@xenon-device-management/xenon 1.22.3 → 1.22.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/package.json +1 -1
- package/lib/public/assets/{ApiKeyGate-bHtvfyNp.js → ApiKeyGate-mUVQGEc0.js} +1 -1
- package/lib/public/assets/{BugReportButton-DFLx1uf_.css → BugReportButton-CPBjfiv4.css} +1 -1
- package/lib/public/assets/{BugReportButton-DFK28wAC.js → BugReportButton-DTEs8tGN.js} +1 -1
- package/lib/public/assets/{DeviceMosaicView-C4Yrz2PA.js → DeviceMosaicView-BRoAd1Sj.js} +1 -1
- package/lib/public/assets/{EmptyState-aXHIYg04.js → EmptyState-ErJtYI1I.js} +1 -1
- package/lib/public/assets/{FieldGroup-C_DwE2dP.js → FieldGroup-65VOAW_s.js} +1 -1
- package/lib/public/assets/{Modal-BCbDzIzg.js → Modal-CumsTFc7.js} +1 -1
- package/lib/public/assets/{SegmentedControl-BPjRPFXH.js → SegmentedControl-Dq0r4nxn.js} +1 -1
- package/lib/public/assets/{SettingCard-BJ8-ywEG.js → SettingCard-BlYmGnxD.js} +1 -1
- package/lib/public/assets/{Table-C7XQ4gI0.js → Table-Dw77VPjI.js} +1 -1
- package/lib/public/assets/{activity-Bv16pTkN.js → activity-W-IYNYOw.js} +1 -1
- package/lib/public/assets/{ai-settings-BpXcUQm3.js → ai-settings-DBYtabv0.js} +1 -1
- package/lib/public/assets/{api-keys-HzfbVxL2.js → api-keys-DTCC8uWq.js} +1 -1
- package/lib/public/assets/{apps-CtyCtiVx.js → apps-BanJSL1m.js} +1 -1
- package/lib/public/assets/{arrow-left-TEnyrpa4.js → arrow-left-DG02ll-2.js} +1 -1
- package/lib/public/assets/{arrow-right-ILl07Dxb.js → arrow-right-DjAmMmYl.js} +1 -1
- package/lib/public/assets/{arrow-up-right-BOGBb0NS.js → arrow-up-right-Dk4zYVvC.js} +1 -1
- package/lib/public/assets/{auth-shell-D3PWn3HG.js → auth-shell-DX60Cnp3.js} +2 -2
- package/lib/public/assets/{builds-page-BsKfrrMf.js → builds-page-DlEfR2IF.js} +1 -1
- package/lib/public/assets/{button-Kv_nqg_I.js → button-CLqhTbpf.js} +1 -1
- package/lib/public/assets/{calendar-DnjXodK3.js → calendar-DbUhR1ky.js} +1 -1
- package/lib/public/assets/{check-DvGXlj1A.js → check-DBN5pEHK.js} +1 -1
- package/lib/public/assets/{chevron-left-CZDYD4H3.js → chevron-left-C_NNcuSy.js} +1 -1
- package/lib/public/assets/{chevron-right-CuPozn4T.js → chevron-right-DSEJHO6A.js} +1 -1
- package/lib/public/assets/{circle-check-CBxV3geR.js → circle-check-DCvFQDU8.js} +1 -1
- package/lib/public/assets/{circle-x-X-nHBZnY.js → circle-x-DozngDyk.js} +1 -1
- package/lib/public/assets/{clock-lLny_RuH.js → clock-rmbxO4wJ.js} +1 -1
- package/lib/public/assets/{copy-CYjhxjiV.js → copy-BaeAL15w.js} +1 -1
- package/lib/public/assets/device-explorer-C4d2_w5A.css +1 -0
- package/lib/public/assets/device-explorer-D7Jz-zbV.js +245 -0
- package/lib/public/assets/{download-2y5oRiK2.js → download-CA52fegs.js} +1 -1
- package/lib/public/assets/{forgot-password-BouiRKS-.js → forgot-password-B9IbsWvo.js} +1 -1
- package/lib/public/assets/{funnel-DozJGkC5.js → funnel-Ba_b7Wqz.js} +1 -1
- package/lib/public/assets/{index-4PUiCXoJ.js → index-c8lodEdC.js} +2 -2
- package/lib/public/assets/{input-Cg5C6lE3.js → input-chJvT8xE.js} +1 -1
- package/lib/public/assets/{keycodes-paeodb9g.js → keycodes-D_POkMkt.js} +1 -1
- package/lib/public/assets/{layers-CVD3KYnj.js → layers-DmlmDics.js} +1 -1
- package/lib/public/assets/{lock-DnyJ9riq.js → lock-DYppIRUo.js} +1 -1
- package/lib/public/assets/{login-BMa0mDmt.js → login-BU4PznoN.js} +1 -1
- package/lib/public/assets/{maintenance-settings-EezUAUBC.js → maintenance-settings-BuAlGIXr.js} +1 -1
- package/lib/public/assets/{mouse-pointer-2-k4GDYFXz.js → mouse-pointer-2-Bf4XBYxV.js} +1 -1
- package/lib/public/assets/{network-ULTYYDWq.js → network-vHrQFUoR.js} +1 -1
- package/lib/public/assets/{overview-DM4y4MtE.js → overview-Bg07_C5h.js} +1 -1
- package/lib/public/assets/{page-header-DgX21Ndv.js → page-header-odsXTF6s.js} +1 -1
- package/lib/public/assets/{plus-DaUKFcvv.js → plus-BxPFTMza.js} +1 -1
- package/lib/public/assets/{profile-page-dcPePTH5.js → profile-page-B8xPVAnw.js} +1 -1
- package/lib/public/assets/{reset-password-Ct5IlHB3.js → reset-password-WDhJisGT.js} +1 -1
- package/lib/public/assets/{runbook-page-C5jLKOAy.js → runbook-page-CCc8c4KT.js} +1 -1
- package/lib/public/assets/{select-HMxRDgs7.js → select-2OHlz_YH.js} +1 -1
- package/lib/public/assets/{selector-detail-page-BhlyEw8l.js → selector-detail-page-Dmmuh77c.js} +1 -1
- package/lib/public/assets/{selector-health-DQlTiNJV.js → selector-health-BpX8aLag.js} +1 -1
- package/lib/public/assets/{selector-health-page-Cd1Mm_DB.js → selector-health-page-CSkHlwY0.js} +1 -1
- package/lib/public/assets/{session-detail-page-BU8Y3HnL.js → session-detail-page-C8YHyGHB.js} +1 -1
- package/lib/public/assets/{settings-k_Xaf5kj.js → settings-DabtQQ3v.js} +1 -1
- package/lib/public/assets/{status-pill-outline-C5m6HFzT.js → status-pill-outline-Ch5V_U-d.js} +1 -1
- package/lib/public/assets/{tablet-2ogUZZch.js → tablet-RsMViU1S.js} +1 -1
- package/lib/public/assets/{teams-C2AfSO30.js → teams-Dr0FkHHP.js} +1 -1
- package/lib/public/assets/{trash-2-BDdM7yPO.js → trash-2-CYQosy3T.js} +1 -1
- package/lib/public/assets/{upload-C1vqAOQK.js → upload-DRltjrDF.js} +1 -1
- package/lib/public/assets/{use-password-reset-mode-Cw6xu19K.js → use-password-reset-mode-DtUlGfEB.js} +1 -1
- package/lib/public/assets/{users-C5jlnASB.js → users-Dm7GOgLZ.js} +1 -1
- package/lib/public/assets/{users-CsatJcoI.js → users-GL3VzMF-.js} +1 -1
- package/lib/public/assets/{video-off-CAdNNByI.js → video-off-DvHtrcFg.js} +1 -1
- package/lib/public/assets/{webhook-settings-D9Yjj-J6.js → webhook-settings-BKJqCNNZ.js} +1 -1
- package/lib/public/assets/{zap-CduRPXBS.js → zap-Dg_oVDEp.js} +1 -1
- package/lib/public/index.html +1 -1
- package/package.json +1 -1
- package/lib/public/assets/device-explorer-CCbOXiB6.css +0 -1
- package/lib/public/assets/device-explorer-ClkV_k7q.js +0 -245
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import{c as X,j as t,r as d,t as gn,R as ni,v as ii,w as je,C as Fs,U as ri,X as H,x as Zt,y as xn,u as Rs,b as oi,z as ai,A as et,S as Ot,B as yn,i as vn,f as is,p as ci,q as Us,D as rs}from"./index-c8lodEdC.js";import{P as li}from"./page-header-odsXTF6s.js";import{B as tt}from"./button-CLqhTbpf.js";import{S as Jt}from"./select-2OHlz_YH.js";import{P as Oe,B as di}from"./BugReportButton-DTEs8tGN.js";import{P as wt,u as Vt,a as vt,b as bn,c as Es,d as ui,D as mi,e as Bs,f as hi,g as st,h as fi,M as wn}from"./Modal-CumsTFc7.js";import{F as Ut}from"./FieldGroup-65VOAW_s.js";import{C as jn}from"./clock-rmbxO4wJ.js";import{P as pi}from"./plus-BxPFTMza.js";import{A as gi}from"./activity-W-IYNYOw.js";import{p as Nn}from"./labels-C21SA4JG.js";import{C as qe}from"./copy-BaeAL15w.js";import{T as Cn,U as xi}from"./upload-DRltjrDF.js";import{f as yi}from"./time-B8FIgwPE.js";import{M as Ws,F as vi}from"./mouse-pointer-2-Bf4XBYxV.js";import{L as bi}from"./layers-DmlmDics.js";import{Z as ys}from"./zap-Dg_oVDEp.js";import{C as Bt}from"./check-DBN5pEHK.js";import{C as Sn}from"./chevron-right-DSEJHO6A.js";import{S as kn,C as wi,H as ji,a as os,A as xt,I as as}from"./keycodes-D_POkMkt.js";import{D as Ni}from"./download-CA52fegs.js";import{T as Wt}from"./trash-2-CYQosy3T.js";import{C as cs}from"./chevron-left-C_NNcuSy.js";import{L as Ci}from"./lock-DYppIRUo.js";import{S as Si}from"./SegmentedControl-Dq0r4nxn.js";import"./utils-CDN07tui.js";/**
|
|
2
|
+
* @license lucide-react v0.555.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const ki=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Ai=X("arrow-down",ki);/**
|
|
7
|
+
* @license lucide-react v0.555.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const Ri=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Ei=X("arrow-up",Ri);/**
|
|
12
|
+
* @license lucide-react v0.555.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const $i=[["path",{d:"M22 14v-4",key:"14q9d5"}],["path",{d:"M6 14v-4",key:"14a6bd"}],["rect",{x:"2",y:"6",width:"16",height:"12",rx:"2",key:"13zb55"}]],Di=X("battery-low",$i);/**
|
|
17
|
+
* @license lucide-react v0.555.0 - ISC
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the ISC license.
|
|
20
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/const Ti=[["path",{d:"M10 17h.01",key:"nbq80n"}],["path",{d:"M10 7v6",key:"nne03l"}],["path",{d:"M14 6h2a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2",key:"1m83kb"}],["path",{d:"M22 14v-4",key:"14q9d5"}],["path",{d:"M6 18H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2",key:"h8lgfh"}]],Ii=X("battery-warning",Ti);/**
|
|
22
|
+
* @license lucide-react v0.555.0 - ISC
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the ISC license.
|
|
25
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/const Li=[["path",{d:"M 22 14 L 22 10",key:"nqc4tb"}],["rect",{x:"2",y:"6",width:"16",height:"12",rx:"2",key:"13zb55"}]],Mi=X("battery",Li);/**
|
|
27
|
+
* @license lucide-react v0.555.0 - ISC
|
|
28
|
+
*
|
|
29
|
+
* This source code is licensed under the ISC license.
|
|
30
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
+
*/const _i=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],Oi=X("box",_i);/**
|
|
32
|
+
* @license lucide-react v0.555.0 - ISC
|
|
33
|
+
*
|
|
34
|
+
* This source code is licensed under the ISC license.
|
|
35
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
+
*/const Pi=[["path",{d:"M16 19h6",key:"xwg31i"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M19 16v6",key:"tddt3s"}],["path",{d:"M21 12.598V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h8.5",key:"1glfrc"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 2v4",key:"1cmpym"}]],zi=X("calendar-plus",Pi);/**
|
|
37
|
+
* @license lucide-react v0.555.0 - ISC
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the ISC license.
|
|
40
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/const Fi=[["path",{d:"m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16",key:"d5nyq2"}],["path",{d:"M22 9v7",key:"pvm9v3"}],["path",{d:"M3.304 13h6.392",key:"1q3zxz"}],["circle",{cx:"18.5",cy:"12.5",r:"3.5",key:"z97x68"}]],Ui=X("case-sensitive",Fi);/**
|
|
42
|
+
* @license lucide-react v0.555.0 - ISC
|
|
43
|
+
*
|
|
44
|
+
* This source code is licensed under the ISC license.
|
|
45
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
+
*/const Bi=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Wi=X("chevron-up",Bi);/**
|
|
47
|
+
* @license lucide-react v0.555.0 - ISC
|
|
48
|
+
*
|
|
49
|
+
* This source code is licensed under the ISC license.
|
|
50
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
51
|
+
*/const Hi=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Vi=X("circle-question-mark",Hi);/**
|
|
52
|
+
* @license lucide-react v0.555.0 - ISC
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the ISC license.
|
|
55
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
+
*/const qi=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]],Xi=X("clipboard",qi);/**
|
|
57
|
+
* @license lucide-react v0.555.0 - ISC
|
|
58
|
+
*
|
|
59
|
+
* This source code is licensed under the ISC license.
|
|
60
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
61
|
+
*/const Ki=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],Hs=X("code-xml",Ki);/**
|
|
62
|
+
* @license lucide-react v0.555.0 - ISC
|
|
63
|
+
*
|
|
64
|
+
* This source code is licensed under the ISC license.
|
|
65
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
66
|
+
*/const Gi=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]],Yi=X("crosshair",Gi);/**
|
|
67
|
+
* @license lucide-react v0.555.0 - ISC
|
|
68
|
+
*
|
|
69
|
+
* This source code is licensed under the ISC license.
|
|
70
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
71
|
+
*/const Zi=[["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"}]],Ji=X("ellipsis",Zi);/**
|
|
72
|
+
* @license lucide-react v0.555.0 - ISC
|
|
73
|
+
*
|
|
74
|
+
* This source code is licensed under the ISC license.
|
|
75
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
76
|
+
*/const Qi=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],er=X("grid-3x3",Qi);/**
|
|
77
|
+
* @license lucide-react v0.555.0 - ISC
|
|
78
|
+
*
|
|
79
|
+
* This source code is licensed under the ISC license.
|
|
80
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
81
|
+
*/const tr=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],sr=X("lightbulb",tr);/**
|
|
82
|
+
* @license lucide-react v0.555.0 - ISC
|
|
83
|
+
*
|
|
84
|
+
* This source code is licensed under the ISC license.
|
|
85
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
86
|
+
*/const nr=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]],ir=X("lock-open",nr);/**
|
|
87
|
+
* @license lucide-react v0.555.0 - ISC
|
|
88
|
+
*
|
|
89
|
+
* This source code is licensed under the ISC license.
|
|
90
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
91
|
+
*/const rr=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],or=X("map-pin",rr);/**
|
|
92
|
+
* @license lucide-react v0.555.0 - ISC
|
|
93
|
+
*
|
|
94
|
+
* This source code is licensed under the ISC license.
|
|
95
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
+
*/const ar=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],cr=X("message-square",ar);/**
|
|
97
|
+
* @license lucide-react v0.555.0 - ISC
|
|
98
|
+
*
|
|
99
|
+
* This source code is licensed under the ISC license.
|
|
100
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
+
*/const lr=[["path",{d:"M18 5h4",key:"1lhgn2"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],dr=X("moon-star",lr);/**
|
|
102
|
+
* @license lucide-react v0.555.0 - ISC
|
|
103
|
+
*
|
|
104
|
+
* This source code is licensed under the ISC license.
|
|
105
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
106
|
+
*/const ur=[["path",{d:"M12 2v20",key:"t6zp3m"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m19 9 3 3-3 3",key:"1mg7y2"}],["path",{d:"M2 12h20",key:"9i4pu4"}],["path",{d:"m5 9-3 3 3 3",key:"j64kie"}],["path",{d:"m9 5 3-3 3 3",key:"l8vdw6"}]],mr=X("move",ur);/**
|
|
107
|
+
* @license lucide-react v0.555.0 - ISC
|
|
108
|
+
*
|
|
109
|
+
* This source code is licensed under the ISC license.
|
|
110
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
111
|
+
*/const hr=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],fr=X("package",hr);/**
|
|
112
|
+
* @license lucide-react v0.555.0 - ISC
|
|
113
|
+
*
|
|
114
|
+
* This source code is licensed under the ISC license.
|
|
115
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
116
|
+
*/const pr=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]],gr=X("panels-top-left",pr);/**
|
|
117
|
+
* @license lucide-react v0.555.0 - ISC
|
|
118
|
+
*
|
|
119
|
+
* This source code is licensed under the ISC license.
|
|
120
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
121
|
+
*/const xr=[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}]],yr=X("rectangle-horizontal",xr);/**
|
|
122
|
+
* @license lucide-react v0.555.0 - ISC
|
|
123
|
+
*
|
|
124
|
+
* This source code is licensed under the ISC license.
|
|
125
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
126
|
+
*/const vr=[["rect",{width:"12",height:"20",x:"6",y:"2",rx:"2",key:"1oxtiu"}]],br=X("rectangle-vertical",vr);/**
|
|
127
|
+
* @license lucide-react v0.555.0 - ISC
|
|
128
|
+
*
|
|
129
|
+
* This source code is licensed under the ISC license.
|
|
130
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
131
|
+
*/const wr=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],yt=X("rotate-cw",wr);/**
|
|
132
|
+
* @license lucide-react v0.555.0 - ISC
|
|
133
|
+
*
|
|
134
|
+
* This source code is licensed under the ISC license.
|
|
135
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
136
|
+
*/const jr=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],Nr=X("scroll-text",jr);/**
|
|
137
|
+
* @license lucide-react v0.555.0 - ISC
|
|
138
|
+
*
|
|
139
|
+
* This source code is licensed under the ISC license.
|
|
140
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
+
*/const Cr=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],Qe=X("shield-alert",Cr);/**
|
|
142
|
+
* @license lucide-react v0.555.0 - ISC
|
|
143
|
+
*
|
|
144
|
+
* This source code is licensed under the ISC license.
|
|
145
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
+
*/const Sr=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],vs=X("sparkles",Sr);/**
|
|
147
|
+
* @license lucide-react v0.555.0 - ISC
|
|
148
|
+
*
|
|
149
|
+
* This source code is licensed under the ISC license.
|
|
150
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
151
|
+
*/const kr=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],Ar=X("tag",kr);/**
|
|
152
|
+
* @license lucide-react v0.555.0 - ISC
|
|
153
|
+
*
|
|
154
|
+
* This source code is licensed under the ISC license.
|
|
155
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
156
|
+
*/const Rr=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],ls=X("target",Rr);/**
|
|
157
|
+
* @license lucide-react v0.555.0 - ISC
|
|
158
|
+
*
|
|
159
|
+
* This source code is licensed under the ISC license.
|
|
160
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
+
*/const Er=[["path",{d:"m16 16-3 3 3 3",key:"117b85"}],["path",{d:"M3 12h14.5a1 1 0 0 1 0 7H13",key:"18xa6z"}],["path",{d:"M3 19h6",key:"1ygdsz"}],["path",{d:"M3 5h18",key:"1u36vt"}]],$r=X("text-wrap",Er);/**
|
|
162
|
+
* @license lucide-react v0.555.0 - ISC
|
|
163
|
+
*
|
|
164
|
+
* This source code is licensed under the ISC license.
|
|
165
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
166
|
+
*/const Dr=[["path",{d:"M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z",key:"17jzev"}]],Tr=X("thermometer",Dr);/**
|
|
167
|
+
* @license lucide-react v0.555.0 - ISC
|
|
168
|
+
*
|
|
169
|
+
* This source code is licensed under the ISC license.
|
|
170
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
+
*/const Ir=[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"M2 14h20",key:"myj16y"}],["path",{d:"M12 20v-6",key:"1rm09r"}]],Vs=X("touchpad",Ir);/**
|
|
172
|
+
* @license lucide-react v0.555.0 - ISC
|
|
173
|
+
*
|
|
174
|
+
* This source code is licensed under the ISC license.
|
|
175
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
176
|
+
*/const Lr=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}]],Mr=X("volume-1",Lr);/**
|
|
177
|
+
* @license lucide-react v0.555.0 - ISC
|
|
178
|
+
*
|
|
179
|
+
* This source code is licensed under the ISC license.
|
|
180
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
181
|
+
*/const _r=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]],Or=X("volume-2",_r);/**
|
|
182
|
+
* @license lucide-react v0.555.0 - ISC
|
|
183
|
+
*
|
|
184
|
+
* This source code is licensed under the ISC license.
|
|
185
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
186
|
+
*/const Pr=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],zr=X("wifi",Pr);function Fr(e){if(typeof e!="number")throw new TypeError("Expected a number");const s=e>0?Math.floor:Math.ceil;return{days:s(e/864e5),hours:s(e/36e5)%24,minutes:s(e/6e4)%60,seconds:s(e/1e3)%60,milliseconds:s(e)%1e3,microseconds:s(e*1e3)%1e3,nanoseconds:s(e*1e6)%1e3}}const Ur=(e,s)=>s===1?e:`${e}s`,Br=1e-7;function $s(e,s={}){if(!Number.isFinite(e))throw new TypeError("Expected a finite number");s.colonNotation&&(s.compact=!1,s.formatSubMilliseconds=!1,s.separateMilliseconds=!1,s.verbose=!1),s.compact&&(s.secondsDecimalDigits=0,s.millisecondsDecimalDigits=0);const n=[],i=(c,l)=>{const o=Math.floor(c*10**l+Br);return(Math.round(o)/10**l).toFixed(l)},r=(c,l,o,u)=>{if((n.length===0||!s.colonNotation)&&c===0&&!(s.colonNotation&&o==="m"))return;u=(u||c||"0").toString();let m,f;if(s.colonNotation){m=n.length>0?":":"",f="";const p=u.includes(".")?u.split(".")[0].length:u.length,y=n.length>0?2:1;u="0".repeat(Math.max(0,y-p))+u}else m="",f=s.verbose?" "+Ur(l,c):o;n.push(m+u+f)},a=Fr(e);if(r(Math.trunc(a.days/365),"year","y"),r(a.days%365,"day","d"),r(a.hours,"hour","h"),r(a.minutes,"minute","m"),s.separateMilliseconds||s.formatSubMilliseconds||!s.colonNotation&&e<1e3)if(r(a.seconds,"second","s"),s.formatSubMilliseconds)r(a.milliseconds,"millisecond","ms"),r(a.microseconds,"microsecond","µs"),r(a.nanoseconds,"nanosecond","ns");else{const c=a.milliseconds+a.microseconds/1e3+a.nanoseconds/1e6,l=typeof s.millisecondsDecimalDigits=="number"?s.millisecondsDecimalDigits:0,o=c>=1?Math.round(c):Math.ceil(c),u=l?c.toFixed(l):o;r(Number.parseFloat(u),"millisecond","ms",u)}else{const c=e/1e3%60,l=typeof s.secondsDecimalDigits=="number"?s.secondsDecimalDigits:1,o=i(c,l),u=s.keepDecimalsOnWholeSeconds?o:o.replace(/\.0+$/,"");r(Number.parseFloat(u),"second","s",u)}if(n.length===0)return"0"+(s.verbose?" milliseconds":"ms");if(s.compact)return n[0];if(typeof s.unitCount=="number"){const c=s.colonNotation?"":" ";return n.slice(0,Math.max(s.unitCount,1)).join(c)}return s.colonNotation?n.join(""):n.join(" ")}const Wr=({kind:e,size:s=6,className:n})=>t.jsx("span",{className:`status-dot status-dot-${e}${n?" "+n:""}`,style:{width:s,height:s},"aria-hidden":!0}),Hr=({kind:e,showDot:s,children:n})=>t.jsxs("span",{className:`status-code status-code-${e}`,children:[s&&t.jsx(Wr,{kind:e}),t.jsx("span",{className:"status-code-label",children:Vr(String(n))})]});function Vr(e){const s=e.trim().toLowerCase();return s.charAt(0).toUpperCase()+s.slice(1)}const ds=({label:e,value:s,mono:n,valueClassName:i})=>t.jsxs("div",{className:"kv-row",children:[t.jsx("span",{className:"kv-label",children:e}),t.jsx("span",{className:`kv-value${n?" kv-value-mono":""}${i?" "+i:""}`,children:s})]}),qr=["top","right","bottom","left"],Pe=Math.min,le=Math.max,qt=Math.round,Pt=Math.floor,Ce=e=>({x:e,y:e}),Xr={left:"right",right:"left",bottom:"top",top:"bottom"};function bs(e,s,n){return le(e,Pe(s,n))}function $e(e,s){return typeof e=="function"?e(s):e}function De(e){return e.split("-")[0]}function ot(e){return e.split("-")[1]}function Ds(e){return e==="x"?"y":"x"}function Ts(e){return e==="y"?"height":"width"}function Ne(e){const s=e[0];return s==="t"||s==="b"?"y":"x"}function Is(e){return Ds(Ne(e))}function Kr(e,s,n){n===void 0&&(n=!1);const i=ot(e),r=Is(e),a=Ts(r);let c=r==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return s.reference[a]>s.floating[a]&&(c=Xt(c)),[c,Xt(c)]}function Gr(e){const s=Xt(e);return[ws(e),s,ws(s)]}function ws(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const qs=["left","right"],Xs=["right","left"],Yr=["top","bottom"],Zr=["bottom","top"];function Jr(e,s,n){switch(e){case"top":case"bottom":return n?s?Xs:qs:s?qs:Xs;case"left":case"right":return s?Yr:Zr;default:return[]}}function Qr(e,s,n,i){const r=ot(e);let a=Jr(De(e),n==="start",i);return r&&(a=a.map(c=>c+"-"+r),s&&(a=a.concat(a.map(ws)))),a}function Xt(e){const s=De(e);return Xr[s]+e.slice(s.length)}function eo(e){return{top:0,right:0,bottom:0,left:0,...e}}function An(e){return typeof e!="number"?eo(e):{top:e,right:e,bottom:e,left:e}}function Kt(e){const{x:s,y:n,width:i,height:r}=e;return{width:i,height:r,top:n,left:s,right:s+i,bottom:n+r,x:s,y:n}}function Ks(e,s,n){let{reference:i,floating:r}=e;const a=Ne(s),c=Is(s),l=Ts(c),o=De(s),u=a==="y",m=i.x+i.width/2-r.width/2,f=i.y+i.height/2-r.height/2,p=i[l]/2-r[l]/2;let y;switch(o){case"top":y={x:m,y:i.y-r.height};break;case"bottom":y={x:m,y:i.y+i.height};break;case"right":y={x:i.x+i.width,y:f};break;case"left":y={x:i.x-r.width,y:f};break;default:y={x:i.x,y:i.y}}switch(ot(s)){case"start":y[c]-=p*(n&&u?-1:1);break;case"end":y[c]+=p*(n&&u?-1:1);break}return y}async function to(e,s){var n;s===void 0&&(s={});const{x:i,y:r,platform:a,rects:c,elements:l,strategy:o}=e,{boundary:u="clippingAncestors",rootBoundary:m="viewport",elementContext:f="floating",altBoundary:p=!1,padding:y=0}=$e(s,e),g=An(y),v=l[p?f==="floating"?"reference":"floating":f],k=Kt(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(v)))==null||n?v:v.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(l.floating)),boundary:u,rootBoundary:m,strategy:o})),N=f==="floating"?{x:i,y:r,width:c.floating.width,height:c.floating.height}:c.reference,j=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l.floating)),w=await(a.isElement==null?void 0:a.isElement(j))?await(a.getScale==null?void 0:a.getScale(j))||{x:1,y:1}:{x:1,y:1},D=Kt(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:N,offsetParent:j,strategy:o}):N);return{top:(k.top-D.top+g.top)/w.y,bottom:(D.bottom-k.bottom+g.bottom)/w.y,left:(k.left-D.left+g.left)/w.x,right:(D.right-k.right+g.right)/w.x}}const so=50,no=async(e,s,n)=>{const{placement:i="bottom",strategy:r="absolute",middleware:a=[],platform:c}=n,l=c.detectOverflow?c:{...c,detectOverflow:to},o=await(c.isRTL==null?void 0:c.isRTL(s));let u=await c.getElementRects({reference:e,floating:s,strategy:r}),{x:m,y:f}=Ks(u,i,o),p=i,y=0;const g={};for(let b=0;b<a.length;b++){const v=a[b];if(!v)continue;const{name:k,fn:N}=v,{x:j,y:w,data:D,reset:$}=await N({x:m,y:f,initialPlacement:i,placement:p,strategy:r,middlewareData:g,rects:u,platform:l,elements:{reference:e,floating:s}});m=j??m,f=w??f,g[k]={...g[k],...D},$&&y<so&&(y++,typeof $=="object"&&($.placement&&(p=$.placement),$.rects&&(u=$.rects===!0?await c.getElementRects({reference:e,floating:s,strategy:r}):$.rects),{x:m,y:f}=Ks(u,p,o)),b=-1)}return{x:m,y:f,placement:p,strategy:r,middlewareData:g}},io=e=>({name:"arrow",options:e,async fn(s){const{x:n,y:i,placement:r,rects:a,platform:c,elements:l,middlewareData:o}=s,{element:u,padding:m=0}=$e(e,s)||{};if(u==null)return{};const f=An(m),p={x:n,y:i},y=Is(r),g=Ts(y),b=await c.getDimensions(u),v=y==="y",k=v?"top":"left",N=v?"bottom":"right",j=v?"clientHeight":"clientWidth",w=a.reference[g]+a.reference[y]-p[y]-a.floating[g],D=p[y]-a.reference[y],$=await(c.getOffsetParent==null?void 0:c.getOffsetParent(u));let T=$?$[j]:0;(!T||!await(c.isElement==null?void 0:c.isElement($)))&&(T=l.floating[j]||a.floating[g]);const I=w/2-D/2,F=T/2-b[g]/2-1,O=Pe(f[k],F),_=Pe(f[N],F),U=O,W=T-b[g]-_,q=T/2-b[g]/2+I,Z=bs(U,q,W),V=!o.arrow&&ot(r)!=null&&q!==Z&&a.reference[g]/2-(q<U?O:_)-b[g]/2<0,B=V?q<U?q-U:q-W:0;return{[y]:p[y]+B,data:{[y]:Z,centerOffset:q-Z-B,...V&&{alignmentOffset:B}},reset:V}}}),ro=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(s){var n,i;const{placement:r,middlewareData:a,rects:c,initialPlacement:l,platform:o,elements:u}=s,{mainAxis:m=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:b=!0,...v}=$e(e,s);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const k=De(r),N=Ne(l),j=De(l)===l,w=await(o.isRTL==null?void 0:o.isRTL(u.floating)),D=p||(j||!b?[Xt(l)]:Gr(l)),$=g!=="none";!p&&$&&D.push(...Qr(l,b,g,w));const T=[l,...D],I=await o.detectOverflow(s,v),F=[];let O=((i=a.flip)==null?void 0:i.overflows)||[];if(m&&F.push(I[k]),f){const q=Kr(r,c,w);F.push(I[q[0]],I[q[1]])}if(O=[...O,{placement:r,overflows:F}],!F.every(q=>q<=0)){var _,U;const q=(((_=a.flip)==null?void 0:_.index)||0)+1,Z=T[q];if(Z&&(!(f==="alignment"?N!==Ne(Z):!1)||O.every(R=>Ne(R.placement)===N?R.overflows[0]>0:!0)))return{data:{index:q,overflows:O},reset:{placement:Z}};let V=(U=O.filter(B=>B.overflows[0]<=0).sort((B,R)=>B.overflows[1]-R.overflows[1])[0])==null?void 0:U.placement;if(!V)switch(y){case"bestFit":{var W;const B=(W=O.filter(R=>{if($){const C=Ne(R.placement);return C===N||C==="y"}return!0}).map(R=>[R.placement,R.overflows.filter(C=>C>0).reduce((C,ne)=>C+ne,0)]).sort((R,C)=>R[1]-C[1])[0])==null?void 0:W[0];B&&(V=B);break}case"initialPlacement":V=l;break}if(r!==V)return{reset:{placement:V}}}return{}}}};function Gs(e,s){return{top:e.top-s.height,right:e.right-s.width,bottom:e.bottom-s.height,left:e.left-s.width}}function Ys(e){return qr.some(s=>e[s]>=0)}const oo=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(s){const{rects:n,platform:i}=s,{strategy:r="referenceHidden",...a}=$e(e,s);switch(r){case"referenceHidden":{const c=await i.detectOverflow(s,{...a,elementContext:"reference"}),l=Gs(c,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:Ys(l)}}}case"escaped":{const c=await i.detectOverflow(s,{...a,altBoundary:!0}),l=Gs(c,n.floating);return{data:{escapedOffsets:l,escaped:Ys(l)}}}default:return{}}}}},Rn=new Set(["left","top"]);async function ao(e,s){const{placement:n,platform:i,elements:r}=e,a=await(i.isRTL==null?void 0:i.isRTL(r.floating)),c=De(n),l=ot(n),o=Ne(n)==="y",u=Rn.has(c)?-1:1,m=a&&o?-1:1,f=$e(s,e);let{mainAxis:p,crossAxis:y,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof g=="number"&&(y=l==="end"?g*-1:g),o?{x:y*m,y:p*u}:{x:p*u,y:y*m}}const co=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(s){var n,i;const{x:r,y:a,placement:c,middlewareData:l}=s,o=await ao(s,e);return c===((n=l.offset)==null?void 0:n.placement)&&(i=l.arrow)!=null&&i.alignmentOffset?{}:{x:r+o.x,y:a+o.y,data:{...o,placement:c}}}}},lo=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(s){const{x:n,y:i,placement:r,platform:a}=s,{mainAxis:c=!0,crossAxis:l=!1,limiter:o={fn:k=>{let{x:N,y:j}=k;return{x:N,y:j}}},...u}=$e(e,s),m={x:n,y:i},f=await a.detectOverflow(s,u),p=Ne(De(r)),y=Ds(p);let g=m[y],b=m[p];if(c){const k=y==="y"?"top":"left",N=y==="y"?"bottom":"right",j=g+f[k],w=g-f[N];g=bs(j,g,w)}if(l){const k=p==="y"?"top":"left",N=p==="y"?"bottom":"right",j=b+f[k],w=b-f[N];b=bs(j,b,w)}const v=o.fn({...s,[y]:g,[p]:b});return{...v,data:{x:v.x-n,y:v.y-i,enabled:{[y]:c,[p]:l}}}}}},uo=function(e){return e===void 0&&(e={}),{options:e,fn(s){const{x:n,y:i,placement:r,rects:a,middlewareData:c}=s,{offset:l=0,mainAxis:o=!0,crossAxis:u=!0}=$e(e,s),m={x:n,y:i},f=Ne(r),p=Ds(f);let y=m[p],g=m[f];const b=$e(l,s),v=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(o){const j=p==="y"?"height":"width",w=a.reference[p]-a.floating[j]+v.mainAxis,D=a.reference[p]+a.reference[j]-v.mainAxis;y<w?y=w:y>D&&(y=D)}if(u){var k,N;const j=p==="y"?"width":"height",w=Rn.has(De(r)),D=a.reference[f]-a.floating[j]+(w&&((k=c.offset)==null?void 0:k[f])||0)+(w?0:v.crossAxis),$=a.reference[f]+a.reference[j]+(w?0:((N=c.offset)==null?void 0:N[f])||0)-(w?v.crossAxis:0);g<D?g=D:g>$&&(g=$)}return{[p]:y,[f]:g}}}},mo=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(s){var n,i;const{placement:r,rects:a,platform:c,elements:l}=s,{apply:o=()=>{},...u}=$e(e,s),m=await c.detectOverflow(s,u),f=De(r),p=ot(r),y=Ne(r)==="y",{width:g,height:b}=a.floating;let v,k;f==="top"||f==="bottom"?(v=f,k=p===(await(c.isRTL==null?void 0:c.isRTL(l.floating))?"start":"end")?"left":"right"):(k=f,v=p==="end"?"top":"bottom");const N=b-m.top-m.bottom,j=g-m.left-m.right,w=Pe(b-m[v],N),D=Pe(g-m[k],j),$=!s.middlewareData.shift;let T=w,I=D;if((n=s.middlewareData.shift)!=null&&n.enabled.x&&(I=j),(i=s.middlewareData.shift)!=null&&i.enabled.y&&(T=N),$&&!p){const O=le(m.left,0),_=le(m.right,0),U=le(m.top,0),W=le(m.bottom,0);y?I=g-2*(O!==0||_!==0?O+_:le(m.left,m.right)):T=b-2*(U!==0||W!==0?U+W:le(m.top,m.bottom))}await o({...s,availableWidth:I,availableHeight:T});const F=await c.getDimensions(l.floating);return g!==F.width||b!==F.height?{reset:{rects:!0}}:{}}}};function Qt(){return typeof window<"u"}function at(e){return En(e)?(e.nodeName||"").toLowerCase():"#document"}function de(e){var s;return(e==null||(s=e.ownerDocument)==null?void 0:s.defaultView)||window}function Se(e){var s;return(s=(En(e)?e.ownerDocument:e.document)||window.document)==null?void 0:s.documentElement}function En(e){return Qt()?e instanceof Node||e instanceof de(e).Node:!1}function xe(e){return Qt()?e instanceof Element||e instanceof de(e).Element:!1}function Ie(e){return Qt()?e instanceof HTMLElement||e instanceof de(e).HTMLElement:!1}function Zs(e){return!Qt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof de(e).ShadowRoot}function jt(e){const{overflow:s,overflowX:n,overflowY:i,display:r}=ye(e);return/auto|scroll|overlay|hidden|clip/.test(s+i+n)&&r!=="inline"&&r!=="contents"}function ho(e){return/^(table|td|th)$/.test(at(e))}function es(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const fo=/transform|translate|scale|rotate|perspective|filter/,po=/paint|layout|strict|content/,Ve=e=>!!e&&e!=="none";let us;function Ls(e){const s=xe(e)?ye(e):e;return Ve(s.transform)||Ve(s.translate)||Ve(s.scale)||Ve(s.rotate)||Ve(s.perspective)||!Ms()&&(Ve(s.backdropFilter)||Ve(s.filter))||fo.test(s.willChange||"")||po.test(s.contain||"")}function go(e){let s=ze(e);for(;Ie(s)&&!it(s);){if(Ls(s))return s;if(es(s))return null;s=ze(s)}return null}function Ms(){return us==null&&(us=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),us}function it(e){return/^(html|body|#document)$/.test(at(e))}function ye(e){return de(e).getComputedStyle(e)}function ts(e){return xe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ze(e){if(at(e)==="html")return e;const s=e.assignedSlot||e.parentNode||Zs(e)&&e.host||Se(e);return Zs(s)?s.host:s}function $n(e){const s=ze(e);return it(s)?e.ownerDocument?e.ownerDocument.body:e.body:Ie(s)&&jt(s)?s:$n(s)}function bt(e,s,n){var i;s===void 0&&(s=[]),n===void 0&&(n=!0);const r=$n(e),a=r===((i=e.ownerDocument)==null?void 0:i.body),c=de(r);if(a){const l=js(c);return s.concat(c,c.visualViewport||[],jt(r)?r:[],l&&n?bt(l):[])}else return s.concat(r,bt(r,[],n))}function js(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Dn(e){const s=ye(e);let n=parseFloat(s.width)||0,i=parseFloat(s.height)||0;const r=Ie(e),a=r?e.offsetWidth:n,c=r?e.offsetHeight:i,l=qt(n)!==a||qt(i)!==c;return l&&(n=a,i=c),{width:n,height:i,$:l}}function _s(e){return xe(e)?e:e.contextElement}function nt(e){const s=_s(e);if(!Ie(s))return Ce(1);const n=s.getBoundingClientRect(),{width:i,height:r,$:a}=Dn(s);let c=(a?qt(n.width):n.width)/i,l=(a?qt(n.height):n.height)/r;return(!c||!Number.isFinite(c))&&(c=1),(!l||!Number.isFinite(l))&&(l=1),{x:c,y:l}}const xo=Ce(0);function Tn(e){const s=de(e);return!Ms()||!s.visualViewport?xo:{x:s.visualViewport.offsetLeft,y:s.visualViewport.offsetTop}}function yo(e,s,n){return s===void 0&&(s=!1),!n||s&&n!==de(e)?!1:s}function Xe(e,s,n,i){s===void 0&&(s=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),a=_s(e);let c=Ce(1);s&&(i?xe(i)&&(c=nt(i)):c=nt(e));const l=yo(a,n,i)?Tn(a):Ce(0);let o=(r.left+l.x)/c.x,u=(r.top+l.y)/c.y,m=r.width/c.x,f=r.height/c.y;if(a){const p=de(a),y=i&&xe(i)?de(i):i;let g=p,b=js(g);for(;b&&i&&y!==g;){const v=nt(b),k=b.getBoundingClientRect(),N=ye(b),j=k.left+(b.clientLeft+parseFloat(N.paddingLeft))*v.x,w=k.top+(b.clientTop+parseFloat(N.paddingTop))*v.y;o*=v.x,u*=v.y,m*=v.x,f*=v.y,o+=j,u+=w,g=de(b),b=js(g)}}return Kt({width:m,height:f,x:o,y:u})}function ss(e,s){const n=ts(e).scrollLeft;return s?s.left+n:Xe(Se(e)).left+n}function In(e,s){const n=e.getBoundingClientRect(),i=n.left+s.scrollLeft-ss(e,n),r=n.top+s.scrollTop;return{x:i,y:r}}function vo(e){let{elements:s,rect:n,offsetParent:i,strategy:r}=e;const a=r==="fixed",c=Se(i),l=s?es(s.floating):!1;if(i===c||l&&a)return n;let o={scrollLeft:0,scrollTop:0},u=Ce(1);const m=Ce(0),f=Ie(i);if((f||!f&&!a)&&((at(i)!=="body"||jt(c))&&(o=ts(i)),f)){const y=Xe(i);u=nt(i),m.x=y.x+i.clientLeft,m.y=y.y+i.clientTop}const p=c&&!f&&!a?In(c,o):Ce(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-o.scrollLeft*u.x+m.x+p.x,y:n.y*u.y-o.scrollTop*u.y+m.y+p.y}}function bo(e){return Array.from(e.getClientRects())}function wo(e){const s=Se(e),n=ts(e),i=e.ownerDocument.body,r=le(s.scrollWidth,s.clientWidth,i.scrollWidth,i.clientWidth),a=le(s.scrollHeight,s.clientHeight,i.scrollHeight,i.clientHeight);let c=-n.scrollLeft+ss(e);const l=-n.scrollTop;return ye(i).direction==="rtl"&&(c+=le(s.clientWidth,i.clientWidth)-r),{width:r,height:a,x:c,y:l}}const Js=25;function jo(e,s){const n=de(e),i=Se(e),r=n.visualViewport;let a=i.clientWidth,c=i.clientHeight,l=0,o=0;if(r){a=r.width,c=r.height;const m=Ms();(!m||m&&s==="fixed")&&(l=r.offsetLeft,o=r.offsetTop)}const u=ss(i);if(u<=0){const m=i.ownerDocument,f=m.body,p=getComputedStyle(f),y=m.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,g=Math.abs(i.clientWidth-f.clientWidth-y);g<=Js&&(a-=g)}else u<=Js&&(a+=u);return{width:a,height:c,x:l,y:o}}function No(e,s){const n=Xe(e,!0,s==="fixed"),i=n.top+e.clientTop,r=n.left+e.clientLeft,a=Ie(e)?nt(e):Ce(1),c=e.clientWidth*a.x,l=e.clientHeight*a.y,o=r*a.x,u=i*a.y;return{width:c,height:l,x:o,y:u}}function Qs(e,s,n){let i;if(s==="viewport")i=jo(e,n);else if(s==="document")i=wo(Se(e));else if(xe(s))i=No(s,n);else{const r=Tn(e);i={x:s.x-r.x,y:s.y-r.y,width:s.width,height:s.height}}return Kt(i)}function Ln(e,s){const n=ze(e);return n===s||!xe(n)||it(n)?!1:ye(n).position==="fixed"||Ln(n,s)}function Co(e,s){const n=s.get(e);if(n)return n;let i=bt(e,[],!1).filter(l=>xe(l)&&at(l)!=="body"),r=null;const a=ye(e).position==="fixed";let c=a?ze(e):e;for(;xe(c)&&!it(c);){const l=ye(c),o=Ls(c);!o&&l.position==="fixed"&&(r=null),(a?!o&&!r:!o&&l.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||jt(c)&&!o&&Ln(e,c))?i=i.filter(m=>m!==c):r=l,c=ze(c)}return s.set(e,i),i}function So(e){let{element:s,boundary:n,rootBoundary:i,strategy:r}=e;const c=[...n==="clippingAncestors"?es(s)?[]:Co(s,this._c):[].concat(n),i],l=Qs(s,c[0],r);let o=l.top,u=l.right,m=l.bottom,f=l.left;for(let p=1;p<c.length;p++){const y=Qs(s,c[p],r);o=le(y.top,o),u=Pe(y.right,u),m=Pe(y.bottom,m),f=le(y.left,f)}return{width:u-f,height:m-o,x:f,y:o}}function ko(e){const{width:s,height:n}=Dn(e);return{width:s,height:n}}function Ao(e,s,n){const i=Ie(s),r=Se(s),a=n==="fixed",c=Xe(e,!0,a,s);let l={scrollLeft:0,scrollTop:0};const o=Ce(0);function u(){o.x=ss(r)}if(i||!i&&!a)if((at(s)!=="body"||jt(r))&&(l=ts(s)),i){const y=Xe(s,!0,a,s);o.x=y.x+s.clientLeft,o.y=y.y+s.clientTop}else r&&u();a&&!i&&r&&u();const m=r&&!i&&!a?In(r,l):Ce(0),f=c.left+l.scrollLeft-o.x-m.x,p=c.top+l.scrollTop-o.y-m.y;return{x:f,y:p,width:c.width,height:c.height}}function ms(e){return ye(e).position==="static"}function en(e,s){if(!Ie(e)||ye(e).position==="fixed")return null;if(s)return s(e);let n=e.offsetParent;return Se(e)===n&&(n=n.ownerDocument.body),n}function Mn(e,s){const n=de(e);if(es(e))return n;if(!Ie(e)){let r=ze(e);for(;r&&!it(r);){if(xe(r)&&!ms(r))return r;r=ze(r)}return n}let i=en(e,s);for(;i&&ho(i)&&ms(i);)i=en(i,s);return i&&it(i)&&ms(i)&&!Ls(i)?n:i||go(e)||n}const Ro=async function(e){const s=this.getOffsetParent||Mn,n=this.getDimensions,i=await n(e.floating);return{reference:Ao(e.reference,await s(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function Eo(e){return ye(e).direction==="rtl"}const $o={convertOffsetParentRelativeRectToViewportRelativeRect:vo,getDocumentElement:Se,getClippingRect:So,getOffsetParent:Mn,getElementRects:Ro,getClientRects:bo,getDimensions:ko,getScale:nt,isElement:xe,isRTL:Eo};function _n(e,s){return e.x===s.x&&e.y===s.y&&e.width===s.width&&e.height===s.height}function Do(e,s){let n=null,i;const r=Se(e);function a(){var l;clearTimeout(i),(l=n)==null||l.disconnect(),n=null}function c(l,o){l===void 0&&(l=!1),o===void 0&&(o=1),a();const u=e.getBoundingClientRect(),{left:m,top:f,width:p,height:y}=u;if(l||s(),!p||!y)return;const g=Pt(f),b=Pt(r.clientWidth-(m+p)),v=Pt(r.clientHeight-(f+y)),k=Pt(m),j={rootMargin:-g+"px "+-b+"px "+-v+"px "+-k+"px",threshold:le(0,Pe(1,o))||1};let w=!0;function D($){const T=$[0].intersectionRatio;if(T!==o){if(!w)return c();T?c(!1,T):i=setTimeout(()=>{c(!1,1e-7)},1e3)}T===1&&!_n(u,e.getBoundingClientRect())&&c(),w=!1}try{n=new IntersectionObserver(D,{...j,root:r.ownerDocument})}catch{n=new IntersectionObserver(D,j)}n.observe(e)}return c(!0),a}function To(e,s,n,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:a=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:o=!1}=i,u=_s(e),m=r||a?[...u?bt(u):[],...s?bt(s):[]]:[];m.forEach(k=>{r&&k.addEventListener("scroll",n,{passive:!0}),a&&k.addEventListener("resize",n)});const f=u&&l?Do(u,n):null;let p=-1,y=null;c&&(y=new ResizeObserver(k=>{let[N]=k;N&&N.target===u&&y&&s&&(y.unobserve(s),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var j;(j=y)==null||j.observe(s)})),n()}),u&&!o&&y.observe(u),s&&y.observe(s));let g,b=o?Xe(e):null;o&&v();function v(){const k=Xe(e);b&&!_n(b,k)&&n(),b=k,g=requestAnimationFrame(v)}return n(),()=>{var k;m.forEach(N=>{r&&N.removeEventListener("scroll",n),a&&N.removeEventListener("resize",n)}),f==null||f(),(k=y)==null||k.disconnect(),y=null,o&&cancelAnimationFrame(g)}}const Io=co,Lo=lo,Mo=ro,_o=mo,Oo=oo,tn=io,Po=uo,zo=(e,s,n)=>{const i=new Map,r={platform:$o,...n},a={...r.platform,_c:i};return no(e,s,{...r,platform:a})};var Fo=typeof document<"u",Uo=function(){},Ht=Fo?d.useLayoutEffect:Uo;function Gt(e,s){if(e===s)return!0;if(typeof e!=typeof s)return!1;if(typeof e=="function"&&e.toString()===s.toString())return!0;let n,i,r;if(e&&s&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==s.length)return!1;for(i=n;i--!==0;)if(!Gt(e[i],s[i]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(s).length)return!1;for(i=n;i--!==0;)if(!{}.hasOwnProperty.call(s,r[i]))return!1;for(i=n;i--!==0;){const a=r[i];if(!(a==="_owner"&&e.$$typeof)&&!Gt(e[a],s[a]))return!1}return!0}return e!==e&&s!==s}function On(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function sn(e,s){const n=On(e);return Math.round(s*n)/n}function hs(e){const s=d.useRef(e);return Ht(()=>{s.current=e}),s}function Bo(e){e===void 0&&(e={});const{placement:s="bottom",strategy:n="absolute",middleware:i=[],platform:r,elements:{reference:a,floating:c}={},transform:l=!0,whileElementsMounted:o,open:u}=e,[m,f]=d.useState({x:0,y:0,strategy:n,placement:s,middlewareData:{},isPositioned:!1}),[p,y]=d.useState(i);Gt(p,i)||y(i);const[g,b]=d.useState(null),[v,k]=d.useState(null),N=d.useCallback(R=>{R!==$.current&&($.current=R,b(R))},[]),j=d.useCallback(R=>{R!==T.current&&(T.current=R,k(R))},[]),w=a||g,D=c||v,$=d.useRef(null),T=d.useRef(null),I=d.useRef(m),F=o!=null,O=hs(o),_=hs(r),U=hs(u),W=d.useCallback(()=>{if(!$.current||!T.current)return;const R={placement:s,strategy:n,middleware:p};_.current&&(R.platform=_.current),zo($.current,T.current,R).then(C=>{const ne={...C,isPositioned:U.current!==!1};q.current&&!Gt(I.current,ne)&&(I.current=ne,gn.flushSync(()=>{f(ne)}))})},[p,s,n,_,U]);Ht(()=>{u===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,f(R=>({...R,isPositioned:!1})))},[u]);const q=d.useRef(!1);Ht(()=>(q.current=!0,()=>{q.current=!1}),[]),Ht(()=>{if(w&&($.current=w),D&&(T.current=D),w&&D){if(O.current)return O.current(w,D,W);W()}},[w,D,W,O,F]);const Z=d.useMemo(()=>({reference:$,floating:T,setReference:N,setFloating:j}),[N,j]),V=d.useMemo(()=>({reference:w,floating:D}),[w,D]),B=d.useMemo(()=>{const R={position:n,left:0,top:0};if(!V.floating)return R;const C=sn(V.floating,m.x),ne=sn(V.floating,m.y);return l?{...R,transform:"translate("+C+"px, "+ne+"px)",...On(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:C,top:ne}},[n,l,V.floating,m.x,m.y]);return d.useMemo(()=>({...m,update:W,refs:Z,elements:V,floatingStyles:B}),[m,W,Z,V,B])}const Wo=e=>{function s(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:i,padding:r}=typeof e=="function"?e(n):e;return i&&s(i)?i.current!=null?tn({element:i.current,padding:r}).fn(n):{}:i?tn({element:i,padding:r}).fn(n):{}}}},Ho=(e,s)=>{const n=Io(e);return{name:n.name,fn:n.fn,options:[e,s]}},Vo=(e,s)=>{const n=Lo(e);return{name:n.name,fn:n.fn,options:[e,s]}},qo=(e,s)=>({fn:Po(e).fn,options:[e,s]}),Xo=(e,s)=>{const n=Mo(e);return{name:n.name,fn:n.fn,options:[e,s]}},Ko=(e,s)=>{const n=_o(e);return{name:n.name,fn:n.fn,options:[e,s]}},Go=(e,s)=>{const n=Oo(e);return{name:n.name,fn:n.fn,options:[e,s]}},Yo=(e,s)=>{const n=Wo(e);return{name:n.name,fn:n.fn,options:[e,s]}};var Zo="Arrow",Pn=d.forwardRef((e,s)=>{const{children:n,width:i=10,height:r=5,...a}=e;return t.jsx(wt.svg,{...a,ref:s,width:i,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:t.jsx("polygon",{points:"0,0 30,0 15,10"})})});Pn.displayName=Zo;var Jo=Pn;function Qo(e){const[s,n]=d.useState(void 0);return Vt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const i=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const a=r[0];let c,l;if("borderBoxSize"in a){const o=a.borderBoxSize,u=Array.isArray(o)?o[0]:o;c=u.inlineSize,l=u.blockSize}else c=e.offsetWidth,l=e.offsetHeight;n({width:c,height:l})});return i.observe(e,{box:"border-box"}),()=>i.unobserve(e)}else n(void 0)},[e]),s}var Os="Popper",[zn]=Es(Os),[ea,Fn]=zn(Os),Un=e=>{const{__scopePopper:s,children:n}=e,[i,r]=d.useState(null);return t.jsx(ea,{scope:s,anchor:i,onAnchorChange:r,children:n})};Un.displayName=Os;var Bn="PopperAnchor",Wn=d.forwardRef((e,s)=>{const{__scopePopper:n,virtualRef:i,...r}=e,a=Fn(Bn,n),c=d.useRef(null),l=vt(s,c),o=d.useRef(null);return d.useEffect(()=>{const u=o.current;o.current=(i==null?void 0:i.current)||c.current,u!==o.current&&a.onAnchorChange(o.current)}),i?null:t.jsx(wt.div,{...r,ref:l})});Wn.displayName=Bn;var Ps="PopperContent",[ta,sa]=zn(Ps),Hn=d.forwardRef((e,s)=>{var P,J,se,re,he,Le;const{__scopePopper:n,side:i="bottom",sideOffset:r=0,align:a="center",alignOffset:c=0,arrowPadding:l=0,avoidCollisions:o=!0,collisionBoundary:u=[],collisionPadding:m=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:y="optimized",onPlaced:g,...b}=e,v=Fn(Ps,n),[k,N]=d.useState(null),j=vt(s,fe=>N(fe)),[w,D]=d.useState(null),$=Qo(w),T=($==null?void 0:$.width)??0,I=($==null?void 0:$.height)??0,F=i+(a!=="center"?"-"+a:""),O=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},_=Array.isArray(u)?u:[u],U=_.length>0,W={padding:O,boundary:_.filter(ra),altBoundary:U},{refs:q,floatingStyles:Z,placement:V,isPositioned:B,middlewareData:R}=Bo({strategy:"fixed",placement:F,whileElementsMounted:(...fe)=>To(...fe,{animationFrame:y==="always"}),elements:{reference:v.anchor},middleware:[Ho({mainAxis:r+I,alignmentAxis:c}),o&&Vo({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?qo():void 0,...W}),o&&Xo({...W}),Ko({...W,apply:({elements:fe,rects:ve,availableWidth:Ue,availableHeight:Ke})=>{const{width:Ae,height:ct}=ve.reference,Me=fe.floating.style;Me.setProperty("--radix-popper-available-width",`${Ue}px`),Me.setProperty("--radix-popper-available-height",`${Ke}px`),Me.setProperty("--radix-popper-anchor-width",`${Ae}px`),Me.setProperty("--radix-popper-anchor-height",`${ct}px`)}}),w&&Yo({element:w,padding:l}),oa({arrowWidth:T,arrowHeight:I}),p&&Go({strategy:"referenceHidden",...W})]}),[C,ne]=qn(V),ae=bn(g);Vt(()=>{B&&(ae==null||ae())},[B,ae]);const Fe=(P=R.arrow)==null?void 0:P.x,ue=(J=R.arrow)==null?void 0:J.y,me=((se=R.arrow)==null?void 0:se.centerOffset)!==0,[ke,ee]=d.useState();return Vt(()=>{k&&ee(window.getComputedStyle(k).zIndex)},[k]),t.jsx("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...Z,transform:B?Z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ke,"--radix-popper-transform-origin":[(re=R.transformOrigin)==null?void 0:re.x,(he=R.transformOrigin)==null?void 0:he.y].join(" "),...((Le=R.hide)==null?void 0:Le.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:t.jsx(ta,{scope:n,placedSide:C,onArrowChange:D,arrowX:Fe,arrowY:ue,shouldHideArrow:me,children:t.jsx(wt.div,{"data-side":C,"data-align":ne,...b,ref:j,style:{...b.style,animation:B?void 0:"none"}})})})});Hn.displayName=Ps;var Vn="PopperArrow",na={top:"bottom",right:"left",bottom:"top",left:"right"},ia=d.forwardRef(function(s,n){const{__scopePopper:i,...r}=s,a=sa(Vn,i),c=na[a.placedSide];return t.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:t.jsx(Jo,{...r,ref:n,style:{...r.style,display:"block"}})})});ia.displayName=Vn;function ra(e){return e!==null}var oa=e=>({name:"transformOrigin",options:e,fn(s){var v,k,N;const{placement:n,rects:i,middlewareData:r}=s,c=((v=r.arrow)==null?void 0:v.centerOffset)!==0,l=c?0:e.arrowWidth,o=c?0:e.arrowHeight,[u,m]=qn(n),f={start:"0%",center:"50%",end:"100%"}[m],p=(((k=r.arrow)==null?void 0:k.x)??0)+l/2,y=(((N=r.arrow)==null?void 0:N.y)??0)+o/2;let g="",b="";return u==="bottom"?(g=c?f:`${p}px`,b=`${-o}px`):u==="top"?(g=c?f:`${p}px`,b=`${i.floating.height+o}px`):u==="right"?(g=`${-o}px`,b=c?f:`${y}px`):u==="left"&&(g=`${i.floating.width+o}px`,b=c?f:`${y}px`),{data:{x:g,y:b}}}});function qn(e){const[s,n="center"]=e.split("-");return[s,n]}var aa=Un,ca=Wn,la=Hn,da=Symbol.for("react.lazy"),Yt=ni[" use ".trim().toString()];function ua(e){return typeof e=="object"&&e!==null&&"then"in e}function Xn(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===da&&"_payload"in e&&ua(e._payload)}function ma(e){const s=ha(e),n=d.forwardRef((i,r)=>{let{children:a,...c}=i;Xn(a)&&typeof Yt=="function"&&(a=Yt(a._payload));const l=d.Children.toArray(a),o=l.find(pa);if(o){const u=o.props.children,m=l.map(f=>f===o?d.Children.count(u)>1?d.Children.only(null):d.isValidElement(u)?u.props.children:null:f);return t.jsx(s,{...c,ref:r,children:d.isValidElement(u)?d.cloneElement(u,void 0,m):null})}return t.jsx(s,{...c,ref:r,children:a})});return n.displayName=`${e}.Slot`,n}function ha(e){const s=d.forwardRef((n,i)=>{let{children:r,...a}=n;if(Xn(r)&&typeof Yt=="function"&&(r=Yt(r._payload)),d.isValidElement(r)){const c=xa(r),l=ga(a,r.props);return r.type!==d.Fragment&&(l.ref=i?ui(i,c):c),d.cloneElement(r,l)}return d.Children.count(r)>1?d.Children.only(null):null});return s.displayName=`${e}.SlotClone`,s}var fa=Symbol("radix.slottable");function pa(e){return d.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===fa}function ga(e,s){const n={...s};for(const i in s){const r=e[i],a=s[i];/^on[A-Z]/.test(i)?r&&a?n[i]=(...l)=>{const o=a(...l);return r(...l),o}:r&&(n[i]=r):i==="style"?n[i]={...r,...a}:i==="className"&&(n[i]=[r,a].filter(Boolean).join(" "))}return{...e,...n}}function xa(e){var i,r;let s=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=s&&"isReactWarning"in s&&s.isReactWarning;return n?e.ref:(s=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=s&&"isReactWarning"in s&&s.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ya=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],va=ya.reduce((e,s)=>{const n=ma(`Primitive.${s}`),i=d.forwardRef((r,a)=>{const{asChild:c,...l}=r,o=c?n:s;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),t.jsx(o,{...l,ref:a})});return i.displayName=`Primitive.${s}`,{...e,[s]:i}},{}),ba="Portal",Kn=d.forwardRef((e,s)=>{var l;const{container:n,...i}=e,[r,a]=d.useState(!1);Vt(()=>a(!0),[]);const c=n||r&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return c?ii.createPortal(t.jsx(va.div,{...i,ref:s}),c):null});Kn.displayName=ba;const wa=({open:e,onClose:s,anchorRef:n,placement:i="bottom-end",children:r})=>{const a=d.useRef(null);if(d.useEffect(()=>{if(!e)return;const u=m=>{var f,p;e&&((f=a.current)!=null&&f.contains(m.target)||(p=n.current)!=null&&p.contains(m.target)||s())};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[e,s,n]),!e)return null;const c=i.startsWith("top")?"top":"bottom",l=i.endsWith("end")?"end":"start",o=i.startsWith("top")?8:4;return t.jsxs(aa,{children:[t.jsx(ca,{virtualRef:n}),t.jsx(Kn,{children:t.jsx(mi,{onEscapeKeyDown:u=>{u.preventDefault(),s()},onPointerDownOutside:u=>{var m;if((m=n.current)!=null&&m.contains(u.target)){u.preventDefault();return}s()},children:t.jsx(la,{ref:a,side:c,align:l,sideOffset:o,className:`popover popover-${i}`,role:"dialog",children:r})})})]})};function ja(e){const s=e+"CollectionProvider",[n,i]=Es(s),[r,a]=n(s,{collectionRef:{current:null},itemMap:new Map}),c=b=>{const{scope:v,children:k}=b,N=je.useRef(null),j=je.useRef(new Map).current;return t.jsx(r,{scope:v,itemMap:j,collectionRef:N,children:k})};c.displayName=s;const l=e+"CollectionSlot",o=Bs(l),u=je.forwardRef((b,v)=>{const{scope:k,children:N}=b,j=a(l,k),w=vt(v,j.collectionRef);return t.jsx(o,{ref:w,children:N})});u.displayName=l;const m=e+"CollectionItemSlot",f="data-radix-collection-item",p=Bs(m),y=je.forwardRef((b,v)=>{const{scope:k,children:N,...j}=b,w=je.useRef(null),D=vt(v,w),$=a(m,k);return je.useEffect(()=>($.itemMap.set(w,{ref:w,...j}),()=>void $.itemMap.delete(w))),t.jsx(p,{[f]:"",ref:D,children:N})});y.displayName=m;function g(b){const v=a(e+"CollectionConsumer",b);return je.useCallback(()=>{const N=v.collectionRef.current;if(!N)return[];const j=Array.from(N.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort(($,T)=>j.indexOf($.ref.current)-j.indexOf(T.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:c,Slot:u,ItemSlot:y},g,i]}var Na=d.createContext(void 0);function Ca(e){const s=d.useContext(Na);return e||s||"ltr"}var fs="rovingFocusGroup.onEntryFocus",Sa={bubbles:!1,cancelable:!0},Nt="RovingFocusGroup",[Ns,Gn,ka]=ja(Nt),[Aa]=Es(Nt,[ka]),[Ra,Ea]=Aa(Nt),Yn=d.forwardRef((e,s)=>t.jsx(Ns.Provider,{scope:e.__scopeRovingFocusGroup,children:t.jsx(Ns.Slot,{scope:e.__scopeRovingFocusGroup,children:t.jsx($a,{...e,ref:s})})}));Yn.displayName=Nt;var $a=d.forwardRef((e,s)=>{const{__scopeRovingFocusGroup:n,orientation:i,loop:r=!1,dir:a,currentTabStopId:c,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:o,onEntryFocus:u,preventScrollOnEntryFocus:m=!1,...f}=e,p=d.useRef(null),y=vt(s,p),g=Ca(a),[b,v]=fi({prop:c,defaultProp:l??null,onChange:o,caller:Nt}),[k,N]=d.useState(!1),j=bn(u),w=Gn(n),D=d.useRef(!1),[$,T]=d.useState(0);return d.useEffect(()=>{const I=p.current;if(I)return I.addEventListener(fs,j),()=>I.removeEventListener(fs,j)},[j]),t.jsx(Ra,{scope:n,orientation:i,dir:g,loop:r,currentTabStopId:b,onItemFocus:d.useCallback(I=>v(I),[v]),onItemShiftTab:d.useCallback(()=>N(!0),[]),onFocusableItemAdd:d.useCallback(()=>T(I=>I+1),[]),onFocusableItemRemove:d.useCallback(()=>T(I=>I-1),[]),children:t.jsx(wt.div,{tabIndex:k||$===0?-1:0,"data-orientation":i,...f,ref:y,style:{outline:"none",...e.style},onMouseDown:st(e.onMouseDown,()=>{D.current=!0}),onFocus:st(e.onFocus,I=>{const F=!D.current;if(I.target===I.currentTarget&&F&&!k){const O=new CustomEvent(fs,Sa);if(I.currentTarget.dispatchEvent(O),!O.defaultPrevented){const _=w().filter(V=>V.focusable),U=_.find(V=>V.active),W=_.find(V=>V.id===b),Z=[U,W,..._].filter(Boolean).map(V=>V.ref.current);Qn(Z,m)}}D.current=!1}),onBlur:st(e.onBlur,()=>N(!1))})})}),Zn="RovingFocusGroupItem",Jn=d.forwardRef((e,s)=>{const{__scopeRovingFocusGroup:n,focusable:i=!0,active:r=!1,tabStopId:a,children:c,...l}=e,o=hi(),u=a||o,m=Ea(Zn,n),f=m.currentTabStopId===u,p=Gn(n),{onFocusableItemAdd:y,onFocusableItemRemove:g,currentTabStopId:b}=m;return d.useEffect(()=>{if(i)return y(),()=>g()},[i,y,g]),t.jsx(Ns.ItemSlot,{scope:n,id:u,focusable:i,active:r,children:t.jsx(wt.span,{tabIndex:f?0:-1,"data-orientation":m.orientation,...l,ref:s,onMouseDown:st(e.onMouseDown,v=>{i?m.onItemFocus(u):v.preventDefault()}),onFocus:st(e.onFocus,()=>m.onItemFocus(u)),onKeyDown:st(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){m.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const k=Ia(v,m.orientation,m.dir);if(k!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let j=p().filter(w=>w.focusable).map(w=>w.ref.current);if(k==="last")j.reverse();else if(k==="prev"||k==="next"){k==="prev"&&j.reverse();const w=j.indexOf(v.currentTarget);j=m.loop?La(j,w+1):j.slice(w+1)}setTimeout(()=>Qn(j))}}),children:typeof c=="function"?c({isCurrentTabStop:f,hasTabStop:b!=null}):c})})});Jn.displayName=Zn;var Da={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ta(e,s){return s!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Ia(e,s,n){const i=Ta(e.key,n);if(!(s==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(s==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return Da[i]}function Qn(e,s=!1){const n=document.activeElement;for(const i of e)if(i===n||(i.focus({preventScroll:s}),document.activeElement!==n))return}function La(e,s){return e.map((n,i)=>e[(s+i)%e.length])}var Ma=Yn,_a=Jn;const zt=({icon:e,children:s,onClick:n,danger:i,disabled:r})=>t.jsx(_a,{asChild:!0,focusable:!r,active:!1,children:t.jsxs("button",{type:"button",role:"menuitem",className:`menu-item${i?" menu-item-danger":""}`,onClick:n,disabled:r,children:[e&&t.jsx("span",{className:"menu-item-icon",children:e}),t.jsx("span",{className:"menu-item-label",children:s})]})}),Oa=({children:e})=>t.jsx(Ma,{asChild:!0,orientation:"vertical",loop:!0,children:t.jsx("div",{className:"menu",role:"menu",children:e})}),Pa=[{label:"1 Hour",value:"1h"},{label:"2 Hours",value:"2h"},{label:"4 Hours",value:"4h"},{label:"8 Hours",value:"8h"}],za=({device:e,onClose:s,onReserved:n})=>{const[i,r]=d.useState(""),[a,c]=d.useState("1h"),[l,o]=d.useState(""),[u,m]=d.useState(!1),[f,p]=d.useState(null),[y,g]=d.useState(null),b=async()=>{if(!i.trim()){p("Please enter your name/ID");return}m(!0),p(null),g(null);try{const v=await H.reserveDevice(e.udid,e.host,i,a,l);v.success?(n(),s()):g(v.error||"Failed to reserve device")}catch(v){g(v.message||"An unexpected error occurred")}finally{m(!1)}};return t.jsx(wn,{open:!0,onClose:s,width:520,title:t.jsxs(t.Fragment,{children:[t.jsx(zi,{size:16,className:"title-icon"}),"Reserve device"]}),footer:t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"btn-cancel",onClick:s,disabled:u,children:"Cancel"}),t.jsx("button",{className:"btn-reserve",onClick:b,disabled:u||!i.trim(),children:u?"Reserving...":"Confirm Reservation"})]}),children:t.jsxs("div",{className:"reservation-modal-body",children:[t.jsxs("div",{className:"device-id-badge",children:[t.jsx("span",{className:"label",children:"Device:"}),t.jsx("span",{className:"value",children:e.udid})]}),t.jsxs("p",{children:["Reserve ",t.jsx("strong",{children:e.name||e.udid})," for exclusive use. This will prevent CI sessions from using this device."]}),t.jsx(Ut,{label:t.jsxs(t.Fragment,{children:[t.jsx(ri,{size:14,style:{marginRight:6,verticalAlign:"middle",color:"var(--color-accent)"}}),"Reserved by"]}),htmlFor:"reservation-reserved-by",error:f?t.jsxs(t.Fragment,{children:[t.jsx(Fs,{size:14,style:{marginRight:6,verticalAlign:"middle"}}),f]}):void 0,children:t.jsx("input",{id:"reservation-reserved-by",type:"text",className:"reservation-input",placeholder:"Enter your name or ID",value:i,onChange:v=>{r(v.target.value),f&&p(null)},disabled:u})}),t.jsx(Ut,{label:t.jsxs(t.Fragment,{children:[t.jsx(jn,{size:14,style:{marginRight:6,verticalAlign:"middle",color:"var(--color-accent)"}}),"Duration"]}),children:t.jsx("div",{className:"duration-selector",children:Pa.map(v=>t.jsx("div",{className:`duration-option ${a===v.value?"active":""}`,onClick:()=>c(v.value),children:v.label},v.value))})}),t.jsx(Ut,{label:t.jsxs(t.Fragment,{children:[t.jsx(cr,{size:14,style:{marginRight:6,verticalAlign:"middle",color:"var(--color-accent)"}}),"Reason (optional)"]}),htmlFor:"reservation-reason",error:y?t.jsxs(t.Fragment,{children:[t.jsx(Fs,{size:14,style:{marginRight:6,verticalAlign:"middle"}}),y]}):void 0,children:t.jsx("input",{id:"reservation-reason",type:"text",className:"reservation-input",placeholder:"e.g., Debugging flaky login test",value:l,onChange:v=>o(v.target.value),disabled:u})})]})})},Fa=({device:e,onClose:s,onUpdated:n})=>{const{toast:i}=Zt(),[r,a]=d.useState(e.tags||[]),[c,l]=d.useState(""),[o,u]=d.useState(!1),m=d.useRef(null);d.useEffect(()=>{m.current&&m.current.focus()},[]);const f=()=>{const b=c.trim();b&&!r.includes(b)&&(a([...r,b]),l(""))},p=b=>{a(r.filter(v=>v!==b))},y=b=>{b.key==="Enter"&&f()},g=async()=>{u(!0);try{await H.updateDeviceTags(e.udid,e.host,r),n(),s()}catch(b){console.error("Failed to update tags",b),i("Error saving tags. Please try again.","error")}finally{u(!1)}};return t.jsx(wn,{open:!0,onClose:s,width:520,title:t.jsxs(t.Fragment,{children:[t.jsx(Ar,{size:16,className:"title-icon"}),"Manage device tags"]}),footer:t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"btn-cancel",onClick:s,children:"Cancel"}),t.jsx("button",{className:"btn-save",onClick:g,disabled:o,children:o?"Saving...":"Apply Changes"})]}),children:t.jsxs("div",{className:"tag-modal-body",children:[t.jsxs("div",{className:"device-id-badge",children:[t.jsx("span",{className:"label",children:"Device:"}),t.jsx("span",{className:"value",children:e.udid})]}),t.jsx(Ut,{label:"Add new tag",description:"Press Enter to add multiple tags",htmlFor:"tag-input",children:t.jsxs("div",{className:"input-with-button",children:[t.jsx("input",{ref:m,id:"tag-input",type:"text",placeholder:"e.g. stable, team-a, ios-17",value:c,onChange:b=>l(b.target.value),onKeyDown:y}),t.jsx("button",{className:"add-inline-btn",onClick:f,disabled:!c.trim(),children:t.jsx(pi,{size:16})})]})}),t.jsxs("div",{className:"tags-display-section",children:[t.jsx("label",{children:"Current Tags"}),t.jsx("div",{className:"tags-list",children:r.length>0?r.map(b=>t.jsxs("div",{className:"tag-pill-editable",children:[b,t.jsx("button",{className:"remove-tag",onClick:()=>p(b),children:t.jsx(xn,{size:12})})]},b)):t.jsx("div",{className:"empty-tags",children:"No tags assigned to this device."})})]})]})})};function Ua(e){return e>=50?"ready":e>=20?"warning":"error"}function Ba(e){return e>=50?t.jsx(Mi,{size:10}):e>=20?t.jsx(Di,{size:10}):t.jsx(Ii,{size:10})}function Wa(e){return e==="Normal"?"ready":e==="Critical"?"error":"warning"}const Ha=({device:e})=>{if(e.deviceType==="emulator"||e.deviceType==="simulator"||e.offline)return null;const n=typeof e.batteryLevel=="number",i=typeof e.thermalStatus=="string"&&e.thermalStatus.length>0&&e.thermalStatus!=="Unknown";return!n&&!i?t.jsx("div",{className:"dc2-health",children:t.jsxs(Oe,{tone:"neutral",title:"Device does not report battery or thermal data",children:[t.jsx(gi,{size:10}),"No telemetry"]})}):t.jsxs("div",{className:"dc2-health",children:[n&&t.jsxs(Oe,{tone:Ua(e.batteryLevel),title:`Battery ${e.batteryLevel}%`,children:[Ba(e.batteryLevel),e.batteryLevel,"%"]}),i&&t.jsxs(Oe,{tone:Wa(e.thermalStatus),title:`Thermal: ${e.thermalStatus}`,children:[t.jsx(Tr,{size:10}),e.thermalStatus]})]})},Va=/^([0-9a-f]{2}:){5}[0-9a-f]{2}$/i,qa=/^(?:\d{1,3}\.){3}\d{1,3}$/;function Xa(e){const s=e.trim();return!s||Va.test(s)||!qa.test(s)?!1:s.split(".").every(n=>{const i=Number(n);return Number.isInteger(i)&&i>=0&&i<=255})}function Ka(e){return e==="127.0.0.1"||e==="localhost"||e==="0.0.0.0"}function Ga(e){if(!e)return null;try{const s=new URL(e.includes("://")?e:`http://${e}`);return s.port?`${s.hostname}:${s.port}`:s.hostname}catch{return e}}function Ya(e){if(e.ip&&Xa(e.ip))return e.ip;const s=Ga(e.host);if(!s)return"—";const n=s.split(":")[0];return Ka(n)?"—":s}const Za="/wd/hub";function Ja(e){return e==="android"?"UiAutomator2":"XCUITest"}function Qa(e){return e==="android"?"Android":e==="tvos"?"tvOS":"iOS"}function ec(e,s=Za){if(!e)return"—";try{const n=new URL(e.includes("://")?e:`http://${e}`),i=s.startsWith("/")?s:`/${s}`,r=n.pathname.replace(/\/$/,"");return r===i||r.endsWith(i)?`${n.protocol}//${n.host}${r}`:`${n.protocol}//${n.host}${i}`}catch{return e}}function tc(e){const s={platformName:Qa(e.platform),"appium:automationName":Ja(e.platform),"appium:udid":e.udid};return e.sdk&&e.sdk!=="Unknown"&&e.sdk!=="unknown"&&(s["appium:platformVersion"]=e.sdk),e.name&&(s["appium:deviceName"]=e.name),s}function sc(e){return JSON.stringify(tc(e),null,2)}function nc(e){return e==="real"?"Real":e==="simulator"?"Simulator":e==="emulator"?"Emulator":null}const ps=6e4;function ic(e){return!Number.isFinite(e)||e<=0?"expiring":e<ps?"under 1m":$s(Math.floor(e/ps)*ps,{unitCount:2})}function Cs(e,s){return e.offline?"offline":e.userBlocked?"maintenance":e.busy?"busy":e.reservedUntil&&s<e.reservedUntil?"reserved":"ready"}function ei(e,s){if(!e.busy||!e.session_id)return null;const n=String(e.session_id);return n.startsWith("manual_")?s!=null&&s.userId&&n===`manual_${s.userId}_${e.udid}`?"self":"other":"session"}const nn=e=>(e==null?void 0:e.role)==="ADMIN"||(e==null?void 0:e.role)==="SUPER_ADMIN";function rc(e,s,n){switch(ei(e,s)){case"session":return e.sessionStartTime&&e.sessionStartTime>0&&n>e.sessionStartTime?`Test session · ${$s(n-e.sessionStartTime,{compact:!0})}`:"Test session running";case"self":return"Live control by you";case"other":return"Live control by another user"}return e.reservedUntil&&n<e.reservedUntil?`Reserved by ${!!e.reservedBy&&(e.reservedBy===(s==null?void 0:s.email)||e.reservedBy===(s==null?void 0:s.name))?"you":e.reservedBy||"another user"} · ${ic(e.reservedUntil-n)} left`:null}function oc(e,s){if(e.offline)return{enabled:!1,reason:"Device is offline"};if(e.userBlocked&&!nn(s))return{enabled:!1,reason:"In maintenance"};const n=ei(e,s);return n==="session"?{enabled:!1,reason:"A test is running on this device"}:n==="other"&&!nn(s)?{enabled:!1,reason:"Another user is controlling this device"}:{enabled:!0}}const rn="Shared",ac="Shared pool — visible to all authenticated users",cc=({udid:e,currentTeamId:s,resolvedTeamName:n,teams:i,canEdit:r,onChanged:a})=>{const{toast:c}=Zt(),[l,o]=d.useState(!1),[u,m]=d.useState(!1),f=s?i.get(s)??n??`Team ${s.slice(0,6)}`:rn;async function p(y){m(!0);try{await H.setDeviceTeam(e,y),c(y?"Device assigned":"Device returned to shared pool","success"),a(),o(!1)}catch(g){c((g==null?void 0:g.message)||"Failed to update team","error")}finally{m(!1)}}return r?l?t.jsxs(Jt,{selectSize:"sm",autoFocus:!0,disabled:u,defaultValue:s??"",onBlur:()=>o(!1),onChange:y=>p(y.target.value||null),children:[t.jsx("option",{value:"",children:"(Shared pool)"}),Array.from(i.entries()).map(([y,g])=>t.jsx("option",{value:y,children:g},y))]}):t.jsx("button",{type:"button",onClick:()=>o(!0),className:"dc2-team-pill",title:s?"Click to change team":"Click to assign to a team",children:f}):s?t.jsx(Oe,{tone:"accent",title:`Team: ${f}`,children:f}):t.jsx(Oe,{tone:"neutral",title:ac,children:rn})};function lc(e,s=10,n=4){return!e||e.length<=s+n+1?e:`${e.slice(0,s)}…${e.slice(-n)}`}const dc=({device:e,reloadDevices:s,navigate:n,teams:i})=>{var O,_,U;const[r,a]=d.useState(!1),[c,l]=d.useState(!1),[o,u]=d.useState(!1),m=d.useRef(null),{me:f}=oi(),{toast:p}=Zt(),y=(f==null?void 0:f.role)==="ADMIN"||(f==null?void 0:f.role)==="SUPER_ADMIN",g=Date.now(),b=Cs(e,g),v=b==="reserved",k=rc(e,f,g),N=oc(e,f),j=`dc2-reason-${e.udid}`,w=async(W,q)=>{var Z;try{await((Z=navigator.clipboard)==null?void 0:Z.writeText(W)),p(q,"success")}catch{p("Failed to copy","error")}},D=ec(e.host),$=nc(e.deviceType),T=async()=>{await H.releaseReservation(e.udid,e.host),s()},I=async()=>{await H.blockDevice(e.udid,e.host),s()},F=async()=>{await H.unblockDevice(e.udid,e.host),s()};return t.jsxs("div",{className:`dc2 dc2-${b}`,children:[t.jsx("div",{className:"dc2-stripe"}),t.jsxs("div",{className:"dc2-header",children:[t.jsxs("span",{className:"dc2-platform",children:[Nn(e.platform)," · ",e.sdk]}),t.jsx(Hr,{kind:b,showDot:!0,children:b})]}),t.jsx("div",{className:"dc2-name",title:e.name,children:e.name}),t.jsxs("div",{className:"dc2-udid-row",children:[t.jsx("div",{className:"dc2-udid",title:e.udid,children:lc(e.udid)}),t.jsx("button",{type:"button",className:"dc2-udid-copy",onClick:()=>w(e.udid,"UDID copied"),"aria-label":"Copy UDID",title:"Copy UDID",children:t.jsx(qe,{size:12})})]}),t.jsx(Ha,{device:e}),t.jsxs("div",{className:"dc2-tags",children:[$&&t.jsx(Oe,{tone:"neutral",title:`Device type: ${$}`,children:$}),t.jsx(cc,{udid:e.udid,currentTeamId:e.teamId??null,resolvedTeamName:e.teamName??null,teams:i??new Map,canEdit:y,onChanged:s}),(O=e.tags)==null?void 0:O.slice(0,3).map(W=>t.jsx(Oe,{tone:"neutral",title:W,children:W},W)),(((_=e.tags)==null?void 0:_.length)||0)>3&&t.jsxs(Oe,{tone:"neutral",children:["+",(((U=e.tags)==null?void 0:U.length)||0)-3]})]}),t.jsxs("div",{className:"dc2-metrics",children:[k?t.jsxs("div",{className:`dc2-banner dc2-banner-${v?"reserved":"session"}`,children:[v?t.jsx(jn,{size:12,"aria-hidden":!0}):t.jsx(Cn,{size:12,"aria-hidden":!0}),t.jsx("span",{children:k})]}):t.jsx(ds,{label:"Time in use",value:e.totalUtilizationTimeMilliSec?$s(e.totalUtilizationTimeMilliSec,{compact:!0}):"—"}),t.jsx(ds,{label:"Network",value:Ya(e),mono:!0}),t.jsx(ds,{label:"Server",mono:!0,value:t.jsxs("span",{className:"dc2-copyable",children:[t.jsx("span",{className:"dc2-copyable-text",title:D,children:D}),D!=="—"&&t.jsx("button",{type:"button",className:"dc2-udid-copy",onClick:()=>w(D,"Server URL copied"),"aria-label":"Copy Appium server URL",title:"Copy Appium server URL",children:t.jsx(qe,{size:12})})]})})]}),!N.enabled&&t.jsx("p",{id:j,className:"dc2-unavailable",children:N.reason}),t.jsxs("div",{className:"dc2-actions",children:[t.jsx(tt,{variant:"primary",size:"sm",disabled:!N.enabled,"aria-describedby":N.enabled?void 0:j,onClick:()=>{N.enabled&&n(`/devices/${e.udid}/control`)},className:"dc2-primary",children:"Control"}),v?t.jsx(tt,{variant:"secondary",size:"sm",onClick:T,children:"Release"}):b==="ready"?t.jsx(tt,{variant:"secondary",size:"sm",onClick:()=>a(!0),children:"Reserve"}):null,t.jsx("button",{ref:m,type:"button",className:"dc2-more",onClick:()=>u(W=>!W),"aria-label":"More actions",children:t.jsx(Ji,{size:14})}),t.jsx(wa,{open:o,onClose:()=>u(!1),anchorRef:m,children:t.jsxs(Oa,{children:[t.jsx(zt,{icon:t.jsx(qe,{size:12}),onClick:()=>{u(!1),w(sc(e),"Session capabilities copied")},children:"Copy caps…"}),t.jsx(zt,{onClick:()=>{u(!1),l(!0)},children:"Manage tags…"}),e.userBlocked?t.jsx(zt,{onClick:()=>{u(!1),F()},children:"Exit maintenance"}):t.jsx(zt,{onClick:()=>{u(!1),I()},children:"Enter maintenance"})]})})]}),r&&t.jsx(za,{device:e,onClose:()=>a(!1),onReserved:()=>s()}),c&&t.jsx(Fa,{device:e,onClose:()=>l(!1),onUpdated:()=>s()})]})};function uc(e){const s=Rs();return t.jsx(dc,{device:e.device,reloadDevices:e.reloadDevices,navigate:s,teams:e.teams})}class mc extends je.Component{constructor(){super(...arguments),this.state={teamsMap:new Map}}componentDidMount(){H.listTeams().then(s=>{this.setState({teamsMap:new Map(s.map(n=>[n.id,n.name]))})}).catch(()=>{})}render(){return t.jsx("div",{className:"device-explorer-card-container",children:je.Children.toArray(this.props.devices.map(s=>t.jsx(uc,{device:s,reloadDevices:this.props.reloadDevices,teams:this.state.teamsMap})))})}}var Ft,hc=new Uint8Array(16);function fc(){if(!Ft&&(Ft=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!Ft))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ft(hc)}const pc=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function gc(e){return typeof e=="string"&&pc.test(e)}var ie=[];for(var gs=0;gs<256;++gs)ie.push((gs+256).toString(16).substr(1));function xc(e){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(ie[e[s+0]]+ie[e[s+1]]+ie[e[s+2]]+ie[e[s+3]]+"-"+ie[e[s+4]]+ie[e[s+5]]+"-"+ie[e[s+6]]+ie[e[s+7]]+"-"+ie[e[s+8]]+ie[e[s+9]]+"-"+ie[e[s+10]]+ie[e[s+11]]+ie[e[s+12]]+ie[e[s+13]]+ie[e[s+14]]+ie[e[s+15]]).toLowerCase();if(!gc(n))throw TypeError("Stringified UUID is invalid");return n}function yc(e,s,n){e=e||{};var i=e.random||(e.rng||fc)();return i[6]=i[6]&15|64,i[8]=i[8]&63|128,xc(i)}const vc=({onCommand:e,prompt:s="$",welcomeMessage:n="Interactive Shell (Restricted Mode)",platform:i})=>{const[r,a]=d.useState([{type:"system",content:n,timestamp:Date.now()},{type:"system",content:'Type "help" for allowed commands.',timestamp:Date.now()}]),[c,l]=d.useState(""),[o,u]=d.useState([]),[m,f]=d.useState(-1),[p,y]=d.useState(!1),g=d.useRef(null),b=d.useRef(null);d.useEffect(()=>{g.current&&(g.current.scrollTop=g.current.scrollHeight)},[r]);const v=N=>{const j=N.trim();if((j.startsWith("{")||j.startsWith("["))&&(j.endsWith("}")||j.endsWith("]")))try{const w=JSON.parse(j);return JSON.stringify(w,null,2)}catch{}return N},k=async N=>{if(N.key==="Enter"&&!p){const j=c.trim();if(!j)return;if(l(""),a(w=>[...w,{type:"command",content:`${s} ${j}`,timestamp:Date.now()}]),u(w=>[...w,j]),f(-1),y(!0),j==="clear"){a([]),y(!1);return}if(j==="help"){let w="";i==="android"?w=`
|
|
187
|
+
Android Allowed Commands:
|
|
188
|
+
• System Info: getprop, ip addr, date, uptime, cat /proc/meminfo, cat /proc/cpuinfo
|
|
189
|
+
• Process Mgmt: ps, top
|
|
190
|
+
• File System: ls
|
|
191
|
+
• Diagnostics: dumpsys [battery|wifi|power]
|
|
192
|
+
• Packages: pm list packages
|
|
193
|
+
`:(i==="ios"||i==="tvos")&&(w=`
|
|
194
|
+
iOS Allowed Commands:
|
|
195
|
+
• Real Device (go-ios):
|
|
196
|
+
apps, info, list, syslog, deviceinfo, diagnostics
|
|
197
|
+
• Simulator (xcrun simctl):
|
|
198
|
+
listapps, get_app_container, list, getenv
|
|
199
|
+
• Simulator System:
|
|
200
|
+
ls, ps, top, date, uptime, whoami
|
|
201
|
+
`),a(D=>[...D,{type:"output",content:w.trim(),timestamp:Date.now()}]),y(!1);return}try{const w=await e(j),D=v(w||"(No output)");a($=>[...$,{type:"output",content:D,timestamp:Date.now()}])}catch(w){a(D=>[...D,{type:"error",content:w.message||"Unknown error",timestamp:Date.now()}])}finally{y(!1),setTimeout(()=>{var w;return(w=b.current)==null?void 0:w.focus()},10)}}else if(N.key==="ArrowUp"){if(N.preventDefault(),o.length>0){const j=m===-1?o.length-1:Math.max(0,m-1);f(j),l(o[j])}}else if(N.key==="ArrowDown"&&(N.preventDefault(),m!==-1)){const j=m+1;j>=o.length?(f(-1),l("")):(f(j),l(o[j]))}};return t.jsxs("div",{className:"terminal-container theme-dark",children:[t.jsx("div",{className:"scanline",style:{position:"absolute",inset:0,pointerEvents:"none",opacity:.05,zIndex:1001}}),t.jsxs("header",{className:"terminal-header",children:[t.jsxs("div",{className:"terminal-controls",children:[t.jsx("div",{className:"dot red"}),t.jsx("div",{className:"dot yellow"}),t.jsx("div",{className:"dot green"})]}),t.jsxs("div",{className:"terminal-title",children:[Nn(i)," shell"]}),t.jsx("div",{className:"terminal-actions",children:t.jsx("button",{className:"terminal-action-btn",onClick:()=>a([]),title:"Clear terminal",children:"CLEAR"})})]}),t.jsxs("div",{className:"terminal-history",ref:g,onClick:()=>{var N;return(N=b.current)==null?void 0:N.focus()},children:[r.map((N,j)=>t.jsx("div",{className:`terminal-line ${N.type}`,children:N.content},j)),p&&t.jsx("div",{className:"terminal-line system animate-pulse",children:"Executing command..."})]}),t.jsxs("div",{className:"terminal-input-area",children:[t.jsx("span",{className:"terminal-prompt",children:s}),t.jsx("input",{ref:b,className:"terminal-input",value:c,onChange:N=>l(N.target.value),onKeyDown:k,disabled:p,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"Type a command..."})]})]})};function Te(e,s){var n;s(e),(n=e.children)==null||n.forEach(i=>Te(i,s))}function Ee(e,...s){var n;for(const i of s){const r=(n=e.attributes)==null?void 0:n[i];if(r!=null&&r!=="")return String(r)}}function rt(e){var s;return((s=e.type)==null?void 0:s.split(".").pop())||e.type||""}function bc(e,s){const n=[];return Te(e,i=>{Ee(i,"content-desc","contentDescription","accessibilityId","name","label")===s&&n.push(i)}),n}function wc(e,s){const n=[];return Te(e,i=>{Ee(i,"resource-id","resourceId","identifier")===s&&n.push(i)}),n}function Ss(e,s){const n=[];return Te(e,i=>{(i.type===s||rt(i)===s)&&n.push(i)}),n}function jc(e,s){const n=[];return Te(e,i=>{Ee(i,"name")===s&&n.push(i)}),n}function Nc(e){const s=/^\/\/(\*|[A-Za-z_][\w.-]*)\[@([\w-]+)=(["'])(.*?)\3\]$/.exec(e.trim());return s?{tag:s[1]==="*"?null:s[1],attrKey:s[2],attrValue:s[4]}:null}function Cc(e,s){const n=s.split("/").filter(Boolean);if(n.length===0)return null;const i=[];for(const a of n){const c=/^([A-Za-z_][\w.-]*)\[(\d+)\]$/.exec(a);if(!c)return null;i.push({type:c[1],index:parseInt(c[2],10)})}if(i[0].type!==e.type&&i[0].type!==rt(e)||i[0].index!==1)return null;let r=e;for(let a=1;a<i.length&&r;a++){const{type:c,index:l}=i[a];let o=0,u;for(const m of r.children||[])if((m.type===c||rt(m)===c)&&(o+=1,o===l)){u=m;break}r=u}return r?[r]:[]}function Sc(e,s){const n=Cc(e,s);if(n!==null)return{kind:"matched",nodes:n};const i=Nc(s);if(i){const r=[];return Te(e,a=>{if(i.tag&&a.type!==i.tag&&rt(a)!==i.tag)return;Ee(a,i.attrKey)===i.attrValue&&r.push(a)}),{kind:"matched",nodes:r}}return{kind:"unsupported",nodes:[],reason:"Complex XPath (axes, multiple predicates, functions) — use a real driver to verify"}}function kc(e,s){const n=s.trim(),i=/^\*\*\/([A-Za-z_]\w*)\[`(\w+)\s*==\s*"([^"]*)"`\]$/.exec(n);if(i){const[,c,l,o]=i,u=[];return Te(e,m=>{if(m.type!==c&&rt(m)!==c)return;Ee(m,l)===o&&u.push(m)}),{kind:"matched",nodes:u}}const r=/^\*\*\/([A-Za-z_]\w*)\[(\d+)\]$/.exec(n);if(r){const[,c,l]=r,o=parseInt(l,10),u=[];return Te(e,m=>{(m.type===c||rt(m)===c)&&u.push(m)}),{kind:"matched",nodes:u[o-1]?[u[o-1]]:[]}}const a=/^\*\*\/([A-Za-z_]\w*)$/.exec(n);return a?Ss(e,a[1]).length>0?{kind:"matched",nodes:Ss(e,a[1])}:{kind:"matched",nodes:[]}:{kind:"unsupported",nodes:[],reason:"Multi-segment class chain — use a real driver to verify"}}function Ac(e,s){const i=s.trim().split(/\s+AND\s+/i).map(c=>c.trim()),r=[];for(const c of i){const l=/^(\w+)\s*==\s*"([^"]*)"$/.exec(c);if(!l)return{kind:"unsupported",nodes:[],reason:"Predicate uses unsupported operator (only ==, AND) — use a real driver"};r.push({key:l[1],value:l[2]})}const a=[];return Te(e,c=>{for(const l of r){let o;if(l.key==="type"?o=c.type:l.key==="label"?o=Ee(c,"label")??c.label:l.key==="name"?o=Ee(c,"name")??c.name:l.key==="value"?o=Ee(c,"value")??c.value:o=Ee(c,l.key),o!==l.value)return}a.push(c)}),{kind:"matched",nodes:a}}function Rc(e,s,n){const i=s.toLowerCase();if(!n)return{kind:"matched",nodes:[]};switch(i){case"accessibility id":return{kind:"matched",nodes:bc(e,n)};case"id":return{kind:"matched",nodes:wc(e,n)};case"class name":return{kind:"matched",nodes:Ss(e,n)};case"name":return{kind:"matched",nodes:jc(e,n)};case"xpath":return Sc(e,n);case"-ios class chain":return kc(e,n);case"-ios predicate string":return Ac(e,n);default:return{kind:"unsupported",nodes:[],reason:`Strategy "${s}" not yet supported by snapshot matcher`}}}function on(e,s){const n=e.toLowerCase();if(n==="accessibility id")return/[0-9a-f]{8}-[0-9a-f]{4}/i.test(s)?{level:"fragile",reason:"UUID in accessibility ID — dynamically generated, unreliable"}:{level:"stable",reason:"#1 recommended by Appium — portable across Android & iOS"};if(n==="id")return/[0-9a-f]{8}-[0-9a-f]{4}/i.test(s)?{level:"fragile",reason:"UUID in resource ID — dynamically generated"}:/\d{6,}/.test(s)&&!s.includes(":id/")?{level:"moderate",reason:"Long numeric ID without package prefix — may not be unique"}:/^[a-z][a-z0-9.]+:id\//.test(s)?{level:"stable",reason:"Android resource-id with package prefix — #2 by Appium priority"}:{level:"stable",reason:"Element ID — #2 by Appium 2.x recommended priority"};if(n==="xpath"){if(s.startsWith("/hierarchy")||s.startsWith("/")&&!s.startsWith("//"))return{level:"very-fragile",reason:"ABSOLUTE XPath — breaks on any layout change. Avoid entirely"};if(/\[\d+\]/.test(s))return{level:"very-fragile",reason:"Index-based XPath [n] — breaks when element order changes"};const i=(s.match(/\//g)||[]).length;return i>7?{level:"fragile",reason:`${i}-level deep XPath — brittle to layout changes, 10x slower on iOS`}:s.includes("@content-desc")||s.includes("@resource-id")||s.includes("@text")?{level:"moderate",reason:"XPath with semantic attribute — more stable, but still prefer ID/accessibility id"}:{level:"fragile",reason:"XPath is a LAST RESORT per Appium docs — 10x slower on iOS, breaks on UI changes"}}return n==="-ios predicate string"?{level:"stable",reason:"iOS NSPredicate — native engine, excellent performance on iOS"}:n==="-ios class chain"?{level:"stable",reason:"iOS Class Chain — native iOS, faster than XPath"}:n==="-android uiautomator"?s.includes("resourceId")||s.includes("description")?{level:"stable",reason:"UIAutomator2 with resourceId/description — Android native, very reliable"}:s.includes("textContains")||s.includes("text(")?{level:"moderate",reason:"UIAutomator2 with text matching — breaks if copy changes"}:{level:"stable",reason:"UIAutomator2 — Android native engine, preferred over XPath on Android"}:n==="class name"?{level:"fragile",reason:"Class name alone is almost never unique — use with explicit index or prefer accessibility id"}:n==="name"?{level:"fragile",reason:"⚠️ Deprecated in Appium 2.x — replace with accessibility id or id"}:n==="link text"?{level:"moderate",reason:"Text-based locator — breaks if copy/label changes"}:{level:"moderate",reason:"Verify reliability for your target platform"}}function an(e,s,n,i){var N,j,w,D,$,T,I;const{strategy:r,value:a}=i,c=(e.text||e.name||((N=e.type)==null?void 0:N.split(".").pop())||"element").replace(/[^a-zA-Z0-9]/g,"_").replace(/^_+/,"").slice(0,24)||"element",l=c.charAt(0).toLowerCase()+c.slice(1),o=((j=e.type)==null?void 0:j.toLowerCase().includes("edit"))||((w=e.type)==null?void 0:w.toLowerCase().includes("input"))||((D=e.type)==null?void 0:D.toLowerCase().includes("field"))||(($=e.type)==null?void 0:$.toLowerCase().includes("textfield")),u=((T=e.attributes)==null?void 0:T.scrollable)==="true"||((I=e.attributes)==null?void 0:I.scrollable)===!0,m=r.toLowerCase().startsWith("-ios")&&s!=="ios"?`// ⚠️ -ios predicate/class chain ONLY work with XCUITest (iOS)
|
|
202
|
+
`:r.toLowerCase().startsWith("-android")&&s!=="android"?`// ⚠️ -android uiautomator ONLY works with UIAutomator2 (Android)
|
|
203
|
+
`:"",f={"accessibility id":`~${a}`,id:s==="ios"?`-ios predicate string:label == "${a}"`:`android=new UiSelector().resourceId("${a}")`,xpath:`${a}`,"-ios predicate string":`-ios predicate string:${a}`,"-ios class chain":`-ios class chain:${a}`,"-android uiautomator":`android=${a}`},p={"accessibility id":`AppiumBy.accessibilityId("${a}")`,id:`AppiumBy.id("${a}")`,xpath:`AppiumBy.xpath("${a}")`,"-ios predicate string":`AppiumBy.iOSNsPredicateString("${a}")`,"-ios class chain":`AppiumBy.iOSClassChain("${a}")`,"-android uiautomator":`AppiumBy.androidUIAutomator("${a}")`,"class name":`AppiumBy.className("${a}")`},y={"accessibility id":`AppiumBy.ACCESSIBILITY_ID, "${a}"`,id:`AppiumBy.ID, "${a}"`,xpath:`AppiumBy.XPATH, "${a}"`,"-ios predicate string":`AppiumBy.IOS_PREDICATE, "${a}"`,"-ios class chain":`AppiumBy.IOS_CLASS_CHAIN, "${a}"`,"-android uiautomator":`AppiumBy.ANDROID_UIAUTOMATOR, '${a}'`,"class name":`AppiumBy.CLASS_NAME, "${a}"`},g=p[r.toLowerCase()],b=y[r.toLowerCase()],v=f[r.toLowerCase()];return n==="java"?g?`${m}// Appium Java Client 9.x + Selenium 4 + TestNG
|
|
204
|
+
import io.appium.java_client.AppiumBy;
|
|
205
|
+
import io.appium.java_client.${s==="android"?"AndroidDriver":s==="ios"?"IOSDriver":"AppiumDriver"};
|
|
206
|
+
import org.openqa.selenium.WebElement;
|
|
207
|
+
import org.testng.annotations.Test;
|
|
208
|
+
|
|
209
|
+
@Test
|
|
210
|
+
public void test_${l}() {
|
|
211
|
+
WebElement element = driver.findElement(${g});
|
|
212
|
+
${u?'((Scrollable) element).scrollTo("target text");':o?`element.clear();
|
|
213
|
+
element.sendKeys("your text here");`:"element.click();"}
|
|
214
|
+
// Add assertions here via TestNG Assert or Hamcrest
|
|
215
|
+
}`:`// Strategy "${r}" not supported in Appium Java Client`:n==="python"?b?`${m}# Appium Python Client 4.x + pytest
|
|
216
|
+
from appium.webdriver.common.appiumby import AppiumBy
|
|
217
|
+
import pytest
|
|
218
|
+
|
|
219
|
+
def test_${l}(self):
|
|
220
|
+
element = self.driver.find_element(${b})
|
|
221
|
+
${o?`element.clear()
|
|
222
|
+
element.send_keys("your text here")`:"element.click()"}
|
|
223
|
+
# Add assertions here via assert or pytest.assert`:`# Strategy "${r}" not supported in Appium Python Client`:n==="javascript"?v?`${m}// WebdriverIO 9.x + @wdio/appium-service
|
|
224
|
+
describe('${l} test', () => {
|
|
225
|
+
it('should interact with ${l}', async () => {
|
|
226
|
+
const element = await $('${v}');
|
|
227
|
+
await element.waitForDisplayed({ timeout: 5000 });
|
|
228
|
+
${o?`await element.clearValue();
|
|
229
|
+
await element.addValue("your text here");`:"await element.click();"}
|
|
230
|
+
// Add assertions here via expect(element)
|
|
231
|
+
});
|
|
232
|
+
});`:`// Strategy "${r}" not supported in WebdriverIO mobile`:v?`${m}// WebdriverIO 9.x standalone
|
|
233
|
+
const element = await driver.$('${v}');
|
|
234
|
+
await element.waitForExist({ timeout: 5000 });
|
|
235
|
+
${o?`await driver.$('target').clearValue();
|
|
236
|
+
await element.addValue("your text here");`:"await element.click();"}
|
|
237
|
+
// Assert with expect(element).toBeDisplayed()`:`// Strategy "${r}" not supported in WebdriverIO mobile`}function cn(e){var y,g,b,v,k,N,j,w,D,$,T;const s=(e.type||"").toLowerCase(),n=((y=e.attributes)==null?void 0:y.clickable)==="true"||((g=e.attributes)==null?void 0:g.clickable)===!0,i=((b=e.attributes)==null?void 0:b.enabled)!=="false"&&((v=e.attributes)==null?void 0:v.enabled)!==!1,r=((k=e.attributes)==null?void 0:k.scrollable)==="true"||((N=e.attributes)==null?void 0:N.scrollable)===!0,a=e.text||e.label||e.value||"",c=((j=e.children)==null?void 0:j.length)||0;let l="Element",o="📦";s.includes("button")||s.includes("btn")||n&&c===0?(l="Button",o="🔘"):s.includes("edit")||s.includes("input")||s.includes("field")?(l="Text Input",o="✏️"):s.includes("image")||s.includes("img")||s.includes("imageview")?(l="Image",o="🖼️"):s.includes("scroll")||s.includes("recyclerview")||s.includes("listview")||r?(l="Scrollable List",o="📜"):s.includes("text")||s.includes("label")?(l="Text Label",o="📝"):s.includes("switch")||s.includes("toggle")||s.includes("checkbox")?(l="Toggle / Checkbox",o="☑️"):s.includes("nav")||s.includes("toolbar")||s.includes("tabbar")?(l="Navigation Bar",o="🧭"):c>0&&(l=`Container (${c} children)`,o="🗂️");const u=((w=e.suggestedLocators)==null?void 0:w.find(I=>I.strategy==="accessibility id"||I.strategy==="id"))||((D=e.suggestedLocators)==null?void 0:D[0]),m=i?(($=e.rect)==null?void 0:$.width)===0||((T=e.rect)==null?void 0:T.height)===0?"⚠️ Zero-size element — may not be interactable":void 0:"⚠️ Element is disabled",f=a?` with text "${a.slice(0,30)}"`:"",p=`This is a ${l.toLowerCase()}${f}. ${n?"It can be tapped/clicked.":r?"It supports scrolling.":"It is a visual container."}${c>0?` Contains ${c} child element${c>1?"s":""}.`:""}`;return{role:l,description:p,interactable:n||i,bestLocator:u,warning:m,emoji:o}}function ln(e,s){if(!s)return!0;const n=s.toLowerCase().trim(),i={button:["button","btn","clickable","tapable"],input:["edittext","input","field","textfield","textinput","edit"],image:["image","imageview","img","picture","photo","icon"],text:["textview","label","text","statictext"],list:["listview","recyclerview","scrollview","tableview","collectionview","scroll"],toggle:["switch","checkbox","toggle","radiobutton"],nav:["toolbar","navigationbar","tabbar","actionbar","navbar"]},r=(e.type||"").toLowerCase(),a=(e.text||e.label||e.value||"").toLowerCase(),c=(e.name||"").toLowerCase(),l=Object.values(e.attributes||{}).join(" ").toLowerCase();for(const[o,u]of Object.entries(i))if(n.includes(o)&&u.some(m=>r.includes(m)))return!0;return r.includes(n)||a.includes(n)||c.includes(n)||l.includes(n)}const Ec=({sessionId:e,udid:s,streamUrl:n,embedded:i=!1,overlayTarget:r=null,onModeChange:a})=>{var Rt,Et,$t,pt,Dt,Tt,It,gt,Lt,Mt;const[c,l]=d.useState(!0),[o,u]=d.useState(null),[m,f]=d.useState(null),[p,y]=d.useState(null),[g,b]=d.useState(null),[v,k]=d.useState(new Set(["/"])),[N,j]=d.useState(""),[w,D]=d.useState(null),[$,T]=d.useState("info"),[I,F]=d.useState("java"),[O,_]=d.useState(null),[U,W]=d.useState({width:0,height:0}),[q,Z]=d.useState({width:0,height:0}),[V,B]=d.useState(!1),[R,C]=d.useState("inspect");d.useEffect(()=>{a==null||a(R)},[R,a]);const[ne,ae]=d.useState({}),[Fe,ue]=d.useState({}),[me,ke]=d.useState(null),[ee,P]=d.useState(null),[J,se]=d.useState(null),re=d.useRef(null),he=d.useRef(null),Le=d.useRef(null),fe=d.useRef(null),ve=d.useCallback(()=>{var Q,G,Y;if(!re.current)return;const h=re.current.getBoundingClientRect(),A=h.width,M=h.height,x=(Q=o==null?void 0:o.hierarchy)==null?void 0:Q.rect;let S=((G=o==null?void 0:o.metadata)==null?void 0:G.screenWidth)||U.width||1,E=((Y=o==null?void 0:o.metadata)==null?void 0:Y.screenHeight)||U.height||1;x&&x.width>0&&x.height>0&&(S=x.width,E=x.height);const L=S/E;let K,z;A/M>L?(z=M,K=z*L):(K=A,z=K/L),Z({width:K,height:z})},[o,U]);d.useEffect(()=>(ve(),window.addEventListener("resize",ve),()=>window.removeEventListener("resize",ve)),[ve]),d.useEffect(()=>{s&&Ae()},[s]),d.useEffect(()=>{if(!s)return;let h=!1;return H.getAppiumSession(s).then(A=>{h||P({sessionId:(A==null?void 0:A.sessionId)??null,basePath:(A==null?void 0:A.basePath)??""})}).catch(()=>{h||P({sessionId:null,basePath:""})}),()=>{h=!0}},[s]);const Ue=d.useCallback(async(h,A,M)=>{if(ee!=null&&ee.sessionId){ke(h);try{const x=await H.verifyLocator(ee.basePath,ee.sessionId,{strategy:h,selector:A,action:M});ue(S=>({...S,[h]:x}))}catch(x){ue(S=>({...S,[h]:{found:!1,count:0,error:(x==null?void 0:x.message)||String(x)}}))}finally{ke(null)}}},[ee]);d.useEffect(()=>{var h;if((h=p==null?void 0:p.suggestedLocators)!=null&&h.length){const A=p.suggestedLocators.find(M=>M.strategy==="accessibility id"||M.strategy==="id")||p.suggestedLocators[0];_(A)}else _(null);ae({}),ue({}),se(null)},[p]);const Ke=d.useCallback((h,A)=>{if(!(o!=null&&o.hierarchy))return;const M=Rc(o.hierarchy,h,A);ae(x=>({...x,[h]:M})),se(h)},[o]),Ae=async()=>{if(s){l(!0),f(null);try{const h=await H.getInspectorSnapshot(s);if(!(h!=null&&h.hierarchy)){u(null),f((h==null?void 0:h.error)||"Failed to capture snapshot");return}u(h);const A=new Set(["/"]),M=(x,S)=>{var E;S<3&&(A.add(x.xpath),(E=x.children)==null||E.forEach(L=>M(L,S+1)))};M(h.hierarchy,0),k(A)}catch(h){u(null),f(h.message||"Failed to capture snapshot")}finally{l(!1)}}},ct=h=>{const{naturalWidth:A,naturalHeight:M}=h.currentTarget;W({width:A,height:M})},Me=()=>B(!0),Ge=h=>{B(!1);const{naturalWidth:A,naturalHeight:M}=h.currentTarget;A>0&&M>0&&W({width:A,height:M})},oe=n&&!V,Ye=h=>{if(R!=="interact"||!s)return;const A=h.currentTarget.getBoundingClientRect();fe.current={x:h.clientX-A.left,y:h.clientY-A.top,time:Date.now()}},lt=async h=>{var pe,_e,He;if(R!=="interact"||!s||!fe.current)return;const A=fe.current,M=h.currentTarget.getBoundingClientRect(),x=h.clientX-M.left,S=h.clientY-M.top,E=Date.now()-A.time,L=q.width,K=q.height,z=(pe=o==null?void 0:o.hierarchy)==null?void 0:pe.rect;let Q=((_e=o==null?void 0:o.metadata)==null?void 0:_e.screenWidth)||U.width,G=((He=o==null?void 0:o.metadata)==null?void 0:He.screenHeight)||U.height;if(z&&z.width>0&&z.height>0&&(Q=z.width,G=z.height),!Q||!G||L===0||K===0)return;const Y=(_t,zs)=>({x:Math.round(_t/L*Q),y:Math.round(zs/K*G),px:_t/L,py:zs/K}),te=Y(A.x,A.y),we=Y(x,S),Re=Math.sqrt(Math.pow(x-A.x,2)+Math.pow(S-A.y,2));if(!(te.px<0||te.px>1||te.py<0||te.py>1)){try{E<500&&Re<10?await H.tap(s,te.x,te.y):E>=500&&Re<10?await H.touchAndHold(s,te.x,te.y,E):Re>=10&&await H.swipe(s,te.x,te.y,we.x,we.y)}catch(_t){console.error("Interaction failed:",_t)}fe.current=null}},Ze=h=>{const A=new Set(v);A.has(h)?A.delete(h):A.add(h),k(A)},Ct=()=>{const h=new Set,A=M=>{var x;h.add(M.xpath),(x=M.children)==null||x.forEach(A)};o!=null&&o.hierarchy&&A(o.hierarchy),k(h)},St=()=>k(new Set(["/"])),ge=(h,A)=>{navigator.clipboard.writeText(h),D(A),setTimeout(()=>D(null),2e3)},be=h=>{var M;let A=1;return(M=h.children)==null||M.forEach(x=>A+=be(x)),A},dt=h=>{if(!h)return[];const A={},M=x=>{var L;const S=cn(x),E=S.role.replace(/\s*\(.*?\)\s*/,"");A[E]||(A[E]={emoji:S.emoji,count:0}),A[E].count+=1,(L=x.children)==null||L.forEach(M)};return M(h),Object.entries(A).map(([x,S])=>({role:x,emoji:S.emoji,count:S.count})).sort((x,S)=>S.count-x.count)},Je=h=>h.xpath.split("/").filter(Boolean).slice(-3),ut=(h,A=0)=>{var Y,te,we,Re;if(!h)return null;const M=v.has(h.xpath),x=((Y=h.children)==null?void 0:Y.length)>0,S=(p==null?void 0:p.xpath)===h.xpath,E=(g==null?void 0:g.xpath)===h.xpath,L=((te=h.type)==null?void 0:te.split(".").pop())||"Element",K=h.label||((we=h.attributes)==null?void 0:we["content-desc"])||((Re=h.attributes)==null?void 0:Re["resource-id"])||h.name,z=typeof K=="string"&&K&&K!==L&&K!==h.type?K:null,Q=z||L,G=!N||ln(h,N);if(!G&&!x)return null;if(N&&!G){const pe=_e=>{var He;return ln(_e,N)?!0:((He=_e.children)==null?void 0:He.some(pe))||!1};if(!pe(h))return null}return t.jsxs("div",{className:"tree-node",children:[t.jsxs("div",{className:`tree-item ${S?"selected":""} ${E&&!S?"hovered":""}`,onClick:()=>{y(h),T("info")},onMouseEnter:()=>b(h),onMouseLeave:()=>b(null),children:[t.jsx("div",{className:"tree-item-indent",style:{width:`${A*14}px`}}),x?t.jsx("button",{onClick:pe=>{pe.stopPropagation(),Ze(h.xpath)},className:"tree-toggle",children:M?t.jsx(yn,{size:11}):t.jsx(Sn,{size:11})}):t.jsx("span",{className:"tree-toggle-spacer"}),t.jsx(Oi,{size:11,className:"tree-icon"}),t.jsx("span",{className:"tree-label",title:`${L}${z?` — ${z}`:""}`,children:Q}),z&&t.jsx("span",{className:"tree-type-tag",title:L,children:L}),h.text&&t.jsxs("span",{className:"tree-text-preview",children:['"',h.text.slice(0,20),'"']}),x&&t.jsx("span",{className:"tree-badge",children:h.children.length})]}),M&&x&&t.jsx("div",{className:"tree-children",children:h.children.map(pe=>ut(pe,A+1))})]},h.xpath)},kt=()=>{var x,S,E;const h=(x=o==null?void 0:o.hierarchy)==null?void 0:x.rect;if(h&&h.width>0&&h.height>0)return{w:h.width,h:h.height};const A=((S=o==null?void 0:o.metadata)==null?void 0:S.screenWidth)||U.width,M=((E=o==null?void 0:o.metadata)==null?void 0:E.screenHeight)||U.height;return A>0&&M>0?{w:A,h:M}:null},mt=h=>{const A=kt();if(!A)return[];const M=[],{w:x,h:S}=A,E=(L,K)=>{var Q,G,Y;const z=!L.children||L.children.length===0;((Q=L.rect)==null?void 0:Q.width)>0&&((G=L.rect)==null?void 0:G.height)>0&&z&&M.push(t.jsx("div",{className:"omni-hit-area",style:{left:`${L.rect.x/x*100}%`,top:`${L.rect.y/S*100}%`,width:`${L.rect.width/x*100}%`,height:`${L.rect.height/S*100}%`,zIndex:K},onClick:te=>{te.stopPropagation(),y(L),T("info")},onMouseEnter:()=>b(L),onMouseLeave:()=>b(null)},L.xpath)),(Y=L.children)==null||Y.forEach(te=>E(te,K+1))};return o!=null&&o.hierarchy&&E(o.hierarchy,1),M},Be=()=>{var E,L,K;if(!J||!U.width)return[];const h=ne[J];if(!h||h.kind!=="matched"||h.nodes.length===0)return[];const A=(E=o==null?void 0:o.hierarchy)==null?void 0:E.rect;let M=((L=o==null?void 0:o.metadata)==null?void 0:L.screenWidth)||U.width,x=((K=o==null?void 0:o.metadata)==null?void 0:K.screenHeight)||U.height;A&&A.width>0&&A.height>0&&(M=A.width,x=A.height);const S=h.nodes.length===1?"omni-frame-match unique":"omni-frame-match multi";return h.nodes.filter(z=>z.rect&&z.rect.width>0&&z.rect.height>0).map((z,Q)=>t.jsx("div",{className:S,style:{left:`${z.rect.x/M*100}%`,top:`${z.rect.y/x*100}%`,width:`${z.rect.width/M*100}%`,height:`${z.rect.height/x*100}%`}},`match-${J}-${Q}`))},We=(h,A)=>{const M=kt();if(!(h!=null&&h.rect)||!M)return null;const{w:x,h:S}=M;return t.jsx("div",{className:`omni-frame-${A}`,style:{left:`${h.rect.x/x*100}%`,top:`${h.rect.y/S*100}%`,width:`${h.rect.width/x*100}%`,height:`${h.rect.height/S*100}%`}})},ht=o!=null&&o.hierarchy?be(o.hierarchy):0,ce=p?cn(p):null,ft=o!=null&&o.hierarchy&&R==="inspect"?t.jsxs("div",{className:"omni-overlay",children:[mt(o.hierarchy),Be(),We(g,"hover"),We(p,"select")]}):null,ns={stable:{icon:t.jsx(Ot,{size:10}),cls:"stable"},moderate:{icon:t.jsx(et,{size:10}),cls:"moderate"},fragile:{icon:t.jsx(Qe,{size:10}),cls:"fragile"},"very-fragile":{icon:t.jsx(Qe,{size:10}),cls:"very-fragile"}},At=i&&(o!=null&&o.hierarchy)?dt(o.hierarchy):[];return t.jsxs("div",{className:`omni-inspector-container ${i?"omni-embedded":""}`,children:[i&&r&&ft?gn.createPortal(ft,r):null,t.jsxs("div",{className:"omni-main-content",children:[!i&&t.jsxs("div",{className:"omni-screenshot-panel",children:[t.jsxs("div",{className:"omni-screenshot-header",children:[t.jsxs("div",{className:"omni-header-left",children:[t.jsx("span",{className:"omni-screenshot-title",children:"Device Preview"}),t.jsxs("div",{className:"omni-mode-toggle",children:[t.jsxs("button",{className:`omni-mode-btn ${R==="inspect"?"active":""}`,onClick:()=>C("inspect"),title:"Inspection mode (highlight elements)",children:[t.jsx(Ws,{size:12}),t.jsx("span",{children:"Inspect"})]}),t.jsxs("button",{className:`omni-mode-btn ${R==="interact"?"active":""}`,onClick:()=>C("interact"),title:"Interaction mode (direct control)",children:[t.jsx(Vs,{size:12}),t.jsx("span",{children:"Interact"})]})]})]}),t.jsxs("button",{className:"omni-refresh-btn",onClick:Ae,disabled:c,children:[t.jsx(yt,{size:12,className:c?"animate-spin":""}),c?"Capturing...":"Refresh"]})]}),t.jsxs("div",{className:"omni-screenshot-container",ref:re,children:[c&&!oe&&t.jsxs("div",{className:"omni-loading-overlay",children:[t.jsx("div",{className:"omni-spinner"}),t.jsx("span",{children:"Capturing screen..."})]}),!o&&!c&&!oe&&t.jsxs("div",{className:"omni-empty-state",children:[t.jsx(ls,{size:40}),t.jsx("span",{children:"Click Refresh to capture"})]}),oe&&t.jsxs("div",{className:`omni-screenshot-wrapper ${R==="interact"?"interactable":""}`,onMouseDown:Ye,onMouseUp:lt,children:[t.jsx("img",{ref:Le,src:n,onLoad:Ge,onError:Me,className:"omni-screenshot-img",style:R==="interact"?{pointerEvents:"none"}:{},draggable:!1,alt:"Live Device Stream"}),ft]}),!oe&&(o==null?void 0:o.screenshot)&&t.jsxs("div",{className:`omni-screenshot-wrapper ${R==="interact"?"interactable":""}`,onMouseDown:Ye,onMouseUp:lt,children:[t.jsx("img",{ref:he,src:`data:image/png;base64,${o.screenshot}`,onLoad:ct,className:"omni-screenshot-img",style:R==="interact"?{pointerEvents:"none"}:{},draggable:!1}),R==="inspect"&&t.jsxs("div",{className:"omni-overlay",children:[mt(o.hierarchy),Be(),We(g,"hover"),We(p,"select")]})]})]})]}),t.jsxs("div",{className:"omni-tree-panel",children:[t.jsxs("div",{className:"omni-tree-header",children:[t.jsxs("div",{className:"omni-tree-title",children:[t.jsx(bi,{size:14}),t.jsx("span",{children:"Source"}),ht>0&&t.jsxs("span",{className:"omni-count-badge",children:[ht," elements"]}),(o==null?void 0:o.hierarchySource)&&t.jsx("span",{className:`omni-source-badge ${o.hierarchySource==="appium-session"?"is-session":"is-device"}`,title:o.hierarchySource==="appium-session"?`From Appium session ${o.sessionId} — the same tree the driver resolves locators against`:"Read from the device. No Appium session is driving it.",children:o.hierarchySource==="appium-session"?"Session":"Device"})]}),t.jsxs("div",{className:"omni-tree-actions",children:[t.jsx("button",{onClick:Ct,className:"omni-action-btn",title:"Expand all",children:t.jsx(er,{size:12})}),t.jsx("button",{onClick:St,className:"omni-action-btn",title:"Collapse all",children:t.jsx(gr,{size:12})}),i&&t.jsxs(t.Fragment,{children:[t.jsx("button",{onClick:()=>C(R==="inspect"?"interact":"inspect"),className:`omni-action-btn ${R==="inspect"?"active":""}`,title:R==="inspect"?"Inspect mode — click the device to select an element":"Interact mode — clicks control the device","aria-pressed":R==="inspect",children:R==="inspect"?t.jsx(Ws,{size:12}):t.jsx(Vs,{size:12})}),t.jsx("button",{onClick:Ae,className:"omni-action-btn",title:c?"Capturing…":"Refresh snapshot",disabled:c,children:t.jsx(yt,{size:12,className:c?"animate-spin":""})})]})]})]}),m&&!c&&t.jsxs("div",{className:"omni-tree-error",role:"alert",children:[t.jsx(Qe,{size:12}),t.jsx("span",{children:m}),t.jsx("button",{type:"button",onClick:Ae,className:"omni-tree-error-retry",children:"Retry"})]}),t.jsxs("div",{className:"omni-tree-search",children:[t.jsx(ai,{size:14}),t.jsx("input",{type:"text",placeholder:"Search elements... (try 'login button' or 'text field')",value:N,onChange:h=>j(h.target.value),"aria-label":"Search elements"}),N&&t.jsx("button",{onClick:()=>j(""),className:"omni-clear-btn",children:"×"})]}),N&&t.jsxs("div",{className:"omni-search-hint",children:[t.jsx(vs,{size:10}),' Smart search active — try "button", "input", "image"']}),t.jsx("div",{className:"omni-tree-content",children:o!=null&&o.hierarchy?ut(o.hierarchy):t.jsx("div",{className:"omni-empty-state small",children:t.jsx("span",{children:"No hierarchy loaded"})})})]}),t.jsxs("div",{className:"omni-details-panel",children:[t.jsxs("div",{className:"omni-details-tabs",role:"tablist",children:[t.jsxs("button",{className:`omni-details-tab ${$==="info"?"active":""}`,onClick:()=>T("info"),role:"tab","aria-selected":$==="info",children:[t.jsx(or,{size:12})," ",t.jsx("span",{children:"Info"})]}),t.jsxs("button",{className:`omni-details-tab ${$==="insight"?"active":""}`,onClick:()=>T("insight"),disabled:!p,title:"AI element analysis",role:"tab","aria-selected":$==="insight",children:[t.jsx(sr,{size:12})," ",t.jsx("span",{children:"AI Insight"})]}),t.jsxs("button",{className:`omni-details-tab ${$==="code"?"active":""}`,onClick:()=>T("code"),disabled:!p,title:"Generate test code",role:"tab","aria-selected":$==="code",children:[t.jsx(Hs,{size:12})," ",t.jsx("span",{children:"Code Gen"})]})]}),t.jsx("div",{className:"omni-details-content",children:p?t.jsxs(t.Fragment,{children:[$==="info"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"omni-section",children:[t.jsx("div",{className:"omni-section-header",children:"Element Info"}),t.jsxs("div",{className:"omni-info-table",children:[t.jsxs("div",{className:"omni-info-row",children:[t.jsx("span",{className:"omni-info-key",children:"Type"}),t.jsx("span",{className:"omni-info-value mono",children:p.type})]}),p.text&&t.jsxs("div",{className:"omni-info-row",children:[t.jsx("span",{className:"omni-info-key",children:"Text"}),t.jsx("span",{className:"omni-info-value",children:p.text})]}),t.jsxs("div",{className:"omni-info-row",children:[t.jsx("span",{className:"omni-info-key",children:"Path"}),t.jsx("span",{className:"omni-info-value mono small",children:Je(p).join(" › ")})]})]})]}),t.jsxs("div",{className:"omni-section",children:[t.jsx("div",{className:"omni-section-header",children:"Layout"}),t.jsx("div",{className:"omni-layout-grid",children:["x","y","width","height"].map(h=>t.jsxs("div",{className:"omni-layout-item",children:[t.jsx("span",{className:"omni-layout-label",children:h.toUpperCase()}),t.jsx("span",{className:"omni-layout-value",children:p.rect[h]})]},h))})]}),t.jsxs("div",{className:"omni-section",children:[t.jsxs("div",{className:"omni-section-header",children:["Locators",t.jsx("span",{className:"omni-section-badge",children:"Stability Scored"})]}),t.jsxs("div",{className:"omni-locators-list",children:[!(($t=p.suggestedLocators)!=null&&$t.length)&&t.jsx("div",{className:"omni-locators-empty",children:p===(o==null?void 0:o.hierarchy)?"This is the XML document root, not a UI element — no Appium locator can select it. Pick a node beneath it.":"No locator could be derived for this node."}),(pt=p.suggestedLocators)==null?void 0:pt.map(h=>{const A=on(h.strategy,h.value),M=ns[A.level],x=ne[h.strategy];let S=null;return x&&(x.kind==="unsupported"?S=t.jsxs("span",{className:"omni-match-badge unsupported",title:x.reason||"Cannot evaluate without a real driver",children:[t.jsx(Vi,{size:10})," preview unavailable"]}):x.nodes.length===0?S=t.jsxs("span",{className:"omni-match-badge zero",title:"No element matches this selector in the current snapshot",children:[t.jsx(Qe,{size:10})," 0 matches"]}):x.nodes.length===1?S=t.jsxs("span",{className:"omni-match-badge unique",title:"Selector is unique in the current snapshot",children:[t.jsx(Ot,{size:10})," unique"]}):S=t.jsxs("span",{className:"omni-match-badge multi",title:`${x.nodes.length} elements match — selector is not unique`,children:[t.jsx(et,{size:10})," ",x.nodes.length," matches"]})),t.jsxs("div",{className:`omni-locator-row ${(O==null?void 0:O.strategy)===h.strategy?"selected-for-code":""}`,onClick:()=>_(h),title:"Click to use in Code Generator",children:[t.jsxs("div",{className:"omni-locator-left",children:[t.jsxs("div",{className:"omni-locator-top",children:[t.jsx("span",{className:"omni-locator-strategy",children:h.strategy}),t.jsxs("span",{className:`omni-stability-badge ${M.cls}`,title:A.reason,children:[M.icon,A.level]}),S]}),t.jsx("code",{className:"omni-locator-value",children:h.value}),t.jsx("span",{className:"omni-stability-reason",children:A.reason}),(()=>{const E=Fe[h.strategy];return E?E.error?t.jsxs("span",{className:"omni-verify-line is-error",children:[t.jsx(Qe,{size:10})," Appium error: ",E.error]}):E.found?E.count>1?t.jsxs("span",{className:"omni-verify-line is-warn",children:[t.jsx(et,{size:10})," Ambiguous — Appium found"," ",E.count," elements",E.actionError?` · ${E.actionError}`:""]}):t.jsxs("span",{className:"omni-verify-line is-ok",children:[t.jsx(Ot,{size:10})," Appium found 1 element",E.elapsedMs!=null?` in ${E.elapsedMs}ms`:"",E.actionPerformed&&E.actionPerformed!=="none"?` · ${E.actionPerformed} ok`:"",E.actionError?` · action failed: ${E.actionError}`:""]}):t.jsxs("span",{className:"omni-verify-line is-error",children:[t.jsx(Qe,{size:10})," Appium found 0 elements"]}):null})()]}),t.jsxs("div",{className:"omni-locator-actions",children:[t.jsx("button",{type:"button",onClick:E=>{E.stopPropagation(),Ke(h.strategy,h.value)},className:`omni-test-btn ${J===h.strategy?"active":""}`,title:"Test this locator against the current snapshot",children:t.jsx(Yi,{size:12})}),t.jsx("button",{type:"button",disabled:!(ee!=null&&ee.sessionId)||me===h.strategy,onClick:E=>{E.stopPropagation(),Ue(h.strategy,h.value,"none")},className:"omni-test-btn",title:ee!=null&&ee.sessionId?"Verify with Appium — does the driver actually find this?":"Needs an active Appium session on this device",children:me===h.strategy?t.jsx(yt,{size:12,className:"animate-spin"}):t.jsx(Ot,{size:12})}),t.jsx("button",{type:"button",disabled:!(ee!=null&&ee.sessionId)||me===h.strategy,onClick:E=>{E.stopPropagation(),Ue(h.strategy,h.value,"tap")},className:"omni-test-btn",title:ee!=null&&ee.sessionId?"Find with Appium and tap the element it returns":"Needs an active Appium session on this device",children:t.jsx(ys,{size:12})}),t.jsx("button",{onClick:E=>{E.stopPropagation(),ge(h.value,h.strategy)},className:`omni-copy-btn ${w===h.strategy?"copied":""}`,children:w===h.strategy?t.jsx(Bt,{size:12}):t.jsx(qe,{size:12})})]})]},h.strategy)})]})]}),t.jsxs("div",{className:"omni-section",children:[t.jsx("div",{className:"omni-section-header",children:"Attributes"}),t.jsx("div",{className:"omni-attributes-table",children:Object.entries(p.attributes||{}).filter(([h,A])=>A!=null&&A!=="").map(([h,A])=>t.jsxs("div",{className:"omni-attr-row",children:[t.jsx("span",{className:"omni-attr-key",children:h}),t.jsx("span",{className:"omni-attr-value",children:String(A)})]},h))})]})]}),$==="insight"&&ce&&t.jsxs("div",{className:"omni-insight-panel",children:[t.jsxs("div",{className:"omni-insight-role",children:[t.jsx("span",{className:"omni-insight-emoji",children:ce.emoji}),t.jsxs("div",{children:[t.jsx("div",{className:"omni-insight-role-name",children:ce.role}),t.jsx("div",{className:"omni-insight-interactable",children:ce.interactable?t.jsxs("span",{className:"omni-badge-green",children:[t.jsx(ys,{size:10})," Interactable"]}):t.jsx("span",{className:"omni-badge-gray",children:"Visual Only"})})]})]}),ce.warning&&t.jsx("div",{className:"omni-insight-warning",children:ce.warning}),t.jsxs("div",{className:"omni-insight-description",children:[t.jsx(vs,{size:12,className:"omni-insight-icon"}),t.jsx("p",{children:ce.description})]}),ce.bestLocator&&t.jsxs("div",{className:"omni-insight-best-locator",children:[t.jsx("div",{className:"omni-section-header",children:"Recommended Locator"}),t.jsxs("div",{className:"omni-locator-row",children:[t.jsxs("div",{className:"omni-locator-left",children:[t.jsx("span",{className:"omni-locator-strategy",children:ce.bestLocator.strategy}),t.jsx("code",{className:"omni-locator-value",children:ce.bestLocator.value})]}),t.jsx("button",{onClick:()=>ge(ce.bestLocator.value,"best"),className:`omni-copy-btn ${w==="best"?"copied":""}`,children:w==="best"?t.jsx(Bt,{size:12}):t.jsx(qe,{size:12})})]})]}),t.jsxs("div",{className:"omni-insight-attributes",children:[t.jsx("div",{className:"omni-section-header",children:"Quick Facts"}),t.jsx("div",{className:"omni-quick-facts",children:[{label:"Clickable",value:(Dt=p.attributes)==null?void 0:Dt.clickable},{label:"Enabled",value:(Tt=p.attributes)==null?void 0:Tt.enabled},{label:"Scrollable",value:(It=p.attributes)==null?void 0:It.scrollable},{label:"Focusable",value:(gt=p.attributes)==null?void 0:gt.focusable},{label:"Children",value:((Lt=p.children)==null?void 0:Lt.length)||0}].map(({label:h,value:A})=>t.jsxs("div",{className:"omni-quick-fact-row",children:[t.jsx("span",{className:"omni-quick-fact-label",children:h}),t.jsx("span",{className:`omni-quick-fact-value ${A==="true"||A===!0?"true":""}`,children:String(A??"—")})]},h))})]})]}),$==="code"&&t.jsxs("div",{className:"omni-codegen-panel",children:[t.jsx("div",{className:"omni-codegen-frameworks",children:["java","python","javascript","wdio"].map(h=>t.jsx("button",{className:`omni-fw-btn ${I===h?"active":""}`,onClick:()=>F(h),children:h==="java"?"☕ Java":h==="python"?"🐍 Python":h==="javascript"?"🟨 JS":"🔷 WD.io"},h))}),O?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"omni-codegen-locator-selector",children:[t.jsx("span",{className:"omni-codegen-label",children:"Locator:"}),t.jsx(Jt,{selectSize:"sm",value:O.strategy,onChange:h=>{var M;const A=(M=p.suggestedLocators)==null?void 0:M.find(x=>x.strategy===h.target.value);A&&_(A)},className:"flex-1",children:(Mt=p.suggestedLocators)==null?void 0:Mt.map(h=>t.jsxs("option",{value:h.strategy,children:[h.strategy," — ",on(h.strategy,h.value).level]},h.strategy))})]}),t.jsxs("div",{className:"omni-codegen-output",children:[t.jsxs("div",{className:"omni-codegen-header",children:[t.jsx("span",{className:"omni-codegen-lang",children:I==="java"?"Java / TestNG":I==="python"?"Python / unittest":I==="javascript"?"JavaScript / Mocha":"WebdriverIO"}),t.jsx("button",{className:"omni-copy-btn",onClick:()=>ge(an(p,(o==null?void 0:o.platform)==="android"?"android":(o==null?void 0:o.platform)==="ios"?"ios":"unknown",I,O),"code"),children:w==="code"?t.jsx(Bt,{size:12}):t.jsx(qe,{size:12})})]}),t.jsx("pre",{className:"omni-codegen-pre theme-dark",children:t.jsx("code",{children:an(p,(o==null?void 0:o.platform)==="android"?"android":(o==null?void 0:o.platform)==="ios"?"ios":"unknown",I,O)})})]})]}):t.jsxs("div",{className:"omni-empty-state small",children:[t.jsx(Hs,{size:24}),t.jsx("span",{children:"No locators available for this element"})]})]})]}):o!=null&&o.hierarchy?t.jsxs("div",{className:"omni-summary-panel",children:[t.jsxs("div",{className:"omni-summary-hero",children:[t.jsx(ls,{size:28}),t.jsxs("div",{children:[t.jsx("div",{className:"omni-summary-title",children:"No element selected"}),t.jsx("div",{className:"omni-summary-subtitle",children:"Click any node in the tree (or use Inspect mode on the device) to drill in."})]})]}),t.jsxs("div",{className:"omni-section",children:[t.jsx("div",{className:"omni-section-header",children:"Snapshot Stats"}),t.jsxs("div",{className:"omni-summary-stats",children:[t.jsxs("div",{className:"omni-summary-stat",children:[t.jsx("span",{className:"omni-summary-stat__label",children:"Elements"}),t.jsx("span",{className:"omni-summary-stat__value",children:ht})]}),t.jsxs("div",{className:"omni-summary-stat",children:[t.jsx("span",{className:"omni-summary-stat__label",children:"Width"}),t.jsx("span",{className:"omni-summary-stat__value",children:((Rt=o.metadata)==null?void 0:Rt.screenWidth)??U.width??"—"})]}),t.jsxs("div",{className:"omni-summary-stat",children:[t.jsx("span",{className:"omni-summary-stat__label",children:"Height"}),t.jsx("span",{className:"omni-summary-stat__value",children:((Et=o.metadata)==null?void 0:Et.screenHeight)??U.height??"—"})]}),t.jsxs("div",{className:"omni-summary-stat",children:[t.jsx("span",{className:"omni-summary-stat__label",children:"Platform"}),t.jsx("span",{className:"omni-summary-stat__value",children:o.platform||"—"})]})]})]}),At.length>0&&t.jsxs("div",{className:"omni-section",children:[t.jsx("div",{className:"omni-section-header",children:"By Role"}),t.jsx("div",{className:"omni-summary-roles",children:At.slice(0,8).map(h=>t.jsxs("div",{className:"omni-summary-role",children:[t.jsx("span",{className:"omni-summary-role__emoji",children:h.emoji}),t.jsx("span",{className:"omni-summary-role__name",children:h.role}),t.jsx("span",{className:"omni-summary-role__count",children:h.count})]},h.role))})]})]}):t.jsxs("div",{className:"omni-empty-state",children:[t.jsx(ls,{size:32}),t.jsx("span",{children:c?"Capturing snapshot…":"Select an element from the tree or screenshot"})]})})]})]})]})},dn=5e3;function $c(e,s=!0){const[n,i]=d.useState("unknown"),r=d.useRef("unknown");return d.useEffect(()=>{if(!e||!s){i("unknown"),r.current="unknown";return}let a=!1,c;const l=m=>{a||m===r.current||(r.current=m,i(m))},o=async()=>{if(!a){if(c&&(clearTimeout(c),c=void 0),typeof document<"u"&&document.visibilityState==="hidden"){c=setTimeout(o,dn);return}try{const m=await H.getDisplayState(e);l((m==null?void 0:m.state)??"unknown")}catch{}a||(c=setTimeout(o,dn))}};o();const u=()=>{document.visibilityState==="visible"&&o()};return document.addEventListener("visibilitychange",u),()=>{a=!0,c&&clearTimeout(c),document.removeEventListener("visibilitychange",u)}},[e,s]),n}const un=5e3,Dc=500,Tc=1e4,Ic=10,Lc=50;function Mc(e,s,n){const i=`${((n==null?void 0:n.levels)??[]).join(",")}|${(n==null?void 0:n.process)??""}`,[r,a]=d.useState([]),[c,l]=d.useState(!1),[o,u]=d.useState(null),[m,f]=d.useState(!1),p=d.useRef(null),y=d.useRef(0),g=d.useRef(void 0),b=d.useRef(()=>{}),v=d.useRef([]),k=d.useRef(void 0),N=d.useRef(0),j=d.useRef(void 0),w=d.useCallback(()=>{if(v.current.length===0)return;const I=v.current;v.current=[],a(F=>{const O=F.concat(I);return O.length>un?O.slice(-un):O})},[]),D=d.useCallback(()=>{k.current===void 0&&(k.current=window.setTimeout(()=>{k.current=void 0,w()},Lc))},[w]),$=d.useCallback(()=>{v.current=[],a([])},[]);d.useEffect(()=>{if(!s){l(!1),u(null),f(!1);return}u(null),f(!1),y.current=0;const I={cancelled:!1},F=()=>{if(I.cancelled)return;if(y.current>=Ic){f(!0);return}const _=Math.min(Dc*2**y.current,Tc);y.current+=1,g.current=window.setTimeout(O,_)},O=async()=>{if(!I.cancelled)try{const _=await fetch(`/xenon/api/control/${encodeURIComponent(e)}/stream/ticket`,{method:"POST",credentials:"include"});if(I.cancelled)return;if(!_.ok){F();return}const{ticket:U}=await _.json();if(I.cancelled)return;if(!U){F();return}const W=window.location.protocol==="https:"?"wss":"ws",[q,Z]=i.split("|"),V=(q?`&levels=${encodeURIComponent(q)}`:"")+(Z?`&process=${encodeURIComponent(Z)}`:""),B=new WebSocket(`${W}://${window.location.host}/xenon/api/control/${encodeURIComponent(e)}/logcat?ticket=${encodeURIComponent(U)}${V}`);p.current=B,B.onopen=()=>{y.current=0,j.current!==1012&&(v.current=[],a([])),j.current=void 0,l(!0)},B.onmessage=R=>{try{const C=JSON.parse(R.data);v.current.push({...C,seq:N.current++}),D()}catch{}},B.onclose=R=>{if(l(!1),j.current=R.code,w(),R.code===1008){I.cancelled=!0,u(R.reason||"access denied");return}if(R.code===1012){F();return}console.warn(`[logcat] WS closed unexpectedly (code ${R.code}) — retrying`),F()},B.onerror=()=>B.close()}catch{F()}};return b.current=()=>{I.cancelled=!1,y.current=0,u(null),f(!1),O()},O(),()=>{var _;I.cancelled=!0,g.current!==void 0&&window.clearTimeout(g.current),k.current!==void 0&&(window.clearTimeout(k.current),k.current=void 0),w(),(_=p.current)==null||_.close(),p.current=null}},[e,s,i,w,D]);const T=d.useCallback(()=>{b.current()},[]);return{records:r,connected:c,clear:$,deniedReason:o,exhausted:m,retry:T}}const ks=["V","D","I","W","E","F"];function _c(e){const s=[];let n="",i=!1,r=!1;for(const a of e){if(a==='"'){i=!i,r=!0;continue}if(!i&&/\s/.test(a)){(r||n)&&s.push(n),n="",r=!1;continue}n+=a,r=!0}return(r||n)&&s.push(n),s.filter(a=>a.length>0)}function ti(e,s={}){const n=s.caseSensitive===!0,i=c=>n?c:c.toLowerCase(),r=n?{caseSensitive:!0}:{},a=[];for(const c of _c(e)){const[l,...o]=c.split(":"),u=o.join(":");u&&l.toLowerCase()==="level"?r.minLevel=u.toUpperCase():u&&l.toLowerCase()==="tag"?r.tag=i(u):u&&l.toLowerCase()==="package"?r.pkg=i(u):a.push(c)}return a.length&&(r.text=i(a.join(" "))),r}function Oc(e,s){if(e.synthetic)return!0;if(s.minLevel){const i=ks.indexOf(s.minLevel),r=ks.indexOf(e.level);if(i>=0&&r>=0&&r<i)return!1}const n=i=>s.caseSensitive?i:i.toLowerCase();return!(s.tag&&!n(e.tag).includes(s.tag)||s.pkg&&!n(e.pkg??"").includes(s.pkg)||s.text&&!n(e.message).includes(s.text))}function Pc(e,s){const n=e.trim().split(/\s+/).filter(Boolean).filter(i=>{const[r,...a]=i.split(":");return!(a.join(":")&&r.toLowerCase()==="level")});return s?["level:"+s.toUpperCase(),...n].join(" "):n.join(" ")}const xs=[{ios:"Debug",android:"D"},{ios:"Info",android:"I"},{ios:"Default",android:"I"},{ios:"Error",android:"E"},{ios:"Fault",android:"F"}],mn=["V","D","I","W","E","F"];function zc(e){if(!e)return xs.filter(n=>n.ios!=="Debug").map(n=>n.ios);const s=mn.indexOf(e.toUpperCase());return s<0?xs.map(n=>n.ios):xs.filter(n=>mn.indexOf(n.android)>=s).map(n=>n.ios)}function Fc(e){const s=ti(e,{caseSensitive:!0});return{levels:zc(s.minLevel),process:s.pkg||void 0}}const hn=["#7dd3fc","#c4b5fd","#5eead4","#f0abfc","#93c5fd","#a5b4fc","#67e8f9","#d8b4fe","#f9a8d4","#99f6e4","#bae6fd","#e9d5ff"];function Uc(e){let s=2166136261;for(let n=0;n<e.length;n++)s^=e.charCodeAt(n),s=Math.imul(s,16777619)>>>0;return s>>>0}function Bc(e){return e?hn[Uc(e)%hn.length]:"var(--text-muted)"}const As=5e5;function si(e){return`${new Date(e.ts).toISOString()} ${e.pid} ${e.level}/${e.tag}: ${e.message}`}function Wc(e){return{lines:[],startedAt:e,dropped:0}}function Hc(e,s){for(const n of s){if(e.lines.length>=As){e.dropped+=1;continue}e.lines.push(si(n))}return e}function Vc(e,s,n){const i=["# Xenon logcat recording",`# device: ${n}`,`# started: ${new Date(e.startedAt).toISOString()}`,`# stopped: ${new Date(s).toISOString()}`,`# duration: ${((s-e.startedAt)/1e3).toFixed(1)}s`,`# lines: ${e.lines.length}`];e.dropped>0&&i.push(`# TRUNCATED: ${e.dropped} further line(s) were dropped after the ${As}-line cap. This capture is INCOMPLETE.`);const r=e.lines.join(`
|
|
238
|
+
`),a=e.dropped>0?`
|
|
239
|
+
# --- TRUNCATED: ${e.dropped} line(s) not captured (cap ${As}) ---`:"";return`${i.join(`
|
|
240
|
+
`)}
|
|
241
|
+
|
|
242
|
+
${r}${a}
|
|
243
|
+
`}function qc(e,s){const n=new Date(s).toISOString().replace(/[:.]/g,"-").replace(/Z$/,"");return`logcat-${e}-${n}.txt`}const fn=ks.filter(e=>e!=="V").map(e=>({value:e,label:e==="F"?"F only":`${e} and above`})),Xc=new Intl.DateTimeFormat([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1});function pn(e,s){const n=URL.createObjectURL(new Blob([e],{type:"text/plain"})),i=document.createElement("a");i.href=n,i.download=s,i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i),setTimeout(()=>URL.revokeObjectURL(n),0)}const Kc=d.memo(function({record:s,index:n,isHit:i,isActiveHit:r}){return t.jsxs("div",{"data-row-index":n,className:`logcat-row ${s.synthetic?"is-synthetic":""} ${i?"is-hit":""} ${r?"is-active-hit":""}`,children:[t.jsx("span",{className:"logcat-time",children:Xc.format(s.ts)}),t.jsxs("span",{className:"logcat-pid",children:[s.pid,"-",s.tid]}),t.jsx("span",{className:"logcat-tag",title:s.tag,style:{color:Bc(s.tag)},children:s.tag}),t.jsx("span",{className:"logcat-pkg",title:s.pkg,children:s.pkg??""}),t.jsx("span",{className:`logcat-level lvl-${s.level}`,children:s.level}),t.jsx("span",{className:"logcat-msg",children:s.message})]})});function Gc({udid:e,platform:s}){const n=(s||"").toLowerCase(),i=n==="ios",r=n==="android"||i,[a,c]=d.useState(""),l=d.useMemo(()=>i?Fc(a):void 0,[i,a]),{records:o,connected:u,clear:m,deniedReason:f,exhausted:p,retry:y}=Mc(e,r,l),[g,b]=d.useState(!0),[v,k]=d.useState(!1),[N,j]=d.useState(!0),[w,D]=d.useState(""),[$,T]=d.useState(0),I=d.useRef(null),F=d.useRef(null),O=d.useRef(null),[_,U]=d.useState(!1),[W,q]=d.useState(0),Z=d.useRef(-1),V=d.useMemo(()=>ti(a,{caseSensitive:v}),[a,v]),B=d.useMemo(()=>o.filter(P=>Oc(P,V)),[o,V]),R=d.useMemo(()=>{if(!w)return[];const P=v?w:w.toLowerCase(),J=[];return B.forEach((se,re)=>{(v?`${se.tag} ${se.message}`:`${se.tag} ${se.message}`.toLowerCase()).includes(P)&&J.push(re)}),J},[B,w,v]),C=R.length?Math.min($,R.length-1):0,ne=d.useMemo(()=>new Set(R),[R]),ae=d.useCallback(P=>{var se,re;if(!R.length)return;const J=(C+P+R.length)%R.length;T(J),b(!1),(re=(se=F.current)==null?void 0:se.querySelector(`[data-row-index="${R[J]}"]`))==null||re.scrollIntoView({block:"center"})},[R,C]),Fe=fn.some(P=>P.value===V.minLevel)?V.minLevel:"",ue=d.useCallback(()=>{pn(B.map(si).join(`
|
|
244
|
+
`),`logcat-${e}-${Date.now()}.txt`)},[B,e]);d.useEffect(()=>{const P=O.current;if(!P||!o.length)return;const J=o.filter(re=>re.seq>Z.current);if(!J.length)return;const se=Z.current+1;Z.current>=0&&J[0].seq>se&&(P.dropped+=J[0].seq-se),Hc(P,J),Z.current=J[J.length-1].seq,q(P.lines.length)},[o]);const me=d.useCallback(()=>{const P=O.current;if(!P){Z.current=o.length?o[o.length-1].seq:-1,O.current=Wc(Date.now()),q(0),U(!0);return}const J=Vc(P,Date.now(),e);O.current=null,U(!1),q(0),pn(J,qc(e,P.startedAt))},[o,e]);if(d.useEffect(()=>{var P;g&&((P=I.current)==null||P.scrollIntoView({block:"end"}))},[B.length,g]),!r)return t.jsxs("div",{className:"log-empty-state",children:[t.jsx("p",{className:"log-empty-title",children:"Live logs are not available here"}),t.jsx("p",{className:"log-empty-subtitle",children:"Streaming is wired up for Android (logcat) and iOS (os_trace), not for this device's platform."})]});const ke=f?"Denied":p?"Offline":u?"Live":"Connecting",ee=!u&&(!!f||p);return t.jsxs("div",{className:"logcat-root",children:[t.jsxs("div",{className:"log-toolbar",children:[t.jsxs("div",{className:"log-filter-group",children:[t.jsxs("div",{className:"log-stat-pill",title:f??void 0,children:[t.jsx("span",{className:`log-live-dot ${u?"active":""} ${ee?"is-error":""}`}),ke]}),t.jsxs("div",{className:"log-stat-pill logcat-count",children:[B.length," / ",o.length]}),t.jsxs(Jt,{selectSize:"sm",value:Fe,onChange:P=>c(Pc(a,P.target.value)),"aria-label":"Minimum log level",children:[t.jsx("option",{value:"",children:"All levels"}),fn.map(P=>t.jsx("option",{value:P.value,children:P.label},P.value))]}),t.jsxs("div",{className:"logcat-input-wrap",children:[t.jsx("input",{type:"text",className:"type-input-field tiny logcat-query",placeholder:"tag:Wifi package:com.android.systemui free text",value:a,onChange:P=>c(P.target.value),"aria-label":"Filter logs"}),a&&t.jsx("button",{type:"button",className:"logcat-input-btn",onClick:()=>c(""),"aria-label":"Clear filter",title:"Clear filter",children:t.jsx(xn,{size:12})})]}),t.jsxs("div",{className:"logcat-input-wrap",children:[t.jsx("input",{type:"text",className:"type-input-field tiny logcat-find",placeholder:"Find…",value:w,onChange:P=>{D(P.target.value),T(0)},onKeyDown:P=>{P.key==="Enter"&&(P.preventDefault(),ae(P.shiftKey?-1:1))},"aria-label":"Find in logs"}),w&&t.jsx("span",{className:"logcat-hit-count","aria-live":"polite",children:R.length?`${C+1}/${R.length}`:"0/0"})]}),t.jsx("button",{type:"button",className:"btn-secondary btn-sm logcat-icon-btn",onClick:()=>ae(-1),disabled:!R.length,"aria-label":"Previous match",title:"Previous match (Shift+Enter)",children:t.jsx(Ei,{size:14})}),t.jsx("button",{type:"button",className:"btn-secondary btn-sm logcat-icon-btn",onClick:()=>ae(1),disabled:!R.length,"aria-label":"Next match",title:"Next match (Enter)",children:t.jsx(Ai,{size:14})}),t.jsx("button",{type:"button",className:`btn-secondary btn-sm logcat-icon-btn ${v?"active":""}`,onClick:()=>k(!v),"aria-pressed":v,"aria-label":"Match case",title:"Match case",children:t.jsx(Ui,{size:15})}),t.jsx("button",{type:"button",className:`btn-secondary btn-sm logcat-icon-btn ${N?"active":""}`,onClick:()=>j(!N),"aria-pressed":N,"aria-label":"Soft wrap",title:"Soft wrap long messages",children:t.jsx($r,{size:14})})]}),t.jsxs("div",{className:"log-actions-group",children:[(f||p)&&t.jsxs("button",{className:"btn-secondary btn-sm",onClick:y,children:[t.jsx(yt,{size:14})," RECONNECT"]}),t.jsxs("button",{className:`btn-secondary btn-sm ${g?"active":""}`,onClick:()=>b(!g),children:[t.jsx(zr,{size:14})," ",g?"FREEZE":"FOLLOW"]}),t.jsxs("button",{className:`btn-secondary btn-sm ${_?"is-recording":""}`,onClick:me,"aria-pressed":_,title:_?"Stop recording and download the capture":"Record the raw log stream to a file",children:[_?t.jsx(kn,{size:12}):t.jsx(wi,{size:12})," ",_?`STOP · ${W.toLocaleString()}`:"RECORD"]}),t.jsxs("button",{className:"btn-premium btn-sm",disabled:B.length===0,onClick:ue,children:[t.jsx(Ni,{size:14})," EXPORT"]}),t.jsxs("button",{className:"btn-secondary btn-sm",onClick:m,children:[t.jsx(Wt,{size:14})," CLEAR"]})]})]}),t.jsxs("div",{className:`logcat-rows theme-dark ${N?"":"no-wrap"}`,ref:F,children:[f&&t.jsxs("div",{className:"logcat-status-banner is-denied",role:"alert",children:[t.jsx(et,{size:14}),t.jsxs("span",{children:["Access denied — ",f]})]}),!f&&p&&t.jsxs("div",{className:"logcat-status-banner is-exhausted",role:"alert",children:[t.jsx(et,{size:14}),t.jsx("span",{children:"Connection lost after repeated attempts. Use Reconnect above to try again."})]}),B.map((P,J)=>t.jsx(Kc,{record:P,index:J,isHit:ne.has(J),isActiveHit:R.length>0&&R[C]===J},P.seq)),t.jsx("div",{ref:I})]})]})}function Yc({device:e,onClose:s,titleId:n}){const{toast:i,removeToast:r}=Zt(),a=Rs(),{tab:c}=vn(),l=d.useRef(null),[o,u]=d.useState({width:0,height:0}),[m,f]=d.useState("inspect"),[p,y]=d.useState(null),[g,b]=d.useState(c||"actions"),v=g==="omni"&&m==="inspect",[k,N]=d.useState(""),[j,w]=d.useState(""),[D,$]=d.useState(""),[T,I]=d.useState(!0),[F,O]=d.useState([]),[_,U]=d.useState(null),[W,q]=d.useState(!1),[Z,V]=d.useState(!1),[B,R]=d.useState(0),[C,ne]=d.useState(e),[ae,Fe]=d.useState([]),[ue,me]=d.useState(!1),[ke,ee]=d.useState(!1),[P,J]=d.useState(null),[se,re]=d.useState(!1),[he,Le]=d.useState(!1),fe=10,[ve,Ue]=d.useState(!1),[Ke,Ae]=d.useState(!1),ct=$c(C==null?void 0:C.udid,!he),Me=()=>{navigator.clipboard.writeText(C.udid).catch(()=>{}),Ue(!0),setTimeout(()=>Ue(!1),1500)},Ge=d.useRef(""),oe=d.useRef(null),[Ye,lt]=d.useState(!1);d.useEffect(()=>{g&&(!c||c!==g)&&a(`/devices/${e.udid}/control/${g}`,{replace:!0})},[g,c,e.udid,a]),d.useEffect(()=>((async()=>{try{V(!0),await H.startStream(C.udid);const E=(await H.getDevices()).find(L=>L.udid===C.udid);E&&ne(E)}catch(S){console.error("Auto-start stream failed:",S)}finally{V(!1)}})(),()=>{H.stopStream(C.udid).catch(()=>{})}),[e.udid]);const Ze=d.useCallback(async()=>{try{me(!0);const x=await H.listApps(C.udid);Array.isArray(x)&&Fe(x)}catch(x){console.error("Failed to load apps:",x)}finally{me(!1)}},[C.udid]);d.useEffect(()=>{g==="actions"&&Ze()},[g,Ze]);const Ct=parseInt(C.screenWidth||"1080",10),St=parseInt(C.screenHeight||"1920",10),ge=Math.min(Ct,St),be=Math.max(Ct,St),dt=ge/be,Je=d.useCallback(()=>{const x=!T,S=x?window.innerHeight*.55:window.innerHeight*.7,E=620,K=window.innerWidth>900;let z;x?z=K?Math.min(window.innerWidth*.8,window.innerWidth-E):window.innerWidth*.8:z=window.innerWidth*.45;const Q=T?dt:1/dt;let G,Y;T?(G=S,Y=G*Q,Y>z&&(Y=z,G=Y/Q)):(Y=z,G=Y/Q,G>S&&(G=S,Y=G*Q)),u({width:Y,height:G})},[dt,T]);d.useEffect(()=>(Je(),window.addEventListener("resize",Je),()=>window.removeEventListener("resize",Je)),[Je]),d.useEffect(()=>{const x=async()=>{if(Ge.current.length>0){const E=Ge.current;Ge.current="";try{await H.typeText(C.udid,E)}catch(L){console.error("Keyboard buffering flush failed:",L)}}},S=E=>{const L=document.activeElement;if(L&&(L.tagName==="INPUT"||L.tagName==="TEXTAREA"||L.isContentEditable)||!Ye&&g!=="terminal")return;const z=E.key;z==="Enter"?(oe.current&&clearTimeout(oe.current),x(),H.pressKey(C.udid,C.platform==="android"?66:"enter")):z==="Backspace"?(oe.current&&clearTimeout(oe.current),x(),H.pressKey(C.udid,C.platform==="android"?67:"backspace")):z.length===1&&(Ge.current+=z,oe.current&&clearTimeout(oe.current),oe.current=setTimeout(()=>{x()},50))};return window.addEventListener("keydown",S),()=>{window.removeEventListener("keydown",S),oe.current&&clearTimeout(oe.current)}},[C.udid,C.platform,Ye,g]);const[ut,kt]=d.useState(Date.now()),mt=()=>{const x=B>0?`r=${B}&`:"";return C.session_id&&!String(C.session_id).startsWith("manual_")?`/xenon/api/session/${C.session_id}/live_video?${x}t=${ut}`:`/xenon/api/control/${C.udid}/stream?${x}t=${ut}`};d.useEffect(()=>{B>0&&kt(Date.now())},[B]),d.useEffect(()=>{if(se||he)return;const x=setTimeout(()=>Le(!0),3e4);return()=>clearTimeout(x)},[se,he,B]);const Be=d.useRef(null),We=x=>{const S=x.currentTarget.getBoundingClientRect();return{x:x.clientX-S.left,y:x.clientY-S.top}},ht=x=>{const S=We(x);Be.current={x:S.x,y:S.y,time:Date.now()}},ce=async x=>{var _e;if(!Be.current)return;const S=Be.current,E=We(x),L=Date.now()-S.time,K=(_e=l.current)==null?void 0:_e.getBoundingClientRect(),z=(K==null?void 0:K.width)||o.width,Q=(K==null?void 0:K.height)||o.height;let G,Y,te,we;T?(G=S.x/z*ge,Y=S.y/Q*be,te=E.x/z*ge,we=E.y/Q*be):(G=S.x/z*be,Y=S.y/Q*ge,te=E.x/z*be,we=E.y/Q*ge);const Re=Math.abs(te-G),pe=Math.abs(we-Y);try{L<500&&Re<10&&pe<10?await H.tap(C.udid,Math.round(G),Math.round(Y)):L>=500&&Re<10&&pe<10?await H.touchAndHold(C.udid,Math.round(G),Math.round(Y),L):await H.swipe(C.udid,Math.round(G),Math.round(Y),Math.round(te),Math.round(we))}catch(He){console.error("Action failed:",He)}Be.current=null},ft=()=>H.pressKey(C.udid,C.platform==="android"?xt.HOME:as.HOME),ns=()=>H.pressKey(C.udid,xt.BACK),At=()=>H.pressKey(C.udid,xt.APP_SWITCH),Rt=()=>H.pressKey(C.udid,C.platform==="android"?xt.VOLUME_UP:as.VOLUME_UP),Et=()=>H.pressKey(C.udid,C.platform==="android"?xt.VOLUME_DOWN:as.VOLUME_DOWN),$t=()=>H.lock(C.udid),pt=async()=>{Ae(!0);try{await H.unlock(C.udid)}finally{setTimeout(()=>Ae(!1),2500)}},Dt=async()=>{k.trim()&&(await H.typeText(C.udid,k),N(""))},Tt=async()=>{try{w("Fetching...");const x=await H.getClipboard(C.udid);x&&x.content!==void 0?w(x.content||"(Clipboard is empty)"):w("No content received")}catch{w("Error: Check Appium Settings app")}},It=async()=>{q(!0);try{const x=await H.getScreenshot(C.udid);if(x!=null&&x.screenshot){const S={id:yc(),base64:x.screenshot,timestamp:Date.now()};O(E=>[S,...E]),U(0)}}catch(x){console.error("Failed to take screenshot:",x)}finally{q(!1)}},gt=x=>{O(S=>{const E=S.filter(L=>L.id!==x);return E.length===0?U(null):_!==null&&_>=E.length&&U(0),E})},Lt=()=>{O([]),U(null),i("Cleared all captured evidence.","success")},Mt=x=>{const S=document.createElement("a");S.href=`data:image/png;base64,${x}`,S.download=`screenshot-${C.udid}-${Date.now()}.png`,S.click()},h=async x=>{const S=ge/2,E=be/2,L=ge*.4,K=be*.4;let z,Q,G,Y;switch(x){case"left":z=S+L,Q=E,G=S-L,Y=E;break;case"right":z=S-L,Q=E,G=S+L,Y=E;break;case"up":z=S,Q=E+K,G=S,Y=E-K;break;case"down":z=S,Q=E-K,G=S,Y=E+K;break}try{await H.swipe(C.udid,Math.round(z),Math.round(Q),Math.round(G),Math.round(Y))}catch(te){console.error(`Quick swipe ${x} failed:`,te)}},A=async()=>{if(D.trim()){const x=i(`Uninstalling ${D}...`,"loading",0);try{me(!0),await H.uninstallApp(C.udid,D),$(""),i(`Request sent for ${D}`,"success"),setTimeout(Ze,3e3)}catch{i("Uninstall failed. Check logs.","error")}finally{me(!1),r(x)}}},M=async()=>{if(!P)return;let x;try{ee(!0),x=i(`Installing app to ${C.udid}...`,"loading",0);const S=await H.uploadAndInstallApp(C.udid,P);S.success?(i(S.message||"App installed successfully","success"),J(null),setTimeout(Ze,5e3)):i("Installation failed: "+(S.error||"Unknown error"),"error")}catch(S){i("Installation failed: "+S.message,"error")}finally{x&&r(x),ee(!1)}};return t.jsxs("div",{className:"device-control-view",children:[t.jsx("div",{className:"scanline",style:{position:"absolute",inset:0,pointerEvents:"none",opacity:.05,zIndex:1001}}),t.jsxs("header",{className:"control-view-top-bar",children:[t.jsxs("button",{className:"back-to-devices-btn",onClick:s,children:[t.jsx(cs,{size:18})," DEVICES"]}),t.jsxs("div",{className:"device-info-mini",children:[t.jsx("span",{className:`device-pill platform-pill ${C.platform}`,children:C.platform==="ios"?"Apple":"Android"}),t.jsxs("span",{className:"device-pill version-pill",children:["v",C.sdk]}),C.reservedUntil&&Date.now()<C.reservedUntil&&t.jsxs("span",{className:"device-pill reserved-pill",title:`Reserved by ${C.reservedBy}${C.reservationReason?`: ${C.reservationReason}`:""}`,children:["Reserved by ",C.reservedBy||"someone"]}),t.jsx("h2",{id:n,className:"device-name-text",children:C.name}),t.jsxs("span",{className:"udid-chip",title:C.udid,children:[t.jsx("span",{className:"udid-chip__value",children:C.udid}),t.jsx("button",{type:"button",className:"udid-chip__copy",onClick:Me,"aria-label":"Copy UDID",title:ve?"Copied!":"Copy UDID",children:ve?t.jsx(Bt,{size:12}):t.jsx(qe,{size:12})})]})]})]}),t.jsxs("div",{className:`control-view-main ${T?"":"is-landscape"} ${g==="omni"?"omni-mode":""}`,children:[t.jsxs("div",{className:"device-preview-column",children:[t.jsx("div",{className:"device-screen-wrapper",children:t.jsxs("div",{ref:x=>{l.current=x,y(x)},className:`device-stream-canvas ${T?"":"landscape"} ${Ye?"focused":""} ${v?"is-inspecting":""}`,style:{width:o.width,height:o.height,background:"var(--black)"},tabIndex:0,onFocus:()=>lt(!0),onBlur:()=>lt(!1),onMouseDown:v?void 0:ht,onMouseUp:v?void 0:ce,children:[he?t.jsxs("div",{className:"device-stream-placeholder",style:{position:"absolute",zIndex:10},children:[t.jsx(et,{size:40,color:"var(--red, #f87171)"}),t.jsx("p",{style:{marginTop:16},children:"Stream unavailable"}),t.jsx("button",{className:"btn-premium btn-sm",style:{marginTop:12},onClick:()=>{Le(!1),R(0)},children:"Retry"})]}):(Z||!se)&&t.jsxs("div",{className:"device-stream-placeholder",style:{position:"absolute",zIndex:10},children:[t.jsx(yt,{size:40,className:"animate-spin",color:"var(--color-accent)"}),t.jsx("p",{style:{marginTop:16},children:Z?"ESTABLISHING TRACE...":"Waiting for stream…"})]}),!he&&t.jsx("img",{src:mt(),alt:"Device Stream",className:"device-stream-image",style:{width:"100%",height:"100%",objectFit:"contain"},onLoad:()=>re(!0),onError:()=>{if(console.warn("Stream failed to load, retrying..."),re(!1),B>=fe){Le(!0);return}setTimeout(()=>R(x=>x+1),2e3)}}),ct==="off"&&!he&&t.jsxs("div",{className:"device-screen-off",role:"status",children:[t.jsx(dr,{size:32}),t.jsx("p",{children:"Display is off"}),t.jsx("span",{children:"The stream is fine — the device is asleep."}),t.jsx("button",{type:"button",className:"btn-premium btn-sm",onClick:pt,disabled:Ke,children:Ke?"Waking…":"Wake device"})]})]})}),t.jsxs("aside",{className:"device-footer-actions",role:"toolbar","aria-label":"Device controls","aria-orientation":T?"vertical":"horizontal",children:[t.jsx("button",{className:`footer-action-btn ${T?"active":""}`,onClick:()=>I(!0),title:"Portrait","aria-label":"Portrait orientation","aria-pressed":T,children:t.jsx(br,{size:18})}),t.jsx("button",{className:`footer-action-btn ${T?"":"active"}`,onClick:()=>I(!1),title:"Landscape","aria-label":"Landscape orientation","aria-pressed":!T,children:t.jsx(yr,{size:18})}),t.jsx("div",{className:"footer-divider"}),t.jsx("button",{className:"footer-action-btn",onClick:ft,title:"Home","aria-label":"Home",children:t.jsx(ji,{size:18})}),C.platform==="android"&&t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"footer-action-btn",onClick:ns,title:"Back","aria-label":"Back",children:t.jsx(cs,{size:18})}),t.jsx("button",{className:"footer-action-btn",onClick:At,title:"App switcher","aria-label":"App switcher",children:t.jsx(kn,{size:18})})]}),t.jsx("div",{className:"footer-divider"}),t.jsx("button",{className:"footer-action-btn",onClick:Rt,title:"Volume up","aria-label":"Volume up",children:t.jsx(Or,{size:18})}),t.jsx("button",{className:"footer-action-btn",onClick:Et,title:"Volume down","aria-label":"Volume down",children:t.jsx(Mr,{size:18})}),t.jsx("button",{className:"footer-action-btn",onClick:$t,title:"Lock device","aria-label":"Lock device",children:t.jsx(Ci,{size:18})}),t.jsx("button",{className:"footer-action-btn",onClick:pt,title:"Unlock device","aria-label":"Unlock device",children:t.jsx(ir,{size:18})})]})]}),t.jsxs("div",{className:"device-interactions-column",children:[t.jsxs("div",{className:"interaction-tabs",role:"tablist",children:[t.jsxs("button",{className:`tab-btn ${g==="actions"?"active":""}`,onClick:()=>b("actions"),role:"tab","aria-selected":g==="actions",children:[t.jsx(ys,{size:13}),t.jsx("span",{children:"Actions"})]}),t.jsxs("button",{className:`tab-btn ${g==="screenshot"?"active":""}`,onClick:()=>b("screenshot"),role:"tab","aria-selected":g==="screenshot",children:[t.jsx(os,{size:13}),t.jsx("span",{children:"Screenshot"})]}),t.jsxs("button",{className:`tab-btn ${g==="logs"?"active":""}`,onClick:()=>b("logs"),role:"tab","aria-selected":g==="logs",children:[t.jsx(Nr,{size:13}),t.jsx("span",{children:"Logs"})]}),t.jsxs("button",{className:`tab-btn ${g==="terminal"?"active":""}`,onClick:()=>b("terminal"),role:"tab","aria-selected":g==="terminal",children:[t.jsx(Cn,{size:13}),t.jsx("span",{children:"Shell"})]}),t.jsxs("button",{className:`tab-btn ${g==="omni"?"active":""}`,onClick:()=>b("omni"),role:"tab","aria-selected":g==="omni",children:[t.jsx(vs,{size:13}),t.jsx("span",{children:"Omni-Vision"})]})]}),t.jsx("div",{className:`interactions-scroll-area ${g==="terminal"?"terminal-mode":""} ${g==="screenshot"||g==="logs"?"screenshot-mode":""}`,children:t.jsxs("div",{className:"tab-content",children:[g==="omni"&&t.jsx("div",{className:"omni-inspector-tab-wrapper animate-fade-in",children:t.jsx(Ec,{sessionId:C.session_id?String(C.session_id):null,udid:C.udid,streamUrl:mt(),embedded:!0,overlayTarget:p,onModeChange:f})}),g==="actions"&&t.jsxs("div",{className:"actions-grid",children:[t.jsxs("div",{className:"action-card full-width",children:[t.jsxs("h4",{className:"action-card-title",children:[t.jsx(vi,{size:18,color:"var(--color-accent)"})," Smart Input"]}),t.jsx("p",{className:"action-card-hint",children:"Relay keystrokes to the focused element on the device."}),t.jsx("input",{type:"text",className:"type-input-field compact",placeholder:"Type and press Enter to send…",value:k,onChange:x=>N(x.target.value),onKeyDown:x=>x.key==="Enter"&&Dt()})]}),t.jsxs("div",{className:"action-card full-width",children:[t.jsxs("h4",{className:"action-card-title",children:[t.jsx(fr,{size:18,color:"var(--color-accent)"})," App Management"]}),t.jsxs("div",{className:"app-mgmt-content",children:[t.jsxs("div",{className:"install-section",children:[t.jsx("p",{className:"compact-label",children:"Install Package"}),t.jsxs("div",{className:"upload-box-row",children:[t.jsxs("label",{className:"file-upload-launcher",title:P?P.name:"Select an .apk, .ipa or .app file",children:[t.jsx(xi,{size:14}),t.jsx("span",{children:P?P.name:"Select File"}),t.jsx("input",{type:"file",accept:".apk,.ipa,.app",onChange:x=>{var S;return J(((S=x.target.files)==null?void 0:S[0])||null)},hidden:!0})]}),t.jsx("button",{className:"btn-premium btn-sm",disabled:!P||ke,onClick:M,children:ke?t.jsx(is,{className:"animate-spin",size:14}):"INSTALL"})]}),t.jsx("p",{className:"hint-text",children:"Accepts .apk, .ipa or .app"})]}),t.jsx("div",{className:"divider-v"}),t.jsxs("div",{className:"uninstall-section",children:[t.jsx("p",{className:"compact-label",children:"Quick Uninstall"}),t.jsxs("div",{className:"uninstall-controls-row",children:[t.jsxs("div",{className:"select-wrapper",children:[t.jsxs(Jt,{selectSize:"sm",className:"w-full",value:D,onChange:x=>$(x.target.value),disabled:ue,children:[t.jsx("option",{value:"",children:ue?"Loading apps...":"-- Select App to Remove --"}),ae.map(x=>t.jsx("option",{value:x,children:x},x))]}),ue&&t.jsx(is,{className:"animate-spin select-loader",size:12})]}),t.jsxs("button",{className:"btn-destructive btn-sm",onClick:A,disabled:!D||ue,children:[t.jsx(Wt,{size:14})," UNINSTALL"]})]}),t.jsxs("div",{className:"manual-input-box",children:[t.jsx("p",{className:"hint-text",children:"Or enter manually:"}),t.jsx("input",{type:"text",className:"type-input-field tiny",placeholder:"com.example.app",value:D,onChange:x=>$(x.target.value)})]})]})]})]}),t.jsxs("div",{className:"action-card full-width",children:[t.jsxs("h4",{className:"action-card-title",children:[t.jsx(Xi,{size:18,color:"var(--color-accent)"})," Clipboard"]}),t.jsxs("div",{className:"clipboard-row",children:[t.jsx("button",{className:"btn-premium btn-sm",onClick:Tt,children:"FETCH VALUE"}),t.jsx("div",{className:"clipboard-display compact",children:j})]})]}),t.jsxs("div",{className:"action-card full-width",children:[t.jsxs("h4",{className:"action-card-title",children:[t.jsx(mr,{size:18,color:"var(--color-accent)"})," Directional Gestures"]}),t.jsxs("div",{className:"gestures-grid-container",children:[t.jsxs("div",{className:"gestures-dpad",children:[t.jsx("div",{}),t.jsx("button",{className:"dpad-btn",onClick:()=>h("up"),children:t.jsx(Wi,{size:24})}),t.jsx("div",{}),t.jsx("button",{className:"dpad-btn",onClick:()=>h("left"),children:t.jsx(cs,{size:24})}),t.jsx("div",{className:"dpad-center"}),t.jsx("button",{className:"dpad-btn",onClick:()=>h("right"),children:t.jsx(Sn,{size:24})}),t.jsx("div",{}),t.jsx("button",{className:"dpad-btn",onClick:()=>h("down"),children:t.jsx(yn,{size:24})}),t.jsx("div",{})]}),t.jsx("p",{className:"compact-label dpad-caption",children:"Quick swipe in a direction"})]})]})]}),g==="screenshot"&&t.jsxs("div",{className:"action-card screenshot-card",children:[F.length>0&&t.jsx("header",{className:"action-card-header",children:t.jsx("button",{className:"btn-text-only",onClick:Lt,children:"CLEAR ALL"})}),t.jsxs("div",{className:`screenshot-workspace ${F.length===0?"is-empty":""}`,children:[t.jsxs("div",{className:"screenshot-gallery-sidebar",children:[t.jsxs("button",{className:"btn-premium take-screenshot-btn",onClick:It,disabled:W,children:[W?t.jsx(is,{className:"animate-spin",size:16}):t.jsx(os,{size:16}),t.jsx("span",{children:W?"CAPTURING...":"NEW CAPTURE"})]}),t.jsxs("div",{className:"screenshot-thumbnails-list",children:[F.length===0&&!W&&t.jsxs("div",{className:"empty-gallery-state",children:[t.jsx(os,{size:20,className:"empty-gallery-icon"}),t.jsx("p",{className:"empty-gallery-title",children:"No captures yet"}),t.jsx("p",{className:"empty-gallery-hint",children:"Grab a screenshot of the device to begin analysis."})]}),F.map((x,S)=>t.jsxs("div",{className:`screenshot-thumb-item ${_===S?"active":""}`,onClick:()=>U(S),children:[t.jsx("img",{src:`data:image/png;base64,${x.base64}`,alt:"Thumb"}),t.jsx("span",{className:"thumb-time",children:new Date(x.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}),t.jsx("button",{className:"thumb-delete-btn",onClick:E=>{E.stopPropagation(),gt(x.id)},children:t.jsx(Wt,{size:12})})]},x.id))]})]}),t.jsx("div",{className:"screenshot-main-preview",children:_!==null&&F[_]?t.jsxs("div",{className:"preview-container",children:[t.jsx("div",{className:"preview-image-wrapper",children:t.jsx("img",{src:`data:image/png;base64,${F[_].base64}`,alt:"Selected Evidence"})}),t.jsxs("footer",{className:"preview-footer",children:[t.jsxs("div",{className:"preview-meta",children:[t.jsx("span",{className:"meta-label",children:"ID:"}),t.jsx("span",{className:"meta-value",children:F[_].id.substring(0,8)}),t.jsx("span",{className:"meta-divider",children:"|"}),t.jsx("span",{className:"meta-value",children:yi(F[_].timestamp)})]}),t.jsxs("div",{className:"preview-actions",children:[t.jsx("button",{className:"btn-premium btn-sm",onClick:()=>Mt(F[_].base64),children:"DOWNLOAD PNG"}),t.jsxs("button",{className:"btn-destructive btn-sm",onClick:()=>gt(F[_].id),children:[t.jsx(Wt,{size:14})," DELETE"]})]})]})]}):null})]})]}),g==="logs"&&t.jsx("div",{className:"action-card screenshot-card",children:t.jsx(Gc,{udid:C.udid,platform:C.platform})}),g==="terminal"&&t.jsx("div",{className:"action-card full-height",children:t.jsx(vc,{platform:(C.platform||"").toLowerCase(),prompt:`${(C.platform||"").toLowerCase()==="ios"?"ios":"adb"} $`,welcomeMessage:`Connected to ${C.name} (${C.udid}).
|
|
245
|
+
Internal Shell Environment.`,onCommand:async x=>{const S=await H.executeShell(C.udid,x);if(S.error)throw new Error(S.error);return S.output}})})]})})]})]}),C.session_id&&!String(C.session_id).startsWith("manual_")&&t.jsx(di,{sessionId:String(C.session_id),mode:"slice",windowSec:60,variant:"floating"})]})}const Zc=/^(INPUT|TEXTAREA|SELECT)$/;function Jc({labelledBy:e,onClose:s,children:n,style:i,...r}){const a=d.useRef(null),c=d.useRef(s);return c.current=s,d.useEffect(()=>{const l=a.current;if(!l)return;const o=document.activeElement,u=[];for(let f=l;f.parentElement&&f!==document.body;f=f.parentElement)for(const p of Array.from(f.parentElement.children))p===f||p.hasAttribute("inert")||p.matches("[aria-live], script, style, link, template")||(p.setAttribute("inert",""),u.push(p));l.contains(document.activeElement)||l.focus();const m=f=>{if(f.key!=="Escape"||f.defaultPrevented)return;const p=f.target;Zc.test(p.tagName)||p.isContentEditable||(f.preventDefault(),c.current())};return l.addEventListener("keydown",m),()=>{l.removeEventListener("keydown",m),u.forEach(f=>f.removeAttribute("inert")),o&&o.isConnected&&o!==document.body&&o.focus()}},[]),t.jsx("div",{ref:a,role:"dialog","aria-modal":"true","aria-labelledby":e,tabIndex:-1,style:{outline:"none",...i},...r,children:n})}class Qc extends je.Component{constructor(s){super(s),this.socketCleanups=[],this.refreshTimeout=null,this.state={devices:[],activeSessionsCount:0,pendingSessionsCount:0,queueSummary:null,statusFilter:"all",search:"",loaded:!1}}componentDidMount(){this.fetchDevices(),this.devicePolling=setInterval(()=>{this.fetchDevices()},1e4);const s=this.props.onSocketEvent("device_unblocked",()=>{this.fetchDevicesDebounced()}),n=this.props.onSocketEvent("device_blocked",()=>{this.fetchDevicesDebounced()});this.socketCleanups.push(s,n)}componentWillUnmount(){this.devicePolling&&(clearInterval(this.devicePolling),this.devicePolling=void 0),this.refreshTimeout&&(clearTimeout(this.refreshTimeout),this.refreshTimeout=null),this.socketCleanups.forEach(s=>s())}fetchDevicesDebounced(){this.refreshTimeout&&clearTimeout(this.refreshTimeout),this.refreshTimeout=setTimeout(()=>{this.refreshTimeout=null,this.fetchDevices()},500)}getBusyDevicesCount(s){return s.filter(n=>n.busy).length}async fetchDevices(){try{const s=await H.getDevices(),n=this.getBusyDevicesCount(s),i=await H.getPendingSessionsCount(),r=await H.getQueueSummary();this.setState({devices:s,activeSessionsCount:n,pendingSessionsCount:i,queueSummary:r,loaded:!0})}catch(s){console.log(s),this.setState({loaded:!0})}}getFiltered(){const s=Date.now(),n=this.state.search.trim().toLowerCase(),i=this.state.statusFilter;return this.state.devices.filter(r=>n&&!`${r.name} ${r.udid}`.toLowerCase().includes(n)?!1:i==="all"||Cs(r,s)===i)}statusCount(s){if(s==="all")return this.state.devices.length;const n=Date.now();return this.state.devices.filter(i=>Cs(i,n)===s).length}render(){const s=this.getFiltered(),{udid:n}=this.props.params,i=n?this.state.devices.find(r=>r.udid===n):null;return t.jsxs("div",{className:"device-explorer-container",children:[t.jsxs("div",{className:"de2-sticky-group",children:[t.jsx(li,{icon:Us,title:"Devices",subtitle:`${this.state.devices.length} device${this.state.devices.length===1?"":"s"} registered across the global pool.`}),t.jsxs("div",{className:"de2-toolbar",children:[t.jsx(Si,{size:"sm",value:this.state.statusFilter,onChange:r=>this.setState({statusFilter:r}),segments:[{value:"all",label:"All",count:this.statusCount("all")},{value:"ready",label:"Ready",count:this.statusCount("ready")},{value:"busy",label:"Busy",count:this.statusCount("busy")},{value:"reserved",label:"Reserved",count:this.statusCount("reserved")},{value:"maintenance",label:"Maintenance",count:this.statusCount("maintenance")},{value:"offline",label:"Offline",count:this.statusCount("offline")}]}),t.jsx("input",{type:"text",className:"de2-search",placeholder:"Search by name or UDID…",value:this.state.search,onChange:r=>this.setState({search:r.target.value})}),t.jsxs(tt,{variant:"secondary",size:"sm",onClick:()=>this.fetchDevices(),children:[t.jsx(rs,{size:12})," Refresh"]})]})]}),s.length>0?t.jsx(mc,{devices:s,reloadDevices:()=>this.fetchDevices()}):t.jsxs("div",{className:"device-explorer-empty stagger-1",children:[t.jsx("div",{className:"device-explorer-empty-icon",children:this.state.loaded?t.jsx(Us,{size:32}):t.jsx(rs,{size:32,className:"animate-spin"})}),this.state.loaded?this.state.devices.length===0?t.jsxs(t.Fragment,{children:[t.jsx("h3",{children:"Global Device Registry Empty"}),t.jsx("p",{children:"Xenon hasn't detected any active device nodes in your infrastructure. Ensure your device farm is connected and heartbeat signals are active."}),t.jsxs(tt,{variant:"primary",onClick:()=>this.fetchDevices(),children:[t.jsx(rs,{size:14}),"Manual sync"]})]}):t.jsxs(t.Fragment,{children:[t.jsx("h3",{children:"No Devices Found"}),t.jsx("p",{children:"Deployment configuration mismatch. Adjust your platform or state filters to find the appropriate testing target."}),t.jsx(tt,{variant:"secondary",onClick:()=>this.setState({statusFilter:"all",search:""}),children:"Reset filters"})]}):t.jsxs(t.Fragment,{children:[t.jsx("h3",{children:"Loading devices…"}),t.jsx("p",{children:"Syncing the global device registry."})]})]}),i&&t.jsx(Jc,{className:"device-control-modal-overlay",labelledBy:"device-control-title",onClose:()=>this.props.navigate("/devices"),children:t.jsx("div",{className:"device-control-modal",children:t.jsx(Yc,{device:i,titleId:"device-control-title",onClose:()=>this.props.navigate("/devices")})})})]})}}function kl(){const e=vn(),s=Rs(),{on:n}=ci();return t.jsx(Qc,{params:e,navigate:s,onSocketEvent:n})}export{Qc as DeviceExplorer,kl as default};
|