PageSourceSearch

https://goexpired.com/assets/Admin-S3LvAwx3.js

js goexpired.com collected 2026-10-09 22:42:35 UTC 657,522 bytes, 297 lines download raw bytes

1import{w as Pe,r as S,c as v0,s as V,j as a,t as Qt,at as x0,y as Se,a7 as Z,Y as Q,B as z,O as be,I as er,au as gn,H as Ju,Z as Ts,$ as Oe,C as Qu,ad as y0,av as Wg,ai as b0,ag as j0,al as w0,ak as wn,aw as _0,ax as N0,aj as Cl,ay as S0,F as Mo,D as br,az as un,i as jr,k as wr,l as _r,m as ti,aA as dn,a4 as O0,b as _n,R as qi,K as A0,aB as ds,aC as Re,aD as Ce,af as M,aE as P0,o as T0,p as E0,q as C0,aF as $0,a0 as Es,aG as Gg,g as k0,E as ed,S as li,aH as M0,J as I0,X as Vi,Q as de,aI as D0,ab as ja,ap as Ki,M as qg,L as Vg,aJ as L0,aK as R0,aL as B0,a6 as F0,aM as U0,a5 as z0}from"./index-DocTL6Xp.js";import{C as q,b as se,c as oe,d as ge,a as K}from"./card-BSfcIW4Y.js";import{S as vn}from"./shield-BEqdegv2.js";import{S as De}from"./skeleton-BQYv2aTe.js";import{U as ft}from"./users-tKFFnZVr.js";import{C as Er}from"./chart-column-CCXSkcEv.js";import{T as td,a as rd,b as fn,c as Tt,d as nd,e as _t}from"./table-DkAu5atY.js";import{S as Gn,a as qn,b as Vn,c as Kn,d as vt}from"./select-bawU9DmT.js";import{D as Cs}from"./download-Bljni_8c.js";import{C as yc}from"./circle-check-big-C9UXHPHU.js";import{C as bc,S as pr}from"./send-Co8yZ4PK.js";import{C as Ef}from"./credit-card-CCgntUPp.js";import{C as Nn}from"./calendar-BwAh82ST.js";import{G as H0}from"./globe-trM-BYBb.js";import{S as Nr}from"./switch-CpL7_qvk.js";import{C as Xn}from"./checkbox-D2alOpbD.js";import{f as ci,C as W0}from"./calendar-CNHSvOdV.js";import{A as Kg,a as G0,b as Xg,c as Yg,d as Zg,e as Jg,f as Qg,g as ev,h as tv}from"./alert-dialog-BL-rbCI7.js";import{T as Cr}from"./trash-2-Bcoczq4e.js";import{I as q0}from"./info-AYzNs3fS.js";import{U as ui}from"./upload-Dbv5oUVA.js";import{C as V0}from"./circle-check-conwmP9q.js";import{H as rv}from"./heart-DohvxikY.js";import{T as K0}from"./trophy-B95nJ3Yv.js";import{B as Cf}from"./book-open-DVrlRLly.js";import"./index-Ds99ek2V.js";import"./chevron-left-DuzCoyNm.js";/**
2 * @license lucide-react v0.462.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const Sr=Pe("Activity",[["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"}]]);/**
7 * @license lucide-react v0.462.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const X0=Pe("Bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]);/**
12 * @license lucide-react v0.462.0 - ISC
13 *
14 * This source code is licensed under the ISC license.
15 * See the LICENSE file in the root directory of this source tree.
16 */const Y0=Pe("ChartPie",[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]]);/**
17 * @license lucide-react v0.462.0 - ISC
18 *
19 * This source code is licensed under the ISC license.
20 * See the LICENSE file in the root directory of this source tree.
21 */const Z0=Pe("CirclePause",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]]);/**
22 * @license lucide-react v0.462.0 - ISC
23 *
24 * This source code is licensed under the ISC license.
25 * See the LICENSE file in the root directory of this source tree.
26 */const J0=Pe("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
27 * @license lucide-react v0.462.0 - ISC
28 *
29 * This source code is licensed under the ISC license.
30 * See the LICENSE file in the root directory of this source tree.
31 */const Gr=Pe("Coins",[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]]);/**
32 * @license lucide-react v0.462.0 - ISC
33 *
34 * This source code is licensed under the ISC license.
35 * See the LICENSE file in the root directory of this source tree.
36 */const Yn=Pe("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
37 * @license lucide-react v0.462.0 - ISC
38 *
39 * This source code is licensed under the ISC license.
40 * See the LICENSE file in the root directory of this source tree.
41 */const Q0=Pe("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
42 * @license lucide-react v0.462.0 - ISC
43 *
44 * This source code is licensed under the ISC license.
45 * See the LICENSE file in the root directory of this source tree.
46 */const ad=Pe("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
47 * @license lucide-react v0.462.0 - ISC
48 *
49 * This source code is licensed under the ISC license.
50 * See the LICENSE file in the root directory of this source tree.
51 */const nv=Pe("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]);/**
52 * @license lucide-react v0.462.0 - ISC
53 *
54 * This source code is licensed under the ISC license.
55 * See the LICENSE file in the root directory of this source tree.
56 */const ej=Pe("FlaskConical",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/**
57 * @license lucide-react v0.462.0 - ISC
58 *
59 * This source code is licensed under the ISC license.
60 * See the LICENSE file in the root directory of this source tree.
61 */const tj=Pe("Gift",[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]]);/**
62 * @license lucide-react v0.462.0 - ISC
63 *
64 * This source code is licensed under the ISC license.
65 * See the LICENSE file in the root directory of this source tree.
66 */const av=Pe("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}
66]]);/**
67 * @license lucide-react v0.462.0 - ISC
68 *
69 * This source code is licensed under the ISC license.
70 * See the LICENSE file in the root directory of this source tree.
71 */const rj=Pe("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
72 * @license lucide-react v0.462.0 - ISC
73 *
74 * This source code is licensed under the ISC license.
75 * See the LICENSE file in the root directory of this source tree.
76 */const nj=Pe("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
77 * @license lucide-react v0.462.0 - ISC
78 *
79 * This source code is licensed under the ISC license.
80 * See the LICENSE file in the root directory of this source tree.
81 */const iv=Pe("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/**
82 * @license lucide-react v0.462.0 - ISC
83 *
84 * This source code is licensed under the ISC license.
85 * See the LICENSE file in the root directory of this source tree.
86 */const aj=Pe("Italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]);/**
87 * @license lucide-react v0.462.0 - ISC
88 *
89 * This source code is licensed under the ISC license.
90 * See the LICENSE file in the root directory of this source tree.
91 */const ij=Pe("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/**
92 * @license lucide-react v0.462.0 - ISC
93 *
94 * This source code is licensed under the ISC license.
95 * See the LICENSE file in the root directory of this source tree.
96 */const sj=Pe("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/**
97 * @license lucide-react v0.462.0 - ISC
98 *
99 * This source code is licensed under the ISC license.
100 * See the LICENSE file in the root directory of this source tree.
101 */const oj=Pe("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);/**
102 * @license lucide-react v0.462.0 - ISC
103 *
104 * This source code is licensed under the ISC license.
105 * See the LICENSE file in the root directory of this source tree.
106 */const $s=Pe("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
107 * @license lucide-react v0.462.0 - ISC
108 *
109 * This source code is licensed under the ISC license.
110 * See the LICENSE file in the root directory of this source tree.
111 */const $f=Pe("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/**
112 * @license lucide-react v0.462.0 - ISC
113 *
114 * This source code is licensed under the ISC license.
115 * See the LICENSE file in the root directory of this source tree.
116 */const Io=Pe("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
117 * @license lucide-react v0.462.0 - ISC
118 *
119 * This source code is licensed under the ISC license.
120 * See the LICENSE file in the root directory of this source tree.
121 */const kf=Pe("Percent",[["line",{x1:"19",x2:"5",y1:"5",y2:"19",key:"1x9vlm"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5",key:"4mh3h7"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5",key:"1mdrzq"}]]);/**
122 * @license lucide-react v0.462.0 - ISC
123 *
124 * This source code is licensed under the ISC license.
125 * See the LICENSE file in the root directory of this source tree.
126 */const qr=Pe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
127 * @license lucide-react v0.462.0 - ISC
128 *
129 * This source code is licensed under the ISC license.
130 * See the LICENSE file in the root directory of this source tree.
131 */const lj=Pe("Redo2",[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]]);/**
132 * @license lucide-react v0.462.0 - ISC
133 *
134 * This source code is licensed under the ISC license.
135 * See the LICENSE file in the root directory of this source tree.
136 */const Zt=Pe("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
137 * @license lucide-react v0.462.0 - ISC
138 *
139 * This source code is licensed under the ISC license.
140 * See the LICENSE file in the root directory of this source tree.
141 */const Do=Pe("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
142 * @license lucide-react v0.462.0 - ISC
143 *
144 * This source code is licensed under the ISC license.
145 * See the LICENSE file in the root directory of this source tree.
146 */const cj=Pe("SlidersVertical",[["line",{x1:"4",x2:"4",y1:"21",y2:"14",key:"1p332r"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3",key:"gb41h5"}],["line",{x1:"12",x2:"12",y1:"21",y2:"12",key:"hf2csr"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3",key:"1kfi7u"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16",key:"1lhrwl"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3",key:"16vvfq"}],["line",{x1:"2",x2:"6",y1:"14",y2:"14",key:"1uebub"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8",key:"1yglbp"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16",key:"1jxqpz"}]]);/**
147 * @license lucide-react v0.462.0 - ISC
148 *
149 * This source code is licensed under the ISC license.
150 * See the LICENSE file in the root directory of this source tree.
151 */const uj=Pe("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
152 * @license lucide-react v0.462.0 - ISC
153 *
154 * This source code is licensed under the ISC license.
155 * See the LICENSE file in the root directory of this source tree.
156 */const jc=Pe("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);/**
157 * @license lucide-react v0.462.0 - ISC
158 *
159 * This source code is licensed under the ISC license.
160 * See the LICENSE file in the root directory of this source tree.
161 */const dj=Pe("Underline",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",ke
161y:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]);/**
162 * @license lucide-react v0.462.0 - ISC
163 *
164 * This source code is licensed under the ISC license.
165 * See the LICENSE file in the root directory of this source tree.
166 */const fj=Pe("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);/**
167 * @license lucide-react v0.462.0 - ISC
168 *
169 * This source code is licensed under the ISC license.
170 * See the LICENSE file in the root directory of this source tree.
171 */const sv=Pe("UserCheck",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]]);/**
172 * @license lucide-react v0.462.0 - ISC
173 *
174 * This source code is licensed under the ISC license.
175 * See the LICENSE file in the root directory of this source tree.
176 */const ov=Pe("UserCog",[["circle",{cx:"18",cy:"15",r:"3",key:"gjjjvw"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M10 15H6a4 4 0 0 0-4 4v2",key:"1nfge6"}],["path",{d:"m21.7 16.4-.9-.3",key:"12j9ji"}],["path",{d:"m15.2 13.9-.9-.3",key:"1fdjdi"}],["path",{d:"m16.6 18.7.3-.9",key:"heedtr"}],["path",{d:"m19.1 12.2.3-.9",key:"1af3ki"}],["path",{d:"m19.6 18.7-.4-1",key:"1x9vze"}],["path",{d:"m16.8 12.3-.4-1",key:"vqeiwj"}],["path",{d:"m14.3 16.6 1-.4",key:"1qlj63"}],["path",{d:"m20.7 13.8 1-.4",key:"1v5t8k"}]]);/**
177 * @license lucide-react v0.462.0 - ISC
178 *
179 * This source code is licensed under the ISC license.
180 * See the LICENSE file in the root directory of this source tree.
181 */const hj=Pe("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]),id=()=>{const[e,t]=S.useState(null),[r,n]=S.useState(!0),[i,s]=S.useState(!1),o=v0();S.useEffect(()=>{V.auth.getSession().then(({data:{session:d}})=>{t((d==null?void 0:d.user)??null),d!=null&&d.user?l(d.user.id):n(!1)});const{data:{subscription:f}}=V.auth.onAuthStateChange((d,h)=>{t((h==null?void 0:h.user)??null),h!=null&&h.user?l(h.user.id):(s(!1),n(!1))});return()=>f.unsubscribe()},[]);const l=async f=>{try{const{data:d,error:h}=await V.rpc("is_admin",{user_uuid:f});if(h){console.error("Error checking admin status:",h),s(!1),o("/");return}const m=d||!1;s(m),m||o("/")}catch(d){console.error("Error checking admin status:",d),s(!1),o("/")}finally{n(!1)}};return{user:e,isLoading:r,isAdmin:i,handleLogin:async(f,d)=>{try{const{error:h}=await V.auth.signInWithPassword({email:f,password:d});if(h)throw h}catch(h){throw new Error(h.message)}},handleLogout:async()=>{await V.auth.signOut(),o("/admin")}}},mj=x0("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Lo=S.forwardRef(({className:e,variant:t,...r},n)=>a.jsx("div",{ref:n,role:"alert",className:Qt(mj({variant:t}),e),...r}));Lo.displayName="Alert";const pj=S.forwardRef(({className:e,...t},r)=>a.jsx("h5",{ref:r,className:Qt("mb-1 font-medium leading-none tracking-tight",e),...t}));pj.displayName="AlertTitle";const Ro=S.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:Qt("text-sm [&_p]:leading-relaxed",e),...t}));Ro.displayName="AlertDescription";const gj=()=>{const[e,t]=S.useState(""),[r,n]=S.useState(""),[i,s]=S.useState(""),[o,l]=S.useState(!1),{handleLogin:c,isLoading:u}=id(),f=async d=>{d.preventDefault(),s(""),l(!0);try{await c(e,r)}catch(h){s(h.message||"Login failed")}finally{l(!1)}};return u?a.jsx("div",{className:"min-h-screen bg-slate-50 flex items-center justify-center",children:a.jsx(Se,{className:"h-8 w-8 animate-spin text-slate-600"})}):a.jsx("div",{className:"min-h-screen bg-slate-50 flex items-center justify-center p-4",children:a.jsxs(q,{className:"w-full max-w-md",children:[a.jsxs(se,{className:"text-center",children:[a.jsx("div",{className:"mx-auto mb-4 w-12 h-12 bg-slate-900 rounded-lg flex items-center justify-center",children:a.jsx(vn,{className:"h-6 w-6 text-white"})}),a.jsx(oe,{className:"text-2xl font-semibold text-slate-900",children:"Admin Dashboard"}),a.jsx(ge,{className:"text-slate-600",children:"Sign in to access the admin panel"})]}),a.jsx(K,{children:a.jsxs("form",{onSubmit:f,className:"space-y-4",children:[i&&a.jsx(Lo,{variant:"destructive",children:a.jsx(Ro,{children:i})}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Z,{htmlFor:"email",className:"text-slate-700",children:"Email"}
181),a.jsx(Q,{id:"email",type:"email",value:e,onChange:d=>t(d.target.value),placeholder:"[email protected]",required:!0,className:"bg-white border-slate-200 focus:border-slate-900"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Z,{htmlFor:"password",className:"text-slate-700",children:"Password"}),a.jsx(Q,{id:"password",type:"password",value:r,onChange:d=>n(d.target.value),required:!0,className:"bg-white border-slate-200 focus:border-slate-900"})]}),a.jsx(z,{type:"submit",className:"w-full bg-slate-900 hover:bg-slate-800 text-white",disabled:o,children:o?a.jsxs(a.Fragment,{children:[a.jsx(Se,{className:"mr-2 h-4 w-4 animate-spin"}),"Signing In..."]}):"Sign In"})]})})]})})},$t=()=>{const[e,t]=S.useState(null),[r,n]=S.useState([]),[i,s]=S.useState([]),[o,l]=S.useState([]),[c,u]=S.useState(!0),[f,d]=S.useState(null),[h,m]=S.useState([]),[v,x]=S.useState(null),[p,w]=S.useState(null),[j,_]=S.useState(null),[y,g]=S.useState([]),[b,N]=S.useState([]),[O,D]=S.useState([]),P=async()=>{try{const{data:A,error:X}=await V.rpc("get_admin_user_stats");if(X)throw X;A&&A.length>0&&t(A[0])}catch(A){console.error("Error fetching user stats:",A),be({title:"Error",description:"Failed to fetch user statistics",variant:"destructive"})}},E=async(A="today")=>{try{const{data:X,error:le}=await V.rpc("get_admin_top_appraisals",{time_period:A,limit_count:10});if(le)throw le;n(X||[])}catch(X){console.error("Error fetching top appraisals:",X),be({title:"Error",description:"Failed to fetch top appraisals",variant:"destructive"})}},$=async()=>{try{const{data:A,error:X}=await V.from("admin_audit_log").select("*").order("created_at",{ascending:!1}).limit(50);if(X)throw X;s(A||[])}catch(A){console.error("Error fetching audit logs:",A)}},I=async()=>{try{const{data:A,error:X}=await V.rpc("get_admin_users");if(X)throw X;l(A||[])}catch(A){console.error("Error fetching users:",A),be({title:"Error",description:"Failed to fetch users",variant:"destructive"})}},L=async(A,X,le=12)=>{var he;try{const{data:J,error:me}=await V.rpc("admin_grant_tokens",{target_user_id:A,tokens_amount:X});if(me)throw me;if(J&&J.length>0&&J[0].success)return be({title:"Success",description:`Granted ${X} tokens to user`}),await I(),await $(),!0;throw new Error(((he=J==null?void 0:J[0])==null?void 0:he.message)||"Failed to grant tokens")}catch(J){return console.error("Error granting tokens:",J),be({title:"Error",description:J.message||"Failed to grant tokens",variant:"destructive"}),!1}},U=async(A,X)=>{var le;try{const{data:he,error:J}=await V.rpc("admin_change_user_tier",{target_user_id:A,new_tier:X});if(J)throw J;if(he&&he.length>0&&he[0].success)return be({title:"Success",description:`Changed user tier to ${X}`}),await I(),await $(),!0;throw new Error(((le=he==null?void 0:he[0])==null?void 0:le.message)||"Failed to change user tier")}catch(he){return console.error("Error changing user tier:",he),be({title:"Error",description:he.message||"Failed to change user tier",variant:"destructive"}),!1}},T=async(A,X)=>{try{const{data:le,error:he}=await V.functions.invoke("admin-cancel-subscription",{body:{userId:A,reason:X}});if(he)throw he;if(le!=null&&le.success)return be({title:"Success",description:"Subscription paused successfully. Payment attempts stopped in Stripe."}),await I(),await $(),!0;throw new Error((le==null?void 0:le.message)||"Failed to pause subscription")}catch(le){return console.error("Error pausing subscription:",le),be({title:"Error",description:le.message||"Failed to pause subscription",variant:"destructive"}),!1}},B=async()=>{try{const{data:A,error:X}=await V.rpc("get_revenue_analytics");if(X)throw X;A&&A.length>0&&d(A[0])}catch(A){console.error("Error fetching revenue analytics:",A),be({title:"Error",description:"Failed to fetch revenue analytics",variant:"destructive"})}},W=async()=>{try{const{data:A,error:X}=await V.rpc("get_monthly_growth_stats");if(X)throw X;m(A||[])}catch(A){console.error("Error fetching monthly growth:",A),be({title:"Error",description:"Failed to fetch monthly growth data",variant:"destructive"})}},ae=async()=>{try{const{data:A,error:X}=await V.rpc("get_token_analytics");if(X)throw X;A&&A.length>0&&x(A[0])}catch(A){console.error("Error fetching token analytics:",A),be({title:"Error",description:"Failed to fetch token analytics",variant:"destructive"})}},F=async()=>{try{const{data:A,error:X}=await V.rpc("get_subscription_metrics");if(X)throw X;A&&A.length>0&&w(A[0])}catch(A){console.error("Error fetching subscription metrics:",A),be({title:"Error",description:"Failed to fetch subscription metrics",variant:"destructive"})}},G=async()=>{var A,X,le;
181try{const{data:he,error:J}=await V.from("user_roles").select("user_id").eq("role","admin");if(J)throw J;const me=(he==null?void 0:he.map(we=>we.user_id))||[];let ve=V.from("user_appraisal_history").select(`
182          domain,
183          appraised_at,
184          user_id
185        `).gte("appraised_at",new Date(Date.now()-30*24*60*60*1e3).toISOString());me.length>0&&(ve=ve.not("user_id","in",`(${me.join(",")})`));const{data:k,error:ne}=await ve;if(ne)throw ne;const{data:Y,error:ue}=await V.from("value_domains").select("domain_name, taken, length, created_at");if(ue)throw ue;console.log("Total appraisal records:",(k==null?void 0:k.length)||0),console.log("Total value domains:",(Y==null?void 0:Y.length)||0),console.log("Sample appraisal domains:",(A=k==null?void 0:k.slice(0,5))==null?void 0:A.map(we=>we.domain)),console.log("Sample value domains:",(X=Y==null?void 0:Y.slice(0,5))==null?void 0:X.map(we=>we.domain_name));const ye=new Set((Y==null?void 0:Y.map(we=>we.domain_name))||[]),Te=(k==null?void 0:k.filter(we=>ye.has(we.domain)))||[];console.log("Filtered daily drops appraisals:",Te.length),console.log("Sample filtered appraisals:",(le=Te.slice(0,5))==null?void 0:le.map(we=>we.domain));const{data:He,error:st}=await V.from("value_domains_progress").select("*").maybeSingle();if(st&&st.code!=="PGRST116")throw st;const jt=new Set(Te.map(we=>we.user_id)).size,mt=new Date;mt.setHours(0,0,0,0);const rr=new Date(mt);rr.setDate(rr.getDate()-1);const Qr=Te.filter(we=>new Date(we.appraised_at)>=mt).length,ur=Te.filter(we=>{const ot=new Date(we.appraised_at);return ot>=rr&&ot<mt}).length,Br=Te.map(we=>we.domain.split(".")[0].length).reduce((we,ot)=>(we[ot]=(we[ot]||0)+1,we),{}),kt=Object.entries(Br).map(([we,ot])=>({length:parseInt(we),count:ot})).sort((we,ot)=>ot.count-we.count).slice(0,5),Ia=Y!=null&&Y.length?Y.reduce((we,ot)=>we+(ot.length||0),0)/Y.length:0,ss=Y!=null&&Y.length?Te.length/Y.length*100:0,os=(Y==null?void 0:Y.filter(we=>!we.taken).length)||0,Da=(Y==null?void 0:Y.filter(we=>we.taken).length)||0,ls={total_appraisals:Te.length,unique_users:jt,processing_sessions:He?1:0,total_domains:(Y==null?void 0:Y.length)||0,available_domains:os,taken_domains:Da,avg_domain_length:Ia,engagement_rate:ss,appraisals_today:Qr,appraisals_yesterday:ur,max_daily_appraisals:Math.max(Qr,ur,1),is_processing:(He==null?void 0:He.status)==="processing"||!1,domain_length_stats:kt};_(ls)}catch(he){console.error("Error fetching daily drops stats:",he),be({title:"Error",description:"Failed to fetch Daily Drops statistics",variant:"destructive"})}},re=async()=>{try{const[A,X,le]=await Promise.all([V.rpc("get_custom_word_stats",{time_period:"today"}),V.rpc("get_custom_word_stats",{time_period:"month"}),V.rpc("get_custom_word_stats",{time_period:"year"})]);if(A.error)throw A.error;if(X.error)throw X.error;if(le.error)throw le.error;g((A.data||[]).map(he=>({...he,word_type:he.word_type}))),N((X.data||[]).map(he=>({...he,word_type:he.word_type}))),D((le.data||[]).map(he=>({...he,word_type:he.word_type})))}catch(A){console.error("Error fetching custom word stats:",A),be({title:"Error",description:"Failed to fetch custom word statistics",variant:"destructive"})}};return S.useEffect(()=>{(async()=>{u(!0),await Promise.all([P(),E(),$(),I(),B(),W(),ae(),F(),G(),re()]),u(!1)})()},[]),{userStats:e,topAppraisals:r,auditLogs:i,users:o,loading:c,fetchUserStats:P,fetchTopAppraisals:A=>E(A),fetchAuditLogs:$,fetchUsers:I,grantTokens:L,changeUserTier:U,pauseSubscription:T,revenueAnalytics:f,monthlyGrowth:h,tokenAnalytics:v,subscriptionMetrics:p,fetchRevenueAnalytics:B,fetchMonthlyGrowth:W,fetchTokenAnalytics:ae,fetchSubscriptionMetrics:F,dailyDropsStats:j,fetchDailyDropsStats:G,customWordsToday:y,customWordsMonth:b,customWordsYear:O,fetchCustomWordStats:re,exportUsersToCSV:async()=>{try{let X=0,le=[],he=!0;for(;he;){const{data:ue,error:ye}=await V.rpc("get_admin_users_with_names",{limit_count:1e3,offset_count:X});if(ye)throw ye;ue&&ue.length>0?(le=[...le,...ue],X+=1e3,he=ue.length===1e3):he=!1}const J=`Name,Email
186`,me=le.map(ue=>{const ye=(ue.display_name||"").replace(/"/g,'""'),Te=(ue.email||"").replace(/"/g,'""');return`"${ye}","${Te}"`}).join(`
187`),ve="\uFEFF"+J+me,k=new Blob([ve],{type:"text/csv;charset=utf-8;"}),ne=URL.createObjectURL(k),Y=document.createElement("a");return Y.href=ne,Y.download=`domaindingo-users-${new Date().toISOString().split("T")[0]}.csv`,document.body.appendChild(Y),Y.click(),document.body.removeChild(Y),URL.revokeObjectURL(ne),console.log(`Exported ${le.length} users to CSV`),{success:!0,count:le.length}}catch(A){return console.error("Error exporting users to CSV:",A),{success:!1,error:A}}},exportProUsersToCSV:async()=>{try{let X=0,le=[],he=!0;for(;he;){const{data:ye,error:Te}=await V.rpc("get_admin_users_with_names",{limit_count:1e3,offset_count:X});if(Te)throw Te;ye&&ye.length>0?(le=[...le,...ye],X+=1e3,he=ye.length===1e3):he=!1}const J=le.filter(ye=>ye.tier==="pro"),me=`Email
188`,ve=J.map(ye=>`"${(ye.email||"").replace(/"/g,'""')}"`).join(`
189`),k="\uFEFF"+me+ve,ne=new Blob([k],{type:"text/csv;charset=utf-8;"}),Y=URL.createObjectURL(ne),ue=document.createElement("a");return ue.href=Y,ue.download=`domaindingo-pro-users-${new Date().toISOString().split("T")[0]}.csv`,document.body.appendChild(ue),ue.click(),document.body.removeChild(ue),URL.revokeObjectURL(Y),console.log(`Exported ${J.length} PRO users to CSV`),{success:!0,count:J.length}}catch(A){return console.error("Error exporting PRO users to CSV:",A),{success:!1,error:A}}}}},vj=()=>{const{userStats:e,loading:t}=$t();if(t)return a.jsxs(q,{className:"bg-white border-slate-200",children:[a.jsx(se,{children:a.jsx(oe,{className:"text-slate-900",children:"System Statistics"})}),a.jsxs(K,{className:"space-y-4",children:[a.jsx(De,{className:"h-4 w-full"}),a.jsx(De,{className:"h-4 w-3/4"}),a.jsx(De,{className:"h-4 w-1/2"})]})]});const r=[{label:"Total Users",value:(e==null?void 0:e.total_users)||0,icon:ft,color:"bg-blue-100 text-blue-800"},{label:"New Today",value:(e==null?void 0:e.last_24h)||0,icon:er,color:"bg-green-100 text-green-800"},{label:"This Week",value:(e==null?void 0:e.last_week)||0,icon:Sr,color:"bg-purple-100 text-purple-800"},{label:"This Month",value:(e==null?void 0:e.last_month)||0,icon:Er,color:"bg-orange-100 text-orange-800"}];return a.jsxs(q,{className:"bg-white border-slate-200",children:[a.jsxs(se,{children:[a.jsx(oe,{className:"text-slate-900",children:"System Statistics"}),a.jsx(ge,{className:"text-slate-600",children:"Real-time user metrics and growth"})]}),a.jsx(K,{children:a.jsx("div",{className:"grid grid-cols-2 gap-4",children:r.map(n=>{const i=n.icon;return a.jsxs("div",{className:"flex items-center space-x-3 p-3 bg-slate-50 rounded-lg",children:[a.jsx("div",{className:`p-2 rounded-md ${n.color}`,children:a.jsx(i,{className:"h-4 w-4"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-slate-600",children:n.label}),a.jsx("p",{className:"text-lg font-bold text-slate-900",children:n.value.toLocaleStr
189ing()})]})]},n.label)})})})]})},xj=()=>{const{topAppraisals:e,loading:t,fetchTopAppraisals:r}=$t(),[n,i]=S.useState("today"),s=l=>{i(l),r(l)},o=[{value:"today",label:"Today"},{value:"week",label:"Week"},{value:"month",label:"Month"}];return t?a.jsxs(q,{className:"bg-white border-slate-200",children:[a.jsx(se,{children:a.jsx(oe,{className:"text-slate-900",children:"Top Domain Appraisals"})}),a.jsx(K,{className:"space-y-4",children:[...Array(5)].map((l,c)=>a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(De,{className:"h-10 w-10 rounded-full"}),a.jsxs("div",{className:"flex-1 space-y-2",children:[a.jsx(De,{className:"h-4 w-full"}),a.jsx(De,{className:"h-3 w-1/2"})]})]},c))})]}):a.jsxs(q,{className:"bg-white border-slate-200",children:[a.jsx(se,{children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx(oe,{className:"text-slate-900",children:"Top Domain Appraisals"}),a.jsx(ge,{className:"text-slate-600",children:"Highest valued domains by period"})]}),a.jsx("div",{className:"flex space-x-1",children:o.map(l=>a.jsx(z,{variant:n===l.value?"default":"outline",size:"sm",onClick:()=>s(l.value),className:n===l.value?"bg-slate-900 hover:bg-slate-800 text-white":"border-slate-200 hover:bg-slate-50",children:l.label},l.value))})]})}),a.jsx(K,{children:e.length===0?a.jsxs("div",{className:"text-center py-8",children:[a.jsx(er,{className:"mx-auto h-12 w-12 text-slate-400"}),a.jsx("p",{className:"mt-2 text-sm text-slate-600",children:"No appraisals found for this period"})]}):a.jsx("div",{className:"space-y-3",children:e.slice(0,10).map((l,c)=>a.jsxs("div",{className:"flex items-center justify-between p-3 bg-slate-50 rounded-lg",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-8 h-8 bg-slate-900 rounded-full flex items-center justify-center text-white text-sm font-bold",children:c+1}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-slate-900",children:l.domain}),a.jsxs("p",{className:"text-xs text-slate-600",children:[l.user_email," • ",gn(new Date(l.appraised_at),{addSuffix:!0})]})]})]}),a.jsx("div",{className:"text-right",children:a.jsxs("div",{className:"flex items-center space-x-1",children:[a.jsx(Ju,{className:"h-4 w-4 text-green-600"}),a.jsx("span",{className:"font-bold text-green-600",children:new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0,maximumFractionDigits:0}).format(Number(l.value))})]})})]},`${l.domain}-${c}`))})})]})},Mf=()=>{var c,u,f,d;const{userStats:e,auditLogs:t,loading:r,revenueAnalytics:n,dailyDropsStats:i}=$t(),s=[{title:"User Management",description:"Manage users and permissions",icon:ft,color:"text-blue-600",bgColor:"bg-blue-100"},{title:"Revenue Analytics",description:"View financial metrics",icon:Gr,color:"text-green-600",bgColor:"bg-green-100"},{title:"Data Management",description:"Monitor domain data",icon:Yn,color:"text-purple-600",bgColor:"bg-purple-100"},{title:"System Settings",description:"Configure platform settings",icon:vn,color:"text-orange-600",bgColor:"bg-orange-100"}],o=[{title:"Total Users",value:r?"-":((c=e==null?void 0:e.total_users)==null?void 0:c.toLocaleString())||"0",change:"+12% from last month",trend:"up",icon:ft,color:"text-blue-600"},{title:"New Users (24h)",value:r?"-":((u=e==null?void 0:e.last_24h)==null?void 0:u.toLocaleString())||"0",change:"Last 24 hours",trend:"neutral",icon:sv,color:"text-green-600"},{title:"Weekly Growth",value:r?"-":((f=e==null?void 0:e.last_week)==null?void 0:f.toLocaleString())||"0",change:"Last 7 days",trend:"up",icon:er,color:"text-purple-600"},{title:"Monthly Growth",value:r?"-":((d=e==null?void 0:e.last_month)==null?void 0:d.toLocaleString())||"0",change:"Last 30 days",trend:"up",icon:Er,color:"text-orange-600"}],l=[{service:"API Services",status:"operational",uptime:"99.9%",icon:Ts},{service:"Database",status:"operational",uptime:"100%",icon:Yn},{service:"Daily Drops",status:i!=null&&i.is_processing?"processing":"operational",uptime:"99.8%",icon:Sr}];return r?a.jsx("div",{className:"space-y-6",children:a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:[...Array(4)].map((h,m)=>a.jsx(q,{children:a.jsxs(K,{className:"p-6",children:[a.jsx(De,{className:"h-8 w-8 rounded mb-4"}),a.jsx(De,{className:"h-4 w-24 mb-2"}),a.jsx(De,{className:"h-6 w-16"})]})},m))})}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center lg:justify-between",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl lg:text-3xl font-bold text-foreground",children:"Admin Dashboard"}),a.jsx("p",{className:"text-muted-foreground mt-1",children:"Welcome back! Here's what's happening with DomainDingo."})]}),a.jsx("div",{className:"flex items-center space-x-2 mt-4 lg:mt-0",children:a.jsxs(Oe,{variant:"secondary",className:"bg-green-100 text-green-800",children:[a.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full mr-2"}),"All Systems Operational"]})})]}),a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:o.map(h=>{const m=h.icon;return a.jsx(q,{className:"hover:shadow-lg transition-shadow",children:a.jsx(K,{className:"p-6",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"p-2 rounded-lg bg-muted mr-4",children:a.jsx(m,{className:`h-5 w-5 ${h.color}`})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:h.title}),a.jsx("p",{className:"text-2xl font-bold text-foreground",children:h.value}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:h.change})]})]})})},h.title)})}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs(q,{children:[a.jsxs(se,{children:[a.jsxs(oe,{className:"flex items-center",children:[a.jsx(vn,{className:"h-5 w-5 mr-2 text-primary"}),"System Health"]}),a.jsx(ge,{children:"Current status of all services"})]}),a.jsx(K,{className:"space-y-4",children:l.map(h=>{const m=h.icon;return a.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-muted/50",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(m,{className:"h-4 w-4 text-muted-foreground"}),a.jsx("span",{className:"font-medium text-foreground",children:h.service})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:h.uptime}),a.jsx(Oe,{variant:h.status==="operational"?"secondary":"outline",className:h.status==="operational"?"bg-green-100 text-green-800":h.status==="processing"?"bg-yellow-100 text-yellow-800":"bg-red-100 text-red-800",children:h.status})]})]},h.service)})})]}),a.jsxs(q,{children:[a.jsxs(se,{children:[a.jsxs(oe,{className:"flex items-center",children:[a.jsx(Qu,{className:"h-5 w-5 mr-2 text-primary"}),"Recent Activity"]}),a.jsx(ge,{children:"Latest administrative actions"})]}),a.jsx(K,{children:t.length===0?a.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[a.jsx(Sr,{className:"mx-auto h-8 w-8 mb-2"}),a.jsx("p",{className:"text-sm",children:"No recent activity"})]}):a.jsx("div",{className:"space-y-3",children:t.slice(0,5).map(h=>a.jsxs("div",{className:"flex items-center space-x-3 p-3 rounded-lg bg-muted/50",children:[a.jsx("div",{className:"flex-shrink-0",children:a.jsx(Sr,{className:"h-4 w-4 text-muted-foreground"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-sm font-medium text-foreground",children:h.action.replace("_"," ").toUpperCase()}),a.jsx("p",{className:"text-xs text-muted-foreground",children:gn(new Date(h.created_at),{addSuffix:!0})})]})]}
vendor: 4,500 bytes, line 189
189,h.id))})})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsx(vj,{}),a.jsx(xj,{})]}),a.jsxs(q,{children:[a.jsxs(se,{children:[a.jsx(oe,{children:"Quick Actions"}),a.jsx(ge,{children:"Frequently used administrative functions"})]}),a.jsx(K,{children:a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:s.map(h=>{const m=h.icon;return a.jsxs("button",{className:"p-4 rounded-lg border border-border hover:bg-muted/50 text-left transition-colors",children:[a.jsx("div",{className:`p-2 rounded-lg ${h.bgColor} w-fit mb-3`,children:a.jsx(m,{className:`h-5 w-5 ${h.color}`})}),a.jsx("h3",{className:"font-medium text-foreground mb-1",children:h.title}),a.jsx("p",{className:"text-sm text-muted-foreground",children:h.description})]},h.title)})})})]})]})};var sd="Tabs",[yj,W9]=y0(sd,[Wg]),lv=Wg(),[bj,od]=yj(sd),cv=S.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:i,defaultValue:s,orientation:o="horizontal",dir:l,activationMode:c="automatic",...u}=e,f=b0(l),[d,h]=j0({prop:n,onChange:i,defaultProp:s});return a.jsx(bj,{scope:r,baseId:w0(),value:d,onValueChange:h,orientation:o,dir:f,activationMode:c,children:a.jsx(wn.div,{dir:f,"data-orientation":o,...u,ref:t})})});cv.displayName=sd;var uv="TabsList",dv=S.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...i}=e,s=od(uv,r),o=lv(r);return a.jsx(_0,{asChild:!0,...o,orientation:s.orientation,dir:s.dir,loop:n,children:a.jsx(wn.div,{role:"tablist","aria-orientation":s.orientation,...i,ref:t})})});dv.displayName=uv;var fv="TabsTrigger",hv=S.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:i=!1,...s}=e,o=od(fv,r),l=lv(r),c=gv(o.baseId,n),u=vv(o.baseId,n),f=n===o.value;return a.jsx(N0,{asChild:!0,...l,focusable:!i,active:f,children:a.jsx(wn.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":u,"data-state":f?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:c,...s,ref:t,onMouseDown:Cl(e.onMouseDown,d=>{!i&&d.button===0&&d.ctrlKey===!1?o.onValueChange(n):d.preventDefault()}),onKeyDown:Cl(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&o.onValueChange(n)}),onFocus:Cl(e.onFocus,()=>{const d=o.activationMode!=="manual";!f&&!i&&d&&o.onValueChange(n)})})})});hv.displayName=fv;var mv="TabsContent",pv=S.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:i,children:s,...o}=e,l=od(mv,r),c=gv(l.baseId,n),u=vv(l.baseId,n),f=n===l.value,d=S.useRef(f);return S.useEffect(()=>{const h=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(h)},[]),a.jsx(S0,{present:i||f,children:({present:h})=>a.jsx(wn.div,{"data-state":f?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!h,id:u,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:h&&s})})});pv.displayName=mv;function gv(e,t){return`${e}-trigger-${t}`}function vv(e,t){return`${e}-content-${t}`}var jj=cv,xv=dv,yv=hv,bv=pv;const Sn=jj,Vr=S.forwardRef(({className:e,...t},r)=>a.jsx(xv,{ref:r,className:Qt("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Vr.displayName=xv.displayName;const Ke=S.forwardRef(({className:e,...t},r)=>a.jsx(yv,{ref:r,className:Qt("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:shadow-sm",e),...t}));Ke.displayName=yv.displayName;const ht=S.forwardRef(({className:e,...t},r)=>a.jsx(bv,{ref:r,className:Qt("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));ht.displayName=bv.displayName;const wj=()=>{const{users:e,loading:t,grantTokens:r,changeUserTier:n,pauseSubscription:i}=$t(),[s,o]=S.useState(""),[l,c]=S.useState(null),[u,f]=S.useState(""),[d,h]=S.useState("12"),[m,v]=S.useState(""),[x,p]=S.useState(""),[w,j]=S.useState(!1),_=e.filter(O=>O.email.toLowerCase().includes(s.toLowerCase())||O.id.toLowerCase().includes(s.toLowerCase())),y=O=>({free:"bg-gray-100 text-gray-800",plus:"bg-blue-100 text-blue-800",pro:"bg-purple-100 text-purple-800",platinum:"bg-yellow-100 text-yellow-800",admin:"bg-red-100 text-red-800"})[O]||"bg-gray-100 text-gray-800",g=async()=>
189{if(!l||!u)return;j(!0),await r(l.id,parseInt(u))&&(f(""),c(null)),j(!1)},b=async()=>{if(!l||!m)return;j(!0),await n(l.id,m)&&(v(""),c(null)),j(!1)},N=async()=>{if(!l)return;j(!0),await i(l.id,x||"Manual admin intervention")&&(p(""),c(null)),j(!1)};return t?a.jsxs(q,{className:"bg-white border-slate-200",children:[a.jsx(se,{children:a.jsx(oe,{className:"text-slate-900",children:"User Management"})}),a.jsx(K,{children:a.jsx("div",{className:"space-y-4",children:[...Array(5)].map((O,D)=>a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsx(De,{className:"h-10 w-10 rounded-full"}),a.jsxs("div",{className:"flex-1 space-y-2",children:[a.jsx(De,{className:"h-4 w-full"}),a.jsx(De,{className:"h-3 w-1/2"})]})]},D))})})]}):a.jsxs(q,{className:"bg-white border-slate-200",children:[a.jsx(se,{children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx(oe,{className:"text-slate-900",children:"User Management"}),a.jsx(ge,{className:"text-slate-600",children:"Manage user accounts, tiers, and tokens"})]}),a.jsx("div",{className:"flex items-center space-x-2",children:a.jsxs("div",{className:"relative",children:[a.jsx(Mo,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-slate-400"}),a.jsx(Q,{placeholder:"Search by email or user ID...",value:s,onChange:O=>o(O.target.value),className:"pl-10 bg-white border-slate-200"})]})})]})}),a.jsx(K,{children:a.jsx("div",{className:"rounded-md border border-slate-200",children:a.jsxs(td,{children:[a.jsx(rd,{children:a.jsxs(fn,{className:"border-slate-200",children:[a.jsx(Tt,{className:"text-slate-600",children:"User"}),a.jsx(Tt,{className:"text-slate-600",children:"Tier"}),a.jsx(Tt,{className:"text-slate-600",children:"Tokens"}),a.jsx(Tt,{className:"text-slate-600",children:"Joined"}),a.jsx(Tt,{className:"text-slate-600",children:"Actions"})]})}),a.jsx(nd,{children:_.map(O=>a.jsxs(fn,{className:"border-slate-200",children:[a.jsx(_t,{children:a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-slate-900",children:O.email}),a.jsxs("p",{className:"text-xs text-slate-500 font-mono",children:[O.id.slice(0,8),"..."]})]})}),a.jsx(_t,{children:a.jsx(Oe,{className:y(O.tier),children:O.tier.toUpperCase()})}),a.jsx(_t,{children:a.jsxs("div",{className:"text-sm",children:[a.jsxs("p",{className:"text-slate-900",children:["Used: ",O.monthly_tokens_used||0]}),a.jsxs("p",{className:"text-slate-600",children:["Extra: ",O.extra_tokens||0]})]})}),a.jsx(_t,{className:"text-slate-600",children:gn(new Date(O.created_at),{addSuffix:!0})}),a.jsx(_t,{children:a.jsxs("div",{className:"flex space-x-2",children:[a.jsxs(br,{children:[a.jsx(un,{asChild:!0,children:a.jsxs(z,{variant:"outline",size:"sm",onClick:()=>c(O),className:"border-slate-200 hover:bg-slate-50",children:[a.jsx(Gr,{className:"h-4 w-4 mr-1"}),"Tokens"]})}),a.jsxs(jr,{className:"bg-white",children:[a.jsxs(wr,{children:[a.jsx(_r,{className:"text-slate-900",children:"Grant Tokens"}),a.jsxs(ti,{className:"text-slate-600",children:["Grant additional tokens to ",l==null?void 0:l.email]})]}),a.jsxs("div",{className:"grid gap-4 py-4",children:[a.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[a.jsx(Z,{htmlFor:"tokens",className:"text-right text-slate-700",children:"Amount"}),a.jsx(Q,{id:"tokens",type:"number",value:u,onChange:D=>f(D.target.value),className:"col-span-3 bg-white border-slate-200",placeholder:"100"})]}),a.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[a.jsx(Z,{htmlFor:"expiry",className:"text-right text-slate-700",children:"Expiry (months)"}),a.jsx(Q,{id:"expiry",type:"number",value:d,onChange:D=>h(D.target.value),className:"col-span-3 bg-white border-slate-200",placeholder:"12"})]})]}),a.jsx(dn,{children:a.jsx(z,{onClick:g,disabled:w||!u,className:"bg-slate-900 hover:bg-slate-800 text-white",children:w?"Granting...":"Grant Tokens"})})]})]}),a.jsxs(br,{children:[a.jsx(un,{asChild:!0,children:a.jsxs(z,{variant:"outline",size:"sm",onClick:()=>c(O),className:"border-slate-200 hover:bg-slate-50",children:[a.jsx(ov,{className:"h-4 w-4 mr-1"}),"Tier"]})}),a.jsxs(jr,{className:"bg-white",children:[a.jsxs(wr,{children:[a.jsx(_r,{className:"text-slate-900",children:"Change User Tier"}),a.jsxs(ti,{className:"text-slate-600",children:["Change tier for ",l==null?void 0:l.email]})]}),a.jsx("div",{className:"grid gap-4 py-4",children:a.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[a.jsx(Z,{htmlFor:"tier",className:"text-right text-slate-700",children:"New Tier"}
189),a.jsxs(Gn,{value:m,onValueChange:v,children:[a.jsx(qn,{className:"col-span-3 bg-white border-slate-200",children:a.jsx(Vn,{placeholder:"Select tier"})}),a.jsxs(Kn,{className:"bg-white",children:[a.jsx(vt,{value:"free",children:"Free"}),a.jsx(vt,{value:"plus",children:"Plus"}),a.jsx(vt,{value:"pro",children:"Pro"}),a.jsx(vt,{value:"platinum",children:"Platinum"}),a.jsx(vt,{value:"admin",children:"Admin"})]})]})]})}),a.jsx(dn,{children:a.jsx(z,{onClick:b,disabled:w||!m,className:"bg-slate-900 hover:bg-slate-800 text-white",children:w?"Updating...":"Update Tier"})})]})]}),(O.tier==="plus"||O.tier==="pro"||O.tier==="platinum")&&a.jsxs(br,{children:[a.jsx(un,{asChild:!0,children:a.jsxs(z,{variant:"outline",size:"sm",onClick:()=>c(O),className:"border-red-200 hover:bg-red-50 text-red-600",children:[a.jsx(Z0,{className:"h-4 w-4 mr-1"}),"Pause"]})}),a.jsxs(jr,{className:"bg-white",children:[a.jsxs(wr,{children:[a.jsx(_r,{className:"text-slate-900",children:"Pause Subscription"}),a.jsxs(ti,{className:"text-slate-600",children:["This will pause the subscription in Stripe and stop all payment attempts for ",l==null?void 0:l.email]})]}),a.jsxs("div",{className:"grid gap-4 py-4",children:[a.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[a.jsx(Z,{htmlFor:"reason",className:"text-right text-slate-700",children:"Reason"}),a.jsx(Q,{id:"reason",value:x,onChange:D=>p(D.target.value),className:"col-span-3 bg-white border-slate-200",placeholder:"e.g., Payment issues, manual intervention"})]}),a.jsxs("div",{className:"col-span-4 text-sm text-slate-600 bg-amber-50 p-3 rounded-md border border-amber-200",children:[a.jsx("p",{className:"font-semibold text-amber-900 mb-1",children:"⚠️ Warning:"}),a.jsx("p",{children:"• User will be downgraded to free tier"}),a.jsx("p",{children:"• Subscription status set to 'paused'"}),a.jsx("p",{children:"• Stripe will stop charging the user"}),a.jsx("p",{children:"• Action will be logged in audit log"})]})]}),a.jsx(dn,{children:a.jsx(z,{onClick:N,disabled:w,className:"bg-red-600 hover:bg-red-700 text-white",children:w?"Pausing...":"Pause Subscription"})})]})]})]})})]},O.id))})]})})})]})},_j=()=>{const{auditLogs:e,loading:t}=$t(),r=s=>{switch(s){case"grant_tokens":return a.jsx(Gr,{className:"h-4 w-4 text-green-600"});case"change_user_tier":return a.jsx(ov,{className:"h-4 w-4 text-blue-600"});default:return a.jsx(Sr,{className:"h-4 w-4 text-slate-600"})}},n=s=>({grant_tokens:"bg-green-100 text-green-800",change_user_tier:"bg-blue-100 text-blue-800",login:"bg-gray-100 text-gray-800",delete_user:"bg-red-100 text-red-800"})[s]||"bg-gray-100 text-gray-800",i=(s,o)=>{if(!o)return"";switch(s){case"grant_tokens":return`${o.tokens_granted} tokens (${o.expiry_months}mo)`;case"change_user_tier":return`${o.old_tier} → ${o.new_tier}`;default:return JSON.stringify(o)}};return t?a.jsxs(q,{className:"bg-white border-slate-200",children:[a.jsx(se,{children:a.jsx(oe,{className:"text-slate-900",children:"Audit Log"})}),a.jsx(K,{children:a.jsx("div",{className:"space-y-4",children:[...Array(10)].map((s,o)=>a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsx(De,{className:"h-8 w-8 rounded"}),a.jsxs("div",{className:"flex-1 space-y-2",children:[a.jsx(De,{className:"h-4 w-full"}),a.jsx(De,{className:"h-3 w-2/3"})]})]},o))})})]}):a.jsxs(q,{className:"bg-white border-slate-200",children:[a.jsxs(se,{children:[a.jsx(oe,{className:"text-slate-900",children:"Audit Log"}),a.jsx(ge,{className:"text-slate-600",children:"Track all administrative actions and changes"})]}),a.jsx(K,{children:e.length===0?a.jsxs("div",{className:"text-center py-8",children:[a.jsx(Sr,{className:"mx-auto h-12 w-12 text-slate-400"}),a.jsx("p",{className:"mt-2 text-sm text-slate-600",children:"No audit logs found"})]}):a.jsx("div",{className:"rounded-md border border-slate-200",children:a.jsxs(td,{children:[a.jsx(rd,{children:a.jsxs(fn,{className:"border-slate-200",children:[a.jsx(Tt,{className:"text-slate-600",children:"Action"}),a.jsx(Tt,{className:"text-slate-600",children:"Admin"}),a.jsx(Tt,{className:"text-slate-600",children:"Target"}),a.jsx(Tt,{className:"text-slate-600",children:"Details"}),a.jsx(Tt,{className:"text-slate-600",children:"Time"})]})}),a.jsx(nd,{children:e.map(s=>a.jsxs(fn,{className:"border-slate-200",children:[a.jsx(_t,{children:a.jsxs("div",{className:"flex items-center space-x-2",children:[r(s.action),a.jsx(Oe,{className:n(s.action),children:s.action.replace("_"," ").toUpperCase()})]})}),a.jsx(_t,{children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(O0,{className:"h-4 w-4 text-slate-400"}),a.jsxs("span",{className:"text-sm text-slate-600 font-mono",children:[s.admin_user_id.slice(0,8),"..."]})]})}),a.jsx(_t,{children:s.target_user_id?a.jsxs("span",{className:"text-sm text-slate-600 font-mono",children:[s.target_user_id.slice(0,8),"..."]}):a.jsx("span",{className:"text-sm text-slate-400",children:"-"})}),a.jsx(_t,{className:"text-sm text-slate-600",children:i(s.action,s.details)}),a.jsx(_t,{className:"text-sm text-slate-600",children:gn(new Date(s.created_at),{addSuffix:!0})})]},s.id))})]})})})]})},Nj=()=>{var j,_,y;const{users:e,userStats:t,loading:r,exportUsersToCSV:n,exportProUsersToCSV:i}=$t(),{toast:s}=_n(),o=qi(),[l,c]=S.useState(""),[u,f]=S.useState("all"),[d,h]=S.useState(!1),[m,v]=S.useState(!1);e.filter(g=>{const b=g.email.toLowerCase().includes(l.toLowerCase()),N=u==="all"||g.tier===u;return b&&N});const x={free:e.filter(g=>g.tier==="free").length,plus:e.filter(g=>g.tier==="plus").length,pro:e.filter(g=>g.tier==="pro").length,platinum:e.filter(g=>g.tier==="platinum").length},p=e.sort((g,b)=>new Date(b.created_at).getTime()-new Date(g.created_at).getTime()).slice(0,5),w=g=>({free:"bg-gray-100 text-gray-800",plus:"bg-blue-100 text-blue-800",pro:"bg-purple-100 text-purple-800",platinum:"bg-yellow-100 text-yellow-800"})[g]||"bg-gray-100 text-gray-800";return r?a.jsx("div",{className:"space-y-6",children:a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[...Array(4)].map((g,b)=>a.jsx(q,{children:a.jsxs(K,{className:"p-6",children:[a.jsx(De,{className:"h-8 w-8 rounded mb-4"}),a.jsx(De,{className:"h-4 w-24 mb-2"}),a.jsx(De,{className:"h-6 w-16"})]})},b))})}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center lg:justify-between",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl lg:text-3xl font-bold text-foreground",children:"User Management"}),a.jsx("p",{className:"text-muted-foreground mt-1",children:"Manage users, permissions, and audit logs"})]}),a.jsxs("div",{className:"flex items-center space-x-2 mt-4 lg:mt-0",children:[a.jsxs(z,{variant:"outline",size:"sm",onClick:async()=>{v(!0);const g=await i();v(!1),g.success?s({title:"Success",description:`Exported ${g.count} PRO user emails to CSV`}):s({title:"Error",description:"Failed to export PRO users",variant:"destructive"})},disabled:m,className:"border-purple-300 text-purple-700 hover:bg-purple-50",children:[a.jsx(Cs,{className:"h-4 w-4 mr-2"}),m?"Exporting...":"Export PRO Emails"]}
189),a.jsxs(z,{variant:"outline",size:"sm",onClick:async()=>{h(!0);const g=await n();h(!1),g.success?s({title:"Success",description:`Exported ${g.count} users to CSV successfully`}):s({title:"Error",description:"Failed to export users",variant:"destructive"})},disabled:d,children:[a.jsx(Cs,{className:"h-4 w-4 mr-2"}),d?"Exporting...":"Export Users"]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[a.jsx(q,{children:a.jsx(K,{className:"p-6",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"p-2 rounded-lg bg-blue-100 mr-4",children:a.jsx(ft,{className:"h-5 w-5 text-blue-600"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Total Users"}),a.jsx("p",{className:"text-2xl font-bold text-foreground",children:((j=t==null?void 0:t.total_users)==null?void 0:j.toLocaleString())||"0"})]})]})})}),a.jsx(q,{children:a.jsx(K,{className:"p-6",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"p-2 rounded-lg bg-green-100 mr-4",children:a.jsx(hj,{className:"h-5 w-5 text-green-600"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"New (24h)"}),a.jsx("p",{className:"text-2xl font-bold text-foreground",children:((_=t==null?void 0:t.last_24h)==null?void 0:_.toLocaleString())||"0"})]})]})})}),a.jsx(q,{children:a.jsx(K,{className:"p-6",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"p-2 rounded-lg bg-purple-100 mr-4",children:a.jsx(er,{className:"h-5 w-5 text-purple-600"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Growth (7d)"}),a.jsx("p",{className:"text-2xl font-bold text-foreground",children:((y=t==null?void 0:t.last_week)==null?void 0:y.toLocaleString())||"0"})]})]})})}),a.jsx(q,{children:a.jsx(K,{className:"p-6",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"p-2 rounded-lg bg-orange-100 mr-4",children:a.jsx(sv,{className:"h-5 w-5 text-orange-600"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Paid Users"}),a.jsx("p",{className:"text-2xl font-bold text-foreground",children:(x.plus+x.pro+x.platinum).toLocaleString()})]})]})})})]}),a.jsxs(q,{children:[a.jsxs(se,{children:[a.jsx(oe,{children:"User Tier Distribution"}),a.jsx(ge,{children:"Breakdown of users by subscription tier"})]}),a.jsx(K,{children:a.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:Object.entries(x).map(([g,b])=>a.jsxs("div",{className:"text-center p-4 rounded-lg bg-muted/50",children:[a.jsx("div",{className:`inline-flex px-3 py-1 rounded-full text-sm font-medium mb-2 ${w(g)}`,children:g.charAt(0).toUpperCase()+g.slice(1)}),a.jsx("p",{className:"text-2xl font-bold text-foreground",children:b.toLocaleString()}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.length>0?Math.round(b/e.length*100):0,"% of total"]})]},g))})})]}),o&&a.jsxs(q,{children:[a.jsxs(se,{children:[a.jsx(oe,{children:"Recent Users"}),a.jsx(ge,{children:"Latest user registrations"})]}),a.jsx(K,{children:a.jsx("div",{className:"space-y-3",children:p.map(g=>a.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-muted/50",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:g.email}),a.jsx("p",{className:"text-xs text-muted-foreground",children:gn(new Date(g.created_at),{addSuffix:!0})})]}),a.jsx(Oe,{className:w(g.tier),children:g.tier})]},g.id))})})]}),a.jsxs(Sn,{defaultValue:"management",className:"space-y-6",children:[a.jsxs(Vr,{className:"grid w-full grid-cols-2",children:[a.jsxs(Ke,{value:"management",className:"flex items-center",children:[a.jsx(ft,{className:"h-4 w-4 mr-2"}),!o&&"User"," Management"]}),a.jsxs(Ke,{value:"audit",className:"flex items-center",children:[a.jsx(Qu,{className:"h-4 w-4 mr-2"}),!o&&"Audit"," Log"]})]}),a.jsx(ht,{value:"management",className:"space-y-6",children:a.jsx(wj,{})}),a.jsx(ht,{value:"audit",className:"space-y-6",children:a.jsx(_j,{})})]})]})};function Sj(e,t=[]){let r=[];function n(s,o){const l=S.createContext(o),c=r.length;r=[...r,o];function u(d){const{scope:h,children:m,...v}=d,x=(h==null?void 0:h[e][c])||l,p=S.useMemo(()=>v,Object.values(v));return a.jsx(x.Provider,{value:p,children:m})}function f(d,h){const m=(h==null?void 0:h[e][c])||l,v=S.useContext(m);if(v)return v;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${s}\``)}return u.displayName=s+"Provider",[u,f]}const i=()=>{const s=r.map(o=>S.createContext(o));return function(l){const c=(l==null?void 0:l[e])||s;return S.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return i.scopeName=e,[n,Oj(i,...t)]}function Oj(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(i=>({useScope:i(),scopeName:i.scopeName}));
189return function(s){const o=n.reduce((l,{useScope:c,scopeName:u})=>{const d=c(s)[`__scope${u}`];return{...l,...d}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}var ld="Progress",cd=100,[Aj,G9]=Sj(ld),[Pj,Tj]=Aj(ld),jv=S.forwardRef((e,t)=>{const{__scopeProgress:r,value:n=null,max:i,getValueLabel:s=Ej,...o}=e;(i||i===0)&&!If(i)&&console.error(Cj(`${i}`,"Progress"));const l=If(i)?i:cd;n!==null&&!Df(n,l)&&console.error($j(`${n}`,"Progress"));const c=Df(n,l)?n:null,u=ks(c)?s(c,l):void 0;return a.jsx(Pj,{scope:r,value:c,max:l,children:a.jsx(wn.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":ks(c)?c:void 0,"aria-valuetext":u,role:"progressbar","data-state":Nv(c,l),"data-value":c??void 0,"data-max":l,...o,ref:t})})});jv.displayName=ld;var wv="ProgressIndicator",_v=S.forwardRef((e,t)=>{const{__scopeProgress:r,...n}=e,i=Tj(wv,r);return a.jsx(wn.div,{"data-state":Nv(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...n,ref:t})});_v.displayName=wv;function Ej(e,t){return`${Math.round(e/t*100)}%`}function Nv(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function ks(e){return typeof e=="number"}function If(e){return ks(e)&&!isNaN(e)&&e>0}function Df(e,t){return ks(e)&&!isNaN(e)&&e<=t&&e>=0}function Cj(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${cd}\`.`}function $j(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
190  - a positive number
191  - less than the value passed to \`max\` (or ${cd} if no \`max\` prop is set)
192  - \`null\` or \`undefined\` if the progress is indeterminate.
193
194Defaulting to \`null\`.`}var Sv=jv,kj=_v;const gr=S.forwardRef(({className:e,value:t,...r},n)=>a.jsx(Sv,{ref:n,className:Qt("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...r,children:a.jsx(kj,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));gr.displayName=Sv.displayName;const Mj=()=>{var s,o;const{revenueAnalytics:e,monthlyGrowth:t,tokenAnalytics:r,subscriptionMetrics:n,loading:i}=$t();return t[t.length-1],a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[a.jsx(q,{className:"bg-white border-slate-200",children:a.jsx(K,{className:"p-6",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx(Ju,{className:"h-8 w-8 text-green-600"}),a.jsxs("div",{className:"ml-4",children:[a.jsx("p",{className:"text-sm font-medium text-slate-600",children:"Estimated MRR"}),a.jsx("p",{className:"text-2xl font-bold text-slate-900",children:i?"-":`$${((s=e==null?void 0:e.estimated_mrr)==null?void 0:s.toFixed(2))||"0.00"}`})]})]})})}),a.jsx(q,{className:"bg-white border-slate-200",children:a.jsx(K,{className:"p-6",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx(er,{className:"h-8 w-8 text-blue-600"}),a.jsxs("div",{className:"ml-4",children:[a.jsx("p",{className:"text-sm font-medium text-slate-600",children:"Conversion Rate"}),a.jsx("p",{className:"text-2xl font-bold text-slate-900",children:i?"-":`${(e==null?void 0:e.conversion_rate)||0}%`})]})]})})}),a.jsx(q,{className:"bg-white border-slate-200",children:a.jsx(K,{className:"p-6",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx(Gr,{className:"h-8 w-8 text-orange-600"}),a.jsxs("div",{className:"ml-4",children:[a.jsx("p",{className:"text-sm font-medium text-slate-600",children:"Token Revenue"}),a.jsx("p",{className:"text-2xl font-bold text-slate-900",children:i?"-":`$${((o=r==null?void 0:r.total_revenue_estimate)==null?void 0:o.toFixed(2))||"0.00"}`})]})]})})}),a.jsx(q,{className:"bg-white border-slate-200",children:a.jsx(K,{className:"p-6",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx(ft,{className:"h-8 w-8 text-purple-600"}),a.jsxs("div",{className:"ml-4",children:[a.jsx("p",{className:"text-sm font-medium text-slate-600",children:"Active Subs"}),a.jsx("p",{className:"text-2xl font-bold text-slate-900",children:i?"-":(n==null?void 0:n.active_subscriptions)||0})]})]})})})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs(q,{className:"bg-white border-slate-200",children:[a.jsxs(se,{children:[a.jsxs(oe,{className:"flex items-center text-gray-900",children:[a.jsx(Y0,{className:"h-5 w-5 mr-2"}),"User Tier Distribution"]}),a.jsx(ge,{className:"text-gray-600",children:"Breakdown of users by subscription tier"})]}),a.jsx(K,{children:!i&&e?a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"w-3 h-3 bg-slate-400 rounded mr-2"}),a.jsx("span",{className:"text-sm font-medium text-gray-900",children:"Free"})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("span",{className:"text-sm font-bold text-gray-900",children:e.free_users.toLocaleStr
194ing()}),a.jsxs("span",{className:"text-xs text-gray-600 ml-1",children:["(",(e.free_users/e.total_users*100).toFixed(1),"%)"]})]})]}),a.jsx(gr,{value:e.free_users/e.total_users*100,className:"h-2"})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"w-3 h-3 bg-blue-500 rounded mr-2"}),a.jsx("span",{className:"text-sm font-medium text-gray-900",children:"Plus"})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("span",{className:"text-sm font-bold text-gray-900",children:e.plus_users.toLocaleString()}),a.jsxs("span",{className:"text-xs text-gray-600 ml-1",children:["(",(e.plus_users/e.total_users*100).toFixed(1),"%)"]})]})]}),a.jsx(gr,{value:e.plus_users/e.total_users*100,className:"h-2"})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"w-3 h-3 bg-green-500 rounded mr-2"}),a.jsx("span",{className:"text-sm font-medium text-gray-900",children:"Pro"})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("span",{className:"text-sm font-bold text-gray-900",children:e.pro_users.toLocaleString()}),a.jsxs("span",{className:"text-xs text-gray-600 ml-1",children:["(",(e.pro_users/e.total_users*100).toFixed(1),"%)"]})]})]}),a.jsx(gr,{value:e.pro_users/e.total_users*100,className:"h-2"})]})]}):a.jsx("div",{className:"text-center py-8 text-slate-500",children:"Loading..."})})]}),a.jsxs(q,{className:"bg-white border-slate-200",children:[a.jsxs(se,{children:[a.jsxs(oe,{className:"flex items-center text-gray-900",children:[a.jsx(Er,{className:"h-5 w-5 mr-2"}),"Monthly Growth"]}),a.jsx(ge,{className:"text-gray-600",children:"New users and conversions over time"})]}),a.jsx(K,{children:!i&&t.length>0?a.jsx("div",{className:"space-y-4",children:t.slice(-6).map(l=>a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-sm font-medium text-gray-900",children:l.month_year}),a.jsxs("div",{className:"text-right",children:[a.jsxs("div",{className:"text-sm font-bold text-gray-900",children:[l.new_users," new users"]}),a.jsxs("div",{className:"text-xs text-gray-600",children:[l.new_paid_users," paid (",l.conversion_rate,"%)"]})]})]}),a.jsxs("div",{className:"flex space-x-2",children:[a.jsx("div",{className:"flex-1",children:a.jsx(gr,{value:100,className:"h-2"})}),a.jsx("div",{className:"w-16",children:a.jsx(gr,{value:l.conversion_rate,className:"h-2"})})]})]},l.month_year))}):a.jsx("div",{className:"text-center py-8 text-slate-500",children:"Loading..."})})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs(q,{className:"bg-white border-slate-200",children:[a.jsxs(se,{children:[a.jsxs(oe,{className:"flex items-center text-gray-900",children:[a.jsx(Gr,{className:"h-5 w-5 mr-2"}),"Token Sales Analytics"]}),a.jsx(ge,{className:"text-gray-600",children:"Token purchase metrics and revenue"})]}),a.jsx(K,{children:!i&&r?a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"text-center p-4 bg-slate-50 rounded-lg",children:[a.jsx("div",{className:"text-2xl font-bold text-slate-900",children:r.total_token_purchases}),a.jsx("div",{className:"text-sm text-slate-600",children:"Total Purchases"})]}),a.jsxs("div",{className:"text-center p-4 bg-slate-50 rounded-lg",children:[a.jsx("div",{className:"text-2xl font-bold text-slate-900",children:r.total_tokens_sold.toLocaleString()}),a.jsx("div",{className:"text-sm text-slate-600",children:"Tokens Sold"})]}),a.jsxs("div",{className:"text-center p-4 bg-slate-50 rounded-lg",children:[a.jsx("div",{className:"text-2xl font-bold text-slate-900",children:r.avg_tokens_per_purchase.toFixed(0)}),a.jsx("div",{className:"text-sm text-slate-600",children:"Avg per Purchase"})]}),a.jsxs("div",{className:"text-center p-4 bg-slate-50 rounded-lg",children:[a.jsx("div",{className:"text-2xl font-bold text-slate-900",children:r.recent_purchases}),a.jsx("div",{className:"text-sm text-slate-600",children:"This Month"})]})]}):a.jsx("div",{className:"text-center py-8 text-slate-500",children:"Loading..."})})]}),a.jsxs(q,{className:"bg-white border-slate-200",children:[a.jsxs(se,{children:[a.jsxs(oe,{className:"flex items-center text-gray-900",children:[a.jsx(ft,{className:"h-5 w-5 mr-2"}),"Subscription Health"]}),a.jsx(ge,{className:"text-gray-600",children:"Active subscriptions and churn metrics"})]}),a.jsx(K,{children:!i&&n?a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 bg-slate-50 rounded-lg",children:[a.jsx("span",{className:"text-sm font-medium",children:"PRO Subscriptions"}),a.jsx(Oe,{variant:"default",children:n.pro_subscriptions})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 bg-slate-50 rounded-lg",children:[a.jsx("span",{className:"text-sm font-medium",children:"PLUS Subscriptions"}),a.jsx(Oe,{variant:"secondary",children:n.plus_subscriptions})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 bg-slate-50 rounded-lg",children:[a.jsx("span",{className:"text-sm font-medium",children:"Est. Monthly Churn"}),a.jsxs(Oe,{variant:n.estimated_monthly_churn>5?"destructive":"default",children:[n.estimated_monthly_churn.toFixed(1),"%"]})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 bg-slate-50 rounded-lg",children:[a.jsx("span",{className:"text-sm font-medium",children:"Avg. Subscription Age"}),a.jsxs(Oe,{variant:"outline",children:[n.avg_subscription_age_days.toFixed(0)," days"]})]})]}):a.jsx("div",{className:"text-center py-8 text-slate-500",children:"Loading..."})})]})]})]})},Ij=()=>{var E,$,I,L,U;const[e,t]=S.useState(""),[r,n]=S.useState("canceled"),[i,s]=S.useState(!0),[o,l]=S.useState(!1),[c,u]=S.useState(!1),[f,d]=S.useState(!1),[h,m]=S.useState(null),[v,x]=S.useState([]),[p,w]=S.useState([]),[j,_]=S.useState([]),{toast:y}=_n(),g=async()=>
194{if(!e.trim()){y({title:"Error",description:"Please enter an email address",variant:"destructive"});return}l(!0);try{const{data:T,error:B}=await V.rpc("admin_fix_subscription_status",{target_email:e.trim(),new_status:r,clear_stripe_data:i});if(B)throw B;const W=T==null?void 0:T[0];if(W!=null&&W.success)y({title:"Success",description:W.message}),t(""),await D();else throw new Error((W==null?void 0:W.message)||"Failed to fix subscription")}catch(T){console.error("Error fixing subscription:",T),y({title:"Error",description:T.message||"Failed to fix subscription status",variant:"destructive"})}finally{l(!1)}},b=async()=>{var T;d(!0),m(null);try{const{data:B,error:W}=await V.functions.invoke("fix-subscription-tokens");if(W)throw W;m(B),((T=B==null?void 0:B.results)==null?void 0:T.tokens_reset)>0?y({title:"Success",description:`Reset tokens for ${B.results.tokens_reset} users out of ${B.results.total_checked} checked.`}):y({title:"No Issues Found",description:"All subscription tokens are correctly reset."}),await D()}catch(B){console.error("Error fixing subscription tokens:",B),y({title:"Error",description:B.message||"Failed to fix subscription tokens",variant:"destructive"})}finally{d(!1)}},N=async()=>{u(!0);try{const{data:T,error:B}=await V.rpc("sync_stripe_subscription_status");if(B)throw B;x(T||[]),(T==null?void 0:T.length)>0?y({title:"Issues Found",description:`Found ${T.length} subscription inconsistencies that need review.`}):y({title:"All Clear",description:"No subscription inconsistencies found."})}catch(T){console.error("Error checking sync status:",T),y({title:"Error",description:T.message||"Failed to check subscription sync status",variant:"destructive"})}finally{u(!1)}},O=async()=>{try{const{data:T,error:B}=await V.from("webhook_failures").select("*").order("created_at",{ascending:!1}).limit(20);if(B)throw B;w(T||[])}catch(T){console.error("Error loading webhook failures:",T)}},D=async()=>{try{const{data:T,error:B}=await V.from("subscription_audit_log").select("*").order("created_at",{ascending:!1}).limit(50);if(B)throw B;_(T||[])}catch(T){console.error("Error loading audit logs:",T)}};S.useEffect(()=>{O(),D()},[]);const P=T=>{switch(T){case"active":return"default";case"canceled":return"secondary";case"past_due":return"destructive";case"incomplete_expired":return"destructive";case"incomplete":return"outline";default:return"outline"}};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-2xl font-bold",children:"Subscription Management"}),a.jsx("p",{className:"text-muted-foreground",children:"Manage and fix subscription inconsistencies"})]}),a.jsxs(z,{onClick:N,disabled:c,children:[c?a.jsx(Zt,{className:"w-4 h-4 mr-2 animate-spin"}):a.jsx(Mo,{className:"w-4 h-4 mr-2"}),"Check Sync Status"]})]}),a.jsxs(q,{className:"border-blue-200 dark:border-blue-900",children:[a.jsxs(se,{children:[a.jsxs(oe,{className:"flex items-center gap-2 text-blue-700 dark:text-blue-400",children:[a.jsx(Zt,{className:"w-5 h-5"}),"Fix Subscription Token Reset"]}),a.jsx(ge,{children:"Reset tokens for users whose tokens weren't properly reset during subscription renewal"})]}),a.jsxs(K,{className:"space-y-4",children:[a.jsx(Lo,{children:a.jsxs(Ro,{children:["This will check all paying users and reset tokens for those where ",a.jsx("code",{children:"current_period_start"})," is newer than ",a.jsx("code",{children:"monthly_reset_date"}),". Safe to run - only affects users who should have had tokens reset but didn't due to webhook failures."]})}),a.jsx(z,{onClick:b,disabled:f,className:"w-full",size:"lg",children:f?a.jsxs(a.Fragment,{children:[a.jsx(Zt,{className:"w-4 h-4 mr-2 animate-spin"}),"Running Token Reset..."]}):a.jsxs(a.Fragment,{children:[a.jsx(yc,{className:"w-4 h-4 mr-2"}),"Run Token Reset for All Users"]})}),h&&a.jsxs("div",{className:"mt-4 p-4 border rounded-lg bg-muted/50",children:[a.jsx("h4",{className:"font-semibold mb-3",children:"Results:"}),a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-4",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Total Checked"}),a.jsx("p",{className:"text-2xl font-bold",children:((E=h.results)==null?void 0:E.total_checked)||0})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Tokens Reset"}),a.jsx("p",{className:"text-2xl font-bold text-green-600",children:(($=h.results)==null?void 0:$.tokens_reset)||0})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Skipped"}),a.jsx("p",{className:"text-2xl font-bold text-blue-600",children:((I=h.results)==null?void 0:I.skipped)||0})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Errors"}),a.jsx("p",{className:"text-2xl font-bold text-red-600",children:((L=h.results)==null?void 0:L.errors)||0})]})]}),((U=h.results)==null?void 0:U.users_processed)&&h.results.users_processed.length>0&&a.jsxs("div",{className:"mt-4",children:[a.jsx("h5",{className:"font-semibold mb-2 text-sm",children:"Processed Users:"}),a.jsx("div",{className:"space-y-2 max-h-60 overflow-y-auto",children:h.results.users_processed.map((T,B)=>a.jsxs("div",{className:"text-xs p-2 border rounded bg-background",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"font-mono",children:T.user_id}),a.jsx(Oe,{variant:T.action==="tokens_reset"?"default":T.action==="error"?"destructive":"secondary",children:T.action})]}),T.reason&&a.jsx("p",{className:"text-muted-foreground mt-1",children:T.reason}),T.action==="tokens_reset"&&a.jsxs("div",{className:"mt-1 text-muted-foreground",children:[a.jsxs("span",{children:["Reset: ",T.old_monthly_tokens_used," → ",T.new_monthly_tokens_used," tokens"]}),a.jsxs("span",{className:"ml-2",children:["Date: ",T.old_monthly_reset_date," → ",T.new_monthly_reset_date]})]})]},B))})]})]})]})]}),a.jsxs(q,{children:[a.jsxs(se,{children:[a.jsxs(oe,{className:"flex items-center gap-2",children:[a.jsx(A0,{className:"w-5 h-5"}),"Manual Subscription Fix"]}),a.jsx(ge,{children:"Manually update a user's subscription status when webhooks fail"})]}),a.jsxs(K,{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsxs("div",{children:[a.jsx(Z,{htmlFor:"email",children:"User Email"}
194),a.jsx(Q,{id:"email",type:"email",value:e,onChange:T=>t(T.target.value),placeholder:"[email protected]"})]}),a.jsxs("div",{children:[a.jsx(Z,{htmlFor:"status",children:"New Status"}),a.jsxs("select",{id:"status",value:r,onChange:T=>n(T.target.value),className:"w-full px-3 py-2 border rounded-md",children:[a.jsx("option",{value:"canceled",children:"Canceled"}),a.jsx("option",{value:"active",children:"Active"}),a.jsx("option",{value:"incomplete",children:"Incomplete"}),a.jsx("option",{value:"incomplete_expired",children:"Incomplete Expired"}),a.jsx("option",{value:"past_due",children:"Past Due"})]})]}),a.jsx("div",{className:"flex items-end",children:a.jsxs(z,{onClick:g,disabled:o,className:"w-full",children:[o?a.jsx(Zt,{className:"w-4 h-4 mr-2 animate-spin"}):a.jsx(yc,{className:"w-4 h-4 mr-2"}),"Fix Subscription"]})})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"checkbox",id:"clearStripeData",checked:i,onChange:T=>s(T.target.checked)}),a.jsx(Z,{htmlFor:"clearStripeData",children:"Clear Stripe subscription data"})]})]})]}),v.length>0&&a.jsxs(q,{children:[a.jsxs(se,{children:[a.jsxs(oe,{className:"flex items-center gap-2",children:[a.jsx(bc,{className:"w-5 h-5 text-destructive"}),"Subscription Inconsistencies (",v.length,")"]}),a.jsx(ge,{children:"Users with subscription status that may need review"})]}),a.jsx(K,{children:a.jsx("div",{className:"space-y-3",children:v.map((T,B)=>a.jsxs("div",{className:"flex items-center justify-between p-3 border rounded-lg",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"font-medium",children:T.user_email}),a.jsx(Oe,{variant:P(T.old_status),children:T.old_status}),a.jsx("span",{className:"text-muted-foreground",children:"→"}),a.jsx(Oe,{variant:"outline",children:T.new_status})]}),a.jsx(z,{size:"sm",variant:"outline",onClick:()=>t(T.user_email),children:"Fix"})]},B))})})]}),p.length>0&&a.jsxs(q,{children:[a.jsxs(se,{children:[a.jsxs(oe,{className:"flex items-center gap-2",children:[a.jsx(Qu,{className:"w-5 h-5 text-warning"}),"Recent Webhook Failures (",p.length,")"]}),a.jsx(ge,{children:"Webhook events that failed to process correctly"})]}),a.jsx(K,{children:a.jsx("div",{className:"space-y-3",children:p.map(T=>a.jsxs("div",{className:"p-3 border rounded-lg",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Oe,{variant:"destructive",children:T.event_type}),a.jsxs("span",{className:"text-sm text-muted-foreground",children:["Retries: ",T.retry_count]})]}),a.jsx("span",{className:"text-sm text-muted-foreground",children:new Date(T.created_at).toLocaleString()})]}),T.customer_email&&a.jsx("p",{className:"text-sm font-medium mb-1",children:T.customer_email}),a.jsx("p",{className:"text-sm text-muted-foreground",children:T.failure_reason})]},T.id))})})]}),a.jsxs(q,{children:[a.jsxs(se,{children:[a.jsx(oe,{children:"Recent Subscription Changes"}),a.jsx(ge,{children:"Audit trail of subscription status changes"})]}),a.jsx(K,{children:a.jsx("div",{className:"space-y-3",children:j.slice(0,10).map(T=>a.jsxs("div",{className:"flex items-center justify-between p-3 border rounded-lg",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Oe,{variant:"outline",children:T.change_source}),a.jsxs("div",{className:"text-sm",children:[T.old_status&&T.new_status&&a.jsxs("span",{children:[T.old_status," → ",T.new_status]}),T.old_tier&&T.new_tier&&T.old_tier!==T.new_tier&&a.jsxs("span",{className:"ml-2 text-muted-foreground",children:["(",T.old_tier," → ",T.new_tier,")"]})]})]}),a.jsx("span",{className:"text-sm text-muted-foreground",children:new Date(T.created_at).toLocaleString()})]},T.id))})})]})]})},Dj=()=>{var l,c,u,f,d,h,m,v;const{revenueAnalytics:e,subscriptionMetrics:t,tokenAnalytics:r,loading:n}=$t(),i=qi(),s=[{title:"Estimated MRR",value:n?"-":`$${((l=e==null?void 0:e.estimated_mrr)==null?void 0:l.toFixed(2))||"0.00"}`,change:"+15% from last month",trend:"up",icon:Ju,color:"text-green-600",bgColor:"bg-green-100"},{title:"Active Subscriptions",value:n?"-":((c=t==null?void 0:t.active_subscriptions)==null?void 0:c.toLocaleStr
194ing())||"0",change:`${(t==null?void 0:t.pro_subscriptions)||0} Pro, ${(t==null?void 0:t.plus_subscriptions)||0} Plus`,trend:"up",icon:ft,color:"text-blue-600",bgColor:"bg-blue-100"},{title:"Conversion Rate",value:n?"-":`${((u=e==null?void 0:e.conversion_rate)==null?void 0:u.toFixed(1))||"0.0"}%`,change:"Free to paid conversion",trend:"up",icon:kf,color:"text-purple-600",bgColor:"bg-purple-100"},{title:"Token Revenue",value:n?"-":`$${((f=r==null?void 0:r.total_revenue_estimate)==null?void 0:f.toFixed(2))||"0.00"}`,change:`${(r==null?void 0:r.recent_purchases)||0} recent purchases`,trend:"neutral",icon:Gr,color:"text-orange-600",bgColor:"bg-orange-100"}],o=[{label:"Pro Users",value:(t==null?void 0:t.pro_subscriptions)||0,color:"bg-purple-500",percentage:t!=null&&t.active_subscriptions?Math.round(t.pro_subscriptions/t.active_subscriptions*100):0},{label:"Plus Users",value:(t==null?void 0:t.plus_subscriptions)||0,color:"bg-blue-500",percentage:t!=null&&t.active_subscriptions?Math.round(t.plus_subscriptions/t.active_subscriptions*100):0}];return n?a.jsx("div",{className:"space-y-6",children:a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[...Array(4)].map((x,p)=>a.jsx(q,{children:a.jsxs(K,{className:"p-6",children:[a.jsx(De,{className:"h-8 w-8 rounded mb-4"}),a.jsx(De,{className:"h-4 w-24 mb-2"}),a.jsx(De,{className:"h-6 w-16"})]})},p))})}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center lg:justify-between",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl lg:text-3xl font-bold text-foreground",children:"Revenue Analytics"}),a.jsx("p",{className:"text-muted-foreground mt-1",children:"Financial metrics and subscription analytics"})]}),a.jsx("div",{className:"flex items-center space-x-2 mt-4 lg:mt-0",children:a.jsxs(Oe,{variant:"secondary",className:"bg-green-100 text-green-800",children:[a.jsx(er,{className:"h-3 w-3 mr-1"}),"Growing"]})})]}),a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:s.map(x=>{const p=x.icon;return a.jsx(q,{className:"hover:shadow-lg transition-shadow",children:a.jsx(K,{className:"p-6",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:`p-2 rounded-lg ${x.bgColor} mr-4`,children:a.jsx(p,{className:`h-5 w-5 ${x.color}`})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:x.title}),a.jsx("p",{className:"text-2xl font-bold text-foreground",children:x.value}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:x.change})]})]})})},x.title)})}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs(q,{children:[a.jsxs(se,{children:[a.jsxs(oe,{className:"flex items-center",children:[a.jsx(Ef,{className:"h-5 w-5 mr-2 text-primary"}),"Subscription Breakdown"]}),a.jsx(ge,{children:"Distribution of active subscriptions"})]}),a.jsx(K,{children:a.jsx("div",{className:"space-y-4",children:o.map(x=>a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-sm font-medium text-foreground",children:x.label}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:x.value}),a.jsxs("span",{className:"text-sm font-medium text-foreground",children:[x.percentage,"%"]})]})]}),a.jsx("div",{className:"w-full bg-muted rounded-full h-2",children:a.jsx("div",{className:`${x.color} h-2 rounded-full transition-all duration-300`,style:{width:`${x.percentage}%`}})})]},x.label))})})]}),a.jsxs(q,{children:[a.jsxs(se,{children:[a.jsxs(oe,{className:"flex items-center",children:[a.jsx(Er,{className:"h-5 w-5 mr-2 text-primary"}),"Key Metrics"]}),a.jsx(ge,{children:"Important financial indicators"})]}),a.jsx(K,{children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-muted/50",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(kf,{className:"h-4 w-4 text-muted-foreground"}),a.jsx("span",{className:"font-medium text-foreground",children:"Monthly Churn"})]}),a.jsxs("span",{className:"text-sm font-bold text-foreground",children:[((d=t==null?void 0:t.estimated_monthly_churn)==null?void 0:d.toFixed(1))||"0.0","%"]})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-muted/50",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Nn,{className:"h-4 w-4 text-muted-foreground"}),a.jsx("span",{className:"font-medium text-foreground",children:"Avg. Subscription Age"})]}),a.jsxs("span",{className:"text-sm font-bold text-foreground",children:[((h=t==null?void 0:t.avg_subscription_age_days)==null?void 0:h.toFixed(0))||"0"," days"]})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-muted/50",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Gr,{className:"h-4 w-4 text-muted-foreground"}),a.jsx("span",{className:"font-medium text-foreground",children:"Avg. Tokens/Purchase"})]}),a.jsx("span",{className:"text-sm font-bold text-foreground",children:((m=r==null?void 0:r.avg_tokens_per_purchase)==null?void 0:m.toFixed(0))||"0"})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-muted/50",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(ft,{className:"h-4 w-4 text-muted-foreground"}),a.jsx("span",{className:"font-medium text-foreground",children:"Free Users"})]}),a.jsx("span",{className:"text-sm font-bold text-foreground",children:((v=e==null?void 0:e.free_users)==null?void 0:v.toLocaleStr
vendor: 6,047 bytes, line 194
194ing())||"0"})]})]})})]})]}),a.jsxs(Sn,{defaultValue:"analytics",className:"space-y-6",children:[a.jsxs(Vr,{className:"grid w-full grid-cols-2",children:[a.jsxs(Ke,{value:"analytics",className:"flex items-center",children:[a.jsx(Er,{className:"h-4 w-4 mr-2"}),!i&&"Revenue"," Analytics"]}),a.jsxs(Ke,{value:"subscriptions",className:"flex items-center",children:[a.jsx(Ef,{className:"h-4 w-4 mr-2"}),!i&&"Subscription"," Management"]})]}),a.jsx(ht,{value:"analytics",className:"space-y-6",children:a.jsx(Mj,{})}),a.jsx(ht,{value:"subscriptions",className:"space-y-6",children:a.jsx(Ij,{})})]})]})};var Lj=Array.isArray,St=Lj,Rj=typeof ds=="object"&&ds&&ds.Object===Object&&ds,Ov=Rj,Bj=Ov,Fj=typeof self=="object"&&self&&self.Object===Object&&self,Uj=Bj||Fj||Function("return this")(),cr=Uj,zj=cr,Hj=zj.Symbol,Xi=Hj,Lf=Xi,Av=Object.prototype,Wj=Av.hasOwnProperty,Gj=Av.toString,Ra=Lf?Lf.toStringTag:void 0;function qj(e){var t=Wj.call(e,Ra),r=e[Ra];try{e[Ra]=void 0;var n=!0}catch{}var i=Gj.call(e);return n&&(t?e[Ra]=r:delete e[Ra]),i}var Vj=qj,Kj=Object.prototype,Xj=Kj.toString;function Yj(e){return Xj.call(e)}var Zj=Yj,Rf=Xi,Jj=Vj,Qj=Zj,ew="[object Null]",tw="[object Undefined]",Bf=Rf?Rf.toStringTag:void 0;function rw(e){return e==null?e===void 0?tw:ew:Bf&&Bf in Object(e)?Jj(e):Qj(e)}var Dr=rw;function nw(e){return e!=null&&typeof e=="object"}var Lr=nw,aw=Dr,iw=Lr,sw="[object Symbol]";function ow(e){return typeof e=="symbol"||iw(e)&&aw(e)==sw}var wa=ow,lw=St,cw=wa,uw=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,dw=/^\w*$/;function fw(e,t){if(lw(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||cw(e)?!0:dw.test(e)||!uw.test(e)||t!=null&&e in Object(t)}var ud=fw;function hw(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Kr=hw;const _a=Re(Kr);var mw=Dr,pw=Kr,gw="[object AsyncFunction]",vw="[object Function]",xw="[object GeneratorFunction]",yw="[object Proxy]";function bw(e){if(!pw(e))return!1;var t=mw(e);return t==vw||t==xw||t==gw||t==yw}var dd=bw;const Ne=Re(dd);var jw=cr,ww=jw["__core-js_shared__"],_w=ww,$l=_w,Ff=function(){var e=/[^.]+$/.exec($l&&$l.keys&&$l.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Nw(e){return!!Ff&&Ff in e}var Sw=Nw,Ow=Function.prototype,Aw=Ow.toString;function Pw(e){if(e!=null){try{return Aw.call(e)}catch{}try{return e+""}catch{}}return""}var Pv=Pw,Tw=dd,Ew=Sw,Cw=Kr,$w=Pv,kw=/[\\^$.*+?()[\]{}|]/g,Mw=/^\[object .+?Constructor\]$/,Iw=Function.prototype,Dw=Object.prototype,Lw=Iw.toString,Rw=Dw.hasOwnProperty,Bw=RegExp("^"+Lw.call(Rw).replace(kw,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Fw(e){if(!Cw(e)||Ew(e))return!1;var t=Tw(e)?Bw:Mw;return t.test($w(e))}var Uw=Fw;function zw(e,t){return e==null?void 0:e[t]}var Hw=zw,Ww=Uw,Gw=Hw;function qw(e,t){var r=Gw(e,t);return Ww(r)?r:void 0}var On=qw,Vw=On,Kw=Vw(Object,"create"),Bo=Kw,Uf=Bo;function Xw(){this.__data__=Uf?Uf(null):{},this.size=0}var Yw=Xw;function Zw(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Jw=Zw,Qw=Bo,e1="__lodash_hash_undefined__",t1=Object.prototype,r1=t1.hasOwnProperty;function n1(e){var t=this.__data__;if(Qw){var r=t[e];return r===e1?void 0:r}return r1.call(t,e)?t[e]:void 0}var a1=n1,i1=Bo,s1=Object.prototype,o1=s1.hasOwnProperty;function l1(e){var t=this.__data__;return i1?t[e]!==void 0:o1.call(t,e)}var c1=l1,u1=Bo,d1="__lodash_hash_undefined__";function f1(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=u1&&t===void 0?d1:t,this}var h1=f1,m1=Yw,p1=Jw,g1=a1,v1=c1,x1=h1;function Na(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Na.prototype.clear=m1;Na.prototype.delete=p1;Na.prototype.get=g1;Na.prototype.has=v1;Na.prototype.set=x1;var y1=Na;function b1(){this.__data__=[],this.size=0}var j1=b1;function w1(e,t){return e===t||e!==e&&t!==t}var fd=w1,_1=fd;function N1(e,t){for(var r=e.length;r--;)if(_1(e[r][0],t))return r;return-1}var Fo=N1,S1=Fo,O1=Array.prototype,A1=O1.splice;function P1(e){var t=this.__data__,r=S1(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():A1.call(t,r,1),--this.size,!0}var T1=P1,E1=Fo;function C1(e){var t=this.__data__,r=E1(t,e);return r<0?void 0:t[r][1]}var $1=C1,k1=Fo;function M1(e){return k1(this.__data__,e)>-1}var I1=M1,D1=Fo;function L1(e,t){var r=this.__data__,n=D1(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var R1=L1,B1=j1,F1=T1,U1=$1,z1=I1,H1=R1;function Sa(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Sa.prototype.clear=B1;Sa.prototype.delete=F1;Sa.prototype.get=U1;Sa.prototype.has=z1;Sa.prototype.set=H1;var Uo=Sa,W1=On,G1=cr,q1=W1(G1,"Map"),hd=q1,zf=y1,V1=Uo,K1=hd;function X1(){this.size=0,this.__data__={hash:new zf,map:new(K1||V1),string:new zf}}var Y1=X1;function Z1(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var J1=Z1,Q1=J1;function e_(e,t){var r=e.__data__;return Q1(t)?r[typeof t=="string"?"string":"hash"]:r.map}var zo=e_,t_=zo;function r_(e){var t=t_(this,e).delete(e);return this.size-=t?1:0,t}var n_=r_,a_=zo;function i_(e){return a_(this,e).get(e)}var s_=i_,o_=zo;function l_(e){return o_(this,e).has(e)}var c_=l_,u_=zo;function d_(e,t){var r=u_(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var f_=d_,h_=Y1,m_=n_,p_=s_,g_=c_,v_=f_;function Oa(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Oa.prototype.clear=h_;Oa.prototype.delete=m_;Oa.prototype.get=p_;Oa.prototype.has=g_;Oa.prototype.set=v_;var md=Oa,Tv=md,x_="Expected a function";function pd(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(x_);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],s=r.cache;if(s.has(i))return s.get(i);var o=e.apply(this,n);return r.cache=s.set(i,o)||s,o};return r.cache=new(pd.Cache||Tv),r}pd.Cache=Tv;var Ev=pd;const y_=Re(Ev);var b_=Ev,j_=500;function w_(e){var t=b_(e,function(n){return r.size===j_&&r.clear(),n}
vendor: 6,448 bytes, lines 194-202
194),r=t.cache;return t}var __=w_,N_=__,S_=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,O_=/\\(\\)?/g,A_=N_(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(S_,function(r,n,i,s){t.push(i?s.replace(O_,"$1"):n||r)}),t}),P_=A_;function T_(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var gd=T_,Hf=Xi,E_=gd,C_=St,$_=wa,k_=1/0,Wf=Hf?Hf.prototype:void 0,Gf=Wf?Wf.toString:void 0;function Cv(e){if(typeof e=="string")return e;if(C_(e))return E_(e,Cv)+"";if($_(e))return Gf?Gf.call(e):"";var t=e+"";return t=="0"&&1/e==-k_?"-0":t}var M_=Cv,I_=M_;function D_(e){return e==null?"":I_(e)}var $v=D_,L_=St,R_=ud,B_=P_,F_=$v;function U_(e,t){return L_(e)?e:R_(e,t)?[e]:B_(F_(e))}var kv=U_,z_=wa,H_=1/0;function W_(e){if(typeof e=="string"||z_(e))return e;var t=e+"";return t=="0"&&1/e==-H_?"-0":t}var Ho=W_,G_=kv,q_=Ho;function V_(e,t){t=G_(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[q_(t[r++])];return r&&r==n?e:void 0}var vd=V_,K_=vd;function X_(e,t,r){var n=e==null?void 0:K_(e,t);return n===void 0?r:n}var Mv=X_;const Rt=Re(Mv);function Y_(e){return e==null}var Z_=Y_;const Ae=Re(Z_);var J_=Dr,Q_=St,eN=Lr,tN="[object String]";function rN(e){return typeof e=="string"||!Q_(e)&&eN(e)&&J_(e)==tN}var nN=rN;const Yi=Re(nN);var Iv={exports:{}},ke={};/**
195 * @license React
196 * react-is.production.min.js
197 *
198 * Copyright (c) Facebook, Inc. and its affiliates.
199 *
200 * This source code is licensed under the MIT license found in the
201 * LICENSE file in the root directory of this source tree.
202 */var xd=Symbol.for("react.element"),yd=Symbol.for("react.portal"),Wo=Symbol.for("react.fragment"),Go=Symbol.for("react.strict_mode"),qo=Symbol.for("react.profiler"),Vo=Symbol.for("react.provider"),Ko=Symbol.for("react.context"),aN=Symbol.for("react.server_context"),Xo=Symbol.for("react.forward_ref"),Yo=Symbol.for("react.suspense"),Zo=Symbol.for("react.suspense_list"),Jo=Symbol.for("react.memo"),Qo=Symbol.for("react.lazy"),iN=Symbol.for("react.offscreen"),Dv;Dv=Symbol.for("react.module.reference");function zt(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case xd:switch(e=e.type,e){case Wo:case qo:case Go:case Yo:case Zo:return e;default:switch(e=e&&e.$$typeof,e){case aN:case Ko:case Xo:case Qo:case Jo:case Vo:return e;default:return t}}case yd:return t}}}ke.ContextConsumer=Ko;ke.ContextProvider=Vo;ke.Element=xd;ke.ForwardRef=Xo;ke.Fragment=Wo;ke.Lazy=Qo;ke.Memo=Jo;ke.Portal=yd;ke.Profiler=qo;ke.StrictMode=Go;ke.Suspense=Yo;ke.SuspenseList=Zo;ke.isAsyncMode=function(){return!1};ke.isConcurrentMode=function(){return!1};ke.isContextConsumer=function(e){return zt(e)===Ko};ke.isContextProvider=function(e){return zt(e)===Vo};ke.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===xd};ke.isForwardRef=function(e){return zt(e)===Xo};ke.isFragment=function(e){return zt(e)===Wo};ke.isLazy=function(e){return zt(e)===Qo};ke.isMemo=function(e){return zt(e)===Jo};ke.isPortal=function(e){return zt(e)===yd};ke.isProfiler=function(e){return zt(e)===qo};ke.isStrictMode=function(e){return zt(e)===Go};ke.isSuspense=function(e){return zt(e)===Yo};ke.isSuspenseList=function(e){return zt(e)===Zo};ke.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Wo||e===qo||e===Go||e===Yo||e===Zo||e===iN||typeof e=="object"&&e!==null&&(e.$$typeof===Qo||e.$$typeof===Jo||e.$$typeof===Vo||e.$$typeof===Ko||e.$$typeof===Xo||e.$$typeof===Dv||e.getModuleId!==void 0)};ke.typeOf=zt;Iv.exports=ke;var Lv=Iv.exports,sN=Dr,oN=Lr,lN="[object Number]";function cN(e){return typeof e=="number"||oN(e)&&sN(e)==lN}var Rv=cN;const uN=Re(Rv);var dN=Rv;function fN(e){return dN(e)&&e!=+e}var hN=fN;const Zi=Re(hN);var Jt=function(t){return t===0?0:t>0?1:-1},sn=function(t){return Yi(t)&&t.indexOf("%")===t.length-1},ie=function(t){return uN(t)&&!Zi(t)},Qe=function(t){return ie(t)||Yi(t)},mN=0,Ji=function(t){var r=++mN;return"".concat(t||"").concat(r)},xn=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!ie(t)&&!Yi(t))return n;var s;if(sn(t)){var o=t.indexOf("%");s=r*parseFloat(t.slice(0,o))/100}else s=+t;return Zi(s)&&(s=n),i&&s>r&&(s=r),s},Ur=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},pN=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},i=0;i<r;i++)if(!n[t[i]])n[t[i]]=!0;else return!0;return!1},Xt=function(t,r){return ie(t)&&ie(r)?function(n){return t+n*(r-t)}:function(){return r}};function Ms(e,t,r){return!e||!e.length?null:e.find(function(n){return n&&(typeof t=="function"?t(n):Rt(n,t))===r})}function Un(e,t){for(var r in e)if({}.hasOwnProperty.call(e,r)&&(!{}.hasOwnProperty.call(t,r)||e[r]!==t[r]))return!1;for(var n in t)if({}.hasOwnProperty.call(t,n)&&!{}.hasOwnProperty.call(e,n))return!1;return!0}function wc(e){"@babel/helpers - typeof";return wc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wc(e)}var gN=["viewBox","children"],vN=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRen
202dering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],qf=["points","pathLength"],kl={svg:gN,polygon:qf,polyline:qf},bd=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDrag
202Capture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],Is=function(t,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var n=t;if(S.isValidElement(t)&&(n=t.props),!_a(n))return null;var i={};return Object.keys(n).forEach(function(s){bd.includes(s)&&(i[s]=r||function(o){return n[s](n,o)})}),i},xN=function(t,r,n){return function(i){return t(r,n,i),null}},Ds=function(t,r,n){if(!_a(t)||wc(t)!=="object")return null;var i=null;return Object.keys(t).forEach(function(s){var o=t[s];bd.includes(s)&&typeof o=="function"&&(i||(i={}),i[s]=xN(o,r,n))}),i},yN=["children"],bN=["children"];function Vf(e,t){if(e==null)return{};var r=jN(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function jN(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function _c(e){"@babel/helpers - typeof";return _c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_c(e)}var Kf={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"},Or=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},Xf=null,Ml=null,jd=function e(t){if(t===Xf&&Array.isArray(Ml))return Ml;var r=[];return S.Children.forEach(t,function(n){Ae(n)||(Lv.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),Ml=r,Xf=t,r};function Bt(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(i){return Or(i)}):n=[Or(t)],jd(e).forEach(function(i){var s=Rt(i,"type.displayName")||Rt(i,"type.name");n.indexOf(s)!==-1&&r.push(i)}),r}function Pt(e,t){var r=Bt(e,t);return r&&r[0]}var Yf=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,i=r.height;return!(!ie(n)||n<=0||!ie(i)||i<=0)},wN=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],_N=function(t){return t&&t.type&&Yi(t.type)&&wN.indexOf(t.type)>=0},NN=function(t){return t&&_c(t)==="object"&&"clipDot"in t},SN=function(t,r,n,i){var s,o=(s=kl==null?void 0:kl[i])!==null&&s!==void 0?s:[];return!Ne(t)&&(i&&o.includes(r)||vN.includes(r))||n&&bd.includes(r)},Ee=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(S.isValidElement(t)&&(i=t.props),!_a(i))return null;var s={};
202return Object.keys(i).forEach(function(o){var l;SN((l=i)===null||l===void 0?void 0:l[o],o,r,n)&&(s[o]=i[o])}),s},Nc=function e(t,r){if(t===r)return!0;var n=S.Children.count(t);if(n!==S.Children.count(r))return!1;if(n===0)return!0;if(n===1)return Zf(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var i=0;i<n;i++){var s=t[i],o=r[i];if(Array.isArray(s)||Array.isArray(o)){if(!e(s,o))return!1}else if(!Zf(s,o))return!1}return!0},Zf=function(t,r){if(Ae(t)&&Ae(r))return!0;if(!Ae(t)&&!Ae(r)){var n=t.props||{},i=n.children,s=Vf(n,yN),o=r.props||{},l=o.children,c=Vf(o,bN);return i&&l?Un(s,c)&&Nc(i,l):!i&&!l?Un(s,c):!1}return!1},Jf=function(t,r){var n=[],i={};return jd(t).forEach(function(s,o){if(_N(s))n.push(s);else if(s){var l=Or(s.type),c=r[l]||{},u=c.handler,f=c.once;if(u&&(!f||!i[l])){var d=u(s,l,o);n.push(d),i[l]=!0}}}),n},ON=function(t){var r=t&&t.type;return r&&Kf[r]?Kf[r]:null},AN=function(t,r){return jd(r).indexOf(t)},PN=["children","width","height","viewBox","className","style","title","desc"];function Sc(){return Sc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Sc.apply(this,arguments)}function TN(e,t){if(e==null)return{};var r=EN(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function EN(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Oc(e){var t=e.children,r=e.width,n=e.height,i=e.viewBox,s=e.className,o=e.style,l=e.title,c=e.desc,u=TN(e,PN),f=i||{width:r,height:n,x:0,y:0},d=Ce("recharts-surface",s);return M.createElement("svg",Sc({},Ee(u,!0,"svg"),{className:d,width:r,height:n,style:o,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height)}),M.createElement("title",null,l),M.createElement("desc",null,c),t)}var CN=["children","className"];function Ac(){return Ac=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ac.apply(this,arguments)}function $N(e,t){if(e==null)return{};var r=kN(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function kN(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Ge=M.forwardRef(function(e,t){var r=e.children,n=e.className,i=$N(e,CN),s=Ce("recharts-layer",n);return M.createElement("g",Ac({className:s},Ee(i,!0),{ref:t}),r)}),Ar=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),s=2;s<n;s++)i[s-2]=arguments[s]};function MN(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),r=r>i?i:r,r<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var s=Array(i);++n<i;)s[n]=e[n+t];return s}var IN=MN,DN=IN;function LN(e,t,r){var n=e.length;return r=r===void 0?n:r,!t&&r>=n?e:DN(e,t,r)}var RN=LN,BN="\\ud800-\\udfff",FN="\\u0300-\\u036f",UN="\\ufe20-\\ufe2f",zN="\\u20d0-\\u20ff",HN=FN+UN+zN,WN="\\ufe0e\\ufe0f",GN="\\u200d",qN=RegExp("["+GN+BN+HN+WN+"]");function VN(e){return qN.test(e)}var Bv=VN;function KN(e){return e.split("")}var XN=KN,Fv="\\ud800-\\udfff",YN="\\u0300-\\u036f",ZN="\\ufe20-\\ufe2f",JN="\\u20d0-\\u20ff",QN=YN+ZN+JN,eS="\\ufe0e\\ufe0f",tS="["+Fv+"]",Pc="["+QN+"]",Tc="\\ud83c[\\udffb-\\udfff]",rS="(?:"+Pc+"|"+Tc+")",Uv="[^"+Fv+"]",zv="(?:\\ud83c[\\udde6-\\uddff]){2}",Hv="[\\ud800-\\udbff][\\udc00-\\udfff]",nS="\\u200d",Wv=rS+"?",Gv="["+eS+"]?",aS="(?:"+nS+"(?:"+[Uv,zv,Hv].join("|")+")"+Gv+Wv+")*",iS=Gv+Wv+aS,sS="(?:"+[Uv+Pc+"?",Pc,zv,Hv,tS].join("|")+")",oS=RegExp(Tc+"(?="+Tc+")|"+sS+iS,"g");function lS(e){return e.match(oS)||[]}var cS=lS,uS=XN,dS=Bv,fS=cS;function hS(e){return dS(e)?fS(e):uS(e)}var mS=hS,pS=RN,gS=Bv,vS=mS,xS=$v;function yS(e){return function(t){t=xS(t);var r=gS(t)?vS(t):void 0,n=r?r[0]:t.charAt(0),i=r?pS(r,1).join(""):t.slice(1);return n[e]()+i}}var bS=yS,jS=bS,wS=jS("toUpperCase"),_S=wS;const el=Re(_S);function Le(e){return function(){return e}}const qv=Math.cos,Ls=Math.sin,tr=Math.sqrt,Rs=Math.PI,tl=2*Rs,Ec=Math.PI,Cc=2*Ec,rn=1e-6,NS=Cc-rn;function Vv(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function SS(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Vv;const r=10**t;return function(n){this._+=n[0];for(let i=1,s=n.length;i<s;++i)this._+=Math.round(arguments[i]*r)/r+n[i]}}class OS{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Vv:SS(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,n,i){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(t,r,n,i,s,o){this._append`C${+t},${+r},${+n}
202,${+i},${this._x1=+s},${this._y1=+o}`}arcTo(t,r,n,i,s){if(t=+t,r=+r,n=+n,i=+i,s=+s,s<0)throw new Error(`negative radius: ${s}`);let o=this._x1,l=this._y1,c=n-t,u=i-r,f=o-t,d=l-r,h=f*f+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(h>rn)if(!(Math.abs(d*c-u*f)>rn)||!s)this._append`L${this._x1=t},${this._y1=r}`;else{let m=n-o,v=i-l,x=c*c+u*u,p=m*m+v*v,w=Math.sqrt(x),j=Math.sqrt(h),_=s*Math.tan((Ec-Math.acos((x+h-p)/(2*w*j)))/2),y=_/j,g=_/w;Math.abs(y-1)>rn&&this._append`L${t+y*f},${r+y*d}`,this._append`A${s},${s},0,0,${+(d*m>f*v)},${this._x1=t+g*c},${this._y1=r+g*u}`}}arc(t,r,n,i,s,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let l=n*Math.cos(i),c=n*Math.sin(i),u=t+l,f=r+c,d=1^o,h=o?i-s:s-i;this._x1===null?this._append`M${u},${f}`:(Math.abs(this._x1-u)>rn||Math.abs(this._y1-f)>rn)&&this._append`L${u},${f}`,n&&(h<0&&(h=h%Cc+Cc),h>NS?this._append`A${n},${n},0,1,${d},${t-l},${r-c}A${n},${n},0,1,${d},${this._x1=u},${this._y1=f}`:h>rn&&this._append`A${n},${n},0,${+(h>=Ec)},${d},${this._x1=t+n*Math.cos(s)},${this._y1=r+n*Math.sin(s)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function wd(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new OS(t)}function _d(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Kv(e){this._context=e}Kv.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 rl(e){return new Kv(e)}function Xv(e){return e[0]}function Yv(e){return e[1]}function Zv(e,t){var r=Le(!0),n=null,i=rl,s=null,o=wd(l);e=typeof e=="function"?e:e===void 0?Xv:Le(e),t=typeof t=="function"?t:t===void 0?Yv:Le(t);function l(c){var u,f=(c=_d(c)).length,d,h=!1,m;for(n==null&&(s=i(m=o())),u=0;u<=f;++u)!(u<f&&r(d=c[u],u,c))===h&&((h=!h)?s.lineStart():s.lineEnd()),h&&s.point(+e(d,u,c),+t(d,u,c));if(m)return s=null,m+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:Le(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:Le(+c),l):t},l.defined=function(c){return arguments.length?(r=typeof c=="function"?c:Le(!!c),l):r},l.curve=function(c){return arguments.length?(i=c,n!=null&&(s=i(n)),l):i},l.context=function(c){return arguments.length?(c==null?n=s=null:s=i(n=c),l):n},l}function fs(e,t,r){var n=null,i=Le(!0),s=null,o=rl,l=null,c=wd(u);e=typeof e=="function"?e:e===void 0?Xv:Le(+e),t=typeof t=="function"?t:Le(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?Yv:Le(+r);function u(d){var h,m,v,x=(d=_d(d)).length,p,w=!1,j,_=new Array(x),y=new Array(x);for(s==null&&(l=o(j=c())),h=0;h<=x;++h){if(!(h<x&&i(p=d[h],h,d))===w)if(w=!w)m=h,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),v=h-1;v>=m;--v)l.point(_[v],y[v]);l.lineEnd(),l.areaEnd()}w&&(_[h]=+e(p,h,d),y[h]=+t(p,h,d),l.point(n?+n(p,h,d):_[h],r?+r(p,h,d):y[h]))}if(j)return l=null,j+""||null}function f(){return Zv().defined(i).curve(o).context(s)}return u.x=function(d){return arguments.length?(e=typeof d=="function"?d:Le(+d),n=null,u):e},u.x0=function(d){return arguments.length?(e=typeof d=="function"?d:Le(+d),u):e},u.x1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:Le(+d),u):n},u.y=function(d){return arguments.length?(t=typeof d=="function"?d:Le(+d),r=null,u):t},u.y0=function(d){return arguments.length?(t=typeof d=="function"?d:Le(+d),u):t},u.y1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:Le(+d),u):r},u.lineX0=u.lineY0=function(){return f().x(e).y(t)},u.lineY1=function(){return f().x(e).y(r)},u.lineX1=function(){return f().x(n).y(t)},u.defined=function(d){return arguments.length?(i=typeof d=="function"?d:Le(!!d),u):i},u.curve=function(d){return arguments.length?(o=d,s!=null&&(l=o(s)),u):o},u.context=function(d){return arguments.length?(d==null?s=l=null:l=o(s=d),u):s},u}class Jv{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function AS(e){return new Jv(e,!0)}function PS(e){return new Jv(e,!1)}const Nd={draw(e,t){const r=tr(t/Rs);e.moveTo(r,0),e.arc(0,0,r,0,tl)}},TS={draw(e,t){const r=tr(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},Qv=tr(1/3),ES=Qv*2,CS={draw(e,t){const r=tr(t/ES),n=r*Qv;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},$S={draw(e,t){const r=tr(t),n=-r/2;e.rect(n,n,r,r)}},kS=.8908130915292852,ex=Ls(Rs/10)/Ls(7*Rs/10),MS=Ls(tl/10)*ex,IS=-qv(tl/10)*ex,DS={draw(e,t){const r=tr(t*kS),n=MS*r,i=IS*r;e.moveTo(0,-r),e.lineTo(n,i);for(let s=1;s<5;++s){const o=tl*s/5,l=qv(o),c=Ls(o);e.lineTo(c*r,-l*r),e.lineTo(l*n-c*i,c*n+l*i)}e.closePath()}},Il=tr(3),LS={draw(e,t){const r=-tr(t/(Il*3));e.moveTo(0,r*2),e.lineTo(-Il*r,-r),e.lineTo(Il*r,-r),e.closePath()}},Mt=-.5,It=tr(3)/2,$c=1/tr(12),RS=($c/2+1)*3,BS={draw(e,t){const r=tr(t/RS),n=r/2,i=r*$c,s=n,o=r*$c+r,l=-s,c=o;e.moveTo(n,i),e.lineTo(s,o),e.lineTo(l,c),e.lineTo(Mt*n-It*i,It*n+Mt*i),e.lineTo(Mt*s-It*o,It*s+Mt*o),e.lineTo(Mt*l-It*c,It*l+Mt*c),e.lineTo(Mt*n+It*i,Mt*i-It*n),e.lineTo(Mt*s+It*o,Mt*o-It*s),e.lineTo(Mt*l+It*c,Mt*c-It*l),e.closePath()}};function FS(e,t){let r=null,n=wd(i);e=typeof e=="function"?e:Le(e||Nd),t=typeof t=="function"?t:Le(t===void 0?64:+t);function i(){let s;if(r||(r=s=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),s)return r=null,s+""||null}return i.type=function(s){return arguments.length?(e=typeof s=="function"?s:Le(s),i):e},i.size=function(s){return arguments.length?(t=typeof s=="function"?s:Le(+s),i):t}
vendor: 6,361 bytes, line 202
202,i.context=function(s){return arguments.length?(r=s??null,i):r},i}function Bs(){}function Fs(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function tx(e){this._context=e}tx.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:Fs(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:Fs(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function US(e){return new tx(e)}function rx(e){this._context=e}rx.prototype={areaStart:Bs,areaEnd:Bs,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:Fs(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function zS(e){return new rx(e)}function nx(e){this._context=e}nx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:Fs(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function HS(e){return new nx(e)}function ax(e){this._context=e}ax.prototype={areaStart:Bs,areaEnd:Bs,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 WS(e){return new ax(e)}function Qf(e){return e<0?-1:1}function eh(e,t,r){var n=e._x1-e._x0,i=t-e._x1,s=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),l=(s*i+o*n)/(n+i);return(Qf(s)+Qf(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(l))||0}function th(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Dl(e,t,r){var n=e._x0,i=e._y0,s=e._x1,o=e._y1,l=(s-n)/3;e._context.bezierCurveTo(n+l,i+l*t,s-l,o-l*r,s,o)}function Us(e){this._context=e}Us.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:Dl(this,this._t0,th(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Dl(this,th(this,r=eh(this,e,t)),r);break;default:Dl(this,this._t0,r=eh(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function ix(e){this._context=new sx(e)}(ix.prototype=Object.create(Us.prototype)).point=function(e,t){Us.prototype.point.call(this,t,e)};function sx(e){this._context=e}sx.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,s){this._context.bezierCurveTo(t,e,n,r,s,i)}};function GS(e){return new Us(e)}function qS(e){return new ix(e)}function ox(e){this._context=e}ox.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=rh(e),i=rh(t),s=0,o=1;o<r;++s,++o)this._context.bezierCurveTo(n[0][s],i[0][s],n[1][s],i[1][s],e[o],t[o]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function rh(e){var t,r=e.length-1,n,i=new Array(r),s=new Array(r),o=new Array(r);for(i[0]=0,s[0]=2,o[0]=e[0]+2*e[1],t=1;t<r-1;++t)i[t]=1,s[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[r-1]=2,s[r-1]=7,o[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=i[t]/s[t-1],s[t]-=n,o[t]-=n*o[t-1];for(i[r-1]=o[r-1]/s[r-1],t=r-2;t>=0;--t)i[t]=(o[t]-i[t+1])/s[t];for(s[r-1]=(e[r]+i[r-1])/2,t=0;t<r-1;++t)s[t]=2*e[t+1]-i[t+1];return[i,s]}function VS(e){return new ox(e)}function nl(e,t){this._context=e,this._t=t}nl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;
vendor: 9,131 bytes, lines 202-205
202default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function KS(e){return new nl(e,.5)}function XS(e){return new nl(e,0)}function YS(e){return new nl(e,1)}function Zn(e,t){if((o=e.length)>1)for(var r=1,n,i,s=e[t[0]],o,l=s.length;r<o;++r)for(i=s,s=e[t[r]],n=0;n<l;++n)s[n][1]+=s[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function kc(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function ZS(e,t){return e[t]}function JS(e){const t=[];return t.key=e,t}function QS(){var e=Le([]),t=kc,r=Zn,n=ZS;function i(s){var o=Array.from(e.apply(this,arguments),JS),l,c=o.length,u=-1,f;for(const d of s)for(l=0,++u;l<c;++l)(o[l][u]=[0,+n(d,o[l].key,u,s)]).data=d;for(l=0,f=_d(t(o));l<c;++l)o[f[l]].index=l;return r(o,f),o}return i.keys=function(s){return arguments.length?(e=typeof s=="function"?s:Le(Array.from(s)),i):e},i.value=function(s){return arguments.length?(n=typeof s=="function"?s:Le(+s),i):n},i.order=function(s){return arguments.length?(t=s==null?kc:typeof s=="function"?s:Le(Array.from(s)),i):t},i.offset=function(s){return arguments.length?(r=s??Zn,i):r},i}function eO(e,t){if((n=e.length)>0){for(var r,n,i=0,s=e[0].length,o;i<s;++i){for(o=r=0;r<n;++r)o+=e[r][i][1]||0;if(o)for(r=0;r<n;++r)e[r][i][1]/=o}Zn(e,t)}}function tO(e,t){if((i=e.length)>0){for(var r=0,n=e[t[0]],i,s=n.length;r<s;++r){for(var o=0,l=0;o<i;++o)l+=e[o][r][1]||0;n[r][1]+=n[r][0]=-l/2}Zn(e,t)}}function rO(e,t){if(!(!((o=e.length)>0)||!((s=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,s,o;n<s;++n){for(var l=0,c=0,u=0;l<o;++l){for(var f=e[t[l]],d=f[n][1]||0,h=f[n-1][1]||0,m=(d-h)/2,v=0;v<l;++v){var x=e[t[v]],p=x[n][1]||0,w=x[n-1][1]||0;m+=p-w}c+=d,u+=m*d}i[n-1][1]+=i[n-1][0]=r,c&&(r-=u/c)}i[n-1][1]+=i[n-1][0]=r,Zn(e,t)}}function di(e){"@babel/helpers - typeof";return di=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},di(e)}var nO=["type","size","sizeType"];function Mc(){return Mc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Mc.apply(this,arguments)}function nh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ah(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?nh(Object(r),!0).forEach(function(n){aO(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nh(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function aO(e,t,r){return t=iO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function iO(e){var t=sO(e,"string");return di(t)=="symbol"?t:t+""}function sO(e,t){if(di(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(di(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function oO(e,t){if(e==null)return{};var r=lO(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function lO(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var lx={symbolCircle:Nd,symbolCross:TS,symbolDiamond:CS,symbolSquare:$S,symbolStar:DS,symbolTriangle:LS,symbolWye:BS},cO=Math.PI/180,uO=function(t){var r="symbol".concat(el(t));return lx[r]||Nd},dO=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*cO;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},fO=function(t,r){lx["symbol".concat(el(t))]=r},Sd=function(t){var r=t.type,n=r===void 0?"circle":r,i=t.size,s=i===void 0?64:i,o=t.sizeType,l=o===void 0?"area":o,c=oO(t,nO),u=ah(ah({},c),{},{type:n,size:s,sizeType:l}),f=function(){var p=uO(n),w=FS().type(p).size(dO(s,l,n));return w()},d=u.className,h=u.cx,m=u.cy,v=Ee(u,!0);return h===+h&&m===+m&&s===+s?M.createElement("path",Mc({},v,{className:Ce("recharts-symbols",d),transform:"translate(".concat(h,", ").concat(m,")"),d:f()})):null};Sd.registerSymbol=fO;function Jn(e){"@babel/helpers - typeof";return Jn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jn(e)}function Ic(){return Ic=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ic.apply(this,arguments)}function ih(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function hO(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ih(Object(r),!0).forEach(function(n){fi(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ih(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function mO(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pO(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ux(n.key),n)}}function gO(e,t,r){return t&&pO(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function vO(e,t,r){return t=zs(t),xO(e,cx()?Reflect.construct(t,r||[],zs(e).constructor):t.apply(e,r))}function xO(e,t){if(t&&(Jn(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return yO(e)}function yO(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function cx(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(cx=function(){return!!e})()}function zs(e){return zs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},zs(e)}function bO(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Dc(e,t)}function Dc(e,t){return Dc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Dc(e,t)}function fi(e,t,r){return t=ux(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ux(e){var t=jO(e,"string");return Jn(t)=="symbol"?t:t+""}function jO(e,t){if(Jn(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Jn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Dt=32,Od=function(e){function t(){return mO(this,t),vO(this,t,arguments)}return bO(t,e),gO(t,[{key:"renderIcon",value:function(n){var i=this.props.inactiveColor,s=Dt/2,o=Dt/6,l=Dt/3,c=n.inactive?i:n.color;if(n.type==="plainline")return M.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:n.payload.strokeDasharray,x1:0,y1:s,x2:Dt,y2:s,className:"recharts-legend-icon"});if(n.type==="line")return M.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(s,"h").concat(l,`
203            A`).concat(o,",").concat(o,",0,1,1,").concat(2*l,",").concat(s,`
204            H`).concat(Dt,"M").concat(2*l,",").concat(s,`
205            A`).concat(o,",").concat(o,",0,1,1,").concat(l,",").concat(s),className:"recharts-legend-icon"});if(n.type==="rect")return M.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(Dt/8,"h").concat(Dt,"v").concat(Dt*3/4,"h").concat(-Dt,"z"),className:"recharts-legend-icon"});if(M.isValidElement(n.legendIcon)){var u=hO({},n);return delete u.legendIcon,M.cloneElement(n.legendIcon,u)}return M.createElement(Sd,{fill:c,cx:s,cy:s,size:Dt,sizeType:"diameter",type:n.type})}},{key:"renderItems",value:function(){var n=this,i=this.props,s=i.payload,o=i.iconSize,l=i.layout,c=i.formatter,u=i.inactiveColor,f={x:0,y:0,width:Dt,height:Dt}
205,d={display:l==="horizontal"?"inline-block":"block",marginRight:10},h={display:"inline-block",verticalAlign:"middle",marginRight:4};return s.map(function(m,v){var x=m.formatter||c,p=Ce(fi(fi({"recharts-legend-item":!0},"legend-item-".concat(v),!0),"inactive",m.inactive));if(m.type==="none")return null;var w=Ne(m.value)?null:m.value;Ar(!Ne(m.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var j=m.inactive?u:m.color;return M.createElement("li",Ic({className:p,style:d,key:"legend-item-".concat(v)},Ds(n.props,m,v)),M.createElement(Oc,{width:o,height:o,viewBox:f,style:h},n.renderIcon(m)),M.createElement("span",{className:"recharts-legend-item-text",style:{color:j}},x?x(w,m,v):w))})}},{key:"render",value:function(){var n=this.props,i=n.payload,s=n.layout,o=n.align;if(!i||!i.length)return null;var l={padding:0,margin:0,textAlign:s==="horizontal"?o:"left"};return M.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])}(S.PureComponent);fi(Od,"displayName","Legend");fi(Od,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var wO=Uo;function _O(){this.__data__=new wO,this.size=0}var NO=_O;function SO(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var OO=SO;function AO(e){return this.__data__.get(e)}var PO=AO;function TO(e){return this.__data__.has(e)}var EO=TO,CO=Uo,$O=hd,kO=md,MO=200;function IO(e,t){var r=this.__data__;if(r instanceof CO){var n=r.__data__;if(!$O||n.length<MO-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new kO(n)}return r.set(e,t),this.size=r.size,this}var DO=IO,LO=Uo,RO=NO,BO=OO,FO=PO,UO=EO,zO=DO;function Aa(e){var t=this.__data__=new LO(e);this.size=t.size}Aa.prototype.clear=RO;Aa.prototype.delete=BO;Aa.prototype.get=FO;Aa.prototype.has=UO;Aa.prototype.set=zO;var dx=Aa,HO="__lodash_hash_undefined__";function WO(e){return this.__data__.set(e,HO),this}var GO=WO;function qO(e){return this.__data__.has(e)}var VO=qO,KO=md,XO=GO,YO=VO;function Hs(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new KO;++t<r;)this.add(e[t])}Hs.prototype.add=Hs.prototype.push=XO;Hs.prototype.has=YO;var fx=Hs;function ZO(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var hx=ZO;function JO(e,t){return e.has(t)}var mx=JO,QO=fx,eA=hx,tA=mx,rA=1,nA=2;function aA(e,t,r,n,i,s){var o=r&rA,l=e.length,c=t.length;if(l!=c&&!(o&&c>l))return!1;var u=s.get(e),f=s.get(t);if(u&&f)return u==t&&f==e;var d=-1,h=!0,m=r&nA?new QO:void 0;for(s.set(e,t),s.set(t,e);++d<l;){var v=e[d],x=t[d];if(n)var p=o?n(x,v,d,t,e,s):n(v,x,d,e,t,s);if(p!==void 0){if(p)continue;h=!1;break}if(m){if(!eA(t,function(w,j){if(!tA(m,j)&&(v===w||i(v,w,r,n,s)))return m.push(j)})){h=!1;break}}else if(!(v===x||i(v,x,r,n,s))){h=!1;break}}return s.delete(e),s.delete(t),h}var px=aA,iA=cr,sA=iA.Uint8Array,oA=sA;function lA(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}var cA=lA;function uA(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var Ad=uA,sh=Xi,oh=oA,dA=fd,fA=px,hA=cA,mA=Ad,pA=1,gA=2,vA="[object Boolean]",xA="[object Date]",yA="[object Error]",bA="[object Map]",jA="[object Number]",wA="[object RegExp]",_A="[object Set]",NA="[object String]",SA="[object Symbol]",OA="[object ArrayBuffer]",AA="[object DataView]",lh=sh?sh.prototype:void 0,Ll=lh?lh.valueOf:void 0;function PA(e,t,r,n,i,s,o){switch(r){case AA:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case OA:return!(e.byteLength!=t.byteLength||!s(new oh(e),new oh(t)));case vA:case xA:case jA:return dA(+e,+t);case yA:return e.name==t.name&&e.message==t.message;case wA:case NA:return e==t+"";case bA:var l=hA;case _A:var c=n&pA;if(l||(l=mA),e.size!=t.size&&!c)return!1;var u=o.get(e);if(u)return u==t;n|=gA,o.set(e,t);var f=fA(l(e),l(t),n,i,s,o);return o.delete(e),f;case SA:if(Ll)return Ll.call(e)==Ll.call(t)}return!1}var TA=PA;function EA(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;
vendor: 4,904 bytes, line 205
205)e[i+r]=t[r];return e}var gx=EA,CA=gx,$A=St;function kA(e,t,r){var n=t(e);return $A(e)?n:CA(n,r(e))}var MA=kA;function IA(e,t){for(var r=-1,n=e==null?0:e.length,i=0,s=[];++r<n;){var o=e[r];t(o,r,e)&&(s[i++]=o)}return s}var DA=IA;function LA(){return[]}var RA=LA,BA=DA,FA=RA,UA=Object.prototype,zA=UA.propertyIsEnumerable,ch=Object.getOwnPropertySymbols,HA=ch?function(e){return e==null?[]:(e=Object(e),BA(ch(e),function(t){return zA.call(e,t)}))}:FA,WA=HA;function GA(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var qA=GA,VA=Dr,KA=Lr,XA="[object Arguments]";function YA(e){return KA(e)&&VA(e)==XA}var ZA=YA,uh=ZA,JA=Lr,vx=Object.prototype,QA=vx.hasOwnProperty,eP=vx.propertyIsEnumerable,tP=uh(function(){return arguments}())?uh:function(e){return JA(e)&&QA.call(e,"callee")&&!eP.call(e,"callee")},Pd=tP,Ws={exports:{}};function rP(){return!1}var nP=rP;Ws.exports;(function(e,t){var r=cr,n=nP,i=t&&!t.nodeType&&t,s=i&&!0&&e&&!e.nodeType&&e,o=s&&s.exports===i,l=o?r.Buffer:void 0,c=l?l.isBuffer:void 0,u=c||n;e.exports=u})(Ws,Ws.exports);var xx=Ws.exports,aP=9007199254740991,iP=/^(?:0|[1-9]\d*)$/;function sP(e,t){var r=typeof e;return t=t??aP,!!t&&(r=="number"||r!="symbol"&&iP.test(e))&&e>-1&&e%1==0&&e<t}var Td=sP,oP=9007199254740991;function lP(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=oP}var Ed=lP,cP=Dr,uP=Ed,dP=Lr,fP="[object Arguments]",hP="[object Array]",mP="[object Boolean]",pP="[object Date]",gP="[object Error]",vP="[object Function]",xP="[object Map]",yP="[object Number]",bP="[object Object]",jP="[object RegExp]",wP="[object Set]",_P="[object String]",NP="[object WeakMap]",SP="[object ArrayBuffer]",OP="[object DataView]",AP="[object Float32Array]",PP="[object Float64Array]",TP="[object Int8Array]",EP="[object Int16Array]",CP="[object Int32Array]",$P="[object Uint8Array]",kP="[object Uint8ClampedArray]",MP="[object Uint16Array]",IP="[object Uint32Array]",Be={};Be[AP]=Be[PP]=Be[TP]=Be[EP]=Be[CP]=Be[$P]=Be[kP]=Be[MP]=Be[IP]=!0;Be[fP]=Be[hP]=Be[SP]=Be[mP]=Be[OP]=Be[pP]=Be[gP]=Be[vP]=Be[xP]=Be[yP]=Be[bP]=Be[jP]=Be[wP]=Be[_P]=Be[NP]=!1;function DP(e){return dP(e)&&uP(e.length)&&!!Be[cP(e)]}var LP=DP;function RP(e){return function(t){return e(t)}}var yx=RP,Gs={exports:{}};Gs.exports;(function(e,t){var r=Ov,n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,s=i&&i.exports===n,o=s&&r.process,l=function(){try{var c=i&&i.require&&i.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();e.exports=l})(Gs,Gs.exports);var BP=Gs.exports,FP=LP,UP=yx,dh=BP,fh=dh&&dh.isTypedArray,zP=fh?UP(fh):FP,bx=zP,HP=qA,WP=Pd,GP=St,qP=xx,VP=Td,KP=bx,XP=Object.prototype,YP=XP.hasOwnProperty;function ZP(e,t){var r=GP(e),n=!r&&WP(e),i=!r&&!n&&qP(e),s=!r&&!n&&!i&&KP(e),o=r||n||i||s,l=o?HP(e.length,String):[],c=l.length;for(var u in e)(t||YP.call(e,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||VP(u,c)))&&l.push(u);return l}var JP=ZP,QP=Object.prototype;function eT(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||QP;return e===r}var tT=eT;function rT(e,t){return function(r){return e(t(r))}}var jx=rT,nT=jx,aT=nT(Object.keys,Object),iT=aT,sT=tT,oT=iT,lT=Object.prototype,cT=lT.hasOwnProperty;function uT(e){if(!sT(e))return oT(e);var t=[];for(var r in Object(e))cT.call(e,r)&&r!="constructor"&&t.push(r);return t}var dT=uT,fT=dd,hT=Ed;function mT(e){return e!=null&&hT(e.length)&&!fT(e)}var Qi=mT,pT=JP,gT=dT,vT=Qi;function xT(e){return vT(e)?pT(e):gT(e)}var al=xT,yT=MA,bT=WA,jT=al;function wT(e){return yT(e,jT,bT)}var _T=wT,hh=_T,NT=1,ST=Object.prototype,OT=ST.hasOwnProperty;function AT(e,t,r,n,i,s){var o=r&NT,l=hh(e),c=l.length,u=hh(t),f=u.length;if(c!=f&&!o)return!1;for(var d=c;d--;){var h=l[d];if(!(o?h in t:OT.call(t,h)))return!1}var m=s.get(e),v=s.get(t);if(m&&v)return m==t&&v==e;var x=!0;s.set(e,t),s.set(t,e);for(var p=o;++d<c;){h=l[d];var w=e[h],j=t[h];if(n)var _=o?n(j,w,h,t,e,s):n(w,j,h,e,t,s);if(!(_===void 0?w===j||i(w,j,r,n,s):_)){x=!1;break}p||(p=h=="constructor")}if(x&&!p){var y=e.constructor,g=t.constructor;y!=g&&"constructor"in e&&"constructor"in t&&!(typeof y=="function"&&y instanceof y&&typeof g=="function"&&g instanceof g)&&(x=!1)}return s.delete(e),s.delete(t),x}var PT=AT,TT=On,ET=cr,CT=TT(ET,"DataView"),$T=CT,kT=On,MT=cr,IT=kT(MT,"Promise"),DT=IT,LT=On,RT=cr,BT=LT(RT,"Set"),wx=BT,FT=On,UT=cr,zT=FT(UT,"WeakMap"),HT=zT,Lc=$T,Rc=hd,Bc=DT,Fc=wx,Uc=HT,_x=Dr,Pa=Pv,mh="[object Map]",WT="[object Object]",ph="[object Promise]",gh="[object Set]",vh="[object WeakMap]",xh="[object DataView]",GT=Pa(Lc),qT=Pa(Rc),VT=Pa(Bc),KT=Pa(Fc),XT=Pa(Uc),nn=_x;(Lc&&nn(new Lc(new ArrayBuffer(1)))!=xh||Rc&&nn(new Rc)!=mh||Bc&&nn(Bc.resolve())!=ph||Fc&&nn(new Fc)!=gh||Uc&&nn(new Uc)!=vh)&&(nn=function(e){var t=_x(e),r=t==WT?e.constructor:void 0,n=r?Pa(r):"";if(n)switch(n){case GT:return xh;case qT:return mh;case VT:return ph;case KT:return gh;case XT:return vh}return t});
vendor: 4,225 bytes, line 205
205var YT=nn,Rl=dx,ZT=px,JT=TA,QT=PT,yh=YT,bh=St,jh=xx,e2=bx,t2=1,wh="[object Arguments]",_h="[object Array]",hs="[object Object]",r2=Object.prototype,Nh=r2.hasOwnProperty;function n2(e,t,r,n,i,s){var o=bh(e),l=bh(t),c=o?_h:yh(e),u=l?_h:yh(t);c=c==wh?hs:c,u=u==wh?hs:u;var f=c==hs,d=u==hs,h=c==u;if(h&&jh(e)){if(!jh(t))return!1;o=!0,f=!1}if(h&&!f)return s||(s=new Rl),o||e2(e)?ZT(e,t,r,n,i,s):JT(e,t,c,r,n,i,s);if(!(r&t2)){var m=f&&Nh.call(e,"__wrapped__"),v=d&&Nh.call(t,"__wrapped__");if(m||v){var x=m?e.value():e,p=v?t.value():t;return s||(s=new Rl),i(x,p,r,n,s)}}return h?(s||(s=new Rl),QT(e,t,r,n,i,s)):!1}var a2=n2,i2=a2,Sh=Lr;function Nx(e,t,r,n,i){return e===t?!0:e==null||t==null||!Sh(e)&&!Sh(t)?e!==e&&t!==t:i2(e,t,r,n,Nx,i)}var Cd=Nx,s2=dx,o2=Cd,l2=1,c2=2;function u2(e,t,r,n){var i=r.length,s=i,o=!n;if(e==null)return!s;for(e=Object(e);i--;){var l=r[i];if(o&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++i<s;){l=r[i];var c=l[0],u=e[c],f=l[1];if(o&&l[2]){if(u===void 0&&!(c in e))return!1}else{var d=new s2;if(n)var h=n(u,f,c,e,t,d);if(!(h===void 0?o2(f,u,l2|c2,n,d):h))return!1}}return!0}var d2=u2,f2=Kr;function h2(e){return e===e&&!f2(e)}var Sx=h2,m2=Sx,p2=al;function g2(e){for(var t=p2(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,m2(i)]}return t}var v2=g2;function x2(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var Ox=x2,y2=d2,b2=v2,j2=Ox;function w2(e){var t=b2(e);return t.length==1&&t[0][2]?j2(t[0][0],t[0][1]):function(r){return r===e||y2(r,e,t)}}var _2=w2;function N2(e,t){return e!=null&&t in Object(e)}var S2=N2,O2=kv,A2=Pd,P2=St,T2=Td,E2=Ed,C2=Ho;function $2(e,t,r){t=O2(t,e);for(var n=-1,i=t.length,s=!1;++n<i;){var o=C2(t[n]);if(!(s=e!=null&&r(e,o)))break;e=e[o]}return s||++n!=i?s:(i=e==null?0:e.length,!!i&&E2(i)&&T2(o,i)&&(P2(e)||A2(e)))}var k2=$2,M2=S2,I2=k2;function D2(e,t){return e!=null&&I2(e,t,M2)}var L2=D2,R2=Cd,B2=Mv,F2=L2,U2=ud,z2=Sx,H2=Ox,W2=Ho,G2=1,q2=2;function V2(e,t){return U2(e)&&z2(t)?H2(W2(e),t):function(r){var n=B2(r,e);return n===void 0&&n===t?F2(r,e):R2(t,n,G2|q2)}}var K2=V2;function X2(e){return e}var Ta=X2;function Y2(e){return function(t){return t==null?void 0:t[e]}}var Z2=Y2,J2=vd;function Q2(e){return function(t){return J2(t,e)}}var eE=Q2,tE=Z2,rE=eE,nE=ud,aE=Ho;function iE(e){return nE(e)?tE(aE(e)):rE(e)}var sE=iE,oE=_2,lE=K2,cE=Ta,uE=St,dE=sE;function fE(e){return typeof e=="function"?e:e==null?cE:typeof e=="object"?uE(e)?lE(e[0],e[1]):oE(e):dE(e)}var Xr=fE;function hE(e,t,r,n){for(var i=e.length,s=r+(n?1:-1);n?s--:++s<i;)if(t(e[s],s,e))return s;return-1}var Ax=hE;function mE(e){return e!==e}var pE=mE;function gE(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}var vE=gE,xE=Ax,yE=pE,bE=vE;function jE(e,t,r){return t===t?bE(e,t,r):xE(e,yE,r)}var wE=jE,_E=wE;function NE(e,t){var r=e==null?0:e.length;return!!r&&_E(e,t,0)>-1}var SE=NE;function OE(e,t,r){for(var n=-1,i=e==null?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}var AE=OE;function PE(){}var TE=PE,Bl=wx,EE=TE,CE=Ad,$E=1/0,kE=Bl&&1/CE(new Bl([,-0]))[1]==$E?function(e){return new Bl(e)}:EE,ME=kE,IE=fx,DE=SE,LE=AE,RE=mx,BE=ME,FE=Ad,UE=200;function zE(e,t,r){var n=-1,i=DE,s=e.length,o=!0,l=[],c=l;if(r)o=!1,i=LE;else if(s>=UE){var u=t?null:BE(e);if(u)return FE(u);o=!1,i=RE,c=new IE}else c=t?[]:l;e:for(;++n<s;){var f=e[n],d=t?t(f):f;if(f=r||f!==0?f:0,o&&d===d){for(var h=c.length;h--;)if(c[h]===d)continue e;t&&c.push(d),l.push(f)}else i(c,d,r)||(c!==l&&c.push(d),l.push(f))}return l}var HE=zE,WE=Xr,GE=HE;function qE(e,t){return e&&e.length?GE(e,WE(t)):[]}var VE=qE;const Oh=Re(VE);function Px(e,t,r){return t===!0?Oh(e,r):Ne(t)?Oh(e,t):e}function Qn(e){"@babel/helpers - typeof";return Qn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qn(e)}var KE=["ref"];function Ah(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function mr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};
vendor: 4,089 bytes, line 205
205t%2?Ah(Object(r),!0).forEach(function(n){il(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ah(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function XE(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ph(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ex(n.key),n)}}function YE(e,t,r){return t&&Ph(e.prototype,t),r&&Ph(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ZE(e,t,r){return t=qs(t),JE(e,Tx()?Reflect.construct(t,r||[],qs(e).constructor):t.apply(e,r))}function JE(e,t){if(t&&(Qn(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return QE(e)}function QE(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Tx(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Tx=function(){return!!e})()}function qs(e){return qs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},qs(e)}function eC(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&zc(e,t)}function zc(e,t){return zc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},zc(e,t)}function il(e,t,r){return t=Ex(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ex(e){var t=tC(e,"string");return Qn(t)=="symbol"?t:t+""}function tC(e,t){if(Qn(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Qn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function rC(e,t){if(e==null)return{};var r=nC(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function nC(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function aC(e){return e.value}function iC(e,t){if(M.isValidElement(e))return M.cloneElement(e,t);if(typeof e=="function")return M.createElement(e,t);t.ref;var r=rC(t,KE);return M.createElement(Od,r)}var Th=1,zn=function(e){function t(){var r;XE(this,t);for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return r=ZE(this,t,[].concat(i)),il(r,"lastBoundingBox",{width:-1,height:-1}),r}return eC(t,e),YE(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();return n.height=this.wrapperNode.offsetHeight,n.width=this.wrapperNode.offsetWidth,n}return null}},{key:"updateBBox",value:function(){var n=this.props.onBBoxUpdate,i=this.getBBox();i?(Math.abs(i.width-this.lastBoundingBox.width)>Th||Math.abs(i.height-this.lastBoundingBox.height)>Th)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,n&&n(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?mr({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,s=i.layout,o=i.align,l=i.verticalAlign,c=i.margin,u=i.chartWidth,f=i.chartHeight,d,h;
205if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&s==="vertical"){var m=this.getBBoxSnapshot();d={left:((u||0)-m.width)/2}}else d=o==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(l==="middle"){var v=this.getBBoxSnapshot();h={top:((f||0)-v.height)/2}}else h=l==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return mr(mr({},d),h)}},{key:"render",value:function(){var n=this,i=this.props,s=i.content,o=i.width,l=i.height,c=i.wrapperStyle,u=i.payloadUniqBy,f=i.payload,d=mr(mr({position:"absolute",width:o||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return M.createElement("div",{className:"recharts-legend-wrapper",style:d,ref:function(m){n.wrapperNode=m}},iC(s,mr(mr({},this.props),{},{payload:Px(f,u,aC)})))}}],[{key:"getWithHeight",value:function(n,i){var s=mr(mr({},this.defaultProps),n.props),o=s.layout;return o==="vertical"&&ie(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||i}:null}}])}(S.PureComponent);il(zn,"displayName","Legend");il(zn,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var Eh=Xi,sC=Pd,oC=St,Ch=Eh?Eh.isConcatSpreadable:void 0;function lC(e){return oC(e)||sC(e)||!!(Ch&&e&&e[Ch])}var cC=lC,uC=gx,dC=cC;function Cx(e,t,r,n,i){var s=-1,o=e.length;for(r||(r=dC),i||(i=[]);++s<o;){var l=e[s];t>0&&r(l)?t>1?Cx(l,t-1,r,n,i):uC(i,l):n||(i[i.length]=l)}return i}var $x=Cx;function fC(e){return function(t,r,n){for(var i=-1,s=Object(t),o=n(t),l=o.length;l--;){var c=o[e?l:++i];if(r(s[c],c,s)===!1)break}return t}}var hC=fC,mC=hC,pC=mC(),gC=pC,vC=gC,xC=al;function yC(e,t){return e&&vC(e,t,xC)}var kx=yC,bC=Qi;function jC(e,t){return function(r,n){if(r==null)return r;if(!bC(r))return e(r,n);for(var i=r.length,s=t?i:-1,o=Object(r);(t?s--:++s<i)&&n(o[s],s,o)!==!1;);return r}}var wC=jC,_C=kx,NC=wC,SC=NC(_C),$d=SC,OC=$d,AC=Qi;function PC(e,t){var r=-1,n=AC(e)?Array(e.length):[];return OC(e,function(i,s,o){n[++r]=t(i,s,o)}),n}var Mx=PC;function TC(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}var EC=TC,$h=wa;function CC(e,t){if(e!==t){var r=e!==void 0,n=e===null,i=e===e,s=$h(e),o=t!==void 0,l=t===null,c=t===t,u=$h(t);if(!l&&!u&&!s&&e>t||s&&o&&c&&!l&&!u||n&&o&&c||!r&&c||!i)return 1;if(!n&&!s&&!u&&e<t||u&&r&&i&&!n&&!s||l&&r&&i||!o&&i||!c)return-1}return 0}var $C=CC,kC=$C;function MC(e,t,r){for(var n=-1,i=e.criteria,s=t.criteria,o=i.length,l=r.length;++n<o;){var c=kC(i[n],s[n]);if(c){if(n>=l)return c;var u=r[n];return c*(u=="desc"?-1:1)}}return e.index-t.index}var IC=MC,Fl=gd,DC=vd,LC=Xr,RC=Mx,BC=EC,FC=yx,UC=IC,zC=Ta,HC=St;function WC(e,t,r){t.length?t=Fl(t,function(s){return HC(s)?function(o){return DC(o,s.length===1?s[0]:s)}:s}):t=[zC];var n=-1;t=Fl(t,FC(LC));var i=RC(e,function(s,o,l){var c=Fl(t,function(u){return u(s)});return{criteria:c,index:++n,value:s}});return BC(i,function(s,o){return UC(s,o,r)})}var GC=WC;function qC(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var VC=qC,KC=VC,kh=Math.max;function XC(e,t,r){return t=kh(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,s=kh(n.length-t,0),o=Array(s);++i<s;)o[i]=n[t+i];i=-1;for(var l=Array(t+1);++i<t;)l[i]=n[i];return l[t]=r(o),KC(e,this,l)}}var YC=XC;function ZC(e){return function(){return e}}var JC=ZC,QC=On,e$=function(){try{var e=QC(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Ix=e$,t$=JC,Mh=Ix,r$=Ta,n$=Mh?function(e,t){return Mh(e,"toString",{configurable:!0,enumerable:!1,value:t$(t),writable:!0})}:r$,a$=n$,i$=800,s$=16,o$=Date.now;function l$(e){var t=0,r=0;return function(){var n=o$(),i=s$-(n-r);if(r=n,i>0){if(++t>=i$)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var c$=l$,u$=a$,d$=c$,f$=d$(u$),h$=f$,m$=Ta,p$=YC,g$=h$;function v$(e,t){return g$(p$(e,t,m$),e+"")}var x$=v$,y$=fd,b$=Qi,j$=Td,w$=Kr;function _$(e,t,r){if(!w$(r))return!1;var n=typeof t;return(n=="number"?b$(r)&&j$(t,r.length):n=="string"&&t in r)?y$(r[t],e):!1}var sl=_$,N$=$x,S$=GC,O$=x$,Ih=sl,A$=O$(function(e,t){if(e==null)return[];var r=t.length;return r>1&&Ih(e,t[0],t[1])?t=[]:r>2&&Ih(t[0],t[1],t[2])&&(t=[t[0]]),S$(e,N$(t,1),[])}),P$=A$;const kd=Re(P$);function hi(e){"@babel/helpers - typeof";return hi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hi(e)}function Hc(){return Hc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];
vendor: 10,861 bytes, lines 205-206
205for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Hc.apply(this,arguments)}function T$(e,t){return k$(e)||$$(e,t)||C$(e,t)||E$()}function E$(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
206In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function C$(e,t){if(e){if(typeof e=="string")return Dh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Dh(e,t)}}function Dh(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function $$(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,s,o,l=[],c=!0,u=!1;try{if(s=(r=r.call(e)).next,t!==0)for(;!(c=(n=s.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,i=f}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function k$(e){if(Array.isArray(e))return e}function Lh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ul(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Lh(Object(r),!0).forEach(function(n){M$(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lh(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function M$(e,t,r){return t=I$(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function I$(e){var t=D$(e,"string");return hi(t)=="symbol"?t:t+""}function D$(e,t){if(hi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(hi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function L$(e){return Array.isArray(e)&&Qe(e[0])&&Qe(e[1])?e.join(" ~ "):e}var R$=function(t){var r=t.separator,n=r===void 0?" : ":r,i=t.contentStyle,s=i===void 0?{}:i,o=t.itemStyle,l=o===void 0?{}:o,c=t.labelStyle,u=c===void 0?{}:c,f=t.payload,d=t.formatter,h=t.itemSorter,m=t.wrapperClassName,v=t.labelClassName,x=t.label,p=t.labelFormatter,w=t.accessibilityLayer,j=w===void 0?!1:w,_=function(){if(f&&f.length){var $={padding:0,margin:0},I=(h?kd(f,h):f).map(function(L,U){if(L.type==="none")return null;var T=Ul({display:"block",paddingTop:4,paddingBottom:4,color:L.color||"#000"},l),B=L.formatter||d||L$,W=L.value,ae=L.name,F=W,G=ae;if(B&&F!=null&&G!=null){var re=B(W,ae,L,U,f);if(Array.isArray(re)){var R=T$(re,2);F=R[0],G=R[1]}else F=re}return M.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(U),style:T},Qe(G)?M.createElement("span",{className:"recharts-tooltip-item-name"},G):null,Qe(G)?M.createElement("span",{className:"recharts-tooltip-item-separator"},n):null,M.createElement("span",{className:"recharts-tooltip-item-value"},F),M.createElement("span",{className:"recharts-tooltip-item-unit"},L.unit||""))});return M.createElement("ul",{className:"recharts-tooltip-item-list",style:$},I)}return null},y=Ul({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},s),g=Ul({margin:0},u),b=!Ae(x),N=b?x:"",O=Ce("recharts-default-tooltip",m),D=Ce("recharts-tooltip-label",v);b&&p&&f!==void 0&&f!==null&&(N=p(x,f));var P=j?{role:"status","aria-live":"assertive"}:{};return M.createElement("div",Hc({className:O,style:y},P),M.createElement("p",{className:D,style:g},M.isValidElement(N)?N:"".concat(N)),_())};function mi(e){"@babel/helpers - typeof";return mi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mi(e)}function ms(e,t,r){return t=B$(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function B$(e){var t=F$(e,"string");return mi(t)=="symbol"?t:t+""}function F$(e,t){if(mi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(mi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ba="recharts-tooltip-wrapper",U$={visibility:"hidden"};function z$(e){var t=e.coordinate,r=e.translateX,n=e.translateY;return Ce(Ba,ms(ms(ms(ms({},"".concat(Ba,"-right"),ie(r)&&t&&ie(t.x)&&r>=t.x),"".concat(Ba,"-left"),ie(r)&&t&&ie(t.x)&&r<t.x),"".concat(Ba,"-bottom"),ie(n)&&t&&ie(t.y)&&n>=t.y),"".concat(Ba,"-top"),ie(n)&&t&&ie(t.y)&&n<t.y))}function Rh(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.key,i=e.offsetTopLeft,s=e.position,o=e.reverseDirection,l=e.tooltipDimension,c=e.viewBox,u=e.viewBoxDimension;if(s&&ie(s[n]))return s[n];var f=r[n]-l-i,d=r[n]+i;if(t[n])return o[n]?f:d;if(o[n]){var h=f,m=c[n];return h<m?Math.max(d,c[n]):Math.max(f,c[n])}var v=d+l,x=c[n]+u;return v>x?Math.max(f,c[n]):Math.max(d,c[n])}function H$(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function W$(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,i=e.position,s=e.reverseDirection,o=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox,u,f,d;return o.height>0&&o.width>0&&r?(f=Rh({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:s,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),d=Rh({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:s,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),u=H$({translateX:f,translateY:d,useTranslate3d:l})):u=U$,{cssProperties:u,cssClasses:z$({translateX:f,translateY:d,coordinate:r})}}function ea(e){"@babel/helpers - typeof";return ea=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ea(e)}function Bh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Fh(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Bh(Object(r),!0).forEach(function(n){Gc(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bh(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function G$(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function q$(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Lx(n.key),n)}}function V$(e,t,r){return t&&q$(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function K$(e,t,r){return t=Vs(t),X$(e,Dx()?Reflect.construct(t,r||[],Vs(e).constructor):t.apply(e,r))}function X$(e,t){if(t&&(ea(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Y$(e)}function Y$(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Dx(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Dx=function(){return!!e})()}function Vs(e){return Vs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Vs(e)}function Z$(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Wc(e,t)}function Wc(e,t){return Wc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Wc(e,t)}function Gc(e,t,r){return t=Lx(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Lx(e){var t=J$(e,"string");return ea(t)=="symbol"?t:t+""}function J$(e,t){if(ea(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ea(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Uh=1,Q$=function(e){function t(){var r;G$(this,t);for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return r=K$(this,t,[].concat(i)),Gc(r,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),Gc(r,"handleKeyDown",function(o){if(o.key==="Escape"){var l,c,u,f;r.setState({dismissed:!0,dismissedAtCoordinate:{x:(l=(c=r.props.coordinate)===null||c===void 0?void 0:c.x)!==null&&l!==void 0?l:0,y:(u=(f=r.props.coordinate)===null||f===void 0?void 0:f.y)!==null&&u!==void 0?u:0}})}}),r}return Z$(t,e),V$(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();(Math.abs(n.width-this.state.lastBoundingBox.width)>Uh||Math.abs(n.height-this.state.lastBoundingBox.height)>Uh)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,i=this.props,s=i.active,o=i.allowEscapeViewBox,l=i.animationDuration,c=i.animationEasing,u=i.children,f=i.coordinate,d=i.hasPayload,h=i.isAnimationActive,m=i.offset,v=i.position,x=i.reverseDirection,p=i.useTranslate3d,w=i.viewBox,j=i.wrapperStyle,_=W$({allowEscapeViewBox:o,coordinate:f,offsetTopLeft:m,position:v,reverseDirection:x,tooltipBox:this.state.lastBoundingBox,useTranslate3d:p,viewBox:w}
206),y=_.cssClasses,g=_.cssProperties,b=Fh(Fh({transition:h&&s?"transform ".concat(l,"ms ").concat(c):void 0},g),{},{pointerEvents:"none",visibility:!this.state.dismissed&&s&&d?"visible":"hidden",position:"absolute",top:0,left:0},j);return M.createElement("div",{tabIndex:-1,className:y,style:b,ref:function(O){n.wrapperNode=O}},u)}}])}(S.PureComponent),ek=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Pr={isSsr:ek(),get:function(t){return Pr[t]},set:function(t,r){if(typeof t=="string")Pr[t]=r;else{var n=Object.keys(t);n&&n.length&&n.forEach(function(i){Pr[i]=t[i]})}}};function ta(e){"@babel/helpers - typeof";return ta=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ta(e)}function zh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Hh(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?zh(Object(r),!0).forEach(function(n){Md(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zh(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function tk(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rk(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Bx(n.key),n)}}function nk(e,t,r){return t&&rk(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function ak(e,t,r){return t=Ks(t),ik(e,Rx()?Reflect.construct(t,r||[],Ks(e).constructor):t.apply(e,r))}function ik(e,t){if(t&&(ta(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return sk(e)}function sk(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Rx(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Rx=function(){return!!e})()}function Ks(e){return Ks=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ks(e)}function ok(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qc(e,t)}function qc(e,t){return qc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},qc(e,t)}function Md(e,t,r){return t=Bx(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Bx(e){var t=lk(e,"string");return ta(t)=="symbol"?t:t+""}function lk(e,t){if(ta(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ta(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ck(e){return e.dataKey}function uk(e,t){return M.isValidElement(e)?M.cloneElement(e,t):typeof e=="function"?M.createElement(e,t):M.createElement(R$,t)}var qt=function(e){function t(){return tk(this,t),ak(this,t,arguments)}return ok(t,e),nk(t,[{key:"render",value:function(){var n=this,i=this.props,s=i.active,o=i.allowEscapeViewBox,l=i.animationDuration,c=i.animationEasing,u=i.content,f=i.coordinate,d=i.filterNull,h=i.isAnimationActive,m=i.offset,v=i.payload,x=i.payloadUniqBy,p=i.position,w=i.reverseDirection,j=i.useTranslate3d,_=i.viewBox,y=i.wrapperStyle,g=v??[];d&&g.length&&(g=Px(v.filter(function(N){return N.value!=null&&(N.hide!==!0||n.props.includeHidden)}),x,ck));var b=g.length>0;return M.createElement(Q$,{allowEscapeViewBox:o,animationDuration:l,animationEasing:c,isAnimationActive:h,active:s,coordinate:f,hasPayload:b,offset:m,position:p,reverseDirection:w,useTranslate3d:j,viewBox:_,wrapperStyle:y},uk(u,Hh(Hh({},this.props),{},{payload:g})))}}])}(S.PureComponent);Md(qt,"displayName","Tooltip");Md(qt,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Pr.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var dk=cr,fk=function(){return dk.Date.now()},hk=fk,mk=/\s/;function pk(e){for(var t=e.length;t--&&mk.test(e.charAt(t)););return t}var gk=pk,vk=gk,xk=/^\s+/;function yk(e){return e&&e.slice(0,vk(e)+1).replace(xk,"")}var bk=yk,jk=bk,Wh=Kr,wk=wa,Gh=NaN,_k=/^[-+]0x[0-9a-f]+$/i,Nk=/^0b[01]+$/i,Sk=/^0o[0-7]+$/i,Ok=parseInt;function Ak(e){if(typeof e=="number")return e;if(wk(e))return Gh;if(Wh(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Wh(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=jk(e);var r=Nk.test(e);return r||Sk.test(e)?Ok(e.slice(2),r?2:8):_k.test(e)?Gh:+e}
vendor: 12,737 bytes, lines 206-212
206var Fx=Ak,Pk=Kr,zl=hk,qh=Fx,Tk="Expected a function",Ek=Math.max,Ck=Math.min;function $k(e,t,r){var n,i,s,o,l,c,u=0,f=!1,d=!1,h=!0;if(typeof e!="function")throw new TypeError(Tk);t=qh(t)||0,Pk(r)&&(f=!!r.leading,d="maxWait"in r,s=d?Ek(qh(r.maxWait)||0,t):s,h="trailing"in r?!!r.trailing:h);function m(b){var N=n,O=i;return n=i=void 0,u=b,o=e.apply(O,N),o}function v(b){return u=b,l=setTimeout(w,t),f?m(b):o}function x(b){var N=b-c,O=b-u,D=t-N;return d?Ck(D,s-O):D}function p(b){var N=b-c,O=b-u;return c===void 0||N>=t||N<0||d&&O>=s}function w(){var b=zl();if(p(b))return j(b);l=setTimeout(w,x(b))}function j(b){return l=void 0,h&&n?m(b):(n=i=void 0,o)}function _(){l!==void 0&&clearTimeout(l),u=0,n=c=i=l=void 0}function y(){return l===void 0?o:j(zl())}function g(){var b=zl(),N=p(b);if(n=arguments,i=this,c=b,N){if(l===void 0)return v(c);if(d)return clearTimeout(l),l=setTimeout(w,t),m(c)}return l===void 0&&(l=setTimeout(w,t)),o}return g.cancel=_,g.flush=y,g}var kk=$k,Mk=kk,Ik=Kr,Dk="Expected a function";function Lk(e,t,r){var n=!0,i=!0;if(typeof e!="function")throw new TypeError(Dk);return Ik(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),Mk(e,t,{leading:n,maxWait:t,trailing:i})}var Rk=Lk;const Ux=Re(Rk);function pi(e){"@babel/helpers - typeof";return pi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pi(e)}function Vh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ps(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Vh(Object(r),!0).forEach(function(n){Bk(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Vh(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Bk(e,t,r){return t=Fk(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fk(e){var t=Uk(e,"string");return pi(t)=="symbol"?t:t+""}function Uk(e,t){if(pi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(pi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zk(e,t){return qk(e)||Gk(e,t)||Wk(e,t)||Hk()}function Hk(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
207In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Wk(e,t){if(e){if(typeof e=="string")return Kh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Kh(e,t)}}function Kh(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Gk(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,s,o,l=[],c=!0,u=!1;try{if(s=(r=r.call(e)).next,t!==0)for(;!(c=(n=s.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,i=f}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function qk(e){if(Array.isArray(e))return e}var Xh=S.forwardRef(function(e,t){var r=e.aspect,n=e.initialDimension,i=n===void 0?{width:-1,height:-1}:n,s=e.width,o=s===void 0?"100%":s,l=e.height,c=l===void 0?"100%":l,u=e.minWidth,f=u===void 0?0:u,d=e.minHeight,h=e.maxHeight,m=e.children,v=e.debounce,x=v===void 0?0:v,p=e.id,w=e.className,j=e.onResize,_=e.style,y=_===void 0?{}:_,g=S.useRef(null),b=S.useRef();b.current=j,S.useImperativeHandle(t,function(){return Object.defineProperty(g.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),g.current},configurable:!0})});var N=S.useState({containerWidth:i.width,containerHeight:i.height}),O=zk(N,2),D=O[0],P=O[1],E=S.useCallback(function(I,L){P(function(U){var T=Math.round(I),B=Math.round(L);return U.containerWidth===T&&U.containerHeight===B?U:{containerWidth:T,containerHeight:B}})},[]);S.useEffect(function(){var I=function(ae){var F,G=ae[0].contentRect,re=G.width,R=G.height;E(re,R),(F=b.current)===null||F===void 0||F.call(b,re,R)};x>0&&(I=Ux(I,x,{trailing:!0,leading:!1}));var L=new ResizeObserver(I),U=g.current.getBoundingClientRect(),T=U.width,B=U.height;return E(T,B),L.observe(g.current),function(){L.disconnect()}},[E,x]);var $=S.useMemo(function(){var I=D.containerWidth,L=D.containerHeight;if(I<0||L<0)return null;Ar(sn(o)||sn(c),`The width(%s) and height(%s) are both fixed numbers,
208       maybe you don't need to use a ResponsiveContainer.`,o,c),Ar(!r||r>0,"The aspect(%s) must be greater than zero.",r);var U=sn(o)?I:o,T=sn(c)?L:c;r&&r>0&&(U?T=U/r:T&&(U=T*r),h&&T>h&&(T=h)),Ar(U>0||T>0,`The width(%s) and height(%s) of chart should be greater than 0,
209       please check the style of container, or the props width(%s) and height(%s),
210       or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
211       height and width.`,U,T,o,c,f,d,r);var B=!Array.isArray(m)&&Or(m.type).endsWith("Chart");return M.Children.map(m,function(W){return Lv.isElement(W)?S.cloneElement(W,ps({width:U,height:T},B?{style:ps({height:"100%",width:"100%",maxHeight:T,maxWidth:U},W.props.style)}:{})):W})},[r,m,c,h,d,f,D,o]);return M.createElement("div",{id:p?"".concat(p):void 0,className:Ce("recharts-responsive-container",w),style:ps(ps({},y),{},{width:o,height:c,minWidth:f,minHeight:d,maxHeight:h}),ref:g},$)}),zx=function(t){return null};zx.displayName="Cell";function gi(e){"@babel/helpers - typeof";return gi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gi(e)}function Yh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Vc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Yh(Object(r),!0).forEach(function(n){Vk(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yh(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Vk(e,t,r){return t=Kk(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Kk(e){var t=Xk(e,"string");return gi(t)=="symbol"?t:t+""}function Xk(e,t){if(gi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(gi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Mn={widthCache:{},cacheCount:0},Yk=2e3,Zk={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},Zh="recharts_measurement_span";function Jk(e){var t=Vc({},e);return Object.keys(t).forEach(function(r){t[r]||delete t[r]}),t}var ri=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Pr.isSsr)return{width:0,height:0};var n=Jk(r),i=JSON.stringify({text:t,copyStyle:n});if(Mn.widthCache[i])return Mn.widthCache[i];try{var s=document.getElementById(Zh);s||(s=document.createElement("span"),s.setAttribute("id",Zh),s.setAttribute("aria-hidden","true"),document.body.appendChild(s));var o=Vc(Vc({},Zk),n);Object.assign(s.style,o),s.textContent="".concat(t);var l=s.getBoundingClientRect(),c={width:l.width,height:l.height};return Mn.widthCache[i]=c,++Mn.cacheCount>Yk&&(Mn.cacheCount=0,Mn.widthCache={}),c}catch{return{width:0,height:0}}},Qk=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function vi(e){"@babel/helpers - typeof";return vi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vi(e)}function Xs(e,t){return nM(e)||rM(e,t)||tM(e,t)||eM()}function eM(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
212In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tM(e,t){if(e){if(typeof e=="string")return Jh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Jh(e,t)}}function Jh(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function rM(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,s,o,l=[],c=!0,u=!1;try{if(s=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=s.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,i=f}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function nM(e){if(Array.isArray(e))return e}function aM(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qh(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,sM(n.key),n)}}function iM(e,t,r){return t&&Qh(e.prototype,t),r&&Qh(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function sM(e){var t=oM(e,"string");return vi(t)=="symbol"?t:t+""}function oM(e,t){if(vi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(vi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var em=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,tm=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,lM=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,cM=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Hx={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},uM=Object.keys(Hx),Rn="NaN";function dM(e,t){return e*Hx[t]}var gs=function(){function e(t,r){aM(this,e),this.num=t,this.unit=r,this.num=t,this.unit=r,Number.isNaN(t)&&(this.unit=""),r!==""&&!lM.test(r)&&(this.num=NaN,this.unit=""),uM.includes(r)&&(this.num=dM(t,r),this.unit="px")}return iM(e,[{key:"add",value:function(r){return this.unit!==r.unit?new e(NaN,""):new e(this.num+r.num,this.unit)}},{key:"subtract",value:function(r){return this.unit!==r.unit?new e(NaN,""):new e(this.num-r.num,this.unit)}},{key:"multiply",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new e(NaN,""):new e(this.num*r.num,this.unit||r.unit)}},{key:"divide",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new e(NaN,""):new e(this.num/r.num,this.unit||r.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(r){var n,i=(n=cM.exec(r))!==null&&n!==void 0?n:[],s=Xs(i,3),o=s[1],l=s[2];return new e(parseFloat(o),l??"")}}])}();function Wx(e){if(e.includes(Rn))return Rn;for(var t=e;t.includes("*")||t.includes("/");){var r,n=(r=em.exec(t))!==null&&r!==void 0?r:[],i=Xs(n,4),s=i[1],o=i[2],l=i[3],c=gs.parse(s??""),u=gs.parse(l??""),f=o==="*"?c.multiply(u):c.divide(u);if(f.isNaN())return Rn;t=t.replace(em,f.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var d,h=(d=tm.exec(t))!==null&&d!==void 0?d:[],m=Xs(h,4),v=m[1],x=m[2],p=m[3],w=gs.parse(v??""),j=gs.parse(p??""),_=x==="+"?w.add(j):w.subtract(j);if(_.isNaN())return Rn;t=t.replace(tm,_.toString())}return t}var rm=/\(([^()]*)\)/;function fM(e){for(var t=e;t.includes("(");){var r=rm.exec(t),n=Xs(r,2),i=n[1];t=t.replace(rm,Wx(i))}return t}function hM(e){var t=e.replace(/\s+/g,"");return t=fM(t),t=Wx(t),t}function mM(e){try{return hM(e)}catch{return Rn}}function Hl(e){var t=mM(e.slice(5,-1));return t===Rn?"":t}var pM=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],gM=["dx","dy","angle","className","breakAll"];function Kc(){return Kc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];
212for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Kc.apply(this,arguments)}function nm(e,t){if(e==null)return{};var r=vM(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function vM(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function am(e,t){return jM(e)||bM(e,t)||yM(e,t)||xM()}function xM(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
213In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yM(e,t){if(e){if(typeof e=="string")return im(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return im(e,t)}}function im(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function bM(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,s,o,l=[],c=!0,u=!1;try{if(s=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=s.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,i=f}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function jM(e){if(Array.isArray(e))return e}var Gx=/[ \f\n\r\t\v\u2028\u2029]+/,qx=function(t){var r=t.children,n=t.breakAll,i=t.style;try{var s=[];Ae(r)||(n?s=r.toString().split(""):s=r.toString().split(Gx));var o=s.map(function(c){return{word:c,width:ri(c,i).width}}),l=n?0:ri(" ",i).width;return{wordsWithComputedWidth:o,spaceWidth:l}}catch{return null}},wM=function(t,r,n,i,s){var o=t.maxLines,l=t.children,c=t.style,u=t.breakAll,f=ie(o),d=l,h=function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return U.reduce(function(T,B){var W=B.word,ae=B.width,F=T[T.length-1];if(F&&(i==null||s||F.width+ae+n<Number(i)))F.words.push(W),F.width+=ae+n;else{var G={words:[W],width:ae};T.push(G)}return T},[])},m=h(r),v=function(U){return U.reduce(function(T,B){return T.width>B.width?T:B})};if(!f)return m;for(var x="…",p=function(U){var T=d.slice(0,U),B=qx({breakAll:u,style:c,children:T+x}).wordsWithComputedWidth,W=h(B),ae=W.length>o||v(W).width>Number(i);return[ae,W]},w=0,j=d.length-1,_=0,y;w<=j&&_<=d.length-1;){var g=Math.floor((w+j)/2),b=g-1,N=p(b),O=am(N,2),D=O[0],P=O[1],E=p(g),$=am(E,1),I=$[0];if(!D&&!I&&(w=g+1),D&&I&&(j=g-1),!D&&I){y=P;break}_++}return y||m},sm=function(t){var r=Ae(t)?[]:t.toString().split(Gx);return[{words:r}]},_M=function(t){var r=t.width,n=t.scaleToFit,i=t.children,s=t.style,o=t.breakAll,l=t.maxLines;if((r||n)&&!Pr.isSsr){var c,u,f=qx({breakAll:o,children:i,style:s});if(f){var d=f.wordsWithComputedWidth,h=f.spaceWidth;c=d,u=h}else return sm(i);return wM({breakAll:o,children:i,maxLines:l,style:s},c,u,r,n)}return sm(i)},om="#808080",Ys=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,s=i===void 0?0:i,o=t.lineHeight,l=o===void 0?"1em":o,c=t.capHeight,u=c===void 0?"0.71em":c,f=t.scaleToFit,d=f===void 0?!1:f,h=t.textAnchor,m=h===void 0?"start":h,v=t.verticalAnchor,x=v===void 0?"end":v,p=t.fill,w=p===void 0?om:p,j=nm(t,pM),_=S.useMemo(function(){return _M({breakAll:j.breakAll,children:j.children,maxLines:j.maxLines,scaleToFit:d,style:j.style,width:j.width})},[j.breakAll,j.children,j.maxLines,d,j.style,j.width]),y=j.dx,g=j.dy,b=j.angle,N=j.className,O=j.breakAll,D=nm(j,gM);if(!Qe(n)||!Qe(s))return null;var P=n+(ie(y)?y:0),E=s+(ie(g)?g:0),$;switch(x){case"start":$=Hl("calc(".concat(u,")"));break;case"middle":$=Hl("calc(".concat((_.length-1)/2," * -").concat(l," + (").concat(u," / 2))"));break;default:$=Hl("calc(".concat(_.length-1," * -").concat(l,")"));break}var I=[];if(d){var L=_[0].width,U=j.width;I.push("scale(".concat((ie(U)?U/L:1)/L,")"))}return b&&I.push("rotate(".concat(b,", ").concat(P,", ").concat(E,")")),I.length&&(D.transform=I.join(" ")),M.createElement("text",Kc({},Ee(D,!0),{x:P,y:E,className:Ce("recharts-text",N),textAnchor:m,fill:w.includes("url")?om:w}),_.map(function(T,B){var W=T.words.join(O?"":" ");return M.createElement("tspan",{x:P,dy:B===0?$:l,key:"".concat(W,"-").concat(B)},W)}))};function Hr(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function NM(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Id(e){let t,r,n;e.length!==2?(t=Hr,r=(l,c)=>Hr(e(l),c),n=(l,c)=>e(l)-c):(t=e===Hr||e===NM?e:SM,r=e,n=e);function i(l,c,u=0,f=l.length){if(u<f){if(t(c,c)!==0)return f;do{const d=u+f>>>1;r(l[d],c)<0?u=d+1:f=d}while(u<f)}return u}function s(l,c,u=0,f=l.length){if(u<f){if(t(c,c)!==0)return f;do{const d=u+f>>>1;r(l[d],c)<=0?u=d+1:f=d}while(u<f)}return u}function o(l,c,u=0,f=l.length){const d=i(l,c,u,f-1);return d>u&&n(l[d-1],c)>-n(l[d],c)?d-1:d}return{left:i,center:o,right:s}}function SM(){return 0}function Vx(e){return e===null?NaN:+e}function*OM(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const AM=Id(Hr),es=AM.right;Id(Vx).center;class lm extends Map{constructor(t,r=EM){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(cm(this,t))}has(t){return super.has(cm(this,t))}set(t,r){return super.set(PM(this,t),r)}delete(t){return super.delete(TM(this,t))}}function cm({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function PM({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function TM({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function EM(e){return e!==null&&typeof e=="object"?e.valueOf():e}function CM(e=Hr){if(e===Hr)return Kx;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function Kx(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const $M=Math.sqrt(50),kM=Math.sqrt(10),MM=Math.sqrt(2);function Zs(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),s=n/Math.pow(10,i),o=s>=$M?10:s>=kM?5:s>=MM?2:1;let l,c,u;return i<0?(u=Math.pow(10,-i)/o,l=Math.round(e*u),c=Math.round(t*u),l/u<e&&++l,c/u>t&&--c,u=-u):(u=Math.pow(10,i)*o,l=Math.round(e/u),c=Math.round(t/u),l*u<e&&++l,c*u>t&&--c),c<l&&.5<=r&&r<2?Zs(e,t,r*2):[l,c,u]}function Xc(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const n=t<e,[i,s,o]=n?Zs(t,e,r):Zs(e,t,r);if(!(s>=i))return[];const l=s-i+1,c=new Array(l);if(n)if(o<0)for(let u=0;u<l;++u)c[u]=(s-u)/-o;else for(let u=0;u<l;++u)c[u]=(s-u)*o;else if(o<0)for(let u=0;u<l;++u)c[u]=(i+u)/-o;else for(let u=0;u<l;++u)c[u]=(i+u)*o;return c}function Yc(e,t,r){return t=+t,e=+e,r=+r,Zs(e,t,r)[2]}function Zc(e,t,r){t=+t,e=+e,r=+r;const n=t<e,i=n?Yc(t,e,r):Yc(e,t,r);return(n?-1:1)*(i<0?1/-i:i)}function um(e,t){let r;for(const n of e)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function dm(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}
213function Xx(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?Kx:CM(i);n>r;){if(n-r>600){const c=n-r+1,u=t-r+1,f=Math.log(c),d=.5*Math.exp(2*f/3),h=.5*Math.sqrt(f*d*(c-d)/c)*(u-c/2<0?-1:1),m=Math.max(r,Math.floor(t-u*d/c+h)),v=Math.min(n,Math.floor(t+(c-u)*d/c+h));Xx(e,t,m,v,i)}const s=e[t];let o=r,l=n;for(Fa(e,r,t),i(e[n],s)>0&&Fa(e,r,n);o<l;){for(Fa(e,o,l),++o,--l;i(e[o],s)<0;)++o;for(;i(e[l],s)>0;)--l}i(e[r],s)===0?Fa(e,r,l):(++l,Fa(e,l,n)),l<=t&&(r=l+1),t<=l&&(n=l-1)}return e}function Fa(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function IM(e,t,r){if(e=Float64Array.from(OM(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return dm(e);if(t>=1)return um(e);var n,i=(n-1)*t,s=Math.floor(i),o=um(Xx(e,s).subarray(0,s+1)),l=dm(e.subarray(s+1));return o+(l-o)*(i-s)}}function DM(e,t,r=Vx){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,s=Math.floor(i),o=+r(e[s],s,e),l=+r(e[s+1],s+1,e);return o+(l-o)*(i-s)}}function LM(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,s=new Array(i);++n<i;)s[n]=e+n*r;return s}function Ht(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Rr(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const Jc=Symbol("implicit");function Dd(){var e=new lm,t=[],r=[],n=Jc;function i(s){let o=e.get(s);if(o===void 0){if(n!==Jc)return n;e.set(s,o=t.push(s)-1)}return r[o%r.length]}return i.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new lm;for(const o of s)e.has(o)||e.set(o,t.push(o)-1);return i},i.range=function(s){return arguments.length?(r=Array.from(s),i):r.slice()},i.unknown=function(s){return arguments.length?(n=s,i):n},i.copy=function(){return Dd(t,r).unknown(n)},Ht.apply(i,arguments),i}function xi(){var e=Dd().unknown(void 0),t=e.domain,r=e.range,n=0,i=1,s,o,l=!1,c=0,u=0,f=.5;delete e.unknown;function d(){var h=t().length,m=i<n,v=m?i:n,x=m?n:i;s=(x-v)/Math.max(1,h-c+u*2),l&&(s=Math.floor(s)),v+=(x-v-s*(h-c))*f,o=s*(1-c),l&&(v=Math.round(v),o=Math.round(o));var p=LM(h).map(function(w){return v+s*w});return r(m?p.reverse():p)}return e.domain=function(h){return arguments.length?(t(h),d()):t()},e.range=function(h){return arguments.length?([n,i]=h,n=+n,i=+i,d()):[n,i]},e.rangeRound=function(h){return[n,i]=h,n=+n,i=+i,l=!0,d()},e.bandwidth=function(){return o},e.step=function(){return s},e.round=function(h){return arguments.length?(l=!!h,d()):l},e.padding=function(h){return arguments.length?(c=Math.min(1,u=+h),d()):c},e.paddingInner=function(h){return arguments.length?(c=Math.min(1,h),d()):c},e.paddingOuter=function(h){return arguments.length?(u=+h,d()):u},e.align=function(h){return arguments.length?(f=Math.max(0,Math.min(1,h)),d()):f},e.copy=function(){return xi(t(),[n,i]).round(l).paddingInner(c).paddingOuter(u).align(f)},Ht.apply(d(),arguments)}function Yx(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return Yx(t())},e}function ni(){return Yx(xi.apply(null,arguments).paddingInner(1))}function Ld(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function Zx(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function ts(){}var yi=.7,Js=1/yi,Hn="\\s*([+-]?\\d+)\\s*",bi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",sr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",RM=/^#([0-9a-f]{3,8})$/,BM=new RegExp(`^rgb\\(${Hn},${Hn},${Hn}\\)$`),FM=new RegExp(`^rgb\\(${sr},${sr},${sr}\\)$`),UM=new RegExp(`^rgba\\(${Hn},${Hn},${Hn},${bi}\\)$`),zM=new RegExp(`^rgba\\(${sr},${sr},${sr},${bi}\\)$`),HM=new RegExp(`^hsl\\(${bi},${sr},${sr}\\)$`),WM=new RegExp(`^hsla\\(${bi},${sr},${sr},${bi}\\)$`),fm={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Ld(ts,ji,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:hm,formatHex:hm,formatHex8:GM,formatHsl:qM,formatRgb:mm,toString:mm});function hm(){return this.rgb().formatHex()}function GM(){return this.rgb().formatHex8()}function qM(){return Jx(this).formatHsl()}function mm(){return this.rgb().formatRgb()}function ji(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=RM.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?pm(t):r===3?new Nt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?vs(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?vs(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>
vendor: 4,196 bytes, line 213
2134&15|t&240,((t&15)<<4|t&15)/255):null):(t=BM.exec(e))?new Nt(t[1],t[2],t[3],1):(t=FM.exec(e))?new Nt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=UM.exec(e))?vs(t[1],t[2],t[3],t[4]):(t=zM.exec(e))?vs(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=HM.exec(e))?xm(t[1],t[2]/100,t[3]/100,1):(t=WM.exec(e))?xm(t[1],t[2]/100,t[3]/100,t[4]):fm.hasOwnProperty(e)?pm(fm[e]):e==="transparent"?new Nt(NaN,NaN,NaN,0):null}function pm(e){return new Nt(e>>16&255,e>>8&255,e&255,1)}function vs(e,t,r,n){return n<=0&&(e=t=r=NaN),new Nt(e,t,r,n)}function VM(e){return e instanceof ts||(e=ji(e)),e?(e=e.rgb(),new Nt(e.r,e.g,e.b,e.opacity)):new Nt}function Qc(e,t,r,n){return arguments.length===1?VM(e):new Nt(e,t,r,n??1)}function Nt(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}Ld(Nt,Qc,Zx(ts,{brighter(e){return e=e==null?Js:Math.pow(Js,e),new Nt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?yi:Math.pow(yi,e),new Nt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Nt(hn(this.r),hn(this.g),hn(this.b),Qs(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:gm,formatHex:gm,formatHex8:KM,formatRgb:vm,toString:vm}));function gm(){return`#${on(this.r)}${on(this.g)}${on(this.b)}`}function KM(){return`#${on(this.r)}${on(this.g)}${on(this.b)}${on((isNaN(this.opacity)?1:this.opacity)*255)}`}function vm(){const e=Qs(this.opacity);return`${e===1?"rgb(":"rgba("}${hn(this.r)}, ${hn(this.g)}, ${hn(this.b)}${e===1?")":`, ${e})`}`}function Qs(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function hn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function on(e){return e=hn(e),(e<16?"0":"")+e.toString(16)}function xm(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Yt(e,t,r,n)}function Jx(e){if(e instanceof Yt)return new Yt(e.h,e.s,e.l,e.opacity);if(e instanceof ts||(e=ji(e)),!e)return new Yt;if(e instanceof Yt)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),s=Math.max(t,r,n),o=NaN,l=s-i,c=(s+i)/2;return l?(t===s?o=(r-n)/l+(r<n)*6:r===s?o=(n-t)/l+2:o=(t-r)/l+4,l/=c<.5?s+i:2-s-i,o*=60):l=c>0&&c<1?0:o,new Yt(o,l,c,e.opacity)}function XM(e,t,r,n){return arguments.length===1?Jx(e):new Yt(e,t,r,n??1)}function Yt(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}Ld(Yt,XM,Zx(ts,{brighter(e){return e=e==null?Js:Math.pow(Js,e),new Yt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?yi:Math.pow(yi,e),new Yt(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new Nt(Wl(e>=240?e-240:e+120,i,n),Wl(e,i,n),Wl(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new Yt(ym(this.h),xs(this.s),xs(this.l),Qs(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=Qs(this.opacity);return`${e===1?"hsl(":"hsla("}${ym(this.h)}, ${xs(this.s)*100}%, ${xs(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ym(e){return e=(e||0)%360,e<0?e+360:e}function xs(e){return Math.max(0,Math.min(1,e||0))}function Wl(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const Rd=e=>()=>e;function YM(e,t){return function(r){return e+r*t}}function ZM(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function JM(e){return(e=+e)==1?Qx:function(t,r){return r-t?ZM(t,r,e):Rd(isNaN(t)?r:t)}}function Qx(e,t){var r=t-e;return r?YM(e,r):Rd(isNaN(e)?t:e)}const bm=function e(t){var r=JM(t);function n(i,s){var o=r((i=Qc(i)).r,(s=Qc(s)).r),l=r(i.g,s.g),c=r(i.b,s.b),u=Qx(i.opacity,s.opacity);return function(f){return i.r=o(f),i.g=l(f),i.b=c(f),i.opacity=u(f),i+""}}return n.gamma=e,n}(1);function QM(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(s){for(i=0;i<r;++i)n[i]=e[i]*(1-s)+t[i]*s;return n}}function eI(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function tI(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,i=new Array(n),s=new Array(r),o;for(o=0;o<n;++o)i[o]=Ea(e[o],t[o]);for(;o<r;
vendor: 5,485 bytes, line 213
213++o)s[o]=t[o];return function(l){for(o=0;o<n;++o)s[o]=i[o](l);return s}}function rI(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function eo(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function nI(e,t){var r={},n={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?r[i]=Ea(e[i],t[i]):n[i]=t[i];return function(s){for(i in r)n[i]=r[i](s);return n}}var eu=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Gl=new RegExp(eu.source,"g");function aI(e){return function(){return e}}function iI(e){return function(t){return e(t)+""}}function sI(e,t){var r=eu.lastIndex=Gl.lastIndex=0,n,i,s,o=-1,l=[],c=[];for(e=e+"",t=t+"";(n=eu.exec(e))&&(i=Gl.exec(t));)(s=i.index)>r&&(s=t.slice(r,s),l[o]?l[o]+=s:l[++o]=s),(n=n[0])===(i=i[0])?l[o]?l[o]+=i:l[++o]=i:(l[++o]=null,c.push({i:o,x:eo(n,i)})),r=Gl.lastIndex;return r<t.length&&(s=t.slice(r),l[o]?l[o]+=s:l[++o]=s),l.length<2?c[0]?iI(c[0].x):aI(t):(t=c.length,function(u){for(var f=0,d;f<t;++f)l[(d=c[f]).i]=d.x(u);return l.join("")})}function Ea(e,t){var r=typeof t,n;return t==null||r==="boolean"?Rd(t):(r==="number"?eo:r==="string"?(n=ji(t))?(t=n,bm):sI:t instanceof ji?bm:t instanceof Date?rI:eI(t)?QM:Array.isArray(t)?tI:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?nI:eo)(e,t)}function Bd(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function oI(e,t){t===void 0&&(t=e,e=Ea);for(var r=0,n=t.length-1,i=t[0],s=new Array(n<0?0:n);r<n;)s[r]=e(i,i=t[++r]);return function(o){var l=Math.max(0,Math.min(n-1,Math.floor(o*=n)));return s[l](o-l)}}function lI(e){return function(){return e}}function to(e){return+e}var jm=[0,1];function xt(e){return e}function tu(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:lI(isNaN(t)?NaN:.5)}function cI(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function uI(e,t,r){var n=e[0],i=e[1],s=t[0],o=t[1];return i<n?(n=tu(i,n),s=r(o,s)):(n=tu(n,i),s=r(s,o)),function(l){return s(n(l))}}function dI(e,t,r){var n=Math.min(e.length,t.length)-1,i=new Array(n),s=new Array(n),o=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<n;)i[o]=tu(e[o],e[o+1]),s[o]=r(t[o],t[o+1]);return function(l){var c=es(e,l,1,n)-1;return s[c](i[c](l))}}function rs(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function ol(){var e=jm,t=jm,r=Ea,n,i,s,o=xt,l,c,u;function f(){var h=Math.min(e.length,t.length);return o!==xt&&(o=cI(e[0],e[h-1])),l=h>2?dI:uI,c=u=null,d}function d(h){return h==null||isNaN(h=+h)?s:(c||(c=l(e.map(n),t,r)))(n(o(h)))}return d.invert=function(h){return o(i((u||(u=l(t,e.map(n),eo)))(h)))},d.domain=function(h){return arguments.length?(e=Array.from(h,to),f()):e.slice()},d.range=function(h){return arguments.length?(t=Array.from(h),f()):t.slice()},d.rangeRound=function(h){return t=Array.from(h),r=Bd,f()},d.clamp=function(h){return arguments.length?(o=h?!0:xt,f()):o!==xt},d.interpolate=function(h){return arguments.length?(r=h,f()):r},d.unknown=function(h){return arguments.length?(s=h,d):s},function(h,m){return n=h,i=m,f()}}function Fd(){return ol()(xt,xt)}function fI(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function ro(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function ra(e){return e=ro(Math.abs(e)),e?e[1]:NaN}function hI(e,t){return function(r,n){for(var i=r.length,s=[],o=0,l=e[0],c=0;i>0&&l>0&&(c+l+1>n&&(l=Math.max(1,n-c)),s.push(r.substring(i-=l,i+l)),!((c+=l+1)>n));)l=e[o=(o+1)%e.length];return s.reverse().join(t)}}function mI(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var pI=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function wi(e){if(!(t=pI.exec(e)))throw new Error("invalid format: "+e);var t;return new Ud({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]})}wi.prototype=Ud.prototype;function Ud(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+""}Ud.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 gI(e){e:for(var t=e.length,r=1,n=-1,i;r<t;++r)switch(e[r]){case".":n=i=r;break;case"0":n===0&&(n=r),i=r;break;default:if(!+e[r])break e;n>0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var ey;function vI(e,t){var r=ro(e,t);if(!r)return e+"";var n=r[0],i=r[1],s=i-(ey=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return s===o?n:s>o?n+new Array(s-o+1).join("0"):s>0?n.slice(0,s)+"."+n.slice(s):"0."+new Array(1-s).join("0")+ro(e,Math.max(0,t+s-1))[0]}function wm(e,t){var r=ro(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const _m={"%":(e,t)=>
vendor: 5,593 bytes, line 213
213(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:fI,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)=>wm(e*100,t),r:wm,s:vI,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Nm(e){return e}var Sm=Array.prototype.map,Om=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function xI(e){var t=e.grouping===void 0||e.thousands===void 0?Nm:hI(Sm.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?Nm:mI(Sm.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(d){d=wi(d);var h=d.fill,m=d.align,v=d.sign,x=d.symbol,p=d.zero,w=d.width,j=d.comma,_=d.precision,y=d.trim,g=d.type;g==="n"?(j=!0,g="g"):_m[g]||(_===void 0&&(_=12),y=!0,g="g"),(p||h==="0"&&m==="=")&&(p=!0,h="0",m="=");var b=x==="$"?r:x==="#"&&/[boxX]/.test(g)?"0"+g.toLowerCase():"",N=x==="$"?n:/[%p]/.test(g)?o:"",O=_m[g],D=/[defgprs%]/.test(g);_=_===void 0?6:/[gprs]/.test(g)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function P(E){var $=b,I=N,L,U,T;if(g==="c")I=O(E)+I,E="";else{E=+E;var B=E<0||1/E<0;if(E=isNaN(E)?c:O(Math.abs(E),_),y&&(E=gI(E)),B&&+E==0&&v!=="+"&&(B=!1),$=(B?v==="("?v:l:v==="-"||v==="("?"":v)+$,I=(g==="s"?Om[8+ey/3]:"")+I+(B&&v==="("?")":""),D){for(L=-1,U=E.length;++L<U;)if(T=E.charCodeAt(L),48>T||T>57){I=(T===46?i+E.slice(L+1):E.slice(L))+I,E=E.slice(0,L);break}}}j&&!p&&(E=t(E,1/0));var W=$.length+E.length+I.length,ae=W<w?new Array(w-W+1).join(h):"";switch(j&&p&&(E=t(ae+E,ae.length?w-I.length:1/0),ae=""),m){case"<":E=$+E+I+ae;break;case"=":E=$+ae+E+I;break;case"^":E=ae.slice(0,W=ae.length>>1)+$+E+I+ae.slice(W);break;default:E=ae+$+E+I;break}return s(E)}return P.toString=function(){return d+""},P}function f(d,h){var m=u((d=wi(d),d.type="f",d)),v=Math.max(-8,Math.min(8,Math.floor(ra(h)/3)))*3,x=Math.pow(10,-v),p=Om[8+v/3];return function(w){return m(x*w)+p}}return{format:u,formatPrefix:f}}var ys,zd,ty;yI({thousands:",",grouping:[3],currency:["$",""]});function yI(e){return ys=xI(e),zd=ys.format,ty=ys.formatPrefix,ys}function bI(e){return Math.max(0,-ra(Math.abs(e)))}function jI(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ra(t)/3)))*3-ra(Math.abs(e)))}function wI(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,ra(t)-ra(e))+1}function ry(e,t,r,n){var i=Zc(e,t,r),s;switch(n=wi(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(s=jI(i,o))&&(n.precision=s),ty(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(s=wI(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=s-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(s=bI(i))&&(n.precision=s-(n.type==="%")*2);break}}return zd(n)}function Yr(e){var t=e.domain;return e.ticks=function(r){var n=t();return Xc(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return ry(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,s=n.length-1,o=n[i],l=n[s],c,u,f=10;for(l<o&&(u=o,o=l,l=u,u=i,i=s,s=u);f-- >0;){if(u=Yc(o,l,r),u===c)return n[i]=o,n[s]=l,t(n);if(u>0)o=Math.floor(o/u)*u,l=Math.ceil(l/u)*u;else if(u<0)o=Math.ceil(o*u)/u,l=Math.floor(l*u)/u;else break;c=u}return e},e}function no(){var e=Fd();return e.copy=function(){return rs(e,no())},Ht.apply(e,arguments),Yr(e)}function ny(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,to),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return ny(e).unknown(t)},e=arguments.length?Array.from(e,to):[0,1],Yr(r)}function ay(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],s=e[n],o;return s<i&&(o=r,r=n,n=o,o=i,i=s,s=o),e[r]=t.floor(i),e[n]=t.ceil(s),e}function Am(e){return Math.log(e)}function Pm(e){return Math.exp(e)}function _I(e){return-Math.log(-e)}function NI(e){return-Math.exp(-e)}function SI(e){return isFinite(e)?+("1e"+e):e<0?0:e}function OI(e){return e===10?SI:e===Math.E?Math.exp:t=>Math.pow(e,t)}function AI(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 Tm(e){return(t,r)=>-e(-t,r)}function Hd(e){const t=e(Am,Pm),r=t.domain;let n=10,i,s;function o(){return i=AI(n),s=OI(n),r()[0]<0?(i=Tm(i),s=Tm(s),e(_I,NI)):e(Am,Pm),t}return t.base=function(l){return arguments.length?(n=+l,o()):n},t.domain=function(l){return arguments.length?(r(l),o()):r()},t.ticks=l=>{const c=r();let u=c[0],f=c[c.length-1];const d=f<u;d&&([u,f]=[f,u]);let h=i(u),m=i(f),v,x;const p=l==null?10:+l;let w=[];if(!(n%1)&&m-h<p){if(h=Math.floor(h),m=Math.ceil(m),u>0){for(;h<=m;++h)for(v=1;v<n;++v)if(x=h<0?v/s(-h):v*s(h),!(x<u)){if(x>f)break;w.push(x)}}else for(;h<=m;++h)for(v=n-1;v>=1;--v)if(x=h>0?v/s(-h):v*s(h),!(x<u)){if(x>f)break;w.push(x)}w.length*2<p&&(w=Xc(u,f,p))}else w=Xc(h,m,Math.min(m-h,p)).map(s);return d?w.reverse():w},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=n===10?"s":","),typeof c!="function"&&(!(n%1)&&(c=wi(c)).precision==null&&(c.trim=!0),c=zd(c)),l===1/0)return c;const u=Math.max(1,n*l/t.ticks().length);return f=>{let d=f/s(Math.round(i(f)));return d*n<n-.5&&(d*=n),d<=u?c(f):""}},t.nice=()=>r(ay(r(),{floor:l=>s(Math.floor(i(l))),ceil:l=>s(Math.ceil(i(l)))})),t}function iy(){const e=Hd(ol()).domain([1,10]);return e.copy=()=>rs(e,iy()).base(e.base()),Ht.apply(e,arguments),e}
213function Em(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function Cm(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Wd(e){var t=1,r=e(Em(t),Cm(t));return r.constant=function(n){return arguments.length?e(Em(t=+n),Cm(t)):t},Yr(r)}function sy(){var e=Wd(ol());return e.copy=function(){return rs(e,sy()).constant(e.constant())},Ht.apply(e,arguments)}function $m(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function PI(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function TI(e){return e<0?-e*e:e*e}function Gd(e){var t=e(xt,xt),r=1;function n(){return r===1?e(xt,xt):r===.5?e(PI,TI):e($m(r),$m(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},Yr(t)}function qd(){var e=Gd(ol());return e.copy=function(){return rs(e,qd()).exponent(e.exponent())},Ht.apply(e,arguments),e}function EI(){return qd.apply(null,arguments).exponent(.5)}function km(e){return Math.sign(e)*e*e}function CI(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function oy(){var e=Fd(),t=[0,1],r=!1,n;function i(s){var o=CI(e(s));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(s){return e.invert(km(s))},i.domain=function(s){return arguments.length?(e.domain(s),i):e.domain()},i.range=function(s){return arguments.length?(e.range((t=Array.from(s,to)).map(km)),i):t.slice()},i.rangeRound=function(s){return i.range(s).round(!0)},i.round=function(s){return arguments.length?(r=!!s,i):r},i.clamp=function(s){return arguments.length?(e.clamp(s),i):e.clamp()},i.unknown=function(s){return arguments.length?(n=s,i):n},i.copy=function(){return oy(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},Ht.apply(i,arguments),Yr(i)}function ly(){var e=[],t=[],r=[],n;function i(){var o=0,l=Math.max(1,t.length);for(r=new Array(l-1);++o<l;)r[o-1]=DM(e,o/l);return s}function s(o){return o==null||isNaN(o=+o)?n:t[es(r,o)]}return s.invertExtent=function(o){var l=t.indexOf(o);return l<0?[NaN,NaN]:[l>0?r[l-1]:e[0],l<r.length?r[l]:e[e.length-1]]},s.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let l of o)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(Hr),i()},s.range=function(o){return arguments.length?(t=Array.from(o),i()):t.slice()},s.unknown=function(o){return arguments.length?(n=o,s):n},s.quantiles=function(){return r.slice()},s.copy=function(){return ly().domain(e).range(t).unknown(n)},Ht.apply(s,arguments)}function cy(){var e=0,t=1,r=1,n=[.5],i=[0,1],s;function o(c){return c!=null&&c<=c?i[es(n,c,0,r)]:s}function l(){var c=-1;for(n=new Array(r);++c<r;)n[c]=((c+1)*t-(c-r)*e)/(r+1);return o}return o.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},o.range=function(c){return arguments.length?(r=(i=Array.from(c)).length-1,l()):i.slice()},o.invertExtent=function(c){var u=i.indexOf(c);return u<0?[NaN,NaN]:u<1?[e,n[0]]:u>=r?[n[r-1],t]:[n[u-1],n[u]]},o.unknown=function(c){return arguments.length&&(s=c),o},o.thresholds=function(){return n.slice()},o.copy=function(){return cy().domain([e,t]).range(i).unknown(s)},Ht.apply(Yr(o),arguments)}function uy(){var e=[.5],t=[0,1],r,n=1;function i(s){return s!=null&&s<=s?t[es(e,s,0,n)]:r}return i.domain=function(s){return arguments.length?(e=Array.from(s),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(s){return arguments.length?(t=Array.from(s),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(s){var o=t.indexOf(s);return[e[o-1],e[o]]},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return uy().domain(e).range(t).unknown(r)},Ht.apply(i,arguments)}const ql=new Date,Vl=new Date;function et(e,t,r,n){function i(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=s=>(e(s=new Date(+s)),s),i.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),i.round=s=>{const o=i(s),l=i.ceil(s);return s-o<l-s?o:l},i.offset=(s,o)=>(t(s=new Date(+s),o==null?1:Math.floor(o)),s),i.range=(s,o,l)=>{const c=[];if(s=i.ceil(s),l=l==null?1:Math.floor(l),!(s<o)||!(l>0))return c;let u;do c.push(u=new Date(+s)),t(s,l),e(s);while(u<s&&s<o);return c},i.filter=s=>et(o=>{if(o>=o)for(;e(o),!s(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;t(o,-1),!s(o););else for(;--l>=0;)for(;t(o,1),!s(o););}),r&&(i.count=(s,o)=>(ql.setTime(+s),Vl.setTime(+o),e(ql),e(Vl),Math.floor(r(ql,Vl))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(n?o=>n(o)%s===0:o=>i.count(0,o)%s===0):i)),i}const ao=et(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);ao.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?et(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):ao);ao.range;const vr=1e3,Lt=vr*60,xr=Lt*60,$r=xr*24,Vd=$r*7,Mm=$r*30,Kl=$r*365,ln=et(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*vr)},(e,t)=>(t-e)/vr,e=>e.getUTCSeconds());ln.range;const Kd=et(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*vr)},(e,t)=>{e.setTime(+e+t*Lt)},(e,t)=>(t-e)/Lt,e=>e.getMinutes());Kd.range;const Xd=et(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Lt)},(e,t)=>(t-e)/Lt,e=>e.getUTCMinutes());Xd.range;const Yd=et(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*vr-e.getMinutes()*Lt)},(e,t)=>{e.setTime(+e+t*xr)},(e,t)=>(t-e)/xr,e=>e.getHours());Yd.range;const Zd=et(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*xr)},(e,t)=>(t-e)/xr,e=>e.getUTCHours());Zd.range;const ns=et(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Lt)/$r,e=>e.getDate()-1);ns.range;const ll=et(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/$r,e=>e.getUTCDate()-1);ll.range;const dy=et(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/$r,e=>Math.floor(e/$r));dy.range;function An(e){return et(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*Lt)/Vd)}const cl=An(0),io=An(1),$I=An(2),kI=An(3),na=An(4),MI=An(5),II=An(6);cl.range;io.range;$I.range;kI.range;na.range;MI.range;II.range;function Pn(e){return et(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/Vd)}const ul=Pn(0),so=Pn(1),DI=Pn(2),LI=Pn(3),aa=Pn(4),RI=Pn(5),BI=Pn(6);ul.range;so.range;DI.range;LI.range;aa.range;RI.range;BI.range;const Jd=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());Jd.range;const Qd=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());Qd.range;
vendor: 7,852 bytes, line 213
213const kr=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());kr.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,r)=>{t.setFullYear(t.getFullYear()+r*e)});kr.range;const Mr=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());Mr.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,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});Mr.range;function fy(e,t,r,n,i,s){const o=[[ln,1,vr],[ln,5,5*vr],[ln,15,15*vr],[ln,30,30*vr],[s,1,Lt],[s,5,5*Lt],[s,15,15*Lt],[s,30,30*Lt],[i,1,xr],[i,3,3*xr],[i,6,6*xr],[i,12,12*xr],[n,1,$r],[n,2,2*$r],[r,1,Vd],[t,1,Mm],[t,3,3*Mm],[e,1,Kl]];function l(u,f,d){const h=f<u;h&&([u,f]=[f,u]);const m=d&&typeof d.range=="function"?d:c(u,f,d),v=m?m.range(u,+f+1):[];return h?v.reverse():v}function c(u,f,d){const h=Math.abs(f-u)/d,m=Id(([,,p])=>p).right(o,h);if(m===o.length)return e.every(Zc(u/Kl,f/Kl,d));if(m===0)return ao.every(Math.max(Zc(u,f,d),1));const[v,x]=o[h/o[m-1][2]<o[m][2]/h?m-1:m];return v.every(x)}return[l,c]}const[FI,UI]=fy(Mr,Qd,ul,dy,Zd,Xd),[zI,HI]=fy(kr,Jd,cl,ns,Yd,Kd);function Xl(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Yl(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Ua(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function WI(e){var t=e.dateTime,r=e.date,n=e.time,i=e.periods,s=e.days,o=e.shortDays,l=e.months,c=e.shortMonths,u=za(i),f=Ha(i),d=za(s),h=Ha(s),m=za(o),v=Ha(o),x=za(l),p=Ha(l),w=za(c),j=Ha(c),_={a:B,A:W,b:ae,B:F,c:null,d:Fm,e:Fm,f:hD,g:_D,G:SD,H:uD,I:dD,j:fD,L:hy,m:mD,M:pD,p:G,q:re,Q:Hm,s:Wm,S:gD,u:vD,U:xD,V:yD,w:bD,W:jD,x:null,X:null,y:wD,Y:ND,Z:OD,"%":zm},y={a:R,A:te,b:A,B:X,c:null,d:Um,e:Um,f:ED,g:FD,G:zD,H:AD,I:PD,j:TD,L:py,m:CD,M:$D,p:le,q:he,Q:Hm,s:Wm,S:kD,u:MD,U:ID,V:DD,w:LD,W:RD,x:null,X:null,y:BD,Y:UD,Z:HD,"%":zm},g={a:P,A:E,b:$,B:I,c:L,d:Rm,e:Rm,f:sD,g:Lm,G:Dm,H:Bm,I:Bm,j:rD,L:iD,m:tD,M:nD,p:D,q:eD,Q:lD,s:cD,S:aD,u:XI,U:YI,V:ZI,w:KI,W:JI,x:U,X:T,y:Lm,Y:Dm,Z:QI,"%":oD};_.x=b(r,_),_.X=b(n,_),_.c=b(t,_),y.x=b(r,y),y.X=b(n,y),y.c=b(t,y);function b(J,me){return function(ve){var k=[],ne=-1,Y=0,ue=J.length,ye,Te,He;for(ve instanceof Date||(ve=new Date(+ve));++ne<ue;)J.charCodeAt(ne)===37&&(k.push(J.slice(Y,ne)),(Te=Im[ye=J.charAt(++ne)])!=null?ye=J.charAt(++ne):Te=ye==="e"?" ":"0",(He=me[ye])&&(ye=He(ve,Te)),k.push(ye),Y=ne+1);return k.push(J.slice(Y,ne)),k.join("")}}function N(J,me){return function(ve){var k=Ua(1900,void 0,1),ne=O(k,J,ve+="",0),Y,ue;if(ne!=ve.length)return null;if("Q"in k)return new Date(k.Q);if("s"in k)return new Date(k.s*1e3+("L"in k?k.L:0));if(me&&!("Z"in k)&&(k.Z=0),"p"in k&&(k.H=k.H%12+k.p*12),k.m===void 0&&(k.m="q"in k?k.q:0),"V"in k){if(k.V<1||k.V>53)return null;"w"in k||(k.w=1),"Z"in k?(Y=Yl(Ua(k.y,0,1)),ue=Y.getUTCDay(),Y=ue>4||ue===0?so.ceil(Y):so(Y),Y=ll.offset(Y,(k.V-1)*7),k.y=Y.getUTCFullYear(),k.m=Y.getUTCMonth(),k.d=Y.getUTCDate()+(k.w+6)%7):(Y=Xl(Ua(k.y,0,1)),ue=Y.getDay(),Y=ue>4||ue===0?io.ceil(Y):io(Y),Y=ns.offset(Y,(k.V-1)*7),k.y=Y.getFullYear(),k.m=Y.getMonth(),k.d=Y.getDate()+(k.w+6)%7)}else("W"in k||"U"in k)&&("w"in k||(k.w="u"in k?k.u%7:"W"in k?1:0),ue="Z"in k?Yl(Ua(k.y,0,1)).getUTCDay():Xl(Ua(k.y,0,1)).getDay(),k.m=0,k.d="W"in k?(k.w+6)%7+k.W*7-(ue+5)%7:k.w+k.U*7-(ue+6)%7);return"Z"in k?(k.H+=k.Z/100|0,k.M+=k.Z%100,Yl(k)):Xl(k)}}function O(J,me,ve,k){for(var ne=0,Y=me.length,ue=ve.length,ye,Te;ne<Y;){if(k>=ue)return-1;if(ye=me.charCodeAt(ne++),ye===37){if(ye=me.charAt(ne++),Te=g[ye in Im?me.charAt(ne++):ye],!Te||(k=Te(J,ve,k))<0)return-1}else if(ye!=ve.charCodeAt(k++))return-1}return k}function D(J,me,ve){var k=u.exec(me.slice(ve));return k?(J.p=f.get(k[0].toLowerCase()),ve+k[0].length):-1}function P(J,me,ve){var k=m.exec(me.slice(ve));return k?(J.w=v.get(k[0].toLowerCase()),ve+k[0].length):-1}function E(J,me,ve){var k=d.exec(me.slice(ve));return k?(J.w=h.get(k[0].toLowerCase()),ve+k[0].length):-1}function $(J,me,ve){var k=w.exec(me.slice(ve));return k?(J.m=j.get(k[0].toLowerCase()),ve+k[0].length):-1}function I(J,me,ve){var k=x.exec(me.slice(ve));return k?(J.m=p.get(k[0].toLowerCase()),ve+k[0].length):-1}function L(J,me,ve){return O(J,t,me,ve)}function U(J,me,ve){return O(J,r,me,ve)}function T(J,me,ve){return O(J,n,me,ve)}function B(J){return o[J.getDay()]}function W(J){return s[J.getDay()]}function ae(J){return c[J.getMonth()]}function F(J){return l[J.getMonth()]}function G(J){return i[+(J.getHours()>=12)]}function re(J){return 1+~~(J.getMonth()/3)}function R(J){return o[J.getUTCDay()]}function te(J){return s[J.getUTCDay()]}function A(J){return c[J.getUTCMonth()]}function X(J){return l[J.getUTCMonth()]}function le(J){return i[+(J.getUTCHours()>=12)]}function he(J){return 1+~~(J.getUTCMonth()/3)}return{format:function(J){var me=b(J+="",_);return me.toString=function(){return J},me},parse:function(J){var me=N(J+="",!1);return me.toString=function(){return J},me},utcFormat:function(J){var me=b(J+="",y);return me.toString=function(){return J},me},utcParse:function(J){var me=N(J+="",!0);return me.toString=function(){return J},me}}}var Im={"-":"",_:" ",0:"0"},rt=/^\s*\d+/,GI=/^%/,qI=/[\\^$*+?|[\]().{}]/g;function $e(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",s=i.length;return n+(s<r?new Array(r-s+1).join(t)+i:i)}function VI(e){return e.replace(qI,"\\$&")}function za(e){return new RegExp("^(?:"+e.map(VI).join("|")+")","i")}function Ha(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function KI(e,t,r){var n=rt.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function XI(e,t,r){var n=rt.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function YI(e,t,r){var n=rt.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function ZI(e,t,r){var n=rt.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function JI(e,t,r){var n=rt.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function Dm(e,t,r){var n=rt.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function Lm(e,t,r){var n=rt.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function QI(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function eD(e,t,r){var n=rt.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function tD(e,t,r){var n=rt.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function Rm(e,t,r){var n=rt.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function rD(e,t,r){var n=rt.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function Bm(e,t,r){var n=rt.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function nD(e,t,r){var n=rt.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function aD(e,t,r){var n=rt.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function iD(e,t,r){var n=rt.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function sD(e,t,r){var n=rt.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function oD(e,t,r){var n=GI.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function lD(e,t,r){var n=rt.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function cD(e,t,r){var n=rt.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function Fm(e,t){return $e(e.getDate(),t,2)}function uD(e,t){return $e(e.getHours(),t,2)}function dD(e,t){return $e(e.getHours()%12||12,t,2)}
213function fD(e,t){return $e(1+ns.count(kr(e),e),t,3)}function hy(e,t){return $e(e.getMilliseconds(),t,3)}function hD(e,t){return hy(e,t)+"000"}function mD(e,t){return $e(e.getMonth()+1,t,2)}function pD(e,t){return $e(e.getMinutes(),t,2)}function gD(e,t){return $e(e.getSeconds(),t,2)}function vD(e){var t=e.getDay();return t===0?7:t}function xD(e,t){return $e(cl.count(kr(e)-1,e),t,2)}function my(e){var t=e.getDay();return t>=4||t===0?na(e):na.ceil(e)}function yD(e,t){return e=my(e),$e(na.count(kr(e),e)+(kr(e).getDay()===4),t,2)}function bD(e){return e.getDay()}function jD(e,t){return $e(io.count(kr(e)-1,e),t,2)}function wD(e,t){return $e(e.getFullYear()%100,t,2)}function _D(e,t){return e=my(e),$e(e.getFullYear()%100,t,2)}function ND(e,t){return $e(e.getFullYear()%1e4,t,4)}function SD(e,t){var r=e.getDay();return e=r>=4||r===0?na(e):na.ceil(e),$e(e.getFullYear()%1e4,t,4)}function OD(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+$e(t/60|0,"0",2)+$e(t%60,"0",2)}function Um(e,t){return $e(e.getUTCDate(),t,2)}function AD(e,t){return $e(e.getUTCHours(),t,2)}function PD(e,t){return $e(e.getUTCHours()%12||12,t,2)}function TD(e,t){return $e(1+ll.count(Mr(e),e),t,3)}function py(e,t){return $e(e.getUTCMilliseconds(),t,3)}function ED(e,t){return py(e,t)+"000"}function CD(e,t){return $e(e.getUTCMonth()+1,t,2)}function $D(e,t){return $e(e.getUTCMinutes(),t,2)}function kD(e,t){return $e(e.getUTCSeconds(),t,2)}function MD(e){var t=e.getUTCDay();return t===0?7:t}function ID(e,t){return $e(ul.count(Mr(e)-1,e),t,2)}function gy(e){var t=e.getUTCDay();return t>=4||t===0?aa(e):aa.ceil(e)}function DD(e,t){return e=gy(e),$e(aa.count(Mr(e),e)+(Mr(e).getUTCDay()===4),t,2)}function LD(e){return e.getUTCDay()}function RD(e,t){return $e(so.count(Mr(e)-1,e),t,2)}function BD(e,t){return $e(e.getUTCFullYear()%100,t,2)}function FD(e,t){return e=gy(e),$e(e.getUTCFullYear()%100,t,2)}function UD(e,t){return $e(e.getUTCFullYear()%1e4,t,4)}function zD(e,t){var r=e.getUTCDay();return e=r>=4||r===0?aa(e):aa.ceil(e),$e(e.getUTCFullYear()%1e4,t,4)}function HD(){return"+0000"}function zm(){return"%"}function Hm(e){return+e}function Wm(e){return Math.floor(+e/1e3)}var In,vy,xy;WD({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 WD(e){return In=WI(e),vy=In.format,In.parse,xy=In.utcFormat,In.utcParse,In}function GD(e){return new Date(e)}function qD(e){return e instanceof Date?+e:+new Date(+e)}function ef(e,t,r,n,i,s,o,l,c,u){var f=Fd(),d=f.invert,h=f.domain,m=u(".%L"),v=u(":%S"),x=u("%I:%M"),p=u("%I %p"),w=u("%a %d"),j=u("%b %d"),_=u("%B"),y=u("%Y");function g(b){return(c(b)<b?m:l(b)<b?v:o(b)<b?x:s(b)<b?p:n(b)<b?i(b)<b?w:j:r(b)<b?_:y)(b)}return f.invert=function(b){return new Date(d(b))},f.domain=function(b){return arguments.length?h(Array.from(b,qD)):h().map(GD)},f.ticks=function(b){var N=h();return e(N[0],N[N.length-1],b??10)},f.tickFormat=function(b,N){return N==null?g:u(N)},f.nice=function(b){var N=h();return(!b||typeof b.range!="function")&&(b=t(N[0],N[N.length-1],b??10)),b?h(ay(N,b)):f},f.copy=function(){return rs(f,ef(e,t,r,n,i,s,o,l,c,u))},f}function VD(){return Ht.apply(ef(zI,HI,kr,Jd,cl,ns,Yd,Kd,ln,vy).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function KD(){return Ht.apply(ef(FI,UI,Mr,Qd,ul,ll,Zd,Xd,ln,xy).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function dl(){var e=0,t=1,r,n,i,s,o=xt,l=!1,c;function u(d){return d==null||isNaN(d=+d)?c:o(i===0?.5:(d=(s(d)-r)*i,l?Math.max(0,Math.min(1,d)):d))}u.domain=function(d){return arguments.length?([e,t]=d,r=s(e=+e),n=s(t=+t),i=r===n?0:1/(n-r),u):[e,t]},u.clamp=function(d){return arguments.length?(l=!!d,u):l},u.interpolator=function(d){return arguments.length?(o=d,u):o};function f(d){return function(h){var m,v;return arguments.length?([m,v]=h,o=d(m,v),u):[o(0),o(1)]}}return u.range=f(Ea),u.rangeRound=f(Bd),u.unknown=function(d){return arguments.length?(c=d,u):c},function(d){return s=d,r=d(e),n=d(t),i=r===n?0:1/(n-r),u}}function Zr(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function yy(){var e=Yr(dl()(xt));return e.copy=function(){return Zr(e,yy())},Rr.apply(e,arguments)}function by(){var e=Hd(dl()).domain([1,10]);return e.copy=function(){return Zr(e,by()).base(e.base())},Rr.apply(e,arguments)}function jy(){var e=Wd(dl());return e.copy=function(){return Zr(e,jy()).constant(e.constant())},Rr.apply(e,arguments)}function tf(){var e=Gd(dl());return e.copy=function(){return Zr(e,tf()).exponent(e.exponent())},Rr.apply(e,arguments)}function XD(){return tf.apply(null,arguments).exponent(.5)}function wy(){var e=[],t=xt;function r(n){if(n!=null&&!isNaN(n=+n))return t((es(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let i of n)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(Hr),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,i)=>t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,s)=>IM(e,s/n))},r.copy=function(){return wy(t).domain(e)},Rr.apply(r,arguments)}function fl(){var e=0,t=.5,r=1,n=1,i,s,o,l,c,u=xt,f,d=!1,h;function m(x){return isNaN(x=+x)?h:(x=.5+((x=+f(x))-s)*(n*x<n*s?l:c),u(d?Math.max(0,Math.min(1,x)):x))}m.domain=function(x){return arguments.length?([e,t,r]=x,i=f(e=+e),s=f(t=+t),o=f(r=+r),l=i===s?0:.5/(s-i),c=s===o?0:.5/(o-s),n=s<i?-1:1,m):[e,t,r]},m.clamp=function(x){return arguments.length?(d=!!x,m):d},m.interpolator=function(x){return arguments.length?(u=x,m):u};function v(x){return function(p){var w,j,_;return arguments.length?([w,j,_]=p,u=oI(x,[w,j,_]),m):[u(0),u(.5),u(1)]}}return m.range=v(Ea),m.rangeRound=v(Bd),m.unknown=function(x){return arguments.length?(h=x,m):h},function(x){return f=x,i=x(e),s=x(t),o=x(r),l=i===s?0:.5/(s-i),c=s===o?0:.5/(o-s),n=s<i?-1:1,m}}function _y(){var e=Yr(fl()(xt));return e.copy=function(){return Zr(e,_y())},Rr.apply(e,arguments)}function Ny(){var e=Hd(fl()).domain([.1,1,10]);return e.copy=function(){return Zr(e,Ny()).base(e.base())},Rr.apply(e,arguments)}function Sy(){var e=Wd(fl());return e.copy=function(){return Zr(e,Sy()).constant(e.constant())},Rr.apply(e,arguments)}function rf(){var e=Gd(fl());return e.copy=function(){return Zr(e,rf()).exponent(e.exponent())},Rr.apply(e,arguments)}function YD(){return rf.apply(null,arguments).exponent(.5)}const Gm=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:xi,scaleDiverging:_y,scaleDivergingLog:Ny,scaleDivergingPow:rf,scaleDivergingSqrt:YD,scaleDivergingSymlog:Sy,scaleIdentity:ny,scaleImplicit:Jc,scaleLinear:no,scaleLog:iy,scaleOrdinal:Dd,scalePoint:ni,scalePow:qd,scaleQuantile:ly,scaleQuantize:cy,scaleRadial:oy,scaleSequential:yy,scaleSequentialLog:by,scaleSequentialPow:tf,scaleSequentialQuantile:wy,scaleSequentialSqrt:XD,scaleSequentialSymlog:jy,scaleSqrt:EI,scaleSymlog:sy,scaleThreshold:uy,scaleTime:VD,scaleUtc:KD,tickFormat:ry},Symbol.toStringTag,{value:"Module"}));var ZD=wa;function JD(e,t,r){for(var n=-1,i=e.length;++n<i;){var s=e[n],o=t(s);if(o!=null&&(l===void 0?o===o&&!ZD(o):r(o,l)))var l=o,c=s}return c}var Oy=JD;function QD(e,t){return e>t}var eL=QD,tL=Oy,rL=eL,nL=Ta;function aL(e){return e&&e.length?tL(e,nL,rL):void 0}var iL=aL;const hl=Re(iL);function sL(e,t){return e<t}var oL=sL,lL=Oy,cL=oL,uL=Ta;function dL(e){return e&&e.length?lL(e,uL,cL):void 0}var fL=dL;const ml=Re(fL);var hL=gd,mL=Xr,pL=Mx,gL=St;function vL(e,t){var r=gL(e)?hL:pL;return r(e,mL(t))}var xL=vL,yL=$x,bL=xL;function jL(e,t){return yL(bL(e,t),1)}var wL=jL;const _L=Re(wL);var NL=Cd;function SL(e,t){return NL(e,t)}var OL=SL;const pl=Re(OL);
vendor: 60,078 bytes, lines 213-239
213var Ca=1e9,AL={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},af,ze=!0,Ft="[DecimalError] ",mn=Ft+"Invalid argument: ",nf=Ft+"Exponent out of range: ",$a=Math.floor,an=Math.pow,PL=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Et,tt=1e7,Fe=7,Ay=9007199254740991,oo=$a(Ay/Fe),ce={};ce.absoluteValue=ce.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};ce.comparedTo=ce.cmp=function(e){var t,r,n,i,s=this;if(e=new s.constructor(e),s.s!==e.s)return s.s||-e.s;if(s.e!==e.e)return s.e>e.e^s.s<0?1:-1;for(n=s.d.length,i=e.d.length,t=0,r=n<i?n:i;t<r;++t)if(s.d[t]!==e.d[t])return s.d[t]>e.d[t]^s.s<0?1:-1;return n===i?0:n>i^s.s<0?1:-1};ce.decimalPlaces=ce.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*Fe;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};ce.dividedBy=ce.div=function(e){return Tr(this,new this.constructor(e))};ce.dividedToIntegerBy=ce.idiv=function(e){var t=this,r=t.constructor;return Ie(Tr(t,new r(e),0,1),r.precision)};ce.equals=ce.eq=function(e){return!this.cmp(e)};ce.exponent=function(){return Xe(this)};ce.greaterThan=ce.gt=function(e){return this.cmp(e)>0};ce.greaterThanOrEqualTo=ce.gte=function(e){return this.cmp(e)>=0};ce.isInteger=ce.isint=function(){return this.e>this.d.length-2};ce.isNegative=ce.isneg=function(){return this.s<0};ce.isPositive=ce.ispos=function(){return this.s>0};ce.isZero=function(){return this.s===0};ce.lessThan=ce.lt=function(e){return this.cmp(e)<0};ce.lessThanOrEqualTo=ce.lte=function(e){return this.cmp(e)<1};ce.logarithm=ce.log=function(e){var t,r=this,n=r.constructor,i=n.precision,s=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Et))throw Error(Ft+"NaN");if(r.s<1)throw Error(Ft+(r.s?"NaN":"-Infinity"));return r.eq(Et)?new n(0):(ze=!1,t=Tr(_i(r,s),_i(e,s),s),ze=!0,Ie(t,i))};ce.minus=ce.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Ey(t,e):Py(t,(e.s=-e.s,e))};ce.modulo=ce.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(Ft+"NaN");return r.s?(ze=!1,t=Tr(r,e,0,1).times(e),ze=!0,r.minus(t)):Ie(new n(r),i)};ce.naturalExponential=ce.exp=function(){return Ty(this)};ce.naturalLogarithm=ce.ln=function(){return _i(this)};ce.negated=ce.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};ce.plus=ce.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Py(t,e):Ey(t,(e.s=-e.s,e))};ce.precision=ce.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(mn+e);if(t=Xe(i)+1,n=i.d.length-1,r=n*Fe+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};ce.squareRoot=ce.sqrt=function(){var e,t,r,n,i,s,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(Ft+"NaN")}for(e=Xe(l),ze=!1,i=Math.sqrt(+l),i==0||i==1/0?(t=ir(l.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=$a((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new c(t)):n=new c(i.toString()),r=c.precision,i=o=r+3;;)if(s=n,n=s.plus(Tr(l,s,o+2)).times(.5),ir(s.d).slice(0,o)===(t=ir(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(Ie(s,r+1,0),s.times(s).eq(l)){n=s;break}}else if(t!="9999")break;o+=4}return ze=!0,Ie(n,r)};ce.times=ce.mul=function(e){var t,r,n,i,s,o,l,c,u,f=this,d=f.constructor,h=f.d,m=(e=new d(e)).d;if(!f.s||!e.s)return new d(0);for(e.s*=f.s,r=f.e+e.e,c=h.length,u=m.length,c<u&&(s=h,h=m,m=s,o=c,c=u,u=o),s=[],o=c+u,n=o;n--;)s.push(0);for(n=u;--n>=0;){for(t=0,i=c+n;i>n;)l=s[i]+m[n]*h[i-n-1]+t,s[i--]=l%tt|0,t=l/tt|0;s[i]=(s[i]+t)%tt|0}for(;!s[--o];)s.pop();return t?++r:s.shift(),e.d=s,e.e=r,ze?Ie(e,d.precision):e};ce.toDecimalPlaces=ce.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(lr(e,0,Ca),t===void 0?t=n.rounding:lr(t,0,8),Ie(r,e+Xe(r)+1,t))};ce.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=yn(n,!0):(lr(e,0,Ca),t===void 0?t=i.rounding:lr(t,0,8),n=Ie(new i(n),e+1,t),r=yn(n,!0,e+1)),r};ce.toFixed=function(e,t){var r,n,i=this,s=i.constructor;return e===void 0?yn(i):(lr(e,0,Ca),t===void 0?t=s.rounding:lr(t,0,8),n=Ie(new s(i),e+Xe(i)+1,t),r=yn(n.abs(),!1,e+Xe(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};ce.toInteger=ce.toint=function(){var e=this,t=e.constructor;return Ie(new t(e),Xe(e)+1,t.rounding)};ce.toNumber=function(){return+this};ce.toPower=ce.pow=function(e){var t,r,n,i,s,o,l=this,c=l.constructor,u=12,f=+(e=new c(e));if(!e.s)return new c(Et);if(l=new c(l),!l.s){if(e.s<1)throw Error(Ft+"Infinity");return l}if(l.eq(Et))return l;if(n=c.precision,e.eq(Et))return Ie(l,n);if(t=e.e,r=e.d.length-1,o=t>=r,s=l.s,o){if((r=f<0?-f:f)<=Ay){for(i=new c(Et),t=Math.ceil(n/Fe+4),ze=!1;r%2&&(i=i.times(l),Vm(i.d,t)),r=$a(r/2),r!==0;)l=l.times(l),Vm(l.d,t);return ze=!0,e.s<0?new c(Et).div(i):Ie(i,n)}}else if(s<0)throw Error(Ft+"NaN");return s=s<0&&e.d[Math.max(t,r)]&1?-1:1,l.s=1,ze=!1,i=e.times(_i(l,n+u)),ze=!0,i=Ty(i),i.s=s,i};ce.toPrecision=function(e,t){var r,n,i=this,s=i.constructor;return e===void 0?(r=Xe(i),n=yn(i,r<=s.toExpNeg||r>=s.toExpPos)):(lr(e,1,Ca),t===void 0?t=s.rounding:lr(t,0,8),i=Ie(new s(i),e,t),r=Xe(i),n=yn(i,e<=r||r<=s.toExpNeg,e)),n};ce.toSignificantDigits=ce.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(lr(e,1,Ca),t===void 0?t=n.rounding:lr(t,0,8)),Ie(new n(r),e,t)};ce.toString=ce.valueOf=ce.val=ce.toJSON=ce[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Xe(e),r=e.constructor;return yn(e,t<=r.toExpNeg||t>=r.toExpPos)};function Py(e,t){var r,n,i,s,o,l,c,u,f=e.constructor,d=f.precision;if(!e.s||!t.s)return t.s||(t=new f(e)),ze?Ie(t,d):t;if(c=e.d,u=t.d,o=e.e,i=t.e,c=c.slice(),s=o-i,s){for(s<0?(n=c,s=-s,l=u.length):(n=u,i=o,l=c.length),o=Math.ceil(d/Fe),l=o>l?o+1:l+1,s>l&&(s=l,n.length=1),n.reverse();s--;)n.push(0);n.reverse()}for(l=c.length,s=u.length,l-s<0&&(s=l,n=u,u=c,c=n),r=0;s;)r=(c[--s]=c[s]+u[s]+r)/tt|0,c[s]%=tt;for(r&&(c.unshift(r),++i),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=i,ze?Ie(t,d):t}function lr(e,t,r){if(e!==~~e||e<t||e>r)throw Error(mn+e)}function ir(e){var t,r,n,i=e.length-1,s="",o=e[0];if(i>0){for(s+=o,t=1;t<i;t++)n=e[t]+"",r=Fe-n.length,r&&(s+=Fr(r)),s+=n;o=e[t],n=o+"",r=Fe-n.length,r&&(s+=Fr(r))}else if(o===0)return"0";for(;o%10===0;)o/=10;return s+o}var Tr=function(){function e(n,i){var s,o=0,l=n.length;for(n=n.slice();l--;)s=n[l]*i+o,n[l]=s%tt|0,o=s/tt|0;return o&&n.unshift(o),n}function t(n,i,s,o){var l,c;if(s!=o)c=s>o?1:-1;else for(l=c=0;l<s;l++)if(n[l]!=i[l]){c=n[l]>i[l]?1:-1;break}return c}function r(n,i,s){for(var o=0;s--;)n[s]-=o,o=n[s]<i[s]?1:0,n[s]=o*tt+n[s]-i[s];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,s,o){var l,c,u,f,d,h,m,v,x,p,w,j,_,y,g,b,N,O,D=n.constructor,P=n.s==i.s?1:-1,E=n.d,$=i.d;if(!n.s)return new D(n);if(!i.s)throw Error(Ft+"Division by zero");for(c=n.e-i.e,N=$.length,g=E.length,m=new D(P),v=m.d=[],u=0;$[u]==(E[u]||0);)++u;if($[u]>(E[u]||0)&&--c,s==null?j=s=D.precision:o?j=s+(Xe(n)-Xe(i))+1:j=s,j<0)return new D(0);if(j=j/Fe+2|0,u=0,N==1)for(f=0,$=$[0],j++;(u<g||f)&&j--;u++)_=f*tt+(E[u]||0),v[u]=_/$|0,f=_%$|0;else{for(f=tt/($[0]+1)|0,f>1&&($=e($,f),E=e(E,f),N=$.length,g=E.length),y=N,x=E.slice(0,N),p=x.length;p<N;)x[p++]=0;O=$.slice(),O.unshift(0),b=$[0],$[1]>=tt/2&&++b;do f=0,l=t($,x,N,p),l<0?(w=x[0],N!=p&&(w=w*tt+(x[1]||0)),f=w/b|0,f>1?(f>=tt&&(f=tt-1),d=e($,f),h=d.length,p=x.length,l=t(d,x,h,p),l==1&&(f--,r(d,N<h?O:$,h))):(f==0&&(l=f=1),d=$.slice()),h=d.length,h<p&&d.unshift(0),r(x,d,p),l==-1&&(p=x.length,l=t($,x,N,p),l<1&&(f++,r(x,N<p?O:$,p))),p=x.length):l===0&&(f++,x=[0]),v[u++]=f,l&&x[0]?x[p++]=E[y]||0:(x=[E[y]],p=1);while((y++<g||x[0]!==void 0)&&j--)}return v[0]||v.shift(),m.e=c,Ie(m,o?s+Xe(m)+1:s)}}();function Ty(e,t){var r,n,i,s,o,l,c=0,u=0,f=e.constructor,d=f.precision;if(Xe(e)>16)throw Error(nf+Xe(e));if(!e.s)return new f(Et);for(t==null?(ze=!1,l=d):l=t,o=new f(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(n=Math.log(an(2,u))/Math.LN10*2+5|0,l+=n,r=i=s=new f(Et),f.precision=l;;){if(i=Ie(i.times(e),l),r=r.times(++c),o=s.plus(Tr(i,r,l)),ir(o.d).slice(0,l)===ir(s.d).slice(0,l)){for(;u--;)s=Ie(s.times(s),l);return f.precision=d,t==null?(ze=!0,Ie(s,d)):s}s=o}}function Xe(e){for(var t=e.e*Fe,r=e.d[0];r>=10;r/=10)t++;return t}function Zl(e,t,r){if(t>e.LN10.sd())throw ze=!0,r&&(e.precision=r),Error(Ft+"LN10 precision limit exceeded");return Ie(new e(e.LN10),t)}function Fr(e){for(var t="";e--;)t+="0";return t}function _i(e,t){var r,n,i,s,o,l,c,u,f,d=1,h=10,m=e,v=m.d,x=m.constructor,p=x.precision;if(m.s<1)throw Error(Ft+(m.s?"NaN":"-Infinity"));if(m.eq(Et))return new x(0);if(t==null?(ze=!1,u=p):u=t,m.eq(10))return t==null&&(ze=!0),Zl(x,u);if(u+=h,x.precision=u,r=ir(v),n=r.charAt(0),s=Xe(m),Math.abs(s)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)m=m.times(e),r=ir(m.d),n=r.charAt(0),d++;s=Xe(m),n>1?(m=new x("0."+r),s++):m=new x(n+"."+r.slice(1))}else return c=Zl(x,u+2,p).times(s+""),m=_i(new x(n+"."+r.slice(1)),u-h).plus(c),x.precision=p,t==null?(ze=!0,Ie(m,p)):m;for(l=o=m=Tr(m.minus(Et),m.plus(Et),u),f=Ie(m.times(m),u),i=3;;){if(o=Ie(o.times(f),u),c=l.plus(Tr(o,new x(i),u)),ir(c.d).slice(0,u)===ir(l.d).slice(0,u))return l=l.times(2),s!==0&&(l=l.plus(Zl(x,u+2,p).times(s+""))),l=Tr(l,new x(d),u),x.precision=p,t==null?(ze=!0,Ie(l,p)):l;l=c,i+=2}}function qm(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=$a(r/Fe),e.d=[],n=(r+1)%Fe,r<0&&(n+=Fe),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=Fe;n<i;)e.d.push(+t.slice(n,n+=Fe));t=t.slice(n),n=Fe-t.length}else n-=i;for(;n--;)t+="0";if(e.d.push(+t),ze&&(e.e>oo||e.e<-oo))throw Error(nf+r)}else e.s=0,e.e=0,e.d=[0];return e}function Ie(e,t,r){var n,i,s,o,l,c,u,f,d=e.d;for(o=1,s=d[0];s>=10;s/=10)o++;if(n=t-o,n<0)n+=Fe,i=t,u=d[f=0];else{if(f=Math.ceil((n+1)/Fe),s=d.length,f>=s)return e;for(u=s=d[f],o=1;s>=10;s/=10)o++;n%=Fe,i=n-Fe+o}if(r!==void 0&&(s=an(10,o-i-1),l=u/s%10|0,c=t<0||d[f+1]!==void 0||u%s,c=r<4?(l||c)&&(r==0||r==(e.s<0?3:2)):l>5||l==5&&(r==4||c||r==6&&(n>0?i>0?u/an(10,o-i):0:d[f-1])%10&1||r==(e.s<0?8:7))),t<1||!d[0])return c?(s=Xe(e),d.length=1,t=t-s-1,d[0]=an(10,(Fe-t%Fe)%Fe),e.e=$a(-t/Fe)||0):(d.length=1,d[0]=e.e=e.s=0),e;if(n==0?(d.length=f,s=1,f--):(d.length=f+1,s=an(10,Fe-n),d[f]=i>0?(u/an(10,o-i)%an(10,i)|0)*s:0),c)for(;;)if(f==0){(d[0]+=s)==tt&&(d[0]=1,++e.e);break}else{if(d[f]+=s,d[f]!=tt)break;d[f--]=0,s=1}for(n=d.length;d[--n]===0;)d.pop();if(ze&&(e.e>oo||e.e<-oo))throw Error(nf+Xe(e));return e}function Ey(e,t){var r,n,i,s,o,l,c,u,f,d,h=e.constructor,m=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),ze?Ie(t,m):t;if(c=e.d,d=t.d,n=t.e,u=e.e,c=c.slice(),o=u-n,o){for(f=o<0,f?(r=c,o=-o,l=d.length):(r=d,n=u,l=c.length),i=Math.max(Math.ceil(m/Fe),l)+2,o>i&&(o=i,r.length=1),r.reverse(),i=o;i--;)r.push(0);r.reverse()}else{for(i=c.length,l=d.length,f=i<l,f&&(l=i),i=0;i<l;i++)if(c[i]!=d[i]){f=c[i]<d[i];break}o=0}for(f&&(r=c,c=d,d=r,t.s=-t.s),l=c.length,i=d.length-l;i>0;--i)c[l++]=0;for(i=d.length;i>o;){if(c[--i]<d[i]){for(s=i;s&&c[--s]===0;)c[s]=tt-1;--c[s],c[i]+=tt}c[i]-=d[i]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--n;return c[0]?(t.d=c,t.e=n,ze?Ie(t,m):t):new h(0)}function yn(e,t,r){var n,i=Xe(e),s=ir(e.d),o=s.length;return t?(r&&(n=r-o)>0?s=s.charAt(0)+"."+s.slice(1)+Fr(n):o>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(i<0?"e":"e+")+i):i<0?(s="0."+Fr(-i-1)+s,r&&(n=r-o)>0&&(s+=Fr(n))):i>=o?(s+=Fr(i+1-o),r&&(n=r-i-1)>0&&(s=s+"."+Fr(n))):((n=i+1)<o&&(s=s.slice(0,n)+"."+s.slice(n)),r&&(n=r-o)>0&&(i+1===o&&(s+="."),s+=Fr(n))),e.s<0?"-"+s:s}function Vm(e,t){if(e.length>t)return e.length=t,!0}function Cy(e){var t,r,n;function i(s){var o=this;if(!(o instanceof i))return new i(s);if(o.constructor=i,s instanceof i){o.s=s.s,o.e=s.e,o.d=(s=s.d)?s.slice():s;return}if(typeof s=="number"){if(s*0!==0)throw Error(mn+s);if(s>0)o.s=1;else if(s<0)s=-s,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(s===~~s&&s<1e7){o.e=0,o.d=[s];return}return qm(o,s.toString())}else if(typeof s!="string")throw Error(mn+s);if(s.charCodeAt(0)===45?(s=s.slice(1),o.s=-1):o.s=1,PL.test(s))qm(o,s);else throw Error(mn+s)}if(i.prototype=ce,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=Cy,i.config=i.set=TL,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return i.config(e),i}function TL(e){if(!e||typeof e!="object")throw Error(Ft+"Object expected");var t,r,n,i=["precision",1,Ca,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((n=e[r=i[t]])!==void 0)if($a(n)===n&&n>=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(mn+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(mn+r+": "+n);return this}var af=Cy(AL);Et=new af(1);const Me=af;function EL(e){return ML(e)||kL(e)||$L(e)||CL()}function CL(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
214In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $L(e,t){if(e){if(typeof e=="string")return ru(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ru(e,t)}}function kL(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function ML(e){if(Array.isArray(e))return ru(e)}function ru(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var IL=function(t){return t},$y={"@@functional/placeholder":!0},ky=function(t){return t===$y},Km=function(t){return function r(){return arguments.length===0||arguments.length===1&&ky(arguments.length<=0?void 0:arguments[0])?r:t.apply(void 0,arguments)}},DL=function e(t,r){return t===1?r:Km(function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];var o=i.filter(function(l){return l!==$y}).length;return o>=t?r.apply(void 0,i):e(t-o,Km(function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];var f=i.map(function(d){return ky(d)?c.shift():d});return r.apply(void 0,EL(f).concat(c))}))})},gl=function(t){return DL(t.length,t)},nu=function(t,r){for(var n=[],i=t;i<r;++i)n[i-t]=i;return n},LL=gl(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(r){return t[r]}).map(e)}),RL=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];if(!r.length)return IL;var i=r.reverse(),s=i[0],o=i.slice(1);return function(){return o.reduce(function(l,c){return c(l)},s.apply(void 0,arguments))}},au=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},My=function(t){var r=null,n=null;return function(){for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return r&&s.every(function(l,c){return l===r[c]})||(r=s,n=t.apply(void 0,s)),n}};function BL(e){var t;return e===0?t=1:t=Math.floor(new Me(e).abs().log(10).toNumber())+1,t}function FL(e,t,r){for(var n=new Me(e),i=0,s=[];n.lt(t)&&i<1e5;)s.push(n.toNumber()),n=n.add(r),i++;return s}var UL=gl(function(e,t,r){var n=+e,i=+t;return n+r*(i-n)}),zL=gl(function(e,t,r){var n=t-+e;return n=n||1/0,(r-e)/n}),HL=gl(function(e,t,r){var n=t-+e;return n=n||1/0,Math.max(0,Math.min(1,(r-e)/n))});const vl={rangeStep:FL,getDigitCount:BL,interpolateNumber:UL,uninterpolateNumber:zL,uninterpolateTruncation:HL};function iu(e){return qL(e)||GL(e)||Iy(e)||WL()}function WL(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
215In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function GL(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function qL(e){if(Array.isArray(e))return su(e)}function Ni(e,t){return XL(e)||KL(e,t)||Iy(e,t)||VL()}function VL(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
216In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Iy(e,t){if(e){if(typeof e=="string")return su(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return su(e,t)}}function su(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function KL(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,i=!1,s=void 0;try{for(var o=e[Symbol.iterator](),l;!(n=(l=o.next()).done)&&(r.push(l.value),!(t&&r.length===t));n=!0);}catch(c){i=!0,s=c}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw s}}return r}}function XL(e){if(Array.isArray(e))return e}function Dy(e){var t=Ni(e,2),r=t[0],n=t[1],i=r,s=n;return r>n&&(i=n,s=r),[i,s]}function Ly(e,t,r){if(e.lte(0))return new Me(0);var n=vl.getDigitCount(e.toNumber()),i=new Me(10).pow(n),s=e.div(i),o=n!==1?.05:.1,l=new Me(Math.ceil(s.div(o).toNumber())).add(r).mul(o),c=l.mul(i);return t?c:new Me(Math.ceil(c))}function YL(e,t,r){var n=1,i=new Me(e);if(!i.isint()&&r){var s=Math.abs(e);s<1?(n=new Me(10).pow(vl.getDigitCount(e)-1),i=new Me(Math.floor(i.div(n).toNumber())).mul(n)):s>1&&(i=new Me(Math.floor(e)))}else e===0?i=new Me(Math.floor((t-1)/2)):r||(i=new Me(Math.floor(e)));var o=Math.floor((t-1)/2),l=RL(LL(function(c){return i.add(new Me(c-o).mul(n)).toNumber()}),nu);return l(0,t)}function Ry(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new Me(0),tickMin:new Me(0),tickMax:new Me(0)};var s=Ly(new Me(t).sub(e).div(r-1),n,i),o;e<=0&&t>=0?o=new Me(0):(o=new Me(e).add(t).div(2),o=o.sub(new Me(o).mod(s)));var l=Math.ceil(o.sub(e).div(s).toNumber()),c=Math.ceil(new Me(t).sub(o).div(s).toNumber()),u=l+c+1;return u>r?Ry(e,t,r,n,i+1):(u<r&&(c=t>0?c+(r-u):c,l=t>0?l:l+(r-u)),{step:s,tickMin:o.sub(new Me(l).mul(s)),tickMax:o.add(new Me(c).mul(s))})}function ZL(e){var t=Ni(e,2),r=t[0],n=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),l=Dy([r,n]),c=Ni(l,2),u=c[0],f=c[1];if(u===-1/0||f===1/0){var d=f===1/0?[u].concat(iu(nu(0,i-1).map(function(){return 1/0}))):[].concat(iu(nu(0,i-1).map(function(){return-1/0})),[f]);return r>n?au(d):d}if(u===f)return YL(u,i,s);var h=Ry(u,f,o,s),m=h.step,v=h.tickMin,x=h.tickMax,p=vl.rangeStep(v,x.add(new Me(.1).mul(m)),m);return r>n?au(p):p}function JL(e,t){var r=Ni(e,2),n=r[0],i=r[1],s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Dy([n,i]),l=Ni(o,2),c=l[0],u=l[1];if(c===-1/0||u===1/0)return[n,i];if(c===u)return[c];var f=Math.max(t,2),d=Ly(new Me(u).sub(c).div(f-1),s,0),h=[].concat(iu(vl.rangeStep(new Me(c),new Me(u).sub(new Me(.99).mul(d)),d)),[u]);return n>i?au(h):h}var QL=My(ZL),e4=My(JL),t4="Invariant failed";function bn(e,t){throw new Error(t4)}var r4=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function ia(e){"@babel/helpers - typeof";return ia=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ia(e)}function lo(){return lo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lo.apply(this,arguments)}function n4(e,t){return o4(e)||s4(e,t)||i4(e,t)||a4()}function a4(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
217In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function i4(e,t){if(e){if(typeof e=="string")return Xm(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Xm(e,t)}}function Xm(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function s4(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,s,o,l=[],c=!0,u=!1;try{if(s=(r=r.call(e)).next,t!==0)for(;!(c=(n=s.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,i=f}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function o4(e){if(Array.isArray(e))return e}function l4(e,t){if(e==null)return{};var r=c4(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function c4(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function u4(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d4(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Uy(n.key),n)}}function f4(e,t,r){return t&&d4(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function h4(e,t,r){return t=co(t),m4(e,By()?Reflect.construct(t,r||[],co(e).constructor):t.apply(e,r))}function m4(e,t){if(t&&(ia(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return p4(e)}function p4(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function By(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(By=function(){return!!e})()}function co(e){return co=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},co(e)}function g4(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ou(e,t)}function ou(e,t){return ou=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},ou(e,t)}function Fy(e,t,r){return t=Uy(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Uy(e){var t=v4(e,"string");return ia(t)=="symbol"?t:t+""}function v4(e,t){if(ia(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ia(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var as=function(e){function t(){return u4(this,t),h4(this,t,arguments)}return g4(t,e),f4(t,[{key:"render",value:function(){var n=this.props,i=n.offset,s=n.layout,o=n.width,l=n.dataKey,c=n.data,u=n.dataPointFormatter,f=n.xAxis,d=n.yAxis,h=l4(n,r4),m=Ee(h,!1);this.props.direction==="x"&&f.type!=="number"&&bn();var v=c.map(function(x){var p=u(x,l),w=p.x,j=p.y,_=p.value,y=p.errorVal;if(!y)return null;var g=[],b,N;if(Array.isArray(y)){var O=n4(y,2);b=O[0],N=O[1]}else b=N=y;if(s==="vertical"){var D=f.scale,P=j+i,E=P+o,$=P-o,I=D(_-b),L=D(_+N);g.push({x1:L,y1:E,x2:L,y2:$}),g.push({x1:I,y1:P,x2:L,y2:P}),g.push({x1:I,y1:E,x2:I,y2:$})}else if(s==="horizontal"){var U=d.scale,T=w+i,B=T-o,W=T+o,ae=U(_-b),F=U(_+N);g.push({x1:B,y1:F,x2:W,y2:F}),g.push({x1:T,y1:ae,x2:T,y2:F}),g.push({x1:B,y1:ae,x2:W,y2:ae})}return M.createElement(Ge,lo({className:"recharts-errorBar",key:"bar-".concat(g.map(function(G){return"".concat(G.x1,"-").concat(G.x2,"-").concat(G.y1,"-").concat(G.y2)}))},m),g.map(function(G){return M.createElement("line",lo({},G,{key:"line-".concat(G.x1,"-").concat(G.x2,"-").concat(G.y1,"-").concat(G.y2)}))}))});return M.createElement(Ge,{className:"recharts-errorBars"},v)}}])}(M.Component);Fy(as,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});Fy(as,"displayName","ErrorBar");function Si(e){"@babel/helpers - typeof";return Si=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Si(e)}function Ym(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function tn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ym(Object(r),!0).forEach(function(n){x4(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ym(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function x4(e,t,r){return t=y4(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function y4(e){var t=b4(e,"string");return Si(t)=="symbol"?t:t+""}function b4(e,t){if(Si(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Si(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var zy=function(t){var r=t.children,n=t.formattedGraphicalItems,i=t.legendWidth,s=t.legendContent,o=Pt(r,zn);if(!o)return null;var l=zn.defaultProps,c=l!==void 0?tn(tn({},l),o.props):{},u;return o.props&&o.props.payload?u=o.props&&o.props.payload:s==="children"?u=(n||[]).reduce(function(f,d){var h=d.item,m=d.props,v=m.sectors||m.data||[];return f.concat(v.map(function(x){return{type:o.props.iconType||h.props.legendType,value:x.name,color:x.fill,payload:x}}))},[]):u=(n||[]).map(function(f){var d=f.item,h=d.type.defaultProps,m=h!==void 0?tn(tn({},h),d.props):{},v=m.dataKey,x=m.name,p=m.legendType,w=m.hide;return{inactive:w,dataKey:v,type:c.iconType||p||"square",color:sf(d),value:x||v,payload:m}}),tn(tn(tn({},c),zn.getWithHeight(o,i)),{},{payload:u,item:o})};function Oi(e){"@babel/helpers - typeof";return Oi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oi(e)}function Zm(e){return N4(e)||_4(e)||w4(e)||j4()}function j4(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
218In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function w4(e,t){if(e){if(typeof e=="string")return lu(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return lu(e,t)}}function _4(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function N4(e){if(Array.isArray(e))return lu(e)}function lu(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Jm(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function We(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Jm(Object(r),!0).forEach(function(n){Wn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Jm(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Wn(e,t,r){return t=S4(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function S4(e){var t=O4(e,"string");return Oi(t)=="symbol"?t:t+""}function O4(e,t){if(Oi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Oi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ct(e,t,r){return Ae(e)||Ae(t)?r:Qe(t)?Rt(e,t,r):Ne(t)?t(e):r}function ai(e,t,r,n){var i=_L(e,function(l){return Ct(l,t)});if(r==="number"){var s=i.filter(function(l){return ie(l)||parseFloat(l)});return s.length?[ml(s),hl(s)]:[1/0,-1/0]}var o=n?i.filter(function(l){return!Ae(l)}):i;return o.map(function(l){return Qe(l)||l instanceof Date?l:""})}var A4=function(t){var r,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0,o=-1,l=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(l<=1)return 0;if(s&&s.axisType==="angleAxis"&&Math.abs(Math.abs(s.range[1]-s.range[0])-360)<=1e-6)for(var c=s.range,u=0;u<l;u++){var f=u>0?i[u-1].coordinate:i[l-1].coordinate,d=i[u].coordinate,h=u>=l-1?i[0].coordinate:i[u+1].coordinate,m=void 0;if(Jt(d-f)!==Jt(h-d)){var v=[];if(Jt(h-d)===Jt(c[1]-c[0])){m=h;var x=d+c[1]-c[0];v[0]=Math.min(x,(x+f)/2),v[1]=Math.max(x,(x+f)/2)}else{m=f;var p=h+c[1]-c[0];v[0]=Math.min(d,(p+d)/2),v[1]=Math.max(d,(p+d)/2)}var w=[Math.min(d,(m+d)/2),Math.max(d,(m+d)/2)];if(t>w[0]&&t<=w[1]||t>=v[0]&&t<=v[1]){o=i[u].index;break}}else{var j=Math.min(f,h),_=Math.max(f,h);if(t>(j+d)/2&&t<=(_+d)/2){o=i[u].index;break}}}else for(var y=0;y<l;y++)if(y===0&&t<=(n[y].coordinate+n[y+1].coordinate)/2||y>0&&y<l-1&&t>(n[y].coordinate+n[y-1].coordinate)/2&&t<=(n[y].coordinate+n[y+1].coordinate)/2||y===l-1&&t>(n[y].coordinate+n[y-1].coordinate)/2){o=n[y].index;break}return o},sf=function(t){var r,n=t,i=n.type.displayName,s=(r=t.type)!==null&&r!==void 0&&r.defaultProps?We(We({},t.type.defaultProps),t.props):t.props,o=s.stroke,l=s.fill,c;switch(i){case"Line":c=o;break;case"Area":case"Radar":c=o&&o!=="none"?o:l;break;default:c=l;break}return c},P4=function(t){var r=t.barSize,n=t.totalSize,i=t.stackGroups,s=i===void 0?{}:i;if(!s)return{};for(var o={},l=Object.keys(s),c=0,u=l.length;c<u;c++)for(var f=s[l[c]].stackGroups,d=Object.keys(f),h=0,m=d.length;h<m;h++){var v=f[d[h]],x=v.items,p=v.cateAxisId,w=x.filter(function(N){return Or(N.type).indexOf("Bar")>=0});if(w&&w.length){var j=w[0].type.defaultProps,_=j!==void 0?We(We({},j),w[0].props):w[0].props,y=_.barSize,g=_[p];o[g]||(o[g]=[]);var b=Ae(y)?r:y;o[g].push({item:w[0],stackList:w.slice(1),barSize:Ae(b)?void 0:xn(b,n,0)})}}return o},T4=function(t){var r=t.barGap,n=t.barCategoryGap,i=t.bandSize,s=t.sizeList,o=s===void 0?[]:s,l=t.maxBarSize,c=o.length;if(c<1)return null;var u=xn(r,i,0,!0),f,d=[];if(o[0].barSize===+o[0].barSize){var h=!1,m=i/c,v=o.reduce(function(y,g){return y+g.barSize||0},0);v+=(c-1)*u,v>=i&&(v-=(c-1)*u,u=0),v>=i&&m>0&&(h=!0,m*=.9,v=c*m);var x=(i-v)/2>>0,p={offset:x-u,size:0};f=o.reduce(function(y,g){var b={item:g.item,position:{offset:p.offset+p.size+u,size:h?m:g.barSize}},N=[].concat(Zm(y),[b]);return p=N[N.length-1].position,g.stackList&&g.stackList.length&&g.stackList.forEach(function(O){N.push({item:O,position:p})}),N},d)}else{var w=xn(n,i,0,!0);i-2*w-(c-1)*u<=0&&(u=0);var j=(i-2*w-(c-1)*u)/c;j>1&&(j>>=0);var _=l===+l?Math.min(j,l):j;f=o.reduce(function(y,g,b){var N=[].concat(Zm(y),[{item:g.item,position:{offset:w+(j+u)*b+(j-_)/2,size:_}}]);return g.stackList&&g.stackList.length&&g.stackList.forEach(function(O){N.push({item:O,position:N[N.length-1].position})}),N},d)}return f},E4=function(t,r,n,i){var s=n.children,o=n.width,l=n.margin,c=o-(l.left||0)-(l.right||0),u=zy({children:s,legendWidth:c});if(u){var f=i||{},d=f.width,h=f.height,m=u.align,v=u.verticalAlign,x=u.layout;if((x==="vertical"||x==="horizontal"&&v==="middle")&&m!=="center"&&ie(t[m]))return We(We({},t),{},Wn({},m,t[m]+(d||0)));if((x==="horizontal"||x==="vertical"&&m==="center")&&v!=="middle"&&ie(t[v]))return We(We({},t),{},Wn({},v,t[v]+(h||0)))}return t},C4=function(t,r,n){return Ae(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},Hy=function(t,r,n,i,s){var o=r.props.children,l=Bt(o,as).filter(function(u){return C4(i,s,u.props.direction)});if(l&&l.length){var c=l.map(function(u){return u.props.dataKey});return t.reduce(function(u,f){var d=Ct(f,n);if(Ae(d))return u;var h=Array.isArray(d)?[ml(d),hl(d)]:[d,d],m=c.reduce(function(v,x){var p=Ct(f,x,0),w=h[0]-Math.abs(Array.isArray(p)?p[0]:p),j=h[1]+Math.abs(Array.isArray(p)?p[1]:p);return[Math.min(w,v[0]),Math.max(j,v[1])]},[1/0,-1/0]);return[Math.min(m[0],u[0]),Math.max(m[1],u[1])]},[1/0,-1/0])}return null},$4=function(t,r,n,i,s){var o=r.map(function(l){return Hy(t,l,n,s,i)}).filter(function(l){return!Ae(l)});return o&&o.length?o.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]):null},Wy=function(t,r,n,i,s){var o=r.map(function(c){var u=c.props.dataKey;return n==="number"&&u&&Hy(t,c,u,i)||ai(t,u,n,s)});if(n==="number")return o.reduce(function(c,u){return[Math.min(c[0],u[0]),Math.max(c[1],u[1])]},[1/0,-1/0]);var l={};return o.reduce(function(c,u){for(var f=0,d=u.length;f<d;f++)l[u[f]]||(l[u[f]]=!0,c.push(u[f]));return c},[])},Gy=function(t,r){return t==="horizontal"&&r==="xAxis"||t==="vertical"&&r==="yAxis"||t==="centric"&&r==="angleAxis"||t==="radial"&&r==="radiusAxis"},qy=function(t,r,n,i){if(i)return t.map(function(c){return c.coordinate});var s,o,l=t.map(function(c){return c.coordinate===r&&(s=!0),c.coordinate===n&&(o=!0),c.coordinate});return s||l.push(r),o||l.push(n),l},yr=function(t,r,n){if(!t)return null;var i=t.scale,s=t.duplicateDomain,o=t.type,l=t.range,c=t.realScaleType==="scaleBand"?i.bandwidth()/2:2,u=(r||n)&&o==="category"&&i.bandwidth?i.bandwidth()/c:0;if(u=t.axisType==="angleAxis"&&(l==null?void 0:l.length)>=2?Jt(l[0]-l[1])*2*u:u,r&&(t.ticks||t.niceTicks)){var f=(t.ticks||t.niceTicks).map(function(d){var h=s?s.indexOf(d):d;return{coordinate:i(h)+u,value:d,offset:u}});return f.filter(function(d){return!Zi(d.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(d,h){return{coordinate:i(d)+u,value:d,index:h,offset:u}}):i.ticks&&!n?i.ticks(t.tickCount).map(function(d){return{coordinate:i(d)+u,value:d,offset:u}}):i.domain().map(function(d,h){return{coordinate:i(d)+u,value:s?s[d]:d,index:h,offset:u}})},Jl=new WeakMap,bs=function(t,r){if(typeof r!="function")return t;Jl.has(t)||Jl.set(t,new WeakMap);var n=Jl.get(t);if(n.has(r))return n.get(r);var i=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,i),i},k4=function(t,r,n){var i=t.scale,s=t.type,o=t.layout,l=t.axisType;if(i==="auto")return o==="radial"&&l==="radiusAxis"?{scale:xi(),realScaleType:"band"}:o==="radial"&&l==="angleAxis"?{scale:no(),realScaleType:"linear"}:s==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:ni(),realScaleType:"point"}:s==="category"?{scale:xi(),realScaleType:"band"}:{scale:no(),realScaleType:"linear"};if(Yi(i)){var c="scale".concat(el(i));return{scale:(Gm[c]||ni)(),realScaleType:Gm[c]?c:"point"}}return Ne(i)?{scale:i}:{scale:ni(),realScaleType:"point"}},Qm=1e-4,M4=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,i=t.range(),s=Math.min(i[0],i[1])-Qm,o=Math.max(i[0],i[1])+Qm,l=t(r[0]),c=t(r[n-1]);(l<s||l>o||c<s||c>o)&&t.domain([r[0],r[n-1]])}},I4=function(t,r){if(!t)return null;for(var n=0,i=t.length;n<i;n++)if(t[n].item===r)return t[n].position;return null},D4=function(t,r){if(!r||r.length!==2||!ie(r[0])||!ie(r[1]))return t;var n=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]),s=[t[0],t[1]];return(!ie(t[0])||t[0]<n)&&(s[0]=n),(!ie(t[1])||t[1]>i)&&(s[1]=i),s[0]>i&&(s[0]=i),s[1]<n&&(s[1]=n),s},L4=function(t){var r=t.length;if(!(r<=0))for(var n=0,i=t[0].length;n<i;++n)for(var s=0,o=0,l=0;l<r;++l){var c=Zi(t[l][n][1])?t[l][n][0]:t[l][n][1];c>=0?(t[l][n][0]=s,t[l][n][1]=s+c,s=t[l][n][1]):(t[l][n][0]=o,t[l][n][1]=o+c,o=t[l][n][1])}},R4=function(t){var r=t.length;if(!(r<=0))for(var n=0,i=t[0].length;n<i;++n)for(var s=0,o=0;o<r;++o){var l=Zi(t[o][n][1])?t[o][n][0]:t[o][n][1];l>=0?(t[o][n][0]=s,t[o][n][1]=s+l,s=t[o][n][1]):(t[o][n][0]=0,t[o][n][1]=0)}},B4={sign:L4,expand:eO,none:Zn,silhouette:tO,wiggle:rO,positive:R4},F4=function(t,r,n){var i=r.map(function(l){return l.props.dataKey}),s=B4[n],o=QS().keys(i).value(function(l,c){return+Ct(l,c,0)}).order(kc).offset(s);return o(t)},U4=function(t,r,n,i,s,o){if(!t)return null;var l=o?r.reverse():r,c={},u=l.reduce(function(d,h){var m,v=(m=h.type)!==null&&m!==void 0&&m.defaultProps?We(We({},h.type.defaultProps),h.props):h.props,x=v.stackId,p=v.hide;if(p)return d;var w=v[n],j=d[w]||{hasStack:!1,stackGroups:{}};if(Qe(x)){var _=j.stackGroups[x]||{numericAxisId:n,cateAxisId:i,items:[]};_.items.push(h),j.hasStack=!0,j.stackGroups[x]=_}else j.stackGroups[Ji("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[h]};return We(We({},d),{},Wn({},w,j))},c),f={};return Object.keys(u).reduce(function(d,h){var m=u[h];if(m.hasStack){var v={};m.stackGroups=Object.keys(m.stackGroups).reduce(function(x,p){var w=m.stackGroups[p];return We(We({},x),{},Wn({},p,{numericAxisId:n,cateAxisId:i,items:w.items,stackedData:F4(t,w.items,s)}))},v)}return We(We({},d),{},Wn({},h,m))},f)},z4=function(t,r){var n=r.realScaleType,i=r.type,s=r.tickCount,o=r.originalDomain,l=r.allowDecimals,c=n||r.scale;if(c!=="auto"&&c!=="linear")return null;if(s&&i==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=t.domain();if(!u.length)return null;var f=QL(u,s,l);return t.domain([ml(f),hl(f)]),{niceTicks:f}}if(s&&i==="number"){var d=t.domain(),h=e4(d,s,l);return{niceTicks:h}}return null};function ep(e){var t=e.axis,r=e.ticks,n=e.bandSize,i=e.entry,s=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Ae(i[t.dataKey])){var l=Ms(r,"value",i[t.dataKey]);if(l)return l.coordinate+n/2}return r[s]?r[s].coordinate+n/2:null}var c=Ct(i,Ae(o)?t.dataKey:o);return Ae(c)?null:t.scale(c)}var tp=function(t){var r=t.axis,n=t.ticks,i=t.offset,s=t.bandSize,o=t.entry,l=t.index;if(r.type==="category")return n[l]?n[l].coordinate+i:null;var c=Ct(o,r.dataKey,r.domain[l]);return Ae(c)?null:r.scale(c)-s/2+i},H4=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var i=Math.min(n[0],n[1]),s=Math.max(n[0],n[1]);return i<=0&&s>=0?0:s<0?s:i}return n[0]},W4=function(t,r){var n,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?We(We({},t.type.defaultProps),t.props):t.props,s=i.stackId;if(Qe(s)){var o=r[s];if(o){var l=o.items.indexOf(t);return l>=0?o.stackedData[l]:null}}return null},G4=function(t){return t.reduce(function(r,n){return[ml(n.concat([r[0]]).filter(ie)),hl(n.concat([r[1]]).filter(ie))]},[1/0,-1/0])},Vy=function(t,r,n){return Object.keys(t).reduce(function(i,s){var o=t[s],l=o.stackedData,c=l.reduce(function(u,f){var d=G4(f.slice(r,n+1));return[Math.min(u[0],d[0]),Math.max(u[1],d[1])]},[1/0,-1/0]);return[Math.min(c[0],i[0]),Math.max(c[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},rp=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,np=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,cu=function(t,r,n){if(Ne(t))return t(r,n);if(!Array.isArray(t))return r;var i=[];if(ie(t[0]))i[0]=n?t[0]:Math.min(t[0],r[0]);else if(rp.test(t[0])){var s=+rp.exec(t[0])[1];i[0]=r[0]-s}else Ne(t[0])?i[0]=t[0](r[0]):i[0]=r[0];if(ie(t[1]))i[1]=n?t[1]:Math.max(t[1],r[1]);else if(np.test(t[1])){var o=+np.exec(t[1])[1];i[1]=r[1]+o}else Ne(t[1])?i[1]=t[1](r[1]):i[1]=r[1];return i},uo=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!n||i>0)return i}if(t&&r&&r.length>=2){for(var s=kd(r,function(d){return d.coordinate}),o=1/0,l=1,c=s.length;l<c;l++){var u=s[l],f=s[l-1];o=Math.min((u.coordinate||0)-(f.coordinate||0),o)}return o===1/0?0:o}return n?void 0:0},ap=function(t,r,n){return!t||!t.length||pl(t,Rt(n,"type.defaultProps.domain"))?r:t},Ky=function(t,r){var n=t.type.defaultProps?We(We({},t.type.defaultProps),t.props):t.props,i=n.dataKey,s=n.name,o=n.unit,l=n.formatter,c=n.tooltipType,u=n.chartType,f=n.hide;return We(We({},Ee(t,!1)),{},{dataKey:i,unit:o,formatter:l,name:s||i,color:sf(t),value:Ct(r,i),type:c,payload:r,chartType:u,hide:f})};function Ai(e){"@babel/helpers - typeof";return Ai=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ai(e)}function ip(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function sp(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ip(Object(r),!0).forEach(function(n){q4(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ip(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function q4(e,t,r){return t=V4(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function V4(e){var t=K4(e,"string");return Ai(t)=="symbol"?t:t+""}function K4(e,t){if(Ai(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ai(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var fo=Math.PI/180,X4=function(t){return t*180/Math.PI},it=function(t,r,n,i){return{x:t+Math.cos(-fo*i)*n,y:r+Math.sin(-fo*i)*n}},Y4=function(t,r){var n=t.x,i=t.y,s=r.x,o=r.y;return Math.sqrt(Math.pow(n-s,2)+Math.pow(i-o,2))},Z4=function(t,r){var n=t.x,i=t.y,s=r.cx,o=r.cy,l=Y4({x:n,y:i},{x:s,y:o});if(l<=0)return{radius:l};var c=(n-s)/l,u=Math.acos(c);return i>o&&(u=2*Math.PI-u),{radius:l,angle:X4(u),angleInRadian:u}},J4=function(t){var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),s=Math.floor(n/360),o=Math.min(i,s);return{startAngle:r-o*360,endAngle:n-o*360}},Q4=function(t,r){var n=r.startAngle,i=r.endAngle,s=Math.floor(n/360),o=Math.floor(i/360),l=Math.min(s,o);return t+l*360},op=function(t,r){var n=t.x,i=t.y,s=Z4({x:n,y:i},r),o=s.radius,l=s.angle,c=r.innerRadius,u=r.outerRadius;if(o<c||o>u)return!1;if(o===0)return!0;var f=J4(r),d=f.startAngle,h=f.endAngle,m=l,v;if(d<=h){for(;m>h;)m-=360;for(;m<d;)m+=360;v=m>=d&&m<=h}else{for(;m>d;)m-=360;for(;m<h;)m+=360;v=m>=h&&m<=d}return v?sp(sp({},r),{},{radius:o,angle:Q4(m,r)}):null};function Pi(e){"@babel/helpers - typeof";return Pi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pi(e)}var eR=["offset"];function tR(e){return iR(e)||aR(e)||nR(e)||rR()}function rR(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
219In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nR(e,t){if(e){if(typeof e=="string")return uu(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return uu(e,t)}}function aR(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function iR(e){if(Array.isArray(e))return uu(e)}function uu(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function sR(e,t){if(e==null)return{};var r=oR(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function oR(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function lp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ze(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?lp(Object(r),!0).forEach(function(n){lR(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lp(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function lR(e,t,r){return t=cR(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cR(e){var t=uR(e,"string");return Pi(t)=="symbol"?t:t+""}function uR(e,t){if(Pi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Pi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ti(){return Ti=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ti.apply(this,arguments)}var dR=function(t){var r=t.value,n=t.formatter,i=Ae(t.children)?r:t.children;return Ne(n)?n(i):i},fR=function(t,r){var n=Jt(r-t),i=Math.min(Math.abs(r-t),360);return n*i},hR=function(t,r,n){var i=t.position,s=t.viewBox,o=t.offset,l=t.className,c=s,u=c.cx,f=c.cy,d=c.innerRadius,h=c.outerRadius,m=c.startAngle,v=c.endAngle,x=c.clockWise,p=(d+h)/2,w=fR(m,v),j=w>=0?1:-1,_,y;i==="insideStart"?(_=m+j*o,y=x):i==="insideEnd"?(_=v-j*o,y=!x):i==="end"&&(_=v+j*o,y=x),y=w<=0?y:!y;var g=it(u,f,p,_),b=it(u,f,p,_+(y?1:-1)*359),N="M".concat(g.x,",").concat(g.y,`
220    A`).concat(p,",").concat(p,",0,1,").concat(y?0:1,`,
221    `).concat(b.x,",").concat(b.y),O=Ae(t.id)?Ji("recharts-radial-line-"):t.id;return M.createElement("text",Ti({},n,{dominantBaseline:"central",className:Ce("recharts-radial-bar-label",l)}),M.createElement("defs",null,M.createElement("path",{id:O,d:N})),M.createElement("textPath",{xlinkHref:"#".concat(O)},r))},mR=function(t){var r=t.viewBox,n=t.offset,i=t.position,s=r,o=s.cx,l=s.cy,c=s.innerRadius,u=s.outerRadius,f=s.startAngle,d=s.endAngle,h=(f+d)/2;if(i==="outside"){var m=it(o,l,u+n,h),v=m.x,x=m.y;return{x:v,y:x,textAnchor:v>=o?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"end"};var p=(c+u)/2,w=it(o,l,p,h),j=w.x,_=w.y;return{x:j,y:_,textAnchor:"middle",verticalAnchor:"middle"}},pR=function(t){var r=t.viewBox,n=t.parentViewBox,i=t.offset,s=t.position,o=r,l=o.x,c=o.y,u=o.width,f=o.height,d=f>=0?1:-1,h=d*i,m=d>0?"end":"start",v=d>0?"start":"end",x=u>=0?1:-1,p=x*i,w=x>0?"end":"start",j=x>0?"start":"end";if(s==="top"){var _={x:l+u/2,y:c-d*i,textAnchor:"middle",verticalAnchor:m};return Ze(Ze({},_),n?{height:Math.max(c-n.y,0),width:u}:{})}if(s==="bottom"){var y={x:l+u/2,y:c+f+h,textAnchor:"middle",verticalAnchor:v};return Ze(Ze({},y),n?{height:Math.max(n.y+n.height-(c+f),0),width:u}:{})}if(s==="left"){var g={x:l-p,y:c+f/2,textAnchor:w,verticalAnchor:"middle"};return Ze(Ze({},g),n?{width:Math.max(g.x-n.x,0),height:f}:{})}if(s==="right"){var b={x:l+u+p,y:c+f/2,textAnchor:j,verticalAnchor:"middle"};return Ze(Ze({},b),n?{width:Math.max(n.x+n.width-b.x,0),height:f}:{})}var N=n?{width:u,height:f}:{};return s==="insideLeft"?Ze({x:l+p,y:c+f/2,textAnchor:j,verticalAnchor:"middle"},N):s==="insideRight"?Ze({x:l+u-p,y:c+f/2,textAnchor:w,verticalAnchor:"middle"},N):s==="insideTop"?Ze({x:l+u/2,y:c+h,textAnchor:"middle",verticalAnchor:v},N):s==="insideBottom"?Ze({x:l+u/2,y:c+f-h,textAnchor:"middle",verticalAnchor:m},N):s==="insideTopLeft"?Ze({x:l+p,y:c+h,textAnchor:j,verticalAnchor:v},N):s==="insideTopRight"?Ze({x:l+u-p,y:c+h,textAnchor:w,verticalAnchor:v},N):s==="insideBottomLeft"?Ze({x:l+p,y:c+f-h,textAnchor:j,verticalAnchor:m},N):s==="insideBottomRight"?Ze({x:l+u-p,y:c+f-h,textAnchor:w,verticalAnchor:m},N):_a(s)&&(ie(s.x)||sn(s.x))&&(ie(s.y)||sn(s.y))?Ze({x:l+xn(s.x,u),y:c+xn(s.y,f),textAnchor:"end",verticalAnchor:"end"},N):Ze({x:l+u/2,y:c+f/2,textAnchor:"middle",verticalAnchor:"middle"},N)},gR=function(t){return"cx"in t&&ie(t.cx)};function ut(e){var t=e.offset,r=t===void 0?5:t,n=sR(e,eR),i=Ze({offset:r},n),s=i.viewBox,o=i.position,l=i.value,c=i.children,u=i.content,f=i.className,d=f===void 0?"":f,h=i.textBreakAll;if(!s||Ae(l)&&Ae(c)&&!S.isValidElement(u)&&!Ne(u))return null;if(S.isValidElement(u))return S.cloneElement(u,i);var m;if(Ne(u)){if(m=S.createElement(u,i),S.isValidElement(m))return m}else m=dR(i);var v=gR(s),x=Ee(i,!0);if(v&&(o==="insideStart"||o==="insideEnd"||o==="end"))return hR(i,m,x);var p=v?mR(i):pR(i);return M.createElement(Ys,Ti({className:Ce("recharts-label",d)},x,p,{breakAll:h}),m)}ut.displayName="Label";var Xy=function(t){var r=t.cx,n=t.cy,i=t.angle,s=t.startAngle,o=t.endAngle,l=t.r,c=t.radius,u=t.innerRadius,f=t.outerRadius,d=t.x,h=t.y,m=t.top,v=t.left,x=t.width,p=t.height,w=t.clockWise,j=t.labelViewBox;if(j)return j;if(ie(x)&&ie(p)){if(ie(d)&&ie(h))return{x:d,y:h,width:x,height:p};if(ie(m)&&ie(v))return{x:m,y:v,width:x,height:p}}return ie(d)&&ie(h)?{x:d,y:h,width:0,height:0}:ie(r)&&ie(n)?{cx:r,cy:n,startAngle:s||i||0,endAngle:o||i||0,innerRadius:u||0,outerRadius:f||c||l||0,clockWise:w}:t.viewBox?t.viewBox:{}},vR=function(t,r){return t?t===!0?M.createElement(ut,{key:"label-implicit",viewBox:r}):Qe(t)?M.createElement(ut,{key:"label-implicit",viewBox:r,value:t}):S.isValidElement(t)?t.type===ut?S.cloneElement(t,{key:"label-implicit",viewBox:r}):M.createElement(ut,{key:"label-implicit",content:t,viewBox:r}):Ne(t)?M.createElement(ut,{key:"label-implicit",content:t,viewBox:r}):_a(t)?M.createElement(ut,Ti({viewBox:r},t,{key:"label-implicit"})):null:null},xR=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var i=t.children,s=Xy(t),o=Bt(i,ut).map(function(c,u){return S.cloneElement(c,{viewBox:r||s,key:"label-".concat(u)})});if(!n)return o;var l=vR(t.label,r||s);return[l].concat(tR(o))};ut.parseViewBox=Xy;ut.renderCallByParent=xR;function yR(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var bR=yR;const jR=Re(bR);function Ei(e){"@babel/helpers - typeof";return Ei=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ei(e)}var wR=["valueAccessor"],_R=["data","dataKey","clockWise","id","textBreakAll"];function NR(e){return PR(e)||AR(e)||OR(e)||SR()}function SR(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
222In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function OR(e,t){if(e){if(typeof e=="string")return du(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return du(e,t)}}function AR(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function PR(e){if(Array.isArray(e))return du(e)}function du(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ho(){return ho=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ho.apply(this,arguments)}function cp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function up(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?cp(Object(r),!0).forEach(function(n){TR(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cp(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function TR(e,t,r){return t=ER(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ER(e){var t=CR(e,"string");return Ei(t)=="symbol"?t:t+""}function CR(e,t){if(Ei(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ei(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dp(e,t){if(e==null)return{};var r=$R(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function $R(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var kR=function(t){return Array.isArray(t.value)?jR(t.value):t.value};function Wr(e){var t=e.valueAccessor,r=t===void 0?kR:t,n=dp(e,wR),i=n.data,s=n.dataKey,o=n.clockWise,l=n.id,c=n.textBreakAll,u=dp(n,_R);return!i||!i.length?null:M.createElement(Ge,{className:"recharts-label-list"},i.map(function(f,d){var h=Ae(s)?r(f,d):Ct(f&&f.payload,s),m=Ae(l)?{}:{id:"".concat(l,"-").concat(d)};return M.createElement(ut,ho({},Ee(f,!0),u,m,{parentViewBox:f.parentViewBox,value:h,textBreakAll:c,viewBox:ut.parseViewBox(Ae(o)?f:up(up({},f),{},{clockWise:o})),key:"label-".concat(d),index:d}))}))}Wr.displayName="LabelList";function MR(e,t){return e?e===!0?M.createElement(Wr,{key:"labelList-implicit",data:t}):M.isValidElement(e)||Ne(e)?M.createElement(Wr,{key:"labelList-implicit",data:t,content:e}):_a(e)?M.createElement(Wr,ho({data:t},e,{key:"labelList-implicit"})):null:null}function IR(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,i=Bt(n,Wr).map(function(o,l){return S.cloneElement(o,{data:t,key:"labelList-".concat(l)})});if(!r)return i;var s=MR(e.label,t);return[s].concat(NR(i))}Wr.renderCallByParent=IR;function Ci(e){"@babel/helpers - typeof";return Ci=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ci(e)}function fu(){return fu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},fu.apply(this,arguments)}function fp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function hp(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?fp(Object(r),!0).forEach(function(n){DR(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fp(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function DR(e,t,r){return t=LR(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function LR(e){var t=RR(e,"string");return Ci(t)=="symbol"?t:t+""}function RR(e,t){if(Ci(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ci(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var BR=function(t,r){var n=Jt(r-t),i=Math.min(Math.abs(r-t),359.999);return n*i},js=function(t){var r=t.cx,n=t.cy,i=t.radius,s=t.angle,o=t.sign,l=t.isExternal,c=t.cornerRadius,u=t.cornerIsExternal,f=c*(l?1:-1)+i,d=Math.asin(c/f)/fo,h=u?s:s+o*d,m=it(r,n,f,h),v=it(r,n,i,h),x=u?s-o*d:s,p=it(r,n,f*Math.cos(d*fo),x);return{center:m,circleTangency:v,lineTangency:p,theta:d}},Yy=function(t){var r=t.cx,n=t.cy,i=t.innerRadius,s=t.outerRadius,o=t.startAngle,l=t.endAngle,c=BR(o,l),u=o+c,f=it(r,n,s,o),d=it(r,n,s,u),h="M ".concat(f.x,",").concat(f.y,`
223    A `).concat(s,",").concat(s,`,0,
224    `).concat(+(Math.abs(c)>180),",").concat(+(o>u),`,
225    `).concat(d.x,",").concat(d.y,`
226  `);if(i>0){var m=it(r,n,i,o),v=it(r,n,i,u);h+="L ".concat(v.x,",").concat(v.y,`
227            A `).concat(i,",").concat(i,`,0,
228            `).concat(+(Math.abs(c)>180),",").concat(+(o<=u),`,
229            `).concat(m.x,",").concat(m.y," Z")}else h+="L ".concat(r,",").concat(n," Z");return h},FR=function(t){var r=t.cx,n=t.cy,i=t.innerRadius,s=t.outerRadius,o=t.cornerRadius,l=t.forceCornerRadius,c=t.cornerIsExternal,u=t.startAngle,f=t.endAngle,d=Jt(f-u),h=js({cx:r,cy:n,radius:s,angle:u,sign:d,cornerRadius:o,cornerIsExternal:c}),m=h.circleTangency,v=h.lineTangency,x=h.theta,p=js({cx:r,cy:n,radius:s,angle:f,sign:-d,cornerRadius:o,cornerIsExternal:c}),w=p.circleTangency,j=p.lineTangency,_=p.theta,y=c?Math.abs(u-f):Math.abs(u-f)-x-_;if(y<0)return l?"M ".concat(v.x,",").concat(v.y,`
230        a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0
231        a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0
232      `):Yy({cx:r,cy:n,innerRadius:i,outerRadius:s,startAngle:u,endAngle:f});var g="M ".concat(v.x,",").concat(v.y,`
233    A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(m.x,",").concat(m.y,`
234    A`).concat(s,",").concat(s,",0,").concat(+(y>180),",").concat(+(d<0),",").concat(w.x,",").concat(w.y,`
235    A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(j.x,",").concat(j.y,`
236  `);if(i>0){var b=js({cx:r,cy:n,radius:i,angle:u,sign:d,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),N=b.circleTangency,O=b.lineTangency,D=b.theta,P=js({cx:r,cy:n,radius:i,angle:f,sign:-d,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),E=P.circleTangency,$=P.lineTangency,I=P.theta,L=c?Math.abs(u-f):Math.abs(u-f)-D-I;if(L<0&&o===0)return"".concat(g,"L").concat(r,",").concat(n,"Z");g+="L".concat($.x,",").concat($.y,`
237      A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(E.x,",").concat(E.y,`
238      A`).concat(i,",").concat(i,",0,").concat(+(L>180),",").concat(+(d>0),",").concat(N.x,",").concat(N.y,`
239      A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(O.x,",").concat(O.y,"Z")}else g+="L".concat(r,",").concat(n,"Z");return g},UR={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Zy=function(t){var r=hp(hp({},UR),t),n=r.cx,i=r.cy,s=r.innerRadius,o=r.outerRadius,l=r.cornerRadius,c=r.forceCornerRadius,u=r.cornerIsExternal,f=r.startAngle,d=r.endAngle,h=r.className;if(o<s||f===d)return null;var m=Ce("recharts-sector",h),v=o-s,x=xn(l,v,0,!0),p;return x>0&&Math.abs(f-d)<360?p=FR({cx:n,cy:i,innerRadius:s,outerRadius:o,cornerRadius:Math.min(x,v/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:f,endAngle:d}):p=Yy({cx:n,cy:i,innerRadius:s,outerRadius:o,startAngle:f,endAngle:d}),M.createElement("path",fu({},Ee(r,!0),{className:m,d:p,role:"img"}))};function $i(e){"@babel/helpers - typeof";return $i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$i(e)}function hu(){return hu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];
239for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hu.apply(this,arguments)}function mp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function pp(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?mp(Object(r),!0).forEach(function(n){zR(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mp(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function zR(e,t,r){return t=HR(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function HR(e){var t=WR(e,"string");return $i(t)=="symbol"?t:t+""}function WR(e,t){if($i(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if($i(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var gp={curveBasisClosed:zS,curveBasisOpen:HS,curveBasis:US,curveBumpX:AS,curveBumpY:PS,curveLinearClosed:WS,curveLinear:rl,curveMonotoneX:GS,curveMonotoneY:qS,curveNatural:VS,curveStep:KS,curveStepAfter:YS,curveStepBefore:XS},ws=function(t){return t.x===+t.x&&t.y===+t.y},Wa=function(t){return t.x},Ga=function(t){return t.y},GR=function(t,r){if(Ne(t))return t;var n="curve".concat(el(t));return(n==="curveMonotone"||n==="curveBump")&&r?gp["".concat(n).concat(r==="vertical"?"Y":"X")]:gp[n]||rl},qR=function(t){var r=t.type,n=r===void 0?"linear":r,i=t.points,s=i===void 0?[]:i,o=t.baseLine,l=t.layout,c=t.connectNulls,u=c===void 0?!1:c,f=GR(n,l),d=u?s.filter(function(x){return ws(x)}):s,h;if(Array.isArray(o)){var m=u?o.filter(function(x){return ws(x)}):o,v=d.map(function(x,p){return pp(pp({},x),{},{base:m[p]})});return l==="vertical"?h=fs().y(Ga).x1(Wa).x0(function(x){return x.base.x}):h=fs().x(Wa).y1(Ga).y0(function(x){return x.base.y}),h.defined(ws).curve(f),h(v)}return l==="vertical"&&ie(o)?h=fs().y(Ga).x1(Wa).x0(o):ie(o)?h=fs().x(Wa).y1(Ga).y0(o):h=Zv().x(Wa).y(Ga),h.defined(ws).curve(f),h(d)},mu=function(t){var r=t.className,n=t.points,i=t.path,s=t.pathRef;if((!n||!n.length)&&!i)return null;var o=n&&n.length?qR(t):i;return M.createElement("path",hu({},Ee(t,!1),Is(t),{className:Ce("recharts-curve",r),d:o,ref:s}))},Jy={exports:{}},VR="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",KR=VR,XR=KR;function Qy(){}function eb(){}eb.resetWarningCache=Qy;var YR=function(){function e(n,i,s,o,l,c){if(c!==XR){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:eb,resetWarningCache:Qy};return r.PropTypes=r,r};Jy.exports=YR();var ZR=Jy.exports;const je=Re(ZR);var JR=Object.getOwnPropertyNames,QR=Object.getOwnPropertySymbols,e3=Object.prototype.hasOwnProperty;function vp(e,t){return function(n,i,s){return e(n,i,s)&&t(n,i,s)}}function _s(e){return function(r,n,i){if(!r||!n||typeof r!="object"||typeof n!="object")return e(r,n,i);var s=i.cache,o=s.get(r),l=s.get(n);if(o&&l)return o===n&&l===r;s.set(r,n),s.set(n,r);var c=e(r,n,i);return s.delete(r),s.delete(n),c}}function xp(e){return JR(e).concat(QR(e))}var tb=Object.hasOwn||function(e,t){return e3.call(e,t)};function ka(e,t){return e||t?e===t:e===t||e!==e&&t!==t}var rb="_owner",yp=Object.getOwnPropertyDescriptor,bp=Object.keys;function t3(e,t,r){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function r3(e,t){return ka(e.getTime(),t.getTime())}function jp(e,t,r){if(e.size!==t.size)return!1;for(var n={},i=e.entries(),s=0,o,l;(o=i.next())&&!o.done;){for(var c=t.entries(),u=!1,f=0;(l=c.next())&&!l.done;){var d=o.value,h=d[0],m=d[1],v=l.value,x=v[0],p=v[1];!u&&!n[f]&&(u=r.equals(h,x,s,f,e,t,r)&&r.equals(m,p,h,x,e,t,r))&&(n[f]=!0),f++}if(!u)return!1;s++}return!0}function n3(e,t,r){var n=bp(e),i=n.length;if(bp(t).length!==i)return!1;for(var s;i-- >0;)if(s=n[i],s===rb&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!tb(t,s)||!r.equals(e[s],t[s],s,s,e,t,r))return!1;return!0}function qa(e,t,r){var n=xp(e),i=n.length;if(xp(t).length!==i)return!1;for(var s,o,l;i-- >0;)if(s=n[i],s===rb&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!tb(t,s)||!r.equals(e[s],t[s],s,s,e,t,r)||(o=yp(e,s),l=yp(t,s),(o||l)&&(!o||!l||o.configurable!==l.configurable||o.enumerable!==l.enumerable||o.writable!==l.writable)))return!1;return!0}function a3(e,t){return ka(e.valueOf(),t.valueOf())}function i3(e,t){return e.source===t.source&&e.flags===t.flags}function wp(e,t,r){if(e.size!==t.size)return!1;for(var n={},i=e.values(),s,o;(s=i.next())&&!s.done;){for(var l=t.values(),c=!1,u=0;(o=l.next())&&!o.done;)!c&&!n[u]&&(c=r.equals(s.value,o.value,s.value,o.value,e,t,r))&&(n[u]=!0),u++;if(!c)return!1}return!0}function s3(e,t){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}var o3="[object Arguments]",l3="[object Boolean]",c3="[object Date]",u3="[object Map]",d3="[object Number]",f3="[object Object]",h3="[object RegExp]",m3="[object Set]",p3="[object String]",g3=Array.isArray,_p=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,Np=Object.assign,v3=Object.prototype.toString.call.bind(Object.prototype.toString);function x3(e){var t=e.areArraysEqual,r=e.areDatesEqual,n=e.areMapsEqual,i=e.areObjectsEqual,s=e.arePrimitiveWrappersEqual,o=e.areRegExpsEqual,l=e.areSetsEqual,c=e.areTypedArraysEqual;return function(f,d,h){if(f===d)return!0;
239if(f==null||d==null||typeof f!="object"||typeof d!="object")return f!==f&&d!==d;var m=f.constructor;if(m!==d.constructor)return!1;if(m===Object)return i(f,d,h);if(g3(f))return t(f,d,h);if(_p!=null&&_p(f))return c(f,d,h);if(m===Date)return r(f,d,h);if(m===RegExp)return o(f,d,h);if(m===Map)return n(f,d,h);if(m===Set)return l(f,d,h);var v=v3(f);return v===c3?r(f,d,h):v===h3?o(f,d,h):v===u3?n(f,d,h):v===m3?l(f,d,h):v===f3?typeof f.then!="function"&&typeof d.then!="function"&&i(f,d,h):v===o3?i(f,d,h):v===l3||v===d3||v===p3?s(f,d,h):!1}}function y3(e){var t=e.circular,r=e.createCustomConfig,n=e.strict,i={areArraysEqual:n?qa:t3,areDatesEqual:r3,areMapsEqual:n?vp(jp,qa):jp,areObjectsEqual:n?qa:n3,arePrimitiveWrappersEqual:a3,areRegExpsEqual:i3,areSetsEqual:n?vp(wp,qa):wp,areTypedArraysEqual:n?qa:s3};if(r&&(i=Np({},i,r(i))),t){var s=_s(i.areArraysEqual),o=_s(i.areMapsEqual),l=_s(i.areObjectsEqual),c=_s(i.areSetsEqual);i=Np({},i,{areArraysEqual:s,areMapsEqual:o,areObjectsEqual:l,areSetsEqual:c})}return i}function b3(e){return function(t,r,n,i,s,o,l){return e(t,r,l)}}function j3(e){var t=e.circular,r=e.comparator,n=e.createState,i=e.equals,s=e.strict;if(n)return function(c,u){var f=n(),d=f.cache,h=d===void 0?t?new WeakMap:void 0:d,m=f.meta;return r(c,u,{cache:h,equals:i,meta:m,strict:s})};if(t)return function(c,u){return r(c,u,{cache:new WeakMap,equals:i,meta:void 0,strict:s})};var o={cache:void 0,equals:i,meta:void 0,strict:s};return function(c,u){return r(c,u,o)}}var w3=Jr();Jr({strict:!0});Jr({circular:!0});Jr({circular:!0,strict:!0});Jr({createInternalComparator:function(){return ka}});Jr({strict:!0,createInternalComparator:function(){return ka}});Jr({circular:!0,createInternalComparator:function(){return ka}});Jr({circular:!0,createInternalComparator:function(){return ka},strict:!0});function Jr(e){e===void 0&&(e={});var t=e.circular,r=t===void 0?!1:t,n=e.createInternalComparator,i=e.createState,s=e.strict,o=s===void 0?!1:s,l=y3(e),c=x3(l),u=n?n(c):b3(c);return j3({circular:r,comparator:c,createState:i,equals:u,strict:o})}function _3(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function Sp(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function i(s){r<0&&(r=s),s-r>t?(e(s),r=-1):_3(i)};requestAnimationFrame(n)}function pu(e){"@babel/helpers - typeof";return pu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pu(e)}function N3(e){return P3(e)||A3(e)||O3(e)||S3()}function S3(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
240In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function O3(e,t){if(e){if(typeof e=="string")return Op(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Op(e,t)}}function Op(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function A3(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function P3(e){if(Array.isArray(e))return e}function T3(){var e={},t=function(){return null},r=!1,n=function i(s){if(!r){if(Array.isArray(s)){if(!s.length)return;var o=s,l=N3(o),c=l[0],u=l.slice(1);if(typeof c=="number"){Sp(i.bind(null,u),c);return}i(c),Sp(i.bind(null,u));return}pu(s)==="object"&&(e=s,t(e)),typeof s=="function"&&s()}};return{stop:function(){r=!0},start:function(s){r=!1,n(s)},subscribe:function(s){return t=s,function(){t=function(){return null}}}}}function ki(e){"@babel/helpers - typeof";return ki=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ki(e)}function Ap(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Pp(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};
vendor: 47,673 bytes, lines 240-257
240t%2?Ap(Object(r),!0).forEach(function(n){nb(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ap(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function nb(e,t,r){return t=E3(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function E3(e){var t=C3(e,"string");return ki(t)==="symbol"?t:String(t)}function C3(e,t){if(ki(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ki(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $3=function(t,r){return[Object.keys(t),Object.keys(r)].reduce(function(n,i){return n.filter(function(s){return i.includes(s)})})},k3=function(t){return t},M3=function(t){return t.replace(/([A-Z])/g,function(r){return"-".concat(r.toLowerCase())})},ii=function(t,r){return Object.keys(r).reduce(function(n,i){return Pp(Pp({},n),{},nb({},i,t(i,r[i])))},{})},Tp=function(t,r,n){return t.map(function(i){return"".concat(M3(i)," ").concat(r,"ms ").concat(n)}).join(",")};function I3(e,t){return R3(e)||L3(e,t)||ab(e,t)||D3()}function D3(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
241In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function L3(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,s,o,l=[],c=!0,u=!1;try{if(s=(r=r.call(e)).next,t!==0)for(;!(c=(n=s.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,i=f}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function R3(e){if(Array.isArray(e))return e}function B3(e){return z3(e)||U3(e)||ab(e)||F3()}function F3(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
242In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ab(e,t){if(e){if(typeof e=="string")return gu(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return gu(e,t)}}function U3(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function z3(e){if(Array.isArray(e))return gu(e)}function gu(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var mo=1e-4,ib=function(t,r){return[0,3*t,3*r-6*t,3*t-3*r+1]},sb=function(t,r){return t.map(function(n,i){return n*Math.pow(r,i)}).reduce(function(n,i){return n+i})},Ep=function(t,r){return function(n){var i=ib(t,r);return sb(i,n)}},H3=function(t,r){return function(n){var i=ib(t,r),s=[].concat(B3(i.map(function(o,l){return o*l}).slice(1)),[0]);return sb(s,n)}},Cp=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=r[0],s=r[1],o=r[2],l=r[3];if(r.length===1)switch(r[0]){case"linear":i=0,s=0,o=1,l=1;break;case"ease":i=.25,s=.1,o=.25,l=1;break;case"ease-in":i=.42,s=0,o=1,l=1;break;case"ease-out":i=.42,s=0,o=.58,l=1;break;case"ease-in-out":i=0,s=0,o=.58,l=1;break;default:{var c=r[0].split("(");if(c[0]==="cubic-bezier"&&c[1].split(")")[0].split(",").length===4){var u=c[1].split(")")[0].split(",").map(function(p){return parseFloat(p)}),f=I3(u,4);i=f[0],s=f[1],o=f[2],l=f[3]}}}var d=Ep(i,o),h=Ep(s,l),m=H3(i,o),v=function(w){return w>1?1:w<0?0:w},x=function(w){for(var j=w>1?1:w,_=j,y=0;y<8;++y){var g=d(_)-j,b=m(_);if(Math.abs(g-j)<mo||b<mo)return h(_);_=v(_-g/b)}return h(_)};return x.isStepper=!1,x},W3=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,i=t.damping,s=i===void 0?8:i,o=t.dt,l=o===void 0?17:o,c=function(f,d,h){var m=-(f-d)*n,v=h*s,x=h+(m-v)*l/1e3,p=h*l/1e3+f;return Math.abs(p-d)<mo&&Math.abs(x)<mo?[d,0]:[p,x]};return c.isStepper=!0,c.dt=l,c},G3=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=r[0];if(typeof i=="string")switch(i){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return Cp(i);case"spring":return W3();default:if(i.split("(")[0]==="cubic-bezier")return Cp(i)}return typeof i=="function"?i:null};function Mi(e){"@babel/helpers - typeof";return Mi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mi(e)}function $p(e){return K3(e)||V3(e)||ob(e)||q3()}function q3(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
243In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function V3(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function K3(e){if(Array.isArray(e))return xu(e)}function kp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function at(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?kp(Object(r),!0).forEach(function(n){vu(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kp(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vu(e,t,r){return t=X3(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function X3(e){var t=Y3(e,"string");return Mi(t)==="symbol"?t:String(t)}function Y3(e,t){if(Mi(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Mi(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Z3(e,t){return e5(e)||Q3(e,t)||ob(e,t)||J3()}function J3(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
244In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ob(e,t){if(e){if(typeof e=="string")return xu(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xu(e,t)}}function xu(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Q3(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,s,o,l=[],c=!0,u=!1;try{if(s=(r=r.call(e)).next,t!==0)for(;!(c=(n=s.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,i=f}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function e5(e){if(Array.isArray(e))return e}var po=function(t,r,n){return t+(r-t)*n},yu=function(t){var r=t.from,n=t.to;return r!==n},t5=function e(t,r,n){var i=ii(function(s,o){if(yu(o)){var l=t(o.from,o.to,o.velocity),c=Z3(l,2),u=c[0],f=c[1];return at(at({},o),{},{from:u,velocity:f})}return o},r);return n<1?ii(function(s,o){return yu(o)?at(at({},o),{},{velocity:po(o.velocity,i[s].velocity,n),from:po(o.from,i[s].from,n)}):o},r):e(t,i,n-1)};const r5=function(e,t,r,n,i){var s=$3(e,t),o=s.reduce(function(p,w){return at(at({},p),{},vu({},w,[e[w],t[w]]))},{}),l=s.reduce(function(p,w){return at(at({},p),{},vu({},w,{from:e[w],velocity:0,to:t[w]}))},{}),c=-1,u,f,d=function(){return null},h=function(){return ii(function(w,j){return j.from},l)},m=function(){return!Object.values(l).filter(yu).length},v=function(w){u||(u=w);var j=w-u,_=j/r.dt;l=t5(r,l,_),i(at(at(at({},e),t),h())),u=w,m()||(c=requestAnimationFrame(d))},x=function(w){f||(f=w);var j=(w-f)/n,_=ii(function(g,b){return po.apply(void 0,$p(b).concat([r(j)]))},o);if(i(at(at(at({},e),t),_)),j<1)c=requestAnimationFrame(d);else{var y=ii(function(g,b){return po.apply(void 0,$p(b).concat([r(1)]))},o);i(at(at(at({},e),t),y))}};return d=r.isStepper?v:x,function(){return requestAnimationFrame(d),function(){cancelAnimationFrame(c)}}};function sa(e){"@babel/helpers - typeof";return sa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sa(e)}var n5=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function a5(e,t){if(e==null)return{};var r=i5(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function i5(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,s;for(s=0;s<n.length;s++)i=n[s],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}function Ql(e){return c5(e)||l5(e)||o5(e)||s5()}function s5(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
245In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function o5(e,t){if(e){if(typeof e=="string")return bu(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return bu(e,t)}}function l5(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function c5(e){if(Array.isArray(e))return bu(e)}function bu(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Mp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Wt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Mp(Object(r),!0).forEach(function(n){ei(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mp(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ei(e,t,r){return t=lb(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u5(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d5(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,lb(n.key),n)}}function f5(e,t,r){return t&&d5(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function lb(e){var t=h5(e,"string");return sa(t)==="symbol"?t:String(t)}function h5(e,t){if(sa(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(sa(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function m5(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ju(e,t)}function ju(e,t){return ju=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},ju(e,t)}function p5(e){var t=g5();return function(){var n=go(e),i;if(t){var s=go(this).constructor;i=Reflect.construct(n,arguments,s)}else i=n.apply(this,arguments);return wu(this,i)}}function wu(e,t){if(t&&(sa(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _u(e)}function _u(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g5(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function go(e){return go=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},go(e)}var Ir=function(e){m5(r,e);var t=p5(r);function r(n,i){var s;u5(this,r),s=t.call(this,n,i);var o=s.props,l=o.isActive,c=o.attributeName,u=o.from,f=o.to,d=o.steps,h=o.children,m=o.duration;if(s.handleStyleChange=s.handleStyleChange.bind(_u(s)),s.changeStyle=s.changeStyle.bind(_u(s)),!l||m<=0)return s.state={style:{}},typeof h=="function"&&(s.state={style:f}),wu(s);if(d&&d.length)s.state={style:d[0].style};else if(u){if(typeof h=="function")return s.state={style:u},wu(s);s.state={style:c?ei({},c,u):u}}else s.state={style:{}};return s}return f5(r,[{key:"componentDidMount",value:function(){var i=this.props,s=i.isActive,o=i.canBegin;this.mounted=!0,!(!s||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var s=this.props,o=s.isActive,l=s.canBegin,c=s.attributeName,u=s.shouldReAnimate,f=s.to,d=s.from,h=this.state.style;if(l){if(!o){var m={style:c?ei({},c,f):f};this.state&&h&&(c&&h[c]!==f||!c&&h!==f)&&this.setState(m);return}if(!(w3(i.to,f)&&i.canBegin&&i.isActive)){var v=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var x=v||u?d:i.to;if(this.state&&h){var p={style:c?ei({},c,x):x};(c&&h[c]!==x||!c&&h!==x)&&this.setState(p)}this.runAnimation(Wt(Wt({},this.props),{},{from:x,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var s=this,o=i.from,l=i.to,c=i.duration,u=i.easing,f=i.begin,d=i.onAnimationEnd,h=i.onAnimationStart,m=r5(o,l,G3(u),c,this.changeStyle),v=function(){s.stopJSAnimation=m()};this.manager.start([h,f,v,c,d])}},{key:"runStepAnimation",value:function(i){var s=this,o=i.steps,l=i.begin,c=i.onAnimationStart,u=o[0],f=u.style,d=u.duration,h=d===void 0?0:d,m=function(x,p,w){if(w===0)return x;var j=p.duration,_=p.easing,y=_===void 0?"ease":_,g=p.style,b=p.properties,N=p.onAnimationEnd,O=w>0?o[w-1]:p,D=b||Object.keys(g);if(typeof y=="function"||y==="spring")return[].concat(Ql(x),[s.runJSAnimation.bind(s,{from:O.style,to:g,duration:j,easing:y}),j]);var P=Tp(D,j,y),E=Wt(Wt(Wt({},O.style),g),{},{transition:P});return[].concat(Ql(x),[E,j,N]).filter(k3)};return this.manager.start([c].concat(Ql(o.reduce(m,[f,Math.max(h,l)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=T3());var s=i.begin,o=i.duration,l=i.attributeName,c=i.to,u=i.easing,f=i.onAnimationStart,d=i.onAnimationEnd,h=i.steps,m=i.children,v=this.manager;if(this.unSubscribe=v.subscribe(this.handleStyleChange),typeof u=="function"||typeof m=="function"||u==="spring"){this.runJSAnimation(i);return}if(h.length>1){this.runStepAnimation(i);return}var x=l?ei({},l,c):c,p=Tp(Object.keys(x),o,u);v.start([f,s,Wt(Wt({},x),{},{transition:p}),o,d])}},{key:"render",value:function(){var i=this.props,s=i.children;i.begin;var o=i.duration;i.attributeName,i.easing;var l=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var c=a5(i,n5),u=S.Children.count(s),f=this.state.style;if(typeof s=="function")return s(f);if(!l||u===0||o<=0)return s;var d=function(m){var v=m.props,x=v.style,p=x===void 0?{}:x,w=v.className,j=S.cloneElement(m,Wt(Wt({},c),{},{style:Wt(Wt({},p),f),className:w}));return j};return u===1?d(S.Children.only(s)):M.createElement("div",null,S.Children.map(s,function(h){return d(h)}))}}]),r}(S.PureComponent);Ir.displayName="Animate";Ir.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Ir.propTypes={from:je.oneOfType([je.object,je.string]),to:je.oneOfType([je.object,je.string]),attributeName:je.string,duration:je.number,begin:je.number,easing:je.oneOfType([je.string,je.func]),steps:je.arrayOf(je.shape({duration:je.number.isRequired,style:je.object.isRequired,easing:je.oneOfType([je.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),je.func]),properties:je.arrayOf("string"),onAnimationEnd:je.func})),children:je.oneOfType([je.node,je.func]),isActive:je.bool,canBegin:je.bool,onAnimationEnd:je.func,shouldReAnimate:je.bool,onAnimationStart:je.func,onAnimationReStart:je.func};je.object,je.object,je.object,je.element;je.object,je.object,je.object,je.oneOfType([je.array,je.element]),je.any;function Ii(e){"@babel/helpers - typeof";return Ii=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ii(e)}function vo(){return vo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vo.apply(this,arguments)}function v5(e,t){return j5(e)||b5(e,t)||y5(e,t)||x5()}function x5(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
246In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function y5(e,t){if(e){if(typeof e=="string")return Ip(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ip(e,t)}}function Ip(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function b5(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,s,o,l=[],c=!0,u=!1;try{if(s=(r=r.call(e)).next,t!==0)for(;!(c=(n=s.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,i=f}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function j5(e){if(Array.isArray(e))return e}function Dp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Lp(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Dp(Object(r),!0).forEach(function(n){w5(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Dp(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function w5(e,t,r){return t=_5(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _5(e){var t=N5(e,"string");return Ii(t)=="symbol"?t:t+""}function N5(e,t){if(Ii(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ii(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Rp=function(t,r,n,i,s){var o=Math.min(Math.abs(n)/2,Math.abs(i)/2),l=i>=0?1:-1,c=n>=0?1:-1,u=i>=0&&n>=0||i<0&&n<0?1:0,f;if(o>0&&s instanceof Array){for(var d=[0,0,0,0],h=0,m=4;h<m;h++)d[h]=s[h]>o?o:s[h];f="M".concat(t,",").concat(r+l*d[0]),d[0]>0&&(f+="A ".concat(d[0],",").concat(d[0],",0,0,").concat(u,",").concat(t+c*d[0],",").concat(r)),f+="L ".concat(t+n-c*d[1],",").concat(r),d[1]>0&&(f+="A ".concat(d[1],",").concat(d[1],",0,0,").concat(u,`,
247        `).concat(t+n,",").concat(r+l*d[1])),f+="L ".concat(t+n,",").concat(r+i-l*d[2]),d[2]>0&&(f+="A ".concat(d[2],",").concat(d[2],",0,0,").concat(u,`,
248        `).concat(t+n-c*d[2],",").concat(r+i)),f+="L ".concat(t+c*d[3],",").concat(r+i),d[3]>0&&(f+="A ".concat(d[3],",").concat(d[3],",0,0,").concat(u,`,
249        `).concat(t,",").concat(r+i-l*d[3])),f+="Z"}else if(o>0&&s===+s&&s>0){var v=Math.min(o,s);f="M ".concat(t,",").concat(r+l*v,`
250            A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t+c*v,",").concat(r,`
251            L `).concat(t+n-c*v,",").concat(r,`
252            A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t+n,",").concat(r+l*v,`
253            L `).concat(t+n,",").concat(r+i-l*v,`
254            A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t+n-c*v,",").concat(r+i,`
255            L `).concat(t+c*v,",").concat(r+i,`
256            A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t,",").concat(r+i-l*v," Z")}else f="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(i," h ").concat(-n," Z");return f},S5=function(t,r){if(!t||!r)return!1;var n=t.x,i=t.y,s=r.x,o=r.y,l=r.width,c=r.height;if(Math.abs(l)>0&&Math.abs(c)>0){var u=Math.min(s,s+l),f=Math.max(s,s+l),d=Math.min(o,o+c),h=Math.max(o,o+c);return n>=u&&n<=f&&i>=d&&i<=h}return!1},O5={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},of=function(t){var r=Lp(Lp({},O5),t),n=S.useRef(),i=S.useState(-1),s=v5(i,2),o=s[0],l=s[1];S.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var y=n.current.getTotalLength();y&&l(y)}catch{}},[]);var c=r.x,u=r.y,f=r.width,d=r.height,h=r.radius,m=r.className,v=r.animationEasing,x=r.animationDuration,p=r.animationBegin,w=r.isAnimationActive,j=r.isUpdateAnimationActive;if(c!==+c||u!==+u||f!==+f||d!==+d||f===0||d===0)return null;var _=Ce("recharts-rectangle",m);return j?M.createElement(Ir,{canBegin:o>0,from:{width:f,height:d,x:c,y:u},to:{width:f,height:d,x:c,y:u},duration:x,animationEasing:v,isActive:j},function(y){var g=y.width,b=y.height,N=y.x,O=y.y;return M.createElement(Ir,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:p,duration:x,isActive:w,easing:v},M.createElement("path",vo({},Ee(r,!0),{className:_,d:Rp(N,O,g,b,h),ref:n})))}):M.createElement("path",vo({},Ee(r,!0),{className:_,d:Rp(c,u,f,d,h)}))};function Nu(){return Nu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Nu.apply(this,arguments)}var lf=function(t){var r=t.cx,n=t.cy,i=t.r,s=t.className,o=Ce("recharts-dot",s);return r===+r&&n===+n&&i===+i?M.createElement("circle",Nu({},Ee(t,!1),Is(t),{className:o,cx:r,cy:n,r:i})):null};function Di(e){"@babel/helpers - typeof";return Di=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Di(e)}var A5=["x","y","top","left","width","height","className"];function Su(){return Su=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Su.apply(this,arguments)}function Bp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function P5(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Bp(Object(r),!0).forEach(function(n){T5(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bp(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function T5(e,t,r){return t=E5(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function E5(e){var t=C5(e,"string");return Di(t)=="symbol"?t:t+""}function C5(e,t){if(Di(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Di(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $5(e,t){if(e==null)return{};var r=k5(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function k5(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var M5=function(t,r,n,i,s,o){return"M".concat(t,",").concat(s,"v").concat(i,"M").concat(o,",").concat(r,"h").concat(n)},I5=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,s=i===void 0?0:i,o=t.top,l=o===void 0?0:o,c=t.left,u=c===void 0?0:c,f=t.width,d=f===void 0?0:f,h=t.height,m=h===void 0?0:h,v=t.className,x=$5(t,A5),p=P5({x:n,y:s,top:l,left:u,width:d,height:m},x);return!ie(n)||!ie(s)||!ie(d)||!ie(m)||!ie(l)||!ie(u)?null:M.createElement("path",Su({},Ee(p,!0),{className:Ce("recharts-cross",v),d:M5(n,s,d,m,l,u)}))},D5=jx,L5=D5(Object.getPrototypeOf,Object),R5=L5,B5=Dr,F5=R5,U5=Lr,z5="[object Object]",H5=Function.prototype,W5=Object.prototype,cb=H5.toString,G5=W5.hasOwnProperty,q5=cb.call(Object);function V5(e){if(!U5(e)||B5(e)!=z5)return!1;var t=F5(e);if(t===null)return!0;var r=G5.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&cb.call(r)==q5}var K5=V5;const X5=Re(K5);var Y5=Dr,Z5=Lr,J5="[object Boolean]";function Q5(e){return e===!0||e===!1||Z5(e)&&Y5(e)==J5}var e6=Q5;const t6=Re(e6);function Li(e){"@babel/helpers - typeof";return Li=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Li(e)}function xo(){return xo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xo.apply(this,arguments)}function r6(e,t){return s6(e)||i6(e,t)||a6(e,t)||n6()}function n6(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
257In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function a6(e,t){if(e){if(typeof e=="string")return Fp(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Fp(e,t)}}function Fp(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function i6(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,s,o,l=[],c=!0,u=!1;try{if(s=(r=r.call(e)).next,t!==0)for(;!(c=(n=s.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,i=f}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function s6(e){if(Array.isArray(e))return e}function Up(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function zp(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Up(Object(r),!0).forEach(function(n){o6(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Up(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function o6(e,t,r){return t=l6(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function l6(e){var t=c6(e,"string");return Li(t)=="symbol"?t:t+""}function c6(e,t){if(Li(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Li(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Hp=function(t,r,n,i,s){var o=n-i,l;return l="M ".concat(t,",").concat(r),l+="L ".concat(t+n,",").concat(r),l+="L ".concat(t+n-o/2,",").concat(r+s),l+="L ".concat(t+n-o/2-i,",").concat(r+s),l+="L ".concat(t,",").concat(r," Z"),l},u6={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},d6=function(t){var r=zp(zp({},u6),t),n=S.useRef(),i=S.useState(-1),s=r6(i,2),o=s[0],l=s[1];S.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var _=n.current.getTotalLength();_&&l(_)}catch{}},[]);var c=r.x,u=r.y,f=r.upperWidth,d=r.lowerWidth,h=r.height,m=r.className,v=r.animationEasing,x=r.animationDuration,p=r.animationBegin,w=r.isUpdateAnimationActive;if(c!==+c||u!==+u||f!==+f||d!==+d||h!==+h||f===0&&d===0||h===0)return null;var j=Ce("recharts-trapezoid",m);return w?M.createElement(Ir,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:h,x:c,y:u},to:{upperWidth:f,lowerWidth:d,height:h,x:c,y:u},duration:x,animationEasing:v,isActive:w},function(_){var y=_.upperWidth,g=_.lowerWidth,b=_.height,N=_.x,O=_.y;return M.createElement(Ir,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:p,duration:x,easing:v},M.createElement("path",xo({},Ee(r,!0),{className:j,d:Hp(N,O,y,g,b),ref:n})))}):M.createElement("g",null,M.createElement("path",xo({},Ee(r,!0),{className:j,d:Hp(c,u,f,d,h)})))},f6=["option","shapeType","propTransformer","activeClassName","isActive"];function Ri(e){"@babel/helpers - typeof";return Ri=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ri(e)}function h6(e,t){if(e==null)return{};var r=m6(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function m6(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Wp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function yo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Wp(Object(r),!0).forEach(function(n){p6(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wp(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function p6(e,t,r){return t=g6(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function g6(e){var t=v6(e,"string");return Ri(t)=="symbol"?t:t+""}function v6(e,t){if(Ri(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ri(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function x6(e,t){return yo(yo({},t),e)}function y6(e,t){return e==="symbols"}function Gp(e){var t=e.shapeType,r=e.elementProps;switch(t){case"rectangle":return M.createElement(of,r);case"trapezoid":return M.createElement(d6,r);case"sector":return M.createElement(Zy,r);case"symbols":if(y6(t))return M.createElement(Sd,r);break;default:return null}}function b6(e){return S.isValidElement(e)?e.props:e}function j6(e){var t=e.option,r=e.shapeType,n=e.propTransformer,i=n===void 0?x6:n,s=e.activeClassName,o=s===void 0?"recharts-active-shape":s,l=e.isActive,c=h6(e,f6),u;if(S.isValidElement(t))u=S.cloneElement(t,yo(yo({},c),b6(t)));else if(Ne(t))u=t(c);else if(X5(t)&&!t6(t)){var f=i(t,c);u=M.createElement(Gp,{shapeType:r,elementProps:f})}else{var d=c;u=M.createElement(Gp,{shapeType:r,elementProps:d})}return l?M.createElement(Ge,{className:o},u):u}function xl(e,t){return t!=null&&"trapezoids"in e.props}function yl(e,t){return t!=null&&"sectors"in e.props}function Bi(e,t){return t!=null&&"points"in e.props}function w6(e,t){var r,n,i=e.x===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.x)||e.x===t.x,s=e.y===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.y)||e.y===t.y;return i&&s}function _6(e,t){var r=e.endAngle===t.endAngle,n=e.startAngle===t.startAngle;return r&&n}function N6(e,t){var r=e.x===t.x,n=e.y===t.y,i=e.z===t.z;return r&&n&&i}function S6(e,t){var r;return xl(e,t)?r=w6:yl(e,t)?r=_6:Bi(e,t)&&(r=N6),r}function O6(e,t){var r;return xl(e,t)?r="trapezoids":yl(e,t)?r="sectors":Bi(e,t)&&(r="points"),r}function A6(e,t){if(xl(e,t)){var r;return(r=t.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}if(yl(e,t)){var n;return(n=t.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}return Bi(e,t)?t.payload:{}}function P6(e){var t=e.activeTooltipItem,r=e.graphicalItem,n=e.itemData,i=O6(r,t),s=A6(r,t),o=n.filter(function(c,u){var f=pl(s,c),d=r.props[i].filter(function(v){var x=S6(r,t);return x(v,t)}),h=r.props[i].indexOf(d[d.length-1]),m=u===h;return f&&m}),l=n.indexOf(o[o.length-1]);return l}var T6=Math.ceil,E6=Math.max;function C6(e,t,r,n){for(var i=-1,s=E6(T6((t-e)/(r||1)),0),o=Array(s);s--;)o[n?s:++i]=e,e+=r;return o}var $6=C6,k6=Fx,qp=1/0,M6=17976931348623157e292;function I6(e){if(!e)return e===0?e:0;if(e=k6(e),e===qp||e===-qp){var t=e<0?-1:1;return t*M6}return e===e?e:0}var ub=I6,D6=$6,L6=sl,ec=ub;function R6(e){return function(t,r,n){return n&&typeof n!="number"&&L6(t,r,n)&&(r=n=void 0),t=ec(t),r===void 0?(r=t,t=0):r=ec(r),n=n===void 0?t<r?1:-1:ec(n),D6(t,r,n,e)}}var B6=R6,F6=B6,U6=F6(),z6=U6;const bo=Re(z6);function Fi(e){"@babel/helpers - typeof";return Fi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fi(e)}function Vp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Kp(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Vp(Object(r),!0).forEach(function(n){db(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Vp(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function db(e,t,r){return t=H6(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function H6(e){var t=W6(e,"string");return Fi(t)=="symbol"?t:t+""}function W6(e,t){if(Fi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Fi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var G6=["Webkit","Moz","O","ms"],q6=function(t,r){var n=t.replace(/(\w)/,function(s){return s.toUpperCase()}),i=G6.reduce(function(s,o){return Kp(Kp({},s),{},db({},o+n,r))},{});return i[t]=r,i};function oa(e){"@babel/helpers - typeof";return oa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oa(e)}function jo(){return jo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jo.apply(this,arguments)}function Xp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function tc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Xp(Object(r),!0).forEach(function(n){At(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xp(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function V6(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Yp(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,hb(n.key),n)}}function K6(e,t,r){return t&&Yp(e.prototype,t),r&&Yp(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function X6(e,t,r){return t=wo(t),Y6(e,fb()?Reflect.construct(t,r||[],wo(e).constructor):t.apply(e,r))}function Y6(e,t){if(t&&(oa(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Z6(e)}function Z6(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function fb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(fb=function(){return!!e})()}function wo(e){return wo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},wo(e)}function J6(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ou(e,t)}function Ou(e,t){return Ou=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Ou(e,t)}function At(e,t,r){return t=hb(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hb(e){var t=Q6(e,"string");return oa(t)=="symbol"?t:t+""}function Q6(e,t){if(oa(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(oa(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var eB=function(t){var r=t.data,n=t.startIndex,i=t.endIndex,s=t.x,o=t.width,l=t.travellerWidth;if(!r||!r.length)return{};var c=r.length,u=ni().domain(bo(0,c)).range([s,s+o-l]),f=u.domain().map(function(d){return u(d)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:u(n),endX:u(i),scale:u,scaleValues:f}},Zp=function(t){return t.changedTouches&&!!t.changedTouches.length},la=function(e){function t(r){var n;return V6(this,t),n=X6(this,t,[r]),At(n,"handleDrag",function(i){n.leaveTimer&&(clearTimeout(n.leaveTimer),n.leaveTimer=null),n.state.isTravellerMoving?n.handleTravellerMove(i):n.state.isSlideMoving&&n.handleSlideDrag(i)}),At(n,"handleTouchMove",function(i){i.changedTouches!=null&&i.changedTouches.length>0&&n.handleDrag(i.changedTouches[0])}),At(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=n.props,s=i.endIndex,o=i.onDragEnd,l=i.startIndex;o==null||o({endIndex:s,startIndex:l})}),n.detachDragEndListener()}),At(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),At(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),At(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),At(n,"handleSlideDragStart",function(i){var s=Zp(i)?i.changedTouches[0]:i;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:s.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return J6(t,e),K6(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var i=n.startX,s=n.endX,o=this.state.scaleValues,l=this.props,c=l.gap,u=l.data,f=u.length-1,d=Math.min(i,s),h=Math.max(i,s),m=t.getIndexInRange(o,d),v=t.getIndexInRange(o,h);return{startIndex:m-m%c,endIndex:v===f?f:v-v%c}}},{key:"getTextOfTick",value:function(n){var i=this.props,s=i.data,o=i.tickFormatter,l=i.dataKey,c=Ct(s[n],l,n);return Ne(o)?o(c,n):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var i=this.state,s=i.slideMoveStartX,o=i.startX,l=i.endX,c=this.props,u=c.x,f=c.width,d=c.travellerWidth,h=c.startIndex,m=c.endIndex,v=c.onChange,x=n.pageX-s;x>0?x=Math.min(x,u+f-d-l,u+f-d-o):x<0&&(x=Math.max(x,u-o,u-l));var p=this.getIndex({startX:o+x,endX:l+x});(p.startIndex!==h||p.endIndex!==m)&&v&&v(p),this.setState({startX:o+x,endX:l+x,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var s=Zp(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:s.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var i=this.state,s=i.brushMoveStartX,o=i.movingTravellerId,l=i.endX,c=i.startX,u=this.state[o],f=this.props,d=f.x,h=f.width,m=f.travellerWidth,v=f.onChange,x=f.gap,p=f.data,w={startX:this.state.startX,endX:this.state.endX},j=n.pageX-s;j>0?j=Math.min(j,d+h-m-u):j<0&&(j=Math.max(j,d-u)),w[o]=u+j;var _=this.getIndex(w),y=_.startIndex,g=_.endIndex,b=function(){var O=p.length-1;return o==="startX"&&(l>c?y%x===0:g%x===0)||l<c&&g===O||o==="endX"&&(l>c?g%x===0:y%x===0)||l>c&&g===O};this.setState(At(At({},o,u+j),"brushMoveStartX",n.pageX),function(){v&&b()&&v(_)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var s=this,o=this.state,l=o.scaleValues,c=o.startX,u=o.endX,f=this.state[i],d=l.indexOf(f);if(d!==-1){var h=d+n;if(!(h===-1||h>=l.length)){var m=l[h];i==="startX"&&m>=u||i==="endX"&&m<=c||this.setState(At({},i,m),function(){s.props.onChange(s.getIndex({startX:s.state.startX,endX:s.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,i=n.x,s=n.y,o=n.width,l=n.height,c=n.fill,u=n.stroke;return M.createElement("rect",{stroke:u,fill:c,x:i,y:s,width:o,height:l})}},{key:"renderPanorama",value:function(){var n=this.props,i=n.x,s=n.y,o=n.width,l=n.height,c=n.data,u=n.children,f=n.padding,d=S.Children.only(u);return d?M.cloneElement(d,{x:i,y:s,width:o,height:l,margin:f,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(n,i){var s,o,l=this,c=this.props,u=c.y,f=c.travellerWidth,d=c.height,h=c.traveller,m=c.ariaLabel,v=c.data,x=c.startIndex,p=c.endIndex,w=Math.max(n,this.props.x),j=tc(tc({},Ee(this.props,!1)),{},{x:w,y:u,width:f,height:d}),_=m||"Min value: ".concat((s=v[x])===null||s===void 0?void 0:s.name,", Max value: ").concat((o=v[p])===null||o===void 0?void 0:o.name);return M.createElement(Ge,{tabIndex:0,role:"slider","aria-label":_,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(g){["ArrowLeft","ArrowRight"].includes(g.key)&&(g.preventDefault(),g.stopPropagation(),l.handleTravellerMoveKeyboard(g.key==="ArrowRight"?1:-1,i))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(h,j))}},{key:"renderSlide",value:function(n,i){var s=this.props,o=s.y,l=s.height,c=s.stroke,u=s.travellerWidth,f=Math.min(n,i)+u,d=Math.max(Math.abs(i-n)-u,0);return M.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:f,y:o,width:d,height:l})}},{key:"renderText",value:function(){var n=this.props,i=n.startIndex,s=n.endIndex,o=n.y,l=n.height,c=n.travellerWidth,u=n.stroke,f=this.state,d=f.startX,h=f.endX,m=5,v={pointerEvents:"none",fill:u};return M.createElement(Ge,{className:"recharts-brush-texts"},M.createElement(Ys,jo({textAnchor:"end",verticalAnchor:"middle",x:Math.min(d,h)-m,y:o+l/2},v),this.getTextOfTick(i)),M.createElement(Ys,jo({textAnchor:"start",verticalAnchor:"middle",x:Math.max(d,h)+c+m,y:o+l/2},v),this.getTextOfTick(s)))}},{key:"render",value:function(){var n=this.props,i=n.data,s=n.className,o=n.children,l=n.x,c=n.y,u=n.width,f=n.height,d=n.alwaysShowText,h=this.state,m=h.startX,v=h.endX,x=h.isTextActive,p=h.isSlideMoving,w=h.isTravellerMoving,j=h.isTravellerFocused;if(!i||!i.length||!ie(l)||!ie(c)||!ie(u)||!ie(f)||u<=0||f<=0)return null;var _=Ce("recharts-brush",s),y=M.Children.count(o)===1,g=q6("userSelect","none");return M.createElement(Ge,{className:_,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:g},this.renderBackground(),y&&this.renderPanorama(),this.renderSlide(m,v),this.renderTravellerLayer(m,"startX"),this.renderTravellerLayer(v,"endX"),(x||p||w||j||d)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var i=n.x,s=n.y,o=n.width,l=n.height,c=n.stroke,u=Math.floor(s+l/2)-1;return M.createElement(M.Fragment,null,M.createElement("rect",{x:i,y:s,width:o,height:l,fill:c,stroke:"none"}),M.createElement("line",{x1:i+1,y1:u,x2:i+o-1,y2:u,fill:"none",stroke:"#fff"}),M.createElement("line",{x1:i+1,y1:u+2,x2:i+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,i){var s;return M.isValidElement(n)?s=M.cloneElement(n,i):Ne(n)?s=n(i):s=t.renderDefaultTraveller(i),s}},{key:"getDerivedStateFromProps",value:function(n,i){var s=n.data,o=n.width,l=n.x,c=n.travellerWidth,u=n.updateId,f=n.startIndex,d=n.endIndex;if(s!==i.prevData||u!==i.prevUpdateId)return tc({prevData:s,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o},s&&s.length?eB({data:s,width:o,x:l,travellerWidth:c,startIndex:f,endIndex:d}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||l!==i.prevX||c!==i.prevTravellerWidth)){i.scale.range([l,l+o-c]);var h=i.scale.domain().map(function(m){return i.scale(m)});return{prevData:s,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o,startX:i.scale(n.startIndex),endX:i.scale(n.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(n,i){for(var s=n.length,o=0,l=s-1;l-o>1;){var c=Math.floor((o+l)/2);n[c]>i?l=c:o=c}return i>=n[l]?l:o}}])}(S.PureComponent);
257At(la,"displayName","Brush");At(la,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var tB=$d;function rB(e,t){var r;return tB(e,function(n,i,s){return r=t(n,i,s),!r}),!!r}var nB=rB,aB=hx,iB=Xr,sB=nB,oB=St,lB=sl;function cB(e,t,r){var n=oB(e)?aB:sB;return r&&lB(e,t,r)&&(t=void 0),n(e,iB(t))}var uB=cB;const dB=Re(uB);var or=function(t,r){var n=t.alwaysShow,i=t.ifOverflow;return n&&(i="extendDomain"),i===r},Jp=Ix;function fB(e,t,r){t=="__proto__"&&Jp?Jp(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var hB=fB,mB=hB,pB=kx,gB=Xr;function vB(e,t){var r={};return t=gB(t),pB(e,function(n,i,s){mB(r,i,t(n,i,s))}),r}var xB=vB;const yB=Re(xB);function bB(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}var jB=bB,wB=$d;function _B(e,t){var r=!0;return wB(e,function(n,i,s){return r=!!t(n,i,s),r}),r}var NB=_B,SB=jB,OB=NB,AB=Xr,PB=St,TB=sl;function EB(e,t,r){var n=PB(e)?SB:OB;return r&&TB(e,t,r)&&(t=void 0),n(e,AB(t))}var CB=EB;const mb=Re(CB);var $B=["x","y"];function Ui(e){"@babel/helpers - typeof";return Ui=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ui(e)}function Au(){return Au=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Au.apply(this,arguments)}function Qp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Va(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Qp(Object(r),!0).forEach(function(n){kB(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qp(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function kB(e,t,r){return t=MB(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function MB(e){var t=IB(e,"string");return Ui(t)=="symbol"?t:t+""}function IB(e,t){if(Ui(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ui(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function DB(e,t){if(e==null)return{};var r=LB(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function LB(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function RB(e,t){var r=e.x,n=e.y,i=DB(e,$B),s="".concat(r),o=parseInt(s,10),l="".concat(n),c=parseInt(l,10),u="".concat(t.height||i.height),f=parseInt(u,10),d="".concat(t.width||i.width),h=parseInt(d,10);return Va(Va(Va(Va(Va({},t),i),o?{x:o}:{}),c?{y:c}:{}),{},{height:f,width:h,name:t.name,radius:t.radius})}function eg(e){return M.createElement(j6,Au({shapeType:"rectangle",propTransformer:RB,activeClassName:"recharts-active-bar"},e))}var BB=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,i){if(typeof t=="number")return t;var s=typeof n=="number";return s?t(n,i):(s||bn(),r)}},FB=["value","background"],pb;function ca(e){"@babel/helpers - typeof";return ca=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ca(e)}function UB(e,t){if(e==null)return{};var r=zB(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function zB(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function _o(){return _o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];
vendor: 105,825 bytes, lines 257-262
257for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_o.apply(this,arguments)}function tg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ve(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?tg(Object(r),!0).forEach(function(n){zr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function HB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rg(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,vb(n.key),n)}}function WB(e,t,r){return t&&rg(e.prototype,t),r&&rg(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function GB(e,t,r){return t=No(t),qB(e,gb()?Reflect.construct(t,r||[],No(e).constructor):t.apply(e,r))}function qB(e,t){if(t&&(ca(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return VB(e)}function VB(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(gb=function(){return!!e})()}function No(e){return No=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},No(e)}function KB(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Pu(e,t)}function Pu(e,t){return Pu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Pu(e,t)}function zr(e,t,r){return t=vb(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vb(e){var t=XB(e,"string");return ca(t)=="symbol"?t:t+""}function XB(e,t){if(ca(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ca(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Tn=function(e){function t(){var r;HB(this,t);for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return r=GB(this,t,[].concat(i)),zr(r,"state",{isAnimationFinished:!1}),zr(r,"id",Ji("recharts-bar-")),zr(r,"handleAnimationEnd",function(){var o=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),o&&o()}),zr(r,"handleAnimationStart",function(){var o=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),o&&o()}),r}return KB(t,e),WB(t,[{key:"renderRectanglesStatically",value:function(n){var i=this,s=this.props,o=s.shape,l=s.dataKey,c=s.activeIndex,u=s.activeBar,f=Ee(this.props,!1);return n&&n.map(function(d,h){var m=h===c,v=m?u:o,x=Ve(Ve(Ve({},f),d),{},{isActive:m,option:v,index:h,dataKey:l,onAnimationStart:i.handleAnimationStart,onAnimationEnd:i.handleAnimationEnd});return M.createElement(Ge,_o({className:"recharts-bar-rectangle"},Ds(i.props,d,h),{key:"rectangle-".concat(d==null?void 0:d.x,"-").concat(d==null?void 0:d.y,"-").concat(d==null?void 0:d.value)}),M.createElement(eg,x))})}},{key:"renderRectanglesWithAnimation",value:function(){var n=this,i=this.props,s=i.data,o=i.layout,l=i.isAnimationActive,c=i.animationBegin,u=i.animationDuration,f=i.animationEasing,d=i.animationId,h=this.state.prevData;return M.createElement(Ir,{begin:c,duration:u,isActive:l,easing:f,from:{t:0},to:{t:1},key:"bar-".concat(d),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(m){var v=m.t,x=s.map(function(p,w){var j=h&&h[w];if(j){var _=Xt(j.x,p.x),y=Xt(j.y,p.y),g=Xt(j.width,p.width),b=Xt(j.height,p.height);return Ve(Ve({},p),{},{x:_(v),y:y(v),width:g(v),height:b(v)})}if(o==="horizontal"){var N=Xt(0,p.height),O=N(v);return Ve(Ve({},p),{},{y:p.y+p.height-O,height:O})}var D=Xt(0,p.width),P=D(v);return Ve(Ve({},p),{},{width:P})});return M.createElement(Ge,null,n.renderRectanglesStatically(x))})}},{key:"renderRectangles",value:function(){var n=this.props,i=n.data,s=n.isAnimationActive,o=this.state.prevData;return s&&i&&i.length&&(!o||!pl(o,i))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(i)}},{key:"renderBackground",value:function(){var n=this,i=this.props,s=i.data,o=i.dataKey,l=i.activeIndex,c=Ee(this.props.background,!1);return s.map(function(u,f){u.value;var d=u.background,h=UB(u,FB);if(!d)return null;var m=Ve(Ve(Ve(Ve(Ve({},h),{},{fill:"#eee"},d),c),Ds(n.props,u,f)),{},{onAnimationStart:n.handleAnimationStart,onAnimationEnd:n.handleAnimationEnd,dataKey:o,index:f,className:"recharts-bar-background-rectangle"});return M.createElement(eg,_o({key:"background-bar-".concat(f),option:n.props.background,isActive:f===l},m))})}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var s=this.props,o=s.data,l=s.xAxis,c=s.yAxis,u=s.layout,f=s.children,d=Bt(f,as);if(!d)return null;var h=u==="vertical"?o[0].height/2:o[0].width/2,m=function(p,w){var j=Array.isArray(p.value)?p.value[1]:p.value;return{x:p.x,y:p.y,value:j,errorVal:Ct(p,w)}},v={clipPath:n?"url(#clipPath-".concat(i,")"):null};return M.createElement(Ge,v,d.map(function(x){return M.cloneElement(x,{key:"error-bar-".concat(i,"-").concat(x.props.dataKey),data:o,xAxis:l,yAxis:c,layout:u,offset:h,dataPointFormatter:m})}))}},{key:"render",value:function(){var n=this.props,i=n.hide,s=n.data,o=n.className,l=n.xAxis,c=n.yAxis,u=n.left,f=n.top,d=n.width,h=n.height,m=n.isAnimationActive,v=n.background,x=n.id;if(i||!s||!s.length)return null;var p=this.state.isAnimationFinished,w=Ce("recharts-bar",o),j=l&&l.allowDataOverflow,_=c&&c.allowDataOverflow,y=j||_,g=Ae(x)?this.id:x;return M.createElement(Ge,{className:w},j||_?M.createElement("defs",null,M.createElement("clipPath",{id:"clipPath-".concat(g)},M.createElement("rect",{x:j?u:u-d/2,y:_?f:f-h/2,width:j?d:d*2,height:_?h:h*2}))):null,M.createElement(Ge,{className:"recharts-bar-rectangles",clipPath:y?"url(#clipPath-".concat(g,")"):null},v?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(y,g),(!m||p)&&Wr.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curData:n.data,prevData:i.curData}:n.data!==i.curData?{curData:n.data}:null}}])}(S.PureComponent);pb=Tn;zr(Tn,"displayName","Bar");zr(Tn,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!Pr.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});zr(Tn,"getComposedData",function(e){var t=e.props,r=e.item,n=e.barPosition,i=e.bandSize,s=e.xAxis,o=e.yAxis,l=e.xAxisTicks,c=e.yAxisTicks,u=e.stackedData,f=e.dataStartIndex,d=e.displayedData,h=e.offset,m=I4(n,r);if(!m)return null;var v=t.layout,x=r.type.defaultProps,p=x!==void 0?Ve(Ve({},x),r.props):r.props,w=p.dataKey,j=p.children,_=p.minPointSize,y=v==="horizontal"?o:s,g=u?y.scale.domain():null,b=H4({numericAxis:y}),N=Bt(j,zx),O=d.map(function(D,P){var E,$,I,L,U,T;u?E=D4(u[f+P],g):(E=Ct(D,w),Array.isArray(E)||(E=[b,E]));var B=BB(_,pb.defaultProps.minPointSize)(E[1],P);if(v==="horizontal"){var W,ae=[o.scale(E[0]),o.scale(E[1])],F=ae[0],G=ae[1];$=tp({axis:s,ticks:l,bandSize:i,offset:m.offset,entry:D,index:P}),I=(W=G??F)!==null&&W!==void 0?W:void 0,L=m.size;var re=F-G;if(U=Number.isNaN(re)?0:re,T={x:$,y:o.y,width:L,height:o.height},Math.abs(B)>0&&Math.abs(U)<Math.abs(B)){var R=Jt(U||B)*(Math.abs(B)-Math.abs(U));I-=R,U+=R}}else{var te=[s.scale(E[0]),s.scale(E[1])],A=te[0],X=te[1];if($=A,I=tp({axis:o,ticks:c,bandSize:i,offset:m.offset,entry:D,index:P}),L=X-A,U=m.size,T={x:s.x,y:I,width:s.width,height:U},Math.abs(B)>0&&Math.abs(L)<Math.abs(B)){var le=Jt(L||B)*(Math.abs(B)-Math.abs(L));L+=le}}return Ve(Ve(Ve({},D),{},{x:$,y:I,width:L,height:U,value:u?E:E[1],payload:D,background:T},N&&N[P]&&N[P].props),{},{tooltipPayload:[Ky(r,D)],tooltipPosition:{x:$+L/2,y:I+U/2}})});return Ve({data:O,layout:v},h)});function zi(e){"@babel/helpers - typeof";return zi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zi(e)}function YB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ng(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,xb(n.key),n)}}function ZB(e,t,r){return t&&ng(e.prototype,t),r&&ng(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ag(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Vt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ag(Object(r),!0).forEach(function(n){bl(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ag(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function bl(e,t,r){return t=xb(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xb(e){var t=JB(e,"string");return zi(t)=="symbol"?t:t+""}function JB(e,t){if(zi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(zi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var yb=function(t,r,n,i,s){var o=t.width,l=t.height,c=t.layout,u=t.children,f=Object.keys(r),d={left:n.left,leftMirror:n.left,right:o-n.right,rightMirror:o-n.right,top:n.top,topMirror:n.top,bottom:l-n.bottom,bottomMirror:l-n.bottom},h=!!Pt(u,Tn);return f.reduce(function(m,v){var x=r[v],p=x.orientation,w=x.domain,j=x.padding,_=j===void 0?{}:j,y=x.mirror,g=x.reversed,b="".concat(p).concat(y?"Mirror":""),N,O,D,P,E;if(x.type==="number"&&(x.padding==="gap"||x.padding==="no-gap")){var $=w[1]-w[0],I=1/0,L=x.categoricalDomain.sort();if(L.forEach(function(te,A){A>0&&(I=Math.min((te||0)-(L[A-1]||0),I))}),Number.isFinite(I)){var U=I/$,T=x.layout==="vertical"?n.height:n.width;if(x.padding==="gap"&&(N=U*T/2),x.padding==="no-gap"){var B=xn(t.barCategoryGap,U*T),W=U*T/2;N=W-B-(W-B)/T*B}}}i==="xAxis"?O=[n.left+(_.left||0)+(N||0),n.left+n.width-(_.right||0)-(N||0)]:i==="yAxis"?O=c==="horizontal"?[n.top+n.height-(_.bottom||0),n.top+(_.top||0)]:[n.top+(_.top||0)+(N||0),n.top+n.height-(_.bottom||0)-(N||0)]:O=x.range,g&&(O=[O[1],O[0]]);var ae=k4(x,s,h),F=ae.scale,G=ae.realScaleType;F.domain(w).range(O),M4(F);var re=z4(F,Vt(Vt({},x),{},{realScaleType:G}));i==="xAxis"?(E=p==="top"&&!y||p==="bottom"&&y,D=n.left,P=d[b]-E*x.height):i==="yAxis"&&(E=p==="left"&&!y||p==="right"&&y,D=d[b]-E*x.width,P=n.top);var R=Vt(Vt(Vt({},x),re),{},{realScaleType:G,x:D,y:P,scale:F,width:i==="xAxis"?n.width:x.width,height:i==="yAxis"?n.height:x.height});return R.bandSize=uo(R,re),!x.hide&&i==="xAxis"?d[b]+=(E?-1:1)*R.height:x.hide||(d[b]+=(E?-1:1)*R.width),Vt(Vt({},m),{},bl({},v,R))},{})},bb=function(t,r){var n=t.x,i=t.y,s=r.x,o=r.y;return{x:Math.min(n,s),y:Math.min(i,o),width:Math.abs(s-n),height:Math.abs(o-i)}},QB=function(t){var r=t.x1,n=t.y1,i=t.x2,s=t.y2;return bb({x:r,y:n},{x:i,y:s})},jb=function(){function e(t){YB(this,e),this.scale=t}return ZB(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.bandAware,s=n.position;if(r!==void 0){if(s)switch(s){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(r)+l}default:return this.scale(r)}if(i){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+c}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),i=n[0],s=n[n.length-1];return i<=s?r>=i&&r<=s:r>=s&&r<=i}}],[{key:"create",value:function(r){return new e(r)}}])}();bl(jb,"EPS",1e-4);var cf=function(t){var r=Object.keys(t).reduce(function(n,i){return Vt(Vt({},n),{},bl({},i,jb.create(t[i])))},{});return Vt(Vt({},r),{},{apply:function(i){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=s.bandAware,l=s.position;return yB(i,function(c,u){return r[u].apply(c,{bandAware:o,position:l})})},isInRange:function(i){return mb(i,function(s,o){return r[o].isInRange(s)})}})};function eF(e){return(e%180+180)%180}var tF=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=eF(i),o=s*Math.PI/180,l=Math.atan(n/r),c=o>l&&o<Math.PI-l?n/Math.sin(o):r/Math.cos(o);return Math.abs(c)},rF=Xr,nF=Qi,aF=al;function iF(e){return function(t,r,n){var i=Object(t);if(!nF(t)){var s=rF(r);t=aF(t),r=function(l){return s(i[l],l,i)}}var o=e(t,r,n);return o>-1?i[s?t[o]:o]:void 0}}var sF=iF,oF=ub;function lF(e){var t=oF(e),r=t%1;return t===t?r?t-r:t:0}var cF=lF,uF=Ax,dF=Xr,fF=cF,hF=Math.max;function mF(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var i=r==null?0:fF(r);return i<0&&(i=hF(n+i,0)),uF(e,dF(t),i)}var pF=mF,gF=sF,vF=pF,xF=gF(vF),yF=xF;const bF=Re(yF);var jF=y_(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),uf=S.createContext(void 0),df=S.createContext(void 0),wb=S.createContext(void 0),_b=S.createContext({}),Nb=S.createContext(void 0),Sb=S.createContext(0),Ob=S.createContext(0),ig=function(t){var r=t.state,n=r.xAxisMap,i=r.yAxisMap,s=r.offset,o=t.clipPathId,l=t.children,c=t.width,u=t.height,f=jF(s);return M.createElement(uf.Provider,{value:n},M.createElement(df.Provider,{value:i},M.createElement(_b.Provider,{value:s},M.createElement(wb.Provider,{value:f},M.createElement(Nb.Provider,{value:o},M.createElement(Sb.Provider,{value:u},M.createElement(Ob.Provider,{value:c},l)))))))},wF=function(){return S.useContext(Nb)},Ab=function(t){var r=S.useContext(uf);r==null&&bn();var n=r[t];return n==null&&bn(),n},_F=function(){var t=S.useContext(uf);return Ur(t)},NF=function(){var t=S.useContext(df),r=bF(t,function(n){return mb(n.domain,Number.isFinite)});return r||Ur(t)},Pb=function(t){var r=S.useContext(df);r==null&&bn();var n=r[t];return n==null&&bn(),n},SF=function(){var t=S.useContext(wb);return t},OF=function(){return S.useContext(_b)},ff=function(){return S.useContext(Ob)},hf=function(){return S.useContext(Sb)};function ua(e){"@babel/helpers - typeof";return ua=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ua(e)}function AF(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function PF(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Eb(n.key),n)}}function TF(e,t,r){return t&&PF(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function EF(e,t,r){return t=So(t),CF(e,Tb()?Reflect.construct(t,r||[],So(e).constructor):t.apply(e,r))}function CF(e,t){if(t&&(ua(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return $F(e)}function $F(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Tb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Tb=function(){return!!e})()}function So(e){return So=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},So(e)}function kF(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Tu(e,t)}function Tu(e,t){return Tu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Tu(e,t)}function sg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function og(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?sg(Object(r),!0).forEach(function(n){mf(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function mf(e,t,r){return t=Eb(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Eb(e){var t=MF(e,"string");return ua(t)=="symbol"?t:t+""}function MF(e,t){if(ua(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ua(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function IF(e,t){return BF(e)||RF(e,t)||LF(e,t)||DF()}function DF(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
258In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function LF(e,t){if(e){if(typeof e=="string")return lg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return lg(e,t)}}function lg(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function RF(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,s,o,l=[],c=!0,u=!1;try{if(s=(r=r.call(e)).next,t!==0)for(;!(c=(n=s.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,i=f}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function BF(e){if(Array.isArray(e))return e}function Eu(){return Eu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Eu.apply(this,arguments)}var FF=function(t,r){var n;return M.isValidElement(t)?n=M.cloneElement(t,r):Ne(t)?n=t(r):n=M.createElement("line",Eu({},r,{className:"recharts-reference-line-line"})),n},UF=function(t,r,n,i,s,o,l,c,u){var f=s.x,d=s.y,h=s.width,m=s.height;if(n){var v=u.y,x=t.y.apply(v,{position:o});if(or(u,"discard")&&!t.y.isInRange(x))return null;var p=[{x:f+h,y:x},{x:f,y:x}];return c==="left"?p.reverse():p}if(r){var w=u.x,j=t.x.apply(w,{position:o});if(or(u,"discard")&&!t.x.isInRange(j))return null;var _=[{x:j,y:d+m},{x:j,y:d}];return l==="top"?_.reverse():_}if(i){var y=u.segment,g=y.map(function(b){return t.apply(b,{position:o})});return or(u,"discard")&&dB(g,function(b){return!t.isInRange(b)})?null:g}return null};function zF(e){var t=e.x,r=e.y,n=e.segment,i=e.xAxisId,s=e.yAxisId,o=e.shape,l=e.className,c=e.alwaysShow,u=wF(),f=Ab(i),d=Pb(s),h=SF();if(!u||!h)return null;Ar(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var m=cf({x:f.scale,y:d.scale}),v=Qe(t),x=Qe(r),p=n&&n.length===2,w=UF(m,v,x,p,h,e.position,f.orientation,d.orientation,e);if(!w)return null;var j=IF(w,2),_=j[0],y=_.x,g=_.y,b=j[1],N=b.x,O=b.y,D=or(e,"hidden")?"url(#".concat(u,")"):void 0,P=og(og({clipPath:D},Ee(e,!0)),{},{x1:y,y1:g,x2:N,y2:O});return M.createElement(Ge,{className:Ce("recharts-reference-line",l)},FF(o,P),ut.renderCallByParent(e,QB({x1:y,y1:g,x2:N,y2:O})))}var pf=function(e){function t(){return AF(this,t),EF(this,t,arguments)}return kF(t,e),TF(t,[{key:"render",value:function(){return M.createElement(zF,this.props)}}])}(M.Component);mf(pf,"displayName","ReferenceLine");mf(pf,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function Cu(){return Cu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Cu.apply(this,arguments)}function da(e){"@babel/helpers - typeof";return da=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},da(e)}function cg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ug(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?cg(Object(r),!0).forEach(function(n){jl(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function HF(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function WF(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,$b(n.key),n)}}function GF(e,t,r){return t&&WF(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function qF(e,t,r){return t=Oo(t),VF(e,Cb()?Reflect.construct(t,r||[],Oo(e).constructor):t.apply(e,r))}function VF(e,t){if(t&&(da(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return KF(e)}function KF(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Cb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Cb=function(){return!!e})()}function Oo(e){return Oo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Oo(e)}function XF(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$u(e,t)}function $u(e,t){return $u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},$u(e,t)}function jl(e,t,r){return t=$b(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $b(e){var t=YF(e,"string");return da(t)=="symbol"?t:t+""}function YF(e,t){if(da(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(da(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ZF=function(t){var r=t.x,n=t.y,i=t.xAxis,s=t.yAxis,o=cf({x:i.scale,y:s.scale}),l=o.apply({x:r,y:n},{bandAware:!0});return or(t,"discard")&&!o.isInRange(l)?null:l},wl=function(e){function t(){return HF(this,t),qF(this,t,arguments)}return XF(t,e),GF(t,[{key:"render",value:function(){var n=this.props,i=n.x,s=n.y,o=n.r,l=n.alwaysShow,c=n.clipPathId,u=Qe(i),f=Qe(s);if(Ar(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!f)return null;var d=ZF(this.props);if(!d)return null;var h=d.x,m=d.y,v=this.props,x=v.shape,p=v.className,w=or(this.props,"hidden")?"url(#".concat(c,")"):void 0,j=ug(ug({clipPath:w},Ee(this.props,!0)),{},{cx:h,cy:m});return M.createElement(Ge,{className:Ce("recharts-reference-dot",p)},t.renderDot(x,j),ut.renderCallByParent(this.props,{x:h-o,y:m-o,width:2*o,height:2*o}))}}])}(M.Component);jl(wl,"displayName","ReferenceDot");jl(wl,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});jl(wl,"renderDot",function(e,t){var r;return M.isValidElement(e)?r=M.cloneElement(e,t):Ne(e)?r=e(t):r=M.createElement(lf,Cu({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),r});function ku(){return ku=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ku.apply(this,arguments)}function fa(e){"@babel/helpers - typeof";return fa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fa(e)}function dg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function fg(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?dg(Object(r),!0).forEach(function(n){_l(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function JF(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function QF(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Mb(n.key),n)}}function eU(e,t,r){return t&&QF(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function tU(e,t,r){return t=Ao(t),rU(e,kb()?Reflect.construct(t,r||[],Ao(e).constructor):t.apply(e,r))}function rU(e,t){if(t&&(fa(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return nU(e)}function nU(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function kb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(kb=function(){return!!e})()}function Ao(e){return Ao=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ao(e)}function aU(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Mu(e,t)}function Mu(e,t){return Mu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Mu(e,t)}function _l(e,t,r){return t=Mb(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Mb(e){var t=iU(e,"string");return fa(t)=="symbol"?t:t+""}function iU(e,t){if(fa(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(fa(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var sU=function(t,r,n,i,s){var o=s.x1,l=s.x2,c=s.y1,u=s.y2,f=s.xAxis,d=s.yAxis;if(!f||!d)return null;var h=cf({x:f.scale,y:d.scale}),m={x:t?h.x.apply(o,{position:"start"}):h.x.rangeMin,y:n?h.y.apply(c,{position:"start"}):h.y.rangeMin},v={x:r?h.x.apply(l,{position:"end"}):h.x.rangeMax,y:i?h.y.apply(u,{position:"end"}):h.y.rangeMax};return or(s,"discard")&&(!h.isInRange(m)||!h.isInRange(v))?null:bb(m,v)},Nl=function(e){function t(){return JF(this,t),tU(this,t,arguments)}return aU(t,e),eU(t,[{key:"render",value:function(){var n=this.props,i=n.x1,s=n.x2,o=n.y1,l=n.y2,c=n.className,u=n.alwaysShow,f=n.clipPathId;Ar(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var d=Qe(i),h=Qe(s),m=Qe(o),v=Qe(l),x=this.props.shape;if(!d&&!h&&!m&&!v&&!x)return null;var p=sU(d,h,m,v,this.props);if(!p&&!x)return null;var w=or(this.props,"hidden")?"url(#".concat(f,")"):void 0;return M.createElement(Ge,{className:Ce("recharts-reference-area",c)},t.renderRect(x,fg(fg({clipPath:w},Ee(this.props,!0)),p)),ut.renderCallByParent(this.props,p))}}])}(M.Component);_l(Nl,"displayName","ReferenceArea");_l(Nl,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});_l(Nl,"renderRect",function(e,t){var r;return M.isValidElement(e)?r=M.cloneElement(e,t):Ne(e)?r=e(t):r=M.createElement(of,ku({},t,{className:"recharts-reference-area-rect"})),r});function Ib(e,t,r){if(t<1)return[];if(t===1&&r===void 0)return e;for(var n=[],i=0;i<e.length;i+=t)n.push(e[i]);return n}function oU(e,t,r){var n={width:e.width+t.width,height:e.height+t.height};return tF(n,r)}function lU(e,t,r){var n=r==="width",i=e.x,s=e.y,o=e.width,l=e.height;return t===1?{start:n?i:s,end:n?i+o:s+l}:{start:n?i+o:s+l,end:n?i:s}}function Po(e,t,r,n,i){if(e*t<e*n||e*t>e*i)return!1;var s=r();return e*(t-e*s/2-n)>=0&&e*(t+e*s/2-i)<=0}function cU(e,t){return Ib(e,t+1)}function uU(e,t,r,n,i){for(var s=(n||[]).slice(),o=t.start,l=t.end,c=0,u=1,f=o,d=function(){var v=n==null?void 0:n[c];if(v===void 0)return{v:Ib(n,u)};var x=c,p,w=function(){return p===void 0&&(p=r(v,x)),p},j=v.coordinate,_=c===0||Po(e,j,w,f,l);_||(c=0,f=o,u+=1),_&&(f=j+e*(w()/2+i),c+=u)},h;u<=s.length;)if(h=d(),h)return h.v;return[]}function Hi(e){"@babel/helpers - typeof";return Hi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hi(e)}function hg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ct(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?hg(Object(r),!0).forEach(function(n){dU(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function dU(e,t,r){return t=fU(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fU(e){var t=hU(e,"string");return Hi(t)=="symbol"?t:t+""}function hU(e,t){if(Hi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Hi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function mU(e,t,r,n,i){for(var s=(n||[]).slice(),o=s.length,l=t.start,c=t.end,u=function(h){var m=s[h],v,x=function(){return v===void 0&&(v=r(m,h)),v};if(h===o-1){var p=e*(m.coordinate+e*x()/2-c);s[h]=m=ct(ct({},m),{},{tickCoord:p>0?m.coordinate-p*e:m.coordinate})}else s[h]=m=ct(ct({},m),{},{tickCoord:m.coordinate});var w=Po(e,m.tickCoord,x,l,c);w&&(c=m.tickCoord-e*(x()/2+i),s[h]=ct(ct({},m),{},{isShow:!0}))},f=o-1;f>=0;f--)u(f);return s}function pU(e,t,r,n,i,s){var o=(n||[]).slice(),l=o.length,c=t.start,u=t.end;if(s){var f=n[l-1],d=r(f,l-1),h=e*(f.coordinate+e*d/2-u);o[l-1]=f=ct(ct({},f),{},{tickCoord:h>0?f.coordinate-h*e:f.coordinate});var m=Po(e,f.tickCoord,function(){return d},c,u);m&&(u=f.tickCoord-e*(d/2+i),o[l-1]=ct(ct({},f),{},{isShow:!0}))}for(var v=s?l-1:l,x=function(j){var _=o[j],y,g=function(){return y===void 0&&(y=r(_,j)),y};if(j===0){var b=e*(_.coordinate-e*g()/2-c);o[j]=_=ct(ct({},_),{},{tickCoord:b<0?_.coordinate-b*e:_.coordinate})}else o[j]=_=ct(ct({},_),{},{tickCoord:_.coordinate});var N=Po(e,_.tickCoord,g,c,u);N&&(c=_.tickCoord+e*(g()/2+i),o[j]=ct(ct({},_),{},{isShow:!0}))},p=0;p<v;p++)x(p);return o}function gf(e,t,r){var n=e.tick,i=e.ticks,s=e.viewBox,o=e.minTickGap,l=e.orientation,c=e.interval,u=e.tickFormatter,f=e.unit,d=e.angle;if(!i||!i.length||!n)return[];if(ie(c)||Pr.isSsr)return cU(i,typeof c=="number"&&ie(c)?c:0);var h=[],m=l==="top"||l==="bottom"?"width":"height",v=f&&m==="width"?ri(f,{fontSize:t,letterSpacing:r}):{width:0,height:0},x=function(_,y){var g=Ne(u)?u(_.value,y):_.value;return m==="width"?oU(ri(g,{fontSize:t,letterSpacing:r}),v,d):ri(g,{fontSize:t,letterSpacing:r})[m]},p=i.length>=2?Jt(i[1].coordinate-i[0].coordinate):1,w=lU(s,p,m);return c==="equidistantPreserveStart"?uU(p,w,x,i,o):(c==="preserveStart"||c==="preserveStartEnd"?h=pU(p,w,x,i,o,c==="preserveStartEnd"):h=mU(p,w,x,i,o),h.filter(function(j){return j.isShow}))}var gU=["viewBox"],vU=["viewBox"],xU=["ticks"];function ha(e){"@babel/helpers - typeof";return ha=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ha(e)}function Bn(){return Bn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Bn.apply(this,arguments)}function mg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function pt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?mg(Object(r),!0).forEach(function(n){vf(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function rc(e,t){if(e==null)return{};var r=yU(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function yU(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function bU(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pg(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Lb(n.key),n)}}function jU(e,t,r){return t&&pg(e.prototype,t),r&&pg(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function wU(e,t,r){return t=To(t),_U(e,Db()?Reflect.construct(t,r||[],To(e).constructor):t.apply(e,r))}function _U(e,t){if(t&&(ha(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return NU(e)}function NU(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Db(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Db=function(){return!!e})()}function To(e){return To=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},To(e)}function SU(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Iu(e,t)}function Iu(e,t){return Iu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Iu(e,t)}function vf(e,t,r){return t=Lb(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Lb(e){var t=OU(e,"string");return ha(t)=="symbol"?t:t+""}function OU(e,t){if(ha(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ha(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ma=function(e){function t(r){var n;return bU(this,t),n=wU(this,t,[r]),n.state={fontSize:"",letterSpacing:""},n}return SU(t,e),jU(t,[{key:"shouldComponentUpdate",value:function(n,i){var s=n.viewBox,o=rc(n,gU),l=this.props,c=l.viewBox,u=rc(l,vU);return!Un(s,c)||!Un(o,u)||!Un(i,this.state)}},{key:"componentDidMount",value:function(){var n=this.layerReference;if(n){var i=n.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];i&&this.setState({fontSize:window.getComputedStyle(i).fontSize,letterSpacing:window.getComputedStyle(i).letterSpacing})}}},{key:"getTickLineCoord",value:function(n){var i=this.props,s=i.x,o=i.y,l=i.width,c=i.height,u=i.orientation,f=i.tickSize,d=i.mirror,h=i.tickMargin,m,v,x,p,w,j,_=d?-1:1,y=n.tickSize||f,g=ie(n.tickCoord)?n.tickCoord:n.coordinate;switch(u){case"top":m=v=n.coordinate,p=o+ +!d*c,x=p-_*y,j=x-_*h,w=g;break;case"left":x=p=n.coordinate,v=s+ +!d*l,m=v-_*y,w=m-_*h,j=g;break;case"right":x=p=n.coordinate,v=s+ +d*l,m=v+_*y,w=m+_*h,j=g;break;default:m=v=n.coordinate,p=o+ +d*c,x=p+_*y,j=x+_*h,w=g;break}return{line:{x1:m,y1:x,x2:v,y2:p},tick:{x:w,y:j}}}},{key:"getTickTextAnchor",value:function(){var n=this.props,i=n.orientation,s=n.mirror,o;switch(i){case"left":o=s?"start":"end";break;case"right":o=s?"end":"start";break;default:o="middle";break}return o}},{key:"getTickVerticalAnchor",value:function(){var n=this.props,i=n.orientation,s=n.mirror,o="end";switch(i){case"left":case"right":o="middle";break;case"top":o=s?"start":"end";break;default:o=s?"end":"start";break}return o}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.x,s=n.y,o=n.width,l=n.height,c=n.orientation,u=n.mirror,f=n.axisLine,d=pt(pt(pt({},Ee(this.props,!1)),Ee(f,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var h=+(c==="top"&&!u||c==="bottom"&&u);d=pt(pt({},d),{},{x1:i,y1:s+h*l,x2:i+o,y2:s+h*l})}else{var m=+(c==="left"&&!u||c==="right"&&u);d=pt(pt({},d),{},{x1:i+m*o,y1:s,x2:i+m*o,y2:s+l})}return M.createElement("line",Bn({},d,{className:Ce("recharts-cartesian-axis-line",Rt(f,"className"))}))}},{key:"renderTicks",value:function(n,i,s){var o=this,l=this.props,c=l.tickLine,u=l.stroke,f=l.tick,d=l.tickFormatter,h=l.unit,m=gf(pt(pt({},this.props),{},{ticks:n}),i,s),v=this.getTickTextAnchor(),x=this.getTickVerticalAnchor(),p=Ee(this.props,!1),w=Ee(f,!1),j=pt(pt({},p),{},{fill:"none"},Ee(c,!1)),_=m.map(function(y,g){var b=o.getTickLineCoord(y),N=b.line,O=b.tick,D=pt(pt(pt(pt({textAnchor:v,verticalAnchor:x},p),{},{stroke:"none",fill:u},w),O),{},{index:g,payload:y,visibleTicksCount:m.length,tickFormatter:d});return M.createElement(Ge,Bn({className:"recharts-cartesian-axis-tick",key:"tick-".concat(y.value,"-").concat(y.coordinate,"-").concat(y.tickCoord)},Ds(o.props,y,g)),c&&M.createElement("line",Bn({},j,N,{className:Ce("recharts-cartesian-axis-tick-line",Rt(c,"className"))})),f&&t.renderTickItem(f,D,"".concat(Ne(d)?d(y.value,g):y.value).concat(h||"")))});return M.createElement("g",{className:"recharts-cartesian-axis-ticks"},_)}},{key:"render",value:function(){var n=this,i=this.props,s=i.axisLine,o=i.width,l=i.height,c=i.ticksGenerator,u=i.className,f=i.hide;if(f)return null;var d=this.props,h=d.ticks,m=rc(d,xU),v=h;return Ne(c)&&(v=h&&h.length>0?c(this.props):c(m)),o<=0||l<=0||!v||!v.length?null:M.createElement(Ge,{className:Ce("recharts-cartesian-axis",u),ref:function(p){n.layerReference=p}},s&&this.renderAxisLine(),this.renderTicks(v,this.state.fontSize,this.state.letterSpacing),ut.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,s){var o;return M.isValidElement(n)?o=M.cloneElement(n,i):Ne(n)?o=n(i):o=M.createElement(Ys,Bn({},i,{className:"recharts-cartesian-axis-tick-value"}),s),o}}])}(S.Component);vf(Ma,"displayName","CartesianAxis");vf(Ma,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var AU=["x1","y1","x2","y2","key"],PU=["offset"];function jn(e){"@babel/helpers - typeof";return jn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jn(e)}function gg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function dt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?gg(Object(r),!0).forEach(function(n){TU(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function TU(e,t,r){return t=EU(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function EU(e){var t=CU(e,"string");return jn(t)=="symbol"?t:t+""}function CU(e,t){if(jn(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(jn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cn(){return cn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cn.apply(this,arguments)}function vg(e,t){if(e==null)return{};var r=$U(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function $U(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var kU=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,i=t.x,s=t.y,o=t.width,l=t.height,c=t.ry;return M.createElement("rect",{x:i,y:s,ry:c,width:o,height:l,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function Rb(e,t){var r;if(M.isValidElement(e))r=M.cloneElement(e,t);else if(Ne(e))r=e(t);else{var n=t.x1,i=t.y1,s=t.x2,o=t.y2,l=t.key,c=vg(t,AU),u=Ee(c,!1);u.offset;var f=vg(u,PU);r=M.createElement("line",cn({},f,{x1:n,y1:i,x2:s,y2:o,fill:"none",key:l}))}return r}function MU(e){var t=e.x,r=e.width,n=e.horizontal,i=n===void 0?!0:n,s=e.horizontalPoints;if(!i||!s||!s.length)return null;var o=s.map(function(l,c){var u=dt(dt({},e),{},{x1:t,y1:l,x2:t+r,y2:l,key:"line-".concat(c),index:c});return Rb(i,u)});return M.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function IU(e){var t=e.y,r=e.height,n=e.vertical,i=n===void 0?!0:n,s=e.verticalPoints;if(!i||!s||!s.length)return null;var o=s.map(function(l,c){var u=dt(dt({},e),{},{x1:l,y1:t,x2:l,y2:t+r,key:"line-".concat(c),index:c});return Rb(i,u)});return M.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function DU(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,i=e.y,s=e.width,o=e.height,l=e.horizontalPoints,c=e.horizontal,u=c===void 0?!0:c;if(!u||!t||!t.length)return null;var f=l.map(function(h){return Math.round(h+i-i)}).sort(function(h,m){return h-m});i!==f[0]&&f.unshift(0);var d=f.map(function(h,m){var v=!f[m+1],x=v?i+o-h:f[m+1]-h;if(x<=0)return null;var p=m%t.length;return M.createElement("rect",{key:"react-".concat(m),y:h,x:n,height:x,width:s,stroke:"none",fill:t[p],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return M.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},d)}function LU(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,i=e.fillOpacity,s=e.x,o=e.y,l=e.width,c=e.height,u=e.verticalPoints;if(!r||!n||!n.length)return null;var f=u.map(function(h){return Math.round(h+s-s)}).sort(function(h,m){return h-m});s!==f[0]&&f.unshift(0);var d=f.map(function(h,m){var v=!f[m+1],x=v?s+l-h:f[m+1]-h;if(x<=0)return null;var p=m%n.length;return M.createElement("rect",{key:"react-".concat(m),x:h,y:o,width:x,height:c,stroke:"none",fill:n[p],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return M.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var RU=function(t,r){var n=t.xAxis,i=t.width,s=t.height,o=t.offset;return qy(gf(dt(dt(dt({},Ma.defaultProps),n),{},{ticks:yr(n,!0),viewBox:{x:0,y:0,width:i,height:s}})),o.left,o.left+o.width,r)},BU=function(t,r){var n=t.yAxis,i=t.width,s=t.height,o=t.offset;return qy(gf(dt(dt(dt({},Ma.defaultProps),n),{},{ticks:yr(n,!0),viewBox:{x:0,y:0,width:i,height:s}})),o.top,o.top+o.height,r)},Dn={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Du(e){var t,r,n,i,s,o,l=ff(),c=hf(),u=OF(),f=dt(dt({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Dn.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:Dn.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:Dn.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:Dn.horizontalFill,vertical:(s=e.vertical)!==null&&s!==void 0?s:Dn.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:Dn.verticalFill,x:ie(e.x)?e.x:u.left,y:ie(e.y)?e.y:u.top,width:ie(e.width)?e.width:u.width,height:ie(e.height)?e.height:u.height}),d=f.x,h=f.y,m=f.width,v=f.height,x=f.syncWithTicks,p=f.horizontalValues,w=f.verticalValues,j=_F(),_=NF();if(!ie(m)||m<=0||!ie(v)||v<=0||!ie(d)||d!==+d||!ie(h)||h!==+h)return null;var y=f.verticalCoordinatesGenerator||RU,g=f.horizontalCoordinatesGenerator||BU,b=f.horizontalPoints,N=f.verticalPoints;if((!b||!b.length)&&Ne(g)){var O=p&&p.length,D=g({yAxis:_?dt(dt({},_),{},{ticks:O?p:_.ticks}):void 0,width:l,height:c,offset:u},O?!0:x);Ar(Array.isArray(D),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(jn(D),"]")),Array.isArray(D)&&(b=D)}if((!N||!N.length)&&Ne(y)){var P=w&&w.length,E=y({xAxis:j?dt(dt({},j),{},{ticks:P?w:j.ticks}):void 0,width:l,height:c,offset:u},P?!0:x);Ar(Array.isArray(E),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(jn(E),"]")),Array.isArray(E)&&(N=E)}return M.createElement("g",{className:"recharts-cartesian-grid"},M.createElement(kU,{fill:f.fill,fillOpacity:f.fillOpacity,x:f.x,y:f.y,width:f.width,height:f.height,ry:f.ry}),M.createElement(MU,cn({},f,{offset:u,horizontalPoints:b,xAxis:j,yAxis:_})),M.createElement(IU,cn({},f,{offset:u,verticalPoints:N,xAxis:j,yAxis:_})),M.createElement(DU,cn({},f,{horizontalPoints:b})),M.createElement(LU,cn({},f,{verticalPoints:N})))}Du.displayName="CartesianGrid";var FU=["type","layout","connectNulls","ref"],UU=["key"];function ma(e){"@babel/helpers - typeof";return ma=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ma(e)}function xg(e,t){if(e==null)return{};var r=zU(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function zU(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function si(){return si=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},si.apply(this,arguments)}function yg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ot(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?yg(Object(r),!0).forEach(function(n){Kt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ln(e){return qU(e)||GU(e)||WU(e)||HU()}function HU(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
259In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function WU(e,t){if(e){if(typeof e=="string")return Lu(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Lu(e,t)}}function GU(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function qU(e){if(Array.isArray(e))return Lu(e)}function Lu(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function VU(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bg(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Fb(n.key),n)}}function KU(e,t,r){return t&&bg(e.prototype,t),r&&bg(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function XU(e,t,r){return t=Eo(t),YU(e,Bb()?Reflect.construct(t,r||[],Eo(e).constructor):t.apply(e,r))}function YU(e,t){if(t&&(ma(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ZU(e)}function ZU(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Bb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Bb=function(){return!!e})()}function Eo(e){return Eo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Eo(e)}function JU(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ru(e,t)}function Ru(e,t){return Ru=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Ru(e,t)}function Kt(e,t,r){return t=Fb(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fb(e){var t=QU(e,"string");return ma(t)=="symbol"?t:t+""}function QU(e,t){if(ma(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ma(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var is=function(e){function t(){var r;VU(this,t);for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return r=XU(this,t,[].concat(i)),Kt(r,"state",{isAnimationFinished:!0,totalLength:0}),Kt(r,"generateSimpleStrokeDasharray",function(o,l){return"".concat(l,"px ").concat(o-l,"px")}),Kt(r,"getStrokeDasharray",function(o,l,c){var u=c.reduce(function(w,j){return w+j});if(!u)return r.generateSimpleStrokeDasharray(l,o);for(var f=Math.floor(o/u),d=o%u,h=l-o,m=[],v=0,x=0;v<c.length;x+=c[v],++v)if(x+c[v]>d){m=[].concat(Ln(c.slice(0,v)),[d-x]);break}var p=m.length%2===0?[0,h]:[h];return[].concat(Ln(t.repeat(c,f)),Ln(m),p).map(function(w){return"".concat(w,"px")}).join(", ")}),Kt(r,"id",Ji("recharts-line-")),Kt(r,"pathRef",function(o){r.mainCurve=o}),Kt(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),Kt(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return JU(t,e),KU(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();this.setState({totalLength:n})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();n!==this.state.totalLength&&this.setState({totalLength:n})}}},{key:"getTotalLength",value:function(){var n=this.mainCurve;try{return n&&n.getTotalLength&&n.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var s=this.props,o=s.points,l=s.xAxis,c=s.yAxis,u=s.layout,f=s.children,d=Bt(f,as);if(!d)return null;var h=function(x,p){return{x:x.x,y:x.y,value:x.value,errorVal:Ct(x.payload,p)}},m={clipPath:n?"url(#clipPath-".concat(i,")"):null};return M.createElement(Ge,m,d.map(function(v){return M.cloneElement(v,{key:"bar-".concat(v.props.dataKey),data:o,xAxis:l,yAxis:c,layout:u,dataPointFormatter:h})}))}},{key:"renderDots",value:function(n,i,s){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var l=this.props,c=l.dot,u=l.points,f=l.dataKey,d=Ee(this.props,!1),h=Ee(c,!0),m=u.map(function(x,p){var w=Ot(Ot(Ot({key:"dot-".concat(p),r:3},d),h),{},{value:x.value,dataKey:f,cx:x.x,cy:x.y,index:p,payload:x.payload});return t.renderDotItem(c,w)}),v={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(s,")"):null};return M.createElement(Ge,si({className:"recharts-line-dots",key:"dots"},v),m)}},{key:"renderCurveStatically",value:function(n,i,s,o){var l=this.props,c=l.type,u=l.layout,f=l.connectNulls;l.ref;var d=xg(l,FU),h=Ot(Ot(Ot({},Ee(d,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(s,")"):null,points:n},o),{},{type:c,layout:u,connectNulls:f});return M.createElement(mu,si({},h,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,i){var s=this,o=this.props,l=o.points,c=o.strokeDasharray,u=o.isAnimationActive,f=o.animationBegin,d=o.animationDuration,h=o.animationEasing,m=o.animationId,v=o.animateNewValues,x=o.width,p=o.height,w=this.state,j=w.prevPoints,_=w.totalLength;return M.createElement(Ir,{begin:f,duration:d,isActive:u,easing:h,from:{t:0},to:{t:1},key:"line-".concat(m),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(y){var g=y.t;if(j){var b=j.length/l.length,N=l.map(function($,I){var L=Math.floor(I*b);if(j[L]){var U=j[L],T=Xt(U.x,$.x),B=Xt(U.y,$.y);return Ot(Ot({},$),{},{x:T(g),y:B(g)})}if(v){var W=Xt(x*2,$.x),ae=Xt(p/2,$.y);return Ot(Ot({},$),{},{x:W(g),y:ae(g)})}return Ot(Ot({},$),{},{x:$.x,y:$.y})});return s.renderCurveStatically(N,n,i)}var O=Xt(0,_),D=O(g),P;if(c){var E="".concat(c).split(/[,\s]+/gim).map(function($){return parseFloat($)});P=s.getStrokeDasharray(D,_,E)}else P=s.generateSimpleStrokeDasharray(_,D);return s.renderCurveStatically(l,n,i,{strokeDasharray:P})})}},{key:"renderCurve",value:function(n,i){var s=this.props,o=s.points,l=s.isAnimationActive,c=this.state,u=c.prevPoints,f=c.totalLength;return l&&o&&o.length&&(!u&&f>0||!pl(u,o))?this.renderCurveWithAnimation(n,i):this.renderCurveStatically(o,n,i)}},{key:"render",value:function(){var n,i=this.props,s=i.hide,o=i.dot,l=i.points,c=i.className,u=i.xAxis,f=i.yAxis,d=i.top,h=i.left,m=i.width,v=i.height,x=i.isAnimationActive,p=i.id;if(s||!l||!l.length)return null;var w=this.state.isAnimationFinished,j=l.length===1,_=Ce("recharts-line",c),y=u&&u.allowDataOverflow,g=f&&f.allowDataOverflow,b=y||g,N=Ae(p)?this.id:p,O=(n=Ee(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},D=O.r,P=D===void 0?3:D,E=O.strokeWidth,$=E===void 0?2:E,I=NN(o)?o:{},L=I.clipDot,U=L===void 0?!0:L,T=P*2+$;return M.createElement(Ge,{className:_},y||g?M.createElement("defs",null,M.createElement("clipPath",{id:"clipPath-".concat(N)},M.createElement("rect",{x:y?h:h-m/2,y:g?d:d-v/2,width:y?m:m*2,height:g?v:v*2})),!U&&M.createElement("clipPath",{id:"clipPath-dots-".concat(N)},M.createElement("rect",{x:h-T/2,y:d-T/2,width:m+T,height:v+T}))):null,!j&&this.renderCurve(b,N),this.renderErrorBar(b,N),(j||o)&&this.renderDots(b,U,N),(!x||w)&&Wr.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:i.curPoints}:n.points!==i.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,i){for(var s=n.length%2!==0?[].concat(Ln(n),[0]):n,o=[],l=0;l<i;++l)o=[].concat(Ln(o),Ln(s));return o}},{key:"renderDotItem",value:function(n,i){var s;if(M.isValidElement(n))s=M.cloneElement(n,i);else if(Ne(n))s=n(i);else{var o=i.key,l=xg(i,UU),c=Ce("recharts-line-dot",typeof n!="boolean"?n.className:"");s=M.createElement(lf,si({key:o},l,{className:c}))}return s}}])}(S.PureComponent);Kt(is,"displayName","Line");Kt(is,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!Pr.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});Kt(is,"getComposedData",function(e){var t=e.props,r=e.xAxis,n=e.yAxis,i=e.xAxisTicks,s=e.yAxisTicks,o=e.dataKey,l=e.bandSize,c=e.displayedData,u=e.offset,f=t.layout,d=c.map(function(h,m){var v=Ct(h,o);return f==="horizontal"?{x:ep({axis:r,ticks:i,bandSize:l,entry:h,index:m}),y:Ae(v)?null:n.scale(v),value:v,payload:h}:{x:Ae(v)?null:r.scale(v),y:ep({axis:n,ticks:s,bandSize:l,entry:h,index:m}),value:v,payload:h}});return Ot({points:d,layout:f},u)});function pa(e){"@babel/helpers - typeof";return pa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pa(e)}function e8(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t8(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Hb(n.key),n)}}function r8(e,t,r){return t&&t8(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function n8(e,t,r){return t=Co(t),a8(e,Ub()?Reflect.construct(t,r||[],Co(e).constructor):t.apply(e,r))}function a8(e,t){if(t&&(pa(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return i8(e)}function i8(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ub(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ub=function(){return!!e})()}function Co(e){return Co=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Co(e)}function s8(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Bu(e,t)}function Bu(e,t){return Bu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Bu(e,t)}function zb(e,t,r){return t=Hb(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Hb(e){var t=o8(e,"string");return pa(t)=="symbol"?t:t+""}function o8(e,t){if(pa(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(pa(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Fu(){return Fu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Fu.apply(this,arguments)}function l8(e){var t=e.xAxisId,r=ff(),n=hf(),i=Ab(t);return i==null?null:M.createElement(Ma,Fu({},i,{className:Ce("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:r,height:n},ticksGenerator:function(o){return yr(o,!0)}}))}var ga=function(e){function t(){return e8(this,t),n8(this,t,arguments)}return s8(t,e),r8(t,[{key:"render",value:function(){return M.createElement(l8,this.props)}}])}(M.Component);zb(ga,"displayName","XAxis");zb(ga,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function va(e){"@babel/helpers - typeof";return va=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},va(e)}function c8(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u8(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,qb(n.key),n)}}function d8(e,t,r){return t&&u8(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function f8(e,t,r){return t=$o(t),h8(e,Wb()?Reflect.construct(t,r||[],$o(e).constructor):t.apply(e,r))}function h8(e,t){if(t&&(va(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return m8(e)}function m8(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Wb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Wb=function(){return!!e})()}function $o(e){return $o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},$o(e)}function p8(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Uu(e,t)}function Uu(e,t){return Uu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Uu(e,t)}function Gb(e,t,r){return t=qb(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function qb(e){var t=g8(e,"string");return va(t)=="symbol"?t:t+""}function g8(e,t){if(va(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(va(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zu(){return zu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zu.apply(this,arguments)}var v8=function(t){var r=t.yAxisId,n=ff(),i=hf(),s=Pb(r);return s==null?null:M.createElement(Ma,zu({},s,{className:Ce("recharts-".concat(s.axisType," ").concat(s.axisType),s.className),viewBox:{x:0,y:0,width:n,height:i},ticksGenerator:function(l){return yr(l,!0)}}))},xa=function(e){function t(){return c8(this,t),f8(this,t,arguments)}return p8(t,e),d8(t,[{key:"render",value:function(){return M.createElement(v8,this.props)}}])}(M.Component);Gb(xa,"displayName","YAxis");Gb(xa,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function jg(e){return j8(e)||b8(e)||y8(e)||x8()}function x8(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
260In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function y8(e,t){if(e){if(typeof e=="string")return Hu(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Hu(e,t)}}function b8(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function j8(e){if(Array.isArray(e))return Hu(e)}function Hu(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Wu=function(t,r,n,i,s){var o=Bt(t,pf),l=Bt(t,wl),c=[].concat(jg(o),jg(l)),u=Bt(t,Nl),f="".concat(i,"Id"),d=i[0],h=r;if(c.length&&(h=c.reduce(function(x,p){if(p.props[f]===n&&or(p.props,"extendDomain")&&ie(p.props[d])){var w=p.props[d];return[Math.min(x[0],w),Math.max(x[1],w)]}return x},h)),u.length){var m="".concat(d,"1"),v="".concat(d,"2");h=u.reduce(function(x,p){if(p.props[f]===n&&or(p.props,"extendDomain")&&ie(p.props[m])&&ie(p.props[v])){var w=p.props[m],j=p.props[v];return[Math.min(x[0],w,j),Math.max(x[1],w,j)]}return x},h)}return s&&s.length&&(h=s.reduce(function(x,p){return ie(p)?[Math.min(x[0],p),Math.max(x[1],p)]:x},h)),h},Vb={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(c,u,f){this.fn=c,this.context=u,this.once=f||!1}function s(c,u,f,d,h){if(typeof f!="function")throw new TypeError("The listener must be a function");var m=new i(f,d||c,h),v=r?r+u:u;return c._events[v]?c._events[v].fn?c._events[v]=[c._events[v],m]:c._events[v].push(m):(c._events[v]=m,c._eventsCount++),c}function o(c,u){--c._eventsCount===0?c._events=new n:delete c._events[u]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],f,d;if(this._eventsCount===0)return u;for(d in f=this._events)t.call(f,d)&&u.push(r?d.slice(1):d);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(f)):u},l.prototype.listeners=function(u){var f=r?r+u:u,d=this._events[f];if(!d)return[];if(d.fn)return[d.fn];for(var h=0,m=d.length,v=new Array(m);h<m;h++)v[h]=d[h].fn;return v},l.prototype.listenerCount=function(u){var f=r?r+u:u,d=this._events[f];return d?d.fn?1:d.length:0},l.prototype.emit=function(u,f,d,h,m,v){var x=r?r+u:u;if(!this._events[x])return!1;var p=this._events[x],w=arguments.length,j,_;if(p.fn){switch(p.once&&this.removeListener(u,p.fn,void 0,!0),w){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,f),!0;case 3:return p.fn.call(p.context,f,d),!0;case 4:return p.fn.call(p.context,f,d,h),!0;case 5:return p.fn.call(p.context,f,d,h,m),!0;case 6:return p.fn.call(p.context,f,d,h,m,v),!0}for(_=1,j=new Array(w-1);_<w;_++)j[_-1]=arguments[_];p.fn.apply(p.context,j)}else{var y=p.length,g;for(_=0;_<y;_++)switch(p[_].once&&this.removeListener(u,p[_].fn,void 0,!0),w){case 1:p[_].fn.call(p[_].context);break;case 2:p[_].fn.call(p[_].context,f);break;case 3:p[_].fn.call(p[_].context,f,d);break;case 4:p[_].fn.call(p[_].context,f,d,h);break;default:if(!j)for(g=1,j=new Array(w-1);g<w;g++)j[g-1]=arguments[g];p[_].fn.apply(p[_].context,j)}}return!0},l.prototype.on=function(u,f,d){return s(this,u,f,d,!1)},l.prototype.once=function(u,f,d){return s(this,u,f,d,!0)},l.prototype.removeListener=function(u,f,d,h){var m=r?r+u:u;if(!this._events[m])return this;if(!f)return o(this,m),this;var v=this._events[m];if(v.fn)v.fn===f&&(!h||v.once)&&(!d||v.context===d)&&o(this,m);else{for(var x=0,p=[],w=v.length;x<w;x++)(v[x].fn!==f||h&&!v[x].once||d&&v[x].context!==d)&&p.push(v[x]);p.length?this._events[m]=p.length===1?p[0]:p:o(this,m)}return this},l.prototype.removeAllListeners=function(u){var f;return u?(f=r?r+u:u,this._events[f]&&o(this,f)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=r,l.EventEmitter=l,e.exports=l})(Vb);var w8=Vb.exports;const _8=Re(w8);var nc=new _8,ac="recharts.syncMouseEvents";function Wi(e){"@babel/helpers - typeof";return Wi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wi(e)}function N8(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function S8(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Kb(n.key),n)}}function O8(e,t,r){return t&&S8(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function ic(e,t,r){return t=Kb(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Kb(e){var t=A8(e,"string");return Wi(t)=="symbol"?t:t+""}function A8(e,t){if(Wi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Wi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var P8=function(){function e(){N8(this,e),ic(this,"activeIndex",0),ic(this,"coordinateList",[]),ic(this,"layout","horizontal")}return O8(e,[{key:"setDetails",value:function(r){var n,i=r.coordinateList,s=i===void 0?null:i,o=r.container,l=o===void 0?null:o,c=r.layout,u=c===void 0?null:c,f=r.offset,d=f===void 0?null:f,h=r.mouseHandlerCallback,m=h===void 0?null:h;this.coordinateList=(n=s??this.coordinateList)!==null&&n!==void 0?n:[],this.container=l??this.container,this.layout=u??this.layout,this.offset=d??this.offset,this.mouseHandlerCallback=m??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(r){if(this.coordinateList.length!==0)switch(r.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(r){this.activeIndex=r}},{key:"spoofMouse",value:function(){var r,n;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var i=this.container.getBoundingClientRect(),s=i.x,o=i.y,l=i.height,c=this.coordinateList[this.activeIndex].coordinate,u=((r=window)===null||r===void 0?void 0:r.scrollX)||0,f=((n=window)===null||n===void 0?void 0:n.scrollY)||0,d=s+c+u,h=o+this.offset.top+l/2+f;this.mouseHandlerCallback({pageX:d,pageY:h})}}}])}();function T8(e,t,r){if(r==="number"&&t===!0&&Array.isArray(e)){var n=e==null?void 0:e[0],i=e==null?void 0:e[1];if(n&&i&&ie(n)&&ie(i))return!0}return!1}function E8(e,t,r,n){var i=n/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:r.left+.5,y:e==="horizontal"?r.top+.5:t.y-i,width:e==="horizontal"?n:r.width-1,height:e==="horizontal"?r.height-1:n}}function Xb(e){var t=e.cx,r=e.cy,n=e.radius,i=e.startAngle,s=e.endAngle,o=it(t,r,n,i),l=it(t,r,n,s);return{points:[o,l],cx:t,cy:r,radius:n,startAngle:i,endAngle:s}}function C8(e,t,r){var n,i,s,o;if(e==="horizontal")n=t.x,s=n,i=r.top,o=r.top+r.height;else if(e==="vertical")i=t.y,o=i,n=r.left,s=r.left+r.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var l=t.cx,c=t.cy,u=t.innerRadius,f=t.outerRadius,d=t.angle,h=it(l,c,u,d),m=it(l,c,f,d);n=h.x,i=h.y,s=m.x,o=m.y}else return Xb(t);return[{x:n,y:i},{x:s,y:o}]}function Gi(e){"@babel/helpers - typeof";return Gi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gi(e)}function wg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ns(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wg(Object(r),!0).forEach(function(n){$8(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $8(e,t,r){return t=k8(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function k8(e){var t=M8(e,"string");return Gi(t)=="symbol"?t:t+""}function M8(e,t){if(Gi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Gi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function I8(e){var t,r,n=e.element,i=e.tooltipEventType,s=e.isActive,o=e.activeCoordinate,l=e.activePayload,c=e.offset,u=e.activeTooltipIndex,f=e.tooltipAxisBandSize,d=e.layout,h=e.chartName,m=(t=n.props.cursor)!==null&&t!==void 0?t:(r=n.type.defaultProps)===null||r===void 0?void 0:r.cursor;if(!n||!m||!s||!o||h!=="ScatterChart"&&i!=="axis")return null;var v,x=mu;if(h==="ScatterChart")v=o,x=I5;else if(h==="BarChart")v=E8(d,o,c,f),x=of;else if(d==="radial"){var p=Xb(o),w=p.cx,j=p.cy,_=p.radius,y=p.startAngle,g=p.endAngle;v={cx:w,cy:j,startAngle:y,endAngle:g,innerRadius:_,outerRadius:_},x=Zy}else v={points:C8(d,o,c)},x=mu;var b=Ns(Ns(Ns(Ns({stroke:"#ccc",pointerEvents:"none"},c),v),Ee(m,!1)),{},{payload:l,payloadIndex:u,className:Ce("recharts-tooltip-cursor",m.className)});return S.isValidElement(m)?S.cloneElement(m,b):S.createElement(x,b)}var D8=["item"],L8=["children","className","width","height","style","compact","title","desc"];function ya(e){"@babel/helpers - typeof";return ya=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ya(e)}function oi(){return oi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},oi.apply(this,arguments)}function _g(e,t){return F8(e)||B8(e,t)||Zb(e,t)||R8()}function R8(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
261In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function B8(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,s,o,l=[],c=!0,u=!1;try{if(s=(r=r.call(e)).next,t!==0)for(;!(c=(n=s.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,i=f}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function F8(e){if(Array.isArray(e))return e}function Ng(e,t){if(e==null)return{};var r=U8(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function U8(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function z8(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function H8(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Jb(n.key),n)}}function W8(e,t,r){return t&&H8(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function G8(e,t,r){return t=ko(t),q8(e,Yb()?Reflect.construct(t,r||[],ko(e).constructor):t.apply(e,r))}function q8(e,t){if(t&&(ya(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return V8(e)}function V8(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Yb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Yb=function(){return!!e})()}function ko(e){return ko=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ko(e)}function K8(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Gu(e,t)}function Gu(e,t){return Gu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Gu(e,t)}function ba(e){return Z8(e)||Y8(e)||Zb(e)||X8()}function X8(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
262In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Zb(e,t){if(e){if(typeof e=="string")return qu(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return qu(e,t)}}function Y8(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Z8(e){if(Array.isArray(e))return qu(e)}function qu(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Sg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function H(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Sg(Object(r),!0).forEach(function(n){xe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Sg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function xe(e,t,r){return t=Jb(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Jb(e){var t=J8(e,"string");return ya(t)=="symbol"?t:t+""}function J8(e,t){if(ya(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ya(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Q8={xAxis:["bottom","top"],yAxis:["left","right"]},ez={width:"100%",height:"100%"},Qb={x:0,y:0};function Ss(e){return e}var tz=function(t,r){return r==="horizontal"?t.x:r==="vertical"?t.y:r==="centric"?t.angle:t.radius},rz=function(t,r,n,i){var s=r.find(function(f){return f&&f.index===n});if(s){if(t==="horizontal")return{x:s.coordinate,y:i.y};if(t==="vertical")return{x:i.x,y:s.coordinate};if(t==="centric"){var o=s.coordinate,l=i.radius;return H(H(H({},i),it(i.cx,i.cy,l,o)),{},{angle:o,radius:l})}var c=s.coordinate,u=i.angle;return H(H(H({},i),it(i.cx,i.cy,c,u)),{},{angle:u,radius:c})}return Qb},Sl=function(t,r){var n=r.graphicalItems,i=r.dataStartIndex,s=r.dataEndIndex,o=(n??[]).reduce(function(l,c){var u=c.props.data;return u&&u.length?[].concat(ba(l),ba(u)):l},[]);return o.length>0?o:t&&t.length&&ie(i)&&ie(s)?t.slice(i,s+1):[]};function e0(e){return e==="number"?[0,"auto"]:void 0}var Vu=function(t,r,n,i){var s=t.graphicalItems,o=t.tooltipAxis,l=Sl(r,t);return n<0||!s||!s.length||n>=l.length?null:s.reduce(function(c,u){var f,d=(f=u.props.data)!==null&&f!==void 0?f:r;d&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(d=d.slice(t.dataStartIndex,t.dataEndIndex+1));var h;if(o.dataKey&&!o.allowDuplicatedCategory){var m=d===void 0?l:d;h=Ms(m,o.dataKey,i)}else h=d&&d[n]||l[n];return h?[].concat(ba(c),[Ky(u,h)]):c},[])},Og=function(t,r,n,i){var s=i||{x:t.chartX,y:t.chartY},o=tz(s,n),l=t.orderedTooltipTicks,c=t.tooltipAxis,u=t.tooltipTicks,f=A4(o,l,u,c);if(f>=0&&u){var d=u[f]&&u[f].value,h=Vu(t,r,f,d),m=rz(n,l,f,s);return{activeTooltipIndex:f,activeLabel:d,activePayload:h,activeCoordinate:m}}return null},nz=function(t,r){var n=r.axes,i=r.graphicalItems,s=r.axisType,o=r.axisIdKey,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,f=t.layout,d=t.children,h=t.stackOffset,m=Gy(f,s);return n.reduce(function(v,x){var p,w=x.type.defaultProps!==void 0?H(H({},x.type.defaultProps),x.props):x.props,j=w.type,_=w.dataKey,y=w.allowDataOverflow,g=w.allowDuplicatedCategory,b=w.scale,N=w.ticks,O=w.includeHidden,D=w[o];if(v[D])return v;var P=Sl(t.data,{graphicalItems:i.filter(function(re){var R,te=o in re.props?re.props[o]:(R=re.type.defaultProps)===null||R===void 0?void 0:R[o];return te===D}),dataStartIndex:c,dataEndIndex:u}),E=P.length,$,I,L;T8(w.domain,y,j)&&($=cu(w.domain,null,y),m&&(j==="number"||b!=="auto")&&(L=ai(P,_,"category")));var U=e0(j);if(!$||$.length===0){var T,B=(T=w.domain)!==null&&T!==void 0?T:U;if(_){if($=ai(P,_,j),j==="category"&&m){var W=pN($);g&&W?(I=$,$=bo(0,E)):g||($=ap(B,$,x).reduce(function(re,R){return re.indexOf(R)>=0?re:[].concat(ba(re),[R])},[]))}else if(j==="category")g?$=$.filter(function(re){return re!==""&&!Ae(re)}):$=ap(B,$,x).reduce(function(re,R){return re.indexOf(R)>=0||R===""||Ae(R)?re:[].concat(ba(re),[R])},[]);else if(j==="number"){var ae=$4(P,i.filter(function(re){var R,te,A=o in re.props?re.props[o]:(R=re.type.defaultProps)===null||R===void 0?void 0:R[o],X="hide"in re.props?re.props.hide:(te=re.type.defaultProps)===null||te===void 0?void 0:te.hide;return A===D&&(O||!X)}),_,s,f);ae&&($=ae)}m&&(j==="number"||b!=="auto")&&(L=ai(P,_,"category"))}else m?$=bo(0,E):l&&l[D]&&l[D].hasStack&&j==="number"?$=h==="expand"?[0,1]:Vy(l[D].stackGroups,c,u):$=Wy(P,i.filter(function(re){var R=o in re.props?re.props[o]:re.type.defaultProps[o],te="hide"in re.props?re.props.hide:re.type.defaultProps.hide;return R===D&&(O||!te)}),j,f,!0);if(j==="number")$=Wu(d,$,D,s,N),B&&($=cu(B,$,y));else if(j==="category"&&B){var F=B,G=$.every(function(re){return F.indexOf(re)>=0});G&&($=F)}}return H(H({},v),{},xe({},D,H(H({},w),{},{axisType:s,domain:$,categoricalDomain:L,duplicateDomain:I,originalDomain:(p=w.domain)!==null&&p!==void 0?p:U,isCategorical:m,layout:f})))},{})},az=function(t,r){var n=r.graphicalItems,i=r.Axis,s=r.axisType,o=r.axisIdKey,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,f=t.layout,d=t.children,h=Sl(t.data,{graphicalItems:n,dataStartIndex:c,dataEndIndex:u}),m=h.length,v=Gy(f,s),x=-1;return n.reduce(function(p,w){var j=w.type.defaultProps!==void 0?H(H({},w.type.defaultProps),w.props):w.props,_=j[o],y=e0("number");if(!p[_]){x++;var g;return v?g=bo(0,m):l&&l[_]&&l[_].hasStack?(g=Vy(l[_].stackGroups,c,u),g=Wu(d,g,_,s)):(g=cu(y,Wy(h,n.filter(function(b){var N,O,D=o in b.props?b.props[o]:(N=b.type.defaultProps)===null||N===void 0?void 0:N[o],P="hide"in b.props?b.props.hide:(O=b.type.defaultProps)===null||O===void 0?void 0:O.hide;return D===_&&!P}),"number",f),i.defaultProps.allowDataOverflow),g=Wu(d,g,_,s)),H(H({},p),{},xe({},_,H(H({axisType:s},i.defaultProps),{},{hide:!0,orientation:Rt(Q8,"".concat(s,".").concat(x%2),null),domain:g,originalDomain:y,isCategorical:v,layout:f})))}return p},{})},iz=function(t,r){var n=r.axisType,i=n===void 0?"xAxis":n,s=r.AxisComp,o=r.graphicalItems,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,f=t.children,d="".concat(i,"Id"),h=Bt(f,s),m={};return h&&h.length?m=nz(t,{axes:h,graphicalItems:o,axisType:i,axisIdKey:d,stackGroups:l,dataStartIndex:c,dataEndIndex:u}):o&&o.length&&(m=az(t,{Axis:s,graphicalItems:o,axisType:i,axisIdKey:d,stackGroups:l,dataStartIndex:c,dataEndIndex:u})),m},sz=function(t){var r=Ur(t),n=yr(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:kd(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:uo(r,n)}},Ag=function(t){var r=t.children,n=t.defaultShowTooltip,i=Pt(r,la),s=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(s=i.props.startIndex),i.props.endIndex>=0&&(o=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:s,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},oz=function(t){return!t||!t.length?!1:t.some(function(r){var n=Or(r&&r.type);return n&&n.indexOf("Bar")>=0})},Pg=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},lz=function(t,r){var n=t.props,i=t.graphicalItems,s=t.xAxisMap,o=s===void 0?{}:s,l=t.yAxisMap,c=l===void 0?{}:l,u=n.width,f=n.height,d=n.children,h=n.margin||{},m=Pt(d,la),v=Pt(d,zn),x=Object.keys(c).reduce(function(g,b){var N=c[b],O=N.orientation;return!N.mirror&&!N.hide?H(H({},g),{},xe({},O,g[O]+N.width)):g},{left:h.left||0,right:h.right||0}),p=Object.keys(o).reduce(function(g,b){var N=o[b],O=N.orientation;return!N.mirror&&!N.hide?H(H({},g),{},xe({},O,Rt(g,"".concat(O))+N.height)):g},{top:h.top||0,bottom:h.bottom||0}),w=H(H({},p),x),j=w.bottom;m&&(w.bottom+=m.props.height||la.defaultProps.height),v&&r&&(w=E4(w,i,n,r));var _=u-w.left-w.right,y=f-w.top-w.bottom;return H(H({brushBottom:j},w),{},{width:Math.max(_,0),height:Math.max(y,0)})},cz=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},t0=function(t){var r=t.chartName,n=t.GraphicalChild,i=t.defaultTooltipEventType,s=i===void 0?"axis":i,o=t.validateTooltipEventTypes,l=o===void 0?["axis"]:o,c=t.axisComponents,u=t.legendContent,f=t.formatAxisMap,d=t.defaultProps,h=function(p,w){var j=w.graphicalItems,_=w.stackGroups,y=w.offset,g=w.updateId,b=w.dataStartIndex,N=w.dataEndIndex,O=p.barSize,D=p.layout,P=p.barGap,E=p.barCategoryGap,$=p.maxBarSize,I=Pg(D),L=I.numericAxisName,U=I.cateAxisName,T=oz(j),B=[];return j.forEach(function(W,ae){var F=Sl(p.data,{graphicalItems:[W],dataStartIndex:b,dataEndIndex:N}),G=W.type.defaultProps!==void 0?H(H({},W.type.defaultProps),W.props):W.props,re=G.dataKey,R=G.maxBarSize,te=G["".concat(L,"Id")],A=G["".concat(U,"Id")],X={},le=c.reduce(function(jt,mt){var rr=w["".concat(mt.axisType,"Map")],Qr=G["".concat(mt.axisType,"Id")];rr&&rr[Qr]||mt.axisType==="zAxis"||bn();var ur=rr[Qr];return H(H({},jt),{},xe(xe({},mt.axisType,ur),"".concat(mt.axisType,"Ticks"),yr(ur)))},X),he=le[U],J=le["".concat(U,"Ticks")],me=_&&_[te]&&_[te].hasStack&&W4(W,_[te].stackGroups),ve=Or(W.type).indexOf("Bar")>=0,k=uo(he,J),ne=[],Y=T&&P4({barSize:O,stackGroups:_,totalSize:cz(le,U)});if(ve){var ue,ye,Te=Ae(R)?$:R,He=(ue=(ye=uo(he,J,!0))!==null&&ye!==void 0?ye:Te)!==null&&ue!==void 0?ue:0;ne=T4({barGap:P,barCategoryGap:E,bandSize:He!==k?He:k,sizeList:Y[A],maxBarSize:Te}),He!==k&&(ne=ne.map(function(jt){return H(H({},jt),{},{position:H(H({},jt.position),{},{offset:jt.position.offset-He/2})})}))}var st=W&&W.type&&W.type.getComposedData;st&&B.push({props:H(H({},st(H(H({},le),{},{displayedData:F,props:p,dataKey:re,item:W,bandSize:k,barPosition:ne,offset:y,stackedData:me,layout:D,dataStartIndex:b,dataEndIndex:N}))),{},xe(xe(xe({key:W.key||"item-".concat(ae)},L,le[L]),U,le[U]),"animationId",g)),childIndex:AN(W,p.children),item:W})}),B},m=function(p,w){var j=p.props,_=p.dataStartIndex,y=p.dataEndIndex,g=p.updateId;if(!Yf({props:j}))return null;var b=j.children,N=j.layout,O=j.stackOffset,D=j.data,P=j.reverseStackOrder,E=Pg(N),$=E.numericAxisName,I=E.cateAxisName,L=Bt(b,n),U=U4(D,L,"".concat($,"Id"),"".concat(I,"Id"),O,P),T=c.reduce(function(G,re){var R="".concat(re.axisType,"Map");return H(H({},G),{},xe({},R,iz(j,H(H({},re),{},{graphicalItems:L,stackGroups:re.axisType===$&&U,dataStartIndex:_,dataEndIndex:y}))))},{}),B=lz(H(H({},T),{},{props:j,graphicalItems:L}),w==null?void 0:w.legendBBox);Object.keys(T).forEach(function(G){T[G]=f(j,T[G],B,G.replace("Map",""),r)});var W=T["".concat(I,"Map")],ae=sz(W),F=h(j,H(H({},T),{},{dataStartIndex:_,dataEndIndex:y,updateId:g,graphicalItems:L,stackGroups:U,offset:B}));return H(H({formattedGraphicalItems:F,graphicalItems:L,offset:B,stackGroups:U},ae),T)},v=function(x){function p(w){var j,_,y;return z8(this,p),y=G8(this,p,[w]),xe(y,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),xe(y,"accessibilityManager",new P8),xe(y,"handleLegendBBoxUpdate",function(g){if(g){var b=y.state,N=b.dataStartIndex,O=b.dataEndIndex,D=b.updateId;y.setState(H({legendBBox:g},m({props:y.props,dataStartIndex:N,dataEndIndex:O,updateId:D},H(H({},y.state),{},{legendBBox:g}))))}}),xe(y,"handleReceiveSyncEvent",function(g,b,N){if(y.props.syncId===g){if(N===y.eventEmitterSymbol&&typeof y.props.syncMethod!="function")return;y.applySyncEvent(b)}}),xe(y,"handleBrushChange",function(g){var b=g.startIndex,N=g.endIndex;if(b!==y.state.dataStartIndex||N!==y.state.dataEndIndex){var O=y.state.updateId;y.setState(function(){return H({dataStartIndex:b,dataEndIndex:N},m({props:y.props,dataStartIndex:b,dataEndIndex:N,updateId:O},y.state))}),y.triggerSyncEvent({dataStartIndex:b,dataEndIndex:N})}}),xe(y,"handleMouseEnter",function(g){var b=y.getMouseInfo(g);if(b){var N=H(H({},b),{},{isTooltipActive:!0});y.setState(N),y.triggerSyncEvent(N);var O=y.props.onMouseEnter;Ne(O)&&O(N,g)}}),xe(y,"triggeredAfterMouseMove",function(g){var b=y.getMouseInfo(g),N=b?H(H({},b),{},{isTooltipActive:!0}):{isTooltipActive:!1};y.setState(N),y.triggerSyncEvent(N);var O=y.props.onMouseMove;Ne(O)&&O(N,g)}),xe(y,"handleItemMouseEnter",function(g){y.setState(function(){return{isTooltipActive:!0,activeItem:g,activePayload:g.tooltipPayload,activeCoordinate:g.tooltipPosition||{x:g.cx,y:g.cy}}})}),xe(y,"handleItemMouseLeave",function(){y.setState(function(){return{isTooltipActive:!1}})}),xe(y,"handleMouseMove",function(g){g.persist(),y.throttleTriggeredAfterMouseMove(g)}),xe(y,"handleMouseLeave",function(g){y.throttleTriggeredAfterMouseMove.cancel();var b={isTooltipActive:!1};y.setState(b),y.triggerSyncEvent(b);var N=y.props.onMouseLeave;Ne(N)&&N(b,g)}),xe(y,"handleOuterEvent",function(g){var b=ON(g),N=Rt(y.props,"".concat(b));if(b&&Ne(N)){var O,D;/.*touch.*/i.test(b)?D=y.getMouseInfo(g.changedTouches[0]):D=y.getMouseInfo(g),N((O=D)!==null&&O!==void 0?O:{},g)}}),xe(y,"handleClick",function(g){var b=y.getMouseInfo(g);if(b){var N=H(H({},b),{},{isTooltipActive:!0});y.setState(N),y.triggerSyncEvent(N);var O=y.props.onClick;Ne(O)&&O(N,g)}}),xe(y,"handleMouseDown",function(g){var b=y.props.onMouseDown;if(Ne(b)){var N=y.getMouseInfo(g);b(N,g)}}),xe(y,"handleMouseUp",function(g){var b=y.props.onMouseUp;if(Ne(b)){var N=y.getMouseInfo(g);b(N,g)}}),xe(y,"handleTouchMove",function(g){g.changedTouches!=null&&g.changedTouches.length>0&&y.throttleTriggeredAfterMouseMove(g.changedTouches[0])}),xe(y,"handleTouchStart",function(g){g.changedTouches!=null&&g.changedTouches.length>0&&y.handleMouseDown(g.changedTouches[0])}),xe(y,"handleTouchEnd",function(g){g.changedTouches!=null&&g.changedTouches.length>0&&y.handleMouseUp(g.changedTouches[0])}),xe(y,"triggerSyncEvent",function(g){y.props.syncId!==void 0&&nc.emit(ac,y.props.syncId,g,y.eventEmitterSymbol)}),xe(y,"applySyncEvent",function(g){var b=y.props,N=b.layout,O=b.syncMethod,D=y.state.updateId,P=g.dataStartIndex,E=g.dataEndIndex;if(g.dataStartIndex!==void 0||g.dataEndIndex!==void 0)y.setState(H({dataStartIndex:P,dataEndIndex:E},m({props:y.props,dataStartIndex:P,dataEndIndex:E,updateId:D},y.state)));else if(g.activeTooltipIndex!==void 0){var $=g.chartX,I=g.chartY,L=g.activeTooltipIndex,U=y.state,T=U.offset,B=U.tooltipTicks;if(!T)return;if(typeof O=="function")L=O(B,g);else if(O==="value"){L=-1;for(var W=0;W<B.length;W++)if(B[W].value===g.activeLabel){L=W;break}}var ae=H(H({},T),{},{x:T.left,y:T.top}),F=Math.min($,ae.x+ae.width),G=Math.min(I,ae.y+ae.height),re=B[L]&&B[L].value,R=Vu(y.state,y.props.data,L),te=B[L]?{x:N==="horizontal"?B[L].coordinate:F,y:N==="horizontal"?G:B[L].coordinate}:Qb;y.setState(H(H({},g),{},{activeLabel:re,activeCoordinate:te,activePayload:R,activeTooltipIndex:L}))}else y.setState(g)}),xe(y,"renderCursor",function(g){var b,N=y.state,O=N.isTooltipActive,D=N.activeCoordinate,P=N.activePayload,E=N.offset,$=N.activeTooltipIndex,I=N.tooltipAxisBandSize,L=y.getTooltipEventType(),U=(b=g.props.active)!==null&&b!==void 0?b:O,T=y.props.layout,B=g.key||"_recharts-cursor";return M.createElement(I8,{key:B,activeCoordinate:D,activePayload:P,activeTooltipIndex:$,chartName:r,element:g,isActive:U,layout:T,offset:E,tooltipAxisBandSize:I,tooltipEventType:L})}),xe(y,"renderPolarAxis",function(g,b,N){var O=Rt(g,"type.axisType"),D=Rt(y.state,"".concat(O,"Map")),P=g.type.defaultProps,E=P!==void 0?H(H({},P),g.props):g.props,$=D&&D[E["".concat(O,"Id")]];return S.cloneElement(g,H(H({},$),{},{className:Ce(O,$.className),key:g.key||"".concat(b,"-").concat(N),ticks:yr($,!0)}))}),xe(y,"renderPolarGrid",function(g){var b=g.props,N=b.radialLines,O=b.polarAngles,D=b.polarRadius,P=y.state,E=P.radiusAxisMap,$=P.angleAxisMap,I=Ur(E),L=Ur($),U=L.cx,T=L.cy,B=L.innerRadius,W=L.outerRadius;return S.cloneElement(g,{polarAngles:Array.isArray(O)?O:yr(L,!0).map(function(ae){return ae.coordinate}),polarRadius:Array.isArray(D)?D:yr(I,!0).map(function(ae){return ae.coordinate}),cx:U,cy:T,innerRadius:B,outerRadius:W,key:g.key||"polar-grid",radialLines:N})}),xe(y,"renderLegend",function(){var g=y.state.formattedGraphicalItems,b=y.props,N=b.children,O=b.width,D=b.height,P=y.props.margin||{},E=O-(P.left||0)-(P.right||0),$=zy({children:N,formattedGraphicalItems:g,legendWidth:E,legendContent:u});if(!$)return null;var I=$.item,L=Ng($,D8);return S.cloneElement(I,H(H({},L),{},{chartWidth:O,chartHeight:D,margin:P,onBBoxUpdate:y.handleLegendBBoxUpdate}))}),xe(y,"renderTooltip",function(){var g,b=y.props,N=b.children,O=b.accessibilityLayer,D=Pt(N,qt);if(!D)return null;var P=y.state,E=P.isTooltipActive,$=P.activeCoordinate,I=P.activePayload,L=P.activeLabel,U=P.offset,T=(g=D.props.active)!==null&&g!==void 0?g:E;return S.cloneElement(D,{viewBox:H(H({},U),{},{x:U.left,y:U.top}),active:T,label:L,payload:T?I:[],coordinate:$,accessibilityLayer:O})}),xe(y,"renderBrush",function(g){var b=y.props,N=b.margin,O=b.data,D=y.state,P=D.offset,E=D.dataStartIndex,$=D.dataEndIndex,I=D.updateId;return S.cloneElement(g,{key:g.key||"_recharts-brush",onChange:bs(y.handleBrushChange,g.props.onChange),data:O,x:ie(g.props.x)?g.props.x:P.left,y:ie(g.props.y)?g.props.y:P.top+P.height+P.brushBottom-(N.bottom||0),width:ie(g.props.width)?g.props.width:P.width,startIndex:E,endIndex:$,updateId:"brush-".concat(I)})}),xe(y,"renderReferenceElement",function(g,b,N){if(!g)return null;var O=y,D=O.clipPathId,P=y.state,E=P.xAxisMap,$=P.yAxisMap,I=P.offset,L=g.type.defaultProps||{},U=g.props,T=U.xAxisId,B=T===void 0?L.xAxisId:T,W=U.yAxisId,ae=W===void 0?L.yAxisId:W;return S.cloneElement(g,{key:g.key||"".concat(b,"-").concat(N),xAxis:E[B],yAxis:$[ae],viewBox:{x:I.left,y:I.top,width:I.width,height:I.height},clipPathId:D})}),xe(y,"renderActivePoints",function(g){var b=g.item,N=g.activePoint,O=g.basePoint,D=g.childIndex,P=g.isRange,E=[],$=b.props.key,I=b.item.type.defaultProps!==void 0?H(H({},b.item.type.defaultProps),b.item.props):b.item.props,L=I.activeDot,U=I.dataKey,T=H(H({index:D,dataKey:U,cx:N.x,cy:N.y,r:4,fill:sf(b.item),strokeWidth:2,stroke:"#fff",payload:N.payload,value:N.value},Ee(L,!1)),Is(L));return E.push(p.renderActiveDot(L,T,"".concat($,"-activePoint-").concat(D))),O?E.push(p.renderActiveDot(L,H(H({},T),{},{cx:O.x,cy:O.y}),"".concat($,"-basePoint-").concat(D))):P&&E.push(null),E}),xe(y,"renderGraphicChild",function(g,b,N){var O=y.filterFormatItem(g,b,N);if(!O)return null;var D=y.getTooltipEventType(),P=y.state,E=P.isTooltipActive,$=P.tooltipAxis,I=P.activeTooltipIndex,L=P.activeLabel,U=y.props.children,T=Pt(U,qt),B=O.props,W=B.points,ae=B.isRange,F=B.baseLine,G=O.item.type.defaultProps!==void 0?H(H({},O.item.type.defaultProps),O.item.props):O.item.props,re=G.activeDot,R=G.hide,te=G.activeBar,A=G.activeShape,X=!!(!R&&E&&T&&(re||te||A)),le={};D!=="axis"&&T&&T.props.trigger==="click"?le={onClick:bs(y.handleItemMouseEnter,g.props.onClick)}:D!=="axis"&&(le={onMouseLeave:bs(y.handleItemMouseLeave,g.props.onMouseLeave),onMouseEnter:bs(y.handleItemMouseEnter,g.props.onMouseEnter)});var he=S.cloneElement(g,H(H({},O.props),le));function J(mt){return typeof $.dataKey=="function"?$.dataKey(mt.payload):null}if(X)if(I>=0){var me,ve;if($.dataKey&&!$.allowDuplicatedCategory){var k=typeof $.dataKey=="function"?J:"payload.".concat($.dataKey.toString());me=Ms(W,k,L),ve=ae&&F&&Ms(F,k,L)}else me=W==null?void 0:W[I],ve=ae&&F&&F[I];if(A||te){var ne=g.props.activeIndex!==void 0?g.props.activeIndex:I;return[S.cloneElement(g,H(H(H({},O.props),le),{},{activeIndex:ne})),null,null]}if(!Ae(me))return[he].concat(ba(y.renderActivePoints({item:O,activePoint:me,basePoint:ve,childIndex:I,isRange:ae})))}else{var Y,ue=(Y=y.getItemByXY(y.state.activeCoordinate))!==null&&Y!==void 0?Y:{graphicalItem:he},ye=ue.graphicalItem,Te=ye.item,He=Te===void 0?g:Te,st=ye.childIndex,jt=H(H(H({},O.props),le),{},{activeIndex:st});return[S.cloneElement(He,jt),null,null]}return ae?[he,null,null]:[he,null]}),xe(y,"renderCustomized",function(g,b,N){return S.cloneElement(g,H(H({key:"recharts-customized-".concat(N)},y.props),y.state))}),xe(y,"renderMap",{CartesianGrid:{handler:Ss,once:!0},ReferenceArea:{handler:y.renderReferenceElement},ReferenceLine:{handler:Ss},ReferenceDot:{handler:y.renderReferenceElement},XAxis:{handler:Ss},YAxis:{handler:Ss},Brush:{handler:y.renderBrush,once:!0},Bar:{handler:y.renderGraphicChild},Line:{handler:y.renderGraphicChild},Area:{handler:y.renderGraphicChild},Radar:{handler:y.renderGraphicChild},RadialBar:{handler:y.renderGraphicChild},Scatter:{handler:y.renderGraphicChild},Pie:{handler:y.renderGraphicChild},Funnel:{handler:y.renderGraphicChild},Tooltip:{handler:y.renderCursor,once:!0},PolarGrid:{handler:y.renderPolarGrid,once:!0},PolarAngleAxis:{handler:y.renderPolarAxis},PolarRadiusAxis:{handler:y.renderPolarAxis},Customized:{handler:y.renderCustomized}}),y.clipPathId="".concat((j=w.id)!==null&&j!==void 0?j:Ji("recharts"),"-clip"),y.throttleTriggeredAfterMouseMove=Ux(y.triggeredAfterMouseMove,(_=w.throttleDelay)!==null&&_!==void 0?_:1e3/60),y.state={},y}return K8(p,x),W8(p,[{key:"componentDidMount",value:function(){var j,_;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(j=this.props.margin.left)!==null&&j!==void 0?j:0,top:(_=this.props.margin.top)!==null&&_!==void 0?_:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var j=this.props,_=j.children,y=j.data,g=j.height,b=j.layout,N=Pt(_,qt);if(N){var O=N.props.defaultIndex;if(!(typeof O!="number"||O<0||O>this.state.tooltipTicks.length-1)){var D=this.state.tooltipTicks[O]&&this.state.tooltipTicks[O].value,P=Vu(this.state,y,O,D),E=this.state.tooltipTicks[O].coordinate,$=(this.state.offset.top+g)/2,I=b==="horizontal",L=I?{x:E,y:$}:{y:E,x:$},U=this.state.formattedGraphicalItems.find(function(B){var W=B.item;return W.type.name==="Scatter"});U&&(L=H(H({},L),U.props.points[O].tooltipPosition),P=U.props.points[O].tooltipPayload);var T={activeTooltipIndex:O,isTooltipActive:!0,activeLabel:D,activePayload:P,activeCoordinate:L};this.setState(T),this.renderCursor(N),this.accessibilityManager.setIndex(O)}}}},{key:"getSnapshotBeforeUpdate",value:function(j,_){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==_.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==j.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==j.margin){var y,g;this.accessibilityManager.setDetails({offset:{left:(y=this.props.margin.left)!==null&&y!==void 0?y:0,top:(g=this.props.margin.top)!==null&&g!==void 0?g:0}})}return null}},{key:"componentDidUpdate",value:function(j){Nc([Pt(j.children,qt)],[Pt(this.props.children,qt)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var j=Pt(this.props.children,qt);if(j&&typeof j.props.shared=="boolean"){var _=j.props.shared?"axis":"item";return l.indexOf(_)>=0?_:s}return s}},{key:"getMouseInfo",value:function(j){if(!this.container)return null;var _=this.container,y=_.getBoundingClientRect(),g=Qk(y),b={chartX:Math.round(j.pageX-g.left),chartY:Math.round(j.pageY-g.top)},N=y.width/_.offsetWidth||1,O=this.inRange(b.chartX,b.chartY,N);if(!O)return null;var D=this.state,P=D.xAxisMap,E=D.yAxisMap,$=this.getTooltipEventType();if($!=="axis"&&P&&E){var I=Ur(P).scale,L=Ur(E).scale,U=I&&I.invert?I.invert(b.chartX):null,T=L&&L.invert?L.invert(b.chartY):null;return H(H({},b),{},{xValue:U,yValue:T})}var B=Og(this.state,this.props.data,this.props.layout,O);return B?H(H({},b),B):null}},{key:"inRange",value:function(j,_){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,g=this.props.layout,b=j/y,N=_/y;if(g==="horizontal"||g==="vertical"){var O=this.state.offset,D=b>=O.left&&b<=O.left+O.width&&N>=O.top&&N<=O.top+O.height;return D?{x:b,y:N}:null}var P=this.state,E=P.angleAxisMap,$=P.radiusAxisMap;if(E&&$){var I=Ur(E);return op({x:b,y:N},I)}return null}},{key:"parseEventsOfWrapper",value:function(){var j=this.props.children,_=this.getTooltipEventType(),y=Pt(j,qt),g={};y&&_==="axis"&&(y.props.trigger==="click"?g={onClick:this.handleClick}:g={onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd});var b=Is(this.props,this.handleOuterEvent);return H(H({},b),g)}},{key:"addListener",value:function(){nc.on(ac,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){nc.removeListener(ac,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(j,_,y){for(var g=this.state.formattedGraphicalItems,b=0,N=g.length;b<N;b++){var O=g[b];if(O.item===j||O.props.key===j.key||_===Or(O.item.type)&&y===O.childIndex)return O}return null}},{key:"renderClipPath",value:function(){var j=this.clipPathId,_=this.state.offset,y=_.left,g=_.top,b=_.height,N=_.width;return M.createElement("defs",null,M.createElement("clipPath",{id:j},M.createElement("rect",{x:y,y:g,height:b,width:N})))}},{key:"getXScales",value:function(){var j=this.state.xAxisMap;return j?Object.entries(j).reduce(function(_,y){var g=_g(y,2),b=g[0],N=g[1];return H(H({},_),{},xe({},b,N.scale))},{}):null}},{key:"getYScales",value:function(){var j=this.state.yAxisMap;return j?Object.entries(j).reduce(function(_,y){var g=_g(y,2),b=g[0],N=g[1];return H(H({},_),{},xe({},b,N.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(j){var _;return(_=this.state.xAxisMap)===null||_===void 0||(_=_[j])===null||_===void 0?void 0:_.scale}},{key:"getYScaleByAxisId",value:function(j){var _;return(_=this.state.yAxisMap)===null||_===void 0||(_=_[j])===null||_===void 0?void 0:_.scale}},{key:"getItemByXY",value:function(j){var _=this.state,y=_.formattedGraphicalItems,g=_.activeItem;if(y&&y.length)for(var b=0,N=y.length;b<N;b++){var O=y[b],D=O.props,P=O.item,E=P.type.defaultProps!==void 0?H(H({},P.type.defaultProps),P.props):P.props,$=Or(P.type);if($==="Bar"){var I=(D.data||[]).find(function(B){return S5(j,B)});if(I)return{graphicalItem:O,payload:I}}else if($==="RadialBar"){var L=(D.data||[]).find(function(B){return op(j,B)});if(L)return{graphicalItem:O,payload:L}}else if(xl(O,g)||yl(O,g)||Bi(O,g)){var U=P6({graphicalItem:O,activeTooltipItem:g,itemData:E.data}),T=E.activeIndex===void 0?U:E.activeIndex;return{graphicalItem:H(H({},O),{},{childIndex:T}),payload:Bi(O,g)?E.data[U]:O.props.data[U]}}}return null}},{key:"render",value:function(){var j=this;if(!Yf(this))return null;var _=this.props,y=_.children,g=_.className,b=_.width,N=_.height,O=_.style,D=_.compact,P=_.title,E=_.desc,$=Ng(_,L8),I=Ee($,!1);if(D)return M.createElement(ig,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},M.createElement(Oc,oi({},I,{width:b,height:N,title:P,desc:E}),this.renderClipPath(),Jf(y,this.renderMap)));if(this.props.accessibilityLayer){var L,U;I.tabIndex=(L=this.props.tabIndex)!==null&&L!==void 0?L:0,I.role=(U=this.props.role)!==null&&U!==void 0?U:"application",I.onKeyDown=function(B){j.accessibilityManager.keyboardEvent(B)},I.onFocus=function(){j.accessibilityManager.focus()}}var T=this.parseEventsOfWrapper();return M.createElement(ig,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},M.createElement("div",oi({className:Ce("recharts-wrapper",g),style:H({position:"relative",curs
262or:"default",width:b,height:N},O)},T,{ref:function(W){j.container=W}}),M.createElement(Oc,oi({},I,{width:b,height:N,title:P,desc:E,style:ez}),this.renderClipPath(),Jf(y,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(S.Component);return xe(v,"displayName",r),xe(v,"defaultProps",H({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},d)),xe(v,"getDerivedStateFromProps",function(x,p){var w=x.dataKey,j=x.data,_=x.children,y=x.width,g=x.height,b=x.layout,N=x.stackOffset,O=x.margin,D=p.dataStartIndex,P=p.dataEndIndex;if(p.updateId===void 0){var E=Ag(x);return H(H(H({},E),{},{updateId:0},m(H(H({props:x},E),{},{updateId:0}),p)),{},{prevDataKey:w,prevData:j,prevWidth:y,prevHeight:g,prevLayout:b,prevStackOffset:N,prevMargin:O,prevChildren:_})}if(w!==p.prevDataKey||j!==p.prevData||y!==p.prevWidth||g!==p.prevHeight||b!==p.prevLayout||N!==p.prevStackOffset||!Un(O,p.prevMargin)){var $=Ag(x),I={chartX:p.chartX,chartY:p.chartY,isTooltipActive:p.isTooltipActive},L=H(H({},Og(p,j,b)),{},{updateId:p.updateId+1}),U=H(H(H({},$),I),L);return H(H(H({},U),m(H({props:x},U),p)),{},{prevDataKey:w,prevData:j,prevWidth:y,prevHeight:g,prevLayout:b,prevStackOffset:N,prevMargin:O,prevChildren:_})}if(!Nc(_,p.prevChildren)){var T,B,W,ae,F=Pt(_,la),G=F&&(T=(B=F.props)===null||B===void 0?void 0:B.startIndex)!==null&&T!==void 0?T:D,re=F&&(W=(ae=F.props)===null||ae===void 0?void 0:ae.endIndex)!==null&&W!==void 0?W:P,R=G!==D||re!==P,te=!Ae(j),A=te&&!R?p.updateId:p.updateId+1;return H(H({updateId:A},m(H(H({props:x},p),{},{updateId:A,dataStartIndex:G,dataEndIndex:re}),p)),{},{prevChildren:_,dataStartIndex:G,dataEndIndex:re})}return null}),xe(v,"renderActiveDot",function(x,p,w){var j;return S.isValidElement(x)?j=S.cloneElement(x,p):Ne(x)?j=x(p):j=M.createElement(lf,p),M.createElement(Ge,{className:"recharts-active-dot",key:w},j)}),function(p){return M.createElement(v,p)}},uz=t0({chartName:"LineChart",GraphicalChild:is,axisComponents:[{axisType:"xAxis",AxisComp:ga},{axisType:"yAxis",AxisComp:xa}],formatAxisMap:yb}),dz=t0({chartName:"BarChart",GraphicalChild:Tn,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:ga},{axisType:"yAxis",AxisComp:xa}],formatAxisMap:yb});const fz=()=>{var f,d,h,m;const[e,t]=S.useState(null),[r,n]=S.useState([]),[i,s]=S.useState(!0),[o,l]=S.useState(null);S.useEffect(()=>{c()},[]);const c=async()=>{try{s(!0),l(null);const{data:v,error:x}=await V.rpc("get_dropped_domains_stats");if(x)throw x;const{data:p,error:w}=await V.rpc("get_processing_progress_over_time");if(w)throw w;t(v[0]||null),n(p||[])}catch(v){console.error("Error fetching dropped domains data:",v),l(v instanceof Error?v.message:"Failed to fetch data")}finally{s(!1)}};if(i)return a.jsx("div",{className:"space-y-6",children:a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[...Array(4)].map((v,x)=>a.jsx(q,{className:"bg-white border-slate-200",children:a.jsx(K,{className:"p-6",children:a.jsx("div",{className:"h-16 bg-slate-200 animate-pulse rounded"})})},x))})});if(o)return a.jsx(q,{className:"bg-white border-slate-200",children:a.jsx(K,{className:"p-6",children:a.jsxs("div",{className:"flex items-center text-red-600",children:[a.jsx(bc,{className:"h-5 w-5 mr-2"}),a.jsxs("span",{children:["Error loading dropped domains data: ",o]})]})})});const u=v=>v.map(x=>({...x,date:new Date(x.date_processed).toLocaleDateString("da-DK",{month:"short",day:"numeric"})}));return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[a.jsx(q,{className:"bg-white border-slate-200",children:a.jsx(K,{className:"p-6",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx(Yn,{className:"h-8 w-8 text-blue-600"}),a.jsxs("div",{className:"ml-4",children:[a.jsx("p",{className:"text-sm font-medium text-slate-600",children:"Total Processed"}),a.jsx("p",{className:"text-2xl font-bold text-slate-900",children:((f=e==null?void 0:e.total_processed)==null?void 0:f.toLocaleStr
262ing())||"0"})]})]})})}),a.jsx(q,{className:"bg-white border-slate-200",children:a.jsx(K,{className:"p-6",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx(yc,{className:"h-8 w-8 text-green-600"}),a.jsxs("div",{className:"ml-4",children:[a.jsx("p",{className:"text-sm font-medium text-slate-600",children:"Available"}),a.jsx("p",{className:"text-2xl font-bold text-slate-900",children:((d=e==null?void 0:e.total_available)==null?void 0:d.toLocaleString())||"0"}),a.jsxs("p",{className:"text-xs text-green-600",children:[(e==null?void 0:e.processing_rate)||0,"% availability rate"]})]})]})})}),a.jsx(q,{className:"bg-white border-slate-200",children:a.jsx(K,{className:"p-6",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx(bc,{className:"h-8 w-8 text-red-600"}),a.jsxs("div",{className:"ml-4",children:[a.jsx("p",{className:"text-sm font-medium text-slate-600",children:"Taken"}),a.jsx("p",{className:"text-2xl font-bold text-slate-900",children:((h=e==null?void 0:e.total_taken)==null?void 0:h.toLocaleString())||"0"})]})]})})}),a.jsx(q,{className:"bg-white border-slate-200",children:a.jsx(K,{className:"p-6",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx(Sr,{className:"h-8 w-8 text-purple-600"}),a.jsxs("div",{className:"ml-4",children:[a.jsx("p",{className:"text-sm font-medium text-slate-600",children:"Recent (24h)"}),a.jsx("p",{className:"text-2xl font-bold text-slate-900",children:((m=e==null?void 0:e.recent_processed)==null?void 0:m.toLocaleString())||"0"})]})]})})})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs(q,{className:"bg-white border-slate-200",children:[a.jsxs(se,{children:[a.jsxs(oe,{className:"flex items-center",children:[a.jsx(Er,{className:"h-5 w-5 mr-2"}),"Daily Processing (Last 30 Days)"]}),a.jsx(ge,{children:"Number of domains processed each day"})]}),a.jsx(K,{children:a.jsx("div",{className:"h-64",children:a.jsx(Xh,{width:"100%",height:"100%",children:a.jsxs(dz,{data:u(r),children:[a.jsx(Du,{strokeDasharray:"3 3"}),a.jsx(ga,{dataKey:"date"}),a.jsx(xa,{}),a.jsx(qt,{labelFormatter:v=>`Date: ${v}`,formatter:v=>[v.toLocaleString(),"Domains"]}),a.jsx(Tn,{dataKey:"domains_processed",fill:"#3b82f6"})]})})})})]}),a.jsxs(q,{className:"bg-white border-slate-200",children:[a.jsxs(se,{children:[a.jsxs(oe,{className:"flex items-center",children:[a.jsx(er,{className:"h-5 w-5 mr-2"}),"Cumulative Progress"]}),a.jsx(ge,{children:"Total domains processed over time"})]}),a.jsx(K,{children:a.jsx("div",{className:"h-64",children:a.jsx(Xh,{width:"100%",height:"100%",children:a.jsxs(uz,{data:u(r),children:[a.jsx(Du,{strokeDasharray:"3 3"}),a.jsx(ga,{dataKey:"date"}),a.jsx(xa,{}),a.jsx(qt,{labelFormatter:v=>`Date: ${v}`,formatter:v=>[v.toLocaleString(),"Total Domains"]}),a.jsx(is,{type:"monotone",dataKey:"cumulative_total",stroke:"#10b981",strokeWidth:2,dot:{fill:"#10b981"}})]})})})})]})]}),a.jsxs(q,{className:"bg-white border-slate-200",children:[a.jsx(se,{children:a.jsxs(oe,{className:"flex items-center",children:[a.jsx(Nn,{className:"h-5 w-5 mr-2"}),"Processing Timeline"]})}),a.jsx(K,{children:a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium text-slate-900 mb-2",children:"Oldest Domain"}),a.jsx("p",{className:"text-sm text-slate-600",children:e!=null&&e.oldest_domain_date?gn(new Date(e.oldest_domain_date),{addSuffix:!0}):"No data"})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium text-slate-900 mb-2",children:"Latest Domain"}),a.jsx("p",{className:"text-sm text-slate-600",children:e!=null&&e.newest_domain_date?gn(new Date(e.newest_domain_date),{addSuffix:!0}):"No data"})]})]})})]})]})},hz=()=>{const{dailyDropsStats:e,loading:t}=$t();if(t)return a.jsxs(q,{className:"bg-white border-slate-200",children:[a.jsxs(se,{children:[a.jsx(oe,{className:"text-slate-900",children:"Daily Drops Usage Statistics"}),a.jsx(ge,{children:"User engagement and activity metrics"})]}),a.jsx(K,{className:"space-y-4",children:Array.from({length:6}).map((n,i)=>a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsx(De,{className:"h-8 w-8 rounded"}),a.jsxs("div",{className:"space-y-2 flex-1",children:[a.jsx(De,{className:"h-4 w-32"}),a.jsx(De,{className:"h-6 w-20"})]})]},i))})]});const r=[{label:"Total Appraisals",value:(e==null?void 0:e.total_appraisals)||0,icon:ad,color:"text-blue-600",description:"Last 30 days on Daily Drops domains"},{label:"Unique Users",value:(e==null?void 0:e.unique_users)||0,icon:ft,color:"text-green-600",description:"Users who appraised Daily Drops domains"},{label:"Processing Sessions",value:(e==null?void 0:e.processing_sessions)||0,icon:Ts,color:"text-purple-600",description:"DNS processing runs"},{label:"Total Domains",value:(e==null?void 0:e.total_domains)||0,icon:H0,color:"text-orange-600",description:"Available in Daily Drops"},{label:"Avg Domain Length",value:(e==null?void 0:e.avg_domain_length)||0,icon:av,color:"text-indigo-600",description:"Average character count",isFloat:!0},{label:"Engagement Rate",value:(e==null?void 0:e.engagement_rate)||0,icon:er,color:"text-pink-600",description:"% of domains appraised",isPercentage:!0}];return a.jsxs("div",{className:"space-y-6",children:[a.jsxs(q,{className:"bg-white border-slate-200",children:[a.jsxs(se,{children:[a.jsxs(oe,{className:"text-slate-900 flex items-center",children:[a.jsx(Nn,{className:"h-5 w-5 mr-2"}),"Daily Drops Usage Statistics"]}),a.jsx(ge,{children:"User engagement and activity metrics (excluding [email protected])"})]}),a.jsx(K,{children:a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:r.map((n,i)=>{const s=n.icon;let o=n.value;return n.isFloat?o=Number(n.value).toFixed(1):n.isPercentage?o=`${Number(n.value).toFixed(1)}
262%`:o=Number(n.value).toLocaleString(),a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsx(s,{className:`h-8 w-8 ${n.color}`}),a.jsxs("div",{className:"flex-1",children:[a.jsx("p",{className:"text-sm font-medium text-slate-600",children:n.label}),a.jsx("p",{className:"text-2xl font-bold text-slate-900",children:o}),a.jsx("p",{className:"text-xs text-slate-500",children:n.description})]})]},i)})})})]}),a.jsxs(q,{className:"bg-white border-slate-200",children:[a.jsxs(se,{children:[a.jsx(oe,{className:"text-slate-900",children:"Recent Activity"}),a.jsx(ge,{children:"Activity breakdown for the last 7 days"})]}),a.jsx(K,{children:a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:"text-sm font-medium text-slate-600",children:"Today"}),a.jsxs("span",{className:"text-sm font-bold text-slate-900",children:[(e==null?void 0:e.appraisals_today)||0," appraisals"]})]}),a.jsx(gr,{value:((e==null?void 0:e.appraisals_today)||0)/Math.max(1,(e==null?void 0:e.max_daily_appraisals)||1)*100,className:"h-2"}),a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:"text-sm font-medium text-slate-600",children:"Yesterday"}),a.jsxs("span",{className:"text-sm font-bold text-slate-900",children:[(e==null?void 0:e.appraisals_yesterday)||0," appraisals"]})]}),a.jsx(gr,{value:((e==null?void 0:e.appraisals_yesterday)||0)/Math.max(1,(e==null?void 0:e.max_daily_appraisals)||1)*100,className:"h-2"})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:"text-sm font-medium text-slate-600",children:"Available Domains"}),a.jsx(Oe,{variant:"secondary",children:(e==null?void 0:e.available_domains)||0})]}),a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:"text-sm font-medium text-slate-600",children:"Taken Domains"}),a.jsx(Oe,{variant:"outline",children:(e==null?void 0:e.taken_domains)||0})]}),a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:"text-sm font-medium text-slate-600",children:"Processing Status"}),a.jsx(Oe,{variant:e!=null&&e.is_processing?"default":"secondary",children:e!=null&&e.is_processing?"Active":"Idle"})]})]})]})})]}),a.jsxs(q,{className:"bg-white border-slate-200",children:[a.jsxs(se,{children:[a.jsx(oe,{className:"text-slate-900",children:"Domain Length Preferences"}),a.jsx(ge,{children:"Most appraised domain lengths"})]}),a.jsx(K,{children:a.jsx("div",{className:"space-y-3",children:((e==null?void 0:e.domain_length_stats)||[]).map((n,i)=>a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(Oe,{variant:"outline",className:"w-16 justify-center",children:[n.length," chars"]}),a.jsxs("span",{className:"text-sm text-slate-600",children:[n.count," appraisals"]})]}),a.jsx(gr,{value:n.count/Math.max(1,(e==null?void 0:e.total_appraisals)||1)*100,className:"w-24 h-2"})]},i))})})]})]})},mz=()=>{const{customWordsToday:e,customWordsMonth:t,customWordsYear:r,loading:n}=$t(),i=(s,o)=>{const l=s.filter(u=>u.word_type==="prefix").slice(0,20),c=s.filter(u=>u.word_type==="suffix").slice(0,20);return a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs(q,{className:"bg-white border-slate-200",children:[a.jsxs(se,{children:[a.jsxs(oe,{className:"flex items-center gap-2 text-slate-900",children:[a.jsx(jc,{className:"h-5 w-5 text-blue-600"}),"Top ",o," Prefixes"]}),a.jsx(ge,{children:"Most used custom prefixes"})]}),a.jsx(K,{children:a.jsx("div",{className:"space-y-3",children:n?a.jsx("div",{className:"text-slate-600",children:"Loading..."}):l.map((u,f)=>a.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-slate-100 last:border-0",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-6 h-6 rounded-full bg-blue-100 text-blue-600 text-xs font-semibold flex items-center justify-center",children:f+1}),a.jsx("span",{className:"font-medium text-slate-900",children:u.word})]}),a.jsx("div",{className:"flex items-center gap-2",children:a.jsx(Oe,{variant:"secondary",className:"bg-blue-50 text-blue-700 border-blue-200",children:u.usage_count})})]},`${u.word}-${u.word_type}`))})})]}),a.jsxs(q,{className:"bg-white border-slate-200",children:[a.jsxs(se,{children:[a.jsxs(oe,{className:"flex items-center gap-2 text-slate-900",children:[a.jsx(av,{className:"h-5 w-5 text-green-600"}),"Top ",o," Suffixes"]}),a.jsx(ge,{children:"Most used custom suffixes"})]}),a.jsx(K,{children:a.jsx("div",{className:"space-y-3",children:n?a.jsx("div",{className:"text-slate-600",children:"Loading..."}):c.map((u,f)=>a.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-slate-100 last:border-0",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-6 h-6 rounded-full bg-green-100 text-green-600 text-xs font-semibold flex items-center justify-center",children:f+1}),a.jsx("span",{className:"font-medium text-slate-900",children:u.word})]}),a.jsx("div",{className:"flex items-center gap-2",children:a.jsx(Oe,{variant:"secondary",className:"bg-green-50 text-green-700 border-green-200",children:u.usage_count})})]},`${u.word}-${u.word_type}`))})})]})]})};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[a.jsx(q,{className:"bg-white border-slate-200",children:a.jsx(K,{className:"p-6",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx(Nn,{className:"h-8 w-8 text-blue-600"}),a.jsxs("div",{className:"ml-4",children:[a.jsx("p",{className:"text-sm font-medium text-slate-600",children:"Today's Usage"}),a.jsx("p",{className:"text-2xl font-bold text-slate-900",children:n?"-":e.reduce((s,o)=>
262s+o.usage_count,0).toLocaleString()})]})]})})}),a.jsx(q,{className:"bg-white border-slate-200",children:a.jsx(K,{className:"p-6",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx(er,{className:"h-8 w-8 text-green-600"}),a.jsxs("div",{className:"ml-4",children:[a.jsx("p",{className:"text-sm font-medium text-slate-600",children:"This Month"}),a.jsx("p",{className:"text-2xl font-bold text-slate-900",children:n?"-":t.reduce((s,o)=>s+o.usage_count,0).toLocaleString()})]})]})})}),a.jsx(q,{className:"bg-white border-slate-200",children:a.jsx(K,{className:"p-6",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx(jc,{className:"h-8 w-8 text-purple-600"}),a.jsxs("div",{className:"ml-4",children:[a.jsx("p",{className:"text-sm font-medium text-slate-600",children:"This Year"}),a.jsx("p",{className:"text-2xl font-bold text-slate-900",children:n?"-":r.reduce((s,o)=>s+o.usage_count,0).toLocaleString()})]})]})})})]}),a.jsxs(Sn,{defaultValue:"today",className:"space-y-6",children:[a.jsxs(Vr,{className:"bg-white border border-slate-200",children:[a.jsx(Ke,{value:"today",className:"data-[state=active]:bg-slate-900 data-[state=active]:text-white",children:"Today"}),a.jsx(Ke,{value:"month",className:"data-[state=active]:bg-slate-900 data-[state=active]:text-white",children:"This Month"}),a.jsx(Ke,{value:"year",className:"data-[state=active]:bg-slate-900 data-[state=active]:text-white",children:"This Year"})]}),a.jsx(ht,{value:"today",children:i(e,"Daily")}),a.jsx(ht,{value:"month",children:i(t,"Monthly")}),a.jsx(ht,{value:"year",children:i(r,"Yearly")})]})]})},pz=()=>{var s,o,l,c,u;const{dailyDropsStats:e,loading:t}=$t(),r=qi(),n=[{title:"Total Domains",value:t?"-":((s=e==null?void 0:e.total_domains)==null?void 0:s.toLocaleString())||"0",change:`${(e==null?void 0:e.available_domains)||0} available`,trend:"up",icon:Yn,color:"text-blue-600",bgColor:"bg-blue-100"},{title:"Total Appraisals",value:t?"-":((o=e==null?void 0:e.total_appraisals)==null?void 0:o.toLocaleString())||"0",change:`${(e==null?void 0:e.appraisals_today)||0} today`,trend:"up",icon:Sr,color:"text-green-600",bgColor:"bg-green-100"},{title:"Unique Users",value:t?"-":((l=e==null?void 0:e.unique_users)==null?void 0:l.toLocaleString())||"0",change:"Active appraisers",trend:"up",icon:ft,color:"text-purple-600",bgColor:"bg-purple-100"},{title:"Engagement Rate",value:t?"-":`${((c=e==null?void 0:e.engagement_rate)==null?void 0:c.toFixed(1))||"0.0"}%`,change:"Appraisals per domain",trend:"neutral",icon:er,color:"text-orange-600",bgColor:"bg-orange-100"}],i=[{label:"Processing Status",value:e!=null&&e.is_processing?"Active":"Idle",status:e!=null&&e.is_processing?"processing":"idle",icon:Ts},{label:"Avg Domain Length",value:`${((u=e==null?void 0:e.avg_domain_length)==null?void 0:u.toFixed(1))||"0.0"} chars`,status:"neutral",icon:Er},{label:"Today vs Yesterday",value:`${(((e==null?void 0:e.appraisals_today)||0)/Math.max((e==null?void 0:e.appraisals_yesterday)||1,1)*100).toFixed(0)}%`,status:((e==null?void 0:e.appraisals_today)||0)>=((e==null?void 0:e.appraisals_yesterday)||0)?"up":"down",icon:Nn}];return t?a.jsx("div",{className:"space-y-6",children:a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[...Array(4)].map((f,d)=>a.jsx(q,{children:a.jsxs(K,{className:"p-6",children:[a.jsx(De,{className:"h-8 w-8 rounded mb-4"}),a.jsx(De,{className:"h-4 w-24 mb-2"}),a.jsx(De,{className:"h-6 w-16"})]})},d))})}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center lg:justify-between",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl lg:text-3xl font-bold text-foreground",children:"Data Management"}),a.jsx("p",{className:"text-muted-foreground mt-1",children:"Domain data, analytics, and system metrics"})]}),a.jsx("div",{className:"flex items-center space-x-2 mt-4 lg:mt-0",children:a.jsxs(Oe,{variant:"secondary",className:e!=null&&e.is_processing?"bg-yellow-100 text-yellow-800":"bg-green-100 text-green-800",children:[a.jsx("div",{className:`w-2 h-2 rounded-full mr-2 ${e!=null&&e.is_processing?"bg-yellow-500":"bg-green-500"}`}),e!=null&&e.is_processing?"Processing":"Ready"]})})]}),a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:n.map(f=>{const d=f.icon;return a.jsx(q,{className:"hover:shadow-lg transition-shadow",children:a.jsx(K,{className:"p-6",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:`p-2 rounded-lg ${f.bgColor} mr-4`,children:a.jsx(d,{className:`h-5 w-5 ${f.color}`})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:f.title}),a.jsx("p",{className:"text-2xl font-bold text-foreground",children:f.value}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:f.change})]})]})})},f.title)})}),a.jsxs(q,{children:[a.jsxs(se,{children:[a.jsxs(oe,{className:"flex items-center",children:[a.jsx(Ts,{className:"h-5 w-5 mr-2 text-primary"}),"System Metrics"]}),a.jsx(ge,{children:"Real-time data processing status"})]}),a.jsx(K,{children:a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:i.map(f=>{const d=f.icon;return a.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-muted/50",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(d,{className:"h-4 w-4 text-muted-foreground"}),a.jsx("span",{className:"font-medium text-foreground",children:f.label})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("span",{className:"text-sm font-bold text-foreground",children:f.value}),f.status!=="neutral"&&a.jsx(Oe,{variant:"outline",className:f.status==="processing"?"bg-yellow-100 text-yellow-800":f.status==="up"?"bg-green-100 text-green-800":f.status==="down"?"bg-red-100 text-red-800":"bg-gray-100 text-gray-800",children:f.status})]})]},f.label)})})})]}),(e==null?void 0:e.domain_length_stats)&&e.domain_length_stats.length>0&&a.jsxs(q,{children:[a.jsxs(se,{children:[a.jsxs(oe,{className:"flex items-center",children:[a.jsx(Er,{className:"h-5 w-5 mr-2 text-primary"}),"Domain Length Distribution"]}),a.jsx(ge,{children:"Most common domain lengths in appraisals"})]}),a.jsx(K,{children:a.jsx("div",{className:"space-y-3",children:e.domain_length_stats.map((f,d)=>{const h=Math.max(...e.domain_length_stats.map(v=>v.count)),m=f.count/h*100;return a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("span",{className:"text-sm font-medium text-foreground",children:[f.length," characters"]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsxs("span",{className:"text-sm text-muted-foreground",children:[f.count," appraisals"]}),a.jsxs(Oe,{variant:"outline",className:"text-xs",children:["#",d+1]})]})]}),a.jsx("div",{className:"w-full bg-muted rounded-full h-2",children:a.jsx("div",{className:"bg-primary h-2 rounded-full transition-all duration-300",style:{width:`${m}%`}})})]},f.length)})})})]}),a.jsxs(Sn,{defaultValue:"domains",className:"space-y-6",children:[a.jsxs(Vr,{className:"grid w-full grid-cols-3",children:[a.jsxs(Ke,{value:"domains",className:"flex items-center",children:[a.jsx(Yn,{className:"h-4 w-4 mr-2"}),!r&&"Dropped"," Domains"]}),a.jsxs(Ke,{value:"dailydrops",className:"flex items-center",children:[a.jsx(Sr,{className:"h-4 w-4 mr-2"}),!r&&"Daily"," Drops"]}),a.jsxs(Ke,{value:"customwords",className:"flex items-center",children:[a.jsx(jc,{className:"h-4 w-4 mr-2"}),!r&&"Custom"," Words"]})]}),a.jsx(ht,{value:"domains",className:"space-y-6",children:a.jsx(fz,{})}),a.jsx(ht,{value:"dailydrops",className:"space-y-6",children:a.jsx(hz,{})}),a.jsx(ht,{value:"customwords",className:"space-y-6",children:a.jsx(mz,{})})]})]})},Je=S.forwardRef(({className:e,enableBrowserFeatures:t=!1,...r},n)=>
262a.jsx("textarea",{className:Qt("flex min-h-[80px] w-full rounded-input border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),autoComplete:t?"on":"off",autoCorrect:t?"on":"off",spellCheck:t,ref:n,...r}));Je.displayName="Textarea";const sc=e=>e?new Date(e).getHours():23,oc=e=>e?new Date(e).getMinutes():59,lc=(e,t,r)=>{if(!e)return;const n=new Date(e);return n.setHours(t,r,0,0),n.toISOString()},Tg=({formData:e,setFormData:t,hasExpiration:r,setHasExpiration:n,handleTierChange:i})=>a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Z,{htmlFor:"title",children:"Banner Title"}),a.jsx(Q,{id:"title",value:e.title,onChange:s=>t(o=>({...o,title:s.target.value})),placeholder:"e.g., FREE Tier Promotion"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Nr,{id:"enabled",checked:e.enabled,onCheckedChange:s=>t(o=>({...o,enabled:s}))}),a.jsx(Z,{htmlFor:"enabled",children:"Enable Banner"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Z,{htmlFor:"message",children:"Banner Message"}),a.jsx(Je,{id:"message",value:e.message,onChange:s=>t(o=>({...o,message:s.target.value})),placeholder:"Enter banner message...",rows:3}),e.type==="dynamic_hot_auction"&&a.jsxs("div",{className:"flex items-start gap-2 p-3 bg-blue-50 border border-blue-200 rounded-md",children:[a.jsx(q0,{className:"h-4 w-4 text-blue-600 mt-0.5 flex-shrink-0"}),a.jsxs("p",{className:"text-xs text-blue-800",children:["Use ",a.jsx("code",{className:"px-1 py-0.5 bg-blue-100 rounded font-mono",children:"{domain}"}),' in your message to automatically insert the next expiring hot auction domain. Example: "Check out ',"{domain}",` - it's up for grabs!"`]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Z,{htmlFor:"type",children:"Banner Type"}),a.jsxs(Gn,{value:e.type||"static",onValueChange:s=>{t(o=>({...o,type:s,link_url:s==="dynamic_hot_auction"?"https://www.dynadot.com/market/auction/{domain}?rsc=domaindingo":o.link_url}))},children:[a.jsx(qn,{children:a.jsx(Vn,{placeholder:"Select banner type"})}),a.jsxs(Kn,{children:[a.jsx(vt,{value:"static",children:"Static (Normal Text)"}),a.jsx(vt,{value:"dynamic_hot_auction",children:"Dynamic (Auto-updates with Hot Auction)"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Z,{children:"Target User Tiers"}),a.jsx("div",{className:"flex flex-wrap gap-4",children:["guest","free","plus","pro","platinum"].map(s=>{var o;return a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Xn,{id:s,checked:(o=e.target_tiers)==null?void 0:o.includes(s),onCheckedChange:l=>i(s,l)}),a.jsx(Z,{htmlFor:s,className:"capitalize",children:s})]},s)})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Nr,{id:"hasExpiration",checked:r,onCheckedChange:s=>{n(s),s||t(o=>({...o,expires_at:void 0}))}}),a.jsx(Z,{htmlFor:"hasExpiration",children:"Set Expiration Date"})]}),r&&a.jsxs("div",{className:"space-y-2",children:[a.jsx(Z,{children:"Expiration Date & Time"}),a.jsxs(T0,{children:[a.jsx(E0,{asChild:!0,children:a.jsxs(z,{variant:"outline",className:Qt("w-full justify-start text-left font-normal",!e.expires_at&&"text-muted-foreground"),children:[a.jsx(Nn,{className:"mr-2 h-4 w-4"}),e.expires_at?ci(new Date(e.expires_at),"PPP 'at' HH:mm"):a.jsx("span",{children:"Pick a date and time"})]})}),a.jsx(C0,{className:"w-auto p-0",align:"start",children:a.jsx(W0,{mode:"single",selected:e.expires_at?new Date(e.expires_at):void 0,onSelect:s=>{const o=sc(e.expires_at),l=oc(e.expires_at);t(c=>({...c,expires_at:lc(s,o,l)}))},disabled:s=>s<new Date,initialFocus:!0,className:"pointer-events-auto"})})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[a.jsxs("div",{children:[a.jsx(Z,{htmlFor:"hours",className:"text-xs",children:"Hours (0-23)"}),a.jsx(Q,{id:"hours",type:"number",min:"0",max:"23",value:sc(e.expires_at),onChange:s=>{const o=Math.max(0,Math.min(23,parseInt(s.target.value)||0)),l=oc(e.expires_at),c=e.expires_at?new Date(e.expires_at):new Date;t(u=>({...u,expires_at:lc(c,o,l)}))}})]}),a.jsxs("div",{children:[a.jsx(Z,{htmlFor:"minutes",className:"text-xs",children:"Minutes (0-59)"}),a.jsx(Q,{id:"minutes",type:"number",min:"0",max:"59",value:oc(e.expires_at),onChange:s=>{const o=Math.max(0,Math.min(59,parseInt(s.target.value)||0)),l=sc(e.expires_at),c=e.expires_at?new Date(e.expires_at):new Date;t(u=>({...u,expires_at:lc(c,l,o)}))}})]})]})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsxs(Z,{htmlFor:"link_url",children:["Link URL ",e.type==="dynamic_hot_auction"?"(Auto-generated)":"(optional)"]}),a.jsx(Q,{id:"link_url",value:e.link_url,onChange:s=>t(o=>({...o,link_url:s.target.value})),placeholder:"/pricing",disabled:e.type==="dynamic_hot_auction",className:e.type==="dynamic_hot_auction"?"bg-muted cursor-not-allowed":""}),e.type==="dynamic_hot_auction"&&a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Link automatically set to Dynadot auction page with ","{domain}"," placeholder"]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Z,{htmlFor:"link_text",children:"Link Text (optional)"}),a.jsx(Q,{id:"link_text",value:e.link_text,onChange:s=>t(o=>({...o,link_text:s.target.value})),placeholder:"Learn More"})]})]}),e.link_url&&a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Nr,{id:"link_target",checked:e.link_target==="_blank",onCheckedChange:s=>t(o=>({...o,link_target:s?"_blank":"_self"}))}),a.jsx(Z,{htmlFor:"link_target",children:"Åbn link i nyt vindue"})]}),e.enabled&&e.message&&a.jsxs("div",{className:"space-y-2",children:[a.jsx(Z,{children:"Preview"}),a.jsx("div",{className:"bg-gradient-to-r from-blue-600 via-purple-600 to-indigo-600 text-white py-3 px-4 text-center shadow-sm rounded-md",children:a.jsxs("p",{className:"text-sm font-medium",children:[e.type==="dynamic_hot_auction"?e.message.replace("{domain}","example.com"):e.message," ",e.link_url&&e.link_text&&a.jsx("span",{className:"underline font-bold hover:text-yellow-200 transition-colors cursor-pointer",children:e.link_text})]})})]})]}),gz=()=>{const{bannerConfigs:e,loading:t,createBannerConfig:r,updateBannerConfig:n,deleteBannerConfig:i,refetch:s}=P0(),{toast:o}=_n(),[l,c]=S.useState(!1),[u,f]=S.useState(null),[d,h]=S.useState(!1),[m,v]=S.useState(!1),[x,p]=S.useState({title:"",enabled:!0,message:"",target_tiers:["free"],link_url:"",link_text:"",link_target:"_self",expires_at:void 0,type:"static"}),[w,j]=S.useState(!1),_=()=>{p({title:"",enabled:!0,message:"",target_tiers:["free"],link_url:"",link_text:"",link_target:"_self",expires_at:void 0,type:"static"}),j(!1),f(null)},y=()=>{_(),h(!0)},g=P=>{f(P),p({title:P.title||"",enabled:P.enabled,message:P.message,target_tiers:P.target_tiers,link_url:P.link_url||"",link_text:P.link_text||"",link_target:P.link_target||"_self",expires_at:P.expires_at}),j(!!P.expires_at),v(!0)},b=async()=>{var P;if(!((P=x.message)!=null&&P.trim())){o({title:"Error",description:"Banner message is required",variant:"destructive"});return}c(!0);try{const E={...x,title:x.title||`Banner ${Date.now()}`,expires_at:w?x.expires_at:void 0};u?(await n(u.id,E),o({title:"Success",description:"Banner updated successfully"}),v(!1)):(await r(E),o({title:"Success",description:"Banner created successfully"}),h(!1)),_()}catch{o({title:"Error",description:"Failed to save banner",variant:"destructive"})}finally{c(!1)}},N=async P=>{try{await i(P),o({title:"Success",description:"Banner deleted successfully"})}catch{o({title:"Error",description:"Failed to delete banner",variant:"destructive"})}},O=async P=>{try{await n(P.id,{enabled:!P.enabled}),o({title:"Success",description:`Banner ${P.enabled?"disabled":"enabled"} successfully`})}catch{o({title:"Error",description:"Failed to update banner status",variant:"destructive"})}},D=(P,E)=>{p($=>({...$,target_tiers:E?[...$.target_tiers||[],P]:($.target_tiers||[]).filter(I=>I!==P)}))};return t?a.jsx("div",{className:"flex items-center justify-center py-8",children:a.jsx(Se,{className:"h-8 w-8 animate-spin"})}):a.jsx("div",{className:"space-y-6",children:a.jsxs(q,{children:[a.jsx(se,{children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(oe,{children:"Banner Management"}),a.jsxs(br,{open:d,onOpenChange:h,children:[a.jsx(un,{asChild:!0,children:a.jsxs(z,{onClick:y,children:[a.jsx(qr,{className:"mr-2 h-4 w-4"}),"Create Banner"]})}),a.jsxs(jr,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[a.jsx(wr,{children:a.jsx(_r,{children:"Create New Banner"})}),a.jsx(Tg,{formData:x,setFormData:p,hasExpiration:w,setHasExpiration:j,handleTierChange:D}),a.jsxs("div",{className:"flex gap-2 pt-4",children:[a.jsx(z,{onClick:b,disabled:l,className:"flex-1",children:l?a.jsxs(a.Fragment,{children:[a.jsx(Se,{className:"mr-2 h-4 w-4 animate-spin"}),"Creating..."]}):"Create Banner"}),a.jsx(z,{variant:"outline",onClick:()=>h(!1),children:"Cancel"})]})]})]})]})}),a.jsx(K,{children:e.length===0?a.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[a.jsx("p",{children:"No banners created yet."}),a.jsx("p",{className:"text-sm mt-2",children:"Create your first banner to get started."})]}):a.jsx("div",{className:"space-y-4",children:e.map(P=>a.jsx(q,{className:Qt("border-l-4 transition-colors",P.enabled?"border-l-green-500":"border-l-gray-300"),children:a.jsx(K,{className:"pt-6",children:a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx("h3",{className:"font-semibold",children:P.title||"Untitled Banner"}),a.jsx(Oe,{variant:P.enabled?"default":"secondary",children:P.enabled?"Active":"Inactive"}),P.expires_at&&a.jsxs(Oe,{variant:"outline",className:"text-xs",children:["Expires ",ci(new Date(P.expires_at),"MMM d, yyyy 'at' HH:mm")]})]}),a.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:P.message}),a.jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:P.target_tiers.map(E=>a.jsx(Oe,{variant:"outline",className:"text-xs capitalize",children:E},E))}),P.link_url&&a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Link: ",P.link_text||"Click here"," → ",P.link_url]})]}),a.jsxs("div",{className:"flex items-center gap-2 ml-4",children:[a.jsx(z,{variant:"ghost",size:"sm",onClick:()=>O(P),children:P.enabled?a.jsx(Q0,{className:"h-4 w-4"}
262):a.jsx(ad,{className:"h-4 w-4"})}),a.jsxs(br,{open:m,onOpenChange:v,children:[a.jsx(un,{asChild:!0,children:a.jsx(z,{variant:"ghost",size:"sm",onClick:()=>g(P),children:a.jsx(uj,{className:"h-4 w-4"})})}),a.jsxs(jr,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[a.jsx(wr,{children:a.jsx(_r,{children:"Edit Banner"})}),a.jsx(Tg,{formData:x,setFormData:p,hasExpiration:w,setHasExpiration:j,handleTierChange:D}),a.jsxs("div",{className:"flex gap-2 pt-4",children:[a.jsx(z,{onClick:b,disabled:l,className:"flex-1",children:l?a.jsxs(a.Fragment,{children:[a.jsx(Se,{className:"mr-2 h-4 w-4 animate-spin"}),"Updating..."]}):"Update Banner"}),a.jsx(z,{variant:"outline",onClick:()=>v(!1),children:"Cancel"})]})]})]}),a.jsxs(Kg,{children:[a.jsx(G0,{asChild:!0,children:a.jsx(z,{variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",children:a.jsx(Cr,{className:"h-4 w-4"})})}),a.jsxs(Xg,{children:[a.jsxs(Yg,{children:[a.jsx(Zg,{children:"Delete Banner"}),a.jsxs(Jg,{children:['Are you sure you want to delete "',P.title||"this banner",'"? This action cannot be undone.']})]}),a.jsxs(Qg,{children:[a.jsx(ev,{children:"Cancel"}),a.jsx(tv,{onClick:()=>N(P.id),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})]})]})]})})},P.id))})})]})})},cc=async(e,t="premium_drops",r)=>{try{const{data:n,error:i}=await V.functions.invoke("telegram-notify",{body:{domains:e,type:t,customHtml:r}});return i?(console.error("Error sending Telegram notifications:",i),{success:!1,error:i.message}):(console.log(`Telegram notifications sent to ${n.sent}/${n.total} subscribers`),{success:!0,sent:n.sent,total:n.total})}catch(n){return console.error("Error calling telegram-notify function:",n),{success:!1,error:n.message}}};/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */const{entries:r0,setPrototypeOf:Eg,isFrozen:vz,getPrototypeOf:xz,getOwnPropertyDescriptor:yz}=Object;let{freeze:yt,seal:Ut,create:Ku}=Object,{apply:Xu,construct:Yu}=typeof Reflect<"u"&&Reflect;yt||(yt=function(t){return t});Ut||(Ut=function(t){return t});Xu||(Xu=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),s=2;s<n;s++)i[s-2]=arguments[s];return t.apply(r,i)});Yu||(Yu=function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return new t(...n)});const Os=bt(Array.prototype.forEach),bz=bt(Array.prototype.lastIndexOf),Cg=bt(Array.prototype.pop),Ka=bt(Array.prototype.push),jz=bt(Array.prototype.splice),Ps=bt(String.prototype.toLowerCase),uc=bt(String.prototype.toString),dc=bt(String.prototype.match),Xa=bt(String.prototype.replace),wz=bt(String.prototype.indexOf),_z=bt(String.prototype.trim),Gt=bt(Object.prototype.hasOwnProperty),gt=bt(RegExp.prototype.test),Ya=Nz(TypeError);function bt(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return Xu(e,t,n)}}function Nz(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Yu(e,r)}}function _e(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ps;Eg&&Eg(e,null);let n=t.length;for(;n--;){let i=t[n];if(typeof i=="string"){const s=r(i);s!==i&&(vz(t)||(t[n]=s),i=s)}e[i]=!0}return e}function Sz(e){for(let t=0;t<e.length;t++)Gt(e,t)||(e[t]=null);return e}function ar(e){const t=Ku(null);for(const[r,n]of r0(e))Gt(e,r)&&(Array.isArray(n)?t[r]=Sz(n):n&&typeof n=="object"&&n.constructor===Object?t[r]=ar(n):t[r]=n);return t}function Za(e,t){for(;e!==null;){const n=yz(e,t);if(n){if(n.get)return bt(n.get);if(typeof n.value=="function")return bt(n.value)}e=xz(e)}function r(){return null}return r}const $g=yt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),fc=yt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),hc=yt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Oz=yt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),mc=yt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Az=yt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),kg=yt(["#text"]),Mg=yt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","
262spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),pc=yt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Ig=yt(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),As=yt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Pz=Ut(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Tz=Ut(/<%[\w\W]*|[\w\W]*%>/gm),Ez=Ut(/\$\{[\w\W]*/gm),Cz=Ut(/^data-[\-\w.\u00B7-\uFFFF]+$/),$z=Ut(/^aria-[\-\w]+$/),n0=Ut(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),kz=Ut(/^(?:\w+script|data):/i),Mz=Ut(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),a0=Ut(/^html$/i),Iz=Ut(/^[a-z][.\w]*(-[.\w]+)+$/i);var Dg=Object.freeze({__proto__:null,ARIA_ATTR:$z,ATTR_WHITESPACE:Mz,CUSTOM_ELEMENT:Iz,DATA_ATTR:Cz,DOCTYPE_NAME:a0,ERB_EXPR:Tz,IS_ALLOWED_URI:n0,IS_SCRIPT_OR_DATA:kz,MUSTACHE_EXPR:Pz,TMPLIT_EXPR:Ez});const Ja={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Dz=function(){return typeof window>"u"?null:window},Lz=function(t,r){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let n=null;
vendor: 12,673 bytes, line 262
262const i="data-tt-policy-suffix";r&&r.hasAttribute(i)&&(n=r.getAttribute(i));const s="dompurify"+(n?"#"+n:"");try{return t.createPolicy(s,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},Lg=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function i0(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Dz();const t=pe=>i0(pe);if(t.version="3.3.1",t.removed=[],!e||!e.document||e.document.nodeType!==Ja.document||!e.Element)return t.isSupported=!1,t;let{document:r}=e;const n=r,i=n.currentScript,{DocumentFragment:s,HTMLTemplateElement:o,Node:l,Element:c,NodeFilter:u,NamedNodeMap:f=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:h,trustedTypes:m}=e,v=c.prototype,x=Za(v,"cloneNode"),p=Za(v,"remove"),w=Za(v,"nextSibling"),j=Za(v,"childNodes"),_=Za(v,"parentNode");if(typeof o=="function"){const pe=r.createElement("template");pe.content&&pe.content.ownerDocument&&(r=pe.content.ownerDocument)}let y,g="";const{implementation:b,createNodeIterator:N,createDocumentFragment:O,getElementsByTagName:D}=r,{importNode:P}=n;let E=Lg();t.isSupported=typeof r0=="function"&&typeof _=="function"&&b&&b.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:$,ERB_EXPR:I,TMPLIT_EXPR:L,DATA_ATTR:U,ARIA_ATTR:T,IS_SCRIPT_OR_DATA:B,ATTR_WHITESPACE:W,CUSTOM_ELEMENT:ae}=Dg;let{IS_ALLOWED_URI:F}=Dg,G=null;const re=_e({},[...$g,...fc,...hc,...mc,...kg]);let R=null;const te=_e({},[...Mg,...pc,...Ig,...As]);let A=Object.seal(Ku(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),X=null,le=null;const he=Object.seal(Ku(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let J=!0,me=!0,ve=!1,k=!0,ne=!1,Y=!0,ue=!1,ye=!1,Te=!1,He=!1,st=!1,jt=!1,mt=!0,rr=!1;const Qr="user-content-";let ur=!0,En=!1,Br={},kt=null;const Ia=_e({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ss=null;const os=_e({},["audio","video","img","source","image","track"]);let Da=null;const ls=_e({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),we="http://www.w3.org/1998/Math/MathML",ot="http://www.w3.org/2000/svg",dr="http://www.w3.org/1999/xhtml";let Cn=dr,Ol=!1,Al=null;const u0=_e({},[we,ot,dr],uc);let cs=_e({},["mi","mo","mn","ms","mtext"]),us=_e({},["annotation-xml"]);const d0=_e({},["title","style","font","a","script"]);let La=null;const f0=["application/xhtml+xml","text/html"],h0="text/html";let Ye=null,$n=null;const m0=r.createElement("form"),xf=function(C){return C instanceof RegExp||C instanceof Function},Pl=function(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!($n&&$n===C)){if((!C||typeof C!="object")&&(C={}),C=ar(C),La=f0.indexOf(C.PARSER_MEDIA_TYPE)===-1?h0:C.PARSER_MEDIA_TYPE,Ye=La==="application/xhtml+xml"?uc:Ps,G=Gt(C,"ALLOWED_TAGS")?_e({},C.ALLOWED_TAGS,Ye):re,R=Gt(C,"ALLOWED_ATTR")?_e({},C.ALLOWED_ATTR,Ye):te,Al=Gt(C,"ALLOWED_NAMESPACES")?_e({},C.ALLOWED_NAMESPACES,uc):u0,Da=Gt(C,"ADD_URI_SAFE_ATTR")?_e(ar(ls),C.ADD_URI_SAFE_ATTR,Ye):ls,ss=Gt(C,"ADD_DATA_URI_TAGS")?_e(ar(os),C.ADD_DATA_URI_TAGS,Ye):os,kt=Gt(C,"FORBID_CONTENTS")?_e({},C.FORBID_CONTENTS,Ye):Ia,X=Gt(C,"FORBID_TAGS")?_e({},C.FORBID_TAGS,Ye):ar({}),le=Gt(C,"FORBID_ATTR")?_e({},C.FORBID_ATTR,Ye):ar({}),Br=Gt(C,"USE_PROFILES")?C.USE_PROFILES:!1,J=C.ALLOW_ARIA_ATTR!==!1,me=C.ALLOW_DATA_ATTR!==!1,ve=C.ALLOW_UNKNOWN_PROTOCOLS||!1,k=C.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ne=C.SAFE_FOR_TEMPLATES||!1,Y=C.SAFE_FOR_XML!==!1,ue=C.WHOLE_DOCUMENT||!1,He=C.RETURN_DOM||!1,st=C.RETURN_DOM_FRAGMENT||!1,jt=C.RETURN_TRUSTED_TYPE||!1,Te=C.FORCE_BODY||!1,mt=C.SANITIZE_DOM!==!1,rr=C.SANITIZE_NAMED_PROPS||!1,ur=C.KEEP_CONTENT!==!1,En=C.IN_PLACE||!1,F=C.ALLOWED_URI_REGEXP||n0,Cn=C.NAMESPACE||dr,cs=C.MATHML_TEXT_INTEGRATION_POINTS||cs,us=C.HTML_INTEGRATION_POINTS||us,A=C.CUSTOM_ELEMENT_HANDLING||{},C.CUSTOM_ELEMENT_HANDLING&&xf(C.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(A.tagNameCheck=C.CUSTOM_ELEMENT_HANDLING.tagNameCheck),C.CUSTOM_ELEMENT_HANDLING&&xf(C.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(A.attributeNameCheck=C.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),C.CUSTOM_ELEMENT_HANDLING&&typeof C.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(A.allowCustomizedBuiltInElements=C.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ne&&(me=!1),st&&(He=!0),Br&&(G=_e({},kg),R=[],Br.html===!0&&(_e(G,$g),_e(R,Mg)),Br.svg===!0&&(_e(G,fc),_e(R,pc),_e(R,As)),Br.svgFilters===!0&&(_e(G,hc),_e(R,pc),_e(R,As)),Br.mathMl===!0&&(_e(G,mc),_e(R,Ig),_e(R,As))),C.ADD_TAGS&&(typeof C.ADD_TAGS=="function"?he.tagCheck=C.ADD_TAGS:(G===re&&(G=ar(G)),_e(G,C.ADD_TAGS,Ye))),C.ADD_ATTR&&(typeof C.ADD_ATTR=="function"?he.attributeCheck=C.ADD_ATTR:(R===te&&(R=ar(R)),_e(R,C.ADD_ATTR,Ye))),C.ADD_URI_SAFE_ATTR&&_e(Da,C.ADD_URI_SAFE_ATTR,Ye),C.FORBID_CONTENTS&&(kt===Ia&&(kt=ar(kt)),_e(kt,C.FORBID_CONTENTS,Ye)),C.ADD_FORBID_CONTENTS&&(kt===Ia&&(kt=ar(kt)),_e(kt,C.ADD_FORBID_CONTENTS,Ye)),ur&&(G["#text"]=!0),ue&&_e(G,["html","head","body"]),G.table&&(_e(G,["tbody"]),delete X.tbody),C.TRUSTED_TYPES_POLICY){if(typeof C.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ya('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof C.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ya('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');y=C.TRUSTED_TYPES_POLICY,g=y.createHTML("")}else y===void 0&&(y=Lz(m,i)),y!==null&&typeof g=="string"&&(g=y.createHTML(""));yt&&yt(C),$n=C}},yf=_e({},[...fc,...hc,...Oz]),bf=_e({},[...mc,...Az]),p0=function(C){let ee=_(C);(!ee||!ee.tagName)&&(ee={namespaceURI:Cn,tagName:"template"});const fe=Ps(C.tagName),Ue=Ps(ee.tagName);return Al[C.namespaceURI]?C.namespaceURI===ot?ee.namespaceURI===dr?fe==="svg":ee.namespaceURI===we?fe==="svg"&&(Ue==="annotation-xml"||cs[Ue]):!!yf[fe]:C.namespaceURI===we?ee.namespaceURI===dr?fe==="math":ee.namespaceURI===ot?fe==="math"&&us[Ue]:!!bf[fe]:C.namespaceURI===dr?ee.namespaceURI===ot&&!us[Ue]||ee.namespaceURI===we&&!cs[Ue]?!1:!bf[fe]&&(d0[fe]||!yf[fe]):!!(La==="application/xhtml+xml"&&Al[C.namespaceURI]):!1},nr=function(C){Ka(t.removed,{element:C});try{_(C).removeChild(C)}catch{p(C)}},en=function(C,ee){try{Ka(t.removed,{attribute:ee.getAttributeNode(C),from:ee})}catch{Ka(t.removed,{attribute:null,from:ee})}if(ee.removeAttribute(C),C==="is")if(He||st)try{nr(ee)}catch{}else try{ee.setAttribute(C,"")}catch{}},jf=function(C){let ee=null,fe=null;if(Te)C="<remove></remove>"+C;else{const qe=dc(C,/^[\r\n\t ]+/);fe=qe&&qe[0]}La==="application/xhtml+xml"&&Cn===dr&&(C='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+C+"</body></html>");const Ue=y?y.createHTML(C):C;if(Cn===dr)try{ee=new h().parseFromString(Ue,La)}catch{}if(!ee||!ee.documentElement){ee=b.createDocument(Cn,"template",null);try{ee.documentElement.innerHTML=Ol?g:Ue}catch{}}const lt=ee.body||ee.documentElement;return C&&fe&&lt.insertBefore(r.createTextNode(fe),lt.childNodes[0]||null),Cn===dr?D.call(ee,ue?"html":"body")[0]:ue?ee.documentElement:lt},wf=function(C){return N.call(C.ownerDocument||C,C,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Tl=function(C){return C instanceof d&&(typeof C.nodeName!="string"||typeof C.textContent!="string"||typeof C.removeChild!="function"||!(C.attributes instanceof f)||typeof C.removeAttribute!="function"||typeof C.setAttribute!="function"||typeof C.namespaceURI!="string"||typeof C.insertBefore!="function"||typeof C.hasChildNodes!="function")},_f=function(C){return typeof l=="function"&&C instanceof l};function fr(pe,C,ee){Os(pe,fe=>{fe.call(t,C,ee,$n)})}const Nf=function(C){let ee=null;if(fr(E.beforeSanitizeElements,C,null),Tl(C))return nr(C),!0;const fe=Ye(C.nodeName);if(fr(E.uponSanitizeElement,C,{tagName:fe,allowedTags:G}),Y&&C.hasChildNodes()&&!_f(C.firstElementChild)&&gt(/<[/\w!]/g,C.innerHTML)&&gt(/<[/\w!]/g,C.textContent)||C.nodeType===Ja.progressingInstruction||Y&&C.nodeType===Ja.comment&&gt(/<[/\w]/g,C.data))return nr(C),!0;if(!(he.tagCheck instanceof Function&&he.tagCheck(fe))&&(!G[fe]||X[fe])){if(!X[fe]&&Of(fe)&&(A.tagNameCheck instanceof RegExp&&gt(A.tagNameCheck,fe)||A.tagNameCheck instanceof Function&&A.tagNameCheck(fe)))return!1;if(ur&&!kt[fe]){const Ue=_(C)||C.parentNode,lt=j(C)||C.childNodes;if(lt&&Ue){const qe=lt.length;for(let wt=qe-1;wt>=0;--wt){const hr=x(lt[wt],!0);hr.__removalCount=(C.__removalCount||0)+1,Ue.insertBefore(hr,w(C))}}}return nr(C),!0}return C instanceof c&&!p0(C)||(fe==="noscript"||fe==="noembed"||fe==="noframes")&&gt(/<\/no(script|embed|frames)/i,C.innerHTML)?(nr(C),!0):(ne&&C.nodeType===Ja.text&&(ee=C.textContent,Os([$,I,L],Ue=>{ee=Xa(ee,Ue," ")}),C.textContent!==ee&&(Ka(t.removed,{element:C.cloneNode()}),C.textContent=ee)),fr(E.afterSanitizeElements,C,null),!1)},Sf=function(C,ee,fe){if(mt&&(ee==="id"||ee==="name")&&(fe in r||fe in m0))return!1;if(!(me&&!le[ee]&&gt(U,ee))){if(!(J&&gt(T,ee))){if(!(he.attributeCheck instanceof Function&&he.attributeCheck(ee,C))){if(!R[ee]||le[ee]){if(!(Of(C)&&(A.tagNameCheck instanceof RegExp&&gt(A.tagNameCheck,C)||A.tagNameCheck instanceof Function&&A.tagNameCheck(C))&&(A.attributeNameCheck instanceof RegExp&&gt(A.attributeNameCheck,ee)||A.attributeNameCheck instanceof Function&&A.attributeNameCheck(ee,C))||ee==="is"&&A.allowCustomizedBuiltInElements&&(A.tagNameCheck instanceof RegExp&&gt(A.tagNameCheck,fe)||A.tagNameCheck instanceof Function&&A.tagNameCheck(fe))))return!1}else if(!Da[ee]){if(!gt(F,Xa(fe,W,""))){if(!((ee==="src"||ee==="xlink:href"||ee==="href")&&C!=="script"&&wz(fe,"data:")===0&&ss[C])){if(!(ve&&!gt(B,Xa(fe,W,"")))){if(fe)return!1}}}}}}}return!0},Of=function(C){return C!=="annotation-xml"&&dc(C,ae)},Af=function(C){fr(E.beforeSanitizeAttributes,C,null);const{attributes:ee}=C;if(!ee||Tl(C))return;const fe={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:R,forceKeepAttr:void 0};let Ue=ee.length;for(;Ue--;){const lt=ee[Ue],{name:qe,namespaceURI:wt,value:hr}=lt,kn=Ye(qe),El=hr;let nt=qe==="value"?El:_z(El);if(fe.attrName=kn,fe.attrValue=nt,fe.keepAttr=!0,fe.forceKeepAttr=void 0,fr(E.uponSanitizeAttribute,C,fe),nt=fe.attrValue,rr&&(kn==="id"||kn==="name")&&(en(qe,C),nt=Qr+nt),Y&&gt(/((--!?|])>)|<\/(style|title|textarea)/i,nt)){en(qe,C);continue}if(kn==="attributename"&&dc(nt,"href")){en(qe,C);continue}if(fe.forceKeepAttr)continue;if(!fe.keepAttr){en(qe,C);continue}if(!k&&gt(/\/>/i,nt)){en(qe,C);continue}ne&&Os([$,I,L],Tf=>{nt=Xa(nt,Tf," ")});const Pf=Ye(C.nodeName);if(!Sf(Pf,kn,nt)){en(qe,C);continue}if(y&&typeof m=="object"&&typeof m.getAttributeType=="function"&&!wt)switch(m.getAttributeType(Pf,kn)){case"TrustedHTML":{nt=y.createHTML(nt);break}case"TrustedScriptURL":{nt=y.createScriptURL(nt);break}}if(nt!==El)try{wt?C.setAttributeNS(wt,qe,nt):C.setAttribute(qe,nt),Tl(C)?nr(C):Cg(t.removed)}catch{en(qe,C)}}fr(E.afterSanitizeAttributes,C,null)},g0=function pe(C){let ee=null;const fe=wf(C);for(fr(E.beforeSanitizeShadowDOM,C,null);ee=fe.nextNode();)fr(E.uponSanitizeShadowNode,ee,null),Nf(ee),Af(ee),ee.content instanceof s&&pe(ee.content);fr(E.afterSanitizeShadowDOM,C,null)};return t.sanitize=function(pe){let C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ee=null,fe=null,Ue=null,lt=null;if(Ol=!pe,Ol&&(pe="<!-->"),typeof pe!="string"&&!_f(pe))if(typeof pe.toString=="function"){if(pe=pe.toString(),typeof pe!="string")throw Ya("dirty is not a string, aborting")}else throw Ya("toString is not a function");if(!t.isSupported)return pe;if(ye||Pl(C),t.removed=[],typeof pe=="string"&&(En=!1),En){if(pe.nodeName){const hr=Ye(pe.nodeName);if(!G[hr]||X[hr])throw Ya("root node is forbidden and cannot be sanitized in-place")}}else if(pe instanceof l)ee=jf("<!---->"),fe=ee.ownerDocument.importNode(pe,!0),fe.nodeType===Ja.element&&fe.nodeName==="BODY"||fe.nodeName==="HTML"?ee=fe:ee.appendChild(fe);else{if(!He&&!ne&&!ue&&pe.indexOf("<")===-1)return y&&jt?y.createHTML(pe):pe;if(ee=jf(pe),!ee)return He?null:jt?g:""}ee&&Te&&nr(ee.firstChild);const qe=wf(En?pe:ee);for(;
262Ue=qe.nextNode();)Nf(Ue),Af(Ue),Ue.content instanceof s&&g0(Ue.content);if(En)return pe;if(He){if(st)for(lt=O.call(ee.ownerDocument);ee.firstChild;)lt.appendChild(ee.firstChild);else lt=ee;return(R.shadowroot||R.shadowrootmode)&&(lt=P.call(n,lt,!0)),lt}let wt=ue?ee.outerHTML:ee.innerHTML;return ue&&G["!doctype"]&&ee.ownerDocument&&ee.ownerDocument.doctype&&ee.ownerDocument.doctype.name&&gt(a0,ee.ownerDocument.doctype.name)&&(wt="<!DOCTYPE "+ee.ownerDocument.doctype.name+`>
263`+wt),ne&&Os([$,I,L],hr=>{wt=Xa(wt,hr," ")}),y&&jt?y.createHTML(wt):wt},t.setConfig=function(){let pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Pl(pe),ye=!0},t.clearConfig=function(){$n=null,ye=!1},t.isValidAttribute=function(pe,C,ee){$n||Pl({});const fe=Ye(pe),Ue=Ye(C);return Sf(fe,Ue,ee)},t.addHook=function(pe,C){typeof C=="function"&&Ka(E[pe],C)},t.removeHook=function(pe,C){if(C!==void 0){const ee=bz(E[pe],C);return ee===-1?void 0:jz(E[pe],ee,1)[0]}return Cg(E[pe])},t.removeHooks=function(pe){E[pe]=[]},t.removeAllHooks=function(){E=Lg()},t}var Zu=i0();const Rz=e=>{const t=[];let r=e;["ul","li","ol","div","span","p","br","hr"].forEach(o=>{new RegExp(`<${o}[^>]*>`,"gi").test(e)&&t.push(`<${o}> tag will be converted to Telegram-compatible format`)}),r=r.replace(/<ul[^>]*>/gi,""),r=r.replace(/<\/ul>/gi,""),r=r.replace(/<li[^>]*>/gi,"• "),r=r.replace(/<\/li>/gi,`
264`),r=r.replace(/<ol[^>]*>/gi,""),r=r.replace(/<\/ol>/gi,""),r=r.replace(/<\/(div|span|p)>/gi,`
265`),r=r.replace(/<(div|span|p)[^>]*>/gi,""),r=r.replace(/<br\s*\/?>/gi,`
266`),r=r.replace(/<hr\s*\/?>/gi,`
267---
268`),r=r.replace(/\n{3,}/g,`
269
270`),r=r.trim(),r.length>4096&&t.push(`Message is ${r.length} characters (max 4096)`);const i=/<a\s+(?:[^>]*?\s+)?href=["']([^"'"]*)["'][^>]*>/gi;let s;for(;(s=i.exec(r))!==null;){const o=s[1];(!o||!o.startsWith("http"))&&t.push(`Invalid link URL: ${o||"empty"}`)}return{html:r,warnings:t,characterCount:r.length}},Bz=({html:e})=>{const[t,r]=M.useState([]),[n,i]=M.useState(""),[s,o]=M.useState(0);M.useEffect(()=>{const c=Rz(e);r(c.warnings),i(c.html),o(c.characterCount)},[e]);const l=c=>{let f=Zu.sanitize(c,{ALLOWED_TAGS:["b","strong","i","em","u","s","code","pre","a","br"],ALLOWED_ATTR:["href","class"],ALLOW_DATA_ATTR:!1,ALLOWED_URI_REGEXP:/^https?:\/\//i});return f=f.replace(/<code>/gi,'<code class="bg-slate-200 px-1 rounded">'),f=f.replace(/<pre>/gi,'<pre class="bg-slate-100 p-2 rounded my-2 overflow-x-auto">'),f=f.replace(/\n/g,"<br>"),f};return a.jsxs("div",{className:"space-y-4",children:[t.length>0&&a.jsxs(Lo,{variant:"destructive",children:[a.jsx($0,{className:"h-4 w-4"}),a.jsx(Ro,{children:a.jsx("ul",{className:"list-disc list-inside space-y-1",children:t.map((c,u)=>a.jsx("li",{children:c},u))})})]}),a.jsxs("div",{className:"border rounded-lg p-4 bg-slate-50 dark:bg-slate-900",children:[a.jsx("div",{className:"text-sm font-semibold mb-2 text-muted-foreground",children:"Telegram Preview:"}),a.jsx("div",{className:"bg-white dark:bg-slate-800 rounded-lg p-4 shadow-sm border border-slate-200 dark:border-slate-700 min-h-[100px] font-telegram",dangerouslySetInnerHTML:{__html:l(n)}}),a.jsxs("div",{className:"text-xs text-muted-foreground mt-2",children:[s," / 4096 characters"]})]})]})},Fz=()=>{const[e,t]=S.useState(null),[r,n]=S.useState(!0),[i,s]=S.useState(!1),[o,l]=S.useState(""),[c,u]=S.useState(""),[f,d]=S.useState("");S.useEffect(()=>{h()},[]);const h=async()=>{try{n(!0);const{data:p}=await V.from("telegram_connections").select("id, status"),{data:w}=await V.from("telegram_subscriptions").select("id, premium_drops_enabled"),j={total_connections:(p==null?void 0:p.length)||0,active_subscriptions:(w==null?void 0:w.length)||0,premium_drops_enabled:(w==null?void 0:w.filter(_=>_.premium_drops_enabled).length)||0};t(j)}catch(p){console.error("Error loading Telegram stats:",p),be({title:"Error",description:"Failed to load Telegram statistics.",variant:"destructive"})}finally{n(!1)}},m=async()=>{if(!o.trim()){be({title:"Error",description:"Please enter at least one domain to send.",variant:"destructive"});return}s(!0);try{const p=o.split(/[,\n]/).map(j=>j.trim()).filter(j=>j.length>0);if(p.length===0)throw new Error("No valid domains found");const w=await cc(p,"premium_drops");if(w.success)be({title:"Notifications sent!",description:`Successfully sent to ${w.sent} out of ${w.total} subscribers.`}),l(""),u("");else throw new Error(w.error||"Failed to send notifications")}catch(p){console.error("Error sending manual alert:",p),be({title:"Error",description:p.message||"Failed to send Telegram notifications.",variant:"destructive"})}finally{s(!1)}},v=async()=>{s(!0);try{const{data:p,error:w}=await V.from("premium_dropped").select("domain").order("updated_at",{ascending:!1}).limit(20);if(w)throw w;if(!p||p.length===0){be({title:"No domains found",description:"No premium drops found in the database.",variant:"destructive"});return}const j=p.map(y=>y.domain),_=await cc(j,"premium_drops");if(_.success)be({title:"Latest premium drops sent!",description:`Successfully sent ${j.length} domains to ${_.sent} out of ${_.total} subscribers.`});else throw new Error(_.error||"Failed to send notifications")}catch(p){console.error("Error sending latest drops:",p),be({title:"Error",description:p.message||"Failed to send latest premium drops.",variant:"destructive"})}finally{s(!1)}},x=async()=>
270{if(!f.trim()){be({title:"Error",description:"Please enter HTML content to send.",variant:"destructive"});return}if(f.length>4096){be({title:"Error",description:"Message is too long. Telegram has a 4096 character limit.",variant:"destructive"});return}s(!0);try{const p=await cc(void 0,"premium_drops",f);if(p.success)be({title:"Custom message sent!",description:`Successfully sent to ${p.sent} out of ${p.total} subscribers.`}),d("");else throw new Error(p.error||"Failed to send notifications")}catch(p){console.error("Error sending custom HTML:",p),be({title:"Error",description:p.message||"Failed to send custom HTML message.",variant:"destructive"})}finally{s(!1)}};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[a.jsx(q,{children:a.jsx(K,{className:"p-6",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx($s,{className:"h-8 w-8 text-blue-600"}),a.jsxs("div",{className:"ml-4",children:[a.jsx("p",{className:"text-sm font-medium text-slate-600",children:"Total Connections"}),a.jsx("p",{className:"text-2xl font-bold text-slate-900",children:r?a.jsx(Se,{className:"h-6 w-6 animate-spin"}):e==null?void 0:e.total_connections})]})]})})}),a.jsx(q,{children:a.jsx(K,{className:"p-6",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx(ft,{className:"h-8 w-8 text-green-600"}),a.jsxs("div",{className:"ml-4",children:[a.jsx("p",{className:"text-sm font-medium text-slate-600",children:"Active Subscriptions"}),a.jsx("p",{className:"text-2xl font-bold text-slate-900",children:r?a.jsx(Se,{className:"h-6 w-6 animate-spin"}):e==null?void 0:e.active_subscriptions})]})]})})}),a.jsx(q,{children:a.jsx(K,{className:"p-6",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx(pr,{className:"h-8 w-8 text-purple-600"}),a.jsxs("div",{className:"ml-4",children:[a.jsx("p",{className:"text-sm font-medium text-slate-600",children:"Premium Drops Enabled"}),a.jsx("p",{className:"text-2xl font-bold text-slate-900",children:r?a.jsx(Se,{className:"h-6 w-6 animate-spin"}):e==null?void 0:e.premium_drops_enabled})]})]})})})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs(q,{children:[a.jsxs(se,{children:[a.jsxs(oe,{className:"flex items-center gap-2",children:[a.jsx(pr,{className:"h-5 w-5"}),"Send Latest Premium Drops"]}),a.jsx(ge,{children:"Send the 20 most recent premium drops to all subscribers"})]}),a.jsx(K,{children:a.jsx(z,{onClick:v,disabled:i||r,className:"w-full",children:i?a.jsxs(a.Fragment,{children:[a.jsx(Se,{className:"h-4 w-4 mr-2 animate-spin"}),"Sending..."]}):a.jsxs(a.Fragment,{children:[a.jsx(pr,{className:"h-4 w-4 mr-2"}),"Send Latest Drops"]})})})]}),a.jsxs(q,{children:[a.jsxs(se,{children:[a.jsxs(oe,{className:"flex items-center gap-2",children:[a.jsx(Zt,{className:"h-5 w-5"}),"Refresh Statistics"]}),a.jsx(ge,{children:"Update the Telegram statistics displayed above"})]}),a.jsx(K,{children:a.jsx(z,{onClick:h,disabled:r,variant:"outline",className:"w-full",children:r?a.jsxs(a.Fragment,{children:[a.jsx(Se,{className:"h-4 w-4 mr-2 animate-spin"}),"Loading..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Zt,{className:"h-4 w-4 mr-2"}),"Refresh Stats"]})})})]})]}),a.jsxs(q,{children:[a.jsxs(se,{children:[a.jsxs(oe,{className:"flex items-center gap-2",children:[a.jsx($s,{className:"h-5 w-5"}),"Send Manual Alert"]}),a.jsx(ge,{children:"Send a custom list of domains to all premium drops subscribers"})]}),a.jsxs(K,{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(Z,{htmlFor:"domain-list",children:"Domains to Send"}),a.jsx(Je,{id:"domain-list",placeholder:`Enter domains separated by commas or new lines
271example.com, another-domain.com
272third-domain.com`,value:o,onChange:p=>l(p.target.value),rows:6,className:"mt-2"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Enter one domain per line or separate with commas"})]}),a.jsxs("div",{children:[a.jsx(Z,{htmlFor:"custom-message",children:"Custom Message (Optional)"}),a.jsx(Q,{id:"custom-message",placeholder:"Optional custom message to include",value:c,onChange:p=>u(p.target.value),className:"mt-2"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Leave empty to use the default message format"})]}),a.jsx(z,{onClick:m,disabled:i||r||!o.trim(),className:"w-full",children:i?a.jsxs(a.Fragment,{children:[a.jsx(Se,{className:"h-4 w-4 mr-2 animate-spin"}),"Sending Alert..."]}
272):a.jsxs(a.Fragment,{children:[a.jsx(pr,{className:"h-4 w-4 mr-2"}),"Send Manual Alert"]})})]})]}),a.jsxs(q,{children:[a.jsxs(se,{children:[a.jsxs(oe,{className:"flex items-center gap-2",children:[a.jsx(J0,{className:"h-5 w-5"}),"Send Custom HTML Message"]}),a.jsx(ge,{children:"Create a custom HTML message with affiliate links. Supports: <b>, <i>, <u>, <s>, <a>, <code>, <pre>"})]}),a.jsxs(K,{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(Z,{htmlFor:"html-message",children:"HTML Content"}),a.jsx(Je,{id:"html-message",placeholder:`<ul>
273  <li><a href='https://example.com?ref=domaindingo'>domain1.com</a></li>
274  <li><a href='https://example.com?ref=domaindingo'>domain2.com</a></li>
275</ul>`,value:f,onChange:p=>d(p.target.value),rows:12,className:"font-mono text-sm",enableBrowserFeatures:!0}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Note: <ul> and <li> will be converted to bullet points (•)"})]}),a.jsxs("div",{children:[a.jsx(Z,{children:"Live Preview"}),a.jsx("div",{className:"mt-2",children:a.jsx(Bz,{html:f})})]})]}),a.jsx(z,{onClick:x,disabled:i||r||!f.trim(),className:"w-full",children:i?a.jsxs(a.Fragment,{children:[a.jsx(Se,{className:"h-4 w-4 mr-2 animate-spin"}),"Sending Custom Message..."]}):a.jsxs(a.Fragment,{children:[a.jsx(pr,{className:"h-4 w-4 mr-2"}),"Send Custom HTML Message"]})})]})]})]})},Uz=[{value:"premiumexpired",label:"Premium Expired Auctions"},{value:"premiumdrops",label:"Premium Drops"},{value:"premium-closeouts",label:"Premium Closeouts"}],zz=()=>{const{toast:e}=_n(),[t,r]=S.useState([]),[n,i]=S.useState(!0),[s,o]=S.useState(!1),[l,c]=S.useState(""),[u,f]=S.useState(""),[d,h]=S.useState(""),[m,v]=S.useState([]),x=async()=>{const{data:g,error:b}=await V.from("promo_open_access").select("*").order("created_at",{ascending:!1});!b&&g&&r(g),i(!1)};S.useEffect(()=>{x()},[]);const p=async()=>{if(!l||!u||!d||m.length===0){e({title:"Udfyld alle felter",variant:"destructive"});return}const{error:g}=await V.from("promo_open_access").insert({name:l,starts_at:new Date(u).toISOString(),ends_at:new Date(d).toISOString(),target_pages:m,enabled:!0});g?e({title:"Fejl",description:g.message,variant:"destructive"}):(e({title:"Promotion oprettet"}),c(""),f(""),h(""),v([]),o(!1),x())},w=async(g,b)=>{const{error:N}=await V.from("promo_open_access").update({enabled:!b,updated_at:new Date().toISOString()}).eq("id",g);N||x()},j=async g=>{const{error:b}=await V.from("promo_open_access").delete().eq("id",g);b||(e({title:"Promotion slettet"}),x())},_=g=>{v(b=>b.includes(g)?b.filter(N=>N!==g):[...b,g])},y=g=>{const b=new Date,N=new Date(g.starts_at),O=new Date(g.ends_at);return g.enabled?b<N?{label:"Planlagt",variant:"outline"}:b>O?{label:"Udløbet",variant:"secondary"}:{label:"Aktiv",variant:"default"}:{label:"Deaktiveret",variant:"secondary"}};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs(q,{children:[a.jsx(se,{children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs(oe,{className:"flex items-center gap-2",children:[a.jsx(Es,{className:"h-5 w-5 text-primary"}),"Premium Promo Access"]}),a.jsx(ge,{children:"Opret tidsbegrænsede perioder hvor premium indhold er åbent for alle brugere"})]}),a.jsxs(z,{onClick:()=>o(!s),size:"sm",children:[a.jsx(qr,{className:"h-4 w-4 mr-2"}),"Ny Promotion"]})]})}),s&&a.jsx(K,{className:"border-t border-border pt-6",children:a.jsxs("div",{className:"grid gap-4 max-w-lg",children:[a.jsxs("div",{children:[a.jsx(Z,{children:"Navn"}),a.jsx(Q,{placeholder:"F.eks. Weekend Open Access",value:l,onChange:g=>c(g.target.value)})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(Z,{children:"Start"}),a.jsx(Q,{type:"datetime-local",value:u,onChange:g=>f(g.target.value)})]}),a.jsxs("div",{children:[a.jsx(Z,{children:"Slut"}),a.jsx(Q,{type:"datetime-local",value:d,onChange:g=>h(g.target.value)})]})]}),a.jsxs("div",{children:[a.jsx(Z,{className:"mb-2 block",children:"Sider der skal åbnes"}),a.jsx("div",{className:"space-y-2",children:Uz.map(g=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Xn,{checked:m.includes(g.value),onCheckedChange:()=>_(g.value)}),a.jsx("span",{className:"text-sm",children:g.label})]},g.value))})]}),a.jsx(z,{onClick:p,className:"w-fit",children:"Opret Promotion"})]})})]}),n?a.jsx("p",{className:"text-muted-foreground text-sm",children:"Indlæser..."}):t.length===0?a.jsx("p",{className:"text-muted-foreground text-sm",children:"Ingen promotions oprettet endnu."}):a.jsx("div",{className:"space-y-3",children:t.map(g=>{const b=y(g);return a.jsx(q,{children:a.jsxs(K,{className:"p-4 flex items-center justify-between gap-4",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx("span",{className:"font-medium text-foreground",children:g.name}),a.jsx(Oe,{variant:b.variant,children:b.label})]}),a.jsx("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(Nn,{className:"h-3 w-3"}),ci(new Date(g.starts_at),"dd/MM/yyyy HH:mm")," - ",ci(new Date(g.ends_at),"dd/MM/yyyy HH:mm")]})}),a.jsx("div",{className:"flex gap-1 mt-1",children:g.target_pages.map(N=>a.jsx(Oe,{variant:"outline",className:"text-xs",children:N},N))})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Nr,{checked:g.enabled,onCheckedChange:()=>w(g.id,g.enabled)}),a.jsx(z,{variant:"ghost",size:"icon",onClick:()=>j(g.id),children:a.jsx(Cr,{className:"h-4 w-4 text-destructive"})})]})]})},g.id)})})]})},Hz=()=>{const e=qi(),t=[{title:"Banner Management",description:"Configure promotional banners and announcements",icon:Es,color:"text-blue-600",bgColor:"bg-blue-100"},{title:"Telegram Notifications",description:"Manage automated notifications and bot settings",icon:$s,color:"text-green-600",bgColor:"bg-green-100"}],r=[{category:"Security",settings:[{name:"Two-factor Authentication",status:"Enabled",type:"security"},{name:"API Rate Limiting",status:"Active",type:"security"},{name:"SSL/TLS Encryption",status:"Enabled",type:"security"}]},{category:"Notifications",settings:[{name:"System Alerts",status:"Enabled",type:"notification"}
275,{name:"User Activity Logs",status:"Active",type:"notification"},{name:"Error Reporting",status:"Enabled",type:"notification"}]}];return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center lg:justify-between",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl lg:text-3xl font-bold text-foreground",children:"System Settings"}),a.jsx("p",{className:"text-muted-foreground mt-1",children:"Configure system-wide settings and integrations"})]}),a.jsx("div",{className:"flex items-center space-x-2 mt-4 lg:mt-0",children:a.jsxs("div",{className:"flex items-center space-x-2 text-sm text-muted-foreground",children:[a.jsx(vn,{className:"h-4 w-4 text-green-600"}),"All systems secure"]})})]}),a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:t.map(n=>{const i=n.icon;return a.jsx(q,{className:"hover:shadow-lg transition-shadow",children:a.jsx(K,{className:"p-6",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:`p-3 rounded-lg ${n.bgColor} mr-4`,children:a.jsx(i,{className:`h-6 w-6 ${n.color}`})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"font-semibold text-foreground",children:n.title}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:n.description})]})]})})},n.title)})}),a.jsxs(q,{children:[a.jsxs(se,{children:[a.jsxs(oe,{className:"flex items-center",children:[a.jsx(cj,{className:"h-5 w-5 mr-2 text-primary"}),"System Status"]}),a.jsx(ge,{children:"Current status of system components"})]}),a.jsx(K,{children:a.jsx("div",{className:"space-y-6",children:r.map(n=>a.jsxs("div",{className:"space-y-3",children:[a.jsxs("h4",{className:"font-medium text-foreground flex items-center",children:[n.category==="Security"?a.jsx(vn,{className:"h-4 w-4 mr-2 text-green-600"}):a.jsx(Gg,{className:"h-4 w-4 mr-2 text-blue-600"}),n.category]}),a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:n.settings.map(i=>a.jsx("div",{className:"p-3 rounded-lg bg-muted/50 border border-border",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-sm font-medium text-foreground",children:i.name}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),a.jsx("span",{className:"text-xs text-green-600 font-medium",children:i.status})]})]})},i.name))})]},n.category))})})]}),a.jsxs(Sn,{defaultValue:"banners",className:"space-y-6",children:[a.jsxs(Vr,{className:"grid w-full grid-cols-3",children:[a.jsxs(Ke,{value:"banners",className:"flex items-center",children:[a.jsx(Es,{className:"h-4 w-4 mr-2"}),!e&&"Banner"]}),a.jsxs(Ke,{value:"telegram",className:"flex items-center",children:[a.jsx($s,{className:"h-4 w-4 mr-2"}),!e&&"Telegram"]}),a.jsxs(Ke,{value:"promo",className:"flex items-center",children:[a.jsx(tj,{className:"h-4 w-4 mr-2"}),!e&&"Promo"]})]}),a.jsx(ht,{value:"banners",className:"space-y-6",children:a.jsx(gz,{})}),a.jsx(ht,{value:"telegram",className:"space-y-6",children:a.jsx(Fz,{})}),a.jsx(ht,{value:"promo",className:"space-y-6",children:a.jsx(zz,{})})]})]})},s0=S.forwardRef(({headerAction:e},t)=>{const[r,n]=S.useState([]),[i,s]=S.useState(!0),[o,l]=S.useState(null),[c,u]=S.useState(null),[f,d]=S.useState(!1),[h,m]=S.useState(!1),[v,x]=S.useState(!1),[p,w]=S.useState(""),[j,_]=S.useState(""),[y,g]=S.useState(""),[b,N]=S.useState("95"),[O,D]=S.useState(""),[P,E]=S.useState(""),[$,I]=S.useState(""),[L,U]=S.useState(""),[T,B]=S.useState(""),[W,ae]=S.useState("95"),[F,G]=S.useState(""),[re,R]=S.useState(""),{toast:te}=_n();S.useImperativeHandle(t,()=>({reload:A})),S.useEffect(()=>{A()},[]),S.useEffect(()=>{if(f&&!j){const k=new Date,ne=k.getFullYear(),Y=String(k.getMonth()+1).padStart(2,"0"),ue=String(k.getDate()).padStart(2,"0");_(`${ne}-${Y}-${ue}T17:00`)}},[f,j]);const A=async()=>{try{const{data:k,error:ne}=await V.from("expired_auctions_hot").select("*").order("id",{ascending:!1});if(ne)throw ne;n(k||[])}catch(k){console.error("Error fetching hot auctions:",k),te({title:"Error",description:"Failed to load hot auctions",variant:"destructive"})}finally{s(!1)}},X=async(k,ne)=>{if(!ne.type.startsWith("image/")){te({title:"Invalid file",description:"Please upload an image file",variant:"destructive"});return}l(k);try{const Y=ne.name.split(".").pop(),ye=`${`${k}-${Date.now()}.${Y}`}`,{error:Te}=await V.storage.from("hot-auction-logos").upload(ye,ne,{upsert:!0});if(Te)throw Te;const{data:{publicUrl:He}}=V.storage.from("hot-auction-logos").getPublicUrl(ye),{error:st}=await V.from("expired_auctions_hot").update({logo_url:He}).eq("id",k);if(st)throw st;A()}catch(Y){console.error("Error uploading logo:",Y),te({title:"Error",description:"Failed to upload logo",variant:"destructive"})}finally{l(null)}},le=async(k,ne)=>{n(Y=>Y.map(ue=>ue.id===k?{...ue,atom_premium:ne}:ue));try{const{error:Y}=await V.from("expired_auctions_hot").update({atom_premium:ne}).eq("id",k);if(Y)throw Y;
275te({title:ne?"Marked as Atom Premium":"Removed Atom Premium",description:ne?"Domain will display the Atom Premium badge.":"Atom Premium badge removed."})}catch(Y){console.error("Error toggling atom_premium:",Y),n(ue=>ue.map(ye=>ye.id===k?{...ye,atom_premium:!ne}:ye)),te({title:"Error",description:"Failed to update Atom Premium status",variant:"destructive"})}},he=async(k,ne)=>{try{if(ne){const ue=ne.split("/").pop();ue&&await V.storage.from("hot-auction-logos").remove([ue])}const{error:Y}=await V.from("expired_auctions_hot").update({logo_url:null}).eq("id",k);if(Y)throw Y;te({title:"Success",description:"Logo removed successfully"}),A()}catch(Y){console.error("Error removing logo:",Y),te({title:"Error",description:"Failed to remove logo",variant:"destructive"})}},J=async k=>{u(k);try{const{error:ne}=await V.rpc("regenerate_hot_auction_logo",{p_id:k});if(ne)throw ne;n(Y=>Y.map(ue=>ue.id===k?{...ue,logo_url:null}:ue))}catch(ne){console.error("Error regenerating logo:",ne),te({title:"Error",description:"Failed to start logo regeneration",variant:"destructive"})}finally{u(null)}},me=async()=>{const k=p.trim().toLowerCase();if(!k||!j||!$.trim()){te({title:"Missing fields",description:"Domain, expires and auction link are required",variant:"destructive"});return}x(!0);try{const ne={domain:k,expires:new Date(j).toISOString(),source_type:"namecheap",atom_premium:!1};y&&(ne.age=Number(y)),b&&(ne.score=Number(b)),O&&(ne.tld_count=Number(O)),P&&(ne.bid_price=P.trim()),$&&(ne.auction_url=$.trim());const{error:Y}=await V.from("expired_auctions_hot").insert(ne);if(Y)throw Y;d(!1),w(""),_(""),g(""),N("95"),D(""),E(""),I(""),A()}catch(ne){console.error("add namecheap error",ne),te({title:"Error",description:ne instanceof Error?ne.message:"Failed to add",variant:"destructive"})}finally{x(!1)}},ve=async()=>{const k=L.trim().toLowerCase();if(!k){te({title:"Missing fields",description:"Domain is required",variant:"destructive"});return}x(!0);try{const{error:ne}=await V.rpc("move_gname_to_hot_auction",{p_domain:k,p_age:T?Number(T):null,p_score:W?Number(W):null,p_tld_count:F?Number(F):null,p_bid_price:re.trim()||null});if(ne)throw ne;m(!1),U(""),B(""),ae("95"),G(""),R(""),A(),te({title:"Gname auction moved",description:`${k} was added to hot auctions and removed from Gname auctions.`})}catch(ne){console.error("add gname error",ne),te({title:"Error",description:ne instanceof Error?ne.message:"Failed to add",variant:"destructive"})}finally{x(!1)}};return i?a.jsx("div",{children:"Loading..."}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-2xl font-bold",children:"Hot Auctions Management"}),a.jsx("p",{className:"text-muted-foreground",children:"Manage the featured hot auction cards shown at the top of the expired auctions page"}),e&&a.jsx("div",{className:"mt-3",children:e})]}),a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsxs(br,{open:f,onOpenChange:d,children:[a.jsx(un,{asChild:!0,children:a.jsxs(z,{variant:"outline",size:"sm",children:[a.jsx(qr,{className:"h-4 w-4 mr-2"}),"Add Namecheap auction"]})}),a.jsxs(jr,{children:[a.jsx(wr,{children:a.jsx(_r,{children:"Add Namecheap auction"})}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx(Z,{htmlFor:"nc-domain",children:"Domain *"}),a.jsx(Q,{id:"nc-domain",placeholder:"insights.ai",value:p,onChange:k=>w(k.target.value)})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx(Z,{htmlFor:"nc-expires",children:"Expires *"}),a.jsx(Q,{id:"nc-expires",type:"datetime-local",value:j,onChange:k=>_(k.target.value)})]}),a.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx(Z,{htmlFor:"nc-age",children:"Age (years)"}),a.jsx(Q,{id:"nc-age",type:"number",min:"0",value:y,onChange:k=>g(k.target.value)})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx(Z,{htmlFor:"nc-score",children:"Score"}),a.jsx(Q,{id:"nc-score",type:"number",min:"0",max:"100",value:b,onChange:k=>N(k.target.value)})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx(Z,{htmlFor:"nc-tld",children:"TLD count"}),a.jsx(Q,{id:"nc-tld",type:"number",min:"0",value:O,onChange:k=>D(k.target.value)})]})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx(Z,{htmlFor:"nc-bid",children:"Current bid (optional)"}),a.jsx(Q,{id:"nc-bid",placeholder:"$16,199",value:P,onChange:k=>E(k.target.value)})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx(Z,{htmlFor:"nc-url",children:"Namecheap auction link *"}),a.jsx(Q,{id:"nc-url",type:"url",placeholder:"https://www.namecheap.com/market/...",value:$,onChange:k=>I(k.target.value)})]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Logo and 6-10 word description are generated automatically after insert."})]}),a.jsxs(dn,{children:[a.jsx(z,{variant:"ghost",onClick:()=>d(!1),disabled:v,children:"Cancel"}),a.jsx(z,{onClick:me,disabled:v,children:v?"Adding...":"Add auction"})]})]})]}),a.jsxs(br,{open:h,onOpenChange:m,children:[a.jsx(un,{asChild:!0,children:a.jsxs(z,{variant:"outline",size:"sm",children:[a.jsx(qr,{className:"h-4 w-4 mr-2"}),"Add Gname auction"]})}),a.jsxs(jr,{children:[a.jsx(wr,{children:a.jsx(_r,{children:"Add Gname auction"})}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx(Z,{htmlFor:"gn-domain",children:"Domain *"}),a.jsx(Q,{id:"gn-domain",placeholder:"example.com",value:L,onChange:k=>U(k.target.value)})]}),a.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx(Z,{htmlFor:"gn-age",children:"Age (years)"}),a.jsx(Q,{id:"gn-age",type:"number",min:"0",value:T,onChange:k=>B(k.target.value)})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx(Z,{htmlFor:"gn-score",children:"Score"}),a.jsx(Q,{id:"gn-score",type:"number",min:"0",max:"100",value:W,onChange:k=>ae(k.target.value)})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx(Z,{htmlFor:"gn-tld",children:"TLD count"}),a.jsx(Q,{id:"gn-tld",type:"number",min:"0",value:F,onChange:k=>G(k.target.value)})]})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx(Z,{htmlFor:"gn-bid",children:"Current bid (optional)"}),a.jsx(Q,{id:"gn-bid",placeholder:"$1,299",value:re,onChange:k=>R(k.target.value)})]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Auction link and expiration are pulled from the gname_auctions table. Logo and description are generated automatically after insert."})]}),a.jsxs(dn,{children:[a.jsx(z,{variant:"ghost",onClick:()=>m(!1),disabled:v,children:"Cancel"}),a.jsx(z,{onClick:ve,disabled:v,children:v?"Adding...":"Add auction"})]})]})]})]})]}),a.jsx("div",{className:"grid gap-4 grid-cols-1 md:grid-cols-2 lg:grid-cols-5",children:r.map(k=>a.jsxs(q,{children:[a.jsxs(se,{className:"p-4",children:[a.jsxs(oe,{className:"text-base flex items-center justify-between",children:[a.jsx("span",{children:k.domain}),a.jsx("a",{href:k0(k.domain,k.source_type,k.auction_url),target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:text-primary/80",children:a.jsx(ed,{className:"h-4 w-4"})})]}),a.jsxs(ge,{className:"text-xs",children:["Expires: ",new Date(k.expires).toLocaleDateString()]})]}),a.jsxs(K,{className:"space-y-3 p-4",children:[k.logo_url?a.jsxs("div",{className:"space-y-2",children:[a.jsx("div",{className:"aspect-video rounded-lg overflow-hidden bg-muted",children:a.jsx("img",{src:k.logo_url,alt:`Logo for ${k.domain}`,className:"w-full h-full object-cover"})}),a.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[a.jsxs(z,{variant:"outline",size:"sm",className:"text-xs h-8",onClick:()=>J(k.id),disabled:c===k.id,children:[a.jsx(li,{className:"h-3 w-3 mr-1"}),c===k.id?"Starting...":"Regenerate"]}),a.jsxs(z,{variant:"destructive",size:"sm",className:"text-xs h-8",onClick:()=>he(k.id,k.logo_url),children:[a.jsx(Cr,{className:"h-3 w-3 mr-1"}),"Remove"]})]})]}):a.jsxs("div",{className:"space-y-2",children:[a.jsx("div",{className:"aspect-video rounded-lg bg-muted flex items-center justify-center",children:a.jsx(ui,{className:"h-8 w-8 text-muted-foreground"})}),a.jsx(Z,{htmlFor:`logo-upload-${k.id}`,children:a.jsxs("div",{className:"cursor-pointer",children:[a.jsx(Q,{id:`logo-upload-${k.id}`,type:"file",accept:"image/*",className:"hidden",onChange:ne=>{var ue;const Y=(ue=ne.target.files)==null?void 0:ue[0];Y&&X(k.id,Y)},disabled:o===k.id}),a.jsx(z,{variant:"outline",size:"sm",className:"w-full h-8",asChild:!0,disabled:o===k.id,children:a.jsxs("span",{children:[a.jsx(ui,{className:"h-4 w-4 mr-2"}),o===k.id?"Uploading...":"Upload Logo"]})})]})}),a.jsxs(z,{variant:"secondary",size:"sm",className:"w-full h-8 text-xs",onClick:()=>J(k.id),disabled:c===k.id,children:[a.jsx(li,{className:"h-3 w-3 mr-1"}),c===k.id?"Starting...":"Auto-generate with AI"]})]}),a.jsxs("div",{className:"flex items-center justify-between rounded-md border border-purple-500/30 bg-gradient-to-r from-purple-500/5 to-pink-500/5 px-3 py-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(M0,{className:"h-4 w-4 text-purple-400"}),a.jsx(Z,{htmlFor:`atom-premium-${k.id}`,className:"text-xs font-medium cursor-pointer",children:"Atom Premium"})]}),a.jsx(Nr,{id:`atom-premium-${k.id}`,checked:k.atom_premium,onCheckedChange:ne=>le(k.id,ne)})]})]})]},k.id))})]})});s0.displayName="AdminHotAuctions";const Wz=()=>{const e=S.useRef(null),[t,r]=S.useState(!1),n=async()=>{var s;r(!0);try{await((s=e.current)==null?void 0:s.reload())}finally{r(!1)}},i=a.jsxs(z,{onClick:n,disabled:t,variant:"outline",size:"sm",children:[a.jsx(Zt,{className:`h-4 w-4 mr-2 ${t?"animate-spin":""}`}),t?"Reloading...":"Reload Auctions"]});return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl lg:text-3xl font-bold text-foreground flex items-center",children:[a.jsx(nv,{className:"h-6 w-6 lg:h-7 lg:w-7 mr-2 text-orange-600"}),"Hot Auctions"]}),a.jsx("p",{className:"text-muted-foreground mt-1",children:"Upload logos and manage Premium Expired Auctions"})]}),a.jsx(s0,{ref:e,headerAction:i})]})},Qa=5,Rg="newsletter-user-offers",Gz=e=>e==="EUR"?"€":"$",gc={domain:"",listing_type:"buy_now",price:"",currency:"USD",link_url:"",logo_url:""},qz=()=>{const[e,t]=S.useState([]),[r,n]=S.useState(!0),[i,s]=S.useState(!1),[o,l]=S.useState(null),[c,u]=S.useState(gc),[f,d]=S.useState(null),[h,m]=S.useState(gc),v=async()=>{n(!0);const{data:N,error:O}=await V.from("newsletter_user_offers").select("*").order("position",{ascending:!0});O?de.error(O.message):t(N||[]),n(!1)};S.useEffect(()=>
275{v()},[]);const x=async N=>{try{const O=N.name.split(".").pop(),D=`${Date.now()}-${Math.random().toString(36).slice(2)}.${O}`,{error:P}=await V.storage.from(Rg).upload(D,N,{cacheControl:"3600",upsert:!1});if(P)throw P;const{data:E}=V.storage.from(Rg).getPublicUrl(D);return de.success("Logo uploaded"),E.publicUrl}catch(O){return de.error(O.message||"Upload failed"),null}},p=N=>!N.domain.trim()||!N.link_url.trim()?(de.error("Domain and link are required"),!1):N.listing_type==="buy_now"&&(!N.price||isNaN(Number(N.price)))?(de.error("Price is required for Buy Now"),!1):!0,w=async()=>{var D;if(!p(c))return;if(e.length>=Qa){de.error(`Max ${Qa} offers`);return}s(!0);const N=(((D=e[e.length-1])==null?void 0:D.position)??0)+1,{error:O}=await V.from("newsletter_user_offers").insert({domain:c.domain.trim(),listing_type:c.listing_type,price_usd:c.listing_type==="buy_now"?Number(c.price):null,currency:c.currency,link_url:c.link_url.trim(),logo_url:c.logo_url||null,position:N});if(s(!1),O)return de.error(O.message);de.success("Offer added"),u(gc),v()},j=N=>{var O;d(N.id),m({domain:N.domain,listing_type:N.listing_type,price:((O=N.price_usd)==null?void 0:O.toString())??"",currency:N.currency||"USD",link_url:N.link_url,logo_url:N.logo_url||""})},_=async()=>{if(!f||!p(h))return;s(!0);const{error:N}=await V.from("newsletter_user_offers").update({domain:h.domain.trim(),listing_type:h.listing_type,price_usd:h.listing_type==="buy_now"?Number(h.price):null,currency:h.currency,link_url:h.link_url.trim(),logo_url:h.logo_url||null}).eq("id",f);if(s(!1),N)return de.error(N.message);de.success("Offer updated"),d(null),v()},y=async N=>{if(!confirm("Delete this offer?"))return;const{error:O}=await V.from("newsletter_user_offers").delete().eq("id",N);if(O)return de.error(O.message);de.success("Offer removed"),v()},g=e.length>=Qa,b=(N,O,D)=>a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Z,{children:"Domain"}),a.jsx(Q,{placeholder:"example.com",value:N.domain,onChange:P=>O({...N,domain:P.target.value})})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Z,{children:"Listing Type"}),a.jsxs(Gn,{value:N.listing_type,onValueChange:P=>O({...N,listing_type:P}),children:[a.jsx(qn,{children:a.jsx(Vn,{})}),a.jsxs(Kn,{children:[a.jsx(vt,{value:"buy_now",children:"Buy Now (fixed price)"}),a.jsx(vt,{value:"auction",children:"Auction"})]})]})]}),N.listing_type==="buy_now"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Z,{children:"Price"}),a.jsx(Q,{type:"number",placeholder:"2500",value:N.price,onChange:P=>O({...N,price:P.target.value})})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Z,{children:"Currency"}),a.jsxs(Gn,{value:N.currency,onValueChange:P=>O({...N,currency:P}),children:[a.jsx(qn,{children:a.jsx(Vn,{})}),a.jsxs(Kn,{children:[a.jsx(vt,{value:"USD",children:"USD ($)"}),a.jsx(vt,{value:"EUR",children:"EUR (€)"})]})]})]})]}),a.jsxs("div",{className:"space-y-1.5 md:col-span-2",children:[a.jsx(Z,{children:"Link URL"}),a.jsx(Q,{placeholder:"https://...",value:N.link_url,onChange:P=>O({...N,link_url:P.target.value})})]}),a.jsxs("div",{className:"space-y-1.5 md:col-span-2",children:[a.jsx(Z,{children:"Logo (square, ideally 200x200)"}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Q,{type:"file",accept:"image/*",onChange:async P=>{var I;const E=(I=P.target.files)==null?void 0:I[0];if(!E)return;l(D);const $=await x(E);l(null),$&&O({...N,logo_url:$})},disabled:o===D}),o===D&&a.jsx(Se,{className:"h-4 w-4 animate-spin"}),N.logo_url&&a.jsx("img",{src:N.logo_url,alt:"preview",className:"w-10 h-10 rounded object-cover"})]})]})]});return a.jsxs(q,{children:[a.jsxs(se,{children:[a.jsxs(oe,{className:"flex items-center",children:[a.jsx(I0,{className:"h-5 w-5 mr-2 text-primary"}),"Community Spotlight (",e.length,"/",Qa,")"]}),a.jsx(ge,{children:"Manage user-submitted domains shown at the top of the Newsletter HTML. Section is hidden when empty."})]}),a.jsxs(K,{className:"space-y-6",children:[r?a.jsx(Se,{className:"h-5 w-5 animate-spin text-muted-foreground"}):a.jsxs("div",{className:"space-y-2",children:[e.length===0&&a.jsx("p",{className:"text-sm text-muted-foreground",children:"No featured offers yet."}),e.map(N=>f===N.id?a.jsxs("div",{className:"p-4 border border-primary/40 rounded-md bg-muted/30 space-y-4",children:[b(h,m,N.id),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(z,{onClick:_,disabled:i,size:"sm",children:[i?a.jsx(Se,{className:"h-4 w-4 mr-2 animate-spin"}
275):a.jsx(Do,{className:"h-4 w-4 mr-2"}),"Save"]}),a.jsxs(z,{variant:"ghost",size:"sm",onClick:()=>d(null),children:[a.jsx(Vi,{className:"h-4 w-4 mr-2"})," Cancel"]})]})]},N.id):a.jsxs("div",{className:"flex items-center gap-3 p-3 border border-border rounded-md bg-muted/30",children:[N.logo_url?a.jsx("img",{src:N.logo_url,alt:N.domain,className:"w-12 h-12 rounded object-cover"}):a.jsx("div",{className:"w-12 h-12 rounded bg-muted flex items-center justify-center text-xs text-muted-foreground",children:"No logo"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"font-semibold text-foreground truncate",children:N.domain}),a.jsxs("div",{className:"text-xs text-muted-foreground truncate",children:[N.listing_type==="buy_now"?`Buy Now • ${Gz(N.currency||"USD")}${N.price_usd}`:"Live Auction"," ","•"," ",a.jsx("a",{href:N.link_url,target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-primary",children:"Link"})]})]}),a.jsx(z,{variant:"ghost",size:"sm",onClick:()=>j(N),children:a.jsx(Io,{className:"h-4 w-4"})}),a.jsx(z,{variant:"ghost",size:"sm",onClick:()=>y(N.id),children:a.jsx(Cr,{className:"h-4 w-4 text-destructive"})})]},N.id))]}),a.jsxs("div",{className:"border-t border-border pt-6 space-y-4",children:[a.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Add New Offer"}),b(c,u,"new"),a.jsx(z,{onClick:w,disabled:g||i,className:"w-full sm:w-auto",children:i?a.jsxs(a.Fragment,{children:[a.jsx(Se,{className:"h-4 w-4 mr-2 animate-spin"})," Saving…"]}):a.jsxs(a.Fragment,{children:[a.jsx(qr,{className:"h-4 w-4 mr-2"})," Add Offer"]})}),g&&a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Maximum of ",Qa," offers reached. Remove one to add another."]})]})]})]})},pn=async e=>{const{data:t,error:r}=await V.functions.invoke("resend-newsletter-admin",{body:e});if(r){const n=r instanceof D0?await r.context.text():r.message;let i=n;try{i=JSON.parse(n).error||n}catch{}throw new Error(i)}return t},Vz=()=>{const[e,t]=S.useState(null),[r,n]=S.useState(!1),[i,s]=S.useState(!1),[o,l]=S.useState(""),[c,u]=S.useState(""),[f,d]=S.useState(!1),h=async()=>{n(!0);try{t(await pn({action:"status"}))}catch(w){de.error(w.message)}finally{n(!1)}};S.useEffect(()=>{h()},[]);const m=async w=>{const j=w.match(/[^\s,;"'<>]+@[^\s,;"'<>]+\.[^\s,;"'<>]+/g)||[];if(!j.length){de.error("No emails found");return}d(!0);try{const _=await pn({action:"import_unsubscribes",emails:j});de.success(`${_.imported} unsubscribed emails saved - they will never be added.`),u(""),await h()}catch(_){de.error(_.message)}finally{d(!1)}},v=async w=>{w&&m(await w.text())},x=async()=>{var w;s(!0);try{let j=1,_=0;for(;j>0;){const y=await pn({action:"sync_batch"});if(_+=y.processed,j=y.remaining,l(`${_} added - ${j} left`),(w=y.errors)!=null&&w.length&&console.warn("Sync errors",y.errors),y.processed===0)break}de.success("All members are on the Resend list.")}catch(j){de.error(j.message)}finally{s(!1),l(""),h()}},p=e&&e.pending===0;return a.jsxs(q,{children:[a.jsxs(se,{children:[a.jsxs(oe,{className:"flex items-center",children:[a.jsx(ft,{className:"h-5 w-5 mr-2 text-primary"}),"Subscribers (Resend)"]}),a.jsx(ge,{children:"All confirmed members are added to the Resend list, except people who unsubscribed. Resend handles unsubscribes from now on."})]}),a.jsxs(K,{className:"space-y-5",children:[a.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[["Members",e==null?void 0:e.users],["Unsubscribed",e==null?void 0:e.unsubscribed],["On Resend list",e==null?void 0:e.synced],["Waiting",e==null?void 0:e.pending]].map(([w,j])=>a.jsxs("div",{className:"rounded-lg border border-border p-3",children:[a.jsx("p",{className:"text-xs text-muted-foreground",children:w}),a.jsx("p",{className:"text-2xl font-bold text-foreground",children:r||j===void 0?"-":j.toLocaleString()})]},w))}),p&&a.jsxs("p",{className:"flex items-center text-sm text-primary",children:[a.jsx(V0,{className:"h-4 w-4 mr-1"}),"Everything is synced."]}),a.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.jsxs(z,{onClick:x,disabled:i||r,children:[i?a.jsx(Se,{className:"h-4 w-4 mr-2 animate-spin"}):a.jsx(Zt,{className:"h-4 w-4 mr-2"}),i?o||"Syncing...":"Sync all members to Resend"]}),a.jsx(z,{variant:"outline",onClick:h,disabled:r,children:"Refresh"})]}),i&&a.jsx("p",{className:"text-xs text-muted-foreground",children:"Keep this page open. Resend accepts about 2 contacts per second."}),a.jsxs("div",{className:"space-y-2 pt-2 border-t border-border",children:[a.jsx(Z,{className:"text-sm font-medium",children:"Import unsubscribed emails from Brevo"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Upload the CSV export or paste emails. Do this before the first sync."}
275),a.jsx(Q,{type:"file",accept:".csv,.txt",onChange:w=>{var j;return v((j=w.target.files)==null?void 0:j[0])},disabled:f}),a.jsx(Je,{rows:3,placeholder:"or paste emails here...",value:c,onChange:w=>u(w.target.value)}),a.jsxs(z,{variant:"outline",size:"sm",onClick:()=>m(c),disabled:f||!c.trim(),children:[f?a.jsx(Se,{className:"h-4 w-4 mr-1 animate-spin"}):a.jsx(ui,{className:"h-4 w-4 mr-1"}),"Save unsubscribes"]})]})]})]})},Kz=({html:e,subject:t,preview:r})=>{const[n,i]=S.useState(""),[s,o]=S.useState(!1),[l,c]=S.useState(!1),[u,f]=S.useState(!1),[d,h]=S.useState(null),[m,v]=S.useState(t);S.useEffect(()=>v(t),[t]),S.useEffect(()=>{V.auth.getUser().then(({data:j})=>{var _;(_=j.user)!=null&&_.email&&i(j.user.email)})},[]);const x=async()=>{o(!0);try{await pn({action:"send_test",to:n,subject:m,html:e,preview:r}),de.success(`Test sent to ${n}`)}catch(j){de.error(j.message)}finally{o(!1)}},p=async()=>{f(!0);try{const j=await pn({action:"status"});h(j.synced)}catch{h(null)}},w=async()=>{c(!0);try{const j=await pn({action:"send_broadcast",subject:m,html:e,preview:r});de.success(`Newsletter sent to ${j.recipients.toLocaleString()} subscribers!`)}catch(j){de.error(j.message)}finally{c(!1),f(!1)}};return a.jsxs("div",{className:"space-y-3 p-4 rounded-lg border border-primary/30 bg-primary/5",children:[a.jsxs("p",{className:"font-medium text-foreground flex items-center",children:[a.jsx(pr,{className:"h-4 w-4 mr-2 text-primary"}),"Send with Resend"]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx(Z,{className:"text-xs",children:"Subject"}),a.jsx(Q,{value:m,onChange:j=>v(j.target.value)})]}),a.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[a.jsx(Q,{value:n,onChange:j=>i(j.target.value),placeholder:"Test email"}),a.jsxs(z,{variant:"outline",onClick:x,disabled:s||!n||!m,children:[s?a.jsx(Se,{className:"h-4 w-4 mr-1 animate-spin"}):a.jsx(ej,{className:"h-4 w-4 mr-1"}),"Send test"]})]}),a.jsxs(z,{onClick:p,disabled:l||!m,className:"w-full",children:[a.jsx(pr,{className:"h-4 w-4 mr-2"}),"Send newsletter to all subscribers"]}
275),a.jsx(Kg,{open:u,onOpenChange:f,children:a.jsxs(Xg,{children:[a.jsxs(Yg,{children:[a.jsx(Zg,{children:"Send the newsletter now?"}),a.jsxs(Jg,{children:['"',m,'" goes out to ',d===null?"...":d.toLocaleString()," subscribers right away. This cannot be undone."]})]}),a.jsxs(Qg,{children:[a.jsx(ev,{disabled:l,children:"Cancel"}),a.jsxs(tv,{onClick:j=>{j.preventDefault(),w()},disabled:l,children:[l?a.jsx(Se,{className:"h-4 w-4 mr-1 animate-spin"}):null,"Send now"]})]})]})})]})},Xz=()=>{const[e,t]=S.useState([]),r=()=>pn({action:"history"}).then(n=>t(n.sends)).catch(()=>{});return S.useEffect(()=>{r()},[]),a.jsxs(q,{children:[a.jsxs(se,{className:"flex flex-row items-center justify-between",children:[a.jsxs("div",{children:[a.jsx(oe,{children:"Send history"}),a.jsx(ge,{children:"Latest newsletters and test mails."})]}),a.jsx(z,{variant:"ghost",size:"sm",onClick:r,children:a.jsx(Zt,{className:"h-4 w-4"})})]}),a.jsx(K,{children:e.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"Nothing sent yet."}):a.jsx("div",{className:"divide-y divide-border text-sm",children:e.map(n=>{var i;return a.jsxs("div",{className:"py-2 flex justify-between gap-3",children:[a.jsxs("span",{className:"truncate",children:[n.kind==="test"?"[Test] ":"",n.subject]}),a.jsxs("span",{className:"text-muted-foreground whitespace-nowrap",children:[(i=n.recipient_count)==null?void 0:i.toLocaleString()," - ",new Date(n.created_at).toLocaleString()]})]},n.id)})})})]})},Bg=({label:e,value:t,multiline:r=!1,rows:n=2})=>{const[i,s]=S.useState(!1),o=async()=>{await navigator.clipboard.writeText(t),s(!0),de.success(`${e} copied!`),setTimeout(()=>s(!1),1500)};return a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Z,{className:"text-sm font-medium",children:e}),a.jsxs(z,{variant:"outline",size:"sm",onClick:o,disabled:!t,children:[i?a.jsx(ja,{className:"h-4 w-4 mr-1"}):a.jsx(Ki,{className:"h-4 w-4 mr-1"}),i?"Copied":"Copy"]})]}),r?a.jsx(Je,{value:t,readOnly:!0,rows:n,className:"text-sm"}):a.jsx(Q,{value:t,readOnly:!0,className:"text-sm"}),t&&a.jsxs("p",{className:"text-xs text-muted-foreground",children:[t.length," characters"]})]})},Yz=e=>{if(!e)return"";const t=new Date(e).getTime()-Date.now();if(!isFinite(t)||t<=0)return"ended";const r=Math.floor(t/6e4),n=Math.floor(r/(60*24)),i=Math.floor(r%(60*24)/60),s=r%60;return n>0?`${n}d ${i}h`:i>0?`${i}h ${String(s).padStart(2,"0")}m`:`${s}m`},Zz=()=>{const[e,t]=S.useState([]),[r,n]=S.useState(!1),[i,s]=S.useState(""),[o,l]=S.useState(""),[c,u]=S.useState(!1),[f,d]=S.useState(""),[h,m]=S.useState(""),[v,x]=S.useState(""),[p,w]=S.useState(!1),j=async()=>{n(!0);const{data:b,error:N}=await V.from("expired_auctions_hot").select("domain, formatted_domain, expires, tld_count, bid_count, current_bid_price").gte("expires",new Date().toISOString()).order("tld_count",{ascending:!1,nullsFirst:!1}).order("expires",{ascending:!0}).limit(200);if(n(!1),N){de.error("Could not load auctions");return}t(b||[])};S.useEffect(()=>{j()},[]);const _=S.useMemo(()=>{const b=o.trim().toLowerCase();return b?e.filter(N=>N.domain.toLowerCase().includes(b)):e},[e,o]),y=async()=>{if(!i){de.error("Please pick an editor's pick first.");return}u(!0),d(""),m(""),x("");try{const{data:b,error:N}=await V.functions.invoke("generate-newsletter-premium",{body:{featured_domain:i}});if(N)throw N;if(b!=null&&b.error)throw new Error(b.error);d((b==null?void 0:b.html)||""),m((b==null?void 0:b.subject)||""),x((b==null?void 0:b.preview)||""),de.success("Newsletter generated!")}catch(b){de.error((b==null?void 0:b.message)||"Error generating newsletter")}finally{u(!1)}},g=async()=>{await navigator.clipboard.writeText(f),w(!0),de.success("HTML copied to clipboard!"),setTimeout(()=>w(!1),1500)};return a.jsxs(q,{children:[a.jsxs(se,{children:[a.jsxs(oe,{className:"flex items-center",children:[a.jsx(li,{className:"h-5 w-5 mr-2 text-primary"}),"Premium Auctions Newsletter"]}),a.jsx(ge,{children:"Pick the editor's pick, generate the newsletter, and paste the HTML into Brevo. The next 14 premium auctions closing soonest are added automatically."})]}),a.jsxs(K,{className:"space-y-5",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx(Z,{className:"text-sm font-medium",children:"Editor's Pick"}),a.jsxs(z,{variant:"ghost",size:"sm",onClick:j,disabled:r,children:[a.jsx(Zt,{className:`h-4 w-4 mr-1 ${r?"animate-spin":""}`}),"Refresh"]})]}),a.jsx(Q,{placeholder:"Search domains...",value:o,onChange:b=>l(b.target.value),className:"text-sm"}),a.jsxs("div",{className:"max-h-72 overflow-y-auto rounded-md border border-input bg-background divide-y",children:[r&&a.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:"Loading auctions..."}),!r&&_.length===0&&a.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:"No auctions foun
275d."}),!r&&_.map(b=>{const N=i===b.domain,O=b.bid_count??0;return a.jsxs("button",{type:"button",onClick:()=>s(b.domain),className:`w-full text-left px-3 py-2 flex items-center justify-between gap-3 text-sm transition-colors ${N?"bg-primary/10 text-primary font-medium":"hover:bg-muted/60"}`,children:[a.jsxs("div",{className:"min-w-0 truncate",children:[a.jsx("span",{className:"font-medium",children:b.formatted_domain||b.domain}),a.jsxs("span",{className:"text-xs text-muted-foreground ml-2",children:["TLDs: ",b.tld_count??0," · Bids: ",O]})]}),a.jsxs("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:[Yz(b.expires)," left"]})]},b.domain)})]}),i&&a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Selected: ",a.jsx("span",{className:"font-medium text-foreground",children:i})]})]}),a.jsx(z,{onClick:y,disabled:c||!i,className:"w-full sm:w-auto",children:c?a.jsxs(a.Fragment,{children:[a.jsx(Se,{className:"h-4 w-4 mr-2 animate-spin"}),"Generating…"]}):a.jsxs(a.Fragment,{children:[a.jsx(li,{className:"h-4 w-4 mr-2"}),"Generate Newsletter"]})}),(h||v)&&a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 p-4 rounded-lg bg-muted/40 border border-border",children:[a.jsx(Bg,{label:"Subject line",value:h}),a.jsx(Bg,{label:"Preview text",value:v,multiline:!0,rows:2})]}),f&&a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Z,{className:"text-sm font-medium",children:"Generated HTML"}),a.jsxs(z,{variant:"outline",size:"sm",onClick:g,children:[p?a.jsx(ja,{className:"h-4 w-4 mr-1"}):a.jsx(Ki,{className:"h-4 w-4 mr-1"}),p?"Copied!":"Copy HTML"]})]}),a.jsx(Je,{value:f,readOnly:!0,rows:16,className:"font-mono text-xs"})]}),f&&a.jsx(Kz,{html:f,subject:h,preview:v})]})]})},Jz=`We just passed 2,000 members on GoExpired. To celebrate, anyone can get GX PRO for $2 (normally $9.99/month) by using promo code 2KMEMBERS at checkout. The offer expires August 31.
276
277Sell the value of GX PRO: unlimited appraisals, full access to all Top 100 lists, every Premium Auction unlocked, search and filters, watchlist alerts, Curated Drops and Telegram notifications, the generators, and 2 free newsletter listing spots per month.
278
279Include the price anchor: if a single domain found through GoExpired resells for just a couple of dollars more than it cost, the membership has already paid for itself.`,Fg=({label:e,value:t,multiline:r=!1,rows:n=2})=>{const[i,s]=S.useState(!1),o=async()=>{await navigator.clipboard.writeText(t),s(!0),de.success(`${e} copied!`),setTimeout(()=>s(!1),1500)};return a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Z,{className:"text-sm font-medium",children:e}),a.jsxs(z,{variant:"outline",size:"sm",onClick:o,disabled:!t,children:[i?a.jsx(ja,{className:"h-4 w-4 mr-1"}):a.jsx(Ki,{className:"h-4 w-4 mr-1"}),i?"Copied":"Copy"]})]}),r?a.jsx(Je,{value:t,readOnly:!0,rows:n,className:"text-sm"}):a.jsx(Q,{value:t,readOnly:!0,className:"text-sm"}),t&&a.jsxs("p",{className:"text-xs text-muted-foreground",children:[t.length," characters"]})]})},Qz=()=>{const[e,t]=S.useState(Jz),[r,n]=S.useState("Get GX PRO for $2"),[i,s]=S.useState("https://goexpired.com/gxpro"),[o,l]=S.useState("2KMEMBERS"),[c,u]=S.useState("Offer ends August 31"),[f,d]=S.useState("sales"),[h,m]=S.useState(!1),[v,x]=S.useState(""),[p,w]=S.useState(""),[j,_]=S.useState(""),[y,g]=S.useState(!1),b=async()=>{if(e.trim().length<10){de.error("Please write a brief first.");return}if(!/^https?:\/\//i.test(i.trim())){de.error("CTA link must start with http:// or https://");return}m(!0),x(""),w(""),_("");try{const{data:O,error:D}=await V.functions.invoke("generate-newsletter-custom",{body:{brief:e.trim().slice(0,4e3),cta_label:r.trim().slice(0,60),cta_url:i.trim().slice(0,500),promo_code:o.trim().slice(0,40),deadline:c.trim().slice(0,120),tone:f}});if(D)throw D;if(O!=null&&O.error)throw new Error(O.error);x((O==null?void 0:O.html)||""),w((O==null?void 0:O.subject)||""),_((O==null?void 0:O.preview)||""),de.success("Email generated!")}catch(O){de.error((O==null?void 0:O.message)||"Error generating email")}finally{m(!1)}},N=async()=>{await navigator.clipboard.writeText(v),g(!0),de.success("HTML copied to clipboard!"),setTimeout(()=>g(!1),1500)};return a.jsxs(q,{children:[a.jsxs(se,{children:[a.jsxs(oe,{className:"flex items-center",children:[a.jsx($f,{className:"h-5 w-5 mr-2 text-primary"}),"Custom Newsletter (text)"]}),a.jsx(ge,{children:"Write a brief and get a campaign email in the GoExpired template - same design as the auction newsletter, but with copy instead of auctions."})]}),a.jsxs(K,{className:"space-y-5",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Z,{className:"text-sm font-medium",children:"Brief - what should the email say?"}
279),a.jsx(Je,{value:e,onChange:O=>t(O.target.value),rows:10,maxLength:4e3,className:"text-sm",placeholder:"Describe the message, offer and angle..."}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:[e.length,"/4000 characters"]})]}),a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Z,{className:"text-sm font-medium",children:"CTA button label"}),a.jsx(Q,{value:r,onChange:O=>n(O.target.value),maxLength:60})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Z,{className:"text-sm font-medium",children:"CTA link"}),a.jsx(Q,{value:i,onChange:O=>s(O.target.value),maxLength:500})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Z,{className:"text-sm font-medium",children:"Promo code (optional)"}),a.jsx(Q,{value:o,onChange:O=>l(O.target.value),maxLength:40})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Z,{className:"text-sm font-medium",children:"Deadline text (optional)"}),a.jsx(Q,{value:c,onChange:O=>u(O.target.value),maxLength:120})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Z,{className:"text-sm font-medium",children:"Tone"}),a.jsxs(Gn,{value:f,onValueChange:d,children:[a.jsx(qn,{children:a.jsx(Vn,{})}),a.jsxs(Kn,{children:[a.jsx(vt,{value:"sales",children:"Sales"}),a.jsx(vt,{value:"announcement",children:"Announcement"}),a.jsx(vt,{value:"update",children:"Update"})]})]})]})]}),a.jsx(z,{onClick:b,disabled:h,className:"w-full sm:w-auto",children:h?a.jsxs(a.Fragment,{children:[a.jsx(Se,{className:"h-4 w-4 mr-2 animate-spin"}),"Generating…"]}):a.jsxs(a.Fragment,{children:[a.jsx($f,{className:"h-4 w-4 mr-2"}),"Generate Email"]})}),(p||j)&&a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 p-4 rounded-lg bg-muted/40 border border-border",children:[a.jsx(Fg,{label:"Subject line",value:p}),a.jsx(Fg,{label:"Preview text",value:j,multiline:!0,rows:2})]}),v&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Z,{className:"text-sm font-medium",children:"Generated HTML"}),a.jsxs(z,{variant:"outline",size:"sm",onClick:N,children:[y?a.jsx(ja,{className:"h-4 w-4 mr-1"}):a.jsx(Ki,{className:"h-4 w-4 mr-1"}),y?"Copied!":"Copy HTML"]})]}),a.jsx(Je,{value:v,readOnly:!0,rows:12,className:"font-mono text-xs"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Z,{className:"text-sm font-medium",children:"Preview"}),a.jsx("iframe",{title:"Email preview",srcDoc:v,sandbox:"",className:"w-full h-[700px] rounded-md border border-border bg-white"})]})]})]})]})},e9=()=>{const{exportUsersToCSV:e}=$t(),[t,r]=S.useState(!1),n=async()=>{r(!0);const i=await e();r(!1),i.success?be({title:"Export complete",description:`Downloaded ${i.count} users`}):be({title:"Export failed",description:"Could not export users. Check console for details.",variant:"destructive"})};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center lg:justify-between gap-4",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl lg:text-3xl font-bold text-foreground flex items-center",children:[a.jsx(qg,{className:"h-6 w-6 lg:h-7 lg:w-7 mr-2 text-primary"}),"Newsletter"]}),a.jsx("p",{className:"text-muted-foreground mt-1",children:"Generate the premium auctions newsletter for Brevo."})]}),a.jsxs(z,{onClick:n,disabled:t,children:[a.jsx(Cs,{className:"h-4 w-4 mr-2"}),t?"Exporting...":"Download all users (CSV)"]})]}),a.jsx(Vz,{}),a.jsx(Zz,{}),a.jsx(Xz,{}),a.jsx(Qz,{}),a.jsx(qz,{})]})};function t9(){const[e,t]=S.useState([]),[r,n]=S.useState(null),[i,s]=S.useState(""),o=async()=>{const{data:f}=await V.from("newsletter_paid_listings").select("*").neq("status","pending_payment").order("created_at",{ascending:!1}).limit(200);t(f||[])};S.useEffect(()=>{o()},[]);const l=async f=>{confirm("Remove this listing from future newsletters? (Refund must be done in Stripe.)")&&(await V.from("newsletter_paid_listings").update({status:"removed"}).eq("id",f),o())},c=f=>{n(f.id),s(f.link_url)},u=async()=>{if(!r)return;const f=i.trim();if(!/^https?:\/\//i.test(f)){alert("The link must start with http:// or https://");return}await V.from("newsletter_paid_listings").update({link_url:f}).eq("id",r),n(null),s(""),o()};return a.jsxs(q,{children:[a.jsx(se,{className:"pb-3",children:a.jsxs(oe,{className:"text-base",children:["Paid listings (",e.filter(f=>f.status==="active").length," active)"]})}),a.jsx(K,{children:e.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No paid listings yet."}):a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{className:"text-left text-muted-foreground",children:a.jsxs("tr",{children:[a.jsx("th",{className:"py-2",children:"Domain"}),a.jsx("th",{children:"Type"}),a.jsx("th",{children:"Price"}),a.jsx("th",{children:"Issues left"}),a.jsx("th",{children:"Paid"}),a.jsx("th",{children:"Buyer"}),a.jsx("th",{children:"Status"}),a.jsx("th",{})]})}),a.jsx("tbody",{children:e.map(f=>a.jsxs("tr",{className:"border-t",children:[a.jsx("td",{className:"py-2",children:r===f.
279id?a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("input",{type:"url",value:i,onChange:d=>s(d.target.value),className:"w-72 rounded border border-input bg-background px-2 py-1 text-sm"}),a.jsx(z,{size:"sm",onClick:u,children:"Save"}),a.jsx(z,{size:"sm",variant:"outline",onClick:()=>n(null),children:"Cancel"})]}):a.jsx("a",{href:f.link_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:f.domain})}),a.jsx("td",{children:f.listing_type==="auction"?"Auction":"BIN"}),a.jsxs("td",{children:["$",Number(f.price_usd).toLocaleString()]}),a.jsxs("td",{children:[f.issues_remaining," / ",f.issues_total]}),a.jsxs("td",{children:["$",(f.amount_cents/100).toFixed(2)]}),a.jsx("td",{children:f.buyer_email}),a.jsx("td",{children:f.status}),a.jsx("td",{children:a.jsxs("div",{className:"flex gap-2",children:[r!==f.id&&a.jsx(z,{size:"sm",variant:"outline",onClick:()=>c(f),children:"Edit link"}),f.status==="active"&&a.jsx(z,{size:"sm",variant:"outline",onClick:()=>l(f.id),children:"Remove"})]})})]},f.id))})]})})})]})}function r9(){const[e,t]=S.useState([]),[r,n]=S.useState(null),[i,s]=S.useState(null),[o,l]=S.useState(""),[c,u]=S.useState(""),[f,d]=S.useState(""),[h,m]=S.useState(1),[v,x]=S.useState(1),p=S.useRef(null),w=S.useRef(null),[j,_]=S.useState(""),[y,g]=S.useState(""),[b,N]=S.useState(1),[O,D]=S.useState(""),P=async()=>{const{data:F}=await V.from("newsletter_sponsor_banners").select("*").order("created_at",{ascending:!1}).limit(200);t(F||[])};S.useEffect(()=>{P()},[]);const E=async F=>{var R,te;const{data:G,error:re}=await V.functions.invoke("sponsor-admin-actions",{body:F});if(re){let A="Request failed";try{A=((te=await((R=re.context)==null?void 0:R.json()))==null?void 0:te.error)||A}catch{}throw new Error(A)}if(G!=null&&G.error)throw new Error(G.error);await P()},$=async F=>{n(F);try{await E({action:"approve",id:F})}catch(G){alert(G.message)}finally{n(null)}},I=async(F,G,re)=>{if(confirm(`Reject this banner and refund $${(G/100).toFixed(2)} to ${re}? The refund runs automatically in Stripe.`)){n(F);try{await E({action:"reject_refund",id:F})}catch(R){alert(R.message)}finally{n(null)}}},L=F=>{s(F),l(F.link_url),u(F.start_date),d(F.end_date),m(F.issues_total),x(F.issues_remaining)},U=async()=>{if(i){n(i.id);try{await E({action:"update",id:i.id,link_url:o,start_date:c,end_date:f,issues_total:h,issues_remaining:v}),s(null)}catch(F){alert(F.message)}finally{n(null)}}},T=async F=>{var re,R;const G=(R=(re=p.current)==null?void 0:re.files)==null?void 0:R[0];if(!G){alert("Choose an image file first.");return}if(!/^image\/(png|jpe?g)$/i.test(G.type)){alert("Must be PNG or JPG.");return}n(F);try{const te=await new Promise((A,X)=>{const le=new FileReader;le.onload=()=>A(String(le.result)),le.onerror=X,le.readAsDataURL(G)});await E({action:"update",id:F,image:te}),p.current&&(p.current.value="")}catch(te){alert(te.message)}finally{n(null)}},B=async()=>{var G,re;const F=(re=(G=w.current)==null?void 0:G.files)==null?void 0:re[0];if(!F||!j||!y){alert("Choose an image, link and start date.");return}if(!/^image\/(png|jpe?g)$/i.test(F.type)){alert("Must be PNG or JPG.");return}n("new");try{const R=await new Promise((te,A)=>{const X=new FileReader;X.onload=()=>te(String(X.result)),X.onerror=A,X.readAsDataURL(F)});await E({action:"create",image:R,link_url:j,start_date:y,issues_total:b,buyer_email:O}),_(""),g(""),N(1),D(""),w.current&&(w.current.value="")}catch(R){alert(R.message)}finally{n(null)}},W=e.filter(F=>F.status==="active").length,ae=e.filter(F=>F.status==="pending_review").length;return a.jsxs(q,{className:"mt-6",children:[a.jsx(se,{className:"pb-3",children:a.jsxs(oe,{className:"text-base",children:["Sponsor banners (",W," active, ",ae," awaiting approval)"]})}),a.jsxs(K,{children:[a.jsxs("div",{className:"mb-6 rounded-md border p-4 space-y-3",children:[a.jsx("p",{className:"text-sm font-medium",children:"Add banner manually (no payment, goes live on the start date)"}),a.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[a.jsxs("label",{className:"text-xs space-y-1",children:["Banner image (1200x400 PNG/JPG)",a.jsx(Q,{ref:w,type:"file",accept:"image/png,image/jpeg"})]}),a.jsxs("label",{className:"text-xs space-y-1",children:["Link",a.jsx(Q,{value:j,onChange:F=>_(F.target.value),placeholder:"https://..."})]}),a.jsxs("label",{className:"text-xs space-y-1",children:["Start date",a.jsx(Q,{type:"date",value:y,onChange:F=>g(F.target.value)})]}),a.jsxs("label",{className:"text-xs space-y-1",children:["Number of issues (days)",a.jsx(Q,{type:"number",min:1,max:30,value:b,onChange:F=>N(Math.max(1,Math.min(30,Number(F.target.value)||1)))})]}),a.jsxs("label",{className:"text-xs space-y-1 md:col-span-2",children:["Sponsor email (optional)",a.jsx(Q,{value:O,onChange:F=>D(F.target.value),placeholder:"[email protected]"})]})]}),a.jsxs(z,{size:"sm",onClick:B,disabled:r==="new",children:[r==="new"&&a.jsx(Se,{className:"h-4 w-4 animate-spin mr-1"}),"Add banner"]})]}),e.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No sponsor banner bookings yet."}):a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{className:"text-left text-muted-foreground",children:a.jsxs("tr",{children:[a.jsx("th",{className:"py-2",children:"Banner"}),a.jsx("th",{children:"Dates"}),a.jsx("th",{children:"Issues left"}),a.jsx("th",{children:"Paid"}),a.jsx("th",{children:"Buyer"}),a.jsx("th",{children:"Status"}),a.jsx("th",{children:"Actions"})]})}),a.jsx("tbody",{children:e.map(F=>a.jsxs("tr",{className:"border-t",children:[a.jsx("td",{className:"py-2",children:a.jsx("a",{href:F.link_url,target:"_blank",rel:"noopener noreferrer",children:a.jsx("img",{src:F.image_url,alt:"banner",className:"h-10 w-[120px] object-cover rounded border"})})}),a.jsxs("td",{children:[F.start_date," → ",F.end_date]}),a.jsxs("td",{children:[F.issues_remaining," / ",F.issues_total]}),a.jsxs("td",{children:["$",(F.amount_cents/100).toFixed(2)]}),a.jsx("td",{children:F.buyer_email}),a.jsx("td",{children:F.status}),a.jsxs("td",{className:"space-x-2 whitespace-nowrap",children:[F.status==="pending_review"&&a.jsx(z,{size:"sm",onClick:()=>$(F.id),disabled:r===F.id,children:r===F.id?a.jsx(Se,{className:"h-4 w-4 animate-spin"}):"Approve"}),["pending_review","active"].includes(F.status)&&a.jsx(z,{size:"sm",variant:"outline",onClick:()=>I(F.id,F.amount_cents,F.buyer_email),disabled:r===F.id,children:"Reject & refund"}),a.jsx(z,{size:"sm",variant:"outline",onClick:()=>L(F),children:"Edit"}),a.jsx("input",{ref:p,type:"file",accept:"image/png,image/jpeg",className:"hidden",onChange:()=>T(F.id)}),a.jsx(z,{size:"sm",variant:"outline",onClick:()=>{var G;return(G=p.current)==null?void 0:G.click()},disabled:r===F.id,children:"Replace image"})]})]},F.id))})]})})]}),i&&a.jsxs(K,{className:"border-t pt-4",children:[a.jsxs("p",{className:"text-sm font-medium mb-3",children:["Edit booking ",i.start_date," → ",i.end_date]}),a.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[a.jsxs("label",{className:"text-sm",children:[a.jsx("span",{className:"block mb-1",children:"Link URL"}),a.jsx(Q,{value:o,onChange:F=>l(F.target.value)})]}),a.jsxs("label",{className:"text-sm",children:[a.jsx("span",{className:"block mb-1",children:"Start date"}),a.jsx(Q,{type:"date",value:c,onChange:F=>u(F.target.value)})]}),a.jsxs("label",{className:"text-sm",children:[a.jsx("span",{className:"block mb-1",children:"End date"}),a.jsx(Q,{type:"date",value:f,onChange:F=>d(F.target.value)})]}),a.jsxs("label",{className:"text-sm",children:[a.jsx("span",{className:"block mb-1",children:"Issues total"}),a.jsx(Q,{type:"number",min:1,max:30,value:h,onChange:F=>m(Number(F.target.value))})]}),a.jsxs("label",{className:"text-sm",children:[a.jsx("span",{className:"block mb-1",children:"Issues remaining"}
279),a.jsx(Q,{type:"number",min:0,max:30,value:v,onChange:F=>x(Number(F.target.value))})]})]}),a.jsxs("div",{className:"mt-4 space-x-2",children:[a.jsx(z,{onClick:U,disabled:r===i.id,children:r===i.id?a.jsx(Se,{className:"h-4 w-4 animate-spin"}):"Save changes"}),a.jsx(z,{variant:"outline",onClick:()=>s(null),children:"Cancel"})]})]})]})}const o0=[{value:"domain_mismatch",label:"Domain does not match the sales page"},{value:"unsupported_platform",label:"Sales page is not on an approved platform"},{value:"price_mismatch",label:"Price does not match the sales page"},{value:"end_user_price",label:"Price is clearly an end-user price"},{value:"other",label:"Other (add a note)"}],n9=Object.fromEntries(o0.map(e=>[e.value,e.label]));function a9(e){const t={pending:{label:"Pending",cls:"bg-yellow-100 text-yellow-800 border-yellow-200"},approved:{label:"Approved",cls:"bg-green-100 text-green-800 border-green-200"},rejected:{label:"Rejected",cls:"bg-red-100 text-red-800 border-red-200"},published:{label:"Published",cls:"bg-blue-100 text-blue-800 border-blue-200"}},{label:r,cls:n}=t[e];return a.jsx(Oe,{variant:"outline",className:n,children:r})}const i9=()=>{const[e,t]=S.useState([]),[r,n]=S.useState(!0),[i,s]=S.useState("pending"),[o,l]=S.useState(""),[c,u]=S.useState(null),[f,d]=S.useState(!1),[h,m]=S.useState(null),[v,x]=S.useState("domain_mismatch"),[p,w]=S.useState(""),[j,_]=S.useState(!1),[y,g]=S.useState(null),[b,N]=S.useState(""),[O,D]=S.useState(""),[P,E]=S.useState(""),[$,I]=S.useState(""),[L,U]=S.useState(!1),T=async()=>{n(!0);const{data:A,error:X}=await V.from("newsletter_submissions").select("*").order("submitted_at",{ascending:!1});if(X){be({title:"Failed to load submissions",description:X.message,variant:"destructive"}),n(!1);return}t((A||[]).map(he=>({...he}))),n(!1)};S.useEffect(()=>{T()},[]);const B=S.useMemo(()=>{const A={pending:0,approved:0,rejected:0,published:0};return e.forEach(X=>{A[X.status]++}),A},[e]),W=S.useMemo(()=>{const A=o.trim().toLowerCase();return e.filter(X=>X.status===i&&(!A||X.domain.toLowerCase().includes(A)||(X.user_id||"").toLowerCase().includes(A)))},[e,i,o]),ae=async A=>{u(A.id);const{error:X}=await V.functions.invoke("review-newsletter-submission",{body:{id:A.id,action:"approve"}});if(u(null),X)return be({title:"Approve failed",description:X.message,variant:"destructive"});be({title:"Approved",description:`${A.domain} added to the newsletter queue.`}),T()},F=A=>{m(A),x("domain_mismatch"),w(""),d(!0)},G=async()=>{if(!h)return;u(h.id);const{error:A}=await V.functions.invoke("review-newsletter-submission",{body:{id:h.id,action:"reject",reason:v,note:p||null}});if(u(null),A)return be({title:"Reject failed",description:A.message,variant:"destructive"});be({title:"Rejected",description:`${h.domain} marked as rejected.`}),d(!1),m(null),T()},re=A=>{navigator.clipboard.writeText(A),be({title:"Copied",description:A})},R=A=>{g(A),N(A.domain),D(String(A.price_usd??"")),E(A.link_url),I(A.platform||""),_(!0)},te=async()=>{if(!y)return;const A=Number(O);if(!b.trim()||!P.trim()||!Number.isFinite(A)||A<=0){be({title:"Invalid input",description:"Please provide a valid domain, link, and price.",variant:"destructive"});return}U(!0);const{error:X}=await V.from("newsletter_submissions").update({domain:b.trim().toLowerCase(),price_usd:A,link_url:P.trim(),platform:$.trim()||null}).eq("id",y.id);if(U(!1),X)return be({title:"Save failed",description:X.message,variant:"destructive"});be({title:"Updated",description:`${b} updated.`}),_(!1),g(null),T()};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl lg:text-3xl font-bold text-foreground flex items-center",children:[a.jsx(iv,{className:"h-6 w-6 lg:h-7 lg:w-7 mr-2 text-primary"}),"Submissions"]}),a.jsx("p",{className:"text-muted-foreground mt-1",children:"Review domains submitted by GX PRO members for the newsletter."})]}),a.jsxs(q,{children:[a.jsx(se,{className:"pb-3",children:a.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[a.jsx(oe,{className:"text-base",children:"Queue"}),a.jsxs("div",{className:"relative w-full sm:w-64",children:[a.jsx(Mo,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),a.jsx(Q,{placeholder:"Search domain or user id...",value:o,onChange:A=>l(A.target.value),className:"pl-8"})]})]})}),a.jsx(K,{children:a.jsxs(Sn,{value:i,onValueChange:A=>s(A),children:[a.jsxs(Vr,{className:"mb-4",children:[a.jsxs(Ke,{value:"pending",children:["Pending (",B.pending,")"]}),a.jsxs(Ke,{value:"approved",children:["Approved (",B.approved,")"]}),a.jsxs(Ke,{value:"published",children:["Published (",B.published,")"]}),a.jsxs(Ke,{value:"rejected",children:["Rejected (",B.rejected,")"]})]}),a.jsx(ht,{value:i,className:"mt-0",children:r?a.jsx("div",{className:"py-10 text-center text-muted-foreground",children:"Loading..."}):W.length===0?a.jsx("div",{className:"py-10 text-center text-muted-foreground",children:"No submissions."}):a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{className:"text-left text-muted-foreground border-b border-border",children:a.jsxs("tr",{children:[a.jsx("th",{className:"py-2 pr-4 font-medium",children:"Domain"}),a.jsx("th",{className:"py-2 pr-4 font-medium",children:"Price"}),a.jsx("th",{className:"py-2 pr-4 font-medium",children:"Platform"}),a.jsx("th",{className:"py-2 pr-4 font-medium",children:"Link"}),a.jsx("th",{className:"py-2 pr-4 font-medium",children:"User"}),a.jsx("th",{className:"py-2 pr-4 font-medium",children:"Submitted"}),a.jsx("th",{className:"py-2 pr-4 font-medium",children:"Status"}),a.jsx("th",{className:"py-2 pr-2 font-medium text-right",children:"Actions"})]})}),a.jsx("tbody",{children:W.map(A=>a.jsxs("tr",{className:"border-b border-border/60 hover:bg-muted/30",children:[a.jsxs("td",{className:"py-3 pr-4",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-medium text-foreground",children:A.domain}),a.jsx("button",{onClick:()=>re(A.domain),className:"text-muted-foreground hover:text-foreground",children:a.jsx(Ki,{className:"h-3.5 w-3.5"})})]}),A.status==="rejected"&&A.rejection_reason&&a.jsxs("div",{className:"mt-1 text-xs text-red-700",children:[n9[A.rejection_reason]||A.rejection_reason,A.rejection_note?` - ${A.rejection_note}`:""]})]}),a.jsxs("td",{className:"py-3 pr-4",children:["$",Number(A.price_usd).toLocaleStr
279ing("en-US")]}),a.jsx("td",{className:"py-3 pr-4",children:a.jsx(Oe,{variant:"outline",className:"capitalize",children:A.platform||"-"})}),a.jsx("td",{className:"py-3 pr-4",children:a.jsxs("a",{href:A.link_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline inline-flex items-center gap-1",children:["Open ",a.jsx(ed,{className:"h-3 w-3"})]})}),a.jsx("td",{className:"py-3 pr-4 text-xs text-muted-foreground font-mono",children:A.user_id.slice(0,8)}),a.jsx("td",{className:"py-3 pr-4 text-muted-foreground",children:new Date(A.submitted_at).toLocaleString()}),a.jsx("td",{className:"py-3 pr-4",children:a9(A.status)}),a.jsx("td",{className:"py-3 pr-2 text-right",children:A.status==="pending"?a.jsxs("div",{className:"inline-flex gap-2",children:[a.jsxs(z,{size:"sm",variant:"outline",onClick:()=>ae(A),disabled:c===A.id,children:[c===A.id?a.jsx(Se,{className:"h-3.5 w-3.5 animate-spin"}):a.jsx(ja,{className:"h-3.5 w-3.5 mr-1"}),"Approve"]}),a.jsxs(z,{size:"sm",variant:"outline",className:"text-red-700 hover:text-red-800 hover:bg-red-50",onClick:()=>F(A),disabled:c===A.id,children:[a.jsx(Vi,{className:"h-3.5 w-3.5 mr-1"}),"Reject"]})]}):A.status==="approved"||A.status==="published"?a.jsxs(z,{size:"sm",variant:"outline",onClick:()=>R(A),children:[a.jsx(Io,{className:"h-3.5 w-3.5 mr-1"}),"Edit"]}):a.jsx("span",{className:"text-xs text-muted-foreground",children:"-"})})]},A.id))})]})})})]})})]}),a.jsx(br,{open:f,onOpenChange:d,children:a.jsxs(jr,{children:[a.jsxs(wr,{children:[a.jsx(_r,{children:"Reject submission"}),a.jsx(ti,{children:h?a.jsxs(a.Fragment,{children:["Reject ",a.jsx("strong",{children:h.domain})," and let the user know why."]}):null})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium mb-1.5 block",children:"Reason"}),a.jsxs(Gn,{value:v,onValueChange:x,children:[a.jsx(qn,{children:a.jsx(Vn,{})}),a.jsx(Kn,{children:o0.map(A=>a.jsx(vt,{value:A.value,children:A.label},A.value))})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium mb-1.5 block",children:"Note (optional, shown to user)"}),a.jsx(Je,{value:p,onChange:A=>w(A.target.value),placeholder:"Add a short clarifying note...",rows:3,maxLength:500})]})]}),a.jsxs(dn,{children:[a.jsx(z,{variant:"outline",onClick:()=>d(!1),children:"Cancel"}),a.jsxs(z,{variant:"destructive",onClick:G,disabled:c===(h==null?void 0:h.id),children:[c===(h==null?void 0:h.id)?a.jsx(Se,{className:"h-4 w-4 animate-spin mr-2"}):null,"Reject"]})]})]})}),a.jsx(br,{open:j,onOpenChange:_,children:a.jsxs(jr,{children:[a.jsxs(wr,{children:[a.jsx(_r,{children:"Edit submission"}),a.jsx(ti,{children:"Update the domain details. Changes apply immediately."})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium mb-1.5 block",children:"Domain"}),a.jsx(Q,{value:b,onChange:A=>N(A.target.value),placeholder:"example.com"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium mb-1.5 block",children:"BIN Price (USD)"}),a.jsx(Q,{type:"number",min:"1",value:O,onChange:A=>D(A.target.value)})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium mb-1.5 block",children:"Link URL"}),a.jsx(Q,{value:P,onChange:A=>E(A.target.value),placeholder:"https://..."})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium mb-1.5 block",children:"Platform"}),a.jsx(Q,{value:$,onChange:A=>I(A.target.value),placeholder:"Sedo, Dan, Afternic..."})]})]}),a.jsxs(dn,{children:[a.jsx(z,{variant:"outline",onClick:()=>_(!1),children:"Cancel"}),a.jsxs(z,{onClick:te,disabled:L,children:[L?a.jsx(Se,{className:"h-4 w-4 animate-spin mr-2"}):null,"Save changes"]})]})]})}),a.jsx(t9,{}),a.jsx(r9,{})]})},s9=()=>{const{toast:e}=_n(),[t,r]=S.useState([]),[n,i]=S.useState({}),[s,o]=S.useState(!1),[l,c]=S.useState(null),[u,f]=S.useState(""),[d,h]=S.useState(""),[m,v]=S.useState(""),[x,p]=S.useState(!0),[w,j]=S.useState(!0),[_,y]=S.useState(!1),g=async()=>{o(!0);const{data:I,error:L}=await V.from("notifications").select("id,title,body,link_url,target_tiers,created_at").order("created_at",{ascending:!1});if(L){e({title:"Failed to load",description:L.message,variant:"destructive"}),o(!1);return}r(I??[]),(I??[]).map(W=>W.id);const{data:U,error:T}=await V.rpc("get_notification_stats");T&&e({title:"Failed to load stats",description:T.message,variant:"destructive"});const B={};
279(I??[]).forEach(W=>{B[W.id]={free:{sent:0,opens:0},pro:{sent:0,opens:0}}}),(U??[]).forEach(W=>{const ae=B[W.notification_id];if(!ae)return;const F=W.tier;F!=="free"&&F!=="pro"||(ae[F]={sent:Number(W.sent)||0,opens:Number(W.opens)||0})}),i(B),o(!1)};S.useEffect(()=>{g()},[]);const b=()=>{c(null),f(""),h(""),v(""),p(!0),j(!0)},N=I=>{c(I.id),f(I.title),h(I.body),v(I.link_url??""),p(I.target_tiers.includes("free")),j(I.target_tiers.includes("pro")),window.scrollTo({top:0,behavior:"smooth"})},O=async()=>{if(!u.trim()||!d.trim()){e({title:"Title and body are required",variant:"destructive"});return}if(!x&&!w){e({title:"Select at least one target tier",variant:"destructive"});return}const I=[];x&&I.push("free"),w&&I.push("pro"),y(!0);try{if(l){const{error:L}=await V.from("notifications").update({title:u.trim(),body:d.trim(),link_url:m.trim()||null,target_tiers:I}).eq("id",l);if(L)throw L;e({title:"Notification updated"})}else{const{data:{user:L}}=await V.auth.getUser(),{error:U}=await V.from("notifications").insert({title:u.trim(),body:d.trim(),link_url:m.trim()||null,target_tiers:I,created_by:(L==null?void 0:L.id)??null});if(U)throw U;e({title:"Notification sent"})}b(),g()}catch(L){e({title:"Save failed",description:L.message,variant:"destructive"})}finally{y(!1)}},D=async I=>{if(!confirm("Delete this notification? This cannot be undone."))return;const{error:L}=await V.from("notifications").delete().eq("id",I);L?e({title:"Delete failed",description:L.message,variant:"destructive"}):(e({title:"Notification deleted"}),l===I&&b(),g())},[P,E]=S.useState(null),$=async I=>{E(I);const L={test_email:"[email protected]"};I==="removed"&&(L.test_removed=!0);const{data:U,error:T}=await V.functions.invoke("watchlist-alerts",{body:L});if(E(null),T){e({title:"Test send failed",description:T.message,variant:"destructive"});return}e({title:"Test email sent",description:`Sent to [email protected] (${I})`}),console.log("watchlist-alerts test result:",U)};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs(q,{children:[a.jsx(se,{children:a.jsx(oe,{children:"Watchlist alerts – test emails"})}),a.jsxs(K,{className:"flex flex-wrap gap-3",children:[a.jsx(z,{onClick:()=>$("alert"),disabled:P!==null,variant:"outline",children:P==="alert"?"Sending…":"Send test '1 hour' alert"}),a.jsx(z,{onClick:()=>$("removed"),disabled:P!==null,children:P==="removed"?"Sending…":"Send test 'auction removed' alert"})]})]}),a.jsxs(q,{children:[a.jsx(se,{children:a.jsx(oe,{children:l?"Edit notification":"Send a new notification"})}),a.jsxs(K,{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium mb-1 block",children:"Title"}),a.jsx(Q,{value:u,onChange:I=>f(I.target.value),placeholder:"e.g. New feature released",maxLength:200})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium mb-1 block",children:"Body"}),a.jsx(Je,{value:d,onChange:I=>h(I.target.value),placeholder:"Write the notification message…",rows:4})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium mb-1 block",children:"Link URL (optional)"}),a.jsx(Q,{value:m,onChange:I=>v(I.target.value),placeholder:"https://… or /internal-path"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium mb-2 block",children:"Send to"}),a.jsxs("div",{className:"flex items-center gap-6",children:[a.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[a.jsx(Xn,{checked:x,onCheckedChange:I=>p(!!I)}),a.jsx("span",{className:"text-sm",children:"Free users"})]}),a.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[a.jsx(Xn,{checked:w,onCheckedChange:I=>j(!!I)}),a.jsx("span",{className:"text-sm",children:"GX PRO users"})]})]})]}),a.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[a.jsxs(z,{onClick:O,disabled:_,style:{backgroundColor:"#2563EB",color:"white"},className:"hover:opacity-90",children:[a.jsx(pr,{className:"w-4 h-4 mr-2"}),l?"Save changes":"Send notification"]}),l&&a.jsxs(z,{variant:"ghost",onClick:b,children:[a.jsx(Vi,{className:"w-4 h-4 mr-2"})," Cancel edit"]})]})]})]}),a.jsxs(q,{children:[a.jsx(se,{children:a.jsxs(oe,{children:["Sent notifications (",t.length,")"]})}),a.jsx(K,{children:s?a.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading…"}):t.length===0?a.jsx("div",{className:"text-sm text-muted-foreground",children:"No notifications sent yet."}):a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{className:"text-left text-muted-foreground border-b border-border",children:a.jsxs("tr",{children:[a.jsx("th",{className:"py-2 pr-3",children:"Title"}),a.jsx("th",{className:"py-2 pr-3",children:"Tiers"}),a.jsx("th",{className:"py-2 pr-3",children:"Sent at"}),a.jsx("th",{className:"py-2 pr-3",children:"FREE"}),a.jsx("th",{className:"py-2 pr-3",children:"GX PRO"}),a.jsx("th",{className:"py-2 pr-3 text-right",children:"Actions"})]})}),a.jsx("tbody",{children:t.map(I=>{const L=n[I.id],U=(T,B)=>{if(!B)return a.jsx("span",{className:"text-muted-foreground",children:"—"});const W=T.sent>0?Math.round(T.opens/T.sent*100):0;return a.jsxs("div",{className:"text-xs leading-5",children:[a.jsxs("div",{children:["Sent: ",a.jsx("span",{className:"font-medium",children:T.sent})]}),a.jsxs("div",{children:["Opens: ",a.jsx("span",{className:"font-medium",children:T.opens})," (",W,"%)"]})]})};return a.jsxs("tr",{className:"border-b border-border last:border-0 align-top",children:[a.jsxs("td",{className:"py-2 pr-3",children:[a.jsx("div",{className:"font-medium",children:I.title}),a.jsx("div",{className:"text-xs text-muted-foreground line-clamp-1 max-w-md",children:I.body})]}),a.jsx("td",{className:"py-2 pr-3",children:a.jsx("div",{className:"flex gap-1",children:I.target_tiers.map(T=>a.jsx(Oe,{variant:"secondary",className:"text-[10px]",children:T.toUpperCase()},T))})}),a.jsx("td",{className:"py-2 pr-3 whitespace-nowrap text-xs text-muted-foreground",children:ci(new Date(I.created_at),"yyyy-MM-dd HH:mm")}
279),a.jsx("td",{className:"py-2 pr-3",children:L?U(L.free,I.target_tiers.includes("free")):"—"}),a.jsx("td",{className:"py-2 pr-3",children:L?U(L.pro,I.target_tiers.includes("pro")):"—"}),a.jsxs("td",{className:"py-2 pr-3 text-right",children:[a.jsx(z,{size:"sm",variant:"ghost",onClick:()=>N(I),children:a.jsx(Io,{className:"w-3.5 h-3.5"})}),a.jsx(z,{size:"sm",variant:"ghost",onClick:()=>D(I.id),children:a.jsx(Cr,{className:"w-3.5 h-3.5 text-red-600"})})]})]},I.id)})})]})})})]})]})},vc=50,xc=e=>e.split(/[\s,;\n\r\t]+/).map(t=>t.trim().toLowerCase().replace(/[^a-z0-9-]/g,"")).filter(t=>t.length>0&&t.length<=32),o9=()=>{const[e,t]=S.useState("prefix"),[r,n]=S.useState([]),[i,s]=S.useState(!1),[o,l]=S.useState(""),[c,u]=S.useState(1),[f,d]=S.useState({prefix:0,suffix:0}),[h,m]=S.useState(""),[v,x]=S.useState(""),[p,w]=S.useState(!1),[j,_]=S.useState(null),[y,g]=S.useState(""),[b,N]=S.useState(new Set),O=S.useRef(null),D=async()=>{s(!0);const[{data:R,error:te},A,X]=await Promise.all([V.from("atom_fragments").select("id, word, kind").eq("kind",e).order("word",{ascending:!0}).limit(5e3),V.from("atom_fragments").select("id",{count:"exact",head:!0}).eq("kind","prefix"),V.from("atom_fragments").select("id",{count:"exact",head:!0}).eq("kind","suffix")]);te&&de.error(te.message),n(R??[]),d({prefix:A.count??0,suffix:X.count??0}),N(new Set),u(1),s(!1)};S.useEffect(()=>{D()},[e]);const P=S.useMemo(()=>{const R=o.trim().toLowerCase();return R?r.filter(te=>te.word.includes(R)):r},[r,o]),E=Math.max(1,Math.ceil(P.length/vc)),$=P.slice((c-1)*vc,c*vc),I=async()=>{const R=xc(h);if(R.length===0){de.error("Enter a word");return}const te=R.map(le=>({word:le,kind:e})),{error:A,count:X}=await V.from("atom_fragments").upsert(te,{onConflict:"word,kind",ignoreDuplicates:!0,count:"exact"});if(A)return de.error(A.message);de.success(`Added ${X??0} new, skipped ${R.length-(X??0)} duplicates`),m(""),D()},L=async()=>{const R=Array.from(new Set(xc(v)));if(R.length===0){de.error("Nothing to upload");return}w(!0);const te=R.map(le=>({word:le,kind:e})),{error:A,count:X}=await V.from("atom_fragments").upsert(te,{onConflict:"word,kind",ignoreDuplicates:!0,count:"exact"});if(w(!1),A)return de.error(A.message);de.success(`Added ${X??0} new ${e}es, skipped ${R.length-(X??0)} duplicates`),x(""),D()},U=async R=>{const te=await R.text();x(A=>(A?A+`
280`:"")+te)},T=async R=>{if(!confirm("Delete this word?"))return;const{error:te}=await V.from("atom_fragments").delete().eq("id",R);if(te)return de.error(te.message);de.success("Deleted"),D()},B=async()=>{if(b.size===0||!confirm(`Delete ${b.size} selected word(s)?`))return;const{error:R}=await V.from("atom_fragments").delete().in("id",Array.from(b));if(R)return de.error(R.message);de.success(`Deleted ${b.size}`),D()},W=R=>{_(R.id),g(R.word)},ae=async R=>{const te=xc(y)[0];if(!te)return de.error("Invalid word");const{error:A}=await V.from("atom_fragments").update({word:te}).eq("id",R);if(A)return de.error(A.message);_(null),g(""),de.success("Updated"),D()},F=()=>{const R=r.map(le=>le.word).join(`
281`),te=new Blob([R],{type:"text/plain"}),A=URL.createObjectURL(te),X=document.createElement("a");X.href=A,X.download=`atom_fragments_${e}_${new Date().toISOString().slice(0,10)}.txt`,X.click(),URL.revokeObjectURL(A)},G=R=>{N(te=>{const A=new Set(te);return A.has(R)?A.delete(R):A.add(R),A})},re=()=>{const R=$.every(te=>b.has(te.id));N(te=>{const A=new Set(te);return R?$.forEach(X=>A.delete(X.id)):$.forEach(X=>A.add(X.id)),A})};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-2xl font-bold text-foreground",children:"Brandable Library"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage the prefix and suffix word library used by the /brandable-generator page."})]}),a.jsxs(Sn,{value:e,onValueChange:R=>t(R),children:[a.jsxs(Vr,{children:[a.jsxs(Ke,{value:"prefix",children:["Prefixes ",a.jsx(Oe,{variant:"secondary",className:"ml-2",children:f.prefix})]}),a.jsxs(Ke,{value:"suffix",children:["Suffixes ",a.jsx(Oe,{variant:"secondary",className:"ml-2",children:f.suffix})]})]}),a.jsxs(ht,{value:e,className:"space-y-6 mt-6",children:[a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[a.jsxs(q,{children:[a.jsxs(se,{children:[a.jsxs(oe,{className:"text-base",children:["Add ",e]}),a.jsx(ge,{children:"Enter one or more words (comma or space separated)."})]}),a.jsxs(K,{className:"flex gap-2",children:[a.jsx(Q,{value:h,onChange:R=>m(R.target.value),placeholder:e==="prefix"?"e.g. neo, lumi, zen":"e.g. ly, ify, hub",onKeyDown:R=>R.key==="Enter"&&I()}),a.jsxs(z,{onClick:I,children:[a.jsx(qr,{className:"h-4 w-4 mr-1"})," Add"]})]})]}),a.jsxs(q,{children:[a.jsxs(se,{children:[a.jsxs(oe,{className:"text-base",children:["Bulk upload ",e,"es"]}),a.jsx(ge,{children:"Paste a list or upload a .txt/.csv file. Duplicates are skipped automatically."})]}),a.jsxs(K,{className:"space-y-2",children:[a.jsx(Je,{value:v,onCh
281ange:R=>x(R.target.value),rows:4,placeholder:"One word per line, or comma/space separated"}),a.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.jsxs(z,{onClick:L,disabled:p,children:[a.jsx(ui,{className:"h-4 w-4 mr-1"})," ",p?"Uploading…":"Upload words"]}),a.jsxs(z,{variant:"outline",onClick:()=>{var R;return(R=O.current)==null?void 0:R.click()},children:[a.jsx(ui,{className:"h-4 w-4 mr-1"})," Load from file"]}),a.jsx("input",{ref:O,type:"file",accept:".txt,.csv,text/plain",className:"hidden",onChange:R=>{var A;const te=(A=R.target.files)==null?void 0:A[0];te&&U(te),R.target.value=""}}),a.jsxs(z,{variant:"outline",onClick:F,children:[a.jsx(Cs,{className:"h-4 w-4 mr-1"})," Export current"]})]})]})]})]}),a.jsxs(q,{children:[a.jsxs(se,{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[a.jsxs("div",{children:[a.jsxs(oe,{className:"text-base",children:["Current ",e," library"]}),a.jsxs(ge,{children:["Showing ",$.length," of ",P.length," (total ",f[e],")"]})]}),a.jsxs("div",{className:"flex gap-2 items-center",children:[a.jsxs("div",{className:"relative",children:[a.jsx(Mo,{className:"h-4 w-4 absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),a.jsx(Q,{value:o,onChange:R=>{l(R.target.value),u(1)},placeholder:"Search…",className:"pl-8 w-56"})]}),b.size>0&&a.jsxs(z,{variant:"destructive",size:"sm",onClick:B,children:[a.jsx(Cr,{className:"h-4 w-4 mr-1"})," Delete ",b.size]})]})]}),a.jsx(K,{children:i?a.jsx("p",{className:"text-sm text-muted-foreground py-6 text-center",children:"Loading…"}):a.jsxs(a.Fragment,{children:[a.jsxs(td,{children:[a.jsx(rd,{children:a.jsxs(fn,{children:[a.jsx(Tt,{className:"w-10",children:a.jsx(Xn,{checked:$.length>0&&$.every(R=>b.has(R.id)),onCheckedChange:re})}),a.jsx(Tt,{children:"Word"}),a.jsx(Tt,{className:"w-44 text-right",children:"Actions"})]})}),a.jsxs(nd,{children:[$.map(R=>a.jsxs(fn,{children:[a.jsx(_t,{children:a.jsx(Xn,{checked:b.has(R.id),onCheckedChange:()=>G(R.id)})}),a.jsx(_t,{children:j===R.id?a.jsx(Q,{value:y,onChange:te=>g(te.target.value),onKeyDown:te=>{te.key==="Enter"&&ae(R.id),te.key==="Escape"&&_(null)},autoFocus:!0}):a.jsx("span",{className:"font-mono",children:R.word})}),a.jsx(_t,{className:"text-right",children:j===R.id?a.jsxs("div",{className:"flex gap-1 justify-end",children:[a.jsx(z,{size:"sm",variant:"outline",onClick:()=>ae(R.id),children:a.jsx(ja,{className:"h-4 w-4"})}),a.jsx(z,{size:"sm",variant:"ghost",onClick:()=>_(null),children:a.jsx(Vi,{className:"h-4 w-4"})})]}):a.jsxs("div",{className:"flex gap-1 justify-end",children:[a.jsx(z,{size:"sm",variant:"ghost",onClick:()=>W(R),children:a.jsx(Io,{className:"h-4 w-4"})}),a.jsx(z,{size:"sm",variant:"ghost",className:"text-destructive hover:text-destructive",onClick:()=>T(R.id),children:a.jsx(Cr,{className:"h-4 w-4"})})]})})]},R.id)),$.length===0&&a.jsx(fn,{children:a.jsxs(_t,{colSpan:3,className:"text-center text-muted-foreground py-6",children:["No ",e,"es found."]})})]})]}),E>1&&a.jsxs("div",{className:"flex items-center justify-between pt-4",children:[a.jsx(z,{variant:"outline",size:"sm",onClick:()=>u(R=>Math.max(1,R-1)),disabled:c===1,children:"Previous"}),a.jsxs("span",{className:"text-sm text-muted-foreground",children:["Page ",c," of ",E]}),a.jsx(z,{variant:"outline",size:"sm",onClick:()=>u(R=>Math.min(E,R+1)),disabled:c===E,children:"Next"})]})]})})]})]})]})]})},Ug=/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?(\.[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)+$/i,l9=()=>{const[e,t]=S.useState([]),[r,n]=S.useState(!0),[i,s]=S.useState(null),[o,l]=S.useState(""),[c,u]=S.useState(new Date().toISOString().slice(0,10)),[f,d]=S.useState(""),[h,m]=S.useState(""),v=async()=>{n(!0);const{data:g,error:b}=await V.from("won_auctions").select("*").order("sort_order",{ascending:!0}).order("won_at",{ascending:!1});b?be({title:"Failed to load",description:b.message,variant:"destructive"}):t(g||[]),n(!1)};S.useEffect(()=>{v()},[]);const x=g=>g.trim().toLowerCase(),p=async()=>{const g=x(o);if(!g||!Ug.test(g)||g.length>253){be({title:"Invalid domain",variant:"destructive"});return}const b={domain:g,won_at:c,price:f?Number(f):null},{error:N}=await V.from("won_auctions").insert(b);if(N){be({title:"Failed to add",description:N.message,variant:"destructive"});return}
281l(""),d(""),be({title:"Added",description:g}),v()},w=async()=>{const g=h.split(/\r?\n/).map(E=>E.trim()).filter(Boolean);if(g.length===0)return;const b=new Date().toISOString().slice(0,10),N=[],O=[];for(const E of g){const $=E.split(",").map(T=>T.trim()),I=x($[0]||"");if(!Ug.test(I)||I.length>253){O.push(E);continue}const L=$[1]&&/^\d{4}-\d{2}-\d{2}$/.test($[1])?$[1]:b,U=$[2]&&!isNaN(Number($[2]))?Number($[2]):null;N.push({domain:I,won_at:L,price:U})}if(N.length===0){be({title:"Nothing to add",description:`${O.length} invalid lines`,variant:"destructive"});return}let D=0,P=0;for(const E of N){const{error:$}=await V.from("won_auctions").insert(E);$?($.code,P++):D++}be({title:"Bulk import done",description:`Added ${D}, skipped ${P}${O.length?`, ${O.length} invalid`:""}`}),m(""),v()},j=async g=>{s(g.id);const{error:b}=await V.from("won_auctions").update({domain:x(g.domain),won_at:g.won_at,price:g.price,is_visible:g.is_visible,sort_order:g.sort_order}).eq("id",g.id);s(null),b?be({title:"Save failed",description:b.message,variant:"destructive"}):(be({title:"Saved"}),v())},_=async g=>{if(!confirm("Delete this entry?"))return;const{error:b}=await V.from("won_auctions").delete().eq("id",g);b?be({title:"Delete failed",description:b.message,variant:"destructive"}):(be({title:"Deleted"}),v())},y=(g,b)=>{t(N=>N.map(O=>O.id===g?{...O,...b}:O))};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl lg:text-3xl font-bold text-foreground",children:"Won Auctions"}),a.jsx("p",{className:"text-muted-foreground mt-1",children:'Manage the "Won via GoExpired" feed shown on the /welcome page'})]}),a.jsxs(q,{children:[a.jsx(se,{children:a.jsx(oe,{className:"text-lg",children:"Add single"})}),a.jsx(K,{children:a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-3 items-end",children:[a.jsxs("div",{children:[a.jsx(Z,{children:"Domain"}),a.jsx(Q,{value:o,onChange:g=>l(g.target.value),placeholder:"example.com"})]}),a.jsxs("div",{children:[a.jsx(Z,{children:"Won date"}),a.jsx(Q,{type:"date",value:c,onChange:g=>u(g.target.value)})]}),a.jsxs("div",{children:[a.jsx(Z,{children:"Price (optional)"}),a.jsx(Q,{type:"number",value:f,onChange:g=>d(g.target.value),placeholder:"e.g. 425"})]}),a.jsxs(z,{onClick:p,children:[a.jsx(qr,{className:"w-4 h-4 mr-2"})," Add"]})]})})]}),a.jsxs(q,{children:[a.jsx(se,{children:a.jsx(oe,{className:"text-lg",children:"Bulk paste"})}),a.jsxs(K,{children:[a.jsxs("p",{className:"text-xs text-muted-foreground mb-2",children:["One per line. Formats: ",a.jsx("code",{children:"domain"}),", ",a.jsx("code",{children:"domain, YYYY-MM-DD"}),", or"," ",a.jsx("code",{children:"domain, YYYY-MM-DD, price"})]}),a.jsx(Je,{rows:6,value:h,onChange:g=>m(g.target.value),placeholder:`snowfox.org
282vibelab.org, 2026-07-01
283biobeans.com, 2026-07-01, 425`}),a.jsx("div",{className:"mt-3",children:a.jsx(z,{onClick:w,disabled:!h.trim(),children:"Import"})})]})]}),a.jsxs(q,{children:[a.jsx(se,{children:a.jsxs(oe,{className:"text-lg",children:["All entries (",e.length,")"]})}),a.jsx(K,{children:r?a.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."}):e.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No entries yet."}):a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b text-left text-muted-foreground",children:[a.jsx("th",{className:"py-2 pr-3",children:"Domain"}),a.jsx("th",{className:"py-2 pr-3",children:"Won date"}),a.jsx("th",{className:"py-2 pr-3",children:"Price"}),a.jsx("th",{className:"py-2 pr-3",children:"Sort"}),a.jsx("th",{className:"py-2 pr-3",children:"Visible"}),a.jsx("th",{className:"py-2 pr-3 text-right",children:"Actions"})]})}),a.jsx("tbody",{children:e.map(g=>a.jsxs("tr",{className:"border-b last:border-0",children:[a.jsx("td",{className:"py-2 pr-3",children:a.jsx(Q,{value:g.domain,onChange:b=>y(g.id,{domain:b.target.value}),className:"h-8"})}),a.jsx("td",{className:"py-2 pr-3",children:a.jsx(Q,{type:"date",value:g.won_at,onChange:b=>y(g.id,{won_at:b.target.value}),className:"h-8 w-40"})}),a.jsx("td",{className:"py-2 pr-3",children:a.jsx(Q,{type:"number",value:g.price??"",onChange:b=>y(g.id,{price:b.target.value===""?null:Number(b.target.value)}),className:"h-8 w-24"})}),a.jsx("td",{className:"py-2 pr-3",children:a.jsx(Q,{type:"number",value:g.sort_order,onChange:b=>y(g.id,{sort_order:Number(b.target.value)}),className:"h-8 w-20"})}),a.jsx("td",{className:"py-2 pr-3",children:a.jsx(Nr,{checked:g.is_visible,onCheckedChange:b=>y(g.id,{is_visible:b})})}),a.jsxs("td",{className:"py-2 pr-3 text-right whitespace-nowrap",children:[a.jsxs(z,{size:"sm",variant:"outline",onClick:()=>
283j(g),disabled:i===g.id,className:"mr-2",children:[a.jsx(Do,{className:"w-4 h-4 mr-1"}),"Save"]}),a.jsx(z,{size:"sm",variant:"destructive",onClick:()=>_(g.id),children:a.jsx(Cr,{className:"w-4 h-4"})})]})]},g.id))})]})})})]})]})};var c9="Separator",zg="horizontal",u9=["horizontal","vertical"],l0=S.forwardRef((e,t)=>{const{decorative:r,orientation:n=zg,...i}=e,s=d9(n)?n:zg,l=r?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return a.jsx(wn.div,{"data-orientation":s,...l,...i,ref:t})});l0.displayName=c9;function d9(e){return u9.includes(e)}var c0=l0;const Fn=S.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},i)=>a.jsx(c0,{ref:i,decorative:r,orientation:t,className:Qt("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));Fn.displayName=c0.displayName;const Hg={ALLOWED_TAGS:["p","br","strong","b","em","i","u","a","ul","ol","li","h1","h2","h3","h4","blockquote","img","span","div"],ALLOWED_ATTR:["href","target","rel","src","alt","style","width","height"]},f9=()=>{var _;const[e,t]=S.useState(null),[r,n]=S.useState(!0),[i,s]=S.useState(!1),[o,l]=S.useState(!1),c=S.useRef(null),u=S.useRef(!1);S.useEffect(()=>{(async()=>{const{data:y,error:g}=await V.from("pro_welcome_email_template").select("*").order("updated_at",{ascending:!1}).limit(1).maybeSingle();g?de.error(`Failed to load template: ${g.message}`):y&&t(y),n(!1)})()},[]),S.useEffect(()=>{if(e&&c.current&&!u.current){c.current.innerHTML=e.body_html||"";try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}u.current=!0}},[e]);const f=(y,g)=>{var b;(b=c.current)==null||b.focus();try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.execCommand(y,!1,g)},d=y=>y.preventDefault(),h=y=>{const g=document.createElement("div");return g.innerHTML=y,Array.from(g.children).forEach(b=>{if(b.tagName==="DIV"){const N=document.createElement("p");N.innerHTML=b.innerHTML||"<br>",b.replaceWith(N)}}),g.innerHTML},m=()=>{var O,D;const y=window.getSelection();if(!y||y.rangeCount===0||!((O=c.current)!=null&&O.contains(y.anchorNode))){de.error("Select some text in the editor first, then click the link button.");return}const g=y.getRangeAt(0).cloneRange();if(g.collapsed){de.error("Select some text first (highlight the words you want to link).");return}const b=window.prompt("Enter URL (include https://):");if(!b)return;const N=/^https?:\/\//i.test(b)?b:`https://${b}`;(D=c.current)==null||D.focus(),y.removeAllRanges(),y.addRange(g);try{const P=document.createElement("a");P.setAttribute("href",N),P.setAttribute("target","_blank"),P.setAttribute("rel","noopener noreferrer");const E=g.extractContents();P.appendChild(E),g.insertNode(P);const $=document.createRange();$.setStartAfter(P),$.collapse(!0),y.removeAllRanges(),y.addRange($)}catch(P){console.error("Insert link failed",P),de.error("Could not insert link. Try selecting the text again.")}},v=()=>{const y=window.prompt("Enter image URL (https://...):");if(y){if(!/^https?:\/\//i.test(y)){de.error("Image URL must start with https://");return}f("insertHTML",`<img src="${y}" alt="" style="max-width:100%;height:auto;border-radius:8px;" />`)}},x=()=>{var g;const y=h(((g=c.current)==null?void 0:g.innerHTML)||"");return Zu.sanitize(y,Hg)},p=async()=>{if(!e)return;s(!0);const y=x(),{error:g}=await V.from("pro_welcome_email_template").update({subject:e.subject,from_name:e.from_name,from_email:e.from_email,image_url:e.image_url,body_html:y}).eq("id",e.id);s(!1),g?de.error(`Save failed: ${g.message}`):(de.success("Template saved"),t({...e,body_html:y}))},w=async()=>{if(!e)return;l(!0);const y=x(),{error:g}=await V.from("pro_welcome_email_template").update({subject:e.subject,from_name:e.from_name,from_email:e.from_email,image_url:e.image_url,body_html:y}).eq("id",e.id);if(g){l(!1),de.error(`Save failed before test: ${g.message}`);return}t({...e,body_html:y});const{data:b,error:N}=await V.functions.invoke("send-pro-welcome-email",{body:{testMode:!0,overrideTo:"[email protected]",firstName:"Michael"}});l(!1),N?de.error(`Test send failed: ${N.message}`):(b==null?void 0:b.ok)===!1?de.error(`Test send failed: ${JSON.stringify(b)}`):de.success("Test email sent to [email protected]")};if(r)return a.jsx("div",{className:"flex items-center justify-center py-20",children:a.jsx(Se,{className:"h-8 w-8 animate-spin text-primary"})});if(!e)return a.jsx("div",{className:"text-center py-20 text-muted-foreground",children:"No template found. Please contact support."});const j=Zu.sanitize(((_=c.current)==null?void 0:_.innerHTML)||e.body_html||"",Hg);return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl lg:text-3xl font-bold text-foreground flex items-center",children:[a.jsx(rv,{className:"h-6 w-6 lg:h-7 lg:w-7 mr-2 text-primary"}),"PRO Welcome Email"]}),a.jsx("p",{className:"text-muted-foreground mt-1",children:"Personal thank-you email sent automatically when a user upgrades to GX PRO."})]}),a.jsxs(q,{children:[a.jsxs(se,{children:[a.jsx(oe,{className:"text-lg",children:"Email settings"}),a.jsxs(ge,{children:["Placeholders you can use in the body: ",a.jsx("code",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:"{{first_name}}"})," ",a.jsx("code",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:"{{email}}"})]})]}),a.jsx(K,{className:"space-y-4",children:a.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Z,{htmlFor:"subject",children:"Subject"}),a.jsx(Q,{id:"subject",value:e.subject,onChange:y=>t({...e,subject:y.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Z,{htmlFor:"from_name",children:"From name"}),a.jsx(Q,{id:"from_name",value:e.from_name,onChange:y=>t({...e,from_name:y.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Z,{htmlFor:"from_email",children:"From email"}),a.jsx(Q,{id:"from_email",value:e.from_email,onChange:y=>t({...e,from_email:y.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Z,{htmlFor:"image_url",children:"Hero image URL (optional)"}),a.jsx(Q,{id:"image_url",placeholder:"https://...",value:e.image_url||"",onChange:y=>t({...e,image_url:y.target.value})})]})]})})]}),a.jsxs(q,{children:[a.jsxs(se,{children:[a.jsx(oe,{className:"text-lg",children:"Body"}),a.jsx(ge,{children:"Rich text editor. Use the toolbar to format text or insert links and images."})]}),a.jsxs(K,{className:"space-y-3",children:[a.jsxs("div",{className:"flex flex-wrap gap-1 border rounded-md p-2 bg-muted/30",onMouseDown:d,children:[a.jsx(z,{type:"button",variant:"ghost",size:"sm",onMouseDown:d,onClick:()=>f("bold"),title:"Bold",children:a.jsx(X0,{className:"h-4 w-4"})}),a.jsx(z,{type:"button",variant:"ghost",size:"sm",onMouseDown:d,onClick:()=>f("italic"),title:"Italic",children:a.jsx(aj,{className:"h-4 w-4"})}),a.jsx(z,{type:"button",variant:"ghost",size:"sm",onMouseDown:d,onClick:()=>f("underline"),title:"Underline",children:a.jsx(dj,{className:"h-4 w-4"})}),a.jsx(Fn,{orientation:"vertical",className:"h-6 mx-1"}),a.jsx(z,{type:"button",variant:"ghost",size:"sm",onMouseDown:d,onClick:()=>f("formatBlock","H2"),title:"Heading",children:"H2"}),a.jsx(z,{type:"button",variant:"ghost",size:"sm",onMouseDown:d,onClick:()=>f("formatBlock","H3"),title:"Subheading",children:"H3"}),a.jsx(z,{type:"button",variant:"ghost",size:"sm",onMouseDown:d,onClick:()=>f("formatBlock","P"),title:"Paragraph",children:"P"}),a.jsx(Fn,{orientation:"vertical",className:"h-6 mx-1"}),a.jsx(z,{type:"button",variant:"ghost",size:"sm",onMouseDown:d,onClick:()=>f("insertUnorderedList"),title:"Bullet list",children:a.jsx(oj,{className:"h-4 w-4"})}),a.jsx(z,{type:"button",variant:"ghost",size:"sm",onMouseDown:d,onClick:()=>f("insertOrderedList"),title:"Numbered list",children:a.jsx(sj,{className:"h-4 w-4"})}),a.jsx(Fn,{orientation:"vertical",className:"h-6 mx-1"}),a.jsx(z,{type:"button",variant:"ghost",size:"sm",onMouseDown:d,onClick:m,title:"Link",children:a.jsx(ij,{className:"h-4 w-4"})}),a.jsx(z,{type:"button",variant:"ghost",size:"sm",onMouseDown:d,onClick:v,title:"Image",children:a.jsx(nj,{className:"h-4 w-4"})}),a.jsx(Fn,{orientation:"vertical",className:"h-6 mx-1"}),a.jsx(z,{type:"button",variant:"ghost",size:"sm",onMouseDown:d,onClick:()=>f("undo"),title:"Undo",children:a.jsx(fj,{className:"h-4 w-4"})}),a.jsx(z,{type:"button",variant:"ghost",size:"sm",onMouseDown:d,onClick:()=>f("redo"),title:"Redo",children:a.jsx(lj,{className:"h-4 w-4"})})]}),a.jsx("style",{children:`
284            .pro-welcome-editor p { margin: 0 0 16px; }
285            .pro-welcome-editor p:last-child { margin-bottom: 0; }
286            .pro-welcome-editor ul { list-style: disc; padding-left: 1.5rem; margin: 0 0 16px; }
287            .pro-welcome-editor ol { list-style: decimal; padding-left: 1.5rem; margin: 0 0 16px; }
288            .pro-welcome-editor li { margin: 4px 0; }
289            .pro-welcome-editor h2 { font-size: 1.25rem; font-weight: 600; margin: 0 0 12px; }
290            .pro-welcome-editor h3 { font-size: 1.1rem; font-weight: 600; margin: 0 0 10px; }
291            .pro-welcome-editor a { color: #2563EB; text-decoration: underline; }
292            .pro-welcome-editor a:hover { color: #1D4FD8; }
293          `}),a.jsx("div",{ref:c,contentEditable:!0,suppressContentEditableWarning:!0,className:"pro-welcome-editor min-h-[300px] max-h-[600px] overflow-y-auto border rounded-md p-4 bg-background max-w-none focus:outline-none focus:ring-2 focus:ring-primary",style:{lineHeight:1.6}})]})]}),a.jsxs(q,{children:[a.jsxs(se,{children:[a.jsx(oe,{className:"text-lg",children:"Preview"}),a.jsx(ge,{children:"Approximate rendering (600px max width)."})]}),a.jsx(K,{children:a.jsx("div",{className:"bg-[#FAF9F5] p-6 rounded-md",children:a.jsxs("div",{className:"max-w-[600px] mx-auto bg-white border border-[#
293E8E5DD] rounded-lg p-8",children:[e.image_url&&a.jsx("div",{className:"text-center mb-6",children:a.jsx("img",{src:e.image_url,alt:"",className:"max-w-full h-auto rounded-md inline-block"})}),a.jsx("div",{className:"pro-welcome-editor prose prose-sm max-w-none text-[#1A1A1A]",dangerouslySetInnerHTML:{__html:j}})]})})})]}),a.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 sticky bottom-4 z-10",children:[a.jsxs(z,{onClick:p,disabled:i,className:"flex-1 sm:flex-initial",children:[i?a.jsx(Se,{className:"h-4 w-4 mr-2 animate-spin"}):a.jsx(Do,{className:"h-4 w-4 mr-2"}),"Save template"]}),a.jsxs(z,{onClick:w,disabled:o,variant:"outline",className:"flex-1 sm:flex-initial",children:[o?a.jsx(Se,{className:"h-4 w-4 mr-2 animate-spin"}):a.jsx(pr,{className:"h-4 w-4 mr-2"}),"Send test to [email protected]"]})]})]})},h9=()=>{const{toast:e}=_n(),[t,r]=S.useState(null),[n,i]=S.useState([]),[s,o]=S.useState([]),[l,c]=S.useState(!0),[u,f]=S.useState(null),d=S.useCallback(async()=>{c(!0);const[{data:p},{data:w},{data:j}]=await Promise.all([V.from("blog_automation_settings").select("auto_publish, min_quality_score, min_impressions, last_run_at, last_run_result").eq("id",!0).maybeSingle(),V.from("blog_topics").select("*").order("updated_at",{ascending:!1}),V.from("blog_posts").select("id, slug, title, status, quality_score, editor_notes, published_at, created_at").order("created_at",{ascending:!1}).limit(30)]);r(p??null),i(w??[]),o(j??[]),c(!1)},[]);S.useEffect(()=>{d()},[d]);const h=async p=>{if(!t)return;r({...t,...p});const{error:w}=await V.from("blog_automation_settings").update(p).eq("id",!0);w&&e({title:"Could not save settings",description:w.message,variant:"destructive"})},m=async(p,w={})=>{f(p==="gsc-keyword-report"?"gsc":"write");const{data:j,error:_}=await V.functions.invoke(p,{body:w});if(f(null),_){e({title:`${p} failed`,description:_.message,variant:"destructive"});return}e({title:p==="gsc-keyword-report"?"Search Console data refreshed":"Article generated",description:JSON.stringify(j).slice(0,300)}),d()},v=async(p,w)=>{const{error:j}=await V.from("blog_posts").update({status:w,published_at:w==="published"?new Date().toISOString():null}).eq("id",p.id);if(j){e({title:"Update failed",description:j.message,variant:"destructive"});return}d()},x=async(p,w)=>{const{error:j}=await V.from("blog_topics").update({status:w}).eq("id",p.id);if(j){e({title:"Update failed",description:j.message,variant:"destructive"});return}d()};return l?a.jsx("div",{className:"flex items-center justify-center py-20",children:a.jsx(Se,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-2xl font-semibold",children:"Blog Automation"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Search Console keyword clusters, generated drafts, and publishing rules."})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(z,{variant:"outline",onClick:()=>m("gsc-keyword-report"),disabled:u!==null,children:[u==="gsc"?a.jsx(Se,{className:"h-4 w-4 animate-spin mr-2"}):a.jsx(Zt,{className:"h-4 w-4 mr-2"}),"Refresh Search Console"]}),a.jsxs(z,{onClick:()=>m("generate-seo-blog-post"),disabled:u!==null,children:[u==="write"?a.jsx(Se,{className:"h-4 w-4 animate-spin mr-2"}):a.jsx(li,{className:"h-4 w-4 mr-2"}),"Write next article"]})]})]}),a.jsxs(q,{children:[a.jsxs(se,{children:[a.jsx(oe,{className:"text-lg",children:"Rules"}),a.jsx(ge,{children:t!=null&&t.last_run_at?`Last run ${new Date(t.last_run_at).toLocaleString()}: ${t.last_run_result??"-"}`:"The generator has not run yet."})]}),a.jsxs(K,{className:"grid gap-6 md:grid-cols-3",children:[a.jsxs("div",{className:"flex items-center justify-between gap-4",children:[a.jsxs("div",{children:[a.jsx(Z,{className:"text-sm",children:"Auto-publish"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Publish automatically when all checks pass"})]}),a.jsx(Nr,{checked:!!(t!=null&&t.auto_publish),onCheckedChange:p=>h({auto_publish:p})})]}),a.jsxs("div",{children:[a.jsx(Z,{className:"text-sm",children:"Minimum quality score"}),a.jsx(Q,{type:"number",min:0,max:100,value:(t==null?void 0:t.min_quality_score)??80,onChange:p=>h({min_quality_score:Number(p.target.value)})})]}),a.jsxs("div",{children:[a.jsx(Z,{className:"text-sm",children:"Minimum impressions per cluster"}),a.jsx(Q,{type:"number",min:0,value:(t==null?void 0:t.min_impressions)??5,onChange:p=>h({min_impressions:Number(p.target.value)})})]})]})]}),a.jsxs(q,{children:[a.jsxs(se,{children:[a.jsx(oe,{className:"text-lg",children:"Keyword clusters"}),a.jsx(ge,{children:"Built from the last 90 days of Search Console queries."})]}),a.jsxs(K,{className:"space-y-3",children:[n.length===0&&a.jsx("p",{className:"text-sm text-muted-foreground",children:"No clusters yet. Refresh Search Console to build them."}),n.map(p=>{var w,j,_;return a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 rounded-lg border p-3",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-medium",children:p.label}),a.jsx(Oe,{variant:p.status==="queued"?"default":"secondary",children:p.status})]}),a.jsx("p",{className:"text-xs text-muted-foreground truncate max-w-xl",children:p.keywords.slice(0,8).join(", ")}),a.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[((w=p.metrics)==null?void 0:w.impressions)??0," impressions · ",((j=p.metrics)==null?void 0:j.clicks)??0," clicks · avg position"," ",((_=p.metrics)==null?void 0:_.avg_position)??"-"]}
293)]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(z,{size:"sm",variant:"outline",disabled:u!==null,onClick:()=>m("generate-seo-blog-post",{cluster_key:p.cluster_key,force_draft:!0}),children:"Draft article"}),p.status!=="queued"?a.jsx(z,{size:"sm",variant:"ghost",onClick:()=>x(p,"queued"),children:"Requeue"}):a.jsx(z,{size:"sm",variant:"ghost",onClick:()=>x(p,"skipped"),children:"Skip"})]})]},p.id)})]})]}),a.jsxs(q,{children:[a.jsxs(se,{children:[a.jsx(oe,{className:"text-lg",children:"Generated articles"}),a.jsx(ge,{children:"Drafts stay hidden from the blog until you publish them."})]}),a.jsxs(K,{className:"space-y-3",children:[s.length===0&&a.jsx("p",{className:"text-sm text-muted-foreground",children:"Nothing generated yet."}),s.map(p=>a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 rounded-lg border p-3",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-medium",children:p.title}),a.jsx(Oe,{variant:p.status==="published"?"default":"secondary",children:p.status}),p.quality_score!==null&&a.jsxs(Oe,{variant:"outline",children:["score ",p.quality_score]})]}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["/blog/",p.slug]}),p.editor_notes&&a.jsxs("p",{className:"text-xs text-muted-foreground mt-1 max-w-xl",children:["Editor notes: ",p.editor_notes]})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(Vg,{to:p.status==="published"?`/blog/${p.slug}`:`/blog/${p.slug}?preview=1`,target:"_blank",rel:"noopener noreferrer",children:a.jsxs(z,{size:"sm",variant:"outline",children:[a.jsx(ed,{className:"h-4 w-4 mr-1"}),"View"]}
293)}),p.status==="published"?a.jsx(z,{size:"sm",variant:"ghost",onClick:()=>v(p,"draft"),children:"Unpublish"}):a.jsx(z,{size:"sm",onClick:()=>v(p,"published"),children:"Publish"})]})]},p.id))]})]})]})},m9=e=>{const t=new Date(e),r=t.getTimezoneOffset();return new Date(t.getTime()-r*6e4).toISOString().slice(0,16)},p9=()=>{const[e,t]=S.useState(null),[r,n]=S.useState(!0),[i,s]=S.useState(!1),[o,l]=S.useState(!1);S.useEffect(()=>{V.from("promo_popup_config").select("*").limit(1).maybeSingle().then(({data:d,error:h})=>{h||!d?de.error("Could not load pop-up settings"):t({...d,bullets:L0(d.bullets)}),n(!1)})},[]);const c=(d,h)=>{t(m=>m&&{...m,[d]:h})},u=async()=>{if(!e)return;s(!0);const{error:d}=await V.from("promo_popup_config").update({enabled:e.enabled,badge_text:e.badge_text,headline:e.headline,subheadline:e.subheadline,body_text:e.body_text,bullets:e.bullets,fine_print:e.fine_print,price_display:e.price_display,regular_price_display:e.regular_price_display,price_caption:e.price_caption,promo_code:e.promo_code,anchor_text:e.anchor_text,cta_label:e.cta_label,cta_mode:e.cta_mode,cta_url:e.cta_url,dismiss_label:e.dismiss_label,deadline_at:new Date(e.deadline_at).toISOString(),countdown_enabled:e.countdown_enabled,close_delay_seconds:e.close_delay_seconds,max_per_session:e.max_per_session,max_per_day:e.max_per_day,target_tiers:e.target_tiers,page_mode:e.page_mode,include_paths:e.include_paths,exclude_paths:e.exclude_paths}).eq("id",!0);s(!1),d?de.error(`Save failed: ${d.message}`):de.success("Pop-up settings saved")},f=d=>{if(!e)return;const h=e.target_tiers.includes(d);c("target_tiers",h?e.target_tiers.filter(m=>m!==d):[...e.target_tiers,d])};return r?a.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[a.jsx(Se,{className:"h-4 w-4 animate-spin"})," Loading pop-up settings..."]}):e?a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-2xl font-bold text-foreground",children:"Promo Pop-up"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Site-wide pop-up campaign. Use it for GX PRO offers or any other promotion."})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(z,{variant:"outline",onClick:()=>l(!0),children:[a.jsx(ad,{className:"mr-2 h-4 w-4"})," Preview"]}),a.jsxs(z,{onClick:u,disabled:i,children:[i?a.jsx(Se,{className:"mr-2 h-4 w-4 animate-spin"}):a.jsx(Do,{className:"mr-2 h-4 w-4"}),"Save"]})]})]}),a.jsxs(q,{children:[a.jsxs(se,{children:[a.jsx(oe,{className:"text-lg",children:"Status"}),a.jsx(ge,{children:"Turn the pop-up on or off instantly."})]}),a.jsxs(K,{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-4",children:[a.jsxs("div",{children:[a.jsx("p",{className:"font-medium",children:"Pop-up enabled"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"When off, no one sees the pop-up."})]}),a.jsx(Nr,{checked:e.enabled,onCheckedChange:d=>c("enabled",d)})]}),a.jsx("div",{className:"flex flex-wrap gap-3",children:["guest","free","plus","pro"].map(d=>a.jsxs("label",{className:"flex items-center gap-2 rounded-lg border px-3 py-2 text-sm",children:[a.jsx("input",{type:"checkbox",checked:e.target_tiers.includes(d),onChange:()=>f(d)}),a.jsx("span",{className:"capitalize",children:d})]},d))})]})]}),a.jsxs(q,{children:[a.jsx(se,{children:a.jsx(oe,{className:"text-lg",children:"Content"})}),a.jsxs(K,{className:"space-y-4",children:[a.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Z,{children:"Badge text"}),a.jsx(Q,{value:e.badge_text,onChange:d=>c("badge_text",d.target.value)})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Z,{children:"Promo code"}),a.jsx(Q,{value:e.promo_code,onChange:d=>c("promo_code",d.target.value)})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Z,{children:"Headline"}),a.jsx(Q,{value:e.headline,onChange:d=>c("headline",d.target.value)})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Z,{children:"Subheadline"}),a.jsx(Q,{value:e.subheadline,onChange:d=>c("subheadline",d.target.value)})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Z,{children:"Body text"}),a.jsx(Je,{rows:3,value:e.body_text,onChange:d=>c("body_text",d.target.value)})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Z,{children:"Benefit bullets"}),e.bullets.map((d,h)=>a.jsxs("div",{className:"flex gap-2",children:[a.jsx(Q,{value:d,onChange:m=>{const v=[...e.bullets];v[h]=m.target.value,c("bullets",v)}}),a.jsx(z,{variant:"outline",size:"icon",onClick:()=>c("bullets",e.bullets.filter((m,v)=>v!==h)),children:a.jsx(Cr,{className:"h-4 w-4"})})]},h)),a.jsxs(z,{variant:"outline",size:"sm",onClick:()=>c("bullets",[...e.bullets,""]),children:[a.jsx(qr,{className:"mr-2 h-4 w-4"})," Add bullet"]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Z,{children:"Value anchor line"}),a.jsx(Je,{rows:2,value:e.anchor_text,onChange:d=>c("anchor_text",d.target.value)})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Z,{children:"Fine print"}),a.jsx(Je,{rows:2,value:e.fine_print,onChange:d=>c("fine_print",d.target.value)})]})]})]}),a.jsxs(q,{children:[a.jsx(se,{children:a.jsx(oe,{className:"text-lg",children:"Pricing and call to action"})}),a.jsxs(K,{className:"space-y-4",children:[a.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Z,{children:"Offer price"}),a.jsx(Q,{value:e.price_display,onChange:d=>c("price_display",d.target.value)})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Z,{children:"Regular price"}),a.jsx(Q,{value:e.regular_price_display,onChange:d=>c("regular_price_display",d.target.value)})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Z,{children:"Price caption"}),a.jsx(Q,{value:e.price_caption??"",onChange:d=>c("price_caption",d.target.value),placeholder:"Leave empty to show: first month, then {regular price}"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Text shown next to the price. Overrides the default subscription wording."})]}),a.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Z,{children:"CTA label"}),a.jsx(Q,{value:e.cta_label,onChange:d=>c("cta_label",d.target.value)})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Z,{children:"Dismiss label"}),a.jsx(Q,{value:e.dismiss_label,onChange:d=>c("dismiss_label",d.target.value)})]})]}),a.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Z,{children:"CTA behaviour"}),a.jsxs("select",{className:"h-10 w-full rounded-md border border-input bg-background px-3 text-sm",value:e.cta_mode,onCh
293ange:d=>c("cta_mode",d.target.value),children:[a.jsx("option",{value:"checkout",children:"Stripe checkout (guests go to sign-up first)"}),a.jsx("option",{value:"url",children:"Custom URL"}),a.jsx("option",{value:"ebook",children:"Newsletter signup with free e-book"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Z,{children:"Custom URL (used when CTA behaviour is Custom URL)"}),a.jsx(Q,{value:e.cta_url,onChange:d=>c("cta_url",d.target.value)})]})]})]})]}),a.jsxs(q,{children:[a.jsx(se,{children:a.jsx(oe,{className:"text-lg",children:"Timing and frequency"})}),a.jsxs(K,{className:"space-y-4",children:[a.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Z,{children:"Offer deadline"}),a.jsx(Q,{type:"datetime-local",value:m9(e.deadline_at),onChange:d=>c("deadline_at",new Date(d.target.value).toISOString())}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"After this moment the pop-up stops showing automatically."})]}),a.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-4",children:[a.jsxs("div",{children:[a.jsx("p",{className:"font-medium",children:"Show countdown"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Days, hours, minutes, seconds."})]}),a.jsx(Nr,{checked:e.countdown_enabled,onCheckedChange:d=>c("countdown_enabled",d)})]})]}),a.jsx(Fn,{}),a.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Z,{children:"Close delay (seconds)"}),a.jsx(Q,{type:"number",min:0,max:30,value:e.close_delay_seconds,onChange:d=>c("close_delay_seconds",Number(d.target.value))})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Z,{children:"Max shows per session"}),a.jsx(Q,{type:"number",min:0,max:10,value:e.max_per_session,onChange:d=>c("max_per_session",Number(d.target.value))})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Z,{children:"Max shows per 24 hours"}),a.jsx(Q,{type:"number",min:0,max:20,value:e.max_per_day,onChange:d=>c("max_per_day",Number(d.target.value))})]})]})]})]}),a.jsxs(q,{children:[a.jsxs(se,{children:[a.jsx(oe,{className:"text-lg",children:"Pages"}),a.jsx(ge,{children:"Choose where the pop-up may appear."})]}),a.jsxs(K,{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Z,{children:"Page mode"}),a.jsxs("select",{className:"h-10 w-full rounded-md border border-input bg-background px-3 text-sm",value:e.page_mode,onChange:d=>c("page_mode",d.target.value),children:[a.jsx("option",{value:"all",children:"All pages (except excluded)"}),a.jsx("option",{value:"include",children:"Only selected pages"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Z,{children:"Included pages (one path per line)"}),a.jsx(Je,{rows:5,value:e.include_paths.join(`
294`),onChange:d=>c("include_paths",d.target.value.split(`
295`).map(h=>h.trim()).filter(Boolean)),placeholder:"/premiumauctions"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Z,{children:"Excluded pages (one path per line)"}),a.jsx(Je,{rows:5,value:e.exclude_paths.join(`
296`),onChange:d=>c("exclude_paths",d.target.value.split(`
297`).map(h=>h.trim()).filter(Boolean))})]})]})]}),o&&(e.cta_mode==="ebook"?a.jsx(R0,{onClose:()=>l(!1)}):a.jsx(B0,{config:{...e,close_delay_seconds:0},user:null,onClose:()=>l(!1),previewMode:!0}))]}):a.jsx("p",{className:"text-muted-foreground",children:"No pop-up configuration found."})},g9=()=>{const{user:e,handleLogout:t}=id(),{userStats:r,loading:n}=$t(),i=qi(),[s,o]=S.useState("dashboard"),[l,c]=S.useState(!1),u=[{id:"dashboard",label:"Dashboard",icon:Er,description:"Overview & Analytics"},{id:"users",label:"Users",icon:ft,description:"User Management & Audit"},{id:"revenue",label:"Revenue",icon:Gr,description:"Financial Analytics"},{id:"data",label:"Data",icon:Yn,description:"Domains & Analytics"},{id:"hot-auctions",label:"Hot Auctions",icon:nv,description:"Premium Expired Auctions"},{id:"won-auctions",label:"Won Auctions",icon:K0,description:"Won via GoExpired feed"},{id:"newsletter",label:"Newsletter",icon:qg,description:"Generate Newsletter HTML"},{id:"blog-automation",label:"Blog Automation",icon:Cf,description:"Search Console driven SEO articles"},{id:"pro-welcome-email",label:"PRO Welcome Email",icon:rv,description:"Edit welcome email for new PRO users"},{id:"submissions",label:"Submissions",icon:iv,description:"GX PRO Domain Submissions"},{id:"notifications",label:"Notifications",icon:Gg,description:"Broadcast in-app messages"},{id:"brandable-library",label:"Brandable Library",icon:Cf,description:"Prefixes & suffixes for /brandable-generator"},{id:"promo-popup",label:"Promo Pop-up",icon:Es,description:"GX PRO offer pop-up settings"},{id:"settings",label:"Settings",icon:z0,description:"System Configuration"}],f=()=>{switch(s){case"dashboard":return a.jsx(Mf,{});case"users":return a.jsx(Nj,{});case"revenue":return a.jsx(Dj,{});case"data":return a.jsx(pz,{});case"hot-auctions":return a.jsx(Wz,{});case"won-auctions":return a.jsx(l9,{});case"newsletter":return a.jsx(e9,{});case"blog-automation":return a.jsx(h9,{});case"pro-welcome-email":return a.jsx(f9,{});case"submissions":return a.jsx(i9,{});case"notifications":return a.jsx(s9,{});case"brandable-library":return a.jsx(o9,{});case"promo-popup":return a.jsx(p9,{});case"settings":return a.jsx(Hz,{});default:return a.jsx(Mf,{})}},d=()=>a.jsxs("div",{className:`${i?"fixed inset-y-0 left-0 z-50 w-64 transform bg-white border-r border-border shadow-lg":"w-64 bg-white border-r border-border"} ${i&&!l?"-translate-x-full":"translate-x-0"} transition-transform duration-200 ease-in-out`,children:[a.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-8 h-8 bg-primary rounded-lg flex items-center justify-center",children:a.jsx(vn,{className:"h-4 w-4 text-primary-foreground"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-lg font-semibold text-foreground",children:"Admin"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"DomainDingo"})]})]}),i&&a.jsx(z,{variant:"ghost",size:"sm",onClick:()=>c(!1),children:a.jsx(Vi,{className:"h-4 w-4"})})]}),a.jsx("nav",{className:"flex-1 px-4 py-6 space-y-2",children:u.map(v=>{const x=v.icon,p=s===v.id;return a.jsxs("button",{onClick:()=>{o(v.id),i&&c(!1)},className:`w-full flex items-center px-3 py-2.5 rounded-lg text-left transition-colors ${p?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground hover:bg-muted"}`,children:[a.jsx(x,{className:`h-5 w-5 mr-3 ${p?"text-primary-foreground":"text-muted-foreground"}`}),a.jsxs("div",{children:[a.jsx("div",{className:`font-medium ${p?"text-primary-foreground":"text-foreground"}`,children:v.label}
297),a.jsx("div",{className:`text-xs ${p?"text-primary-foreground/80":"text-muted-foreground"}`,children:v.description})]})]},v.id)})}),a.jsxs("div",{className:"border-t border-border p-4",children:[a.jsxs("div",{className:"flex items-center space-x-3 mb-3",children:[a.jsx("div",{className:"w-8 h-8 bg-muted rounded-full flex items-center justify-center",children:a.jsx(ft,{className:"h-4 w-4 text-muted-foreground"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:e==null?void 0:e.email}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Administrator"})]})]}),a.jsxs(z,{variant:"outline",size:"sm",onClick:t,className:"w-full mb-2",children:[a.jsx(F0,{className:"h-4 w-4 mr-2"}),"Logout"]}),a.jsx(z,{asChild:!0,variant:"outline",size:"sm",className:"w-full",children:a.jsxs(Vg,{to:"/dashboard",children:[a.jsx(rj,{className:"h-4 w-4 mr-2"}),"Dashboard"]})})]})]}),h=()=>{var v;return a.jsxs("header",{className:"sticky top-0 z-50 lg:hidden bg-white border-b border-border px-4 py-3 flex items-center justify-between",children:[a.jsx(z,{variant:"ghost",size:"sm",onClick:()=>c(!0),children:a.jsx(U0,{className:"h-5 w-5"})}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(vn,{className:"h-5 w-5 text-primary"}),a.jsx("span",{className:"font-semibold text-foreground",children:(v=u.find(x=>x.id===s))==null?void 0:v.label})]}),a.jsx("div",{className:"w-8"})," "]})},m=()=>{var v,x;return a.jsxs("div",{className:"grid grid-cols-2 gap-3 p-4 lg:hidden",children:[a.jsx(q,{className:"p-3",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx(ft,{className:"h-5 w-5 text-primary mr-2"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-muted-foreground",children:"Users"}),a.jsx("p",{className:"text-lg font-bold text-foreground",children:n?"-":(v=r==null?void 0:r.total_users)==null?void 0:v.toLocaleString()})]})]})}),a.jsx(q,{className:"p-3",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx(er,{className:"h-5 w-5 text-green-600 mr-2"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-muted-foreground",children:"New (24h)"}),a.jsx("p",{className:"text-lg font-bold text-foreground",children:n?"-":(x=r==null?void 0:r.last_24h)==null?void 0:x.toLocaleString()})]})]})})]})};return a.jsxs("div",{className:"min-h-screen bg-background",children:[a.jsx(h,{}),a.jsx(m,{}),a.jsxs("div",{className:"flex",children:[a.jsx(d,{}),i&&l&&a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 z-40",onClick:()=>c(!1)}),a.jsx("div",{className:"flex-1 min-w-0",children:a.jsx("main",{className:"p-4 lg:p-6",children:f()})})]})]})},q9=()=>{const{user:e,isLoading:t,isAdmin:r}=id();return t?a.jsx("div",{className:"min-h-screen bg-slate-50 flex items-center justify-center",children:a.jsx(Se,{className:"h-8 w-8 animate-spin text-slate-600"})}):!e||!r?a.jsx(gj,{}):a.jsx(g9,{})};export{q9 as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.