better-auth-studio 1.0.45 → 1.0.46-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -105,288 +105,293 @@ Error generating stack: `+n.message+`
105
105
  *
106
106
  * This source code is licensed under the ISC license.
107
107
  * See the LICENSE file in the root directory of this source tree.
108
- */const Kz=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),De=(e,t)=>{const n=m.forwardRef(({color:s="currentColor",size:r=24,strokeWidth:i=2,absoluteStrokeWidth:o,className:l="",children:c,...u},h)=>m.createElement("svg",{ref:h,...Qz,width:r,height:r,stroke:s,strokeWidth:o?Number(i)*24/Number(r):i,className:["lucide",`lucide-${Kz(e)}`,l].join(" "),...u},[...t.map(([d,f])=>m.createElement(d,f)),...Array.isArray(c)?c:[c]]));return n.displayName=`${e}`,n};/**
108
+ */const Kz=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),Te=(e,t)=>{const n=m.forwardRef(({color:s="currentColor",size:r=24,strokeWidth:i=2,absoluteStrokeWidth:o,className:l="",children:c,...u},h)=>m.createElement("svg",{ref:h,...Qz,width:r,height:r,stroke:s,strokeWidth:o?Number(i)*24/Number(r):i,className:["lucide",`lucide-${Kz(e)}`,l].join(" "),...u},[...t.map(([d,f])=>m.createElement(d,f)),...Array.isArray(c)?c:[c]]));return n.displayName=`${e}`,n};/**
109
109
  * @license lucide-react v0.294.0 - ISC
110
110
  *
111
111
  * This source code is licensed under the ISC license.
112
112
  * See the LICENSE file in the root directory of this source tree.
113
- */const Ms=De("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
113
+ */const Ms=Te("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
114
114
  * @license lucide-react v0.294.0 - ISC
115
115
  *
116
116
  * This source code is licensed under the ISC license.
117
117
  * See the LICENSE file in the root directory of this source tree.
118
- */const Jz=De("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
118
+ */const Jz=Te("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
119
119
  * @license lucide-react v0.294.0 - ISC
120
120
  *
121
121
  * This source code is licensed under the ISC license.
122
122
  * See the LICENSE file in the root directory of this source tree.
123
- */const eR=De("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/**
123
+ */const eR=Te("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/**
124
124
  * @license lucide-react v0.294.0 - ISC
125
125
  *
126
126
  * This source code is licensed under the ISC license.
127
127
  * See the LICENSE file in the root directory of this source tree.
128
- */const Pd=De("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);/**
128
+ */const Pd=Te("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);/**
129
129
  * @license lucide-react v0.294.0 - ISC
130
130
  *
131
131
  * This source code is licensed under the ISC license.
132
132
  * See the LICENSE file in the root directory of this source tree.
133
- */const py=De("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
133
+ */const py=Te("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
134
134
  * @license lucide-react v0.294.0 - ISC
135
135
  *
136
136
  * This source code is licensed under the ISC license.
137
137
  * See the LICENSE file in the root directory of this source tree.
138
- */const tR=De("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/**
138
+ */const tR=Te("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/**
139
139
  * @license lucide-react v0.294.0 - ISC
140
140
  *
141
141
  * This source code is licensed under the ISC license.
142
142
  * See the LICENSE file in the root directory of this source tree.
143
- */const _s=De("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/**
143
+ */const _s=Te("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/**
144
144
  * @license lucide-react v0.294.0 - ISC
145
145
  *
146
146
  * This source code is licensed under the ISC license.
147
147
  * See the LICENSE file in the root directory of this source tree.
148
- */const dh=De("Calendar",[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",ry:"2",key:"eu3xkr"}],["line",{x1:"16",x2:"16",y1:"2",y2:"6",key:"m3sa8f"}],["line",{x1:"8",x2:"8",y1:"2",y2:"6",key:"18kwsl"}],["line",{x1:"3",x2:"21",y1:"10",y2:"10",key:"xt86sb"}]]);/**
148
+ */const dh=Te("Calendar",[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",ry:"2",key:"eu3xkr"}],["line",{x1:"16",x2:"16",y1:"2",y2:"6",key:"m3sa8f"}],["line",{x1:"8",x2:"8",y1:"2",y2:"6",key:"18kwsl"}],["line",{x1:"3",x2:"21",y1:"10",y2:"10",key:"xt86sb"}]]);/**
149
149
  * @license lucide-react v0.294.0 - ISC
150
150
  *
151
151
  * This source code is licensed under the ISC license.
152
152
  * See the LICENSE file in the root directory of this source tree.
153
- */const Ht=De("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
153
+ */const Ht=Te("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
154
154
  * @license lucide-react v0.294.0 - ISC
155
155
  *
156
156
  * This source code is licensed under the ISC license.
157
157
  * See the LICENSE file in the root directory of this source tree.
158
- */const fg=De("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
158
+ */const fg=Te("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
159
159
  * @license lucide-react v0.294.0 - ISC
160
160
  *
161
161
  * This source code is licensed under the ISC license.
162
162
  * See the LICENSE file in the root directory of this source tree.
163
- */const of=De("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
163
+ */const of=Te("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
164
164
  * @license lucide-react v0.294.0 - ISC
165
165
  *
166
166
  * This source code is licensed under the ISC license.
167
167
  * See the LICENSE file in the root directory of this source tree.
168
- */const TS=De("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
168
+ */const TS=Te("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
169
169
  * @license lucide-react v0.294.0 - ISC
170
170
  *
171
171
  * This source code is licensed under the ISC license.
172
172
  * See the LICENSE file in the root directory of this source tree.
173
- */const Jp=De("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
173
+ */const Jp=Te("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
174
174
  * @license lucide-react v0.294.0 - ISC
175
175
  *
176
176
  * This source code is licensed under the ISC license.
177
177
  * See the LICENSE file in the root directory of this source tree.
178
- */const nR=De("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
178
+ */const nR=Te("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
179
179
  * @license lucide-react v0.294.0 - ISC
180
180
  *
181
181
  * This source code is licensed under the ISC license.
182
182
  * See the LICENSE file in the root directory of this source tree.
183
- */const mg=De("Clock1",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 14.5 8",key:"12zbmj"}]]);/**
183
+ */const mg=Te("Clock1",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 14.5 8",key:"12zbmj"}]]);/**
184
184
  * @license lucide-react v0.294.0 - ISC
185
185
  *
186
186
  * This source code is licensed under the ISC license.
187
187
  * See the LICENSE file in the root directory of this source tree.
188
- */const Ld=De("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
188
+ */const Ld=Te("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
189
189
  * @license lucide-react v0.294.0 - ISC
190
190
  *
191
191
  * This source code is licensed under the ISC license.
192
192
  * See the LICENSE file in the root directory of this source tree.
193
- */const vy=De("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
193
+ */const vy=Te("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
194
194
  * @license lucide-react v0.294.0 - ISC
195
195
  *
196
196
  * This source code is licensed under the ISC license.
197
197
  * See the LICENSE file in the root directory of this source tree.
198
- */const by=De("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
198
+ */const by=Te("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
199
199
  * @license lucide-react v0.294.0 - ISC
200
200
  *
201
201
  * This source code is licensed under the ISC license.
202
202
  * See the LICENSE file in the root directory of this source tree.
203
- */const Nt=De("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"}]]);/**
203
+ */const Nt=Te("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"}]]);/**
204
204
  * @license lucide-react v0.294.0 - ISC
205
205
  *
206
206
  * This source code is licensed under the ISC license.
207
207
  * See the LICENSE file in the root directory of this source tree.
208
- */const DS=De("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
208
+ */const DS=Te("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
209
209
  * @license lucide-react v0.294.0 - ISC
210
210
  *
211
211
  * This source code is licensed under the ISC license.
212
212
  * See the LICENSE file in the root directory of this source tree.
213
- */const _S=De("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/**
213
+ */const _S=Te("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/**
214
214
  * @license lucide-react v0.294.0 - ISC
215
215
  *
216
216
  * This source code is licensed under the ISC license.
217
217
  * See the LICENSE file in the root directory of this source tree.
218
- */const Xo=De("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
218
+ */const Xo=Te("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
219
219
  * @license lucide-react v0.294.0 - ISC
220
220
  *
221
221
  * This source code is licensed under the ISC license.
222
222
  * See the LICENSE file in the root directory of this source tree.
223
- */const e0=De("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
223
+ */const e0=Te("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
224
224
  * @license lucide-react v0.294.0 - ISC
225
225
  *
226
226
  * This source code is licensed under the ISC license.
227
227
  * See the LICENSE file in the root directory of this source tree.
228
- */const sR=De("Fingerprint",[["path",{d:"M2 12C2 6.5 6.5 2 12 2a10 10 0 0 1 8 4",key:"1jc9o5"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12c0-.7.12-1.37.34-2",key:"1mxgy1"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2c0 .47 0 1.17-.02 2",key:"1fgabc"}]]);/**
228
+ */const sR=Te("Fingerprint",[["path",{d:"M2 12C2 6.5 6.5 2 12 2a10 10 0 0 1 8 4",key:"1jc9o5"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12c0-.7.12-1.37.34-2",key:"1mxgy1"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2c0 .47 0 1.17-.02 2",key:"1fgabc"}]]);/**
229
229
  * @license lucide-react v0.294.0 - ISC
230
230
  *
231
231
  * This source code is licensed under the ISC license.
232
232
  * See the LICENSE file in the root directory of this source tree.
233
- */const aR=De("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/**
233
+ */const aR=Te("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/**
234
234
  * @license lucide-react v0.294.0 - ISC
235
235
  *
236
236
  * This source code is licensed under the ISC license.
237
237
  * See the LICENSE file in the root directory of this source tree.
238
- */const sn=De("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
238
+ */const sn=Te("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
239
239
  * @license lucide-react v0.294.0 - ISC
240
240
  *
241
241
  * This source code is licensed under the ISC license.
242
242
  * See the LICENSE file in the root directory of this source tree.
243
- */const rR=De("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"}]]);/**
243
+ */const rR=Te("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"}]]);/**
244
244
  * @license lucide-react v0.294.0 - ISC
245
245
  *
246
246
  * This source code is licensed under the ISC license.
247
247
  * See the LICENSE file in the root directory of this source tree.
248
- */const Hd=De("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
248
+ */const Hd=Te("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
249
249
  * @license lucide-react v0.294.0 - ISC
250
250
  *
251
251
  * This source code is licensed under the ISC license.
252
252
  * See the LICENSE file in the root directory of this source tree.
253
- */const co=De("Key",[["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["path",{d:"m15.5 7.5 3 3L22 7l-3-3",key:"1rn1fs"}]]);/**
253
+ */const co=Te("Key",[["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["path",{d:"m15.5 7.5 3 3L22 7l-3-3",key:"1rn1fs"}]]);/**
254
254
  * @license lucide-react v0.294.0 - ISC
255
255
  *
256
256
  * This source code is licensed under the ISC license.
257
257
  * See the LICENSE file in the root directory of this source tree.
258
- */const iR=De("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
258
+ */const iR=Te("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
259
259
  * @license lucide-react v0.294.0 - ISC
260
260
  *
261
261
  * This source code is licensed under the ISC license.
262
262
  * See the LICENSE file in the root directory of this source tree.
263
- */const Cm=De("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
263
+ */const Cm=Te("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
264
264
  * @license lucide-react v0.294.0 - ISC
265
265
  *
266
266
  * This source code is licensed under the ISC license.
267
267
  * See the LICENSE file in the root directory of this source tree.
268
- */const Vs=De("Loader",[["line",{x1:"12",x2:"12",y1:"2",y2:"6",key:"gza1u7"}],["line",{x1:"12",x2:"12",y1:"18",y2:"22",key:"1qhbu9"}],["line",{x1:"4.93",x2:"7.76",y1:"4.93",y2:"7.76",key:"xae44r"}],["line",{x1:"16.24",x2:"19.07",y1:"16.24",y2:"19.07",key:"bxnmvf"}],["line",{x1:"2",x2:"6",y1:"12",y2:"12",key:"89khin"}],["line",{x1:"18",x2:"22",y1:"12",y2:"12",key:"pb8tfm"}],["line",{x1:"4.93",x2:"7.76",y1:"19.07",y2:"16.24",key:"1uxjnu"}],["line",{x1:"16.24",x2:"19.07",y1:"7.76",y2:"4.93",key:"6duxfx"}]]);/**
268
+ */const oR=Te("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
269
269
  * @license lucide-react v0.294.0 - ISC
270
270
  *
271
271
  * This source code is licensed under the ISC license.
272
272
  * See the LICENSE file in the root directory of this source tree.
273
- */const xu=De("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
273
+ */const Vs=Te("Loader",[["line",{x1:"12",x2:"12",y1:"2",y2:"6",key:"gza1u7"}],["line",{x1:"12",x2:"12",y1:"18",y2:"22",key:"1qhbu9"}],["line",{x1:"4.93",x2:"7.76",y1:"4.93",y2:"7.76",key:"xae44r"}],["line",{x1:"16.24",x2:"19.07",y1:"16.24",y2:"19.07",key:"bxnmvf"}],["line",{x1:"2",x2:"6",y1:"12",y2:"12",key:"89khin"}],["line",{x1:"18",x2:"22",y1:"12",y2:"12",key:"pb8tfm"}],["line",{x1:"4.93",x2:"7.76",y1:"19.07",y2:"16.24",key:"1uxjnu"}],["line",{x1:"16.24",x2:"19.07",y1:"7.76",y2:"4.93",key:"6duxfx"}]]);/**
274
274
  * @license lucide-react v0.294.0 - ISC
275
275
  *
276
276
  * This source code is licensed under the ISC license.
277
277
  * See the LICENSE file in the root directory of this source tree.
278
- */const uh=De("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
278
+ */const xu=Te("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
279
279
  * @license lucide-react v0.294.0 - ISC
280
280
  *
281
281
  * This source code is licensed under the ISC license.
282
282
  * See the LICENSE file in the root directory of this source tree.
283
- */const oR=De("MoreHorizontal",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
283
+ */const uh=Te("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
284
284
  * @license lucide-react v0.294.0 - ISC
285
285
  *
286
286
  * This source code is licensed under the ISC license.
287
287
  * See the LICENSE file in the root directory of this source tree.
288
- */const lR=De("MoreVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/**
288
+ */const lR=Te("MoreHorizontal",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
289
289
  * @license lucide-react v0.294.0 - ISC
290
290
  *
291
291
  * This source code is licensed under the ISC license.
292
292
  * See the LICENSE file in the root directory of this source tree.
293
- */const ii=De("PenSquare",[["path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1qinfi"}],["path",{d:"M18.5 2.5a2.12 2.12 0 0 1 3 3L12 15l-4 1 1-4Z",key:"w2jsv5"}]]);/**
293
+ */const cR=Te("MoreVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/**
294
294
  * @license lucide-react v0.294.0 - ISC
295
295
  *
296
296
  * This source code is licensed under the ISC license.
297
297
  * See the LICENSE file in the root directory of this source tree.
298
- */const ur=De("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
298
+ */const ii=Te("PenSquare",[["path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1qinfi"}],["path",{d:"M18.5 2.5a2.12 2.12 0 0 1 3 3L12 15l-4 1 1-4Z",key:"w2jsv5"}]]);/**
299
299
  * @license lucide-react v0.294.0 - ISC
300
300
  *
301
301
  * This source code is licensed under the ISC license.
302
302
  * See the LICENSE file in the root directory of this source tree.
303
- */const yy=De("Puzzle",[["path",{d:"M19.439 7.85c-.049.322.059.648.289.878l1.568 1.568c.47.47.706 1.087.706 1.704s-.235 1.233-.706 1.704l-1.611 1.611a.98.98 0 0 1-.837.276c-.47-.07-.802-.48-.968-.925a2.501 2.501 0 1 0-3.214 3.214c.446.166.855.497.925.968a.979.979 0 0 1-.276.837l-1.61 1.61a2.404 2.404 0 0 1-1.705.707 2.402 2.402 0 0 1-1.704-.706l-1.568-1.568a1.026 1.026 0 0 0-.877-.29c-.493.074-.84.504-1.02.968a2.5 2.5 0 1 1-3.237-3.237c.464-.18.894-.527.967-1.02a1.026 1.026 0 0 0-.289-.877l-1.568-1.568A2.402 2.402 0 0 1 1.998 12c0-.617.236-1.234.706-1.704L4.23 8.77c.24-.24.581-.353.917-.303.515.077.877.528 1.073 1.01a2.5 2.5 0 1 0 3.259-3.259c-.482-.196-.933-.558-1.01-1.073-.05-.336.062-.676.303-.917l1.525-1.525A2.402 2.402 0 0 1 12 1.998c.617 0 1.234.236 1.704.706l1.568 1.568c.23.23.556.338.877.29.493-.074.84-.504 1.02-.968a2.5 2.5 0 1 1 3.237 3.237c-.464.18-.894.527-.967 1.02Z",key:"i0oyt7"}]]);/**
303
+ */const ur=Te("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
304
304
  * @license lucide-react v0.294.0 - ISC
305
305
  *
306
306
  * This source code is licensed under the ISC license.
307
307
  * See the LICENSE file in the root directory of this source tree.
308
- */const xg=De("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"}]]);/**
308
+ */const yy=Te("Puzzle",[["path",{d:"M19.439 7.85c-.049.322.059.648.289.878l1.568 1.568c.47.47.706 1.087.706 1.704s-.235 1.233-.706 1.704l-1.611 1.611a.98.98 0 0 1-.837.276c-.47-.07-.802-.48-.968-.925a2.501 2.501 0 1 0-3.214 3.214c.446.166.855.497.925.968a.979.979 0 0 1-.276.837l-1.61 1.61a2.404 2.404 0 0 1-1.705.707 2.402 2.402 0 0 1-1.704-.706l-1.568-1.568a1.026 1.026 0 0 0-.877-.29c-.493.074-.84.504-1.02.968a2.5 2.5 0 1 1-3.237-3.237c.464-.18.894-.527.967-1.02a1.026 1.026 0 0 0-.289-.877l-1.568-1.568A2.402 2.402 0 0 1 1.998 12c0-.617.236-1.234.706-1.704L4.23 8.77c.24-.24.581-.353.917-.303.515.077.877.528 1.073 1.01a2.5 2.5 0 1 0 3.259-3.259c-.482-.196-.933-.558-1.01-1.073-.05-.336.062-.676.303-.917l1.525-1.525A2.402 2.402 0 0 1 12 1.998c.617 0 1.234.236 1.704.706l1.568 1.568c.23.23.556.338.877.29.493-.074.84-.504 1.02-.968a2.5 2.5 0 1 1 3.237 3.237c-.464.18-.894.527-.967 1.02Z",key:"i0oyt7"}]]);/**
309
309
  * @license lucide-react v0.294.0 - ISC
310
310
  *
311
311
  * This source code is licensed under the ISC license.
312
312
  * See the LICENSE file in the root directory of this source tree.
313
- */const oi=De("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
313
+ */const xg=Te("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"}]]);/**
314
314
  * @license lucide-react v0.294.0 - ISC
315
315
  *
316
316
  * This source code is licensed under the ISC license.
317
317
  * See the LICENSE file in the root directory of this source tree.
318
- */const cR=De("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/**
318
+ */const oi=Te("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
319
319
  * @license lucide-react v0.294.0 - ISC
320
320
  *
321
321
  * This source code is licensed under the ISC license.
322
322
  * See the LICENSE file in the root directory of this source tree.
323
- */const uo=De("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
323
+ */const dR=Te("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/**
324
324
  * @license lucide-react v0.294.0 - ISC
325
325
  *
326
326
  * This source code is licensed under the ISC license.
327
327
  * See the LICENSE file in the root directory of this source tree.
328
- */const kn=De("Shield",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}]]);/**
328
+ */const uo=Te("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
329
329
  * @license lucide-react v0.294.0 - ISC
330
330
  *
331
331
  * This source code is licensed under the ISC license.
332
332
  * See the LICENSE file in the root directory of this source tree.
333
- */const dR=De("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]);/**
333
+ */const kn=Te("Shield",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}]]);/**
334
334
  * @license lucide-react v0.294.0 - ISC
335
335
  *
336
336
  * This source code is licensed under the ISC license.
337
337
  * See the LICENSE file in the root directory of this source tree.
338
- */const uR=De("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
338
+ */const uR=Te("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]);/**
339
339
  * @license lucide-react v0.294.0 - ISC
340
340
  *
341
341
  * This source code is licensed under the ISC license.
342
342
  * See the LICENSE file in the root directory of this source tree.
343
- */const wy=De("TestTube",[["path",{d:"M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5h0c-1.4 0-2.5-1.1-2.5-2.5V2",key:"187lwq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M14.5 16h-5",key:"1ox875"}]]);/**
343
+ */const hR=Te("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
344
344
  * @license lucide-react v0.294.0 - ISC
345
345
  *
346
346
  * This source code is licensed under the ISC license.
347
347
  * See the LICENSE file in the root directory of this source tree.
348
- */const t0=De("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
348
+ */const wy=Te("TestTube",[["path",{d:"M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5h0c-1.4 0-2.5-1.1-2.5-2.5V2",key:"187lwq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M14.5 16h-5",key:"1ox875"}]]);/**
349
349
  * @license lucide-react v0.294.0 - ISC
350
350
  *
351
351
  * This source code is licensed under the ISC license.
352
352
  * See the LICENSE file in the root directory of this source tree.
353
- */const hR=De("Trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]);/**
353
+ */const t0=Te("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
354
354
  * @license lucide-react v0.294.0 - ISC
355
355
  *
356
356
  * This source code is licensed under the ISC license.
357
357
  * See the LICENSE file in the root directory of this source tree.
358
- */const gg=De("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"}]]);/**
358
+ */const fR=Te("Trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]);/**
359
359
  * @license lucide-react v0.294.0 - ISC
360
360
  *
361
361
  * This source code is licensed under the ISC license.
362
362
  * See the LICENSE file in the root directory of this source tree.
363
- */const jy=De("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
363
+ */const gg=Te("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"}]]);/**
364
364
  * @license lucide-react v0.294.0 - ISC
365
365
  *
366
366
  * This source code is licensed under the ISC license.
367
367
  * See the LICENSE file in the root directory of this source tree.
368
- */const li=De("Users",[["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"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
368
+ */const jy=Te("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
369
369
  * @license lucide-react v0.294.0 - ISC
370
370
  *
371
371
  * This source code is licensed under the ISC license.
372
372
  * See the LICENSE file in the root directory of this source tree.
373
- */const AS=De("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
373
+ */const li=Te("Users",[["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"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
374
374
  * @license lucide-react v0.294.0 - ISC
375
375
  *
376
376
  * This source code is licensed under the ISC license.
377
377
  * See the LICENSE file in the root directory of this source tree.
378
- */const $r=De("XCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
378
+ */const AS=Te("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
379
379
  * @license lucide-react v0.294.0 - ISC
380
380
  *
381
381
  * This source code is licensed under the ISC license.
382
382
  * See the LICENSE file in the root directory of this source tree.
383
- */const Wt=De("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
383
+ */const $r=Te("XCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
384
384
  * @license lucide-react v0.294.0 - ISC
385
385
  *
386
386
  * This source code is licensed under the ISC license.
387
387
  * See the LICENSE file in the root directory of this source tree.
388
- */const Em=De("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]]);function OS(e){var t,n,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=OS(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function hh(){for(var e,t,n=0,s="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=OS(e))&&(s&&(s+=" "),s+=t);return s}const n0="-",fR=e=>{const t=xR(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:o=>{const l=o.split(n0);return l[0]===""&&l.length!==1&&l.shift(),zS(l,t)||mR(o)},getConflictingClassGroupIds:(o,l)=>{const c=n[o]||[];return l&&s[o]?[...c,...s[o]]:c}}},zS=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],s=t.nextPart.get(n),r=s?zS(e.slice(1),s):void 0;if(r)return r;if(t.validators.length===0)return;const i=e.join(n0);return(o=t.validators.find(({validator:l})=>l(i)))==null?void 0:o.classGroupId},Ny=/^\[(.+)\]$/,mR=e=>{if(Ny.test(e)){const t=Ny.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},xR=e=>{const{theme:t,prefix:n}=e,s={nextPart:new Map,validators:[]};return pR(Object.entries(e.classGroups),n).forEach(([i,o])=>{pg(o,s,i,t)}),s},pg=(e,t,n,s)=>{e.forEach(r=>{if(typeof r=="string"){const i=r===""?t:Sy(t,r);i.classGroupId=n;return}if(typeof r=="function"){if(gR(r)){pg(r(s),t,n,s);return}t.validators.push({validator:r,classGroupId:n});return}Object.entries(r).forEach(([i,o])=>{pg(o,Sy(t,i),n,s)})})},Sy=(e,t)=>{let n=e;return t.split(n0).forEach(s=>{n.nextPart.has(s)||n.nextPart.set(s,{nextPart:new Map,validators:[]}),n=n.nextPart.get(s)}),n},gR=e=>e.isThemeGetter,pR=(e,t)=>t?e.map(([n,s])=>{const r=s.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,l])=>[t+o,l])):i);return[n,r]}):e,vR=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,s=new Map;const r=(i,o)=>{n.set(i,o),t++,t>e&&(t=0,s=n,n=new Map)};return{get(i){let o=n.get(i);if(o!==void 0)return o;if((o=s.get(i))!==void 0)return r(i,o),o},set(i,o){n.has(i)?n.set(i,o):r(i,o)}}},RS="!",bR=e=>{const{separator:t,experimentalParseClassName:n}=e,s=t.length===1,r=t[0],i=t.length,o=l=>{const c=[];let u=0,h=0,d;for(let j=0;j<l.length;j++){let g=l[j];if(u===0){if(g===r&&(s||l.slice(j,j+i)===t)){c.push(l.slice(h,j)),h=j+i;continue}if(g==="/"){d=j;continue}}g==="["?u++:g==="]"&&u--}const f=c.length===0?l:l.substring(h),x=f.startsWith(RS),y=x?f.substring(1):f,v=d&&d>h?d-h:void 0;return{modifiers:c,hasImportantModifier:x,baseClassName:y,maybePostfixModifierPosition:v}};return n?l=>n({className:l,parseClassName:o}):o},yR=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(s=>{s[0]==="["?(t.push(...n.sort(),s),n=[]):n.push(s)}),t.push(...n.sort()),t},wR=e=>({cache:vR(e.cacheSize),parseClassName:bR(e),...fR(e)}),jR=/\s+/,NR=(e,t)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:r}=t,i=[],o=e.trim().split(jR);let l="";for(let c=o.length-1;c>=0;c-=1){const u=o[c],{modifiers:h,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:x}=n(u);let y=!!x,v=s(y?f.substring(0,x):f);if(!v){if(!y){l=u+(l.length>0?" "+l:l);continue}if(v=s(f),!v){l=u+(l.length>0?" "+l:l);continue}y=!1}const j=yR(h).join(":"),g=d?j+RS:j,b=g+v;if(i.includes(b))continue;i.push(b);const p=r(v,y);for(let w=0;w<p.length;++w){const N=p[w];i.push(g+N)}l=u+(l.length>0?" "+l:l)}return l};function SR(){let e=0,t,n,s="";for(;e<arguments.length;)(t=arguments[e++])&&(n=US(t))&&(s&&(s+=" "),s+=n);return s}const US=e=>{if(typeof e=="string")return e;let t,n="";for(let s=0;s<e.length;s++)e[s]&&(t=US(e[s]))&&(n&&(n+=" "),n+=t);return n};function CR(e,...t){let n,s,r,i=o;function o(c){const u=t.reduce((h,d)=>d(h),e());return n=wR(u),s=n.cache.get,r=n.cache.set,i=l,l(c)}function l(c){const u=s(c);if(u)return u;const h=NR(c,n);return r(c,h),h}return function(){return i(SR.apply(null,arguments))}}const pt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},$S=/^\[(?:([a-z-]+):)?(.+)\]$/i,ER=/^\d+\/\d+$/,kR=new Set(["px","full","screen"]),MR=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,TR=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,DR=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,_R=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,AR=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,na=e=>ho(e)||kR.has(e)||ER.test(e),Ra=e=>Go(e,"length",HR),ho=e=>!!e&&!Number.isNaN(Number(e)),km=e=>Go(e,"number",ho),gl=e=>!!e&&Number.isInteger(Number(e)),OR=e=>e.endsWith("%")&&ho(e.slice(0,-1)),Ye=e=>$S.test(e),Ua=e=>MR.test(e),zR=new Set(["length","size","percentage"]),RR=e=>Go(e,zR,PS),UR=e=>Go(e,"position",PS),$R=new Set(["image","url"]),PR=e=>Go(e,$R,VR),LR=e=>Go(e,"",BR),pl=()=>!0,Go=(e,t,n)=>{const s=$S.exec(e);return s?s[1]?typeof t=="string"?s[1]===t:t.has(s[1]):n(s[2]):!1},HR=e=>TR.test(e)&&!DR.test(e),PS=()=>!1,BR=e=>_R.test(e),VR=e=>AR.test(e),YR=()=>{const e=pt("colors"),t=pt("spacing"),n=pt("blur"),s=pt("brightness"),r=pt("borderColor"),i=pt("borderRadius"),o=pt("borderSpacing"),l=pt("borderWidth"),c=pt("contrast"),u=pt("grayscale"),h=pt("hueRotate"),d=pt("invert"),f=pt("gap"),x=pt("gradientColorStops"),y=pt("gradientColorStopPositions"),v=pt("inset"),j=pt("margin"),g=pt("opacity"),b=pt("padding"),p=pt("saturate"),w=pt("scale"),N=pt("sepia"),S=pt("skew"),C=pt("space"),T=pt("translate"),O=()=>["auto","contain","none"],H=()=>["auto","hidden","clip","visible","scroll"],U=()=>["auto",Ye,t],z=()=>[Ye,t],Y=()=>["",na,Ra],k=()=>["auto",ho,Ye],$=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],M=()=>["solid","dashed","dotted","double","none"],A=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],E=()=>["start","end","center","between","around","evenly","stretch"],D=()=>["","0",Ye],_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],I=()=>[ho,Ye];return{cacheSize:500,separator:":",theme:{colors:[pl],spacing:[na,Ra],blur:["none","",Ua,Ye],brightness:I(),borderColor:[e],borderRadius:["none","","full",Ua,Ye],borderSpacing:z(),borderWidth:Y(),contrast:I(),grayscale:D(),hueRotate:I(),invert:D(),gap:z(),gradientColorStops:[e],gradientColorStopPositions:[OR,Ra],inset:U(),margin:U(),opacity:I(),padding:z(),saturate:I(),scale:I(),sepia:D(),skew:I(),space:z(),translate:z()},classGroups:{aspect:[{aspect:["auto","square","video",Ye]}],container:["container"],columns:[{columns:[Ua]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...$(),Ye]}],overflow:[{overflow:H()}],"overflow-x":[{"overflow-x":H()}],"overflow-y":[{"overflow-y":H()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",gl,Ye]}],basis:[{basis:U()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ye]}],grow:[{grow:D()}],shrink:[{shrink:D()}],order:[{order:["first","last","none",gl,Ye]}],"grid-cols":[{"grid-cols":[pl]}],"col-start-end":[{col:["auto",{span:["full",gl,Ye]},Ye]}],"col-start":[{"col-start":k()}],"col-end":[{"col-end":k()}],"grid-rows":[{"grid-rows":[pl]}],"row-start-end":[{row:["auto",{span:[gl,Ye]},Ye]}],"row-start":[{"row-start":k()}],"row-end":[{"row-end":k()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ye]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ye]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...E()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...E(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...E(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[j]}],mx:[{mx:[j]}],my:[{my:[j]}],ms:[{ms:[j]}],me:[{me:[j]}],mt:[{mt:[j]}],mr:[{mr:[j]}],mb:[{mb:[j]}],ml:[{ml:[j]}],"space-x":[{"space-x":[C]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[C]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ye,t]}],"min-w":[{"min-w":[Ye,t,"min","max","fit"]}],"max-w":[{"max-w":[Ye,t,"none","full","min","max","fit","prose",{screen:[Ua]},Ua]}],h:[{h:[Ye,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ye,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ye,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ye,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ua,Ra]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",km]}],"font-family":[{font:[pl]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ye]}],"line-clamp":[{"line-clamp":["none",ho,km]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",na,Ye]}],"list-image":[{"list-image":["none",Ye]}],"list-style-type":[{list:["none","disc","decimal",Ye]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...M(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",na,Ra]}],"underline-offset":[{"underline-offset":["auto",na,Ye]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ye]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ye]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...$(),UR]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",RR]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},PR]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[x]}],"gradient-via":[{via:[x]}],"gradient-to":[{to:[x]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[g]}],"border-style":[{border:[...M(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[g]}],"divide-style":[{divide:M()}],"border-color":[{border:[r]}],"border-color-x":[{"border-x":[r]}],"border-color-y":[{"border-y":[r]}],"border-color-s":[{"border-s":[r]}],"border-color-e":[{"border-e":[r]}],"border-color-t":[{"border-t":[r]}],"border-color-r":[{"border-r":[r]}],"border-color-b":[{"border-b":[r]}],"border-color-l":[{"border-l":[r]}],"divide-color":[{divide:[r]}],"outline-style":[{outline:["",...M()]}],"outline-offset":[{"outline-offset":[na,Ye]}],"outline-w":[{outline:[na,Ra]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Y()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[na,Ra]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ua,LR]}],"shadow-color":[{shadow:[pl]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...A(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":A()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[s]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Ua,Ye]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[d]}],saturate:[{saturate:[p]}],sepia:[{sepia:[N]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[p]}],"backdrop-sepia":[{"backdrop-sepia":[N]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ye]}],duration:[{duration:I()}],ease:[{ease:["linear","in","out","in-out",Ye]}],delay:[{delay:I()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ye]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[gl,Ye]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ye]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ye]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ye]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[na,Ra,km]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},FR=CR(YR);function $e(...e){return FR(hh(e))}function Vt(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e==null||e(r),n===!1||!r.defaultPrevented)return t==null?void 0:t(r)}}function Cy(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function gr(...e){return t=>{let n=!1;const s=e.map(r=>{const i=Cy(r,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let r=0;r<s.length;r++){const i=s[r];typeof i=="function"?i():Cy(e[r],null)}}}}function Fn(...e){return m.useCallback(gr(...e),e)}function IR(e,t){const n=m.createContext(t),s=i=>{const{children:o,...l}=i,c=m.useMemo(()=>l,Object.values(l));return a.jsx(n.Provider,{value:c,children:o})};s.displayName=e+"Provider";function r(i){const o=m.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[s,r]}function lf(e,t=[]){let n=[];function s(i,o){const l=m.createContext(o),c=n.length;n=[...n,o];const u=d=>{var g;const{scope:f,children:x,...y}=d,v=((g=f==null?void 0:f[e])==null?void 0:g[c])||l,j=m.useMemo(()=>y,Object.values(y));return a.jsx(v.Provider,{value:j,children:x})};u.displayName=i+"Provider";function h(d,f){var v;const x=((v=f==null?void 0:f[e])==null?void 0:v[c])||l,y=m.useContext(x);if(y)return y;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,h]}const r=()=>{const i=n.map(o=>m.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return m.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return r.scopeName=e,[s,WR(r,...t)]}function WR(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const s=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const o=s.reduce((l,{useScope:c,scopeName:u})=>{const d=c(i)[`__scope${u}`];return{...l,...d}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function s0(e){const t=qR(e),n=m.forwardRef((s,r)=>{const{children:i,...o}=s,l=m.Children.toArray(i),c=l.find(GR);if(c){const u=c.props.children,h=l.map(d=>d===c?m.Children.count(u)>1?m.Children.only(null):m.isValidElement(u)?u.props.children:null:d);return a.jsx(t,{...o,ref:r,children:m.isValidElement(u)?m.cloneElement(u,void 0,h):null})}return a.jsx(t,{...o,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function qR(e){const t=m.forwardRef((n,s)=>{const{children:r,...i}=n;if(m.isValidElement(r)){const o=QR(r),l=ZR(i,r.props);return r.type!==m.Fragment&&(l.ref=s?gr(s,o):o),m.cloneElement(r,l)}return m.Children.count(r)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var LS=Symbol("radix.slottable");function XR(e){const t=({children:n})=>a.jsx(a.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=LS,t}function GR(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===LS}function ZR(e,t){const n={...t};for(const s in t){const r=e[s],i=t[s];/^on[A-Z]/.test(s)?r&&i?n[s]=(...l)=>{const c=i(...l);return r(...l),c}:r&&(n[s]=r):s==="style"?n[s]={...r,...i}:s==="className"&&(n[s]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function QR(e){var s,r;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var KR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ln=KR.reduce((e,t)=>{const n=s0(`Primitive.${t}`),s=m.forwardRef((r,i)=>{const{asChild:o,...l}=r,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{});function JR(e,t){e&&Dh.flushSync(()=>e.dispatchEvent(t))}function zo(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var s;return(s=t.current)==null?void 0:s.call(t,...n)},[])}function e8(e,t=globalThis==null?void 0:globalThis.document){const n=zo(e);m.useEffect(()=>{const s=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",s,{capture:!0}),()=>t.removeEventListener("keydown",s,{capture:!0})},[n,t])}var t8="DismissableLayer",vg="dismissableLayer.update",n8="dismissableLayer.pointerDownOutside",s8="dismissableLayer.focusOutside",Ey,HS=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),cf=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:s,onPointerDownOutside:r,onFocusOutside:i,onInteractOutside:o,onDismiss:l,...c}=e,u=m.useContext(HS),[h,d]=m.useState(null),f=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,x]=m.useState({}),y=Fn(t,C=>d(C)),v=Array.from(u.layers),[j]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=v.indexOf(j),b=h?v.indexOf(h):-1,p=u.layersWithOutsidePointerEventsDisabled.size>0,w=b>=g,N=i8(C=>{const T=C.target,O=[...u.branches].some(H=>H.contains(T));!w||O||(r==null||r(C),o==null||o(C),C.defaultPrevented||l==null||l())},f),S=o8(C=>{const T=C.target;[...u.branches].some(H=>H.contains(T))||(i==null||i(C),o==null||o(C),C.defaultPrevented||l==null||l())},f);return e8(C=>{b===u.layers.size-1&&(s==null||s(C),!C.defaultPrevented&&l&&(C.preventDefault(),l()))},f),m.useEffect(()=>{if(h)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Ey=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(h)),u.layers.add(h),ky(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Ey)}},[h,f,n,u]),m.useEffect(()=>()=>{h&&(u.layers.delete(h),u.layersWithOutsidePointerEventsDisabled.delete(h),ky())},[h,u]),m.useEffect(()=>{const C=()=>x({});return document.addEventListener(vg,C),()=>document.removeEventListener(vg,C)},[]),a.jsx(ln.div,{...c,ref:y,style:{pointerEvents:p?w?"auto":"none":void 0,...e.style},onFocusCapture:Vt(e.onFocusCapture,S.onFocusCapture),onBlurCapture:Vt(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:Vt(e.onPointerDownCapture,N.onPointerDownCapture)})});cf.displayName=t8;var a8="DismissableLayerBranch",r8=m.forwardRef((e,t)=>{const n=m.useContext(HS),s=m.useRef(null),r=Fn(t,s);return m.useEffect(()=>{const i=s.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),a.jsx(ln.div,{...e,ref:r})});r8.displayName=a8;function i8(e,t=globalThis==null?void 0:globalThis.document){const n=zo(e),s=m.useRef(!1),r=m.useRef(()=>{});return m.useEffect(()=>{const i=l=>{if(l.target&&!s.current){let c=function(){BS(n8,n,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=c,t.addEventListener("click",r.current,{once:!0})):c()}else t.removeEventListener("click",r.current);s.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>s.current=!0}}function o8(e,t=globalThis==null?void 0:globalThis.document){const n=zo(e),s=m.useRef(!1);return m.useEffect(()=>{const r=i=>{i.target&&!s.current&&BS(s8,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function ky(){const e=new CustomEvent(vg);document.dispatchEvent(e)}function BS(e,t,n,{discrete:s}){const r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),s?JR(r,i):r.dispatchEvent(i)}var pr=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},l8=kh[" useId ".trim().toString()]||(()=>{}),c8=0;function ps(e){const[t,n]=m.useState(l8());return pr(()=>{n(s=>s??String(c8++))},[e]),e||(t?`radix-${t}`:"")}const d8=["top","right","bottom","left"],vr=Math.min,_n=Math.max,fh=Math.round,Bd=Math.floor,Ys=e=>({x:e,y:e}),u8={left:"right",right:"left",bottom:"top",top:"bottom"},h8={start:"end",end:"start"};function bg(e,t,n){return _n(e,vr(t,n))}function ja(e,t){return typeof e=="function"?e(t):e}function Na(e){return e.split("-")[0]}function Zo(e){return e.split("-")[1]}function a0(e){return e==="x"?"y":"x"}function r0(e){return e==="y"?"height":"width"}const f8=new Set(["top","bottom"]);function Us(e){return f8.has(Na(e))?"y":"x"}function i0(e){return a0(Us(e))}function m8(e,t,n){n===void 0&&(n=!1);const s=Zo(e),r=i0(e),i=r0(r);let o=r==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=mh(o)),[o,mh(o)]}function x8(e){const t=mh(e);return[yg(e),t,yg(t)]}function yg(e){return e.replace(/start|end/g,t=>h8[t])}const My=["left","right"],Ty=["right","left"],g8=["top","bottom"],p8=["bottom","top"];function v8(e,t,n){switch(e){case"top":case"bottom":return n?t?Ty:My:t?My:Ty;case"left":case"right":return t?g8:p8;default:return[]}}function b8(e,t,n,s){const r=Zo(e);let i=v8(Na(e),n==="start",s);return r&&(i=i.map(o=>o+"-"+r),t&&(i=i.concat(i.map(yg)))),i}function mh(e){return e.replace(/left|right|bottom|top/g,t=>u8[t])}function y8(e){return{top:0,right:0,bottom:0,left:0,...e}}function VS(e){return typeof e!="number"?y8(e):{top:e,right:e,bottom:e,left:e}}function xh(e){const{x:t,y:n,width:s,height:r}=e;return{width:s,height:r,top:n,left:t,right:t+s,bottom:n+r,x:t,y:n}}function Dy(e,t,n){let{reference:s,floating:r}=e;const i=Us(t),o=i0(t),l=r0(o),c=Na(t),u=i==="y",h=s.x+s.width/2-r.width/2,d=s.y+s.height/2-r.height/2,f=s[l]/2-r[l]/2;let x;switch(c){case"top":x={x:h,y:s.y-r.height};break;case"bottom":x={x:h,y:s.y+s.height};break;case"right":x={x:s.x+s.width,y:d};break;case"left":x={x:s.x-r.width,y:d};break;default:x={x:s.x,y:s.y}}switch(Zo(t)){case"start":x[o]-=f*(n&&u?-1:1);break;case"end":x[o]+=f*(n&&u?-1:1);break}return x}const w8=async(e,t,n)=>{const{placement:s="bottom",strategy:r="absolute",middleware:i=[],platform:o}=n,l=i.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:r}),{x:h,y:d}=Dy(u,s,c),f=s,x={},y=0;for(let v=0;v<l.length;v++){const{name:j,fn:g}=l[v],{x:b,y:p,data:w,reset:N}=await g({x:h,y:d,initialPlacement:s,placement:f,strategy:r,middlewareData:x,rects:u,platform:o,elements:{reference:e,floating:t}});h=b??h,d=p??d,x={...x,[j]:{...x[j],...w}},N&&y<=50&&(y++,typeof N=="object"&&(N.placement&&(f=N.placement),N.rects&&(u=N.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:r}):N.rects),{x:h,y:d}=Dy(u,f,c)),v=-1)}return{x:h,y:d,placement:f,strategy:r,middlewareData:x}};async function Nc(e,t){var n;t===void 0&&(t={});const{x:s,y:r,platform:i,rects:o,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:f=!1,padding:x=0}=ja(t,e),y=VS(x),j=l[f?d==="floating"?"reference":"floating":d],g=xh(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(j)))==null||n?j:j.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:u,rootBoundary:h,strategy:c})),b=d==="floating"?{x:s,y:r,width:o.floating.width,height:o.floating.height}:o.reference,p=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),w=await(i.isElement==null?void 0:i.isElement(p))?await(i.getScale==null?void 0:i.getScale(p))||{x:1,y:1}:{x:1,y:1},N=xh(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:b,offsetParent:p,strategy:c}):b);return{top:(g.top-N.top+y.top)/w.y,bottom:(N.bottom-g.bottom+y.bottom)/w.y,left:(g.left-N.left+y.left)/w.x,right:(N.right-g.right+y.right)/w.x}}const j8=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:s,placement:r,rects:i,platform:o,elements:l,middlewareData:c}=t,{element:u,padding:h=0}=ja(e,t)||{};if(u==null)return{};const d=VS(h),f={x:n,y:s},x=i0(r),y=r0(x),v=await o.getDimensions(u),j=x==="y",g=j?"top":"left",b=j?"bottom":"right",p=j?"clientHeight":"clientWidth",w=i.reference[y]+i.reference[x]-f[x]-i.floating[y],N=f[x]-i.reference[x],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let C=S?S[p]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=l.floating[p]||i.floating[y]);const T=w/2-N/2,O=C/2-v[y]/2-1,H=vr(d[g],O),U=vr(d[b],O),z=H,Y=C-v[y]-U,k=C/2-v[y]/2+T,$=bg(z,k,Y),M=!c.arrow&&Zo(r)!=null&&k!==$&&i.reference[y]/2-(k<z?H:U)-v[y]/2<0,A=M?k<z?k-z:k-Y:0;return{[x]:f[x]+A,data:{[x]:$,centerOffset:k-$-A,...M&&{alignmentOffset:A}},reset:M}}}),N8=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,s;const{placement:r,middlewareData:i,rects:o,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:h=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:v=!0,...j}=ja(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const g=Na(r),b=Us(l),p=Na(l)===l,w=await(c.isRTL==null?void 0:c.isRTL(u.floating)),N=f||(p||!v?[mh(l)]:x8(l)),S=y!=="none";!f&&S&&N.push(...b8(l,v,y,w));const C=[l,...N],T=await Nc(t,j),O=[];let H=((s=i.flip)==null?void 0:s.overflows)||[];if(h&&O.push(T[g]),d){const k=m8(r,o,w);O.push(T[k[0]],T[k[1]])}if(H=[...H,{placement:r,overflows:O}],!O.every(k=>k<=0)){var U,z;const k=(((U=i.flip)==null?void 0:U.index)||0)+1,$=C[k];if($&&(!(d==="alignment"?b!==Us($):!1)||H.every(E=>Us(E.placement)===b?E.overflows[0]>0:!0)))return{data:{index:k,overflows:H},reset:{placement:$}};let M=(z=H.filter(A=>A.overflows[0]<=0).sort((A,E)=>A.overflows[1]-E.overflows[1])[0])==null?void 0:z.placement;if(!M)switch(x){case"bestFit":{var Y;const A=(Y=H.filter(E=>{if(S){const D=Us(E.placement);return D===b||D==="y"}return!0}).map(E=>[E.placement,E.overflows.filter(D=>D>0).reduce((D,_)=>D+_,0)]).sort((E,D)=>E[1]-D[1])[0])==null?void 0:Y[0];A&&(M=A);break}case"initialPlacement":M=l;break}if(r!==M)return{reset:{placement:M}}}return{}}}};function _y(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ay(e){return d8.some(t=>e[t]>=0)}const S8=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:s="referenceHidden",...r}=ja(e,t);switch(s){case"referenceHidden":{const i=await Nc(t,{...r,elementContext:"reference"}),o=_y(i,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Ay(o)}}}case"escaped":{const i=await Nc(t,{...r,altBoundary:!0}),o=_y(i,n.floating);return{data:{escapedOffsets:o,escaped:Ay(o)}}}default:return{}}}}},YS=new Set(["left","top"]);async function C8(e,t){const{placement:n,platform:s,elements:r}=e,i=await(s.isRTL==null?void 0:s.isRTL(r.floating)),o=Na(n),l=Zo(n),c=Us(n)==="y",u=YS.has(o)?-1:1,h=i&&c?-1:1,d=ja(t,e);let{mainAxis:f,crossAxis:x,alignmentAxis:y}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&typeof y=="number"&&(x=l==="end"?y*-1:y),c?{x:x*h,y:f*u}:{x:f*u,y:x*h}}const E8=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,s;const{x:r,y:i,placement:o,middlewareData:l}=t,c=await C8(t,e);return o===((n=l.offset)==null?void 0:n.placement)&&(s=l.arrow)!=null&&s.alignmentOffset?{}:{x:r+c.x,y:i+c.y,data:{...c,placement:o}}}}},k8=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:s,placement:r}=t,{mainAxis:i=!0,crossAxis:o=!1,limiter:l={fn:j=>{let{x:g,y:b}=j;return{x:g,y:b}}},...c}=ja(e,t),u={x:n,y:s},h=await Nc(t,c),d=Us(Na(r)),f=a0(d);let x=u[f],y=u[d];if(i){const j=f==="y"?"top":"left",g=f==="y"?"bottom":"right",b=x+h[j],p=x-h[g];x=bg(b,x,p)}if(o){const j=d==="y"?"top":"left",g=d==="y"?"bottom":"right",b=y+h[j],p=y-h[g];y=bg(b,y,p)}const v=l.fn({...t,[f]:x,[d]:y});return{...v,data:{x:v.x-n,y:v.y-s,enabled:{[f]:i,[d]:o}}}}}},M8=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:s,placement:r,rects:i,middlewareData:o}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=ja(e,t),h={x:n,y:s},d=Us(r),f=a0(d);let x=h[f],y=h[d];const v=ja(l,t),j=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const p=f==="y"?"height":"width",w=i.reference[f]-i.floating[p]+j.mainAxis,N=i.reference[f]+i.reference[p]-j.mainAxis;x<w?x=w:x>N&&(x=N)}if(u){var g,b;const p=f==="y"?"width":"height",w=YS.has(Na(r)),N=i.reference[d]-i.floating[p]+(w&&((g=o.offset)==null?void 0:g[d])||0)+(w?0:j.crossAxis),S=i.reference[d]+i.reference[p]+(w?0:((b=o.offset)==null?void 0:b[d])||0)-(w?j.crossAxis:0);y<N?y=N:y>S&&(y=S)}return{[f]:x,[d]:y}}}},T8=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,s;const{placement:r,rects:i,platform:o,elements:l}=t,{apply:c=()=>{},...u}=ja(e,t),h=await Nc(t,u),d=Na(r),f=Zo(r),x=Us(r)==="y",{width:y,height:v}=i.floating;let j,g;d==="top"||d==="bottom"?(j=d,g=f===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(g=d,j=f==="end"?"top":"bottom");const b=v-h.top-h.bottom,p=y-h.left-h.right,w=vr(v-h[j],b),N=vr(y-h[g],p),S=!t.middlewareData.shift;let C=w,T=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=p),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(C=b),S&&!f){const H=_n(h.left,0),U=_n(h.right,0),z=_n(h.top,0),Y=_n(h.bottom,0);x?T=y-2*(H!==0||U!==0?H+U:_n(h.left,h.right)):C=v-2*(z!==0||Y!==0?z+Y:_n(h.top,h.bottom))}await c({...t,availableWidth:T,availableHeight:C});const O=await o.getDimensions(l.floating);return y!==O.width||v!==O.height?{reset:{rects:!0}}:{}}}};function df(){return typeof window<"u"}function Qo(e){return FS(e)?(e.nodeName||"").toLowerCase():"#document"}function Hn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Gs(e){var t;return(t=(FS(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function FS(e){return df()?e instanceof Node||e instanceof Hn(e).Node:!1}function vs(e){return df()?e instanceof Element||e instanceof Hn(e).Element:!1}function Is(e){return df()?e instanceof HTMLElement||e instanceof Hn(e).HTMLElement:!1}function Oy(e){return!df()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Hn(e).ShadowRoot}const D8=new Set(["inline","contents"]);function Qc(e){const{overflow:t,overflowX:n,overflowY:s,display:r}=bs(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&!D8.has(r)}const _8=new Set(["table","td","th"]);function A8(e){return _8.has(Qo(e))}const O8=[":popover-open",":modal"];function uf(e){return O8.some(t=>{try{return e.matches(t)}catch{return!1}})}const z8=["transform","translate","scale","rotate","perspective"],R8=["transform","translate","scale","rotate","perspective","filter"],U8=["paint","layout","strict","content"];function o0(e){const t=l0(),n=vs(e)?bs(e):e;return z8.some(s=>n[s]?n[s]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||R8.some(s=>(n.willChange||"").includes(s))||U8.some(s=>(n.contain||"").includes(s))}function $8(e){let t=br(e);for(;Is(t)&&!Ro(t);){if(o0(t))return t;if(uf(t))return null;t=br(t)}return null}function l0(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const P8=new Set(["html","body","#document"]);function Ro(e){return P8.has(Qo(e))}function bs(e){return Hn(e).getComputedStyle(e)}function hf(e){return vs(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function br(e){if(Qo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Oy(e)&&e.host||Gs(e);return Oy(t)?t.host:t}function IS(e){const t=br(e);return Ro(t)?e.ownerDocument?e.ownerDocument.body:e.body:Is(t)&&Qc(t)?t:IS(t)}function Sc(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=IS(e),i=r===((s=e.ownerDocument)==null?void 0:s.body),o=Hn(r);if(i){const l=wg(o);return t.concat(o,o.visualViewport||[],Qc(r)?r:[],l&&n?Sc(l):[])}return t.concat(r,Sc(r,[],n))}function wg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function WS(e){const t=bs(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const r=Is(e),i=r?e.offsetWidth:n,o=r?e.offsetHeight:s,l=fh(n)!==i||fh(s)!==o;return l&&(n=i,s=o),{width:n,height:s,$:l}}function c0(e){return vs(e)?e:e.contextElement}function fo(e){const t=c0(e);if(!Is(t))return Ys(1);const n=t.getBoundingClientRect(),{width:s,height:r,$:i}=WS(t);let o=(i?fh(n.width):n.width)/s,l=(i?fh(n.height):n.height)/r;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const L8=Ys(0);function qS(e){const t=Hn(e);return!l0()||!t.visualViewport?L8:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function H8(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Hn(e)?!1:t}function ci(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=c0(e);let o=Ys(1);t&&(s?vs(s)&&(o=fo(s)):o=fo(e));const l=H8(i,n,s)?qS(i):Ys(0);let c=(r.left+l.x)/o.x,u=(r.top+l.y)/o.y,h=r.width/o.x,d=r.height/o.y;if(i){const f=Hn(i),x=s&&vs(s)?Hn(s):s;let y=f,v=wg(y);for(;v&&s&&x!==y;){const j=fo(v),g=v.getBoundingClientRect(),b=bs(v),p=g.left+(v.clientLeft+parseFloat(b.paddingLeft))*j.x,w=g.top+(v.clientTop+parseFloat(b.paddingTop))*j.y;c*=j.x,u*=j.y,h*=j.x,d*=j.y,c+=p,u+=w,y=Hn(v),v=wg(y)}}return xh({width:h,height:d,x:c,y:u})}function ff(e,t){const n=hf(e).scrollLeft;return t?t.left+n:ci(Gs(e)).left+n}function XS(e,t){const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-ff(e,n),r=n.top+t.scrollTop;return{x:s,y:r}}function B8(e){let{elements:t,rect:n,offsetParent:s,strategy:r}=e;const i=r==="fixed",o=Gs(s),l=t?uf(t.floating):!1;if(s===o||l&&i)return n;let c={scrollLeft:0,scrollTop:0},u=Ys(1);const h=Ys(0),d=Is(s);if((d||!d&&!i)&&((Qo(s)!=="body"||Qc(o))&&(c=hf(s)),Is(s))){const x=ci(s);u=fo(s),h.x=x.x+s.clientLeft,h.y=x.y+s.clientTop}const f=o&&!d&&!i?XS(o,c):Ys(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+h.x+f.x,y:n.y*u.y-c.scrollTop*u.y+h.y+f.y}}function V8(e){return Array.from(e.getClientRects())}function Y8(e){const t=Gs(e),n=hf(e),s=e.ownerDocument.body,r=_n(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),i=_n(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let o=-n.scrollLeft+ff(e);const l=-n.scrollTop;return bs(s).direction==="rtl"&&(o+=_n(t.clientWidth,s.clientWidth)-r),{width:r,height:i,x:o,y:l}}const zy=25;function F8(e,t){const n=Hn(e),s=Gs(e),r=n.visualViewport;let i=s.clientWidth,o=s.clientHeight,l=0,c=0;if(r){i=r.width,o=r.height;const h=l0();(!h||h&&t==="fixed")&&(l=r.offsetLeft,c=r.offsetTop)}const u=ff(s);if(u<=0){const h=s.ownerDocument,d=h.body,f=getComputedStyle(d),x=h.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,y=Math.abs(s.clientWidth-d.clientWidth-x);y<=zy&&(i-=y)}else u<=zy&&(i+=u);return{width:i,height:o,x:l,y:c}}const I8=new Set(["absolute","fixed"]);function W8(e,t){const n=ci(e,!0,t==="fixed"),s=n.top+e.clientTop,r=n.left+e.clientLeft,i=Is(e)?fo(e):Ys(1),o=e.clientWidth*i.x,l=e.clientHeight*i.y,c=r*i.x,u=s*i.y;return{width:o,height:l,x:c,y:u}}function Ry(e,t,n){let s;if(t==="viewport")s=F8(e,n);else if(t==="document")s=Y8(Gs(e));else if(vs(t))s=W8(t,n);else{const r=qS(e);s={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return xh(s)}function GS(e,t){const n=br(e);return n===t||!vs(n)||Ro(n)?!1:bs(n).position==="fixed"||GS(n,t)}function q8(e,t){const n=t.get(e);if(n)return n;let s=Sc(e,[],!1).filter(l=>vs(l)&&Qo(l)!=="body"),r=null;const i=bs(e).position==="fixed";let o=i?br(e):e;for(;vs(o)&&!Ro(o);){const l=bs(o),c=o0(o);!c&&l.position==="fixed"&&(r=null),(i?!c&&!r:!c&&l.position==="static"&&!!r&&I8.has(r.position)||Qc(o)&&!c&&GS(e,o))?s=s.filter(h=>h!==o):r=l,o=br(o)}return t.set(e,s),s}function X8(e){let{element:t,boundary:n,rootBoundary:s,strategy:r}=e;const o=[...n==="clippingAncestors"?uf(t)?[]:q8(t,this._c):[].concat(n),s],l=o[0],c=o.reduce((u,h)=>{const d=Ry(t,h,r);return u.top=_n(d.top,u.top),u.right=vr(d.right,u.right),u.bottom=vr(d.bottom,u.bottom),u.left=_n(d.left,u.left),u},Ry(t,l,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function G8(e){const{width:t,height:n}=WS(e);return{width:t,height:n}}function Z8(e,t,n){const s=Is(t),r=Gs(t),i=n==="fixed",o=ci(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=Ys(0);function u(){c.x=ff(r)}if(s||!s&&!i)if((Qo(t)!=="body"||Qc(r))&&(l=hf(t)),s){const x=ci(t,!0,i,t);c.x=x.x+t.clientLeft,c.y=x.y+t.clientTop}else r&&u();i&&!s&&r&&u();const h=r&&!s&&!i?XS(r,l):Ys(0),d=o.left+l.scrollLeft-c.x-h.x,f=o.top+l.scrollTop-c.y-h.y;return{x:d,y:f,width:o.width,height:o.height}}function Mm(e){return bs(e).position==="static"}function Uy(e,t){if(!Is(e)||bs(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Gs(e)===n&&(n=n.ownerDocument.body),n}function ZS(e,t){const n=Hn(e);if(uf(e))return n;if(!Is(e)){let r=br(e);for(;r&&!Ro(r);){if(vs(r)&&!Mm(r))return r;r=br(r)}return n}let s=Uy(e,t);for(;s&&A8(s)&&Mm(s);)s=Uy(s,t);return s&&Ro(s)&&Mm(s)&&!o0(s)?n:s||$8(e)||n}const Q8=async function(e){const t=this.getOffsetParent||ZS,n=this.getDimensions,s=await n(e.floating);return{reference:Z8(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function K8(e){return bs(e).direction==="rtl"}const J8={convertOffsetParentRelativeRectToViewportRelativeRect:B8,getDocumentElement:Gs,getClippingRect:X8,getOffsetParent:ZS,getElementRects:Q8,getClientRects:V8,getDimensions:G8,getScale:fo,isElement:vs,isRTL:K8};function QS(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function e7(e,t){let n=null,s;const r=Gs(e);function i(){var l;clearTimeout(s),(l=n)==null||l.disconnect(),n=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const u=e.getBoundingClientRect(),{left:h,top:d,width:f,height:x}=u;if(l||t(),!f||!x)return;const y=Bd(d),v=Bd(r.clientWidth-(h+f)),j=Bd(r.clientHeight-(d+x)),g=Bd(h),p={rootMargin:-y+"px "+-v+"px "+-j+"px "+-g+"px",threshold:_n(0,vr(1,c))||1};let w=!0;function N(S){const C=S[0].intersectionRatio;if(C!==c){if(!w)return o();C?o(!1,C):s=setTimeout(()=>{o(!1,1e-7)},1e3)}C===1&&!QS(u,e.getBoundingClientRect())&&o(),w=!1}try{n=new IntersectionObserver(N,{...p,root:r.ownerDocument})}catch{n=new IntersectionObserver(N,p)}n.observe(e)}return o(!0),i}function t7(e,t,n,s){s===void 0&&(s={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=s,u=c0(e),h=r||i?[...u?Sc(u):[],...Sc(t)]:[];h.forEach(g=>{r&&g.addEventListener("scroll",n,{passive:!0}),i&&g.addEventListener("resize",n)});const d=u&&l?e7(u,n):null;let f=-1,x=null;o&&(x=new ResizeObserver(g=>{let[b]=g;b&&b.target===u&&x&&(x.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var p;(p=x)==null||p.observe(t)})),n()}),u&&!c&&x.observe(u),x.observe(t));let y,v=c?ci(e):null;c&&j();function j(){const g=ci(e);v&&!QS(v,g)&&n(),v=g,y=requestAnimationFrame(j)}return n(),()=>{var g;h.forEach(b=>{r&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),d==null||d(),(g=x)==null||g.disconnect(),x=null,c&&cancelAnimationFrame(y)}}const n7=E8,s7=k8,a7=N8,r7=T8,i7=S8,$y=j8,o7=M8,l7=(e,t,n)=>{const s=new Map,r={platform:J8,...n},i={...r.platform,_c:s};return w8(e,t,{...r,platform:i})};var c7=typeof document<"u",d7=function(){},gu=c7?m.useLayoutEffect:d7;function gh(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,s,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(s=n;s--!==0;)if(!gh(e[s],t[s]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!{}.hasOwnProperty.call(t,r[s]))return!1;for(s=n;s--!==0;){const i=r[s];if(!(i==="_owner"&&e.$$typeof)&&!gh(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function KS(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Py(e,t){const n=KS(e);return Math.round(t*n)/n}function Tm(e){const t=m.useRef(e);return gu(()=>{t.current=e}),t}function u7(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:s=[],platform:r,elements:{reference:i,floating:o}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[h,d]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,x]=m.useState(s);gh(f,s)||x(s);const[y,v]=m.useState(null),[j,g]=m.useState(null),b=m.useCallback(E=>{E!==S.current&&(S.current=E,v(E))},[]),p=m.useCallback(E=>{E!==C.current&&(C.current=E,g(E))},[]),w=i||y,N=o||j,S=m.useRef(null),C=m.useRef(null),T=m.useRef(h),O=c!=null,H=Tm(c),U=Tm(r),z=Tm(u),Y=m.useCallback(()=>{if(!S.current||!C.current)return;const E={placement:t,strategy:n,middleware:f};U.current&&(E.platform=U.current),l7(S.current,C.current,E).then(D=>{const _={...D,isPositioned:z.current!==!1};k.current&&!gh(T.current,_)&&(T.current=_,Dh.flushSync(()=>{d(_)}))})},[f,t,n,U,z]);gu(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(E=>({...E,isPositioned:!1})))},[u]);const k=m.useRef(!1);gu(()=>(k.current=!0,()=>{k.current=!1}),[]),gu(()=>{if(w&&(S.current=w),N&&(C.current=N),w&&N){if(H.current)return H.current(w,N,Y);Y()}},[w,N,Y,H,O]);const $=m.useMemo(()=>({reference:S,floating:C,setReference:b,setFloating:p}),[b,p]),M=m.useMemo(()=>({reference:w,floating:N}),[w,N]),A=m.useMemo(()=>{const E={position:n,left:0,top:0};if(!M.floating)return E;const D=Py(M.floating,h.x),_=Py(M.floating,h.y);return l?{...E,transform:"translate("+D+"px, "+_+"px)",...KS(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:D,top:_}},[n,l,M.floating,h.x,h.y]);return m.useMemo(()=>({...h,update:Y,refs:$,elements:M,floatingStyles:A}),[h,Y,$,M,A])}const h7=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:s,padding:r}=typeof e=="function"?e(n):e;return s&&t(s)?s.current!=null?$y({element:s.current,padding:r}).fn(n):{}:s?$y({element:s,padding:r}).fn(n):{}}}},f7=(e,t)=>({...n7(e),options:[e,t]}),m7=(e,t)=>({...s7(e),options:[e,t]}),x7=(e,t)=>({...o7(e),options:[e,t]}),g7=(e,t)=>({...a7(e),options:[e,t]}),p7=(e,t)=>({...r7(e),options:[e,t]}),v7=(e,t)=>({...i7(e),options:[e,t]}),b7=(e,t)=>({...h7(e),options:[e,t]});var y7="Arrow",JS=m.forwardRef((e,t)=>{const{children:n,width:s=10,height:r=5,...i}=e;return a.jsx(ln.svg,{...i,ref:t,width:s,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});JS.displayName=y7;var w7=JS;function j7(e){const[t,n]=m.useState(void 0);return pr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const s=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const i=r[0];let o,l;if("borderBoxSize"in i){const c=i.borderBoxSize,u=Array.isArray(c)?c[0]:c;o=u.inlineSize,l=u.blockSize}else o=e.offsetWidth,l=e.offsetHeight;n({width:o,height:l})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else n(void 0)},[e]),t}var d0="Popper",[e4,mf]=lf(d0),[N7,t4]=e4(d0),n4=e=>{const{__scopePopper:t,children:n}=e,[s,r]=m.useState(null);return a.jsx(N7,{scope:t,anchor:s,onAnchorChange:r,children:n})};n4.displayName=d0;var s4="PopperAnchor",a4=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:s,...r}=e,i=t4(s4,n),o=m.useRef(null),l=Fn(t,o),c=m.useRef(null);return m.useEffect(()=>{const u=c.current;c.current=(s==null?void 0:s.current)||o.current,u!==c.current&&i.onAnchorChange(c.current)}),s?null:a.jsx(ln.div,{...r,ref:l})});a4.displayName=s4;var u0="PopperContent",[S7,C7]=e4(u0),r4=m.forwardRef((e,t)=>{var ne,Z,se,xe,ae,ce;const{__scopePopper:n,side:s="bottom",sideOffset:r=0,align:i="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:h=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:x="optimized",onPlaced:y,...v}=e,j=t4(u0,n),[g,b]=m.useState(null),p=Fn(t,de=>b(de)),[w,N]=m.useState(null),S=j7(w),C=(S==null?void 0:S.width)??0,T=(S==null?void 0:S.height)??0,O=s+(i!=="center"?"-"+i:""),H=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},U=Array.isArray(u)?u:[u],z=U.length>0,Y={padding:H,boundary:U.filter(k7),altBoundary:z},{refs:k,floatingStyles:$,placement:M,isPositioned:A,middlewareData:E}=u7({strategy:"fixed",placement:O,whileElementsMounted:(...de)=>t7(...de,{animationFrame:x==="always"}),elements:{reference:j.anchor},middleware:[f7({mainAxis:r+T,alignmentAxis:o}),c&&m7({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?x7():void 0,...Y}),c&&g7({...Y}),p7({...Y,apply:({elements:de,rects:Se,availableWidth:Ee,availableHeight:Ae})=>{const{width:He,height:J}=Se.reference,oe=de.floating.style;oe.setProperty("--radix-popper-available-width",`${Ee}px`),oe.setProperty("--radix-popper-available-height",`${Ae}px`),oe.setProperty("--radix-popper-anchor-width",`${He}px`),oe.setProperty("--radix-popper-anchor-height",`${J}px`)}}),w&&b7({element:w,padding:l}),M7({arrowWidth:C,arrowHeight:T}),f&&v7({strategy:"referenceHidden",...Y})]}),[D,_]=l4(M),I=zo(y);pr(()=>{A&&(I==null||I())},[A,I]);const R=(ne=E.arrow)==null?void 0:ne.x,P=(Z=E.arrow)==null?void 0:Z.y,W=((se=E.arrow)==null?void 0:se.centerOffset)!==0,[q,ee]=m.useState();return pr(()=>{g&&ee(window.getComputedStyle(g).zIndex)},[g]),a.jsx("div",{ref:k.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:A?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:q,"--radix-popper-transform-origin":[(xe=E.transformOrigin)==null?void 0:xe.x,(ae=E.transformOrigin)==null?void 0:ae.y].join(" "),...((ce=E.hide)==null?void 0:ce.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(S7,{scope:n,placedSide:D,onArrowChange:N,arrowX:R,arrowY:P,shouldHideArrow:W,children:a.jsx(ln.div,{"data-side":D,"data-align":_,...v,ref:p,style:{...v.style,animation:A?void 0:"none"}})})})});r4.displayName=u0;var i4="PopperArrow",E7={top:"bottom",right:"left",bottom:"top",left:"right"},o4=m.forwardRef(function(t,n){const{__scopePopper:s,...r}=t,i=C7(i4,s),o=E7[i.placedSide];return a.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:a.jsx(w7,{...r,ref:n,style:{...r.style,display:"block"}})})});o4.displayName=i4;function k7(e){return e!==null}var M7=e=>({name:"transformOrigin",options:e,fn(t){var j,g,b;const{placement:n,rects:s,middlewareData:r}=t,o=((j=r.arrow)==null?void 0:j.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[u,h]=l4(n),d={start:"0%",center:"50%",end:"100%"}[h],f=(((g=r.arrow)==null?void 0:g.x)??0)+l/2,x=(((b=r.arrow)==null?void 0:b.y)??0)+c/2;let y="",v="";return u==="bottom"?(y=o?d:`${f}px`,v=`${-c}px`):u==="top"?(y=o?d:`${f}px`,v=`${s.floating.height+c}px`):u==="right"?(y=`${-c}px`,v=o?d:`${x}px`):u==="left"&&(y=`${s.floating.width+c}px`,v=o?d:`${x}px`),{data:{x:y,y:v}}}});function l4(e){const[t,n="center"]=e.split("-");return[t,n]}var c4=n4,h0=a4,d4=r4,u4=o4,T7="Portal",f0=m.forwardRef((e,t)=>{var l;const{container:n,...s}=e,[r,i]=m.useState(!1);pr(()=>i(!0),[]);const o=n||r&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?Iw.createPortal(a.jsx(ln.div,{...s,ref:t}),o):null});f0.displayName=T7;function D7(e,t){return m.useReducer((n,s)=>t[n][s]??n,e)}var bi=e=>{const{present:t,children:n}=e,s=_7(t),r=typeof n=="function"?n({present:s.isPresent}):m.Children.only(n),i=Fn(s.ref,A7(r));return typeof n=="function"||s.isPresent?m.cloneElement(r,{ref:i}):null};bi.displayName="Presence";function _7(e){const[t,n]=m.useState(),s=m.useRef(null),r=m.useRef(e),i=m.useRef("none"),o=e?"mounted":"unmounted",[l,c]=D7(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const u=Vd(s.current);i.current=l==="mounted"?u:"none"},[l]),pr(()=>{const u=s.current,h=r.current;if(h!==e){const f=i.current,x=Vd(u);e?c("MOUNT"):x==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(h&&f!==x?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,c]),pr(()=>{if(t){let u;const h=t.ownerDocument.defaultView??window,d=x=>{const v=Vd(s.current).includes(CSS.escape(x.animationName));if(x.target===t&&v&&(c("ANIMATION_END"),!r.current)){const j=t.style.animationFillMode;t.style.animationFillMode="forwards",u=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=j)})}},f=x=>{x.target===t&&(i.current=Vd(s.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{h.clearTimeout(u),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:m.useCallback(u=>{s.current=u?getComputedStyle(u):null,n(u)},[])}}function Vd(e){return(e==null?void 0:e.animationName)||"none"}function A7(e){var s,r;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var O7=kh[" useInsertionEffect ".trim().toString()]||pr;function m0({prop:e,defaultProp:t,onChange:n=()=>{},caller:s}){const[r,i,o]=z7({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:r;{const h=m.useRef(e!==void 0);m.useEffect(()=>{const d=h.current;d!==l&&console.warn(`${s} is changing from ${d?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),h.current=l},[l,s])}const u=m.useCallback(h=>{var d;if(l){const f=R7(h)?h(e):h;f!==e&&((d=o.current)==null||d.call(o,f))}else i(h)},[l,e,i,o]);return[c,u]}function z7({defaultProp:e,onChange:t}){const[n,s]=m.useState(e),r=m.useRef(n),i=m.useRef(t);return O7(()=>{i.current=t},[t]),m.useEffect(()=>{var o;r.current!==n&&((o=i.current)==null||o.call(i,n),r.current=n)},[n,r]),[n,s,i]}function R7(e){return typeof e=="function"}var U7=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),$7="VisuallyHidden",h4=m.forwardRef((e,t)=>a.jsx(ln.span,{...e,ref:t,style:{...U7,...e.style}}));h4.displayName=$7;var P7=h4,[xf]=lf("Tooltip",[mf]),gf=mf(),f4="TooltipProvider",L7=700,jg="tooltip.open",[H7,x0]=xf(f4),m4=e=>{const{__scopeTooltip:t,delayDuration:n=L7,skipDelayDuration:s=300,disableHoverableContent:r=!1,children:i}=e,o=m.useRef(!0),l=m.useRef(!1),c=m.useRef(0);return m.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),a.jsx(H7,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:m.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:m.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,s)},[s]),isPointerInTransitRef:l,onPointerInTransitChange:m.useCallback(u=>{l.current=u},[]),disableHoverableContent:r,children:i})};m4.displayName=f4;var Cc="Tooltip",[B7,pf]=xf(Cc),x4=e=>{const{__scopeTooltip:t,children:n,open:s,defaultOpen:r,onOpenChange:i,disableHoverableContent:o,delayDuration:l}=e,c=x0(Cc,e.__scopeTooltip),u=gf(t),[h,d]=m.useState(null),f=ps(),x=m.useRef(0),y=o??c.disableHoverableContent,v=l??c.delayDuration,j=m.useRef(!1),[g,b]=m0({prop:s,defaultProp:r??!1,onChange:C=>{C?(c.onOpen(),document.dispatchEvent(new CustomEvent(jg))):c.onClose(),i==null||i(C)},caller:Cc}),p=m.useMemo(()=>g?j.current?"delayed-open":"instant-open":"closed",[g]),w=m.useCallback(()=>{window.clearTimeout(x.current),x.current=0,j.current=!1,b(!0)},[b]),N=m.useCallback(()=>{window.clearTimeout(x.current),x.current=0,b(!1)},[b]),S=m.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{j.current=!0,b(!0),x.current=0},v)},[v,b]);return m.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]),a.jsx(c4,{...u,children:a.jsx(B7,{scope:t,contentId:f,open:g,stateAttribute:p,trigger:h,onTriggerChange:d,onTriggerEnter:m.useCallback(()=>{c.isOpenDelayedRef.current?S():w()},[c.isOpenDelayedRef,S,w]),onTriggerLeave:m.useCallback(()=>{y?N():(window.clearTimeout(x.current),x.current=0)},[N,y]),onOpen:w,onClose:N,disableHoverableContent:y,children:n})})};x4.displayName=Cc;var Ng="TooltipTrigger",g4=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...s}=e,r=pf(Ng,n),i=x0(Ng,n),o=gf(n),l=m.useRef(null),c=Fn(t,l,r.onTriggerChange),u=m.useRef(!1),h=m.useRef(!1),d=m.useCallback(()=>u.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),a.jsx(h0,{asChild:!0,...o,children:a.jsx(ln.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...s,ref:c,onPointerMove:Vt(e.onPointerMove,f=>{f.pointerType!=="touch"&&!h.current&&!i.isPointerInTransitRef.current&&(r.onTriggerEnter(),h.current=!0)}),onPointerLeave:Vt(e.onPointerLeave,()=>{r.onTriggerLeave(),h.current=!1}),onPointerDown:Vt(e.onPointerDown,()=>{r.open&&r.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Vt(e.onFocus,()=>{u.current||r.onOpen()}),onBlur:Vt(e.onBlur,r.onClose),onClick:Vt(e.onClick,r.onClose)})})});g4.displayName=Ng;var V7="TooltipPortal",[mV,Y7]=xf(V7,{forceMount:void 0}),Uo="TooltipContent",p4=m.forwardRef((e,t)=>{const n=Y7(Uo,e.__scopeTooltip),{forceMount:s=n.forceMount,side:r="top",...i}=e,o=pf(Uo,e.__scopeTooltip);return a.jsx(bi,{present:s||o.open,children:o.disableHoverableContent?a.jsx(v4,{side:r,...i,ref:t}):a.jsx(F7,{side:r,...i,ref:t})})}),F7=m.forwardRef((e,t)=>{const n=pf(Uo,e.__scopeTooltip),s=x0(Uo,e.__scopeTooltip),r=m.useRef(null),i=Fn(t,r),[o,l]=m.useState(null),{trigger:c,onClose:u}=n,h=r.current,{onPointerInTransitChange:d}=s,f=m.useCallback(()=>{l(null),d(!1)},[d]),x=m.useCallback((y,v)=>{const j=y.currentTarget,g={x:y.clientX,y:y.clientY},b=G7(g,j.getBoundingClientRect()),p=Z7(g,b),w=Q7(v.getBoundingClientRect()),N=J7([...p,...w]);l(N),d(!0)},[d]);return m.useEffect(()=>()=>f(),[f]),m.useEffect(()=>{if(c&&h){const y=j=>x(j,h),v=j=>x(j,c);return c.addEventListener("pointerleave",y),h.addEventListener("pointerleave",v),()=>{c.removeEventListener("pointerleave",y),h.removeEventListener("pointerleave",v)}}},[c,h,x,f]),m.useEffect(()=>{if(o){const y=v=>{const j=v.target,g={x:v.clientX,y:v.clientY},b=(c==null?void 0:c.contains(j))||(h==null?void 0:h.contains(j)),p=!K7(g,o);b?f():p&&(f(),u())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[c,h,o,u,f]),a.jsx(v4,{...e,ref:i})}),[I7,W7]=xf(Cc,{isInside:!1}),q7=XR("TooltipContent"),v4=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:s,"aria-label":r,onEscapeKeyDown:i,onPointerDownOutside:o,...l}=e,c=pf(Uo,n),u=gf(n),{onClose:h}=c;return m.useEffect(()=>(document.addEventListener(jg,h),()=>document.removeEventListener(jg,h)),[h]),m.useEffect(()=>{if(c.trigger){const d=f=>{const x=f.target;x!=null&&x.contains(c.trigger)&&h()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[c.trigger,h]),a.jsx(cf,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:d=>d.preventDefault(),onDismiss:h,children:a.jsxs(d4,{"data-state":c.stateAttribute,...u,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[a.jsx(q7,{children:s}),a.jsx(I7,{scope:n,isInside:!0,children:a.jsx(P7,{id:c.contentId,role:"tooltip",children:r||s})})]})})});p4.displayName=Uo;var b4="TooltipArrow",X7=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...s}=e,r=gf(n);return W7(b4,n).isInside?null:a.jsx(u4,{...r,...s,ref:t})});X7.displayName=b4;function G7(e,t){const n=Math.abs(t.top-e.y),s=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,s,r,i)){case i:return"left";case r:return"right";case n:return"top";case s:return"bottom";default:throw new Error("unreachable")}}function Z7(e,t,n=5){const s=[];switch(t){case"top":s.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":s.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":s.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":s.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return s}function Q7(e){const{top:t,right:n,bottom:s,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:s},{x:r,y:s}]}function K7(e,t){const{x:n,y:s}=e;let r=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const l=t[i],c=t[o],u=l.x,h=l.y,d=c.x,f=c.y;h>s!=f>s&&n<(d-u)*(s-h)/(f-h)+u&&(r=!r)}return r}function J7(e){const t=e.slice();return t.sort((n,s)=>n.x<s.x?-1:n.x>s.x?1:n.y<s.y?-1:n.y>s.y?1:0),e9(t)}function e9(e){if(e.length<=1)return e.slice();const t=[];for(let s=0;s<e.length;s++){const r=e[s];for(;t.length>=2;){const i=t[t.length-1],o=t[t.length-2];if((i.x-o.x)*(r.y-o.y)>=(i.y-o.y)*(r.x-o.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let s=e.length-1;s>=0;s--){const r=e[s];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(r.y-o.y)>=(i.y-o.y)*(r.x-o.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var t9=m4,n9=x4,s9=g4,y4=p4;const Dm=t9,_m=n9,Am=s9,pu=m.forwardRef(({className:e,sideOffset:t=4,...n},s)=>a.jsx(y4,{ref:s,sideOffset:t,className:$e("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));pu.displayName=y4.displayName;const a9=320,r9=32,i9=e=>({core:"text-slate-300",organization:"text-blue-300",teams:"text-green-300",twoFactor:"text-purple-300",apiKey:"text-orange-300",passkey:"text-pink-300"})[e]||"text-gray-300",Sg=({data:e,targetPosition:t,sourcePosition:n})=>{const s=e,[r,i]=m.useState(!1),[o,l]=m.useState(!1),c="!h-2 !w-2 !min-w-0 !min-h-0 !cursor-grab !border-0 opacity-0 hover:opacity-100 transition-opacity",u=i9(s.plugin||"core");return s.isForeign?a.jsx("div",{className:"relative",children:a.jsxs("div",{className:"text-xs px-3 py-2 border border-gray-600 bg-gray-800 text-gray-200 flex gap-2 items-center rounded-md shadow-lg",id:`${s.name}-foreign-key`,children:[a.jsx(Nt,{size:12,className:"text-gray-400"}),a.jsx("span",{className:"font-medium",children:s.displayName||s.name}),t&&a.jsx(Gr,{type:"target",id:s.name,position:t,className:$e(c)})]})}):a.jsx("div",{className:"relative",children:a.jsxs("div",{className:$e("border border-gray-700 overflow-hidden shadow-xl bg-gray-900 rounded-lg","hover:border-gray-600 transition-colors duration-200"),style:{width:a9},id:`${s.name}-schema-node`,children:[a.jsxs("div",{className:$e("px-4 py-3 bg-black border-b border-gray-700 flex items-center justify-between","cursor-pointer select-none"),onClick:()=>i(!r),children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Nt,{size:16,className:"text-white"}),a.jsx("span",{className:"text-white font-semibold text-sm",children:s.displayName||s.name})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("button",{onClick:h=>{h.stopPropagation(),l(!o)},className:"p-1 hover:bg-gray-800 rounded transition-colors",children:o?a.jsx(_S,{size:12,className:"text-gray-400"}):a.jsx(Xo,{size:12,className:"text-gray-400"})}),r?a.jsx(Jp,{size:14,className:"text-gray-400"}):a.jsx(of,{size:14,className:"text-gray-400"})]})]}),!r&&a.jsx("div",{className:"max-h-96 bg-black overflow-y-auto",children:s.columns.map(h=>a.jsxs("div",{className:$e("relative flex items-center overflow-x-hidden px-4 py-2 text-xs","bg-black/30 hover:bg-black/40 transition-colors duration-150","border-b border-white/20 last:border-b-0"),style:{minHeight:r9},children:[a.jsxs("div",{className:"flex items-center gap-1 mr-3 min-w-[40px]",children:[h.isPrimary&&a.jsx(Dm,{delayDuration:100,children:a.jsxs(_m,{children:[a.jsx(Am,{asChild:!0,children:a.jsx(co,{size:10,className:"text-yellow-400 flex-shrink-0"})}),a.jsx(pu,{className:"bg-black border-gray-600 text-white text-xs",children:"Primary Key"})]})}),h.isUnique&&!h.isPrimary&&a.jsx(Dm,{delayDuration:100,children:a.jsxs(_m,{children:[a.jsx(Am,{asChild:!0,children:a.jsx(sR,{size:10,className:"text-green-400 flex-shrink-0"})}),a.jsx(pu,{className:"bg-black border-gray-600 text-white text-xs",children:"Unique"})]})}),h.isIdentity&&a.jsx(Dm,{delayDuration:100,children:a.jsxs(_m,{children:[a.jsx(Am,{asChild:!0,children:a.jsx(rR,{size:10,className:"text-blue-400 flex-shrink-0"})}),a.jsx(pu,{className:"bg-black border-gray-600 text-white text-xs",children:"Identity"})]})})]}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[!h.isNullable&&a.jsx("span",{className:"text-red-400 text-xs",children:"*"}),a.jsx("span",{className:"text-white font-medium truncate",children:h.name}),a.jsx("span",{className:"text-gray-400 font-mono text-xs",children:h.format})]}),o&&h.description&&a.jsx("div",{className:"text-gray-500 text-xs mt-1 truncate",children:h.description})]}),a.jsx("div",{className:"ml-2",children:a.jsx("span",{className:$e("px-2 py-1 rounded text-xs font-medium",u),children:h.plugin})}),a.jsx(Gr,{type:"target",id:h.id,position:t||"left",className:$e(c,"!left-[-8px] !top-1/2 !transform !-translate-y-1/2"),style:{background:"#1f2937",border:"2px solid #374151",left:"-8px",top:"50%",transform:"translateY(-50%)",boxShadow:"0 0 0 2px rgba(0, 0, 0, 0.3)"}}),a.jsx(Gr,{type:"source",id:h.id,position:n||"right",className:$e(c,"!right-[-8px] !top-1/2 !transform !-translate-y-1/2"),style:{background:"#1f2937",border:"2px solid #374151",right:"-8px",top:"50%",transform:"translateY(-50%)",boxShadow:"0 0 0 2px rgba(0, 0, 0, 0.3)"}})]},h.id))}),s.relationships&&s.relationships.length>0&&a.jsx("div",{className:"px-4 py-2 bg-gray-800 border-t border-gray-700",children:a.jsxs("span",{className:"text-xs text-gray-400",children:[s.relationships.length," relationship",s.relationships.length!==1?"s":""]})})]})})},o9={id:"demo-user-table",name:"user",displayName:"User",isForeign:!1,plugin:"core",columns:[{id:"user-id",isPrimary:!0,isNullable:!1,isUnique:!0,isIdentity:!1,name:"id",format:"string",plugin:"core",description:"Unique user identifier"},{id:"user-name",isPrimary:!1,isNullable:!1,isUnique:!1,isIdentity:!1,name:"name",format:"string",plugin:"core",description:"User display name"},{id:"user-email",isPrimary:!1,isNullable:!1,isUnique:!0,isIdentity:!1,name:"email",format:"string",plugin:"core",description:"User email address"},{id:"user-emailVerified",isPrimary:!1,isNullable:!1,isUnique:!1,isIdentity:!1,name:"emailVerified",format:"boolean",plugin:"core",description:"Email verification status"},{id:"user-image",isPrimary:!1,isNullable:!0,isUnique:!1,isIdentity:!1,name:"image",format:"string",plugin:"core",description:"User profile image URL"},{id:"user-createdAt",isPrimary:!1,isNullable:!1,isUnique:!1,isIdentity:!1,name:"createdAt",format:"date",plugin:"core",description:"Account creation timestamp"}],relationships:[{type:"one-to-many",target:"session",field:"userId"},{type:"one-to-many",target:"account",field:"userId"}]},l9={id:"demo-organization-table",name:"organization",displayName:"Organization",isForeign:!1,plugin:"organization",columns:[{id:"org-id",isPrimary:!0,isNullable:!1,isUnique:!0,isIdentity:!1,name:"id",format:"string",plugin:"organization",description:"Unique organization identifier"},{id:"org-name",isPrimary:!1,isNullable:!1,isUnique:!1,isIdentity:!1,name:"name",format:"string",plugin:"organization",description:"Organization name"},{id:"org-slug",isPrimary:!1,isNullable:!1,isUnique:!0,isIdentity:!1,name:"slug",format:"string",plugin:"organization",description:"Organization URL slug"}],relationships:[{type:"one-to-many",target:"member",field:"organizationId"}]};function c9(){return a.jsx("div",{className:"min-h-screen bg-black p-8",children:a.jsxs("div",{className:"max-w-6xl mx-auto",children:[a.jsxs("div",{className:"mb-8",children:[a.jsx("h1",{className:"text-3xl font-light text-white mb-4",children:"Database Schema Node Demo"}),a.jsx("p",{className:"text-gray-400",children:"Enhanced database schema nodes with dark mode theming, collapsible views, and detailed tooltips."})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-xl text-white mb-4",children:"Core User Table"}),a.jsx(Sg,{data:o9,targetPosition:"left",sourcePosition:"right"})]}),a.jsxs("div",{children:[a.jsx("h2",{className:"text-xl text-white mb-4",children:"Organization Plugin Table"}),a.jsx(Sg,{data:l9,targetPosition:"left",sourcePosition:"right"})]})]}),a.jsxs("div",{className:"mt-12 p-6 bg-gray-900 rounded-lg border border-gray-700",children:[a.jsx("h3",{className:"text-lg text-white mb-4",children:"Features"}),a.jsxs("ul",{className:"space-y-2 text-gray-300",children:[a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Dark Mode Optimized:"})," Designed specifically for dark themes"]}),a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Collapsible Views:"})," Click the header to collapse/expand table contents"]}),a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Detail Toggle:"})," Show/hide column descriptions with the eye icon"]}),a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Plugin Badges:"})," Color-coded plugin indicators"]}),a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Interactive Icons:"})," Hover tooltips for primary keys, unique constraints, etc."]}),a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Relationship Counter:"})," Shows number of relationships in footer"]}),a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Connection Handles:"})," Invisible handles for React Flow connections"]})]})]})]})})}const w4=m.createContext(void 0);function d9({children:e}){const[t,n]=m.useState({users:0,organizations:0,sessions:0,teams:0}),[s,r]=m.useState(!0),i=m.useCallback(async()=>{try{const c=await(await fetch("/api/counts")).json();n(c)}catch{}finally{r(!1)}},[]),o=m.useCallback(async()=>{r(!0),await i()},[i]);return m.useEffect(()=>{i()},[i]),a.jsx(w4.Provider,{value:{counts:t,loading:s,refetchCounts:o},children:e})}function vf(){const e=m.useContext(w4);if(e===void 0)throw new Error("useCounts must be used within a CountsProvider");return e}function j4(e,t){const n=m.useRef(null),s=m.useRef(null),r=m.useRef(0),i=m.useRef(!1),o=m.useRef(e),l=m.useRef(t==null?void 0:t.onStatusChange),c=(t==null?void 0:t.maxReconnectAttempts)??5;m.useEffect(()=>{o.current=e},[e]),m.useEffect(()=>{l.current=t==null?void 0:t.onStatusChange},[t==null?void 0:t.onStatusChange]),m.useEffect(()=>{let u=!1;const h=()=>{var d;try{(d=l.current)==null||d.call(l,"connecting");const x=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`;n.current=new WebSocket(x),n.current.onopen=()=>{var y;r.current=0,i.current=!0,(y=l.current)==null||y.call(l,"open"),s.current&&(clearTimeout(s.current),s.current=null)},n.current.onmessage=y=>{try{const v=JSON.parse(y.data);o.current&&o.current(v)}catch{}},n.current.onclose=y=>{var v,j,g,b;if(!u){if(!i.current&&(y.code===1006||y.code===1001)){(v=l.current)==null||v.call(l,"unavailable");return}if((j=l.current)==null||j.call(l,"closed"),r.current<c){r.current++;const p=Math.min(1e3*2**r.current,1e4);(g=l.current)==null||g.call(l,"reconnecting"),s.current=setTimeout(()=>{h()},p)}else(b=l.current)==null||b.call(l,"unavailable")}},n.current.onerror=y=>{var v;(v=l.current)==null||v.call(l,"error")}}catch{}};return h(),()=>{u=!0,n.current&&n.current.close(),s.current&&clearTimeout(s.current)}},[c])}var Ly=1,u9=.9,h9=.8,f9=.17,Om=.1,zm=.999,m9=.9999,x9=.99,g9=/[\\\/_+.#"@\[\(\{&]/,p9=/[\\\/_+.#"@\[\(\{&]/g,v9=/[\s-]/,N4=/[\s-]/g;function Cg(e,t,n,s,r,i,o){if(i===t.length)return r===e.length?Ly:x9;var l=`${r},${i}`;if(o[l]!==void 0)return o[l];for(var c=s.charAt(i),u=n.indexOf(c,r),h=0,d,f,x,y;u>=0;)d=Cg(e,t,n,s,u+1,i+1,o),d>h&&(u===r?d*=Ly:g9.test(e.charAt(u-1))?(d*=h9,x=e.slice(r,u-1).match(p9),x&&r>0&&(d*=Math.pow(zm,x.length))):v9.test(e.charAt(u-1))?(d*=u9,y=e.slice(r,u-1).match(N4),y&&r>0&&(d*=Math.pow(zm,y.length))):(d*=f9,r>0&&(d*=Math.pow(zm,u-r))),e.charAt(u)!==t.charAt(i)&&(d*=m9)),(d<Om&&n.charAt(u-1)===s.charAt(i+1)||s.charAt(i+1)===s.charAt(i)&&n.charAt(u-1)!==s.charAt(i))&&(f=Cg(e,t,n,s,u+1,i+2,o),f*Om>d&&(d=f*Om)),d>h&&(h=d),u=n.indexOf(c,u+1);return o[l]=h,h}function Hy(e){return e.toLowerCase().replace(N4," ")}function b9(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Cg(e,t,Hy(e),Hy(t),0,0,{})}var Rm="focusScope.autoFocusOnMount",Um="focusScope.autoFocusOnUnmount",By={bubbles:!1,cancelable:!0},y9="FocusScope",g0=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:s=!1,onMountAutoFocus:r,onUnmountAutoFocus:i,...o}=e,[l,c]=m.useState(null),u=zo(r),h=zo(i),d=m.useRef(null),f=Fn(t,v=>c(v)),x=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(s){let v=function(p){if(x.paused||!l)return;const w=p.target;l.contains(w)?d.current=w:Ha(d.current,{select:!0})},j=function(p){if(x.paused||!l)return;const w=p.relatedTarget;w!==null&&(l.contains(w)||Ha(d.current,{select:!0}))},g=function(p){if(document.activeElement===document.body)for(const N of p)N.removedNodes.length>0&&Ha(l)};document.addEventListener("focusin",v),document.addEventListener("focusout",j);const b=new MutationObserver(g);return l&&b.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",j),b.disconnect()}}},[s,l,x.paused]),m.useEffect(()=>{if(l){Yy.add(x);const v=document.activeElement;if(!l.contains(v)){const g=new CustomEvent(Rm,By);l.addEventListener(Rm,u),l.dispatchEvent(g),g.defaultPrevented||(w9(E9(S4(l)),{select:!0}),document.activeElement===v&&Ha(l))}return()=>{l.removeEventListener(Rm,u),setTimeout(()=>{const g=new CustomEvent(Um,By);l.addEventListener(Um,h),l.dispatchEvent(g),g.defaultPrevented||Ha(v??document.body,{select:!0}),l.removeEventListener(Um,h),Yy.remove(x)},0)}}},[l,u,h,x]);const y=m.useCallback(v=>{if(!n&&!s||x.paused)return;const j=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,g=document.activeElement;if(j&&g){const b=v.currentTarget,[p,w]=j9(b);p&&w?!v.shiftKey&&g===w?(v.preventDefault(),n&&Ha(p,{select:!0})):v.shiftKey&&g===p&&(v.preventDefault(),n&&Ha(w,{select:!0})):g===b&&v.preventDefault()}},[n,s,x.paused]);return a.jsx(ln.div,{tabIndex:-1,...o,ref:f,onKeyDown:y})});g0.displayName=y9;function w9(e,{select:t=!1}={}){const n=document.activeElement;for(const s of e)if(Ha(s,{select:t}),document.activeElement!==n)return}function j9(e){const t=S4(e),n=Vy(t,e),s=Vy(t.reverse(),e);return[n,s]}function S4(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const r=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||r?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Vy(e,t){for(const n of e)if(!N9(n,{upTo:t}))return n}function N9(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function S9(e){return e instanceof HTMLInputElement&&"select"in e}function Ha(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&S9(e)&&t&&e.select()}}var Yy=C9();function C9(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Fy(e,t),e.unshift(t)},remove(t){var n;e=Fy(e,t),(n=e[0])==null||n.resume()}}}function Fy(e,t){const n=[...e],s=n.indexOf(t);return s!==-1&&n.splice(s,1),n}function E9(e){return e.filter(t=>t.tagName!=="A")}var $m=0;function C4(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Iy()),document.body.insertAdjacentElement("beforeend",e[1]??Iy()),$m++,()=>{$m===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),$m--}},[])}function Iy(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var zs=function(){return zs=Object.assign||function(t){for(var n,s=1,r=arguments.length;s<r;s++){n=arguments[s];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},zs.apply(this,arguments)};function E4(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(e);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(e,s[r])&&(n[s[r]]=e[s[r]]);return n}function k9(e,t,n){if(n||arguments.length===2)for(var s=0,r=t.length,i;s<r;s++)(i||!(s in t))&&(i||(i=Array.prototype.slice.call(t,0,s)),i[s]=t[s]);return e.concat(i||Array.prototype.slice.call(t))}var vu="right-scroll-bar-position",bu="width-before-scroll-bar",M9="with-scroll-bars-hidden",T9="--removed-body-scroll-bar-size";function Pm(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function D9(e,t){var n=m.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(s){var r=n.value;r!==s&&(n.value=s,n.callback(s,r))}}}})[0];return n.callback=t,n.facade}var _9=typeof window<"u"?m.useLayoutEffect:m.useEffect,Wy=new WeakMap;function A9(e,t){var n=D9(null,function(s){return e.forEach(function(r){return Pm(r,s)})});return _9(function(){var s=Wy.get(n);if(s){var r=new Set(s),i=new Set(e),o=n.current;r.forEach(function(l){i.has(l)||Pm(l,null)}),i.forEach(function(l){r.has(l)||Pm(l,o)})}Wy.set(n,e)},[e]),n}function O9(e){return e}function z9(e,t){t===void 0&&(t=O9);var n=[],s=!1,r={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var o=t(i,s);return n.push(o),function(){n=n.filter(function(l){return l!==o})}},assignSyncMedium:function(i){for(s=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){s=!0;var o=[];if(n.length){var l=n;n=[],l.forEach(i),o=n}var c=function(){var h=o;o=[],h.forEach(i)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(h){o.push(h),u()},filter:function(h){return o=o.filter(h),n}}}};return r}function R9(e){e===void 0&&(e={});var t=z9(null);return t.options=zs({async:!0,ssr:!1},e),t}var k4=function(e){var t=e.sideCar,n=E4(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=t.read();if(!s)throw new Error("Sidecar medium not found");return m.createElement(s,zs({},n))};k4.isSideCarExport=!0;function U9(e,t){return e.useMedium(t),k4}var M4=R9(),Lm=function(){},bf=m.forwardRef(function(e,t){var n=m.useRef(null),s=m.useState({onScrollCapture:Lm,onWheelCapture:Lm,onTouchMoveCapture:Lm}),r=s[0],i=s[1],o=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,h=e.enabled,d=e.shards,f=e.sideCar,x=e.noRelative,y=e.noIsolation,v=e.inert,j=e.allowPinchZoom,g=e.as,b=g===void 0?"div":g,p=e.gapMode,w=E4(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=f,S=A9([n,t]),C=zs(zs({},w),r);return m.createElement(m.Fragment,null,h&&m.createElement(N,{sideCar:M4,removeScrollBar:u,shards:d,noRelative:x,noIsolation:y,inert:v,setCallbacks:i,allowPinchZoom:!!j,lockRef:n,gapMode:p}),o?m.cloneElement(m.Children.only(l),zs(zs({},C),{ref:S})):m.createElement(b,zs({},C,{className:c,ref:S}),l))});bf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};bf.classNames={fullWidth:bu,zeroRight:vu};var $9=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function P9(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=$9();return t&&e.setAttribute("nonce",t),e}function L9(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function H9(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var B9=function(){var e=0,t=null;return{add:function(n){e==0&&(t=P9())&&(L9(t,n),H9(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},V9=function(){var e=B9();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},T4=function(){var e=V9(),t=function(n){var s=n.styles,r=n.dynamic;return e(s,r),null};return t},Y9={left:0,top:0,right:0,gap:0},Hm=function(e){return parseInt(e||"",10)||0},F9=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],s=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[Hm(n),Hm(s),Hm(r)]},I9=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Y9;var t=F9(e),n=document.documentElement.clientWidth,s=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,s-n+t[2]-t[0])}},W9=T4(),mo="data-scroll-locked",q9=function(e,t,n,s){var r=e.left,i=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),`
389
- .`.concat(M9,` {
388
+ */const Wt=Te("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
389
+ * @license lucide-react v0.294.0 - ISC
390
+ *
391
+ * This source code is licensed under the ISC license.
392
+ * See the LICENSE file in the root directory of this source tree.
393
+ */const Em=Te("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]]);function OS(e){var t,n,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=OS(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function hh(){for(var e,t,n=0,s="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=OS(e))&&(s&&(s+=" "),s+=t);return s}const n0="-",mR=e=>{const t=gR(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:o=>{const l=o.split(n0);return l[0]===""&&l.length!==1&&l.shift(),zS(l,t)||xR(o)},getConflictingClassGroupIds:(o,l)=>{const c=n[o]||[];return l&&s[o]?[...c,...s[o]]:c}}},zS=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],s=t.nextPart.get(n),r=s?zS(e.slice(1),s):void 0;if(r)return r;if(t.validators.length===0)return;const i=e.join(n0);return(o=t.validators.find(({validator:l})=>l(i)))==null?void 0:o.classGroupId},Ny=/^\[(.+)\]$/,xR=e=>{if(Ny.test(e)){const t=Ny.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},gR=e=>{const{theme:t,prefix:n}=e,s={nextPart:new Map,validators:[]};return vR(Object.entries(e.classGroups),n).forEach(([i,o])=>{pg(o,s,i,t)}),s},pg=(e,t,n,s)=>{e.forEach(r=>{if(typeof r=="string"){const i=r===""?t:Sy(t,r);i.classGroupId=n;return}if(typeof r=="function"){if(pR(r)){pg(r(s),t,n,s);return}t.validators.push({validator:r,classGroupId:n});return}Object.entries(r).forEach(([i,o])=>{pg(o,Sy(t,i),n,s)})})},Sy=(e,t)=>{let n=e;return t.split(n0).forEach(s=>{n.nextPart.has(s)||n.nextPart.set(s,{nextPart:new Map,validators:[]}),n=n.nextPart.get(s)}),n},pR=e=>e.isThemeGetter,vR=(e,t)=>t?e.map(([n,s])=>{const r=s.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,l])=>[t+o,l])):i);return[n,r]}):e,bR=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,s=new Map;const r=(i,o)=>{n.set(i,o),t++,t>e&&(t=0,s=n,n=new Map)};return{get(i){let o=n.get(i);if(o!==void 0)return o;if((o=s.get(i))!==void 0)return r(i,o),o},set(i,o){n.has(i)?n.set(i,o):r(i,o)}}},RS="!",yR=e=>{const{separator:t,experimentalParseClassName:n}=e,s=t.length===1,r=t[0],i=t.length,o=l=>{const c=[];let u=0,h=0,d;for(let j=0;j<l.length;j++){let g=l[j];if(u===0){if(g===r&&(s||l.slice(j,j+i)===t)){c.push(l.slice(h,j)),h=j+i;continue}if(g==="/"){d=j;continue}}g==="["?u++:g==="]"&&u--}const f=c.length===0?l:l.substring(h),x=f.startsWith(RS),y=x?f.substring(1):f,v=d&&d>h?d-h:void 0;return{modifiers:c,hasImportantModifier:x,baseClassName:y,maybePostfixModifierPosition:v}};return n?l=>n({className:l,parseClassName:o}):o},wR=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(s=>{s[0]==="["?(t.push(...n.sort(),s),n=[]):n.push(s)}),t.push(...n.sort()),t},jR=e=>({cache:bR(e.cacheSize),parseClassName:yR(e),...mR(e)}),NR=/\s+/,SR=(e,t)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:r}=t,i=[],o=e.trim().split(NR);let l="";for(let c=o.length-1;c>=0;c-=1){const u=o[c],{modifiers:h,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:x}=n(u);let y=!!x,v=s(y?f.substring(0,x):f);if(!v){if(!y){l=u+(l.length>0?" "+l:l);continue}if(v=s(f),!v){l=u+(l.length>0?" "+l:l);continue}y=!1}const j=wR(h).join(":"),g=d?j+RS:j,b=g+v;if(i.includes(b))continue;i.push(b);const p=r(v,y);for(let w=0;w<p.length;++w){const N=p[w];i.push(g+N)}l=u+(l.length>0?" "+l:l)}return l};function CR(){let e=0,t,n,s="";for(;e<arguments.length;)(t=arguments[e++])&&(n=US(t))&&(s&&(s+=" "),s+=n);return s}const US=e=>{if(typeof e=="string")return e;let t,n="";for(let s=0;s<e.length;s++)e[s]&&(t=US(e[s]))&&(n&&(n+=" "),n+=t);return n};function ER(e,...t){let n,s,r,i=o;function o(c){const u=t.reduce((h,d)=>d(h),e());return n=jR(u),s=n.cache.get,r=n.cache.set,i=l,l(c)}function l(c){const u=s(c);if(u)return u;const h=SR(c,n);return r(c,h),h}return function(){return i(CR.apply(null,arguments))}}const pt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},$S=/^\[(?:([a-z-]+):)?(.+)\]$/i,kR=/^\d+\/\d+$/,MR=new Set(["px","full","screen"]),TR=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,DR=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,_R=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,AR=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,OR=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,na=e=>ho(e)||MR.has(e)||kR.test(e),Ra=e=>Go(e,"length",BR),ho=e=>!!e&&!Number.isNaN(Number(e)),km=e=>Go(e,"number",ho),gl=e=>!!e&&Number.isInteger(Number(e)),zR=e=>e.endsWith("%")&&ho(e.slice(0,-1)),Ye=e=>$S.test(e),Ua=e=>TR.test(e),RR=new Set(["length","size","percentage"]),UR=e=>Go(e,RR,PS),$R=e=>Go(e,"position",PS),PR=new Set(["image","url"]),LR=e=>Go(e,PR,YR),HR=e=>Go(e,"",VR),pl=()=>!0,Go=(e,t,n)=>{const s=$S.exec(e);return s?s[1]?typeof t=="string"?s[1]===t:t.has(s[1]):n(s[2]):!1},BR=e=>DR.test(e)&&!_R.test(e),PS=()=>!1,VR=e=>AR.test(e),YR=e=>OR.test(e),FR=()=>{const e=pt("colors"),t=pt("spacing"),n=pt("blur"),s=pt("brightness"),r=pt("borderColor"),i=pt("borderRadius"),o=pt("borderSpacing"),l=pt("borderWidth"),c=pt("contrast"),u=pt("grayscale"),h=pt("hueRotate"),d=pt("invert"),f=pt("gap"),x=pt("gradientColorStops"),y=pt("gradientColorStopPositions"),v=pt("inset"),j=pt("margin"),g=pt("opacity"),b=pt("padding"),p=pt("saturate"),w=pt("scale"),N=pt("sepia"),S=pt("skew"),C=pt("space"),T=pt("translate"),O=()=>["auto","contain","none"],H=()=>["auto","hidden","clip","visible","scroll"],U=()=>["auto",Ye,t],z=()=>[Ye,t],Y=()=>["",na,Ra],k=()=>["auto",ho,Ye],$=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],M=()=>["solid","dashed","dotted","double","none"],A=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],E=()=>["start","end","center","between","around","evenly","stretch"],D=()=>["","0",Ye],_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],I=()=>[ho,Ye];return{cacheSize:500,separator:":",theme:{colors:[pl],spacing:[na,Ra],blur:["none","",Ua,Ye],brightness:I(),borderColor:[e],borderRadius:["none","","full",Ua,Ye],borderSpacing:z(),borderWidth:Y(),contrast:I(),grayscale:D(),hueRotate:I(),invert:D(),gap:z(),gradientColorStops:[e],gradientColorStopPositions:[zR,Ra],inset:U(),margin:U(),opacity:I(),padding:z(),saturate:I(),scale:I(),sepia:D(),skew:I(),space:z(),translate:z()},classGroups:{aspect:[{aspect:["auto","square","video",Ye]}],container:["container"],columns:[{columns:[Ua]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...$(),Ye]}],overflow:[{overflow:H()}],"overflow-x":[{"overflow-x":H()}],"overflow-y":[{"overflow-y":H()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",gl,Ye]}],basis:[{basis:U()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ye]}],grow:[{grow:D()}],shrink:[{shrink:D()}],order:[{order:["first","last","none",gl,Ye]}],"grid-cols":[{"grid-cols":[pl]}],"col-start-end":[{col:["auto",{span:["full",gl,Ye]},Ye]}],"col-start":[{"col-start":k()}],"col-end":[{"col-end":k()}],"grid-rows":[{"grid-rows":[pl]}],"row-start-end":[{row:["auto",{span:[gl,Ye]},Ye]}],"row-start":[{"row-start":k()}],"row-end":[{"row-end":k()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ye]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ye]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...E()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...E(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...E(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[j]}],mx:[{mx:[j]}],my:[{my:[j]}],ms:[{ms:[j]}],me:[{me:[j]}],mt:[{mt:[j]}],mr:[{mr:[j]}],mb:[{mb:[j]}],ml:[{ml:[j]}],"space-x":[{"space-x":[C]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[C]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ye,t]}],"min-w":[{"min-w":[Ye,t,"min","max","fit"]}],"max-w":[{"max-w":[Ye,t,"none","full","min","max","fit","prose",{screen:[Ua]},Ua]}],h:[{h:[Ye,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ye,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ye,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ye,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ua,Ra]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",km]}],"font-family":[{font:[pl]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ye]}],"line-clamp":[{"line-clamp":["none",ho,km]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",na,Ye]}],"list-image":[{"list-image":["none",Ye]}],"list-style-type":[{list:["none","disc","decimal",Ye]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...M(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",na,Ra]}],"underline-offset":[{"underline-offset":["auto",na,Ye]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ye]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ye]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...$(),$R]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",UR]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},LR]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[x]}],"gradient-via":[{via:[x]}],"gradient-to":[{to:[x]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[g]}],"border-style":[{border:[...M(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[g]}],"divide-style":[{divide:M()}],"border-color":[{border:[r]}],"border-color-x":[{"border-x":[r]}],"border-color-y":[{"border-y":[r]}],"border-color-s":[{"border-s":[r]}],"border-color-e":[{"border-e":[r]}],"border-color-t":[{"border-t":[r]}],"border-color-r":[{"border-r":[r]}],"border-color-b":[{"border-b":[r]}],"border-color-l":[{"border-l":[r]}],"divide-color":[{divide:[r]}],"outline-style":[{outline:["",...M()]}],"outline-offset":[{"outline-offset":[na,Ye]}],"outline-w":[{outline:[na,Ra]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Y()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[na,Ra]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ua,HR]}],"shadow-color":[{shadow:[pl]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...A(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":A()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[s]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Ua,Ye]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[d]}],saturate:[{saturate:[p]}],sepia:[{sepia:[N]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[p]}],"backdrop-sepia":[{"backdrop-sepia":[N]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ye]}],duration:[{duration:I()}],ease:[{ease:["linear","in","out","in-out",Ye]}],delay:[{delay:I()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ye]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[gl,Ye]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ye]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ye]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ye]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[na,Ra,km]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},IR=ER(FR);function $e(...e){return IR(hh(e))}function Vt(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e==null||e(r),n===!1||!r.defaultPrevented)return t==null?void 0:t(r)}}function Cy(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function gr(...e){return t=>{let n=!1;const s=e.map(r=>{const i=Cy(r,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let r=0;r<s.length;r++){const i=s[r];typeof i=="function"?i():Cy(e[r],null)}}}}function Fn(...e){return m.useCallback(gr(...e),e)}function WR(e,t){const n=m.createContext(t),s=i=>{const{children:o,...l}=i,c=m.useMemo(()=>l,Object.values(l));return a.jsx(n.Provider,{value:c,children:o})};s.displayName=e+"Provider";function r(i){const o=m.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[s,r]}function lf(e,t=[]){let n=[];function s(i,o){const l=m.createContext(o),c=n.length;n=[...n,o];const u=d=>{var g;const{scope:f,children:x,...y}=d,v=((g=f==null?void 0:f[e])==null?void 0:g[c])||l,j=m.useMemo(()=>y,Object.values(y));return a.jsx(v.Provider,{value:j,children:x})};u.displayName=i+"Provider";function h(d,f){var v;const x=((v=f==null?void 0:f[e])==null?void 0:v[c])||l,y=m.useContext(x);if(y)return y;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,h]}const r=()=>{const i=n.map(o=>m.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return m.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return r.scopeName=e,[s,qR(r,...t)]}function qR(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const s=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const o=s.reduce((l,{useScope:c,scopeName:u})=>{const d=c(i)[`__scope${u}`];return{...l,...d}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function s0(e){const t=XR(e),n=m.forwardRef((s,r)=>{const{children:i,...o}=s,l=m.Children.toArray(i),c=l.find(ZR);if(c){const u=c.props.children,h=l.map(d=>d===c?m.Children.count(u)>1?m.Children.only(null):m.isValidElement(u)?u.props.children:null:d);return a.jsx(t,{...o,ref:r,children:m.isValidElement(u)?m.cloneElement(u,void 0,h):null})}return a.jsx(t,{...o,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function XR(e){const t=m.forwardRef((n,s)=>{const{children:r,...i}=n;if(m.isValidElement(r)){const o=KR(r),l=QR(i,r.props);return r.type!==m.Fragment&&(l.ref=s?gr(s,o):o),m.cloneElement(r,l)}return m.Children.count(r)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var LS=Symbol("radix.slottable");function GR(e){const t=({children:n})=>a.jsx(a.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=LS,t}function ZR(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===LS}function QR(e,t){const n={...t};for(const s in t){const r=e[s],i=t[s];/^on[A-Z]/.test(s)?r&&i?n[s]=(...l)=>{const c=i(...l);return r(...l),c}:r&&(n[s]=r):s==="style"?n[s]={...r,...i}:s==="className"&&(n[s]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function KR(e){var s,r;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var JR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ln=JR.reduce((e,t)=>{const n=s0(`Primitive.${t}`),s=m.forwardRef((r,i)=>{const{asChild:o,...l}=r,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{});function e8(e,t){e&&Dh.flushSync(()=>e.dispatchEvent(t))}function zo(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var s;return(s=t.current)==null?void 0:s.call(t,...n)},[])}function t8(e,t=globalThis==null?void 0:globalThis.document){const n=zo(e);m.useEffect(()=>{const s=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",s,{capture:!0}),()=>t.removeEventListener("keydown",s,{capture:!0})},[n,t])}var n8="DismissableLayer",vg="dismissableLayer.update",s8="dismissableLayer.pointerDownOutside",a8="dismissableLayer.focusOutside",Ey,HS=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),cf=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:s,onPointerDownOutside:r,onFocusOutside:i,onInteractOutside:o,onDismiss:l,...c}=e,u=m.useContext(HS),[h,d]=m.useState(null),f=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,x]=m.useState({}),y=Fn(t,C=>d(C)),v=Array.from(u.layers),[j]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=v.indexOf(j),b=h?v.indexOf(h):-1,p=u.layersWithOutsidePointerEventsDisabled.size>0,w=b>=g,N=o8(C=>{const T=C.target,O=[...u.branches].some(H=>H.contains(T));!w||O||(r==null||r(C),o==null||o(C),C.defaultPrevented||l==null||l())},f),S=l8(C=>{const T=C.target;[...u.branches].some(H=>H.contains(T))||(i==null||i(C),o==null||o(C),C.defaultPrevented||l==null||l())},f);return t8(C=>{b===u.layers.size-1&&(s==null||s(C),!C.defaultPrevented&&l&&(C.preventDefault(),l()))},f),m.useEffect(()=>{if(h)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Ey=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(h)),u.layers.add(h),ky(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Ey)}},[h,f,n,u]),m.useEffect(()=>()=>{h&&(u.layers.delete(h),u.layersWithOutsidePointerEventsDisabled.delete(h),ky())},[h,u]),m.useEffect(()=>{const C=()=>x({});return document.addEventListener(vg,C),()=>document.removeEventListener(vg,C)},[]),a.jsx(ln.div,{...c,ref:y,style:{pointerEvents:p?w?"auto":"none":void 0,...e.style},onFocusCapture:Vt(e.onFocusCapture,S.onFocusCapture),onBlurCapture:Vt(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:Vt(e.onPointerDownCapture,N.onPointerDownCapture)})});cf.displayName=n8;var r8="DismissableLayerBranch",i8=m.forwardRef((e,t)=>{const n=m.useContext(HS),s=m.useRef(null),r=Fn(t,s);return m.useEffect(()=>{const i=s.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),a.jsx(ln.div,{...e,ref:r})});i8.displayName=r8;function o8(e,t=globalThis==null?void 0:globalThis.document){const n=zo(e),s=m.useRef(!1),r=m.useRef(()=>{});return m.useEffect(()=>{const i=l=>{if(l.target&&!s.current){let c=function(){BS(s8,n,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=c,t.addEventListener("click",r.current,{once:!0})):c()}else t.removeEventListener("click",r.current);s.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>s.current=!0}}function l8(e,t=globalThis==null?void 0:globalThis.document){const n=zo(e),s=m.useRef(!1);return m.useEffect(()=>{const r=i=>{i.target&&!s.current&&BS(a8,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function ky(){const e=new CustomEvent(vg);document.dispatchEvent(e)}function BS(e,t,n,{discrete:s}){const r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),s?e8(r,i):r.dispatchEvent(i)}var pr=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},c8=kh[" useId ".trim().toString()]||(()=>{}),d8=0;function ps(e){const[t,n]=m.useState(c8());return pr(()=>{n(s=>s??String(d8++))},[e]),e||(t?`radix-${t}`:"")}const u8=["top","right","bottom","left"],vr=Math.min,_n=Math.max,fh=Math.round,Bd=Math.floor,Ys=e=>({x:e,y:e}),h8={left:"right",right:"left",bottom:"top",top:"bottom"},f8={start:"end",end:"start"};function bg(e,t,n){return _n(e,vr(t,n))}function ja(e,t){return typeof e=="function"?e(t):e}function Na(e){return e.split("-")[0]}function Zo(e){return e.split("-")[1]}function a0(e){return e==="x"?"y":"x"}function r0(e){return e==="y"?"height":"width"}const m8=new Set(["top","bottom"]);function Us(e){return m8.has(Na(e))?"y":"x"}function i0(e){return a0(Us(e))}function x8(e,t,n){n===void 0&&(n=!1);const s=Zo(e),r=i0(e),i=r0(r);let o=r==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=mh(o)),[o,mh(o)]}function g8(e){const t=mh(e);return[yg(e),t,yg(t)]}function yg(e){return e.replace(/start|end/g,t=>f8[t])}const My=["left","right"],Ty=["right","left"],p8=["top","bottom"],v8=["bottom","top"];function b8(e,t,n){switch(e){case"top":case"bottom":return n?t?Ty:My:t?My:Ty;case"left":case"right":return t?p8:v8;default:return[]}}function y8(e,t,n,s){const r=Zo(e);let i=b8(Na(e),n==="start",s);return r&&(i=i.map(o=>o+"-"+r),t&&(i=i.concat(i.map(yg)))),i}function mh(e){return e.replace(/left|right|bottom|top/g,t=>h8[t])}function w8(e){return{top:0,right:0,bottom:0,left:0,...e}}function VS(e){return typeof e!="number"?w8(e):{top:e,right:e,bottom:e,left:e}}function xh(e){const{x:t,y:n,width:s,height:r}=e;return{width:s,height:r,top:n,left:t,right:t+s,bottom:n+r,x:t,y:n}}function Dy(e,t,n){let{reference:s,floating:r}=e;const i=Us(t),o=i0(t),l=r0(o),c=Na(t),u=i==="y",h=s.x+s.width/2-r.width/2,d=s.y+s.height/2-r.height/2,f=s[l]/2-r[l]/2;let x;switch(c){case"top":x={x:h,y:s.y-r.height};break;case"bottom":x={x:h,y:s.y+s.height};break;case"right":x={x:s.x+s.width,y:d};break;case"left":x={x:s.x-r.width,y:d};break;default:x={x:s.x,y:s.y}}switch(Zo(t)){case"start":x[o]-=f*(n&&u?-1:1);break;case"end":x[o]+=f*(n&&u?-1:1);break}return x}const j8=async(e,t,n)=>{const{placement:s="bottom",strategy:r="absolute",middleware:i=[],platform:o}=n,l=i.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:r}),{x:h,y:d}=Dy(u,s,c),f=s,x={},y=0;for(let v=0;v<l.length;v++){const{name:j,fn:g}=l[v],{x:b,y:p,data:w,reset:N}=await g({x:h,y:d,initialPlacement:s,placement:f,strategy:r,middlewareData:x,rects:u,platform:o,elements:{reference:e,floating:t}});h=b??h,d=p??d,x={...x,[j]:{...x[j],...w}},N&&y<=50&&(y++,typeof N=="object"&&(N.placement&&(f=N.placement),N.rects&&(u=N.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:r}):N.rects),{x:h,y:d}=Dy(u,f,c)),v=-1)}return{x:h,y:d,placement:f,strategy:r,middlewareData:x}};async function Nc(e,t){var n;t===void 0&&(t={});const{x:s,y:r,platform:i,rects:o,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:f=!1,padding:x=0}=ja(t,e),y=VS(x),j=l[f?d==="floating"?"reference":"floating":d],g=xh(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(j)))==null||n?j:j.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:u,rootBoundary:h,strategy:c})),b=d==="floating"?{x:s,y:r,width:o.floating.width,height:o.floating.height}:o.reference,p=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),w=await(i.isElement==null?void 0:i.isElement(p))?await(i.getScale==null?void 0:i.getScale(p))||{x:1,y:1}:{x:1,y:1},N=xh(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:b,offsetParent:p,strategy:c}):b);return{top:(g.top-N.top+y.top)/w.y,bottom:(N.bottom-g.bottom+y.bottom)/w.y,left:(g.left-N.left+y.left)/w.x,right:(N.right-g.right+y.right)/w.x}}const N8=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:s,placement:r,rects:i,platform:o,elements:l,middlewareData:c}=t,{element:u,padding:h=0}=ja(e,t)||{};if(u==null)return{};const d=VS(h),f={x:n,y:s},x=i0(r),y=r0(x),v=await o.getDimensions(u),j=x==="y",g=j?"top":"left",b=j?"bottom":"right",p=j?"clientHeight":"clientWidth",w=i.reference[y]+i.reference[x]-f[x]-i.floating[y],N=f[x]-i.reference[x],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let C=S?S[p]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=l.floating[p]||i.floating[y]);const T=w/2-N/2,O=C/2-v[y]/2-1,H=vr(d[g],O),U=vr(d[b],O),z=H,Y=C-v[y]-U,k=C/2-v[y]/2+T,$=bg(z,k,Y),M=!c.arrow&&Zo(r)!=null&&k!==$&&i.reference[y]/2-(k<z?H:U)-v[y]/2<0,A=M?k<z?k-z:k-Y:0;return{[x]:f[x]+A,data:{[x]:$,centerOffset:k-$-A,...M&&{alignmentOffset:A}},reset:M}}}),S8=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,s;const{placement:r,middlewareData:i,rects:o,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:h=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:v=!0,...j}=ja(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const g=Na(r),b=Us(l),p=Na(l)===l,w=await(c.isRTL==null?void 0:c.isRTL(u.floating)),N=f||(p||!v?[mh(l)]:g8(l)),S=y!=="none";!f&&S&&N.push(...y8(l,v,y,w));const C=[l,...N],T=await Nc(t,j),O=[];let H=((s=i.flip)==null?void 0:s.overflows)||[];if(h&&O.push(T[g]),d){const k=x8(r,o,w);O.push(T[k[0]],T[k[1]])}if(H=[...H,{placement:r,overflows:O}],!O.every(k=>k<=0)){var U,z;const k=(((U=i.flip)==null?void 0:U.index)||0)+1,$=C[k];if($&&(!(d==="alignment"?b!==Us($):!1)||H.every(E=>Us(E.placement)===b?E.overflows[0]>0:!0)))return{data:{index:k,overflows:H},reset:{placement:$}};let M=(z=H.filter(A=>A.overflows[0]<=0).sort((A,E)=>A.overflows[1]-E.overflows[1])[0])==null?void 0:z.placement;if(!M)switch(x){case"bestFit":{var Y;const A=(Y=H.filter(E=>{if(S){const D=Us(E.placement);return D===b||D==="y"}return!0}).map(E=>[E.placement,E.overflows.filter(D=>D>0).reduce((D,_)=>D+_,0)]).sort((E,D)=>E[1]-D[1])[0])==null?void 0:Y[0];A&&(M=A);break}case"initialPlacement":M=l;break}if(r!==M)return{reset:{placement:M}}}return{}}}};function _y(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ay(e){return u8.some(t=>e[t]>=0)}const C8=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:s="referenceHidden",...r}=ja(e,t);switch(s){case"referenceHidden":{const i=await Nc(t,{...r,elementContext:"reference"}),o=_y(i,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Ay(o)}}}case"escaped":{const i=await Nc(t,{...r,altBoundary:!0}),o=_y(i,n.floating);return{data:{escapedOffsets:o,escaped:Ay(o)}}}default:return{}}}}},YS=new Set(["left","top"]);async function E8(e,t){const{placement:n,platform:s,elements:r}=e,i=await(s.isRTL==null?void 0:s.isRTL(r.floating)),o=Na(n),l=Zo(n),c=Us(n)==="y",u=YS.has(o)?-1:1,h=i&&c?-1:1,d=ja(t,e);let{mainAxis:f,crossAxis:x,alignmentAxis:y}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&typeof y=="number"&&(x=l==="end"?y*-1:y),c?{x:x*h,y:f*u}:{x:f*u,y:x*h}}const k8=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,s;const{x:r,y:i,placement:o,middlewareData:l}=t,c=await E8(t,e);return o===((n=l.offset)==null?void 0:n.placement)&&(s=l.arrow)!=null&&s.alignmentOffset?{}:{x:r+c.x,y:i+c.y,data:{...c,placement:o}}}}},M8=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:s,placement:r}=t,{mainAxis:i=!0,crossAxis:o=!1,limiter:l={fn:j=>{let{x:g,y:b}=j;return{x:g,y:b}}},...c}=ja(e,t),u={x:n,y:s},h=await Nc(t,c),d=Us(Na(r)),f=a0(d);let x=u[f],y=u[d];if(i){const j=f==="y"?"top":"left",g=f==="y"?"bottom":"right",b=x+h[j],p=x-h[g];x=bg(b,x,p)}if(o){const j=d==="y"?"top":"left",g=d==="y"?"bottom":"right",b=y+h[j],p=y-h[g];y=bg(b,y,p)}const v=l.fn({...t,[f]:x,[d]:y});return{...v,data:{x:v.x-n,y:v.y-s,enabled:{[f]:i,[d]:o}}}}}},T8=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:s,placement:r,rects:i,middlewareData:o}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=ja(e,t),h={x:n,y:s},d=Us(r),f=a0(d);let x=h[f],y=h[d];const v=ja(l,t),j=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const p=f==="y"?"height":"width",w=i.reference[f]-i.floating[p]+j.mainAxis,N=i.reference[f]+i.reference[p]-j.mainAxis;x<w?x=w:x>N&&(x=N)}if(u){var g,b;const p=f==="y"?"width":"height",w=YS.has(Na(r)),N=i.reference[d]-i.floating[p]+(w&&((g=o.offset)==null?void 0:g[d])||0)+(w?0:j.crossAxis),S=i.reference[d]+i.reference[p]+(w?0:((b=o.offset)==null?void 0:b[d])||0)-(w?j.crossAxis:0);y<N?y=N:y>S&&(y=S)}return{[f]:x,[d]:y}}}},D8=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,s;const{placement:r,rects:i,platform:o,elements:l}=t,{apply:c=()=>{},...u}=ja(e,t),h=await Nc(t,u),d=Na(r),f=Zo(r),x=Us(r)==="y",{width:y,height:v}=i.floating;let j,g;d==="top"||d==="bottom"?(j=d,g=f===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(g=d,j=f==="end"?"top":"bottom");const b=v-h.top-h.bottom,p=y-h.left-h.right,w=vr(v-h[j],b),N=vr(y-h[g],p),S=!t.middlewareData.shift;let C=w,T=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=p),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(C=b),S&&!f){const H=_n(h.left,0),U=_n(h.right,0),z=_n(h.top,0),Y=_n(h.bottom,0);x?T=y-2*(H!==0||U!==0?H+U:_n(h.left,h.right)):C=v-2*(z!==0||Y!==0?z+Y:_n(h.top,h.bottom))}await c({...t,availableWidth:T,availableHeight:C});const O=await o.getDimensions(l.floating);return y!==O.width||v!==O.height?{reset:{rects:!0}}:{}}}};function df(){return typeof window<"u"}function Qo(e){return FS(e)?(e.nodeName||"").toLowerCase():"#document"}function Hn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Gs(e){var t;return(t=(FS(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function FS(e){return df()?e instanceof Node||e instanceof Hn(e).Node:!1}function vs(e){return df()?e instanceof Element||e instanceof Hn(e).Element:!1}function Is(e){return df()?e instanceof HTMLElement||e instanceof Hn(e).HTMLElement:!1}function Oy(e){return!df()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Hn(e).ShadowRoot}const _8=new Set(["inline","contents"]);function Qc(e){const{overflow:t,overflowX:n,overflowY:s,display:r}=bs(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&!_8.has(r)}const A8=new Set(["table","td","th"]);function O8(e){return A8.has(Qo(e))}const z8=[":popover-open",":modal"];function uf(e){return z8.some(t=>{try{return e.matches(t)}catch{return!1}})}const R8=["transform","translate","scale","rotate","perspective"],U8=["transform","translate","scale","rotate","perspective","filter"],$8=["paint","layout","strict","content"];function o0(e){const t=l0(),n=vs(e)?bs(e):e;return R8.some(s=>n[s]?n[s]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||U8.some(s=>(n.willChange||"").includes(s))||$8.some(s=>(n.contain||"").includes(s))}function P8(e){let t=br(e);for(;Is(t)&&!Ro(t);){if(o0(t))return t;if(uf(t))return null;t=br(t)}return null}function l0(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const L8=new Set(["html","body","#document"]);function Ro(e){return L8.has(Qo(e))}function bs(e){return Hn(e).getComputedStyle(e)}function hf(e){return vs(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function br(e){if(Qo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Oy(e)&&e.host||Gs(e);return Oy(t)?t.host:t}function IS(e){const t=br(e);return Ro(t)?e.ownerDocument?e.ownerDocument.body:e.body:Is(t)&&Qc(t)?t:IS(t)}function Sc(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=IS(e),i=r===((s=e.ownerDocument)==null?void 0:s.body),o=Hn(r);if(i){const l=wg(o);return t.concat(o,o.visualViewport||[],Qc(r)?r:[],l&&n?Sc(l):[])}return t.concat(r,Sc(r,[],n))}function wg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function WS(e){const t=bs(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const r=Is(e),i=r?e.offsetWidth:n,o=r?e.offsetHeight:s,l=fh(n)!==i||fh(s)!==o;return l&&(n=i,s=o),{width:n,height:s,$:l}}function c0(e){return vs(e)?e:e.contextElement}function fo(e){const t=c0(e);if(!Is(t))return Ys(1);const n=t.getBoundingClientRect(),{width:s,height:r,$:i}=WS(t);let o=(i?fh(n.width):n.width)/s,l=(i?fh(n.height):n.height)/r;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const H8=Ys(0);function qS(e){const t=Hn(e);return!l0()||!t.visualViewport?H8:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function B8(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Hn(e)?!1:t}function ci(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=c0(e);let o=Ys(1);t&&(s?vs(s)&&(o=fo(s)):o=fo(e));const l=B8(i,n,s)?qS(i):Ys(0);let c=(r.left+l.x)/o.x,u=(r.top+l.y)/o.y,h=r.width/o.x,d=r.height/o.y;if(i){const f=Hn(i),x=s&&vs(s)?Hn(s):s;let y=f,v=wg(y);for(;v&&s&&x!==y;){const j=fo(v),g=v.getBoundingClientRect(),b=bs(v),p=g.left+(v.clientLeft+parseFloat(b.paddingLeft))*j.x,w=g.top+(v.clientTop+parseFloat(b.paddingTop))*j.y;c*=j.x,u*=j.y,h*=j.x,d*=j.y,c+=p,u+=w,y=Hn(v),v=wg(y)}}return xh({width:h,height:d,x:c,y:u})}function ff(e,t){const n=hf(e).scrollLeft;return t?t.left+n:ci(Gs(e)).left+n}function XS(e,t){const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-ff(e,n),r=n.top+t.scrollTop;return{x:s,y:r}}function V8(e){let{elements:t,rect:n,offsetParent:s,strategy:r}=e;const i=r==="fixed",o=Gs(s),l=t?uf(t.floating):!1;if(s===o||l&&i)return n;let c={scrollLeft:0,scrollTop:0},u=Ys(1);const h=Ys(0),d=Is(s);if((d||!d&&!i)&&((Qo(s)!=="body"||Qc(o))&&(c=hf(s)),Is(s))){const x=ci(s);u=fo(s),h.x=x.x+s.clientLeft,h.y=x.y+s.clientTop}const f=o&&!d&&!i?XS(o,c):Ys(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+h.x+f.x,y:n.y*u.y-c.scrollTop*u.y+h.y+f.y}}function Y8(e){return Array.from(e.getClientRects())}function F8(e){const t=Gs(e),n=hf(e),s=e.ownerDocument.body,r=_n(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),i=_n(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let o=-n.scrollLeft+ff(e);const l=-n.scrollTop;return bs(s).direction==="rtl"&&(o+=_n(t.clientWidth,s.clientWidth)-r),{width:r,height:i,x:o,y:l}}const zy=25;function I8(e,t){const n=Hn(e),s=Gs(e),r=n.visualViewport;let i=s.clientWidth,o=s.clientHeight,l=0,c=0;if(r){i=r.width,o=r.height;const h=l0();(!h||h&&t==="fixed")&&(l=r.offsetLeft,c=r.offsetTop)}const u=ff(s);if(u<=0){const h=s.ownerDocument,d=h.body,f=getComputedStyle(d),x=h.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,y=Math.abs(s.clientWidth-d.clientWidth-x);y<=zy&&(i-=y)}else u<=zy&&(i+=u);return{width:i,height:o,x:l,y:c}}const W8=new Set(["absolute","fixed"]);function q8(e,t){const n=ci(e,!0,t==="fixed"),s=n.top+e.clientTop,r=n.left+e.clientLeft,i=Is(e)?fo(e):Ys(1),o=e.clientWidth*i.x,l=e.clientHeight*i.y,c=r*i.x,u=s*i.y;return{width:o,height:l,x:c,y:u}}function Ry(e,t,n){let s;if(t==="viewport")s=I8(e,n);else if(t==="document")s=F8(Gs(e));else if(vs(t))s=q8(t,n);else{const r=qS(e);s={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return xh(s)}function GS(e,t){const n=br(e);return n===t||!vs(n)||Ro(n)?!1:bs(n).position==="fixed"||GS(n,t)}function X8(e,t){const n=t.get(e);if(n)return n;let s=Sc(e,[],!1).filter(l=>vs(l)&&Qo(l)!=="body"),r=null;const i=bs(e).position==="fixed";let o=i?br(e):e;for(;vs(o)&&!Ro(o);){const l=bs(o),c=o0(o);!c&&l.position==="fixed"&&(r=null),(i?!c&&!r:!c&&l.position==="static"&&!!r&&W8.has(r.position)||Qc(o)&&!c&&GS(e,o))?s=s.filter(h=>h!==o):r=l,o=br(o)}return t.set(e,s),s}function G8(e){let{element:t,boundary:n,rootBoundary:s,strategy:r}=e;const o=[...n==="clippingAncestors"?uf(t)?[]:X8(t,this._c):[].concat(n),s],l=o[0],c=o.reduce((u,h)=>{const d=Ry(t,h,r);return u.top=_n(d.top,u.top),u.right=vr(d.right,u.right),u.bottom=vr(d.bottom,u.bottom),u.left=_n(d.left,u.left),u},Ry(t,l,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Z8(e){const{width:t,height:n}=WS(e);return{width:t,height:n}}function Q8(e,t,n){const s=Is(t),r=Gs(t),i=n==="fixed",o=ci(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=Ys(0);function u(){c.x=ff(r)}if(s||!s&&!i)if((Qo(t)!=="body"||Qc(r))&&(l=hf(t)),s){const x=ci(t,!0,i,t);c.x=x.x+t.clientLeft,c.y=x.y+t.clientTop}else r&&u();i&&!s&&r&&u();const h=r&&!s&&!i?XS(r,l):Ys(0),d=o.left+l.scrollLeft-c.x-h.x,f=o.top+l.scrollTop-c.y-h.y;return{x:d,y:f,width:o.width,height:o.height}}function Mm(e){return bs(e).position==="static"}function Uy(e,t){if(!Is(e)||bs(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Gs(e)===n&&(n=n.ownerDocument.body),n}function ZS(e,t){const n=Hn(e);if(uf(e))return n;if(!Is(e)){let r=br(e);for(;r&&!Ro(r);){if(vs(r)&&!Mm(r))return r;r=br(r)}return n}let s=Uy(e,t);for(;s&&O8(s)&&Mm(s);)s=Uy(s,t);return s&&Ro(s)&&Mm(s)&&!o0(s)?n:s||P8(e)||n}const K8=async function(e){const t=this.getOffsetParent||ZS,n=this.getDimensions,s=await n(e.floating);return{reference:Q8(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function J8(e){return bs(e).direction==="rtl"}const e7={convertOffsetParentRelativeRectToViewportRelativeRect:V8,getDocumentElement:Gs,getClippingRect:G8,getOffsetParent:ZS,getElementRects:K8,getClientRects:Y8,getDimensions:Z8,getScale:fo,isElement:vs,isRTL:J8};function QS(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function t7(e,t){let n=null,s;const r=Gs(e);function i(){var l;clearTimeout(s),(l=n)==null||l.disconnect(),n=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const u=e.getBoundingClientRect(),{left:h,top:d,width:f,height:x}=u;if(l||t(),!f||!x)return;const y=Bd(d),v=Bd(r.clientWidth-(h+f)),j=Bd(r.clientHeight-(d+x)),g=Bd(h),p={rootMargin:-y+"px "+-v+"px "+-j+"px "+-g+"px",threshold:_n(0,vr(1,c))||1};let w=!0;function N(S){const C=S[0].intersectionRatio;if(C!==c){if(!w)return o();C?o(!1,C):s=setTimeout(()=>{o(!1,1e-7)},1e3)}C===1&&!QS(u,e.getBoundingClientRect())&&o(),w=!1}try{n=new IntersectionObserver(N,{...p,root:r.ownerDocument})}catch{n=new IntersectionObserver(N,p)}n.observe(e)}return o(!0),i}function n7(e,t,n,s){s===void 0&&(s={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=s,u=c0(e),h=r||i?[...u?Sc(u):[],...Sc(t)]:[];h.forEach(g=>{r&&g.addEventListener("scroll",n,{passive:!0}),i&&g.addEventListener("resize",n)});const d=u&&l?t7(u,n):null;let f=-1,x=null;o&&(x=new ResizeObserver(g=>{let[b]=g;b&&b.target===u&&x&&(x.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var p;(p=x)==null||p.observe(t)})),n()}),u&&!c&&x.observe(u),x.observe(t));let y,v=c?ci(e):null;c&&j();function j(){const g=ci(e);v&&!QS(v,g)&&n(),v=g,y=requestAnimationFrame(j)}return n(),()=>{var g;h.forEach(b=>{r&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),d==null||d(),(g=x)==null||g.disconnect(),x=null,c&&cancelAnimationFrame(y)}}const s7=k8,a7=M8,r7=S8,i7=D8,o7=C8,$y=N8,l7=T8,c7=(e,t,n)=>{const s=new Map,r={platform:e7,...n},i={...r.platform,_c:s};return j8(e,t,{...r,platform:i})};var d7=typeof document<"u",u7=function(){},gu=d7?m.useLayoutEffect:u7;function gh(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,s,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(s=n;s--!==0;)if(!gh(e[s],t[s]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!{}.hasOwnProperty.call(t,r[s]))return!1;for(s=n;s--!==0;){const i=r[s];if(!(i==="_owner"&&e.$$typeof)&&!gh(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function KS(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Py(e,t){const n=KS(e);return Math.round(t*n)/n}function Tm(e){const t=m.useRef(e);return gu(()=>{t.current=e}),t}function h7(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:s=[],platform:r,elements:{reference:i,floating:o}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[h,d]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,x]=m.useState(s);gh(f,s)||x(s);const[y,v]=m.useState(null),[j,g]=m.useState(null),b=m.useCallback(E=>{E!==S.current&&(S.current=E,v(E))},[]),p=m.useCallback(E=>{E!==C.current&&(C.current=E,g(E))},[]),w=i||y,N=o||j,S=m.useRef(null),C=m.useRef(null),T=m.useRef(h),O=c!=null,H=Tm(c),U=Tm(r),z=Tm(u),Y=m.useCallback(()=>{if(!S.current||!C.current)return;const E={placement:t,strategy:n,middleware:f};U.current&&(E.platform=U.current),c7(S.current,C.current,E).then(D=>{const _={...D,isPositioned:z.current!==!1};k.current&&!gh(T.current,_)&&(T.current=_,Dh.flushSync(()=>{d(_)}))})},[f,t,n,U,z]);gu(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(E=>({...E,isPositioned:!1})))},[u]);const k=m.useRef(!1);gu(()=>(k.current=!0,()=>{k.current=!1}),[]),gu(()=>{if(w&&(S.current=w),N&&(C.current=N),w&&N){if(H.current)return H.current(w,N,Y);Y()}},[w,N,Y,H,O]);const $=m.useMemo(()=>({reference:S,floating:C,setReference:b,setFloating:p}),[b,p]),M=m.useMemo(()=>({reference:w,floating:N}),[w,N]),A=m.useMemo(()=>{const E={position:n,left:0,top:0};if(!M.floating)return E;const D=Py(M.floating,h.x),_=Py(M.floating,h.y);return l?{...E,transform:"translate("+D+"px, "+_+"px)",...KS(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:D,top:_}},[n,l,M.floating,h.x,h.y]);return m.useMemo(()=>({...h,update:Y,refs:$,elements:M,floatingStyles:A}),[h,Y,$,M,A])}const f7=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:s,padding:r}=typeof e=="function"?e(n):e;return s&&t(s)?s.current!=null?$y({element:s.current,padding:r}).fn(n):{}:s?$y({element:s,padding:r}).fn(n):{}}}},m7=(e,t)=>({...s7(e),options:[e,t]}),x7=(e,t)=>({...a7(e),options:[e,t]}),g7=(e,t)=>({...l7(e),options:[e,t]}),p7=(e,t)=>({...r7(e),options:[e,t]}),v7=(e,t)=>({...i7(e),options:[e,t]}),b7=(e,t)=>({...o7(e),options:[e,t]}),y7=(e,t)=>({...f7(e),options:[e,t]});var w7="Arrow",JS=m.forwardRef((e,t)=>{const{children:n,width:s=10,height:r=5,...i}=e;return a.jsx(ln.svg,{...i,ref:t,width:s,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});JS.displayName=w7;var j7=JS;function N7(e){const[t,n]=m.useState(void 0);return pr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const s=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const i=r[0];let o,l;if("borderBoxSize"in i){const c=i.borderBoxSize,u=Array.isArray(c)?c[0]:c;o=u.inlineSize,l=u.blockSize}else o=e.offsetWidth,l=e.offsetHeight;n({width:o,height:l})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else n(void 0)},[e]),t}var d0="Popper",[e4,mf]=lf(d0),[S7,t4]=e4(d0),n4=e=>{const{__scopePopper:t,children:n}=e,[s,r]=m.useState(null);return a.jsx(S7,{scope:t,anchor:s,onAnchorChange:r,children:n})};n4.displayName=d0;var s4="PopperAnchor",a4=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:s,...r}=e,i=t4(s4,n),o=m.useRef(null),l=Fn(t,o),c=m.useRef(null);return m.useEffect(()=>{const u=c.current;c.current=(s==null?void 0:s.current)||o.current,u!==c.current&&i.onAnchorChange(c.current)}),s?null:a.jsx(ln.div,{...r,ref:l})});a4.displayName=s4;var u0="PopperContent",[C7,E7]=e4(u0),r4=m.forwardRef((e,t)=>{var ne,Z,se,xe,ae,ce;const{__scopePopper:n,side:s="bottom",sideOffset:r=0,align:i="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:h=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:x="optimized",onPlaced:y,...v}=e,j=t4(u0,n),[g,b]=m.useState(null),p=Fn(t,de=>b(de)),[w,N]=m.useState(null),S=N7(w),C=(S==null?void 0:S.width)??0,T=(S==null?void 0:S.height)??0,O=s+(i!=="center"?"-"+i:""),H=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},U=Array.isArray(u)?u:[u],z=U.length>0,Y={padding:H,boundary:U.filter(M7),altBoundary:z},{refs:k,floatingStyles:$,placement:M,isPositioned:A,middlewareData:E}=h7({strategy:"fixed",placement:O,whileElementsMounted:(...de)=>n7(...de,{animationFrame:x==="always"}),elements:{reference:j.anchor},middleware:[m7({mainAxis:r+T,alignmentAxis:o}),c&&x7({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?g7():void 0,...Y}),c&&p7({...Y}),v7({...Y,apply:({elements:de,rects:Se,availableWidth:Ee,availableHeight:Ae})=>{const{width:He,height:J}=Se.reference,oe=de.floating.style;oe.setProperty("--radix-popper-available-width",`${Ee}px`),oe.setProperty("--radix-popper-available-height",`${Ae}px`),oe.setProperty("--radix-popper-anchor-width",`${He}px`),oe.setProperty("--radix-popper-anchor-height",`${J}px`)}}),w&&y7({element:w,padding:l}),T7({arrowWidth:C,arrowHeight:T}),f&&b7({strategy:"referenceHidden",...Y})]}),[D,_]=l4(M),I=zo(y);pr(()=>{A&&(I==null||I())},[A,I]);const R=(ne=E.arrow)==null?void 0:ne.x,P=(Z=E.arrow)==null?void 0:Z.y,W=((se=E.arrow)==null?void 0:se.centerOffset)!==0,[q,ee]=m.useState();return pr(()=>{g&&ee(window.getComputedStyle(g).zIndex)},[g]),a.jsx("div",{ref:k.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:A?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:q,"--radix-popper-transform-origin":[(xe=E.transformOrigin)==null?void 0:xe.x,(ae=E.transformOrigin)==null?void 0:ae.y].join(" "),...((ce=E.hide)==null?void 0:ce.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(C7,{scope:n,placedSide:D,onArrowChange:N,arrowX:R,arrowY:P,shouldHideArrow:W,children:a.jsx(ln.div,{"data-side":D,"data-align":_,...v,ref:p,style:{...v.style,animation:A?void 0:"none"}})})})});r4.displayName=u0;var i4="PopperArrow",k7={top:"bottom",right:"left",bottom:"top",left:"right"},o4=m.forwardRef(function(t,n){const{__scopePopper:s,...r}=t,i=E7(i4,s),o=k7[i.placedSide];return a.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:a.jsx(j7,{...r,ref:n,style:{...r.style,display:"block"}})})});o4.displayName=i4;function M7(e){return e!==null}var T7=e=>({name:"transformOrigin",options:e,fn(t){var j,g,b;const{placement:n,rects:s,middlewareData:r}=t,o=((j=r.arrow)==null?void 0:j.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[u,h]=l4(n),d={start:"0%",center:"50%",end:"100%"}[h],f=(((g=r.arrow)==null?void 0:g.x)??0)+l/2,x=(((b=r.arrow)==null?void 0:b.y)??0)+c/2;let y="",v="";return u==="bottom"?(y=o?d:`${f}px`,v=`${-c}px`):u==="top"?(y=o?d:`${f}px`,v=`${s.floating.height+c}px`):u==="right"?(y=`${-c}px`,v=o?d:`${x}px`):u==="left"&&(y=`${s.floating.width+c}px`,v=o?d:`${x}px`),{data:{x:y,y:v}}}});function l4(e){const[t,n="center"]=e.split("-");return[t,n]}var c4=n4,h0=a4,d4=r4,u4=o4,D7="Portal",f0=m.forwardRef((e,t)=>{var l;const{container:n,...s}=e,[r,i]=m.useState(!1);pr(()=>i(!0),[]);const o=n||r&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?Iw.createPortal(a.jsx(ln.div,{...s,ref:t}),o):null});f0.displayName=D7;function _7(e,t){return m.useReducer((n,s)=>t[n][s]??n,e)}var bi=e=>{const{present:t,children:n}=e,s=A7(t),r=typeof n=="function"?n({present:s.isPresent}):m.Children.only(n),i=Fn(s.ref,O7(r));return typeof n=="function"||s.isPresent?m.cloneElement(r,{ref:i}):null};bi.displayName="Presence";function A7(e){const[t,n]=m.useState(),s=m.useRef(null),r=m.useRef(e),i=m.useRef("none"),o=e?"mounted":"unmounted",[l,c]=_7(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const u=Vd(s.current);i.current=l==="mounted"?u:"none"},[l]),pr(()=>{const u=s.current,h=r.current;if(h!==e){const f=i.current,x=Vd(u);e?c("MOUNT"):x==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(h&&f!==x?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,c]),pr(()=>{if(t){let u;const h=t.ownerDocument.defaultView??window,d=x=>{const v=Vd(s.current).includes(CSS.escape(x.animationName));if(x.target===t&&v&&(c("ANIMATION_END"),!r.current)){const j=t.style.animationFillMode;t.style.animationFillMode="forwards",u=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=j)})}},f=x=>{x.target===t&&(i.current=Vd(s.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{h.clearTimeout(u),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:m.useCallback(u=>{s.current=u?getComputedStyle(u):null,n(u)},[])}}function Vd(e){return(e==null?void 0:e.animationName)||"none"}function O7(e){var s,r;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var z7=kh[" useInsertionEffect ".trim().toString()]||pr;function m0({prop:e,defaultProp:t,onChange:n=()=>{},caller:s}){const[r,i,o]=R7({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:r;{const h=m.useRef(e!==void 0);m.useEffect(()=>{const d=h.current;d!==l&&console.warn(`${s} is changing from ${d?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),h.current=l},[l,s])}const u=m.useCallback(h=>{var d;if(l){const f=U7(h)?h(e):h;f!==e&&((d=o.current)==null||d.call(o,f))}else i(h)},[l,e,i,o]);return[c,u]}function R7({defaultProp:e,onChange:t}){const[n,s]=m.useState(e),r=m.useRef(n),i=m.useRef(t);return z7(()=>{i.current=t},[t]),m.useEffect(()=>{var o;r.current!==n&&((o=i.current)==null||o.call(i,n),r.current=n)},[n,r]),[n,s,i]}function U7(e){return typeof e=="function"}var $7=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),P7="VisuallyHidden",h4=m.forwardRef((e,t)=>a.jsx(ln.span,{...e,ref:t,style:{...$7,...e.style}}));h4.displayName=P7;var L7=h4,[xf]=lf("Tooltip",[mf]),gf=mf(),f4="TooltipProvider",H7=700,jg="tooltip.open",[B7,x0]=xf(f4),m4=e=>{const{__scopeTooltip:t,delayDuration:n=H7,skipDelayDuration:s=300,disableHoverableContent:r=!1,children:i}=e,o=m.useRef(!0),l=m.useRef(!1),c=m.useRef(0);return m.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),a.jsx(B7,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:m.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:m.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,s)},[s]),isPointerInTransitRef:l,onPointerInTransitChange:m.useCallback(u=>{l.current=u},[]),disableHoverableContent:r,children:i})};m4.displayName=f4;var Cc="Tooltip",[V7,pf]=xf(Cc),x4=e=>{const{__scopeTooltip:t,children:n,open:s,defaultOpen:r,onOpenChange:i,disableHoverableContent:o,delayDuration:l}=e,c=x0(Cc,e.__scopeTooltip),u=gf(t),[h,d]=m.useState(null),f=ps(),x=m.useRef(0),y=o??c.disableHoverableContent,v=l??c.delayDuration,j=m.useRef(!1),[g,b]=m0({prop:s,defaultProp:r??!1,onChange:C=>{C?(c.onOpen(),document.dispatchEvent(new CustomEvent(jg))):c.onClose(),i==null||i(C)},caller:Cc}),p=m.useMemo(()=>g?j.current?"delayed-open":"instant-open":"closed",[g]),w=m.useCallback(()=>{window.clearTimeout(x.current),x.current=0,j.current=!1,b(!0)},[b]),N=m.useCallback(()=>{window.clearTimeout(x.current),x.current=0,b(!1)},[b]),S=m.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{j.current=!0,b(!0),x.current=0},v)},[v,b]);return m.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]),a.jsx(c4,{...u,children:a.jsx(V7,{scope:t,contentId:f,open:g,stateAttribute:p,trigger:h,onTriggerChange:d,onTriggerEnter:m.useCallback(()=>{c.isOpenDelayedRef.current?S():w()},[c.isOpenDelayedRef,S,w]),onTriggerLeave:m.useCallback(()=>{y?N():(window.clearTimeout(x.current),x.current=0)},[N,y]),onOpen:w,onClose:N,disableHoverableContent:y,children:n})})};x4.displayName=Cc;var Ng="TooltipTrigger",g4=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...s}=e,r=pf(Ng,n),i=x0(Ng,n),o=gf(n),l=m.useRef(null),c=Fn(t,l,r.onTriggerChange),u=m.useRef(!1),h=m.useRef(!1),d=m.useCallback(()=>u.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),a.jsx(h0,{asChild:!0,...o,children:a.jsx(ln.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...s,ref:c,onPointerMove:Vt(e.onPointerMove,f=>{f.pointerType!=="touch"&&!h.current&&!i.isPointerInTransitRef.current&&(r.onTriggerEnter(),h.current=!0)}),onPointerLeave:Vt(e.onPointerLeave,()=>{r.onTriggerLeave(),h.current=!1}),onPointerDown:Vt(e.onPointerDown,()=>{r.open&&r.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Vt(e.onFocus,()=>{u.current||r.onOpen()}),onBlur:Vt(e.onBlur,r.onClose),onClick:Vt(e.onClick,r.onClose)})})});g4.displayName=Ng;var Y7="TooltipPortal",[xV,F7]=xf(Y7,{forceMount:void 0}),Uo="TooltipContent",p4=m.forwardRef((e,t)=>{const n=F7(Uo,e.__scopeTooltip),{forceMount:s=n.forceMount,side:r="top",...i}=e,o=pf(Uo,e.__scopeTooltip);return a.jsx(bi,{present:s||o.open,children:o.disableHoverableContent?a.jsx(v4,{side:r,...i,ref:t}):a.jsx(I7,{side:r,...i,ref:t})})}),I7=m.forwardRef((e,t)=>{const n=pf(Uo,e.__scopeTooltip),s=x0(Uo,e.__scopeTooltip),r=m.useRef(null),i=Fn(t,r),[o,l]=m.useState(null),{trigger:c,onClose:u}=n,h=r.current,{onPointerInTransitChange:d}=s,f=m.useCallback(()=>{l(null),d(!1)},[d]),x=m.useCallback((y,v)=>{const j=y.currentTarget,g={x:y.clientX,y:y.clientY},b=Z7(g,j.getBoundingClientRect()),p=Q7(g,b),w=K7(v.getBoundingClientRect()),N=e9([...p,...w]);l(N),d(!0)},[d]);return m.useEffect(()=>()=>f(),[f]),m.useEffect(()=>{if(c&&h){const y=j=>x(j,h),v=j=>x(j,c);return c.addEventListener("pointerleave",y),h.addEventListener("pointerleave",v),()=>{c.removeEventListener("pointerleave",y),h.removeEventListener("pointerleave",v)}}},[c,h,x,f]),m.useEffect(()=>{if(o){const y=v=>{const j=v.target,g={x:v.clientX,y:v.clientY},b=(c==null?void 0:c.contains(j))||(h==null?void 0:h.contains(j)),p=!J7(g,o);b?f():p&&(f(),u())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[c,h,o,u,f]),a.jsx(v4,{...e,ref:i})}),[W7,q7]=xf(Cc,{isInside:!1}),X7=GR("TooltipContent"),v4=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:s,"aria-label":r,onEscapeKeyDown:i,onPointerDownOutside:o,...l}=e,c=pf(Uo,n),u=gf(n),{onClose:h}=c;return m.useEffect(()=>(document.addEventListener(jg,h),()=>document.removeEventListener(jg,h)),[h]),m.useEffect(()=>{if(c.trigger){const d=f=>{const x=f.target;x!=null&&x.contains(c.trigger)&&h()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[c.trigger,h]),a.jsx(cf,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:d=>d.preventDefault(),onDismiss:h,children:a.jsxs(d4,{"data-state":c.stateAttribute,...u,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[a.jsx(X7,{children:s}),a.jsx(W7,{scope:n,isInside:!0,children:a.jsx(L7,{id:c.contentId,role:"tooltip",children:r||s})})]})})});p4.displayName=Uo;var b4="TooltipArrow",G7=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...s}=e,r=gf(n);return q7(b4,n).isInside?null:a.jsx(u4,{...r,...s,ref:t})});G7.displayName=b4;function Z7(e,t){const n=Math.abs(t.top-e.y),s=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,s,r,i)){case i:return"left";case r:return"right";case n:return"top";case s:return"bottom";default:throw new Error("unreachable")}}function Q7(e,t,n=5){const s=[];switch(t){case"top":s.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":s.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":s.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":s.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return s}function K7(e){const{top:t,right:n,bottom:s,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:s},{x:r,y:s}]}function J7(e,t){const{x:n,y:s}=e;let r=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const l=t[i],c=t[o],u=l.x,h=l.y,d=c.x,f=c.y;h>s!=f>s&&n<(d-u)*(s-h)/(f-h)+u&&(r=!r)}return r}function e9(e){const t=e.slice();return t.sort((n,s)=>n.x<s.x?-1:n.x>s.x?1:n.y<s.y?-1:n.y>s.y?1:0),t9(t)}function t9(e){if(e.length<=1)return e.slice();const t=[];for(let s=0;s<e.length;s++){const r=e[s];for(;t.length>=2;){const i=t[t.length-1],o=t[t.length-2];if((i.x-o.x)*(r.y-o.y)>=(i.y-o.y)*(r.x-o.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let s=e.length-1;s>=0;s--){const r=e[s];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(r.y-o.y)>=(i.y-o.y)*(r.x-o.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var n9=m4,s9=x4,a9=g4,y4=p4;const Dm=n9,_m=s9,Am=a9,pu=m.forwardRef(({className:e,sideOffset:t=4,...n},s)=>a.jsx(y4,{ref:s,sideOffset:t,className:$e("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));pu.displayName=y4.displayName;const r9=320,i9=32,o9=e=>({core:"text-slate-300",organization:"text-blue-300",teams:"text-green-300",twoFactor:"text-purple-300",apiKey:"text-orange-300",passkey:"text-pink-300"})[e]||"text-gray-300",Sg=({data:e,targetPosition:t,sourcePosition:n})=>{const s=e,[r,i]=m.useState(!1),[o,l]=m.useState(!1),c="!h-2 !w-2 !min-w-0 !min-h-0 !cursor-grab !border-0 opacity-0 hover:opacity-100 transition-opacity",u=o9(s.plugin||"core");return s.isForeign?a.jsx("div",{className:"relative",children:a.jsxs("div",{className:"text-xs px-3 py-2 border border-gray-600 bg-gray-800 text-gray-200 flex gap-2 items-center rounded-md shadow-lg",id:`${s.name}-foreign-key`,children:[a.jsx(Nt,{size:12,className:"text-gray-400"}),a.jsx("span",{className:"font-medium",children:s.displayName||s.name}),t&&a.jsx(Gr,{type:"target",id:s.name,position:t,className:$e(c)})]})}):a.jsx("div",{className:"relative",children:a.jsxs("div",{className:$e("border border-gray-700 overflow-hidden shadow-xl bg-gray-900 rounded-lg","hover:border-gray-600 transition-colors duration-200"),style:{width:r9},id:`${s.name}-schema-node`,children:[a.jsxs("div",{className:$e("px-4 py-3 bg-black border-b border-gray-700 flex items-center justify-between","cursor-pointer select-none"),onClick:()=>i(!r),children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Nt,{size:16,className:"text-white"}),a.jsx("span",{className:"text-white font-semibold text-sm",children:s.displayName||s.name})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("button",{onClick:h=>{h.stopPropagation(),l(!o)},className:"p-1 hover:bg-gray-800 rounded transition-colors",children:o?a.jsx(_S,{size:12,className:"text-gray-400"}):a.jsx(Xo,{size:12,className:"text-gray-400"})}),r?a.jsx(Jp,{size:14,className:"text-gray-400"}):a.jsx(of,{size:14,className:"text-gray-400"})]})]}),!r&&a.jsx("div",{className:"max-h-96 bg-black overflow-y-auto",children:s.columns.map(h=>a.jsxs("div",{className:$e("relative flex items-center overflow-x-hidden px-4 py-2 text-xs","bg-black/30 hover:bg-black/40 transition-colors duration-150","border-b border-white/20 last:border-b-0"),style:{minHeight:i9},children:[a.jsxs("div",{className:"flex items-center gap-1 mr-3 min-w-[40px]",children:[h.isPrimary&&a.jsx(Dm,{delayDuration:100,children:a.jsxs(_m,{children:[a.jsx(Am,{asChild:!0,children:a.jsx(co,{size:10,className:"text-yellow-400 flex-shrink-0"})}),a.jsx(pu,{className:"bg-black border-gray-600 text-white text-xs",children:"Primary Key"})]})}),h.isUnique&&!h.isPrimary&&a.jsx(Dm,{delayDuration:100,children:a.jsxs(_m,{children:[a.jsx(Am,{asChild:!0,children:a.jsx(sR,{size:10,className:"text-green-400 flex-shrink-0"})}),a.jsx(pu,{className:"bg-black border-gray-600 text-white text-xs",children:"Unique"})]})}),h.isIdentity&&a.jsx(Dm,{delayDuration:100,children:a.jsxs(_m,{children:[a.jsx(Am,{asChild:!0,children:a.jsx(rR,{size:10,className:"text-blue-400 flex-shrink-0"})}),a.jsx(pu,{className:"bg-black border-gray-600 text-white text-xs",children:"Identity"})]})})]}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[!h.isNullable&&a.jsx("span",{className:"text-red-400 text-xs",children:"*"}),a.jsx("span",{className:"text-white font-medium truncate",children:h.name}),a.jsx("span",{className:"text-gray-400 font-mono text-xs",children:h.format})]}),o&&h.description&&a.jsx("div",{className:"text-gray-500 text-xs mt-1 truncate",children:h.description})]}),a.jsx("div",{className:"ml-2",children:a.jsx("span",{className:$e("px-2 py-1 rounded text-xs font-medium",u),children:h.plugin})}),a.jsx(Gr,{type:"target",id:h.id,position:t||"left",className:$e(c,"!left-[-8px] !top-1/2 !transform !-translate-y-1/2"),style:{background:"#1f2937",border:"2px solid #374151",left:"-8px",top:"50%",transform:"translateY(-50%)",boxShadow:"0 0 0 2px rgba(0, 0, 0, 0.3)"}}),a.jsx(Gr,{type:"source",id:h.id,position:n||"right",className:$e(c,"!right-[-8px] !top-1/2 !transform !-translate-y-1/2"),style:{background:"#1f2937",border:"2px solid #374151",right:"-8px",top:"50%",transform:"translateY(-50%)",boxShadow:"0 0 0 2px rgba(0, 0, 0, 0.3)"}})]},h.id))}),s.relationships&&s.relationships.length>0&&a.jsx("div",{className:"px-4 py-2 bg-gray-800 border-t border-gray-700",children:a.jsxs("span",{className:"text-xs text-gray-400",children:[s.relationships.length," relationship",s.relationships.length!==1?"s":""]})})]})})},l9={id:"demo-user-table",name:"user",displayName:"User",isForeign:!1,plugin:"core",columns:[{id:"user-id",isPrimary:!0,isNullable:!1,isUnique:!0,isIdentity:!1,name:"id",format:"string",plugin:"core",description:"Unique user identifier"},{id:"user-name",isPrimary:!1,isNullable:!1,isUnique:!1,isIdentity:!1,name:"name",format:"string",plugin:"core",description:"User display name"},{id:"user-email",isPrimary:!1,isNullable:!1,isUnique:!0,isIdentity:!1,name:"email",format:"string",plugin:"core",description:"User email address"},{id:"user-emailVerified",isPrimary:!1,isNullable:!1,isUnique:!1,isIdentity:!1,name:"emailVerified",format:"boolean",plugin:"core",description:"Email verification status"},{id:"user-image",isPrimary:!1,isNullable:!0,isUnique:!1,isIdentity:!1,name:"image",format:"string",plugin:"core",description:"User profile image URL"},{id:"user-createdAt",isPrimary:!1,isNullable:!1,isUnique:!1,isIdentity:!1,name:"createdAt",format:"date",plugin:"core",description:"Account creation timestamp"}],relationships:[{type:"one-to-many",target:"session",field:"userId"},{type:"one-to-many",target:"account",field:"userId"}]},c9={id:"demo-organization-table",name:"organization",displayName:"Organization",isForeign:!1,plugin:"organization",columns:[{id:"org-id",isPrimary:!0,isNullable:!1,isUnique:!0,isIdentity:!1,name:"id",format:"string",plugin:"organization",description:"Unique organization identifier"},{id:"org-name",isPrimary:!1,isNullable:!1,isUnique:!1,isIdentity:!1,name:"name",format:"string",plugin:"organization",description:"Organization name"},{id:"org-slug",isPrimary:!1,isNullable:!1,isUnique:!0,isIdentity:!1,name:"slug",format:"string",plugin:"organization",description:"Organization URL slug"}],relationships:[{type:"one-to-many",target:"member",field:"organizationId"}]};function d9(){return a.jsx("div",{className:"min-h-screen bg-black p-8",children:a.jsxs("div",{className:"max-w-6xl mx-auto",children:[a.jsxs("div",{className:"mb-8",children:[a.jsx("h1",{className:"text-3xl font-light text-white mb-4",children:"Database Schema Node Demo"}),a.jsx("p",{className:"text-gray-400",children:"Enhanced database schema nodes with dark mode theming, collapsible views, and detailed tooltips."})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-xl text-white mb-4",children:"Core User Table"}),a.jsx(Sg,{data:l9,targetPosition:"left",sourcePosition:"right"})]}),a.jsxs("div",{children:[a.jsx("h2",{className:"text-xl text-white mb-4",children:"Organization Plugin Table"}),a.jsx(Sg,{data:c9,targetPosition:"left",sourcePosition:"right"})]})]}),a.jsxs("div",{className:"mt-12 p-6 bg-gray-900 rounded-lg border border-gray-700",children:[a.jsx("h3",{className:"text-lg text-white mb-4",children:"Features"}),a.jsxs("ul",{className:"space-y-2 text-gray-300",children:[a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Dark Mode Optimized:"})," Designed specifically for dark themes"]}),a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Collapsible Views:"})," Click the header to collapse/expand table contents"]}),a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Detail Toggle:"})," Show/hide column descriptions with the eye icon"]}),a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Plugin Badges:"})," Color-coded plugin indicators"]}),a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Interactive Icons:"})," Hover tooltips for primary keys, unique constraints, etc."]}),a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Relationship Counter:"})," Shows number of relationships in footer"]}),a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Connection Handles:"})," Invisible handles for React Flow connections"]})]})]})]})})}const w4=m.createContext(void 0);function u9({children:e}){const[t,n]=m.useState({users:0,organizations:0,sessions:0,teams:0}),[s,r]=m.useState(!0),i=m.useCallback(async()=>{try{const c=await(await fetch("/api/counts")).json();n(c)}catch{}finally{r(!1)}},[]),o=m.useCallback(async()=>{r(!0),await i()},[i]);return m.useEffect(()=>{i()},[i]),a.jsx(w4.Provider,{value:{counts:t,loading:s,refetchCounts:o},children:e})}function vf(){const e=m.useContext(w4);if(e===void 0)throw new Error("useCounts must be used within a CountsProvider");return e}function j4(e,t){const n=m.useRef(null),s=m.useRef(null),r=m.useRef(0),i=m.useRef(!1),o=m.useRef(e),l=m.useRef(t==null?void 0:t.onStatusChange),c=(t==null?void 0:t.maxReconnectAttempts)??5;m.useEffect(()=>{o.current=e},[e]),m.useEffect(()=>{l.current=t==null?void 0:t.onStatusChange},[t==null?void 0:t.onStatusChange]),m.useEffect(()=>{let u=!1;const h=()=>{var d;try{(d=l.current)==null||d.call(l,"connecting");const x=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`;n.current=new WebSocket(x),n.current.onopen=()=>{var y;r.current=0,i.current=!0,(y=l.current)==null||y.call(l,"open"),s.current&&(clearTimeout(s.current),s.current=null)},n.current.onmessage=y=>{try{const v=JSON.parse(y.data);o.current&&o.current(v)}catch{}},n.current.onclose=y=>{var v,j,g,b;if(!u){if(!i.current&&(y.code===1006||y.code===1001)){(v=l.current)==null||v.call(l,"unavailable");return}if((j=l.current)==null||j.call(l,"closed"),r.current<c){r.current++;const p=Math.min(1e3*2**r.current,1e4);(g=l.current)==null||g.call(l,"reconnecting"),s.current=setTimeout(()=>{h()},p)}else(b=l.current)==null||b.call(l,"unavailable")}},n.current.onerror=y=>{var v;(v=l.current)==null||v.call(l,"error")}}catch{}};return h(),()=>{u=!0,n.current&&n.current.close(),s.current&&clearTimeout(s.current)}},[c])}var Ly=1,h9=.9,f9=.8,m9=.17,Om=.1,zm=.999,x9=.9999,g9=.99,p9=/[\\\/_+.#"@\[\(\{&]/,v9=/[\\\/_+.#"@\[\(\{&]/g,b9=/[\s-]/,N4=/[\s-]/g;function Cg(e,t,n,s,r,i,o){if(i===t.length)return r===e.length?Ly:g9;var l=`${r},${i}`;if(o[l]!==void 0)return o[l];for(var c=s.charAt(i),u=n.indexOf(c,r),h=0,d,f,x,y;u>=0;)d=Cg(e,t,n,s,u+1,i+1,o),d>h&&(u===r?d*=Ly:p9.test(e.charAt(u-1))?(d*=f9,x=e.slice(r,u-1).match(v9),x&&r>0&&(d*=Math.pow(zm,x.length))):b9.test(e.charAt(u-1))?(d*=h9,y=e.slice(r,u-1).match(N4),y&&r>0&&(d*=Math.pow(zm,y.length))):(d*=m9,r>0&&(d*=Math.pow(zm,u-r))),e.charAt(u)!==t.charAt(i)&&(d*=x9)),(d<Om&&n.charAt(u-1)===s.charAt(i+1)||s.charAt(i+1)===s.charAt(i)&&n.charAt(u-1)!==s.charAt(i))&&(f=Cg(e,t,n,s,u+1,i+2,o),f*Om>d&&(d=f*Om)),d>h&&(h=d),u=n.indexOf(c,u+1);return o[l]=h,h}function Hy(e){return e.toLowerCase().replace(N4," ")}function y9(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Cg(e,t,Hy(e),Hy(t),0,0,{})}var Rm="focusScope.autoFocusOnMount",Um="focusScope.autoFocusOnUnmount",By={bubbles:!1,cancelable:!0},w9="FocusScope",g0=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:s=!1,onMountAutoFocus:r,onUnmountAutoFocus:i,...o}=e,[l,c]=m.useState(null),u=zo(r),h=zo(i),d=m.useRef(null),f=Fn(t,v=>c(v)),x=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(s){let v=function(p){if(x.paused||!l)return;const w=p.target;l.contains(w)?d.current=w:Ha(d.current,{select:!0})},j=function(p){if(x.paused||!l)return;const w=p.relatedTarget;w!==null&&(l.contains(w)||Ha(d.current,{select:!0}))},g=function(p){if(document.activeElement===document.body)for(const N of p)N.removedNodes.length>0&&Ha(l)};document.addEventListener("focusin",v),document.addEventListener("focusout",j);const b=new MutationObserver(g);return l&&b.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",j),b.disconnect()}}},[s,l,x.paused]),m.useEffect(()=>{if(l){Yy.add(x);const v=document.activeElement;if(!l.contains(v)){const g=new CustomEvent(Rm,By);l.addEventListener(Rm,u),l.dispatchEvent(g),g.defaultPrevented||(j9(k9(S4(l)),{select:!0}),document.activeElement===v&&Ha(l))}return()=>{l.removeEventListener(Rm,u),setTimeout(()=>{const g=new CustomEvent(Um,By);l.addEventListener(Um,h),l.dispatchEvent(g),g.defaultPrevented||Ha(v??document.body,{select:!0}),l.removeEventListener(Um,h),Yy.remove(x)},0)}}},[l,u,h,x]);const y=m.useCallback(v=>{if(!n&&!s||x.paused)return;const j=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,g=document.activeElement;if(j&&g){const b=v.currentTarget,[p,w]=N9(b);p&&w?!v.shiftKey&&g===w?(v.preventDefault(),n&&Ha(p,{select:!0})):v.shiftKey&&g===p&&(v.preventDefault(),n&&Ha(w,{select:!0})):g===b&&v.preventDefault()}},[n,s,x.paused]);return a.jsx(ln.div,{tabIndex:-1,...o,ref:f,onKeyDown:y})});g0.displayName=w9;function j9(e,{select:t=!1}={}){const n=document.activeElement;for(const s of e)if(Ha(s,{select:t}),document.activeElement!==n)return}function N9(e){const t=S4(e),n=Vy(t,e),s=Vy(t.reverse(),e);return[n,s]}function S4(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const r=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||r?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Vy(e,t){for(const n of e)if(!S9(n,{upTo:t}))return n}function S9(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function C9(e){return e instanceof HTMLInputElement&&"select"in e}function Ha(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&C9(e)&&t&&e.select()}}var Yy=E9();function E9(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Fy(e,t),e.unshift(t)},remove(t){var n;e=Fy(e,t),(n=e[0])==null||n.resume()}}}function Fy(e,t){const n=[...e],s=n.indexOf(t);return s!==-1&&n.splice(s,1),n}function k9(e){return e.filter(t=>t.tagName!=="A")}var $m=0;function C4(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Iy()),document.body.insertAdjacentElement("beforeend",e[1]??Iy()),$m++,()=>{$m===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),$m--}},[])}function Iy(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var zs=function(){return zs=Object.assign||function(t){for(var n,s=1,r=arguments.length;s<r;s++){n=arguments[s];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},zs.apply(this,arguments)};function E4(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(e);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(e,s[r])&&(n[s[r]]=e[s[r]]);return n}function M9(e,t,n){if(n||arguments.length===2)for(var s=0,r=t.length,i;s<r;s++)(i||!(s in t))&&(i||(i=Array.prototype.slice.call(t,0,s)),i[s]=t[s]);return e.concat(i||Array.prototype.slice.call(t))}var vu="right-scroll-bar-position",bu="width-before-scroll-bar",T9="with-scroll-bars-hidden",D9="--removed-body-scroll-bar-size";function Pm(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function _9(e,t){var n=m.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(s){var r=n.value;r!==s&&(n.value=s,n.callback(s,r))}}}})[0];return n.callback=t,n.facade}var A9=typeof window<"u"?m.useLayoutEffect:m.useEffect,Wy=new WeakMap;function O9(e,t){var n=_9(null,function(s){return e.forEach(function(r){return Pm(r,s)})});return A9(function(){var s=Wy.get(n);if(s){var r=new Set(s),i=new Set(e),o=n.current;r.forEach(function(l){i.has(l)||Pm(l,null)}),i.forEach(function(l){r.has(l)||Pm(l,o)})}Wy.set(n,e)},[e]),n}function z9(e){return e}function R9(e,t){t===void 0&&(t=z9);var n=[],s=!1,r={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var o=t(i,s);return n.push(o),function(){n=n.filter(function(l){return l!==o})}},assignSyncMedium:function(i){for(s=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){s=!0;var o=[];if(n.length){var l=n;n=[],l.forEach(i),o=n}var c=function(){var h=o;o=[],h.forEach(i)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(h){o.push(h),u()},filter:function(h){return o=o.filter(h),n}}}};return r}function U9(e){e===void 0&&(e={});var t=R9(null);return t.options=zs({async:!0,ssr:!1},e),t}var k4=function(e){var t=e.sideCar,n=E4(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=t.read();if(!s)throw new Error("Sidecar medium not found");return m.createElement(s,zs({},n))};k4.isSideCarExport=!0;function $9(e,t){return e.useMedium(t),k4}var M4=U9(),Lm=function(){},bf=m.forwardRef(function(e,t){var n=m.useRef(null),s=m.useState({onScrollCapture:Lm,onWheelCapture:Lm,onTouchMoveCapture:Lm}),r=s[0],i=s[1],o=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,h=e.enabled,d=e.shards,f=e.sideCar,x=e.noRelative,y=e.noIsolation,v=e.inert,j=e.allowPinchZoom,g=e.as,b=g===void 0?"div":g,p=e.gapMode,w=E4(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=f,S=O9([n,t]),C=zs(zs({},w),r);return m.createElement(m.Fragment,null,h&&m.createElement(N,{sideCar:M4,removeScrollBar:u,shards:d,noRelative:x,noIsolation:y,inert:v,setCallbacks:i,allowPinchZoom:!!j,lockRef:n,gapMode:p}),o?m.cloneElement(m.Children.only(l),zs(zs({},C),{ref:S})):m.createElement(b,zs({},C,{className:c,ref:S}),l))});bf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};bf.classNames={fullWidth:bu,zeroRight:vu};var P9=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function L9(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=P9();return t&&e.setAttribute("nonce",t),e}function H9(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function B9(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var V9=function(){var e=0,t=null;return{add:function(n){e==0&&(t=L9())&&(H9(t,n),B9(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Y9=function(){var e=V9();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},T4=function(){var e=Y9(),t=function(n){var s=n.styles,r=n.dynamic;return e(s,r),null};return t},F9={left:0,top:0,right:0,gap:0},Hm=function(e){return parseInt(e||"",10)||0},I9=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],s=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[Hm(n),Hm(s),Hm(r)]},W9=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return F9;var t=I9(e),n=document.documentElement.clientWidth,s=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,s-n+t[2]-t[0])}},q9=T4(),mo="data-scroll-locked",X9=function(e,t,n,s){var r=e.left,i=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),`
394
+ .`.concat(T9,` {
390
395
  overflow: hidden `).concat(s,`;
391
396
  padding-right: `).concat(l,"px ").concat(s,`;
392
397
  }
@@ -420,16 +425,16 @@ Error generating stack: `+n.message+`
420
425
  }
421
426
 
422
427
  body[`).concat(mo,`] {
423
- `).concat(T9,": ").concat(l,`px;
428
+ `).concat(D9,": ").concat(l,`px;
424
429
  }
425
- `)},qy=function(){var e=parseInt(document.body.getAttribute(mo)||"0",10);return isFinite(e)?e:0},X9=function(){m.useEffect(function(){return document.body.setAttribute(mo,(qy()+1).toString()),function(){var e=qy()-1;e<=0?document.body.removeAttribute(mo):document.body.setAttribute(mo,e.toString())}},[])},G9=function(e){var t=e.noRelative,n=e.noImportant,s=e.gapMode,r=s===void 0?"margin":s;X9();var i=m.useMemo(function(){return I9(r)},[r]);return m.createElement(W9,{styles:q9(i,!t,r,n?"":"!important")})},Eg=!1;if(typeof window<"u")try{var Yd=Object.defineProperty({},"passive",{get:function(){return Eg=!0,!0}});window.addEventListener("test",Yd,Yd),window.removeEventListener("test",Yd,Yd)}catch{Eg=!1}var Mi=Eg?{passive:!1}:!1,Z9=function(e){return e.tagName==="TEXTAREA"},D4=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Z9(e)&&n[t]==="visible")},Q9=function(e){return D4(e,"overflowY")},K9=function(e){return D4(e,"overflowX")},Xy=function(e,t){var n=t.ownerDocument,s=t;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var r=_4(e,s);if(r){var i=A4(e,s),o=i[1],l=i[2];if(o>l)return!0}s=s.parentNode}while(s&&s!==n.body);return!1},J9=function(e){var t=e.scrollTop,n=e.scrollHeight,s=e.clientHeight;return[t,n,s]},eU=function(e){var t=e.scrollLeft,n=e.scrollWidth,s=e.clientWidth;return[t,n,s]},_4=function(e,t){return e==="v"?Q9(t):K9(t)},A4=function(e,t){return e==="v"?J9(t):eU(t)},tU=function(e,t){return e==="h"&&t==="rtl"?-1:1},nU=function(e,t,n,s,r){var i=tU(e,window.getComputedStyle(t).direction),o=i*s,l=n.target,c=t.contains(l),u=!1,h=o>0,d=0,f=0;do{if(!l)break;var x=A4(e,l),y=x[0],v=x[1],j=x[2],g=v-j-i*y;(y||g)&&_4(e,l)&&(d+=g,f+=y);var b=l.parentNode;l=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(h&&Math.abs(d)<1||!h&&Math.abs(f)<1)&&(u=!0),u},Fd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Gy=function(e){return[e.deltaX,e.deltaY]},Zy=function(e){return e&&"current"in e?e.current:e},sU=function(e,t){return e[0]===t[0]&&e[1]===t[1]},aU=function(e){return`
430
+ `)},qy=function(){var e=parseInt(document.body.getAttribute(mo)||"0",10);return isFinite(e)?e:0},G9=function(){m.useEffect(function(){return document.body.setAttribute(mo,(qy()+1).toString()),function(){var e=qy()-1;e<=0?document.body.removeAttribute(mo):document.body.setAttribute(mo,e.toString())}},[])},Z9=function(e){var t=e.noRelative,n=e.noImportant,s=e.gapMode,r=s===void 0?"margin":s;G9();var i=m.useMemo(function(){return W9(r)},[r]);return m.createElement(q9,{styles:X9(i,!t,r,n?"":"!important")})},Eg=!1;if(typeof window<"u")try{var Yd=Object.defineProperty({},"passive",{get:function(){return Eg=!0,!0}});window.addEventListener("test",Yd,Yd),window.removeEventListener("test",Yd,Yd)}catch{Eg=!1}var Mi=Eg?{passive:!1}:!1,Q9=function(e){return e.tagName==="TEXTAREA"},D4=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Q9(e)&&n[t]==="visible")},K9=function(e){return D4(e,"overflowY")},J9=function(e){return D4(e,"overflowX")},Xy=function(e,t){var n=t.ownerDocument,s=t;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var r=_4(e,s);if(r){var i=A4(e,s),o=i[1],l=i[2];if(o>l)return!0}s=s.parentNode}while(s&&s!==n.body);return!1},eU=function(e){var t=e.scrollTop,n=e.scrollHeight,s=e.clientHeight;return[t,n,s]},tU=function(e){var t=e.scrollLeft,n=e.scrollWidth,s=e.clientWidth;return[t,n,s]},_4=function(e,t){return e==="v"?K9(t):J9(t)},A4=function(e,t){return e==="v"?eU(t):tU(t)},nU=function(e,t){return e==="h"&&t==="rtl"?-1:1},sU=function(e,t,n,s,r){var i=nU(e,window.getComputedStyle(t).direction),o=i*s,l=n.target,c=t.contains(l),u=!1,h=o>0,d=0,f=0;do{if(!l)break;var x=A4(e,l),y=x[0],v=x[1],j=x[2],g=v-j-i*y;(y||g)&&_4(e,l)&&(d+=g,f+=y);var b=l.parentNode;l=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(h&&Math.abs(d)<1||!h&&Math.abs(f)<1)&&(u=!0),u},Fd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Gy=function(e){return[e.deltaX,e.deltaY]},Zy=function(e){return e&&"current"in e?e.current:e},aU=function(e,t){return e[0]===t[0]&&e[1]===t[1]},rU=function(e){return`
426
431
  .block-interactivity-`.concat(e,` {pointer-events: none;}
427
432
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
428
- `)},rU=0,Ti=[];function iU(e){var t=m.useRef([]),n=m.useRef([0,0]),s=m.useRef(),r=m.useState(rU++)[0],i=m.useState(T4)[0],o=m.useRef(e);m.useEffect(function(){o.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var v=k9([e.lockRef.current],(e.shards||[]).map(Zy),!0).filter(Boolean);return v.forEach(function(j){return j.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),v.forEach(function(j){return j.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var l=m.useCallback(function(v,j){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!o.current.allowPinchZoom;var g=Fd(v),b=n.current,p="deltaX"in v?v.deltaX:b[0]-g[0],w="deltaY"in v?v.deltaY:b[1]-g[1],N,S=v.target,C=Math.abs(p)>Math.abs(w)?"h":"v";if("touches"in v&&C==="h"&&S.type==="range")return!1;var T=Xy(C,S);if(!T)return!0;if(T?N=C:(N=C==="v"?"h":"v",T=Xy(C,S)),!T)return!1;if(!s.current&&"changedTouches"in v&&(p||w)&&(s.current=N),!N)return!0;var O=s.current||N;return nU(O,j,v,O==="h"?p:w)},[]),c=m.useCallback(function(v){var j=v;if(!(!Ti.length||Ti[Ti.length-1]!==i)){var g="deltaY"in j?Gy(j):Fd(j),b=t.current.filter(function(N){return N.name===j.type&&(N.target===j.target||j.target===N.shadowParent)&&sU(N.delta,g)})[0];if(b&&b.should){j.cancelable&&j.preventDefault();return}if(!b){var p=(o.current.shards||[]).map(Zy).filter(Boolean).filter(function(N){return N.contains(j.target)}),w=p.length>0?l(j,p[0]):!o.current.noIsolation;w&&j.cancelable&&j.preventDefault()}}},[]),u=m.useCallback(function(v,j,g,b){var p={name:v,delta:j,target:g,should:b,shadowParent:oU(g)};t.current.push(p),setTimeout(function(){t.current=t.current.filter(function(w){return w!==p})},1)},[]),h=m.useCallback(function(v){n.current=Fd(v),s.current=void 0},[]),d=m.useCallback(function(v){u(v.type,Gy(v),v.target,l(v,e.lockRef.current))},[]),f=m.useCallback(function(v){u(v.type,Fd(v),v.target,l(v,e.lockRef.current))},[]);m.useEffect(function(){return Ti.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",c,Mi),document.addEventListener("touchmove",c,Mi),document.addEventListener("touchstart",h,Mi),function(){Ti=Ti.filter(function(v){return v!==i}),document.removeEventListener("wheel",c,Mi),document.removeEventListener("touchmove",c,Mi),document.removeEventListener("touchstart",h,Mi)}},[]);var x=e.removeScrollBar,y=e.inert;return m.createElement(m.Fragment,null,y?m.createElement(i,{styles:aU(r)}):null,x?m.createElement(G9,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function oU(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const lU=U9(M4,iU);var p0=m.forwardRef(function(e,t){return m.createElement(bf,zs({},e,{ref:t,sideCar:lU}))});p0.classNames=bf.classNames;var cU=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Di=new WeakMap,Id=new WeakMap,Wd={},Bm=0,O4=function(e){return e&&(e.host||O4(e.parentNode))},dU=function(e,t){return t.map(function(n){if(e.contains(n))return n;var s=O4(n);return s&&e.contains(s)?s:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},uU=function(e,t,n,s){var r=dU(t,Array.isArray(e)?e:[e]);Wd[n]||(Wd[n]=new WeakMap);var i=Wd[n],o=[],l=new Set,c=new Set(r),u=function(d){!d||l.has(d)||(l.add(d),u(d.parentNode))};r.forEach(u);var h=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(f){if(l.has(f))h(f);else try{var x=f.getAttribute(s),y=x!==null&&x!=="false",v=(Di.get(f)||0)+1,j=(i.get(f)||0)+1;Di.set(f,v),i.set(f,j),o.push(f),v===1&&y&&Id.set(f,!0),j===1&&f.setAttribute(n,"true"),y||f.setAttribute(s,"true")}catch(g){console.error("aria-hidden: cannot operate on ",f,g)}})};return h(t),l.clear(),Bm++,function(){o.forEach(function(d){var f=Di.get(d)-1,x=i.get(d)-1;Di.set(d,f),i.set(d,x),f||(Id.has(d)||d.removeAttribute(s),Id.delete(d)),x||d.removeAttribute(n)}),Bm--,Bm||(Di=new WeakMap,Di=new WeakMap,Id=new WeakMap,Wd={})}},z4=function(e,t,n){n===void 0&&(n="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),r=cU(e);return r?(s.push.apply(s,Array.from(r.querySelectorAll("[aria-live], script"))),uU(s,r,n,"aria-hidden")):function(){return null}},yf="Dialog",[R4]=lf(yf),[hU,Ns]=R4(yf),U4=e=>{const{__scopeDialog:t,children:n,open:s,defaultOpen:r,onOpenChange:i,modal:o=!0}=e,l=m.useRef(null),c=m.useRef(null),[u,h]=m0({prop:s,defaultProp:r??!1,onChange:i,caller:yf});return a.jsx(hU,{scope:t,triggerRef:l,contentRef:c,contentId:ps(),titleId:ps(),descriptionId:ps(),open:u,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(d=>!d),[h]),modal:o,children:n})};U4.displayName=yf;var $4="DialogTrigger",fU=m.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,r=Ns($4,n),i=Fn(t,r.triggerRef);return a.jsx(ln.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":y0(r.open),...s,ref:i,onClick:Vt(e.onClick,r.onOpenToggle)})});fU.displayName=$4;var v0="DialogPortal",[mU,P4]=R4(v0,{forceMount:void 0}),L4=e=>{const{__scopeDialog:t,forceMount:n,children:s,container:r}=e,i=Ns(v0,t);return a.jsx(mU,{scope:t,forceMount:n,children:m.Children.map(s,o=>a.jsx(bi,{present:n||i.open,children:a.jsx(f0,{asChild:!0,container:r,children:o})}))})};L4.displayName=v0;var ph="DialogOverlay",H4=m.forwardRef((e,t)=>{const n=P4(ph,e.__scopeDialog),{forceMount:s=n.forceMount,...r}=e,i=Ns(ph,e.__scopeDialog);return i.modal?a.jsx(bi,{present:s||i.open,children:a.jsx(gU,{...r,ref:t})}):null});H4.displayName=ph;var xU=s0("DialogOverlay.RemoveScroll"),gU=m.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,r=Ns(ph,n);return a.jsx(p0,{as:xU,allowPinchZoom:!0,shards:[r.contentRef],children:a.jsx(ln.div,{"data-state":y0(r.open),...s,ref:t,style:{pointerEvents:"auto",...s.style}})})}),di="DialogContent",B4=m.forwardRef((e,t)=>{const n=P4(di,e.__scopeDialog),{forceMount:s=n.forceMount,...r}=e,i=Ns(di,e.__scopeDialog);return a.jsx(bi,{present:s||i.open,children:i.modal?a.jsx(pU,{...r,ref:t}):a.jsx(vU,{...r,ref:t})})});B4.displayName=di;var pU=m.forwardRef((e,t)=>{const n=Ns(di,e.__scopeDialog),s=m.useRef(null),r=Fn(t,n.contentRef,s);return m.useEffect(()=>{const i=s.current;if(i)return z4(i)},[]),a.jsx(V4,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Vt(e.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Vt(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&i.preventDefault()}),onFocusOutside:Vt(e.onFocusOutside,i=>i.preventDefault())})}),vU=m.forwardRef((e,t)=>{const n=Ns(di,e.__scopeDialog),s=m.useRef(!1),r=m.useRef(!1);return a.jsx(V4,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(s.current||(l=n.triggerRef.current)==null||l.focus(),i.preventDefault()),s.current=!1,r.current=!1},onInteractOutside:i=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(s.current=!0,i.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const o=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&r.current&&i.preventDefault()}})}),V4=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:s,onOpenAutoFocus:r,onCloseAutoFocus:i,...o}=e,l=Ns(di,n),c=m.useRef(null),u=Fn(t,c);return C4(),a.jsxs(a.Fragment,{children:[a.jsx(g0,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:r,onUnmountAutoFocus:i,children:a.jsx(cf,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":y0(l.open),...o,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(jU,{titleId:l.titleId}),a.jsx(SU,{contentRef:c,descriptionId:l.descriptionId})]})]})}),b0="DialogTitle",bU=m.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,r=Ns(b0,n);return a.jsx(ln.h2,{id:r.titleId,...s,ref:t})});bU.displayName=b0;var Y4="DialogDescription",yU=m.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,r=Ns(Y4,n);return a.jsx(ln.p,{id:r.descriptionId,...s,ref:t})});yU.displayName=Y4;var F4="DialogClose",wU=m.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,r=Ns(F4,n);return a.jsx(ln.button,{type:"button",...s,ref:t,onClick:Vt(e.onClick,()=>r.onOpenChange(!1))})});wU.displayName=F4;function y0(e){return e?"open":"closed"}var I4="DialogTitleWarning",[xV,W4]=IR(I4,{contentName:di,titleName:b0,docsSlug:"dialog"}),jU=({titleId:e})=>{const t=W4(I4),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
433
+ `)},iU=0,Ti=[];function oU(e){var t=m.useRef([]),n=m.useRef([0,0]),s=m.useRef(),r=m.useState(iU++)[0],i=m.useState(T4)[0],o=m.useRef(e);m.useEffect(function(){o.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var v=M9([e.lockRef.current],(e.shards||[]).map(Zy),!0).filter(Boolean);return v.forEach(function(j){return j.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),v.forEach(function(j){return j.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var l=m.useCallback(function(v,j){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!o.current.allowPinchZoom;var g=Fd(v),b=n.current,p="deltaX"in v?v.deltaX:b[0]-g[0],w="deltaY"in v?v.deltaY:b[1]-g[1],N,S=v.target,C=Math.abs(p)>Math.abs(w)?"h":"v";if("touches"in v&&C==="h"&&S.type==="range")return!1;var T=Xy(C,S);if(!T)return!0;if(T?N=C:(N=C==="v"?"h":"v",T=Xy(C,S)),!T)return!1;if(!s.current&&"changedTouches"in v&&(p||w)&&(s.current=N),!N)return!0;var O=s.current||N;return sU(O,j,v,O==="h"?p:w)},[]),c=m.useCallback(function(v){var j=v;if(!(!Ti.length||Ti[Ti.length-1]!==i)){var g="deltaY"in j?Gy(j):Fd(j),b=t.current.filter(function(N){return N.name===j.type&&(N.target===j.target||j.target===N.shadowParent)&&aU(N.delta,g)})[0];if(b&&b.should){j.cancelable&&j.preventDefault();return}if(!b){var p=(o.current.shards||[]).map(Zy).filter(Boolean).filter(function(N){return N.contains(j.target)}),w=p.length>0?l(j,p[0]):!o.current.noIsolation;w&&j.cancelable&&j.preventDefault()}}},[]),u=m.useCallback(function(v,j,g,b){var p={name:v,delta:j,target:g,should:b,shadowParent:lU(g)};t.current.push(p),setTimeout(function(){t.current=t.current.filter(function(w){return w!==p})},1)},[]),h=m.useCallback(function(v){n.current=Fd(v),s.current=void 0},[]),d=m.useCallback(function(v){u(v.type,Gy(v),v.target,l(v,e.lockRef.current))},[]),f=m.useCallback(function(v){u(v.type,Fd(v),v.target,l(v,e.lockRef.current))},[]);m.useEffect(function(){return Ti.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",c,Mi),document.addEventListener("touchmove",c,Mi),document.addEventListener("touchstart",h,Mi),function(){Ti=Ti.filter(function(v){return v!==i}),document.removeEventListener("wheel",c,Mi),document.removeEventListener("touchmove",c,Mi),document.removeEventListener("touchstart",h,Mi)}},[]);var x=e.removeScrollBar,y=e.inert;return m.createElement(m.Fragment,null,y?m.createElement(i,{styles:rU(r)}):null,x?m.createElement(Z9,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function lU(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const cU=$9(M4,oU);var p0=m.forwardRef(function(e,t){return m.createElement(bf,zs({},e,{ref:t,sideCar:cU}))});p0.classNames=bf.classNames;var dU=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Di=new WeakMap,Id=new WeakMap,Wd={},Bm=0,O4=function(e){return e&&(e.host||O4(e.parentNode))},uU=function(e,t){return t.map(function(n){if(e.contains(n))return n;var s=O4(n);return s&&e.contains(s)?s:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},hU=function(e,t,n,s){var r=uU(t,Array.isArray(e)?e:[e]);Wd[n]||(Wd[n]=new WeakMap);var i=Wd[n],o=[],l=new Set,c=new Set(r),u=function(d){!d||l.has(d)||(l.add(d),u(d.parentNode))};r.forEach(u);var h=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(f){if(l.has(f))h(f);else try{var x=f.getAttribute(s),y=x!==null&&x!=="false",v=(Di.get(f)||0)+1,j=(i.get(f)||0)+1;Di.set(f,v),i.set(f,j),o.push(f),v===1&&y&&Id.set(f,!0),j===1&&f.setAttribute(n,"true"),y||f.setAttribute(s,"true")}catch(g){console.error("aria-hidden: cannot operate on ",f,g)}})};return h(t),l.clear(),Bm++,function(){o.forEach(function(d){var f=Di.get(d)-1,x=i.get(d)-1;Di.set(d,f),i.set(d,x),f||(Id.has(d)||d.removeAttribute(s),Id.delete(d)),x||d.removeAttribute(n)}),Bm--,Bm||(Di=new WeakMap,Di=new WeakMap,Id=new WeakMap,Wd={})}},z4=function(e,t,n){n===void 0&&(n="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),r=dU(e);return r?(s.push.apply(s,Array.from(r.querySelectorAll("[aria-live], script"))),hU(s,r,n,"aria-hidden")):function(){return null}},yf="Dialog",[R4]=lf(yf),[fU,Ns]=R4(yf),U4=e=>{const{__scopeDialog:t,children:n,open:s,defaultOpen:r,onOpenChange:i,modal:o=!0}=e,l=m.useRef(null),c=m.useRef(null),[u,h]=m0({prop:s,defaultProp:r??!1,onChange:i,caller:yf});return a.jsx(fU,{scope:t,triggerRef:l,contentRef:c,contentId:ps(),titleId:ps(),descriptionId:ps(),open:u,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(d=>!d),[h]),modal:o,children:n})};U4.displayName=yf;var $4="DialogTrigger",mU=m.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,r=Ns($4,n),i=Fn(t,r.triggerRef);return a.jsx(ln.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":y0(r.open),...s,ref:i,onClick:Vt(e.onClick,r.onOpenToggle)})});mU.displayName=$4;var v0="DialogPortal",[xU,P4]=R4(v0,{forceMount:void 0}),L4=e=>{const{__scopeDialog:t,forceMount:n,children:s,container:r}=e,i=Ns(v0,t);return a.jsx(xU,{scope:t,forceMount:n,children:m.Children.map(s,o=>a.jsx(bi,{present:n||i.open,children:a.jsx(f0,{asChild:!0,container:r,children:o})}))})};L4.displayName=v0;var ph="DialogOverlay",H4=m.forwardRef((e,t)=>{const n=P4(ph,e.__scopeDialog),{forceMount:s=n.forceMount,...r}=e,i=Ns(ph,e.__scopeDialog);return i.modal?a.jsx(bi,{present:s||i.open,children:a.jsx(pU,{...r,ref:t})}):null});H4.displayName=ph;var gU=s0("DialogOverlay.RemoveScroll"),pU=m.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,r=Ns(ph,n);return a.jsx(p0,{as:gU,allowPinchZoom:!0,shards:[r.contentRef],children:a.jsx(ln.div,{"data-state":y0(r.open),...s,ref:t,style:{pointerEvents:"auto",...s.style}})})}),di="DialogContent",B4=m.forwardRef((e,t)=>{const n=P4(di,e.__scopeDialog),{forceMount:s=n.forceMount,...r}=e,i=Ns(di,e.__scopeDialog);return a.jsx(bi,{present:s||i.open,children:i.modal?a.jsx(vU,{...r,ref:t}):a.jsx(bU,{...r,ref:t})})});B4.displayName=di;var vU=m.forwardRef((e,t)=>{const n=Ns(di,e.__scopeDialog),s=m.useRef(null),r=Fn(t,n.contentRef,s);return m.useEffect(()=>{const i=s.current;if(i)return z4(i)},[]),a.jsx(V4,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Vt(e.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Vt(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&i.preventDefault()}),onFocusOutside:Vt(e.onFocusOutside,i=>i.preventDefault())})}),bU=m.forwardRef((e,t)=>{const n=Ns(di,e.__scopeDialog),s=m.useRef(!1),r=m.useRef(!1);return a.jsx(V4,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(s.current||(l=n.triggerRef.current)==null||l.focus(),i.preventDefault()),s.current=!1,r.current=!1},onInteractOutside:i=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(s.current=!0,i.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const o=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&r.current&&i.preventDefault()}})}),V4=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:s,onOpenAutoFocus:r,onCloseAutoFocus:i,...o}=e,l=Ns(di,n),c=m.useRef(null),u=Fn(t,c);return C4(),a.jsxs(a.Fragment,{children:[a.jsx(g0,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:r,onUnmountAutoFocus:i,children:a.jsx(cf,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":y0(l.open),...o,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(NU,{titleId:l.titleId}),a.jsx(CU,{contentRef:c,descriptionId:l.descriptionId})]})]})}),b0="DialogTitle",yU=m.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,r=Ns(b0,n);return a.jsx(ln.h2,{id:r.titleId,...s,ref:t})});yU.displayName=b0;var Y4="DialogDescription",wU=m.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,r=Ns(Y4,n);return a.jsx(ln.p,{id:r.descriptionId,...s,ref:t})});wU.displayName=Y4;var F4="DialogClose",jU=m.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,r=Ns(F4,n);return a.jsx(ln.button,{type:"button",...s,ref:t,onClick:Vt(e.onClick,()=>r.onOpenChange(!1))})});jU.displayName=F4;function y0(e){return e?"open":"closed"}var I4="DialogTitleWarning",[gV,W4]=WR(I4,{contentName:di,titleName:b0,docsSlug:"dialog"}),NU=({titleId:e})=>{const t=W4(I4),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
429
434
 
430
435
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
431
436
 
432
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return m.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},NU="DialogDescriptionWarning",SU=({contentRef:e,descriptionId:t})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${W4(NU).contentName}}.`;return m.useEffect(()=>{var i;const r=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(s))},[s,e,t]),null},CU=U4,EU=L4,kU=H4,MU=B4,TU=Symbol.for("react.lazy"),vh=kh[" use ".trim().toString()];function DU(e){return typeof e=="object"&&e!==null&&"then"in e}function q4(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===TU&&"_payload"in e&&DU(e._payload)}function X4(e){const t=AU(e),n=m.forwardRef((s,r)=>{let{children:i,...o}=s;q4(i)&&typeof vh=="function"&&(i=vh(i._payload));const l=m.Children.toArray(i),c=l.find(zU);if(c){const u=c.props.children,h=l.map(d=>d===c?m.Children.count(u)>1?m.Children.only(null):m.isValidElement(u)?u.props.children:null:d);return a.jsx(t,{...o,ref:r,children:m.isValidElement(u)?m.cloneElement(u,void 0,h):null})}return a.jsx(t,{...o,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}var _U=X4("Slot");function AU(e){const t=m.forwardRef((n,s)=>{let{children:r,...i}=n;if(q4(r)&&typeof vh=="function"&&(r=vh(r._payload)),m.isValidElement(r)){const o=UU(r),l=RU(i,r.props);return r.type!==m.Fragment&&(l.ref=s?gr(s,o):o),m.cloneElement(r,l)}return m.Children.count(r)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var OU=Symbol("radix.slottable");function zU(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===OU}function RU(e,t){const n={...t};for(const s in t){const r=e[s],i=t[s];/^on[A-Z]/.test(s)?r&&i?n[s]=(...l)=>{const c=i(...l);return r(...l),c}:r&&(n[s]=r):s==="style"?n[s]={...r,...i}:s==="className"&&(n[s]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function UU(e){var s,r;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var $U=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Sr=$U.reduce((e,t)=>{const n=X4(`Primitive.${t}`),s=m.forwardRef((r,i)=>{const{asChild:o,...l}=r,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{}),vl='[cmdk-group=""]',Vm='[cmdk-group-items=""]',PU='[cmdk-group-heading=""]',G4='[cmdk-item=""]',Qy=`${G4}:not([aria-disabled="true"])`,kg="cmdk-item-select",$i="data-value",LU=(e,t,n)=>b9(e,t,n),Z4=m.createContext(void 0),Kc=()=>m.useContext(Z4),Q4=m.createContext(void 0),w0=()=>m.useContext(Q4),K4=m.createContext(void 0),J4=m.forwardRef((e,t)=>{let n=Pi(()=>{var R,P;return{search:"",value:(P=(R=e.value)!=null?R:e.defaultValue)!=null?P:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),s=Pi(()=>new Set),r=Pi(()=>new Map),i=Pi(()=>new Map),o=Pi(()=>new Set),l=eC(e),{label:c,children:u,value:h,onValueChange:d,filter:f,shouldFilter:x,loop:y,disablePointerSelection:v=!1,vimBindings:j=!0,...g}=e,b=ps(),p=ps(),w=ps(),N=m.useRef(null),S=ZU();ui(()=>{if(h!==void 0){let R=h.trim();n.current.value=R,C.emit()}},[h]),ui(()=>{S(6,Y)},[]);let C=m.useMemo(()=>({subscribe:R=>(o.current.add(R),()=>o.current.delete(R)),snapshot:()=>n.current,setState:(R,P,W)=>{var q,ee,ne,Z;if(!Object.is(n.current[R],P)){if(n.current[R]=P,R==="search")z(),H(),S(1,U);else if(R==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let se=document.getElementById(w);se?se.focus():(q=document.getElementById(b))==null||q.focus()}if(S(7,()=>{var se;n.current.selectedItemId=(se=k())==null?void 0:se.id,C.emit()}),W||S(5,Y),((ee=l.current)==null?void 0:ee.value)!==void 0){let se=P??"";(Z=(ne=l.current).onValueChange)==null||Z.call(ne,se);return}}C.emit()}},emit:()=>{o.current.forEach(R=>R())}}),[]),T=m.useMemo(()=>({value:(R,P,W)=>{var q;P!==((q=i.current.get(R))==null?void 0:q.value)&&(i.current.set(R,{value:P,keywords:W}),n.current.filtered.items.set(R,O(P,W)),S(2,()=>{H(),C.emit()}))},item:(R,P)=>(s.current.add(R),P&&(r.current.has(P)?r.current.get(P).add(R):r.current.set(P,new Set([R]))),S(3,()=>{z(),H(),n.current.value||U(),C.emit()}),()=>{i.current.delete(R),s.current.delete(R),n.current.filtered.items.delete(R);let W=k();S(4,()=>{z(),(W==null?void 0:W.getAttribute("id"))===R&&U(),C.emit()})}),group:R=>(r.current.has(R)||r.current.set(R,new Set),()=>{i.current.delete(R),r.current.delete(R)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:b,inputId:w,labelId:p,listInnerRef:N}),[]);function O(R,P){var W,q;let ee=(q=(W=l.current)==null?void 0:W.filter)!=null?q:LU;return R?ee(R,n.current.search,P):0}function H(){if(!n.current.search||l.current.shouldFilter===!1)return;let R=n.current.filtered.items,P=[];n.current.filtered.groups.forEach(q=>{let ee=r.current.get(q),ne=0;ee.forEach(Z=>{let se=R.get(Z);ne=Math.max(se,ne)}),P.push([q,ne])});let W=N.current;$().sort((q,ee)=>{var ne,Z;let se=q.getAttribute("id"),xe=ee.getAttribute("id");return((ne=R.get(xe))!=null?ne:0)-((Z=R.get(se))!=null?Z:0)}).forEach(q=>{let ee=q.closest(Vm);ee?ee.appendChild(q.parentElement===ee?q:q.closest(`${Vm} > *`)):W.appendChild(q.parentElement===W?q:q.closest(`${Vm} > *`))}),P.sort((q,ee)=>ee[1]-q[1]).forEach(q=>{var ee;let ne=(ee=N.current)==null?void 0:ee.querySelector(`${vl}[${$i}="${encodeURIComponent(q[0])}"]`);ne==null||ne.parentElement.appendChild(ne)})}function U(){let R=$().find(W=>W.getAttribute("aria-disabled")!=="true"),P=R==null?void 0:R.getAttribute($i);C.setState("value",P||void 0)}function z(){var R,P,W,q;if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=s.current.size;return}n.current.filtered.groups=new Set;let ee=0;for(let ne of s.current){let Z=(P=(R=i.current.get(ne))==null?void 0:R.value)!=null?P:"",se=(q=(W=i.current.get(ne))==null?void 0:W.keywords)!=null?q:[],xe=O(Z,se);n.current.filtered.items.set(ne,xe),xe>0&&ee++}for(let[ne,Z]of r.current)for(let se of Z)if(n.current.filtered.items.get(se)>0){n.current.filtered.groups.add(ne);break}n.current.filtered.count=ee}function Y(){var R,P,W;let q=k();q&&(((R=q.parentElement)==null?void 0:R.firstChild)===q&&((W=(P=q.closest(vl))==null?void 0:P.querySelector(PU))==null||W.scrollIntoView({block:"nearest"})),q.scrollIntoView({block:"nearest"}))}function k(){var R;return(R=N.current)==null?void 0:R.querySelector(`${G4}[aria-selected="true"]`)}function $(){var R;return Array.from(((R=N.current)==null?void 0:R.querySelectorAll(Qy))||[])}function M(R){let P=$()[R];P&&C.setState("value",P.getAttribute($i))}function A(R){var P;let W=k(),q=$(),ee=q.findIndex(Z=>Z===W),ne=q[ee+R];(P=l.current)!=null&&P.loop&&(ne=ee+R<0?q[q.length-1]:ee+R===q.length?q[0]:q[ee+R]),ne&&C.setState("value",ne.getAttribute($i))}function E(R){let P=k(),W=P==null?void 0:P.closest(vl),q;for(;W&&!q;)W=R>0?XU(W,vl):GU(W,vl),q=W==null?void 0:W.querySelector(Qy);q?C.setState("value",q.getAttribute($i)):A(R)}let D=()=>M($().length-1),_=R=>{R.preventDefault(),R.metaKey?D():R.altKey?E(1):A(1)},I=R=>{R.preventDefault(),R.metaKey?M(0):R.altKey?E(-1):A(-1)};return m.createElement(Sr.div,{ref:t,tabIndex:-1,...g,"cmdk-root":"",onKeyDown:R=>{var P;(P=g.onKeyDown)==null||P.call(g,R);let W=R.nativeEvent.isComposing||R.keyCode===229;if(!(R.defaultPrevented||W))switch(R.key){case"n":case"j":{j&&R.ctrlKey&&_(R);break}case"ArrowDown":{_(R);break}case"p":case"k":{j&&R.ctrlKey&&I(R);break}case"ArrowUp":{I(R);break}case"Home":{R.preventDefault(),M(0);break}case"End":{R.preventDefault(),D();break}case"Enter":{R.preventDefault();let q=k();if(q){let ee=new Event(kg);q.dispatchEvent(ee)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:T.inputId,id:T.labelId,style:KU},c),wf(e,R=>m.createElement(Q4.Provider,{value:C},m.createElement(Z4.Provider,{value:T},R))))}),HU=m.forwardRef((e,t)=>{var n,s;let r=ps(),i=m.useRef(null),o=m.useContext(K4),l=Kc(),c=eC(e),u=(s=(n=c.current)==null?void 0:n.forceMount)!=null?s:o==null?void 0:o.forceMount;ui(()=>{if(!u)return l.item(r,o==null?void 0:o.id)},[u]);let h=tC(r,i,[e.value,e.children,i],e.keywords),d=w0(),f=yr(S=>S.value&&S.value===h.current),x=yr(S=>u||l.filter()===!1?!0:S.search?S.filtered.items.get(r)>0:!0);m.useEffect(()=>{let S=i.current;if(!(!S||e.disabled))return S.addEventListener(kg,y),()=>S.removeEventListener(kg,y)},[x,e.onSelect,e.disabled]);function y(){var S,C;v(),(C=(S=c.current).onSelect)==null||C.call(S,h.current)}function v(){d.setState("value",h.current,!0)}if(!x)return null;let{disabled:j,value:g,onSelect:b,forceMount:p,keywords:w,...N}=e;return m.createElement(Sr.div,{ref:gr(i,t),...N,id:r,"cmdk-item":"",role:"option","aria-disabled":!!j,"aria-selected":!!f,"data-disabled":!!j,"data-selected":!!f,onPointerMove:j||l.getDisablePointerSelection()?void 0:v,onClick:j?void 0:y},e.children)}),BU=m.forwardRef((e,t)=>{let{heading:n,children:s,forceMount:r,...i}=e,o=ps(),l=m.useRef(null),c=m.useRef(null),u=ps(),h=Kc(),d=yr(x=>r||h.filter()===!1?!0:x.search?x.filtered.groups.has(o):!0);ui(()=>h.group(o),[]),tC(o,l,[e.value,e.heading,c]);let f=m.useMemo(()=>({id:o,forceMount:r}),[r]);return m.createElement(Sr.div,{ref:gr(l,t),...i,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&m.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),wf(e,x=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},m.createElement(K4.Provider,{value:f},x))))}),VU=m.forwardRef((e,t)=>{let{alwaysRender:n,...s}=e,r=m.useRef(null),i=yr(o=>!o.search);return!n&&!i?null:m.createElement(Sr.div,{ref:gr(r,t),...s,"cmdk-separator":"",role:"separator"})}),YU=m.forwardRef((e,t)=>{let{onValueChange:n,...s}=e,r=e.value!=null,i=w0(),o=yr(u=>u.search),l=yr(u=>u.selectedItemId),c=Kc();return m.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),m.createElement(Sr.input,{ref:t,...s,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:r?e.value:o,onChange:u=>{r||i.setState("search",u.target.value),n==null||n(u.target.value)}})}),FU=m.forwardRef((e,t)=>{let{children:n,label:s="Suggestions",...r}=e,i=m.useRef(null),o=m.useRef(null),l=yr(u=>u.selectedItemId),c=Kc();return m.useEffect(()=>{if(o.current&&i.current){let u=o.current,h=i.current,d,f=new ResizeObserver(()=>{d=requestAnimationFrame(()=>{let x=u.offsetHeight;h.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return f.observe(u),()=>{cancelAnimationFrame(d),f.unobserve(u)}}},[]),m.createElement(Sr.div,{ref:gr(i,t),...r,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":s,id:c.listId},wf(e,u=>m.createElement("div",{ref:gr(o,c.listInnerRef),"cmdk-list-sizer":""},u)))}),IU=m.forwardRef((e,t)=>{let{open:n,onOpenChange:s,overlayClassName:r,contentClassName:i,container:o,...l}=e;return m.createElement(CU,{open:n,onOpenChange:s},m.createElement(EU,{container:o},m.createElement(kU,{"cmdk-overlay":"",className:r}),m.createElement(MU,{"aria-label":e.label,"cmdk-dialog":"",className:i},m.createElement(J4,{ref:t,...l}))))}),WU=m.forwardRef((e,t)=>yr(n=>n.filtered.count===0)?m.createElement(Sr.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),qU=m.forwardRef((e,t)=>{let{progress:n,children:s,label:r="Loading...",...i}=e;return m.createElement(Sr.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":r},wf(e,o=>m.createElement("div",{"aria-hidden":!0},o)))}),bl=Object.assign(J4,{List:FU,Item:HU,Input:YU,Group:BU,Separator:VU,Dialog:IU,Empty:WU,Loading:qU});function XU(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function GU(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function eC(e){let t=m.useRef(e);return ui(()=>{t.current=e}),t}var ui=typeof window>"u"?m.useEffect:m.useLayoutEffect;function Pi(e){let t=m.useRef();return t.current===void 0&&(t.current=e()),t}function yr(e){let t=w0(),n=()=>e(t.snapshot());return m.useSyncExternalStore(t.subscribe,n,n)}function tC(e,t,n,s=[]){let r=m.useRef(),i=Kc();return ui(()=>{var o;let l=(()=>{var u;for(let h of n){if(typeof h=="string")return h.trim();if(typeof h=="object"&&"current"in h)return h.current?(u=h.current.textContent)==null?void 0:u.trim():r.current}})(),c=s.map(u=>u.trim());i.value(e,l,c),(o=t.current)==null||o.setAttribute($i,l),r.current=l}),r}var ZU=()=>{let[e,t]=m.useState(),n=Pi(()=>new Map);return ui(()=>{n.current.forEach(s=>s()),n.current=new Map},[e]),(s,r)=>{n.current.set(s,r),t({})}};function QU(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function wf({asChild:e,children:t},n){return e&&m.isValidElement(t)?m.cloneElement(QU(t),{ref:t.ref},n(t.props.children)):n(t)}var KU={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function JU({isOpen:e,onClose:t}){const n=ws(),[s,r]=m.useState(""),[i,o]=m.useState(null);m.useEffect(()=>{(async()=>{try{const x=await(await fetch("/api/plugins")).json();o(x)}catch{}})()},[]);const l=d=>i!=null&&i.plugins?i.plugins.some(f=>f.id===d):!1,h=[{id:"users",title:"Users",description:"Manage users and their accounts",icon:li,action:()=>n("/users"),category:"Navigation",keywords:["user","account","profile"]},{id:"organizations",title:"Organizations",description:"Manage organizations and teams",icon:_s,action:()=>n("/organizations"),category:"Navigation",keywords:["org","company","team"],requiresPlugin:"organization",disabled:!l("organization"),disabledMessage:"Enable organization plugin in settings"},{id:"sessions",title:"Sessions",description:"View active user sessions",icon:py,action:()=>n("/sessions"),category:"Navigation",keywords:["session","login","active"]},{id:"tools",title:"Tools",description:"View tools and utilities",icon:AS,action:()=>n("/tools"),category:"Navigation",keywords:["utilities","tools"]},{id:"database",title:"Database",description:"View database and schema",icon:Nt,disabled:!0,action:()=>n("/database"),category:"Navigation",keywords:["database","schema"]},{id:"settings",title:"Settings",description:"Configure Better Auth Studio",icon:uo,action:()=>n("/settings"),category:"Navigation",keywords:["config","setup","preferences"]},{id:"dashboard",title:"Dashboard",description:"View overview and statistics",icon:py,action:()=>n("/"),category:"Navigation",keywords:["overview","stats","home"]},{id:"create-user",title:"Create User",description:"Add a new user to the system",icon:gg,action:()=>n("/users"),category:"Actions",keywords:["add","new","register"]},{id:"create-organization",title:"Create Organization",description:"Create a new organization",icon:ur,action:()=>n("/organizations"),category:"Actions",keywords:["add","new","org"],requiresPlugin:"organization",disabled:!l("organization"),disabledMessage:"Enable organization plugin in settings"},{id:"invite-user",title:"Invite User",description:"Send invitation to join organization",icon:uh,action:()=>n("/organizations"),category:"Actions",keywords:["invite","email","send"],requiresPlugin:"organization",disabled:!l("organization"),disabledMessage:"Enable organization plugin in settings"}].filter(d=>{var x;const f=s.toLowerCase();return d.title.toLowerCase().includes(f)||d.description.toLowerCase().includes(f)||((x=d.keywords)==null?void 0:x.some(y=>y.toLowerCase().includes(f)))}).reduce((d,f)=>(d[f.category]||(d[f.category]=[]),d[f.category].push(f),d),{});return m.useEffect(()=>{const d=f=>{(f.metaKey||f.ctrlKey)&&f.key==="k"&&f.preventDefault()};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[]),m.useEffect(()=>{const d=f=>{f.key==="Escape"&&t()};if(e)return document.body.style.overflow="hidden",document.addEventListener("keydown",d),()=>{document.body.style.overflow="unset",document.removeEventListener("keydown",d)}},[e,t]),e?a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-start justify-center pt-[20vh] z-50 overflow-hidden",onClick:t,children:a.jsx("div",{className:"bg-black/90 overflow-hidden border border-white/10 rounded-none w-full max-w-2xl mx-4",onClick:d=>d.stopPropagation(),children:a.jsxs(bl,{className:"p-2",children:[a.jsxs("div",{className:"flex items-center border-b border-dashed border-white/10 px-3 pb-3",children:[a.jsx(oi,{className:"w-4 h-4 text-gray-400 mr-3"}),a.jsx(bl.Input,{value:s,onValueChange:r,placeholder:"Search for actions, pages, or commands...",className:"flex-1 placeholder:text-xs bg-transparent text-white placeholder-gray-400 outline-none",autoFocus:!0}),a.jsx("kbd",{className:"hidden sm:inline-flex items-center px-2 py-1 text-xs text-gray-400 border border-dashed border-white/20 rounded-sm",children:"ESC"})]}),a.jsx(bl.List,{className:"max-h-96 overflow-y-auto p-2",children:Object.keys(h).length===0?a.jsxs("div",{className:"text-center py-8 text-gray-400",children:[a.jsx(oi,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),a.jsx("p",{children:"No results found"}),a.jsx("p",{className:"text-sm",children:"Try a different search term"})]}):Object.entries(h).map(([d,f])=>a.jsx(bl.Group,{heading:d,className:"text-xs text-gray-400 font-medium mb-4 px-2",children:f.map(x=>{const y=x.icon,v=x.disabled;return a.jsxs(bl.Item,{value:x.id,disabled:v,onSelect:()=>{v||(x.action(),t())},className:`flex items-center space-x-3 px-0 py-2 rounded-none transition-colors relative ${v?"opacity-40 cursor-not-allowed blur-[0.5px]":"hover:bg-white/5 cursor-pointer"}`,children:[a.jsx(y,{className:"w-4 h-4 text-white"}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"text-white text-[13px] font-light flex items-center gap-2",children:[x.title,v&&a.jsx(xu,{className:"w-3 h-3 text-yellow-500"})]}),a.jsx("div",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:v?x.disabledMessage:x.description})]}),!v&&a.jsx(Jz,{className:"w-4 h-4 text-gray-400"})]},x.id)})},d))}),a.jsx("div",{className:"border-t border-dashed border-white/10 px-3 py-2 text-xs text-gray-400",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("span",{children:["Press"," ",a.jsx("kbd",{className:"px-1 py-0.5 border border-dashed border-white/20 rounded-sm",children:"↑↓"})," ","to navigate"]}),a.jsxs("span",{children:["Press"," ",a.jsx("kbd",{className:"px-1 py-0.5 border border-dashed border-white/20 rounded-sm",children:"Enter"})," ","to select"]})]})})]})})}):null}const e$={connecting:{label:"Connecting",textClass:"text-amber-200 border-amber-400/40",dotClass:"bg-amber-300",animate:"animate-pulse"},watching:{label:"Watching",textClass:"text-emerald-200 border-emerald-400/40",dotClass:"bg-emerald-300"},refreshing:{label:"Refreshing",textClass:"text-amber-200 border-amber-400/40",dotClass:"bg-amber-300",animate:"animate-pulse"},up_to_date:{label:"Up-to-date",textClass:"text-emerald-200 border-emerald-400/40",dotClass:"bg-emerald-300"},error:{label:"Reload Failed",textClass:"text-red-200 border-red-500/50",dotClass:"bg-red-400",animate:"animate-pulse"},unavailable:{label:"Watch Off",textClass:"text-gray-300 border-gray-500/40",dotClass:"bg-gray-400"},reconnecting:{label:"Reconnecting",textClass:"text-amber-200 border-amber-400/40",dotClass:"bg-amber-300",animate:"animate-pulse"}};function t$(e){switch(e){case"refreshing":return"refreshing";case"error":return"error";case"up_to_date":case"watching":return"up_to_date";default:return"watching"}}function n$({children:e}){const t=qo(),{counts:n,loading:s}=vf(),r=ws(),[i,o]=m.useState(!1),[l,c]=m.useState("v1.0.0"),[u,h]=m.useState({status:"connecting"}),d=m.useRef(!1),f=m.useRef(null),x=m.useRef(!1),y=()=>{f.current&&(clearTimeout(f.current),f.current=null)},v=()=>{y(),f.current=setTimeout(()=>{d.current=!1,h(w=>({...w,status:"up_to_date",updatedAt:Date.now()}))},4e3)};m.useEffect(()=>{const w=N=>{(N.metaKey||N.ctrlKey)&&N.key==="k"&&(N.preventDefault(),o(!0))};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[]),m.useEffect(()=>((async()=>{var N;try{const C=await(await fetch("/api/config")).json();(N=C.studio)!=null&&N.version&&c(`v${C.studio.version}`)}catch{}})(),()=>{y()}),[]);const j=()=>{d.current=!1,x.current=!1,y(),h(w=>({...w,status:"refreshing",updatedAt:Date.now()})),window.location.reload()};j4(w=>{if(w.type==="studio_status"){const N=t$(w.status);N==="up_to_date"&&(d.current=!1,y()),h(S=>({status:N,fileName:w.fileName||S.fileName,updatedAt:w.updatedAt||Date.now()}));return}if(w.type==="config_change_detected"){d.current=!0,v(),h(N=>({...N,status:"refreshing",fileName:w.fileName||N.fileName,updatedAt:Date.now()})),x.current||(x.current=!0,setTimeout(()=>{j()},200));return}if(w.type==="config_changed"){d.current=!1,y(),h(N=>({...N,status:"up_to_date",fileName:w.fileName||N.fileName,updatedAt:w.changedAt||Date.now()}));return}w.type==="connected"&&(d.current=!1,y(),h(N=>({...N,status:"up_to_date",updatedAt:Date.now()})))},{onStatusChange:w=>{h(N=>{if(N.status==="refreshing"&&w!=="unavailable"&&w!=="open")return N;switch(w){case"connecting":return{...N,status:"connecting"};case"open":return y(),d.current?N:{...N,status:"watching",updatedAt:Date.now()};case"reconnecting":case"closed":return{...N,status:"reconnecting"};case"error":return{...N,status:"error"};case"unavailable":return d.current=!1,y(),{...N,status:"unavailable"};default:return N}})}});const g=e$[u.status],b=w=>w>=1e3?`${(w/1e3).toFixed(1).replace(/\.0$/,"")}k`:w.toString(),p=[{name:"Dashboard",href:"/",icon:iR},{name:"Users",href:"/users",icon:li,badge:s?"...":b(n.users)},{name:"Organizations",href:"/organizations",icon:_s,badge:s?"...":b(n.organizations)},{name:"Database",href:"/database",icon:Nt},{name:"Tools",href:"/tools",icon:AS},{name:"Settings",href:"/settings",icon:uo}];return a.jsxs("div",{className:"min-h-screen bg-black",children:[a.jsx("div",{className:"bg-black/70 border-b border-white/15",children:a.jsxs("div",{className:"flex items-center justify-between px-6 py-4",children:[a.jsx("div",{className:"flex items-center space-x-4",children:a.jsxs("div",{className:"flex items-end justify-end space-x-2",children:[a.jsx("div",{className:"w-7 h-7 border border-dashed border-white/20 rounded-lg flex items-center justify-center",children:a.jsx("span",{className:"text-black font-bold text-md",children:"⚡"})}),a.jsx("div",{className:"mb-0 cursor-pointer",onClick:()=>r("/"),children:a.jsxs("h1",{className:"text-md inline-flex mb-0 items-start font-light font-mono uppercase text-white gap-2",children:["Better-Auth Studio",a.jsxs("sup",{className:"text-xs text-gray-400 ml-1 mt-0 flex items-center space-x-2",children:[a.jsxs("span",{className:"inline-flex items-center",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white/80 lowercase font-mono text-xs",children:l}),a.jsx("span",{className:"ml-1",children:"]"})]}),a.jsxs("span",{className:`inline-flex items-center rounded border px-1.5 py-0.5 font-normal uppercase tracking-wide text-[9px] ${g.textClass} ${g.animate??""}`,children:[a.jsx("span",{className:`mr-1 h-1.5 w-1.5 rounded-full ${g.dotClass}`}),g.label]}),a.jsx("button",{type:"button",onClick:j,"aria-label":"Hard refresh studio",className:"ml-1 inline-flex items-center rounded border border-dashed border-white/20 p-0.5 text-white/70 transition hover:text-white hover:border-white/50",children:a.jsx(xg,{className:"h-3.5 w-3.5"})})]})]})})]})}),a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsxs("div",{className:"relative",children:[a.jsx(oi,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx("input",{type:"text",placeholder:"Search...",onClick:()=>o(!0),className:"pl-10 pr-4 py-2 bg-black border rounded-none border-gray-600 text-white border-dashed border-white/20 focus:ring-2 focus:ring-white focus:border-transparent transition-colors placeholder-gray-400 cursor-pointer",readOnly:!0}),a.jsx("kbd",{className:"absolute right-3 top-1/2 transform -translate-y-1/2 text-xs text-gray-400 border border-dashed border-white/10 rounded-sm px-1.5 py-0.5",children:"⌘ K"})]}),a.jsxs("a",{href:"https://better-auth.com/docs",target:"_blank",rel:"noopener",className:"group flex items-center",children:[a.jsx("span",{className:"text-white/70 text-xs mr-2 transition-colors duration-150 group-hover:text-white group-hover:bg-gray-500/20 rounded px-0.5",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-sm uppercase",children:"Docs"}),a.jsx("span",{className:"text-white/70 text-xs ml-2 transition-colors duration-150 group-hover:text-white group-hover:bg-gray-500/20 rounded px-0.5",children:"]"})]}),a.jsxs("a",{href:"https://better-auth.com/support",target:"_blank",rel:"noopener",className:"group flex items-center",children:[a.jsx("span",{className:"text-white/70 text-xs mr-2 transition-colors duration-150 group-hover:text-white group-hover:bg-gray-500/20 rounded px-0.5",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-sm uppercase",children:"Support"}),a.jsx("span",{className:"text-white/70 text-xs ml-2 transition-colors duration-150 group-hover:text-white group-hover:bg-gray-500/20 rounded px-0.5",children:"]"})]})]})]})}),a.jsx("div",{className:"bg-black/50 border-b border-white/10",children:a.jsx("div",{className:"px-6",children:a.jsx("nav",{className:"flex space-x-8",children:p.map(w=>{const N=t.pathname===w.href;return a.jsxs(Rp,{to:w.href,className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${N?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[a.jsx(w.icon,{className:"w-4 h-4"}),a.jsxs("span",{className:"inline-flex items-start",children:[w.name,w.badge&&a.jsxs("sup",{className:"text-xs text-gray-500 ml-1",children:[a.jsx("span",{className:"mr-0.5",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-xs",children:w.badge}),a.jsx("span",{className:"ml-0.5",children:"]"})]})]})]},w.name)})})})}),a.jsx("div",{className:"flex-1 p-0",children:e}),a.jsx(JU,{isOpen:i,onClose:()=>o(!1)})]})}function bh(e){"@babel/helpers - typeof";return bh=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},bh(e)}function hi(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function fn(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function Zs(e){fn(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||bh(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function s$(e,t){fn(2,arguments);var n=Zs(e).getTime(),s=hi(t);return new Date(n+s)}var a$={};function jf(){return a$}function r$(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function i$(e){return fn(1,arguments),e instanceof Date||bh(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function o$(e){if(fn(1,arguments),!i$(e)&&typeof e!="number")return!1;var t=Zs(e);return!isNaN(Number(t))}function l$(e,t){fn(2,arguments);var n=hi(t);return s$(e,-n)}var c$=864e5;function d$(e){fn(1,arguments);var t=Zs(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var s=t.getTime(),r=n-s;return Math.floor(r/c$)+1}function yh(e){fn(1,arguments);var t=1,n=Zs(e),s=n.getUTCDay(),r=(s<t?7:0)+s-t;return n.setUTCDate(n.getUTCDate()-r),n.setUTCHours(0,0,0,0),n}function nC(e){fn(1,arguments);var t=Zs(e),n=t.getUTCFullYear(),s=new Date(0);s.setUTCFullYear(n+1,0,4),s.setUTCHours(0,0,0,0);var r=yh(s),i=new Date(0);i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0);var o=yh(i);return t.getTime()>=r.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}function u$(e){fn(1,arguments);var t=nC(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var s=yh(n);return s}var h$=6048e5;function f$(e){fn(1,arguments);var t=Zs(e),n=yh(t).getTime()-u$(t).getTime();return Math.round(n/h$)+1}function wh(e,t){var n,s,r,i,o,l,c,u;fn(1,arguments);var h=jf(),d=hi((n=(s=(r=(i=t==null?void 0:t.weekStartsOn)!==null&&i!==void 0?i:t==null||(o=t.locale)===null||o===void 0||(l=o.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&r!==void 0?r:h.weekStartsOn)!==null&&s!==void 0?s:(c=h.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&n!==void 0?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=Zs(e),x=f.getUTCDay(),y=(x<d?7:0)+x-d;return f.setUTCDate(f.getUTCDate()-y),f.setUTCHours(0,0,0,0),f}function sC(e,t){var n,s,r,i,o,l,c,u;fn(1,arguments);var h=Zs(e),d=h.getUTCFullYear(),f=jf(),x=hi((n=(s=(r=(i=t==null?void 0:t.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(o=t.locale)===null||o===void 0||(l=o.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&r!==void 0?r:f.firstWeekContainsDate)!==null&&s!==void 0?s:(c=f.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&n!==void 0?n:1);if(!(x>=1&&x<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var y=new Date(0);y.setUTCFullYear(d+1,0,x),y.setUTCHours(0,0,0,0);var v=wh(y,t),j=new Date(0);j.setUTCFullYear(d,0,x),j.setUTCHours(0,0,0,0);var g=wh(j,t);return h.getTime()>=v.getTime()?d+1:h.getTime()>=g.getTime()?d:d-1}function m$(e,t){var n,s,r,i,o,l,c,u;fn(1,arguments);var h=jf(),d=hi((n=(s=(r=(i=t==null?void 0:t.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(o=t.locale)===null||o===void 0||(l=o.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&r!==void 0?r:h.firstWeekContainsDate)!==null&&s!==void 0?s:(c=h.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&n!==void 0?n:1),f=sC(e,t),x=new Date(0);x.setUTCFullYear(f,0,d),x.setUTCHours(0,0,0,0);var y=wh(x,t);return y}var x$=6048e5;function g$(e,t){fn(1,arguments);var n=Zs(e),s=wh(n,t).getTime()-m$(n,t).getTime();return Math.round(s/x$)+1}function it(e,t){for(var n=e<0?"-":"",s=Math.abs(e).toString();s.length<t;)s="0"+s;return n+s}var $a={y:function(t,n){var s=t.getUTCFullYear(),r=s>0?s:1-s;return it(n==="yy"?r%100:r,n.length)},M:function(t,n){var s=t.getUTCMonth();return n==="M"?String(s+1):it(s+1,2)},d:function(t,n){return it(t.getUTCDate(),n.length)},a:function(t,n){var s=t.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return s.toUpperCase();case"aaa":return s;case"aaaaa":return s[0];case"aaaa":default:return s==="am"?"a.m.":"p.m."}},h:function(t,n){return it(t.getUTCHours()%12||12,n.length)},H:function(t,n){return it(t.getUTCHours(),n.length)},m:function(t,n){return it(t.getUTCMinutes(),n.length)},s:function(t,n){return it(t.getUTCSeconds(),n.length)},S:function(t,n){var s=n.length,r=t.getUTCMilliseconds(),i=Math.floor(r*Math.pow(10,s-3));return it(i,n.length)}},_i={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},p$={G:function(t,n,s){var r=t.getUTCFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return s.era(r,{width:"abbreviated"});case"GGGGG":return s.era(r,{width:"narrow"});case"GGGG":default:return s.era(r,{width:"wide"})}},y:function(t,n,s){if(n==="yo"){var r=t.getUTCFullYear(),i=r>0?r:1-r;return s.ordinalNumber(i,{unit:"year"})}return $a.y(t,n)},Y:function(t,n,s,r){var i=sC(t,r),o=i>0?i:1-i;if(n==="YY"){var l=o%100;return it(l,2)}return n==="Yo"?s.ordinalNumber(o,{unit:"year"}):it(o,n.length)},R:function(t,n){var s=nC(t);return it(s,n.length)},u:function(t,n){var s=t.getUTCFullYear();return it(s,n.length)},Q:function(t,n,s){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"Q":return String(r);case"QQ":return it(r,2);case"Qo":return s.ordinalNumber(r,{unit:"quarter"});case"QQQ":return s.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return s.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,n,s){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"q":return String(r);case"qq":return it(r,2);case"qo":return s.ordinalNumber(r,{unit:"quarter"});case"qqq":return s.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return s.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,n,s){var r=t.getUTCMonth();switch(n){case"M":case"MM":return $a.M(t,n);case"Mo":return s.ordinalNumber(r+1,{unit:"month"});case"MMM":return s.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return s.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(r,{width:"wide",context:"formatting"})}},L:function(t,n,s){var r=t.getUTCMonth();switch(n){case"L":return String(r+1);case"LL":return it(r+1,2);case"Lo":return s.ordinalNumber(r+1,{unit:"month"});case"LLL":return s.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return s.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(r,{width:"wide",context:"standalone"})}},w:function(t,n,s,r){var i=g$(t,r);return n==="wo"?s.ordinalNumber(i,{unit:"week"}):it(i,n.length)},I:function(t,n,s){var r=f$(t);return n==="Io"?s.ordinalNumber(r,{unit:"week"}):it(r,n.length)},d:function(t,n,s){return n==="do"?s.ordinalNumber(t.getUTCDate(),{unit:"date"}):$a.d(t,n)},D:function(t,n,s){var r=d$(t);return n==="Do"?s.ordinalNumber(r,{unit:"dayOfYear"}):it(r,n.length)},E:function(t,n,s){var r=t.getUTCDay();switch(n){case"E":case"EE":case"EEE":return s.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return s.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(r,{width:"short",context:"formatting"});case"EEEE":default:return s.day(r,{width:"wide",context:"formatting"})}},e:function(t,n,s,r){var i=t.getUTCDay(),o=(i-r.weekStartsOn+8)%7||7;switch(n){case"e":return String(o);case"ee":return it(o,2);case"eo":return s.ordinalNumber(o,{unit:"day"});case"eee":return s.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return s.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(i,{width:"short",context:"formatting"});case"eeee":default:return s.day(i,{width:"wide",context:"formatting"})}},c:function(t,n,s,r){var i=t.getUTCDay(),o=(i-r.weekStartsOn+8)%7||7;switch(n){case"c":return String(o);case"cc":return it(o,n.length);case"co":return s.ordinalNumber(o,{unit:"day"});case"ccc":return s.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return s.day(i,{width:"narrow",context:"standalone"});case"cccccc":return s.day(i,{width:"short",context:"standalone"});case"cccc":default:return s.day(i,{width:"wide",context:"standalone"})}},i:function(t,n,s){var r=t.getUTCDay(),i=r===0?7:r;switch(n){case"i":return String(i);case"ii":return it(i,n.length);case"io":return s.ordinalNumber(i,{unit:"day"});case"iii":return s.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return s.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return s.day(r,{width:"short",context:"formatting"});case"iiii":default:return s.day(r,{width:"wide",context:"formatting"})}},a:function(t,n,s){var r=t.getUTCHours(),i=r/12>=1?"pm":"am";switch(n){case"a":case"aa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return s.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,n,s){var r=t.getUTCHours(),i;switch(r===12?i=_i.noon:r===0?i=_i.midnight:i=r/12>=1?"pm":"am",n){case"b":case"bb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return s.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,n,s){var r=t.getUTCHours(),i;switch(r>=17?i=_i.evening:r>=12?i=_i.afternoon:r>=4?i=_i.morning:i=_i.night,n){case"B":case"BB":case"BBB":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return s.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,n,s){if(n==="ho"){var r=t.getUTCHours()%12;return r===0&&(r=12),s.ordinalNumber(r,{unit:"hour"})}return $a.h(t,n)},H:function(t,n,s){return n==="Ho"?s.ordinalNumber(t.getUTCHours(),{unit:"hour"}):$a.H(t,n)},K:function(t,n,s){var r=t.getUTCHours()%12;return n==="Ko"?s.ordinalNumber(r,{unit:"hour"}):it(r,n.length)},k:function(t,n,s){var r=t.getUTCHours();return r===0&&(r=24),n==="ko"?s.ordinalNumber(r,{unit:"hour"}):it(r,n.length)},m:function(t,n,s){return n==="mo"?s.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):$a.m(t,n)},s:function(t,n,s){return n==="so"?s.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):$a.s(t,n)},S:function(t,n){return $a.S(t,n)},X:function(t,n,s,r){var i=r._originalDate||t,o=i.getTimezoneOffset();if(o===0)return"Z";switch(n){case"X":return Jy(o);case"XXXX":case"XX":return Rr(o);case"XXXXX":case"XXX":default:return Rr(o,":")}},x:function(t,n,s,r){var i=r._originalDate||t,o=i.getTimezoneOffset();switch(n){case"x":return Jy(o);case"xxxx":case"xx":return Rr(o);case"xxxxx":case"xxx":default:return Rr(o,":")}},O:function(t,n,s,r){var i=r._originalDate||t,o=i.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+Ky(o,":");case"OOOO":default:return"GMT"+Rr(o,":")}},z:function(t,n,s,r){var i=r._originalDate||t,o=i.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+Ky(o,":");case"zzzz":default:return"GMT"+Rr(o,":")}},t:function(t,n,s,r){var i=r._originalDate||t,o=Math.floor(i.getTime()/1e3);return it(o,n.length)},T:function(t,n,s,r){var i=r._originalDate||t,o=i.getTime();return it(o,n.length)}};function Ky(e,t){var n=e>0?"-":"+",s=Math.abs(e),r=Math.floor(s/60),i=s%60;if(i===0)return n+String(r);var o=t;return n+String(r)+o+it(i,2)}function Jy(e,t){if(e%60===0){var n=e>0?"-":"+";return n+it(Math.abs(e)/60,2)}return Rr(e,t)}function Rr(e,t){var n=t||"",s=e>0?"-":"+",r=Math.abs(e),i=it(Math.floor(r/60),2),o=it(r%60,2);return s+i+n+o}var ew=function(t,n){switch(t){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},aC=function(t,n){switch(t){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},v$=function(t,n){var s=t.match(/(P+)(p+)?/)||[],r=s[1],i=s[2];if(!i)return ew(t,n);var o;switch(r){case"P":o=n.dateTime({width:"short"});break;case"PP":o=n.dateTime({width:"medium"});break;case"PPP":o=n.dateTime({width:"long"});break;case"PPPP":default:o=n.dateTime({width:"full"});break}return o.replace("{{date}}",ew(r,n)).replace("{{time}}",aC(i,n))},b$={p:aC,P:v$},y$=["D","DD"],w$=["YY","YYYY"];function j$(e){return y$.indexOf(e)!==-1}function N$(e){return w$.indexOf(e)!==-1}function tw(e,t,n){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var S$={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},C$=function(t,n,s){var r,i=S$[t];return typeof i=="string"?r=i:n===1?r=i.one:r=i.other.replace("{{count}}",n.toString()),s!=null&&s.addSuffix?s.comparison&&s.comparison>0?"in "+r:r+" ago":r};function Ym(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,s=e.formats[n]||e.formats[e.defaultWidth];return s}}var E$={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},k$={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},M$={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},T$={date:Ym({formats:E$,defaultWidth:"full"}),time:Ym({formats:k$,defaultWidth:"full"}),dateTime:Ym({formats:M$,defaultWidth:"full"})},D$={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},_$=function(t,n,s,r){return D$[t]};function yl(e){return function(t,n){var s=n!=null&&n.context?String(n.context):"standalone",r;if(s==="formatting"&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,o=n!=null&&n.width?String(n.width):i;r=e.formattingValues[o]||e.formattingValues[i]}else{var l=e.defaultWidth,c=n!=null&&n.width?String(n.width):e.defaultWidth;r=e.values[c]||e.values[l]}var u=e.argumentCallback?e.argumentCallback(t):t;return r[u]}}var A$={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},O$={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},z$={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},R$={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},U$={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},$$={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},P$=function(t,n){var s=Number(t),r=s%100;if(r>20||r<10)switch(r%10){case 1:return s+"st";case 2:return s+"nd";case 3:return s+"rd"}return s+"th"},L$={ordinalNumber:P$,era:yl({values:A$,defaultWidth:"wide"}),quarter:yl({values:O$,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:yl({values:z$,defaultWidth:"wide"}),day:yl({values:R$,defaultWidth:"wide"}),dayPeriod:yl({values:U$,defaultWidth:"wide",formattingValues:$$,defaultFormattingWidth:"wide"})};function wl(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=n.width,r=s&&e.matchPatterns[s]||e.matchPatterns[e.defaultMatchWidth],i=t.match(r);if(!i)return null;var o=i[0],l=s&&e.parsePatterns[s]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?B$(l,function(d){return d.test(o)}):H$(l,function(d){return d.test(o)}),u;u=e.valueCallback?e.valueCallback(c):c,u=n.valueCallback?n.valueCallback(u):u;var h=t.slice(o.length);return{value:u,rest:h}}}function H$(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function B$(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}function V$(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=t.match(e.matchPattern);if(!s)return null;var r=s[0],i=t.match(e.parsePattern);if(!i)return null;var o=e.valueCallback?e.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;var l=t.slice(r.length);return{value:o,rest:l}}}var Y$=/^(\d+)(th|st|nd|rd)?/i,F$=/\d+/i,I$={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},W$={any:[/^b/i,/^(a|c)/i]},q$={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},X$={any:[/1/i,/2/i,/3/i,/4/i]},G$={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Z$={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Q$={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},K$={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},J$={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},eP={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},tP={ordinalNumber:V$({matchPattern:Y$,parsePattern:F$,valueCallback:function(t){return parseInt(t,10)}}),era:wl({matchPatterns:I$,defaultMatchWidth:"wide",parsePatterns:W$,defaultParseWidth:"any"}),quarter:wl({matchPatterns:q$,defaultMatchWidth:"wide",parsePatterns:X$,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:wl({matchPatterns:G$,defaultMatchWidth:"wide",parsePatterns:Z$,defaultParseWidth:"any"}),day:wl({matchPatterns:Q$,defaultMatchWidth:"wide",parsePatterns:K$,defaultParseWidth:"any"}),dayPeriod:wl({matchPatterns:J$,defaultMatchWidth:"any",parsePatterns:eP,defaultParseWidth:"any"})},nP={code:"en-US",formatDistance:C$,formatLong:T$,formatRelative:_$,localize:L$,match:tP,options:{weekStartsOn:0,firstWeekContainsDate:1}},sP=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,aP=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,rP=/^'([^]*?)'?$/,iP=/''/g,oP=/[a-zA-Z]/;function Zn(e,t,n){var s,r,i,o,l,c,u,h,d,f,x,y,v,j;fn(2,arguments);var g=String(t),b=jf(),p=(s=(r=void 0)!==null&&r!==void 0?r:b.locale)!==null&&s!==void 0?s:nP,w=hi((i=(o=(l=(c=void 0)!==null&&c!==void 0?c:void 0)!==null&&l!==void 0?l:b.firstWeekContainsDate)!==null&&o!==void 0?o:(u=b.locale)===null||u===void 0||(h=u.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(w>=1&&w<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var N=hi((d=(f=(x=(y=void 0)!==null&&y!==void 0?y:void 0)!==null&&x!==void 0?x:b.weekStartsOn)!==null&&f!==void 0?f:(v=b.locale)===null||v===void 0||(j=v.options)===null||j===void 0?void 0:j.weekStartsOn)!==null&&d!==void 0?d:0);if(!(N>=0&&N<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!p.localize)throw new RangeError("locale must contain localize property");if(!p.formatLong)throw new RangeError("locale must contain formatLong property");var S=Zs(e);if(!o$(S))throw new RangeError("Invalid time value");var C=r$(S),T=l$(S,C),O={firstWeekContainsDate:w,weekStartsOn:N,locale:p,_originalDate:S},H=g.match(aP).map(function(U){var z=U[0];if(z==="p"||z==="P"){var Y=b$[z];return Y(U,p.formatLong)}return U}).join("").match(sP).map(function(U){if(U==="''")return"'";var z=U[0];if(z==="'")return lP(U);var Y=p$[z];if(Y)return N$(U)&&tw(U,t,String(e)),j$(U)&&tw(U,t,String(e)),Y(T,U,p.localize,O);if(z.match(oP))throw new RangeError("Format string contains an unescaped latin alphabet character `"+z+"`");return U}).join("");return H}function lP(e){var t=e.match(rP);return t?t[1].replace(iP,"'"):e}const nw=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,sw=hh,rC=(e,t)=>n=>{var s;if((t==null?void 0:t.variants)==null)return sw(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:r,defaultVariants:i}=t,o=Object.keys(r).map(u=>{const h=n==null?void 0:n[u],d=i==null?void 0:i[u];if(h===null)return null;const f=nw(h)||nw(d);return r[u][f]}),l=n&&Object.entries(n).reduce((u,h)=>{let[d,f]=h;return f===void 0||(u[d]=f),u},{}),c=t==null||(s=t.compoundVariants)===null||s===void 0?void 0:s.reduce((u,h)=>{let{class:d,className:f,...x}=h;return Object.entries(x).every(y=>{let[v,j]=y;return Array.isArray(j)?j.includes({...i,...l}[v]):{...i,...l}[v]===j})?[...u,d,f]:u},[]);return sw(e,o,c,n==null?void 0:n.class,n==null?void 0:n.className)},Mg=rC("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),F=m.forwardRef(({className:e,variant:t,size:n,asChild:s=!1,...r},i)=>{const o=s?_U:"button";return a.jsx(o,{className:$e(Mg({variant:t,size:n,className:e})),ref:i,...r})});F.displayName="Button";function cP(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}const Fm={},Al={};function Lr(e,t){try{const s=(Fm[e]||(Fm[e]=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return s in Al?Al[s]:aw(s,s.split(":"))}catch{if(e in Al)return Al[e];const n=e==null?void 0:e.match(dP);return n?aw(e,n.slice(1)):NaN}}const dP=/([+-]\d\d):?(\d\d)?/;function aw(e,t){const n=+(t[0]||0),s=+(t[1]||0),r=+(t[2]||0)/60;return Al[e]=n*60+s>0?n*60+s+r:n*60-s-r}class $s extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Lr(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),iC(this),Tg(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new $s(...n,t):new $s(Date.now(),t)}withTimeZone(t){return new $s(+this,t)}getTimezoneOffset(){const t=-Lr(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),Tg(this),+this}[Symbol.for("constructDateFrom")](t){return new $s(+new Date(t),this.timeZone)}}const rw=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!rw.test(e))return;const t=e.replace(rw,"$1UTC");$s.prototype[t]&&(e.startsWith("get")?$s.prototype[e]=function(){return this.internal[t]()}:($s.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),uP(this),+this},$s.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Tg(this),+this}))});function Tg(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-Lr(e.timeZone,e)*60))}function uP(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),iC(e)}function iC(e){const t=Lr(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),s=new Date(+e);s.setUTCHours(s.getUTCHours()-1);const r=-new Date(+e).getTimezoneOffset(),i=-new Date(+s).getTimezoneOffset(),o=r-i,l=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();o&&l&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+o);const c=r-n;c&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+c);const u=new Date(+e);u.setUTCSeconds(0);const h=r>0?u.getSeconds():(u.getSeconds()-60)%60,d=Math.round(-(Lr(e.timeZone,e)*60))%60;(d||h)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+d),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+d+h));const f=Lr(e.timeZone,e),x=f>0?Math.floor(f):Math.ceil(f),v=-new Date(+e).getTimezoneOffset()-x,j=x!==n,g=v-c;if(j&&g){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+g);const b=Lr(e.timeZone,e),p=b>0?Math.floor(b):Math.ceil(b),w=x-p;w&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+w),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+w))}}class an extends $s{static tz(t,...n){return n.length?new an(...n,t):new an(Date.now(),t)}toISOString(){const[t,n,s]=this.tzComponents(),r=`${t}${n}:${s}`;return this.internal.toISOString().slice(0,-1)+r}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,s,r]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${s} ${n} ${r}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,s,r]=this.tzComponents();return`${t} GMT${n}${s}${r} (${cP(this.timeZone,this)})`}toLocaleString(t,n){return Date.prototype.toLocaleString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleDateString(t,n){return Date.prototype.toLocaleDateString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleTimeString(t,n){return Date.prototype.toLocaleTimeString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),n=t>0?"-":"+",s=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),r=String(Math.abs(t)%60).padStart(2,"0");return[n,s,r]}withTimeZone(t){return new an(+this,t)}[Symbol.for("constructDateFrom")](t){return new an(+new Date(t),this.timeZone)}}const oC=6048e5,hP=864e5,iw=Symbol.for("constructDateFrom");function $t(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&iw in e?e[iw](t):e instanceof Date?new e.constructor(t):new Date(t)}function ht(e,t){return $t(t||e,e)}function lC(e,t,n){const s=ht(e,n==null?void 0:n.in);return isNaN(t)?$t(e,NaN):(t&&s.setDate(s.getDate()+t),s)}function cC(e,t,n){const s=ht(e,n==null?void 0:n.in);if(isNaN(t))return $t(e,NaN);if(!t)return s;const r=s.getDate(),i=$t(e,s.getTime());i.setMonth(s.getMonth()+t+1,0);const o=i.getDate();return r>=o?i:(s.setFullYear(i.getFullYear(),i.getMonth(),r),s)}let fP={};function Jc(){return fP}function $o(e,t){var l,c,u,h;const n=Jc(),s=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((h=(u=n.locale)==null?void 0:u.options)==null?void 0:h.weekStartsOn)??0,r=ht(e,t==null?void 0:t.in),i=r.getDay(),o=(i<s?7:0)+i-s;return r.setDate(r.getDate()-o),r.setHours(0,0,0,0),r}function Ec(e,t){return $o(e,{...t,weekStartsOn:1})}function dC(e,t){const n=ht(e,t==null?void 0:t.in),s=n.getFullYear(),r=$t(n,0);r.setFullYear(s+1,0,4),r.setHours(0,0,0,0);const i=Ec(r),o=$t(n,0);o.setFullYear(s,0,4),o.setHours(0,0,0,0);const l=Ec(o);return n.getTime()>=i.getTime()?s+1:n.getTime()>=l.getTime()?s:s-1}function ow(e){const t=ht(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Ko(e,...t){const n=$t.bind(null,t.find(s=>typeof s=="object"));return t.map(n)}function kc(e,t){const n=ht(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function uC(e,t,n){const[s,r]=Ko(n==null?void 0:n.in,e,t),i=kc(s),o=kc(r),l=+i-ow(i),c=+o-ow(o);return Math.round((l-c)/hP)}function mP(e,t){const n=dC(e,t),s=$t(e,0);return s.setFullYear(n,0,4),s.setHours(0,0,0,0),Ec(s)}function xP(e,t,n){return lC(e,t*7,n)}function gP(e,t,n){return cC(e,t*12,n)}function pP(e,t){let n,s=t==null?void 0:t.in;return e.forEach(r=>{!s&&typeof r=="object"&&(s=$t.bind(null,r));const i=ht(r,s);(!n||n<i||isNaN(+i))&&(n=i)}),$t(s,n||NaN)}function vP(e,t){let n,s=t==null?void 0:t.in;return e.forEach(r=>{!s&&typeof r=="object"&&(s=$t.bind(null,r));const i=ht(r,s);(!n||n>i||isNaN(+i))&&(n=i)}),$t(s,n||NaN)}function bP(e,t,n){const[s,r]=Ko(n==null?void 0:n.in,e,t);return+kc(s)==+kc(r)}function hC(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function yP(e){return!(!hC(e)&&typeof e!="number"||isNaN(+ht(e)))}function wP(e,t,n){const[s,r]=Ko(n==null?void 0:n.in,e,t),i=s.getFullYear()-r.getFullYear(),o=s.getMonth()-r.getMonth();return i*12+o}function jP(e,t){const n=ht(e,t==null?void 0:t.in),s=n.getMonth();return n.setFullYear(n.getFullYear(),s+1,0),n.setHours(23,59,59,999),n}function fC(e,t){const[n,s]=Ko(e,t.start,t.end);return{start:n,end:s}}function NP(e,t){const{start:n,end:s}=fC(t==null?void 0:t.in,e);let r=+n>+s;const i=r?+n:+s,o=r?s:n;o.setHours(0,0,0,0),o.setDate(1);let l=1;const c=[];for(;+o<=i;)c.push($t(n,o)),o.setMonth(o.getMonth()+l);return r?c.reverse():c}function SP(e,t){const n=ht(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function CP(e,t){const n=ht(e,t==null?void 0:t.in),s=n.getFullYear();return n.setFullYear(s+1,0,0),n.setHours(23,59,59,999),n}function mC(e,t){const n=ht(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function EP(e,t){const{start:n,end:s}=fC(t==null?void 0:t.in,e);let r=+n>+s;const i=r?+n:+s,o=r?s:n;o.setHours(0,0,0,0),o.setMonth(0,1);let l=1;const c=[];for(;+o<=i;)c.push($t(n,o)),o.setFullYear(o.getFullYear()+l);return r?c.reverse():c}function xC(e,t){var l,c,u,h;const n=Jc(),s=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((h=(u=n.locale)==null?void 0:u.options)==null?void 0:h.weekStartsOn)??0,r=ht(e,t==null?void 0:t.in),i=r.getDay(),o=(i<s?-7:0)+6-(i-s);return r.setDate(r.getDate()+o),r.setHours(23,59,59,999),r}function kP(e,t){return xC(e,{...t,weekStartsOn:1})}const MP={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},TP=(e,t,n)=>{let s;const r=MP[e];return typeof r=="string"?s=r:t===1?s=r.one:s=r.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+s:s+" ago":s};function Im(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const DP={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},_P={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},AP={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},OP={date:Im({formats:DP,defaultWidth:"full"}),time:Im({formats:_P,defaultWidth:"full"}),dateTime:Im({formats:AP,defaultWidth:"full"})},zP={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},RP=(e,t,n,s)=>zP[e];function jl(e){return(t,n)=>{const s=n!=null&&n.context?String(n.context):"standalone";let r;if(s==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,l=n!=null&&n.width?String(n.width):o;r=e.formattingValues[l]||e.formattingValues[o]}else{const o=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;r=e.values[l]||e.values[o]}const i=e.argumentCallback?e.argumentCallback(t):t;return r[i]}}const UP={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},$P={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},PP={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},LP={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},HP={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},BP={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},VP=(e,t)=>{const n=Number(e),s=n%100;if(s>20||s<10)switch(s%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},YP={ordinalNumber:VP,era:jl({values:UP,defaultWidth:"wide"}),quarter:jl({values:$P,defaultWidth:"wide",argumentCallback:e=>e-1}),month:jl({values:PP,defaultWidth:"wide"}),day:jl({values:LP,defaultWidth:"wide"}),dayPeriod:jl({values:HP,defaultWidth:"wide",formattingValues:BP,defaultFormattingWidth:"wide"})};function Nl(e){return(t,n={})=>{const s=n.width,r=s&&e.matchPatterns[s]||e.matchPatterns[e.defaultMatchWidth],i=t.match(r);if(!i)return null;const o=i[0],l=s&&e.parsePatterns[s]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?IP(l,d=>d.test(o)):FP(l,d=>d.test(o));let u;u=e.valueCallback?e.valueCallback(c):c,u=n.valueCallback?n.valueCallback(u):u;const h=t.slice(o.length);return{value:u,rest:h}}}function FP(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function IP(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function WP(e){return(t,n={})=>{const s=t.match(e.matchPattern);if(!s)return null;const r=s[0],i=t.match(e.parsePattern);if(!i)return null;let o=e.valueCallback?e.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const l=t.slice(r.length);return{value:o,rest:l}}}const qP=/^(\d+)(th|st|nd|rd)?/i,XP=/\d+/i,GP={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},ZP={any:[/^b/i,/^(a|c)/i]},QP={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},KP={any:[/1/i,/2/i,/3/i,/4/i]},JP={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},eL={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},tL={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},nL={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},sL={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},aL={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},rL={ordinalNumber:WP({matchPattern:qP,parsePattern:XP,valueCallback:e=>parseInt(e,10)}),era:Nl({matchPatterns:GP,defaultMatchWidth:"wide",parsePatterns:ZP,defaultParseWidth:"any"}),quarter:Nl({matchPatterns:QP,defaultMatchWidth:"wide",parsePatterns:KP,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Nl({matchPatterns:JP,defaultMatchWidth:"wide",parsePatterns:eL,defaultParseWidth:"any"}),day:Nl({matchPatterns:tL,defaultMatchWidth:"wide",parsePatterns:nL,defaultParseWidth:"any"}),dayPeriod:Nl({matchPatterns:sL,defaultMatchWidth:"any",parsePatterns:aL,defaultParseWidth:"any"})},j0={code:"en-US",formatDistance:TP,formatLong:OP,formatRelative:RP,localize:YP,match:rL,options:{weekStartsOn:0,firstWeekContainsDate:1}};function iL(e,t){const n=ht(e,t==null?void 0:t.in);return uC(n,mC(n))+1}function gC(e,t){const n=ht(e,t==null?void 0:t.in),s=+Ec(n)-+mP(n);return Math.round(s/oC)+1}function pC(e,t){var h,d,f,x;const n=ht(e,t==null?void 0:t.in),s=n.getFullYear(),r=Jc(),i=(t==null?void 0:t.firstWeekContainsDate)??((d=(h=t==null?void 0:t.locale)==null?void 0:h.options)==null?void 0:d.firstWeekContainsDate)??r.firstWeekContainsDate??((x=(f=r.locale)==null?void 0:f.options)==null?void 0:x.firstWeekContainsDate)??1,o=$t((t==null?void 0:t.in)||e,0);o.setFullYear(s+1,0,i),o.setHours(0,0,0,0);const l=$o(o,t),c=$t((t==null?void 0:t.in)||e,0);c.setFullYear(s,0,i),c.setHours(0,0,0,0);const u=$o(c,t);return+n>=+l?s+1:+n>=+u?s:s-1}function oL(e,t){var l,c,u,h;const n=Jc(),s=(t==null?void 0:t.firstWeekContainsDate)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((h=(u=n.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??1,r=pC(e,t),i=$t((t==null?void 0:t.in)||e,0);return i.setFullYear(r,0,s),i.setHours(0,0,0,0),$o(i,t)}function vC(e,t){const n=ht(e,t==null?void 0:t.in),s=+$o(n,t)-+oL(n,t);return Math.round(s/oC)+1}function ot(e,t){const n=e<0?"-":"",s=Math.abs(e).toString().padStart(t,"0");return n+s}const Pa={y(e,t){const n=e.getFullYear(),s=n>0?n:1-n;return ot(t==="yy"?s%100:s,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):ot(n+1,2)},d(e,t){return ot(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return ot(e.getHours()%12||12,t.length)},H(e,t){return ot(e.getHours(),t.length)},m(e,t){return ot(e.getMinutes(),t.length)},s(e,t){return ot(e.getSeconds(),t.length)},S(e,t){const n=t.length,s=e.getMilliseconds(),r=Math.trunc(s*Math.pow(10,n-3));return ot(r,t.length)}},Ai={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},lw={G:function(e,t,n){const s=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(s,{width:"abbreviated"});case"GGGGG":return n.era(s,{width:"narrow"});case"GGGG":default:return n.era(s,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const s=e.getFullYear(),r=s>0?s:1-s;return n.ordinalNumber(r,{unit:"year"})}return Pa.y(e,t)},Y:function(e,t,n,s){const r=pC(e,s),i=r>0?r:1-r;if(t==="YY"){const o=i%100;return ot(o,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):ot(i,t.length)},R:function(e,t){const n=dC(e);return ot(n,t.length)},u:function(e,t){const n=e.getFullYear();return ot(n,t.length)},Q:function(e,t,n){const s=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(s);case"QQ":return ot(s,2);case"Qo":return n.ordinalNumber(s,{unit:"quarter"});case"QQQ":return n.quarter(s,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(s,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(s,{width:"wide",context:"formatting"})}},q:function(e,t,n){const s=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(s);case"qq":return ot(s,2);case"qo":return n.ordinalNumber(s,{unit:"quarter"});case"qqq":return n.quarter(s,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(s,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(s,{width:"wide",context:"standalone"})}},M:function(e,t,n){const s=e.getMonth();switch(t){case"M":case"MM":return Pa.M(e,t);case"Mo":return n.ordinalNumber(s+1,{unit:"month"});case"MMM":return n.month(s,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(s,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(s,{width:"wide",context:"formatting"})}},L:function(e,t,n){const s=e.getMonth();switch(t){case"L":return String(s+1);case"LL":return ot(s+1,2);case"Lo":return n.ordinalNumber(s+1,{unit:"month"});case"LLL":return n.month(s,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(s,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(s,{width:"wide",context:"standalone"})}},w:function(e,t,n,s){const r=vC(e,s);return t==="wo"?n.ordinalNumber(r,{unit:"week"}):ot(r,t.length)},I:function(e,t,n){const s=gC(e);return t==="Io"?n.ordinalNumber(s,{unit:"week"}):ot(s,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Pa.d(e,t)},D:function(e,t,n){const s=iL(e);return t==="Do"?n.ordinalNumber(s,{unit:"dayOfYear"}):ot(s,t.length)},E:function(e,t,n){const s=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(s,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(s,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(s,{width:"short",context:"formatting"});case"EEEE":default:return n.day(s,{width:"wide",context:"formatting"})}},e:function(e,t,n,s){const r=e.getDay(),i=(r-s.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return ot(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});case"eeee":default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(e,t,n,s){const r=e.getDay(),i=(r-s.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return ot(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});case"cccc":default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,n){const s=e.getDay(),r=s===0?7:s;switch(t){case"i":return String(r);case"ii":return ot(r,t.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(s,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(s,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(s,{width:"short",context:"formatting"});case"iiii":default:return n.day(s,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const s=e.getHours();let r;switch(s===12?r=Ai.noon:s===0?r=Ai.midnight:r=s/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){const s=e.getHours();let r;switch(s>=17?r=Ai.evening:s>=12?r=Ai.afternoon:s>=4?r=Ai.morning:r=Ai.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let s=e.getHours()%12;return s===0&&(s=12),n.ordinalNumber(s,{unit:"hour"})}return Pa.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Pa.H(e,t)},K:function(e,t,n){const s=e.getHours()%12;return t==="Ko"?n.ordinalNumber(s,{unit:"hour"}):ot(s,t.length)},k:function(e,t,n){let s=e.getHours();return s===0&&(s=24),t==="ko"?n.ordinalNumber(s,{unit:"hour"}):ot(s,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Pa.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Pa.s(e,t)},S:function(e,t){return Pa.S(e,t)},X:function(e,t,n){const s=e.getTimezoneOffset();if(s===0)return"Z";switch(t){case"X":return dw(s);case"XXXX":case"XX":return Ur(s);case"XXXXX":case"XXX":default:return Ur(s,":")}},x:function(e,t,n){const s=e.getTimezoneOffset();switch(t){case"x":return dw(s);case"xxxx":case"xx":return Ur(s);case"xxxxx":case"xxx":default:return Ur(s,":")}},O:function(e,t,n){const s=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+cw(s,":");case"OOOO":default:return"GMT"+Ur(s,":")}},z:function(e,t,n){const s=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+cw(s,":");case"zzzz":default:return"GMT"+Ur(s,":")}},t:function(e,t,n){const s=Math.trunc(+e/1e3);return ot(s,t.length)},T:function(e,t,n){return ot(+e,t.length)}};function cw(e,t=""){const n=e>0?"-":"+",s=Math.abs(e),r=Math.trunc(s/60),i=s%60;return i===0?n+String(r):n+String(r)+t+ot(i,2)}function dw(e,t){return e%60===0?(e>0?"-":"+")+ot(Math.abs(e)/60,2):Ur(e,t)}function Ur(e,t=""){const n=e>0?"-":"+",s=Math.abs(e),r=ot(Math.trunc(s/60),2),i=ot(s%60,2);return n+r+t+i}const uw=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},bC=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},lL=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],s=n[1],r=n[2];if(!r)return uw(e,t);let i;switch(s){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",uw(s,t)).replace("{{time}}",bC(r,t))},cL={p:bC,P:lL},dL=/^D+$/,uL=/^Y+$/,hL=["D","DD","YY","YYYY"];function fL(e){return dL.test(e)}function mL(e){return uL.test(e)}function xL(e,t,n){const s=gL(e,t,n);if(console.warn(s),hL.includes(e))throw new RangeError(s)}function gL(e,t,n){const s=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${s} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const pL=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,vL=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,bL=/^'([^]*?)'?$/,yL=/''/g,wL=/[a-zA-Z]/;function jL(e,t,n){var h,d,f,x,y,v,j,g;const s=Jc(),r=(n==null?void 0:n.locale)??s.locale??j0,i=(n==null?void 0:n.firstWeekContainsDate)??((d=(h=n==null?void 0:n.locale)==null?void 0:h.options)==null?void 0:d.firstWeekContainsDate)??s.firstWeekContainsDate??((x=(f=s.locale)==null?void 0:f.options)==null?void 0:x.firstWeekContainsDate)??1,o=(n==null?void 0:n.weekStartsOn)??((v=(y=n==null?void 0:n.locale)==null?void 0:y.options)==null?void 0:v.weekStartsOn)??s.weekStartsOn??((g=(j=s.locale)==null?void 0:j.options)==null?void 0:g.weekStartsOn)??0,l=ht(e,n==null?void 0:n.in);if(!yP(l))throw new RangeError("Invalid time value");let c=t.match(vL).map(b=>{const p=b[0];if(p==="p"||p==="P"){const w=cL[p];return w(b,r.formatLong)}return b}).join("").match(pL).map(b=>{if(b==="''")return{isToken:!1,value:"'"};const p=b[0];if(p==="'")return{isToken:!1,value:NL(b)};if(lw[p])return{isToken:!0,value:b};if(p.match(wL))throw new RangeError("Format string contains an unescaped latin alphabet character `"+p+"`");return{isToken:!1,value:b}});r.localize.preprocessor&&(c=r.localize.preprocessor(l,c));const u={firstWeekContainsDate:i,weekStartsOn:o,locale:r};return c.map(b=>{if(!b.isToken)return b.value;const p=b.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&mL(p)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&fL(p))&&xL(p,t,String(e));const w=lw[p[0]];return w(l,p,r.localize,u)}).join("")}function NL(e){const t=e.match(bL);return t?t[1].replace(yL,"'"):e}function SL(e,t){const n=ht(e,t==null?void 0:t.in),s=n.getFullYear(),r=n.getMonth(),i=$t(n,0);return i.setFullYear(s,r+1,0),i.setHours(0,0,0,0),i.getDate()}function CL(e,t){return ht(e,t==null?void 0:t.in).getMonth()}function EL(e,t){return ht(e,t==null?void 0:t.in).getFullYear()}function kL(e,t){return+ht(e)>+ht(t)}function ML(e,t){return+ht(e)<+ht(t)}function TL(e,t,n){const[s,r]=Ko(n==null?void 0:n.in,e,t);return s.getFullYear()===r.getFullYear()&&s.getMonth()===r.getMonth()}function DL(e,t,n){const[s,r]=Ko(n==null?void 0:n.in,e,t);return s.getFullYear()===r.getFullYear()}function _L(e,t,n){const s=ht(e,n==null?void 0:n.in),r=s.getFullYear(),i=s.getDate(),o=$t(e,0);o.setFullYear(r,t,15),o.setHours(0,0,0,0);const l=SL(o);return s.setMonth(t,Math.min(i,l)),s}function AL(e,t,n){const s=ht(e,n==null?void 0:n.in);return isNaN(+s)?$t(e,NaN):(s.setFullYear(t),s)}const hw=5,OL=4;function zL(e,t){const n=t.startOfMonth(e),s=n.getDay()>0?n.getDay():7,r=t.addDays(e,-s+1),i=t.addDays(r,hw*7-1);return t.getMonth(e)===t.getMonth(i)?hw:OL}function yC(e,t){const n=t.startOfMonth(e),s=n.getDay();return s===1?n:s===0?t.addDays(n,-1*6):t.addDays(n,-1*(s-1))}function RL(e,t){const n=yC(e,t),s=zL(e,t);return t.addDays(n,s*7-1)}class Yn{constructor(t,n){this.Date=Date,this.today=()=>{var s;return(s=this.overrides)!=null&&s.today?this.overrides.today():this.options.timeZone?an.tz(this.options.timeZone):new this.Date},this.newDate=(s,r,i)=>{var o;return(o=this.overrides)!=null&&o.newDate?this.overrides.newDate(s,r,i):this.options.timeZone?new an(s,r,i,this.options.timeZone):new Date(s,r,i)},this.addDays=(s,r)=>{var i;return(i=this.overrides)!=null&&i.addDays?this.overrides.addDays(s,r):lC(s,r)},this.addMonths=(s,r)=>{var i;return(i=this.overrides)!=null&&i.addMonths?this.overrides.addMonths(s,r):cC(s,r)},this.addWeeks=(s,r)=>{var i;return(i=this.overrides)!=null&&i.addWeeks?this.overrides.addWeeks(s,r):xP(s,r)},this.addYears=(s,r)=>{var i;return(i=this.overrides)!=null&&i.addYears?this.overrides.addYears(s,r):gP(s,r)},this.differenceInCalendarDays=(s,r)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarDays?this.overrides.differenceInCalendarDays(s,r):uC(s,r)},this.differenceInCalendarMonths=(s,r)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(s,r):wP(s,r)},this.eachMonthOfInterval=s=>{var r;return(r=this.overrides)!=null&&r.eachMonthOfInterval?this.overrides.eachMonthOfInterval(s):NP(s)},this.eachYearOfInterval=s=>{var l;const r=(l=this.overrides)!=null&&l.eachYearOfInterval?this.overrides.eachYearOfInterval(s):EP(s),i=new Set(r.map(c=>this.getYear(c)));if(i.size===r.length)return r;const o=[];return i.forEach(c=>{o.push(new Date(c,0,1))}),o},this.endOfBroadcastWeek=s=>{var r;return(r=this.overrides)!=null&&r.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(s):RL(s,this)},this.endOfISOWeek=s=>{var r;return(r=this.overrides)!=null&&r.endOfISOWeek?this.overrides.endOfISOWeek(s):kP(s)},this.endOfMonth=s=>{var r;return(r=this.overrides)!=null&&r.endOfMonth?this.overrides.endOfMonth(s):jP(s)},this.endOfWeek=(s,r)=>{var i;return(i=this.overrides)!=null&&i.endOfWeek?this.overrides.endOfWeek(s,r):xC(s,this.options)},this.endOfYear=s=>{var r;return(r=this.overrides)!=null&&r.endOfYear?this.overrides.endOfYear(s):CP(s)},this.format=(s,r,i)=>{var l;const o=(l=this.overrides)!=null&&l.format?this.overrides.format(s,r,this.options):jL(s,r,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(o):o},this.getISOWeek=s=>{var r;return(r=this.overrides)!=null&&r.getISOWeek?this.overrides.getISOWeek(s):gC(s)},this.getMonth=(s,r)=>{var i;return(i=this.overrides)!=null&&i.getMonth?this.overrides.getMonth(s,this.options):CL(s,this.options)},this.getYear=(s,r)=>{var i;return(i=this.overrides)!=null&&i.getYear?this.overrides.getYear(s,this.options):EL(s,this.options)},this.getWeek=(s,r)=>{var i;return(i=this.overrides)!=null&&i.getWeek?this.overrides.getWeek(s,this.options):vC(s,this.options)},this.isAfter=(s,r)=>{var i;return(i=this.overrides)!=null&&i.isAfter?this.overrides.isAfter(s,r):kL(s,r)},this.isBefore=(s,r)=>{var i;return(i=this.overrides)!=null&&i.isBefore?this.overrides.isBefore(s,r):ML(s,r)},this.isDate=s=>{var r;return(r=this.overrides)!=null&&r.isDate?this.overrides.isDate(s):hC(s)},this.isSameDay=(s,r)=>{var i;return(i=this.overrides)!=null&&i.isSameDay?this.overrides.isSameDay(s,r):bP(s,r)},this.isSameMonth=(s,r)=>{var i;return(i=this.overrides)!=null&&i.isSameMonth?this.overrides.isSameMonth(s,r):TL(s,r)},this.isSameYear=(s,r)=>{var i;return(i=this.overrides)!=null&&i.isSameYear?this.overrides.isSameYear(s,r):DL(s,r)},this.max=s=>{var r;return(r=this.overrides)!=null&&r.max?this.overrides.max(s):pP(s)},this.min=s=>{var r;return(r=this.overrides)!=null&&r.min?this.overrides.min(s):vP(s)},this.setMonth=(s,r)=>{var i;return(i=this.overrides)!=null&&i.setMonth?this.overrides.setMonth(s,r):_L(s,r)},this.setYear=(s,r)=>{var i;return(i=this.overrides)!=null&&i.setYear?this.overrides.setYear(s,r):AL(s,r)},this.startOfBroadcastWeek=(s,r)=>{var i;return(i=this.overrides)!=null&&i.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(s,this):yC(s,this)},this.startOfDay=s=>{var r;return(r=this.overrides)!=null&&r.startOfDay?this.overrides.startOfDay(s):kc(s)},this.startOfISOWeek=s=>{var r;return(r=this.overrides)!=null&&r.startOfISOWeek?this.overrides.startOfISOWeek(s):Ec(s)},this.startOfMonth=s=>{var r;return(r=this.overrides)!=null&&r.startOfMonth?this.overrides.startOfMonth(s):SP(s)},this.startOfWeek=(s,r)=>{var i;return(i=this.overrides)!=null&&i.startOfWeek?this.overrides.startOfWeek(s,this.options):$o(s,this.options)},this.startOfYear=s=>{var r;return(r=this.overrides)!=null&&r.startOfYear?this.overrides.startOfYear(s):mC(s)},this.options={locale:j0,...t},this.overrides=n}getDigitMap(){const{numerals:t="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:t}),s={};for(let r=0;r<10;r++)s[r.toString()]=n.format(r);return s}replaceDigits(t){const n=this.getDigitMap();return t.replace(/\d/g,s=>n[s]||s)}formatNumber(t){return this.replaceDigits(t.toString())}getMonthYearOrder(){var n;const t=(n=this.options.locale)==null?void 0:n.code;return t&&Yn.yearFirstLocales.has(t)?"year-first":"month-first"}formatMonthYear(t){const{locale:n,timeZone:s,numerals:r}=this.options,i=n==null?void 0:n.code;if(i&&Yn.yearFirstLocales.has(i))try{return new Intl.DateTimeFormat(i,{month:"long",year:"numeric",timeZone:s,numberingSystem:r}).format(t)}catch{}const o=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(t,o)}}Yn.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const Qs=new Yn;class wC{constructor(t,n,s=Qs){this.date=t,this.displayMonth=n,this.outside=!!(n&&!s.isSameMonth(t,n)),this.dateLib=s}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class UL{constructor(t,n){this.date=t,this.weeks=n}}class $L{constructor(t,n){this.days=n,this.weekNumber=t}}function PL(e){return G.createElement("button",{...e})}function LL(e){return G.createElement("span",{...e})}function HL(e){const{size:t=24,orientation:n="left",className:s}=e;return G.createElement("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&G.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&G.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&G.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&G.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function BL(e){const{day:t,modifiers:n,...s}=e;return G.createElement("td",{...s})}function VL(e){const{day:t,modifiers:n,...s}=e,r=G.useRef(null);return G.useEffect(()=>{var i;n.focused&&((i=r.current)==null||i.focus())},[n.focused]),G.createElement("button",{ref:r,...s})}var Te;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})(Te||(Te={}));var Mt;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(Mt||(Mt={}));var ms;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(ms||(ms={}));var Tn;(function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"})(Tn||(Tn={}));function YL(e){const{options:t,className:n,components:s,classNames:r,...i}=e,o=[r[Te.Dropdown],n].join(" "),l=t==null?void 0:t.find(({value:c})=>c===i.value);return G.createElement("span",{"data-disabled":i.disabled,className:r[Te.DropdownRoot]},G.createElement(s.Select,{className:o,...i},t==null?void 0:t.map(({value:c,label:u,disabled:h})=>G.createElement(s.Option,{key:c,value:c,disabled:h},u))),G.createElement("span",{className:r[Te.CaptionLabel],"aria-hidden":!0},l==null?void 0:l.label,G.createElement(s.Chevron,{orientation:"down",size:18,className:r[Te.Chevron]})))}function FL(e){return G.createElement("div",{...e})}function IL(e){return G.createElement("div",{...e})}function WL(e){const{calendarMonth:t,displayIndex:n,...s}=e;return G.createElement("div",{...s},e.children)}function qL(e){const{calendarMonth:t,displayIndex:n,...s}=e;return G.createElement("div",{...s})}function XL(e){return G.createElement("table",{...e})}function GL(e){return G.createElement("div",{...e})}const jC=m.createContext(void 0);function ed(){const e=m.useContext(jC);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function ZL(e){const{components:t}=ed();return G.createElement(t.Dropdown,{...e})}function QL(e){const{onPreviousClick:t,onNextClick:n,previousMonth:s,nextMonth:r,...i}=e,{components:o,classNames:l,labels:{labelPrevious:c,labelNext:u}}=ed(),h=m.useCallback(f=>{r&&(n==null||n(f))},[r,n]),d=m.useCallback(f=>{s&&(t==null||t(f))},[s,t]);return G.createElement("nav",{...i},G.createElement(o.PreviousMonthButton,{type:"button",className:l[Te.PreviousMonthButton],tabIndex:s?void 0:-1,"aria-disabled":s?void 0:!0,"aria-label":c(s),onClick:d},G.createElement(o.Chevron,{disabled:s?void 0:!0,className:l[Te.Chevron],orientation:"left"})),G.createElement(o.NextMonthButton,{type:"button",className:l[Te.NextMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":u(r),onClick:h},G.createElement(o.Chevron,{disabled:r?void 0:!0,orientation:"right",className:l[Te.Chevron]})))}function KL(e){const{components:t}=ed();return G.createElement(t.Button,{...e})}function JL(e){return G.createElement("option",{...e})}function eH(e){const{components:t}=ed();return G.createElement(t.Button,{...e})}function tH(e){const{rootRef:t,...n}=e;return G.createElement("div",{...n,ref:t})}function nH(e){return G.createElement("select",{...e})}function sH(e){const{week:t,...n}=e;return G.createElement("tr",{...n})}function aH(e){return G.createElement("th",{...e})}function rH(e){return G.createElement("thead",{"aria-hidden":!0},G.createElement("tr",{...e}))}function iH(e){const{week:t,...n}=e;return G.createElement("th",{...n})}function oH(e){return G.createElement("th",{...e})}function lH(e){return G.createElement("tbody",{...e})}function cH(e){const{components:t}=ed();return G.createElement(t.Dropdown,{...e})}const dH=Object.freeze(Object.defineProperty({__proto__:null,Button:PL,CaptionLabel:LL,Chevron:HL,Day:BL,DayButton:VL,Dropdown:YL,DropdownNav:FL,Footer:IL,Month:WL,MonthCaption:qL,MonthGrid:XL,Months:GL,MonthsDropdown:ZL,Nav:QL,NextMonthButton:KL,Option:JL,PreviousMonthButton:eH,Root:tH,Select:nH,Week:sH,WeekNumber:iH,WeekNumberHeader:oH,Weekday:aH,Weekdays:rH,Weeks:lH,YearsDropdown:cH},Symbol.toStringTag,{value:"Module"}));function ua(e,t,n=!1,s=Qs){let{from:r,to:i}=e;const{differenceInCalendarDays:o,isSameDay:l}=s;return r&&i?(o(i,r)<0&&([r,i]=[i,r]),o(t,r)>=(n?1:0)&&o(i,t)>=(n?1:0)):!n&&i?l(i,t):!n&&r?l(r,t):!1}function NC(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function N0(e){return!!(e&&typeof e=="object"&&"from"in e)}function SC(e){return!!(e&&typeof e=="object"&&"after"in e)}function CC(e){return!!(e&&typeof e=="object"&&"before"in e)}function EC(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function kC(e,t){return Array.isArray(e)&&e.every(t.isDate)}function ha(e,t,n=Qs){const s=Array.isArray(t)?t:[t],{isSameDay:r,differenceInCalendarDays:i,isAfter:o}=n;return s.some(l=>{if(typeof l=="boolean")return l;if(n.isDate(l))return r(e,l);if(kC(l,n))return l.includes(e);if(N0(l))return ua(l,e,!1,n);if(EC(l))return Array.isArray(l.dayOfWeek)?l.dayOfWeek.includes(e.getDay()):l.dayOfWeek===e.getDay();if(NC(l)){const c=i(l.before,e),u=i(l.after,e),h=c>0,d=u<0;return o(l.before,l.after)?d&&h:h||d}return SC(l)?i(e,l.after)>0:CC(l)?i(l.before,e)>0:typeof l=="function"?l(e):!1})}function uH(e,t,n,s,r){const{disabled:i,hidden:o,modifiers:l,showOutsideDays:c,broadcastCalendar:u,today:h}=t,{isSameDay:d,isSameMonth:f,startOfMonth:x,isBefore:y,endOfMonth:v,isAfter:j}=r,g=n&&x(n),b=s&&v(s),p={[Mt.focused]:[],[Mt.outside]:[],[Mt.disabled]:[],[Mt.hidden]:[],[Mt.today]:[]},w={};for(const N of e){const{date:S,displayMonth:C}=N,T=!!(C&&!f(S,C)),O=!!(g&&y(S,g)),H=!!(b&&j(S,b)),U=!!(i&&ha(S,i,r)),z=!!(o&&ha(S,o,r))||O||H||!u&&!c&&T||u&&c===!1&&T,Y=d(S,h??r.today());T&&p.outside.push(N),U&&p.disabled.push(N),z&&p.hidden.push(N),Y&&p.today.push(N),l&&Object.keys(l).forEach(k=>{const $=l==null?void 0:l[k];$&&ha(S,$,r)&&(w[k]?w[k].push(N):w[k]=[N])})}return N=>{const S={[Mt.focused]:!1,[Mt.disabled]:!1,[Mt.hidden]:!1,[Mt.outside]:!1,[Mt.today]:!1},C={};for(const T in p){const O=p[T];S[T]=O.some(H=>H===N)}for(const T in w)C[T]=w[T].some(O=>O===N);return{...S,...C}}}function hH(e,t,n={}){return Object.entries(e).filter(([,r])=>r===!0).reduce((r,[i])=>(n[i]?r.push(n[i]):t[Mt[i]]?r.push(t[Mt[i]]):t[ms[i]]&&r.push(t[ms[i]]),r),[t[Te.Day]])}function fH(e){return{...dH,...e}}function mH(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([n,s])=>{n.startsWith("data-")&&(t[n]=s)}),t}function S0(){const e={};for(const t in Te)e[Te[t]]=`rdp-${Te[t]}`;for(const t in Mt)e[Mt[t]]=`rdp-${Mt[t]}`;for(const t in ms)e[ms[t]]=`rdp-${ms[t]}`;for(const t in Tn)e[Tn[t]]=`rdp-${Tn[t]}`;return e}function MC(e,t,n){return(n??new Yn(t)).formatMonthYear(e)}const xH=MC;function gH(e,t,n){return(n??new Yn(t)).format(e,"d")}function pH(e,t=Qs){return t.format(e,"LLLL")}function vH(e,t,n){return(n??new Yn(t)).format(e,"cccccc")}function bH(e,t=Qs){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function yH(){return""}function TC(e,t=Qs){return t.format(e,"yyyy")}const wH=TC,jH=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:MC,formatDay:gH,formatMonthCaption:xH,formatMonthDropdown:pH,formatWeekNumber:bH,formatWeekNumberHeader:yH,formatWeekdayName:vH,formatYearCaption:wH,formatYearDropdown:TC},Symbol.toStringTag,{value:"Module"}));function NH(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...jH,...e}}function SH(e,t,n,s,r){const{startOfMonth:i,startOfYear:o,endOfYear:l,eachMonthOfInterval:c,getMonth:u}=r;return c({start:o(e),end:l(e)}).map(f=>{const x=s.formatMonthDropdown(f,r),y=u(f),v=t&&f<i(t)||n&&f>i(n)||!1;return{value:y,label:x,disabled:v}})}function CH(e,t={},n={}){let s={...t==null?void 0:t[Te.Day]};return Object.entries(e).filter(([,r])=>r===!0).forEach(([r])=>{s={...s,...n==null?void 0:n[r]}}),s}function EH(e,t,n){const s=e.today(),r=t?e.startOfISOWeek(s):e.startOfWeek(s),i=[];for(let o=0;o<7;o++){const l=e.addDays(r,o);i.push(l)}return i}function kH(e,t,n,s,r=!1){if(!e||!t)return;const{startOfYear:i,endOfYear:o,eachYearOfInterval:l,getYear:c}=s,u=i(e),h=o(t),d=l({start:u,end:h});return r&&d.reverse(),d.map(f=>{const x=n.formatYearDropdown(f,s);return{value:c(f),label:x,disabled:!1}})}function DC(e,t,n,s){let r=(s??new Yn(n)).format(e,"PPPP");return t.today&&(r=`Today, ${r}`),t.selected&&(r=`${r}, selected`),r}const MH=DC;function _C(e,t,n){return(n??new Yn(t)).formatMonthYear(e)}const TH=_C;function DH(e,t,n,s){let r=(s??new Yn(n)).format(e,"PPPP");return t!=null&&t.today&&(r=`Today, ${r}`),r}function _H(e){return"Choose the Month"}function AH(){return""}function OH(e){return"Go to the Next Month"}function zH(e){return"Go to the Previous Month"}function RH(e,t,n){return(n??new Yn(t)).format(e,"cccc")}function UH(e,t){return`Week ${e}`}function $H(e){return"Week Number"}function PH(e){return"Choose the Year"}const LH=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:TH,labelDay:MH,labelDayButton:DC,labelGrid:_C,labelGridcell:DH,labelMonthDropdown:_H,labelNav:AH,labelNext:OH,labelPrevious:zH,labelWeekNumber:UH,labelWeekNumberHeader:$H,labelWeekday:RH,labelYearDropdown:PH},Symbol.toStringTag,{value:"Module"})),td=e=>e instanceof HTMLElement?e:null,Wm=e=>[...e.querySelectorAll("[data-animated-month]")??[]],HH=e=>td(e.querySelector("[data-animated-month]")),qm=e=>td(e.querySelector("[data-animated-caption]")),Xm=e=>td(e.querySelector("[data-animated-weeks]")),BH=e=>td(e.querySelector("[data-animated-nav]")),VH=e=>td(e.querySelector("[data-animated-weekdays]"));function YH(e,t,{classNames:n,months:s,focused:r,dateLib:i}){const o=m.useRef(null),l=m.useRef(s),c=m.useRef(!1);m.useLayoutEffect(()=>{const u=l.current;if(l.current=s,!t||!e.current||!(e.current instanceof HTMLElement)||s.length===0||u.length===0||s.length!==u.length)return;const h=i.isSameMonth(s[0].date,u[0].date),d=i.isAfter(s[0].date,u[0].date),f=d?n[Tn.caption_after_enter]:n[Tn.caption_before_enter],x=d?n[Tn.weeks_after_enter]:n[Tn.weeks_before_enter],y=o.current,v=e.current.cloneNode(!0);if(v instanceof HTMLElement?(Wm(v).forEach(p=>{if(!(p instanceof HTMLElement))return;const w=HH(p);w&&p.contains(w)&&p.removeChild(w);const N=qm(p);N&&N.classList.remove(f);const S=Xm(p);S&&S.classList.remove(x)}),o.current=v):o.current=null,c.current||h||r)return;const j=y instanceof HTMLElement?Wm(y):[],g=Wm(e.current);if(g!=null&&g.every(b=>b instanceof HTMLElement)&&j&&j.every(b=>b instanceof HTMLElement)){c.current=!0,e.current.style.isolation="isolate";const b=BH(e.current);b&&(b.style.zIndex="1"),g.forEach((p,w)=>{const N=j[w];if(!N)return;p.style.position="relative",p.style.overflow="hidden";const S=qm(p);S&&S.classList.add(f);const C=Xm(p);C&&C.classList.add(x);const T=()=>{c.current=!1,e.current&&(e.current.style.isolation=""),b&&(b.style.zIndex=""),S&&S.classList.remove(f),C&&C.classList.remove(x),p.style.position="",p.style.overflow="",p.contains(N)&&p.removeChild(N)};N.style.pointerEvents="none",N.style.position="absolute",N.style.overflow="hidden",N.setAttribute("aria-hidden","true");const O=VH(N);O&&(O.style.opacity="0");const H=qm(N);H&&(H.classList.add(d?n[Tn.caption_before_exit]:n[Tn.caption_after_exit]),H.addEventListener("animationend",T));const U=Xm(N);U&&U.classList.add(d?n[Tn.weeks_before_exit]:n[Tn.weeks_after_exit]),p.insertBefore(N,p.firstChild)})}})}function FH(e,t,n,s){const r=e[0],i=e[e.length-1],{ISOWeek:o,fixedWeeks:l,broadcastCalendar:c}=n??{},{addDays:u,differenceInCalendarDays:h,differenceInCalendarMonths:d,endOfBroadcastWeek:f,endOfISOWeek:x,endOfMonth:y,endOfWeek:v,isAfter:j,startOfBroadcastWeek:g,startOfISOWeek:b,startOfWeek:p}=s,w=c?g(r,s):o?b(r):p(r),N=c?f(i):o?x(y(i)):v(y(i)),S=h(N,w),C=d(i,r)+1,T=[];for(let U=0;U<=S;U++){const z=u(w,U);if(t&&j(z,t))break;T.push(z)}const H=(c?35:42)*C;if(l&&T.length<H){const U=H-T.length;for(let z=0;z<U;z++){const Y=u(T[T.length-1],1);T.push(Y)}}return T}function IH(e){const t=[];return e.reduce((n,s)=>{const r=s.weeks.reduce((i,o)=>i.concat(o.days.slice()),t.slice());return n.concat(r.slice())},t.slice())}function WH(e,t,n,s){const{numberOfMonths:r=1}=n,i=[];for(let o=0;o<r;o++){const l=s.addMonths(e,o);if(t&&l>t)break;i.push(l)}return i}function fw(e,t,n,s){const{month:r,defaultMonth:i,today:o=s.today(),numberOfMonths:l=1}=e;let c=r||i||o;const{differenceInCalendarMonths:u,addMonths:h,startOfMonth:d}=s;if(n&&u(n,c)<l-1){const f=-1*(l-1);c=h(n,f)}return t&&u(c,t)<0&&(c=t),d(c)}function qH(e,t,n,s){const{addDays:r,endOfBroadcastWeek:i,endOfISOWeek:o,endOfMonth:l,endOfWeek:c,getISOWeek:u,getWeek:h,startOfBroadcastWeek:d,startOfISOWeek:f,startOfWeek:x}=s,y=e.reduce((v,j)=>{const g=n.broadcastCalendar?d(j,s):n.ISOWeek?f(j):x(j),b=n.broadcastCalendar?i(j):n.ISOWeek?o(l(j)):c(l(j)),p=t.filter(C=>C>=g&&C<=b),w=n.broadcastCalendar?35:42;if(n.fixedWeeks&&p.length<w){const C=t.filter(T=>{const O=w-p.length;return T>b&&T<=r(b,O)});p.push(...C)}const N=p.reduce((C,T)=>{const O=n.ISOWeek?u(T):h(T),H=C.find(z=>z.weekNumber===O),U=new wC(T,j,s);return H?H.days.push(U):C.push(new $L(O,[U])),C},[]),S=new UL(j,N);return v.push(S),v},[]);return n.reverseMonths?y.reverse():y}function XH(e,t){let{startMonth:n,endMonth:s}=e;const{startOfYear:r,startOfDay:i,startOfMonth:o,endOfMonth:l,addYears:c,endOfYear:u,newDate:h,today:d}=t,{fromYear:f,toYear:x,fromMonth:y,toMonth:v}=e;!n&&y&&(n=y),!n&&f&&(n=t.newDate(f,0,1)),!s&&v&&(s=v),!s&&x&&(s=h(x,11,31));const j=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=o(n):f?n=h(f,0,1):!n&&j&&(n=r(c(e.today??d(),-100))),s?s=l(s):x?s=h(x,11,31):!s&&j&&(s=u(e.today??d())),[n&&i(n),s&&i(s)]}function GH(e,t,n,s){if(n.disableNavigation)return;const{pagedNavigation:r,numberOfMonths:i=1}=n,{startOfMonth:o,addMonths:l,differenceInCalendarMonths:c}=s,u=r?i:1,h=o(e);if(!t)return l(h,u);if(!(c(t,e)<i))return l(h,u)}function ZH(e,t,n,s){if(n.disableNavigation)return;const{pagedNavigation:r,numberOfMonths:i}=n,{startOfMonth:o,addMonths:l,differenceInCalendarMonths:c}=s,u=r?i??1:1,h=o(e);if(!t)return l(h,-u);if(!(c(h,t)<=0))return l(h,-u)}function QH(e){const t=[];return e.reduce((n,s)=>n.concat(s.weeks.slice()),t.slice())}function Nf(e,t){const[n,s]=m.useState(e);return[t===void 0?n:t,s]}function KH(e,t){const[n,s]=XH(e,t),{startOfMonth:r,endOfMonth:i}=t,o=fw(e,n,s,t),[l,c]=Nf(o,e.month?o:void 0);m.useEffect(()=>{const S=fw(e,n,s,t);c(S)},[e.timeZone]);const u=WH(l,s,e,t),h=FH(u,e.endMonth?i(e.endMonth):void 0,e,t),d=qH(u,h,e,t),f=QH(d),x=IH(d),y=ZH(l,n,e,t),v=GH(l,s,e,t),{disableNavigation:j,onMonthChange:g}=e,b=S=>f.some(C=>C.days.some(T=>T.isEqualTo(S))),p=S=>{if(j)return;let C=r(S);n&&C<r(n)&&(C=r(n)),s&&C>r(s)&&(C=r(s)),c(C),g==null||g(C)};return{months:d,weeks:f,days:x,navStart:n,navEnd:s,previousMonth:y,nextMonth:v,goToMonth:p,goToDay:S=>{b(S)||p(S.date)}}}var Ds;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(Ds||(Ds={}));function mw(e){return!e[Mt.disabled]&&!e[Mt.hidden]&&!e[Mt.outside]}function JH(e,t,n,s){let r,i=-1;for(const o of e){const l=t(o);mw(l)&&(l[Mt.focused]&&i<Ds.FocusedModifier?(r=o,i=Ds.FocusedModifier):s!=null&&s.isEqualTo(o)&&i<Ds.LastFocused?(r=o,i=Ds.LastFocused):n(o.date)&&i<Ds.Selected?(r=o,i=Ds.Selected):l[Mt.today]&&i<Ds.Today&&(r=o,i=Ds.Today))}return r||(r=e.find(o=>mw(t(o)))),r}function eB(e,t,n,s,r,i,o){const{ISOWeek:l,broadcastCalendar:c}=i,{addDays:u,addMonths:h,addWeeks:d,addYears:f,endOfBroadcastWeek:x,endOfISOWeek:y,endOfWeek:v,max:j,min:g,startOfBroadcastWeek:b,startOfISOWeek:p,startOfWeek:w}=o;let S={day:u,week:d,month:h,year:f,startOfWeek:C=>c?b(C,o):l?p(C):w(C),endOfWeek:C=>c?x(C):l?y(C):v(C)}[e](n,t==="after"?1:-1);return t==="before"&&s?S=j([s,S]):t==="after"&&r&&(S=g([r,S])),S}function AC(e,t,n,s,r,i,o,l=0){if(l>365)return;const c=eB(e,t,n.date,s,r,i,o),u=!!(i.disabled&&ha(c,i.disabled,o)),h=!!(i.hidden&&ha(c,i.hidden,o)),d=c,f=new wC(c,d,o);return!u&&!h?f:AC(e,t,f,s,r,i,o,l+1)}function tB(e,t,n,s,r){const{autoFocus:i}=e,[o,l]=m.useState(),c=JH(t.days,n,s||(()=>!1),o),[u,h]=m.useState(i?c:void 0);return{isFocusTarget:v=>!!(c!=null&&c.isEqualTo(v)),setFocused:h,focused:u,blur:()=>{l(u),h(void 0)},moveFocus:(v,j)=>{if(!u)return;const g=AC(v,j,u,t.navStart,t.navEnd,e,r);g&&(e.disableNavigation&&!t.days.some(p=>p.isEqualTo(g))||(t.goToDay(g),h(g)))}}}function nB(e,t){const{selected:n,required:s,onSelect:r}=e,[i,o]=Nf(n,r?n:void 0),l=r?n:i,{isSameDay:c}=t,u=x=>(l==null?void 0:l.some(y=>c(y,x)))??!1,{min:h,max:d}=e;return{selected:l,select:(x,y,v)=>{let j=[...l??[]];if(u(x)){if((l==null?void 0:l.length)===h||s&&(l==null?void 0:l.length)===1)return;j=l==null?void 0:l.filter(g=>!c(g,x))}else(l==null?void 0:l.length)===d?j=[x]:j=[...j,x];return r||o(j),r==null||r(j,x,y,v),j},isSelected:u}}function sB(e,t,n=0,s=0,r=!1,i=Qs){const{from:o,to:l}=t||{},{isSameDay:c,isAfter:u,isBefore:h}=i;let d;if(!o&&!l)d={from:e,to:n>0?void 0:e};else if(o&&!l)c(o,e)?n===0?d={from:o,to:e}:r?d={from:o,to:void 0}:d=void 0:h(e,o)?d={from:e,to:o}:d={from:o,to:e};else if(o&&l)if(c(o,e)&&c(l,e))r?d={from:o,to:l}:d=void 0;else if(c(o,e))d={from:o,to:n>0?void 0:e};else if(c(l,e))d={from:e,to:n>0?void 0:e};else if(h(e,o))d={from:e,to:l};else if(u(e,o))d={from:o,to:e};else if(u(e,l))d={from:o,to:e};else throw new Error("Invalid range");if(d!=null&&d.from&&(d!=null&&d.to)){const f=i.differenceInCalendarDays(d.to,d.from);s>0&&f>s?d={from:e,to:void 0}:n>1&&f<n&&(d={from:e,to:void 0})}return d}function aB(e,t,n=Qs){const s=Array.isArray(t)?t:[t];let r=e.from;const i=n.differenceInCalendarDays(e.to,e.from),o=Math.min(i,6);for(let l=0;l<=o;l++){if(s.includes(r.getDay()))return!0;r=n.addDays(r,1)}return!1}function xw(e,t,n=Qs){return ua(e,t.from,!1,n)||ua(e,t.to,!1,n)||ua(t,e.from,!1,n)||ua(t,e.to,!1,n)}function rB(e,t,n=Qs){const s=Array.isArray(t)?t:[t];if(s.filter(l=>typeof l!="function").some(l=>typeof l=="boolean"?l:n.isDate(l)?ua(e,l,!1,n):kC(l,n)?l.some(c=>ua(e,c,!1,n)):N0(l)?l.from&&l.to?xw(e,{from:l.from,to:l.to},n):!1:EC(l)?aB(e,l.dayOfWeek,n):NC(l)?n.isAfter(l.before,l.after)?xw(e,{from:n.addDays(l.after,1),to:n.addDays(l.before,-1)},n):ha(e.from,l,n)||ha(e.to,l,n):SC(l)||CC(l)?ha(e.from,l,n)||ha(e.to,l,n):!1))return!0;const o=s.filter(l=>typeof l=="function");if(o.length){let l=e.from;const c=n.differenceInCalendarDays(e.to,e.from);for(let u=0;u<=c;u++){if(o.some(h=>h(l)))return!0;l=n.addDays(l,1)}}return!1}function iB(e,t){const{disabled:n,excludeDisabled:s,selected:r,required:i,onSelect:o}=e,[l,c]=Nf(r,o?r:void 0),u=o?r:l;return{selected:u,select:(f,x,y)=>{const{min:v,max:j}=e,g=f?sB(f,u,v,j,i,t):void 0;return s&&n&&(g!=null&&g.from)&&g.to&&rB({from:g.from,to:g.to},n,t)&&(g.from=f,g.to=void 0),o||c(g),o==null||o(g,f,x,y),g},isSelected:f=>u&&ua(u,f,!1,t)}}function oB(e,t){const{selected:n,required:s,onSelect:r}=e,[i,o]=Nf(n,r?n:void 0),l=r?n:i,{isSameDay:c}=t;return{selected:l,select:(d,f,x)=>{let y=d;return!s&&l&&l&&c(d,l)&&(y=void 0),r||o(y),r==null||r(y,d,f,x),y},isSelected:d=>l?c(l,d):!1}}function lB(e,t){const n=oB(e,t),s=nB(e,t),r=iB(e,t);switch(e.mode){case"single":return n;case"multiple":return s;case"range":return r;default:return}}function cB(e){var Re;let t=e;t.timeZone&&(t={...e},t.today&&(t.today=new an(t.today,t.timeZone)),t.month&&(t.month=new an(t.month,t.timeZone)),t.defaultMonth&&(t.defaultMonth=new an(t.defaultMonth,t.timeZone)),t.startMonth&&(t.startMonth=new an(t.startMonth,t.timeZone)),t.endMonth&&(t.endMonth=new an(t.endMonth,t.timeZone)),t.mode==="single"&&t.selected?t.selected=new an(t.selected,t.timeZone):t.mode==="multiple"&&t.selected?t.selected=(Re=t.selected)==null?void 0:Re.map(je=>new an(je,t.timeZone)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?new an(t.selected.from,t.timeZone):void 0,to:t.selected.to?new an(t.selected.to,t.timeZone):void 0}));const{components:n,formatters:s,labels:r,dateLib:i,locale:o,classNames:l}=m.useMemo(()=>{const je={...j0,...t.locale};return{dateLib:new Yn({locale:je,weekStartsOn:t.broadcastCalendar?1:t.weekStartsOn,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},t.dateLib),components:fH(t.components),formatters:NH(t.formatters),labels:{...LH,...t.labels},locale:je,classNames:{...S0(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.components,t.formatters,t.labels,t.classNames]),{captionLayout:c,mode:u,navLayout:h,numberOfMonths:d=1,onDayBlur:f,onDayClick:x,onDayFocus:y,onDayKeyDown:v,onDayMouseEnter:j,onDayMouseLeave:g,onNextClick:b,onPrevClick:p,showWeekNumber:w,styles:N}=t,{formatCaption:S,formatDay:C,formatMonthDropdown:T,formatWeekNumber:O,formatWeekNumberHeader:H,formatWeekdayName:U,formatYearDropdown:z}=s,Y=KH(t,i),{days:k,months:$,navStart:M,navEnd:A,previousMonth:E,nextMonth:D,goToMonth:_}=Y,I=uH(k,t,M,A,i),{isSelected:R,select:P,selected:W}=lB(t,i)??{},{blur:q,focused:ee,isFocusTarget:ne,moveFocus:Z,setFocused:se}=tB(t,Y,I,R??(()=>!1),i),{labelDayButton:xe,labelGridcell:ae,labelGrid:ce,labelMonthDropdown:de,labelNav:Se,labelPrevious:Ee,labelNext:Ae,labelWeekday:He,labelWeekNumber:J,labelWeekNumberHeader:oe,labelYearDropdown:be}=r,Oe=m.useMemo(()=>EH(i,t.ISOWeek),[i,t.ISOWeek]),we=u!==void 0||x!==void 0,Ce=m.useCallback(()=>{E&&(_(E),p==null||p(E))},[E,_,p]),st=m.useCallback(()=>{D&&(_(D),b==null||b(D))},[_,D,b]),yt=m.useCallback((je,Ve)=>ke=>{ke.preventDefault(),ke.stopPropagation(),se(je),P==null||P(je.date,Ve,ke),x==null||x(je.date,Ve,ke)},[P,x,se]),wt=m.useCallback((je,Ve)=>ke=>{se(je),y==null||y(je.date,Ve,ke)},[y,se]),Lt=m.useCallback((je,Ve)=>ke=>{q(),f==null||f(je.date,Ve,ke)},[q,f]),K=m.useCallback((je,Ve)=>ke=>{const Pe={ArrowLeft:[ke.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[ke.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[ke.shiftKey?"year":"week","after"],ArrowUp:[ke.shiftKey?"year":"week","before"],PageUp:[ke.shiftKey?"year":"month","before"],PageDown:[ke.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(Pe[ke.key]){ke.preventDefault(),ke.stopPropagation();const[X,Q]=Pe[ke.key];Z(X,Q)}v==null||v(je.date,Ve,ke)},[Z,v,t.dir]),V=m.useCallback((je,Ve)=>ke=>{j==null||j(je.date,Ve,ke)},[j]),te=m.useCallback((je,Ve)=>ke=>{g==null||g(je.date,Ve,ke)},[g]),me=m.useCallback(je=>Ve=>{const ke=Number(Ve.target.value),Pe=i.setMonth(i.startOfMonth(je),ke);_(Pe)},[i,_]),L=m.useCallback(je=>Ve=>{const ke=Number(Ve.target.value),Pe=i.setYear(i.startOfMonth(je),ke);_(Pe)},[i,_]),{className:ie,style:ue}=m.useMemo(()=>({className:[l[Te.Root],t.className].filter(Boolean).join(" "),style:{...N==null?void 0:N[Te.Root],...t.style}}),[l,t.className,t.style,N]),he=mH(t),Be=m.useRef(null);YH(Be,!!t.animate,{classNames:l,months:$,focused:ee,dateLib:i});const _e={dayPickerProps:t,selected:W,select:P,isSelected:R,months:$,nextMonth:D,previousMonth:E,goToMonth:_,getModifiers:I,components:n,classNames:l,styles:N,labels:r,formatters:s};return G.createElement(jC.Provider,{value:_e},G.createElement(n.Root,{rootRef:t.animate?Be:void 0,className:ie,style:ue,dir:t.dir,id:t.id,lang:t.lang,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],"aria-labelledby":t["aria-labelledby"],...he},G.createElement(n.Months,{className:l[Te.Months],style:N==null?void 0:N[Te.Months]},!t.hideNavigation&&!h&&G.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:l[Te.Nav],style:N==null?void 0:N[Te.Nav],"aria-label":Se(),onPreviousClick:Ce,onNextClick:st,previousMonth:E,nextMonth:D}),$.map((je,Ve)=>G.createElement(n.Month,{"data-animated-month":t.animate?"true":void 0,className:l[Te.Month],style:N==null?void 0:N[Te.Month],key:Ve,displayIndex:Ve,calendarMonth:je},h==="around"&&!t.hideNavigation&&Ve===0&&G.createElement(n.PreviousMonthButton,{type:"button",className:l[Te.PreviousMonthButton],tabIndex:E?void 0:-1,"aria-disabled":E?void 0:!0,"aria-label":Ee(E),onClick:Ce,"data-animated-button":t.animate?"true":void 0},G.createElement(n.Chevron,{disabled:E?void 0:!0,className:l[Te.Chevron],orientation:t.dir==="rtl"?"right":"left"})),G.createElement(n.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:l[Te.MonthCaption],style:N==null?void 0:N[Te.MonthCaption],calendarMonth:je,displayIndex:Ve},c!=null&&c.startsWith("dropdown")?G.createElement(n.DropdownNav,{className:l[Te.Dropdowns],style:N==null?void 0:N[Te.Dropdowns]},(()=>{const ke=c==="dropdown"||c==="dropdown-months"?G.createElement(n.MonthsDropdown,{key:"month",className:l[Te.MonthsDropdown],"aria-label":de(),classNames:l,components:n,disabled:!!t.disableNavigation,onChange:me(je.date),options:SH(je.date,M,A,s,i),style:N==null?void 0:N[Te.Dropdown],value:i.getMonth(je.date)}):G.createElement("span",{key:"month"},T(je.date,i)),Pe=c==="dropdown"||c==="dropdown-years"?G.createElement(n.YearsDropdown,{key:"year",className:l[Te.YearsDropdown],"aria-label":be(i.options),classNames:l,components:n,disabled:!!t.disableNavigation,onChange:L(je.date),options:kH(M,A,s,i,!!t.reverseYears),style:N==null?void 0:N[Te.Dropdown],value:i.getYear(je.date)}):G.createElement("span",{key:"year"},z(je.date,i));return i.getMonthYearOrder()==="year-first"?[Pe,ke]:[ke,Pe]})(),G.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},S(je.date,i.options,i))):G.createElement(n.CaptionLabel,{className:l[Te.CaptionLabel],role:"status","aria-live":"polite"},S(je.date,i.options,i))),h==="around"&&!t.hideNavigation&&Ve===d-1&&G.createElement(n.NextMonthButton,{type:"button",className:l[Te.NextMonthButton],tabIndex:D?void 0:-1,"aria-disabled":D?void 0:!0,"aria-label":Ae(D),onClick:st,"data-animated-button":t.animate?"true":void 0},G.createElement(n.Chevron,{disabled:D?void 0:!0,className:l[Te.Chevron],orientation:t.dir==="rtl"?"left":"right"})),Ve===d-1&&h==="after"&&!t.hideNavigation&&G.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:l[Te.Nav],style:N==null?void 0:N[Te.Nav],"aria-label":Se(),onPreviousClick:Ce,onNextClick:st,previousMonth:E,nextMonth:D}),G.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":u==="multiple"||u==="range","aria-label":ce(je.date,i.options,i)||void 0,className:l[Te.MonthGrid],style:N==null?void 0:N[Te.MonthGrid]},!t.hideWeekdays&&G.createElement(n.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:l[Te.Weekdays],style:N==null?void 0:N[Te.Weekdays]},w&&G.createElement(n.WeekNumberHeader,{"aria-label":oe(i.options),className:l[Te.WeekNumberHeader],style:N==null?void 0:N[Te.WeekNumberHeader],scope:"col"},H()),Oe.map(ke=>G.createElement(n.Weekday,{"aria-label":He(ke,i.options,i),className:l[Te.Weekday],key:String(ke),style:N==null?void 0:N[Te.Weekday],scope:"col"},U(ke,i.options,i)))),G.createElement(n.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:l[Te.Weeks],style:N==null?void 0:N[Te.Weeks]},je.weeks.map(ke=>G.createElement(n.Week,{className:l[Te.Week],key:ke.weekNumber,style:N==null?void 0:N[Te.Week],week:ke},w&&G.createElement(n.WeekNumber,{week:ke,style:N==null?void 0:N[Te.WeekNumber],"aria-label":J(ke.weekNumber,{locale:o}),className:l[Te.WeekNumber],scope:"row",role:"rowheader"},O(ke.weekNumber,i)),ke.days.map(Pe=>{const{date:X}=Pe,Q=I(Pe);if(Q[Mt.focused]=!Q.hidden&&!!(ee!=null&&ee.isEqualTo(Pe)),Q[ms.selected]=(R==null?void 0:R(X))||Q.selected,N0(W)){const{from:tt,to:Qe}=W;Q[ms.range_start]=!!(tt&&Qe&&i.isSameDay(X,tt)),Q[ms.range_end]=!!(tt&&Qe&&i.isSameDay(X,Qe)),Q[ms.range_middle]=ua(W,X,!0,i)}const pe=CH(Q,N,t.modifiersStyles),We=hH(Q,l,t.modifiersClassNames),nt=!we&&!Q.hidden?ae(X,Q,i.options,i):void 0;return G.createElement(n.Day,{key:`${i.format(X,"yyyy-MM-dd")}_${i.format(Pe.displayMonth,"yyyy-MM")}`,day:Pe,modifiers:Q,className:We.join(" "),style:pe,role:"gridcell","aria-selected":Q.selected||void 0,"aria-label":nt,"data-day":i.format(X,"yyyy-MM-dd"),"data-month":Pe.outside?i.format(X,"yyyy-MM"):void 0,"data-selected":Q.selected||void 0,"data-disabled":Q.disabled||void 0,"data-hidden":Q.hidden||void 0,"data-outside":Pe.outside||void 0,"data-focused":Q.focused||void 0,"data-today":Q.today||void 0},!Q.hidden&&we?G.createElement(n.DayButton,{className:l[Te.DayButton],style:N==null?void 0:N[Te.DayButton],type:"button",day:Pe,modifiers:Q,disabled:Q.disabled||void 0,tabIndex:ne(Pe)?0:-1,"aria-label":xe(X,Q,i.options,i),onClick:yt(Pe,Q),onBlur:Lt(Pe,Q),onFocus:wt(Pe,Q),onKeyDown:K(Pe,Q),onMouseEnter:V(Pe,Q),onMouseLeave:te(Pe,Q)},C(X,i.options,i)):!Q.hidden&&C(Pe.date,i.options,i))})))))))),t.footer&&G.createElement(n.Footer,{className:l[Te.Footer],style:N==null?void 0:N[Te.Footer],role:"status","aria-live":"polite"},t.footer)))}function Qn({className:e,classNames:t,showOutsideDays:n=!0,captionLayout:s="label",buttonVariant:r="ghost",formatters:i,components:o,...l}){const c=S0();return a.jsx(cB,{showOutsideDays:n,className:$e("bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:s,formatters:{formatMonthDropdown:u=>u.toLocaleString("default",{month:"short"}),...i},classNames:{root:$e("w-fit",c.root),months:$e("relative flex flex-col gap-4 md:flex-row",c.months),month:$e("flex w-full flex-col gap-4",c.month),nav:$e("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",c.nav),button_previous:$e(Mg({variant:r}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_previous),button_next:$e(Mg({variant:r}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_next),month_caption:$e("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",c.month_caption),dropdowns:$e("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",c.dropdowns),dropdown_root:$e("has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",c.dropdown_root),dropdown:$e("bg-popover absolute inset-0 opacity-0",c.dropdown),caption_label:$e("select-none font-medium",s==="label"?"text-sm":"[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",c.caption_label),table:"w-full border-collapse",weekdays:$e("flex",c.weekdays),weekday:$e("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",c.weekday),week:$e("mt-2 flex w-full",c.week),week_number_header:$e("w-[--cell-size] select-none",c.week_number_header),week_number:$e("text-muted-foreground select-none text-[0.8rem]",c.week_number),day:$e("group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",c.day),range_start:$e("bg-accent rounded-l-md",c.range_start),range_middle:$e("rounded-none",c.range_middle),range_end:$e("bg-accent rounded-r-md",c.range_end),today:$e("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",c.today),outside:$e("text-muted-foreground aria-selected:text-muted-foreground",c.outside),disabled:$e("text-muted-foreground opacity-50",c.disabled),hidden:$e("invisible",c.hidden),...t},components:{Root:({className:u,rootRef:h,...d})=>a.jsx("div",{"data-slot":"calendar",ref:h,className:$e(u),...d}),Chevron:({className:u,orientation:h,...d})=>h==="left"?a.jsx(TS,{className:$e("size-4",u),...d}):h==="right"?a.jsx(Jp,{className:$e("size-4",u),...d}):a.jsx(of,{className:$e("size-4",u),...d}),DayButton:dB,WeekNumber:({children:u,...h})=>a.jsx("td",{...h,children:a.jsx("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:u})}),...o},...l})}function dB({className:e,day:t,modifiers:n,...s}){const r=S0(),i=m.useRef(null);return m.useEffect(()=>{var o;n.focused&&((o=i.current)==null||o.focus())},[n.focused]),a.jsx(F,{ref:i,variant:"ghost",size:"icon","data-day":t.date.toLocaleDateString(),"data-selected-single":n.selected&&!n.range_start&&!n.range_end&&!n.range_middle,"data-range-start":n.range_start,"data-range-end":n.range_end,"data-range-middle":n.range_middle,className:$e("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[--cell-size] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70",r.day,e),...s})}var Sf="Popover",[OC]=lf(Sf,[mf]),nd=mf(),[uB,Cr]=OC(Sf),zC=e=>{const{__scopePopover:t,children:n,open:s,defaultOpen:r,onOpenChange:i,modal:o=!1}=e,l=nd(t),c=m.useRef(null),[u,h]=m.useState(!1),[d,f]=m0({prop:s,defaultProp:r??!1,onChange:i,caller:Sf});return a.jsx(c4,{...l,children:a.jsx(uB,{scope:t,contentId:ps(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(x=>!x),[f]),hasCustomAnchor:u,onCustomAnchorAdd:m.useCallback(()=>h(!0),[]),onCustomAnchorRemove:m.useCallback(()=>h(!1),[]),modal:o,children:n})})};zC.displayName=Sf;var RC="PopoverAnchor",hB=m.forwardRef((e,t)=>{const{__scopePopover:n,...s}=e,r=Cr(RC,n),i=nd(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:l}=r;return m.useEffect(()=>(o(),()=>l()),[o,l]),a.jsx(h0,{...i,...s,ref:t})});hB.displayName=RC;var UC="PopoverTrigger",$C=m.forwardRef((e,t)=>{const{__scopePopover:n,...s}=e,r=Cr(UC,n),i=nd(n),o=Fn(t,r.triggerRef),l=a.jsx(ln.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":VC(r.open),...s,ref:o,onClick:Vt(e.onClick,r.onOpenToggle)});return r.hasCustomAnchor?l:a.jsx(h0,{asChild:!0,...i,children:l})});$C.displayName=UC;var C0="PopoverPortal",[fB,mB]=OC(C0,{forceMount:void 0}),PC=e=>{const{__scopePopover:t,forceMount:n,children:s,container:r}=e,i=Cr(C0,t);return a.jsx(fB,{scope:t,forceMount:n,children:a.jsx(bi,{present:n||i.open,children:a.jsx(f0,{asChild:!0,container:r,children:s})})})};PC.displayName=C0;var Po="PopoverContent",LC=m.forwardRef((e,t)=>{const n=mB(Po,e.__scopePopover),{forceMount:s=n.forceMount,...r}=e,i=Cr(Po,e.__scopePopover);return a.jsx(bi,{present:s||i.open,children:i.modal?a.jsx(gB,{...r,ref:t}):a.jsx(pB,{...r,ref:t})})});LC.displayName=Po;var xB=s0("PopoverContent.RemoveScroll"),gB=m.forwardRef((e,t)=>{const n=Cr(Po,e.__scopePopover),s=m.useRef(null),r=Fn(t,s),i=m.useRef(!1);return m.useEffect(()=>{const o=s.current;if(o)return z4(o)},[]),a.jsx(p0,{as:xB,allowPinchZoom:!0,children:a.jsx(HC,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Vt(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),i.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Vt(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;i.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:Vt(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),pB=m.forwardRef((e,t)=>{const n=Cr(Po,e.__scopePopover),s=m.useRef(!1),r=m.useRef(!1);return a.jsx(HC,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(s.current||(l=n.triggerRef.current)==null||l.focus(),i.preventDefault()),s.current=!1,r.current=!1},onInteractOutside:i=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(s.current=!0,i.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const o=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&r.current&&i.preventDefault()}})}),HC=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:s,onOpenAutoFocus:r,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:h,...d}=e,f=Cr(Po,n),x=nd(n);return C4(),a.jsx(g0,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:r,onUnmountAutoFocus:i,children:a.jsx(cf,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:h,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:a.jsx(d4,{"data-state":VC(f.open),role:"dialog",id:f.contentId,...x,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),BC="PopoverClose",vB=m.forwardRef((e,t)=>{const{__scopePopover:n,...s}=e,r=Cr(BC,n);return a.jsx(ln.button,{type:"button",...s,ref:t,onClick:Vt(e.onClick,()=>r.onOpenChange(!1))})});vB.displayName=BC;var bB="PopoverArrow",yB=m.forwardRef((e,t)=>{const{__scopePopover:n,...s}=e,r=nd(n);return a.jsx(u4,{...r,...s,ref:t})});yB.displayName=bB;function VC(e){return e?"open":"closed"}var wB=zC,jB=$C,NB=PC,YC=LC;const Kn=wB,Jn=jB,Dn=m.forwardRef(({className:e,align:t="start",sideOffset:n=4,...s},r)=>a.jsx(NB,{children:a.jsx(YC,{ref:r,align:t,sideOffset:n,className:$e("z-50 w-auto p-0 rounded-lg border border-white/20 bg-black text-white shadow-lg outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...s})}));Dn.displayName=YC.displayName;const gw=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M20 3H2v14h8v2H8v2h8v-2h-2v-2h8V3h-2zm-6 12H4V5h16v10h-6z",fill:"currentColor"})}),qd=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M7 8H5v2h2v2h2v2h2v2h2v-2h2v-2h2v-2h2V8h-2v2h-2v2h-2v2h-2v-2H9v-2H7V8z",fill:"currentColor"})}),SB=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})}),ls=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M15 2h2v2h4v18H3V4h4V2h2v2h6V2zM9 6H5v2h14V6H9zm-4 4v10h14V10H5zm2 2h8v2H7v-2zm4 6v-2H7v2h4z",fill:"currentColor"})}),CB=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M2 2h14v4h6v16H2V2zm18 6h-4v2h2v2h-2v2h2v2h-2v2h2v2h2V8zm-6-4H4v16h2v-2h6v2h2V4zM6 6h2v2H6V6zm6 0h-2v2h2V6zm-6 4h2v2H6v-2zm6 0h-2v2h2v-2zm-6 4h2v2H6v-2zm6 0h-2v2h2v-2z",fill:"currentColor"})}),EB=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M20 11v2H8v2H6v-2H4v-2h2V9h2v2h12zM10 7H8v2h2V7zm0 0h2V5h-2v2zm0 10H8v-2h2v2zm0 0h2v2h-2v-2z",fill:"currentColor"})}),Fa=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M4 11v2h12v2h2v-2h2v-2h-2V9h-2v2H4zm10-4h2v2h-2V7zm0 0h-2V5h2v2zm0 10h2v-2h-2v2zm0 0h-2v2h2v-2z",fill:"currentColor"})}),kB=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M3 3h18v18H3V3zm16 2H5v14h14V5zM7 12h2v5H7v-5zm10-5h-2v10h2V7zm-6 3h2v2h-2v-2zm2 4h-2v3h2v-3z",fill:"currentColor"})}),sa=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M22 4H2v16h20V4zM4 18V6h16v12H4zM8 8H6v2h2v2h2v2h4v-2h2v-2h2V8h-2v2h-2v2h-4v-2H8V8z",fill:"currentColor"})}),FC=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M6 2h8v2H6V2zM4 6V4h2v2H4zm0 8H2V6h2v8zm2 2H4v-2h2v2zm8 0v2H6v-2h8zm2-2h-2v2h2v2h2v2h2v2h2v-2h-2v-2h-2v-2h-2v-2zm0-8h2v8h-2V6zm0 0V4h-2v2h2z",fill:"currentColor"})}),Xd=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M15 2H9v2H7v6h2V4h6V2zm0 8H9v2h6v-2zm0-6h2v6h-2V4zM4 16h2v-2h12v2H6v4h12v-4h2v6H4v-6z",fill:"currentColor"})}),ft=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M11 0H5v2H3v6h2v2h6V8H5V2h6V0zm0 2h2v6h-2V2zM0 14h2v4h12v2H0v-6zm2 0h12v-2H2v2zm14 0h-2v6h2v-6zM15 0h4v2h-4V0zm4 8h-4v2h4V8zm0-6h2v6h-2V2zm5 12h-2v4h-4v2h6v-6zm-6-2h4v2h-4v-2z",fill:"currentColor"})}),Jt=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M5 5h2v2H5V5zm4 4H7V7h2v2zm2 2H9V9h2v2zm2 0h-2v2H9v2H7v2H5v2h2v-2h2v-2h2v-2h2v2h2v2h2v2h2v-2h-2v-2h-2v-2h-2v-2zm2-2v2h-2V9h2zm2-2v2h-2V7h2zm0 0V5h2v2h-2z",fill:"currentColor"})}),IC=({className:e="",size:t=24})=>a.jsx(mg,{size:t,className:$e(e,"w-4 h-4")}),fa=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M2 4h20v4H2V4zm18 2v2H4V6h16zm0 6H2v4h18v-4zm-2 2v2H4v-2h14zM2 16h20v4H2v-4zm18 2v2H4v-2h16z",fill:"currentColor"})}),MB=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 2c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm0 4c2.21 0 4 1.79 4 4s-1.79 4-4 4-4-1.79-4-4 1.79-4 4-4zm0 6c1.38 0 2.5-1.12 2.5-2.5S13.38 11.5 12 11.5 9.5 12.62 9.5 14 10.62 16.5 12 16.5z",fill:"currentColor"})}),Gm=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M15 2H9v2H7v6h2V4h6V2zm0 8H9v2h6v-2zm0-6h2v6h-2V4zM4 16h2v-2h8v2H6v4h8v-4h2v6H4v-6zm10-4h-2v2h2v-2z",fill:"currentColor"})}),Zl=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M15 2H9v2H7v6h2V4h6V2zm0 8H9v2h6v-2zm0-6h2v6h-2V4zM4 16h2v-2h8v2H6v4h8v-4h2v6H4v-6zm12-6h-2v2h2v2h2v-2h-2v-2z",fill:"currentColor"})}),Zm=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8 0-1.57.46-3.03 1.24-4.26L16.26 18.76C15.03 19.54 13.57 20 12 20zm6.76-3.74L7.74 5.24C8.97 4.46 10.43 4 12 4c4.41 0 8 3.59 8 8 0 1.57-.46 3.03-1.24 4.26z",fill:"currentColor"})}),tr=e=>a.jsx(Vs,{...e,className:"w-4 h-4 animate-spin"}),TB=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M6 2h12v2H6V2zm0 2v16h12V4H6zm8 2H10v2h4V6zm-4 4h4v8h-4v-8z",fill:"currentColor"})}),DB=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M8 4h2v4h4V4h2v4h4v2h-4v4h4v2h-4v4h-2v-4H8v4H6v-4H2v-2h4V8H2V6h4V4zm2 6v4h4v-4h-4z",fill:"currentColor"})}),An=({className:e="",size:t=24})=>a.jsx(CB,{className:e,size:t}),pw=({className:e="",size:t=24})=>a.jsx(kB,{className:e,size:t}),yu=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M4 2h12v2H4v12H2V2h2zm4 4h12v16H8V6zm2 2v12h8V8h-8z",fill:"currentColor"})}),WC=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M12 2h2v2h-2V2zm-2 4H8v2H6v2h2v2h2v-2h2V8h-2V6zm6 0h-2v2h2V6zm2 0h2v2h-2V6zm-6 8h-2v-2h2v2zm-4 0H6v-2h2v2zm-4 0H2v-2h2v2zm8 4h-2v-2h2v2zm4 0h2v-2h-2v2zm-6 2h2v2h-2v-2zm4 0h2v2h-2v-2z",fill:"currentColor"})}),_B=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M12 2h2v2h-2V2zm-2 4h6v2h-2v6h-2V8H8V6zm-4 8h12v2H4v-2zm0 4h12v2H4v-2z",fill:"currentColor"})}),wu=({className:e="",size:t=24})=>a.jsx(hR,{className:$e(e,"w-4 h-4"),size:t}),vw=({className:e="",size:t=24})=>a.jsx(cR,{className:$e(e,"w-4 h-4"),size:t}),E0=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-1-5l6-6-1.41-1.41L11 12.17l-2.59-2.58L7 10.59l4 4z",fill:"currentColor"})}),bw=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M12 1h2v8h8v4h-2v-2h-8V5h-2V1zM8 7V5h2v2H8zM6 9V7h2v2H6zm-2 2V9h2v2H4zm10 8v2h-2v2h-2v-8H2v-4h2v2h8v6h2zm2-2v2h-2v-2h2zm2-2v2h-2v-2h2zm0 0h2v-2h-2v2z",fill:"currentColor"})}),hr=(e,t,n)=>{const s=document.createElement(e),[r,i]=Array.isArray(t)?[void 0,t]:[t,n];return r&&Object.assign(s,r),i==null||i.forEach(o=>s.appendChild(o)),s},AB=(e,t)=>{var n;return t==="left"?e.offsetLeft:(((n=e.offsetParent instanceof HTMLElement?e.offsetParent:null)==null?void 0:n.offsetWidth)??0)-e.offsetWidth-e.offsetLeft},OB=e=>e.offsetWidth>0&&e.offsetHeight>0,zB=(e,t)=>{!customElements.get(e)&&customElements.define(e,t)};function RB(e,t,{reverse:n=!1}={}){const s=e.length;for(let r=n?s-1:0;n?r>=0:r<s;n?r--:r++)t(e[r],r)}function UB(e,t,n,s){const r=t.formatToParts(e);n&&r.unshift({type:"prefix",value:n}),s&&r.push({type:"suffix",value:s});const i=[],o=[],l=[],c=[],u={},h=v=>`${v}:${u[v]=(u[v]??-1)+1}`;let d="",f=!1,x=!1;for(const v of r){d+=v.value;const j=v.type==="minusSign"||v.type==="plusSign"?"sign":v.type;j==="integer"?(f=!0,o.push(...v.value.split("").map(g=>({type:j,value:parseInt(g)})))):j==="group"?o.push({type:j,value:v.value}):j==="decimal"?(x=!0,l.push({type:j,value:v.value,key:h(j)})):j==="fraction"?l.push(...v.value.split("").map(g=>({type:j,value:parseInt(g),key:h(j),pos:-1-u[j]}))):(f||x?c:i).push({type:j,value:v.value,key:h(j)})}const y=[];for(let v=o.length-1;v>=0;v--){const j=o[v];y.unshift(j.type==="integer"?{...j,key:h(j.type),pos:u[j.type]}:{...j,key:h(j.type)})}return{pre:i,integer:y,fraction:l,post:c,valueAsString:d,value:typeof e=="string"?parseFloat(e):e}}const $B=String.raw,PB=(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0})(),LB=typeof CSS<"u"&&CSS.supports&&CSS.supports("line-height","mod(1,1)"),yw=typeof matchMedia<"u"?matchMedia("(prefers-reduced-motion: reduce)"):null,jh="--_number-flow-d-opacity",k0="--_number-flow-d-width",Nh="--_number-flow-dx",M0="--_number-flow-d",HB=(()=>{try{return CSS.registerProperty({name:jh,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:Nh,syntax:"<length>",inherits:!0,initialValue:"0px"}),CSS.registerProperty({name:k0,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:M0,syntax:"<number>",inherits:!0,initialValue:"0"}),!0}catch{return!1}})(),BB="var(--number-flow-char-height, 1em)",Ba="var(--number-flow-mask-height, 0.25em)",ww=`calc(${Ba} / 2)`,Dg="var(--number-flow-mask-width, 0.5em)",Dr=`calc(${Dg} / var(--scale-x))`,Gd="#000 0, transparent 71%",jw=$B`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:${BB} !important}.number,.number__inner{display:inline-block;transform-origin:left top}:host([data-will-change]) :is(.number,.number__inner,.section,.digit,.digit__num,.symbol){will-change:transform}.number{--scale-x:calc(1 + var(${k0}) / var(--width));transform:translateX(var(${Nh})) scaleX(var(--scale-x));margin:0 calc(-1 * ${Dg});position:relative;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 ${Dr},#000 calc(100% - ${Dr}),transparent ),linear-gradient(to bottom,transparent 0,#000 ${Ba},#000 calc(100% - ${Ba}),transparent 100% ),radial-gradient(at bottom right,${Gd}),radial-gradient(at bottom left,${Gd}),radial-gradient(at top left,${Gd}),radial-gradient(at top right,${Gd});-webkit-mask-size:100% calc(100% - ${Ba} * 2),calc(100% - ${Dr} * 2) 100%,${Dr} ${Ba},${Dr} ${Ba},${Dr} ${Ba},${Dr} ${Ba};-webkit-mask-position:center,center,top left,top right,bottom right,bottom left;-webkit-mask-repeat:no-repeat}.number__inner{padding:${ww} ${Dg};transform:scaleX(calc(1 / var(--scale-x))) translateX(calc(-1 * var(${Nh})))}:host > :not(.number){z-index:5}.section,.symbol{display:inline-block;position:relative;isolation:isolate}.section::after{content:'\200b';display:inline-block}.section--justify-left{transform-origin:center left}.section--justify-right{transform-origin:center right}.section > [inert],.symbol > [inert]{margin:0 !important;position:absolute !important;z-index:-1}.digit{display:inline-block;position:relative;--c:var(--current) + var(${M0})}.digit__num,.number .section::after{padding:${ww} 0}.digit__num{display:inline-block;--offset-raw:mod(var(--length) + var(--n) - mod(var(--c),var(--length)),var(--length));--offset:calc( var(--offset-raw) - var(--length) * round(down,var(--offset-raw) / (var(--length) / 2),1) );--y:clamp(-100%,var(--offset) * 100%,100%);transform:translateY(var(--y))}.digit__num[inert]{position:absolute;top:0;left:50%;transform:translateX(-50%) translateY(var(--y))}.digit:not(.is-spinning) .digit__num[inert]{display:none}.symbol__value{display:inline-block;mix-blend-mode:plus-lighter;white-space:pre}.section--justify-left .symbol > [inert]{left:0}.section--justify-right .symbol > [inert]{right:0}.animate-presence{opacity:calc(1 + var(${jh}))}`,VB=HTMLElement,YB=LB&&PB&&HB;let Zd;class qC extends VB{constructor(){super(),this.created=!1,this.batched=!1;const{animated:t,...n}=this.constructor.defaultProps;this._animated=this.computedAnimated=t,Object.assign(this,n)}get animated(){return this._animated}set animated(t){var n;this.animated!==t&&(this._animated=t,(n=this.shadowRoot)==null||n.getAnimations().forEach(s=>s.finish()))}set data(t){var n;if(t==null)return;const{pre:s,integer:r,fraction:i,post:o,value:l}=t;if(this.created){const c=this._data;this._data=t,this.computedTrend=typeof this.trend=="function"?this.trend(c.value,l):this.trend,this.computedAnimated=YB&&this._animated&&(!this.respectMotionPreference||!(yw!=null&&yw.matches))&&OB(this),(n=this.plugins)==null||n.forEach(u=>{var h;return(h=u.onUpdate)==null?void 0:h.call(u,t,c,this)}),this.batched||this.willUpdate(),this._pre.update(s),this._num.update({integer:r,fraction:i}),this._post.update(o),this.batched||this.didUpdate()}else{this._data=t,this.attachShadow({mode:"open"});try{this._internals??(this._internals=this.attachInternals()),this._internals.role="img"}catch{}if(typeof CSSStyleSheet<"u"&&this.shadowRoot.adoptedStyleSheets)Zd||(Zd=new CSSStyleSheet,Zd.replaceSync(jw)),this.shadowRoot.adoptedStyleSheets=[Zd];else{const c=document.createElement("style");c.textContent=jw,this.shadowRoot.appendChild(c)}this._pre=new Sw(this,s,{justify:"right",part:"left"}),this.shadowRoot.appendChild(this._pre.el),this._num=new FB(this,r,i),this.shadowRoot.appendChild(this._num.el),this._post=new Sw(this,o,{justify:"left",part:"right"}),this.shadowRoot.appendChild(this._post.el),this.created=!0}try{this._internals.ariaLabel=t.valueAsString}catch{}}willUpdate(){this._pre.willUpdate(),this._num.willUpdate(),this._post.willUpdate()}didUpdate(){if(!this.computedAnimated)return;this._abortAnimationsFinish?this._abortAnimationsFinish.abort():this.dispatchEvent(new Event("animationsstart")),this._pre.didUpdate(),this._num.didUpdate(),this._post.didUpdate();const t=new AbortController;Promise.all(this.shadowRoot.getAnimations().map(n=>n.finished)).then(()=>{t.signal.aborted||(this.dispatchEvent(new Event("animationsfinish")),this._abortAnimationsFinish=void 0)}),this._abortAnimationsFinish=t}}qC.defaultProps={transformTiming:{duration:900,easing:"linear(0,.005,.019,.039,.066,.096,.129,.165,.202,.24,.278,.316,.354,.39,.426,.461,.494,.526,.557,.586,.614,.64,.665,.689,.711,.731,.751,.769,.786,.802,.817,.831,.844,.856,.867,.877,.887,.896,.904,.912,.919,.925,.931,.937,.942,.947,.951,.955,.959,.962,.965,.968,.971,.973,.976,.978,.98,.981,.983,.984,.986,.987,.988,.989,.99,.991,.992,.992,.993,.994,.994,.995,.995,.996,.996,.9963,.9967,.9969,.9972,.9975,.9977,.9979,.9981,.9982,.9984,.9985,.9987,.9988,.9989,1)"},spinTiming:void 0,opacityTiming:{duration:450,easing:"ease-out"},animated:!0,trend:(e,t)=>Math.sign(t-e),respectMotionPreference:!0,plugins:void 0,digits:void 0};class FB{constructor(t,n,s,{className:r,...i}={}){this.flow=t,this._integer=new Nw(t,n,{justify:"right",part:"integer"}),this._fraction=new Nw(t,s,{justify:"left",part:"fraction"}),this._inner=hr("span",{className:"number__inner"},[this._integer.el,this._fraction.el]),this.el=hr("span",{...i,part:"number",className:`number ${r??""}`},[this._inner])}willUpdate(){this._prevWidth=this.el.offsetWidth,this._prevLeft=this.el.getBoundingClientRect().left,this._integer.willUpdate(),this._fraction.willUpdate()}update({integer:t,fraction:n}){this._integer.update(t),this._fraction.update(n)}didUpdate(){const t=this.el.getBoundingClientRect();this._integer.didUpdate(),this._fraction.didUpdate();const n=this._prevLeft-t.left,s=this.el.offsetWidth,r=this._prevWidth-s;this.el.style.setProperty("--width",String(s)),this.el.animate({[Nh]:[`${n}px`,"0px"],[k0]:[r,0]},{...this.flow.transformTiming,composite:"accumulate"})}}class XC{constructor(t,n,{justify:s,className:r,...i},o){this.flow=t,this.children=new Map,this.onCharRemove=c=>()=>{this.children.delete(c)},this.justify=s;const l=n.map(c=>this.addChar(c).el);this.el=hr("span",{...i,className:`section section--justify-${s} ${r??""}`},o?o(l):l)}addChar(t,{startDigitsAtZero:n=!1,...s}={}){const r=t.type==="integer"||t.type==="fraction"?new ZC(this,t.type,n?0:t.value,t.pos,{...s,onRemove:this.onCharRemove(t.key)}):new IB(this,t.type,t.value,{...s,onRemove:this.onCharRemove(t.key)});return this.children.set(t.key,r),r}unpop(t){t.el.removeAttribute("inert"),t.el.style.top="",t.el.style[this.justify]=""}pop(t){t.forEach(n=>{n.el.style.top=`${n.el.offsetTop}px`,n.el.style[this.justify]=`${AB(n.el,this.justify)}px`}),t.forEach(n=>{n.el.setAttribute("inert",""),n.present=!1})}addNewAndUpdateExisting(t){const n=new Map,s=new Map,r=this.justify==="left",i=r?"prepend":"append";if(RB(t,o=>{let l;this.children.has(o.key)?(l=this.children.get(o.key),s.set(o,l),this.unpop(l),l.present=!0):(l=this.addChar(o,{startDigitsAtZero:!0,animateIn:!0}),n.set(o,l)),this.el[i](l.el)},{reverse:r}),this.flow.computedAnimated){const o=this.el.getBoundingClientRect();n.forEach(l=>{l.willUpdate(o)})}n.forEach((o,l)=>{o.update(l.value)}),s.forEach((o,l)=>{o.update(l.value)})}willUpdate(){const t=this.el.getBoundingClientRect();this._prevOffset=t[this.justify],this.children.forEach(n=>n.willUpdate(t))}didUpdate(){const t=this.el.getBoundingClientRect();this.children.forEach(r=>r.didUpdate(t));const n=t[this.justify],s=this._prevOffset-n;s&&this.children.size&&this.el.animate({transform:[`translateX(${s}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}class Nw extends XC{update(t){const n=new Map;this.children.forEach((s,r)=>{t.find(i=>i.key===r)||n.set(r,s),this.unpop(s)}),this.addNewAndUpdateExisting(t),n.forEach(s=>{s instanceof ZC&&s.update(0)}),this.pop(n)}}class Sw extends XC{update(t){const n=new Map;this.children.forEach((s,r)=>{t.find(i=>i.key===r)||n.set(r,s)}),this.pop(n),this.addNewAndUpdateExisting(t)}}class _g{constructor(t,n,{onRemove:s,animateIn:r=!1}={}){this.flow=t,this.el=n,this._present=!0,this._remove=()=>{var i;this.el.remove(),(i=this._onRemove)==null||i.call(this)},this.el.classList.add("animate-presence"),this.flow.computedAnimated&&r&&this.el.animate({[jh]:[-.9999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),this._onRemove=s}get present(){return this._present}set present(t){if(this._present!==t){if(this._present=t,t?this.el.removeAttribute("inert"):this.el.setAttribute("inert",""),!this.flow.computedAnimated){t||this._remove();return}this.el.style.setProperty("--_number-flow-d-opacity",t?"0":"-.999"),this.el.animate({[jh]:t?[-.9999,0]:[.999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),t?this.flow.removeEventListener("animationsfinish",this._remove):this.flow.addEventListener("animationsfinish",this._remove,{once:!0})}}}class GC extends _g{constructor(t,n,s,r){super(t.flow,s,r),this.section=t,this.value=n,this.el=s}}class ZC extends GC{constructor(t,n,s,r,i){var o,l;const c=(((l=(o=t.flow.digits)==null?void 0:o[r])==null?void 0:l.max)??9)+1,u=Array.from({length:c}).map((d,f)=>{const x=hr("span",{className:"digit__num"},[document.createTextNode(String(f))]);return f!==s&&x.setAttribute("inert",""),x.style.setProperty("--n",String(f)),x}),h=hr("span",{part:`digit ${n}-digit`,className:"digit"},u);h.style.setProperty("--current",String(s)),h.style.setProperty("--length",String(c)),super(t,s,h,i),this.pos=r,this._onAnimationsFinish=()=>{this.el.classList.remove("is-spinning")},this._numbers=u,this.length=c}willUpdate(t){const n=this.el.getBoundingClientRect();this._prevValue=this.value;const s=n[this.section.justify]-t[this.section.justify],r=n.width/2;this._prevCenter=this.section.justify==="left"?s+r:s-r}update(t){this.el.style.setProperty("--current",String(t)),this._numbers.forEach((n,s)=>s===t?n.removeAttribute("inert"):n.setAttribute("inert","")),this.value=t}didUpdate(t){const n=this.el.getBoundingClientRect(),s=n[this.section.justify]-t[this.section.justify],r=n.width/2,i=this.section.justify==="left"?s+r:s-r,o=this._prevCenter-i;o&&this.el.animate({transform:[`translateX(${o}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"});const l=this.getDelta();l&&(this.el.classList.add("is-spinning"),this.el.animate({[M0]:[-l,0]},{...this.flow.spinTiming??this.flow.transformTiming,composite:"accumulate"}),this.flow.addEventListener("animationsfinish",this._onAnimationsFinish,{once:!0}))}getDelta(){var t;if(this.flow.plugins)for(const r of this.flow.plugins){const i=(t=r.getDelta)==null?void 0:t.call(r,this.value,this._prevValue,this);if(i!=null)return i}const n=this.value-this._prevValue,s=this.flow.computedTrend||Math.sign(n);return s<0&&this.value>this._prevValue?this.value-this.length-this._prevValue:s>0&&this.value<this._prevValue?this.length-this._prevValue+this.value:n}}class IB extends GC{constructor(t,n,s,r){const i=hr("span",{className:"symbol__value",textContent:s});super(t,s,hr("span",{part:`symbol ${n}`,className:"symbol"},[i]),r),this.type=n,this._children=new Map,this._onChildRemove=o=>()=>{this._children.delete(o)},this._children.set(s,new _g(this.flow,i,{onRemove:this._onChildRemove(s)}))}willUpdate(t){if(this.type==="decimal")return;const n=this.el.getBoundingClientRect();this._prevOffset=n[this.section.justify]-t[this.section.justify]}update(t){if(this.value!==t){const n=this._children.get(this.value);n&&(n.present=!1);const s=this._children.get(t);if(s)s.present=!0;else{const r=hr("span",{className:"symbol__value",textContent:t});this.el.appendChild(r),this._children.set(t,new _g(this.flow,r,{animateIn:!0,onRemove:this._onChildRemove(t)}))}}this.value=t}didUpdate(t){if(this.type==="decimal")return;const n=this.el.getBoundingClientRect()[this.section.justify]-t[this.section.justify],s=this._prevOffset-n;s&&this.el.animate({transform:[`translateX(${s}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}var Tw;const WB=parseInt((Tw=m.version.match(/^(\d+)\./))==null?void 0:Tw[1]),T0=WB>=19,qB=["data","digits"];class D0 extends qC{attributeChangedCallback(t,n,s){this[t]=JSON.parse(s)}}D0.observedAttributes=T0?[]:qB;zB("number-flow-react",D0);const Qm={},Cw=T0?e=>e:JSON.stringify;function Ew(e){const{transformTiming:t,spinTiming:n,opacityTiming:s,animated:r,respectMotionPreference:i,trend:o,plugins:l,...c}=e;return[{transformTiming:t,spinTiming:n,opacityTiming:s,animated:r,respectMotionPreference:i,trend:o,plugins:l},c]}class XB extends m.Component{updateProperties(t){if(!this.el)return;this.el.batched=!this.props.isolate;const[n]=Ew(this.props);Object.entries(n).forEach(([s,r])=>{this.el[s]=r??D0.defaultProps[s]}),t!=null&&t.onAnimationsStart&&this.el.removeEventListener("animationsstart",t.onAnimationsStart),this.props.onAnimationsStart&&this.el.addEventListener("animationsstart",this.props.onAnimationsStart),t!=null&&t.onAnimationsFinish&&this.el.removeEventListener("animationsfinish",t.onAnimationsFinish),this.props.onAnimationsFinish&&this.el.addEventListener("animationsfinish",this.props.onAnimationsFinish)}componentDidMount(){this.updateProperties(),T0&&this.el&&(this.el.digits=this.props.digits,this.el.data=this.props.data)}getSnapshotBeforeUpdate(t){var n;if(this.updateProperties(t),t.data!==this.props.data){if(this.props.group)return this.props.group.willUpdate(),()=>{var s;return(s=this.props.group)==null?void 0:s.didUpdate()};if(!this.props.isolate)return(n=this.el)==null||n.willUpdate(),()=>{var s;return(s=this.el)==null?void 0:s.didUpdate()}}return null}componentDidUpdate(t,n,s){s==null||s()}handleRef(t){this.props.innerRef&&(this.props.innerRef.current=t),this.el=t}render(){const[t,{innerRef:n,className:s,data:r,willChange:i,isolate:o,group:l,digits:c,onAnimationsStart:u,onAnimationsFinish:h,...d}]=Ew(this.props);return m.createElement("number-flow-react",{ref:this.handleRef,"data-will-change":i?"":void 0,class:s,...d,dangerouslySetInnerHTML:{__html:""},suppressHydrationWarning:!0,digits:Cw(c),data:Cw(r)})}constructor(t){super(t),this.handleRef=this.handleRef.bind(this)}}const GB=m.forwardRef(function({value:t,locales:n,format:s,prefix:r,suffix:i,...o},l){m.useImperativeHandle(l,()=>c.current,[]);const c=m.useRef(),u=m.useContext(ZB);u==null||u.useRegister(c);const h=m.useMemo(()=>n?JSON.stringify(n):"",[n]),d=m.useMemo(()=>s?JSON.stringify(s):"",[s]),f=m.useMemo(()=>{var y;const x=Qm[y=`${h}:${d}`]??(Qm[y]=new Intl.NumberFormat(n,s));return UB(t,x,r,i)},[t,h,d,r,i]);return m.createElement(XB,{...o,group:u,data:f,innerRef:c})}),ZB=m.createContext(void 0),QB={notation:"compact",maximumFractionDigits:1};function xs({value:e,loading:t=!1,className:n,prefix:s,suffix:r,format:i,trend:o,fallback:l="…"}){const c=m.useMemo(()=>{if(e==null)return 0;const d=Number(e);return Number.isFinite(d)?d:0},[e]);if(t)return a.jsxs("span",{className:hh("inline-flex items-baseline",n),children:[s,l,r]});const u=GB,h=typeof o=="boolean"?o?1:0:o;return a.jsxs("span",{className:hh("inline-flex",n),children:[s,a.jsx(u,{value:c,format:i??QB,trend:h,className:"inline-flex"}),r]})}function Rn({id:e,label:t="ID",className:n="",variant:s="inline"}){const[r,i]=m.useState(!1),o=async()=>{try{await navigator.clipboard.writeText(e),i(!0),B.success("Copied to clipboard"),setTimeout(()=>i(!1),2e3)}catch{B.error("Failed to copy to clipboard")}};return s==="detail"?a.jsxs("div",{className:`flex justify-between items-center ${n}`,children:[a.jsxs("span",{className:"text-gray-400",children:[t,":"]}),a.jsxs("button",{onClick:o,className:"flex items-center gap-2 text-white text-sm hover:text-white/80 transition-colors group",title:"Click to copy",children:[a.jsx("span",{className:"font-mono",children:e}),r?a.jsx(fg,{className:"w-3 h-3 text-green-500"}):a.jsx(by,{className:"w-3 h-3 text-gray-400 group-hover:text-white transition-colors"})]})]}):s==="subscript"?a.jsxs("sup",{onClick:o,className:`text-xs text-gray-500 ml-2 cursor-pointer hover:text-white transition-colors inline-flex items-center gap-1 ${n}`,title:"Click to copy User ID",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsxs("span",{className:"text-white/80 font-mono text-xs",children:[e.slice(0,8),"..."]}),a.jsx("span",{className:"ml-1",children:"]"})]}):a.jsxs("button",{onClick:o,className:`flex items-center gap-1.5 text-sm text-gray-400 hover:text-white transition-colors group ${n}`,title:"Click to copy",children:[a.jsxs("span",{children:[t,":"]}),a.jsx("span",{className:"font-mono",children:e}),r?a.jsx(fg,{className:"w-3 h-3 text-green-500"}):a.jsx(by,{className:"w-3 h-3 opacity-0 group-hover:opacity-100 transition-opacity"})]})}function fi({title:e="Seeding Terminal",lines:t,isRunning:n=!1,className:s="",defaultCollapsed:r=!1}){const[i,o]=m.useState(r),l=m.useRef(null);m.useEffect(()=>{const d=l.current;!d||i||d.scrollTo({top:d.scrollHeight,behavior:"smooth"})},[i]);const c=d=>{switch(d.type){case"success":return a.jsx(Ht,{className:"w-3 h-3 text-green-400"});case"error":return a.jsx($r,{className:"w-3 h-3 text-red-400"});case"progress":return d.status==="running"?a.jsx(Vs,{className:"w-3 h-3 text-blue-400 animate-spin"}):d.status==="completed"?a.jsx(Ht,{className:"w-3 h-3 text-green-400"}):d.status==="failed"?a.jsx($r,{className:"w-3 h-3 text-red-400"}):a.jsx("div",{className:"w-3 h-3 border border-gray-500 rounded-full"});default:return a.jsx("div",{className:"w-3 h-3 border border-gray-500 rounded-full"})}},u=d=>{switch(d.type){case"success":return"text-green-400";case"error":return"text-red-400";case"progress":return d.status==="running"?"text-blue-400":d.status==="completed"?"text-green-400":d.status==="failed"?"text-red-400":"text-gray-400";default:return"text-gray-300"}},h=d=>d.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})+"."+d.getMilliseconds().toString().padStart(3,"0");return a.jsxs("div",{className:`bg-black/90 border border-dashed border-white/20 rounded-none font-mono text-xs ${s}`,children:[a.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-dashed border-white/10",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(uR,{className:"w-3 h-3 text-green-400"}),a.jsx("span",{className:"text-green-400 font-medium text-xs",children:e})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[n&&a.jsxs("div",{className:"flex items-center space-x-1",children:[a.jsx("div",{className:"w-1.5 h-1.5 bg-green-400 rounded-full animate-pulse"}),a.jsx("span",{className:"text-green-400 text-xs",children:"RUNNING"})]}),a.jsxs("div",{className:"text-gray-400 text-xs",children:[t.length," / ",t.length]}),a.jsx("button",{onClick:()=>o(!i),className:"text-gray-400 hover:text-white transition-colors",children:i?a.jsx(of,{className:"w-3 h-3"}):a.jsx(nR,{className:"w-3 h-3"})})]})]}),!i&&a.jsxs("div",{ref:l,className:"p-3 space-y-0.5 h-56 overflow-y-auto",children:[t.length===0?a.jsxs("div",{className:"text-gray-500 italic text-xs",children:[a.jsx("span",{className:"text-green-400",children:"$"})," Waiting for operations..."]}):t.map(d=>a.jsxs("div",{className:`flex items-start space-x-3 py-1 ${u(d)} text-xs`,children:[a.jsx("span",{className:"text-gray-500 text-xs w-20 flex-shrink-0",children:h(d.timestamp)}),a.jsx("span",{className:"text-green-400 flex-shrink-0",children:"$"}),a.jsx("div",{className:"flex-shrink-0 mt-0.5",children:c(d)}),a.jsx("span",{className:"flex-1 min-w-0 break-words",children:d.message})]},d.id)),n&&a.jsxs("div",{className:"flex items-start space-x-3 py-1 text-green-400 text-xs",children:[a.jsx("span",{className:"text-gray-500 text-xs w-20 flex-shrink-0",children:h(new Date)}),a.jsx("span",{className:"text-green-400 flex-shrink-0",children:"$"}),a.jsx("div",{className:"w-3 h-3 flex-shrink-0 mt-0.5"}),a.jsx("span",{className:"flex-1 flex items-center",children:a.jsx("span",{className:"animate-pulse",children:"█"})})]})]}),!i&&a.jsx("div",{className:"px-3 py-1.5 border-t border-dashed border-white/10 bg-black/50",children:a.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-400",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("span",{children:["Status: ",n?"Active":"Idle"]}),a.jsxs("span",{children:["Lines: ",t.length]})]}),a.jsxs("div",{className:"flex items-center space-x-1",children:[a.jsx("div",{className:"w-1.5 h-1.5 bg-green-400 rounded-full"}),a.jsx("span",{children:"Better Auth Studio"})]})]})})]})}const QC=document.createElement("style");QC.textContent=`
437
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return m.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},SU="DialogDescriptionWarning",CU=({contentRef:e,descriptionId:t})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${W4(SU).contentName}}.`;return m.useEffect(()=>{var i;const r=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(s))},[s,e,t]),null},EU=U4,kU=L4,MU=H4,TU=B4,DU=Symbol.for("react.lazy"),vh=kh[" use ".trim().toString()];function _U(e){return typeof e=="object"&&e!==null&&"then"in e}function q4(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===DU&&"_payload"in e&&_U(e._payload)}function X4(e){const t=OU(e),n=m.forwardRef((s,r)=>{let{children:i,...o}=s;q4(i)&&typeof vh=="function"&&(i=vh(i._payload));const l=m.Children.toArray(i),c=l.find(RU);if(c){const u=c.props.children,h=l.map(d=>d===c?m.Children.count(u)>1?m.Children.only(null):m.isValidElement(u)?u.props.children:null:d);return a.jsx(t,{...o,ref:r,children:m.isValidElement(u)?m.cloneElement(u,void 0,h):null})}return a.jsx(t,{...o,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}var AU=X4("Slot");function OU(e){const t=m.forwardRef((n,s)=>{let{children:r,...i}=n;if(q4(r)&&typeof vh=="function"&&(r=vh(r._payload)),m.isValidElement(r)){const o=$U(r),l=UU(i,r.props);return r.type!==m.Fragment&&(l.ref=s?gr(s,o):o),m.cloneElement(r,l)}return m.Children.count(r)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var zU=Symbol("radix.slottable");function RU(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===zU}function UU(e,t){const n={...t};for(const s in t){const r=e[s],i=t[s];/^on[A-Z]/.test(s)?r&&i?n[s]=(...l)=>{const c=i(...l);return r(...l),c}:r&&(n[s]=r):s==="style"?n[s]={...r,...i}:s==="className"&&(n[s]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function $U(e){var s,r;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var PU=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Sr=PU.reduce((e,t)=>{const n=X4(`Primitive.${t}`),s=m.forwardRef((r,i)=>{const{asChild:o,...l}=r,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{}),vl='[cmdk-group=""]',Vm='[cmdk-group-items=""]',LU='[cmdk-group-heading=""]',G4='[cmdk-item=""]',Qy=`${G4}:not([aria-disabled="true"])`,kg="cmdk-item-select",$i="data-value",HU=(e,t,n)=>y9(e,t,n),Z4=m.createContext(void 0),Kc=()=>m.useContext(Z4),Q4=m.createContext(void 0),w0=()=>m.useContext(Q4),K4=m.createContext(void 0),J4=m.forwardRef((e,t)=>{let n=Pi(()=>{var R,P;return{search:"",value:(P=(R=e.value)!=null?R:e.defaultValue)!=null?P:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),s=Pi(()=>new Set),r=Pi(()=>new Map),i=Pi(()=>new Map),o=Pi(()=>new Set),l=eC(e),{label:c,children:u,value:h,onValueChange:d,filter:f,shouldFilter:x,loop:y,disablePointerSelection:v=!1,vimBindings:j=!0,...g}=e,b=ps(),p=ps(),w=ps(),N=m.useRef(null),S=QU();ui(()=>{if(h!==void 0){let R=h.trim();n.current.value=R,C.emit()}},[h]),ui(()=>{S(6,Y)},[]);let C=m.useMemo(()=>({subscribe:R=>(o.current.add(R),()=>o.current.delete(R)),snapshot:()=>n.current,setState:(R,P,W)=>{var q,ee,ne,Z;if(!Object.is(n.current[R],P)){if(n.current[R]=P,R==="search")z(),H(),S(1,U);else if(R==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let se=document.getElementById(w);se?se.focus():(q=document.getElementById(b))==null||q.focus()}if(S(7,()=>{var se;n.current.selectedItemId=(se=k())==null?void 0:se.id,C.emit()}),W||S(5,Y),((ee=l.current)==null?void 0:ee.value)!==void 0){let se=P??"";(Z=(ne=l.current).onValueChange)==null||Z.call(ne,se);return}}C.emit()}},emit:()=>{o.current.forEach(R=>R())}}),[]),T=m.useMemo(()=>({value:(R,P,W)=>{var q;P!==((q=i.current.get(R))==null?void 0:q.value)&&(i.current.set(R,{value:P,keywords:W}),n.current.filtered.items.set(R,O(P,W)),S(2,()=>{H(),C.emit()}))},item:(R,P)=>(s.current.add(R),P&&(r.current.has(P)?r.current.get(P).add(R):r.current.set(P,new Set([R]))),S(3,()=>{z(),H(),n.current.value||U(),C.emit()}),()=>{i.current.delete(R),s.current.delete(R),n.current.filtered.items.delete(R);let W=k();S(4,()=>{z(),(W==null?void 0:W.getAttribute("id"))===R&&U(),C.emit()})}),group:R=>(r.current.has(R)||r.current.set(R,new Set),()=>{i.current.delete(R),r.current.delete(R)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:b,inputId:w,labelId:p,listInnerRef:N}),[]);function O(R,P){var W,q;let ee=(q=(W=l.current)==null?void 0:W.filter)!=null?q:HU;return R?ee(R,n.current.search,P):0}function H(){if(!n.current.search||l.current.shouldFilter===!1)return;let R=n.current.filtered.items,P=[];n.current.filtered.groups.forEach(q=>{let ee=r.current.get(q),ne=0;ee.forEach(Z=>{let se=R.get(Z);ne=Math.max(se,ne)}),P.push([q,ne])});let W=N.current;$().sort((q,ee)=>{var ne,Z;let se=q.getAttribute("id"),xe=ee.getAttribute("id");return((ne=R.get(xe))!=null?ne:0)-((Z=R.get(se))!=null?Z:0)}).forEach(q=>{let ee=q.closest(Vm);ee?ee.appendChild(q.parentElement===ee?q:q.closest(`${Vm} > *`)):W.appendChild(q.parentElement===W?q:q.closest(`${Vm} > *`))}),P.sort((q,ee)=>ee[1]-q[1]).forEach(q=>{var ee;let ne=(ee=N.current)==null?void 0:ee.querySelector(`${vl}[${$i}="${encodeURIComponent(q[0])}"]`);ne==null||ne.parentElement.appendChild(ne)})}function U(){let R=$().find(W=>W.getAttribute("aria-disabled")!=="true"),P=R==null?void 0:R.getAttribute($i);C.setState("value",P||void 0)}function z(){var R,P,W,q;if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=s.current.size;return}n.current.filtered.groups=new Set;let ee=0;for(let ne of s.current){let Z=(P=(R=i.current.get(ne))==null?void 0:R.value)!=null?P:"",se=(q=(W=i.current.get(ne))==null?void 0:W.keywords)!=null?q:[],xe=O(Z,se);n.current.filtered.items.set(ne,xe),xe>0&&ee++}for(let[ne,Z]of r.current)for(let se of Z)if(n.current.filtered.items.get(se)>0){n.current.filtered.groups.add(ne);break}n.current.filtered.count=ee}function Y(){var R,P,W;let q=k();q&&(((R=q.parentElement)==null?void 0:R.firstChild)===q&&((W=(P=q.closest(vl))==null?void 0:P.querySelector(LU))==null||W.scrollIntoView({block:"nearest"})),q.scrollIntoView({block:"nearest"}))}function k(){var R;return(R=N.current)==null?void 0:R.querySelector(`${G4}[aria-selected="true"]`)}function $(){var R;return Array.from(((R=N.current)==null?void 0:R.querySelectorAll(Qy))||[])}function M(R){let P=$()[R];P&&C.setState("value",P.getAttribute($i))}function A(R){var P;let W=k(),q=$(),ee=q.findIndex(Z=>Z===W),ne=q[ee+R];(P=l.current)!=null&&P.loop&&(ne=ee+R<0?q[q.length-1]:ee+R===q.length?q[0]:q[ee+R]),ne&&C.setState("value",ne.getAttribute($i))}function E(R){let P=k(),W=P==null?void 0:P.closest(vl),q;for(;W&&!q;)W=R>0?GU(W,vl):ZU(W,vl),q=W==null?void 0:W.querySelector(Qy);q?C.setState("value",q.getAttribute($i)):A(R)}let D=()=>M($().length-1),_=R=>{R.preventDefault(),R.metaKey?D():R.altKey?E(1):A(1)},I=R=>{R.preventDefault(),R.metaKey?M(0):R.altKey?E(-1):A(-1)};return m.createElement(Sr.div,{ref:t,tabIndex:-1,...g,"cmdk-root":"",onKeyDown:R=>{var P;(P=g.onKeyDown)==null||P.call(g,R);let W=R.nativeEvent.isComposing||R.keyCode===229;if(!(R.defaultPrevented||W))switch(R.key){case"n":case"j":{j&&R.ctrlKey&&_(R);break}case"ArrowDown":{_(R);break}case"p":case"k":{j&&R.ctrlKey&&I(R);break}case"ArrowUp":{I(R);break}case"Home":{R.preventDefault(),M(0);break}case"End":{R.preventDefault(),D();break}case"Enter":{R.preventDefault();let q=k();if(q){let ee=new Event(kg);q.dispatchEvent(ee)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:T.inputId,id:T.labelId,style:JU},c),wf(e,R=>m.createElement(Q4.Provider,{value:C},m.createElement(Z4.Provider,{value:T},R))))}),BU=m.forwardRef((e,t)=>{var n,s;let r=ps(),i=m.useRef(null),o=m.useContext(K4),l=Kc(),c=eC(e),u=(s=(n=c.current)==null?void 0:n.forceMount)!=null?s:o==null?void 0:o.forceMount;ui(()=>{if(!u)return l.item(r,o==null?void 0:o.id)},[u]);let h=tC(r,i,[e.value,e.children,i],e.keywords),d=w0(),f=yr(S=>S.value&&S.value===h.current),x=yr(S=>u||l.filter()===!1?!0:S.search?S.filtered.items.get(r)>0:!0);m.useEffect(()=>{let S=i.current;if(!(!S||e.disabled))return S.addEventListener(kg,y),()=>S.removeEventListener(kg,y)},[x,e.onSelect,e.disabled]);function y(){var S,C;v(),(C=(S=c.current).onSelect)==null||C.call(S,h.current)}function v(){d.setState("value",h.current,!0)}if(!x)return null;let{disabled:j,value:g,onSelect:b,forceMount:p,keywords:w,...N}=e;return m.createElement(Sr.div,{ref:gr(i,t),...N,id:r,"cmdk-item":"",role:"option","aria-disabled":!!j,"aria-selected":!!f,"data-disabled":!!j,"data-selected":!!f,onPointerMove:j||l.getDisablePointerSelection()?void 0:v,onClick:j?void 0:y},e.children)}),VU=m.forwardRef((e,t)=>{let{heading:n,children:s,forceMount:r,...i}=e,o=ps(),l=m.useRef(null),c=m.useRef(null),u=ps(),h=Kc(),d=yr(x=>r||h.filter()===!1?!0:x.search?x.filtered.groups.has(o):!0);ui(()=>h.group(o),[]),tC(o,l,[e.value,e.heading,c]);let f=m.useMemo(()=>({id:o,forceMount:r}),[r]);return m.createElement(Sr.div,{ref:gr(l,t),...i,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&m.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),wf(e,x=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},m.createElement(K4.Provider,{value:f},x))))}),YU=m.forwardRef((e,t)=>{let{alwaysRender:n,...s}=e,r=m.useRef(null),i=yr(o=>!o.search);return!n&&!i?null:m.createElement(Sr.div,{ref:gr(r,t),...s,"cmdk-separator":"",role:"separator"})}),FU=m.forwardRef((e,t)=>{let{onValueChange:n,...s}=e,r=e.value!=null,i=w0(),o=yr(u=>u.search),l=yr(u=>u.selectedItemId),c=Kc();return m.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),m.createElement(Sr.input,{ref:t,...s,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:r?e.value:o,onChange:u=>{r||i.setState("search",u.target.value),n==null||n(u.target.value)}})}),IU=m.forwardRef((e,t)=>{let{children:n,label:s="Suggestions",...r}=e,i=m.useRef(null),o=m.useRef(null),l=yr(u=>u.selectedItemId),c=Kc();return m.useEffect(()=>{if(o.current&&i.current){let u=o.current,h=i.current,d,f=new ResizeObserver(()=>{d=requestAnimationFrame(()=>{let x=u.offsetHeight;h.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return f.observe(u),()=>{cancelAnimationFrame(d),f.unobserve(u)}}},[]),m.createElement(Sr.div,{ref:gr(i,t),...r,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":s,id:c.listId},wf(e,u=>m.createElement("div",{ref:gr(o,c.listInnerRef),"cmdk-list-sizer":""},u)))}),WU=m.forwardRef((e,t)=>{let{open:n,onOpenChange:s,overlayClassName:r,contentClassName:i,container:o,...l}=e;return m.createElement(EU,{open:n,onOpenChange:s},m.createElement(kU,{container:o},m.createElement(MU,{"cmdk-overlay":"",className:r}),m.createElement(TU,{"aria-label":e.label,"cmdk-dialog":"",className:i},m.createElement(J4,{ref:t,...l}))))}),qU=m.forwardRef((e,t)=>yr(n=>n.filtered.count===0)?m.createElement(Sr.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),XU=m.forwardRef((e,t)=>{let{progress:n,children:s,label:r="Loading...",...i}=e;return m.createElement(Sr.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":r},wf(e,o=>m.createElement("div",{"aria-hidden":!0},o)))}),bl=Object.assign(J4,{List:IU,Item:BU,Input:FU,Group:VU,Separator:YU,Dialog:WU,Empty:qU,Loading:XU});function GU(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function ZU(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function eC(e){let t=m.useRef(e);return ui(()=>{t.current=e}),t}var ui=typeof window>"u"?m.useEffect:m.useLayoutEffect;function Pi(e){let t=m.useRef();return t.current===void 0&&(t.current=e()),t}function yr(e){let t=w0(),n=()=>e(t.snapshot());return m.useSyncExternalStore(t.subscribe,n,n)}function tC(e,t,n,s=[]){let r=m.useRef(),i=Kc();return ui(()=>{var o;let l=(()=>{var u;for(let h of n){if(typeof h=="string")return h.trim();if(typeof h=="object"&&"current"in h)return h.current?(u=h.current.textContent)==null?void 0:u.trim():r.current}})(),c=s.map(u=>u.trim());i.value(e,l,c),(o=t.current)==null||o.setAttribute($i,l),r.current=l}),r}var QU=()=>{let[e,t]=m.useState(),n=Pi(()=>new Map);return ui(()=>{n.current.forEach(s=>s()),n.current=new Map},[e]),(s,r)=>{n.current.set(s,r),t({})}};function KU(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function wf({asChild:e,children:t},n){return e&&m.isValidElement(t)?m.cloneElement(KU(t),{ref:t.ref},n(t.props.children)):n(t)}var JU={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function e$({isOpen:e,onClose:t}){const n=ws(),[s,r]=m.useState(""),[i,o]=m.useState(null);m.useEffect(()=>{(async()=>{try{const x=await(await fetch("/api/plugins")).json();o(x)}catch{}})()},[]);const l=d=>i!=null&&i.plugins?i.plugins.some(f=>f.id===d):!1,h=[{id:"users",title:"Users",description:"Manage users and their accounts",icon:li,action:()=>n("/users"),category:"Navigation",keywords:["user","account","profile"]},{id:"organizations",title:"Organizations",description:"Manage organizations and teams",icon:_s,action:()=>n("/organizations"),category:"Navigation",keywords:["org","company","team"],requiresPlugin:"organization",disabled:!l("organization"),disabledMessage:"Enable organization plugin in settings"},{id:"sessions",title:"Sessions",description:"View active user sessions",icon:py,action:()=>n("/sessions"),category:"Navigation",keywords:["session","login","active"]},{id:"tools",title:"Tools",description:"View tools and utilities",icon:AS,action:()=>n("/tools"),category:"Navigation",keywords:["utilities","tools"]},{id:"database",title:"Database",description:"View database and schema",icon:Nt,disabled:!0,action:()=>n("/database"),category:"Navigation",keywords:["database","schema"]},{id:"settings",title:"Settings",description:"Configure Better Auth Studio",icon:uo,action:()=>n("/settings"),category:"Navigation",keywords:["config","setup","preferences"]},{id:"dashboard",title:"Dashboard",description:"View overview and statistics",icon:py,action:()=>n("/"),category:"Navigation",keywords:["overview","stats","home"]},{id:"create-user",title:"Create User",description:"Add a new user to the system",icon:gg,action:()=>n("/users"),category:"Actions",keywords:["add","new","register"]},{id:"create-organization",title:"Create Organization",description:"Create a new organization",icon:ur,action:()=>n("/organizations"),category:"Actions",keywords:["add","new","org"],requiresPlugin:"organization",disabled:!l("organization"),disabledMessage:"Enable organization plugin in settings"},{id:"invite-user",title:"Invite User",description:"Send invitation to join organization",icon:uh,action:()=>n("/organizations"),category:"Actions",keywords:["invite","email","send"],requiresPlugin:"organization",disabled:!l("organization"),disabledMessage:"Enable organization plugin in settings"}].filter(d=>{var x;const f=s.toLowerCase();return d.title.toLowerCase().includes(f)||d.description.toLowerCase().includes(f)||((x=d.keywords)==null?void 0:x.some(y=>y.toLowerCase().includes(f)))}).reduce((d,f)=>(d[f.category]||(d[f.category]=[]),d[f.category].push(f),d),{});return m.useEffect(()=>{const d=f=>{(f.metaKey||f.ctrlKey)&&f.key==="k"&&f.preventDefault()};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[]),m.useEffect(()=>{const d=f=>{f.key==="Escape"&&t()};if(e)return document.body.style.overflow="hidden",document.addEventListener("keydown",d),()=>{document.body.style.overflow="unset",document.removeEventListener("keydown",d)}},[e,t]),e?a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-start justify-center pt-[20vh] z-50 overflow-hidden",onClick:t,children:a.jsx("div",{className:"bg-black/90 overflow-hidden border border-white/10 rounded-none w-full max-w-2xl mx-4",onClick:d=>d.stopPropagation(),children:a.jsxs(bl,{className:"p-2",children:[a.jsxs("div",{className:"flex items-center border-b border-dashed border-white/10 px-3 pb-3",children:[a.jsx(oi,{className:"w-4 h-4 text-gray-400 mr-3"}),a.jsx(bl.Input,{value:s,onValueChange:r,placeholder:"Search for actions, pages, or commands...",className:"flex-1 placeholder:text-xs bg-transparent text-white placeholder-gray-400 outline-none",autoFocus:!0}),a.jsx("kbd",{className:"hidden sm:inline-flex items-center px-2 py-1 text-xs text-gray-400 border border-dashed border-white/20 rounded-sm",children:"ESC"})]}),a.jsx(bl.List,{className:"max-h-96 overflow-y-auto p-2",children:Object.keys(h).length===0?a.jsxs("div",{className:"text-center py-8 text-gray-400",children:[a.jsx(oi,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),a.jsx("p",{children:"No results found"}),a.jsx("p",{className:"text-sm",children:"Try a different search term"})]}):Object.entries(h).map(([d,f])=>a.jsx(bl.Group,{heading:d,className:"text-xs text-gray-400 font-medium mb-4 px-2",children:f.map(x=>{const y=x.icon,v=x.disabled;return a.jsxs(bl.Item,{value:x.id,disabled:v,onSelect:()=>{v||(x.action(),t())},className:`flex items-center space-x-3 px-0 py-2 rounded-none transition-colors relative ${v?"opacity-40 cursor-not-allowed blur-[0.5px]":"hover:bg-white/5 cursor-pointer"}`,children:[a.jsx(y,{className:"w-4 h-4 text-white"}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"text-white text-[13px] font-light flex items-center gap-2",children:[x.title,v&&a.jsx(xu,{className:"w-3 h-3 text-yellow-500"})]}),a.jsx("div",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:v?x.disabledMessage:x.description})]}),!v&&a.jsx(Jz,{className:"w-4 h-4 text-gray-400"})]},x.id)})},d))}),a.jsx("div",{className:"border-t border-dashed border-white/10 px-3 py-2 text-xs text-gray-400",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("span",{children:["Press"," ",a.jsx("kbd",{className:"px-1 py-0.5 border border-dashed border-white/20 rounded-sm",children:"↑↓"})," ","to navigate"]}),a.jsxs("span",{children:["Press"," ",a.jsx("kbd",{className:"px-1 py-0.5 border border-dashed border-white/20 rounded-sm",children:"Enter"})," ","to select"]})]})})]})})}):null}const t$={connecting:{label:"Connecting",textClass:"text-amber-200 border-amber-400/40",dotClass:"bg-amber-300",animate:"animate-pulse"},watching:{label:"Watching",textClass:"text-emerald-200 border-emerald-400/40",dotClass:"bg-emerald-300"},refreshing:{label:"Refreshing",textClass:"text-amber-200 border-amber-400/40",dotClass:"bg-amber-300",animate:"animate-pulse"},up_to_date:{label:"Up-to-date",textClass:"text-emerald-200 border-emerald-400/40",dotClass:"bg-emerald-300"},error:{label:"Reload Failed",textClass:"text-red-200 border-red-500/50",dotClass:"bg-red-400",animate:"animate-pulse"},unavailable:{label:"Watch Off",textClass:"text-gray-300 border-gray-500/40",dotClass:"bg-gray-400"},reconnecting:{label:"Reconnecting",textClass:"text-amber-200 border-amber-400/40",dotClass:"bg-amber-300",animate:"animate-pulse"}};function n$(e){switch(e){case"refreshing":return"refreshing";case"error":return"error";case"up_to_date":case"watching":return"up_to_date";default:return"watching"}}function s$({children:e}){const t=qo(),{counts:n,loading:s}=vf(),r=ws(),[i,o]=m.useState(!1),[l,c]=m.useState("v1.0.0"),[u,h]=m.useState({status:"connecting"}),d=m.useRef(!1),f=m.useRef(null),x=m.useRef(!1),y=()=>{f.current&&(clearTimeout(f.current),f.current=null)},v=()=>{y(),f.current=setTimeout(()=>{d.current=!1,h(w=>({...w,status:"up_to_date",updatedAt:Date.now()}))},4e3)};m.useEffect(()=>{const w=N=>{(N.metaKey||N.ctrlKey)&&N.key==="k"&&(N.preventDefault(),o(!0))};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[]),m.useEffect(()=>((async()=>{var N;try{const C=await(await fetch("/api/config")).json();(N=C.studio)!=null&&N.version&&c(`v${C.studio.version}`)}catch{}})(),()=>{y()}),[]);const j=()=>{d.current=!1,x.current=!1,y(),h(w=>({...w,status:"refreshing",updatedAt:Date.now()})),window.location.reload()};j4(w=>{if(w.type==="studio_status"){const N=n$(w.status);N==="up_to_date"&&(d.current=!1,y()),h(S=>({status:N,fileName:w.fileName||S.fileName,updatedAt:w.updatedAt||Date.now()}));return}if(w.type==="config_change_detected"){d.current=!0,v(),h(N=>({...N,status:"refreshing",fileName:w.fileName||N.fileName,updatedAt:Date.now()})),x.current||(x.current=!0,setTimeout(()=>{j()},200));return}if(w.type==="config_changed"){d.current=!1,y(),h(N=>({...N,status:"up_to_date",fileName:w.fileName||N.fileName,updatedAt:w.changedAt||Date.now()}));return}w.type==="connected"&&(d.current=!1,y(),h(N=>({...N,status:"up_to_date",updatedAt:Date.now()})))},{onStatusChange:w=>{h(N=>{if(N.status==="refreshing"&&w!=="unavailable"&&w!=="open")return N;switch(w){case"connecting":return{...N,status:"connecting"};case"open":return y(),d.current?N:{...N,status:"watching",updatedAt:Date.now()};case"reconnecting":case"closed":return{...N,status:"reconnecting"};case"error":return{...N,status:"error"};case"unavailable":return d.current=!1,y(),{...N,status:"unavailable"};default:return N}})}});const g=t$[u.status],b=w=>w>=1e3?`${(w/1e3).toFixed(1).replace(/\.0$/,"")}k`:w.toString(),p=[{name:"Dashboard",href:"/",icon:iR},{name:"Users",href:"/users",icon:li,badge:s?"...":b(n.users)},{name:"Organizations",href:"/organizations",icon:_s,badge:s?"...":b(n.organizations)},{name:"Database",href:"/database",icon:Nt},{name:"Tools",href:"/tools",icon:AS},{name:"Settings",href:"/settings",icon:uo}];return a.jsxs("div",{className:"min-h-screen bg-black",children:[a.jsx("div",{className:"bg-black/70 border-b border-white/15",children:a.jsxs("div",{className:"flex items-center justify-between px-6 py-4",children:[a.jsx("div",{className:"flex items-center space-x-4",children:a.jsxs("div",{className:"flex items-end justify-end space-x-2",children:[a.jsx("div",{className:"w-7 h-7 border border-dashed border-white/20 rounded-lg flex items-center justify-center",children:a.jsx("span",{className:"text-black font-bold text-md",children:"⚡"})}),a.jsx("div",{className:"mb-0 cursor-pointer",onClick:()=>r("/"),children:a.jsxs("h1",{className:"text-md inline-flex mb-0 items-start font-light font-mono uppercase text-white gap-2",children:["Better-Auth Studio",a.jsxs("sup",{className:"text-xs text-gray-400 ml-1 mt-0 flex items-center space-x-2",children:[a.jsxs("span",{className:"inline-flex items-center",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white/80 lowercase font-mono text-xs",children:l}),a.jsx("span",{className:"ml-1",children:"]"})]}),a.jsxs("span",{className:`inline-flex items-center rounded border px-1.5 py-0.5 font-normal uppercase tracking-wide text-[9px] ${g.textClass} ${g.animate??""}`,children:[a.jsx("span",{className:`mr-1 h-1.5 w-1.5 rounded-full ${g.dotClass}`}),g.label]}),a.jsx("button",{type:"button",onClick:j,"aria-label":"Hard refresh studio",className:"ml-1 inline-flex items-center rounded border border-dashed border-white/20 p-0.5 text-white/70 transition hover:text-white hover:border-white/50",children:a.jsx(xg,{className:"h-3.5 w-3.5"})})]})]})})]})}),a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsxs("div",{className:"relative",children:[a.jsx(oi,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx("input",{type:"text",placeholder:"Search...",onClick:()=>o(!0),className:"pl-10 pr-4 py-2 bg-black border rounded-none border-gray-600 text-white border-dashed border-white/20 focus:ring-2 focus:ring-white focus:border-transparent transition-colors placeholder-gray-400 cursor-pointer",readOnly:!0}),a.jsx("kbd",{className:"absolute right-3 top-1/2 transform -translate-y-1/2 text-xs text-gray-400 border border-dashed border-white/10 rounded-sm px-1.5 py-0.5",children:"⌘ K"})]}),a.jsxs("a",{href:"https://better-auth.com/docs",target:"_blank",rel:"noopener",className:"group flex items-center",children:[a.jsx("span",{className:"text-white/70 text-xs mr-2 transition-colors duration-150 group-hover:text-white group-hover:bg-gray-500/20 rounded px-0.5",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-sm uppercase",children:"Docs"}),a.jsx("span",{className:"text-white/70 text-xs ml-2 transition-colors duration-150 group-hover:text-white group-hover:bg-gray-500/20 rounded px-0.5",children:"]"})]}),a.jsxs("a",{href:"https://better-auth.com/support",target:"_blank",rel:"noopener",className:"group flex items-center",children:[a.jsx("span",{className:"text-white/70 text-xs mr-2 transition-colors duration-150 group-hover:text-white group-hover:bg-gray-500/20 rounded px-0.5",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-sm uppercase",children:"Support"}),a.jsx("span",{className:"text-white/70 text-xs ml-2 transition-colors duration-150 group-hover:text-white group-hover:bg-gray-500/20 rounded px-0.5",children:"]"})]})]})]})}),a.jsx("div",{className:"bg-black/50 border-b border-white/10",children:a.jsx("div",{className:"px-6",children:a.jsx("nav",{className:"flex space-x-8",children:p.map(w=>{const N=t.pathname===w.href;return a.jsxs(Rp,{to:w.href,className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${N?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[a.jsx(w.icon,{className:"w-4 h-4"}),a.jsxs("span",{className:"inline-flex items-start",children:[w.name,w.badge&&a.jsxs("sup",{className:"text-xs text-gray-500 ml-1",children:[a.jsx("span",{className:"mr-0.5",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-xs",children:w.badge}),a.jsx("span",{className:"ml-0.5",children:"]"})]})]})]},w.name)})})})}),a.jsx("div",{className:"flex-1 p-0",children:e}),a.jsx(e$,{isOpen:i,onClose:()=>o(!1)})]})}function bh(e){"@babel/helpers - typeof";return bh=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},bh(e)}function hi(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function fn(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function Zs(e){fn(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||bh(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function a$(e,t){fn(2,arguments);var n=Zs(e).getTime(),s=hi(t);return new Date(n+s)}var r$={};function jf(){return r$}function i$(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function o$(e){return fn(1,arguments),e instanceof Date||bh(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function l$(e){if(fn(1,arguments),!o$(e)&&typeof e!="number")return!1;var t=Zs(e);return!isNaN(Number(t))}function c$(e,t){fn(2,arguments);var n=hi(t);return a$(e,-n)}var d$=864e5;function u$(e){fn(1,arguments);var t=Zs(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var s=t.getTime(),r=n-s;return Math.floor(r/d$)+1}function yh(e){fn(1,arguments);var t=1,n=Zs(e),s=n.getUTCDay(),r=(s<t?7:0)+s-t;return n.setUTCDate(n.getUTCDate()-r),n.setUTCHours(0,0,0,0),n}function nC(e){fn(1,arguments);var t=Zs(e),n=t.getUTCFullYear(),s=new Date(0);s.setUTCFullYear(n+1,0,4),s.setUTCHours(0,0,0,0);var r=yh(s),i=new Date(0);i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0);var o=yh(i);return t.getTime()>=r.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}function h$(e){fn(1,arguments);var t=nC(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var s=yh(n);return s}var f$=6048e5;function m$(e){fn(1,arguments);var t=Zs(e),n=yh(t).getTime()-h$(t).getTime();return Math.round(n/f$)+1}function wh(e,t){var n,s,r,i,o,l,c,u;fn(1,arguments);var h=jf(),d=hi((n=(s=(r=(i=t==null?void 0:t.weekStartsOn)!==null&&i!==void 0?i:t==null||(o=t.locale)===null||o===void 0||(l=o.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&r!==void 0?r:h.weekStartsOn)!==null&&s!==void 0?s:(c=h.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&n!==void 0?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=Zs(e),x=f.getUTCDay(),y=(x<d?7:0)+x-d;return f.setUTCDate(f.getUTCDate()-y),f.setUTCHours(0,0,0,0),f}function sC(e,t){var n,s,r,i,o,l,c,u;fn(1,arguments);var h=Zs(e),d=h.getUTCFullYear(),f=jf(),x=hi((n=(s=(r=(i=t==null?void 0:t.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(o=t.locale)===null||o===void 0||(l=o.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&r!==void 0?r:f.firstWeekContainsDate)!==null&&s!==void 0?s:(c=f.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&n!==void 0?n:1);if(!(x>=1&&x<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var y=new Date(0);y.setUTCFullYear(d+1,0,x),y.setUTCHours(0,0,0,0);var v=wh(y,t),j=new Date(0);j.setUTCFullYear(d,0,x),j.setUTCHours(0,0,0,0);var g=wh(j,t);return h.getTime()>=v.getTime()?d+1:h.getTime()>=g.getTime()?d:d-1}function x$(e,t){var n,s,r,i,o,l,c,u;fn(1,arguments);var h=jf(),d=hi((n=(s=(r=(i=t==null?void 0:t.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(o=t.locale)===null||o===void 0||(l=o.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&r!==void 0?r:h.firstWeekContainsDate)!==null&&s!==void 0?s:(c=h.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&n!==void 0?n:1),f=sC(e,t),x=new Date(0);x.setUTCFullYear(f,0,d),x.setUTCHours(0,0,0,0);var y=wh(x,t);return y}var g$=6048e5;function p$(e,t){fn(1,arguments);var n=Zs(e),s=wh(n,t).getTime()-x$(n,t).getTime();return Math.round(s/g$)+1}function it(e,t){for(var n=e<0?"-":"",s=Math.abs(e).toString();s.length<t;)s="0"+s;return n+s}var $a={y:function(t,n){var s=t.getUTCFullYear(),r=s>0?s:1-s;return it(n==="yy"?r%100:r,n.length)},M:function(t,n){var s=t.getUTCMonth();return n==="M"?String(s+1):it(s+1,2)},d:function(t,n){return it(t.getUTCDate(),n.length)},a:function(t,n){var s=t.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return s.toUpperCase();case"aaa":return s;case"aaaaa":return s[0];case"aaaa":default:return s==="am"?"a.m.":"p.m."}},h:function(t,n){return it(t.getUTCHours()%12||12,n.length)},H:function(t,n){return it(t.getUTCHours(),n.length)},m:function(t,n){return it(t.getUTCMinutes(),n.length)},s:function(t,n){return it(t.getUTCSeconds(),n.length)},S:function(t,n){var s=n.length,r=t.getUTCMilliseconds(),i=Math.floor(r*Math.pow(10,s-3));return it(i,n.length)}},_i={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},v$={G:function(t,n,s){var r=t.getUTCFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return s.era(r,{width:"abbreviated"});case"GGGGG":return s.era(r,{width:"narrow"});case"GGGG":default:return s.era(r,{width:"wide"})}},y:function(t,n,s){if(n==="yo"){var r=t.getUTCFullYear(),i=r>0?r:1-r;return s.ordinalNumber(i,{unit:"year"})}return $a.y(t,n)},Y:function(t,n,s,r){var i=sC(t,r),o=i>0?i:1-i;if(n==="YY"){var l=o%100;return it(l,2)}return n==="Yo"?s.ordinalNumber(o,{unit:"year"}):it(o,n.length)},R:function(t,n){var s=nC(t);return it(s,n.length)},u:function(t,n){var s=t.getUTCFullYear();return it(s,n.length)},Q:function(t,n,s){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"Q":return String(r);case"QQ":return it(r,2);case"Qo":return s.ordinalNumber(r,{unit:"quarter"});case"QQQ":return s.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return s.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,n,s){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"q":return String(r);case"qq":return it(r,2);case"qo":return s.ordinalNumber(r,{unit:"quarter"});case"qqq":return s.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return s.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,n,s){var r=t.getUTCMonth();switch(n){case"M":case"MM":return $a.M(t,n);case"Mo":return s.ordinalNumber(r+1,{unit:"month"});case"MMM":return s.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return s.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(r,{width:"wide",context:"formatting"})}},L:function(t,n,s){var r=t.getUTCMonth();switch(n){case"L":return String(r+1);case"LL":return it(r+1,2);case"Lo":return s.ordinalNumber(r+1,{unit:"month"});case"LLL":return s.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return s.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(r,{width:"wide",context:"standalone"})}},w:function(t,n,s,r){var i=p$(t,r);return n==="wo"?s.ordinalNumber(i,{unit:"week"}):it(i,n.length)},I:function(t,n,s){var r=m$(t);return n==="Io"?s.ordinalNumber(r,{unit:"week"}):it(r,n.length)},d:function(t,n,s){return n==="do"?s.ordinalNumber(t.getUTCDate(),{unit:"date"}):$a.d(t,n)},D:function(t,n,s){var r=u$(t);return n==="Do"?s.ordinalNumber(r,{unit:"dayOfYear"}):it(r,n.length)},E:function(t,n,s){var r=t.getUTCDay();switch(n){case"E":case"EE":case"EEE":return s.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return s.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(r,{width:"short",context:"formatting"});case"EEEE":default:return s.day(r,{width:"wide",context:"formatting"})}},e:function(t,n,s,r){var i=t.getUTCDay(),o=(i-r.weekStartsOn+8)%7||7;switch(n){case"e":return String(o);case"ee":return it(o,2);case"eo":return s.ordinalNumber(o,{unit:"day"});case"eee":return s.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return s.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(i,{width:"short",context:"formatting"});case"eeee":default:return s.day(i,{width:"wide",context:"formatting"})}},c:function(t,n,s,r){var i=t.getUTCDay(),o=(i-r.weekStartsOn+8)%7||7;switch(n){case"c":return String(o);case"cc":return it(o,n.length);case"co":return s.ordinalNumber(o,{unit:"day"});case"ccc":return s.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return s.day(i,{width:"narrow",context:"standalone"});case"cccccc":return s.day(i,{width:"short",context:"standalone"});case"cccc":default:return s.day(i,{width:"wide",context:"standalone"})}},i:function(t,n,s){var r=t.getUTCDay(),i=r===0?7:r;switch(n){case"i":return String(i);case"ii":return it(i,n.length);case"io":return s.ordinalNumber(i,{unit:"day"});case"iii":return s.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return s.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return s.day(r,{width:"short",context:"formatting"});case"iiii":default:return s.day(r,{width:"wide",context:"formatting"})}},a:function(t,n,s){var r=t.getUTCHours(),i=r/12>=1?"pm":"am";switch(n){case"a":case"aa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return s.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,n,s){var r=t.getUTCHours(),i;switch(r===12?i=_i.noon:r===0?i=_i.midnight:i=r/12>=1?"pm":"am",n){case"b":case"bb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return s.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,n,s){var r=t.getUTCHours(),i;switch(r>=17?i=_i.evening:r>=12?i=_i.afternoon:r>=4?i=_i.morning:i=_i.night,n){case"B":case"BB":case"BBB":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return s.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,n,s){if(n==="ho"){var r=t.getUTCHours()%12;return r===0&&(r=12),s.ordinalNumber(r,{unit:"hour"})}return $a.h(t,n)},H:function(t,n,s){return n==="Ho"?s.ordinalNumber(t.getUTCHours(),{unit:"hour"}):$a.H(t,n)},K:function(t,n,s){var r=t.getUTCHours()%12;return n==="Ko"?s.ordinalNumber(r,{unit:"hour"}):it(r,n.length)},k:function(t,n,s){var r=t.getUTCHours();return r===0&&(r=24),n==="ko"?s.ordinalNumber(r,{unit:"hour"}):it(r,n.length)},m:function(t,n,s){return n==="mo"?s.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):$a.m(t,n)},s:function(t,n,s){return n==="so"?s.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):$a.s(t,n)},S:function(t,n){return $a.S(t,n)},X:function(t,n,s,r){var i=r._originalDate||t,o=i.getTimezoneOffset();if(o===0)return"Z";switch(n){case"X":return Jy(o);case"XXXX":case"XX":return Rr(o);case"XXXXX":case"XXX":default:return Rr(o,":")}},x:function(t,n,s,r){var i=r._originalDate||t,o=i.getTimezoneOffset();switch(n){case"x":return Jy(o);case"xxxx":case"xx":return Rr(o);case"xxxxx":case"xxx":default:return Rr(o,":")}},O:function(t,n,s,r){var i=r._originalDate||t,o=i.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+Ky(o,":");case"OOOO":default:return"GMT"+Rr(o,":")}},z:function(t,n,s,r){var i=r._originalDate||t,o=i.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+Ky(o,":");case"zzzz":default:return"GMT"+Rr(o,":")}},t:function(t,n,s,r){var i=r._originalDate||t,o=Math.floor(i.getTime()/1e3);return it(o,n.length)},T:function(t,n,s,r){var i=r._originalDate||t,o=i.getTime();return it(o,n.length)}};function Ky(e,t){var n=e>0?"-":"+",s=Math.abs(e),r=Math.floor(s/60),i=s%60;if(i===0)return n+String(r);var o=t;return n+String(r)+o+it(i,2)}function Jy(e,t){if(e%60===0){var n=e>0?"-":"+";return n+it(Math.abs(e)/60,2)}return Rr(e,t)}function Rr(e,t){var n=t||"",s=e>0?"-":"+",r=Math.abs(e),i=it(Math.floor(r/60),2),o=it(r%60,2);return s+i+n+o}var ew=function(t,n){switch(t){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},aC=function(t,n){switch(t){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},b$=function(t,n){var s=t.match(/(P+)(p+)?/)||[],r=s[1],i=s[2];if(!i)return ew(t,n);var o;switch(r){case"P":o=n.dateTime({width:"short"});break;case"PP":o=n.dateTime({width:"medium"});break;case"PPP":o=n.dateTime({width:"long"});break;case"PPPP":default:o=n.dateTime({width:"full"});break}return o.replace("{{date}}",ew(r,n)).replace("{{time}}",aC(i,n))},y$={p:aC,P:b$},w$=["D","DD"],j$=["YY","YYYY"];function N$(e){return w$.indexOf(e)!==-1}function S$(e){return j$.indexOf(e)!==-1}function tw(e,t,n){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var C$={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},E$=function(t,n,s){var r,i=C$[t];return typeof i=="string"?r=i:n===1?r=i.one:r=i.other.replace("{{count}}",n.toString()),s!=null&&s.addSuffix?s.comparison&&s.comparison>0?"in "+r:r+" ago":r};function Ym(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,s=e.formats[n]||e.formats[e.defaultWidth];return s}}var k$={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},M$={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},T$={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},D$={date:Ym({formats:k$,defaultWidth:"full"}),time:Ym({formats:M$,defaultWidth:"full"}),dateTime:Ym({formats:T$,defaultWidth:"full"})},_$={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},A$=function(t,n,s,r){return _$[t]};function yl(e){return function(t,n){var s=n!=null&&n.context?String(n.context):"standalone",r;if(s==="formatting"&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,o=n!=null&&n.width?String(n.width):i;r=e.formattingValues[o]||e.formattingValues[i]}else{var l=e.defaultWidth,c=n!=null&&n.width?String(n.width):e.defaultWidth;r=e.values[c]||e.values[l]}var u=e.argumentCallback?e.argumentCallback(t):t;return r[u]}}var O$={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},z$={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},R$={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},U$={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},$$={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},P$={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},L$=function(t,n){var s=Number(t),r=s%100;if(r>20||r<10)switch(r%10){case 1:return s+"st";case 2:return s+"nd";case 3:return s+"rd"}return s+"th"},H$={ordinalNumber:L$,era:yl({values:O$,defaultWidth:"wide"}),quarter:yl({values:z$,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:yl({values:R$,defaultWidth:"wide"}),day:yl({values:U$,defaultWidth:"wide"}),dayPeriod:yl({values:$$,defaultWidth:"wide",formattingValues:P$,defaultFormattingWidth:"wide"})};function wl(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=n.width,r=s&&e.matchPatterns[s]||e.matchPatterns[e.defaultMatchWidth],i=t.match(r);if(!i)return null;var o=i[0],l=s&&e.parsePatterns[s]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?V$(l,function(d){return d.test(o)}):B$(l,function(d){return d.test(o)}),u;u=e.valueCallback?e.valueCallback(c):c,u=n.valueCallback?n.valueCallback(u):u;var h=t.slice(o.length);return{value:u,rest:h}}}function B$(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function V$(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}function Y$(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=t.match(e.matchPattern);if(!s)return null;var r=s[0],i=t.match(e.parsePattern);if(!i)return null;var o=e.valueCallback?e.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;var l=t.slice(r.length);return{value:o,rest:l}}}var F$=/^(\d+)(th|st|nd|rd)?/i,I$=/\d+/i,W$={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},q$={any:[/^b/i,/^(a|c)/i]},X$={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},G$={any:[/1/i,/2/i,/3/i,/4/i]},Z$={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Q$={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},K$={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},J$={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},eP={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},tP={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},nP={ordinalNumber:Y$({matchPattern:F$,parsePattern:I$,valueCallback:function(t){return parseInt(t,10)}}),era:wl({matchPatterns:W$,defaultMatchWidth:"wide",parsePatterns:q$,defaultParseWidth:"any"}),quarter:wl({matchPatterns:X$,defaultMatchWidth:"wide",parsePatterns:G$,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:wl({matchPatterns:Z$,defaultMatchWidth:"wide",parsePatterns:Q$,defaultParseWidth:"any"}),day:wl({matchPatterns:K$,defaultMatchWidth:"wide",parsePatterns:J$,defaultParseWidth:"any"}),dayPeriod:wl({matchPatterns:eP,defaultMatchWidth:"any",parsePatterns:tP,defaultParseWidth:"any"})},sP={code:"en-US",formatDistance:E$,formatLong:D$,formatRelative:A$,localize:H$,match:nP,options:{weekStartsOn:0,firstWeekContainsDate:1}},aP=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,rP=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,iP=/^'([^]*?)'?$/,oP=/''/g,lP=/[a-zA-Z]/;function Zn(e,t,n){var s,r,i,o,l,c,u,h,d,f,x,y,v,j;fn(2,arguments);var g=String(t),b=jf(),p=(s=(r=void 0)!==null&&r!==void 0?r:b.locale)!==null&&s!==void 0?s:sP,w=hi((i=(o=(l=(c=void 0)!==null&&c!==void 0?c:void 0)!==null&&l!==void 0?l:b.firstWeekContainsDate)!==null&&o!==void 0?o:(u=b.locale)===null||u===void 0||(h=u.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(w>=1&&w<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var N=hi((d=(f=(x=(y=void 0)!==null&&y!==void 0?y:void 0)!==null&&x!==void 0?x:b.weekStartsOn)!==null&&f!==void 0?f:(v=b.locale)===null||v===void 0||(j=v.options)===null||j===void 0?void 0:j.weekStartsOn)!==null&&d!==void 0?d:0);if(!(N>=0&&N<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!p.localize)throw new RangeError("locale must contain localize property");if(!p.formatLong)throw new RangeError("locale must contain formatLong property");var S=Zs(e);if(!l$(S))throw new RangeError("Invalid time value");var C=i$(S),T=c$(S,C),O={firstWeekContainsDate:w,weekStartsOn:N,locale:p,_originalDate:S},H=g.match(rP).map(function(U){var z=U[0];if(z==="p"||z==="P"){var Y=y$[z];return Y(U,p.formatLong)}return U}).join("").match(aP).map(function(U){if(U==="''")return"'";var z=U[0];if(z==="'")return cP(U);var Y=v$[z];if(Y)return S$(U)&&tw(U,t,String(e)),N$(U)&&tw(U,t,String(e)),Y(T,U,p.localize,O);if(z.match(lP))throw new RangeError("Format string contains an unescaped latin alphabet character `"+z+"`");return U}).join("");return H}function cP(e){var t=e.match(iP);return t?t[1].replace(oP,"'"):e}const nw=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,sw=hh,rC=(e,t)=>n=>{var s;if((t==null?void 0:t.variants)==null)return sw(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:r,defaultVariants:i}=t,o=Object.keys(r).map(u=>{const h=n==null?void 0:n[u],d=i==null?void 0:i[u];if(h===null)return null;const f=nw(h)||nw(d);return r[u][f]}),l=n&&Object.entries(n).reduce((u,h)=>{let[d,f]=h;return f===void 0||(u[d]=f),u},{}),c=t==null||(s=t.compoundVariants)===null||s===void 0?void 0:s.reduce((u,h)=>{let{class:d,className:f,...x}=h;return Object.entries(x).every(y=>{let[v,j]=y;return Array.isArray(j)?j.includes({...i,...l}[v]):{...i,...l}[v]===j})?[...u,d,f]:u},[]);return sw(e,o,c,n==null?void 0:n.class,n==null?void 0:n.className)},Mg=rC("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),F=m.forwardRef(({className:e,variant:t,size:n,asChild:s=!1,...r},i)=>{const o=s?AU:"button";return a.jsx(o,{className:$e(Mg({variant:t,size:n,className:e})),ref:i,...r})});F.displayName="Button";function dP(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}const Fm={},Al={};function Lr(e,t){try{const s=(Fm[e]||(Fm[e]=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return s in Al?Al[s]:aw(s,s.split(":"))}catch{if(e in Al)return Al[e];const n=e==null?void 0:e.match(uP);return n?aw(e,n.slice(1)):NaN}}const uP=/([+-]\d\d):?(\d\d)?/;function aw(e,t){const n=+(t[0]||0),s=+(t[1]||0),r=+(t[2]||0)/60;return Al[e]=n*60+s>0?n*60+s+r:n*60-s-r}class $s extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Lr(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),iC(this),Tg(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new $s(...n,t):new $s(Date.now(),t)}withTimeZone(t){return new $s(+this,t)}getTimezoneOffset(){const t=-Lr(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),Tg(this),+this}[Symbol.for("constructDateFrom")](t){return new $s(+new Date(t),this.timeZone)}}const rw=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!rw.test(e))return;const t=e.replace(rw,"$1UTC");$s.prototype[t]&&(e.startsWith("get")?$s.prototype[e]=function(){return this.internal[t]()}:($s.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),hP(this),+this},$s.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Tg(this),+this}))});function Tg(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-Lr(e.timeZone,e)*60))}function hP(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),iC(e)}function iC(e){const t=Lr(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),s=new Date(+e);s.setUTCHours(s.getUTCHours()-1);const r=-new Date(+e).getTimezoneOffset(),i=-new Date(+s).getTimezoneOffset(),o=r-i,l=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();o&&l&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+o);const c=r-n;c&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+c);const u=new Date(+e);u.setUTCSeconds(0);const h=r>0?u.getSeconds():(u.getSeconds()-60)%60,d=Math.round(-(Lr(e.timeZone,e)*60))%60;(d||h)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+d),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+d+h));const f=Lr(e.timeZone,e),x=f>0?Math.floor(f):Math.ceil(f),v=-new Date(+e).getTimezoneOffset()-x,j=x!==n,g=v-c;if(j&&g){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+g);const b=Lr(e.timeZone,e),p=b>0?Math.floor(b):Math.ceil(b),w=x-p;w&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+w),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+w))}}class an extends $s{static tz(t,...n){return n.length?new an(...n,t):new an(Date.now(),t)}toISOString(){const[t,n,s]=this.tzComponents(),r=`${t}${n}:${s}`;return this.internal.toISOString().slice(0,-1)+r}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,s,r]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${s} ${n} ${r}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,s,r]=this.tzComponents();return`${t} GMT${n}${s}${r} (${dP(this.timeZone,this)})`}toLocaleString(t,n){return Date.prototype.toLocaleString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleDateString(t,n){return Date.prototype.toLocaleDateString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleTimeString(t,n){return Date.prototype.toLocaleTimeString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),n=t>0?"-":"+",s=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),r=String(Math.abs(t)%60).padStart(2,"0");return[n,s,r]}withTimeZone(t){return new an(+this,t)}[Symbol.for("constructDateFrom")](t){return new an(+new Date(t),this.timeZone)}}const oC=6048e5,fP=864e5,iw=Symbol.for("constructDateFrom");function $t(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&iw in e?e[iw](t):e instanceof Date?new e.constructor(t):new Date(t)}function ht(e,t){return $t(t||e,e)}function lC(e,t,n){const s=ht(e,n==null?void 0:n.in);return isNaN(t)?$t(e,NaN):(t&&s.setDate(s.getDate()+t),s)}function cC(e,t,n){const s=ht(e,n==null?void 0:n.in);if(isNaN(t))return $t(e,NaN);if(!t)return s;const r=s.getDate(),i=$t(e,s.getTime());i.setMonth(s.getMonth()+t+1,0);const o=i.getDate();return r>=o?i:(s.setFullYear(i.getFullYear(),i.getMonth(),r),s)}let mP={};function Jc(){return mP}function $o(e,t){var l,c,u,h;const n=Jc(),s=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((h=(u=n.locale)==null?void 0:u.options)==null?void 0:h.weekStartsOn)??0,r=ht(e,t==null?void 0:t.in),i=r.getDay(),o=(i<s?7:0)+i-s;return r.setDate(r.getDate()-o),r.setHours(0,0,0,0),r}function Ec(e,t){return $o(e,{...t,weekStartsOn:1})}function dC(e,t){const n=ht(e,t==null?void 0:t.in),s=n.getFullYear(),r=$t(n,0);r.setFullYear(s+1,0,4),r.setHours(0,0,0,0);const i=Ec(r),o=$t(n,0);o.setFullYear(s,0,4),o.setHours(0,0,0,0);const l=Ec(o);return n.getTime()>=i.getTime()?s+1:n.getTime()>=l.getTime()?s:s-1}function ow(e){const t=ht(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Ko(e,...t){const n=$t.bind(null,t.find(s=>typeof s=="object"));return t.map(n)}function kc(e,t){const n=ht(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function uC(e,t,n){const[s,r]=Ko(n==null?void 0:n.in,e,t),i=kc(s),o=kc(r),l=+i-ow(i),c=+o-ow(o);return Math.round((l-c)/fP)}function xP(e,t){const n=dC(e,t),s=$t(e,0);return s.setFullYear(n,0,4),s.setHours(0,0,0,0),Ec(s)}function gP(e,t,n){return lC(e,t*7,n)}function pP(e,t,n){return cC(e,t*12,n)}function vP(e,t){let n,s=t==null?void 0:t.in;return e.forEach(r=>{!s&&typeof r=="object"&&(s=$t.bind(null,r));const i=ht(r,s);(!n||n<i||isNaN(+i))&&(n=i)}),$t(s,n||NaN)}function bP(e,t){let n,s=t==null?void 0:t.in;return e.forEach(r=>{!s&&typeof r=="object"&&(s=$t.bind(null,r));const i=ht(r,s);(!n||n>i||isNaN(+i))&&(n=i)}),$t(s,n||NaN)}function yP(e,t,n){const[s,r]=Ko(n==null?void 0:n.in,e,t);return+kc(s)==+kc(r)}function hC(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function wP(e){return!(!hC(e)&&typeof e!="number"||isNaN(+ht(e)))}function jP(e,t,n){const[s,r]=Ko(n==null?void 0:n.in,e,t),i=s.getFullYear()-r.getFullYear(),o=s.getMonth()-r.getMonth();return i*12+o}function NP(e,t){const n=ht(e,t==null?void 0:t.in),s=n.getMonth();return n.setFullYear(n.getFullYear(),s+1,0),n.setHours(23,59,59,999),n}function fC(e,t){const[n,s]=Ko(e,t.start,t.end);return{start:n,end:s}}function SP(e,t){const{start:n,end:s}=fC(t==null?void 0:t.in,e);let r=+n>+s;const i=r?+n:+s,o=r?s:n;o.setHours(0,0,0,0),o.setDate(1);let l=1;const c=[];for(;+o<=i;)c.push($t(n,o)),o.setMonth(o.getMonth()+l);return r?c.reverse():c}function CP(e,t){const n=ht(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function EP(e,t){const n=ht(e,t==null?void 0:t.in),s=n.getFullYear();return n.setFullYear(s+1,0,0),n.setHours(23,59,59,999),n}function mC(e,t){const n=ht(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function kP(e,t){const{start:n,end:s}=fC(t==null?void 0:t.in,e);let r=+n>+s;const i=r?+n:+s,o=r?s:n;o.setHours(0,0,0,0),o.setMonth(0,1);let l=1;const c=[];for(;+o<=i;)c.push($t(n,o)),o.setFullYear(o.getFullYear()+l);return r?c.reverse():c}function xC(e,t){var l,c,u,h;const n=Jc(),s=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((h=(u=n.locale)==null?void 0:u.options)==null?void 0:h.weekStartsOn)??0,r=ht(e,t==null?void 0:t.in),i=r.getDay(),o=(i<s?-7:0)+6-(i-s);return r.setDate(r.getDate()+o),r.setHours(23,59,59,999),r}function MP(e,t){return xC(e,{...t,weekStartsOn:1})}const TP={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},DP=(e,t,n)=>{let s;const r=TP[e];return typeof r=="string"?s=r:t===1?s=r.one:s=r.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+s:s+" ago":s};function Im(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const _P={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},AP={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},OP={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},zP={date:Im({formats:_P,defaultWidth:"full"}),time:Im({formats:AP,defaultWidth:"full"}),dateTime:Im({formats:OP,defaultWidth:"full"})},RP={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},UP=(e,t,n,s)=>RP[e];function jl(e){return(t,n)=>{const s=n!=null&&n.context?String(n.context):"standalone";let r;if(s==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,l=n!=null&&n.width?String(n.width):o;r=e.formattingValues[l]||e.formattingValues[o]}else{const o=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;r=e.values[l]||e.values[o]}const i=e.argumentCallback?e.argumentCallback(t):t;return r[i]}}const $P={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},PP={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},LP={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},HP={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},BP={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},VP={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},YP=(e,t)=>{const n=Number(e),s=n%100;if(s>20||s<10)switch(s%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},FP={ordinalNumber:YP,era:jl({values:$P,defaultWidth:"wide"}),quarter:jl({values:PP,defaultWidth:"wide",argumentCallback:e=>e-1}),month:jl({values:LP,defaultWidth:"wide"}),day:jl({values:HP,defaultWidth:"wide"}),dayPeriod:jl({values:BP,defaultWidth:"wide",formattingValues:VP,defaultFormattingWidth:"wide"})};function Nl(e){return(t,n={})=>{const s=n.width,r=s&&e.matchPatterns[s]||e.matchPatterns[e.defaultMatchWidth],i=t.match(r);if(!i)return null;const o=i[0],l=s&&e.parsePatterns[s]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?WP(l,d=>d.test(o)):IP(l,d=>d.test(o));let u;u=e.valueCallback?e.valueCallback(c):c,u=n.valueCallback?n.valueCallback(u):u;const h=t.slice(o.length);return{value:u,rest:h}}}function IP(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function WP(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function qP(e){return(t,n={})=>{const s=t.match(e.matchPattern);if(!s)return null;const r=s[0],i=t.match(e.parsePattern);if(!i)return null;let o=e.valueCallback?e.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const l=t.slice(r.length);return{value:o,rest:l}}}const XP=/^(\d+)(th|st|nd|rd)?/i,GP=/\d+/i,ZP={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},QP={any:[/^b/i,/^(a|c)/i]},KP={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},JP={any:[/1/i,/2/i,/3/i,/4/i]},eL={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},tL={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},nL={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},sL={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},aL={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},rL={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},iL={ordinalNumber:qP({matchPattern:XP,parsePattern:GP,valueCallback:e=>parseInt(e,10)}),era:Nl({matchPatterns:ZP,defaultMatchWidth:"wide",parsePatterns:QP,defaultParseWidth:"any"}),quarter:Nl({matchPatterns:KP,defaultMatchWidth:"wide",parsePatterns:JP,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Nl({matchPatterns:eL,defaultMatchWidth:"wide",parsePatterns:tL,defaultParseWidth:"any"}),day:Nl({matchPatterns:nL,defaultMatchWidth:"wide",parsePatterns:sL,defaultParseWidth:"any"}),dayPeriod:Nl({matchPatterns:aL,defaultMatchWidth:"any",parsePatterns:rL,defaultParseWidth:"any"})},j0={code:"en-US",formatDistance:DP,formatLong:zP,formatRelative:UP,localize:FP,match:iL,options:{weekStartsOn:0,firstWeekContainsDate:1}};function oL(e,t){const n=ht(e,t==null?void 0:t.in);return uC(n,mC(n))+1}function gC(e,t){const n=ht(e,t==null?void 0:t.in),s=+Ec(n)-+xP(n);return Math.round(s/oC)+1}function pC(e,t){var h,d,f,x;const n=ht(e,t==null?void 0:t.in),s=n.getFullYear(),r=Jc(),i=(t==null?void 0:t.firstWeekContainsDate)??((d=(h=t==null?void 0:t.locale)==null?void 0:h.options)==null?void 0:d.firstWeekContainsDate)??r.firstWeekContainsDate??((x=(f=r.locale)==null?void 0:f.options)==null?void 0:x.firstWeekContainsDate)??1,o=$t((t==null?void 0:t.in)||e,0);o.setFullYear(s+1,0,i),o.setHours(0,0,0,0);const l=$o(o,t),c=$t((t==null?void 0:t.in)||e,0);c.setFullYear(s,0,i),c.setHours(0,0,0,0);const u=$o(c,t);return+n>=+l?s+1:+n>=+u?s:s-1}function lL(e,t){var l,c,u,h;const n=Jc(),s=(t==null?void 0:t.firstWeekContainsDate)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((h=(u=n.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??1,r=pC(e,t),i=$t((t==null?void 0:t.in)||e,0);return i.setFullYear(r,0,s),i.setHours(0,0,0,0),$o(i,t)}function vC(e,t){const n=ht(e,t==null?void 0:t.in),s=+$o(n,t)-+lL(n,t);return Math.round(s/oC)+1}function ot(e,t){const n=e<0?"-":"",s=Math.abs(e).toString().padStart(t,"0");return n+s}const Pa={y(e,t){const n=e.getFullYear(),s=n>0?n:1-n;return ot(t==="yy"?s%100:s,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):ot(n+1,2)},d(e,t){return ot(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return ot(e.getHours()%12||12,t.length)},H(e,t){return ot(e.getHours(),t.length)},m(e,t){return ot(e.getMinutes(),t.length)},s(e,t){return ot(e.getSeconds(),t.length)},S(e,t){const n=t.length,s=e.getMilliseconds(),r=Math.trunc(s*Math.pow(10,n-3));return ot(r,t.length)}},Ai={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},lw={G:function(e,t,n){const s=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(s,{width:"abbreviated"});case"GGGGG":return n.era(s,{width:"narrow"});case"GGGG":default:return n.era(s,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const s=e.getFullYear(),r=s>0?s:1-s;return n.ordinalNumber(r,{unit:"year"})}return Pa.y(e,t)},Y:function(e,t,n,s){const r=pC(e,s),i=r>0?r:1-r;if(t==="YY"){const o=i%100;return ot(o,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):ot(i,t.length)},R:function(e,t){const n=dC(e);return ot(n,t.length)},u:function(e,t){const n=e.getFullYear();return ot(n,t.length)},Q:function(e,t,n){const s=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(s);case"QQ":return ot(s,2);case"Qo":return n.ordinalNumber(s,{unit:"quarter"});case"QQQ":return n.quarter(s,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(s,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(s,{width:"wide",context:"formatting"})}},q:function(e,t,n){const s=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(s);case"qq":return ot(s,2);case"qo":return n.ordinalNumber(s,{unit:"quarter"});case"qqq":return n.quarter(s,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(s,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(s,{width:"wide",context:"standalone"})}},M:function(e,t,n){const s=e.getMonth();switch(t){case"M":case"MM":return Pa.M(e,t);case"Mo":return n.ordinalNumber(s+1,{unit:"month"});case"MMM":return n.month(s,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(s,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(s,{width:"wide",context:"formatting"})}},L:function(e,t,n){const s=e.getMonth();switch(t){case"L":return String(s+1);case"LL":return ot(s+1,2);case"Lo":return n.ordinalNumber(s+1,{unit:"month"});case"LLL":return n.month(s,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(s,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(s,{width:"wide",context:"standalone"})}},w:function(e,t,n,s){const r=vC(e,s);return t==="wo"?n.ordinalNumber(r,{unit:"week"}):ot(r,t.length)},I:function(e,t,n){const s=gC(e);return t==="Io"?n.ordinalNumber(s,{unit:"week"}):ot(s,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Pa.d(e,t)},D:function(e,t,n){const s=oL(e);return t==="Do"?n.ordinalNumber(s,{unit:"dayOfYear"}):ot(s,t.length)},E:function(e,t,n){const s=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(s,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(s,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(s,{width:"short",context:"formatting"});case"EEEE":default:return n.day(s,{width:"wide",context:"formatting"})}},e:function(e,t,n,s){const r=e.getDay(),i=(r-s.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return ot(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});case"eeee":default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(e,t,n,s){const r=e.getDay(),i=(r-s.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return ot(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});case"cccc":default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,n){const s=e.getDay(),r=s===0?7:s;switch(t){case"i":return String(r);case"ii":return ot(r,t.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(s,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(s,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(s,{width:"short",context:"formatting"});case"iiii":default:return n.day(s,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const s=e.getHours();let r;switch(s===12?r=Ai.noon:s===0?r=Ai.midnight:r=s/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){const s=e.getHours();let r;switch(s>=17?r=Ai.evening:s>=12?r=Ai.afternoon:s>=4?r=Ai.morning:r=Ai.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let s=e.getHours()%12;return s===0&&(s=12),n.ordinalNumber(s,{unit:"hour"})}return Pa.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Pa.H(e,t)},K:function(e,t,n){const s=e.getHours()%12;return t==="Ko"?n.ordinalNumber(s,{unit:"hour"}):ot(s,t.length)},k:function(e,t,n){let s=e.getHours();return s===0&&(s=24),t==="ko"?n.ordinalNumber(s,{unit:"hour"}):ot(s,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Pa.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Pa.s(e,t)},S:function(e,t){return Pa.S(e,t)},X:function(e,t,n){const s=e.getTimezoneOffset();if(s===0)return"Z";switch(t){case"X":return dw(s);case"XXXX":case"XX":return Ur(s);case"XXXXX":case"XXX":default:return Ur(s,":")}},x:function(e,t,n){const s=e.getTimezoneOffset();switch(t){case"x":return dw(s);case"xxxx":case"xx":return Ur(s);case"xxxxx":case"xxx":default:return Ur(s,":")}},O:function(e,t,n){const s=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+cw(s,":");case"OOOO":default:return"GMT"+Ur(s,":")}},z:function(e,t,n){const s=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+cw(s,":");case"zzzz":default:return"GMT"+Ur(s,":")}},t:function(e,t,n){const s=Math.trunc(+e/1e3);return ot(s,t.length)},T:function(e,t,n){return ot(+e,t.length)}};function cw(e,t=""){const n=e>0?"-":"+",s=Math.abs(e),r=Math.trunc(s/60),i=s%60;return i===0?n+String(r):n+String(r)+t+ot(i,2)}function dw(e,t){return e%60===0?(e>0?"-":"+")+ot(Math.abs(e)/60,2):Ur(e,t)}function Ur(e,t=""){const n=e>0?"-":"+",s=Math.abs(e),r=ot(Math.trunc(s/60),2),i=ot(s%60,2);return n+r+t+i}const uw=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},bC=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},cL=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],s=n[1],r=n[2];if(!r)return uw(e,t);let i;switch(s){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",uw(s,t)).replace("{{time}}",bC(r,t))},dL={p:bC,P:cL},uL=/^D+$/,hL=/^Y+$/,fL=["D","DD","YY","YYYY"];function mL(e){return uL.test(e)}function xL(e){return hL.test(e)}function gL(e,t,n){const s=pL(e,t,n);if(console.warn(s),fL.includes(e))throw new RangeError(s)}function pL(e,t,n){const s=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${s} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const vL=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,bL=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,yL=/^'([^]*?)'?$/,wL=/''/g,jL=/[a-zA-Z]/;function NL(e,t,n){var h,d,f,x,y,v,j,g;const s=Jc(),r=(n==null?void 0:n.locale)??s.locale??j0,i=(n==null?void 0:n.firstWeekContainsDate)??((d=(h=n==null?void 0:n.locale)==null?void 0:h.options)==null?void 0:d.firstWeekContainsDate)??s.firstWeekContainsDate??((x=(f=s.locale)==null?void 0:f.options)==null?void 0:x.firstWeekContainsDate)??1,o=(n==null?void 0:n.weekStartsOn)??((v=(y=n==null?void 0:n.locale)==null?void 0:y.options)==null?void 0:v.weekStartsOn)??s.weekStartsOn??((g=(j=s.locale)==null?void 0:j.options)==null?void 0:g.weekStartsOn)??0,l=ht(e,n==null?void 0:n.in);if(!wP(l))throw new RangeError("Invalid time value");let c=t.match(bL).map(b=>{const p=b[0];if(p==="p"||p==="P"){const w=dL[p];return w(b,r.formatLong)}return b}).join("").match(vL).map(b=>{if(b==="''")return{isToken:!1,value:"'"};const p=b[0];if(p==="'")return{isToken:!1,value:SL(b)};if(lw[p])return{isToken:!0,value:b};if(p.match(jL))throw new RangeError("Format string contains an unescaped latin alphabet character `"+p+"`");return{isToken:!1,value:b}});r.localize.preprocessor&&(c=r.localize.preprocessor(l,c));const u={firstWeekContainsDate:i,weekStartsOn:o,locale:r};return c.map(b=>{if(!b.isToken)return b.value;const p=b.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&xL(p)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&mL(p))&&gL(p,t,String(e));const w=lw[p[0]];return w(l,p,r.localize,u)}).join("")}function SL(e){const t=e.match(yL);return t?t[1].replace(wL,"'"):e}function CL(e,t){const n=ht(e,t==null?void 0:t.in),s=n.getFullYear(),r=n.getMonth(),i=$t(n,0);return i.setFullYear(s,r+1,0),i.setHours(0,0,0,0),i.getDate()}function EL(e,t){return ht(e,t==null?void 0:t.in).getMonth()}function kL(e,t){return ht(e,t==null?void 0:t.in).getFullYear()}function ML(e,t){return+ht(e)>+ht(t)}function TL(e,t){return+ht(e)<+ht(t)}function DL(e,t,n){const[s,r]=Ko(n==null?void 0:n.in,e,t);return s.getFullYear()===r.getFullYear()&&s.getMonth()===r.getMonth()}function _L(e,t,n){const[s,r]=Ko(n==null?void 0:n.in,e,t);return s.getFullYear()===r.getFullYear()}function AL(e,t,n){const s=ht(e,n==null?void 0:n.in),r=s.getFullYear(),i=s.getDate(),o=$t(e,0);o.setFullYear(r,t,15),o.setHours(0,0,0,0);const l=CL(o);return s.setMonth(t,Math.min(i,l)),s}function OL(e,t,n){const s=ht(e,n==null?void 0:n.in);return isNaN(+s)?$t(e,NaN):(s.setFullYear(t),s)}const hw=5,zL=4;function RL(e,t){const n=t.startOfMonth(e),s=n.getDay()>0?n.getDay():7,r=t.addDays(e,-s+1),i=t.addDays(r,hw*7-1);return t.getMonth(e)===t.getMonth(i)?hw:zL}function yC(e,t){const n=t.startOfMonth(e),s=n.getDay();return s===1?n:s===0?t.addDays(n,-1*6):t.addDays(n,-1*(s-1))}function UL(e,t){const n=yC(e,t),s=RL(e,t);return t.addDays(n,s*7-1)}class Yn{constructor(t,n){this.Date=Date,this.today=()=>{var s;return(s=this.overrides)!=null&&s.today?this.overrides.today():this.options.timeZone?an.tz(this.options.timeZone):new this.Date},this.newDate=(s,r,i)=>{var o;return(o=this.overrides)!=null&&o.newDate?this.overrides.newDate(s,r,i):this.options.timeZone?new an(s,r,i,this.options.timeZone):new Date(s,r,i)},this.addDays=(s,r)=>{var i;return(i=this.overrides)!=null&&i.addDays?this.overrides.addDays(s,r):lC(s,r)},this.addMonths=(s,r)=>{var i;return(i=this.overrides)!=null&&i.addMonths?this.overrides.addMonths(s,r):cC(s,r)},this.addWeeks=(s,r)=>{var i;return(i=this.overrides)!=null&&i.addWeeks?this.overrides.addWeeks(s,r):gP(s,r)},this.addYears=(s,r)=>{var i;return(i=this.overrides)!=null&&i.addYears?this.overrides.addYears(s,r):pP(s,r)},this.differenceInCalendarDays=(s,r)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarDays?this.overrides.differenceInCalendarDays(s,r):uC(s,r)},this.differenceInCalendarMonths=(s,r)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(s,r):jP(s,r)},this.eachMonthOfInterval=s=>{var r;return(r=this.overrides)!=null&&r.eachMonthOfInterval?this.overrides.eachMonthOfInterval(s):SP(s)},this.eachYearOfInterval=s=>{var l;const r=(l=this.overrides)!=null&&l.eachYearOfInterval?this.overrides.eachYearOfInterval(s):kP(s),i=new Set(r.map(c=>this.getYear(c)));if(i.size===r.length)return r;const o=[];return i.forEach(c=>{o.push(new Date(c,0,1))}),o},this.endOfBroadcastWeek=s=>{var r;return(r=this.overrides)!=null&&r.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(s):UL(s,this)},this.endOfISOWeek=s=>{var r;return(r=this.overrides)!=null&&r.endOfISOWeek?this.overrides.endOfISOWeek(s):MP(s)},this.endOfMonth=s=>{var r;return(r=this.overrides)!=null&&r.endOfMonth?this.overrides.endOfMonth(s):NP(s)},this.endOfWeek=(s,r)=>{var i;return(i=this.overrides)!=null&&i.endOfWeek?this.overrides.endOfWeek(s,r):xC(s,this.options)},this.endOfYear=s=>{var r;return(r=this.overrides)!=null&&r.endOfYear?this.overrides.endOfYear(s):EP(s)},this.format=(s,r,i)=>{var l;const o=(l=this.overrides)!=null&&l.format?this.overrides.format(s,r,this.options):NL(s,r,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(o):o},this.getISOWeek=s=>{var r;return(r=this.overrides)!=null&&r.getISOWeek?this.overrides.getISOWeek(s):gC(s)},this.getMonth=(s,r)=>{var i;return(i=this.overrides)!=null&&i.getMonth?this.overrides.getMonth(s,this.options):EL(s,this.options)},this.getYear=(s,r)=>{var i;return(i=this.overrides)!=null&&i.getYear?this.overrides.getYear(s,this.options):kL(s,this.options)},this.getWeek=(s,r)=>{var i;return(i=this.overrides)!=null&&i.getWeek?this.overrides.getWeek(s,this.options):vC(s,this.options)},this.isAfter=(s,r)=>{var i;return(i=this.overrides)!=null&&i.isAfter?this.overrides.isAfter(s,r):ML(s,r)},this.isBefore=(s,r)=>{var i;return(i=this.overrides)!=null&&i.isBefore?this.overrides.isBefore(s,r):TL(s,r)},this.isDate=s=>{var r;return(r=this.overrides)!=null&&r.isDate?this.overrides.isDate(s):hC(s)},this.isSameDay=(s,r)=>{var i;return(i=this.overrides)!=null&&i.isSameDay?this.overrides.isSameDay(s,r):yP(s,r)},this.isSameMonth=(s,r)=>{var i;return(i=this.overrides)!=null&&i.isSameMonth?this.overrides.isSameMonth(s,r):DL(s,r)},this.isSameYear=(s,r)=>{var i;return(i=this.overrides)!=null&&i.isSameYear?this.overrides.isSameYear(s,r):_L(s,r)},this.max=s=>{var r;return(r=this.overrides)!=null&&r.max?this.overrides.max(s):vP(s)},this.min=s=>{var r;return(r=this.overrides)!=null&&r.min?this.overrides.min(s):bP(s)},this.setMonth=(s,r)=>{var i;return(i=this.overrides)!=null&&i.setMonth?this.overrides.setMonth(s,r):AL(s,r)},this.setYear=(s,r)=>{var i;return(i=this.overrides)!=null&&i.setYear?this.overrides.setYear(s,r):OL(s,r)},this.startOfBroadcastWeek=(s,r)=>{var i;return(i=this.overrides)!=null&&i.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(s,this):yC(s,this)},this.startOfDay=s=>{var r;return(r=this.overrides)!=null&&r.startOfDay?this.overrides.startOfDay(s):kc(s)},this.startOfISOWeek=s=>{var r;return(r=this.overrides)!=null&&r.startOfISOWeek?this.overrides.startOfISOWeek(s):Ec(s)},this.startOfMonth=s=>{var r;return(r=this.overrides)!=null&&r.startOfMonth?this.overrides.startOfMonth(s):CP(s)},this.startOfWeek=(s,r)=>{var i;return(i=this.overrides)!=null&&i.startOfWeek?this.overrides.startOfWeek(s,this.options):$o(s,this.options)},this.startOfYear=s=>{var r;return(r=this.overrides)!=null&&r.startOfYear?this.overrides.startOfYear(s):mC(s)},this.options={locale:j0,...t},this.overrides=n}getDigitMap(){const{numerals:t="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:t}),s={};for(let r=0;r<10;r++)s[r.toString()]=n.format(r);return s}replaceDigits(t){const n=this.getDigitMap();return t.replace(/\d/g,s=>n[s]||s)}formatNumber(t){return this.replaceDigits(t.toString())}getMonthYearOrder(){var n;const t=(n=this.options.locale)==null?void 0:n.code;return t&&Yn.yearFirstLocales.has(t)?"year-first":"month-first"}formatMonthYear(t){const{locale:n,timeZone:s,numerals:r}=this.options,i=n==null?void 0:n.code;if(i&&Yn.yearFirstLocales.has(i))try{return new Intl.DateTimeFormat(i,{month:"long",year:"numeric",timeZone:s,numberingSystem:r}).format(t)}catch{}const o=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(t,o)}}Yn.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const Qs=new Yn;class wC{constructor(t,n,s=Qs){this.date=t,this.displayMonth=n,this.outside=!!(n&&!s.isSameMonth(t,n)),this.dateLib=s}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class $L{constructor(t,n){this.date=t,this.weeks=n}}class PL{constructor(t,n){this.days=n,this.weekNumber=t}}function LL(e){return G.createElement("button",{...e})}function HL(e){return G.createElement("span",{...e})}function BL(e){const{size:t=24,orientation:n="left",className:s}=e;return G.createElement("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&G.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&G.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&G.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&G.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function VL(e){const{day:t,modifiers:n,...s}=e;return G.createElement("td",{...s})}function YL(e){const{day:t,modifiers:n,...s}=e,r=G.useRef(null);return G.useEffect(()=>{var i;n.focused&&((i=r.current)==null||i.focus())},[n.focused]),G.createElement("button",{ref:r,...s})}var De;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})(De||(De={}));var Mt;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(Mt||(Mt={}));var ms;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(ms||(ms={}));var Tn;(function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"})(Tn||(Tn={}));function FL(e){const{options:t,className:n,components:s,classNames:r,...i}=e,o=[r[De.Dropdown],n].join(" "),l=t==null?void 0:t.find(({value:c})=>c===i.value);return G.createElement("span",{"data-disabled":i.disabled,className:r[De.DropdownRoot]},G.createElement(s.Select,{className:o,...i},t==null?void 0:t.map(({value:c,label:u,disabled:h})=>G.createElement(s.Option,{key:c,value:c,disabled:h},u))),G.createElement("span",{className:r[De.CaptionLabel],"aria-hidden":!0},l==null?void 0:l.label,G.createElement(s.Chevron,{orientation:"down",size:18,className:r[De.Chevron]})))}function IL(e){return G.createElement("div",{...e})}function WL(e){return G.createElement("div",{...e})}function qL(e){const{calendarMonth:t,displayIndex:n,...s}=e;return G.createElement("div",{...s},e.children)}function XL(e){const{calendarMonth:t,displayIndex:n,...s}=e;return G.createElement("div",{...s})}function GL(e){return G.createElement("table",{...e})}function ZL(e){return G.createElement("div",{...e})}const jC=m.createContext(void 0);function ed(){const e=m.useContext(jC);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function QL(e){const{components:t}=ed();return G.createElement(t.Dropdown,{...e})}function KL(e){const{onPreviousClick:t,onNextClick:n,previousMonth:s,nextMonth:r,...i}=e,{components:o,classNames:l,labels:{labelPrevious:c,labelNext:u}}=ed(),h=m.useCallback(f=>{r&&(n==null||n(f))},[r,n]),d=m.useCallback(f=>{s&&(t==null||t(f))},[s,t]);return G.createElement("nav",{...i},G.createElement(o.PreviousMonthButton,{type:"button",className:l[De.PreviousMonthButton],tabIndex:s?void 0:-1,"aria-disabled":s?void 0:!0,"aria-label":c(s),onClick:d},G.createElement(o.Chevron,{disabled:s?void 0:!0,className:l[De.Chevron],orientation:"left"})),G.createElement(o.NextMonthButton,{type:"button",className:l[De.NextMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":u(r),onClick:h},G.createElement(o.Chevron,{disabled:r?void 0:!0,orientation:"right",className:l[De.Chevron]})))}function JL(e){const{components:t}=ed();return G.createElement(t.Button,{...e})}function eH(e){return G.createElement("option",{...e})}function tH(e){const{components:t}=ed();return G.createElement(t.Button,{...e})}function nH(e){const{rootRef:t,...n}=e;return G.createElement("div",{...n,ref:t})}function sH(e){return G.createElement("select",{...e})}function aH(e){const{week:t,...n}=e;return G.createElement("tr",{...n})}function rH(e){return G.createElement("th",{...e})}function iH(e){return G.createElement("thead",{"aria-hidden":!0},G.createElement("tr",{...e}))}function oH(e){const{week:t,...n}=e;return G.createElement("th",{...n})}function lH(e){return G.createElement("th",{...e})}function cH(e){return G.createElement("tbody",{...e})}function dH(e){const{components:t}=ed();return G.createElement(t.Dropdown,{...e})}const uH=Object.freeze(Object.defineProperty({__proto__:null,Button:LL,CaptionLabel:HL,Chevron:BL,Day:VL,DayButton:YL,Dropdown:FL,DropdownNav:IL,Footer:WL,Month:qL,MonthCaption:XL,MonthGrid:GL,Months:ZL,MonthsDropdown:QL,Nav:KL,NextMonthButton:JL,Option:eH,PreviousMonthButton:tH,Root:nH,Select:sH,Week:aH,WeekNumber:oH,WeekNumberHeader:lH,Weekday:rH,Weekdays:iH,Weeks:cH,YearsDropdown:dH},Symbol.toStringTag,{value:"Module"}));function ua(e,t,n=!1,s=Qs){let{from:r,to:i}=e;const{differenceInCalendarDays:o,isSameDay:l}=s;return r&&i?(o(i,r)<0&&([r,i]=[i,r]),o(t,r)>=(n?1:0)&&o(i,t)>=(n?1:0)):!n&&i?l(i,t):!n&&r?l(r,t):!1}function NC(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function N0(e){return!!(e&&typeof e=="object"&&"from"in e)}function SC(e){return!!(e&&typeof e=="object"&&"after"in e)}function CC(e){return!!(e&&typeof e=="object"&&"before"in e)}function EC(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function kC(e,t){return Array.isArray(e)&&e.every(t.isDate)}function ha(e,t,n=Qs){const s=Array.isArray(t)?t:[t],{isSameDay:r,differenceInCalendarDays:i,isAfter:o}=n;return s.some(l=>{if(typeof l=="boolean")return l;if(n.isDate(l))return r(e,l);if(kC(l,n))return l.includes(e);if(N0(l))return ua(l,e,!1,n);if(EC(l))return Array.isArray(l.dayOfWeek)?l.dayOfWeek.includes(e.getDay()):l.dayOfWeek===e.getDay();if(NC(l)){const c=i(l.before,e),u=i(l.after,e),h=c>0,d=u<0;return o(l.before,l.after)?d&&h:h||d}return SC(l)?i(e,l.after)>0:CC(l)?i(l.before,e)>0:typeof l=="function"?l(e):!1})}function hH(e,t,n,s,r){const{disabled:i,hidden:o,modifiers:l,showOutsideDays:c,broadcastCalendar:u,today:h}=t,{isSameDay:d,isSameMonth:f,startOfMonth:x,isBefore:y,endOfMonth:v,isAfter:j}=r,g=n&&x(n),b=s&&v(s),p={[Mt.focused]:[],[Mt.outside]:[],[Mt.disabled]:[],[Mt.hidden]:[],[Mt.today]:[]},w={};for(const N of e){const{date:S,displayMonth:C}=N,T=!!(C&&!f(S,C)),O=!!(g&&y(S,g)),H=!!(b&&j(S,b)),U=!!(i&&ha(S,i,r)),z=!!(o&&ha(S,o,r))||O||H||!u&&!c&&T||u&&c===!1&&T,Y=d(S,h??r.today());T&&p.outside.push(N),U&&p.disabled.push(N),z&&p.hidden.push(N),Y&&p.today.push(N),l&&Object.keys(l).forEach(k=>{const $=l==null?void 0:l[k];$&&ha(S,$,r)&&(w[k]?w[k].push(N):w[k]=[N])})}return N=>{const S={[Mt.focused]:!1,[Mt.disabled]:!1,[Mt.hidden]:!1,[Mt.outside]:!1,[Mt.today]:!1},C={};for(const T in p){const O=p[T];S[T]=O.some(H=>H===N)}for(const T in w)C[T]=w[T].some(O=>O===N);return{...S,...C}}}function fH(e,t,n={}){return Object.entries(e).filter(([,r])=>r===!0).reduce((r,[i])=>(n[i]?r.push(n[i]):t[Mt[i]]?r.push(t[Mt[i]]):t[ms[i]]&&r.push(t[ms[i]]),r),[t[De.Day]])}function mH(e){return{...uH,...e}}function xH(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([n,s])=>{n.startsWith("data-")&&(t[n]=s)}),t}function S0(){const e={};for(const t in De)e[De[t]]=`rdp-${De[t]}`;for(const t in Mt)e[Mt[t]]=`rdp-${Mt[t]}`;for(const t in ms)e[ms[t]]=`rdp-${ms[t]}`;for(const t in Tn)e[Tn[t]]=`rdp-${Tn[t]}`;return e}function MC(e,t,n){return(n??new Yn(t)).formatMonthYear(e)}const gH=MC;function pH(e,t,n){return(n??new Yn(t)).format(e,"d")}function vH(e,t=Qs){return t.format(e,"LLLL")}function bH(e,t,n){return(n??new Yn(t)).format(e,"cccccc")}function yH(e,t=Qs){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function wH(){return""}function TC(e,t=Qs){return t.format(e,"yyyy")}const jH=TC,NH=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:MC,formatDay:pH,formatMonthCaption:gH,formatMonthDropdown:vH,formatWeekNumber:yH,formatWeekNumberHeader:wH,formatWeekdayName:bH,formatYearCaption:jH,formatYearDropdown:TC},Symbol.toStringTag,{value:"Module"}));function SH(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...NH,...e}}function CH(e,t,n,s,r){const{startOfMonth:i,startOfYear:o,endOfYear:l,eachMonthOfInterval:c,getMonth:u}=r;return c({start:o(e),end:l(e)}).map(f=>{const x=s.formatMonthDropdown(f,r),y=u(f),v=t&&f<i(t)||n&&f>i(n)||!1;return{value:y,label:x,disabled:v}})}function EH(e,t={},n={}){let s={...t==null?void 0:t[De.Day]};return Object.entries(e).filter(([,r])=>r===!0).forEach(([r])=>{s={...s,...n==null?void 0:n[r]}}),s}function kH(e,t,n){const s=e.today(),r=t?e.startOfISOWeek(s):e.startOfWeek(s),i=[];for(let o=0;o<7;o++){const l=e.addDays(r,o);i.push(l)}return i}function MH(e,t,n,s,r=!1){if(!e||!t)return;const{startOfYear:i,endOfYear:o,eachYearOfInterval:l,getYear:c}=s,u=i(e),h=o(t),d=l({start:u,end:h});return r&&d.reverse(),d.map(f=>{const x=n.formatYearDropdown(f,s);return{value:c(f),label:x,disabled:!1}})}function DC(e,t,n,s){let r=(s??new Yn(n)).format(e,"PPPP");return t.today&&(r=`Today, ${r}`),t.selected&&(r=`${r}, selected`),r}const TH=DC;function _C(e,t,n){return(n??new Yn(t)).formatMonthYear(e)}const DH=_C;function _H(e,t,n,s){let r=(s??new Yn(n)).format(e,"PPPP");return t!=null&&t.today&&(r=`Today, ${r}`),r}function AH(e){return"Choose the Month"}function OH(){return""}function zH(e){return"Go to the Next Month"}function RH(e){return"Go to the Previous Month"}function UH(e,t,n){return(n??new Yn(t)).format(e,"cccc")}function $H(e,t){return`Week ${e}`}function PH(e){return"Week Number"}function LH(e){return"Choose the Year"}const HH=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:DH,labelDay:TH,labelDayButton:DC,labelGrid:_C,labelGridcell:_H,labelMonthDropdown:AH,labelNav:OH,labelNext:zH,labelPrevious:RH,labelWeekNumber:$H,labelWeekNumberHeader:PH,labelWeekday:UH,labelYearDropdown:LH},Symbol.toStringTag,{value:"Module"})),td=e=>e instanceof HTMLElement?e:null,Wm=e=>[...e.querySelectorAll("[data-animated-month]")??[]],BH=e=>td(e.querySelector("[data-animated-month]")),qm=e=>td(e.querySelector("[data-animated-caption]")),Xm=e=>td(e.querySelector("[data-animated-weeks]")),VH=e=>td(e.querySelector("[data-animated-nav]")),YH=e=>td(e.querySelector("[data-animated-weekdays]"));function FH(e,t,{classNames:n,months:s,focused:r,dateLib:i}){const o=m.useRef(null),l=m.useRef(s),c=m.useRef(!1);m.useLayoutEffect(()=>{const u=l.current;if(l.current=s,!t||!e.current||!(e.current instanceof HTMLElement)||s.length===0||u.length===0||s.length!==u.length)return;const h=i.isSameMonth(s[0].date,u[0].date),d=i.isAfter(s[0].date,u[0].date),f=d?n[Tn.caption_after_enter]:n[Tn.caption_before_enter],x=d?n[Tn.weeks_after_enter]:n[Tn.weeks_before_enter],y=o.current,v=e.current.cloneNode(!0);if(v instanceof HTMLElement?(Wm(v).forEach(p=>{if(!(p instanceof HTMLElement))return;const w=BH(p);w&&p.contains(w)&&p.removeChild(w);const N=qm(p);N&&N.classList.remove(f);const S=Xm(p);S&&S.classList.remove(x)}),o.current=v):o.current=null,c.current||h||r)return;const j=y instanceof HTMLElement?Wm(y):[],g=Wm(e.current);if(g!=null&&g.every(b=>b instanceof HTMLElement)&&j&&j.every(b=>b instanceof HTMLElement)){c.current=!0,e.current.style.isolation="isolate";const b=VH(e.current);b&&(b.style.zIndex="1"),g.forEach((p,w)=>{const N=j[w];if(!N)return;p.style.position="relative",p.style.overflow="hidden";const S=qm(p);S&&S.classList.add(f);const C=Xm(p);C&&C.classList.add(x);const T=()=>{c.current=!1,e.current&&(e.current.style.isolation=""),b&&(b.style.zIndex=""),S&&S.classList.remove(f),C&&C.classList.remove(x),p.style.position="",p.style.overflow="",p.contains(N)&&p.removeChild(N)};N.style.pointerEvents="none",N.style.position="absolute",N.style.overflow="hidden",N.setAttribute("aria-hidden","true");const O=YH(N);O&&(O.style.opacity="0");const H=qm(N);H&&(H.classList.add(d?n[Tn.caption_before_exit]:n[Tn.caption_after_exit]),H.addEventListener("animationend",T));const U=Xm(N);U&&U.classList.add(d?n[Tn.weeks_before_exit]:n[Tn.weeks_after_exit]),p.insertBefore(N,p.firstChild)})}})}function IH(e,t,n,s){const r=e[0],i=e[e.length-1],{ISOWeek:o,fixedWeeks:l,broadcastCalendar:c}=n??{},{addDays:u,differenceInCalendarDays:h,differenceInCalendarMonths:d,endOfBroadcastWeek:f,endOfISOWeek:x,endOfMonth:y,endOfWeek:v,isAfter:j,startOfBroadcastWeek:g,startOfISOWeek:b,startOfWeek:p}=s,w=c?g(r,s):o?b(r):p(r),N=c?f(i):o?x(y(i)):v(y(i)),S=h(N,w),C=d(i,r)+1,T=[];for(let U=0;U<=S;U++){const z=u(w,U);if(t&&j(z,t))break;T.push(z)}const H=(c?35:42)*C;if(l&&T.length<H){const U=H-T.length;for(let z=0;z<U;z++){const Y=u(T[T.length-1],1);T.push(Y)}}return T}function WH(e){const t=[];return e.reduce((n,s)=>{const r=s.weeks.reduce((i,o)=>i.concat(o.days.slice()),t.slice());return n.concat(r.slice())},t.slice())}function qH(e,t,n,s){const{numberOfMonths:r=1}=n,i=[];for(let o=0;o<r;o++){const l=s.addMonths(e,o);if(t&&l>t)break;i.push(l)}return i}function fw(e,t,n,s){const{month:r,defaultMonth:i,today:o=s.today(),numberOfMonths:l=1}=e;let c=r||i||o;const{differenceInCalendarMonths:u,addMonths:h,startOfMonth:d}=s;if(n&&u(n,c)<l-1){const f=-1*(l-1);c=h(n,f)}return t&&u(c,t)<0&&(c=t),d(c)}function XH(e,t,n,s){const{addDays:r,endOfBroadcastWeek:i,endOfISOWeek:o,endOfMonth:l,endOfWeek:c,getISOWeek:u,getWeek:h,startOfBroadcastWeek:d,startOfISOWeek:f,startOfWeek:x}=s,y=e.reduce((v,j)=>{const g=n.broadcastCalendar?d(j,s):n.ISOWeek?f(j):x(j),b=n.broadcastCalendar?i(j):n.ISOWeek?o(l(j)):c(l(j)),p=t.filter(C=>C>=g&&C<=b),w=n.broadcastCalendar?35:42;if(n.fixedWeeks&&p.length<w){const C=t.filter(T=>{const O=w-p.length;return T>b&&T<=r(b,O)});p.push(...C)}const N=p.reduce((C,T)=>{const O=n.ISOWeek?u(T):h(T),H=C.find(z=>z.weekNumber===O),U=new wC(T,j,s);return H?H.days.push(U):C.push(new PL(O,[U])),C},[]),S=new $L(j,N);return v.push(S),v},[]);return n.reverseMonths?y.reverse():y}function GH(e,t){let{startMonth:n,endMonth:s}=e;const{startOfYear:r,startOfDay:i,startOfMonth:o,endOfMonth:l,addYears:c,endOfYear:u,newDate:h,today:d}=t,{fromYear:f,toYear:x,fromMonth:y,toMonth:v}=e;!n&&y&&(n=y),!n&&f&&(n=t.newDate(f,0,1)),!s&&v&&(s=v),!s&&x&&(s=h(x,11,31));const j=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=o(n):f?n=h(f,0,1):!n&&j&&(n=r(c(e.today??d(),-100))),s?s=l(s):x?s=h(x,11,31):!s&&j&&(s=u(e.today??d())),[n&&i(n),s&&i(s)]}function ZH(e,t,n,s){if(n.disableNavigation)return;const{pagedNavigation:r,numberOfMonths:i=1}=n,{startOfMonth:o,addMonths:l,differenceInCalendarMonths:c}=s,u=r?i:1,h=o(e);if(!t)return l(h,u);if(!(c(t,e)<i))return l(h,u)}function QH(e,t,n,s){if(n.disableNavigation)return;const{pagedNavigation:r,numberOfMonths:i}=n,{startOfMonth:o,addMonths:l,differenceInCalendarMonths:c}=s,u=r?i??1:1,h=o(e);if(!t)return l(h,-u);if(!(c(h,t)<=0))return l(h,-u)}function KH(e){const t=[];return e.reduce((n,s)=>n.concat(s.weeks.slice()),t.slice())}function Nf(e,t){const[n,s]=m.useState(e);return[t===void 0?n:t,s]}function JH(e,t){const[n,s]=GH(e,t),{startOfMonth:r,endOfMonth:i}=t,o=fw(e,n,s,t),[l,c]=Nf(o,e.month?o:void 0);m.useEffect(()=>{const S=fw(e,n,s,t);c(S)},[e.timeZone]);const u=qH(l,s,e,t),h=IH(u,e.endMonth?i(e.endMonth):void 0,e,t),d=XH(u,h,e,t),f=KH(d),x=WH(d),y=QH(l,n,e,t),v=ZH(l,s,e,t),{disableNavigation:j,onMonthChange:g}=e,b=S=>f.some(C=>C.days.some(T=>T.isEqualTo(S))),p=S=>{if(j)return;let C=r(S);n&&C<r(n)&&(C=r(n)),s&&C>r(s)&&(C=r(s)),c(C),g==null||g(C)};return{months:d,weeks:f,days:x,navStart:n,navEnd:s,previousMonth:y,nextMonth:v,goToMonth:p,goToDay:S=>{b(S)||p(S.date)}}}var Ds;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(Ds||(Ds={}));function mw(e){return!e[Mt.disabled]&&!e[Mt.hidden]&&!e[Mt.outside]}function eB(e,t,n,s){let r,i=-1;for(const o of e){const l=t(o);mw(l)&&(l[Mt.focused]&&i<Ds.FocusedModifier?(r=o,i=Ds.FocusedModifier):s!=null&&s.isEqualTo(o)&&i<Ds.LastFocused?(r=o,i=Ds.LastFocused):n(o.date)&&i<Ds.Selected?(r=o,i=Ds.Selected):l[Mt.today]&&i<Ds.Today&&(r=o,i=Ds.Today))}return r||(r=e.find(o=>mw(t(o)))),r}function tB(e,t,n,s,r,i,o){const{ISOWeek:l,broadcastCalendar:c}=i,{addDays:u,addMonths:h,addWeeks:d,addYears:f,endOfBroadcastWeek:x,endOfISOWeek:y,endOfWeek:v,max:j,min:g,startOfBroadcastWeek:b,startOfISOWeek:p,startOfWeek:w}=o;let S={day:u,week:d,month:h,year:f,startOfWeek:C=>c?b(C,o):l?p(C):w(C),endOfWeek:C=>c?x(C):l?y(C):v(C)}[e](n,t==="after"?1:-1);return t==="before"&&s?S=j([s,S]):t==="after"&&r&&(S=g([r,S])),S}function AC(e,t,n,s,r,i,o,l=0){if(l>365)return;const c=tB(e,t,n.date,s,r,i,o),u=!!(i.disabled&&ha(c,i.disabled,o)),h=!!(i.hidden&&ha(c,i.hidden,o)),d=c,f=new wC(c,d,o);return!u&&!h?f:AC(e,t,f,s,r,i,o,l+1)}function nB(e,t,n,s,r){const{autoFocus:i}=e,[o,l]=m.useState(),c=eB(t.days,n,s||(()=>!1),o),[u,h]=m.useState(i?c:void 0);return{isFocusTarget:v=>!!(c!=null&&c.isEqualTo(v)),setFocused:h,focused:u,blur:()=>{l(u),h(void 0)},moveFocus:(v,j)=>{if(!u)return;const g=AC(v,j,u,t.navStart,t.navEnd,e,r);g&&(e.disableNavigation&&!t.days.some(p=>p.isEqualTo(g))||(t.goToDay(g),h(g)))}}}function sB(e,t){const{selected:n,required:s,onSelect:r}=e,[i,o]=Nf(n,r?n:void 0),l=r?n:i,{isSameDay:c}=t,u=x=>(l==null?void 0:l.some(y=>c(y,x)))??!1,{min:h,max:d}=e;return{selected:l,select:(x,y,v)=>{let j=[...l??[]];if(u(x)){if((l==null?void 0:l.length)===h||s&&(l==null?void 0:l.length)===1)return;j=l==null?void 0:l.filter(g=>!c(g,x))}else(l==null?void 0:l.length)===d?j=[x]:j=[...j,x];return r||o(j),r==null||r(j,x,y,v),j},isSelected:u}}function aB(e,t,n=0,s=0,r=!1,i=Qs){const{from:o,to:l}=t||{},{isSameDay:c,isAfter:u,isBefore:h}=i;let d;if(!o&&!l)d={from:e,to:n>0?void 0:e};else if(o&&!l)c(o,e)?n===0?d={from:o,to:e}:r?d={from:o,to:void 0}:d=void 0:h(e,o)?d={from:e,to:o}:d={from:o,to:e};else if(o&&l)if(c(o,e)&&c(l,e))r?d={from:o,to:l}:d=void 0;else if(c(o,e))d={from:o,to:n>0?void 0:e};else if(c(l,e))d={from:e,to:n>0?void 0:e};else if(h(e,o))d={from:e,to:l};else if(u(e,o))d={from:o,to:e};else if(u(e,l))d={from:o,to:e};else throw new Error("Invalid range");if(d!=null&&d.from&&(d!=null&&d.to)){const f=i.differenceInCalendarDays(d.to,d.from);s>0&&f>s?d={from:e,to:void 0}:n>1&&f<n&&(d={from:e,to:void 0})}return d}function rB(e,t,n=Qs){const s=Array.isArray(t)?t:[t];let r=e.from;const i=n.differenceInCalendarDays(e.to,e.from),o=Math.min(i,6);for(let l=0;l<=o;l++){if(s.includes(r.getDay()))return!0;r=n.addDays(r,1)}return!1}function xw(e,t,n=Qs){return ua(e,t.from,!1,n)||ua(e,t.to,!1,n)||ua(t,e.from,!1,n)||ua(t,e.to,!1,n)}function iB(e,t,n=Qs){const s=Array.isArray(t)?t:[t];if(s.filter(l=>typeof l!="function").some(l=>typeof l=="boolean"?l:n.isDate(l)?ua(e,l,!1,n):kC(l,n)?l.some(c=>ua(e,c,!1,n)):N0(l)?l.from&&l.to?xw(e,{from:l.from,to:l.to},n):!1:EC(l)?rB(e,l.dayOfWeek,n):NC(l)?n.isAfter(l.before,l.after)?xw(e,{from:n.addDays(l.after,1),to:n.addDays(l.before,-1)},n):ha(e.from,l,n)||ha(e.to,l,n):SC(l)||CC(l)?ha(e.from,l,n)||ha(e.to,l,n):!1))return!0;const o=s.filter(l=>typeof l=="function");if(o.length){let l=e.from;const c=n.differenceInCalendarDays(e.to,e.from);for(let u=0;u<=c;u++){if(o.some(h=>h(l)))return!0;l=n.addDays(l,1)}}return!1}function oB(e,t){const{disabled:n,excludeDisabled:s,selected:r,required:i,onSelect:o}=e,[l,c]=Nf(r,o?r:void 0),u=o?r:l;return{selected:u,select:(f,x,y)=>{const{min:v,max:j}=e,g=f?aB(f,u,v,j,i,t):void 0;return s&&n&&(g!=null&&g.from)&&g.to&&iB({from:g.from,to:g.to},n,t)&&(g.from=f,g.to=void 0),o||c(g),o==null||o(g,f,x,y),g},isSelected:f=>u&&ua(u,f,!1,t)}}function lB(e,t){const{selected:n,required:s,onSelect:r}=e,[i,o]=Nf(n,r?n:void 0),l=r?n:i,{isSameDay:c}=t;return{selected:l,select:(d,f,x)=>{let y=d;return!s&&l&&l&&c(d,l)&&(y=void 0),r||o(y),r==null||r(y,d,f,x),y},isSelected:d=>l?c(l,d):!1}}function cB(e,t){const n=lB(e,t),s=sB(e,t),r=oB(e,t);switch(e.mode){case"single":return n;case"multiple":return s;case"range":return r;default:return}}function dB(e){var Re;let t=e;t.timeZone&&(t={...e},t.today&&(t.today=new an(t.today,t.timeZone)),t.month&&(t.month=new an(t.month,t.timeZone)),t.defaultMonth&&(t.defaultMonth=new an(t.defaultMonth,t.timeZone)),t.startMonth&&(t.startMonth=new an(t.startMonth,t.timeZone)),t.endMonth&&(t.endMonth=new an(t.endMonth,t.timeZone)),t.mode==="single"&&t.selected?t.selected=new an(t.selected,t.timeZone):t.mode==="multiple"&&t.selected?t.selected=(Re=t.selected)==null?void 0:Re.map(je=>new an(je,t.timeZone)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?new an(t.selected.from,t.timeZone):void 0,to:t.selected.to?new an(t.selected.to,t.timeZone):void 0}));const{components:n,formatters:s,labels:r,dateLib:i,locale:o,classNames:l}=m.useMemo(()=>{const je={...j0,...t.locale};return{dateLib:new Yn({locale:je,weekStartsOn:t.broadcastCalendar?1:t.weekStartsOn,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},t.dateLib),components:mH(t.components),formatters:SH(t.formatters),labels:{...HH,...t.labels},locale:je,classNames:{...S0(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.components,t.formatters,t.labels,t.classNames]),{captionLayout:c,mode:u,navLayout:h,numberOfMonths:d=1,onDayBlur:f,onDayClick:x,onDayFocus:y,onDayKeyDown:v,onDayMouseEnter:j,onDayMouseLeave:g,onNextClick:b,onPrevClick:p,showWeekNumber:w,styles:N}=t,{formatCaption:S,formatDay:C,formatMonthDropdown:T,formatWeekNumber:O,formatWeekNumberHeader:H,formatWeekdayName:U,formatYearDropdown:z}=s,Y=JH(t,i),{days:k,months:$,navStart:M,navEnd:A,previousMonth:E,nextMonth:D,goToMonth:_}=Y,I=hH(k,t,M,A,i),{isSelected:R,select:P,selected:W}=cB(t,i)??{},{blur:q,focused:ee,isFocusTarget:ne,moveFocus:Z,setFocused:se}=nB(t,Y,I,R??(()=>!1),i),{labelDayButton:xe,labelGridcell:ae,labelGrid:ce,labelMonthDropdown:de,labelNav:Se,labelPrevious:Ee,labelNext:Ae,labelWeekday:He,labelWeekNumber:J,labelWeekNumberHeader:oe,labelYearDropdown:be}=r,Oe=m.useMemo(()=>kH(i,t.ISOWeek),[i,t.ISOWeek]),we=u!==void 0||x!==void 0,Ce=m.useCallback(()=>{E&&(_(E),p==null||p(E))},[E,_,p]),st=m.useCallback(()=>{D&&(_(D),b==null||b(D))},[_,D,b]),yt=m.useCallback((je,Ve)=>ke=>{ke.preventDefault(),ke.stopPropagation(),se(je),P==null||P(je.date,Ve,ke),x==null||x(je.date,Ve,ke)},[P,x,se]),wt=m.useCallback((je,Ve)=>ke=>{se(je),y==null||y(je.date,Ve,ke)},[y,se]),Lt=m.useCallback((je,Ve)=>ke=>{q(),f==null||f(je.date,Ve,ke)},[q,f]),K=m.useCallback((je,Ve)=>ke=>{const Pe={ArrowLeft:[ke.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[ke.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[ke.shiftKey?"year":"week","after"],ArrowUp:[ke.shiftKey?"year":"week","before"],PageUp:[ke.shiftKey?"year":"month","before"],PageDown:[ke.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(Pe[ke.key]){ke.preventDefault(),ke.stopPropagation();const[X,Q]=Pe[ke.key];Z(X,Q)}v==null||v(je.date,Ve,ke)},[Z,v,t.dir]),V=m.useCallback((je,Ve)=>ke=>{j==null||j(je.date,Ve,ke)},[j]),te=m.useCallback((je,Ve)=>ke=>{g==null||g(je.date,Ve,ke)},[g]),me=m.useCallback(je=>Ve=>{const ke=Number(Ve.target.value),Pe=i.setMonth(i.startOfMonth(je),ke);_(Pe)},[i,_]),L=m.useCallback(je=>Ve=>{const ke=Number(Ve.target.value),Pe=i.setYear(i.startOfMonth(je),ke);_(Pe)},[i,_]),{className:ie,style:ue}=m.useMemo(()=>({className:[l[De.Root],t.className].filter(Boolean).join(" "),style:{...N==null?void 0:N[De.Root],...t.style}}),[l,t.className,t.style,N]),he=xH(t),Be=m.useRef(null);FH(Be,!!t.animate,{classNames:l,months:$,focused:ee,dateLib:i});const _e={dayPickerProps:t,selected:W,select:P,isSelected:R,months:$,nextMonth:D,previousMonth:E,goToMonth:_,getModifiers:I,components:n,classNames:l,styles:N,labels:r,formatters:s};return G.createElement(jC.Provider,{value:_e},G.createElement(n.Root,{rootRef:t.animate?Be:void 0,className:ie,style:ue,dir:t.dir,id:t.id,lang:t.lang,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],"aria-labelledby":t["aria-labelledby"],...he},G.createElement(n.Months,{className:l[De.Months],style:N==null?void 0:N[De.Months]},!t.hideNavigation&&!h&&G.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:l[De.Nav],style:N==null?void 0:N[De.Nav],"aria-label":Se(),onPreviousClick:Ce,onNextClick:st,previousMonth:E,nextMonth:D}),$.map((je,Ve)=>G.createElement(n.Month,{"data-animated-month":t.animate?"true":void 0,className:l[De.Month],style:N==null?void 0:N[De.Month],key:Ve,displayIndex:Ve,calendarMonth:je},h==="around"&&!t.hideNavigation&&Ve===0&&G.createElement(n.PreviousMonthButton,{type:"button",className:l[De.PreviousMonthButton],tabIndex:E?void 0:-1,"aria-disabled":E?void 0:!0,"aria-label":Ee(E),onClick:Ce,"data-animated-button":t.animate?"true":void 0},G.createElement(n.Chevron,{disabled:E?void 0:!0,className:l[De.Chevron],orientation:t.dir==="rtl"?"right":"left"})),G.createElement(n.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:l[De.MonthCaption],style:N==null?void 0:N[De.MonthCaption],calendarMonth:je,displayIndex:Ve},c!=null&&c.startsWith("dropdown")?G.createElement(n.DropdownNav,{className:l[De.Dropdowns],style:N==null?void 0:N[De.Dropdowns]},(()=>{const ke=c==="dropdown"||c==="dropdown-months"?G.createElement(n.MonthsDropdown,{key:"month",className:l[De.MonthsDropdown],"aria-label":de(),classNames:l,components:n,disabled:!!t.disableNavigation,onChange:me(je.date),options:CH(je.date,M,A,s,i),style:N==null?void 0:N[De.Dropdown],value:i.getMonth(je.date)}):G.createElement("span",{key:"month"},T(je.date,i)),Pe=c==="dropdown"||c==="dropdown-years"?G.createElement(n.YearsDropdown,{key:"year",className:l[De.YearsDropdown],"aria-label":be(i.options),classNames:l,components:n,disabled:!!t.disableNavigation,onChange:L(je.date),options:MH(M,A,s,i,!!t.reverseYears),style:N==null?void 0:N[De.Dropdown],value:i.getYear(je.date)}):G.createElement("span",{key:"year"},z(je.date,i));return i.getMonthYearOrder()==="year-first"?[Pe,ke]:[ke,Pe]})(),G.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},S(je.date,i.options,i))):G.createElement(n.CaptionLabel,{className:l[De.CaptionLabel],role:"status","aria-live":"polite"},S(je.date,i.options,i))),h==="around"&&!t.hideNavigation&&Ve===d-1&&G.createElement(n.NextMonthButton,{type:"button",className:l[De.NextMonthButton],tabIndex:D?void 0:-1,"aria-disabled":D?void 0:!0,"aria-label":Ae(D),onClick:st,"data-animated-button":t.animate?"true":void 0},G.createElement(n.Chevron,{disabled:D?void 0:!0,className:l[De.Chevron],orientation:t.dir==="rtl"?"left":"right"})),Ve===d-1&&h==="after"&&!t.hideNavigation&&G.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:l[De.Nav],style:N==null?void 0:N[De.Nav],"aria-label":Se(),onPreviousClick:Ce,onNextClick:st,previousMonth:E,nextMonth:D}),G.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":u==="multiple"||u==="range","aria-label":ce(je.date,i.options,i)||void 0,className:l[De.MonthGrid],style:N==null?void 0:N[De.MonthGrid]},!t.hideWeekdays&&G.createElement(n.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:l[De.Weekdays],style:N==null?void 0:N[De.Weekdays]},w&&G.createElement(n.WeekNumberHeader,{"aria-label":oe(i.options),className:l[De.WeekNumberHeader],style:N==null?void 0:N[De.WeekNumberHeader],scope:"col"},H()),Oe.map(ke=>G.createElement(n.Weekday,{"aria-label":He(ke,i.options,i),className:l[De.Weekday],key:String(ke),style:N==null?void 0:N[De.Weekday],scope:"col"},U(ke,i.options,i)))),G.createElement(n.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:l[De.Weeks],style:N==null?void 0:N[De.Weeks]},je.weeks.map(ke=>G.createElement(n.Week,{className:l[De.Week],key:ke.weekNumber,style:N==null?void 0:N[De.Week],week:ke},w&&G.createElement(n.WeekNumber,{week:ke,style:N==null?void 0:N[De.WeekNumber],"aria-label":J(ke.weekNumber,{locale:o}),className:l[De.WeekNumber],scope:"row",role:"rowheader"},O(ke.weekNumber,i)),ke.days.map(Pe=>{const{date:X}=Pe,Q=I(Pe);if(Q[Mt.focused]=!Q.hidden&&!!(ee!=null&&ee.isEqualTo(Pe)),Q[ms.selected]=(R==null?void 0:R(X))||Q.selected,N0(W)){const{from:tt,to:Qe}=W;Q[ms.range_start]=!!(tt&&Qe&&i.isSameDay(X,tt)),Q[ms.range_end]=!!(tt&&Qe&&i.isSameDay(X,Qe)),Q[ms.range_middle]=ua(W,X,!0,i)}const pe=EH(Q,N,t.modifiersStyles),We=fH(Q,l,t.modifiersClassNames),nt=!we&&!Q.hidden?ae(X,Q,i.options,i):void 0;return G.createElement(n.Day,{key:`${i.format(X,"yyyy-MM-dd")}_${i.format(Pe.displayMonth,"yyyy-MM")}`,day:Pe,modifiers:Q,className:We.join(" "),style:pe,role:"gridcell","aria-selected":Q.selected||void 0,"aria-label":nt,"data-day":i.format(X,"yyyy-MM-dd"),"data-month":Pe.outside?i.format(X,"yyyy-MM"):void 0,"data-selected":Q.selected||void 0,"data-disabled":Q.disabled||void 0,"data-hidden":Q.hidden||void 0,"data-outside":Pe.outside||void 0,"data-focused":Q.focused||void 0,"data-today":Q.today||void 0},!Q.hidden&&we?G.createElement(n.DayButton,{className:l[De.DayButton],style:N==null?void 0:N[De.DayButton],type:"button",day:Pe,modifiers:Q,disabled:Q.disabled||void 0,tabIndex:ne(Pe)?0:-1,"aria-label":xe(X,Q,i.options,i),onClick:yt(Pe,Q),onBlur:Lt(Pe,Q),onFocus:wt(Pe,Q),onKeyDown:K(Pe,Q),onMouseEnter:V(Pe,Q),onMouseLeave:te(Pe,Q)},C(X,i.options,i)):!Q.hidden&&C(Pe.date,i.options,i))})))))))),t.footer&&G.createElement(n.Footer,{className:l[De.Footer],style:N==null?void 0:N[De.Footer],role:"status","aria-live":"polite"},t.footer)))}function Qn({className:e,classNames:t,showOutsideDays:n=!0,captionLayout:s="label",buttonVariant:r="ghost",formatters:i,components:o,...l}){const c=S0();return a.jsx(dB,{showOutsideDays:n,className:$e("bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:s,formatters:{formatMonthDropdown:u=>u.toLocaleString("default",{month:"short"}),...i},classNames:{root:$e("w-fit",c.root),months:$e("relative flex flex-col gap-4 md:flex-row",c.months),month:$e("flex w-full flex-col gap-4",c.month),nav:$e("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",c.nav),button_previous:$e(Mg({variant:r}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_previous),button_next:$e(Mg({variant:r}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_next),month_caption:$e("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",c.month_caption),dropdowns:$e("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",c.dropdowns),dropdown_root:$e("has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",c.dropdown_root),dropdown:$e("bg-popover absolute inset-0 opacity-0",c.dropdown),caption_label:$e("select-none font-medium",s==="label"?"text-sm":"[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",c.caption_label),table:"w-full border-collapse",weekdays:$e("flex",c.weekdays),weekday:$e("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",c.weekday),week:$e("mt-2 flex w-full",c.week),week_number_header:$e("w-[--cell-size] select-none",c.week_number_header),week_number:$e("text-muted-foreground select-none text-[0.8rem]",c.week_number),day:$e("group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",c.day),range_start:$e("bg-accent rounded-l-md",c.range_start),range_middle:$e("rounded-none",c.range_middle),range_end:$e("bg-accent rounded-r-md",c.range_end),today:$e("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",c.today),outside:$e("text-muted-foreground aria-selected:text-muted-foreground",c.outside),disabled:$e("text-muted-foreground opacity-50",c.disabled),hidden:$e("invisible",c.hidden),...t},components:{Root:({className:u,rootRef:h,...d})=>a.jsx("div",{"data-slot":"calendar",ref:h,className:$e(u),...d}),Chevron:({className:u,orientation:h,...d})=>h==="left"?a.jsx(TS,{className:$e("size-4",u),...d}):h==="right"?a.jsx(Jp,{className:$e("size-4",u),...d}):a.jsx(of,{className:$e("size-4",u),...d}),DayButton:uB,WeekNumber:({children:u,...h})=>a.jsx("td",{...h,children:a.jsx("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:u})}),...o},...l})}function uB({className:e,day:t,modifiers:n,...s}){const r=S0(),i=m.useRef(null);return m.useEffect(()=>{var o;n.focused&&((o=i.current)==null||o.focus())},[n.focused]),a.jsx(F,{ref:i,variant:"ghost",size:"icon","data-day":t.date.toLocaleDateString(),"data-selected-single":n.selected&&!n.range_start&&!n.range_end&&!n.range_middle,"data-range-start":n.range_start,"data-range-end":n.range_end,"data-range-middle":n.range_middle,className:$e("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[--cell-size] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70",r.day,e),...s})}var Sf="Popover",[OC]=lf(Sf,[mf]),nd=mf(),[hB,Cr]=OC(Sf),zC=e=>{const{__scopePopover:t,children:n,open:s,defaultOpen:r,onOpenChange:i,modal:o=!1}=e,l=nd(t),c=m.useRef(null),[u,h]=m.useState(!1),[d,f]=m0({prop:s,defaultProp:r??!1,onChange:i,caller:Sf});return a.jsx(c4,{...l,children:a.jsx(hB,{scope:t,contentId:ps(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(x=>!x),[f]),hasCustomAnchor:u,onCustomAnchorAdd:m.useCallback(()=>h(!0),[]),onCustomAnchorRemove:m.useCallback(()=>h(!1),[]),modal:o,children:n})})};zC.displayName=Sf;var RC="PopoverAnchor",fB=m.forwardRef((e,t)=>{const{__scopePopover:n,...s}=e,r=Cr(RC,n),i=nd(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:l}=r;return m.useEffect(()=>(o(),()=>l()),[o,l]),a.jsx(h0,{...i,...s,ref:t})});fB.displayName=RC;var UC="PopoverTrigger",$C=m.forwardRef((e,t)=>{const{__scopePopover:n,...s}=e,r=Cr(UC,n),i=nd(n),o=Fn(t,r.triggerRef),l=a.jsx(ln.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":VC(r.open),...s,ref:o,onClick:Vt(e.onClick,r.onOpenToggle)});return r.hasCustomAnchor?l:a.jsx(h0,{asChild:!0,...i,children:l})});$C.displayName=UC;var C0="PopoverPortal",[mB,xB]=OC(C0,{forceMount:void 0}),PC=e=>{const{__scopePopover:t,forceMount:n,children:s,container:r}=e,i=Cr(C0,t);return a.jsx(mB,{scope:t,forceMount:n,children:a.jsx(bi,{present:n||i.open,children:a.jsx(f0,{asChild:!0,container:r,children:s})})})};PC.displayName=C0;var Po="PopoverContent",LC=m.forwardRef((e,t)=>{const n=xB(Po,e.__scopePopover),{forceMount:s=n.forceMount,...r}=e,i=Cr(Po,e.__scopePopover);return a.jsx(bi,{present:s||i.open,children:i.modal?a.jsx(pB,{...r,ref:t}):a.jsx(vB,{...r,ref:t})})});LC.displayName=Po;var gB=s0("PopoverContent.RemoveScroll"),pB=m.forwardRef((e,t)=>{const n=Cr(Po,e.__scopePopover),s=m.useRef(null),r=Fn(t,s),i=m.useRef(!1);return m.useEffect(()=>{const o=s.current;if(o)return z4(o)},[]),a.jsx(p0,{as:gB,allowPinchZoom:!0,children:a.jsx(HC,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Vt(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),i.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Vt(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;i.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:Vt(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),vB=m.forwardRef((e,t)=>{const n=Cr(Po,e.__scopePopover),s=m.useRef(!1),r=m.useRef(!1);return a.jsx(HC,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(s.current||(l=n.triggerRef.current)==null||l.focus(),i.preventDefault()),s.current=!1,r.current=!1},onInteractOutside:i=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(s.current=!0,i.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const o=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&r.current&&i.preventDefault()}})}),HC=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:s,onOpenAutoFocus:r,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:h,...d}=e,f=Cr(Po,n),x=nd(n);return C4(),a.jsx(g0,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:r,onUnmountAutoFocus:i,children:a.jsx(cf,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:h,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:a.jsx(d4,{"data-state":VC(f.open),role:"dialog",id:f.contentId,...x,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),BC="PopoverClose",bB=m.forwardRef((e,t)=>{const{__scopePopover:n,...s}=e,r=Cr(BC,n);return a.jsx(ln.button,{type:"button",...s,ref:t,onClick:Vt(e.onClick,()=>r.onOpenChange(!1))})});bB.displayName=BC;var yB="PopoverArrow",wB=m.forwardRef((e,t)=>{const{__scopePopover:n,...s}=e,r=nd(n);return a.jsx(u4,{...r,...s,ref:t})});wB.displayName=yB;function VC(e){return e?"open":"closed"}var jB=zC,NB=$C,SB=PC,YC=LC;const Kn=jB,Jn=NB,Dn=m.forwardRef(({className:e,align:t="start",sideOffset:n=4,...s},r)=>a.jsx(SB,{children:a.jsx(YC,{ref:r,align:t,sideOffset:n,className:$e("z-50 w-auto p-0 rounded-lg border border-white/20 bg-black text-white shadow-lg outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...s})}));Dn.displayName=YC.displayName;const gw=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M20 3H2v14h8v2H8v2h8v-2h-2v-2h8V3h-2zm-6 12H4V5h16v10h-6z",fill:"currentColor"})}),qd=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M7 8H5v2h2v2h2v2h2v2h2v-2h2v-2h2v-2h2V8h-2v2h-2v2h-2v2h-2v-2H9v-2H7V8z",fill:"currentColor"})}),CB=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})}),ls=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M15 2h2v2h4v18H3V4h4V2h2v2h6V2zM9 6H5v2h14V6H9zm-4 4v10h14V10H5zm2 2h8v2H7v-2zm4 6v-2H7v2h4z",fill:"currentColor"})}),EB=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M2 2h14v4h6v16H2V2zm18 6h-4v2h2v2h-2v2h2v2h-2v2h2v2h2V8zm-6-4H4v16h2v-2h6v2h2V4zM6 6h2v2H6V6zm6 0h-2v2h2V6zm-6 4h2v2H6v-2zm6 0h-2v2h2v-2zm-6 4h2v2H6v-2zm6 0h-2v2h2v-2z",fill:"currentColor"})}),kB=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M20 11v2H8v2H6v-2H4v-2h2V9h2v2h12zM10 7H8v2h2V7zm0 0h2V5h-2v2zm0 10H8v-2h2v2zm0 0h2v2h-2v-2z",fill:"currentColor"})}),Fa=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M4 11v2h12v2h2v-2h2v-2h-2V9h-2v2H4zm10-4h2v2h-2V7zm0 0h-2V5h2v2zm0 10h2v-2h-2v2zm0 0h-2v2h2v-2z",fill:"currentColor"})}),MB=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M3 3h18v18H3V3zm16 2H5v14h14V5zM7 12h2v5H7v-5zm10-5h-2v10h2V7zm-6 3h2v2h-2v-2zm2 4h-2v3h2v-3z",fill:"currentColor"})}),sa=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M22 4H2v16h20V4zM4 18V6h16v12H4zM8 8H6v2h2v2h2v2h4v-2h2v-2h2V8h-2v2h-2v2h-4v-2H8V8z",fill:"currentColor"})}),FC=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M6 2h8v2H6V2zM4 6V4h2v2H4zm0 8H2V6h2v8zm2 2H4v-2h2v2zm8 0v2H6v-2h8zm2-2h-2v2h2v2h2v2h2v2h2v-2h-2v-2h-2v-2h-2v-2zm0-8h2v8h-2V6zm0 0V4h-2v2h2z",fill:"currentColor"})}),Xd=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M15 2H9v2H7v6h2V4h6V2zm0 8H9v2h6v-2zm0-6h2v6h-2V4zM4 16h2v-2h12v2H6v4h12v-4h2v6H4v-6z",fill:"currentColor"})}),ft=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M11 0H5v2H3v6h2v2h6V8H5V2h6V0zm0 2h2v6h-2V2zM0 14h2v4h12v2H0v-6zm2 0h12v-2H2v2zm14 0h-2v6h2v-6zM15 0h4v2h-4V0zm4 8h-4v2h4V8zm0-6h2v6h-2V2zm5 12h-2v4h-4v2h6v-6zm-6-2h4v2h-4v-2z",fill:"currentColor"})}),Jt=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M5 5h2v2H5V5zm4 4H7V7h2v2zm2 2H9V9h2v2zm2 0h-2v2H9v2H7v2H5v2h2v-2h2v-2h2v-2h2v2h2v2h2v2h2v-2h-2v-2h-2v-2h-2v-2zm2-2v2h-2V9h2zm2-2v2h-2V7h2zm0 0V5h2v2h-2z",fill:"currentColor"})}),IC=({className:e="",size:t=24})=>a.jsx(mg,{size:t,className:$e(e,"w-4 h-4")}),fa=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M2 4h20v4H2V4zm18 2v2H4V6h16zm0 6H2v4h18v-4zm-2 2v2H4v-2h14zM2 16h20v4H2v-4zm18 2v2H4v-2h16z",fill:"currentColor"})}),TB=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 2c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm0 4c2.21 0 4 1.79 4 4s-1.79 4-4 4-4-1.79-4-4 1.79-4 4-4zm0 6c1.38 0 2.5-1.12 2.5-2.5S13.38 11.5 12 11.5 9.5 12.62 9.5 14 10.62 16.5 12 16.5z",fill:"currentColor"})}),Gm=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M15 2H9v2H7v6h2V4h6V2zm0 8H9v2h6v-2zm0-6h2v6h-2V4zM4 16h2v-2h8v2H6v4h8v-4h2v6H4v-6zm10-4h-2v2h2v-2z",fill:"currentColor"})}),Zl=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M15 2H9v2H7v6h2V4h6V2zm0 8H9v2h6v-2zm0-6h2v6h-2V4zM4 16h2v-2h8v2H6v4h8v-4h2v6H4v-6zm12-6h-2v2h2v2h2v-2h-2v-2z",fill:"currentColor"})}),Zm=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8 0-1.57.46-3.03 1.24-4.26L16.26 18.76C15.03 19.54 13.57 20 12 20zm6.76-3.74L7.74 5.24C8.97 4.46 10.43 4 12 4c4.41 0 8 3.59 8 8 0 1.57-.46 3.03-1.24 4.26z",fill:"currentColor"})}),tr=e=>a.jsx(Vs,{...e,className:"w-4 h-4 animate-spin"}),DB=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M6 2h12v2H6V2zm0 2v16h12V4H6zm8 2H10v2h4V6zm-4 4h4v8h-4v-8z",fill:"currentColor"})}),_B=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M8 4h2v4h4V4h2v4h4v2h-4v4h4v2h-4v4h-2v-4H8v4H6v-4H2v-2h4V8H2V6h4V4zm2 6v4h4v-4h-4z",fill:"currentColor"})}),An=({className:e="",size:t=24})=>a.jsx(EB,{className:e,size:t}),pw=({className:e="",size:t=24})=>a.jsx(MB,{className:e,size:t}),yu=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M4 2h12v2H4v12H2V2h2zm4 4h12v16H8V6zm2 2v12h8V8h-8z",fill:"currentColor"})}),WC=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M12 2h2v2h-2V2zm-2 4H8v2H6v2h2v2h2v-2h2V8h-2V6zm6 0h-2v2h2V6zm2 0h2v2h-2V6zm-6 8h-2v-2h2v2zm-4 0H6v-2h2v2zm-4 0H2v-2h2v2zm8 4h-2v-2h2v2zm4 0h2v-2h-2v2zm-6 2h2v2h-2v-2zm4 0h2v2h-2v-2z",fill:"currentColor"})}),AB=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M12 2h2v2h-2V2zm-2 4h6v2h-2v6h-2V8H8V6zm-4 8h12v2H4v-2zm0 4h12v2H4v-2z",fill:"currentColor"})}),wu=({className:e="",size:t=24})=>a.jsx(fR,{className:$e(e,"w-4 h-4"),size:t}),vw=({className:e="",size:t=24})=>a.jsx(dR,{className:$e(e,"w-4 h-4"),size:t}),E0=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-1-5l6-6-1.41-1.41L11 12.17l-2.59-2.58L7 10.59l4 4z",fill:"currentColor"})}),bw=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M12 1h2v8h8v4h-2v-2h-8V5h-2V1zM8 7V5h2v2H8zM6 9V7h2v2H6zm-2 2V9h2v2H4zm10 8v2h-2v2h-2v-8H2v-4h2v2h8v6h2zm2-2v2h-2v-2h2zm2-2v2h-2v-2h2zm0 0h2v-2h-2v2z",fill:"currentColor"})}),hr=(e,t,n)=>{const s=document.createElement(e),[r,i]=Array.isArray(t)?[void 0,t]:[t,n];return r&&Object.assign(s,r),i==null||i.forEach(o=>s.appendChild(o)),s},OB=(e,t)=>{var n;return t==="left"?e.offsetLeft:(((n=e.offsetParent instanceof HTMLElement?e.offsetParent:null)==null?void 0:n.offsetWidth)??0)-e.offsetWidth-e.offsetLeft},zB=e=>e.offsetWidth>0&&e.offsetHeight>0,RB=(e,t)=>{!customElements.get(e)&&customElements.define(e,t)};function UB(e,t,{reverse:n=!1}={}){const s=e.length;for(let r=n?s-1:0;n?r>=0:r<s;n?r--:r++)t(e[r],r)}function $B(e,t,n,s){const r=t.formatToParts(e);n&&r.unshift({type:"prefix",value:n}),s&&r.push({type:"suffix",value:s});const i=[],o=[],l=[],c=[],u={},h=v=>`${v}:${u[v]=(u[v]??-1)+1}`;let d="",f=!1,x=!1;for(const v of r){d+=v.value;const j=v.type==="minusSign"||v.type==="plusSign"?"sign":v.type;j==="integer"?(f=!0,o.push(...v.value.split("").map(g=>({type:j,value:parseInt(g)})))):j==="group"?o.push({type:j,value:v.value}):j==="decimal"?(x=!0,l.push({type:j,value:v.value,key:h(j)})):j==="fraction"?l.push(...v.value.split("").map(g=>({type:j,value:parseInt(g),key:h(j),pos:-1-u[j]}))):(f||x?c:i).push({type:j,value:v.value,key:h(j)})}const y=[];for(let v=o.length-1;v>=0;v--){const j=o[v];y.unshift(j.type==="integer"?{...j,key:h(j.type),pos:u[j.type]}:{...j,key:h(j.type)})}return{pre:i,integer:y,fraction:l,post:c,valueAsString:d,value:typeof e=="string"?parseFloat(e):e}}const PB=String.raw,LB=(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0})(),HB=typeof CSS<"u"&&CSS.supports&&CSS.supports("line-height","mod(1,1)"),yw=typeof matchMedia<"u"?matchMedia("(prefers-reduced-motion: reduce)"):null,jh="--_number-flow-d-opacity",k0="--_number-flow-d-width",Nh="--_number-flow-dx",M0="--_number-flow-d",BB=(()=>{try{return CSS.registerProperty({name:jh,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:Nh,syntax:"<length>",inherits:!0,initialValue:"0px"}),CSS.registerProperty({name:k0,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:M0,syntax:"<number>",inherits:!0,initialValue:"0"}),!0}catch{return!1}})(),VB="var(--number-flow-char-height, 1em)",Ba="var(--number-flow-mask-height, 0.25em)",ww=`calc(${Ba} / 2)`,Dg="var(--number-flow-mask-width, 0.5em)",Dr=`calc(${Dg} / var(--scale-x))`,Gd="#000 0, transparent 71%",jw=PB`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:${VB} !important}.number,.number__inner{display:inline-block;transform-origin:left top}:host([data-will-change]) :is(.number,.number__inner,.section,.digit,.digit__num,.symbol){will-change:transform}.number{--scale-x:calc(1 + var(${k0}) / var(--width));transform:translateX(var(${Nh})) scaleX(var(--scale-x));margin:0 calc(-1 * ${Dg});position:relative;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 ${Dr},#000 calc(100% - ${Dr}),transparent ),linear-gradient(to bottom,transparent 0,#000 ${Ba},#000 calc(100% - ${Ba}),transparent 100% ),radial-gradient(at bottom right,${Gd}),radial-gradient(at bottom left,${Gd}),radial-gradient(at top left,${Gd}),radial-gradient(at top right,${Gd});-webkit-mask-size:100% calc(100% - ${Ba} * 2),calc(100% - ${Dr} * 2) 100%,${Dr} ${Ba},${Dr} ${Ba},${Dr} ${Ba},${Dr} ${Ba};-webkit-mask-position:center,center,top left,top right,bottom right,bottom left;-webkit-mask-repeat:no-repeat}.number__inner{padding:${ww} ${Dg};transform:scaleX(calc(1 / var(--scale-x))) translateX(calc(-1 * var(${Nh})))}:host > :not(.number){z-index:5}.section,.symbol{display:inline-block;position:relative;isolation:isolate}.section::after{content:'\200b';display:inline-block}.section--justify-left{transform-origin:center left}.section--justify-right{transform-origin:center right}.section > [inert],.symbol > [inert]{margin:0 !important;position:absolute !important;z-index:-1}.digit{display:inline-block;position:relative;--c:var(--current) + var(${M0})}.digit__num,.number .section::after{padding:${ww} 0}.digit__num{display:inline-block;--offset-raw:mod(var(--length) + var(--n) - mod(var(--c),var(--length)),var(--length));--offset:calc( var(--offset-raw) - var(--length) * round(down,var(--offset-raw) / (var(--length) / 2),1) );--y:clamp(-100%,var(--offset) * 100%,100%);transform:translateY(var(--y))}.digit__num[inert]{position:absolute;top:0;left:50%;transform:translateX(-50%) translateY(var(--y))}.digit:not(.is-spinning) .digit__num[inert]{display:none}.symbol__value{display:inline-block;mix-blend-mode:plus-lighter;white-space:pre}.section--justify-left .symbol > [inert]{left:0}.section--justify-right .symbol > [inert]{right:0}.animate-presence{opacity:calc(1 + var(${jh}))}`,YB=HTMLElement,FB=HB&&LB&&BB;let Zd;class qC extends YB{constructor(){super(),this.created=!1,this.batched=!1;const{animated:t,...n}=this.constructor.defaultProps;this._animated=this.computedAnimated=t,Object.assign(this,n)}get animated(){return this._animated}set animated(t){var n;this.animated!==t&&(this._animated=t,(n=this.shadowRoot)==null||n.getAnimations().forEach(s=>s.finish()))}set data(t){var n;if(t==null)return;const{pre:s,integer:r,fraction:i,post:o,value:l}=t;if(this.created){const c=this._data;this._data=t,this.computedTrend=typeof this.trend=="function"?this.trend(c.value,l):this.trend,this.computedAnimated=FB&&this._animated&&(!this.respectMotionPreference||!(yw!=null&&yw.matches))&&zB(this),(n=this.plugins)==null||n.forEach(u=>{var h;return(h=u.onUpdate)==null?void 0:h.call(u,t,c,this)}),this.batched||this.willUpdate(),this._pre.update(s),this._num.update({integer:r,fraction:i}),this._post.update(o),this.batched||this.didUpdate()}else{this._data=t,this.attachShadow({mode:"open"});try{this._internals??(this._internals=this.attachInternals()),this._internals.role="img"}catch{}if(typeof CSSStyleSheet<"u"&&this.shadowRoot.adoptedStyleSheets)Zd||(Zd=new CSSStyleSheet,Zd.replaceSync(jw)),this.shadowRoot.adoptedStyleSheets=[Zd];else{const c=document.createElement("style");c.textContent=jw,this.shadowRoot.appendChild(c)}this._pre=new Sw(this,s,{justify:"right",part:"left"}),this.shadowRoot.appendChild(this._pre.el),this._num=new IB(this,r,i),this.shadowRoot.appendChild(this._num.el),this._post=new Sw(this,o,{justify:"left",part:"right"}),this.shadowRoot.appendChild(this._post.el),this.created=!0}try{this._internals.ariaLabel=t.valueAsString}catch{}}willUpdate(){this._pre.willUpdate(),this._num.willUpdate(),this._post.willUpdate()}didUpdate(){if(!this.computedAnimated)return;this._abortAnimationsFinish?this._abortAnimationsFinish.abort():this.dispatchEvent(new Event("animationsstart")),this._pre.didUpdate(),this._num.didUpdate(),this._post.didUpdate();const t=new AbortController;Promise.all(this.shadowRoot.getAnimations().map(n=>n.finished)).then(()=>{t.signal.aborted||(this.dispatchEvent(new Event("animationsfinish")),this._abortAnimationsFinish=void 0)}),this._abortAnimationsFinish=t}}qC.defaultProps={transformTiming:{duration:900,easing:"linear(0,.005,.019,.039,.066,.096,.129,.165,.202,.24,.278,.316,.354,.39,.426,.461,.494,.526,.557,.586,.614,.64,.665,.689,.711,.731,.751,.769,.786,.802,.817,.831,.844,.856,.867,.877,.887,.896,.904,.912,.919,.925,.931,.937,.942,.947,.951,.955,.959,.962,.965,.968,.971,.973,.976,.978,.98,.981,.983,.984,.986,.987,.988,.989,.99,.991,.992,.992,.993,.994,.994,.995,.995,.996,.996,.9963,.9967,.9969,.9972,.9975,.9977,.9979,.9981,.9982,.9984,.9985,.9987,.9988,.9989,1)"},spinTiming:void 0,opacityTiming:{duration:450,easing:"ease-out"},animated:!0,trend:(e,t)=>Math.sign(t-e),respectMotionPreference:!0,plugins:void 0,digits:void 0};class IB{constructor(t,n,s,{className:r,...i}={}){this.flow=t,this._integer=new Nw(t,n,{justify:"right",part:"integer"}),this._fraction=new Nw(t,s,{justify:"left",part:"fraction"}),this._inner=hr("span",{className:"number__inner"},[this._integer.el,this._fraction.el]),this.el=hr("span",{...i,part:"number",className:`number ${r??""}`},[this._inner])}willUpdate(){this._prevWidth=this.el.offsetWidth,this._prevLeft=this.el.getBoundingClientRect().left,this._integer.willUpdate(),this._fraction.willUpdate()}update({integer:t,fraction:n}){this._integer.update(t),this._fraction.update(n)}didUpdate(){const t=this.el.getBoundingClientRect();this._integer.didUpdate(),this._fraction.didUpdate();const n=this._prevLeft-t.left,s=this.el.offsetWidth,r=this._prevWidth-s;this.el.style.setProperty("--width",String(s)),this.el.animate({[Nh]:[`${n}px`,"0px"],[k0]:[r,0]},{...this.flow.transformTiming,composite:"accumulate"})}}class XC{constructor(t,n,{justify:s,className:r,...i},o){this.flow=t,this.children=new Map,this.onCharRemove=c=>()=>{this.children.delete(c)},this.justify=s;const l=n.map(c=>this.addChar(c).el);this.el=hr("span",{...i,className:`section section--justify-${s} ${r??""}`},o?o(l):l)}addChar(t,{startDigitsAtZero:n=!1,...s}={}){const r=t.type==="integer"||t.type==="fraction"?new ZC(this,t.type,n?0:t.value,t.pos,{...s,onRemove:this.onCharRemove(t.key)}):new WB(this,t.type,t.value,{...s,onRemove:this.onCharRemove(t.key)});return this.children.set(t.key,r),r}unpop(t){t.el.removeAttribute("inert"),t.el.style.top="",t.el.style[this.justify]=""}pop(t){t.forEach(n=>{n.el.style.top=`${n.el.offsetTop}px`,n.el.style[this.justify]=`${OB(n.el,this.justify)}px`}),t.forEach(n=>{n.el.setAttribute("inert",""),n.present=!1})}addNewAndUpdateExisting(t){const n=new Map,s=new Map,r=this.justify==="left",i=r?"prepend":"append";if(UB(t,o=>{let l;this.children.has(o.key)?(l=this.children.get(o.key),s.set(o,l),this.unpop(l),l.present=!0):(l=this.addChar(o,{startDigitsAtZero:!0,animateIn:!0}),n.set(o,l)),this.el[i](l.el)},{reverse:r}),this.flow.computedAnimated){const o=this.el.getBoundingClientRect();n.forEach(l=>{l.willUpdate(o)})}n.forEach((o,l)=>{o.update(l.value)}),s.forEach((o,l)=>{o.update(l.value)})}willUpdate(){const t=this.el.getBoundingClientRect();this._prevOffset=t[this.justify],this.children.forEach(n=>n.willUpdate(t))}didUpdate(){const t=this.el.getBoundingClientRect();this.children.forEach(r=>r.didUpdate(t));const n=t[this.justify],s=this._prevOffset-n;s&&this.children.size&&this.el.animate({transform:[`translateX(${s}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}class Nw extends XC{update(t){const n=new Map;this.children.forEach((s,r)=>{t.find(i=>i.key===r)||n.set(r,s),this.unpop(s)}),this.addNewAndUpdateExisting(t),n.forEach(s=>{s instanceof ZC&&s.update(0)}),this.pop(n)}}class Sw extends XC{update(t){const n=new Map;this.children.forEach((s,r)=>{t.find(i=>i.key===r)||n.set(r,s)}),this.pop(n),this.addNewAndUpdateExisting(t)}}class _g{constructor(t,n,{onRemove:s,animateIn:r=!1}={}){this.flow=t,this.el=n,this._present=!0,this._remove=()=>{var i;this.el.remove(),(i=this._onRemove)==null||i.call(this)},this.el.classList.add("animate-presence"),this.flow.computedAnimated&&r&&this.el.animate({[jh]:[-.9999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),this._onRemove=s}get present(){return this._present}set present(t){if(this._present!==t){if(this._present=t,t?this.el.removeAttribute("inert"):this.el.setAttribute("inert",""),!this.flow.computedAnimated){t||this._remove();return}this.el.style.setProperty("--_number-flow-d-opacity",t?"0":"-.999"),this.el.animate({[jh]:t?[-.9999,0]:[.999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),t?this.flow.removeEventListener("animationsfinish",this._remove):this.flow.addEventListener("animationsfinish",this._remove,{once:!0})}}}class GC extends _g{constructor(t,n,s,r){super(t.flow,s,r),this.section=t,this.value=n,this.el=s}}class ZC extends GC{constructor(t,n,s,r,i){var o,l;const c=(((l=(o=t.flow.digits)==null?void 0:o[r])==null?void 0:l.max)??9)+1,u=Array.from({length:c}).map((d,f)=>{const x=hr("span",{className:"digit__num"},[document.createTextNode(String(f))]);return f!==s&&x.setAttribute("inert",""),x.style.setProperty("--n",String(f)),x}),h=hr("span",{part:`digit ${n}-digit`,className:"digit"},u);h.style.setProperty("--current",String(s)),h.style.setProperty("--length",String(c)),super(t,s,h,i),this.pos=r,this._onAnimationsFinish=()=>{this.el.classList.remove("is-spinning")},this._numbers=u,this.length=c}willUpdate(t){const n=this.el.getBoundingClientRect();this._prevValue=this.value;const s=n[this.section.justify]-t[this.section.justify],r=n.width/2;this._prevCenter=this.section.justify==="left"?s+r:s-r}update(t){this.el.style.setProperty("--current",String(t)),this._numbers.forEach((n,s)=>s===t?n.removeAttribute("inert"):n.setAttribute("inert","")),this.value=t}didUpdate(t){const n=this.el.getBoundingClientRect(),s=n[this.section.justify]-t[this.section.justify],r=n.width/2,i=this.section.justify==="left"?s+r:s-r,o=this._prevCenter-i;o&&this.el.animate({transform:[`translateX(${o}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"});const l=this.getDelta();l&&(this.el.classList.add("is-spinning"),this.el.animate({[M0]:[-l,0]},{...this.flow.spinTiming??this.flow.transformTiming,composite:"accumulate"}),this.flow.addEventListener("animationsfinish",this._onAnimationsFinish,{once:!0}))}getDelta(){var t;if(this.flow.plugins)for(const r of this.flow.plugins){const i=(t=r.getDelta)==null?void 0:t.call(r,this.value,this._prevValue,this);if(i!=null)return i}const n=this.value-this._prevValue,s=this.flow.computedTrend||Math.sign(n);return s<0&&this.value>this._prevValue?this.value-this.length-this._prevValue:s>0&&this.value<this._prevValue?this.length-this._prevValue+this.value:n}}class WB extends GC{constructor(t,n,s,r){const i=hr("span",{className:"symbol__value",textContent:s});super(t,s,hr("span",{part:`symbol ${n}`,className:"symbol"},[i]),r),this.type=n,this._children=new Map,this._onChildRemove=o=>()=>{this._children.delete(o)},this._children.set(s,new _g(this.flow,i,{onRemove:this._onChildRemove(s)}))}willUpdate(t){if(this.type==="decimal")return;const n=this.el.getBoundingClientRect();this._prevOffset=n[this.section.justify]-t[this.section.justify]}update(t){if(this.value!==t){const n=this._children.get(this.value);n&&(n.present=!1);const s=this._children.get(t);if(s)s.present=!0;else{const r=hr("span",{className:"symbol__value",textContent:t});this.el.appendChild(r),this._children.set(t,new _g(this.flow,r,{animateIn:!0,onRemove:this._onChildRemove(t)}))}}this.value=t}didUpdate(t){if(this.type==="decimal")return;const n=this.el.getBoundingClientRect()[this.section.justify]-t[this.section.justify],s=this._prevOffset-n;s&&this.el.animate({transform:[`translateX(${s}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}var Tw;const qB=parseInt((Tw=m.version.match(/^(\d+)\./))==null?void 0:Tw[1]),T0=qB>=19,XB=["data","digits"];class D0 extends qC{attributeChangedCallback(t,n,s){this[t]=JSON.parse(s)}}D0.observedAttributes=T0?[]:XB;RB("number-flow-react",D0);const Qm={},Cw=T0?e=>e:JSON.stringify;function Ew(e){const{transformTiming:t,spinTiming:n,opacityTiming:s,animated:r,respectMotionPreference:i,trend:o,plugins:l,...c}=e;return[{transformTiming:t,spinTiming:n,opacityTiming:s,animated:r,respectMotionPreference:i,trend:o,plugins:l},c]}class GB extends m.Component{updateProperties(t){if(!this.el)return;this.el.batched=!this.props.isolate;const[n]=Ew(this.props);Object.entries(n).forEach(([s,r])=>{this.el[s]=r??D0.defaultProps[s]}),t!=null&&t.onAnimationsStart&&this.el.removeEventListener("animationsstart",t.onAnimationsStart),this.props.onAnimationsStart&&this.el.addEventListener("animationsstart",this.props.onAnimationsStart),t!=null&&t.onAnimationsFinish&&this.el.removeEventListener("animationsfinish",t.onAnimationsFinish),this.props.onAnimationsFinish&&this.el.addEventListener("animationsfinish",this.props.onAnimationsFinish)}componentDidMount(){this.updateProperties(),T0&&this.el&&(this.el.digits=this.props.digits,this.el.data=this.props.data)}getSnapshotBeforeUpdate(t){var n;if(this.updateProperties(t),t.data!==this.props.data){if(this.props.group)return this.props.group.willUpdate(),()=>{var s;return(s=this.props.group)==null?void 0:s.didUpdate()};if(!this.props.isolate)return(n=this.el)==null||n.willUpdate(),()=>{var s;return(s=this.el)==null?void 0:s.didUpdate()}}return null}componentDidUpdate(t,n,s){s==null||s()}handleRef(t){this.props.innerRef&&(this.props.innerRef.current=t),this.el=t}render(){const[t,{innerRef:n,className:s,data:r,willChange:i,isolate:o,group:l,digits:c,onAnimationsStart:u,onAnimationsFinish:h,...d}]=Ew(this.props);return m.createElement("number-flow-react",{ref:this.handleRef,"data-will-change":i?"":void 0,class:s,...d,dangerouslySetInnerHTML:{__html:""},suppressHydrationWarning:!0,digits:Cw(c),data:Cw(r)})}constructor(t){super(t),this.handleRef=this.handleRef.bind(this)}}const ZB=m.forwardRef(function({value:t,locales:n,format:s,prefix:r,suffix:i,...o},l){m.useImperativeHandle(l,()=>c.current,[]);const c=m.useRef(),u=m.useContext(QB);u==null||u.useRegister(c);const h=m.useMemo(()=>n?JSON.stringify(n):"",[n]),d=m.useMemo(()=>s?JSON.stringify(s):"",[s]),f=m.useMemo(()=>{var y;const x=Qm[y=`${h}:${d}`]??(Qm[y]=new Intl.NumberFormat(n,s));return $B(t,x,r,i)},[t,h,d,r,i]);return m.createElement(GB,{...o,group:u,data:f,innerRef:c})}),QB=m.createContext(void 0),KB={notation:"compact",maximumFractionDigits:1};function xs({value:e,loading:t=!1,className:n,prefix:s,suffix:r,format:i,trend:o,fallback:l="…"}){const c=m.useMemo(()=>{if(e==null)return 0;const d=Number(e);return Number.isFinite(d)?d:0},[e]);if(t)return a.jsxs("span",{className:hh("inline-flex items-baseline",n),children:[s,l,r]});const u=ZB,h=typeof o=="boolean"?o?1:0:o;return a.jsxs("span",{className:hh("inline-flex",n),children:[s,a.jsx(u,{value:c,format:i??KB,trend:h,className:"inline-flex"}),r]})}function Rn({id:e,label:t="ID",className:n="",variant:s="inline"}){const[r,i]=m.useState(!1),o=async()=>{try{await navigator.clipboard.writeText(e),i(!0),B.success("Copied to clipboard"),setTimeout(()=>i(!1),2e3)}catch{B.error("Failed to copy to clipboard")}};return s==="detail"?a.jsxs("div",{className:`flex justify-between items-center ${n}`,children:[a.jsxs("span",{className:"text-gray-400",children:[t,":"]}),a.jsxs("button",{onClick:o,className:"flex items-center gap-2 text-white text-sm hover:text-white/80 transition-colors group",title:"Click to copy",children:[a.jsx("span",{className:"font-mono",children:e}),r?a.jsx(fg,{className:"w-3 h-3 text-green-500"}):a.jsx(by,{className:"w-3 h-3 text-gray-400 group-hover:text-white transition-colors"})]})]}):s==="subscript"?a.jsxs("sup",{onClick:o,className:`text-xs text-gray-500 ml-2 cursor-pointer hover:text-white transition-colors inline-flex items-center gap-1 ${n}`,title:"Click to copy User ID",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsxs("span",{className:"text-white/80 font-mono text-xs",children:[e.slice(0,8),"..."]}),a.jsx("span",{className:"ml-1",children:"]"})]}):a.jsxs("button",{onClick:o,className:`flex items-center gap-1.5 text-sm text-gray-400 hover:text-white transition-colors group ${n}`,title:"Click to copy",children:[a.jsxs("span",{children:[t,":"]}),a.jsx("span",{className:"font-mono",children:e}),r?a.jsx(fg,{className:"w-3 h-3 text-green-500"}):a.jsx(by,{className:"w-3 h-3 opacity-0 group-hover:opacity-100 transition-opacity"})]})}function fi({title:e="Seeding Terminal",lines:t,isRunning:n=!1,className:s="",defaultCollapsed:r=!1}){const[i,o]=m.useState(r),l=m.useRef(null);m.useEffect(()=>{const d=l.current;!d||i||d.scrollTo({top:d.scrollHeight,behavior:"smooth"})},[i]);const c=d=>{switch(d.type){case"success":return a.jsx(Ht,{className:"w-3 h-3 text-green-400"});case"error":return a.jsx($r,{className:"w-3 h-3 text-red-400"});case"progress":return d.status==="running"?a.jsx(Vs,{className:"w-3 h-3 text-blue-400 animate-spin"}):d.status==="completed"?a.jsx(Ht,{className:"w-3 h-3 text-green-400"}):d.status==="failed"?a.jsx($r,{className:"w-3 h-3 text-red-400"}):a.jsx("div",{className:"w-3 h-3 border border-gray-500 rounded-full"});default:return a.jsx("div",{className:"w-3 h-3 border border-gray-500 rounded-full"})}},u=d=>{switch(d.type){case"success":return"text-green-400";case"error":return"text-red-400";case"progress":return d.status==="running"?"text-blue-400":d.status==="completed"?"text-green-400":d.status==="failed"?"text-red-400":"text-gray-400";default:return"text-gray-300"}},h=d=>d.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})+"."+d.getMilliseconds().toString().padStart(3,"0");return a.jsxs("div",{className:`bg-black/90 border border-dashed border-white/20 rounded-none font-mono text-xs ${s}`,children:[a.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-dashed border-white/10",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(hR,{className:"w-3 h-3 text-green-400"}),a.jsx("span",{className:"text-green-400 font-medium text-xs",children:e})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[n&&a.jsxs("div",{className:"flex items-center space-x-1",children:[a.jsx("div",{className:"w-1.5 h-1.5 bg-green-400 rounded-full animate-pulse"}),a.jsx("span",{className:"text-green-400 text-xs",children:"RUNNING"})]}),a.jsxs("div",{className:"text-gray-400 text-xs",children:[t.length," / ",t.length]}),a.jsx("button",{onClick:()=>o(!i),className:"text-gray-400 hover:text-white transition-colors",children:i?a.jsx(of,{className:"w-3 h-3"}):a.jsx(nR,{className:"w-3 h-3"})})]})]}),!i&&a.jsxs("div",{ref:l,className:"p-3 space-y-0.5 h-56 overflow-y-auto",children:[t.length===0?a.jsxs("div",{className:"text-gray-500 italic text-xs",children:[a.jsx("span",{className:"text-green-400",children:"$"})," Waiting for operations..."]}):t.map(d=>a.jsxs("div",{className:`flex items-start space-x-3 py-1 ${u(d)} text-xs`,children:[a.jsx("span",{className:"text-gray-500 text-xs w-20 flex-shrink-0",children:h(d.timestamp)}),a.jsx("span",{className:"text-green-400 flex-shrink-0",children:"$"}),a.jsx("div",{className:"flex-shrink-0 mt-0.5",children:c(d)}),a.jsx("span",{className:"flex-1 min-w-0 break-words",children:d.message})]},d.id)),n&&a.jsxs("div",{className:"flex items-start space-x-3 py-1 text-green-400 text-xs",children:[a.jsx("span",{className:"text-gray-500 text-xs w-20 flex-shrink-0",children:h(new Date)}),a.jsx("span",{className:"text-green-400 flex-shrink-0",children:"$"}),a.jsx("div",{className:"w-3 h-3 flex-shrink-0 mt-0.5"}),a.jsx("span",{className:"flex-1 flex items-center",children:a.jsx("span",{className:"animate-pulse",children:"█"})})]})]}),!i&&a.jsx("div",{className:"px-3 py-1.5 border-t border-dashed border-white/10 bg-black/50",children:a.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-400",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("span",{children:["Status: ",n?"Active":"Idle"]}),a.jsxs("span",{children:["Lines: ",t.length]})]}),a.jsxs("div",{className:"flex items-center space-x-1",children:[a.jsx("div",{className:"w-1.5 h-1.5 bg-green-400 rounded-full"}),a.jsx("span",{children:"Better Auth Studio"})]})]})})]})}const QC=document.createElement("style");QC.textContent=`
433
438
  @keyframes fadeIn {
434
439
  from {
435
440
  opacity: 0;
@@ -444,9 +449,9 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
444
449
  .animate-fadeIn {
445
450
  animation: fadeIn 0.3s ease-out forwards;
446
451
  }
447
- `;document.head.appendChild(QC);const Fe=m.forwardRef(({className:e,type:t,...n},s)=>a.jsx("input",{type:t,className:`flex h-10 w-full border border-dashed border-white/20 bg-black/30 px-3 py-2 text-sm text-white placeholder:text-gray-400 focus:outline-none focus:ring-1 focus:ring-white focus:border-white/40 disabled:cursor-not-allowed disabled:opacity-50 rounded-none ${e}`,ref:s,...n}));Fe.displayName="Input";const Xe=m.forwardRef(({className:e,...t},n)=>a.jsx("label",{className:`text-sm font-light text-white ${e}`,ref:n,...t}));Xe.displayName="Label";function KC({currentPage:e,totalPages:t,onPageChange:n,totalItems:s,startIndex:r,endIndex:i}){const o=()=>{const u=[],h=[];for(let d=Math.max(2,e-2);d<=Math.min(t-1,e+2);d++)u.push(d);return e-2>2?h.push(1,"..."):h.push(1),h.push(...u),e+2<t-1?h.push("...",t):t>1&&h.push(t),h};if(t<=1)return null;const l=o();return a.jsxs("div",{className:"flex items-center justify-between mt-6",children:[a.jsxs("div",{className:"text-sm text-gray-400",children:["Showing ",r+1," to ",Math.min(i,s)," of ",s," items"]}),a.jsxs("div",{className:"flex items-center space-x-1",children:[a.jsxs(F,{variant:"outline",size:"sm",onClick:()=>n(e-1),disabled:e===1,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:[a.jsx(TS,{className:"w-4 h-4"}),"Previous"]}),l.map((c,u)=>{if(c==="...")return a.jsx(F,{variant:"outline",size:"sm",disabled:!0,className:"border border-dashed border-white/20 text-white rounded-none",children:a.jsx(oR,{className:"w-4 h-4"})},`dots-${u}`);const h=c,d=e===h;return a.jsx(F,{variant:d?"default":"outline",size:"sm",onClick:()=>n(h),className:d?"bg-white text-black rounded-none":"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:h},h)}),a.jsxs(F,{variant:"outline",size:"sm",onClick:()=>n(e+1),disabled:e===t,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:["Next",a.jsx(Jp,{className:"w-4 h-4"})]})]})]})}const sd=m.createContext({isOpen:!1,setIsOpen:()=>{}}),Zr=m.forwardRef(({className:e,value:t,onValueChange:n,children:s,...r},i)=>{const[o,l]=m.useState(!1);return a.jsx(sd.Provider,{value:{value:t,onValueChange:n,isOpen:o,setIsOpen:l},children:a.jsx("div",{ref:i,className:`relative ${e}`,...r,children:s})})});Zr.displayName="Select";const Qr=m.forwardRef(({className:e,children:t,...n},s)=>{const{isOpen:r,setIsOpen:i}=m.useContext(sd);return a.jsxs("button",{ref:s,type:"button",className:`flex h-10 w-full items-center justify-between border bg-black/30 px-3 py-2 text-sm text-white focus:outline-none focus:ring-1 focus:ring-white focus:border-white/40 disabled:cursor-not-allowed disabled:opacity-50 rounded-none ${e}`,onClick:()=>i(!r),...n,children:[t,a.jsx(of,{className:`h-4 w-4 text-gray-400 transition-transform ${r?"rotate-180":""}`})]})});Qr.displayName="SelectTrigger";const _0=m.forwardRef(({className:e,placeholder:t,...n},s)=>{const{value:r}=m.useContext(sd);return a.jsx("span",{ref:s,className:`text-sm text-white ${e}`,...n,children:r||t})});_0.displayName="SelectValue";const Kr=m.forwardRef(({className:e,children:t,...n},s)=>{const{isOpen:r}=m.useContext(sd);return r?a.jsx("div",{ref:s,className:`absolute top-full left-0 right-0 z-50 mt-1 border border-dashed border-white/20 bg-black/90 rounded-none shadow-lg ${e}`,...n,children:t}):null});Kr.displayName="SelectContent";const yn=m.forwardRef(({className:e,children:t,value:n,...s},r)=>{const{onValueChange:i,setIsOpen:o}=m.useContext(sd);return a.jsx("div",{ref:r,className:`px-3 py-2 text-sm text-white hover:bg-white/10 cursor-pointer ${e}`,onClick:()=>{i==null||i(n),o(!1)},...s,children:t})});yn.displayName="SelectItem";function JC(){const e=ws(),{counts:t,refetchCounts:n}=vf(),[s,r]=m.useState([]),[i,o]=m.useState(!0),[l,c]=m.useState(null),[u,h]=m.useState(""),[d,f]=m.useState("all"),[x,y]=m.useState([]),[v,j]=m.useState(1),[g]=m.useState(20),[b,p]=m.useState(!1),[w,N]=m.useState(!1),[S,C]=m.useState(!1),[T,O]=m.useState(!1),[H,U]=m.useState(!1),[z,Y]=m.useState(!1),[k,$]=m.useState(null),[M,A]=m.useState([]),[E,D]=m.useState(!1),[_,I]=m.useState({name:"",slug:""}),[R,P]=m.useState({name:"",slug:""});m.useEffect(()=>{se()},[]);const W=V=>V.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,""),q=V=>{const te=W(V);I({name:V,slug:te})},ee=V=>{I(te=>({...te,slug:W(V)}))},ne=V=>{const te=W(V);P({name:V,slug:te})},Z=V=>{P(te=>({...te,slug:W(V)}))},se=async()=>{try{const te=await(await fetch("/api/plugins")).json(),me=(te==null?void 0:te.plugins).find(L=>L.id==="organization");c({enabled:!!me,availablePlugins:(te==null?void 0:te.plugins).map(L=>L.id),configPath:te.configPath,organizationPlugin:(te==null?void 0:te.plugins).find(L=>L.id==="organization")}),me?await xe():o(!1)}catch(V){console.error("Failed to check plugin status:",V),c({enabled:!1,error:"Failed to check plugin status"}),o(!1)}},xe=async()=>{try{const te=await(await fetch("/api/organizations?limit=10000")).json();console.log({lenght:te.organizations.length}),r(te.organizations||[])}catch(V){console.error("Failed to fetch organizations:",V),B.error("Failed to fetch organizations")}finally{o(!1)}},ae=async V=>{A([]),D(!0),A([{id:"start",type:"info",message:`Starting organization seeding process for ${V} organizations...`,timestamp:new Date}]);try{const me=await(await fetch("/api/seed/organizations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:V})})).json();if(me.success){const L=me.results.map((ue,he)=>ue.success?{id:`org-${he}`,type:"progress",message:`Creating organization: ${ue.organization.name} (${ue.organization.slug})`,timestamp:new Date,status:"completed"}:{id:`org-${he}`,type:"error",message:`Failed to create organization ${he+1}: ${ue.error}`,timestamp:new Date});A(ue=>[...ue,...L]);const ie=me.results.filter(ue=>ue.success).length;A(ue=>[...ue,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${ie}/${V} organizations successfully`,timestamp:new Date}]),await xe(),await n()}else A(L=>[...L,{id:"error",type:"error",message:`❌ Seeding failed: ${me.error||"Unknown error"}`,timestamp:new Date}])}catch(te){A(me=>[...me,{id:"error",type:"error",message:`❌ Network error: ${te}`,timestamp:new Date}])}finally{D(!1)}},ce=V=>{$(V),U(!0)},de=V=>{$(V),P({name:V.name,slug:V.slug}),C(!0)},Se=V=>{$(V),O(!0)},Ee=async()=>{if(!_.name){B.error("Please fill in the organization name");return}const V=B.loading("Creating organization...");try{const me=await(await fetch("/api/organizations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:_.name,slug:_.slug})})).json();me.success?(await xe(),p(!1),I({name:"",slug:""}),B.success("Organization created successfully!",{id:V})):B.error(`Error creating organization: ${me.error||"Unknown error"}`,{id:V})}catch(te){console.error("Error creating organization:",te),B.error("Error creating organization",{id:V})}},Ae=async()=>{if(!k){B.error("No organization selected");return}if(!R.name){B.error("Please fill in the organization name");return}const V=B.loading("Updating organization...");try{const me=await(await fetch(`/api/organizations/${k.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:R.name,slug:R.slug})})).json();me.success?(await xe(),C(!1),$(null),P({name:"",slug:""}),B.success("Organization updated successfully!",{id:V})):B.error(`Error updating organization: ${me.error||"Unknown error"}`,{id:V})}catch(te){console.error("Error updating organization:",te),B.error("Error updating organization",{id:V})}},He=async()=>{if(!k){B.error("No organization selected");return}const V=B.loading("Deleting organization...");try{const me=await(await fetch(`/api/organizations/${k.id}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();me.success?(await xe(),await n(),O(!1),$(null),B.success("Organization deleted successfully!",{id:V})):B.error(`Error deleting organization: ${me.error||"Unknown error"}`,{id:V})}catch(te){console.error("Error deleting organization:",te),B.error("Error deleting organization",{id:V})}},J=()=>{if(s.length===0){B.error("No organizations to export");return}const V=["ID","Name","Slug","Created At","Updated At"],te=s.map(he=>[he.id,he.name||"",he.slug||"",new Date(he.createdAt).toLocaleString(),new Date(he.updatedAt).toLocaleString()]),me=[V.join(","),...te.map(he=>he.map(Be=>`"${Be}"`).join(","))].join(`
452
+ `;document.head.appendChild(QC);const Fe=m.forwardRef(({className:e,type:t,...n},s)=>a.jsx("input",{type:t,className:`flex h-10 w-full border border-dashed border-white/20 bg-black/30 px-3 py-2 text-sm text-white placeholder:text-gray-400 focus:outline-none focus:ring-1 focus:ring-white focus:border-white/40 disabled:cursor-not-allowed disabled:opacity-50 rounded-none ${e}`,ref:s,...n}));Fe.displayName="Input";const Xe=m.forwardRef(({className:e,...t},n)=>a.jsx("label",{className:`text-sm font-light text-white ${e}`,ref:n,...t}));Xe.displayName="Label";function KC({currentPage:e,totalPages:t,onPageChange:n,totalItems:s,startIndex:r,endIndex:i}){const o=()=>{const u=[],h=[];for(let d=Math.max(2,e-2);d<=Math.min(t-1,e+2);d++)u.push(d);return e-2>2?h.push(1,"..."):h.push(1),h.push(...u),e+2<t-1?h.push("...",t):t>1&&h.push(t),h};if(t<=1)return null;const l=o();return a.jsxs("div",{className:"flex items-center justify-between mt-6",children:[a.jsxs("div",{className:"text-sm text-gray-400",children:["Showing ",r+1," to ",Math.min(i,s)," of ",s," items"]}),a.jsxs("div",{className:"flex items-center space-x-1",children:[a.jsxs(F,{variant:"outline",size:"sm",onClick:()=>n(e-1),disabled:e===1,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:[a.jsx(TS,{className:"w-4 h-4"}),"Previous"]}),l.map((c,u)=>{if(c==="...")return a.jsx(F,{variant:"outline",size:"sm",disabled:!0,className:"border border-dashed border-white/20 text-white rounded-none",children:a.jsx(lR,{className:"w-4 h-4"})},`dots-${u}`);const h=c,d=e===h;return a.jsx(F,{variant:d?"default":"outline",size:"sm",onClick:()=>n(h),className:d?"bg-white text-black rounded-none":"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:h},h)}),a.jsxs(F,{variant:"outline",size:"sm",onClick:()=>n(e+1),disabled:e===t,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:["Next",a.jsx(Jp,{className:"w-4 h-4"})]})]})]})}const sd=m.createContext({isOpen:!1,setIsOpen:()=>{}}),Zr=m.forwardRef(({className:e,value:t,onValueChange:n,children:s,...r},i)=>{const[o,l]=m.useState(!1);return a.jsx(sd.Provider,{value:{value:t,onValueChange:n,isOpen:o,setIsOpen:l},children:a.jsx("div",{ref:i,className:`relative ${e}`,...r,children:s})})});Zr.displayName="Select";const Qr=m.forwardRef(({className:e,children:t,...n},s)=>{const{isOpen:r,setIsOpen:i}=m.useContext(sd);return a.jsxs("button",{ref:s,type:"button",className:`flex h-10 w-full items-center justify-between border bg-black/30 px-3 py-2 text-sm text-white focus:outline-none focus:ring-1 focus:ring-white focus:border-white/40 disabled:cursor-not-allowed disabled:opacity-50 rounded-none ${e}`,onClick:()=>i(!r),...n,children:[t,a.jsx(of,{className:`h-4 w-4 text-gray-400 transition-transform ${r?"rotate-180":""}`})]})});Qr.displayName="SelectTrigger";const _0=m.forwardRef(({className:e,placeholder:t,...n},s)=>{const{value:r}=m.useContext(sd);return a.jsx("span",{ref:s,className:`text-sm text-white ${e}`,...n,children:r||t})});_0.displayName="SelectValue";const Kr=m.forwardRef(({className:e,children:t,...n},s)=>{const{isOpen:r}=m.useContext(sd);return r?a.jsx("div",{ref:s,className:`absolute top-full left-0 right-0 z-50 mt-1 border border-dashed border-white/20 bg-black/90 rounded-none shadow-lg ${e}`,...n,children:t}):null});Kr.displayName="SelectContent";const yn=m.forwardRef(({className:e,children:t,value:n,...s},r)=>{const{onValueChange:i,setIsOpen:o}=m.useContext(sd);return a.jsx("div",{ref:r,className:`px-3 py-2 text-sm text-white hover:bg-white/10 cursor-pointer ${e}`,onClick:()=>{i==null||i(n),o(!1)},...s,children:t})});yn.displayName="SelectItem";function JC(){const e=ws(),{counts:t,refetchCounts:n}=vf(),[s,r]=m.useState([]),[i,o]=m.useState(!0),[l,c]=m.useState(null),[u,h]=m.useState(""),[d,f]=m.useState("all"),[x,y]=m.useState([]),[v,j]=m.useState(1),[g]=m.useState(20),[b,p]=m.useState(!1),[w,N]=m.useState(!1),[S,C]=m.useState(!1),[T,O]=m.useState(!1),[H,U]=m.useState(!1),[z,Y]=m.useState(!1),[k,$]=m.useState(null),[M,A]=m.useState([]),[E,D]=m.useState(!1),[_,I]=m.useState({name:"",slug:""}),[R,P]=m.useState({name:"",slug:""});m.useEffect(()=>{se()},[]);const W=V=>V.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,""),q=V=>{const te=W(V);I({name:V,slug:te})},ee=V=>{I(te=>({...te,slug:W(V)}))},ne=V=>{const te=W(V);P({name:V,slug:te})},Z=V=>{P(te=>({...te,slug:W(V)}))},se=async()=>{try{const te=await(await fetch("/api/plugins")).json(),me=(te==null?void 0:te.plugins).find(L=>L.id==="organization");c({enabled:!!me,availablePlugins:(te==null?void 0:te.plugins).map(L=>L.id),configPath:te.configPath,organizationPlugin:(te==null?void 0:te.plugins).find(L=>L.id==="organization")}),me?await xe():o(!1)}catch(V){console.error("Failed to check plugin status:",V),c({enabled:!1,error:"Failed to check plugin status"}),o(!1)}},xe=async()=>{try{const te=await(await fetch("/api/organizations?limit=10000")).json();console.log({lenght:te.organizations.length}),r(te.organizations||[])}catch(V){console.error("Failed to fetch organizations:",V),B.error("Failed to fetch organizations")}finally{o(!1)}},ae=async V=>{A([]),D(!0),A([{id:"start",type:"info",message:`Starting organization seeding process for ${V} organizations...`,timestamp:new Date}]);try{const me=await(await fetch("/api/seed/organizations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:V})})).json();if(me.success){const L=me.results.map((ue,he)=>ue.success?{id:`org-${he}`,type:"progress",message:`Creating organization: ${ue.organization.name} (${ue.organization.slug})`,timestamp:new Date,status:"completed"}:{id:`org-${he}`,type:"error",message:`Failed to create organization ${he+1}: ${ue.error}`,timestamp:new Date});A(ue=>[...ue,...L]);const ie=me.results.filter(ue=>ue.success).length;A(ue=>[...ue,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${ie}/${V} organizations successfully`,timestamp:new Date}]),await xe(),await n()}else A(L=>[...L,{id:"error",type:"error",message:`❌ Seeding failed: ${me.error||"Unknown error"}`,timestamp:new Date}])}catch(te){A(me=>[...me,{id:"error",type:"error",message:`❌ Network error: ${te}`,timestamp:new Date}])}finally{D(!1)}},ce=V=>{$(V),U(!0)},de=V=>{$(V),P({name:V.name,slug:V.slug}),C(!0)},Se=V=>{$(V),O(!0)},Ee=async()=>{if(!_.name){B.error("Please fill in the organization name");return}const V=B.loading("Creating organization...");try{const me=await(await fetch("/api/organizations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:_.name,slug:_.slug})})).json();me.success?(await xe(),p(!1),I({name:"",slug:""}),B.success("Organization created successfully!",{id:V})):B.error(`Error creating organization: ${me.error||"Unknown error"}`,{id:V})}catch(te){console.error("Error creating organization:",te),B.error("Error creating organization",{id:V})}},Ae=async()=>{if(!k){B.error("No organization selected");return}if(!R.name){B.error("Please fill in the organization name");return}const V=B.loading("Updating organization...");try{const me=await(await fetch(`/api/organizations/${k.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:R.name,slug:R.slug})})).json();me.success?(await xe(),C(!1),$(null),P({name:"",slug:""}),B.success("Organization updated successfully!",{id:V})):B.error(`Error updating organization: ${me.error||"Unknown error"}`,{id:V})}catch(te){console.error("Error updating organization:",te),B.error("Error updating organization",{id:V})}},He=async()=>{if(!k){B.error("No organization selected");return}const V=B.loading("Deleting organization...");try{const me=await(await fetch(`/api/organizations/${k.id}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();me.success?(await xe(),await n(),O(!1),$(null),B.success("Organization deleted successfully!",{id:V})):B.error(`Error deleting organization: ${me.error||"Unknown error"}`,{id:V})}catch(te){console.error("Error deleting organization:",te),B.error("Error deleting organization",{id:V})}},J=()=>{if(s.length===0){B.error("No organizations to export");return}const V=["ID","Name","Slug","Created At","Updated At"],te=s.map(he=>[he.id,he.name||"",he.slug||"",new Date(he.createdAt).toLocaleString(),new Date(he.updatedAt).toLocaleString()]),me=[V.join(","),...te.map(he=>he.map(Be=>`"${Be}"`).join(","))].join(`
448
453
  `),L=new Blob([me],{type:"text/csv;charset=utf-8;"}),ie=document.createElement("a"),ue=URL.createObjectURL(L);ie.setAttribute("href",ue),ie.setAttribute("download",`organizations-export-${new Date().toISOString().split("T")[0]}.csv`),ie.style.visibility="hidden",document.body.appendChild(ie),ie.click(),document.body.removeChild(ie),B.success(`Exported ${s.length} organizations to CSV`)},oe=V=>{x.some(te=>te.type===V)||y([...x,{type:V}])},be=V=>{y(x.filter(te=>te.type!==V))},Oe=()=>{y([])},we=(V,te)=>{y(me=>me.map(L=>L.type===V?{...L,dateRange:te}:L))},Ce=s.filter(V=>{const te=V.name.toLowerCase().includes(u.toLowerCase())||V.slug.toLowerCase().includes(u.toLowerCase());if(x.length===0)return te;const me=x.every(L=>{var ie,ue,he,Be;switch(L.type){case"createdAt":{if(!((ie=L.dateRange)!=null&&ie.from)&&!((ue=L.dateRange)!=null&&ue.to))return!0;const _e=new Date(V.createdAt);return!((he=L.dateRange)!=null&&he.from&&L.dateRange.from>_e||(Be=L.dateRange)!=null&&Be.to&&L.dateRange.to<_e)}default:return!0}});return te&&me}),st=Math.ceil(Ce.length/g),yt=(v-1)*g,wt=yt+g,Lt=Ce.slice(yt,wt),K=V=>{j(V)};return i?a.jsx("div",{className:"flex min-h-screen items-center justify-center h-full",children:a.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[a.jsx(Vs,{className:"w-6 h-6 text-white animate-spin"}),a.jsx("div",{className:"text-white text-sm",children:"Loading organizations..."})]})}):l&&!l.enabled?a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl text-white font-light",children:"Organizations"}),a.jsx("p",{className:"text-gray-400 font-light text-sm mt-1 uppercase font-mono",children:"Manage your application organizations"})]})}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-8",children:a.jsxs("div",{className:"flex items-start space-x-4",children:[a.jsx("div",{className:"flex-shrink-0",children:a.jsx(_s,{className:"w-12 h-12 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"Organization Plugin Required"}),a.jsx("p",{className:"text-gray-300 mb-6",children:"To use Organizations in Better Auth Studio, you need to enable the organization plugin in your Better Auth configuration."}),a.jsxs("div",{className:"bg-black/50 border border-dashed border-white/20 rounded-none p-4 mb-6",children:[a.jsx("h4",{className:"text-white font-light mb-3",children:"Follow these steps:"}),a.jsx("ol",{className:"text-gray-300 space-y-2 text-sm list-decimal list-inside",children:a.jsxs("li",{children:["Import the plugin in your auth configuration file",l.configPath&&a.jsxs("span",{className:"text-gray-400",children:[" (",l.configPath,")"]}),":"]})}),a.jsx("div",{className:"mt-4 bg-black/70 border border-dashed border-white/10 rounded-none p-3 overflow-x-auto",children:a.jsxs("pre",{className:"text-sm text-gray-300",children:[a.jsx("span",{className:"text-blue-400",children:"import"})," ","{ betterAuth }"," ",a.jsx("span",{className:"text-blue-400",children:"from"})," ",a.jsx("span",{className:"text-green-400",children:'"better-auth"'})," ",a.jsx("br",{}),a.jsx("span",{className:"text-blue-400",children:"import"})," ","{ organization }"," ",a.jsx("span",{className:"text-blue-400",children:"from"})," ",a.jsx("span",{className:"text-green-400",children:'"better-auth/plugins/organization"'})," ",a.jsx("br",{}),a.jsx("span",{className:"text-blue-400",children:"export const"})," ",a.jsx("span",{className:"text-yellow-300",children:"auth"})," ="," ",a.jsx("span",{className:"text-yellow-300",children:"betterAuth"}),"(","{"," ",a.jsx("br",{}),a.jsx("span",{className:"text-gray-500 pl-10",children:"// ... your existing configuration"})," ",a.jsx("br",{}),a.jsx("span",{className:"text-red-300 pl-10",children:"plugins"}),": [ ",a.jsx("br",{}),a.jsxs("span",{className:"text-yellow-300 pl-12",children:["organization(",")"]}),a.jsx("br",{}),a.jsx("span",{className:"pl-10",children:"]"})," ",a.jsx("br",{}),"}",") ",a.jsx("br",{})]})}),a.jsx("div",{className:"mt-4",children:a.jsx("p",{className:"text-gray-400 text-sm",children:"2. Do migrations to create the organizations table"})}),a.jsx("div",{className:"mt-2",children:a.jsx("p",{className:"text-gray-400 text-sm",children:"3. Restart your application to apply the changes"})})]}),l.availablePlugins&&l.availablePlugins.length>0&&a.jsx("div",{className:"mb-4",children:a.jsxs("p",{className:"text-gray-400 text-sm",children:["Currently enabled plugins: ",l.availablePlugins.join(", ")]})}),a.jsx(F,{onClick:()=>window.location.reload(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Check Again"}),a.jsxs("div",{className:"mt-4 text-xs text-gray-500",children:["Need help? Check the"," ",a.jsx("a",{href:"https://better-auth.com/docs/plugins/organization",target:"_blank",rel:"noopener noreferrer",className:"text-white hover:underline",children:"Better Auth Organization Plugin Documentation"})]})]})]})})]}):a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl relative text-white font-light inline-flex items-start",children:["Organizations",a.jsx("sup",{className:"text-xs text-gray-500 ml-1 mt-0 inline-flex items-baseline",children:a.jsx(xs,{value:t.organizations??0,className:"text-white font-mono text-sm",prefix:a.jsx("span",{className:"mr-1 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-1 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]}),a.jsx("p",{className:"text-gray-400 font-light text-sm mt-1 uppercase font-mono",children:"Manage your organizations and teams"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(F,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",onClick:J,children:[a.jsx(DS,{className:"w-4 h-4 mr-2"}),"Export CSV"]}),a.jsxs(F,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",onClick:()=>Y(!0),children:[a.jsx(Nt,{className:"w-4 h-4 mr-2"}),"Seed"]}),a.jsxs(F,{className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",onClick:()=>p(!0),children:[a.jsx(ur,{className:"w-4 h-4 mr-2"}),"Add Organization"]})]})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsxs("div",{className:"flex-1 relative",children:[a.jsx(oi,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx(Fe,{placeholder:"Search organizations...",value:u,onChange:V=>h(V.target.value),className:"pl-10 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx("div",{className:"flex items-center space-x-2",children:a.jsxs(Zr,{value:"",onValueChange:oe,children:[a.jsx(Qr,{className:"w-[180px]",children:a.jsxs("div",{className:"flex mr-3 items-center space-x-2",children:[a.jsx(ur,{className:"w-4 h-4"}),a.jsx("span",{children:"Add Filter"})]})}),a.jsx(Kr,{children:!x.some(V=>V.type==="createdAt")&&a.jsx(yn,{value:"createdAt",children:"Created Date"})})]})}),x.length>0&&a.jsx("div",{className:"flex items-center space-x-2",children:a.jsx(F,{onClick:Oe,children:"Clear all"})})]}),x.length>0&&a.jsx("div",{className:"space-y-3",children:a.jsx("div",{className:"flex flex-wrap gap-3",children:x.map(V=>{var te,me,L,ie;return a.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-2 bg-white/10 border border-white/20 rounded-sm",children:[a.jsx(e0,{className:"w-3 h-3 text-white"}),V.type==="createdAt"&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm text-white",children:"Created:"}),a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(F,{variant:"outline",className:"h-8 px-3 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(dh,{className:"mr-1 h-3 w-3"}),(te=V.dateRange)!=null&&te.from?Zn(V.dateRange.from,"MMM dd yyyy"):"From"]})}),a.jsx(Dn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:(me=V.dateRange)==null?void 0:me.from,onSelect:ue=>{var he;return we("createdAt",{from:ue,to:(he=V.dateRange)==null?void 0:he.to})},initialFocus:!0,className:"rounded-none"})})]}),a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(F,{variant:"outline",className:"h-8 px-3 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(dh,{className:"mr-1 h-3 w-3"}),(L=V.dateRange)!=null&&L.to?Zn(V.dateRange.to,"MMM dd yyyy"):"To"]})}),a.jsx(Dn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:(ie=V.dateRange)==null?void 0:ie.to,onSelect:ue=>{var he;return we("createdAt",{from:(he=V.dateRange)==null?void 0:he.from,to:ue})},initialFocus:!0,disabled:ue=>{var he;return(he=V.dateRange)!=null&&he.from?ue<V.dateRange.from:!1},className:"rounded-none"})})]})]}),a.jsx("button",{onClick:()=>be(V.type),className:"ml-1 hover:bg-white/20 rounded-full p-0.5",children:a.jsx(Wt,{className:"w-3 h-3 text-white"})})]},V.type)})})})]}),a.jsxs("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:[a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Organization"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Slug"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Created"}),a.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),a.jsx("tbody",{children:Ce.length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:4,className:"py-12 px-4 text-center",children:a.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[a.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(_s,{className:"w-8 h-8 text-white/50"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-white font-medium text-lg",children:"No organizations found"}),a.jsx("p",{className:"text-gray-400 text-sm mt-1",children:u||d!=="all"?"Try adjusting your search or filter criteria":"Get started by creating your first organization"})]}),!u&&d==="all"&&a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(F,{onClick:()=>p(!0),className:"bg-white text-black hover:bg-gray-200 rounded-none",children:[a.jsx(ur,{className:"w-4 h-4 mr-2"}),"Create Organization"]}),a.jsxs(F,{onClick:()=>Y(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[a.jsx(Nt,{className:"w-4 h-4 mr-2"}),"Seed Data"]})]})]})})}):Lt.map(V=>a.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5 cursor-pointer",onClick:()=>e(`/organizations/${V.id}`),children:[a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-10 h-10 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(_s,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:V.name}),a.jsx(Rn,{id:V.id})]})]})}),a.jsx("td",{className:"py-4 px-4 text-white",children:V.slug}),a.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:a.jsxs("div",{className:"flex flex-col",children:[new Date(V.createdAt).toLocaleDateString(),a.jsx("p",{className:"text-xs",children:new Date(V.createdAt).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})})]})}),a.jsx("td",{className:"py-4 px-4 text-right",children:a.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[a.jsx(F,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:te=>{te.stopPropagation(),ce(V)},children:a.jsx(Xo,{className:"w-4 h-4"})}),a.jsx(F,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:te=>{te.stopPropagation(),de(V)},children:a.jsx(ii,{className:"w-4 h-4"})}),a.jsx(F,{variant:"ghost",size:"sm",className:"text-red-400 hover:text-red-300 rounded-none",onClick:te=>{te.stopPropagation(),Se(V)},children:a.jsx(t0,{className:"w-4 h-4"})})]})})]},V.id))})]})}),a.jsx(KC,{currentPage:v,totalPages:st,onPageChange:K,totalItems:Ce.length,startIndex:yt,endIndex:wt})]}),z&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"overflow-x-hidden bg-black/90 border border-white/10 p-6 w-full pt-4 max-w-2xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("h3",{className:"text-sm text-white flex items-center justify-center font-light uppercase",children:[a.jsx("span",{className:"text-white/50 mr-2",children:"["}),a.jsx(_s,{className:"inline mr-2 w-3.5 h-3.5 text-white"}),a.jsx("span",{className:"font-mono text-white/70 uppercase",children:"Seed Organizations"}),a.jsx("span",{className:"text-white/50 ml-2",children:"]"})]}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>Y(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Wt,{className:"w-4 h-4"})})]}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed -mt-4 mb-4"}),a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"space-y-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(Xe,{htmlFor:"organization-count",className:"text-sm text-gray-400 font-light",children:"Number of organizations"}),a.jsx(Fe,{id:"organization-count",type:"number",min:"1",max:"100",defaultValue:"5",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx(F,{onClick:()=>{var te;const V=parseInt(((te=document.getElementById("organization-count"))==null?void 0:te.value)||"5",10);ae(V)},disabled:E,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:E?a.jsxs(a.Fragment,{children:[a.jsx(Vs,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Nt,{className:"w-3 h-3 mr-2"}),"Seed Organizations"]})})]})}),M.length>0&&a.jsx("div",{className:"mt-6",children:a.jsx(fi,{title:"Organization Seeding Terminal",lines:M,isRunning:E,className:"w-full",defaultCollapsed:!0})})]}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed mt-10"}),a.jsx("div",{className:"flex justify-end mt-6 pt-6",children:a.jsx(F,{variant:"outline",onClick:()=>Y(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),b&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Create Organization"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>p(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Wt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"create-name",className:"text-sm text-gray-400 font-light",children:"Name"}),a.jsx(Fe,{id:"create-name",value:_.name,onChange:V=>q(V.target.value),placeholder:"e.g. Acme Corp",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"create-slug",className:"text-sm text-gray-400 font-light",children:"Slug"}),a.jsx(Fe,{id:"create-slug",value:_.slug,onChange:V=>ee(V.target.value),placeholder:"e.g. acme-corp",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Auto-generated from name. You can edit it manually."})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>{p(!1),I({name:"",slug:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:Ee,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Create"})]})]})}),S&&k&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",onClick:V=>{V.target===V.currentTarget&&(C(!1),$(null),P({name:"",slug:""}))},children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",onClick:V=>V.stopPropagation(),children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Edit Organization"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>{C(!1),$(null),P({name:"",slug:""})},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Wt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(_s,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:k.name}),a.jsx("div",{className:"text-sm text-gray-400",children:k.slug})]})]}),a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"edit-name",className:"text-sm text-gray-400 font-light",children:"Name"}),a.jsx(Fe,{id:"edit-name",value:R.name,onChange:V=>ne(V.target.value),placeholder:"e.g. Acme Corp",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"edit-slug",className:"text-sm text-gray-400 font-light",children:"Slug"}),a.jsx(Fe,{id:"edit-slug",value:R.slug,onChange:V=>Z(V.target.value),placeholder:"e.g. acme-corp",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Auto-generated from name. You can edit it manually."})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>{C(!1),P({name:"",slug:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:Ae,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),T&&k&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Delete Organization"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>O(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Wt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(_s,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:k.name}),a.jsx("div",{className:"text-sm text-gray-400",children:k.slug})]})]}),a.jsx("p",{className:"text-gray-400",children:"Are you sure you want to delete this organization? This action cannot be undone."})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>O(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:He,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none",children:"Delete"})]})]})}),H&&k&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Organization Details"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>U(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Wt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(_s,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:k.name}),a.jsx("div",{className:"text-sm text-gray-400",children:k.slug})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Rn,{id:k.id,variant:"detail"}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Created:"}),a.jsx("span",{className:"text-white text-sm",children:new Date(k.createdAt).toLocaleString()})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Updated:"}),a.jsx("span",{className:"text-white text-sm",children:new Date(k.updatedAt).toLocaleString()})]})]})]}),a.jsx("div",{className:"flex justify-end mt-6",children:a.jsx(F,{onClick:()=>U(!1),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Close"})})]})})]})}function eE(){const e=ws(),{counts:t,refetchCounts:n}=vf(),[s,r]=m.useState([]),[i,o]=m.useState(!0),[l,c]=m.useState(""),[u,h]=m.useState([]),[d,f]=m.useState(1),[x]=m.useState(20),[y,v]=m.useState(!1),[j,g]=m.useState(!1),[b,p]=m.useState(!1),[w,N]=m.useState(!1),[S,C]=m.useState(!1),[T,O]=m.useState(!1),[H,U]=m.useState(!1),[z,Y]=m.useState(!1),[k,$]=m.useState(null),[M,A]=m.useState(null),[E,D]=m.useState(""),[_,I]=m.useState(),[R,P]=m.useState(!1),[W,q]=m.useState([]),[ee,ne]=m.useState(!1),Z=m.useCallback(async()=>{try{const ie=await(await fetch("/api/users?limit=10000")).json();r(ie.users||[])}catch{}finally{o(!1)}},[]),se=m.useCallback(async()=>{try{const ie=await(await fetch("/api/admin/status")).json();P(ie.enabled)}catch{P(!1)}},[]);m.useEffect(()=>{Z(),se();const L=()=>{M&&A(null)};return document.addEventListener("click",L),()=>document.removeEventListener("click",L)},[M,se,Z]);const xe=async L=>{q([]),ne(!0),q([{id:"start",type:"info",message:`Starting user seeding process for ${L} users...`,timestamp:new Date}]);try{const ue=await(await fetch("/api/seed/users",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:L})})).json();if(ue.success){const he=ue.results.map((_e,Re)=>_e.success?{id:`user-${Re}`,type:"progress",message:`Creating user: ${_e.user.name} (${_e.user.email})`,timestamp:new Date,status:"completed"}:{id:`user-${Re}`,type:"error",message:`Failed to create user ${Re+1}: ${_e.error}`,timestamp:new Date});q(_e=>[..._e,...he]);const Be=ue.results.filter(_e=>_e.success).length;q(_e=>[..._e,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${Be}/${L} users successfully`,timestamp:new Date}]),await Z(),await n()}else q(he=>[...he,{id:"error",type:"error",message:`❌ Seeding failed: ${ue.error||"Unknown error"}`,timestamp:new Date}])}catch(ie){q(ue=>[...ue,{id:"error",type:"error",message:`❌ Network error: ${ie}`,timestamp:new Date}])}finally{ne(!1)}},ae=L=>{$(L),N(!0)},ce=L=>{$(L),g(!0)},de=L=>{$(L),p(!0)},Se=async()=>{var Be,_e,Re;const L=(Be=document.getElementById("create-name"))==null?void 0:Be.value,ie=(_e=document.getElementById("create-email"))==null?void 0:_e.value,ue=(Re=document.getElementById("create-password"))==null?void 0:Re.value;if(!L||!ie||!ue){B.error("Please fill in all fields");return}const he=B.loading("Creating user...");try{const Ve=await(await fetch("/api/users",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:L,email:ie,password:ue})})).json();Ve.success?(await Z(),v(!1),document.getElementById("create-name").value="",document.getElementById("create-email").value="",document.getElementById("create-password").value="",B.success("User created successfully!",{id:he})):B.error(`Error creating user: ${Ve.error||"Unknown error"}`,{id:he})}catch{B.error("Error creating user",{id:he})}},Ee=async()=>{var he,Be;if(!k){B.error("No user selected");return}const L=(he=document.getElementById("edit-name"))==null?void 0:he.value,ie=(Be=document.getElementById("edit-email"))==null?void 0:Be.value;if(!L||!ie){B.error("Please fill in all fields");return}const ue=B.loading("Updating user...");try{const Re=await(await fetch(`/api/users/${k.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:L,email:ie})})).json();Re.success?(await Z(),g(!1),$(null),B.success("User updated successfully!",{id:ue})):B.error(`Error updating user: ${Re.error||"Unknown error"}`,{id:ue})}catch{B.error("Error updating user",{id:ue})}},Ae=async()=>{if(!k){B.error("No user selected");return}const L=B.loading("Deleting user...");try{const ue=await(await fetch(`/api/users/${k.id}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();ue.success?(await Z(),await n(),p(!1),$(null),B.success("User deleted successfully!",{id:L})):B.error(`Error deleting user: ${ue.error||"Unknown error"}`,{id:L})}catch{B.error("Error deleting user",{id:L})}},He=async()=>{if(!k)return;if(!R){B.error("Admin plugin is not enabled");return}const L=B.loading("Banning user...");try{const ie=await fetch("/api/admin/ban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:k.id,banReason:E||"No reason provided",banExpiresIn:_})}),ue=await ie.json();ie.ok?(B.success("User banned successfully!",{id:L}),O(!1),D(""),I(void 0),$(null),A(null),Z()):B.error(`Error banning user: ${ue.error||ue.message||"Unknown error"}`,{id:L})}catch{B.error("Error banning user",{id:L})}},J=async()=>{if(!k)return;if(!R){B.error("Admin plugin is not enabled");return}const L=B.loading("Unbanning user...");try{const ie=await fetch("/api/admin/unban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:k.id})}),ue=await ie.json();ie.ok?(B.success("User unbanned successfully!",{id:L}),U(!1),$(null),A(null),Z()):B.error(`Error unbanning user: ${ue.error||ue.message||"Unknown error"}`,{id:L})}catch{B.error("Error unbanning user",{id:L})}},oe=async()=>{var ue;if(!k){B.error("No user selected");return}const L=(ue=document.getElementById("update-password"))==null?void 0:ue.value;if(!L){B.error("Please enter a new password");return}const ie=B.loading("Updating password...");try{const he=await fetch(`/api/users/${k.id}/password`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:L})}),Be=await he.json();he.ok&&Be.success?(B.success("Password updated successfully!",{id:ie}),Y(!1),$(null),document.getElementById("update-password").value=""):B.error(`Error updating password: ${Be.error||"Unknown error"}`,{id:ie})}catch{B.error("Error updating password",{id:ie})}},be=()=>{if(s.length===0){B.error("No users to export");return}const L=["ID","Name","Email","Email Verified","Created At","Updated At"],ie=s.map(Re=>[Re.id,Re.name||"",Re.email||"",!!Re.emailVerified,new Date(Re.createdAt).toLocaleString(),new Date(Re.updatedAt).toLocaleString()]),ue=[L.join(","),...ie.map(Re=>Re.map(je=>`"${je}"`).join(","))].join(`
449
- `),he=new Blob([ue],{type:"text/csv;charset=utf-8;"}),Be=document.createElement("a"),_e=URL.createObjectURL(he);Be.setAttribute("href",_e),Be.setAttribute("download",`users-export-${new Date().toISOString().split("T")[0]}.csv`),Be.style.visibility="hidden",document.body.appendChild(Be),Be.click(),document.body.removeChild(Be),B.success(`Exported ${s.length} users to CSV`)},Oe=L=>{u.some(ue=>ue.type===L)||(h(ue=>[...ue,{type:L}]),f(1))},we=L=>{h(ie=>ie.filter(ue=>ue.type!==L)),f(1)},Ce=(L,ie)=>{h(ue=>ue.map(he=>he.type===L?{...he,value:ie}:he))},st=(L,ie)=>{h(ue=>ue.map(he=>he.type===L?{...he,dateRange:ie}:he))},yt=s.filter(L=>{const ie=L.name.toLowerCase().includes(l.toLowerCase())||L.email.toLowerCase().includes(l.toLowerCase());if(u.length===0)return ie;const ue=u.every(he=>{var Be,_e,Re,je,Ve;switch(he.type){case"emailVerified":return he.value===void 0?!0:L.emailVerified===(he.value==="true");case"banned":return he.value===void 0?!0:L.banned===(he.value==="true");case"active":return L.banned!==!0;case"createdAt":{if(!((Be=he.dateRange)!=null&&Be.from)&&!((_e=he.dateRange)!=null&&_e.to))return!0;const ke=new Date(L.createdAt);return!((Re=he.dateRange)!=null&&Re.from&&he.dateRange.from>ke||(je=he.dateRange)!=null&&je.to&&he.dateRange.to<ke)}case"role":return he.value?(Ve=L.role)==null?void 0:Ve.toLowerCase().includes(he.value.toLowerCase()):!0;default:return!0}});return ie&&ue}),wt=s.filter(L=>L.banned).length,Lt=Math.ceil(yt.length/x),K=(d-1)*x,V=K+x,te=yt.slice(K,V),me=L=>{f(L)};return i?a.jsx("div",{className:"flex min-h-screen items-center justify-center h-full",children:a.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[a.jsx(Vs,{className:"w-6 h-6 text-white animate-spin"}),a.jsx("div",{className:"text-white text-sm",children:"Loading users..."})]})}):a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl relative text-white font-light inline-flex items-start",children:["Users",a.jsx("sup",{className:"text-xs text-gray-500 ml-1 mt-0 inline-flex items-baseline",children:a.jsx(xs,{value:t.users??0,className:"text-white font-mono text-sm",prefix:a.jsx("span",{className:"mr-1 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-1 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]}),a.jsx("p",{className:"text-gray-400 font-light text-sm mt-1 uppercase font-mono",children:"Manage your application users"}),a.jsx("div",{className:"flex items-center space-x-4 mt-2",children:wt>0&&a.jsxs("span",{className:"text-sm text-red-400 flex items-center space-x-1",children:[a.jsx(Pd,{className:"w-3 h-3"}),a.jsxs("span",{children:[wt," Banned"]})]})})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(F,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",onClick:be,children:[a.jsx(DS,{className:"w-4 h-4 mr-2"}),"Export CSV"]}),a.jsxs(F,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",onClick:()=>C(!0),children:[a.jsx(Nt,{className:"w-4 h-4 mr-2"}),"Seed"]}),a.jsxs(F,{className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",onClick:()=>v(!0),children:[a.jsx(gg,{className:"w-4 h-4 mr-2"}),"Add User"]})]})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsxs("div",{className:"flex-1 relative",children:[a.jsx(oi,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx(Fe,{placeholder:"Search users...",value:l,onChange:L=>c(L.target.value),className:"pl-10 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx("div",{className:"flex items-center space-x-2",children:a.jsxs(Zr,{value:"",onValueChange:Oe,children:[a.jsx(Qr,{className:"w-[180px]",children:a.jsxs("div",{className:"flex mr-3 items-center space-x-2",children:[a.jsx(ur,{className:"w-4 h-4"}),a.jsx("span",{children:"Add Filter"})]})}),a.jsxs(Kr,{children:[!u.some(L=>L.type==="emailVerified")&&a.jsx(yn,{value:"emailVerified",children:"Email Verified"}),!u.some(L=>L.type==="banned")&&a.jsx(yn,{value:"banned",children:"Banned Status"}),!u.some(L=>L.type==="createdAt")&&a.jsx(yn,{value:"createdAt",children:"Created Date"}),!u.some(L=>L.type==="role")&&a.jsx(yn,{value:"role",children:"Role"})]})]})}),u.length>0&&a.jsx("div",{className:"flex items-center space-x-2",children:a.jsx(F,{onClick:()=>h([]),className:"",children:"Clear all"})})]}),u.length>0&&a.jsx("div",{className:"space-y-3",children:a.jsx("div",{className:"flex flex-wrap gap-3",children:u.map(L=>{var ie,ue,he,Be;return a.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-2 bg-white/10 border border-white/20 rounded-sm",children:[a.jsx(e0,{className:"w-3 h-3 text-white"}),L.type==="emailVerified"&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm text-white",children:"Email Verified:"}),a.jsxs(Zr,{value:L.value||"",onValueChange:_e=>Ce("emailVerified",_e),children:[a.jsx(Qr,{className:"h-7 w-24 text-xs",children:a.jsx("span",{children:L.value==="true"?"True":L.value==="false"?"False":"Select"})}),a.jsxs(Kr,{children:[a.jsx(yn,{value:"true",children:"True"}),a.jsx(yn,{value:"false",children:"False"})]})]})]}),L.type==="banned"&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm text-white",children:"Banned:"}),a.jsxs(Zr,{value:L.value||"",onValueChange:_e=>Ce("banned",_e),children:[a.jsx(Qr,{className:"h-7 w-24 text-xs",children:a.jsx("span",{children:L.value==="true"?"Yes":L.value==="false"?"No":"Select"})}),a.jsxs(Kr,{children:[a.jsx(yn,{value:"true",children:"Yes"}),a.jsx(yn,{value:"false",children:"No"})]})]})]}),L.type==="createdAt"&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm text-white",children:"Created:"}),a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(F,{variant:"outline",className:"h-8 px-3 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(dh,{className:"mr-1 h-3 w-3"}),(ie=L.dateRange)!=null&&ie.from?Zn(L.dateRange.from,"MMM dd yyyy"):"From"]})}),a.jsx(Dn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:(ue=L.dateRange)==null?void 0:ue.from,onSelect:_e=>{var Re;return st("createdAt",{from:_e,to:(Re=L.dateRange)==null?void 0:Re.to})},initialFocus:!0,className:"rounded-none"})})]}),a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(F,{variant:"outline",className:"h-8 px-3 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(dh,{className:"mr-1 h-3 w-3"}),(he=L.dateRange)!=null&&he.to?Zn(L.dateRange.to,"MMM dd yyyy"):"To"]})}),a.jsx(Dn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:(Be=L.dateRange)==null?void 0:Be.to,onSelect:_e=>{var Re;return st("createdAt",{from:(Re=L.dateRange)==null?void 0:Re.from,to:_e})},initialFocus:!0,disabled:_e=>{var Re;return(Re=L.dateRange)!=null&&Re.from?_e<L.dateRange.from:!1},className:"rounded-none"})})]})]}),L.type==="role"&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm text-white",children:"Role:"}),a.jsx(Fe,{type:"text",value:L.value||"",onChange:_e=>Ce("role",_e.target.value),className:"h-7 w-32 text-xs bg-black border-white/20 text-white",placeholder:"Enter role..."})]}),a.jsx("button",{onClick:()=>we(L.type),className:"ml-1 hover:bg-white/20 rounded-full p-0.5",children:a.jsx(Wt,{className:"w-3 h-3 text-white"})})]},L.type)})})})]}),a.jsxs("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:[a.jsx("div",{className:"overflow-x-auto overflow-y-hidden",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"User"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Email Status"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Created"}),a.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),a.jsx("tbody",{children:te.length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:4,className:"py-12 px-4 text-center",children:a.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[a.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(li,{className:"w-8 h-8 text-white/50"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-white font-medium text-lg",children:"No users found"}),a.jsx("p",{className:"text-gray-400 text-sm mt-1",children:l||u.length>0?"Try adjusting your search or filter criteria":"Get started by creating your first user or seeding some data"})]}),!l&&u.length===0&&a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(F,{onClick:()=>v(!0),className:"bg-white text-black hover:bg-gray-200 rounded-none",children:[a.jsx(gg,{className:"w-4 h-4 mr-2"}),"Create User"]}),a.jsxs(F,{onClick:()=>C(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[a.jsx(Nt,{className:"w-4 h-4 mr-2"}),"Seed Data"]})]})]})})}):te.map(L=>a.jsxs("tr",{className:`border-b border-dashed hover:bg-white/5 cursor-pointer ${L.banned?"border-red-500/30 bg-red-500/5":"border-white/5"}`,onClick:()=>e(`/users/${L.id}`),children:[a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"relative",children:[a.jsx("img",{src:L.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${L.id}`,alt:L.name,className:`w-10 h-10 rounded-none border border-dashed ${L.banned?"border-red-400/50 opacity-60":"border-white/20"}`}),L.banned&&a.jsx("div",{className:"absolute -top-1 -right-1 bg-red-500 rounded-full p-0.5",children:a.jsx(Pd,{className:"w-3 h-3 text-white"})})]}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"text-white font-light",children:L.name}),L.banned&&a.jsx("span",{className:"px-2 py-0.5 text-[10px] font-semibold bg-red-500/20 border border-red-500/50 text-red-400 rounded-sm uppercase tracking-wide",children:"Banned"})]}),a.jsx("div",{className:"text-sm text-gray-400 mt-0.5",children:L.email})]})]})}),a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[L.emailVerified?a.jsx(fg,{className:"w-4 h-4 text-green-400"}):a.jsx(uh,{className:"w-4 h-4 text-yellow-400"}),a.jsx("span",{className:"text-sm text-gray-400",children:L.emailVerified?"Verified":"Not Verified"})]})}),a.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:a.jsxs("div",{className:"flex flex-col",children:[new Date(L.createdAt).toLocaleDateString(),a.jsx("p",{className:"text-xs",children:new Date(L.createdAt).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})})]})}),a.jsx("td",{className:"py-4 px-4 text-right",children:a.jsxs("div",{className:"relative flex items-center justify-end",children:[a.jsx(F,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:ie=>{ie.stopPropagation(),A(M===L.id?null:L.id)},children:a.jsx(lR,{className:"w-4 h-4"})}),M===L.id&&a.jsxs("div",{className:"absolute z-[999] right-0 top-full mt-1 w-48 bg-black border border-white/20 rounded-none shadow-lg",onClick:ie=>ie.stopPropagation(),children:[a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-white hover:bg-white/10 flex items-center space-x-2",onClick:ie=>{ie.stopPropagation(),A(null),ae(L)},children:[a.jsx(Xo,{className:"w-4 h-4"}),a.jsx("span",{children:"View"})]}),a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-white hover:bg-white/10 flex items-center space-x-2",onClick:ie=>{ie.stopPropagation(),A(null),ce(L)},children:[a.jsx(ii,{className:"w-4 h-4"}),a.jsx("span",{children:"Edit User"})]}),a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-white hover:bg-white/10 flex items-center space-x-2",onClick:ie=>{ie.stopPropagation(),A(null),$(L),Y(!0)},children:[a.jsx(kn,{className:"w-4 h-4"}),a.jsx("span",{children:"Update Password"})]}),R&&(L.banned?a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-green-400 hover:bg-white/10 flex items-center space-x-2",onClick:ie=>{ie.stopPropagation(),$(L),U(!0),A(null)},children:[a.jsx(Pd,{className:"w-4 h-4"}),a.jsx("span",{children:"Unban User"})]}):a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-yellow-400 hover:bg-white/10 flex items-center space-x-2",onClick:ie=>{ie.stopPropagation(),$(L),O(!0),A(null)},children:[a.jsx(Pd,{className:"w-4 h-4"}),a.jsx("span",{children:"Ban User"})]})),a.jsx("div",{className:"border-t border-white/10 my-1"}),a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-red-400 hover:bg-white/10 flex items-center space-x-2",onClick:ie=>{ie.stopPropagation(),A(null),de(L)},children:[a.jsx(t0,{className:"w-4 h-4"}),a.jsx("span",{children:"Delete User"})]})]})]})})]},L.id))})]})}),a.jsx(KC,{currentPage:d,totalPages:Lt,onPageChange:me,totalItems:yt.length,startIndex:K,endIndex:V})]}),S&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"overflow-x-hidden bg-black/90 border border-white/10 p-6 w-full pt-4 max-w-2xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("h3",{className:"text-sm text-white flex items-center justify-center font-light uppercase",children:[a.jsx("span",{className:"text-white/50 mr-2",children:"["}),a.jsx(li,{className:"inline mr-2 w-3 h-3 text-white"}),a.jsx("span",{className:"font-mono text-white/70 uppercase",children:"Seed User"}),a.jsx("span",{className:"text-white/50 ml-2",children:"]"})]}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>C(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Wt,{className:"w-4 h-4"})})]}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed -mt-4 mb-4"}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"flex items-center space-x-2"}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(Xe,{htmlFor:"user-count",className:"text-sm text-gray-400 font-light",children:"Number of users"}),a.jsx(Fe,{id:"user-count",type:"number",min:"1",max:"100",defaultValue:"5",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx(F,{onClick:()=>{var ie;const L=parseInt(((ie=document.getElementById("user-count"))==null?void 0:ie.value)||"5",10);xe(L)},disabled:ee,className:"bg-transparent hover:bg-white/90 bg-white text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:ee?a.jsxs(a.Fragment,{children:[a.jsx(Vs,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Nt,{className:"w-3 h-3 mr-2"}),"Seed Users"]})})]})]}),W.length>0&&a.jsx("div",{className:"mt-6",children:a.jsx(fi,{title:"User Seeding Terminal",lines:W,isRunning:ee,className:"w-full",defaultCollapsed:!0})})]}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed mt-10"}),a.jsx("div",{className:"flex justify-end mt-6 pt-6",children:a.jsx(F,{variant:"outline",onClick:()=>C(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),y&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-white/10 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Create User"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>v(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Wt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"create-name",className:"text-sm text-gray-400 font-light",children:"Name"}),a.jsx(Fe,{id:"create-name",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"create-email",className:"text-sm text-gray-400 font-light",children:"Email"}),a.jsx(Fe,{id:"create-email",type:"email",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"create-password",className:"text-sm text-gray-400 font-light",children:"Password"}),a.jsx(Fe,{id:"create-password",type:"password",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>v(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:Se,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Create"})]})]})}),j&&k&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Edit User"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>g(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Wt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("img",{src:k.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${k.id}`,alt:k.name,className:"w-16 h-16 rounded-none border border-dashed border-white/20"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:k.name}),a.jsx("div",{className:"text-sm text-gray-400",children:k.email})]})]}),a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"edit-name",className:"text-sm text-gray-400 font-light",children:"Name"}),a.jsx(Fe,{id:"edit-name",defaultValue:k.name,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"edit-email",className:"text-sm text-gray-400 font-light",children:"Email"}),a.jsx(Fe,{id:"edit-email",type:"email",defaultValue:k.email,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>g(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:Ee,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),b&&k&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Delete User"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>p(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Wt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("img",{src:k.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${k.id}`,alt:k.name,className:"w-16 h-16 rounded-none border border-dashed border-white/20"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:k.name}),a.jsx("div",{className:"text-sm text-gray-400",children:k.email})]})]}),a.jsx("p",{className:"text-gray-400",children:"Are you sure you want to delete this user? This action cannot be undone."})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>p(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:Ae,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none",children:"Delete"})]})]})}),w&&k&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"User Details"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>N(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Wt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("img",{src:k.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${k.id}`,alt:k.name,className:"w-16 h-16 rounded-none border border-dashed border-white/20"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:k.name}),a.jsx("div",{className:"text-sm text-gray-400",children:k.email})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Rn,{id:k.id,variant:"detail"}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Email Verified:"}),a.jsx("span",{className:"text-white text-sm",children:k.emailVerified?"Yes":"No"})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Created:"}),a.jsx("span",{className:"text-white text-sm",children:new Date(k.createdAt).toLocaleString()})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Updated:"}),a.jsx("span",{className:"text-white text-sm",children:new Date(k.updatedAt).toLocaleString()})]})]})]}),a.jsx("div",{className:"flex justify-end mt-6",children:a.jsx(F,{onClick:()=>N(!1),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Close"})})]})}),T&&k&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-red-400/20 rounded-none p-6 w-full max-w-md",children:[a.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Ban User"}),a.jsxs("p",{className:"text-gray-400 mb-4",children:["Ban ",a.jsx("strong",{children:k.name})," from accessing the system."]}),a.jsxs("div",{className:"space-y-4 mb-6",children:[a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"banReason",className:"text-white",children:"Ban Reason"}),a.jsx(Fe,{id:"banReason",value:E,onChange:L=>D(L.target.value),placeholder:"Enter reason for ban (optional)",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"banExpires",className:"text-white",children:"Ban Duration (seconds)"}),a.jsx(Fe,{id:"banExpires",type:"number",value:_||"",onChange:L=>I(L.target.value?Number(L.target.value):void 0),placeholder:"Leave empty for permanent ban",className:"bg-black border border-dashed border-white/20 text-white rounded-none"}),a.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Examples: 3600 (1 hour), 86400 (1 day), 604800 (1 week)"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-2",children:[a.jsx(F,{variant:"outline",onClick:()=>{O(!1),D(""),I(void 0),$(null)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:He,className:"bg-red-600 text-white hover:bg-red-700 rounded-none",children:"Ban User"})]})]})}),H&&k&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-dashed border-green-400/50 rounded-none p-6 w-full max-w-md",children:[a.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Unban User"}),a.jsxs("p",{className:"text-gray-400 mb-6",children:["Are you sure you want to unban ",a.jsx("strong",{children:k.name}),"? This will restore their access to the system."]}),a.jsxs("div",{className:"flex justify-end space-x-2",children:[a.jsx(F,{variant:"outline",onClick:()=>{U(!1),$(null)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:J,className:"bg-green-600 text-white hover:bg-green-700 rounded-none",children:"Unban User"})]})]})}),z&&k&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Update Password"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>{Y(!1),$(null),document.getElementById("update-password").value=""},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Wt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("img",{src:k.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${k.id}`,alt:k.name,className:"w-16 h-16 rounded-none border border-dashed border-white/20"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:k.name}),a.jsx("div",{className:"text-sm text-gray-400",children:k.email})]})]}),a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"update-password",className:"text-sm text-gray-400 font-light",children:"New Password"}),a.jsx(Fe,{id:"update-password",type:"password",placeholder:"Enter new password",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>{Y(!1),$(null),document.getElementById("update-password").value=""},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:oe,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update Password"})]})]})})]})}const Sl=[{id:"signups",label:"Signups",analyticsKey:"newUsers",barClass:"bg-white/25 border border-white/10",dotClass:"bg-white/25"},{id:"logins",label:"Logins",analyticsKey:"activeUsers",barClass:"bg-white/20 border border-white/10",dotClass:"bg-white/20"},{id:"organizations",label:"Organizations",analyticsKey:"organizations",barClass:"bg-white/15 border border-white/10",dotClass:"bg-white/15"},{id:"teams",label:"Teams",analyticsKey:"teams",barClass:"bg-white/10 border border-white/10",dotClass:"bg-white/10"},{id:"sessions",label:"Sessions",analyticsKey:"sessions",barClass:"bg-white/5 border border-white/10",dotClass:"bg-white/5"}];function KB(){const[e]=m.useState("overview"),[t,n]=m.useState(!1),[s,r]=m.useState(0),[i,o]=m.useState(0),[l,c]=m.useState("1D"),[u,h]=m.useState("1D"),[d,f]=m.useState(null),[x,y]=m.useState(!1),[v,j]=m.useState("Daily"),[g,b]=m.useState("Daily"),[p,w]=m.useState("Daily"),[N,S]=m.useState("Daily"),[C,T]=m.useState(!1),[O,H]=m.useState(!1),[U,z]=m.useState(!1),[Y,k]=m.useState(!1),[$,M]=m.useState(null),[A,E]=m.useState(null),[D,_]=m.useState(null),[I,R]=m.useState(null),[P,W]=m.useState(null),[q,ee]=m.useState(void 0),[ne,Z]=m.useState(void 0),[se,xe]=m.useState(void 0),[ae,ce]=m.useState(void 0),[de,Se]=m.useState(void 0),[Ee,Ae]=m.useState(void 0),[He,J]=m.useState(void 0),[oe,be]=m.useState(void 0),[Oe,we]=m.useState([]),[Ce,st]=m.useState([]),[yt,wt]=m.useState(0),[Lt,K]=m.useState([]),[V,te]=m.useState([]),[me,L]=m.useState(0),[ie,ue]=m.useState(0),[he,Be]=m.useState(0),[_e,Re]=m.useState(0),[je,Ve]=m.useState(0),[ke,Pe]=m.useState(!1),[X,Q]=m.useState(!1),[pe,We]=m.useState({signups:[],logins:[],organizations:[],teams:[],sessions:[]}),[nt,tt]=m.useState([]),[Qe,Zt]=m.useState(!1),[Ss,cn]=m.useState(0),[Qt,yi]=m.useState(0),[Sn,ad]=m.useState(0),[Jo,el]=m.useState(0),[Cf,Ef]=m.useState(0),[Er,tl]=m.useState([]),[rd,wi]=m.useState(0),[ji,Ni]=m.useState(0),[nl,id]=m.useState(0),{counts:Ea,loading:Cs}=vf(),ka=ws(),Si=["Daily","Weekly","Monthly","Yearly","Custom"],od={Daily:"1D",Weekly:"1W",Monthly:"1M",Yearly:"1Y",Custom:"Custom"},kf=m.useMemo(()=>new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}),[]),Ma=fe=>fe==null?"...":kf.format(Number(fe)),Ta=fe=>fe==null?"...":Number(fe).toLocaleString(),sl=m.useMemo(()=>Sl.reduce((fe,ge)=>(fe[ge.id]=(pe[ge.id]||[]).reduce((ve,le)=>ve+le,0),fe),{}),[pe]),ld=m.useMemo(()=>Object.values(sl).reduce((fe,ge)=>fe+ge,0),[sl]),Mf=(fe,ge)=>{const ve=fe.currentTarget.getBoundingClientRect();R(ge),W({x:ve.left+ve.width/2,y:ve.top})},cd=(()=>{const fe=[];return $!=null&&$.isOutdated?fe.push({id:"version-check",title:`Update Better-Auth to v${$.latest}`,severity:"high",date:new Date().toISOString().split("T")[0],description:"Your current version is outdated. Update to the latest version to get the latest security fixes, features, and improvements. Run: `pnpm install better-auth@latest`",affectedComponents:["All Components"],status:"pending",cve:""}):$&&fe.push({id:"version-check",title:"Better-Auth is Up to date",severity:"low",date:new Date().toISOString().split("T")[0],description:"You are running the latest version of better-auth. Great job keeping your dependencies up to date!",affectedComponents:["All Components"],status:"applied",cve:""}),fe.push(),fe.push({id:"3",title:"Rate Limiting Configuration",severity:"medium",date:new Date().toISOString().split("T")[0],description:"Configure rate limiting for authentication endpoints to prevent brute force attacks. Better-auth provides built-in rate limiting middleware.",affectedComponents:["Auth Endpoints"],status:"pending"}),fe})(),gt=m.useCallback(async(fe,ge,ve,le)=>{try{const Ne=new URLSearchParams({type:fe,period:ge});return ve&&Ne.append("from",ve.toISOString()),le&&Ne.append("to",le.toISOString()),await(await fetch(`/api/analytics?${Ne.toString()}`)).json()}catch{return null}},[]);m.useEffect(()=>{(async()=>{try{const ve=await(await fetch("/api/users/all")).json();ve!=null&&ve.success&&ve.users&&tl(ve.users)}catch{tl([])}})()},[]),m.useEffect(()=>{(async()=>{try{const ve=await(await fetch("/api/stats")).json();ve&&r(ve.activeUsers||0)}catch{r(0)}})()},[]),m.useEffect(()=>{(async()=>{const ge=await gt("users",l,q,ne);ge&&(we(ge.data||[]),st(ge.labels||[]),wt(ge.percentageChange||0))})()},[l,q,ne,gt]),m.useEffect(()=>{if(Er.length===0){wi(0),Ni(0);return}const fe=new Date;let ge,ve=fe,le,Ne;if(g==="Custom"){if(!se||!ae){wi(0),Ni(0);return}ge=new Date(se),ve=new Date(ae),ve.setHours(23,59,59,999);const nn=ve.getTime()-ge.getTime();Ne=new Date(ge.getTime()-1),le=new Date(Ne.getTime()-nn)}else switch(g){case"Daily":ge=new Date(fe),ge.setHours(0,0,0,0),Ne=new Date(ge.getTime()-1),le=new Date(Ne.getTime()-24*60*60*1e3);break;case"Weekly":ge=new Date(fe),ge.setDate(fe.getDate()-fe.getDay()),ge.setHours(0,0,0,0),Ne=new Date(ge.getTime()-1),le=new Date(Ne.getTime()-7*24*60*60*1e3);break;case"Monthly":ge=new Date(fe.getFullYear(),fe.getMonth(),1),ge.setHours(0,0,0,0),Ne=new Date(ge.getTime()-1),le=new Date(fe.getFullYear(),fe.getMonth()-1,1),le.setHours(0,0,0,0);break;case"Yearly":ge=new Date(fe.getFullYear(),0,1),ge.setHours(0,0,0,0),Ne=new Date(ge.getTime()-1),le=new Date(fe.getFullYear()-1,0,1),le.setHours(0,0,0,0);break;default:wi(0),Ni(0);return}const Ue=Er.filter(nn=>{if(!nn.createdAt)return!1;const Da=new Date(nn.createdAt);return Da>=ge&&Da<=ve}),Me=Er.filter(nn=>{if(!nn.createdAt)return!1;const Da=new Date(nn.createdAt);return Da>=le&&Da<=Ne}),ye=Ue.length,Ke=Me.length;let mn=0;Ke>0?mn=(ye-Ke)/Ke*100:ye>0&&(mn=100),wi(ye),Ni(mn)},[Er,g,se,ae]),m.useEffect(()=>{(async()=>{if(!(u==="Custom"&&(!se||!ae))){Zt(!0);try{const[ge,ve,le,Ne,Ue]=await Promise.all([gt("newUsers",u,se,ae),gt("activeUsers",u,se,ae),gt("organizations",u,se,ae),gt("teams",u,se,ae),gt("sessions",u,se,ae)]);ge&&(K(ge.data||[]),te(ge.labels||[])),We({signups:(ge==null?void 0:ge.data)||[],logins:(ve==null?void 0:ve.data)||[],organizations:(le==null?void 0:le.data)||[],teams:(Ne==null?void 0:Ne.data)||[],sessions:(Ue==null?void 0:Ue.data)||[]}),tt((ge==null?void 0:ge.labels)||(ve==null?void 0:ve.labels)||(le==null?void 0:le.labels)||(Ne==null?void 0:Ne.labels)||(Ue==null?void 0:Ue.labels)||[])}finally{Zt(!1)}}})()},[u,se,ae,gt]),m.useEffect(()=>{(async()=>{const ge=await gt("activeUsers","1D");ge&&L(ge.percentageChange||0)})()},[gt]),m.useEffect(()=>{},[Ea.organizations,Ea.teams,Cs]),m.useEffect(()=>{(async()=>{const ge=od[p]||"1D",ve=ge==="Custom";if(!(ve&&(!de||!Ee))){Pe(!0);try{const le=await gt("organizations",ge,ve?de:void 0,ve?Ee:void 0);le&&(Re(le.total||0),ue(le.percentageChange||0))}catch{Re(0),ue(0)}finally{Pe(!1)}}})()},[p,de,Ee,gt]),m.useEffect(()=>{(async()=>{const ge=od[N]||"1D",ve=ge==="Custom";if(!(ve&&(!He||!oe))){Q(!0);try{const le=await gt("teams",ge,ve?He:void 0,ve?oe:void 0);le&&(Ve(le.total||0),Be(le.percentageChange||0))}catch{Ve(0),Be(0)}finally{Q(!1)}}})()},[N,He,oe,gt]),m.useEffect(()=>{(async()=>{const ge=await gt("users","1D");ge&&cn(ge.percentageChange||0);const ve=await gt("organizations","1D");ve&&yi(ve.percentageChange||0);const le=await gt("activeUsers","1D");le&&ad(le.percentageChange||0);const[Ne,Ue,Me,ye,Ke]=await Promise.all([gt("newUsers","1D"),gt("activeUsers","1D"),gt("organizations","1D"),gt("teams","1D"),gt("sessions","1D")]);Ne?(o(Ne.total||0),id(Ne.percentageChange||0)):(o(0),id(0));const nn=[(Ne==null?void 0:Ne.total)||0,(Ue==null?void 0:Ue.total)||0,(Me==null?void 0:Me.total)||0,(ye==null?void 0:ye.total)||0,(Ke==null?void 0:Ke.total)||0].reduce((Mr,Af)=>Mr+Af,0);Ef(nn);const rl=[(Ne==null?void 0:Ne.previousTotal)||0,(Ue==null?void 0:Ue.previousTotal)||0,(Me==null?void 0:Me.previousTotal)||0,(ye==null?void 0:ye.previousTotal)||0,(Ke==null?void 0:Ke.previousTotal)||0].reduce((Mr,Af)=>Mr+Af,0);if(rl>0){const Mr=(nn-rl)/rl*100;el(Mr)}else nn>0?el(100):el(0)})()},[gt]),m.useEffect(()=>{(async()=>{try{const ve=await(await fetch("/api/version-check")).json();ve&&M({current:ve.current||"1.0.0",latest:ve.latest||"1.0.0",isOutdated:ve.isOutdated||!1})}catch{try{const Ne=(await(await fetch("/api/package-info")).json()).betterAuthVersion||"1.0.0",Ue="1.5.0";M({current:Ne,latest:Ue,isOutdated:Ne!==Ue})}catch{M({current:"1.0.0",latest:"1.5.0",isOutdated:!0})}}})()},[]);const dd=fe=>{switch(fe){case"critical":return"bg-white/10 text-white border-white/20";case"high":return"bg-white/10 text-white border-white/20";case"medium":return"bg-white/10 text-gray-300 border-white/20";case"low":return"bg-white/10 text-gray-400 border-white/20";default:return"bg-white/10 text-gray-400 border-white/20"}},ud=fe=>{switch(fe){case"applied":return"bg-white/10 text-white border-white/20";case"scheduled":return"bg-white/10 text-gray-300 border-white/20";case"pending":return"bg-white/10 text-gray-400 border-white/20";default:return"bg-white/10 text-gray-400 border-white/20"}},Tf=fe=>{f(fe),y(!0)},al=()=>{y(!1),setTimeout(()=>f(null),300)},kr=(fe,ge="users")=>{const ve=ge==="users"?Ce:V,Ne={"1D":24,"1W":7,"1M":30,"3M":3,"6M":6,"1Y":12,ALL:7}[fe]||7;if(ve&&ve.length>0&&ve.length===Ne)return fe==="1D"?ve.filter((Me,ye)=>ye%4===0).map(Me=>{const ye=parseInt(Me.replace("h",""),10);return ye===0?"12am":ye<12?`${ye}am`:ye===12?"12pm":`${ye-12}pm`}):fe==="1W"?ve.map(Me=>Me.length>3?Me.substring(0,3):Me):fe==="1M"?ve.map(Me=>{const ye=Me.split(" ");return ye.length>=2?ye[1]:Me}):fe==="1Y"||fe==="3M"||fe==="6M"?ve.map(Me=>Me.length>3?Me.substring(0,3):Me):ve.map(Me=>Me.length>3?Me.substring(0,3):Me);const Ue=new Date;switch(fe){case"1D":return["12am","4am","8am","12pm","4pm","8pm"];case"1W":return Array.from({length:7},(Me,ye)=>new Date(Ue.getTime()-(6-ye)*24*60*60*1e3).toLocaleDateString("en-US",{weekday:"short"}));case"1M":return Array.from({length:30},(Me,ye)=>new Date(Ue.getTime()-(29-ye)*24*60*60*1e3).getDate().toString());case"3M":return Array.from({length:3},(Me,ye)=>new Date(Ue.getFullYear(),Ue.getMonth()-(2-ye),1).toLocaleDateString("en-US",{month:"short"}));case"6M":return Array.from({length:6},(Me,ye)=>new Date(Ue.getFullYear(),Ue.getMonth()-(5-ye),1).toLocaleDateString("en-US",{month:"short"}));case"1Y":return Array.from({length:12},(Me,ye)=>new Date(Ue.getFullYear(),Ue.getMonth()-(11-ye),1).toLocaleDateString("en-US",{month:"short"}));case"ALL":return Array.from({length:7},(Me,ye)=>new Date(Ue.getFullYear(),Ue.getMonth()-(6-ye),1).toLocaleDateString("en-US",{month:"short"}));default:return["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]}},Df=(fe,ge="users")=>{const ve=ge==="users"?Ce:V,Ne={"1D":24,"1W":7,"1M":30,"3M":3,"6M":6,"1Y":12,ALL:7}[fe]||7;if(ve&&ve.length>0&&ve.length===Ne)return fe==="1D"?ve.map(Me=>{const ye=parseInt(Me.replace("h",""),10);return ye===0?"12am":ye<12?`${ye}am`:ye===12?"12pm":`${ye-12}pm`}):fe==="1Y"||fe==="3M"||fe==="6M"?ve.map(Me=>{const ye=["January","February","March","April","May","June","July","August","September","October","November","December"],mn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"].indexOf(Me);return mn!==-1?ye[mn]:Me}):ve;const Ue=new Date;switch(fe){case"1D":return Array.from({length:24},(Me,ye)=>{const Ke=new Date;return Ke.setHours(ye,0,0,0),Ke.toLocaleTimeString("en-US",{hour:"numeric",hour12:!0})});case"1W":return Array.from({length:7},(Me,ye)=>new Date(Ue.getTime()-(6-ye)*24*60*60*1e3).toLocaleDateString("en-US",{weekday:"long"}));case"1M":return Array.from({length:30},(Me,ye)=>{const Ke=new Date(Ue.getTime()-(29-ye)*24*60*60*1e3),mn=Ke.toLocaleDateString("en-US",{month:"short"}),nn=Ke.getDate();return`${mn} ${nn}`});case"3M":return Array.from({length:3},(Me,ye)=>new Date(Ue.getFullYear(),Ue.getMonth()-(2-ye),1).toLocaleDateString("en-US",{month:"long"}));case"6M":return Array.from({length:6},(Me,ye)=>new Date(Ue.getFullYear(),Ue.getMonth()-(5-ye),1).toLocaleDateString("en-US",{month:"long"}));case"1Y":return Array.from({length:12},(Me,ye)=>new Date(Ue.getFullYear(),Ue.getMonth()-(11-ye),1).toLocaleDateString("en-US",{month:"long"}));case"ALL":return Array.from({length:7},(Me,ye)=>new Date(Ue.getFullYear(),Ue.getMonth()-(6-ye),1).toLocaleDateString("en-US",{month:"long"}));default:return["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]}},_f=(fe,ge="users")=>{const ve=ge==="users"?Oe:Lt,Ne={"1D":24,"1W":7,"1M":30,"3M":3,"6M":6,"1Y":12,ALL:7}[fe]||7;if(!ve||ve.length===0)return Array(Ne).fill(0);const Ue=[...ve];for(;Ue.length<Ne;)Ue.push(0);const Me=Ue.slice(0,Ne),ye=Math.max(...Me,1);return Me.map(Ke=>Ke/ye*100)},hd=()=>{const fe=nt.length>0?nt:kr(u,"users"),ge=fe.map((le,Ne)=>Sl.reduce((Ue,Me)=>{var ye;return Ue+(((ye=pe[Me.id])==null?void 0:ye[Ne])??0)},0)),ve=Math.max(...ge,1);return a.jsxs("div",{className:"space-y-6 min-h-screen h-full mt-5 flex-1 overflow-y-hidden overflow-x-hidden px-0",children:[a.jsx("div",{className:"px-6 overflow-hidden",children:a.jsxs("div",{className:"flex items-center justify-between gap-8 py-4 px-6 bg-white/5 border border-white/10 rounded-none overflow-x-auto relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[a.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:a.jsx(ft,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Users"}),a.jsx("span",{className:"text-white text-lg font-medium",children:Cs?"...":Ma(Ea.users)}),a.jsxs("div",{className:`flex items-center gap-1 ${Ss>=0?"text-green-500":"text-red-500"}`,children:[a.jsx("svg",{className:`w-3 h-3 ${Ss<0?"rotate-180":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:"text-sm font-medium",children:[Math.abs(Ss).toFixed(1),"%"]})]})]})]}),a.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),a.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[a.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:a.jsx(An,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Organizations"}),a.jsx("span",{className:"text-white text-lg font-medium",children:Cs?"...":Ma(Ea.organizations)}),a.jsxs("div",{className:`flex items-center gap-1 ${Qt>=0?"text-green-500":"text-red-500"}`,children:[a.jsx("svg",{className:`w-3 h-3 ${Qt<0?"rotate-180":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:"text-sm font-medium",children:[Math.abs(Qt).toFixed(1),"%"]})]})]})]}),a.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),a.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[a.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:a.jsx(bw,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Sessions"}),a.jsx("span",{className:"text-white text-lg font-medium",children:Cs?"...":Ma(Ea.sessions)}),a.jsxs("div",{className:`flex items-center gap-1 ${Sn>=0?"text-green-500":"text-red-500"}`,children:[a.jsx("svg",{className:`w-3 h-3 ${Sn<0?"rotate-180":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:"text-sm font-medium",children:[Math.abs(Sn).toFixed(1),"%"]})]})]})]}),a.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),a.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[a.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:a.jsx(pw,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Activity Hits"}),a.jsx("span",{className:"text-white text-lg font-medium",children:Cs?"...":Ma(Cf??0)}),a.jsxs("div",{className:`flex items-center gap-1 ${Jo>=0?"text-green-500":"text-red-500"}`,children:[a.jsx("svg",{className:`w-3 h-3 ${Jo<0?"rotate-180":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:"text-sm font-medium",children:[Math.abs(Jo).toFixed(1),"%"]})]})]})]}),a.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),a.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[a.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:a.jsx(ft,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"New Users"}),a.jsx("span",{className:"text-white text-lg font-medium",children:Cs?"...":Ma(i??0)}),a.jsxs("div",{className:`flex items-center gap-1 ${nl>=0?"text-green-500":"text-red-500"}`,children:[a.jsx("svg",{className:`w-3 h-3 ${nl<0?"rotate-180":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:"text-sm font-medium",children:[Math.abs(nl).toFixed(1),"%"]})]})]})]})]})}),a.jsxs("div",{className:"px-6 pb-10 space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-sm text-white uppercase font-light",children:"TOTAL USER"}),a.jsx("div",{className:"flex items-center space-x-1 overflow-x-auto",children:["1D","1W","6M","1Y"].map(le=>a.jsx("button",{onClick:()=>c(le),className:`px-2 py-1 text-xs font-light transition-colors whitespace-nowrap ${l===le?"bg-white/20 text-white border border-white/30":"text-gray-500 hover:text-white"}`,children:le},le))})]}),a.jsxs("div",{className:"flex justify-between items-end mb-6",children:[a.jsx("p",{className:"text-4xl text-white font-light",children:Cs?"...":Ma(Ea.users)}),a.jsxs("div",{className:"flex items-center gap-1 px-2 py-1",children:[a.jsx("svg",{className:`w-3 h-3 ${yt>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:`text-xs font-medium ${yt>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(yt).toFixed(1),"%"]})]})]}),a.jsxs("div",{className:"space-y-2 relative",children:[a.jsxs("div",{className:"h-32 relative",children:[a.jsx("svg",{className:"w-full h-full absolute inset-0",viewBox:"0 0 100 100",preserveAspectRatio:"none",children:a.jsx("defs",{children:a.jsxs("linearGradient",{id:"usersBarGradient",x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[a.jsx("stop",{offset:"0%",style:{stopColor:"rgba(255, 255, 255, 0.3)",stopOpacity:1}}),a.jsx("stop",{offset:"100%",style:{stopColor:"rgba(255, 255, 255, 0.05)",stopOpacity:1}})]})})}),a.jsx("div",{className:"h-32 flex items-end justify-between space-x-1 relative z-10",children:_f(l,"users").map((le,Ne)=>{const Ue=A===Ne;return a.jsx("div",{className:"flex-1 transition-all duration-200 ease-out relative cursor-pointer group",style:{height:`${le}%`,background:"url(#usersBarGradient)"},onMouseEnter:Me=>{const ye=Me.currentTarget.getBoundingClientRect(),Ke=ye.left+ye.width/2,mn=ye.top,nn=150,Da=60,rl=Math.max(nn/2,Math.min(window.innerWidth-nn/2,Ke)),Mr=Math.max(Da+10,Math.min(window.innerHeight-10,mn));E(Ne),_({x:rl,y:Mr})},onMouseLeave:()=>{E(null),_(null)},children:a.jsx("div",{className:"w-full h-full",style:{background:"linear-gradient(to bottom, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.05))",opacity:Ue?1:.8}})},Ne)})}),A!==null&&D&&a.jsx("div",{className:"fixed z-50 pointer-events-none transition-all duration-200 ease-out animate-in fade-in",style:{left:`${D.x}px`,top:`${D.y}px`,transform:"translate(-50%, -100%)",maxWidth:"calc(100vw - 20px)"},children:a.jsxs("div",{className:"bg-black border border-white/20 rounded-sm px-3 py-2 shadow-lg whitespace-nowrap",children:[a.jsx("div",{className:"text-xs text-gray-400 mb-1 font-mono uppercase",children:Df(l,"users")[A]}),a.jsxs("div",{className:"text-sm text-white font-sans font-medium",children:[Oe[A]!==void 0?Oe[A].toLocaleString():"0"," ",a.jsx("span",{className:"font-mono text-xs text-gray-400",children:"users"})]})]})})]}),a.jsx("div",{className:`flex justify-between ${l==="1M"?"text-[10px]":"text-xs"} text-gray-500 font-mono`,children:kr(l,"users").map((le,Ne)=>a.jsx("span",{className:"flex-1 text-center truncate",children:le},Ne))})]})]}),a.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm text-white uppercase font-light",children:"Activity Hits"}),a.jsx("p",{className:"text-4xl text-white font-light mt-1",children:Qe?"...":Ta(ld)}),a.jsx("p",{className:"text-xs text-gray-400",children:"Tracked events in selected period"})]}),a.jsx("div",{className:"flex items-center space-x-1 overflow-x-auto",children:["1D","1W","1M","3M","6M","1Y","ALL"].map(le=>a.jsx("button",{onClick:()=>h(le),className:`px-2 py-1 text-xs font-light transition-colors whitespace-nowrap ${u===le?"bg-white/20 text-white border border-white/30":"text-gray-500 hover:text-white"}`,children:le},le))})]}),a.jsxs("div",{className:"space-y-2 relative",children:[a.jsx("div",{className:"h-40 flex items-end gap-1",children:fe.map((le,Ne)=>{const Ue=ge[Ne]||0;return a.jsx("div",{className:"flex-1 flex flex-col justify-end gap-[1px] h-full cursor-pointer",onMouseEnter:Me=>Mf(Me,Ne),onMouseLeave:()=>{R(null),W(null)},children:Sl.map(Me=>{var mn;const ye=((mn=pe[Me.id])==null?void 0:mn[Ne])??0,Ke=Ue===0||ve===0?0:Math.max(ye/ve*100,ye>0?4:0);return a.jsx("div",{className:`w-full ${Me.barClass}`,style:{height:`${Ke}%`}},`${Me.id}-${Ne}`)})},`${le}-${Ne}`)})}),Qe&&a.jsx("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm flex items-center justify-center text-xs uppercase text-gray-400 pointer-events-none",children:"Loading activity..."}),I!==null&&P&&a.jsx("div",{className:"fixed z-50 pointer-events-none transition-all duration-200 ease-out animate-in fade-in",style:{left:`${P.x}px`,top:`${P.y}px`,transform:"translate(-50%, -100%)",maxWidth:"calc(100vw - 20px)"},children:a.jsxs("div",{className:"bg-black border border-white/20 rounded-sm px-3 py-2 shadow-lg min-w-[180px]",children:[a.jsx("div",{className:"text-xs text-gray-400 mb-2 font-mono uppercase",children:fe[I]||`Bucket ${I+1}`}),a.jsx("div",{className:"space-y-1",children:Sl.map(le=>{var Ne;return a.jsxs("div",{className:"flex items-center justify-between text-sm",children:[a.jsxs("div",{className:"flex items-center gap-2 text-gray-300",children:[a.jsx("span",{className:`w-2 h-2 rounded-sm ${le.dotClass}`}),le.label]}),a.jsx("span",{className:"text-white font-medium",children:((Ne=pe[le.id])==null?void 0:Ne[I])??0})]},le.id)})})]})}),a.jsx("div",{className:`flex justify-between ${u==="1M"?"text-[10px]":"text-xs"} text-gray-500 font-mono`,children:fe.map((le,Ne)=>a.jsx("span",{className:"flex-1 text-center truncate",children:le},Ne))}),a.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-5 gap-3 mt-4 pt-4 border-t border-white/10",children:Sl.map(le=>a.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-400",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:`w-2 h-2 rounded-sm ${le.dotClass}`}),le.label]}),a.jsx("span",{className:"text-white font-medium",children:Qe?"...":Ta(sl[le.id]||0)})]},le.id))})]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[a.jsxs("div",{className:"space-y-4 overflow-x-hidden",children:[a.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pb-2 relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsxs("div",{className:"flex items-center justify-between mb-2 relative -mt-2 pb-1",children:[a.jsxs("div",{className:"relative",children:[a.jsxs("button",{onClick:()=>T(!C),className:"text-xs h-full font-mono uppercase text-gray-400 flex items-center space-x-1 hover:text-white transition-colors",children:[a.jsx(qd,{className:"w-3 h-3"}),a.jsx("span",{children:v})]}),C&&a.jsx("div",{className:"absolute top-6 left-0 w-[150px] z-10 bg-black border border-white/10 rounded-none shadow-lg",children:Si.map(le=>a.jsx("button",{onClick:()=>{j(le),T(!1)},className:"block border-b border-dashed border-white/5 w-full text-left px-4 py-2 text-xs text-white hover:bg-white/10 transition-colors whitespace-nowrap",children:le},le))})]}),v==="Custom"&&a.jsxs("div",{className:"h-0 flex items-center gap-2",children:[a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(F,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(ls,{className:"mr-1 h-3 w-3"}),q?Zn(q,"MMM dd yyyy"):"From"]})}),a.jsx(Dn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:q,onSelect:ee,initialFocus:!0,className:"rounded-none"})})]}),a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(F,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(ls,{className:"mr-1 h-3 w-3"}),ne?Zn(ne,"MMM dd yyyy"):"To"]})}),a.jsx(Dn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:ne,onSelect:Z,initialFocus:!0,disabled:le=>q?le<q:!1,className:"rounded-none"})})]})]})]}),a.jsx("hr",{className:"mb-2 -mx-10 border-white/10"}),a.jsx("h4",{className:"text-md text-white/80 uppercase font-mono font-light mb-1",children:"Active Users"}),a.jsx("p",{className:"text-xs text-gray-400 mb-3",children:"Users with active session in the time frame"}),a.jsxs("div",{className:"flex pt-4 justify-between items-end",children:[a.jsx("p",{className:"text-3xl text-white font-light",children:Ta(s)}),a.jsx("div",{className:"mt-2 mb-1 flex items-center gap-2",children:a.jsxs("div",{className:"flex items-center -mr-5 gap-1 px-2 py-1 border-white/5 rounded-none",children:[a.jsx("svg",{className:`w-3 h-3 ${me>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:`text-xs font-medium ${me>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(me).toFixed(1),"%"]})]})})]})]}),a.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pb-2 relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsxs("div",{className:"flex items-center justify-between mb-2 relative -mt-2 pb-1",children:[a.jsxs("div",{className:"relative",children:[a.jsxs("button",{onClick:()=>H(!O),className:"text-xs h-full font-mono uppercase text-gray-400 flex items-center space-x-1 hover:text-white transition-colors",children:[a.jsx(qd,{className:"w-3 h-3"}),a.jsx("span",{children:g})]}),O&&a.jsx("div",{className:"absolute top-6 left-0 w-[150px] z-10 bg-black border border-white/10 rounded-none shadow-lg",children:Si.map(le=>a.jsx("button",{onClick:()=>{b(le),H(!1)},className:"block border-b border-dashed border-white/5 w-full text-left px-4 py-2 text-xs text-white hover:bg-white/10 transition-colors whitespace-nowrap",children:le},le))})]}),g==="Custom"&&a.jsxs("div",{className:"h-0 flex items-center gap-2",children:[a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(F,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(ls,{className:"mr-1 h-3 w-3"}),se?Zn(se,"MMM dd yyyy"):"From"]})}),a.jsx(Dn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:se,onSelect:xe,initialFocus:!0,className:"rounded-none"})})]}),a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(F,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(ls,{className:"mr-1 h-3 w-3"}),ae?Zn(ae,"MMM dd yyyy"):"To"]})}),a.jsx(Dn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:ae,onSelect:ce,initialFocus:!0,disabled:le=>se?le<se:!1,className:"rounded-none"})})]})]})]}),a.jsx("hr",{className:"mb-2 -mx-10 border-white/10"}),a.jsx("h4",{className:"text-md text-white/80 uppercase font-mono font-light mb-1",children:"New Users"}),a.jsx("p",{className:"text-xs text-gray-400 mb-3",children:"Newly registered Users in the time frame"}),a.jsxs("div",{className:"flex pt-4 justify-between items-end",children:[a.jsx("p",{className:"text-3xl text-white font-light",children:Ta(rd)}),a.jsx("div",{className:"mt-2 mb-1 flex items-center gap-2",children:a.jsxs("div",{className:"flex items-center -mr-5 gap-1 px-2 py-1 rounded-none",children:[a.jsx("svg",{className:`w-3 h-3 ${ji>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",style:ji<0?{transform:"rotate(180deg)"}:{},children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:`text-xs font-medium ${ji>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(ji).toFixed(1),"%"]})]})})]})]})]}),a.jsxs("div",{className:"space-y-4 overflow-x-hidden",children:[a.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pb-2 relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsxs("div",{className:"flex items-center justify-between mb-2 relative -mt-2 pb-1",children:[a.jsxs("div",{className:"relative",children:[a.jsxs("button",{onClick:()=>z(!U),className:"text-xs h-full font-mono uppercase text-gray-400 flex items-center space-x-1 hover:text-white transition-colors",children:[a.jsx(qd,{className:"w-3 h-3"}),a.jsx("span",{children:p})]}),U&&a.jsx("div",{className:"absolute top-6 left-0 w-[150px] z-10 bg-black border border-white/10 rounded-none shadow-lg",children:Si.map(le=>a.jsx("button",{onClick:()=>{w(le),z(!1)},className:"block border-b border-dashed border-white/5 w-full text-left px-4 py-2 text-xs text-white hover:bg-white/10 transition-colors whitespace-nowrap",children:le},le))})]}),p==="Custom"&&a.jsxs("div",{className:"h-0 flex items-center gap-2",children:[a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(F,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(ls,{className:"mr-1 h-3 w-3"}),de?Zn(de,"MMM dd yyyy"):"From"]})}),a.jsx(Dn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:de,onSelect:Se,initialFocus:!0,className:"rounded-none"})})]}),a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(F,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(ls,{className:"mr-1 h-3 w-3"}),Ee?Zn(Ee,"MMM dd yyyy"):"To"]})}),a.jsx(Dn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:Ee,onSelect:Ae,initialFocus:!0,disabled:le=>de?le<de:!1,className:"rounded-none"})})]})]})]}),a.jsx("hr",{className:"mb-2 -mx-10 border-white/10"}),a.jsx("h4",{className:"text-md text-white/80 uppercase font-mono font-light mb-1",children:"Organizations"}),a.jsx("p",{className:"text-xs text-gray-400 mb-3",children:"Total organizations in the time frame"}),a.jsxs("div",{className:"flex pt-4 justify-between items-end",children:[a.jsx("p",{className:"text-3xl text-white font-light",children:ke?"...":Ta(_e)}),a.jsx("div",{className:"mt-2 mb-1 flex items-center gap-2",children:a.jsxs("div",{className:"flex items-center -mr-5 gap-1 px-2 py-1 rounded-none",children:[a.jsx("svg",{className:`w-3 h-3 ${ie>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:`text-xs font-medium ${ie>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(ie).toFixed(1),"%"]})]})})]})]}),a.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pb-2 relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsxs("div",{className:"flex items-center justify-between mb-2 relative -mt-2 pb-1",children:[a.jsxs("div",{className:"relative",children:[a.jsxs("button",{onClick:()=>k(!Y),className:"text-xs h-full font-mono uppercase text-gray-400 flex items-center space-x-1 hover:text-white transition-colors",children:[a.jsx(qd,{className:"w-3 h-3"}),a.jsx("span",{children:N})]}),Y&&a.jsx("div",{className:"absolute top-6 left-0 w-[150px] z-10 bg-black border border-white/10 rounded-none shadow-lg",children:Si.map(le=>a.jsx("button",{onClick:()=>{S(le),k(!1)},className:"block border-b border-dashed border-white/5 w-full text-left px-4 py-2 text-xs text-white hover:bg-white/10 transition-colors whitespace-nowrap",children:le},le))})]}),N==="Custom"&&a.jsxs("div",{className:"h-0 flex items-center gap-2",children:[a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(F,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(ls,{className:"mr-1 h-3 w-3"}),He?Zn(He,"MMM dd yyyy"):"From"]})}),a.jsx(Dn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:He,onSelect:J,initialFocus:!0,className:"rounded-none"})})]}),a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(F,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(ls,{className:"mr-1 h-3 w-3"}),oe?Zn(oe,"MMM dd yyyy"):"To"]})}),a.jsx(Dn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:oe,onSelect:be,initialFocus:!0,disabled:le=>He?le<He:!1,className:"rounded-none"})})]})]})]}),a.jsx("hr",{className:"mb-2 -mx-10 border-white/10"}),a.jsx("h4",{className:"text-md text-white/80 uppercase font-mono font-light mb-1",children:"Teams"}),a.jsx("p",{className:"text-xs text-gray-400 mb-3",children:"Total teams in the time frame"}),a.jsxs("div",{className:"flex pt-4 justify-between items-end",children:[a.jsx("p",{className:"text-3xl text-white font-light",children:X?"...":Ta(je)}),a.jsx("div",{className:"mt-2 mb-1 flex items-center gap-2",children:a.jsxs("div",{className:"flex items-center -mr-5 gap-1 px-2 py-1 rounded-none",children:[a.jsx("svg",{className:`w-3 h-3 ${he>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:`text-xs font-medium ${he>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(he).toFixed(1),"%"]})]})})]})]})]}),a.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pt-4 overflow-hidden relative rounded-none flex flex-col",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(kn,{className:"w-4 h-4 text-white/60"}),a.jsx("h4",{className:"text-xs text-gray-400 uppercase font-mono font-light",children:"Security Insights"})]})}),a.jsx("hr",{className:"-mx-10 -mt-1 border-white/10"}),a.jsxs("div",{className:"space-y-3 overflow-y-auto custom-scrollbar max-h-[400px]",children:[cd.length===0&&a.jsx("div",{className:"text-sm flex items-center justify-center text-gray-400",children:a.jsxs("div",{className:"flex mt-5 items-center justify-center",children:[a.jsx(kn,{className:"w-4 h-4 text-gray-400 mr-2"}),a.jsx("p",{className:"text-center",children:"No security insights found"})]})}),cd.map((le,Ne)=>a.jsx("div",{onClick:()=>Tf(le),className:"group py-2 border-b border-white/5 cursor-pointer transition-all duration-200 hover:border-white/20",style:{animation:`slideIn 0.3s ease-out ${Ne*.1}s both`},children:a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"flex items-center gap-2 mb-1.5",children:a.jsx("span",{className:"text-sm text-white/90 font-light truncate group-hover:text-white transition-colors",children:le.title})}),a.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[a.jsx("span",{className:`text-[9px] px-1.5 py-0.5 border rounded-sm uppercase font-mono ${dd(le.severity)}`,children:le.severity}),a.jsx("span",{className:`text-[9px] px-1.5 py-0.5 border rounded-sm capitalize font-mono ${ud(le.status)}`,children:le.status})]})]}),a.jsx(eR,{className:"w-3.5 h-3.5 text-gray-500 group-hover:text-white transition-all flex-shrink-0 mt-0.5"})]})},le.id))]})]})]})]})]})};return a.jsxs("div",{className:"h-screen bg-black text-white overflow-hidden flex flex-col",style:{overflowX:"hidden"},children:[a.jsx("div",{className:"flex-1 overflow-hidden",children:e==="overview"?hd():e==="users"?a.jsx(eE,{}):e==="organizations"?a.jsx(JC,{}):hd()}),t&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-3xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(bw,{className:"w-6 h-6 text-white"}),a.jsx("h3",{className:"text-lg text-white font-light",children:"Quick Actions"})]}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>n(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Jt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("button",{onClick:()=>{n(!1),ka("/users")},className:"flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none hover:bg-black/50 transition-colors text-left group",children:[a.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:a.jsx(ft,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-white font-light mb-1",children:"View All Users"}),a.jsx("p",{className:"text-sm text-gray-400",children:"Manage user accounts"})]}),a.jsx(Fa,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),a.jsxs("button",{onClick:()=>{n(!1),ka("/organizations")},className:"flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none hover:bg-black/50 transition-colors text-left group",children:[a.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:a.jsx(An,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-white font-light mb-1",children:"View Organizations"}),a.jsx("p",{className:"text-sm text-gray-400",children:"Manage organizations"})]}),a.jsx(Fa,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),a.jsxs("button",{onClick:()=>{n(!1),ka("/sessions")},className:"flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none hover:bg-black/50 transition-colors text-left group",children:[a.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:a.jsx(pw,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-white font-light mb-1",children:"View Sessions"}),a.jsx("p",{className:"text-sm text-gray-400",children:"Monitor active sessions"})]}),a.jsx(Fa,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),a.jsxs("button",{onClick:()=>{n(!1),ka("/database")},className:"flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none hover:bg-black/50 transition-colors text-left group",children:[a.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:a.jsx(fa,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-white font-light mb-1",children:"Database Schema"}),a.jsx("p",{className:"text-sm text-gray-400",children:"View schema visualizer"})]}),a.jsx(Fa,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),a.jsxs("button",{onClick:()=>{n(!1),ka("/settings")},className:"flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none hover:bg-black/50 transition-colors text-left group",children:[a.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:a.jsx(WC,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-white font-light mb-1",children:"Settings"}),a.jsx("p",{className:"text-sm text-gray-400",children:"Configure system"})]}),a.jsx(Fa,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),a.jsxs("button",{onClick:()=>{n(!1),ka("/users")},className:"flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none hover:bg-black/50 transition-colors text-left group",children:[a.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:a.jsx(FC,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-white font-light mb-1",children:"Search Users"}),a.jsx("p",{className:"text-sm text-gray-400",children:"Find specific users"})]}),a.jsx(Fa,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]})]}),a.jsx("div",{className:"mt-6 pt-6 border-t border-dashed border-white/10",children:a.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-400",children:[a.jsx("span",{children:"Tip: Press Ctrl+K or Cmd+K for command palette"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>n(!1),className:"text-gray-400 hover:text-white rounded-none",children:"Close"})]})})]})}),x&&d&&a.jsx("div",{className:"fixed inset-0 bg-black/80 backdrop-blur-sm z-50 flex items-center justify-center p-4",style:{animation:"fadeIn 0.3s ease-out"},onClick:al,children:a.jsxs("div",{className:"bg-black border border-white/20 rounded-none max-w-2xl w-full max-h-[80vh] overflow-y-auto",style:{animation:"slideUp 0.3s ease-out"},onClick:fe=>fe.stopPropagation(),children:[a.jsx("div",{className:"sticky top-0 bg-black border-b border-white/10 p-6 z-10",children:a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[a.jsx(kn,{className:"w-6 h-6 text-white"}),a.jsx("h3",{className:"text-xl text-white font-light",children:d.title})]}),a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsxs("span",{className:`text-xs px-2 py-1 border rounded-none uppercase font-medium ${dd(d.severity)}`,children:[d.severity," Severity"]}),a.jsx("span",{className:`text-xs px-2 py-1 border rounded-none capitalize ${ud(d.status)}`,children:d.status}),d.cve&&a.jsx("span",{className:"text-xs text-gray-400 font-mono bg-white/5 px-2 py-1 border border-white/10 rounded-none",children:d.cve})]})]}),a.jsx("button",{onClick:al,className:"p-2 hover:bg-white/10 transition-colors rounded-none",children:a.jsx(Jt,{className:"w-5 h-5 text-gray-400 hover:text-white"})})]})}),a.jsxs("div",{className:"p-6 space-y-6",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm text-gray-400 uppercase tracking-wide mb-2",children:"Release Date"}),a.jsx("p",{className:"text-white",children:new Date(d.date).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm text-gray-400 uppercase tracking-wide mb-2",children:"Description"}),d.description.includes("npm install")?a.jsxs("div",{children:[a.jsx("p",{className:"text-white leading-relaxed mb-3",children:d.description.split("Run:")[0]}),a.jsx("div",{className:"relative group",children:a.jsx("div",{className:"bg-black border border-white/20 rounded-none p-3 font-mono text-sm",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("code",{children:[a.jsx("span",{className:"text-green-400",children:"$"})," ",a.jsx("span",{className:"text-cyan-400",children:"npm"})," ",a.jsx("span",{className:"text-yellow-400",children:"install"})," ",a.jsx("span",{className:"text-white",children:"better-auth@latest"})]}),a.jsx("button",{onClick:()=>{navigator.clipboard.writeText("npm install better-auth@latest"),B.success("Command copied to clipboard")},className:"opacity-0 group-hover:opacity-100 transition-opacity p-1 hover:bg-white/10 rounded",title:"Copy command",children:a.jsx(yu,{className:"w-4 h-4 text-gray-400 hover:text-white"})})]})})})]}):a.jsx("p",{className:"text-white leading-relaxed",children:d.description})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm text-gray-400 uppercase tracking-wide mb-3",children:"Affected Components"}),a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:d.affectedComponents.map((fe,ge)=>a.jsxs("div",{className:"flex items-center gap-2 p-3 bg-white/5 border border-white/10 rounded-none",style:{animation:`slideIn 0.3s ease-out ${ge*.1}s both`},children:[a.jsx("div",{className:"w-2 h-2 bg-white rounded-none flex-shrink-0"}),a.jsx("span",{className:"text-sm text-white",children:fe})]},ge))})]}),a.jsx("div",{className:"p-4 bg-white/5 border border-white/10 rounded-none",children:a.jsxs("div",{className:"flex items-start gap-3",children:[d.status==="applied"&&a.jsxs(a.Fragment,{children:[a.jsx(E0,{className:"w-5 h-5 text-white flex-shrink-0 mt-0.5"}),a.jsxs("div",{children:[a.jsx("h5",{className:"text-sm text-white font-medium mb-1",children:"Patch Applied"}),a.jsx("p",{className:"text-xs text-gray-400",children:"This security patch has been successfully applied to your system."})]})]}),d.status==="scheduled"&&a.jsxs(a.Fragment,{children:[a.jsx(IC,{className:"w-5 h-5 text-white flex-shrink-0 mt-0.5"}),a.jsxs("div",{children:[a.jsx("h5",{className:"text-sm text-white font-medium mb-1",children:"Scheduled"}),a.jsx("p",{className:"text-xs text-gray-400",children:"This patch is scheduled for deployment in the next maintenance window."})]})]}),d.status==="pending"&&a.jsxs(a.Fragment,{children:[a.jsx(_B,{className:"w-5 h-5 text-white flex-shrink-0 mt-0.5"}),a.jsxs("div",{children:[a.jsx("h5",{className:"text-sm text-white font-medium mb-1",children:"Action Required"}),a.jsx("p",{className:"text-xs text-gray-400",children:"This patch is pending review and requires manual approval before deployment."})]})]})]})}),a.jsx("div",{className:"flex items-center justify-end gap-3 pt-4 border-t border-white/10",children:a.jsx(F,{variant:"ghost",onClick:al,className:"text-gray-400 hover:text-white rounded-none",children:"Close"})})]})]})}),a.jsx("style",{children:`
454
+ `),he=new Blob([ue],{type:"text/csv;charset=utf-8;"}),Be=document.createElement("a"),_e=URL.createObjectURL(he);Be.setAttribute("href",_e),Be.setAttribute("download",`users-export-${new Date().toISOString().split("T")[0]}.csv`),Be.style.visibility="hidden",document.body.appendChild(Be),Be.click(),document.body.removeChild(Be),B.success(`Exported ${s.length} users to CSV`)},Oe=L=>{u.some(ue=>ue.type===L)||(h(ue=>[...ue,{type:L}]),f(1))},we=L=>{h(ie=>ie.filter(ue=>ue.type!==L)),f(1)},Ce=(L,ie)=>{h(ue=>ue.map(he=>he.type===L?{...he,value:ie}:he))},st=(L,ie)=>{h(ue=>ue.map(he=>he.type===L?{...he,dateRange:ie}:he))},yt=s.filter(L=>{const ie=L.name.toLowerCase().includes(l.toLowerCase())||L.email.toLowerCase().includes(l.toLowerCase());if(u.length===0)return ie;const ue=u.every(he=>{var Be,_e,Re,je,Ve;switch(he.type){case"emailVerified":return he.value===void 0?!0:L.emailVerified===(he.value==="true");case"banned":return he.value===void 0?!0:L.banned===(he.value==="true");case"active":return L.banned!==!0;case"createdAt":{if(!((Be=he.dateRange)!=null&&Be.from)&&!((_e=he.dateRange)!=null&&_e.to))return!0;const ke=new Date(L.createdAt);return!((Re=he.dateRange)!=null&&Re.from&&he.dateRange.from>ke||(je=he.dateRange)!=null&&je.to&&he.dateRange.to<ke)}case"role":return he.value?(Ve=L.role)==null?void 0:Ve.toLowerCase().includes(he.value.toLowerCase()):!0;default:return!0}});return ie&&ue}),wt=s.filter(L=>L.banned).length,Lt=Math.ceil(yt.length/x),K=(d-1)*x,V=K+x,te=yt.slice(K,V),me=L=>{f(L)};return i?a.jsx("div",{className:"flex min-h-screen items-center justify-center h-full",children:a.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[a.jsx(Vs,{className:"w-6 h-6 text-white animate-spin"}),a.jsx("div",{className:"text-white text-sm",children:"Loading users..."})]})}):a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl relative text-white font-light inline-flex items-start",children:["Users",a.jsx("sup",{className:"text-xs text-gray-500 ml-1 mt-0 inline-flex items-baseline",children:a.jsx(xs,{value:t.users??0,className:"text-white font-mono text-sm",prefix:a.jsx("span",{className:"mr-1 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-1 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]}),a.jsx("p",{className:"text-gray-400 font-light text-sm mt-1 uppercase font-mono",children:"Manage your application users"}),a.jsx("div",{className:"flex items-center space-x-4 mt-2",children:wt>0&&a.jsxs("span",{className:"text-sm text-red-400 flex items-center space-x-1",children:[a.jsx(Pd,{className:"w-3 h-3"}),a.jsxs("span",{children:[wt," Banned"]})]})})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(F,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",onClick:be,children:[a.jsx(DS,{className:"w-4 h-4 mr-2"}),"Export CSV"]}),a.jsxs(F,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",onClick:()=>C(!0),children:[a.jsx(Nt,{className:"w-4 h-4 mr-2"}),"Seed"]}),a.jsxs(F,{className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",onClick:()=>v(!0),children:[a.jsx(gg,{className:"w-4 h-4 mr-2"}),"Add User"]})]})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsxs("div",{className:"flex-1 relative",children:[a.jsx(oi,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx(Fe,{placeholder:"Search users...",value:l,onChange:L=>c(L.target.value),className:"pl-10 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx("div",{className:"flex items-center space-x-2",children:a.jsxs(Zr,{value:"",onValueChange:Oe,children:[a.jsx(Qr,{className:"w-[180px]",children:a.jsxs("div",{className:"flex mr-3 items-center space-x-2",children:[a.jsx(ur,{className:"w-4 h-4"}),a.jsx("span",{children:"Add Filter"})]})}),a.jsxs(Kr,{children:[!u.some(L=>L.type==="emailVerified")&&a.jsx(yn,{value:"emailVerified",children:"Email Verified"}),!u.some(L=>L.type==="banned")&&a.jsx(yn,{value:"banned",children:"Banned Status"}),!u.some(L=>L.type==="createdAt")&&a.jsx(yn,{value:"createdAt",children:"Created Date"}),!u.some(L=>L.type==="role")&&a.jsx(yn,{value:"role",children:"Role"})]})]})}),u.length>0&&a.jsx("div",{className:"flex items-center space-x-2",children:a.jsx(F,{onClick:()=>h([]),className:"",children:"Clear all"})})]}),u.length>0&&a.jsx("div",{className:"space-y-3",children:a.jsx("div",{className:"flex flex-wrap gap-3",children:u.map(L=>{var ie,ue,he,Be;return a.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-2 bg-white/10 border border-white/20 rounded-sm",children:[a.jsx(e0,{className:"w-3 h-3 text-white"}),L.type==="emailVerified"&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm text-white",children:"Email Verified:"}),a.jsxs(Zr,{value:L.value||"",onValueChange:_e=>Ce("emailVerified",_e),children:[a.jsx(Qr,{className:"h-7 w-24 text-xs",children:a.jsx("span",{children:L.value==="true"?"True":L.value==="false"?"False":"Select"})}),a.jsxs(Kr,{children:[a.jsx(yn,{value:"true",children:"True"}),a.jsx(yn,{value:"false",children:"False"})]})]})]}),L.type==="banned"&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm text-white",children:"Banned:"}),a.jsxs(Zr,{value:L.value||"",onValueChange:_e=>Ce("banned",_e),children:[a.jsx(Qr,{className:"h-7 w-24 text-xs",children:a.jsx("span",{children:L.value==="true"?"Yes":L.value==="false"?"No":"Select"})}),a.jsxs(Kr,{children:[a.jsx(yn,{value:"true",children:"Yes"}),a.jsx(yn,{value:"false",children:"No"})]})]})]}),L.type==="createdAt"&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm text-white",children:"Created:"}),a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(F,{variant:"outline",className:"h-8 px-3 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(dh,{className:"mr-1 h-3 w-3"}),(ie=L.dateRange)!=null&&ie.from?Zn(L.dateRange.from,"MMM dd yyyy"):"From"]})}),a.jsx(Dn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:(ue=L.dateRange)==null?void 0:ue.from,onSelect:_e=>{var Re;return st("createdAt",{from:_e,to:(Re=L.dateRange)==null?void 0:Re.to})},initialFocus:!0,className:"rounded-none"})})]}),a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(F,{variant:"outline",className:"h-8 px-3 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(dh,{className:"mr-1 h-3 w-3"}),(he=L.dateRange)!=null&&he.to?Zn(L.dateRange.to,"MMM dd yyyy"):"To"]})}),a.jsx(Dn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:(Be=L.dateRange)==null?void 0:Be.to,onSelect:_e=>{var Re;return st("createdAt",{from:(Re=L.dateRange)==null?void 0:Re.from,to:_e})},initialFocus:!0,disabled:_e=>{var Re;return(Re=L.dateRange)!=null&&Re.from?_e<L.dateRange.from:!1},className:"rounded-none"})})]})]}),L.type==="role"&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm text-white",children:"Role:"}),a.jsx(Fe,{type:"text",value:L.value||"",onChange:_e=>Ce("role",_e.target.value),className:"h-7 w-32 text-xs bg-black border-white/20 text-white",placeholder:"Enter role..."})]}),a.jsx("button",{onClick:()=>we(L.type),className:"ml-1 hover:bg-white/20 rounded-full p-0.5",children:a.jsx(Wt,{className:"w-3 h-3 text-white"})})]},L.type)})})})]}),a.jsxs("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:[a.jsx("div",{className:"overflow-x-auto overflow-y-hidden",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"User"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Email Status"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Created"}),a.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),a.jsx("tbody",{children:te.length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:4,className:"py-12 px-4 text-center",children:a.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[a.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(li,{className:"w-8 h-8 text-white/50"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-white font-medium text-lg",children:"No users found"}),a.jsx("p",{className:"text-gray-400 text-sm mt-1",children:l||u.length>0?"Try adjusting your search or filter criteria":"Get started by creating your first user or seeding some data"})]}),!l&&u.length===0&&a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(F,{onClick:()=>v(!0),className:"bg-white text-black hover:bg-gray-200 rounded-none",children:[a.jsx(gg,{className:"w-4 h-4 mr-2"}),"Create User"]}),a.jsxs(F,{onClick:()=>C(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[a.jsx(Nt,{className:"w-4 h-4 mr-2"}),"Seed Data"]})]})]})})}):te.map(L=>a.jsxs("tr",{className:`border-b border-dashed hover:bg-white/5 cursor-pointer ${L.banned?"border-red-500/30 bg-red-500/5":"border-white/5"}`,onClick:()=>e(`/users/${L.id}`),children:[a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"relative",children:[a.jsx("img",{src:L.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${L.id}`,alt:L.name,className:`w-10 h-10 rounded-none border border-dashed ${L.banned?"border-red-400/50 opacity-60":"border-white/20"}`}),L.banned&&a.jsx("div",{className:"absolute -top-1 -right-1 bg-red-500 rounded-full p-0.5",children:a.jsx(Pd,{className:"w-3 h-3 text-white"})})]}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"text-white font-light",children:L.name}),L.banned&&a.jsx("span",{className:"px-2 py-0.5 text-[10px] font-semibold bg-red-500/20 border border-red-500/50 text-red-400 rounded-sm uppercase tracking-wide",children:"Banned"})]}),a.jsx("div",{className:"text-sm text-gray-400 mt-0.5",children:L.email})]})]})}),a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[L.emailVerified?a.jsx(fg,{className:"w-4 h-4 text-green-400"}):a.jsx(uh,{className:"w-4 h-4 text-yellow-400"}),a.jsx("span",{className:"text-sm text-gray-400",children:L.emailVerified?"Verified":"Not Verified"})]})}),a.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:a.jsxs("div",{className:"flex flex-col",children:[new Date(L.createdAt).toLocaleDateString(),a.jsx("p",{className:"text-xs",children:new Date(L.createdAt).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})})]})}),a.jsx("td",{className:"py-4 px-4 text-right",children:a.jsxs("div",{className:"relative flex items-center justify-end",children:[a.jsx(F,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:ie=>{ie.stopPropagation(),A(M===L.id?null:L.id)},children:a.jsx(cR,{className:"w-4 h-4"})}),M===L.id&&a.jsxs("div",{className:"absolute z-[999] right-0 top-full mt-1 w-48 bg-black border border-white/20 rounded-none shadow-lg",onClick:ie=>ie.stopPropagation(),children:[a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-white hover:bg-white/10 flex items-center space-x-2",onClick:ie=>{ie.stopPropagation(),A(null),ae(L)},children:[a.jsx(Xo,{className:"w-4 h-4"}),a.jsx("span",{children:"View"})]}),a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-white hover:bg-white/10 flex items-center space-x-2",onClick:ie=>{ie.stopPropagation(),A(null),ce(L)},children:[a.jsx(ii,{className:"w-4 h-4"}),a.jsx("span",{children:"Edit User"})]}),a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-white hover:bg-white/10 flex items-center space-x-2",onClick:ie=>{ie.stopPropagation(),A(null),$(L),Y(!0)},children:[a.jsx(kn,{className:"w-4 h-4"}),a.jsx("span",{children:"Update Password"})]}),R&&(L.banned?a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-green-400 hover:bg-white/10 flex items-center space-x-2",onClick:ie=>{ie.stopPropagation(),$(L),U(!0),A(null)},children:[a.jsx(Pd,{className:"w-4 h-4"}),a.jsx("span",{children:"Unban User"})]}):a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-yellow-400 hover:bg-white/10 flex items-center space-x-2",onClick:ie=>{ie.stopPropagation(),$(L),O(!0),A(null)},children:[a.jsx(Pd,{className:"w-4 h-4"}),a.jsx("span",{children:"Ban User"})]})),a.jsx("div",{className:"border-t border-white/10 my-1"}),a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-red-400 hover:bg-white/10 flex items-center space-x-2",onClick:ie=>{ie.stopPropagation(),A(null),de(L)},children:[a.jsx(t0,{className:"w-4 h-4"}),a.jsx("span",{children:"Delete User"})]})]})]})})]},L.id))})]})}),a.jsx(KC,{currentPage:d,totalPages:Lt,onPageChange:me,totalItems:yt.length,startIndex:K,endIndex:V})]}),S&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"overflow-x-hidden bg-black/90 border border-white/10 p-6 w-full pt-4 max-w-2xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("h3",{className:"text-sm text-white flex items-center justify-center font-light uppercase",children:[a.jsx("span",{className:"text-white/50 mr-2",children:"["}),a.jsx(li,{className:"inline mr-2 w-3 h-3 text-white"}),a.jsx("span",{className:"font-mono text-white/70 uppercase",children:"Seed User"}),a.jsx("span",{className:"text-white/50 ml-2",children:"]"})]}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>C(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Wt,{className:"w-4 h-4"})})]}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed -mt-4 mb-4"}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"flex items-center space-x-2"}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(Xe,{htmlFor:"user-count",className:"text-sm text-gray-400 font-light",children:"Number of users"}),a.jsx(Fe,{id:"user-count",type:"number",min:"1",max:"100",defaultValue:"5",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx(F,{onClick:()=>{var ie;const L=parseInt(((ie=document.getElementById("user-count"))==null?void 0:ie.value)||"5",10);xe(L)},disabled:ee,className:"bg-transparent hover:bg-white/90 bg-white text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:ee?a.jsxs(a.Fragment,{children:[a.jsx(Vs,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Nt,{className:"w-3 h-3 mr-2"}),"Seed Users"]})})]})]}),W.length>0&&a.jsx("div",{className:"mt-6",children:a.jsx(fi,{title:"User Seeding Terminal",lines:W,isRunning:ee,className:"w-full",defaultCollapsed:!0})})]}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed mt-10"}),a.jsx("div",{className:"flex justify-end mt-6 pt-6",children:a.jsx(F,{variant:"outline",onClick:()=>C(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),y&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-white/10 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Create User"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>v(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Wt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"create-name",className:"text-sm text-gray-400 font-light",children:"Name"}),a.jsx(Fe,{id:"create-name",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"create-email",className:"text-sm text-gray-400 font-light",children:"Email"}),a.jsx(Fe,{id:"create-email",type:"email",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"create-password",className:"text-sm text-gray-400 font-light",children:"Password"}),a.jsx(Fe,{id:"create-password",type:"password",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>v(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:Se,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Create"})]})]})}),j&&k&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Edit User"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>g(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Wt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("img",{src:k.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${k.id}`,alt:k.name,className:"w-16 h-16 rounded-none border border-dashed border-white/20"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:k.name}),a.jsx("div",{className:"text-sm text-gray-400",children:k.email})]})]}),a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"edit-name",className:"text-sm text-gray-400 font-light",children:"Name"}),a.jsx(Fe,{id:"edit-name",defaultValue:k.name,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"edit-email",className:"text-sm text-gray-400 font-light",children:"Email"}),a.jsx(Fe,{id:"edit-email",type:"email",defaultValue:k.email,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>g(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:Ee,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),b&&k&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Delete User"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>p(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Wt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("img",{src:k.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${k.id}`,alt:k.name,className:"w-16 h-16 rounded-none border border-dashed border-white/20"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:k.name}),a.jsx("div",{className:"text-sm text-gray-400",children:k.email})]})]}),a.jsx("p",{className:"text-gray-400",children:"Are you sure you want to delete this user? This action cannot be undone."})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>p(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:Ae,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none",children:"Delete"})]})]})}),w&&k&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"User Details"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>N(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Wt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("img",{src:k.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${k.id}`,alt:k.name,className:"w-16 h-16 rounded-none border border-dashed border-white/20"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:k.name}),a.jsx("div",{className:"text-sm text-gray-400",children:k.email})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Rn,{id:k.id,variant:"detail"}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Email Verified:"}),a.jsx("span",{className:"text-white text-sm",children:k.emailVerified?"Yes":"No"})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Created:"}),a.jsx("span",{className:"text-white text-sm",children:new Date(k.createdAt).toLocaleString()})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Updated:"}),a.jsx("span",{className:"text-white text-sm",children:new Date(k.updatedAt).toLocaleString()})]})]})]}),a.jsx("div",{className:"flex justify-end mt-6",children:a.jsx(F,{onClick:()=>N(!1),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Close"})})]})}),T&&k&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-red-400/20 rounded-none p-6 w-full max-w-md",children:[a.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Ban User"}),a.jsxs("p",{className:"text-gray-400 mb-4",children:["Ban ",a.jsx("strong",{children:k.name})," from accessing the system."]}),a.jsxs("div",{className:"space-y-4 mb-6",children:[a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"banReason",className:"text-white",children:"Ban Reason"}),a.jsx(Fe,{id:"banReason",value:E,onChange:L=>D(L.target.value),placeholder:"Enter reason for ban (optional)",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"banExpires",className:"text-white",children:"Ban Duration (seconds)"}),a.jsx(Fe,{id:"banExpires",type:"number",value:_||"",onChange:L=>I(L.target.value?Number(L.target.value):void 0),placeholder:"Leave empty for permanent ban",className:"bg-black border border-dashed border-white/20 text-white rounded-none"}),a.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Examples: 3600 (1 hour), 86400 (1 day), 604800 (1 week)"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-2",children:[a.jsx(F,{variant:"outline",onClick:()=>{O(!1),D(""),I(void 0),$(null)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:He,className:"bg-red-600 text-white hover:bg-red-700 rounded-none",children:"Ban User"})]})]})}),H&&k&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-dashed border-green-400/50 rounded-none p-6 w-full max-w-md",children:[a.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Unban User"}),a.jsxs("p",{className:"text-gray-400 mb-6",children:["Are you sure you want to unban ",a.jsx("strong",{children:k.name}),"? This will restore their access to the system."]}),a.jsxs("div",{className:"flex justify-end space-x-2",children:[a.jsx(F,{variant:"outline",onClick:()=>{U(!1),$(null)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:J,className:"bg-green-600 text-white hover:bg-green-700 rounded-none",children:"Unban User"})]})]})}),z&&k&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Update Password"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>{Y(!1),$(null),document.getElementById("update-password").value=""},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Wt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("img",{src:k.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${k.id}`,alt:k.name,className:"w-16 h-16 rounded-none border border-dashed border-white/20"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:k.name}),a.jsx("div",{className:"text-sm text-gray-400",children:k.email})]})]}),a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"update-password",className:"text-sm text-gray-400 font-light",children:"New Password"}),a.jsx(Fe,{id:"update-password",type:"password",placeholder:"Enter new password",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>{Y(!1),$(null),document.getElementById("update-password").value=""},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:oe,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update Password"})]})]})})]})}const Sl=[{id:"signups",label:"Signups",analyticsKey:"newUsers",barClass:"bg-white/25 border border-white/10",dotClass:"bg-white/25"},{id:"logins",label:"Logins",analyticsKey:"activeUsers",barClass:"bg-white/20 border border-white/10",dotClass:"bg-white/20"},{id:"organizations",label:"Organizations",analyticsKey:"organizations",barClass:"bg-white/15 border border-white/10",dotClass:"bg-white/15"},{id:"teams",label:"Teams",analyticsKey:"teams",barClass:"bg-white/10 border border-white/10",dotClass:"bg-white/10"},{id:"sessions",label:"Sessions",analyticsKey:"sessions",barClass:"bg-white/5 border border-white/10",dotClass:"bg-white/5"}];function JB(){const[e]=m.useState("overview"),[t,n]=m.useState(!1),[s,r]=m.useState(0),[i,o]=m.useState(0),[l,c]=m.useState("1D"),[u,h]=m.useState("1D"),[d,f]=m.useState(null),[x,y]=m.useState(!1),[v,j]=m.useState("Daily"),[g,b]=m.useState("Daily"),[p,w]=m.useState("Daily"),[N,S]=m.useState("Daily"),[C,T]=m.useState(!1),[O,H]=m.useState(!1),[U,z]=m.useState(!1),[Y,k]=m.useState(!1),[$,M]=m.useState(null),[A,E]=m.useState(null),[D,_]=m.useState(null),[I,R]=m.useState(null),[P,W]=m.useState(null),[q,ee]=m.useState(void 0),[ne,Z]=m.useState(void 0),[se,xe]=m.useState(void 0),[ae,ce]=m.useState(void 0),[de,Se]=m.useState(void 0),[Ee,Ae]=m.useState(void 0),[He,J]=m.useState(void 0),[oe,be]=m.useState(void 0),[Oe,we]=m.useState([]),[Ce,st]=m.useState([]),[yt,wt]=m.useState(0),[Lt,K]=m.useState([]),[V,te]=m.useState([]),[me,L]=m.useState(0),[ie,ue]=m.useState(0),[he,Be]=m.useState(0),[_e,Re]=m.useState(0),[je,Ve]=m.useState(0),[ke,Pe]=m.useState(!1),[X,Q]=m.useState(!1),[pe,We]=m.useState({signups:[],logins:[],organizations:[],teams:[],sessions:[]}),[nt,tt]=m.useState([]),[Qe,Zt]=m.useState(!1),[Ss,cn]=m.useState(0),[Qt,yi]=m.useState(0),[Sn,ad]=m.useState(0),[Jo,el]=m.useState(0),[Cf,Ef]=m.useState(0),[Er,tl]=m.useState([]),[rd,wi]=m.useState(0),[ji,Ni]=m.useState(0),[nl,id]=m.useState(0),{counts:Ea,loading:Cs}=vf(),ka=ws(),Si=["Daily","Weekly","Monthly","Yearly","Custom"],od={Daily:"1D",Weekly:"1W",Monthly:"1M",Yearly:"1Y",Custom:"Custom"},kf=m.useMemo(()=>new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}),[]),Ma=fe=>fe==null?"...":kf.format(Number(fe)),Ta=fe=>fe==null?"...":Number(fe).toLocaleString(),sl=m.useMemo(()=>Sl.reduce((fe,ge)=>(fe[ge.id]=(pe[ge.id]||[]).reduce((ve,le)=>ve+le,0),fe),{}),[pe]),ld=m.useMemo(()=>Object.values(sl).reduce((fe,ge)=>fe+ge,0),[sl]),Mf=(fe,ge)=>{const ve=fe.currentTarget.getBoundingClientRect();R(ge),W({x:ve.left+ve.width/2,y:ve.top})},cd=(()=>{const fe=[];return $!=null&&$.isOutdated?fe.push({id:"version-check",title:`Update Better-Auth to v${$.latest}`,severity:"high",date:new Date().toISOString().split("T")[0],description:"Your current version is outdated. Update to the latest version to get the latest security fixes, features, and improvements. Run: `pnpm install better-auth@latest`",affectedComponents:["All Components"],status:"pending",cve:""}):$&&fe.push({id:"version-check",title:"Better-Auth is Up to date",severity:"low",date:new Date().toISOString().split("T")[0],description:"You are running the latest version of better-auth. Great job keeping your dependencies up to date!",affectedComponents:["All Components"],status:"applied",cve:""}),fe.push(),fe.push({id:"3",title:"Rate Limiting Configuration",severity:"medium",date:new Date().toISOString().split("T")[0],description:"Configure rate limiting for authentication endpoints to prevent brute force attacks. Better-auth provides built-in rate limiting middleware.",affectedComponents:["Auth Endpoints"],status:"pending"}),fe})(),gt=m.useCallback(async(fe,ge,ve,le)=>{try{const Ne=new URLSearchParams({type:fe,period:ge});return ve&&Ne.append("from",ve.toISOString()),le&&Ne.append("to",le.toISOString()),await(await fetch(`/api/analytics?${Ne.toString()}`)).json()}catch{return null}},[]);m.useEffect(()=>{(async()=>{try{const ve=await(await fetch("/api/users/all")).json();ve!=null&&ve.success&&ve.users&&tl(ve.users)}catch{tl([])}})()},[]),m.useEffect(()=>{(async()=>{try{const ve=await(await fetch("/api/stats")).json();ve&&r(ve.activeUsers||0)}catch{r(0)}})()},[]),m.useEffect(()=>{(async()=>{const ge=await gt("users",l,q,ne);ge&&(we(ge.data||[]),st(ge.labels||[]),wt(ge.percentageChange||0))})()},[l,q,ne,gt]),m.useEffect(()=>{if(Er.length===0){wi(0),Ni(0);return}const fe=new Date;let ge,ve=fe,le,Ne;if(g==="Custom"){if(!se||!ae){wi(0),Ni(0);return}ge=new Date(se),ve=new Date(ae),ve.setHours(23,59,59,999);const nn=ve.getTime()-ge.getTime();Ne=new Date(ge.getTime()-1),le=new Date(Ne.getTime()-nn)}else switch(g){case"Daily":ge=new Date(fe),ge.setHours(0,0,0,0),Ne=new Date(ge.getTime()-1),le=new Date(Ne.getTime()-24*60*60*1e3);break;case"Weekly":ge=new Date(fe),ge.setDate(fe.getDate()-fe.getDay()),ge.setHours(0,0,0,0),Ne=new Date(ge.getTime()-1),le=new Date(Ne.getTime()-7*24*60*60*1e3);break;case"Monthly":ge=new Date(fe.getFullYear(),fe.getMonth(),1),ge.setHours(0,0,0,0),Ne=new Date(ge.getTime()-1),le=new Date(fe.getFullYear(),fe.getMonth()-1,1),le.setHours(0,0,0,0);break;case"Yearly":ge=new Date(fe.getFullYear(),0,1),ge.setHours(0,0,0,0),Ne=new Date(ge.getTime()-1),le=new Date(fe.getFullYear()-1,0,1),le.setHours(0,0,0,0);break;default:wi(0),Ni(0);return}const Ue=Er.filter(nn=>{if(!nn.createdAt)return!1;const Da=new Date(nn.createdAt);return Da>=ge&&Da<=ve}),Me=Er.filter(nn=>{if(!nn.createdAt)return!1;const Da=new Date(nn.createdAt);return Da>=le&&Da<=Ne}),ye=Ue.length,Ke=Me.length;let mn=0;Ke>0?mn=(ye-Ke)/Ke*100:ye>0&&(mn=100),wi(ye),Ni(mn)},[Er,g,se,ae]),m.useEffect(()=>{(async()=>{if(!(u==="Custom"&&(!se||!ae))){Zt(!0);try{const[ge,ve,le,Ne,Ue]=await Promise.all([gt("newUsers",u,se,ae),gt("activeUsers",u,se,ae),gt("organizations",u,se,ae),gt("teams",u,se,ae),gt("sessions",u,se,ae)]);ge&&(K(ge.data||[]),te(ge.labels||[])),We({signups:(ge==null?void 0:ge.data)||[],logins:(ve==null?void 0:ve.data)||[],organizations:(le==null?void 0:le.data)||[],teams:(Ne==null?void 0:Ne.data)||[],sessions:(Ue==null?void 0:Ue.data)||[]}),tt((ge==null?void 0:ge.labels)||(ve==null?void 0:ve.labels)||(le==null?void 0:le.labels)||(Ne==null?void 0:Ne.labels)||(Ue==null?void 0:Ue.labels)||[])}finally{Zt(!1)}}})()},[u,se,ae,gt]),m.useEffect(()=>{(async()=>{const ge=await gt("activeUsers","1D");ge&&L(ge.percentageChange||0)})()},[gt]),m.useEffect(()=>{},[Ea.organizations,Ea.teams,Cs]),m.useEffect(()=>{(async()=>{const ge=od[p]||"1D",ve=ge==="Custom";if(!(ve&&(!de||!Ee))){Pe(!0);try{const le=await gt("organizations",ge,ve?de:void 0,ve?Ee:void 0);le&&(Re(le.total||0),ue(le.percentageChange||0))}catch{Re(0),ue(0)}finally{Pe(!1)}}})()},[p,de,Ee,gt]),m.useEffect(()=>{(async()=>{const ge=od[N]||"1D",ve=ge==="Custom";if(!(ve&&(!He||!oe))){Q(!0);try{const le=await gt("teams",ge,ve?He:void 0,ve?oe:void 0);le&&(Ve(le.total||0),Be(le.percentageChange||0))}catch{Ve(0),Be(0)}finally{Q(!1)}}})()},[N,He,oe,gt]),m.useEffect(()=>{(async()=>{const ge=await gt("users","1D");ge&&cn(ge.percentageChange||0);const ve=await gt("organizations","1D");ve&&yi(ve.percentageChange||0);const le=await gt("activeUsers","1D");le&&ad(le.percentageChange||0);const[Ne,Ue,Me,ye,Ke]=await Promise.all([gt("newUsers","1D"),gt("activeUsers","1D"),gt("organizations","1D"),gt("teams","1D"),gt("sessions","1D")]);Ne?(o(Ne.total||0),id(Ne.percentageChange||0)):(o(0),id(0));const nn=[(Ne==null?void 0:Ne.total)||0,(Ue==null?void 0:Ue.total)||0,(Me==null?void 0:Me.total)||0,(ye==null?void 0:ye.total)||0,(Ke==null?void 0:Ke.total)||0].reduce((Mr,Af)=>Mr+Af,0);Ef(nn);const rl=[(Ne==null?void 0:Ne.previousTotal)||0,(Ue==null?void 0:Ue.previousTotal)||0,(Me==null?void 0:Me.previousTotal)||0,(ye==null?void 0:ye.previousTotal)||0,(Ke==null?void 0:Ke.previousTotal)||0].reduce((Mr,Af)=>Mr+Af,0);if(rl>0){const Mr=(nn-rl)/rl*100;el(Mr)}else nn>0?el(100):el(0)})()},[gt]),m.useEffect(()=>{(async()=>{try{const ve=await(await fetch("/api/version-check")).json();ve&&M({current:ve.current||"1.0.0",latest:ve.latest||"1.0.0",isOutdated:ve.isOutdated||!1})}catch{try{const Ne=(await(await fetch("/api/package-info")).json()).betterAuthVersion||"1.0.0",Ue="1.5.0";M({current:Ne,latest:Ue,isOutdated:Ne!==Ue})}catch{M({current:"1.0.0",latest:"1.5.0",isOutdated:!0})}}})()},[]);const dd=fe=>{switch(fe){case"critical":return"bg-white/10 text-white border-white/20";case"high":return"bg-white/10 text-white border-white/20";case"medium":return"bg-white/10 text-gray-300 border-white/20";case"low":return"bg-white/10 text-gray-400 border-white/20";default:return"bg-white/10 text-gray-400 border-white/20"}},ud=fe=>{switch(fe){case"applied":return"bg-white/10 text-white border-white/20";case"scheduled":return"bg-white/10 text-gray-300 border-white/20";case"pending":return"bg-white/10 text-gray-400 border-white/20";default:return"bg-white/10 text-gray-400 border-white/20"}},Tf=fe=>{f(fe),y(!0)},al=()=>{y(!1),setTimeout(()=>f(null),300)},kr=(fe,ge="users")=>{const ve=ge==="users"?Ce:V,Ne={"1D":24,"1W":7,"1M":30,"3M":3,"6M":6,"1Y":12,ALL:7}[fe]||7;if(ve&&ve.length>0&&ve.length===Ne)return fe==="1D"?ve.filter((Me,ye)=>ye%4===0).map(Me=>{const ye=parseInt(Me.replace("h",""),10);return ye===0?"12am":ye<12?`${ye}am`:ye===12?"12pm":`${ye-12}pm`}):fe==="1W"?ve.map(Me=>Me.length>3?Me.substring(0,3):Me):fe==="1M"?ve.map(Me=>{const ye=Me.split(" ");return ye.length>=2?ye[1]:Me}):fe==="1Y"||fe==="3M"||fe==="6M"?ve.map(Me=>Me.length>3?Me.substring(0,3):Me):ve.map(Me=>Me.length>3?Me.substring(0,3):Me);const Ue=new Date;switch(fe){case"1D":return["12am","4am","8am","12pm","4pm","8pm"];case"1W":return Array.from({length:7},(Me,ye)=>new Date(Ue.getTime()-(6-ye)*24*60*60*1e3).toLocaleDateString("en-US",{weekday:"short"}));case"1M":return Array.from({length:30},(Me,ye)=>new Date(Ue.getTime()-(29-ye)*24*60*60*1e3).getDate().toString());case"3M":return Array.from({length:3},(Me,ye)=>new Date(Ue.getFullYear(),Ue.getMonth()-(2-ye),1).toLocaleDateString("en-US",{month:"short"}));case"6M":return Array.from({length:6},(Me,ye)=>new Date(Ue.getFullYear(),Ue.getMonth()-(5-ye),1).toLocaleDateString("en-US",{month:"short"}));case"1Y":return Array.from({length:12},(Me,ye)=>new Date(Ue.getFullYear(),Ue.getMonth()-(11-ye),1).toLocaleDateString("en-US",{month:"short"}));case"ALL":return Array.from({length:7},(Me,ye)=>new Date(Ue.getFullYear(),Ue.getMonth()-(6-ye),1).toLocaleDateString("en-US",{month:"short"}));default:return["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]}},Df=(fe,ge="users")=>{const ve=ge==="users"?Ce:V,Ne={"1D":24,"1W":7,"1M":30,"3M":3,"6M":6,"1Y":12,ALL:7}[fe]||7;if(ve&&ve.length>0&&ve.length===Ne)return fe==="1D"?ve.map(Me=>{const ye=parseInt(Me.replace("h",""),10);return ye===0?"12am":ye<12?`${ye}am`:ye===12?"12pm":`${ye-12}pm`}):fe==="1Y"||fe==="3M"||fe==="6M"?ve.map(Me=>{const ye=["January","February","March","April","May","June","July","August","September","October","November","December"],mn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"].indexOf(Me);return mn!==-1?ye[mn]:Me}):ve;const Ue=new Date;switch(fe){case"1D":return Array.from({length:24},(Me,ye)=>{const Ke=new Date;return Ke.setHours(ye,0,0,0),Ke.toLocaleTimeString("en-US",{hour:"numeric",hour12:!0})});case"1W":return Array.from({length:7},(Me,ye)=>new Date(Ue.getTime()-(6-ye)*24*60*60*1e3).toLocaleDateString("en-US",{weekday:"long"}));case"1M":return Array.from({length:30},(Me,ye)=>{const Ke=new Date(Ue.getTime()-(29-ye)*24*60*60*1e3),mn=Ke.toLocaleDateString("en-US",{month:"short"}),nn=Ke.getDate();return`${mn} ${nn}`});case"3M":return Array.from({length:3},(Me,ye)=>new Date(Ue.getFullYear(),Ue.getMonth()-(2-ye),1).toLocaleDateString("en-US",{month:"long"}));case"6M":return Array.from({length:6},(Me,ye)=>new Date(Ue.getFullYear(),Ue.getMonth()-(5-ye),1).toLocaleDateString("en-US",{month:"long"}));case"1Y":return Array.from({length:12},(Me,ye)=>new Date(Ue.getFullYear(),Ue.getMonth()-(11-ye),1).toLocaleDateString("en-US",{month:"long"}));case"ALL":return Array.from({length:7},(Me,ye)=>new Date(Ue.getFullYear(),Ue.getMonth()-(6-ye),1).toLocaleDateString("en-US",{month:"long"}));default:return["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]}},_f=(fe,ge="users")=>{const ve=ge==="users"?Oe:Lt,Ne={"1D":24,"1W":7,"1M":30,"3M":3,"6M":6,"1Y":12,ALL:7}[fe]||7;if(!ve||ve.length===0)return Array(Ne).fill(0);const Ue=[...ve];for(;Ue.length<Ne;)Ue.push(0);const Me=Ue.slice(0,Ne),ye=Math.max(...Me,1);return Me.map(Ke=>Ke/ye*100)},hd=()=>{const fe=nt.length>0?nt:kr(u,"users"),ge=fe.map((le,Ne)=>Sl.reduce((Ue,Me)=>{var ye;return Ue+(((ye=pe[Me.id])==null?void 0:ye[Ne])??0)},0)),ve=Math.max(...ge,1);return a.jsxs("div",{className:"space-y-6 min-h-screen h-full mt-5 flex-1 overflow-y-hidden overflow-x-hidden px-0",children:[a.jsx("div",{className:"px-6 overflow-hidden",children:a.jsxs("div",{className:"flex items-center justify-between gap-8 py-4 px-6 bg-white/5 border border-white/10 rounded-none overflow-x-auto relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[a.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:a.jsx(ft,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Users"}),a.jsx("span",{className:"text-white text-lg font-medium",children:Cs?"...":Ma(Ea.users)}),a.jsxs("div",{className:`flex items-center gap-1 ${Ss>=0?"text-green-500":"text-red-500"}`,children:[a.jsx("svg",{className:`w-3 h-3 ${Ss<0?"rotate-180":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:"text-sm font-medium",children:[Math.abs(Ss).toFixed(1),"%"]})]})]})]}),a.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),a.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[a.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:a.jsx(An,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Organizations"}),a.jsx("span",{className:"text-white text-lg font-medium",children:Cs?"...":Ma(Ea.organizations)}),a.jsxs("div",{className:`flex items-center gap-1 ${Qt>=0?"text-green-500":"text-red-500"}`,children:[a.jsx("svg",{className:`w-3 h-3 ${Qt<0?"rotate-180":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:"text-sm font-medium",children:[Math.abs(Qt).toFixed(1),"%"]})]})]})]}),a.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),a.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[a.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:a.jsx(bw,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Sessions"}),a.jsx("span",{className:"text-white text-lg font-medium",children:Cs?"...":Ma(Ea.sessions)}),a.jsxs("div",{className:`flex items-center gap-1 ${Sn>=0?"text-green-500":"text-red-500"}`,children:[a.jsx("svg",{className:`w-3 h-3 ${Sn<0?"rotate-180":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:"text-sm font-medium",children:[Math.abs(Sn).toFixed(1),"%"]})]})]})]}),a.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),a.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[a.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:a.jsx(pw,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Activity Hits"}),a.jsx("span",{className:"text-white text-lg font-medium",children:Cs?"...":Ma(Cf??0)}),a.jsxs("div",{className:`flex items-center gap-1 ${Jo>=0?"text-green-500":"text-red-500"}`,children:[a.jsx("svg",{className:`w-3 h-3 ${Jo<0?"rotate-180":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:"text-sm font-medium",children:[Math.abs(Jo).toFixed(1),"%"]})]})]})]}),a.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),a.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[a.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:a.jsx(ft,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"New Users"}),a.jsx("span",{className:"text-white text-lg font-medium",children:Cs?"...":Ma(i??0)}),a.jsxs("div",{className:`flex items-center gap-1 ${nl>=0?"text-green-500":"text-red-500"}`,children:[a.jsx("svg",{className:`w-3 h-3 ${nl<0?"rotate-180":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:"text-sm font-medium",children:[Math.abs(nl).toFixed(1),"%"]})]})]})]})]})}),a.jsxs("div",{className:"px-6 pb-10 space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-sm text-white uppercase font-light",children:"TOTAL USER"}),a.jsx("div",{className:"flex items-center space-x-1 overflow-x-auto",children:["1D","1W","6M","1Y"].map(le=>a.jsx("button",{onClick:()=>c(le),className:`px-2 py-1 text-xs font-light transition-colors whitespace-nowrap ${l===le?"bg-white/20 text-white border border-white/30":"text-gray-500 hover:text-white"}`,children:le},le))})]}),a.jsxs("div",{className:"flex justify-between items-end mb-6",children:[a.jsx("p",{className:"text-4xl text-white font-light",children:Cs?"...":Ma(Ea.users)}),a.jsxs("div",{className:"flex items-center gap-1 px-2 py-1",children:[a.jsx("svg",{className:`w-3 h-3 ${yt>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:`text-xs font-medium ${yt>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(yt).toFixed(1),"%"]})]})]}),a.jsxs("div",{className:"space-y-2 relative",children:[a.jsxs("div",{className:"h-32 relative",children:[a.jsx("svg",{className:"w-full h-full absolute inset-0",viewBox:"0 0 100 100",preserveAspectRatio:"none",children:a.jsx("defs",{children:a.jsxs("linearGradient",{id:"usersBarGradient",x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[a.jsx("stop",{offset:"0%",style:{stopColor:"rgba(255, 255, 255, 0.3)",stopOpacity:1}}),a.jsx("stop",{offset:"100%",style:{stopColor:"rgba(255, 255, 255, 0.05)",stopOpacity:1}})]})})}),a.jsx("div",{className:"h-32 flex items-end justify-between space-x-1 relative z-10",children:_f(l,"users").map((le,Ne)=>{const Ue=A===Ne;return a.jsx("div",{className:"flex-1 transition-all duration-200 ease-out relative cursor-pointer group",style:{height:`${le}%`,background:"url(#usersBarGradient)"},onMouseEnter:Me=>{const ye=Me.currentTarget.getBoundingClientRect(),Ke=ye.left+ye.width/2,mn=ye.top,nn=150,Da=60,rl=Math.max(nn/2,Math.min(window.innerWidth-nn/2,Ke)),Mr=Math.max(Da+10,Math.min(window.innerHeight-10,mn));E(Ne),_({x:rl,y:Mr})},onMouseLeave:()=>{E(null),_(null)},children:a.jsx("div",{className:"w-full h-full",style:{background:"linear-gradient(to bottom, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.05))",opacity:Ue?1:.8}})},Ne)})}),A!==null&&D&&a.jsx("div",{className:"fixed z-50 pointer-events-none transition-all duration-200 ease-out animate-in fade-in",style:{left:`${D.x}px`,top:`${D.y}px`,transform:"translate(-50%, -100%)",maxWidth:"calc(100vw - 20px)"},children:a.jsxs("div",{className:"bg-black border border-white/20 rounded-sm px-3 py-2 shadow-lg whitespace-nowrap",children:[a.jsx("div",{className:"text-xs text-gray-400 mb-1 font-mono uppercase",children:Df(l,"users")[A]}),a.jsxs("div",{className:"text-sm text-white font-sans font-medium",children:[Oe[A]!==void 0?Oe[A].toLocaleString():"0"," ",a.jsx("span",{className:"font-mono text-xs text-gray-400",children:"users"})]})]})})]}),a.jsx("div",{className:`flex justify-between ${l==="1M"?"text-[10px]":"text-xs"} text-gray-500 font-mono`,children:kr(l,"users").map((le,Ne)=>a.jsx("span",{className:"flex-1 text-center truncate",children:le},Ne))})]})]}),a.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm text-white uppercase font-light",children:"Activity Hits"}),a.jsx("p",{className:"text-4xl text-white font-light mt-1",children:Qe?"...":Ta(ld)}),a.jsx("p",{className:"text-xs text-gray-400",children:"Tracked events in selected period"})]}),a.jsx("div",{className:"flex items-center space-x-1 overflow-x-auto",children:["1D","1W","1M","3M","6M","1Y","ALL"].map(le=>a.jsx("button",{onClick:()=>h(le),className:`px-2 py-1 text-xs font-light transition-colors whitespace-nowrap ${u===le?"bg-white/20 text-white border border-white/30":"text-gray-500 hover:text-white"}`,children:le},le))})]}),a.jsxs("div",{className:"space-y-2 relative",children:[a.jsx("div",{className:"h-40 flex items-end gap-1",children:fe.map((le,Ne)=>{const Ue=ge[Ne]||0;return a.jsx("div",{className:"flex-1 flex flex-col justify-end gap-[1px] h-full cursor-pointer",onMouseEnter:Me=>Mf(Me,Ne),onMouseLeave:()=>{R(null),W(null)},children:Sl.map(Me=>{var mn;const ye=((mn=pe[Me.id])==null?void 0:mn[Ne])??0,Ke=Ue===0||ve===0?0:Math.max(ye/ve*100,ye>0?4:0);return a.jsx("div",{className:`w-full ${Me.barClass}`,style:{height:`${Ke}%`}},`${Me.id}-${Ne}`)})},`${le}-${Ne}`)})}),Qe&&a.jsx("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm flex items-center justify-center text-xs uppercase text-gray-400 pointer-events-none",children:"Loading activity..."}),I!==null&&P&&a.jsx("div",{className:"fixed z-50 pointer-events-none transition-all duration-200 ease-out animate-in fade-in",style:{left:`${P.x}px`,top:`${P.y}px`,transform:"translate(-50%, -100%)",maxWidth:"calc(100vw - 20px)"},children:a.jsxs("div",{className:"bg-black border border-white/20 rounded-sm px-3 py-2 shadow-lg min-w-[180px]",children:[a.jsx("div",{className:"text-xs text-gray-400 mb-2 font-mono uppercase",children:fe[I]||`Bucket ${I+1}`}),a.jsx("div",{className:"space-y-1",children:Sl.map(le=>{var Ne;return a.jsxs("div",{className:"flex items-center justify-between text-sm",children:[a.jsxs("div",{className:"flex items-center gap-2 text-gray-300",children:[a.jsx("span",{className:`w-2 h-2 rounded-sm ${le.dotClass}`}),le.label]}),a.jsx("span",{className:"text-white font-medium",children:((Ne=pe[le.id])==null?void 0:Ne[I])??0})]},le.id)})})]})}),a.jsx("div",{className:`flex justify-between ${u==="1M"?"text-[10px]":"text-xs"} text-gray-500 font-mono`,children:fe.map((le,Ne)=>a.jsx("span",{className:"flex-1 text-center truncate",children:le},Ne))}),a.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-5 gap-3 mt-4 pt-4 border-t border-white/10",children:Sl.map(le=>a.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-400",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:`w-2 h-2 rounded-sm ${le.dotClass}`}),le.label]}),a.jsx("span",{className:"text-white font-medium",children:Qe?"...":Ta(sl[le.id]||0)})]},le.id))})]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[a.jsxs("div",{className:"space-y-4 overflow-x-hidden",children:[a.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pb-2 relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsxs("div",{className:"flex items-center justify-between mb-2 relative -mt-2 pb-1",children:[a.jsxs("div",{className:"relative",children:[a.jsxs("button",{onClick:()=>T(!C),className:"text-xs h-full font-mono uppercase text-gray-400 flex items-center space-x-1 hover:text-white transition-colors",children:[a.jsx(qd,{className:"w-3 h-3"}),a.jsx("span",{children:v})]}),C&&a.jsx("div",{className:"absolute top-6 left-0 w-[150px] z-10 bg-black border border-white/10 rounded-none shadow-lg",children:Si.map(le=>a.jsx("button",{onClick:()=>{j(le),T(!1)},className:"block border-b border-dashed border-white/5 w-full text-left px-4 py-2 text-xs text-white hover:bg-white/10 transition-colors whitespace-nowrap",children:le},le))})]}),v==="Custom"&&a.jsxs("div",{className:"h-0 flex items-center gap-2",children:[a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(F,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(ls,{className:"mr-1 h-3 w-3"}),q?Zn(q,"MMM dd yyyy"):"From"]})}),a.jsx(Dn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:q,onSelect:ee,initialFocus:!0,className:"rounded-none"})})]}),a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(F,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(ls,{className:"mr-1 h-3 w-3"}),ne?Zn(ne,"MMM dd yyyy"):"To"]})}),a.jsx(Dn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:ne,onSelect:Z,initialFocus:!0,disabled:le=>q?le<q:!1,className:"rounded-none"})})]})]})]}),a.jsx("hr",{className:"mb-2 -mx-10 border-white/10"}),a.jsx("h4",{className:"text-md text-white/80 uppercase font-mono font-light mb-1",children:"Active Users"}),a.jsx("p",{className:"text-xs text-gray-400 mb-3",children:"Users with active session in the time frame"}),a.jsxs("div",{className:"flex pt-4 justify-between items-end",children:[a.jsx("p",{className:"text-3xl text-white font-light",children:Ta(s)}),a.jsx("div",{className:"mt-2 mb-1 flex items-center gap-2",children:a.jsxs("div",{className:"flex items-center -mr-5 gap-1 px-2 py-1 border-white/5 rounded-none",children:[a.jsx("svg",{className:`w-3 h-3 ${me>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:`text-xs font-medium ${me>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(me).toFixed(1),"%"]})]})})]})]}),a.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pb-2 relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsxs("div",{className:"flex items-center justify-between mb-2 relative -mt-2 pb-1",children:[a.jsxs("div",{className:"relative",children:[a.jsxs("button",{onClick:()=>H(!O),className:"text-xs h-full font-mono uppercase text-gray-400 flex items-center space-x-1 hover:text-white transition-colors",children:[a.jsx(qd,{className:"w-3 h-3"}),a.jsx("span",{children:g})]}),O&&a.jsx("div",{className:"absolute top-6 left-0 w-[150px] z-10 bg-black border border-white/10 rounded-none shadow-lg",children:Si.map(le=>a.jsx("button",{onClick:()=>{b(le),H(!1)},className:"block border-b border-dashed border-white/5 w-full text-left px-4 py-2 text-xs text-white hover:bg-white/10 transition-colors whitespace-nowrap",children:le},le))})]}),g==="Custom"&&a.jsxs("div",{className:"h-0 flex items-center gap-2",children:[a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(F,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(ls,{className:"mr-1 h-3 w-3"}),se?Zn(se,"MMM dd yyyy"):"From"]})}),a.jsx(Dn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:se,onSelect:xe,initialFocus:!0,className:"rounded-none"})})]}),a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(F,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(ls,{className:"mr-1 h-3 w-3"}),ae?Zn(ae,"MMM dd yyyy"):"To"]})}),a.jsx(Dn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:ae,onSelect:ce,initialFocus:!0,disabled:le=>se?le<se:!1,className:"rounded-none"})})]})]})]}),a.jsx("hr",{className:"mb-2 -mx-10 border-white/10"}),a.jsx("h4",{className:"text-md text-white/80 uppercase font-mono font-light mb-1",children:"New Users"}),a.jsx("p",{className:"text-xs text-gray-400 mb-3",children:"Newly registered Users in the time frame"}),a.jsxs("div",{className:"flex pt-4 justify-between items-end",children:[a.jsx("p",{className:"text-3xl text-white font-light",children:Ta(rd)}),a.jsx("div",{className:"mt-2 mb-1 flex items-center gap-2",children:a.jsxs("div",{className:"flex items-center -mr-5 gap-1 px-2 py-1 rounded-none",children:[a.jsx("svg",{className:`w-3 h-3 ${ji>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",style:ji<0?{transform:"rotate(180deg)"}:{},children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:`text-xs font-medium ${ji>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(ji).toFixed(1),"%"]})]})})]})]})]}),a.jsxs("div",{className:"space-y-4 overflow-x-hidden",children:[a.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pb-2 relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsxs("div",{className:"flex items-center justify-between mb-2 relative -mt-2 pb-1",children:[a.jsxs("div",{className:"relative",children:[a.jsxs("button",{onClick:()=>z(!U),className:"text-xs h-full font-mono uppercase text-gray-400 flex items-center space-x-1 hover:text-white transition-colors",children:[a.jsx(qd,{className:"w-3 h-3"}),a.jsx("span",{children:p})]}),U&&a.jsx("div",{className:"absolute top-6 left-0 w-[150px] z-10 bg-black border border-white/10 rounded-none shadow-lg",children:Si.map(le=>a.jsx("button",{onClick:()=>{w(le),z(!1)},className:"block border-b border-dashed border-white/5 w-full text-left px-4 py-2 text-xs text-white hover:bg-white/10 transition-colors whitespace-nowrap",children:le},le))})]}),p==="Custom"&&a.jsxs("div",{className:"h-0 flex items-center gap-2",children:[a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(F,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(ls,{className:"mr-1 h-3 w-3"}),de?Zn(de,"MMM dd yyyy"):"From"]})}),a.jsx(Dn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:de,onSelect:Se,initialFocus:!0,className:"rounded-none"})})]}),a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(F,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(ls,{className:"mr-1 h-3 w-3"}),Ee?Zn(Ee,"MMM dd yyyy"):"To"]})}),a.jsx(Dn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:Ee,onSelect:Ae,initialFocus:!0,disabled:le=>de?le<de:!1,className:"rounded-none"})})]})]})]}),a.jsx("hr",{className:"mb-2 -mx-10 border-white/10"}),a.jsx("h4",{className:"text-md text-white/80 uppercase font-mono font-light mb-1",children:"Organizations"}),a.jsx("p",{className:"text-xs text-gray-400 mb-3",children:"Total organizations in the time frame"}),a.jsxs("div",{className:"flex pt-4 justify-between items-end",children:[a.jsx("p",{className:"text-3xl text-white font-light",children:ke?"...":Ta(_e)}),a.jsx("div",{className:"mt-2 mb-1 flex items-center gap-2",children:a.jsxs("div",{className:"flex items-center -mr-5 gap-1 px-2 py-1 rounded-none",children:[a.jsx("svg",{className:`w-3 h-3 ${ie>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:`text-xs font-medium ${ie>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(ie).toFixed(1),"%"]})]})})]})]}),a.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pb-2 relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsxs("div",{className:"flex items-center justify-between mb-2 relative -mt-2 pb-1",children:[a.jsxs("div",{className:"relative",children:[a.jsxs("button",{onClick:()=>k(!Y),className:"text-xs h-full font-mono uppercase text-gray-400 flex items-center space-x-1 hover:text-white transition-colors",children:[a.jsx(qd,{className:"w-3 h-3"}),a.jsx("span",{children:N})]}),Y&&a.jsx("div",{className:"absolute top-6 left-0 w-[150px] z-10 bg-black border border-white/10 rounded-none shadow-lg",children:Si.map(le=>a.jsx("button",{onClick:()=>{S(le),k(!1)},className:"block border-b border-dashed border-white/5 w-full text-left px-4 py-2 text-xs text-white hover:bg-white/10 transition-colors whitespace-nowrap",children:le},le))})]}),N==="Custom"&&a.jsxs("div",{className:"h-0 flex items-center gap-2",children:[a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(F,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(ls,{className:"mr-1 h-3 w-3"}),He?Zn(He,"MMM dd yyyy"):"From"]})}),a.jsx(Dn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:He,onSelect:J,initialFocus:!0,className:"rounded-none"})})]}),a.jsxs(Kn,{children:[a.jsx(Jn,{asChild:!0,children:a.jsxs(F,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(ls,{className:"mr-1 h-3 w-3"}),oe?Zn(oe,"MMM dd yyyy"):"To"]})}),a.jsx(Dn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Qn,{mode:"single",selected:oe,onSelect:be,initialFocus:!0,disabled:le=>He?le<He:!1,className:"rounded-none"})})]})]})]}),a.jsx("hr",{className:"mb-2 -mx-10 border-white/10"}),a.jsx("h4",{className:"text-md text-white/80 uppercase font-mono font-light mb-1",children:"Teams"}),a.jsx("p",{className:"text-xs text-gray-400 mb-3",children:"Total teams in the time frame"}),a.jsxs("div",{className:"flex pt-4 justify-between items-end",children:[a.jsx("p",{className:"text-3xl text-white font-light",children:X?"...":Ta(je)}),a.jsx("div",{className:"mt-2 mb-1 flex items-center gap-2",children:a.jsxs("div",{className:"flex items-center -mr-5 gap-1 px-2 py-1 rounded-none",children:[a.jsx("svg",{className:`w-3 h-3 ${he>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:`text-xs font-medium ${he>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(he).toFixed(1),"%"]})]})})]})]})]}),a.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pt-4 overflow-hidden relative rounded-none flex flex-col",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(kn,{className:"w-4 h-4 text-white/60"}),a.jsx("h4",{className:"text-xs text-gray-400 uppercase font-mono font-light",children:"Security Insights"})]})}),a.jsx("hr",{className:"-mx-10 -mt-1 border-white/10"}),a.jsxs("div",{className:"space-y-3 overflow-y-auto custom-scrollbar max-h-[400px]",children:[cd.length===0&&a.jsx("div",{className:"text-sm flex items-center justify-center text-gray-400",children:a.jsxs("div",{className:"flex mt-5 items-center justify-center",children:[a.jsx(kn,{className:"w-4 h-4 text-gray-400 mr-2"}),a.jsx("p",{className:"text-center",children:"No security insights found"})]})}),cd.map((le,Ne)=>a.jsx("div",{onClick:()=>Tf(le),className:"group py-2 border-b border-white/5 cursor-pointer transition-all duration-200 hover:border-white/20",style:{animation:`slideIn 0.3s ease-out ${Ne*.1}s both`},children:a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"flex items-center gap-2 mb-1.5",children:a.jsx("span",{className:"text-sm text-white/90 font-light truncate group-hover:text-white transition-colors",children:le.title})}),a.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[a.jsx("span",{className:`text-[9px] px-1.5 py-0.5 border rounded-sm uppercase font-mono ${dd(le.severity)}`,children:le.severity}),a.jsx("span",{className:`text-[9px] px-1.5 py-0.5 border rounded-sm capitalize font-mono ${ud(le.status)}`,children:le.status})]})]}),a.jsx(eR,{className:"w-3.5 h-3.5 text-gray-500 group-hover:text-white transition-all flex-shrink-0 mt-0.5"})]})},le.id))]})]})]})]})]})};return a.jsxs("div",{className:"h-screen bg-black text-white overflow-hidden flex flex-col",style:{overflowX:"hidden"},children:[a.jsx("div",{className:"flex-1 overflow-hidden",children:e==="overview"?hd():e==="users"?a.jsx(eE,{}):e==="organizations"?a.jsx(JC,{}):hd()}),t&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-3xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(bw,{className:"w-6 h-6 text-white"}),a.jsx("h3",{className:"text-lg text-white font-light",children:"Quick Actions"})]}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>n(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Jt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("button",{onClick:()=>{n(!1),ka("/users")},className:"flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none hover:bg-black/50 transition-colors text-left group",children:[a.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:a.jsx(ft,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-white font-light mb-1",children:"View All Users"}),a.jsx("p",{className:"text-sm text-gray-400",children:"Manage user accounts"})]}),a.jsx(Fa,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),a.jsxs("button",{onClick:()=>{n(!1),ka("/organizations")},className:"flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none hover:bg-black/50 transition-colors text-left group",children:[a.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:a.jsx(An,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-white font-light mb-1",children:"View Organizations"}),a.jsx("p",{className:"text-sm text-gray-400",children:"Manage organizations"})]}),a.jsx(Fa,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),a.jsxs("button",{onClick:()=>{n(!1),ka("/sessions")},className:"flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none hover:bg-black/50 transition-colors text-left group",children:[a.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:a.jsx(pw,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-white font-light mb-1",children:"View Sessions"}),a.jsx("p",{className:"text-sm text-gray-400",children:"Monitor active sessions"})]}),a.jsx(Fa,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),a.jsxs("button",{onClick:()=>{n(!1),ka("/database")},className:"flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none hover:bg-black/50 transition-colors text-left group",children:[a.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:a.jsx(fa,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-white font-light mb-1",children:"Database Schema"}),a.jsx("p",{className:"text-sm text-gray-400",children:"View schema visualizer"})]}),a.jsx(Fa,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),a.jsxs("button",{onClick:()=>{n(!1),ka("/settings")},className:"flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none hover:bg-black/50 transition-colors text-left group",children:[a.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:a.jsx(WC,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-white font-light mb-1",children:"Settings"}),a.jsx("p",{className:"text-sm text-gray-400",children:"Configure system"})]}),a.jsx(Fa,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),a.jsxs("button",{onClick:()=>{n(!1),ka("/users")},className:"flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none hover:bg-black/50 transition-colors text-left group",children:[a.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:a.jsx(FC,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-white font-light mb-1",children:"Search Users"}),a.jsx("p",{className:"text-sm text-gray-400",children:"Find specific users"})]}),a.jsx(Fa,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]})]}),a.jsx("div",{className:"mt-6 pt-6 border-t border-dashed border-white/10",children:a.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-400",children:[a.jsx("span",{children:"Tip: Press Ctrl+K or Cmd+K for command palette"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>n(!1),className:"text-gray-400 hover:text-white rounded-none",children:"Close"})]})})]})}),x&&d&&a.jsx("div",{className:"fixed inset-0 bg-black/80 backdrop-blur-sm z-50 flex items-center justify-center p-4",style:{animation:"fadeIn 0.3s ease-out"},onClick:al,children:a.jsxs("div",{className:"bg-black border border-white/20 rounded-none max-w-2xl w-full max-h-[80vh] overflow-y-auto",style:{animation:"slideUp 0.3s ease-out"},onClick:fe=>fe.stopPropagation(),children:[a.jsx("div",{className:"sticky top-0 bg-black border-b border-white/10 p-6 z-10",children:a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[a.jsx(kn,{className:"w-6 h-6 text-white"}),a.jsx("h3",{className:"text-xl text-white font-light",children:d.title})]}),a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsxs("span",{className:`text-xs px-2 py-1 border rounded-none uppercase font-medium ${dd(d.severity)}`,children:[d.severity," Severity"]}),a.jsx("span",{className:`text-xs px-2 py-1 border rounded-none capitalize ${ud(d.status)}`,children:d.status}),d.cve&&a.jsx("span",{className:"text-xs text-gray-400 font-mono bg-white/5 px-2 py-1 border border-white/10 rounded-none",children:d.cve})]})]}),a.jsx("button",{onClick:al,className:"p-2 hover:bg-white/10 transition-colors rounded-none",children:a.jsx(Jt,{className:"w-5 h-5 text-gray-400 hover:text-white"})})]})}),a.jsxs("div",{className:"p-6 space-y-6",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm text-gray-400 uppercase tracking-wide mb-2",children:"Release Date"}),a.jsx("p",{className:"text-white",children:new Date(d.date).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm text-gray-400 uppercase tracking-wide mb-2",children:"Description"}),d.description.includes("npm install")?a.jsxs("div",{children:[a.jsx("p",{className:"text-white leading-relaxed mb-3",children:d.description.split("Run:")[0]}),a.jsx("div",{className:"relative group",children:a.jsx("div",{className:"bg-black border border-white/20 rounded-none p-3 font-mono text-sm",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("code",{children:[a.jsx("span",{className:"text-green-400",children:"$"})," ",a.jsx("span",{className:"text-cyan-400",children:"npm"})," ",a.jsx("span",{className:"text-yellow-400",children:"install"})," ",a.jsx("span",{className:"text-white",children:"better-auth@latest"})]}),a.jsx("button",{onClick:()=>{navigator.clipboard.writeText("npm install better-auth@latest"),B.success("Command copied to clipboard")},className:"opacity-0 group-hover:opacity-100 transition-opacity p-1 hover:bg-white/10 rounded",title:"Copy command",children:a.jsx(yu,{className:"w-4 h-4 text-gray-400 hover:text-white"})})]})})})]}):a.jsx("p",{className:"text-white leading-relaxed",children:d.description})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm text-gray-400 uppercase tracking-wide mb-3",children:"Affected Components"}),a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:d.affectedComponents.map((fe,ge)=>a.jsxs("div",{className:"flex items-center gap-2 p-3 bg-white/5 border border-white/10 rounded-none",style:{animation:`slideIn 0.3s ease-out ${ge*.1}s both`},children:[a.jsx("div",{className:"w-2 h-2 bg-white rounded-none flex-shrink-0"}),a.jsx("span",{className:"text-sm text-white",children:fe})]},ge))})]}),a.jsx("div",{className:"p-4 bg-white/5 border border-white/10 rounded-none",children:a.jsxs("div",{className:"flex items-start gap-3",children:[d.status==="applied"&&a.jsxs(a.Fragment,{children:[a.jsx(E0,{className:"w-5 h-5 text-white flex-shrink-0 mt-0.5"}),a.jsxs("div",{children:[a.jsx("h5",{className:"text-sm text-white font-medium mb-1",children:"Patch Applied"}),a.jsx("p",{className:"text-xs text-gray-400",children:"This security patch has been successfully applied to your system."})]})]}),d.status==="scheduled"&&a.jsxs(a.Fragment,{children:[a.jsx(IC,{className:"w-5 h-5 text-white flex-shrink-0 mt-0.5"}),a.jsxs("div",{children:[a.jsx("h5",{className:"text-sm text-white font-medium mb-1",children:"Scheduled"}),a.jsx("p",{className:"text-xs text-gray-400",children:"This patch is scheduled for deployment in the next maintenance window."})]})]}),d.status==="pending"&&a.jsxs(a.Fragment,{children:[a.jsx(AB,{className:"w-5 h-5 text-white flex-shrink-0 mt-0.5"}),a.jsxs("div",{children:[a.jsx("h5",{className:"text-sm text-white font-medium mb-1",children:"Action Required"}),a.jsx("p",{className:"text-xs text-gray-400",children:"This patch is pending review and requires manual approval before deployment."})]})]})]})}),a.jsx("div",{className:"flex items-center justify-end gap-3 pt-4 border-t border-white/10",children:a.jsx(F,{variant:"ghost",onClick:al,className:"text-gray-400 hover:text-white rounded-none",children:"Close"})})]})]})}),a.jsx("style",{children:`
450
455
  @keyframes fadeIn {
451
456
  from {
452
457
  opacity: 0;
@@ -494,7 +499,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
494
499
  .custom-scrollbar::-webkit-scrollbar-thumb:hover {
495
500
  background: rgba(255, 255, 255, 0.3);
496
501
  }
497
- `})]})}const In=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:$e("rounded-lg border border-gray-700 bg-gray-900 text-white shadow-sm",e),...t}));In.displayName="Card";const Wn=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:$e("flex flex-col space-y-1.5 p-6",e),...t}));Wn.displayName="CardHeader";const qn=m.forwardRef(({className:e,...t},n)=>a.jsx("h3",{ref:n,className:$e("text-2xl font-semibold leading-none tracking-tight text-white",e),...t}));qn.displayName="CardTitle";const Ts=m.forwardRef(({className:e,...t},n)=>a.jsx("p",{ref:n,className:$e("text-sm text-gray-300",e),...t}));Ts.displayName="CardDescription";const Xn=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:$e("p-6 pt-0",e),...t}));Xn.displayName="CardContent";const JB=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:$e("flex items-center p-6 pt-0",e),...t}));JB.displayName="CardFooter";const eV={databaseSchemaNode:Sg},kw=[{name:"organization",displayName:"Organization",description:"Multi-tenant organization support",color:"bg-blue-500"},{name:"teams",displayName:"Teams",description:"Team management within organizations",color:"bg-green-500"},{name:"twoFactor",displayName:"Two Factor",description:"Two-factor authentication support",color:"bg-purple-500"},{name:"apiKey",displayName:"API Key",description:"API key authentication",color:"bg-orange-500"},{name:"passkey",displayName:"Passkey",description:"WebAuthn passkey support",color:"bg-pink-500"}];function tV(){const[e,t]=m.useState(null),[n,s]=m.useState(!0),[r,i]=m.useState(null),[o,l]=m.useState([]),[c,u]=m.useState([]),[h,d,f]=wz([]),[x,y,v]=jz([]),j=m.useCallback(S=>{const C=kw.find(T=>T.name===S);return(C==null?void 0:C.color)||"bg-gray-500"},[]),g=m.useCallback((S,C,T)=>{if(S==="user"||S==="session"||S==="account"||S==="verification")return"core";for(const O of T)if(S===O||S.includes(O))return O;return"core"},[]),b=m.useCallback(async()=>{try{const C=await(await fetch("/api/plugins")).json();if(C.plugins&&Array.isArray(C.plugins)){const T=C.plugins.map(O=>({name:O.id,displayName:O.name||O.id,description:O.description||`${O.id} plugin for Better Auth`,color:j(O.id)}));u(T),l(T.map(O=>O.name))}}catch{u(kw),l(["organization"])}},[j]),p=m.useCallback(async S=>{try{s(!0);const C=S.length>0?`?plugins=${S.join(",")}`:"",O=await(await fetch(`/api/database/schema${C}`)).json();O.success?t(O.schema):i(O.error||"Failed to fetch schema")}catch{i("Failed to fetch database schema")}finally{s(!1)}},[]);m.useEffect(()=>{b()},[b]),m.useEffect(()=>{o.length>0&&p(o)},[o,p]),m.useEffect(()=>{if(!e)return;const S=[],C=[];e.tables.forEach((T,O)=>{const H=T.fields.map(U=>({id:`${T.name}-${U.name}`,isPrimary:U.primaryKey||!1,isNullable:!U.required,isUnique:U.unique||!1,isIdentity:!1,name:U.name,format:U.type,plugin:g(T.name,U.name,o)}));S.push({id:T.name,type:"databaseSchemaNode",position:{x:O%3*380,y:Math.floor(O/3)*320},data:{name:T.name,displayName:T.displayName,isForeign:!1,plugin:g(T.name,"",o),columns:H.map(U=>{var z;return{...U,description:((z=T.fields.find(Y=>Y.name===U.name))==null?void 0:z.description)||""}}),relationships:T.relationships}})}),e.tables.forEach(T=>{T.relationships.forEach(O=>{if(O.type==="many-to-one")return;const H=T.name,U=O.target,z=S.find(k=>k.id===H),Y=S.find(k=>k.id===U);if(z&&Y){const k=O.type==="one-to-one"?"1:1":"1:N";C.push({id:`${H}-${U}-${O.field}`,source:H,target:U,type:"smoothstep",animated:!1,style:{stroke:"#6b7280",strokeWidth:2,strokeDasharray:"0"},label:k,labelStyle:{fontSize:"11px",fill:"#9ca3af",fontWeight:"500"},labelBgStyle:{fill:"rgba(0, 0, 0, 0.9)",fillOpacity:1,borderRadius:4},markerEnd:{type:"arrowclosed",color:"#6b7280",width:12,height:12}})}})}),d(S),y(C)},[e,o,d,y,g]);const w=m.useCallback(S=>y(C=>_2(S,C)),[y]);if(n)return a.jsxs("div",{className:"p-6",children:[a.jsxs("div",{className:"animate-pulse",children:[a.jsx("div",{className:"h-8 bg-gray-700 rounded w-1/3 mb-6"}),a.jsx("div",{className:"h-96 bg-gray-700 rounded"})]}),a.jsx("div",{className:"text-center text-gray-500 dark:text-gray-400 mt-4",children:"Loading plugins and schema..."})]});if(r)return a.jsx("div",{className:"p-6",children:a.jsxs("div",{className:"bg-red-900/20 border border-red-500/20 rounded-none p-6",children:[a.jsx("h2",{className:"text-xl font-semibold text-red-400 mb-2",children:"Error Loading Schema"}),a.jsx("p",{className:"text-gray-300",children:r})]})});const N=a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mb-6",children:[a.jsx("div",{className:"flex items-center justify-between mb-1",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Nt,{className:"w-6 h-6 text-white"}),a.jsx("h1",{className:"text-2xl font-light text-white",children:"Schema Visualizer"})]})}),a.jsx("p",{className:"text-gray-400",children:"Visualize your Better Auth database schema with interactive tables and relationships."})]}),a.jsxs("div",{className:"flex-1 grid grid-cols-4 gap-6",children:[a.jsxs("div",{className:"col-span-1",children:[a.jsxs(In,{className:"rounded-none bg-black h-fit shadow-sm",children:[a.jsx(Wn,{children:a.jsxs(qn,{className:"font-light text-xl text-white flex items-center space-x-2",children:[a.jsx(uo,{className:"w-5 h-5"}),a.jsx("span",{children:"Plugins"})]})}),a.jsx(Xn,{className:"space-y-3",children:c.length>0?c.map(S=>a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:`w-3 h-3 rounded-full ${S.color}`}),a.jsx("label",{htmlFor:S.name,className:"text-sm font-medium text-white cursor-pointer",children:S.displayName.slice(0,1).toUpperCase()+S.displayName.slice(1).replace("-"," ")})]},S.name)):a.jsx("div",{className:"text-sm text-white/70",children:"No plugins detected in configuration"})})]}),e&&a.jsxs(In,{className:"rounded-none bg-black mt-4 shadow-sm",children:[a.jsx(Wn,{children:a.jsx(qn,{className:"text-white text-sm",children:"Schema Info"})}),a.jsxs(Xn,{className:"space-y-2",children:[a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{className:"text-white/70",children:"Tables:"}),a.jsx("span",{className:"text-white",children:e.tables.length})]}),a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{className:"text-white/70",children:"Relationships:"}),a.jsx("span",{className:"text-white",children:e.tables.reduce((S,C)=>S+C.relationships.length,0)})]}),a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{className:"text-white/70",children:"Available Plugins:"}),a.jsx("span",{className:"text-white",children:c.length})]}),a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{className:"text-white/70",children:"Selected Plugins:"}),a.jsx("span",{className:"text-white",children:o.length})]})]})]})]}),a.jsx("div",{className:"col-span-3",children:a.jsx("div",{className:"h-full bg-black border border-gray-700 rounded-lg overflow-hidden shadow-xl",children:a.jsxs(yz,{nodes:h,edges:x,onNodesChange:f,onEdgesChange:v,onConnect:w,nodeTypes:eV,fitView:!0,fitViewOptions:{padding:.1,includeHiddenNodes:!1},className:"bg-black",connectionLineType:"smoothstep",defaultEdgeOptions:{style:{stroke:"#6b7280",strokeWidth:2},animated:!1,type:"smoothstep"},nodesDraggable:!0,nodesConnectable:!1,elementsSelectable:!0,children:[a.jsx(zz,{className:"bg-gray-900 border-gray-700 [&>button]:bg-gray-800 [&>button]:border-gray-600 [&>button]:text-white [&>button:hover]:bg-gray-700"}),a.jsx(qz,{className:"bg-gray-900 border-gray-700",nodeColor:S=>{var C;return(C=S.data)!=null&&C.isForeign?"#374151":"#1f2937"},maskColor:"rgba(0, 0, 0, 0.9)"}),a.jsx(kz,{variant:ga.Dots,gap:20,size:1,color:"#374151"})]})})})]})]});return a.jsxs("div",{className:"overflow-hidden p-6 h-[90vh] flex flex-col opacity-70 bg-black relative",children:[a.jsxs("div",{className:"absolute inset-0 z-50 flex items-center justify-center pointer-events-none",children:[a.jsx("div",{className:"absolute inset-0 backdrop-blur-sm",style:{WebkitBackdropFilter:"blur(8px)",backdropFilter:"blur(8px)"}}),a.jsxs("div",{className:"relative -mt-6 bg-black/50 border border-dashed border-white/20 rounded-none p-12 max-w-2xl mx-6 text-center pointer-events-auto",children:[a.jsx("div",{className:"flex items-center justify-center mb-4",children:a.jsxs("div",{className:"relative",children:[a.jsx(Nt,{className:"w-16 h-16 text-white opacity-50"}),a.jsx(dR,{className:"w-8 h-8 text-white opacity-80 absolute -top-2 -right-2 animate-pulse"})]})}),a.jsx("h2",{className:"text-3xl font-mono uppercase font-light text-white mb-3",children:"Coming Soon"}),a.jsx("p",{className:"text-lg text-gray-300 font-light mb-6 leading-relaxed",children:"We will be having this feature soon. This feature will allow you to explore your Better Auth database structure with beautiful, interactive graphs showing all tables, relationships, and data flow."}),a.jsxs("div",{className:"flex items-center justify-center space-x-6 text-sm text-gray-400",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),a.jsx("span",{children:"Interactive Tables"})]}),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",{children:"Relationship Mapping"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("div",{className:"w-2 h-2 bg-purple-500 rounded-full"}),a.jsx("span",{children:"Real-time Updates"})]})]})]})]}),a.jsx("div",{className:"blur-sm opacity-50 pointer-events-none",children:N})]})}const nV=rC("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-white text-black hover:bg-white",secondary:"border-transparent bg-gray-800 text-white hover:bg-gray-800 border border-gray-600",destructive:"border-transparent bg-red-500 text-white hover:bg-red-600",outline:"text-gray-300 border-gray-600",success:"border-transparent bg-green-900 text-green-300",warning:"border-transparent bg-yellow-900 text-yellow-300",error:"border-transparent bg-red-900 text-red-300",info:"border-transparent bg-gray-800 text-white border border-gray-600"}},defaultVariants:{variant:"default"}});function vt({className:e,variant:t,...n}){return a.jsx("div",{className:$e(nV({variant:t}),e),...n})}function sV(){const{orgId:e}=zp(),t=ws(),[n,s]=m.useState(null),[r,i]=m.useState([]),[o,l]=m.useState([]),[c,u]=m.useState([]),[h,d]=m.useState(!0),[f,x]=m.useState("details"),[y,v]=m.useState(!1),[j,g]=m.useState(!1),[b,p]=m.useState(!1),[w,N]=m.useState(!1),[S,C]=m.useState(!1),[T,O]=m.useState(!1),[H,U]=m.useState(!1),[z,Y]=m.useState(!1),[k,$]=m.useState(!1),[M,A]=m.useState(null),[E,D]=m.useState({name:"",slug:""}),[_,I]=m.useState(""),[R,P]=m.useState(""),[W,q]=m.useState([]),[ee,ne]=m.useState({name:""}),[Z,se]=m.useState(!1),[xe,ae]=m.useState([]),[ce,de]=m.useState(!1),[Se,Ee]=m.useState([]),[Ae,He]=m.useState(!1);m.useEffect(()=>{e&&(oe(),Oe(),be(),Ce(),st(),we())},[e]),m.useEffect(()=>{y&&e&&we()},[]),m.useEffect(()=>{f==="members"&&e&&st()},[f,e]),m.useEffect(()=>{f==="invitations"&&e&&Ce()},[f,e]);const J=X=>{ne({name:X})},oe=async()=>{try{const Q=await(await fetch(`/api/organizations/${e}`)).json();Q.success&&Q.organization||Q.organization?s(Q.organization):B.error("Organization not found")}catch(X){console.error("Failed to fetch organization:",X),B.error("Failed to load organization")}finally{d(!1)}},be=async()=>{try{const Q=await(await fetch("/api/plugins/teams/status")).json();v(Q.enabled)}catch(X){console.error("Failed to check teams status:",X),v(!1)}},Oe=async()=>{try{const Q=await(await fetch("/api/plugins/organization/status")).json();g(Q.enabled)}catch(X){console.error("Failed to check organization status:",X),g(!1)}},we=async()=>{try{const Q=await(await fetch(`/api/organizations/${e}/teams`)).json();Q.success&&i(Q.teams||[])}catch(X){console.error("Failed to fetch teams:",X),B.error("Failed to load teams")}},Ce=async()=>{try{const Q=await(await fetch(`/api/organizations/${e}/invitations`)).json();Q.success&&l(Q.invitations||[])}catch(X){console.error("Failed to fetch invitations:",X),B.error("Failed to load invitations")}},st=async()=>{try{const Q=await(await fetch(`/api/organizations/${e}/members`)).json();Q.success&&u(Q.members||[])}catch(X){console.error("Failed to fetch members:",X),B.error("Failed to load members")}},yt=async X=>{ae([]),de(!0),ae([{id:"start",type:"info",message:`Starting member seeding process for ${X} members...`,timestamp:new Date}]);try{const pe=await(await fetch(`/api/organizations/${e}/seed-members`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:X})})).json();if(pe.success){const We=pe.results.map((tt,Qe)=>tt.success?{id:`member-${Qe}`,type:"progress",message:`Adding member: ${tt.member.user.name} (${tt.member.user.email})`,timestamp:new Date,status:"completed"}:{id:`member-${Qe}`,type:"error",message:`Failed to add member ${Qe+1}: ${tt.error}`,timestamp:new Date});ae(tt=>[...tt,...We]);const nt=pe.results.filter(tt=>tt.success).length;ae(tt=>[...tt,{id:"complete",type:"success",message:`✅ Seeding completed! Added ${nt}/${X} members successfully`,timestamp:new Date}]),await st(),B.success(`Successfully added ${nt} members!`)}else ae(We=>[...We,{id:"error",type:"error",message:`❌ Seeding failed: ${pe.error||"Unknown error"}`,timestamp:new Date}]),B.error(pe.error||"Failed to seed members")}catch(Q){ae(pe=>[...pe,{id:"error",type:"error",message:`❌ Network error: ${Q}`,timestamp:new Date}]),B.error("Failed to seed members")}finally{de(!1)}},wt=async X=>{Ee([]),He(!0),Ee([{id:"start",type:"info",message:`Starting team seeding process for ${X} teams...`,timestamp:new Date}]);try{const pe=await(await fetch(`/api/organizations/${e}/seed-teams`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:X})})).json();if(pe.success){const We=pe.results.map((tt,Qe)=>tt.success?{id:`team-${Qe}`,type:"progress",message:`Creating team: ${tt.team.name}`,timestamp:new Date,status:"completed"}:{id:`team-${Qe}`,type:"error",message:`Failed to create team ${Qe+1}: ${tt.error}`,timestamp:new Date});Ee(tt=>[...tt,...We]);const nt=pe.results.filter(tt=>tt.success).length;Ee(tt=>[...tt,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${nt}/${X} teams successfully`,timestamp:new Date}]),await we(),B.success(`Successfully created ${nt} teams!`)}else Ee(We=>[...We,{id:"error",type:"error",message:`❌ Seeding failed: ${pe.error||"Unknown error"}`,timestamp:new Date}]),B.error(pe.error||"Failed to seed teams")}catch(Q){Ee(pe=>[...pe,{id:"error",type:"error",message:`❌ Network error: ${Q}`,timestamp:new Date}]),B.error("Failed to seed teams")}finally{He(!1)}},Lt=async()=>{try{const Q=await(await fetch("/api/users/all")).json();Q.success&&q(Q.users||[])}catch(X){console.error("Failed to fetch users:",X)}},K=X=>X.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,""),V=()=>{n&&(D({name:n.name,slug:n.slug}),$(!0))},te=X=>{const Q=K(X);D({name:X,slug:Q})},me=X=>{D(Q=>({...Q,slug:K(X)}))},L=async()=>{if(!n){B.error("No organization selected");return}if(!E.name){B.error("Please fill in the organization name");return}const X=B.loading("Updating organization...");try{const pe=await(await fetch(`/api/organizations/${n.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:E.name,slug:E.slug})})).json();pe.success?(await oe(),$(!1),D({name:"",slug:""}),B.success("Organization updated successfully!",{id:X})):B.error(`Error updating organization: ${pe.error||"Unknown error"}`,{id:X})}catch(Q){console.error("Error updating organization:",Q),B.error("Error updating organization",{id:X})}},ie=()=>{Lt(),p(!0)},ue=async()=>{if(!_){B.error("Please enter an email address");return}if(!R){B.error("Please select an inviter");return}se(!0);const X=B.loading("Sending invitation...");try{const pe=await(await fetch(`/api/organizations/${e}/invitations`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:_,role:"member",inviterId:R})})).json();pe.success?(await Ce(),p(!1),I(""),P(""),B.success("Invitation sent successfully!",{id:X})):B.error(`Error sending invitation: ${pe.error||"Unknown error"}`,{id:X})}catch(Q){console.error("Error sending invitation:",Q),B.error("Error sending invitation",{id:X})}finally{se(!1)}},he=async X=>{const Q=B.loading("Cancelling invitation...");try{const We=await(await fetch(`/api/invitations/${X}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();We.success?(await Ce(),B.success("Invitation cancelled successfully!",{id:Q})):B.error(`Error cancelling invitation: ${We.error||"Unknown error"}`,{id:Q})}catch(pe){console.error("Error cancelling invitation:",pe),B.error("Error cancelling invitation",{id:Q})}},Be=async(X,Q)=>{const pe=B.loading("Resending invitation...");try{const nt=await(await fetch(`/api/invitations/${X}/resend`,{method:"POST",headers:{"Content-Type":"application/json"}})).json();nt.success?(await Ce(),B.success(`Invitation resent to ${Q}!`,{id:pe})):B.error(`Error resending invitation: ${nt.error||"Unknown error"}`,{id:pe})}catch(We){console.error("Error resending invitation:",We),B.error("Error resending invitation",{id:pe})}},_e=async(X,Q)=>{const pe=B.loading(`Removing ${Q}...`);try{const nt=await(await fetch(`/api/members/${X}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();nt.success?(await st(),B.success(`${Q} removed from organization!`,{id:pe})):B.error(`Error removing member: ${nt.error||"Unknown error"}`,{id:pe})}catch(We){console.error("Error removing member:",We),B.error("Error removing member",{id:pe})}},Re=async()=>{if(!ee.name){B.error("Please enter a team name");return}const X=B.loading("Creating team...");try{const pe=await(await fetch(`/api/organizations/${e}/teams`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:ee.name,organizationId:e})})).json();pe.success?(await we(),O(!1),ne({name:""}),B.success("Team created successfully!",{id:X})):B.error(`Error creating team: ${pe.error||"Unknown error"}`,{id:X})}catch(Q){console.error("Error creating team:",Q),B.error("Error creating team",{id:X})}},je=async()=>{if(!M||!ee.name){B.error("Please enter a team name");return}const X=B.loading("Updating team...");try{const pe=await(await fetch(`/api/teams/${M.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:ee.name})})).json();pe.success?(await we(),U(!1),A(null),ne({name:""}),B.success("Team updated successfully!",{id:X})):B.error(`Error updating team: ${pe.error||"Unknown error"}`,{id:X})}catch(Q){console.error("Error updating team:",Q),B.error("Error updating team",{id:X})}},Ve=async()=>{if(!M){B.error("No team selected");return}const X=B.loading("Deleting team...");try{const pe=await(await fetch(`/api/teams/${M.id}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();pe.success?(await we(),Y(!1),A(null),B.success("Team deleted successfully!",{id:X})):B.error(`Error deleting team: ${pe.error||"Unknown error"}`,{id:X})}catch(Q){console.error("Error deleting team:",Q),B.error("Error deleting team",{id:X})}},ke=X=>{A(X),ne({name:X.name}),U(!0)},Pe=X=>{A(X),Y(!0)};return h?a.jsx("div",{className:"flex items-center justify-center h-32",children:a.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[a.jsx(tr,{className:"w-6 h-6 text-white animate-spin"}),a.jsx("div",{className:"text-white text-sm",children:"Loading organization details..."})]})}):n?a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("div",{className:"flex items-center space-x-4",children:a.jsx("span",{className:"mb-4 ml-0 flex justify-start items-start text-left border-none text-white",children:a.jsxs("span",{className:"font-light",children:[a.jsxs("span",{onClick:()=>t("/organizations"),className:"uppercase cursor-pointer text-white/80 font-mono text-sm",children:["orgs /"," "]}),a.jsx("span",{className:"text-white font-mono text-sm",children:e})]})})}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(F,{onClick:()=>N(!0),className:"border border-dashed border-white/20 text-white bg-transparent hover:bg-white/10 rounded-none",children:[a.jsx(ft,{className:"w-4 h-4 mr-2"}),"Seed Members"]}),a.jsxs(F,{onClick:ie,className:"border border-dashed border-white/20 text-white bg-transparent hover:bg-white/10 rounded-none",children:[a.jsx(sa,{className:"w-4 h-4 mr-2"}),"Invite User"]}),a.jsxs(F,{onClick:V,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[a.jsx(ii,{className:"w-4 h-4 mr-2"}),"Edit Organization"]})]})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-12 h-12 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:a.jsx(An,{className:"w-6 h-6 text-white"})}),a.jsx("div",{children:a.jsxs("h1",{className:"text-2xl text-white font-light inline-flex items-center",children:[n.name,a.jsxs("sup",{className:"text-xs text-gray-500 ml-2",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-xs",children:n.slug}),a.jsx("span",{className:"ml-1",children:"]"})]})]})})]}),a.jsx("div",{className:"border-b border-white/10",children:a.jsxs("nav",{className:"flex space-x-8",children:[a.jsxs("button",{onClick:()=>x("details"),className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${f==="details"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[a.jsx(An,{className:"w-4 h-4"}),a.jsxs("span",{className:"inline-flex items-start",children:["Details",a.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:a.jsx(xs,{value:0,className:"text-white/80 font-mono text-xs",prefix:a.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]}),a.jsxs("button",{onClick:()=>x("members"),className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${f==="members"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[a.jsx(ft,{className:"w-4 h-4"}),a.jsxs("span",{className:"inline-flex items-start",children:["Members",a.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:a.jsx(xs,{value:c.length,className:"text-white/80 font-mono text-xs",prefix:a.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]}),a.jsxs("button",{onClick:()=>x("invitations"),className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${f==="invitations"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[a.jsx(sa,{className:"w-4 h-4"}),a.jsxs("span",{className:"inline-flex items-start",children:["Invitations",a.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:a.jsx(xs,{value:o.length,className:"text-white/80 font-mono text-xs",prefix:a.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]}),a.jsxs("button",{onClick:()=>x("teams"),className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${f==="teams"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[a.jsx(ft,{className:"w-4 h-4"}),a.jsxs("span",{className:"inline-flex items-start",children:["Teams",a.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:a.jsx(xs,{value:r.length,className:"text-white/80 font-mono text-xs",prefix:a.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]})]})}),f==="details"&&a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:[a.jsx("h3",{className:"text-lg text-white font-light mb-4",children:"Organization Information"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Name"}),a.jsx("p",{className:"text-white font-sans mt-1",children:n.name})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Slug"}),a.jsx("p",{className:"text-white font-mono mt-1",children:n.slug})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Created"}),a.jsx("p",{className:"text-white font-sans mt-1",children:new Date(n.createdAt).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6",children:[a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(ft,{className:"w-8 h-8 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl text-white font-sans font-light",children:c.length}),a.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Members"})]})]})}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(ft,{className:"w-8 h-8 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl text-white font-sans font-light",children:r.length}),a.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Teams"})]})]})}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(sa,{className:"w-8 h-8 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl text-white font-sans font-light",children:o.length}),a.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Invitations"})]})]})}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(ls,{className:"w-8 h-8 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl text-white font-sans font-light",children:Math.ceil((new Date().getTime()-new Date(n.createdAt).getTime())/(1e3*60*60*24))}),a.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Days Active"})]})]})})]})]}),f==="teams"&&a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Teams",a.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white font-mono text-xs",children:r.length}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 mt-1 uppercase font-mono text-xs font-light",children:"Manage teams within this organization"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(F,{onClick:()=>C(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[a.jsx(fa,{className:"w-4 h-4 mr-2"}),"Seed Teams"]}),a.jsxs(F,{onClick:()=>O(!0),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[a.jsx(Zl,{className:"w-4 h-4 mr-2"}),"Create Team"]})]})]}),y?r.length>0?a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Team"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Members"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Created"}),a.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),a.jsx("tbody",{children:r.map(X=>a.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5 cursor-pointer",onClick:()=>t(`/organizations/${e}/teams/${X.id}`),children:[a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-10 h-10 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:a.jsx(ft,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:X.name}),a.jsx(Rn,{id:X.id,label:"Team ID"})]})]})}),a.jsx("td",{className:"py-4 px-4 text-white",children:X.memberCount||0}),a.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:new Date(X.createdAt).toLocaleDateString()}),a.jsx("td",{className:"py-4 px-4 text-right",children:a.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[a.jsxs(F,{variant:"outline",size:"sm",className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",onClick:Q=>{Q.stopPropagation(),ke(X)},children:[a.jsx(ii,{className:"w-4 h-4 mr-1"}),"Edit"]}),a.jsxs(F,{variant:"outline",size:"sm",className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",onClick:Q=>{Q.stopPropagation(),Pe(X)},children:[a.jsx(wu,{className:"w-4 h-4 mr-1"}),"Delete"]})]})})]},X.id))})]})})}):a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-12",children:a.jsxs("div",{className:"text-center",children:[a.jsx(ft,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"No Teams Yet"}),a.jsx("p",{className:"text-gray-400 mb-6",children:"Create your first team to start organizing members within this organization."}),a.jsxs(F,{onClick:()=>O(!0),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[a.jsx(Zl,{className:"w-4 h-4 mr-2"}),"Create First Team"]})]})}):a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-8",children:a.jsxs("div",{className:"flex items-start space-x-4",children:[a.jsx("div",{className:"flex-shrink-0",children:a.jsx(ft,{className:"w-12 h-12 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"Teams Feature Required"}),a.jsx("p",{className:"text-gray-300 mb-6",children:"To use Teams in Better Auth Studio, you need to enable the teams feature in your organization plugin configuration."}),a.jsxs("div",{className:"bg-black/50 border border-dashed border-white/20 rounded-none p-4 mb-6",children:[a.jsx("h4",{className:"text-white font-light mb-3",children:"Follow these steps:"}),a.jsx("ol",{className:"text-gray-300 space-y-2 text-sm list-decimal list-inside",children:a.jsx("li",{children:"Update your auth configuration file to enable teams:"})}),a.jsx("div",{className:"mt-4 bg-black/70 border border-dashed border-white/10 rounded-none p-3 overflow-x-auto",children:a.jsxs("pre",{className:"text-sm text-gray-300",children:[a.jsx("span",{className:"text-blue-400",children:"import"})," ","{ betterAuth }"," ",a.jsx("span",{className:"text-blue-400",children:"from"})," ",a.jsx("span",{className:"text-green-400",children:'"better-auth"'})," ",a.jsx("br",{}),a.jsx("span",{className:"text-blue-400",children:"import"})," ","{ organization }"," ",a.jsx("span",{className:"text-blue-400",children:"from"})," ",a.jsx("span",{className:"text-green-400",children:'"better-auth/plugins/organization"'})," ",a.jsx("br",{}),a.jsx("span",{className:"text-blue-400",children:"export const"})," ",a.jsx("span",{className:"text-yellow-300",children:"auth"})," ="," ",a.jsx("span",{className:"text-yellow-300",children:"betterAuth"}),"(","{"," ",a.jsx("br",{}),a.jsx("span",{className:"text-gray-500 pl-10",children:"// ... your existing configuration"})," ",a.jsx("br",{}),a.jsx("span",{className:"text-red-300 pl-10",children:"plugins"}),": [ ",a.jsx("br",{}),a.jsx("span",{className:"text-yellow-300 pl-12",children:"organization"}),"(","{"," ",a.jsx("br",{}),a.jsx("span",{className:"text-red-300 pl-16",children:"teams"}),": ","{"," ",a.jsx("br",{}),a.jsx("span",{className:"text-yellow-300 pl-20",children:"enabled"}),":"," ",a.jsx("span",{className:"text-blue-400",children:"true"})," ",a.jsx("br",{}),a.jsx("span",{className:"pl-16",children:"}"})," ",a.jsx("br",{}),a.jsx("span",{className:"pl-12",children:"})"})," ",a.jsx("br",{}),a.jsx("span",{className:"pl-10",children:"]"})," ",a.jsx("br",{}),"}",") ",a.jsx("br",{})]})}),a.jsx("div",{className:"mt-4",children:a.jsx("p",{className:"text-gray-400 text-sm",children:"2. Run migrations to create the teams table"})}),a.jsx("div",{className:"mt-2",children:a.jsx("p",{className:"text-gray-400 text-sm",children:"3. Restart your application to apply the changes"})})]}),a.jsx(F,{onClick:()=>window.location.reload(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Check Again"}),a.jsxs("div",{className:"mt-4 text-xs text-gray-500",children:["Need help? Check the"," ",a.jsx("a",{href:"https://better-auth.com/docs/plugins/organization",target:"_blank",rel:"noopener noreferrer",className:"text-white hover:underline",children:"Better Auth Organization Plugin Documentation"})]})]})]})})]}),f==="members"&&a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{children:[a.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Members",a.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white font-mono text-xs",children:c.length}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 font-light font-mono text-xs uppercase mt-1",children:"Manage organization members and their roles"})]})}),c.length>0?a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"User"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Email"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Role"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Joined"}),a.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),a.jsx("tbody",{children:c.map(X=>a.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5",children:[a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("img",{src:X.user.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${X.user.id}`,alt:X.user.name,className:"w-10 h-10 rounded-none border border-dashed border-white/20"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:X.user.name}),a.jsx(Rn,{id:X.user.id})]})]})}),a.jsx("td",{className:"py-4 px-4 text-white",children:X.user.email}),a.jsx("td",{className:"py-4 px-4",children:a.jsx(vt,{variant:"secondary",className:"text-xs bg-blue-900/10 border border-dashed rounded-none border-blue-500/30 text-blue-400/70 capitalize",children:X.role})}),a.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:new Date(X.joinedAt).toLocaleDateString()}),a.jsx("td",{className:"py-4 px-4 text-right",children:a.jsx("div",{className:"flex items-center justify-end space-x-2",children:a.jsxs(F,{variant:"outline",size:"sm",className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",onClick:()=>_e(X.id,X.user.name),children:[a.jsx(wu,{className:"w-4 h-4 mr-1"}),"Remove"]})})})]},X.id))})]})})}):a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-12",children:a.jsxs("div",{className:"text-center",children:[a.jsx(ft,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"No Members Yet"}),a.jsx("p",{className:"text-gray-400 mb-6",children:"Invite users or seed members from existing users to get started."}),a.jsxs("div",{className:"flex items-center justify-center space-x-3",children:[a.jsxs(F,{onClick:()=>N(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[a.jsx(ft,{className:"w-4 h-4 mr-2"}),"Seed Members"]}),a.jsxs(F,{onClick:ie,className:"bg-white text-white hover:bg-white/90 bg-transparent border border-white/20 rounded-none",children:[a.jsx(sa,{className:"w-4 h-4 mr-2"}),"Invite User"]})]})]})})]}),f==="invitations"&&a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{children:[a.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Invitations",a.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white font-mono text-xs",children:o.length}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 font-light font-mono text-xs uppercase mt-1",children:"Manage pending invitations to this organization"})]})}),o.length>0?a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Email"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Role"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Status"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Expires"}),a.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),a.jsx("tbody",{children:o.map(X=>a.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5",children:[a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-10 h-10 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:a.jsx(sa,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:X.email}),a.jsxs("div",{className:"text-sm text-gray-400",children:["Expires on"," ",new Date(X.expiresAt).toLocaleDateString("en-US",{month:"short",year:"numeric",day:"numeric"})]})]})]})}),a.jsx("td",{className:"py-4 px-4 text-white capitalize",children:X.role}),a.jsx("td",{className:"py-4 px-4",children:a.jsxs(vt,{variant:"secondary",className:`text-xs font-normal rounded-none border-dashed flex items-center gap-1 w-fit ${X.status==="pending"?"bg-yellow-900/10 border border-yellow-500/30 text-yellow-400/70":X.status==="accepted"?"bg-green-900/10 border border-green-500/30 text-green-400/70":"bg-red-900/10 border border-red-500/30 text-red-400/70"}`,children:[X.status==="pending"&&a.jsx(IC,{className:"w-3 h-3"}),X.status==="accepted"&&a.jsx(E0,{className:"w-3 h-3"}),X.status==="expired"&&a.jsx(Jt,{className:"w-3 h-3"}),X.status]})}),a.jsxs("td",{className:"py-4 px-4 text-sm text-gray-400",children:[new Date(X.expiresAt).toLocaleDateString(),a.jsx("br",{}),a.jsx("span",{className:"text-xs text-gray-400",children:new Date(X.expiresAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]}),a.jsx("td",{className:"py-4 px-4 text-right",children:a.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[a.jsxs(F,{variant:"outline",size:"sm",className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",onClick:()=>Be(X.id,X.email),children:[a.jsx(vw,{className:"w-4 h-4 mr-1"}),"Resend"]}),a.jsxs(F,{variant:"outline",size:"sm",className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",onClick:()=>he(X.id),children:[a.jsx(wu,{className:"w-4 h-4 mr-1"}),"Cancel"]})]})})]},X.id))})]})})}):a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-12",children:a.jsxs("div",{className:"text-center",children:[a.jsx(sa,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"No Invitations"}),a.jsx("p",{className:"text-gray-400 mb-6",children:"Start inviting users to join this organization."}),a.jsxs(F,{onClick:ie,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[a.jsx(sa,{className:"w-4 h-4 mr-2"}),"Send First Invitation"]})]})})]}),b&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Invite User"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>{p(!1),I(""),P("")},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Jt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"invite-email",className:"text-sm text-gray-400 font-light",children:"Email Address"}),a.jsx(Fe,{id:"invite-email",type:"email",value:_,onChange:X=>I(X.target.value),placeholder:"user@example.com",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"inviter-select",className:"text-sm text-gray-400 font-light",children:"Inviter"}),a.jsxs(Zr,{value:R,onValueChange:P,children:[a.jsx(Qr,{children:a.jsx(_0,{placeholder:"Select an inviter..."})}),a.jsx(Kr,{children:W.map(X=>a.jsx(yn,{value:X.id,children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("img",{src:X.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${X.id}`,alt:X.name,className:"w-6 h-6 rounded-none border border-dashed border-white/20"}),a.jsxs("span",{children:[X.name," (",X.email,")"]})]})},X.id))})]})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>{p(!1),I(""),P("")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsxs(F,{onClick:ue,disabled:Z,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none disabled:opacity-50",children:[Z?a.jsx(tr,{className:"w-3 h-3 mr-2 animate-spin"}):a.jsx(vw,{className:"w-4 h-4 mr-2"}),Z?"Sending...":"Send Invitation"]})]})]})}),T&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Create Team"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>{O(!1),ne({name:""})},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Jt,{className:"w-4 h-4"})})]}),a.jsx("div",{className:"space-y-4",children:a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"team-name",className:"text-sm text-gray-400 font-light",children:"Team Name"}),a.jsx(Fe,{id:"team-name",value:ee.name,onChange:X=>J(X.target.value),placeholder:"e.g. Development Team",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>{O(!1),ne({name:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:Re,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Create Team"})]})]})}),H&&M&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Edit Team"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>{U(!1),ne({name:""})},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Jt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:a.jsx(ft,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:M.name}),a.jsx(Rn,{id:M.id,label:"Team ID",variant:"detail"})]})]}),a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"edit-team-name",className:"text-sm text-gray-400 font-light",children:"Team Name"}),a.jsx(Fe,{id:"edit-team-name",value:ee.name,onChange:X=>J(X.target.value),placeholder:"e.g. Development Team",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>{U(!1),ne({name:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:je,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update Team"})]})]})}),z&&M&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Delete Team"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>Y(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Jt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:a.jsx(ft,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:M.name}),a.jsx(Rn,{id:M.id,label:"Team ID",variant:"detail"})]})]}),a.jsx("p",{className:"text-gray-400",children:"Are you sure you want to delete this team? This action cannot be undone."})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>Y(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:Ve,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none",children:"Delete Team"})]})]})}),w&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-2xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Seed Members"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>N(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Jt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(ft,{className:"w-5 h-5 text-white"}),a.jsx("h4",{className:"text-white font-light",children:"Add Members from Existing Users"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(Xe,{htmlFor:"member-count",className:"text-sm text-gray-400 font-light",children:"Number of members to add"}),a.jsx(Fe,{id:"member-count",type:"number",min:"1",max:"50",defaultValue:"5",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx(F,{onClick:()=>{var Q;const X=parseInt(((Q=document.getElementById("member-count"))==null?void 0:Q.value)||"5");yt(X)},disabled:ce,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:ce?a.jsxs(a.Fragment,{children:[a.jsx(tr,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(ft,{className:"w-3 h-3 mr-2"}),"Seed Members"]})})]})]}),xe.length>0&&a.jsx("div",{className:"mt-6",children:a.jsx(fi,{title:"Member Seeding Terminal",lines:xe,isRunning:ce,className:"w-full",defaultCollapsed:!0})})]}),a.jsx("div",{className:"flex justify-end mt-6 pt-6 border-t border-dashed border-white/10",children:a.jsx(F,{variant:"outline",onClick:()=>N(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),S&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-2xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Seed Teams"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>C(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Jt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(An,{className:"w-5 h-5 text-white"}),a.jsx("h4",{className:"text-white font-light",children:"Create Teams"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(Xe,{htmlFor:"team-count",className:"text-sm text-gray-400 font-light",children:"Number of teams to create"}),a.jsx(Fe,{id:"team-count",type:"number",min:"1",max:"20",defaultValue:"3",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx(F,{onClick:()=>{var Q;const X=parseInt(((Q=document.getElementById("team-count"))==null?void 0:Q.value)||"3");wt(X)},disabled:Ae,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:Ae?a.jsxs(a.Fragment,{children:[a.jsx(tr,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(An,{className:"w-3 h-3 mr-2"}),"Seed Teams"]})})]})]}),Se.length>0&&a.jsx("div",{className:"mt-6",children:a.jsx(fi,{title:"Team Seeding Terminal",lines:Se,isRunning:Ae,className:"w-full",defaultCollapsed:!0})})]}),a.jsx("div",{className:"flex justify-end mt-6 pt-6 border-t border-dashed border-white/10",children:a.jsx(F,{variant:"outline",onClick:()=>C(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),k&&n&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",onClick:X=>{X.target===X.currentTarget&&($(!1),D({name:"",slug:""}))},children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",onClick:X=>X.stopPropagation(),children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Edit Organization"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>{$(!1),D({name:"",slug:""})},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Jt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(An,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:n.name}),a.jsx("div",{className:"text-sm text-gray-400",children:n.slug})]})]}),a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"edit-name",className:"text-sm text-gray-400 font-light",children:"Name"}),a.jsx(Fe,{id:"edit-name",value:E.name,onChange:X=>te(X.target.value),placeholder:"e.g. Acme Corp",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"edit-slug",className:"text-sm text-gray-400 font-light",children:"Slug"}),a.jsx(Fe,{id:"edit-slug",value:E.slug,onChange:X=>me(X.target.value),placeholder:"e.g. acme-corp",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Auto-generated from name. You can edit it manually."})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>{$(!1),D({name:"",slug:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:L,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})})]}):a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsx("div",{className:"flex items-center space-x-4",children:a.jsx(Rp,{to:"/organizations",children:a.jsxs(F,{variant:"ghost",className:"text-gray-400 hover:text-white rounded-none",children:[a.jsx(EB,{className:"w-4 h-4 mr-2"}),"Back to Organizations"]})})}),a.jsx("br",{}),a.jsxs("div",{className:"text-center py-12",children:[a.jsx(An,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),a.jsx("h2",{className:"text-xl text-white font-light mb-2",children:"Organization Not Found"}),a.jsx("p",{className:"text-gray-400",children:"The organization you're looking for doesn't exist."})]})]})}function aV(){const[e,t]=m.useState([]),[n,s]=m.useState(!0),[r,i]=m.useState(""),[o,l]=m.useState("all"),[c,u]=m.useState(!1),[h,d]=m.useState(!1),[f,x]=m.useState(!1),[y,v]=m.useState(!1),[j,g]=m.useState(!1),[b,p]=m.useState(null),[w,N]=m.useState([]),[S,C]=m.useState(!1),T=m.useCallback(async()=>{try{const D=await(await fetch("/api/sessions")).json();t(D.sessions||[])}catch{}finally{s(!1)}},[]);m.useEffect(()=>{T()},[T]);const O=async E=>{N([]),C(!0),N([{id:"start",type:"info",message:`Starting session seeding process for ${E} sessions...`,timestamp:new Date}]);try{const _=await(await fetch("/api/seed/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:E})})).json();if(_.success){const I=_.results.map((P,W)=>P.success?{id:`session-${W}`,type:"progress",message:`Creating session: ${P.session.id}`,timestamp:new Date,status:"completed"}:{id:`session-${W}`,type:"error",message:`Failed to create session ${W+1}: ${P.error}`,timestamp:new Date});N(P=>[...P,...I]);const R=_.results.filter(P=>P.success).length;N(P=>[...P,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${R}/${E} sessions successfully`,timestamp:new Date}]),await T()}else N(I=>[...I,{id:"error",type:"error",message:`❌ Seeding failed: ${_.error||"Unknown error"}`,timestamp:new Date}])}catch(D){N(_=>[..._,{id:"error",type:"error",message:`❌ Network error: ${D}`,timestamp:new Date}])}finally{C(!1)}},H=async E=>{N([]),C(!0),N([{id:"start",type:"info",message:`Starting account seeding process for ${E} accounts...`,timestamp:new Date}]);try{const _=await(await fetch("/api/seed/accounts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:E})})).json();if(_.success){const I=_.results.map((P,W)=>P.success?{id:`account-${W}`,type:"progress",message:`Creating account: ${P.account.provider}`,timestamp:new Date,status:"completed"}:{id:`account-${W}`,type:"error",message:`Failed to create account ${W+1}: ${P.error}`,timestamp:new Date});N(P=>[...P,...I]);const R=_.results.filter(P=>P.success).length;N(P=>[...P,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${R}/${E} accounts successfully`,timestamp:new Date}]),await T()}else N(I=>[...I,{id:"error",type:"error",message:`❌ Seeding failed: ${_.error||"Unknown error"}`,timestamp:new Date}])}catch(D){N(_=>[..._,{id:"error",type:"error",message:`❌ Network error: ${D}`,timestamp:new Date}])}finally{C(!1)}},U=E=>{p(E),v(!0)},z=E=>{p(E),d(!0)},Y=E=>{p(E),x(!0)},k=async E=>{u(!1)},$=async E=>{d(!1)},M=async()=>{x(!1)},A=e.filter(E=>{const D=E.id.toLowerCase().includes(r.toLowerCase())||E.userId.toLowerCase().includes(r.toLowerCase()),_=o==="all"||o==="active"&&new Date(E.expiresAt)>new Date||o==="expired"&&new Date(E.expiresAt)<=new Date;return D&&_});return n?a.jsx("div",{className:"flex items-center justify-center h-32",children:a.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[a.jsx(Vs,{className:"w-6 h-6 text-white animate-spin"}),a.jsx("div",{className:"text-white text-sm",children:"Loading sessions..."})]})}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl relative text-white font-light inline-flex items-start",children:["Sessions",a.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white font-mono text-sm",children:e.length}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 mt-1 uppercase font-mono text-sm font-light",children:"Manage user sessions and accounts"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(F,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",onClick:()=>g(!0),children:[a.jsx(Nt,{className:"w-4 h-4 mr-2"}),"Seed"]}),a.jsxs(F,{className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",onClick:()=>u(!0),children:[a.jsx(ur,{className:"w-4 h-4 mr-2"}),"Add Session"]})]})]}),a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsxs("div",{className:"flex-1 relative",children:[a.jsx(oi,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx(Fe,{placeholder:"Search sessions...",value:r,onChange:E=>i(E.target.value),className:"pl-10 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(e0,{className:"w-4 h-4 text-gray-400"}),a.jsxs(Zr,{value:o,onValueChange:l,children:[a.jsx(Qr,{children:a.jsx(_0,{})}),a.jsxs(Kr,{children:[a.jsx(yn,{value:"all",children:"All"}),a.jsx(yn,{value:"active",children:"Active"}),a.jsx(yn,{value:"expired",children:"Expired"})]})]})]})]}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Session"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"User ID"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Status"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Expires"}),a.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),a.jsx("tbody",{children:A.map(E=>a.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5",children:[a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-10 h-10 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(Nt,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{children:[a.jsxs("div",{className:"text-white font-light",children:["Session ",E.id.slice(0,8),"..."]}),a.jsx(Rn,{id:E.id})]})]})}),a.jsx("td",{className:"py-4 px-4 text-white",children:E.userId}),a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[new Date(E.expiresAt)>new Date?a.jsx("div",{className:"w-2 h-2 bg-green-400 rounded-full"}):a.jsx("div",{className:"w-2 h-2 bg-red-400 rounded-full"}),a.jsx("span",{className:"text-sm text-gray-400",children:new Date(E.expiresAt)>new Date?"Active":"Expired"})]})}),a.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:new Date(E.expiresAt).toLocaleDateString()}),a.jsx("td",{className:"py-4 px-4 text-right",children:a.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[a.jsx(F,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:()=>U(E),children:a.jsx(Xo,{className:"w-4 h-4"})}),a.jsx(F,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:()=>z(E),children:a.jsx(ii,{className:"w-4 h-4"})}),a.jsx(F,{variant:"ghost",size:"sm",className:"text-red-400 hover:text-red-300 rounded-none",onClick:()=>Y(E),children:a.jsx(t0,{className:"w-4 h-4"})})]})})]},E.id))})]})})}),j&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-2xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Seed Data"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>g(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Wt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Nt,{className:"w-5 h-5 text-white"}),a.jsx("h4",{className:"text-white font-light",children:"Seed Sessions"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(Xe,{htmlFor:"session-count",className:"text-sm text-gray-400 font-light",children:"Number of sessions"}),a.jsx(Fe,{id:"session-count",type:"number",min:"1",max:"100",defaultValue:"5",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx(F,{onClick:()=>{var D;const E=parseInt(((D=document.getElementById("session-count"))==null?void 0:D.value)||"5",10);O(E)},disabled:S,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:S?a.jsxs(a.Fragment,{children:[a.jsx(Vs,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Nt,{className:"w-3 h-3 mr-2"}),"Seed Sessions"]})})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(jy,{className:"w-5 h-5 text-white"}),a.jsx("h4",{className:"text-white font-light",children:"Seed Accounts"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(Xe,{htmlFor:"account-count",className:"text-sm text-gray-400 font-light",children:"Number of accounts"}),a.jsx(Fe,{id:"account-count",type:"number",min:"1",max:"100",defaultValue:"5",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx(F,{onClick:()=>{var D;const E=parseInt(((D=document.getElementById("account-count"))==null?void 0:D.value)||"5",10);H(E)},disabled:S,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:S?a.jsxs(a.Fragment,{children:[a.jsx(Vs,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(jy,{className:"w-3 h-3 mr-2"}),"Seed Accounts"]})})]})]}),w.length>0&&a.jsx("div",{className:"mt-6",children:a.jsx(fi,{title:"Session Seeding Terminal",lines:w,isRunning:S,className:"w-full",defaultCollapsed:!0})})]}),a.jsx("div",{className:"flex justify-end mt-6 pt-6 border-t border-dashed border-white/10",children:a.jsx(F,{variant:"outline",onClick:()=>g(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),c&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Create Session"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>u(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Wt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"create-user-id",className:"text-sm text-gray-400 font-light",children:"User ID"}),a.jsx(Fe,{id:"create-user-id",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"create-expires",className:"text-sm text-gray-400 font-light",children:"Expires At"}),a.jsx(Fe,{id:"create-expires",type:"datetime-local",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>u(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:()=>k(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Create"})]})]})}),h&&b&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Edit Session"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>d(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Wt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(Nt,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsxs("div",{className:"text-white font-light",children:["Session ",b.id.slice(0,8),"..."]}),a.jsx("div",{className:"text-sm text-gray-400",children:b.userId})]})]}),a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"edit-user-id",className:"text-sm text-gray-400 font-light",children:"User ID"}),a.jsx(Fe,{id:"edit-user-id",defaultValue:b.userId,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"edit-expires",className:"text-sm text-gray-400 font-light",children:"Expires At"}),a.jsx(Fe,{id:"edit-expires",type:"datetime-local",defaultValue:new Date(b.expiresAt).toISOString().slice(0,16),className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>d(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:()=>$(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),f&&b&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Delete Session"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>x(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Wt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(Nt,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsxs("div",{className:"text-white font-light",children:["Session ",b.id.slice(0,8),"..."]}),a.jsx("div",{className:"text-sm text-gray-400",children:b.userId})]})]}),a.jsx("p",{className:"text-gray-400",children:"Are you sure you want to delete this session? This action cannot be undone."})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>x(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:M,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none",children:"Delete"})]})]})}),y&&b&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Session Details"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>v(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Wt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(Nt,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsxs("div",{className:"text-white font-light",children:["Session ",b.id.slice(0,8),"..."]}),a.jsx("div",{className:"text-sm text-gray-400",children:b.userId})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Rn,{id:b.id,variant:"detail"}),a.jsx(Rn,{id:b.userId,label:"User ID",variant:"detail"}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Status:"}),a.jsx("span",{className:"text-white text-sm",children:new Date(b.expiresAt)>new Date?"Active":"Expired"})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Expires:"}),a.jsx("span",{className:"text-white text-sm",children:new Date(b.expiresAt).toLocaleString()})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Created:"}),a.jsx("span",{className:"text-white text-sm",children:new Date(b.createdAt).toLocaleString()})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Updated:"}),a.jsx("span",{className:"text-white text-sm",children:new Date(b.updatedAt).toLocaleString()})]})]})]}),a.jsx("div",{className:"flex justify-end mt-6",children:a.jsx(F,{onClick:()=>v(!1),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Close"})})]})})]})}function rV(){var b,p,w,N,S,C,T,O,H,U,z,Y,k,$,M,A,E,D,_,I,R,P,W,q,ee,ne,Z,se,xe;const[e,t]=m.useState(null),[n,s]=m.useState(null),[r,i]=m.useState(null),[o,l]=m.useState(null),[c,u]=m.useState(!0),[h,d]=m.useState(null);j4(ae=>{ae.type==="config_changed"?setTimeout(()=>{f(),x(),y(),v()},500):ae.type});const f=m.useCallback(async()=>{var ae;try{const de=await(await fetch("/api/config")).json();(ae=de.studio)!=null&&ae.version&&d(`v${de.studio.version}`),t(de)}catch{}finally{u(!1)}},[]),x=m.useCallback(async()=>{try{const ce=await(await fetch("/api/health")).json();s(ce.system||{studioVersion:h||"v1.0.0",nodeVersion:process.version,platform:navigator.platform,uptime:"2h 15m"})}catch{s({studioVersion:h||"v1.0.0",nodeVersion:"v18.0.0",platform:"macOS",uptime:"2h 15m"})}},[h]),y=m.useCallback(async()=>{try{const ce=await(await fetch("/api/plugins")).json();i(ce)}catch{i({plugins:[],configPath:null,totalPlugins:0,error:"Failed to fetch plugins"})}},[]),v=m.useCallback(async()=>{try{const ce=await(await fetch("/api/db")).json();l(ce)}catch{l({success:!1,name:"unknown",version:"unknown",dialect:"unknown",adapter:"unknown",displayName:"Unknown",autoDetected:!1,message:"Failed to fetch database info"})}},[]),j=ae=>{switch(ae==null?void 0:ae.toLowerCase()){case"postgresql":case"postgres":return a.jsxs(vt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:[a.jsx(Ht,{className:"w-3 h-3"}),"Connected"]});case"mysql":return a.jsxs(vt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:[a.jsx(Ht,{className:"w-3 h-3"}),"Connected"]});case"sqlite":return a.jsxs(vt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:[a.jsx(Hd,{className:"w-3 h-3"}),"Local"]});default:return a.jsxs(vt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:[a.jsx(Ms,{className:"w-3 h-3"}),"Unknown"]})}};m.useEffect(()=>{f(),x(),y(),v()},[f,v,y,x]);const g=ae=>{switch(ae.toLowerCase()){case"google":return a.jsx(sn,{className:"w-5 h-5 text-white"});case"github":return a.jsx(kn,{className:"w-5 h-5 text-white"});case"discord":return a.jsx(sn,{className:"w-5 h-5 text-white"});case"twitter":return a.jsx(sn,{className:"w-5 h-5 text-white"});default:return a.jsx(sn,{className:"w-5 h-5 text-white"})}};return c?a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-white"})}):a.jsxs("div",{className:"space-y-8 animate-fade-in",children:[a.jsx("div",{className:"flex items-center justify-between p-5 pt-7",children:a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-normal text-white tracking-tight",children:"Settings"}),a.jsx("p",{className:"text-gray-300 mt-2 uppercase font-mono font-light text-xs",children:"Configure your Better Auth application"})]})}),a.jsx("hr",{className:"w-full border-white/15 h-px"}),a.jsx("hr",{className:"w-full border-white/15 h-px"}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8 p-5",children:[a.jsxs(In,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[a.jsxs(Wn,{className:"space-y-0",children:[a.jsxs(qn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(uo,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"Application"})]}),a.jsxs(Ts,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Basic application configuration"]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsxs(Xn,{className:"space-y-0 px-0 pb-0 border-b-none",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(sn,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"App Name"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Application display name"})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("p",{className:"text-sm font-medium text-white",children:(e==null?void 0:e.appName)||"Better Auth"})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(co,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Base URL"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Application base URL"})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("p",{className:"text-sm font-mono font-medium text-white",children:(e==null?void 0:e.baseURL)||"http://localhost:3000"})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(xu,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Base Path"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Auth API base path"})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("p",{className:"text-sm font-mono font-medium text-white",children:(e==null?void 0:e.basePath)||"/api/auth"})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(kn,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Secret"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Encryption secret"})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("p",{className:"text-sm font-medium text-white",children:(e==null?void 0:e.secret)==="Configured"?"Configured":"Not set"})})]})]})]}),a.jsxs(In,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[a.jsxs(Wn,{className:"space-y-0",children:[a.jsxs(qn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(Nt,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"Database"})]}),a.jsxs(Ts,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Database connection and configuration"]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsxs(Xn,{className:"space-y-0 px-0 pb-0 border-b-none",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Nt,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:(o==null?void 0:o.displayName)||((b=e==null?void 0:e.database)==null?void 0:b.type)&&((p=e==null?void 0:e.database)==null?void 0:p.type.charAt(0).toUpperCase())+((w=e==null?void 0:e.database)==null?void 0:w.type.slice(1))||"Unknown"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Database Type"})]})]}),((o==null?void 0:o.name)||((N=e==null?void 0:e.database)==null?void 0:N.type))&&j((o==null?void 0:o.name)||((S=e==null?void 0:e.database)==null?void 0:S.type)||"")]}),((o==null?void 0:o.dialect)||((C=e==null?void 0:e.database)==null?void 0:C.dialect))&&(o==null?void 0:o.dialect)!=="unknown"&&a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Nt,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Dialect"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Database dialect"})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("p",{className:"text-sm font-medium text-white",children:((T=e==null?void 0:e.database)==null?void 0:T.dialect)||(o==null?void 0:o.dialect)})})]}),((O=e==null?void 0:e.database)==null?void 0:O.url)&&a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(co,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Connection URL"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Database connection string"})]})]}),a.jsxs(vt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:[a.jsx(Ht,{className:"w-3 h-3"}),"Configured"]})]}),((H=e==null?void 0:e.database)==null?void 0:H.casing)&&a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(uo,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Casing"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Table name casing"})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("p",{className:"text-sm font-medium text-white capitalize",children:e.database.casing})})]}),(e==null?void 0:e.database)&&a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(xg,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Debug Logs"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Database debug logging"})]})]}),a.jsx(vt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:e.database.debugLogs?a.jsxs(a.Fragment,{children:[a.jsx(Ms,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Ht,{className:"w-3 h-3"}),"Disabled"]})})]}),!(o!=null&&o.success)&&!(e!=null&&e.database)&&a.jsxs("div",{className:"flex items-center justify-between p-3 px-5",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Ms,{className:"w-5 h-5 text-yellow-400"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"No Database Detected"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:(o==null?void 0:o.message)||"No supported database packages found"})]})]}),a.jsx(vt,{variant:"secondary",className:"text-xs bg-yellow-900/50 border border-yellow-500/30 text-yellow-400 rounded-sm",children:"Unknown"})]})]})]}),a.jsxs(In,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[a.jsxs(Wn,{className:"space-y-0",children:[a.jsxs(qn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(kn,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"Providers"})]}),a.jsxs(Ts,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Configured authentication providers"]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsx(Xn,{className:"p-0",children:e!=null&&e.socialProviders&&e.socialProviders.length>0?e.socialProviders.map((ae,ce)=>a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15 last:border-b-0",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[g(ae.type),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white capitalize",children:ae.type}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:ae.clientId?"Configured":"Not configured"})]})]}),a.jsx(vt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:ae.clientId?a.jsxs(a.Fragment,{children:[a.jsx(Ht,{className:"w-3 h-3"}),"Active"]}):a.jsxs(a.Fragment,{children:[a.jsx(Ms,{className:"w-3 h-3"}),"Setup Required"]})})]},ce)):a.jsxs("div",{className:"text-center py-8",children:[a.jsx(kn,{className:"w-8 h-8 text-white mx-auto mb-2"}),a.jsx("p",{className:"text-sm text-gray-400",children:"No providers configured"})]})})]}),a.jsxs(In,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[a.jsxs(Wn,{className:"space-y-0",children:[a.jsxs(qn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(uh,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"Email & Password"})]}),a.jsxs(Ts,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Email authentication settings"]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsxs(Xn,{className:"p-0",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(uh,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Email Authentication"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Allow users to sign up with email"})]})]}),a.jsx(vt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(U=e==null?void 0:e.emailAndPassword)!=null&&U.enabled?a.jsxs(a.Fragment,{children:[a.jsx(Ht,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx($r,{className:"w-3 h-3"}),"Disabled"]})})]}),((z=e==null?void 0:e.emailAndPassword)==null?void 0:z.enabled)&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(li,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Sign Up"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Allow new user registration"})]})]}),a.jsx(vt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(Y=e==null?void 0:e.emailAndPassword)!=null&&Y.disableSignUp?a.jsxs(a.Fragment,{children:[a.jsx($r,{className:"w-3 h-3"}),"Disabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Ht,{className:"w-3 h-3"}),"Enabled"]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(kn,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Email Verification"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Require email verification"})]})]}),a.jsx(vt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(k=e==null?void 0:e.emailAndPassword)!=null&&k.requireEmailVerification?a.jsxs(a.Fragment,{children:[a.jsx(Ht,{className:"w-3 h-3"}),"Required"]}):a.jsxs(a.Fragment,{children:[a.jsx(Ms,{className:"w-3 h-3"}),"Optional"]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(xu,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Password Length"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Min/Max password length"})]})]}),a.jsx("div",{className:"text-right",children:a.jsxs("p",{className:"text-sm font-medium text-white",children:[(($=e==null?void 0:e.emailAndPassword)==null?void 0:$.minPasswordLength)||8," -"," ",((M=e==null?void 0:e.emailAndPassword)==null?void 0:M.maxPasswordLength)||128]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Em,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Auto Sign In"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Auto sign in after registration"})]})]}),a.jsx(vt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(A=e==null?void 0:e.emailAndPassword)!=null&&A.autoSignIn?a.jsxs(a.Fragment,{children:[a.jsx(Ht,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Ms,{className:"w-3 h-3"}),"Disabled"]})})]})]})]})]}),a.jsxs(In,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[a.jsxs(Wn,{className:"space-y-0",children:[a.jsxs(qn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(Ld,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"Session"})]}),a.jsxs(Ts,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Session management settings"]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsxs(Xn,{className:"p-0",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Ld,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Session Duration"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"How long sessions last"})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-sm font-medium text-white",children:(E=e==null?void 0:e.session)!=null&&E.expiresIn?`${Math.floor(e.session.expiresIn/(60*60*24))} days`:"7 days"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Default"})]})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(xg,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Update Age"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Session refresh interval"})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("p",{className:"text-sm font-medium text-white",children:(D=e==null?void 0:e.session)!=null&&D.updateAge?`${Math.floor(e.session.updateAge/(60*60))} hours`:"24 hours"})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Em,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Session Refresh"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Auto refresh sessions"})]})]}),a.jsx(vt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(_=e==null?void 0:e.session)!=null&&_.disableSessionRefresh?a.jsxs(a.Fragment,{children:[a.jsx($r,{className:"w-3 h-3"}),"Disabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Ht,{className:"w-3 h-3"}),"Enabled"]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Nt,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Store in Database"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Store sessions in database"})]})]}),a.jsx(vt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(I=e==null?void 0:e.session)!=null&&I.storeSessionInDatabase?a.jsxs(a.Fragment,{children:[a.jsx(Ht,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Hd,{className:"w-3 h-3"}),"Secondary Storage"]})})]})]})]}),a.jsxs(In,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[a.jsxs(Wn,{className:"space-y-0",children:[a.jsxs(qn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(kn,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"Rate Limiting"})]}),a.jsxs(Ts,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"API rate limiting configuration"]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsxs(Xn,{className:"p-0",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(kn,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Rate Limiting"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Enable rate limiting"})]})]}),a.jsx(vt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(R=e==null?void 0:e.rateLimit)!=null&&R.enabled?a.jsxs(a.Fragment,{children:[a.jsx(Ht,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Ms,{className:"w-3 h-3"}),"Disabled"]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Ld,{className:"w-5 h-5 text-red-400"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Rate Limit Window"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Time window for rate limiting"})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-sm font-medium text-white",children:(P=e==null?void 0:e.rateLimit)!=null&&P.window?`${e.rateLimit.window} seconds`:"10 seconds"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Window"})]})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(kn,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Max Requests"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Maximum requests per window"})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-sm font-medium text-white",children:((W=e==null?void 0:e.rateLimit)==null?void 0:W.max)||100}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Requests"})]})]}),a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Nt,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Storage"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Rate limit storage type"})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("p",{className:"text-sm font-medium text-white capitalize",children:((q=e==null?void 0:e.rateLimit)==null?void 0:q.storage)||"memory"})})]})]})]}),a.jsxs(In,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[a.jsxs(Wn,{className:"space-y-0",children:[a.jsxs(qn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(uo,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"Advanced"})]}),a.jsxs(Ts,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Advanced configuration options"]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsxs(Xn,{className:"p-0",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(xu,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Secure Cookies"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Use secure cookies"})]})]}),a.jsx(vt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(ee=e==null?void 0:e.advanced)!=null&&ee.useSecureCookies?a.jsxs(a.Fragment,{children:[a.jsx(Ht,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Ms,{className:"w-3 h-3"}),"Disabled"]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(kn,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"CSRF Check"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"CSRF protection"})]})]}),a.jsx(vt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(ne=e==null?void 0:e.advanced)!=null&&ne.disableCSRFCheck?a.jsxs(a.Fragment,{children:[a.jsx($r,{className:"w-3 h-3"}),"Disabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Ht,{className:"w-3 h-3"}),"Enabled"]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Xo,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"IP Tracking"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Track IP addresses"})]})]}),a.jsx(vt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(se=(Z=e==null?void 0:e.advanced)==null?void 0:Z.ipAddress)!=null&&se.disableIpTracking?a.jsxs(a.Fragment,{children:[a.jsx($r,{className:"w-3 h-3"}),"Disabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Ht,{className:"w-3 h-3"}),"Enabled"]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(tR,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Telemetry"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Usage analytics"})]})]}),a.jsx(vt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(xe=e==null?void 0:e.telemetry)!=null&&xe.enabled?a.jsxs(a.Fragment,{children:[a.jsx(Ms,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Ht,{className:"w-3 h-3"}),"Disabled"]})})]})]})]}),a.jsxs(In,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[a.jsxs(Wn,{className:"space-y-0",children:[a.jsxs(qn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(Hd,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"System Info"})]}),a.jsxs(Ts,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Better Auth Studio system information"]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsxs(Xn,{className:"p-0",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Em,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Studio Version"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Better Auth Studio"})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-sm font-medium text-white",children:h||"v1.0.0"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Latest"})]})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Hd,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Node.js Version"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Runtime environment"})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-sm font-medium text-white",children:(n==null?void 0:n.nodeVersion)||"v18.0.0"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Current"})]})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(sn,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Platform"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Operating system"})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-sm font-medium text-white",children:(n==null?void 0:n.platform)||"macOS"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"System"})]})]}),a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Ld,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Uptime"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Service uptime"})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-sm font-medium text-white",children:(n==null?void 0:n.uptime)||"2h 15m"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Running"})]})]})]})]}),a.jsxs(In,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none lg:col-span-2",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsxs(Wn,{className:"space-y-0",children:[a.jsxs(qn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(yy,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"Plugins"})]}),a.jsxs(Ts,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Better Auth plugins enabled in your configuration"]})]}),a.jsxs("div",{className:"pr-6",children:[a.jsx("p",{className:"text-sm font-medium text-white",children:(r==null?void 0:r.totalPlugins)||0}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Active"})]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsx(Xn,{className:"space-y-0 px-0 pb-0 border-b-none",children:r!=null&&r.plugins&&r.plugins.length>0?a.jsxs(a.Fragment,{children:[r.plugins.map((ae,ce)=>a.jsxs("div",{className:`flex items-center justify-between p-3 px-5 ${ce<r.plugins.length-1?"border-b border-white/15":""}`,children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(yy,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:ae.name.slice(0,1).toUpperCase()+ae.name.slice(1).replace("-"," ")}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:ae.description})]})]}),a.jsx("div",{className:"text-right flex items-center space-x-2",children:a.jsxs(vt,{variant:"secondary",className:"text-xs bg-green-900/50 border border-dashed rounded-none border-green-500/30 text-green-400 flex items-center gap-1",children:[a.jsx(Ht,{className:"w-3 h-3"}),"Enabled"]})})]},ae.id)),r.configPath&&a.jsx("div",{className:"p-4 px-5 bg-black/30 border-t border-white/10",children:a.jsxs("p",{className:"text-xs text-gray-400",children:["Config file:"," ",a.jsx("span",{className:"text-white font-mono",children:r.configPath})]})})]}):a.jsxs("div",{className:"flex items-center justify-between p-4 px-5",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Ms,{className:"w-5 h-5 text-yellow-400"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-white",children:"No Plugins Enabled"}),a.jsx("p",{className:"text-xs text-gray-400",children:(r==null?void 0:r.error)||"No plugins are currently configured in your Better Auth setup"})]})]}),a.jsx(vt,{variant:"secondary",className:"text-xs bg-yellow-900/50 border border-yellow-500/30 text-yellow-400 rounded-sm",children:"None"})]})})]})]})]})}function Mw(){var M,A;const{orgId:e,teamId:t}=zp(),n=ws(),[s,r]=m.useState(null),[i,o]=m.useState([]),[l,c]=m.useState(!0),[u,h]=m.useState("details"),[d,f]=m.useState(!1),[x,y]=m.useState(!1),[v,j]=m.useState(""),[g,b]=m.useState([]),[p,w]=m.useState([]),[N,S]=m.useState({name:""}),C=m.useCallback(async()=>{if(t)try{const D=await(await fetch(`/api/teams/${t}`)).json();D.success&&D.team?(r(D.team),S({name:D.team.name})):D.team?(r(D.team),S({name:D.team.name})):B.error("Team not found")}catch{B.error("Failed to load team")}finally{c(!1)}},[t]),T=m.useCallback(async()=>{if(t)try{const D=await(await fetch(`/api/teams/${t}/members`)).json();D.success&&o(D.members||[])}catch{B.error("Failed to load team members")}},[t]),O=async()=>{try{const D=await(await fetch("/api/users?limit=10000")).json(),_=i.map(R=>R.userId),I=(D.users||[]).filter(R=>!_.includes(R.id));b(I)}catch{B.error("Failed to load users")}};m.useEffect(()=>{t&&(C(),T())},[t,C,T]);const H=async()=>{if(!N.name){B.error("Please enter a team name");return}const E=B.loading("Updating team...");try{const _=await(await fetch(`/api/teams/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:N.name})})).json();_.success?(await C(),y(!1),B.success("Team updated successfully!",{id:E})):B.error(`Error updating team: ${_.error||"Unknown error"}`,{id:E})}catch{B.error("Error updating team",{id:E})}},U=async()=>{if(p.length===0){B.error("Please select at least one user");return}const E=B.loading(`Adding ${p.length} members...`);try{const _=await(await fetch(`/api/teams/${t}/members`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userIds:p})})).json();_.success?(await T(),f(!1),w([]),j(""),B.success(`Successfully added ${p.length} members!`,{id:E})):B.error(`Error adding members: ${_.error||"Unknown error"}`,{id:E})}catch{B.error("Error adding members",{id:E})}},z=async(E,D)=>{const _=B.loading(`Removing ${D}...`);try{const R=await(await fetch(`/api/team-members/${E}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();R.success?(await T(),B.success(`${D} removed from team!`,{id:_})):B.error(`Error removing member: ${R.error||"Unknown error"}`,{id:_})}catch{B.error("Error removing team member",{id:_})}},Y=()=>{O(),f(!0)},k=E=>{w(D=>D.includes(E)?D.filter(_=>_!==E):[...D,E])},$=g.filter(E=>E.name.toLowerCase().includes(v.toLowerCase())||E.email.toLowerCase().includes(v.toLowerCase()));return l?a.jsx("div",{className:"flex items-center justify-center h-32",children:a.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[a.jsx(tr,{className:"w-6 h-6 text-white animate-spin"}),a.jsx("div",{className:"text-white text-sm",children:"Loading team details..."})]})}):s?a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("div",{className:"flex items-center space-x-4",children:a.jsx("span",{className:"mb-4 ml-0 flex justify-start items-start text-left border-none text-white",children:a.jsxs("span",{className:"font-light",children:[a.jsxs("span",{onClick:()=>n(`/organizations/${s.organizationId}`),className:"uppercase cursor-pointer text-white/80 font-mono text-sm",children:["teams /"," "]}),a.jsx("span",{className:"text-white font-mono text-sm",children:t})]})})}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(F,{onClick:Y,className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[a.jsx(Zl,{className:"w-4 h-4 mr-2"}),"Add Members"]}),a.jsxs(F,{onClick:()=>y(!0),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[a.jsx(ii,{className:"w-4 h-4 mr-2"}),"Edit Team"]})]})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-12 h-12 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:a.jsx(ft,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl text-white font-light inline-flex items-center",children:[s.name,t&&a.jsx(Rn,{id:t,variant:"subscript"})]}),a.jsx("div",{className:"flex items-center space-x-2 mt-1",children:s.organization&&a.jsxs(Rp,{to:`/organizations/${s.organizationId}`,className:"text-gray-400 hover:text-white text-sm font-sans",children:[a.jsx(An,{className:"w-4 h-4 inline mr-1"}),s.organization.name]})})]})]}),a.jsx("div",{className:"border-b border-white/10",children:a.jsxs("nav",{className:"flex space-x-8",children:[a.jsxs("button",{onClick:()=>h("details"),className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${u==="details"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[a.jsx(ft,{className:"w-4 h-4"}),a.jsx("span",{children:"Details"})]}),a.jsxs("button",{onClick:()=>h("members"),className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${u==="members"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[a.jsx(ft,{className:"w-4 h-4"}),a.jsxs("span",{className:"inline-flex items-start",children:["Members",a.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:a.jsx(xs,{value:i.length,className:"text-white/80 font-mono text-xs",prefix:a.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]})]})}),u==="details"&&a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:[a.jsx("h3",{className:"text-lg text-white font-light mb-4",children:"Team Information"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Name"}),a.jsx("p",{className:"text-white font-sans mt-1",children:s.name})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Organization"}),a.jsx("p",{className:"text-white font-sans mt-1",children:((M=s.organization)==null?void 0:M.name)||"Unknown"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Created"}),a.jsx("p",{className:"text-white font-sans mt-1",children:new Date(s.createdAt).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Last Updated"}),a.jsx("p",{className:"text-white font-sans mt-1",children:new Date(s.updatedAt).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(ft,{className:"w-8 h-8 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl text-white font-sans font-light",children:i.length}),a.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Members"})]})]})}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(ls,{className:"w-8 h-8 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl text-white font-sans font-light",children:Math.ceil((Date.now()-new Date(s.createdAt).getTime())/(1e3*60*60*24))}),a.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Days Active"})]})]})}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(An,{className:"w-8 h-8 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl text-white font-sans font-light",children:"1"}),a.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Organization"})]})]})})]})]}),u==="members"&&a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{children:[a.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Team Members",a.jsx(xs,{value:i.length,className:"text-white/80 font-mono text-xs",prefix:a.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})]}),a.jsx("p",{className:"text-gray-400 font-light font-mono text-xs uppercase mt-1",children:"Manage members of this team"})]})}),i.length>0?a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"User"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Email"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Role"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Joined"}),a.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),a.jsx("tbody",{children:i.map(E=>a.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5",children:[a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("img",{src:E.user.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${E.user.id}`,alt:E.user.name,className:"w-10 h-10 rounded-none border border-dashed border-white/20"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:E.user.name}),a.jsx(Rn,{id:E.user.id})]})]})}),a.jsx("td",{className:"py-4 px-4 text-white",children:E.user.email}),a.jsx("td",{className:"py-4 px-4",children:a.jsx(vt,{variant:"secondary",className:"text-xs bg-blue-900/10 border border-dashed border-blue-500/30 text-blue-400/70 rounded-none capitalize",children:E.role})}),a.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:new Date(E.joinedAt).toLocaleDateString()}),a.jsx("td",{className:"py-4 px-4 text-right",children:a.jsx("div",{className:"flex items-center justify-end space-x-2",children:a.jsxs(F,{variant:"outline",size:"sm",className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",onClick:()=>z(E.id,E.user.name),children:[a.jsx(wu,{className:"w-4 h-4 mr-1"}),"Remove"]})})})]},E.id))})]})})}):a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-12",children:a.jsxs("div",{className:"text-center",children:[a.jsx(ft,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"No Members Yet"}),a.jsx("p",{className:"text-gray-400 mb-6",children:"Add members to this team to get started."}),a.jsxs(F,{onClick:Y,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[a.jsx(Zl,{className:"w-4 h-4 mr-2"}),"Add First Members"]})]})})]}),d&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-2xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Add Team Members"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>{f(!1),w([]),j("")},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Jt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"relative",children:[a.jsx(FC,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx(Fe,{placeholder:"Search users by name or email...",value:v,onChange:E=>j(E.target.value),className:"pl-10 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),p.length>0&&a.jsx("div",{className:"bg-blue-900/20 border border-blue-500/30 rounded-none p-3",children:a.jsxs("p",{className:"text-blue-400 text-sm",children:[p.length," user",p.length!==1?"s":""," selected"]})}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none max-h-96 overflow-y-auto",children:$.length>0?a.jsx("div",{className:"divide-y divide-white/5",children:$.map(E=>a.jsxs("div",{className:`flex items-center space-x-3 p-4 cursor-pointer hover:bg-white/5 ${p.includes(E.id)?"bg-blue-900/20":""}`,onClick:()=>k(E.id),children:[a.jsx("input",{type:"checkbox",checked:p.includes(E.id),onChange:()=>k(E.id),className:"rounded border-gray-300"}),a.jsx("img",{src:E.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${E.id}`,alt:E.name,className:"w-10 h-10 rounded-none border border-dashed border-white/20"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-white font-light",children:E.name}),a.jsx("div",{className:"text-sm text-gray-400",children:E.email})]})]},E.id))}):a.jsx("div",{className:"p-8 text-center",children:a.jsx("p",{className:"text-gray-400",children:"No users found matching your search."})})})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>{f(!1),w([]),j("")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsxs(F,{onClick:U,disabled:p.length===0,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none disabled:opacity-50",children:[a.jsx(Zl,{className:"w-4 h-4 mr-2"}),"Add ",p.length," Member",p.length!==1?"s":""]})]})]})}),x&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Edit Team"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>y(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Jt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:a.jsx(ft,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:s.name}),a.jsx("div",{className:"text-sm text-gray-400",children:(A=s.organization)==null?void 0:A.name})]})]}),a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"edit-team-name",className:"text-sm text-gray-400 font-light",children:"Team Name"}),a.jsx(Fe,{id:"edit-team-name",value:N.name,onChange:E=>S({name:E.target.value}),placeholder:"e.g. Development Team",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>y(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:H,disabled:N.name===s.name,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update Team"})]})]})})]}):a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsx("div",{className:"flex items-center space-x-4",children:a.jsx("span",{className:"mb-4 ml-0 flex justify-start items-start text-left border-none text-white",children:a.jsxs("span",{className:"font-light",children:[a.jsxs("span",{onClick:()=>n(`/organizations/${e}`),className:"uppercase cursor-pointer text-white/80 font-mono text-sm",children:["teams /"," "]}),a.jsx("span",{className:"text-white font-mono text-sm",children:t})]})})}),a.jsxs("div",{className:"text-center py-12",children:[a.jsx(ft,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),a.jsx("h2",{className:"text-xl text-white font-light mb-2",children:"Team Not Found"}),a.jsx("p",{className:"text-gray-400",children:"The team you're looking for doesn't exist."})]})]})}function iV(){const e=ws(),[t,n]=m.useState([]),[s,r]=m.useState(!0),[i,o]=m.useState(null),[l,c]=m.useState(""),[u,h]=m.useState("all"),[d,f]=m.useState(1),[x]=m.useState(20);m.useEffect(()=>{y()},[]);const y=async()=>{try{const S=await(await fetch("/api/plugins")).json(),C=(S==null?void 0:S.plugins).find(T=>T.id==="teams");o({enabled:!!C,availablePlugins:(S==null?void 0:S.plugins).map(T=>T.id),configPath:S.configPath,teamsPlugin:(S==null?void 0:S.plugins).find(T=>T.id==="teams")}),C?await v():r(!1)}catch(N){console.error("Failed to check teams plugin status:",N),o({enabled:!1,error:"Failed to check plugin status"}),r(!1)}},v=async()=>{try{const S=await(await fetch("/api/teams")).json();S.success&&n(S.teams||[])}catch(N){console.error("Failed to fetch teams:",N),B.error("Failed to load teams")}finally{r(!1)}},j=t.filter(N=>{var C;const S=N.name.toLowerCase().includes(l.toLowerCase())||((C=N.organization)==null?void 0:C.name.toLowerCase().includes(l.toLowerCase()));if(u==="all")return S;if(u==="recent"){const T=new Date;return T.setDate(T.getDate()-7),S&&new Date(N.createdAt)>T}return S}),g=d*x,b=g-x,p=j.slice(b,g),w=Math.ceil(j.length/x);return s?a.jsx("div",{className:"flex items-center justify-center min-h-screen",children:a.jsx(Vs,{className:"w-8 h-8 animate-spin text-white"})}):i!=null&&i.enabled?a.jsxs("div",{className:"p-6 space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl relative text-white font-light inline-flex items-start",children:["Teams",a.jsx("sup",{className:"text-xs text-gray-500 ml-1 mt-0 inline-flex items-baseline",children:a.jsx(xs,{value:j.length,className:"text-white font-mono text-sm",prefix:a.jsx("span",{className:"mr-1 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-1 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]}),a.jsxs("p",{className:"text-gray-400 mt-1 uppercase font-mono text-sm font-light flex items-baseline gap-1",children:[a.jsx(xs,{value:j.length,className:"text-white font-mono text-sm",format:{notation:"standard",maximumFractionDigits:0}}),a.jsxs("span",{children:["team",j.length!==1?"s":""," found"]})]})]}),a.jsx("div",{className:"flex items-center space-x-3",children:a.jsxs(F,{onClick:()=>e("/teams/new"),className:"bg-white text-black hover:bg-gray-200 border-dashed",children:[a.jsx(ur,{className:"w-4 h-4 mr-2"}),"Create Team"]})})]}),a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsxs("div",{className:"relative flex-1 max-w-md",children:[a.jsx(oi,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx(Fe,{type:"text",placeholder:"Search teams...",value:l,onChange:N=>c(N.target.value),className:"pl-10 bg-black border-dashed border-white/20 text-white placeholder-gray-400 focus:ring-2 focus:ring-white focus:border-transparent"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(F,{variant:u==="all"?"default":"outline",size:"sm",onClick:()=>h("all"),className:u==="all"?"bg-white text-black":"border-dashed border-white/20 text-white hover:bg-white/10",children:"All"}),a.jsx(F,{variant:u==="recent"?"default":"outline",size:"sm",onClick:()=>h("recent"),className:u==="recent"?"bg-white text-black":"border-dashed border-white/20 text-white hover:bg-white/10",children:"Recent"})]})]}),p.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(li,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-light text-white mb-2",children:"No teams found"}),a.jsx("p",{className:"text-gray-400 mb-6",children:l?"Try adjusting your search terms":"Get started by creating your first team"}),!l&&a.jsxs(F,{onClick:()=>e("/teams/new"),className:"bg-white text-black hover:bg-gray-200 border-dashed",children:[a.jsx(ur,{className:"w-4 h-4 mr-2"}),"Create Team"]})]}):a.jsx("div",{className:"grid gap-4",children:p.map(N=>{var S;return a.jsx("div",{className:"bg-black/30 border border-white/15 rounded-none p-4 hover:bg-black/40 transition-colors cursor-pointer",onClick:()=>e(`/teams/${N.id}`),children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsx("div",{className:"w-10 h-10 bg-white/10 rounded-none flex items-center justify-center",children:a.jsx(li,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-white font-medium",children:N.name}),a.jsxs("p",{className:"text-gray-400 text-sm",children:[(S=N.organization)==null?void 0:S.name," • ",N.memberCount||0," members"]})]})]}),a.jsx("div",{className:"flex items-center space-x-2",children:a.jsx(vt,{variant:"secondary",className:"text-xs bg-green-900/50 border border-dashed rounded-none border-green-500/30 text-green-400",children:"Active"})})]})},N.id)})}),w>1&&a.jsxs("div",{className:"flex items-center justify-center space-x-2",children:[a.jsx(F,{variant:"outline",size:"sm",onClick:()=>f(Math.max(1,d-1)),disabled:d===1,className:"border-dashed border-white/20 text-white hover:bg-white/10 disabled:opacity-50",children:"Previous"}),a.jsxs("span",{className:"text-gray-400 text-sm",children:["Page ",d," of ",w]}),a.jsx(F,{variant:"outline",size:"sm",onClick:()=>f(Math.min(w,d+1)),disabled:d===w,className:"border-dashed border-white/20 text-white hover:bg-white/10 disabled:opacity-50",children:"Next"})]})]}):a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl text-white font-light",children:"Teams"}),a.jsx("p",{className:"text-gray-400 mt-1",children:"Manage your application organizations"})]})}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-8",children:a.jsxs("div",{className:"flex items-start space-x-4",children:[a.jsx("div",{className:"flex-shrink-0",children:a.jsx(_s,{className:"w-12 h-12 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"Organization Plugin Required"}),a.jsx("p",{className:"text-gray-300 mb-6",children:"To use Organizations in Better Auth Studio, you need to enable the organization plugin in your Better Auth configuration."}),a.jsxs("div",{className:"bg-black/50 border border-dashed border-white/20 rounded-none p-4 mb-6",children:[a.jsx("h4",{className:"text-white font-light mb-3",children:"Follow these steps:"}),a.jsx("ol",{className:"text-gray-300 space-y-2 text-sm list-decimal list-inside",children:a.jsxs("li",{children:["Import the plugin in your auth configuration file",(i==null?void 0:i.configPath)&&a.jsxs("span",{className:"text-gray-400",children:[" (",i.configPath,")"]}),":"]})}),a.jsx("div",{className:"mt-4 bg-black/70 border border-dashed border-white/10 rounded-none p-3 overflow-x-auto",children:a.jsxs("pre",{className:"text-sm text-gray-300",children:[a.jsx("span",{className:"text-blue-400",children:"import"})," ","{ betterAuth }"," ",a.jsx("span",{className:"text-blue-400",children:"from"})," ",a.jsx("span",{className:"text-green-400",children:'"better-auth"'})," ",a.jsx("br",{}),a.jsx("span",{className:"text-blue-400",children:"import"})," ","{ organization }"," ",a.jsx("span",{className:"text-blue-400",children:"from"})," ",a.jsx("span",{className:"text-green-400",children:'"better-auth/plugins/organization"'})," ",a.jsx("br",{}),a.jsx("span",{className:"text-blue-400",children:"export const"})," ",a.jsx("span",{className:"text-yellow-300",children:"auth"})," ="," ",a.jsx("span",{className:"text-yellow-300",children:"betterAuth"}),"(","{"," ",a.jsx("br",{}),a.jsx("span",{className:"text-gray-500 pl-10",children:"// ... your existing configuration"})," ",a.jsx("br",{}),a.jsx("span",{className:"text-red-300 pl-10",children:"plugins"}),": [ ",a.jsx("br",{}),a.jsxs("span",{className:"text-yellow-300 pl-12",children:["organization(",")"]}),a.jsx("br",{}),a.jsx("span",{className:"pl-10",children:"]"})," ",a.jsx("br",{}),"}",") ",a.jsx("br",{})]})}),a.jsx("div",{className:"mt-4",children:a.jsx("p",{className:"text-gray-400 text-sm",children:"2. Do migrations to create the organizations table"})}),a.jsx("div",{className:"mt-2",children:a.jsx("p",{className:"text-gray-400 text-sm",children:"3. Restart your application to apply the changes"})})]}),(i==null?void 0:i.availablePlugins)&&i.availablePlugins.length>0&&a.jsx("div",{className:"mb-4",children:a.jsxs("p",{className:"text-gray-400 text-sm",children:["Currently enabled plugins: ",i.availablePlugins.join(", ")]})}),a.jsx(F,{onClick:()=>window.location.reload(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Check Again"}),a.jsxs("div",{className:"mt-4 text-xs text-gray-500",children:["Need help? Check the"," ",a.jsx("a",{href:"https://better-auth.com/docs/plugins/organization",target:"_blank",rel:"noopener noreferrer",className:"text-white hover:underline",children:"Better Auth Organization Plugin Documentation"})]})]})]})})]})}function Sh(e){return e?"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"}function tE(e,t,n){let s="",r=0,i=0;for(const o of e)for(r=r<<8|o,i+=8;i>=6;)i-=6,s+=t[r>>i&63];if(i>0&&(s+=t[r<<6-i&63]),n){const o=(4-s.length%4)%4;s+="=".repeat(o)}return s}function nE(e,t){const n=new Map;for(let o=0;o<t.length;o++)n.set(t[o],o);const s=[];let r=0,i=0;for(const o of e){if(o==="=")break;const l=n.get(o);if(l===void 0)throw new Error(`Invalid Base64 character: ${o}`);r=r<<6|l,i+=6,i>=8&&(i-=8,s.push(r>>i&255))}return Uint8Array.from(s)}const oV={encode(e,t={}){const n=Sh(!1),s=typeof e=="string"?new TextEncoder().encode(e):new Uint8Array(e);return tE(s,n,t.padding??!0)},decode(e){typeof e!="string"&&(e=new TextDecoder().decode(e));const t=e.includes("-")||e.includes("_"),n=Sh(t);return nE(e,n)}},lV={encode(e,t={}){const n=Sh(!0),s=typeof e=="string"?new TextEncoder().encode(e):new Uint8Array(e);return tE(s,n,t.padding??!0)},decode(e){const t=e.includes("-")||e.includes("_"),n=Sh(t);return nE(e,n)}};function cV(){const e=typeof globalThis<"u"&&globalThis.crypto;if(e&&typeof e.subtle=="object"&&e.subtle!=null)return e.subtle;throw new Error("crypto.subtle must be defined")}function dV(e,t){return{digest:async n=>{const s=new TextEncoder,r=typeof n=="string"?s.encode(n):n,i=await cV().digest(e,r);return t==="hex"?Array.from(new Uint8Array(i)).map(c=>c.toString(16).padStart(2,"0")).join(""):t==="base64"||t==="base64url"||t==="base64urlnopad"?t.includes("url")?lV.encode(i,{padding:t!=="base64urlnopad"}):oV.encode(i):i}}}const Km=`// Example custom migration script
502
+ `})]})}const In=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:$e("rounded-lg border border-gray-700 bg-gray-900 text-white shadow-sm",e),...t}));In.displayName="Card";const Wn=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:$e("flex flex-col space-y-1.5 p-6",e),...t}));Wn.displayName="CardHeader";const qn=m.forwardRef(({className:e,...t},n)=>a.jsx("h3",{ref:n,className:$e("text-2xl font-semibold leading-none tracking-tight text-white",e),...t}));qn.displayName="CardTitle";const Ts=m.forwardRef(({className:e,...t},n)=>a.jsx("p",{ref:n,className:$e("text-sm text-gray-300",e),...t}));Ts.displayName="CardDescription";const Xn=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:$e("p-6 pt-0",e),...t}));Xn.displayName="CardContent";const eV=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:$e("flex items-center p-6 pt-0",e),...t}));eV.displayName="CardFooter";const tV={databaseSchemaNode:Sg},kw=[{name:"organization",displayName:"Organization",description:"Multi-tenant organization support",color:"bg-blue-500"},{name:"teams",displayName:"Teams",description:"Team management within organizations",color:"bg-green-500"},{name:"twoFactor",displayName:"Two Factor",description:"Two-factor authentication support",color:"bg-purple-500"},{name:"apiKey",displayName:"API Key",description:"API key authentication",color:"bg-orange-500"},{name:"passkey",displayName:"Passkey",description:"WebAuthn passkey support",color:"bg-pink-500"}];function nV(){const[e,t]=m.useState(null),[n,s]=m.useState(!0),[r,i]=m.useState(null),[o,l]=m.useState([]),[c,u]=m.useState([]),[h,d,f]=wz([]),[x,y,v]=jz([]),j=m.useCallback(S=>{const C=kw.find(T=>T.name===S);return(C==null?void 0:C.color)||"bg-gray-500"},[]),g=m.useCallback((S,C,T)=>{if(S==="user"||S==="session"||S==="account"||S==="verification")return"core";for(const O of T)if(S===O||S.includes(O))return O;return"core"},[]),b=m.useCallback(async()=>{try{const C=await(await fetch("/api/plugins")).json();if(C.plugins&&Array.isArray(C.plugins)){const T=C.plugins.map(O=>({name:O.id,displayName:O.name||O.id,description:O.description||`${O.id} plugin for Better Auth`,color:j(O.id)}));u(T),l(T.map(O=>O.name))}}catch{u(kw),l(["organization"])}},[j]),p=m.useCallback(async S=>{try{s(!0);const C=S.length>0?`?plugins=${S.join(",")}`:"",O=await(await fetch(`/api/database/schema${C}`)).json();O.success?t(O.schema):i(O.error||"Failed to fetch schema")}catch{i("Failed to fetch database schema")}finally{s(!1)}},[]);m.useEffect(()=>{b()},[b]),m.useEffect(()=>{o.length>0&&p(o)},[o,p]),m.useEffect(()=>{if(!e)return;const S=[],C=[];e.tables.forEach((T,O)=>{const H=T.fields.map(U=>({id:`${T.name}-${U.name}`,isPrimary:U.primaryKey||!1,isNullable:!U.required,isUnique:U.unique||!1,isIdentity:!1,name:U.name,format:U.type,plugin:g(T.name,U.name,o)}));S.push({id:T.name,type:"databaseSchemaNode",position:{x:O%3*380,y:Math.floor(O/3)*320},data:{name:T.name,displayName:T.displayName,isForeign:!1,plugin:g(T.name,"",o),columns:H.map(U=>{var z;return{...U,description:((z=T.fields.find(Y=>Y.name===U.name))==null?void 0:z.description)||""}}),relationships:T.relationships}})}),e.tables.forEach(T=>{T.relationships.forEach(O=>{if(O.type==="many-to-one")return;const H=T.name,U=O.target,z=S.find(k=>k.id===H),Y=S.find(k=>k.id===U);if(z&&Y){const k=O.type==="one-to-one"?"1:1":"1:N";C.push({id:`${H}-${U}-${O.field}`,source:H,target:U,type:"smoothstep",animated:!1,style:{stroke:"#6b7280",strokeWidth:2,strokeDasharray:"0"},label:k,labelStyle:{fontSize:"11px",fill:"#9ca3af",fontWeight:"500"},labelBgStyle:{fill:"rgba(0, 0, 0, 0.9)",fillOpacity:1,borderRadius:4},markerEnd:{type:"arrowclosed",color:"#6b7280",width:12,height:12}})}})}),d(S),y(C)},[e,o,d,y,g]);const w=m.useCallback(S=>y(C=>_2(S,C)),[y]);if(n)return a.jsxs("div",{className:"p-6",children:[a.jsxs("div",{className:"animate-pulse",children:[a.jsx("div",{className:"h-8 bg-gray-700 rounded w-1/3 mb-6"}),a.jsx("div",{className:"h-96 bg-gray-700 rounded"})]}),a.jsx("div",{className:"text-center text-gray-500 dark:text-gray-400 mt-4",children:"Loading plugins and schema..."})]});if(r)return a.jsx("div",{className:"p-6",children:a.jsxs("div",{className:"bg-red-900/20 border border-red-500/20 rounded-none p-6",children:[a.jsx("h2",{className:"text-xl font-semibold text-red-400 mb-2",children:"Error Loading Schema"}),a.jsx("p",{className:"text-gray-300",children:r})]})});const N=a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mb-6",children:[a.jsx("div",{className:"flex items-center justify-between mb-1",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Nt,{className:"w-6 h-6 text-white"}),a.jsx("h1",{className:"text-2xl font-light text-white",children:"Schema Visualizer"})]})}),a.jsx("p",{className:"text-gray-400",children:"Visualize your Better Auth database schema with interactive tables and relationships."})]}),a.jsxs("div",{className:"flex-1 grid grid-cols-4 gap-6",children:[a.jsxs("div",{className:"col-span-1",children:[a.jsxs(In,{className:"rounded-none bg-black h-fit shadow-sm",children:[a.jsx(Wn,{children:a.jsxs(qn,{className:"font-light text-xl text-white flex items-center space-x-2",children:[a.jsx(uo,{className:"w-5 h-5"}),a.jsx("span",{children:"Plugins"})]})}),a.jsx(Xn,{className:"space-y-3",children:c.length>0?c.map(S=>a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:`w-3 h-3 rounded-full ${S.color}`}),a.jsx("label",{htmlFor:S.name,className:"text-sm font-medium text-white cursor-pointer",children:S.displayName.slice(0,1).toUpperCase()+S.displayName.slice(1).replace("-"," ")})]},S.name)):a.jsx("div",{className:"text-sm text-white/70",children:"No plugins detected in configuration"})})]}),e&&a.jsxs(In,{className:"rounded-none bg-black mt-4 shadow-sm",children:[a.jsx(Wn,{children:a.jsx(qn,{className:"text-white text-sm",children:"Schema Info"})}),a.jsxs(Xn,{className:"space-y-2",children:[a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{className:"text-white/70",children:"Tables:"}),a.jsx("span",{className:"text-white",children:e.tables.length})]}),a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{className:"text-white/70",children:"Relationships:"}),a.jsx("span",{className:"text-white",children:e.tables.reduce((S,C)=>S+C.relationships.length,0)})]}),a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{className:"text-white/70",children:"Available Plugins:"}),a.jsx("span",{className:"text-white",children:c.length})]}),a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{className:"text-white/70",children:"Selected Plugins:"}),a.jsx("span",{className:"text-white",children:o.length})]})]})]})]}),a.jsx("div",{className:"col-span-3",children:a.jsx("div",{className:"h-full bg-black border border-gray-700 rounded-lg overflow-hidden shadow-xl",children:a.jsxs(yz,{nodes:h,edges:x,onNodesChange:f,onEdgesChange:v,onConnect:w,nodeTypes:tV,fitView:!0,fitViewOptions:{padding:.1,includeHiddenNodes:!1},className:"bg-black",connectionLineType:"smoothstep",defaultEdgeOptions:{style:{stroke:"#6b7280",strokeWidth:2},animated:!1,type:"smoothstep"},nodesDraggable:!0,nodesConnectable:!1,elementsSelectable:!0,children:[a.jsx(zz,{className:"bg-gray-900 border-gray-700 [&>button]:bg-gray-800 [&>button]:border-gray-600 [&>button]:text-white [&>button:hover]:bg-gray-700"}),a.jsx(qz,{className:"bg-gray-900 border-gray-700",nodeColor:S=>{var C;return(C=S.data)!=null&&C.isForeign?"#374151":"#1f2937"},maskColor:"rgba(0, 0, 0, 0.9)"}),a.jsx(kz,{variant:ga.Dots,gap:20,size:1,color:"#374151"})]})})})]})]});return a.jsxs("div",{className:"overflow-hidden p-6 h-[90vh] flex flex-col opacity-70 bg-black relative",children:[a.jsxs("div",{className:"absolute inset-0 z-50 flex items-center justify-center pointer-events-none",children:[a.jsx("div",{className:"absolute inset-0 backdrop-blur-sm",style:{WebkitBackdropFilter:"blur(8px)",backdropFilter:"blur(8px)"}}),a.jsxs("div",{className:"relative -mt-6 bg-black/50 border border-dashed border-white/20 rounded-none p-12 max-w-2xl mx-6 text-center pointer-events-auto",children:[a.jsx("div",{className:"flex items-center justify-center mb-4",children:a.jsxs("div",{className:"relative",children:[a.jsx(Nt,{className:"w-16 h-16 text-white opacity-50"}),a.jsx(uR,{className:"w-8 h-8 text-white opacity-80 absolute -top-2 -right-2 animate-pulse"})]})}),a.jsx("h2",{className:"text-3xl font-mono uppercase font-light text-white mb-3",children:"Coming Soon"}),a.jsx("p",{className:"text-lg text-gray-300 font-light mb-6 leading-relaxed",children:"We will be having this feature soon. This feature will allow you to explore your Better Auth database structure with beautiful, interactive graphs showing all tables, relationships, and data flow."}),a.jsxs("div",{className:"flex items-center justify-center space-x-6 text-sm text-gray-400",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),a.jsx("span",{children:"Interactive Tables"})]}),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",{children:"Relationship Mapping"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("div",{className:"w-2 h-2 bg-purple-500 rounded-full"}),a.jsx("span",{children:"Real-time Updates"})]})]})]})]}),a.jsx("div",{className:"blur-sm opacity-50 pointer-events-none",children:N})]})}const sV=rC("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-white text-black hover:bg-white",secondary:"border-transparent bg-gray-800 text-white hover:bg-gray-800 border border-gray-600",destructive:"border-transparent bg-red-500 text-white hover:bg-red-600",outline:"text-gray-300 border-gray-600",success:"border-transparent bg-green-900 text-green-300",warning:"border-transparent bg-yellow-900 text-yellow-300",error:"border-transparent bg-red-900 text-red-300",info:"border-transparent bg-gray-800 text-white border border-gray-600"}},defaultVariants:{variant:"default"}});function vt({className:e,variant:t,...n}){return a.jsx("div",{className:$e(sV({variant:t}),e),...n})}function aV(){const{orgId:e}=zp(),t=ws(),[n,s]=m.useState(null),[r,i]=m.useState([]),[o,l]=m.useState([]),[c,u]=m.useState([]),[h,d]=m.useState(!0),[f,x]=m.useState("details"),[y,v]=m.useState(!1),[j,g]=m.useState(!1),[b,p]=m.useState(!1),[w,N]=m.useState(!1),[S,C]=m.useState(!1),[T,O]=m.useState(!1),[H,U]=m.useState(!1),[z,Y]=m.useState(!1),[k,$]=m.useState(!1),[M,A]=m.useState(null),[E,D]=m.useState({name:"",slug:""}),[_,I]=m.useState(""),[R,P]=m.useState(""),[W,q]=m.useState([]),[ee,ne]=m.useState({name:""}),[Z,se]=m.useState(!1),[xe,ae]=m.useState([]),[ce,de]=m.useState(!1),[Se,Ee]=m.useState([]),[Ae,He]=m.useState(!1);m.useEffect(()=>{e&&(oe(),Oe(),be(),Ce(),st(),we())},[e]),m.useEffect(()=>{y&&e&&we()},[]),m.useEffect(()=>{f==="members"&&e&&st()},[f,e]),m.useEffect(()=>{f==="invitations"&&e&&Ce()},[f,e]);const J=X=>{ne({name:X})},oe=async()=>{try{const Q=await(await fetch(`/api/organizations/${e}`)).json();Q.success&&Q.organization||Q.organization?s(Q.organization):B.error("Organization not found")}catch(X){console.error("Failed to fetch organization:",X),B.error("Failed to load organization")}finally{d(!1)}},be=async()=>{try{const Q=await(await fetch("/api/plugins/teams/status")).json();v(Q.enabled)}catch(X){console.error("Failed to check teams status:",X),v(!1)}},Oe=async()=>{try{const Q=await(await fetch("/api/plugins/organization/status")).json();g(Q.enabled)}catch(X){console.error("Failed to check organization status:",X),g(!1)}},we=async()=>{try{const Q=await(await fetch(`/api/organizations/${e}/teams`)).json();Q.success&&i(Q.teams||[])}catch(X){console.error("Failed to fetch teams:",X),B.error("Failed to load teams")}},Ce=async()=>{try{const Q=await(await fetch(`/api/organizations/${e}/invitations`)).json();Q.success&&l(Q.invitations||[])}catch(X){console.error("Failed to fetch invitations:",X),B.error("Failed to load invitations")}},st=async()=>{try{const Q=await(await fetch(`/api/organizations/${e}/members`)).json();Q.success&&u(Q.members||[])}catch(X){console.error("Failed to fetch members:",X),B.error("Failed to load members")}},yt=async X=>{ae([]),de(!0),ae([{id:"start",type:"info",message:`Starting member seeding process for ${X} members...`,timestamp:new Date}]);try{const pe=await(await fetch(`/api/organizations/${e}/seed-members`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:X})})).json();if(pe.success){const We=pe.results.map((tt,Qe)=>tt.success?{id:`member-${Qe}`,type:"progress",message:`Adding member: ${tt.member.user.name} (${tt.member.user.email})`,timestamp:new Date,status:"completed"}:{id:`member-${Qe}`,type:"error",message:`Failed to add member ${Qe+1}: ${tt.error}`,timestamp:new Date});ae(tt=>[...tt,...We]);const nt=pe.results.filter(tt=>tt.success).length;ae(tt=>[...tt,{id:"complete",type:"success",message:`✅ Seeding completed! Added ${nt}/${X} members successfully`,timestamp:new Date}]),await st(),B.success(`Successfully added ${nt} members!`)}else ae(We=>[...We,{id:"error",type:"error",message:`❌ Seeding failed: ${pe.error||"Unknown error"}`,timestamp:new Date}]),B.error(pe.error||"Failed to seed members")}catch(Q){ae(pe=>[...pe,{id:"error",type:"error",message:`❌ Network error: ${Q}`,timestamp:new Date}]),B.error("Failed to seed members")}finally{de(!1)}},wt=async X=>{Ee([]),He(!0),Ee([{id:"start",type:"info",message:`Starting team seeding process for ${X} teams...`,timestamp:new Date}]);try{const pe=await(await fetch(`/api/organizations/${e}/seed-teams`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:X})})).json();if(pe.success){const We=pe.results.map((tt,Qe)=>tt.success?{id:`team-${Qe}`,type:"progress",message:`Creating team: ${tt.team.name}`,timestamp:new Date,status:"completed"}:{id:`team-${Qe}`,type:"error",message:`Failed to create team ${Qe+1}: ${tt.error}`,timestamp:new Date});Ee(tt=>[...tt,...We]);const nt=pe.results.filter(tt=>tt.success).length;Ee(tt=>[...tt,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${nt}/${X} teams successfully`,timestamp:new Date}]),await we(),B.success(`Successfully created ${nt} teams!`)}else Ee(We=>[...We,{id:"error",type:"error",message:`❌ Seeding failed: ${pe.error||"Unknown error"}`,timestamp:new Date}]),B.error(pe.error||"Failed to seed teams")}catch(Q){Ee(pe=>[...pe,{id:"error",type:"error",message:`❌ Network error: ${Q}`,timestamp:new Date}]),B.error("Failed to seed teams")}finally{He(!1)}},Lt=async()=>{try{const Q=await(await fetch("/api/users/all")).json();Q.success&&q(Q.users||[])}catch(X){console.error("Failed to fetch users:",X)}},K=X=>X.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,""),V=()=>{n&&(D({name:n.name,slug:n.slug}),$(!0))},te=X=>{const Q=K(X);D({name:X,slug:Q})},me=X=>{D(Q=>({...Q,slug:K(X)}))},L=async()=>{if(!n){B.error("No organization selected");return}if(!E.name){B.error("Please fill in the organization name");return}const X=B.loading("Updating organization...");try{const pe=await(await fetch(`/api/organizations/${n.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:E.name,slug:E.slug})})).json();pe.success?(await oe(),$(!1),D({name:"",slug:""}),B.success("Organization updated successfully!",{id:X})):B.error(`Error updating organization: ${pe.error||"Unknown error"}`,{id:X})}catch(Q){console.error("Error updating organization:",Q),B.error("Error updating organization",{id:X})}},ie=()=>{Lt(),p(!0)},ue=async()=>{if(!_){B.error("Please enter an email address");return}if(!R){B.error("Please select an inviter");return}se(!0);const X=B.loading("Sending invitation...");try{const pe=await(await fetch(`/api/organizations/${e}/invitations`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:_,role:"member",inviterId:R})})).json();pe.success?(await Ce(),p(!1),I(""),P(""),B.success("Invitation sent successfully!",{id:X})):B.error(`Error sending invitation: ${pe.error||"Unknown error"}`,{id:X})}catch(Q){console.error("Error sending invitation:",Q),B.error("Error sending invitation",{id:X})}finally{se(!1)}},he=async X=>{const Q=B.loading("Cancelling invitation...");try{const We=await(await fetch(`/api/invitations/${X}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();We.success?(await Ce(),B.success("Invitation cancelled successfully!",{id:Q})):B.error(`Error cancelling invitation: ${We.error||"Unknown error"}`,{id:Q})}catch(pe){console.error("Error cancelling invitation:",pe),B.error("Error cancelling invitation",{id:Q})}},Be=async(X,Q)=>{const pe=B.loading("Resending invitation...");try{const nt=await(await fetch(`/api/invitations/${X}/resend`,{method:"POST",headers:{"Content-Type":"application/json"}})).json();nt.success?(await Ce(),B.success(`Invitation resent to ${Q}!`,{id:pe})):B.error(`Error resending invitation: ${nt.error||"Unknown error"}`,{id:pe})}catch(We){console.error("Error resending invitation:",We),B.error("Error resending invitation",{id:pe})}},_e=async(X,Q)=>{const pe=B.loading(`Removing ${Q}...`);try{const nt=await(await fetch(`/api/members/${X}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();nt.success?(await st(),B.success(`${Q} removed from organization!`,{id:pe})):B.error(`Error removing member: ${nt.error||"Unknown error"}`,{id:pe})}catch(We){console.error("Error removing member:",We),B.error("Error removing member",{id:pe})}},Re=async()=>{if(!ee.name){B.error("Please enter a team name");return}const X=B.loading("Creating team...");try{const pe=await(await fetch(`/api/organizations/${e}/teams`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:ee.name,organizationId:e})})).json();pe.success?(await we(),O(!1),ne({name:""}),B.success("Team created successfully!",{id:X})):B.error(`Error creating team: ${pe.error||"Unknown error"}`,{id:X})}catch(Q){console.error("Error creating team:",Q),B.error("Error creating team",{id:X})}},je=async()=>{if(!M||!ee.name){B.error("Please enter a team name");return}const X=B.loading("Updating team...");try{const pe=await(await fetch(`/api/teams/${M.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:ee.name})})).json();pe.success?(await we(),U(!1),A(null),ne({name:""}),B.success("Team updated successfully!",{id:X})):B.error(`Error updating team: ${pe.error||"Unknown error"}`,{id:X})}catch(Q){console.error("Error updating team:",Q),B.error("Error updating team",{id:X})}},Ve=async()=>{if(!M){B.error("No team selected");return}const X=B.loading("Deleting team...");try{const pe=await(await fetch(`/api/teams/${M.id}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();pe.success?(await we(),Y(!1),A(null),B.success("Team deleted successfully!",{id:X})):B.error(`Error deleting team: ${pe.error||"Unknown error"}`,{id:X})}catch(Q){console.error("Error deleting team:",Q),B.error("Error deleting team",{id:X})}},ke=X=>{A(X),ne({name:X.name}),U(!0)},Pe=X=>{A(X),Y(!0)};return h?a.jsx("div",{className:"flex items-center justify-center h-32",children:a.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[a.jsx(tr,{className:"w-6 h-6 text-white animate-spin"}),a.jsx("div",{className:"text-white text-sm",children:"Loading organization details..."})]})}):n?a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("div",{className:"flex items-center space-x-4",children:a.jsx("span",{className:"mb-4 ml-0 flex justify-start items-start text-left border-none text-white",children:a.jsxs("span",{className:"font-light",children:[a.jsxs("span",{onClick:()=>t("/organizations"),className:"uppercase cursor-pointer text-white/80 font-mono text-sm",children:["orgs /"," "]}),a.jsx("span",{className:"text-white font-mono text-sm",children:e})]})})}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(F,{onClick:()=>N(!0),className:"border border-dashed border-white/20 text-white bg-transparent hover:bg-white/10 rounded-none",children:[a.jsx(ft,{className:"w-4 h-4 mr-2"}),"Seed Members"]}),a.jsxs(F,{onClick:ie,className:"border border-dashed border-white/20 text-white bg-transparent hover:bg-white/10 rounded-none",children:[a.jsx(sa,{className:"w-4 h-4 mr-2"}),"Invite User"]}),a.jsxs(F,{onClick:V,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[a.jsx(ii,{className:"w-4 h-4 mr-2"}),"Edit Organization"]})]})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-12 h-12 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:a.jsx(An,{className:"w-6 h-6 text-white"})}),a.jsx("div",{children:a.jsxs("h1",{className:"text-2xl text-white font-light inline-flex items-center",children:[n.name,a.jsxs("sup",{className:"text-xs text-gray-500 ml-2",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-xs",children:n.slug}),a.jsx("span",{className:"ml-1",children:"]"})]})]})})]}),a.jsx("div",{className:"border-b border-white/10",children:a.jsxs("nav",{className:"flex space-x-8",children:[a.jsxs("button",{onClick:()=>x("details"),className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${f==="details"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[a.jsx(An,{className:"w-4 h-4"}),a.jsxs("span",{className:"inline-flex items-start",children:["Details",a.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:a.jsx(xs,{value:0,className:"text-white/80 font-mono text-xs",prefix:a.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]}),a.jsxs("button",{onClick:()=>x("members"),className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${f==="members"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[a.jsx(ft,{className:"w-4 h-4"}),a.jsxs("span",{className:"inline-flex items-start",children:["Members",a.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:a.jsx(xs,{value:c.length,className:"text-white/80 font-mono text-xs",prefix:a.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]}),a.jsxs("button",{onClick:()=>x("invitations"),className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${f==="invitations"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[a.jsx(sa,{className:"w-4 h-4"}),a.jsxs("span",{className:"inline-flex items-start",children:["Invitations",a.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:a.jsx(xs,{value:o.length,className:"text-white/80 font-mono text-xs",prefix:a.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]}),a.jsxs("button",{onClick:()=>x("teams"),className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${f==="teams"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[a.jsx(ft,{className:"w-4 h-4"}),a.jsxs("span",{className:"inline-flex items-start",children:["Teams",a.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:a.jsx(xs,{value:r.length,className:"text-white/80 font-mono text-xs",prefix:a.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]})]})}),f==="details"&&a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:[a.jsx("h3",{className:"text-lg text-white font-light mb-4",children:"Organization Information"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Name"}),a.jsx("p",{className:"text-white font-sans mt-1",children:n.name})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Slug"}),a.jsx("p",{className:"text-white font-mono mt-1",children:n.slug})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Created"}),a.jsx("p",{className:"text-white font-sans mt-1",children:new Date(n.createdAt).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6",children:[a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(ft,{className:"w-8 h-8 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl text-white font-sans font-light",children:c.length}),a.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Members"})]})]})}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(ft,{className:"w-8 h-8 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl text-white font-sans font-light",children:r.length}),a.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Teams"})]})]})}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(sa,{className:"w-8 h-8 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl text-white font-sans font-light",children:o.length}),a.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Invitations"})]})]})}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(ls,{className:"w-8 h-8 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl text-white font-sans font-light",children:Math.ceil((new Date().getTime()-new Date(n.createdAt).getTime())/(1e3*60*60*24))}),a.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Days Active"})]})]})})]})]}),f==="teams"&&a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Teams",a.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white font-mono text-xs",children:r.length}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 mt-1 uppercase font-mono text-xs font-light",children:"Manage teams within this organization"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(F,{onClick:()=>C(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[a.jsx(fa,{className:"w-4 h-4 mr-2"}),"Seed Teams"]}),a.jsxs(F,{onClick:()=>O(!0),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[a.jsx(Zl,{className:"w-4 h-4 mr-2"}),"Create Team"]})]})]}),y?r.length>0?a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Team"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Members"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Created"}),a.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),a.jsx("tbody",{children:r.map(X=>a.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5 cursor-pointer",onClick:()=>t(`/organizations/${e}/teams/${X.id}`),children:[a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-10 h-10 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:a.jsx(ft,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:X.name}),a.jsx(Rn,{id:X.id,label:"Team ID"})]})]})}),a.jsx("td",{className:"py-4 px-4 text-white",children:X.memberCount||0}),a.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:new Date(X.createdAt).toLocaleDateString()}),a.jsx("td",{className:"py-4 px-4 text-right",children:a.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[a.jsxs(F,{variant:"outline",size:"sm",className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",onClick:Q=>{Q.stopPropagation(),ke(X)},children:[a.jsx(ii,{className:"w-4 h-4 mr-1"}),"Edit"]}),a.jsxs(F,{variant:"outline",size:"sm",className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",onClick:Q=>{Q.stopPropagation(),Pe(X)},children:[a.jsx(wu,{className:"w-4 h-4 mr-1"}),"Delete"]})]})})]},X.id))})]})})}):a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-12",children:a.jsxs("div",{className:"text-center",children:[a.jsx(ft,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"No Teams Yet"}),a.jsx("p",{className:"text-gray-400 mb-6",children:"Create your first team to start organizing members within this organization."}),a.jsxs(F,{onClick:()=>O(!0),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[a.jsx(Zl,{className:"w-4 h-4 mr-2"}),"Create First Team"]})]})}):a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-8",children:a.jsxs("div",{className:"flex items-start space-x-4",children:[a.jsx("div",{className:"flex-shrink-0",children:a.jsx(ft,{className:"w-12 h-12 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"Teams Feature Required"}),a.jsx("p",{className:"text-gray-300 mb-6",children:"To use Teams in Better Auth Studio, you need to enable the teams feature in your organization plugin configuration."}),a.jsxs("div",{className:"bg-black/50 border border-dashed border-white/20 rounded-none p-4 mb-6",children:[a.jsx("h4",{className:"text-white font-light mb-3",children:"Follow these steps:"}),a.jsx("ol",{className:"text-gray-300 space-y-2 text-sm list-decimal list-inside",children:a.jsx("li",{children:"Update your auth configuration file to enable teams:"})}),a.jsx("div",{className:"mt-4 bg-black/70 border border-dashed border-white/10 rounded-none p-3 overflow-x-auto",children:a.jsxs("pre",{className:"text-sm text-gray-300",children:[a.jsx("span",{className:"text-blue-400",children:"import"})," ","{ betterAuth }"," ",a.jsx("span",{className:"text-blue-400",children:"from"})," ",a.jsx("span",{className:"text-green-400",children:'"better-auth"'})," ",a.jsx("br",{}),a.jsx("span",{className:"text-blue-400",children:"import"})," ","{ organization }"," ",a.jsx("span",{className:"text-blue-400",children:"from"})," ",a.jsx("span",{className:"text-green-400",children:'"better-auth/plugins/organization"'})," ",a.jsx("br",{}),a.jsx("span",{className:"text-blue-400",children:"export const"})," ",a.jsx("span",{className:"text-yellow-300",children:"auth"})," ="," ",a.jsx("span",{className:"text-yellow-300",children:"betterAuth"}),"(","{"," ",a.jsx("br",{}),a.jsx("span",{className:"text-gray-500 pl-10",children:"// ... your existing configuration"})," ",a.jsx("br",{}),a.jsx("span",{className:"text-red-300 pl-10",children:"plugins"}),": [ ",a.jsx("br",{}),a.jsx("span",{className:"text-yellow-300 pl-12",children:"organization"}),"(","{"," ",a.jsx("br",{}),a.jsx("span",{className:"text-red-300 pl-16",children:"teams"}),": ","{"," ",a.jsx("br",{}),a.jsx("span",{className:"text-yellow-300 pl-20",children:"enabled"}),":"," ",a.jsx("span",{className:"text-blue-400",children:"true"})," ",a.jsx("br",{}),a.jsx("span",{className:"pl-16",children:"}"})," ",a.jsx("br",{}),a.jsx("span",{className:"pl-12",children:"})"})," ",a.jsx("br",{}),a.jsx("span",{className:"pl-10",children:"]"})," ",a.jsx("br",{}),"}",") ",a.jsx("br",{})]})}),a.jsx("div",{className:"mt-4",children:a.jsx("p",{className:"text-gray-400 text-sm",children:"2. Run migrations to create the teams table"})}),a.jsx("div",{className:"mt-2",children:a.jsx("p",{className:"text-gray-400 text-sm",children:"3. Restart your application to apply the changes"})})]}),a.jsx(F,{onClick:()=>window.location.reload(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Check Again"}),a.jsxs("div",{className:"mt-4 text-xs text-gray-500",children:["Need help? Check the"," ",a.jsx("a",{href:"https://better-auth.com/docs/plugins/organization",target:"_blank",rel:"noopener noreferrer",className:"text-white hover:underline",children:"Better Auth Organization Plugin Documentation"})]})]})]})})]}),f==="members"&&a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{children:[a.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Members",a.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white font-mono text-xs",children:c.length}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 font-light font-mono text-xs uppercase mt-1",children:"Manage organization members and their roles"})]})}),c.length>0?a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"User"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Email"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Role"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Joined"}),a.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),a.jsx("tbody",{children:c.map(X=>a.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5",children:[a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("img",{src:X.user.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${X.user.id}`,alt:X.user.name,className:"w-10 h-10 rounded-none border border-dashed border-white/20"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:X.user.name}),a.jsx(Rn,{id:X.user.id})]})]})}),a.jsx("td",{className:"py-4 px-4 text-white",children:X.user.email}),a.jsx("td",{className:"py-4 px-4",children:a.jsx(vt,{variant:"secondary",className:"text-xs bg-blue-900/10 border border-dashed rounded-none border-blue-500/30 text-blue-400/70 capitalize",children:X.role})}),a.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:new Date(X.joinedAt).toLocaleDateString()}),a.jsx("td",{className:"py-4 px-4 text-right",children:a.jsx("div",{className:"flex items-center justify-end space-x-2",children:a.jsxs(F,{variant:"outline",size:"sm",className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",onClick:()=>_e(X.id,X.user.name),children:[a.jsx(wu,{className:"w-4 h-4 mr-1"}),"Remove"]})})})]},X.id))})]})})}):a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-12",children:a.jsxs("div",{className:"text-center",children:[a.jsx(ft,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"No Members Yet"}),a.jsx("p",{className:"text-gray-400 mb-6",children:"Invite users or seed members from existing users to get started."}),a.jsxs("div",{className:"flex items-center justify-center space-x-3",children:[a.jsxs(F,{onClick:()=>N(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[a.jsx(ft,{className:"w-4 h-4 mr-2"}),"Seed Members"]}),a.jsxs(F,{onClick:ie,className:"bg-white text-white hover:bg-white/90 bg-transparent border border-white/20 rounded-none",children:[a.jsx(sa,{className:"w-4 h-4 mr-2"}),"Invite User"]})]})]})})]}),f==="invitations"&&a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{children:[a.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Invitations",a.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white font-mono text-xs",children:o.length}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 font-light font-mono text-xs uppercase mt-1",children:"Manage pending invitations to this organization"})]})}),o.length>0?a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Email"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Role"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Status"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Expires"}),a.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),a.jsx("tbody",{children:o.map(X=>a.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5",children:[a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-10 h-10 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:a.jsx(sa,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:X.email}),a.jsxs("div",{className:"text-sm text-gray-400",children:["Expires on"," ",new Date(X.expiresAt).toLocaleDateString("en-US",{month:"short",year:"numeric",day:"numeric"})]})]})]})}),a.jsx("td",{className:"py-4 px-4 text-white capitalize",children:X.role}),a.jsx("td",{className:"py-4 px-4",children:a.jsxs(vt,{variant:"secondary",className:`text-xs font-normal rounded-none border-dashed flex items-center gap-1 w-fit ${X.status==="pending"?"bg-yellow-900/10 border border-yellow-500/30 text-yellow-400/70":X.status==="accepted"?"bg-green-900/10 border border-green-500/30 text-green-400/70":"bg-red-900/10 border border-red-500/30 text-red-400/70"}`,children:[X.status==="pending"&&a.jsx(IC,{className:"w-3 h-3"}),X.status==="accepted"&&a.jsx(E0,{className:"w-3 h-3"}),X.status==="expired"&&a.jsx(Jt,{className:"w-3 h-3"}),X.status]})}),a.jsxs("td",{className:"py-4 px-4 text-sm text-gray-400",children:[new Date(X.expiresAt).toLocaleDateString(),a.jsx("br",{}),a.jsx("span",{className:"text-xs text-gray-400",children:new Date(X.expiresAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]}),a.jsx("td",{className:"py-4 px-4 text-right",children:a.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[a.jsxs(F,{variant:"outline",size:"sm",className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",onClick:()=>Be(X.id,X.email),children:[a.jsx(vw,{className:"w-4 h-4 mr-1"}),"Resend"]}),a.jsxs(F,{variant:"outline",size:"sm",className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",onClick:()=>he(X.id),children:[a.jsx(wu,{className:"w-4 h-4 mr-1"}),"Cancel"]})]})})]},X.id))})]})})}):a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-12",children:a.jsxs("div",{className:"text-center",children:[a.jsx(sa,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"No Invitations"}),a.jsx("p",{className:"text-gray-400 mb-6",children:"Start inviting users to join this organization."}),a.jsxs(F,{onClick:ie,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[a.jsx(sa,{className:"w-4 h-4 mr-2"}),"Send First Invitation"]})]})})]}),b&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Invite User"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>{p(!1),I(""),P("")},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Jt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"invite-email",className:"text-sm text-gray-400 font-light",children:"Email Address"}),a.jsx(Fe,{id:"invite-email",type:"email",value:_,onChange:X=>I(X.target.value),placeholder:"user@example.com",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"inviter-select",className:"text-sm text-gray-400 font-light",children:"Inviter"}),a.jsxs(Zr,{value:R,onValueChange:P,children:[a.jsx(Qr,{children:a.jsx(_0,{placeholder:"Select an inviter..."})}),a.jsx(Kr,{children:W.map(X=>a.jsx(yn,{value:X.id,children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("img",{src:X.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${X.id}`,alt:X.name,className:"w-6 h-6 rounded-none border border-dashed border-white/20"}),a.jsxs("span",{children:[X.name," (",X.email,")"]})]})},X.id))})]})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>{p(!1),I(""),P("")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsxs(F,{onClick:ue,disabled:Z,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none disabled:opacity-50",children:[Z?a.jsx(tr,{className:"w-3 h-3 mr-2 animate-spin"}):a.jsx(vw,{className:"w-4 h-4 mr-2"}),Z?"Sending...":"Send Invitation"]})]})]})}),T&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Create Team"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>{O(!1),ne({name:""})},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Jt,{className:"w-4 h-4"})})]}),a.jsx("div",{className:"space-y-4",children:a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"team-name",className:"text-sm text-gray-400 font-light",children:"Team Name"}),a.jsx(Fe,{id:"team-name",value:ee.name,onChange:X=>J(X.target.value),placeholder:"e.g. Development Team",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>{O(!1),ne({name:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:Re,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Create Team"})]})]})}),H&&M&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Edit Team"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>{U(!1),ne({name:""})},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Jt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:a.jsx(ft,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:M.name}),a.jsx(Rn,{id:M.id,label:"Team ID",variant:"detail"})]})]}),a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"edit-team-name",className:"text-sm text-gray-400 font-light",children:"Team Name"}),a.jsx(Fe,{id:"edit-team-name",value:ee.name,onChange:X=>J(X.target.value),placeholder:"e.g. Development Team",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>{U(!1),ne({name:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:je,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update Team"})]})]})}),z&&M&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Delete Team"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>Y(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Jt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:a.jsx(ft,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:M.name}),a.jsx(Rn,{id:M.id,label:"Team ID",variant:"detail"})]})]}),a.jsx("p",{className:"text-gray-400",children:"Are you sure you want to delete this team? This action cannot be undone."})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>Y(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:Ve,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none",children:"Delete Team"})]})]})}),w&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-2xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Seed Members"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>N(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Jt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(ft,{className:"w-5 h-5 text-white"}),a.jsx("h4",{className:"text-white font-light",children:"Add Members from Existing Users"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(Xe,{htmlFor:"member-count",className:"text-sm text-gray-400 font-light",children:"Number of members to add"}),a.jsx(Fe,{id:"member-count",type:"number",min:"1",max:"50",defaultValue:"5",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx(F,{onClick:()=>{var Q;const X=parseInt(((Q=document.getElementById("member-count"))==null?void 0:Q.value)||"5");yt(X)},disabled:ce,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:ce?a.jsxs(a.Fragment,{children:[a.jsx(tr,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(ft,{className:"w-3 h-3 mr-2"}),"Seed Members"]})})]})]}),xe.length>0&&a.jsx("div",{className:"mt-6",children:a.jsx(fi,{title:"Member Seeding Terminal",lines:xe,isRunning:ce,className:"w-full",defaultCollapsed:!0})})]}),a.jsx("div",{className:"flex justify-end mt-6 pt-6 border-t border-dashed border-white/10",children:a.jsx(F,{variant:"outline",onClick:()=>N(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),S&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-2xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Seed Teams"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>C(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Jt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(An,{className:"w-5 h-5 text-white"}),a.jsx("h4",{className:"text-white font-light",children:"Create Teams"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(Xe,{htmlFor:"team-count",className:"text-sm text-gray-400 font-light",children:"Number of teams to create"}),a.jsx(Fe,{id:"team-count",type:"number",min:"1",max:"20",defaultValue:"3",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx(F,{onClick:()=>{var Q;const X=parseInt(((Q=document.getElementById("team-count"))==null?void 0:Q.value)||"3");wt(X)},disabled:Ae,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:Ae?a.jsxs(a.Fragment,{children:[a.jsx(tr,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(An,{className:"w-3 h-3 mr-2"}),"Seed Teams"]})})]})]}),Se.length>0&&a.jsx("div",{className:"mt-6",children:a.jsx(fi,{title:"Team Seeding Terminal",lines:Se,isRunning:Ae,className:"w-full",defaultCollapsed:!0})})]}),a.jsx("div",{className:"flex justify-end mt-6 pt-6 border-t border-dashed border-white/10",children:a.jsx(F,{variant:"outline",onClick:()=>C(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),k&&n&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",onClick:X=>{X.target===X.currentTarget&&($(!1),D({name:"",slug:""}))},children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",onClick:X=>X.stopPropagation(),children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Edit Organization"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>{$(!1),D({name:"",slug:""})},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Jt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(An,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:n.name}),a.jsx("div",{className:"text-sm text-gray-400",children:n.slug})]})]}),a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"edit-name",className:"text-sm text-gray-400 font-light",children:"Name"}),a.jsx(Fe,{id:"edit-name",value:E.name,onChange:X=>te(X.target.value),placeholder:"e.g. Acme Corp",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"edit-slug",className:"text-sm text-gray-400 font-light",children:"Slug"}),a.jsx(Fe,{id:"edit-slug",value:E.slug,onChange:X=>me(X.target.value),placeholder:"e.g. acme-corp",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Auto-generated from name. You can edit it manually."})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>{$(!1),D({name:"",slug:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:L,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})})]}):a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsx("div",{className:"flex items-center space-x-4",children:a.jsx(Rp,{to:"/organizations",children:a.jsxs(F,{variant:"ghost",className:"text-gray-400 hover:text-white rounded-none",children:[a.jsx(kB,{className:"w-4 h-4 mr-2"}),"Back to Organizations"]})})}),a.jsx("br",{}),a.jsxs("div",{className:"text-center py-12",children:[a.jsx(An,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),a.jsx("h2",{className:"text-xl text-white font-light mb-2",children:"Organization Not Found"}),a.jsx("p",{className:"text-gray-400",children:"The organization you're looking for doesn't exist."})]})]})}function rV(){const[e,t]=m.useState([]),[n,s]=m.useState(!0),[r,i]=m.useState(""),[o,l]=m.useState("all"),[c,u]=m.useState(!1),[h,d]=m.useState(!1),[f,x]=m.useState(!1),[y,v]=m.useState(!1),[j,g]=m.useState(!1),[b,p]=m.useState(null),[w,N]=m.useState([]),[S,C]=m.useState(!1),T=m.useCallback(async()=>{try{const D=await(await fetch("/api/sessions")).json();t(D.sessions||[])}catch{}finally{s(!1)}},[]);m.useEffect(()=>{T()},[T]);const O=async E=>{N([]),C(!0),N([{id:"start",type:"info",message:`Starting session seeding process for ${E} sessions...`,timestamp:new Date}]);try{const _=await(await fetch("/api/seed/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:E})})).json();if(_.success){const I=_.results.map((P,W)=>P.success?{id:`session-${W}`,type:"progress",message:`Creating session: ${P.session.id}`,timestamp:new Date,status:"completed"}:{id:`session-${W}`,type:"error",message:`Failed to create session ${W+1}: ${P.error}`,timestamp:new Date});N(P=>[...P,...I]);const R=_.results.filter(P=>P.success).length;N(P=>[...P,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${R}/${E} sessions successfully`,timestamp:new Date}]),await T()}else N(I=>[...I,{id:"error",type:"error",message:`❌ Seeding failed: ${_.error||"Unknown error"}`,timestamp:new Date}])}catch(D){N(_=>[..._,{id:"error",type:"error",message:`❌ Network error: ${D}`,timestamp:new Date}])}finally{C(!1)}},H=async E=>{N([]),C(!0),N([{id:"start",type:"info",message:`Starting account seeding process for ${E} accounts...`,timestamp:new Date}]);try{const _=await(await fetch("/api/seed/accounts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:E})})).json();if(_.success){const I=_.results.map((P,W)=>P.success?{id:`account-${W}`,type:"progress",message:`Creating account: ${P.account.provider}`,timestamp:new Date,status:"completed"}:{id:`account-${W}`,type:"error",message:`Failed to create account ${W+1}: ${P.error}`,timestamp:new Date});N(P=>[...P,...I]);const R=_.results.filter(P=>P.success).length;N(P=>[...P,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${R}/${E} accounts successfully`,timestamp:new Date}]),await T()}else N(I=>[...I,{id:"error",type:"error",message:`❌ Seeding failed: ${_.error||"Unknown error"}`,timestamp:new Date}])}catch(D){N(_=>[..._,{id:"error",type:"error",message:`❌ Network error: ${D}`,timestamp:new Date}])}finally{C(!1)}},U=E=>{p(E),v(!0)},z=E=>{p(E),d(!0)},Y=E=>{p(E),x(!0)},k=async E=>{u(!1)},$=async E=>{d(!1)},M=async()=>{x(!1)},A=e.filter(E=>{const D=E.id.toLowerCase().includes(r.toLowerCase())||E.userId.toLowerCase().includes(r.toLowerCase()),_=o==="all"||o==="active"&&new Date(E.expiresAt)>new Date||o==="expired"&&new Date(E.expiresAt)<=new Date;return D&&_});return n?a.jsx("div",{className:"flex items-center justify-center h-32",children:a.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[a.jsx(Vs,{className:"w-6 h-6 text-white animate-spin"}),a.jsx("div",{className:"text-white text-sm",children:"Loading sessions..."})]})}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl relative text-white font-light inline-flex items-start",children:["Sessions",a.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white font-mono text-sm",children:e.length}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 mt-1 uppercase font-mono text-sm font-light",children:"Manage user sessions and accounts"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(F,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",onClick:()=>g(!0),children:[a.jsx(Nt,{className:"w-4 h-4 mr-2"}),"Seed"]}),a.jsxs(F,{className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",onClick:()=>u(!0),children:[a.jsx(ur,{className:"w-4 h-4 mr-2"}),"Add Session"]})]})]}),a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsxs("div",{className:"flex-1 relative",children:[a.jsx(oi,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx(Fe,{placeholder:"Search sessions...",value:r,onChange:E=>i(E.target.value),className:"pl-10 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(e0,{className:"w-4 h-4 text-gray-400"}),a.jsxs(Zr,{value:o,onValueChange:l,children:[a.jsx(Qr,{children:a.jsx(_0,{})}),a.jsxs(Kr,{children:[a.jsx(yn,{value:"all",children:"All"}),a.jsx(yn,{value:"active",children:"Active"}),a.jsx(yn,{value:"expired",children:"Expired"})]})]})]})]}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Session"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"User ID"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Status"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Expires"}),a.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),a.jsx("tbody",{children:A.map(E=>a.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5",children:[a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-10 h-10 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(Nt,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{children:[a.jsxs("div",{className:"text-white font-light",children:["Session ",E.id.slice(0,8),"..."]}),a.jsx(Rn,{id:E.id})]})]})}),a.jsx("td",{className:"py-4 px-4 text-white",children:E.userId}),a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[new Date(E.expiresAt)>new Date?a.jsx("div",{className:"w-2 h-2 bg-green-400 rounded-full"}):a.jsx("div",{className:"w-2 h-2 bg-red-400 rounded-full"}),a.jsx("span",{className:"text-sm text-gray-400",children:new Date(E.expiresAt)>new Date?"Active":"Expired"})]})}),a.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:new Date(E.expiresAt).toLocaleDateString()}),a.jsx("td",{className:"py-4 px-4 text-right",children:a.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[a.jsx(F,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:()=>U(E),children:a.jsx(Xo,{className:"w-4 h-4"})}),a.jsx(F,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:()=>z(E),children:a.jsx(ii,{className:"w-4 h-4"})}),a.jsx(F,{variant:"ghost",size:"sm",className:"text-red-400 hover:text-red-300 rounded-none",onClick:()=>Y(E),children:a.jsx(t0,{className:"w-4 h-4"})})]})})]},E.id))})]})})}),j&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-2xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Seed Data"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>g(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Wt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Nt,{className:"w-5 h-5 text-white"}),a.jsx("h4",{className:"text-white font-light",children:"Seed Sessions"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(Xe,{htmlFor:"session-count",className:"text-sm text-gray-400 font-light",children:"Number of sessions"}),a.jsx(Fe,{id:"session-count",type:"number",min:"1",max:"100",defaultValue:"5",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx(F,{onClick:()=>{var D;const E=parseInt(((D=document.getElementById("session-count"))==null?void 0:D.value)||"5",10);O(E)},disabled:S,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:S?a.jsxs(a.Fragment,{children:[a.jsx(Vs,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Nt,{className:"w-3 h-3 mr-2"}),"Seed Sessions"]})})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(jy,{className:"w-5 h-5 text-white"}),a.jsx("h4",{className:"text-white font-light",children:"Seed Accounts"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(Xe,{htmlFor:"account-count",className:"text-sm text-gray-400 font-light",children:"Number of accounts"}),a.jsx(Fe,{id:"account-count",type:"number",min:"1",max:"100",defaultValue:"5",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx(F,{onClick:()=>{var D;const E=parseInt(((D=document.getElementById("account-count"))==null?void 0:D.value)||"5",10);H(E)},disabled:S,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:S?a.jsxs(a.Fragment,{children:[a.jsx(Vs,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(jy,{className:"w-3 h-3 mr-2"}),"Seed Accounts"]})})]})]}),w.length>0&&a.jsx("div",{className:"mt-6",children:a.jsx(fi,{title:"Session Seeding Terminal",lines:w,isRunning:S,className:"w-full",defaultCollapsed:!0})})]}),a.jsx("div",{className:"flex justify-end mt-6 pt-6 border-t border-dashed border-white/10",children:a.jsx(F,{variant:"outline",onClick:()=>g(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),c&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Create Session"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>u(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Wt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"create-user-id",className:"text-sm text-gray-400 font-light",children:"User ID"}),a.jsx(Fe,{id:"create-user-id",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"create-expires",className:"text-sm text-gray-400 font-light",children:"Expires At"}),a.jsx(Fe,{id:"create-expires",type:"datetime-local",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>u(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:()=>k(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Create"})]})]})}),h&&b&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Edit Session"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>d(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Wt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(Nt,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsxs("div",{className:"text-white font-light",children:["Session ",b.id.slice(0,8),"..."]}),a.jsx("div",{className:"text-sm text-gray-400",children:b.userId})]})]}),a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"edit-user-id",className:"text-sm text-gray-400 font-light",children:"User ID"}),a.jsx(Fe,{id:"edit-user-id",defaultValue:b.userId,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"edit-expires",className:"text-sm text-gray-400 font-light",children:"Expires At"}),a.jsx(Fe,{id:"edit-expires",type:"datetime-local",defaultValue:new Date(b.expiresAt).toISOString().slice(0,16),className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>d(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:()=>$(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),f&&b&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Delete Session"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>x(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Wt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(Nt,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsxs("div",{className:"text-white font-light",children:["Session ",b.id.slice(0,8),"..."]}),a.jsx("div",{className:"text-sm text-gray-400",children:b.userId})]})]}),a.jsx("p",{className:"text-gray-400",children:"Are you sure you want to delete this session? This action cannot be undone."})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>x(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:M,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none",children:"Delete"})]})]})}),y&&b&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Session Details"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>v(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Wt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(Nt,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsxs("div",{className:"text-white font-light",children:["Session ",b.id.slice(0,8),"..."]}),a.jsx("div",{className:"text-sm text-gray-400",children:b.userId})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Rn,{id:b.id,variant:"detail"}),a.jsx(Rn,{id:b.userId,label:"User ID",variant:"detail"}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Status:"}),a.jsx("span",{className:"text-white text-sm",children:new Date(b.expiresAt)>new Date?"Active":"Expired"})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Expires:"}),a.jsx("span",{className:"text-white text-sm",children:new Date(b.expiresAt).toLocaleString()})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Created:"}),a.jsx("span",{className:"text-white text-sm",children:new Date(b.createdAt).toLocaleString()})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Updated:"}),a.jsx("span",{className:"text-white text-sm",children:new Date(b.updatedAt).toLocaleString()})]})]})]}),a.jsx("div",{className:"flex justify-end mt-6",children:a.jsx(F,{onClick:()=>v(!1),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Close"})})]})})]})}function iV(){var b,p,w,N,S,C,T,O,H,U,z,Y,k,$,M,A,E,D,_,I,R,P,W,q,ee,ne,Z,se,xe;const[e,t]=m.useState(null),[n,s]=m.useState(null),[r,i]=m.useState(null),[o,l]=m.useState(null),[c,u]=m.useState(!0),[h,d]=m.useState(null);j4(ae=>{ae.type==="config_changed"?setTimeout(()=>{f(),x(),y(),v()},500):ae.type});const f=m.useCallback(async()=>{var ae;try{const de=await(await fetch("/api/config")).json();(ae=de.studio)!=null&&ae.version&&d(`v${de.studio.version}`),t(de)}catch{}finally{u(!1)}},[]),x=m.useCallback(async()=>{try{const ce=await(await fetch("/api/health")).json();s(ce.system||{studioVersion:h||"v1.0.0",nodeVersion:process.version,platform:navigator.platform,uptime:"2h 15m"})}catch{s({studioVersion:h||"v1.0.0",nodeVersion:"v18.0.0",platform:"macOS",uptime:"2h 15m"})}},[h]),y=m.useCallback(async()=>{try{const ce=await(await fetch("/api/plugins")).json();i(ce)}catch{i({plugins:[],configPath:null,totalPlugins:0,error:"Failed to fetch plugins"})}},[]),v=m.useCallback(async()=>{try{const ce=await(await fetch("/api/db")).json();l(ce)}catch{l({success:!1,name:"unknown",version:"unknown",dialect:"unknown",adapter:"unknown",displayName:"Unknown",autoDetected:!1,message:"Failed to fetch database info"})}},[]),j=ae=>{switch(ae==null?void 0:ae.toLowerCase()){case"postgresql":case"postgres":return a.jsxs(vt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:[a.jsx(Ht,{className:"w-3 h-3"}),"Connected"]});case"mysql":return a.jsxs(vt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:[a.jsx(Ht,{className:"w-3 h-3"}),"Connected"]});case"sqlite":return a.jsxs(vt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:[a.jsx(Hd,{className:"w-3 h-3"}),"Local"]});default:return a.jsxs(vt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:[a.jsx(Ms,{className:"w-3 h-3"}),"Unknown"]})}};m.useEffect(()=>{f(),x(),y(),v()},[f,v,y,x]);const g=ae=>{switch(ae.toLowerCase()){case"google":return a.jsx(sn,{className:"w-5 h-5 text-white"});case"github":return a.jsx(kn,{className:"w-5 h-5 text-white"});case"discord":return a.jsx(sn,{className:"w-5 h-5 text-white"});case"twitter":return a.jsx(sn,{className:"w-5 h-5 text-white"});default:return a.jsx(sn,{className:"w-5 h-5 text-white"})}};return c?a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsx(oR,{className:"w-6 h-6 text-white animate-spin"})}):a.jsxs("div",{className:"space-y-8",children:[a.jsx("div",{className:"flex items-center justify-between p-5 pt-7",children:a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-normal text-white tracking-tight",children:"Settings"}),a.jsx("p",{className:"text-gray-300 mt-2 uppercase font-mono font-light text-xs",children:"Configure your Better Auth application"})]})}),a.jsx("hr",{className:"w-full border-white/15 h-px"}),a.jsx("hr",{className:"w-full border-white/15 h-px"}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8 p-5",children:[a.jsxs(In,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[a.jsxs(Wn,{className:"space-y-0",children:[a.jsxs(qn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(uo,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"Application"})]}),a.jsxs(Ts,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Basic application configuration"]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsxs(Xn,{className:"space-y-0 px-0 pb-0 border-b-none",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(sn,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"App Name"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Application display name"})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("p",{className:"text-sm font-medium text-white",children:(e==null?void 0:e.appName)||"Better Auth"})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(co,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Base URL"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Application base URL"})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("p",{className:"text-sm font-mono font-medium text-white",children:(e==null?void 0:e.baseURL)||"http://localhost:3000"})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(xu,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Base Path"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Auth API base path"})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("p",{className:"text-sm font-mono font-medium text-white",children:(e==null?void 0:e.basePath)||"/api/auth"})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(kn,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Secret"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Encryption secret"})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("p",{className:"text-sm font-medium text-white",children:(e==null?void 0:e.secret)==="Configured"?"Configured":"Not set"})})]})]})]}),a.jsxs(In,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[a.jsxs(Wn,{className:"space-y-0",children:[a.jsxs(qn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(Nt,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"Database"})]}),a.jsxs(Ts,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Database connection and configuration"]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsxs(Xn,{className:"space-y-0 px-0 pb-0 border-b-none",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Nt,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:(o==null?void 0:o.displayName)||((b=e==null?void 0:e.database)==null?void 0:b.type)&&((p=e==null?void 0:e.database)==null?void 0:p.type.charAt(0).toUpperCase())+((w=e==null?void 0:e.database)==null?void 0:w.type.slice(1))||"Unknown"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Database Type"})]})]}),((o==null?void 0:o.name)||((N=e==null?void 0:e.database)==null?void 0:N.type))&&j((o==null?void 0:o.name)||((S=e==null?void 0:e.database)==null?void 0:S.type)||"")]}),((o==null?void 0:o.dialect)||((C=e==null?void 0:e.database)==null?void 0:C.dialect))&&(o==null?void 0:o.dialect)!=="unknown"&&a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Nt,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Dialect"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Database dialect"})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("p",{className:"text-sm font-medium text-white",children:((T=e==null?void 0:e.database)==null?void 0:T.dialect)||(o==null?void 0:o.dialect)})})]}),((O=e==null?void 0:e.database)==null?void 0:O.url)&&a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(co,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Connection URL"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Database connection string"})]})]}),a.jsxs(vt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:[a.jsx(Ht,{className:"w-3 h-3"}),"Configured"]})]}),((H=e==null?void 0:e.database)==null?void 0:H.casing)&&a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(uo,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Casing"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Table name casing"})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("p",{className:"text-sm font-medium text-white capitalize",children:e.database.casing})})]}),(e==null?void 0:e.database)&&a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(xg,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Debug Logs"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Database debug logging"})]})]}),a.jsx(vt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:e.database.debugLogs?a.jsxs(a.Fragment,{children:[a.jsx(Ms,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Ht,{className:"w-3 h-3"}),"Disabled"]})})]}),!(o!=null&&o.success)&&!(e!=null&&e.database)&&a.jsxs("div",{className:"flex items-center justify-between p-3 px-5",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Ms,{className:"w-5 h-5 text-yellow-400"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"No Database Detected"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:(o==null?void 0:o.message)||"No supported database packages found"})]})]}),a.jsx(vt,{variant:"secondary",className:"text-xs bg-yellow-900/50 border border-yellow-500/30 text-yellow-400 rounded-sm",children:"Unknown"})]})]})]}),a.jsxs(In,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[a.jsxs(Wn,{className:"space-y-0",children:[a.jsxs(qn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(kn,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"Providers"})]}),a.jsxs(Ts,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Configured authentication providers"]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsx(Xn,{className:"p-0",children:e!=null&&e.socialProviders&&e.socialProviders.length>0?e.socialProviders.map((ae,ce)=>a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15 last:border-b-0",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[g(ae.type),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white capitalize",children:ae.type}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:ae.clientId?"Configured":"Not configured"})]})]}),a.jsx(vt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:ae.clientId?a.jsxs(a.Fragment,{children:[a.jsx(Ht,{className:"w-3 h-3"}),"Active"]}):a.jsxs(a.Fragment,{children:[a.jsx(Ms,{className:"w-3 h-3"}),"Setup Required"]})})]},ce)):a.jsxs("div",{className:"text-center py-8",children:[a.jsx(kn,{className:"w-8 h-8 text-white mx-auto mb-2"}),a.jsx("p",{className:"text-sm text-gray-400",children:"No providers configured"})]})})]}),a.jsxs(In,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[a.jsxs(Wn,{className:"space-y-0",children:[a.jsxs(qn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(uh,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"Email & Password"})]}),a.jsxs(Ts,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Email authentication settings"]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsxs(Xn,{className:"p-0",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(uh,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Email Authentication"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Allow users to sign up with email"})]})]}),a.jsx(vt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(U=e==null?void 0:e.emailAndPassword)!=null&&U.enabled?a.jsxs(a.Fragment,{children:[a.jsx(Ht,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx($r,{className:"w-3 h-3"}),"Disabled"]})})]}),((z=e==null?void 0:e.emailAndPassword)==null?void 0:z.enabled)&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(li,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Sign Up"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Allow new user registration"})]})]}),a.jsx(vt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(Y=e==null?void 0:e.emailAndPassword)!=null&&Y.disableSignUp?a.jsxs(a.Fragment,{children:[a.jsx($r,{className:"w-3 h-3"}),"Disabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Ht,{className:"w-3 h-3"}),"Enabled"]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(kn,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Email Verification"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Require email verification"})]})]}),a.jsx(vt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(k=e==null?void 0:e.emailAndPassword)!=null&&k.requireEmailVerification?a.jsxs(a.Fragment,{children:[a.jsx(Ht,{className:"w-3 h-3"}),"Required"]}):a.jsxs(a.Fragment,{children:[a.jsx(Ms,{className:"w-3 h-3"}),"Optional"]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(xu,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Password Length"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Min/Max password length"})]})]}),a.jsx("div",{className:"text-right",children:a.jsxs("p",{className:"text-sm font-medium text-white",children:[(($=e==null?void 0:e.emailAndPassword)==null?void 0:$.minPasswordLength)||8," -"," ",((M=e==null?void 0:e.emailAndPassword)==null?void 0:M.maxPasswordLength)||128]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Em,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Auto Sign In"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Auto sign in after registration"})]})]}),a.jsx(vt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(A=e==null?void 0:e.emailAndPassword)!=null&&A.autoSignIn?a.jsxs(a.Fragment,{children:[a.jsx(Ht,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Ms,{className:"w-3 h-3"}),"Disabled"]})})]})]})]})]}),a.jsxs(In,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[a.jsxs(Wn,{className:"space-y-0",children:[a.jsxs(qn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(Ld,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"Session"})]}),a.jsxs(Ts,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Session management settings"]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsxs(Xn,{className:"p-0",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Ld,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Session Duration"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"How long sessions last"})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-sm font-medium text-white",children:(E=e==null?void 0:e.session)!=null&&E.expiresIn?`${Math.floor(e.session.expiresIn/(60*60*24))} days`:"7 days"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Default"})]})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(xg,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Update Age"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Session refresh interval"})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("p",{className:"text-sm font-medium text-white",children:(D=e==null?void 0:e.session)!=null&&D.updateAge?`${Math.floor(e.session.updateAge/(60*60))} hours`:"24 hours"})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Em,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Session Refresh"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Auto refresh sessions"})]})]}),a.jsx(vt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(_=e==null?void 0:e.session)!=null&&_.disableSessionRefresh?a.jsxs(a.Fragment,{children:[a.jsx($r,{className:"w-3 h-3"}),"Disabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Ht,{className:"w-3 h-3"}),"Enabled"]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Nt,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Store in Database"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Store sessions in database"})]})]}),a.jsx(vt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(I=e==null?void 0:e.session)!=null&&I.storeSessionInDatabase?a.jsxs(a.Fragment,{children:[a.jsx(Ht,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Hd,{className:"w-3 h-3"}),"Secondary Storage"]})})]})]})]}),a.jsxs(In,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[a.jsxs(Wn,{className:"space-y-0",children:[a.jsxs(qn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(kn,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"Rate Limiting"})]}),a.jsxs(Ts,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"API rate limiting configuration"]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsxs(Xn,{className:"p-0",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(kn,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Rate Limiting"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Enable rate limiting"})]})]}),a.jsx(vt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(R=e==null?void 0:e.rateLimit)!=null&&R.enabled?a.jsxs(a.Fragment,{children:[a.jsx(Ht,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Ms,{className:"w-3 h-3"}),"Disabled"]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Ld,{className:"w-5 h-5 text-red-400"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Rate Limit Window"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Time window for rate limiting"})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-sm font-medium text-white",children:(P=e==null?void 0:e.rateLimit)!=null&&P.window?`${e.rateLimit.window} seconds`:"10 seconds"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Window"})]})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(kn,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Max Requests"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Maximum requests per window"})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-sm font-medium text-white",children:((W=e==null?void 0:e.rateLimit)==null?void 0:W.max)||100}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Requests"})]})]}),a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Nt,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Storage"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Rate limit storage type"})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("p",{className:"text-sm font-medium text-white capitalize",children:((q=e==null?void 0:e.rateLimit)==null?void 0:q.storage)||"memory"})})]})]})]}),a.jsxs(In,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[a.jsxs(Wn,{className:"space-y-0",children:[a.jsxs(qn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(uo,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"Advanced"})]}),a.jsxs(Ts,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Advanced configuration options"]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsxs(Xn,{className:"p-0",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(xu,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Secure Cookies"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Use secure cookies"})]})]}),a.jsx(vt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(ee=e==null?void 0:e.advanced)!=null&&ee.useSecureCookies?a.jsxs(a.Fragment,{children:[a.jsx(Ht,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Ms,{className:"w-3 h-3"}),"Disabled"]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(kn,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"CSRF Check"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"CSRF protection"})]})]}),a.jsx(vt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(ne=e==null?void 0:e.advanced)!=null&&ne.disableCSRFCheck?a.jsxs(a.Fragment,{children:[a.jsx($r,{className:"w-3 h-3"}),"Disabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Ht,{className:"w-3 h-3"}),"Enabled"]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Xo,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"IP Tracking"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Track IP addresses"})]})]}),a.jsx(vt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(se=(Z=e==null?void 0:e.advanced)==null?void 0:Z.ipAddress)!=null&&se.disableIpTracking?a.jsxs(a.Fragment,{children:[a.jsx($r,{className:"w-3 h-3"}),"Disabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Ht,{className:"w-3 h-3"}),"Enabled"]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(tR,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Telemetry"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Usage analytics"})]})]}),a.jsx(vt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(xe=e==null?void 0:e.telemetry)!=null&&xe.enabled?a.jsxs(a.Fragment,{children:[a.jsx(Ms,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Ht,{className:"w-3 h-3"}),"Disabled"]})})]})]})]}),a.jsxs(In,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[a.jsxs(Wn,{className:"space-y-0",children:[a.jsxs(qn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(Hd,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"System Info"})]}),a.jsxs(Ts,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Better Auth Studio system information"]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsxs(Xn,{className:"p-0",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Em,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Studio Version"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Better Auth Studio"})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-sm font-medium text-white",children:h||"v1.0.0"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Latest"})]})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Hd,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Node.js Version"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Runtime environment"})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-sm font-medium text-white",children:(n==null?void 0:n.nodeVersion)||"v18.0.0"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Current"})]})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(sn,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Platform"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Operating system"})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-sm font-medium text-white",children:(n==null?void 0:n.platform)||"macOS"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"System"})]})]}),a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Ld,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Uptime"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Service uptime"})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-sm font-medium text-white",children:(n==null?void 0:n.uptime)||"2h 15m"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Running"})]})]})]})]}),a.jsxs(In,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none lg:col-span-2",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsxs(Wn,{className:"space-y-0",children:[a.jsxs(qn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(yy,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"Plugins"})]}),a.jsxs(Ts,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Better Auth plugins enabled in your configuration"]})]}),a.jsxs("div",{className:"pr-6",children:[a.jsx("p",{className:"text-sm font-medium text-white",children:(r==null?void 0:r.totalPlugins)||0}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Active"})]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsx(Xn,{className:"space-y-0 px-0 pb-0 border-b-none",children:r!=null&&r.plugins&&r.plugins.length>0?a.jsxs(a.Fragment,{children:[r.plugins.map((ae,ce)=>a.jsxs("div",{className:`flex items-center justify-between p-3 px-5 ${ce<r.plugins.length-1?"border-b border-white/15":""}`,children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(yy,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:ae.name.slice(0,1).toUpperCase()+ae.name.slice(1).replace("-"," ")}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:ae.description})]})]}),a.jsx("div",{className:"text-right flex items-center space-x-2",children:a.jsxs(vt,{variant:"secondary",className:"text-xs bg-green-900/50 border border-dashed rounded-none border-green-500/30 text-green-400 flex items-center gap-1",children:[a.jsx(Ht,{className:"w-3 h-3"}),"Enabled"]})})]},ae.id)),r.configPath&&a.jsx("div",{className:"p-4 px-5 bg-black/30 border-t border-white/10",children:a.jsxs("p",{className:"text-xs text-gray-400",children:["Config file:"," ",a.jsx("span",{className:"text-white font-mono",children:r.configPath})]})})]}):a.jsxs("div",{className:"flex items-center justify-between p-4 px-5",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Ms,{className:"w-5 h-5 text-yellow-400"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-white",children:"No Plugins Enabled"}),a.jsx("p",{className:"text-xs text-gray-400",children:(r==null?void 0:r.error)||"No plugins are currently configured in your Better Auth setup"})]})]}),a.jsx(vt,{variant:"secondary",className:"text-xs bg-yellow-900/50 border border-yellow-500/30 text-yellow-400 rounded-sm",children:"None"})]})})]})]})]})}function Mw(){var M,A;const{orgId:e,teamId:t}=zp(),n=ws(),[s,r]=m.useState(null),[i,o]=m.useState([]),[l,c]=m.useState(!0),[u,h]=m.useState("details"),[d,f]=m.useState(!1),[x,y]=m.useState(!1),[v,j]=m.useState(""),[g,b]=m.useState([]),[p,w]=m.useState([]),[N,S]=m.useState({name:""}),C=m.useCallback(async()=>{if(t)try{const D=await(await fetch(`/api/teams/${t}`)).json();D.success&&D.team?(r(D.team),S({name:D.team.name})):D.team?(r(D.team),S({name:D.team.name})):B.error("Team not found")}catch{B.error("Failed to load team")}finally{c(!1)}},[t]),T=m.useCallback(async()=>{if(t)try{const D=await(await fetch(`/api/teams/${t}/members`)).json();D.success&&o(D.members||[])}catch{B.error("Failed to load team members")}},[t]),O=async()=>{try{const D=await(await fetch("/api/users?limit=10000")).json(),_=i.map(R=>R.userId),I=(D.users||[]).filter(R=>!_.includes(R.id));b(I)}catch{B.error("Failed to load users")}};m.useEffect(()=>{t&&(C(),T())},[t,C,T]);const H=async()=>{if(!N.name){B.error("Please enter a team name");return}const E=B.loading("Updating team...");try{const _=await(await fetch(`/api/teams/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:N.name})})).json();_.success?(await C(),y(!1),B.success("Team updated successfully!",{id:E})):B.error(`Error updating team: ${_.error||"Unknown error"}`,{id:E})}catch{B.error("Error updating team",{id:E})}},U=async()=>{if(p.length===0){B.error("Please select at least one user");return}const E=B.loading(`Adding ${p.length} members...`);try{const _=await(await fetch(`/api/teams/${t}/members`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userIds:p})})).json();_.success?(await T(),f(!1),w([]),j(""),B.success(`Successfully added ${p.length} members!`,{id:E})):B.error(`Error adding members: ${_.error||"Unknown error"}`,{id:E})}catch{B.error("Error adding members",{id:E})}},z=async(E,D)=>{const _=B.loading(`Removing ${D}...`);try{const R=await(await fetch(`/api/team-members/${E}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();R.success?(await T(),B.success(`${D} removed from team!`,{id:_})):B.error(`Error removing member: ${R.error||"Unknown error"}`,{id:_})}catch{B.error("Error removing team member",{id:_})}},Y=()=>{O(),f(!0)},k=E=>{w(D=>D.includes(E)?D.filter(_=>_!==E):[...D,E])},$=g.filter(E=>E.name.toLowerCase().includes(v.toLowerCase())||E.email.toLowerCase().includes(v.toLowerCase()));return l?a.jsx("div",{className:"flex items-center justify-center h-32",children:a.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[a.jsx(tr,{className:"w-6 h-6 text-white animate-spin"}),a.jsx("div",{className:"text-white text-sm",children:"Loading team details..."})]})}):s?a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("div",{className:"flex items-center space-x-4",children:a.jsx("span",{className:"mb-4 ml-0 flex justify-start items-start text-left border-none text-white",children:a.jsxs("span",{className:"font-light",children:[a.jsxs("span",{onClick:()=>n(`/organizations/${s.organizationId}`),className:"uppercase cursor-pointer text-white/80 font-mono text-sm",children:["teams /"," "]}),a.jsx("span",{className:"text-white font-mono text-sm",children:t})]})})}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(F,{onClick:Y,className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[a.jsx(Zl,{className:"w-4 h-4 mr-2"}),"Add Members"]}),a.jsxs(F,{onClick:()=>y(!0),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[a.jsx(ii,{className:"w-4 h-4 mr-2"}),"Edit Team"]})]})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-12 h-12 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:a.jsx(ft,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl text-white font-light inline-flex items-center",children:[s.name,t&&a.jsx(Rn,{id:t,variant:"subscript"})]}),a.jsx("div",{className:"flex items-center space-x-2 mt-1",children:s.organization&&a.jsxs(Rp,{to:`/organizations/${s.organizationId}`,className:"text-gray-400 hover:text-white text-sm font-sans",children:[a.jsx(An,{className:"w-4 h-4 inline mr-1"}),s.organization.name]})})]})]}),a.jsx("div",{className:"border-b border-white/10",children:a.jsxs("nav",{className:"flex space-x-8",children:[a.jsxs("button",{onClick:()=>h("details"),className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${u==="details"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[a.jsx(ft,{className:"w-4 h-4"}),a.jsx("span",{children:"Details"})]}),a.jsxs("button",{onClick:()=>h("members"),className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${u==="members"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[a.jsx(ft,{className:"w-4 h-4"}),a.jsxs("span",{className:"inline-flex items-start",children:["Members",a.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:a.jsx(xs,{value:i.length,className:"text-white/80 font-mono text-xs",prefix:a.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]})]})}),u==="details"&&a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:[a.jsx("h3",{className:"text-lg text-white font-light mb-4",children:"Team Information"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Name"}),a.jsx("p",{className:"text-white font-sans mt-1",children:s.name})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Organization"}),a.jsx("p",{className:"text-white font-sans mt-1",children:((M=s.organization)==null?void 0:M.name)||"Unknown"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Created"}),a.jsx("p",{className:"text-white font-sans mt-1",children:new Date(s.createdAt).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Last Updated"}),a.jsx("p",{className:"text-white font-sans mt-1",children:new Date(s.updatedAt).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(ft,{className:"w-8 h-8 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl text-white font-sans font-light",children:i.length}),a.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Members"})]})]})}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(ls,{className:"w-8 h-8 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl text-white font-sans font-light",children:Math.ceil((Date.now()-new Date(s.createdAt).getTime())/(1e3*60*60*24))}),a.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Days Active"})]})]})}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(An,{className:"w-8 h-8 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl text-white font-sans font-light",children:"1"}),a.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Organization"})]})]})})]})]}),u==="members"&&a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{children:[a.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Team Members",a.jsx(xs,{value:i.length,className:"text-white/80 font-mono text-xs",prefix:a.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})]}),a.jsx("p",{className:"text-gray-400 font-light font-mono text-xs uppercase mt-1",children:"Manage members of this team"})]})}),i.length>0?a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"User"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Email"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Role"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Joined"}),a.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),a.jsx("tbody",{children:i.map(E=>a.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5",children:[a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("img",{src:E.user.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${E.user.id}`,alt:E.user.name,className:"w-10 h-10 rounded-none border border-dashed border-white/20"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:E.user.name}),a.jsx(Rn,{id:E.user.id})]})]})}),a.jsx("td",{className:"py-4 px-4 text-white",children:E.user.email}),a.jsx("td",{className:"py-4 px-4",children:a.jsx(vt,{variant:"secondary",className:"text-xs bg-blue-900/10 border border-dashed border-blue-500/30 text-blue-400/70 rounded-none capitalize",children:E.role})}),a.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:new Date(E.joinedAt).toLocaleDateString()}),a.jsx("td",{className:"py-4 px-4 text-right",children:a.jsx("div",{className:"flex items-center justify-end space-x-2",children:a.jsxs(F,{variant:"outline",size:"sm",className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",onClick:()=>z(E.id,E.user.name),children:[a.jsx(wu,{className:"w-4 h-4 mr-1"}),"Remove"]})})})]},E.id))})]})})}):a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-12",children:a.jsxs("div",{className:"text-center",children:[a.jsx(ft,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"No Members Yet"}),a.jsx("p",{className:"text-gray-400 mb-6",children:"Add members to this team to get started."}),a.jsxs(F,{onClick:Y,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[a.jsx(Zl,{className:"w-4 h-4 mr-2"}),"Add First Members"]})]})})]}),d&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-2xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Add Team Members"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>{f(!1),w([]),j("")},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Jt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"relative",children:[a.jsx(FC,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx(Fe,{placeholder:"Search users by name or email...",value:v,onChange:E=>j(E.target.value),className:"pl-10 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),p.length>0&&a.jsx("div",{className:"bg-blue-900/20 border border-blue-500/30 rounded-none p-3",children:a.jsxs("p",{className:"text-blue-400 text-sm",children:[p.length," user",p.length!==1?"s":""," selected"]})}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none max-h-96 overflow-y-auto",children:$.length>0?a.jsx("div",{className:"divide-y divide-white/5",children:$.map(E=>a.jsxs("div",{className:`flex items-center space-x-3 p-4 cursor-pointer hover:bg-white/5 ${p.includes(E.id)?"bg-blue-900/20":""}`,onClick:()=>k(E.id),children:[a.jsx("input",{type:"checkbox",checked:p.includes(E.id),onChange:()=>k(E.id),className:"rounded border-gray-300"}),a.jsx("img",{src:E.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${E.id}`,alt:E.name,className:"w-10 h-10 rounded-none border border-dashed border-white/20"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-white font-light",children:E.name}),a.jsx("div",{className:"text-sm text-gray-400",children:E.email})]})]},E.id))}):a.jsx("div",{className:"p-8 text-center",children:a.jsx("p",{className:"text-gray-400",children:"No users found matching your search."})})})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>{f(!1),w([]),j("")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsxs(F,{onClick:U,disabled:p.length===0,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none disabled:opacity-50",children:[a.jsx(Zl,{className:"w-4 h-4 mr-2"}),"Add ",p.length," Member",p.length!==1?"s":""]})]})]})}),x&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Edit Team"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>y(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Jt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:a.jsx(ft,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:s.name}),a.jsx("div",{className:"text-sm text-gray-400",children:(A=s.organization)==null?void 0:A.name})]})]}),a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"edit-team-name",className:"text-sm text-gray-400 font-light",children:"Team Name"}),a.jsx(Fe,{id:"edit-team-name",value:N.name,onChange:E=>S({name:E.target.value}),placeholder:"e.g. Development Team",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>y(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:H,disabled:N.name===s.name,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update Team"})]})]})})]}):a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsx("div",{className:"flex items-center space-x-4",children:a.jsx("span",{className:"mb-4 ml-0 flex justify-start items-start text-left border-none text-white",children:a.jsxs("span",{className:"font-light",children:[a.jsxs("span",{onClick:()=>n(`/organizations/${e}`),className:"uppercase cursor-pointer text-white/80 font-mono text-sm",children:["teams /"," "]}),a.jsx("span",{className:"text-white font-mono text-sm",children:t})]})})}),a.jsxs("div",{className:"text-center py-12",children:[a.jsx(ft,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),a.jsx("h2",{className:"text-xl text-white font-light mb-2",children:"Team Not Found"}),a.jsx("p",{className:"text-gray-400",children:"The team you're looking for doesn't exist."})]})]})}function oV(){const e=ws(),[t,n]=m.useState([]),[s,r]=m.useState(!0),[i,o]=m.useState(null),[l,c]=m.useState(""),[u,h]=m.useState("all"),[d,f]=m.useState(1),[x]=m.useState(20);m.useEffect(()=>{y()},[]);const y=async()=>{try{const S=await(await fetch("/api/plugins")).json(),C=(S==null?void 0:S.plugins).find(T=>T.id==="teams");o({enabled:!!C,availablePlugins:(S==null?void 0:S.plugins).map(T=>T.id),configPath:S.configPath,teamsPlugin:(S==null?void 0:S.plugins).find(T=>T.id==="teams")}),C?await v():r(!1)}catch(N){console.error("Failed to check teams plugin status:",N),o({enabled:!1,error:"Failed to check plugin status"}),r(!1)}},v=async()=>{try{const S=await(await fetch("/api/teams")).json();S.success&&n(S.teams||[])}catch(N){console.error("Failed to fetch teams:",N),B.error("Failed to load teams")}finally{r(!1)}},j=t.filter(N=>{var C;const S=N.name.toLowerCase().includes(l.toLowerCase())||((C=N.organization)==null?void 0:C.name.toLowerCase().includes(l.toLowerCase()));if(u==="all")return S;if(u==="recent"){const T=new Date;return T.setDate(T.getDate()-7),S&&new Date(N.createdAt)>T}return S}),g=d*x,b=g-x,p=j.slice(b,g),w=Math.ceil(j.length/x);return s?a.jsx("div",{className:"flex items-center justify-center min-h-screen",children:a.jsx(Vs,{className:"w-8 h-8 animate-spin text-white"})}):i!=null&&i.enabled?a.jsxs("div",{className:"p-6 space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl relative text-white font-light inline-flex items-start",children:["Teams",a.jsx("sup",{className:"text-xs text-gray-500 ml-1 mt-0 inline-flex items-baseline",children:a.jsx(xs,{value:j.length,className:"text-white font-mono text-sm",prefix:a.jsx("span",{className:"mr-1 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-1 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]}),a.jsxs("p",{className:"text-gray-400 mt-1 uppercase font-mono text-sm font-light flex items-baseline gap-1",children:[a.jsx(xs,{value:j.length,className:"text-white font-mono text-sm",format:{notation:"standard",maximumFractionDigits:0}}),a.jsxs("span",{children:["team",j.length!==1?"s":""," found"]})]})]}),a.jsx("div",{className:"flex items-center space-x-3",children:a.jsxs(F,{onClick:()=>e("/teams/new"),className:"bg-white text-black hover:bg-gray-200 border-dashed",children:[a.jsx(ur,{className:"w-4 h-4 mr-2"}),"Create Team"]})})]}),a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsxs("div",{className:"relative flex-1 max-w-md",children:[a.jsx(oi,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx(Fe,{type:"text",placeholder:"Search teams...",value:l,onChange:N=>c(N.target.value),className:"pl-10 bg-black border-dashed border-white/20 text-white placeholder-gray-400 focus:ring-2 focus:ring-white focus:border-transparent"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(F,{variant:u==="all"?"default":"outline",size:"sm",onClick:()=>h("all"),className:u==="all"?"bg-white text-black":"border-dashed border-white/20 text-white hover:bg-white/10",children:"All"}),a.jsx(F,{variant:u==="recent"?"default":"outline",size:"sm",onClick:()=>h("recent"),className:u==="recent"?"bg-white text-black":"border-dashed border-white/20 text-white hover:bg-white/10",children:"Recent"})]})]}),p.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(li,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-light text-white mb-2",children:"No teams found"}),a.jsx("p",{className:"text-gray-400 mb-6",children:l?"Try adjusting your search terms":"Get started by creating your first team"}),!l&&a.jsxs(F,{onClick:()=>e("/teams/new"),className:"bg-white text-black hover:bg-gray-200 border-dashed",children:[a.jsx(ur,{className:"w-4 h-4 mr-2"}),"Create Team"]})]}):a.jsx("div",{className:"grid gap-4",children:p.map(N=>{var S;return a.jsx("div",{className:"bg-black/30 border border-white/15 rounded-none p-4 hover:bg-black/40 transition-colors cursor-pointer",onClick:()=>e(`/teams/${N.id}`),children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsx("div",{className:"w-10 h-10 bg-white/10 rounded-none flex items-center justify-center",children:a.jsx(li,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-white font-medium",children:N.name}),a.jsxs("p",{className:"text-gray-400 text-sm",children:[(S=N.organization)==null?void 0:S.name," • ",N.memberCount||0," members"]})]})]}),a.jsx("div",{className:"flex items-center space-x-2",children:a.jsx(vt,{variant:"secondary",className:"text-xs bg-green-900/50 border border-dashed rounded-none border-green-500/30 text-green-400",children:"Active"})})]})},N.id)})}),w>1&&a.jsxs("div",{className:"flex items-center justify-center space-x-2",children:[a.jsx(F,{variant:"outline",size:"sm",onClick:()=>f(Math.max(1,d-1)),disabled:d===1,className:"border-dashed border-white/20 text-white hover:bg-white/10 disabled:opacity-50",children:"Previous"}),a.jsxs("span",{className:"text-gray-400 text-sm",children:["Page ",d," of ",w]}),a.jsx(F,{variant:"outline",size:"sm",onClick:()=>f(Math.min(w,d+1)),disabled:d===w,className:"border-dashed border-white/20 text-white hover:bg-white/10 disabled:opacity-50",children:"Next"})]})]}):a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl text-white font-light",children:"Teams"}),a.jsx("p",{className:"text-gray-400 mt-1",children:"Manage your application organizations"})]})}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-8",children:a.jsxs("div",{className:"flex items-start space-x-4",children:[a.jsx("div",{className:"flex-shrink-0",children:a.jsx(_s,{className:"w-12 h-12 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"Organization Plugin Required"}),a.jsx("p",{className:"text-gray-300 mb-6",children:"To use Organizations in Better Auth Studio, you need to enable the organization plugin in your Better Auth configuration."}),a.jsxs("div",{className:"bg-black/50 border border-dashed border-white/20 rounded-none p-4 mb-6",children:[a.jsx("h4",{className:"text-white font-light mb-3",children:"Follow these steps:"}),a.jsx("ol",{className:"text-gray-300 space-y-2 text-sm list-decimal list-inside",children:a.jsxs("li",{children:["Import the plugin in your auth configuration file",(i==null?void 0:i.configPath)&&a.jsxs("span",{className:"text-gray-400",children:[" (",i.configPath,")"]}),":"]})}),a.jsx("div",{className:"mt-4 bg-black/70 border border-dashed border-white/10 rounded-none p-3 overflow-x-auto",children:a.jsxs("pre",{className:"text-sm text-gray-300",children:[a.jsx("span",{className:"text-blue-400",children:"import"})," ","{ betterAuth }"," ",a.jsx("span",{className:"text-blue-400",children:"from"})," ",a.jsx("span",{className:"text-green-400",children:'"better-auth"'})," ",a.jsx("br",{}),a.jsx("span",{className:"text-blue-400",children:"import"})," ","{ organization }"," ",a.jsx("span",{className:"text-blue-400",children:"from"})," ",a.jsx("span",{className:"text-green-400",children:'"better-auth/plugins/organization"'})," ",a.jsx("br",{}),a.jsx("span",{className:"text-blue-400",children:"export const"})," ",a.jsx("span",{className:"text-yellow-300",children:"auth"})," ="," ",a.jsx("span",{className:"text-yellow-300",children:"betterAuth"}),"(","{"," ",a.jsx("br",{}),a.jsx("span",{className:"text-gray-500 pl-10",children:"// ... your existing configuration"})," ",a.jsx("br",{}),a.jsx("span",{className:"text-red-300 pl-10",children:"plugins"}),": [ ",a.jsx("br",{}),a.jsxs("span",{className:"text-yellow-300 pl-12",children:["organization(",")"]}),a.jsx("br",{}),a.jsx("span",{className:"pl-10",children:"]"})," ",a.jsx("br",{}),"}",") ",a.jsx("br",{})]})}),a.jsx("div",{className:"mt-4",children:a.jsx("p",{className:"text-gray-400 text-sm",children:"2. Do migrations to create the organizations table"})}),a.jsx("div",{className:"mt-2",children:a.jsx("p",{className:"text-gray-400 text-sm",children:"3. Restart your application to apply the changes"})})]}),(i==null?void 0:i.availablePlugins)&&i.availablePlugins.length>0&&a.jsx("div",{className:"mb-4",children:a.jsxs("p",{className:"text-gray-400 text-sm",children:["Currently enabled plugins: ",i.availablePlugins.join(", ")]})}),a.jsx(F,{onClick:()=>window.location.reload(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Check Again"}),a.jsxs("div",{className:"mt-4 text-xs text-gray-500",children:["Need help? Check the"," ",a.jsx("a",{href:"https://better-auth.com/docs/plugins/organization",target:"_blank",rel:"noopener noreferrer",className:"text-white hover:underline",children:"Better Auth Organization Plugin Documentation"})]})]})]})})]})}function Sh(e){return e?"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"}function tE(e,t,n){let s="",r=0,i=0;for(const o of e)for(r=r<<8|o,i+=8;i>=6;)i-=6,s+=t[r>>i&63];if(i>0&&(s+=t[r<<6-i&63]),n){const o=(4-s.length%4)%4;s+="=".repeat(o)}return s}function nE(e,t){const n=new Map;for(let o=0;o<t.length;o++)n.set(t[o],o);const s=[];let r=0,i=0;for(const o of e){if(o==="=")break;const l=n.get(o);if(l===void 0)throw new Error(`Invalid Base64 character: ${o}`);r=r<<6|l,i+=6,i>=8&&(i-=8,s.push(r>>i&255))}return Uint8Array.from(s)}const lV={encode(e,t={}){const n=Sh(!1),s=typeof e=="string"?new TextEncoder().encode(e):new Uint8Array(e);return tE(s,n,t.padding??!0)},decode(e){typeof e!="string"&&(e=new TextDecoder().decode(e));const t=e.includes("-")||e.includes("_"),n=Sh(t);return nE(e,n)}},cV={encode(e,t={}){const n=Sh(!0),s=typeof e=="string"?new TextEncoder().encode(e):new Uint8Array(e);return tE(s,n,t.padding??!0)},decode(e){const t=e.includes("-")||e.includes("_"),n=Sh(t);return nE(e,n)}};function dV(){const e=typeof globalThis<"u"&&globalThis.crypto;if(e&&typeof e.subtle=="object"&&e.subtle!=null)return e.subtle;throw new Error("crypto.subtle must be defined")}function uV(e,t){return{digest:async n=>{const s=new TextEncoder,r=typeof n=="string"?s.encode(n):n,i=await dV().digest(e,r);return t==="hex"?Array.from(new Uint8Array(i)).map(c=>c.toString(16).padStart(2,"0")).join(""):t==="base64"||t==="base64url"||t==="base64urlnopad"?t.includes("url")?cV.encode(i,{padding:t!=="base64urlnopad"}):lV.encode(i):i}}}const Km=`// Example custom migration script
498
503
  import { migrateUser } from '@better-auth/migration';
499
504
 
500
505
  async function run() {
@@ -695,4 +700,4 @@ migrateFromClerk()
695
700
  .catch((error) => {
696
701
  console.error('Migration failed:', error);
697
702
  process.exit(1);
698
- });`},{id:"supabase",name:"Supabase",description:"Supabase Migration guide",docs:"https://better-auth.com/docs/migrations/supabase",logo:"",highlights:["Exports Supabase auth.users and auth.identities.","Preserves password hashes and metadata fields.","Supports incremental re-runs with idempotent operations."],disabled:!0},{id:"auth0",name:"Auth0",description:"Auth0 Migration guide",docs:"https://better-auth.com/docs/migrations/auth0",logo:"",highlights:["Uses Auth0 Management API bulk exports.","Keeps password hashes compatible with Better Auth adapters.","Migrates applications and roles to Better Auth format."],disabled:!0},{id:"nextauth",name:"NextAuth.js",description:"NextAuth.js Migration guide",docs:"https://better-auth.com/docs/migrations/nextauth",logo:"",highlights:["Reads users/accounts from your existing NextAuth database.","Moves refresh tokens and OAuth profiles into Better Auth.","Supports Prisma, MySQL, and Postgres NextAuth adapters."],disabled:!0},{id:"custom",name:"Custom Script",description:"Custom Migration guide",docs:"https://better-auth.com/docs/migrations/custom",highlights:["Use Better Auth SDK helpers to insert users safely.","Supports dry-run mode to validate before committing.","Perfect for bespoke data sources or ETL pipelines."],custom:!0}];function uV(){const[e,t]=sM(),[n,s]=m.useState(null),[r,i]=m.useState([]),[o,l]=m.useState(!1),[c,u]=m.useState(!1),[h,d]=m.useState([]),[f,x]=m.useState(""),[y,v]=m.useState(!1),[j,g]=m.useState(""),[b,p]=m.useState(Km),[w,N]=m.useState(!1),[S,C]=m.useState(""),[T,O]=m.useState(""),[H,U]=m.useState("SHA-256"),[z,Y]=m.useState("hex"),[k,$]=m.useState(null),[M,A]=m.useState(!1),[E,D]=m.useState(!1),_=(K,V,te,me)=>{i(L=>[...L,{id:me??`log-${Date.now()}-${Math.random()}`,type:K,message:V,timestamp:new Date,status:te}])},I=m.useRef(new Set),R=m.useRef(new Set),P=m.useRef(new Map),W=m.useRef(null),q=()=>Cl.find(K=>!K.disabled)??Cl[0],ee=Cl.find(K=>K.id===j)??q();m.useEffect(()=>{g(y?K=>{var V;return K||((V=q())==null?void 0:V.id)||""}:"")},[y,q]);const ne=K=>{g(K),K!=="custom"&&p(Km)},Z=()=>{C(""),O(""),$(null),U("SHA-256"),Y("hex"),N(!0)},se=async()=>{if(!S.trim()){B.error("Enter a password to hash");return}try{A(!0);const K=T?`${T}:${S}`:S,te=await dV(H,z).digest(K);$(te),B.success("Password hashed successfully")}catch(K){B.error("Failed to hash password"),console.error(K)}finally{A(!1)}},xe=async K=>{try{await navigator.clipboard.writeText(K),B.success("Copied to clipboard")}catch{B.error("Failed to copy to clipboard")}},ae=K=>{switch(K.toLowerCase()){case"github":return a.jsx(aR,{className:"w-5 h-5 text-white"});case"google":return a.jsx(sn,{className:"w-5 h-5 text-white"});case"discord":return a.jsx(sn,{className:"w-5 h-5 text-white"});case"twitter":case"x":return a.jsx(sn,{className:"w-5 h-5 text-white"});case"facebook":return a.jsx(sn,{className:"w-5 h-5 text-white"});case"apple":return a.jsx(sn,{className:"w-5 h-5 text-white"});default:return a.jsx(sn,{className:"w-5 h-5 text-white"})}},ce=()=>{W.current&&!W.current.closed&&W.current.close(),W.current=null},de=(K,V,te,me,L)=>{let ie=P.current.get(K);ie||(ie=new Map,P.current.set(K,ie));const ue=ie.get(te);if(ue){i(Be=>Be.map(_e=>_e.id===ue?{..._e,type:V,message:me,status:L,timestamp:new Date}:_e));return}const he=`session-${K}-${te}-${Date.now()}`;ie.set(te,he),_(V,me,L,he)},Se=(K,V,te=0)=>{I.current.has(K)||I.current.add(K),fetch(`/api/tools/oauth/status?testSessionId=${encodeURIComponent(K)}`).then(L=>L.json()).then(L=>{if(L.hasResult){I.current.delete(K),Ee(L.result);return}if(te+1>=15){I.current.delete(K),de(K,"error","timeout","⌛ Timed out waiting for account creation. Check Better Auth logs.","failed"),ce(),s(null),B.error("OAuth test timed out waiting for account creation");return}setTimeout(()=>Se(K,V,te+1),2e3)}).catch(L=>{te+1<15?setTimeout(()=>Se(K,V,te+1),2e3):(I.current.delete(K),de(K,"error","poll-error",`⚠️ Failed to check OAuth status: ${L}`,"failed"),ce(),s(null),B.error("Failed to check OAuth status"))})},Ee=K=>{l(!0);const V=K.testSessionId;if(K.success){if(R.current.has(V)&&K.userInfo)return;if(de(V,"success","waiting","✅ Verified with Better Auth.","completed"),K.userInfo){R.current.add(V);const te=[K.userInfo.name?`👤 ${K.userInfo.name}`:null,K.userInfo.email?`✉️ ${K.userInfo.email}`:null].filter(Boolean).join(" | "),me=te?`✅ ${K.provider} OAuth succeeded — ${te}`:`✅ ${K.provider} OAuth succeeded!`;de(V,"success","completed",me,"completed"),B.success(`OAuth test for ${K.provider} passed!`),ce(),s(null),P.current.delete(V)}else de(V,"progress","await-finalize","⌛ OAuth flow finished. Waiting for Better Auth to finalize account...","running"),I.current.has(V)||(I.current.add(V),Se(V,K.provider))}else{if(R.current.has(V))return;de(V,"error","waiting","❌ Verification failed with Better Auth.","failed");const te=K.error?` — ${K.error}`:"";de(V,"error","failed",`❌ ${K.provider} OAuth failed${te}`,"failed"),B.error(`OAuth test for ${K.provider} failed`),ce(),s(null),P.current.delete(V)}K.success||(R.current.add(V),P.current.delete(V)),sessionStorage.removeItem("oauth_test_session"),sessionStorage.removeItem(`oauth_test_result_${V}`)};m.useEffect(()=>{const K=e.get("oauth_test_result");if(K)try{const V=JSON.parse(decodeURIComponent(K));l(!0),Ee(V),t({})}catch{}},[e,t,Ee]),m.useEffect(()=>{(async()=>{try{const te=await(await fetch("/api/tools/oauth/providers")).json();te.success&&te.providers&&d(te.providers.filter(me=>me.enabled))}catch{}})()},[]);const Ae=async()=>{if(h.length===0){B.error("No OAuth providers configured"),_("error","❌ No OAuth providers found in configuration","failed"),_("info","💡 Please configure at least one OAuth provider in your Better Auth config","failed");return}u(!0)},He=async K=>{u(!1),x(""),s("test-oauth"),l(!0),i([]),_("info",`🔍 Testing ${K} OAuth...`,"running");const V=new Date().toISOString();try{_("progress","📡 Contacting Better Auth...","running");const me=await(await fetch("/api/tools/oauth/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:K})})).json();if(me.success&&me.startUrl){P.current.delete(me.testSessionId),de(me.testSessionId,"progress","popup-open",`🌐 Opening ${me.provider} OAuth popup...`,"running");const L={testSessionId:me.testSessionId,provider:me.provider,providerId:K,startTime:V};R.current.delete(me.testSessionId),sessionStorage.setItem("oauth_test_session",JSON.stringify(L));const ie=600,ue=700,he=(window.screen.width-ie)/2,Be=(window.screen.height-ue)/2,_e=window.open(me.startUrl,"oauth-test",`width=${ie},height=${ue},left=${he},top=${Be},scrollbars=yes,resizable=yes`);if(!_e){_("error","❌ Failed to open OAuth window. Please allow popups for this site.","failed"),_("error","💡 Check your browser popup blocker settings","failed"),B.error("Failed to open OAuth window. Please allow popups."),s(null);return}W.current=_e;let Re=!1;const je=Pe=>{if(Pe.origin===window.location.origin){if(Pe.data&&Pe.data.type==="oauth_test_state"){if(Pe.data.status==="redirect")I.current.has(L.testSessionId)||Se(L.testSessionId,L.provider);else if(Pe.data.status==="error"){Re=!0;const X=sessionStorage.getItem("oauth_test_session");let Q=me.provider;if(X)try{Q=JSON.parse(X).provider||Q}catch{}Ee({success:!1,provider:Q,testSessionId:Pe.data.testSessionId,error:Pe.data.error||"Failed to start OAuth test"}),window.removeEventListener("message",je),clearInterval(Ve),clearTimeout(ke),ce()}return}if(Pe.data&&Pe.data.type==="oauth_test_result"){window.removeEventListener("message",je),clearInterval(Ve),clearTimeout(ke),Re=!0;const X=Pe.data.result;Ee(X),I.current.has(X.testSessionId)||Se(X.testSessionId,X.provider),ce()}}};window.addEventListener("message",je);const Ve=setInterval(()=>{_e.closed&&(clearInterval(Ve),clearTimeout(ke),window.removeEventListener("message",je),!sessionStorage.getItem(`oauth_test_result_${L.testSessionId}`)&&!Re&&(Re=!0,Se(L.testSessionId,L.provider)))},500),ke=setTimeout(()=>{_e.closed||(clearInterval(Ve),window.removeEventListener("message",je),ce(),Re||(Re=!0),_("error","❌ OAuth test timed out after 5 minutes","failed"),_("error","💡 Possible reasons:","failed"),_("error"," • Authentication took too long","failed"),_("error"," • Provider is not responding","failed"),_("error"," • Network connectivity issues","failed"),B.error("OAuth test timed out"),s(null))},5*60*1e3)}else _("error",`❌ Failed to initiate OAuth test: ${me.error||"Unknown error"}`,"failed"),me.details&&_("error",`💡 Details: ${JSON.stringify(me.details)}`,"failed"),me.cause&&_("error",`💡 Cause: ${me.cause}`,"failed"),B.error(me.error||"Failed to start OAuth test"),s(null)}catch(te){_("error",`❌ Network error: ${te}`,"failed"),B.error("Failed to start OAuth test"),s(null)}},J=()=>{v(!0)},oe=async(K,V)=>{const te=Cl.find(L=>L.id===K);if(!te){B.error("Unknown migration provider");return}if(te.disabled){B.info(`${te.name} migration is coming soon`);return}v(!1),s("run-migration"),l(!0),i([]);const me=L=>new Promise(ie=>setTimeout(ie,L));try{if(_("info",`🚀 Preparing ${te.name} migration...`,"running"),te.highlights)for(const ue of te.highlights)await me(350),_("progress",ue,"running");_("progress","📡 Sending migration payload to server...","running");const ie=await(await fetch("/api/tools/migrations/run",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:te.id,script:te.custom?V:te.script})})).json();if(ie.success)_("progress","🚀 Migration job acknowledged. Follow server logs for live progress.","running"),_("success",`✅ ${te.name} migration request accepted.`,"completed"),ie.message&&_("info",ie.message,"completed"),B.success(`${te.name} migration flow completed`);else throw new Error(ie.error||"Migration request failed")}catch(L){_("error",`❌ Migration failed: ${L}`,"failed"),B.error("Migration failed")}finally{s(null)}},be=async()=>{s("validate-config"),l(!0),i([]),_("info","Validating Better Auth configuration...","running");try{await new Promise(K=>setTimeout(K,500)),_("progress","Checking database connection...","running"),await new Promise(K=>setTimeout(K,500)),_("progress","Validating plugins configuration...","running"),await new Promise(K=>setTimeout(K,500)),_("success","✅ Configuration is valid!","completed"),B.success("Configuration validated successfully")}catch(K){_("error",`❌ Configuration validation failed: ${K}`,"failed"),B.error("Configuration validation failed")}finally{s(null)}},Oe=async()=>{s("test-db"),l(!0),i([]),_("info","Testing database connection...","running");try{const V=await(await fetch("/api/database/test")).json();await new Promise(te=>setTimeout(te,1e3)),_("progress","Checking on database con!","running"),V.success?(_("success","✅ Database connection successful!","completed"),V.result&&Array.isArray(V.result)&&V.result.length>0&&(_("info","📄 Sample user record (first row):","completed"),_("info",JSON.stringify(V.result[0],null,2),"completed")),B.success("Database connection test successful")):(_("error",`❌ Database connection failed: ${V.error||"Unknown error"}`,"failed"),B.error("Database connection test failed"))}catch(K){_("error",`❌ Network error: ${K}`,"failed"),B.error("Failed to test database connection")}finally{s(null)}},we=async()=>{s("generate-api-key"),l(!0),i([]),_("info","Generating new API key...","running");try{const V=await(await fetch("/api/tools/generate-api-key",{method:"POST",headers:{"Content-Type":"application/json"}})).json();V.success&&V.apiKey?(_("success","✅ API key generated successfully!","completed"),_("info",`API Key: ${V.apiKey}`,"completed"),B.success("API key generated successfully")):(_("error",`❌ Failed to generate API key: ${V.error||"Unknown error"}`,"failed"),B.error("Failed to generate API key"))}catch(K){_("error",`❌ Network error: ${K}`,"failed"),B.error("Failed to generate API key")}finally{s(null)}},Ce=async()=>{s("health-check"),l(!0),i([]),_("info","Running Better Auth health check...","running");try{_("progress","Testing Better Auth endpoints...","running");const K=await fetch("/api/tools/health-check",{method:"POST"}),V=await K.json();if(!K.ok)throw new Error(V.error||V.message||"Health check failed");V.success?(_("success","✅ Better Auth health check passed","completed"),B.success("Health check passed")):(_("error","❌ Better Auth health check failed","failed"),V.failedEndpoints&&V.failedEndpoints.length>0&&V.failedEndpoints.forEach(te=>{const me=te.status?` (Status: ${te.status})`:"",L=te.error?` - ${te.error}`:"";_("error",` • Endpoint ${te.endpoint}${me}${L}`,"failed")}),B.error("Health check failed"))}catch(K){_("error",`❌ Health check failed: ${K instanceof Error?K.message:K}`,"failed"),B.error("Health check failed")}finally{s(null)}},st=new Set(["test-oauth","test-db","hash-password","health-check"]),yt=[{id:"test-oauth",name:"Test OAuth",description:"Test OAuth provider connections",icon:sn,action:Ae,category:"oauth"},{id:"hash-password",name:"Hash Password",description:"Generate SHA hashes",icon:co,action:Z,category:"utilities"},{id:"run-migration",name:"Run Migration",description:"Run database migrations",icon:fa,action:J,category:"database"},{id:"test-db",name:"Test Database",description:"Test database connection",icon:fa,action:Oe,category:"database"},{id:"validate-config",name:"Validate Config",description:"Validate Better Auth configuration",icon:E0,action:be,category:"utilities"},{id:"generate-api-key",name:"Generate API Key",description:"Generate a new API key",icon:co,action:we,category:"utilities"},{id:"health-check",name:"Health Check",description:"Run system health check",icon:wy,action:Ce,category:"testing"}],Lt=[{id:"oauth",name:"OAuth",icon:sn},{id:"database",name:"Database",icon:fa},{id:"testing",name:"Testing",icon:wy},{id:"utilities",name:"Utilities",icon:WC}].map(K=>({...K,tools:yt.filter(V=>V.category===K.id)}));return a.jsxs("div",{className:"space-y-8 bg-black w-full min-h-screen",children:[a.jsxs("div",{className:"w-full flex flex-col",children:[a.jsx("div",{className:"flex items-center justify-between p-5 pt-7",children:a.jsxs("div",{className:"pb-8",children:[a.jsx("h1",{className:"text-3xl font-normal text-white tracking-tight",children:"Tools"}),a.jsx("p",{className:"text-gray-300 mt-2 uppercase font-mono font-light text-xs",children:"Utility tools for managing and testing your Better Auth setup"})]})}),a.jsxs("div",{className:"flex flex-col items-center space-y-8",children:[a.jsx("hr",{className:"w-full border-white/15 h-px"}),a.jsx("hr",{className:"w-full border-white/15 h-px"})]}),o&&r.length>0&&a.jsxs("div",{className:"mb-6 p-6 gap-8",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("h3",{className:"text-sm uppercase font-mono text-gray-400 tracking-wider",children:"Tool Output"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>l(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Jt,{className:"w-4 h-4"})})]}),a.jsx(fi,{title:"Tool Execution Logs",lines:r,isRunning:n!==null,className:"w-full",defaultCollapsed:!1})]}),a.jsx("div",{className:"space-y-8 p-6 gap-8",children:Lt.map(K=>a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(K.icon,{className:"w-5 h-5 text-white"}),a.jsx("h2",{className:"text-lg font-light text-white uppercase tracking-wider",children:K.name})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:K.tools.map(V=>{const te=V.icon,me=n===V.id,L=st.has(V.id),ie=!L||n!==null&&n!==V.id||me;return a.jsxs("button",{onClick:()=>V.action(),disabled:ie,className:`relative flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none transition-colors text-left group ${L?"hover:bg-black/50 disabled:opacity-50 disabled:cursor-not-allowed":"opacity-60 cursor-not-allowed"}`,children:[a.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:me?a.jsx(tr,{className:"w-6 h-6 text-white animate-spin"}):a.jsx(te,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-white font-light mb-1",children:V.name}),a.jsxs("p",{className:"text-xs uppercase font-mono flex items-center text-gray-400",children:[a.jsx(SB,{className:"w-4 h-4 mr-2"}),V.description]})]}),!L&&a.jsx("span",{className:"absolute top-2 right-3 text-[10px] font-mono uppercase tracking-[0.2em] text-white/60",children:"Coming Soon"}),a.jsx(Fa,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]},V.id)})})]},K.id))})]}),w&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-2xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(co,{className:"w-5 h-5 text-white"}),a.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Password Hasher"})]}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>N(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Jt,{className:"w-5 h-5"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(Xe,{className:"text-xs uppercase font-mono text-gray-400",children:"Algorithm"}),a.jsxs("select",{value:H,onChange:K=>U(K.target.value),className:"mt-2 w-full bg-black border border-dashed border-white/20 text-white px-3 py-2 text-sm focus:outline-none",children:[a.jsx("option",{value:"SHA-256",children:"SHA-256"}),a.jsx("option",{value:"SHA-384",children:"SHA-384"}),a.jsx("option",{value:"SHA-512",children:"SHA-512"})]})]}),a.jsxs("div",{children:[a.jsx(Xe,{className:"text-xs uppercase font-mono text-gray-400",children:"Encoding"}),a.jsxs("select",{value:z,onChange:K=>Y(K.target.value),className:"mt-2 w-full bg-black border border-dashed border-white/20 text-white px-3 py-2 text-sm focus:outline-none",children:[a.jsx("option",{value:"hex",children:"Hex"}),a.jsx("option",{value:"base64",children:"Base64"}),a.jsx("option",{value:"base64url",children:"Base64 URL"})]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(Xe,{className:"text-xs uppercase font-mono text-gray-400",children:"Salt (optional)"}),a.jsx(Fe,{value:T,onChange:K=>O(K.target.value),placeholder:"e.g. project-specific-salt",className:"mt-2 bg-black border border-dashed border-white/20 text-white rounded-none"}),a.jsxs("p",{className:"text-[11px] text-gray-500 mt-1 font-mono",children:["Salt is prepended (",a.jsx("span",{className:"text-white/80",children:"salt:password"}),")"]})]}),a.jsxs("div",{children:[a.jsx(Xe,{className:"text-xs uppercase font-mono text-gray-400",children:"Password"}),a.jsxs("div",{className:"relative mt-2",children:[a.jsx(Fe,{type:E?"text":"password",value:S,onChange:K=>C(K.target.value),placeholder:"Enter password",className:"bg-black border border-dashed border-white/20 text-white rounded-none pr-10"}),a.jsx("button",{type:"button",onClick:()=>D(K=>!K),className:"absolute inset-y-0 right-0 px-3 flex items-center text-gray-400 hover:text-white","aria-label":E?"Hide password":"Show password",children:E?a.jsx(_S,{className:"w-4 h-4"}):a.jsx(Xo,{className:"w-4 h-4"})})]})]})]}),k&&a.jsxs("div",{children:[a.jsx(Xe,{className:"text-xs uppercase font-mono text-gray-400",children:"Hash Result"}),a.jsxs("div",{className:"mt-2 flex items-center space-x-2",children:[a.jsx(Fe,{value:k,readOnly:!0,className:"flex-1 bg-black border border-dashed border-white/20 text-white rounded-none"}),a.jsx(F,{variant:"outline",size:"icon",onClick:()=>k&&xe(k),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:a.jsx(yu,{className:"w-4 h-4"})})]})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-8 border-t border-dashed border-white/10 pt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>N(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"}),a.jsx(F,{onClick:se,disabled:M,className:"rounded-none",children:M?a.jsxs(a.Fragment,{children:[a.jsx(tr,{className:"w-4 h-4 mr-2 animate-spin"}),"Hashing..."]}):"Hash Password"})]})]})}),c&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-8 w-full max-w-2xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(sn,{className:"w-6 h-6 text-white"}),a.jsx("h3",{className:"text-xl text-white font-light",children:"Select OAuth Provider"})]}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>{u(!1),x("")},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Jt,{className:"w-5 h-5"})})]}),a.jsx("div",{className:"space-y-4",children:h.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(sn,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),a.jsx("p",{className:"text-gray-400 mb-2 text-lg",children:"No OAuth providers configured"}),a.jsx("p",{className:"text-sm text-gray-500",children:"Please configure OAuth providers in your Better Auth configuration"})]}):a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-medium text-gray-400 mb-4 uppercase font-mono",children:["Available Providers (",h.length,")"]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 max-h-96 overflow-y-auto",children:h.map(K=>a.jsxs("button",{onClick:()=>{x(K.id),setTimeout(()=>{He(K.id)},100)},className:`w-full flex items-center space-x-4 p-4 border rounded-none transition-all text-left group ${f===K.id?"border-white/50 bg-white/10":"border-dashed border-white/20 hover:bg-white/5 hover:border-white/30"}`,children:[a.jsx("div",{className:"flex-shrink-0",children:ae(K.id)}),a.jsx("div",{className:"flex-1 min-w-0",children:a.jsx("p",{className:"text-white uppercase font-mono font-light text-base",children:K.name||K.id})}),a.jsx(Fa,{className:`w-5 h-5 transition-colors flex-shrink-0 ${f===K.id?"text-white":"text-gray-400 group-hover:text-white"}`})]},K.id))}),a.jsx("p",{className:"text-xs text-gray-500 mt-4 font-mono uppercase",children:"Click on a provider to start the OAuth test"})]})}),a.jsx("div",{className:"flex justify-end space-x-3 mt-8 pt-6 border-t border-dashed border-white/10",children:a.jsx(F,{variant:"outline",onClick:()=>{u(!1),x("")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"})})]})}),y&&a.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/95 border border-dashed border-white/20 p-8 w-full max-w-5xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(fa,{className:"w-6 h-6 text-white"}),a.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Select Migration"})]}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>v(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Jt,{className:"w-5 h-5"})})]}),a.jsxs("div",{className:"grid md:grid-cols-3 gap-4",children:[a.jsx("div",{className:"space-y-3",children:Cl.map(K=>{const V=(ee==null?void 0:ee.id)===K.id;return a.jsxs("button",{onClick:()=>ne(K.id),disabled:K.disabled,className:`w-full flex items-center space-x-3 p-4 border transition-colors rounded-none text-left ${K.disabled?"border-dashed border-white/10 bg-black/30 cursor-not-allowed opacity-60":V?"border-white/60 bg-white/10":"border-dashed border-white/20 hover:bg-white/5 hover:border-white/40"}`,children:[a.jsx("div",{className:"flex-shrink-0 w-10 h-10 bg-white/10 flex items-center justify-center",children:K.logo?K.logo:a.jsx(vy,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-white uppercase font-mono text-sm",children:K.name}),a.jsx("p",{className:"text-xs uppercase text-gray-400 font-mono mt-1 truncate",children:K.description})]}),K.disabled&&a.jsx("span",{className:"text-[10px] font-mono text-gray-400 uppercase",children:"Coming Soon"})]},K.id)})}),a.jsxs("div",{className:"md:col-span-2 space-y-4",children:[a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx("div",{className:"w-12 h-12 bg-white/10 flex items-center justify-center",children:ee.logo?ee.logo:a.jsx(vy,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("h4",{className:"text-white -mb-2 text-lg font-light uppercase tracking-wider",children:ee.name}),a.jsx("p",{className:"text-sm mt-0 text-gray-400 uppercase font-mono leading-relaxed",children:ee.description}),a.jsx("div",{className:"flex items-center space-x-2",children:ee.docs&&a.jsx(F,{variant:"ghost",size:"sm",asChild:!0,className:"rounded-none border border-dashed",children:a.jsx("a",{href:ee.docs,target:"_blank",rel:"noreferrer",children:"View Docs"})})})]})]}),ee.highlights&&a.jsx("ul",{className:"space-y-2 text-xs text-gray-300 font-mono bg-black/40 border border-white/10 p-4",children:ee.highlights.map(K=>a.jsxs("li",{className:"flex items-start space-x-2",children:[a.jsx("span",{className:"text-white/60 mt-0.5",children:"•"}),a.jsx("span",{children:K})]},K))}),ee.disabled?a.jsxs("div",{className:"space-y-4 text-gray-400 font-mono text-xs",children:[a.jsx("p",{children:"This migration provider is coming soon."}),a.jsxs("p",{children:["Subscribe to updates at"," ",a.jsx("a",{href:"https://better-auth.com",target:"_blank",rel:"noreferrer",className:"text-white underline",children:"better-auth.com"}),"."]})]}):ee.custom?a.jsxs("div",{className:"space-y-3",children:[a.jsx("label",{className:"text-xs uppercase font-mono text-gray-400",children:"Custom Migration Script"}),a.jsx("textarea",{value:b,onChange:K=>p(K.target.value),className:"w-full h-64 bg-black/70 border border-white/10 text-xs text-gray-200 font-mono p-3 rounded-none focus:outline-none focus:ring-0"}),a.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[a.jsx(F,{variant:"outline",size:"sm",className:"rounded-none",onClick:()=>p(Km),children:"Reset"}),a.jsxs(F,{variant:"ghost",size:"sm",className:"rounded-none text-gray-400 hover:text-white",onClick:()=>xe(b),children:[a.jsx(yu,{className:"w-4 h-4"}),"Copy Script"]}),a.jsx(F,{className:"rounded-none",onClick:()=>oe("custom",b),children:"Run Custom Script"})]})]}):a.jsxs("div",{className:"space-y-3",children:[ee.script&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center justify-between text-xs uppercase font-mono text-gray-400",children:[a.jsx("span",{children:"Migration Script Preview"}),a.jsxs(F,{variant:"ghost",size:"sm",className:"rounded-none text-gray-400 hover:text-white",onClick:()=>xe(ee.script),children:[a.jsx(yu,{className:"w-4 h-4"}),"Copy Script"]})]}),a.jsx("pre",{className:"bg-black/70 border border-white/10 text-[11px] text-green-200 font-mono p-4 overflow-auto leading-relaxed h-64",children:a.jsx("code",{children:ee.script})})]}),a.jsx("div",{className:"flex items-center justify-end space-x-2",children:a.jsxs(F,{className:"rounded-none",onClick:()=>oe(ee.id),children:["Run ",ee.name," Migration"]})})]})]})]})]})})]})}function hV(){const{userId:e}=zp(),t=ws(),[n,s]=m.useState(null),[r,i]=m.useState([]),[o,l]=m.useState([]),[c,u]=m.useState([]),[h,d]=m.useState([]),[f,x]=m.useState(!0),[y,v]=m.useState("details"),[j,g]=m.useState(!1),[b,p]=m.useState(!1),[w,N]=m.useState(!1),[S,C]=m.useState(!1),[T,O]=m.useState(""),[H,U]=m.useState(),[z,Y]=m.useState(!1),[k,$]=m.useState([]),[M,A]=m.useState(!1),[E,D]=m.useState({}),_=m.useRef({}),I=m.useCallback(async()=>{try{const oe=await(await fetch("/api/admin/status")).json();Y(oe.enabled)}catch{Y(!1)}},[]),R=m.useCallback(async J=>{try{const oe=await fetch("/api/geo/resolve",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ipAddress:J})});if(oe.ok){const be=await oe.json();if(be.success&&be.location)return be.location}return null}catch{return null}},[]),P=m.useCallback(async J=>{const oe=J.filter(we=>!_.current[we.id]);if(oe.length===0)return;const be=await Promise.all(oe.map(async we=>{const Ce=await R(we.ipAddress);return Ce?{sessionId:we.id,location:Ce}:null})),Oe={};be.forEach(we=>{we&&(Oe[we.sessionId]=we.location)}),Object.keys(Oe).length>0&&(_.current={..._.current,...Oe},D(_.current))},[R]),W=J=>{if(!J)return"🌍";const oe=J.toUpperCase().split("").map(be=>127397+be.charCodeAt(0));return String.fromCodePoint(...oe)},q=J=>J?J.replace(/[_-]/g," ").replace(/\b\w/g,oe=>oe.toUpperCase()):"Unknown Provider",ee=J=>{if(!J)return"Unknown";const oe=new Date(J);return Number.isNaN(oe.getTime())?"Unknown":oe.toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})},ne=m.useCallback(async()=>{try{const J=await fetch(`/api/users/${e}`);if(J.ok){const oe=await J.json();s(oe.user)}else B.error("Failed to fetch user details"),t("/users")}catch{B.error("Failed to fetch user details"),t("/users")}finally{x(!1)}},[e,t]),Z=m.useCallback(async()=>{try{const[J,oe,be]=await Promise.all([fetch(`/api/users/${e}/organizations`),fetch(`/api/users/${e}/teams`),fetch(`/api/users/${e}/sessions`)]);if(J.ok){const Oe=await J.json();i(Oe.memberships||[])}if(oe.ok){const Oe=await oe.json();l(Oe.memberships||[])}if(be.ok){const we=(await be.json()).sessions||[];u(we),P(we)}}catch{}},[e,P]),se=m.useCallback(async()=>{try{const J=await fetch(`/api/users/${e}/accounts`);if(J.ok){const oe=await J.json();d(oe.accounts||[])}}catch{}},[e]),xe=async()=>{var Oe,we;if(!n)return;const J=(Oe=document.getElementById("edit-name"))==null?void 0:Oe.value,oe=(we=document.getElementById("edit-email"))==null?void 0:we.value;if(!J||!oe){B.error("Please fill in all fields");return}const be=B.loading("Updating user...");try{const st=await(await fetch(`/api/users/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:J,email:oe})})).json();st.success?(s({...n,name:J,email:oe}),g(!1),B.success("User updated successfully!",{id:be})):B.error(`Error updating user: ${st.error||"Unknown error"}`,{id:be})}catch{B.error("Error updating user",{id:be})}},ae=async()=>{if(!n)return;if(!z){B.error("Admin plugin is not enabled. Please enable the admin plugin in your Better Auth configuration to use ban functionality.");return}const J=B.loading("Banning user...");try{const oe=await fetch("/api/admin/ban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e,banReason:T||"No reason provided",banExpiresIn:H})}),be=await oe.json();oe.ok?(B.success("User banned successfully!",{id:J}),p(!1),O(""),U(void 0),ne()):oe.status===403?B.error("You do not have permission to ban users. Admin role required.",{id:J}):be.adminPluginEnabled&&be.instructions?B.error(`${be.error}`,{id:J,duration:6e3,description:`Use: ${be.instructions.example}`}):B.error(`Error banning user: ${be.error||be.message||"Unknown error"}`,{id:J})}catch{B.error("Error banning user",{id:J})}},ce=async()=>{if(!n)return;if(!z){B.error("Admin plugin is not enabled. Please enable the admin plugin in your Better Auth configuration to use unban functionality.");return}const J=B.loading("Unbanning user...");try{const oe=await fetch("/api/admin/unban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e})}),be=await oe.json();oe.ok?(B.success("User unbanned successfully!",{id:J}),N(!1),ne()):oe.status===403?B.error("You do not have permission to unban users. Admin role required.",{id:J}):be.adminPluginEnabled&&be.instructions?B.error(`${be.error}`,{id:J,duration:6e3,description:`Use: ${be.instructions.example}`}):B.error(`Error unbanning user: ${be.error||be.message||"Unknown error"}`,{id:J})}catch{B.error("Error unbanning user",{id:J})}},de=async J=>{const oe=B.loading("Removing user from organization...");try{const Oe=await(await fetch(`/api/organizations/members/${J}`,{method:"DELETE"})).json();Oe.success?(i(we=>we.filter(Ce=>Ce.id!==J)),B.success("User removed from organization!",{id:oe})):B.error(`Error removing user: ${Oe.error||"Unknown error"}`,{id:oe})}catch{B.error("Error removing user from organization",{id:oe})}},Se=async J=>{const oe=B.loading("Removing user from team...");try{const Oe=await(await fetch(`/api/teams/members/${J}`,{method:"DELETE"})).json();Oe.success?(l(we=>we.filter(Ce=>Ce.id!==J)),B.success("User removed from team!",{id:oe})):B.error(`Error removing user: ${Oe.error||"Unknown error"}`,{id:oe})}catch{B.error("Error removing user from team",{id:oe})}},Ee=async J=>{const oe=B.loading("Deleting session...");try{const Oe=await(await fetch(`/api/sessions/${J}`,{method:"DELETE"})).json();Oe.success?(u(we=>we.filter(Ce=>Ce.id!==J)),B.success("Session deleted successfully!",{id:oe})):B.error(`Error deleting session: ${Oe.error||"Unknown error"}`,{id:oe})}catch{B.error("Error deleting session",{id:oe})}},Ae=async J=>{if(!e)return;const oe=B.loading("Unlinking account...");try{const be=await fetch(`/api/users/${e}/accounts/${J}`,{method:"DELETE"});if(be.ok)d(Oe=>Oe.filter(we=>we.id!==J)),B.success("Account unlinked successfully",{id:oe});else{const Oe=await be.json();B.error(Oe.error||"Failed to unlink account",{id:oe})}}catch{B.error("Failed to unlink account",{id:oe})}};m.useEffect(()=>{e&&(ne(),Z(),se(),I())},[e,I,ne,Z,se]);const He=async(J=3)=>{if(e){$([]),A(!0),$([{id:"start",type:"info",message:`Starting session seeding process for ${J} sessions...`,timestamp:new Date}]);try{const be=await(await fetch(`/api/users/${e}/seed-sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:J})})).json();if(be.success){const Oe=be.results.map((Ce,st)=>Ce.success?{id:`session-${st}`,type:"progress",message:`Creating session ${st+1}: ${Ce.session.token.substring(0,20)}... from ${Ce.session.ipAddress}`,timestamp:new Date,status:"completed"}:{id:`session-${st}`,type:"error",message:`Failed to create session ${st+1}: ${Ce.error}`,timestamp:new Date});$(Ce=>[...Ce,...Oe]);const we=be.results.filter(Ce=>Ce.success).length;$(Ce=>[...Ce,{id:"complete",type:"success",message:`✅ Session seeding completed! Created ${we}/${J} sessions successfully`,timestamp:new Date}]),Z()}else $(Oe=>[...Oe,{id:"error",type:"error",message:`❌ Session seeding failed: ${be.error||"Unknown error"}`,timestamp:new Date}])}catch(oe){$(be=>[...be,{id:"error",type:"error",message:`❌ Network error: ${oe}`,timestamp:new Date}])}finally{A(!1)}}};return f?a.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center",children:a.jsx("div",{className:"text-white text-lg",children:"Loading user details..."})}):n?a.jsxs("div",{className:"space-y-6 p-6 bg-black w-full",children:[a.jsxs("div",{className:"w-full flex flex-col",children:[a.jsx("span",{className:"mb-4 ml-0 flex justify-start items-start text-left border-none text-white",children:a.jsxs("span",{className:"font-light",children:[a.jsxs("span",{onClick:()=>t("/users"),className:"uppercase cursor-pointer text-white/80 font-mono text-sm",children:["users /"," "]}),a.jsx("span",{className:"text-white font-mono text-sm",children:n.id})]})}),a.jsx("div",{className:"mb-8 mt-4",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsx("div",{className:"w-16 h-16 bg-gray-800 border border-dashed border-white/20 flex items-center justify-center",children:n.image?a.jsx("img",{src:n.image,alt:n.name,className:"w-16 h-16 object-cover"}):a.jsx(Xd,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsxs("h1",{className:"text-3xl font-light text-white inline-flex items-center",children:[n.name,a.jsx(Rn,{id:n.id,variant:"subscript"}),n.banned&&a.jsx("sup",{className:"ml-2 px-2 pt-2 pb-2 -mt-1 py-0.5 text-[10px] font-mono uppercase border border-dashed border-red-500/30 bg-red-500/10 text-red-400/80 rounded-none",children:"Banned"})]}),a.jsx("p",{className:"text-gray-400 font-mono text-sm",children:n.email}),a.jsx("div",{className:"flex items-center space-x-2 mt-2",children:n.role&&a.jsxs("div",{className:"flex items-center space-x-1 px-2 py-1 rounded-sm text-xs font-mono bg-purple-500/20 text-purple-400",children:[a.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-purple-500"}),a.jsx("span",{children:n.role})]})})]})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsxs(F,{variant:"outline",onClick:()=>g(!0),className:"border border-white/20 text-white hover:bg-white/10 rounded-none",children:[a.jsx(ii,{className:"w-4 h-4 mr-2"}),"Edit User"]}),n.banned?a.jsxs(F,{variant:"outline",onClick:()=>N(!0),className:"border border-green-400/20 text-green-400 hover:bg-green-400/10 rounded-none",disabled:!z,children:[a.jsx(Zm,{className:"w-4 h-4 mr-2"}),"Unban User"]}):a.jsxs(F,{variant:"outline",onClick:()=>p(!0),className:"border border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",disabled:!z,children:[a.jsx(Zm,{className:"w-4 h-4 mr-2"}),"Ban User"]})]})]})}),a.jsxs("div",{className:"border border-dashed border-white/20 rounded-none",children:[a.jsx("div",{className:"border-b border-dashed border-white/10",children:a.jsx("nav",{className:"flex space-x-8 px-6",children:[{id:"details",name:"Details",icon:Xd},{id:"organizations",name:"Organizations",icon:An,count:r.length},{id:"teams",name:"Teams",icon:ft,count:o.length},{id:"accounts",name:"Accounts",icon:Cm,count:h.length},{id:"sessions",name:"Sessions",icon:mg,count:c.length}].map(J=>a.jsxs("button",{onClick:()=>v(J.id),className:`flex items-center space-x-2 py-4 px-2 border-b-2 font-medium text-sm ${y===J.id?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-white/50"}`,children:[a.jsx(J.icon,{className:"w-4 h-4 text-white/90"}),a.jsxs("span",{className:"inline-flex items-start",children:[a.jsx("span",{className:"",children:J.name}),J.count!==void 0&&a.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:a.jsx(xs,{value:J.count,className:"text-white/80 font-mono text-xs",prefix:a.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]},J.id))})}),a.jsxs("div",{className:"p-6",children:[y==="details"&&a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"overflow-x-hidden bg-white/[3%] border border-white/10 p-6 rounded-none",children:[a.jsx("h3",{className:"text-sm uppercase font-mono text-gray-400 mb-4 tracking-wider",children:"BASIC INFORMATION"}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed my-4"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(Xd,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Username"}),a.jsx("div",{className:"text-white font-sans text-sm",children:n.name.toLowerCase().replace(/\s+/g,"")})]})]}),a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(sa,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Email"}),a.jsx("div",{className:"text-white font-mono text-sm",children:n.email})]})]}),n.username&&a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(DB,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Username"}),a.jsx("div",{className:"text-white font-mono text-sm",children:n.username})]})]}),n.phoneNumber&&a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(TB,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Phone"}),a.jsx("div",{className:"text-white font-mono text-sm",children:"+251 91 234 5678"})]})]}),a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(ls,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Member Since"}),a.jsx("div",{className:"text-white font-mono text-sm",children:new Date(n.createdAt).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"})})]})]})]})]}),a.jsxs("div",{className:"overflow-x-hidden bg-white/[3%] border border-white/10 p-6 rounded-none",children:[a.jsx("h3",{className:"text-sm uppercase font-mono text-gray-400 mb-4 tracking-wider",children:"SECURITY"}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed my-4"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 bg-black/30 border border-white/5 rounded-none",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(sa,{className:"w-4 h-4 text-gray-400"}),a.jsx("div",{children:a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500",children:"Email Verification"})})]}),a.jsx("div",{className:`px-2 rounded-none py-1 text-xs font-mono ${n.emailVerified?"bg-green-500/20 text-green-400":"bg-red-500/20 text-red-400"}`,children:n.emailVerified?"Verified":"Unverified"})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 bg-black/30 border border-white/5 rounded-none",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(fa,{className:"w-4 h-4 text-gray-400"}),a.jsx("div",{children:a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500",children:"Two-Factor Authentication"})})]}),a.jsx("div",{className:`px-2 rounded-none py-1 text-xs font-mono ${n.twoFactorEnabled?"bg-green-500/20 text-green-400":"bg-red-500/20 text-red-400"}`,children:n.twoFactorEnabled?"Enabled":"Disabled"})]})]})]})]}),y==="organizations"&&a.jsx("div",{className:"space-y-4",children:r.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(An,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Organizations"}),a.jsx("p",{className:"text-gray-400",children:"This user is not a member of any organizations."})]}):a.jsx("div",{className:"grid gap-4",children:r.map(J=>a.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[a.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:J.organization.image?a.jsx("img",{src:J.organization.image,alt:J.organization.name,className:"w-12 h-12 object-cover"}):a.jsx(An,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:[J.organization.name,a.jsxs("sup",{className:"text-xs text-gray-500 ml-2 mt-0.5",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-xs",children:J.organization.slug}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsxs("p",{className:"text-gray-400 text-sm font-sans mt-1",children:["in ",J.organization.slug]})]})]}),a.jsx("div",{className:"flex flex-col items-end space-y-2",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Joined:"," "]}),a.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(J.joinedAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(J.joinedAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]})})]}),a.jsx("div",{className:"flex items-center justify-end",children:a.jsxs(F,{variant:"outline",size:"sm",onClick:()=>de(J.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[a.jsx(Gm,{className:"w-4 h-4 mr-1"}),"Remove"]})})]},J.id))})}),y==="teams"&&a.jsx("div",{className:"space-y-4",children:o.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(ft,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Teams"}),a.jsx("p",{className:"text-gray-400",children:"This user is not a member of any teams."})]}):a.jsx("div",{className:"grid gap-4",children:o.map(J=>a.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[a.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:a.jsx(ft,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:[J.team.name,a.jsxs("sup",{className:"text-xs text-gray-500 ml-2 mt-0.5",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-xs",children:J.team.organizationSlug||J.team.organizationName}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsxs("p",{className:"text-gray-400 text-sm font-sans mt-1",children:["in"," ",J.team.organizationSlug||J.team.organizationName]})]})]}),a.jsx("div",{className:"flex flex-col items-end space-y-2",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Joined:"," "]}),a.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(J.joinedAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(J.joinedAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]})})]}),a.jsx("div",{className:"flex items-center justify-end",children:a.jsxs(F,{variant:"outline",size:"sm",onClick:()=>Se(J.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[a.jsx(Gm,{className:"w-4 h-4 mr-1"}),"Remove"]})})]},J.id))})}),y==="accounts"&&a.jsx("div",{className:"space-y-4",children:h.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(Cm,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Linked Accounts"}),a.jsx("p",{className:"text-gray-400",children:"This user has not connected any accounts yet."})]}):a.jsx("div",{className:"grid gap-4",children:h.map(J=>a.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[a.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:a.jsx(Cm,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:[q(J.providerId),a.jsxs("sup",{className:"text-xs text-gray-500 ml-2 mt-0.5",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-xs",children:J.providerId}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 text-sm font-sans mt-1",children:J.email||`Account ID: ${J.id}`})]})]}),a.jsx("div",{className:"flex flex-col items-end space-y-2 text-right",children:a.jsxs("div",{className:"flex items-center space-x-2 text-xs font-mono text-gray-400",children:[a.jsx("span",{children:"Linked:"}),a.jsx("span",{className:"text-white",children:ee(J.createdAt||J.updatedAt)})]})})]}),a.jsx("div",{className:"flex items-center justify-end",children:a.jsxs(F,{variant:"outline",size:"sm",onClick:()=>Ae(J.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[a.jsx(Gm,{className:"w-4 h-4 mr-1"}),"Unlink"]})})]},J.id))})}),y==="sessions"&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-medium text-white",children:"Sessions"}),a.jsx("p",{className:"text-gray-400 text-sm",children:"Manage user authentication sessions"})]}),a.jsxs(F,{variant:"outline",onClick:()=>{$([]),A(!1),C(!0)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:[a.jsx(fa,{className:"w-4 h-4 mr-2"}),"Seed Sessions"]})]}),c.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(mg,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Sessions"}),a.jsx("p",{className:"text-gray-400",children:"This user has no active sessions."})]}):a.jsx("div",{className:"grid gap-4",children:c.map(J=>{var oe,be,Oe,we;return a.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[a.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:a.jsx(gw,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:["Session ",J.id.substring(0,8),"...",a.jsxs("sup",{className:"text-xs text-gray-500 ml-2 mt-0.5",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-xs",children:J.ipAddress}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsxs("div",{className:"flex items-center space-x-2 mt-2",children:[a.jsx(MB,{className:"w-3.5 h-3.5 text-gray-400"}),a.jsxs("span",{className:"text-gray-400 uppercase font-mono text-xs",children:[((oe=E[J.id])==null?void 0:oe.city)||"...",","," ",((be=E[J.id])==null?void 0:be.country)||"..."]}),((Oe=E[J.id])==null?void 0:Oe.countryCode)&&a.jsx("span",{className:"text-xs ml-1",children:W((we=E[J.id])==null?void 0:we.countryCode)})]})]})]}),a.jsx("div",{className:"flex flex-col items-end space-y-2",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Expires:"," "]}),a.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(J.expiresAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(J.expiresAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]})})]}),a.jsx("div",{className:"flex items-center justify-end",children:a.jsxs(F,{variant:"outline",size:"sm",onClick:()=>Ee(J.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[a.jsx(Zm,{className:"w-4 h-4 mr-1"}),"Revoke"]})})]},J.id)})})]})]})]})]}),j&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 rounded-none p-6 w-full max-w-md",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Edit User"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>g(!1),className:"text-gray-400 hover:text-white rounded-none",children:"×"})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 bg-black/80 border border-dashed border-white/20 flex items-center justify-center",children:n!=null&&n.image?a.jsx("img",{src:n.image,alt:n.name,className:"w-16 h-16 object-cover"}):a.jsx(Xd,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-white font-medium",children:n==null?void 0:n.name}),a.jsx("p",{className:"text-gray-400 text-sm",children:n==null?void 0:n.email})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Name"}),a.jsx("input",{id:"edit-name",type:"text",defaultValue:(n==null?void 0:n.name)||"",className:"w-full px-3 py-2 bg-gray-800 border border-dashed border-white/20 rounded-none text-white placeholder-gray-400 focus:outline-none focus:border-white/50"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Email"}),a.jsx("input",{id:"edit-email",type:"email",defaultValue:(n==null?void 0:n.email)||"",className:"w-full px-3 py-2 bg-gray-800 border border-dashed border-white/20 rounded-none text-white placeholder-gray-400 focus:outline-none focus:border-white/50"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-2 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>g(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:xe,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),b&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-red-400/20 rounded-none p-6 w-full max-w-md",children:[a.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Ban User"}),a.jsxs("p",{className:"text-gray-400 mb-4",children:["Ban ",a.jsx("strong",{children:n.name})," from accessing the system."]}),a.jsxs("div",{className:"space-y-4 mb-6",children:[a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"banReason",className:"text-white",children:"Ban Reason"}),a.jsx(Fe,{id:"banReason",value:T,onChange:J=>O(J.target.value),placeholder:"Enter reason for ban (optional)",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"banExpires",className:"text-white",children:"Ban Duration (seconds)"}),a.jsx(Fe,{id:"banExpires",type:"number",value:H||"",onChange:J=>U(J.target.value?Number(J.target.value):void 0),placeholder:"Leave empty for permanent ban",className:"bg-black border border-dashed border-white/20 text-white rounded-none"}),a.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Examples: 3600 (1 hour), 86400 (1 day), 604800 (1 week)"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-2",children:[a.jsx(F,{variant:"outline",onClick:()=>{p(!1),O(""),U(void 0)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:ae,className:"bg-red-600 text-white hover:bg-red-700 rounded-none",children:"Ban User"})]})]})}),w&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-green-400/20 rounded-none p-6 w-full max-w-md",children:[a.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Unban User"}),a.jsxs("p",{className:"text-gray-400 mb-6",children:["Are you sure you want to unban ",a.jsx("strong",{children:n.name}),"? This will restore their access to the system."]}),a.jsxs("div",{className:"flex justify-end space-x-2",children:[a.jsx(F,{variant:"outline",onClick:()=>N(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:ce,className:"bg-green-400 text-white hover:bg-green-700 rounded-none",children:"Unban User"})]})]})}),S&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"overflow-x-hidden bg-black/90 border border-white/10 p-6 w-full pt-4 max-w-2xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("h3",{className:"text-sm text-white flex items-center justify-center font-light uppercase",children:[a.jsx("span",{className:"text-white/50 mr-2",children:"["}),a.jsx(gw,{className:"inline mr-2 w-3 h-3 text-white"}),a.jsx("span",{className:"font-mono text-white/70 uppercase",children:"Seed Sessions"}),a.jsx("span",{className:"text-white/50 ml-2",children:"]"})]}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>C(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Jt,{className:"w-4 h-4"})})]}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed -mt-4 mb-4"}),a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"space-y-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(Xe,{htmlFor:"session-count",className:"text-sm text-gray-400 font-light",children:"Number of sessions"}),a.jsx(Fe,{id:"session-count",type:"number",min:"1",max:"50",defaultValue:"3",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx(F,{onClick:()=>{var oe;const J=parseInt(((oe=document.getElementById("session-count"))==null?void 0:oe.value)||"3",10);He(J)},disabled:M,className:"bg-transparent hover:bg-white/90 bg-white text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:M?a.jsxs(a.Fragment,{children:[a.jsx(tr,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(fa,{className:"w-3 h-3 mr-2"}),"Seed Sessions"]})})]})}),k.length>0&&a.jsx("div",{className:"mt-6",children:a.jsx(fi,{title:"Session Seeding Terminal",lines:k,isRunning:M,className:"w-full",defaultCollapsed:!0})})]}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed mt-10"}),a.jsx("div",{className:"flex justify-end mt-6 pt-6",children:a.jsx(F,{variant:"outline",onClick:()=>C(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})})]}):a.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center",children:a.jsx("div",{className:"text-white text-lg",children:"User not found"})})}function fV(){return a.jsx(d9,{children:a.jsxs(J5,{children:[a.jsx(n$,{children:a.jsxs(I5,{children:[a.jsx(xn,{path:"/",element:a.jsx(KB,{})}),a.jsx(xn,{path:"/users",element:a.jsx(eE,{})}),a.jsx(xn,{path:"/users/:userId",element:a.jsx(hV,{})}),a.jsx(xn,{path:"/organizations",element:a.jsx(JC,{})}),a.jsx(xn,{path:"/organizations/:orgId",element:a.jsx(sV,{})}),a.jsx(xn,{path:"/teams",element:a.jsx(iV,{})}),a.jsx(xn,{path:"/teams/:teamId",element:a.jsx(Mw,{})}),a.jsx(xn,{path:"/organizations/:orgId/teams/:teamId",element:a.jsx(Mw,{})}),a.jsx(xn,{path:"/sessions",element:a.jsx(aV,{})}),a.jsx(xn,{path:"/database",element:a.jsx(tV,{})}),a.jsx(xn,{path:"/database/demo",element:a.jsx(c9,{})}),a.jsx(xn,{path:"/tools",element:a.jsx(uV,{})}),a.jsx(xn,{path:"/settings",element:a.jsx(rV,{})})]})}),a.jsx(DM,{className:"rounded-none border-dashed border-white/20",theme:"dark",position:"top-right",richColors:!0,toastOptions:{style:{border:"dashed 1px #ffffff20",borderRadius:"0"},className:"font-mono uppercase"},closeButton:!0})]})})}Jk.createRoot(document.getElementById("root")).render(a.jsx(G.StrictMode,{children:a.jsx(fV,{})}));
703
+ });`},{id:"supabase",name:"Supabase",description:"Supabase Migration guide",docs:"https://better-auth.com/docs/migrations/supabase",logo:"",highlights:["Exports Supabase auth.users and auth.identities.","Preserves password hashes and metadata fields.","Supports incremental re-runs with idempotent operations."],disabled:!0},{id:"auth0",name:"Auth0",description:"Auth0 Migration guide",docs:"https://better-auth.com/docs/migrations/auth0",logo:"",highlights:["Uses Auth0 Management API bulk exports.","Keeps password hashes compatible with Better Auth adapters.","Migrates applications and roles to Better Auth format."],disabled:!0},{id:"nextauth",name:"NextAuth.js",description:"NextAuth.js Migration guide",docs:"https://better-auth.com/docs/migrations/nextauth",logo:"",highlights:["Reads users/accounts from your existing NextAuth database.","Moves refresh tokens and OAuth profiles into Better Auth.","Supports Prisma, MySQL, and Postgres NextAuth adapters."],disabled:!0},{id:"custom",name:"Custom Script",description:"Custom Migration guide",docs:"https://better-auth.com/docs/migrations/custom",highlights:["Use Better Auth SDK helpers to insert users safely.","Supports dry-run mode to validate before committing.","Perfect for bespoke data sources or ETL pipelines."],custom:!0}];function hV(){const[e,t]=sM(),[n,s]=m.useState(null),[r,i]=m.useState([]),[o,l]=m.useState(!1),[c,u]=m.useState(!1),[h,d]=m.useState([]),[f,x]=m.useState(""),[y,v]=m.useState(!1),[j,g]=m.useState(""),[b,p]=m.useState(Km),[w,N]=m.useState(!1),[S,C]=m.useState(""),[T,O]=m.useState(""),[H,U]=m.useState("SHA-256"),[z,Y]=m.useState("hex"),[k,$]=m.useState(null),[M,A]=m.useState(!1),[E,D]=m.useState(!1),_=(K,V,te,me)=>{i(L=>[...L,{id:me??`log-${Date.now()}-${Math.random()}`,type:K,message:V,timestamp:new Date,status:te}])},I=m.useRef(new Set),R=m.useRef(new Set),P=m.useRef(new Map),W=m.useRef(null),q=()=>Cl.find(K=>!K.disabled)??Cl[0],ee=Cl.find(K=>K.id===j)??q();m.useEffect(()=>{g(y?K=>{var V;return K||((V=q())==null?void 0:V.id)||""}:"")},[y,q]);const ne=K=>{g(K),K!=="custom"&&p(Km)},Z=()=>{C(""),O(""),$(null),U("SHA-256"),Y("hex"),N(!0)},se=async()=>{if(!S.trim()){B.error("Enter a password to hash");return}try{A(!0);const K=T?`${T}:${S}`:S,te=await uV(H,z).digest(K);$(te),B.success("Password hashed successfully")}catch(K){B.error("Failed to hash password"),console.error(K)}finally{A(!1)}},xe=async K=>{try{await navigator.clipboard.writeText(K),B.success("Copied to clipboard")}catch{B.error("Failed to copy to clipboard")}},ae=K=>{switch(K.toLowerCase()){case"github":return a.jsx(aR,{className:"w-5 h-5 text-white"});case"google":return a.jsx(sn,{className:"w-5 h-5 text-white"});case"discord":return a.jsx(sn,{className:"w-5 h-5 text-white"});case"twitter":case"x":return a.jsx(sn,{className:"w-5 h-5 text-white"});case"facebook":return a.jsx(sn,{className:"w-5 h-5 text-white"});case"apple":return a.jsx(sn,{className:"w-5 h-5 text-white"});default:return a.jsx(sn,{className:"w-5 h-5 text-white"})}},ce=()=>{W.current&&!W.current.closed&&W.current.close(),W.current=null},de=(K,V,te,me,L)=>{let ie=P.current.get(K);ie||(ie=new Map,P.current.set(K,ie));const ue=ie.get(te);if(ue){i(Be=>Be.map(_e=>_e.id===ue?{..._e,type:V,message:me,status:L,timestamp:new Date}:_e));return}const he=`session-${K}-${te}-${Date.now()}`;ie.set(te,he),_(V,me,L,he)},Se=(K,V,te=0)=>{I.current.has(K)||I.current.add(K),fetch(`/api/tools/oauth/status?testSessionId=${encodeURIComponent(K)}`).then(L=>L.json()).then(L=>{if(L.hasResult){I.current.delete(K),Ee(L.result);return}if(te+1>=15){I.current.delete(K),de(K,"error","timeout","⌛ Timed out waiting for account creation. Check Better Auth logs.","failed"),ce(),s(null),B.error("OAuth test timed out waiting for account creation");return}setTimeout(()=>Se(K,V,te+1),2e3)}).catch(L=>{te+1<15?setTimeout(()=>Se(K,V,te+1),2e3):(I.current.delete(K),de(K,"error","poll-error",`⚠️ Failed to check OAuth status: ${L}`,"failed"),ce(),s(null),B.error("Failed to check OAuth status"))})},Ee=K=>{l(!0);const V=K.testSessionId;if(K.success){if(R.current.has(V)&&K.userInfo)return;if(de(V,"success","waiting","✅ Verified with Better Auth.","completed"),K.userInfo){R.current.add(V);const te=[K.userInfo.name?`👤 ${K.userInfo.name}`:null,K.userInfo.email?`✉️ ${K.userInfo.email}`:null].filter(Boolean).join(" | "),me=te?`✅ ${K.provider} OAuth succeeded — ${te}`:`✅ ${K.provider} OAuth succeeded!`;de(V,"success","completed",me,"completed"),B.success(`OAuth test for ${K.provider} passed!`),ce(),s(null),P.current.delete(V)}else de(V,"progress","await-finalize","⌛ OAuth flow finished. Waiting for Better Auth to finalize account...","running"),I.current.has(V)||(I.current.add(V),Se(V,K.provider))}else{if(R.current.has(V))return;de(V,"error","waiting","❌ Verification failed with Better Auth.","failed");const te=K.error?` — ${K.error}`:"";de(V,"error","failed",`❌ ${K.provider} OAuth failed${te}`,"failed"),B.error(`OAuth test for ${K.provider} failed`),ce(),s(null),P.current.delete(V)}K.success||(R.current.add(V),P.current.delete(V)),sessionStorage.removeItem("oauth_test_session"),sessionStorage.removeItem(`oauth_test_result_${V}`)};m.useEffect(()=>{const K=e.get("oauth_test_result");if(K)try{const V=JSON.parse(decodeURIComponent(K));l(!0),Ee(V),t({})}catch{}},[e,t,Ee]),m.useEffect(()=>{(async()=>{try{const te=await(await fetch("/api/tools/oauth/providers")).json();te.success&&te.providers&&d(te.providers.filter(me=>me.enabled))}catch{}})()},[]);const Ae=async()=>{if(h.length===0){B.error("No OAuth providers configured"),_("error","❌ No OAuth providers found in configuration","failed"),_("info","💡 Please configure at least one OAuth provider in your Better Auth config","failed");return}u(!0)},He=async K=>{u(!1),x(""),s("test-oauth"),l(!0),i([]),_("info",`🔍 Testing ${K} OAuth...`,"running");const V=new Date().toISOString();try{_("progress","📡 Contacting Better Auth...","running");const me=await(await fetch("/api/tools/oauth/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:K})})).json();if(me.success&&me.startUrl){P.current.delete(me.testSessionId),de(me.testSessionId,"progress","popup-open",`🌐 Opening ${me.provider} OAuth popup...`,"running");const L={testSessionId:me.testSessionId,provider:me.provider,providerId:K,startTime:V};R.current.delete(me.testSessionId),sessionStorage.setItem("oauth_test_session",JSON.stringify(L));const ie=600,ue=700,he=(window.screen.width-ie)/2,Be=(window.screen.height-ue)/2,_e=window.open(me.startUrl,"oauth-test",`width=${ie},height=${ue},left=${he},top=${Be},scrollbars=yes,resizable=yes`);if(!_e){_("error","❌ Failed to open OAuth window. Please allow popups for this site.","failed"),_("error","💡 Check your browser popup blocker settings","failed"),B.error("Failed to open OAuth window. Please allow popups."),s(null);return}W.current=_e;let Re=!1;const je=Pe=>{if(Pe.origin===window.location.origin){if(Pe.data&&Pe.data.type==="oauth_test_state"){if(Pe.data.status==="redirect")I.current.has(L.testSessionId)||Se(L.testSessionId,L.provider);else if(Pe.data.status==="error"){Re=!0;const X=sessionStorage.getItem("oauth_test_session");let Q=me.provider;if(X)try{Q=JSON.parse(X).provider||Q}catch{}Ee({success:!1,provider:Q,testSessionId:Pe.data.testSessionId,error:Pe.data.error||"Failed to start OAuth test"}),window.removeEventListener("message",je),clearInterval(Ve),clearTimeout(ke),ce()}return}if(Pe.data&&Pe.data.type==="oauth_test_result"){window.removeEventListener("message",je),clearInterval(Ve),clearTimeout(ke),Re=!0;const X=Pe.data.result;Ee(X),I.current.has(X.testSessionId)||Se(X.testSessionId,X.provider),ce()}}};window.addEventListener("message",je);const Ve=setInterval(()=>{_e.closed&&(clearInterval(Ve),clearTimeout(ke),window.removeEventListener("message",je),!sessionStorage.getItem(`oauth_test_result_${L.testSessionId}`)&&!Re&&(Re=!0,Se(L.testSessionId,L.provider)))},500),ke=setTimeout(()=>{_e.closed||(clearInterval(Ve),window.removeEventListener("message",je),ce(),Re||(Re=!0),_("error","❌ OAuth test timed out after 5 minutes","failed"),_("error","💡 Possible reasons:","failed"),_("error"," • Authentication took too long","failed"),_("error"," • Provider is not responding","failed"),_("error"," • Network connectivity issues","failed"),B.error("OAuth test timed out"),s(null))},5*60*1e3)}else _("error",`❌ Failed to initiate OAuth test: ${me.error||"Unknown error"}`,"failed"),me.details&&_("error",`💡 Details: ${JSON.stringify(me.details)}`,"failed"),me.cause&&_("error",`💡 Cause: ${me.cause}`,"failed"),B.error(me.error||"Failed to start OAuth test"),s(null)}catch(te){_("error",`❌ Network error: ${te}`,"failed"),B.error("Failed to start OAuth test"),s(null)}},J=()=>{v(!0)},oe=async(K,V)=>{const te=Cl.find(L=>L.id===K);if(!te){B.error("Unknown migration provider");return}if(te.disabled){B.info(`${te.name} migration is coming soon`);return}v(!1),s("run-migration"),l(!0),i([]);const me=L=>new Promise(ie=>setTimeout(ie,L));try{if(_("info",`🚀 Preparing ${te.name} migration...`,"running"),te.highlights)for(const ue of te.highlights)await me(350),_("progress",ue,"running");_("progress","📡 Sending migration payload to server...","running");const ie=await(await fetch("/api/tools/migrations/run",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:te.id,script:te.custom?V:te.script})})).json();if(ie.success)_("progress","🚀 Migration job acknowledged. Follow server logs for live progress.","running"),_("success",`✅ ${te.name} migration request accepted.`,"completed"),ie.message&&_("info",ie.message,"completed"),B.success(`${te.name} migration flow completed`);else throw new Error(ie.error||"Migration request failed")}catch(L){_("error",`❌ Migration failed: ${L}`,"failed"),B.error("Migration failed")}finally{s(null)}},be=async()=>{s("validate-config"),l(!0),i([]),_("info","Validating Better Auth configuration...","running");try{await new Promise(K=>setTimeout(K,500)),_("progress","Checking database connection...","running"),await new Promise(K=>setTimeout(K,500)),_("progress","Validating plugins configuration...","running"),await new Promise(K=>setTimeout(K,500)),_("success","✅ Configuration is valid!","completed"),B.success("Configuration validated successfully")}catch(K){_("error",`❌ Configuration validation failed: ${K}`,"failed"),B.error("Configuration validation failed")}finally{s(null)}},Oe=async()=>{s("test-db"),l(!0),i([]),_("info","Testing database connection...","running");try{const V=await(await fetch("/api/database/test")).json();await new Promise(te=>setTimeout(te,1e3)),_("progress","Checking on database con!","running"),V.success?(_("success","✅ Database connection successful!","completed"),V.result&&Array.isArray(V.result)&&V.result.length>0&&(_("info","📄 Sample user record (first row):","completed"),_("info",JSON.stringify(V.result[0],null,2),"completed")),B.success("Database connection test successful")):(_("error",`❌ Database connection failed: ${V.error||"Unknown error"}`,"failed"),B.error("Database connection test failed"))}catch(K){_("error",`❌ Network error: ${K}`,"failed"),B.error("Failed to test database connection")}finally{s(null)}},we=async()=>{s("generate-api-key"),l(!0),i([]),_("info","Generating new API key...","running");try{const V=await(await fetch("/api/tools/generate-api-key",{method:"POST",headers:{"Content-Type":"application/json"}})).json();V.success&&V.apiKey?(_("success","✅ API key generated successfully!","completed"),_("info",`API Key: ${V.apiKey}`,"completed"),B.success("API key generated successfully")):(_("error",`❌ Failed to generate API key: ${V.error||"Unknown error"}`,"failed"),B.error("Failed to generate API key"))}catch(K){_("error",`❌ Network error: ${K}`,"failed"),B.error("Failed to generate API key")}finally{s(null)}},Ce=async()=>{s("health-check"),l(!0),i([]),_("info","Running Better Auth health check...","running");try{_("progress","Testing Better Auth endpoints...","running");const K=await fetch("/api/tools/health-check",{method:"POST"}),V=await K.json();if(!K.ok)throw new Error(V.error||V.message||"Health check failed");V.success?(_("success","✅ Better Auth health check passed","completed"),B.success("Health check passed")):(_("error","❌ Better Auth health check failed","failed"),V.failedEndpoints&&V.failedEndpoints.length>0&&V.failedEndpoints.forEach(te=>{const me=te.status?` (Status: ${te.status})`:"",L=te.error?` - ${te.error}`:"";_("error",` • Endpoint ${te.endpoint}${me}${L}`,"failed")}),B.error("Health check failed"))}catch(K){_("error",`❌ Health check failed: ${K instanceof Error?K.message:K}`,"failed"),B.error("Health check failed")}finally{s(null)}},st=new Set(["test-oauth","test-db","hash-password","health-check"]),yt=[{id:"test-oauth",name:"Test OAuth",description:"Test OAuth provider connections",icon:sn,action:Ae,category:"oauth"},{id:"hash-password",name:"Hash Password",description:"Generate SHA hashes",icon:co,action:Z,category:"utilities"},{id:"run-migration",name:"Run Migration",description:"Run database migrations",icon:fa,action:J,category:"database"},{id:"test-db",name:"Test Database",description:"Test database connection",icon:fa,action:Oe,category:"database"},{id:"validate-config",name:"Validate Config",description:"Validate Better Auth configuration",icon:E0,action:be,category:"utilities"},{id:"generate-api-key",name:"Generate API Key",description:"Generate a new API key",icon:co,action:we,category:"utilities"},{id:"health-check",name:"Health Check",description:"Run system health check",icon:wy,action:Ce,category:"testing"}],Lt=[{id:"oauth",name:"OAuth",icon:sn},{id:"database",name:"Database",icon:fa},{id:"testing",name:"Testing",icon:wy},{id:"utilities",name:"Utilities",icon:WC}].map(K=>({...K,tools:yt.filter(V=>V.category===K.id)}));return a.jsxs("div",{className:"space-y-8 bg-black w-full min-h-screen",children:[a.jsxs("div",{className:"w-full flex flex-col",children:[a.jsx("div",{className:"flex items-center justify-between p-5 pt-7",children:a.jsxs("div",{className:"pb-8",children:[a.jsx("h1",{className:"text-3xl font-normal text-white tracking-tight",children:"Tools"}),a.jsx("p",{className:"text-gray-300 mt-2 uppercase font-mono font-light text-xs",children:"Utility tools for managing and testing your Better Auth setup"})]})}),a.jsxs("div",{className:"flex flex-col items-center space-y-8",children:[a.jsx("hr",{className:"w-full border-white/15 h-px"}),a.jsx("hr",{className:"w-full border-white/15 h-px"})]}),o&&r.length>0&&a.jsxs("div",{className:"mb-6 p-6 gap-8",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("h3",{className:"text-sm uppercase font-mono text-gray-400 tracking-wider",children:"Tool Output"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>l(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Jt,{className:"w-4 h-4"})})]}),a.jsx(fi,{title:"Tool Execution Logs",lines:r,isRunning:n!==null,className:"w-full",defaultCollapsed:!1})]}),a.jsx("div",{className:"space-y-8 p-6 gap-8",children:Lt.map(K=>a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(K.icon,{className:"w-5 h-5 text-white"}),a.jsx("h2",{className:"text-lg font-light text-white uppercase tracking-wider",children:K.name})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:K.tools.map(V=>{const te=V.icon,me=n===V.id,L=st.has(V.id),ie=!L||n!==null&&n!==V.id||me;return a.jsxs("button",{onClick:()=>V.action(),disabled:ie,className:`relative flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none transition-colors text-left group ${L?"hover:bg-black/50 disabled:opacity-50 disabled:cursor-not-allowed":"opacity-60 cursor-not-allowed"}`,children:[a.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:me?a.jsx(tr,{className:"w-6 h-6 text-white animate-spin"}):a.jsx(te,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-white font-light mb-1",children:V.name}),a.jsxs("p",{className:"text-xs uppercase font-mono flex items-center text-gray-400",children:[a.jsx(CB,{className:"w-4 h-4 mr-2"}),V.description]})]}),!L&&a.jsx("span",{className:"absolute top-2 right-3 text-[10px] font-mono uppercase tracking-[0.2em] text-white/60",children:"Coming Soon"}),a.jsx(Fa,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]},V.id)})})]},K.id))})]}),w&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-2xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(co,{className:"w-5 h-5 text-white"}),a.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Password Hasher"})]}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>N(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Jt,{className:"w-5 h-5"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(Xe,{className:"text-xs uppercase font-mono text-gray-400",children:"Algorithm"}),a.jsxs("select",{value:H,onChange:K=>U(K.target.value),className:"mt-2 w-full bg-black border border-dashed border-white/20 text-white px-3 py-2 text-sm focus:outline-none",children:[a.jsx("option",{value:"SHA-256",children:"SHA-256"}),a.jsx("option",{value:"SHA-384",children:"SHA-384"}),a.jsx("option",{value:"SHA-512",children:"SHA-512"})]})]}),a.jsxs("div",{children:[a.jsx(Xe,{className:"text-xs uppercase font-mono text-gray-400",children:"Encoding"}),a.jsxs("select",{value:z,onChange:K=>Y(K.target.value),className:"mt-2 w-full bg-black border border-dashed border-white/20 text-white px-3 py-2 text-sm focus:outline-none",children:[a.jsx("option",{value:"hex",children:"Hex"}),a.jsx("option",{value:"base64",children:"Base64"}),a.jsx("option",{value:"base64url",children:"Base64 URL"})]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(Xe,{className:"text-xs uppercase font-mono text-gray-400",children:"Salt (optional)"}),a.jsx(Fe,{value:T,onChange:K=>O(K.target.value),placeholder:"e.g. project-specific-salt",className:"mt-2 bg-black border border-dashed border-white/20 text-white rounded-none"}),a.jsxs("p",{className:"text-[11px] text-gray-500 mt-1 font-mono",children:["Salt is prepended (",a.jsx("span",{className:"text-white/80",children:"salt:password"}),")"]})]}),a.jsxs("div",{children:[a.jsx(Xe,{className:"text-xs uppercase font-mono text-gray-400",children:"Password"}),a.jsxs("div",{className:"relative mt-2",children:[a.jsx(Fe,{type:E?"text":"password",value:S,onChange:K=>C(K.target.value),placeholder:"Enter password",className:"bg-black border border-dashed border-white/20 text-white rounded-none pr-10"}),a.jsx("button",{type:"button",onClick:()=>D(K=>!K),className:"absolute inset-y-0 right-0 px-3 flex items-center text-gray-400 hover:text-white","aria-label":E?"Hide password":"Show password",children:E?a.jsx(_S,{className:"w-4 h-4"}):a.jsx(Xo,{className:"w-4 h-4"})})]})]})]}),k&&a.jsxs("div",{children:[a.jsx(Xe,{className:"text-xs uppercase font-mono text-gray-400",children:"Hash Result"}),a.jsxs("div",{className:"mt-2 flex items-center space-x-2",children:[a.jsx(Fe,{value:k,readOnly:!0,className:"flex-1 bg-black border border-dashed border-white/20 text-white rounded-none"}),a.jsx(F,{variant:"outline",size:"icon",onClick:()=>k&&xe(k),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:a.jsx(yu,{className:"w-4 h-4"})})]})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-8 border-t border-dashed border-white/10 pt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>N(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"}),a.jsx(F,{onClick:se,disabled:M,className:"rounded-none",children:M?a.jsxs(a.Fragment,{children:[a.jsx(tr,{className:"w-4 h-4 mr-2 animate-spin"}),"Hashing..."]}):"Hash Password"})]})]})}),c&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-8 w-full max-w-2xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(sn,{className:"w-6 h-6 text-white"}),a.jsx("h3",{className:"text-xl text-white font-light",children:"Select OAuth Provider"})]}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>{u(!1),x("")},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Jt,{className:"w-5 h-5"})})]}),a.jsx("div",{className:"space-y-4",children:h.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(sn,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),a.jsx("p",{className:"text-gray-400 mb-2 text-lg",children:"No OAuth providers configured"}),a.jsx("p",{className:"text-sm text-gray-500",children:"Please configure OAuth providers in your Better Auth configuration"})]}):a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-medium text-gray-400 mb-4 uppercase font-mono",children:["Available Providers (",h.length,")"]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 max-h-96 overflow-y-auto",children:h.map(K=>a.jsxs("button",{onClick:()=>{x(K.id),setTimeout(()=>{He(K.id)},100)},className:`w-full flex items-center space-x-4 p-4 border rounded-none transition-all text-left group ${f===K.id?"border-white/50 bg-white/10":"border-dashed border-white/20 hover:bg-white/5 hover:border-white/30"}`,children:[a.jsx("div",{className:"flex-shrink-0",children:ae(K.id)}),a.jsx("div",{className:"flex-1 min-w-0",children:a.jsx("p",{className:"text-white uppercase font-mono font-light text-base",children:K.name||K.id})}),a.jsx(Fa,{className:`w-5 h-5 transition-colors flex-shrink-0 ${f===K.id?"text-white":"text-gray-400 group-hover:text-white"}`})]},K.id))}),a.jsx("p",{className:"text-xs text-gray-500 mt-4 font-mono uppercase",children:"Click on a provider to start the OAuth test"})]})}),a.jsx("div",{className:"flex justify-end space-x-3 mt-8 pt-6 border-t border-dashed border-white/10",children:a.jsx(F,{variant:"outline",onClick:()=>{u(!1),x("")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"})})]})}),y&&a.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/95 border border-dashed border-white/20 p-8 w-full max-w-5xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(fa,{className:"w-6 h-6 text-white"}),a.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Select Migration"})]}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>v(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Jt,{className:"w-5 h-5"})})]}),a.jsxs("div",{className:"grid md:grid-cols-3 gap-4",children:[a.jsx("div",{className:"space-y-3",children:Cl.map(K=>{const V=(ee==null?void 0:ee.id)===K.id;return a.jsxs("button",{onClick:()=>ne(K.id),disabled:K.disabled,className:`w-full flex items-center space-x-3 p-4 border transition-colors rounded-none text-left ${K.disabled?"border-dashed border-white/10 bg-black/30 cursor-not-allowed opacity-60":V?"border-white/60 bg-white/10":"border-dashed border-white/20 hover:bg-white/5 hover:border-white/40"}`,children:[a.jsx("div",{className:"flex-shrink-0 w-10 h-10 bg-white/10 flex items-center justify-center",children:K.logo?K.logo:a.jsx(vy,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-white uppercase font-mono text-sm",children:K.name}),a.jsx("p",{className:"text-xs uppercase text-gray-400 font-mono mt-1 truncate",children:K.description})]}),K.disabled&&a.jsx("span",{className:"text-[10px] font-mono text-gray-400 uppercase",children:"Coming Soon"})]},K.id)})}),a.jsxs("div",{className:"md:col-span-2 space-y-4",children:[a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx("div",{className:"w-12 h-12 bg-white/10 flex items-center justify-center",children:ee.logo?ee.logo:a.jsx(vy,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("h4",{className:"text-white -mb-2 text-lg font-light uppercase tracking-wider",children:ee.name}),a.jsx("p",{className:"text-sm mt-0 text-gray-400 uppercase font-mono leading-relaxed",children:ee.description}),a.jsx("div",{className:"flex items-center space-x-2",children:ee.docs&&a.jsx(F,{variant:"ghost",size:"sm",asChild:!0,className:"rounded-none border border-dashed",children:a.jsx("a",{href:ee.docs,target:"_blank",rel:"noreferrer",children:"View Docs"})})})]})]}),ee.highlights&&a.jsx("ul",{className:"space-y-2 text-xs text-gray-300 font-mono bg-black/40 border border-white/10 p-4",children:ee.highlights.map(K=>a.jsxs("li",{className:"flex items-start space-x-2",children:[a.jsx("span",{className:"text-white/60 mt-0.5",children:"•"}),a.jsx("span",{children:K})]},K))}),ee.disabled?a.jsxs("div",{className:"space-y-4 text-gray-400 font-mono text-xs",children:[a.jsx("p",{children:"This migration provider is coming soon."}),a.jsxs("p",{children:["Subscribe to updates at"," ",a.jsx("a",{href:"https://better-auth.com",target:"_blank",rel:"noreferrer",className:"text-white underline",children:"better-auth.com"}),"."]})]}):ee.custom?a.jsxs("div",{className:"space-y-3",children:[a.jsx("label",{className:"text-xs uppercase font-mono text-gray-400",children:"Custom Migration Script"}),a.jsx("textarea",{value:b,onChange:K=>p(K.target.value),className:"w-full h-64 bg-black/70 border border-white/10 text-xs text-gray-200 font-mono p-3 rounded-none focus:outline-none focus:ring-0"}),a.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[a.jsx(F,{variant:"outline",size:"sm",className:"rounded-none",onClick:()=>p(Km),children:"Reset"}),a.jsxs(F,{variant:"ghost",size:"sm",className:"rounded-none text-gray-400 hover:text-white",onClick:()=>xe(b),children:[a.jsx(yu,{className:"w-4 h-4"}),"Copy Script"]}),a.jsx(F,{className:"rounded-none",onClick:()=>oe("custom",b),children:"Run Custom Script"})]})]}):a.jsxs("div",{className:"space-y-3",children:[ee.script&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center justify-between text-xs uppercase font-mono text-gray-400",children:[a.jsx("span",{children:"Migration Script Preview"}),a.jsxs(F,{variant:"ghost",size:"sm",className:"rounded-none text-gray-400 hover:text-white",onClick:()=>xe(ee.script),children:[a.jsx(yu,{className:"w-4 h-4"}),"Copy Script"]})]}),a.jsx("pre",{className:"bg-black/70 border border-white/10 text-[11px] text-green-200 font-mono p-4 overflow-auto leading-relaxed h-64",children:a.jsx("code",{children:ee.script})})]}),a.jsx("div",{className:"flex items-center justify-end space-x-2",children:a.jsxs(F,{className:"rounded-none",onClick:()=>oe(ee.id),children:["Run ",ee.name," Migration"]})})]})]})]})]})})]})}function fV(){const{userId:e}=zp(),t=ws(),[n,s]=m.useState(null),[r,i]=m.useState([]),[o,l]=m.useState([]),[c,u]=m.useState([]),[h,d]=m.useState([]),[f,x]=m.useState(!0),[y,v]=m.useState("details"),[j,g]=m.useState(!1),[b,p]=m.useState(!1),[w,N]=m.useState(!1),[S,C]=m.useState(!1),[T,O]=m.useState(""),[H,U]=m.useState(),[z,Y]=m.useState(!1),[k,$]=m.useState([]),[M,A]=m.useState(!1),[E,D]=m.useState({}),_=m.useRef({}),I=m.useCallback(async()=>{try{const oe=await(await fetch("/api/admin/status")).json();Y(oe.enabled)}catch{Y(!1)}},[]),R=m.useCallback(async J=>{try{const oe=await fetch("/api/geo/resolve",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ipAddress:J})});if(oe.ok){const be=await oe.json();if(be.success&&be.location)return be.location}return null}catch{return null}},[]),P=m.useCallback(async J=>{const oe=J.filter(we=>!_.current[we.id]);if(oe.length===0)return;const be=await Promise.all(oe.map(async we=>{const Ce=await R(we.ipAddress);return Ce?{sessionId:we.id,location:Ce}:null})),Oe={};be.forEach(we=>{we&&(Oe[we.sessionId]=we.location)}),Object.keys(Oe).length>0&&(_.current={..._.current,...Oe},D(_.current))},[R]),W=J=>{if(!J)return"🌍";const oe=J.toUpperCase().split("").map(be=>127397+be.charCodeAt(0));return String.fromCodePoint(...oe)},q=J=>J?J.replace(/[_-]/g," ").replace(/\b\w/g,oe=>oe.toUpperCase()):"Unknown Provider",ee=J=>{if(!J)return"Unknown";const oe=new Date(J);return Number.isNaN(oe.getTime())?"Unknown":oe.toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})},ne=m.useCallback(async()=>{try{const J=await fetch(`/api/users/${e}`);if(J.ok){const oe=await J.json();s(oe.user)}else B.error("Failed to fetch user details"),t("/users")}catch{B.error("Failed to fetch user details"),t("/users")}finally{x(!1)}},[e,t]),Z=m.useCallback(async()=>{try{const[J,oe,be]=await Promise.all([fetch(`/api/users/${e}/organizations`),fetch(`/api/users/${e}/teams`),fetch(`/api/users/${e}/sessions`)]);if(J.ok){const Oe=await J.json();i(Oe.memberships||[])}if(oe.ok){const Oe=await oe.json();l(Oe.memberships||[])}if(be.ok){const we=(await be.json()).sessions||[];u(we),P(we)}}catch{}},[e,P]),se=m.useCallback(async()=>{try{const J=await fetch(`/api/users/${e}/accounts`);if(J.ok){const oe=await J.json();d(oe.accounts||[])}}catch{}},[e]),xe=async()=>{var Oe,we;if(!n)return;const J=(Oe=document.getElementById("edit-name"))==null?void 0:Oe.value,oe=(we=document.getElementById("edit-email"))==null?void 0:we.value;if(!J||!oe){B.error("Please fill in all fields");return}const be=B.loading("Updating user...");try{const st=await(await fetch(`/api/users/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:J,email:oe})})).json();st.success?(s({...n,name:J,email:oe}),g(!1),B.success("User updated successfully!",{id:be})):B.error(`Error updating user: ${st.error||"Unknown error"}`,{id:be})}catch{B.error("Error updating user",{id:be})}},ae=async()=>{if(!n)return;if(!z){B.error("Admin plugin is not enabled. Please enable the admin plugin in your Better Auth configuration to use ban functionality.");return}const J=B.loading("Banning user...");try{const oe=await fetch("/api/admin/ban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e,banReason:T||"No reason provided",banExpiresIn:H})}),be=await oe.json();oe.ok?(B.success("User banned successfully!",{id:J}),p(!1),O(""),U(void 0),ne()):oe.status===403?B.error("You do not have permission to ban users. Admin role required.",{id:J}):be.adminPluginEnabled&&be.instructions?B.error(`${be.error}`,{id:J,duration:6e3,description:`Use: ${be.instructions.example}`}):B.error(`Error banning user: ${be.error||be.message||"Unknown error"}`,{id:J})}catch{B.error("Error banning user",{id:J})}},ce=async()=>{if(!n)return;if(!z){B.error("Admin plugin is not enabled. Please enable the admin plugin in your Better Auth configuration to use unban functionality.");return}const J=B.loading("Unbanning user...");try{const oe=await fetch("/api/admin/unban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e})}),be=await oe.json();oe.ok?(B.success("User unbanned successfully!",{id:J}),N(!1),ne()):oe.status===403?B.error("You do not have permission to unban users. Admin role required.",{id:J}):be.adminPluginEnabled&&be.instructions?B.error(`${be.error}`,{id:J,duration:6e3,description:`Use: ${be.instructions.example}`}):B.error(`Error unbanning user: ${be.error||be.message||"Unknown error"}`,{id:J})}catch{B.error("Error unbanning user",{id:J})}},de=async J=>{const oe=B.loading("Removing user from organization...");try{const Oe=await(await fetch(`/api/organizations/members/${J}`,{method:"DELETE"})).json();Oe.success?(i(we=>we.filter(Ce=>Ce.id!==J)),B.success("User removed from organization!",{id:oe})):B.error(`Error removing user: ${Oe.error||"Unknown error"}`,{id:oe})}catch{B.error("Error removing user from organization",{id:oe})}},Se=async J=>{const oe=B.loading("Removing user from team...");try{const Oe=await(await fetch(`/api/teams/members/${J}`,{method:"DELETE"})).json();Oe.success?(l(we=>we.filter(Ce=>Ce.id!==J)),B.success("User removed from team!",{id:oe})):B.error(`Error removing user: ${Oe.error||"Unknown error"}`,{id:oe})}catch{B.error("Error removing user from team",{id:oe})}},Ee=async J=>{const oe=B.loading("Deleting session...");try{const Oe=await(await fetch(`/api/sessions/${J}`,{method:"DELETE"})).json();Oe.success?(u(we=>we.filter(Ce=>Ce.id!==J)),B.success("Session deleted successfully!",{id:oe})):B.error(`Error deleting session: ${Oe.error||"Unknown error"}`,{id:oe})}catch{B.error("Error deleting session",{id:oe})}},Ae=async J=>{if(!e)return;const oe=B.loading("Unlinking account...");try{const be=await fetch(`/api/users/${e}/accounts/${J}`,{method:"DELETE"});if(be.ok)d(Oe=>Oe.filter(we=>we.id!==J)),B.success("Account unlinked successfully",{id:oe});else{const Oe=await be.json();B.error(Oe.error||"Failed to unlink account",{id:oe})}}catch{B.error("Failed to unlink account",{id:oe})}};m.useEffect(()=>{e&&(ne(),Z(),se(),I())},[e,I,ne,Z,se]);const He=async(J=3)=>{if(e){$([]),A(!0),$([{id:"start",type:"info",message:`Starting session seeding process for ${J} sessions...`,timestamp:new Date}]);try{const be=await(await fetch(`/api/users/${e}/seed-sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:J})})).json();if(be.success){const Oe=be.results.map((Ce,st)=>Ce.success?{id:`session-${st}`,type:"progress",message:`Creating session ${st+1}: ${Ce.session.token.substring(0,20)}... from ${Ce.session.ipAddress}`,timestamp:new Date,status:"completed"}:{id:`session-${st}`,type:"error",message:`Failed to create session ${st+1}: ${Ce.error}`,timestamp:new Date});$(Ce=>[...Ce,...Oe]);const we=be.results.filter(Ce=>Ce.success).length;$(Ce=>[...Ce,{id:"complete",type:"success",message:`✅ Session seeding completed! Created ${we}/${J} sessions successfully`,timestamp:new Date}]),Z()}else $(Oe=>[...Oe,{id:"error",type:"error",message:`❌ Session seeding failed: ${be.error||"Unknown error"}`,timestamp:new Date}])}catch(oe){$(be=>[...be,{id:"error",type:"error",message:`❌ Network error: ${oe}`,timestamp:new Date}])}finally{A(!1)}}};return f?a.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center",children:a.jsx("div",{className:"text-white text-lg",children:"Loading user details..."})}):n?a.jsxs("div",{className:"space-y-6 p-6 bg-black w-full",children:[a.jsxs("div",{className:"w-full flex flex-col",children:[a.jsx("span",{className:"mb-4 ml-0 flex justify-start items-start text-left border-none text-white",children:a.jsxs("span",{className:"font-light",children:[a.jsxs("span",{onClick:()=>t("/users"),className:"uppercase cursor-pointer text-white/80 font-mono text-sm",children:["users /"," "]}),a.jsx("span",{className:"text-white font-mono text-sm",children:n.id})]})}),a.jsx("div",{className:"mb-8 mt-4",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsx("div",{className:"w-16 h-16 bg-gray-800 border border-dashed border-white/20 flex items-center justify-center",children:n.image?a.jsx("img",{src:n.image,alt:n.name,className:"w-16 h-16 object-cover"}):a.jsx(Xd,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsxs("h1",{className:"text-3xl font-light text-white inline-flex items-center",children:[n.name,a.jsx(Rn,{id:n.id,variant:"subscript"}),n.banned&&a.jsx("sup",{className:"ml-2 px-2 pt-2 pb-2 -mt-1 py-0.5 text-[10px] font-mono uppercase border border-dashed border-red-500/30 bg-red-500/10 text-red-400/80 rounded-none",children:"Banned"})]}),a.jsx("p",{className:"text-gray-400 font-mono text-sm",children:n.email}),a.jsx("div",{className:"flex items-center space-x-2 mt-2",children:n.role&&a.jsxs("div",{className:"flex items-center space-x-1 px-2 py-1 rounded-sm text-xs font-mono bg-purple-500/20 text-purple-400",children:[a.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-purple-500"}),a.jsx("span",{children:n.role})]})})]})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsxs(F,{variant:"outline",onClick:()=>g(!0),className:"border border-white/20 text-white hover:bg-white/10 rounded-none",children:[a.jsx(ii,{className:"w-4 h-4 mr-2"}),"Edit User"]}),n.banned?a.jsxs(F,{variant:"outline",onClick:()=>N(!0),className:"border border-green-400/20 text-green-400 hover:bg-green-400/10 rounded-none",disabled:!z,children:[a.jsx(Zm,{className:"w-4 h-4 mr-2"}),"Unban User"]}):a.jsxs(F,{variant:"outline",onClick:()=>p(!0),className:"border border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",disabled:!z,children:[a.jsx(Zm,{className:"w-4 h-4 mr-2"}),"Ban User"]})]})]})}),a.jsxs("div",{className:"border border-dashed border-white/20 rounded-none",children:[a.jsx("div",{className:"border-b border-dashed border-white/10",children:a.jsx("nav",{className:"flex space-x-8 px-6",children:[{id:"details",name:"Details",icon:Xd},{id:"organizations",name:"Organizations",icon:An,count:r.length},{id:"teams",name:"Teams",icon:ft,count:o.length},{id:"accounts",name:"Accounts",icon:Cm,count:h.length},{id:"sessions",name:"Sessions",icon:mg,count:c.length}].map(J=>a.jsxs("button",{onClick:()=>v(J.id),className:`flex items-center space-x-2 py-4 px-2 border-b-2 font-medium text-sm ${y===J.id?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-white/50"}`,children:[a.jsx(J.icon,{className:"w-4 h-4 text-white/90"}),a.jsxs("span",{className:"inline-flex items-start",children:[a.jsx("span",{className:"",children:J.name}),J.count!==void 0&&a.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:a.jsx(xs,{value:J.count,className:"text-white/80 font-mono text-xs",prefix:a.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]},J.id))})}),a.jsxs("div",{className:"p-6",children:[y==="details"&&a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"overflow-x-hidden bg-white/[3%] border border-white/10 p-6 rounded-none",children:[a.jsx("h3",{className:"text-sm uppercase font-mono text-gray-400 mb-4 tracking-wider",children:"BASIC INFORMATION"}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed my-4"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(Xd,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Username"}),a.jsx("div",{className:"text-white font-sans text-sm",children:n.name.toLowerCase().replace(/\s+/g,"")})]})]}),a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(sa,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Email"}),a.jsx("div",{className:"text-white font-mono text-sm",children:n.email})]})]}),n.username&&a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(_B,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Username"}),a.jsx("div",{className:"text-white font-mono text-sm",children:n.username})]})]}),n.phoneNumber&&a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(DB,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Phone"}),a.jsx("div",{className:"text-white font-mono text-sm",children:"+251 91 234 5678"})]})]}),a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(ls,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Member Since"}),a.jsx("div",{className:"text-white font-mono text-sm",children:new Date(n.createdAt).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"})})]})]})]})]}),a.jsxs("div",{className:"overflow-x-hidden bg-white/[3%] border border-white/10 p-6 rounded-none",children:[a.jsx("h3",{className:"text-sm uppercase font-mono text-gray-400 mb-4 tracking-wider",children:"SECURITY"}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed my-4"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 bg-black/30 border border-white/5 rounded-none",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(sa,{className:"w-4 h-4 text-gray-400"}),a.jsx("div",{children:a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500",children:"Email Verification"})})]}),a.jsx("div",{className:`px-2 rounded-none py-1 text-xs font-mono ${n.emailVerified?"bg-green-500/20 text-green-400":"bg-red-500/20 text-red-400"}`,children:n.emailVerified?"Verified":"Unverified"})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 bg-black/30 border border-white/5 rounded-none",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(fa,{className:"w-4 h-4 text-gray-400"}),a.jsx("div",{children:a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500",children:"Two-Factor Authentication"})})]}),a.jsx("div",{className:`px-2 rounded-none py-1 text-xs font-mono ${n.twoFactorEnabled?"bg-green-500/20 text-green-400":"bg-red-500/20 text-red-400"}`,children:n.twoFactorEnabled?"Enabled":"Disabled"})]})]})]})]}),y==="organizations"&&a.jsx("div",{className:"space-y-4",children:r.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(An,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Organizations"}),a.jsx("p",{className:"text-gray-400",children:"This user is not a member of any organizations."})]}):a.jsx("div",{className:"grid gap-4",children:r.map(J=>a.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[a.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:J.organization.image?a.jsx("img",{src:J.organization.image,alt:J.organization.name,className:"w-12 h-12 object-cover"}):a.jsx(An,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:[J.organization.name,a.jsxs("sup",{className:"text-xs text-gray-500 ml-2 mt-0.5",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-xs",children:J.organization.slug}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsxs("p",{className:"text-gray-400 text-sm font-sans mt-1",children:["in ",J.organization.slug]})]})]}),a.jsx("div",{className:"flex flex-col items-end space-y-2",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Joined:"," "]}),a.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(J.joinedAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(J.joinedAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]})})]}),a.jsx("div",{className:"flex items-center justify-end",children:a.jsxs(F,{variant:"outline",size:"sm",onClick:()=>de(J.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[a.jsx(Gm,{className:"w-4 h-4 mr-1"}),"Remove"]})})]},J.id))})}),y==="teams"&&a.jsx("div",{className:"space-y-4",children:o.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(ft,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Teams"}),a.jsx("p",{className:"text-gray-400",children:"This user is not a member of any teams."})]}):a.jsx("div",{className:"grid gap-4",children:o.map(J=>a.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[a.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:a.jsx(ft,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:[J.team.name,a.jsxs("sup",{className:"text-xs text-gray-500 ml-2 mt-0.5",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-xs",children:J.team.organizationSlug||J.team.organizationName}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsxs("p",{className:"text-gray-400 text-sm font-sans mt-1",children:["in"," ",J.team.organizationSlug||J.team.organizationName]})]})]}),a.jsx("div",{className:"flex flex-col items-end space-y-2",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Joined:"," "]}),a.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(J.joinedAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(J.joinedAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]})})]}),a.jsx("div",{className:"flex items-center justify-end",children:a.jsxs(F,{variant:"outline",size:"sm",onClick:()=>Se(J.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[a.jsx(Gm,{className:"w-4 h-4 mr-1"}),"Remove"]})})]},J.id))})}),y==="accounts"&&a.jsx("div",{className:"space-y-4",children:h.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(Cm,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Linked Accounts"}),a.jsx("p",{className:"text-gray-400",children:"This user has not connected any accounts yet."})]}):a.jsx("div",{className:"grid gap-4",children:h.map(J=>a.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[a.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:a.jsx(Cm,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:[q(J.providerId),a.jsxs("sup",{className:"text-xs text-gray-500 ml-2 mt-0.5",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-xs",children:J.providerId}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 text-sm font-sans mt-1",children:J.email||`Account ID: ${J.id}`})]})]}),a.jsx("div",{className:"flex flex-col items-end space-y-2 text-right",children:a.jsxs("div",{className:"flex items-center space-x-2 text-xs font-mono text-gray-400",children:[a.jsx("span",{children:"Linked:"}),a.jsx("span",{className:"text-white",children:ee(J.createdAt||J.updatedAt)})]})})]}),a.jsx("div",{className:"flex items-center justify-end",children:a.jsxs(F,{variant:"outline",size:"sm",onClick:()=>Ae(J.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[a.jsx(Gm,{className:"w-4 h-4 mr-1"}),"Unlink"]})})]},J.id))})}),y==="sessions"&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-medium text-white",children:"Sessions"}),a.jsx("p",{className:"text-gray-400 text-sm",children:"Manage user authentication sessions"})]}),a.jsxs(F,{variant:"outline",onClick:()=>{$([]),A(!1),C(!0)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:[a.jsx(fa,{className:"w-4 h-4 mr-2"}),"Seed Sessions"]})]}),c.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(mg,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Sessions"}),a.jsx("p",{className:"text-gray-400",children:"This user has no active sessions."})]}):a.jsx("div",{className:"grid gap-4",children:c.map(J=>{var oe,be,Oe,we;return a.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[a.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:a.jsx(gw,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:["Session ",J.id.substring(0,8),"...",a.jsxs("sup",{className:"text-xs text-gray-500 ml-2 mt-0.5",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-xs",children:J.ipAddress}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsxs("div",{className:"flex items-center space-x-2 mt-2",children:[a.jsx(TB,{className:"w-3.5 h-3.5 text-gray-400"}),a.jsxs("span",{className:"text-gray-400 uppercase font-mono text-xs",children:[((oe=E[J.id])==null?void 0:oe.city)||"...",","," ",((be=E[J.id])==null?void 0:be.country)||"..."]}),((Oe=E[J.id])==null?void 0:Oe.countryCode)&&a.jsx("span",{className:"text-xs ml-1",children:W((we=E[J.id])==null?void 0:we.countryCode)})]})]})]}),a.jsx("div",{className:"flex flex-col items-end space-y-2",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Expires:"," "]}),a.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(J.expiresAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(J.expiresAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]})})]}),a.jsx("div",{className:"flex items-center justify-end",children:a.jsxs(F,{variant:"outline",size:"sm",onClick:()=>Ee(J.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[a.jsx(Zm,{className:"w-4 h-4 mr-1"}),"Revoke"]})})]},J.id)})})]})]})]})]}),j&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 rounded-none p-6 w-full max-w-md",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Edit User"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>g(!1),className:"text-gray-400 hover:text-white rounded-none",children:"×"})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 bg-black/80 border border-dashed border-white/20 flex items-center justify-center",children:n!=null&&n.image?a.jsx("img",{src:n.image,alt:n.name,className:"w-16 h-16 object-cover"}):a.jsx(Xd,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-white font-medium",children:n==null?void 0:n.name}),a.jsx("p",{className:"text-gray-400 text-sm",children:n==null?void 0:n.email})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Name"}),a.jsx("input",{id:"edit-name",type:"text",defaultValue:(n==null?void 0:n.name)||"",className:"w-full px-3 py-2 bg-gray-800 border border-dashed border-white/20 rounded-none text-white placeholder-gray-400 focus:outline-none focus:border-white/50"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Email"}),a.jsx("input",{id:"edit-email",type:"email",defaultValue:(n==null?void 0:n.email)||"",className:"w-full px-3 py-2 bg-gray-800 border border-dashed border-white/20 rounded-none text-white placeholder-gray-400 focus:outline-none focus:border-white/50"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-2 mt-6",children:[a.jsx(F,{variant:"outline",onClick:()=>g(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:xe,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),b&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-red-400/20 rounded-none p-6 w-full max-w-md",children:[a.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Ban User"}),a.jsxs("p",{className:"text-gray-400 mb-4",children:["Ban ",a.jsx("strong",{children:n.name})," from accessing the system."]}),a.jsxs("div",{className:"space-y-4 mb-6",children:[a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"banReason",className:"text-white",children:"Ban Reason"}),a.jsx(Fe,{id:"banReason",value:T,onChange:J=>O(J.target.value),placeholder:"Enter reason for ban (optional)",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Xe,{htmlFor:"banExpires",className:"text-white",children:"Ban Duration (seconds)"}),a.jsx(Fe,{id:"banExpires",type:"number",value:H||"",onChange:J=>U(J.target.value?Number(J.target.value):void 0),placeholder:"Leave empty for permanent ban",className:"bg-black border border-dashed border-white/20 text-white rounded-none"}),a.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Examples: 3600 (1 hour), 86400 (1 day), 604800 (1 week)"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-2",children:[a.jsx(F,{variant:"outline",onClick:()=>{p(!1),O(""),U(void 0)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:ae,className:"bg-red-600 text-white hover:bg-red-700 rounded-none",children:"Ban User"})]})]})}),w&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-green-400/20 rounded-none p-6 w-full max-w-md",children:[a.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Unban User"}),a.jsxs("p",{className:"text-gray-400 mb-6",children:["Are you sure you want to unban ",a.jsx("strong",{children:n.name}),"? This will restore their access to the system."]}),a.jsxs("div",{className:"flex justify-end space-x-2",children:[a.jsx(F,{variant:"outline",onClick:()=>N(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(F,{onClick:ce,className:"bg-green-400 text-white hover:bg-green-700 rounded-none",children:"Unban User"})]})]})}),S&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"overflow-x-hidden bg-black/90 border border-white/10 p-6 w-full pt-4 max-w-2xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("h3",{className:"text-sm text-white flex items-center justify-center font-light uppercase",children:[a.jsx("span",{className:"text-white/50 mr-2",children:"["}),a.jsx(gw,{className:"inline mr-2 w-3 h-3 text-white"}),a.jsx("span",{className:"font-mono text-white/70 uppercase",children:"Seed Sessions"}),a.jsx("span",{className:"text-white/50 ml-2",children:"]"})]}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>C(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Jt,{className:"w-4 h-4"})})]}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed -mt-4 mb-4"}),a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"space-y-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(Xe,{htmlFor:"session-count",className:"text-sm text-gray-400 font-light",children:"Number of sessions"}),a.jsx(Fe,{id:"session-count",type:"number",min:"1",max:"50",defaultValue:"3",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx(F,{onClick:()=>{var oe;const J=parseInt(((oe=document.getElementById("session-count"))==null?void 0:oe.value)||"3",10);He(J)},disabled:M,className:"bg-transparent hover:bg-white/90 bg-white text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:M?a.jsxs(a.Fragment,{children:[a.jsx(tr,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(fa,{className:"w-3 h-3 mr-2"}),"Seed Sessions"]})})]})}),k.length>0&&a.jsx("div",{className:"mt-6",children:a.jsx(fi,{title:"Session Seeding Terminal",lines:k,isRunning:M,className:"w-full",defaultCollapsed:!0})})]}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed mt-10"}),a.jsx("div",{className:"flex justify-end mt-6 pt-6",children:a.jsx(F,{variant:"outline",onClick:()=>C(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})})]}):a.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center",children:a.jsx("div",{className:"text-white text-lg",children:"User not found"})})}function mV(){return a.jsx(u9,{children:a.jsxs(J5,{children:[a.jsx(s$,{children:a.jsxs(I5,{children:[a.jsx(xn,{path:"/",element:a.jsx(JB,{})}),a.jsx(xn,{path:"/users",element:a.jsx(eE,{})}),a.jsx(xn,{path:"/users/:userId",element:a.jsx(fV,{})}),a.jsx(xn,{path:"/organizations",element:a.jsx(JC,{})}),a.jsx(xn,{path:"/organizations/:orgId",element:a.jsx(aV,{})}),a.jsx(xn,{path:"/teams",element:a.jsx(oV,{})}),a.jsx(xn,{path:"/teams/:teamId",element:a.jsx(Mw,{})}),a.jsx(xn,{path:"/organizations/:orgId/teams/:teamId",element:a.jsx(Mw,{})}),a.jsx(xn,{path:"/sessions",element:a.jsx(rV,{})}),a.jsx(xn,{path:"/database",element:a.jsx(nV,{})}),a.jsx(xn,{path:"/database/demo",element:a.jsx(d9,{})}),a.jsx(xn,{path:"/tools",element:a.jsx(hV,{})}),a.jsx(xn,{path:"/settings",element:a.jsx(iV,{})})]})}),a.jsx(DM,{className:"rounded-none border-dashed border-white/20",theme:"dark",position:"top-right",richColors:!0,toastOptions:{style:{border:"dashed 1px #ffffff20",borderRadius:"0"},className:"font-mono uppercase"},closeButton:!0})]})})}Jk.createRoot(document.getElementById("root")).render(a.jsx(G.StrictMode,{children:a.jsx(mV,{})}));