@tapflowio/relay 0.24.0 → 0.26.0
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/dist/RelayServer.d.ts +51 -0
- package/dist/RelayServer.d.ts.map +1 -1
- package/dist/RelayServer.js +262 -31
- package/dist/RelayServer.js.map +1 -1
- package/dist/api/apps.d.ts.map +1 -1
- package/dist/api/apps.js +6 -16
- package/dist/api/apps.js.map +1 -1
- package/dist/api/auth.d.ts +1 -1
- package/dist/api/auth.d.ts.map +1 -1
- package/dist/api/auth.js +30 -19
- package/dist/api/auth.js.map +1 -1
- package/dist/api/builds.d.ts.map +1 -1
- package/dist/api/builds.js +7 -5
- package/dist/api/builds.js.map +1 -1
- package/dist/api/comments.d.ts.map +1 -1
- package/dist/api/comments.js +41 -15
- package/dist/api/comments.js.map +1 -1
- package/dist/api/invitations.d.ts +2 -0
- package/dist/api/invitations.d.ts.map +1 -1
- package/dist/api/invitations.js +17 -17
- package/dist/api/invitations.js.map +1 -1
- package/dist/api/passwordReset.d.ts +13 -2
- package/dist/api/passwordReset.d.ts.map +1 -1
- package/dist/api/passwordReset.js +47 -12
- package/dist/api/passwordReset.js.map +1 -1
- package/dist/api/team.d.ts +2 -2
- package/dist/api/team.d.ts.map +1 -1
- package/dist/api/team.js +15 -5
- package/dist/api/team.js.map +1 -1
- package/dist/api/tokens.d.ts +1 -1
- package/dist/api/tokens.d.ts.map +1 -1
- package/dist/api/tokens.js +33 -8
- package/dist/api/tokens.js.map +1 -1
- package/dist/api/webhooks.d.ts.map +1 -1
- package/dist/api/webhooks.js +11 -5
- package/dist/api/webhooks.js.map +1 -1
- package/dist/lib/adminAccount.d.ts +0 -5
- package/dist/lib/adminAccount.d.ts.map +1 -1
- package/dist/lib/adminAccount.js +6 -7
- package/dist/lib/adminAccount.js.map +1 -1
- package/dist/lib/clientAddress.d.ts +7 -0
- package/dist/lib/clientAddress.d.ts.map +1 -1
- package/dist/lib/clientAddress.js +15 -0
- package/dist/lib/clientAddress.js.map +1 -1
- package/dist/lib/connectionAuth.d.ts +58 -2
- package/dist/lib/connectionAuth.d.ts.map +1 -1
- package/dist/lib/connectionAuth.js +66 -6
- package/dist/lib/connectionAuth.js.map +1 -1
- package/dist/lib/email.d.ts +16 -0
- package/dist/lib/email.d.ts.map +1 -0
- package/dist/lib/email.js +18 -0
- package/dist/lib/email.js.map +1 -0
- package/dist/middleware/auth.d.ts +63 -4
- package/dist/middleware/auth.d.ts.map +1 -1
- package/dist/middleware/auth.js +127 -28
- package/dist/middleware/auth.js.map +1 -1
- package/dist/migrations/014_normalize_emails.sql +16 -0
- package/package.json +3 -3
- package/public/assets/AppCenter-DZCsC2wa.js +26 -0
- package/public/assets/AppCenter-DZCsC2wa.js.br +0 -0
- package/public/assets/AppCenter-DZCsC2wa.js.gz +0 -0
- package/public/assets/Default-xD9Fmd5X.js +1 -0
- package/public/assets/Default-xD9Fmd5X.js.br +0 -0
- package/public/assets/Default-xD9Fmd5X.js.gz +0 -0
- package/public/assets/Invite-29Erwv8j.js +1 -0
- package/public/assets/Invite-29Erwv8j.js.br +0 -0
- package/public/assets/Invite-29Erwv8j.js.gz +0 -0
- package/public/assets/{MacResources-fCn40Tf5.js → MacResources-B0DQ9ISE.js} +1 -1
- package/public/assets/MacResources-B0DQ9ISE.js.br +0 -0
- package/public/assets/MacResources-B0DQ9ISE.js.gz +0 -0
- package/public/assets/QASession-D-n6PXuD.js +150 -0
- package/public/assets/QASession-D-n6PXuD.js.br +0 -0
- package/public/assets/QASession-D-n6PXuD.js.gz +0 -0
- package/public/assets/{ResetPassword-D-SFg4ap.js → ResetPassword-BnPIwTYH.js} +1 -1
- package/public/assets/ResetPassword-BnPIwTYH.js.br +0 -0
- package/public/assets/ResetPassword-BnPIwTYH.js.gz +0 -0
- package/public/assets/{Setup-ULjvIfAi.js → Setup-DmUGFblg.js} +1 -1
- package/public/assets/Setup-DmUGFblg.js.br +0 -0
- package/public/assets/Setup-DmUGFblg.js.gz +0 -0
- package/public/assets/Team-BpvRgFfZ.js +6 -0
- package/public/assets/Team-BpvRgFfZ.js.br +0 -0
- package/public/assets/Team-BpvRgFfZ.js.gz +0 -0
- package/public/assets/Tokens-x6BtCcL7.js +1 -0
- package/public/assets/Tokens-x6BtCcL7.js.br +0 -0
- package/public/assets/Tokens-x6BtCcL7.js.gz +0 -0
- package/public/assets/alert-dialog-C8wDimW-.js +1 -0
- package/public/assets/alert-dialog-C8wDimW-.js.br +0 -0
- package/public/assets/alert-dialog-C8wDimW-.js.gz +0 -0
- package/public/assets/{badge-B4QAWrzA.js → badge-CWVbeuH3.js} +1 -1
- package/public/assets/badge-CWVbeuH3.js.br +0 -0
- package/public/assets/badge-CWVbeuH3.js.gz +0 -0
- package/public/assets/{build-format-CtmRXihN.js → build-format-fzt-JrUX.js} +1 -1
- package/public/assets/build-format-fzt-JrUX.js.br +0 -0
- package/public/assets/build-format-fzt-JrUX.js.gz +0 -0
- package/public/assets/{dialog-BAFN_ONP.js → dialog-DQkbaw8h.js} +3 -3
- package/public/assets/dialog-DQkbaw8h.js.br +0 -0
- package/public/assets/dialog-DQkbaw8h.js.gz +0 -0
- package/public/assets/{index-COOWQXpW.js → index-C1Fo8g_c.js} +33 -33
- package/public/assets/index-C1Fo8g_c.js.br +0 -0
- package/public/assets/index-C1Fo8g_c.js.gz +0 -0
- package/public/assets/index-C2F1AgwB.css +1 -0
- package/public/assets/index-C2F1AgwB.css.br +0 -0
- package/public/assets/{index-ozCdBYxk.css.gz → index-C2F1AgwB.css.gz} +0 -0
- package/public/assets/{list-view-Rrqp8TkG.js → list-view-DxI397-H.js} +1 -1
- package/public/assets/list-view-DxI397-H.js.br +0 -0
- package/public/assets/list-view-DxI397-H.js.gz +0 -0
- package/public/assets/{pencil-CAHyK7Qf.js → pencil-BJcOp3oN.js} +1 -1
- package/public/assets/pencil-BJcOp3oN.js.br +0 -0
- package/public/assets/pencil-BJcOp3oN.js.gz +0 -0
- package/public/assets/resource-health-Cq3gqqVd.js +1 -0
- package/public/assets/resource-health-Cq3gqqVd.js.br +0 -0
- package/public/assets/resource-health-Cq3gqqVd.js.gz +0 -0
- package/public/assets/{trash-CkO-5TRA.js → trash-DhBxh6H7.js} +1 -1
- package/public/assets/trash-DhBxh6H7.js.br +0 -0
- package/public/assets/trash-DhBxh6H7.js.gz +0 -0
- package/public/index.html +2 -2
- package/public/index.html.br +0 -0
- package/public/index.html.gz +0 -0
- package/public/assets/AppCenter-BHz6vh5p.js +0 -26
- package/public/assets/AppCenter-BHz6vh5p.js.br +0 -0
- package/public/assets/AppCenter-BHz6vh5p.js.gz +0 -0
- package/public/assets/Default-bCqU0Qz9.js +0 -1
- package/public/assets/Default-bCqU0Qz9.js.br +0 -0
- package/public/assets/Default-bCqU0Qz9.js.gz +0 -0
- package/public/assets/Invite-EVMTsuNz.js +0 -1
- package/public/assets/Invite-EVMTsuNz.js.br +0 -0
- package/public/assets/Invite-EVMTsuNz.js.gz +0 -0
- package/public/assets/MacResources-fCn40Tf5.js.br +0 -0
- package/public/assets/MacResources-fCn40Tf5.js.gz +0 -0
- package/public/assets/QASession-CL-eyFxG.js +0 -150
- package/public/assets/QASession-CL-eyFxG.js.br +0 -0
- package/public/assets/QASession-CL-eyFxG.js.gz +0 -0
- package/public/assets/ResetPassword-D-SFg4ap.js.br +0 -0
- package/public/assets/ResetPassword-D-SFg4ap.js.gz +0 -0
- package/public/assets/Setup-ULjvIfAi.js.br +0 -0
- package/public/assets/Setup-ULjvIfAi.js.gz +0 -0
- package/public/assets/Team-DH91GD4w.js +0 -6
- package/public/assets/Team-DH91GD4w.js.br +0 -0
- package/public/assets/Team-DH91GD4w.js.gz +0 -0
- package/public/assets/Tokens-DImLpOVZ.js +0 -1
- package/public/assets/Tokens-DImLpOVZ.js.br +0 -0
- package/public/assets/Tokens-DImLpOVZ.js.gz +0 -0
- package/public/assets/alert-dialog-CwcUyDZQ.js +0 -1
- package/public/assets/alert-dialog-CwcUyDZQ.js.br +0 -0
- package/public/assets/alert-dialog-CwcUyDZQ.js.gz +0 -0
- package/public/assets/badge-B4QAWrzA.js.br +0 -0
- package/public/assets/badge-B4QAWrzA.js.gz +0 -0
- package/public/assets/build-format-CtmRXihN.js.br +0 -0
- package/public/assets/build-format-CtmRXihN.js.gz +0 -0
- package/public/assets/dialog-BAFN_ONP.js.br +0 -0
- package/public/assets/dialog-BAFN_ONP.js.gz +0 -0
- package/public/assets/index-COOWQXpW.js.br +0 -0
- package/public/assets/index-COOWQXpW.js.gz +0 -0
- package/public/assets/index-ozCdBYxk.css +0 -1
- package/public/assets/index-ozCdBYxk.css.br +0 -0
- package/public/assets/list-view-Rrqp8TkG.js.br +0 -0
- package/public/assets/list-view-Rrqp8TkG.js.gz +0 -0
- package/public/assets/pencil-CAHyK7Qf.js.br +0 -0
- package/public/assets/pencil-CAHyK7Qf.js.gz +0 -0
- package/public/assets/resource-health-BRpSwarg.js +0 -1
- package/public/assets/resource-health-BRpSwarg.js.br +0 -0
- package/public/assets/resource-health-BRpSwarg.js.gz +0 -0
- package/public/assets/trash-CkO-5TRA.js.br +0 -0
- package/public/assets/trash-CkO-5TRA.js.gz +0 -0
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import{f as ue,k as a,j as i}from"./vendor-react-BlPSzrEe.js";import{a2 as Ie,a9 as ko,W as He,T as Et,H as Tt,E as At,B as qe,G as Nr,S as cs,av as zt,t as Co,aB as Kn,v as Xn,a0 as ds,aA as nr,aH as Eo,aD as To,u as kr,Y as In,aJ as us,aI as fs,ab as Ao,aq as _r,U as No,ae as Po,y as Io,f as Do,aK as Lo,aC as Mo,az as $o,L as Uo}from"./index-C1Fo8g_c.js";import{u as hs,n as ve,c as Xr,b as Fo,a as Yr,T as zo,R as Ho,g as Bo}from"./resource-health-Cq3gqqVd.js";import{c as ps,b as Oo}from"./vendor-router-B_lVHrKl.js";import{A as Wo,c as Vo,f as qo,g as Ko,d as Xo,e as Yo,b as Go,a as Jo}from"./alert-dialog-C8wDimW-.js";import{e as ms,d as Qo,b as Zo,a as gs,c as ei,D as bs,k as ti,S as ni,i as ri,j as si,g as oi,h as xs}from"./dialog-DQkbaw8h.js";import{a as ii,P as ys,b as li,c as Gr,S as ai}from"./build-format-fzt-JrUX.js";import{l as Jr,j as ci}from"./publicLink-D6zKS_wu.js";import{B as di}from"./badge-CWVbeuH3.js";/**
|
|
2
|
+
* @license lucide-react v1.47.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 ws={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};ws.node;const ui=Ie(ws);/**
|
|
7
|
+
* @license lucide-react v1.47.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 vs={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]};vs.node;const fi=Ie(vs);/**
|
|
12
|
+
* @license lucide-react v1.47.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 Ss={name:"camera",size:24,node:[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]};Ss.node;const hi=Ie(Ss);/**
|
|
17
|
+
* @license lucide-react v1.47.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 Rs={name:"download",size:24,node:[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]};Rs.node;const pi=Ie(Rs);/**
|
|
22
|
+
* @license lucide-react v1.47.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 _s={name:"film",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M3 7.5h4",key:"zfgn84"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 16.5h4",key:"1230mu"}],["path",{d:"M17 3v18",key:"in4fa5"}],["path",{d:"M17 7.5h4",key:"myr1c1"}],["path",{d:"M17 16.5h4",key:"go4c1d"}]]};_s.node;const mi=Ie(_s);/**
|
|
27
|
+
* @license lucide-react v1.47.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 js={name:"fold-horizontal",size:24,node:[["path",{d:"M2 12h6",key:"1wqiqv"}],["path",{d:"M22 12h-6",key:"1eg9hc"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 8v2",key:"1woqiv"}],["path",{d:"M12 14v2",key:"8jcxud"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m19 9-3 3 3 3",key:"12ol22"}],["path",{d:"m5 15 3-3-3-3",key:"1kdhjc"}]]};js.node;const gi=Ie(js);/**
|
|
32
|
+
* @license lucide-react v1.47.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 ks={name:"house",size:24,node:[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],aliases:["home"]};ks.node;const Cs=Ie(ks);/**
|
|
37
|
+
* @license lucide-react v1.47.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 Es={name:"image-plus",size:24,node:[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]};Es.node;const bi=Ie(Es);/**
|
|
42
|
+
* @license lucide-react v1.47.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 Ts={name:"keyboard",size:24,node:[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]};Ts.node;const xi=Ie(Ts);/**
|
|
47
|
+
* @license lucide-react v1.47.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 As={name:"link-2",size:24,node:[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]};As.node;const Ns=Ie(As);/**
|
|
52
|
+
* @license lucide-react v1.47.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 Ps={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]};Ps.node;const rr=Ie(Ps);/**
|
|
57
|
+
* @license lucide-react v1.47.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 Is={name:"message-square",size:24,node:[["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"}]]};Is.node;const yi=Ie(Is);/**
|
|
62
|
+
* @license lucide-react v1.47.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 Ds={name:"power",size:24,node:[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]};Ds.node;const wi=Ie(Ds);/**
|
|
67
|
+
* @license lucide-react v1.47.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 Ls={name:"radio-off",size:24,node:[["path",{d:"M13.414 13.414a2 2 0 1 1-2.828-2.828",key:"srl686"}],["path",{d:"M16.247 7.761a6 6 0 0 1 1.744 4.572",key:"1h86sp"}],["path",{d:"M19.075 4.933a10 10 0 0 1 2.234 10.72",key:"1n13k4"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}]]};Ls.node;const vi=Ie(Ls);/**
|
|
72
|
+
* @license lucide-react v1.47.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 Ms={name:"radio",size:24,node:[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]};Ms.node;const Cr=Ie(Ms);/**
|
|
77
|
+
* @license lucide-react v1.47.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 $s={name:"refresh-cw",size:24,node:[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]};$s.node;const Si=Ie($s);/**
|
|
82
|
+
* @license lucide-react v1.47.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 Us={name:"rotate-cw",size:24,node:[["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"}]]};Us.node;const Ri=Ie(Us);/**
|
|
87
|
+
* @license lucide-react v1.47.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 Fs={name:"scan-line",size:24,node:[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M7 12h10",key:"b7w52i"}]]};Fs.node;const _i=Ie(Fs);/**
|
|
92
|
+
* @license lucide-react v1.47.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 zs={name:"square",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]};zs.node;const ji=Ie(zs);/**
|
|
97
|
+
* @license lucide-react v1.47.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 Hs={name:"unfold-horizontal",size:24,node:[["path",{d:"M16 12h6",key:"15xry1"}],["path",{d:"M8 12H2",key:"1jqql6"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 8v2",key:"1woqiv"}],["path",{d:"M12 14v2",key:"8jcxud"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m19 15 3-3-3-3",key:"wjy7rq"}],["path",{d:"m5 9-3 3 3 3",key:"j64kie"}]]};Hs.node;const ki=Ie(Hs);/**
|
|
102
|
+
* @license lucide-react v1.47.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 Bs={name:"video",size:24,node:[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]};Bs.node;const Ci=Ie(Bs);/**
|
|
107
|
+
* @license lucide-react v1.47.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 Os={name:"volume-1",size:24,node:[["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"}]]};Os.node;const Ei=Ie(Os);/**
|
|
112
|
+
* @license lucide-react v1.47.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 Ws={name:"volume-2",size:24,node:[["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"}]]};Ws.node;const Ti=Ie(Ws);function Ai(n){const e=ue.c(5),[t,s]=a.useState(null);let r,o;e[0]!==n?(r=()=>{n&&ko(n).then(s)},o=[n],e[0]=n,e[1]=r,e[2]=o):(r=e[1],o=e[2]),a.useEffect(r,o);let l;return e[3]!==t?(l={build:t},e[3]=t,e[4]=l):l=e[4],l}function Ni(n){const e=ue.c(42);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=[],e[0]=t):t=e[0];const[s,r]=a.useState(t),[o,l]=a.useState(null),[c,u]=a.useState(null),[d,p]=a.useState(""),[f,m]=a.useState(!1),[g,v]=a.useState("");let h;e[1]===Symbol.for("react.memo_cache_sentinel")?(h=q=>{q.type==="agents:listed"&&r(q.sessions),q.type==="session:joined"&&(m(!1),v("Connected")),q.type==="error"&&(m(!1),v(`Error: ${q.message}`))},e[1]=h):h=e[1];const E=h,{send:b,connected:_}=hs(E);let T,S;e[2]!==_||e[3]!==b?(T=()=>{if(!_)return;b({type:"agents:list"});const q=setInterval(()=>b({type:"agents:list"}),5e3);return()=>clearInterval(q)},S=[_,b],e[2]=_,e[3]=b,e[4]=T,e[5]=S):(T=e[4],S=e[5]),a.useEffect(T,S);let k;e[6]!==c||e[7]!==d?(k={sessionId:c,deviceId:d},e[6]=c,e[7]=d,e[8]=k):k=e[8];const C=a.useRef(k);let R,I;e[9]!==c||e[10]!==d?(R=()=>{C.current={sessionId:c,deviceId:d}},I=[c,d],e[9]=c,e[10]=d,e[11]=R,e[12]=I):(R=e[11],I=e[12]),a.useEffect(R,I);let M,P;e[13]!==b?(M=()=>()=>{const{sessionId:q,deviceId:oe}=C.current;q&&oe&&b({type:"device:shutdown",sessionId:q,payload:{deviceId:oe}})},P=[b],e[13]=b,e[14]=M,e[15]=P):(M=e[14],P=e[15]),a.useEffect(M,P);let L;if(e[16]!==n||e[17]!==s){let q;e[19]!==n?(q=oe=>oe.devices.some(Se=>Se.platform===n),e[19]=n,e[20]=q):q=e[20],L=s.filter(q),e[16]=n,e[17]=s,e[18]=L}else L=e[18];const $=L;let B;e[21]===Symbol.for("react.memo_cache_sentinel")?(B=q=>{p(q.id),m(!0),v("Booting…"),u(q.sessionId)},e[21]=B):B=e[21];const F=B;let Y;e[22]===Symbol.for("react.memo_cache_sentinel")?(Y=()=>p(""),e[22]=Y):Y=e[22];const G=Y;let Q;e[23]!==b?(Q=()=>{const{sessionId:q,deviceId:oe}=C.current;q&&oe&&b({type:"device:shutdown",sessionId:q,payload:{deviceId:oe}}),u(null),m(!1),v("")},e[23]=b,e[24]=Q):Q=e[24];const ae=Q;let se;e[25]!==b?(se=()=>{const{sessionId:q,deviceId:oe}=C.current;q&&oe&&b({type:"device:shutdown",sessionId:q,payload:{deviceId:oe}}),u(null),l(null),m(!1),v(""),b({type:"agents:list"})},e[25]=b,e[26]=se):se=e[26];const V=se;let O;e[27]!==b?(O=()=>{u(null),l(null),m(!1),v(""),b({type:"agents:list"})},e[27]=b,e[28]=O):O=e[28];const ce=O;let de;return e[29]!==c||e[30]!==$||e[31]!==f||e[32]!==_||e[33]!==d||e[34]!==ae||e[35]!==V||e[36]!==ce||e[37]!==o||e[38]!==b||e[39]!==s||e[40]!==g?(de={sessions:s,selectedAgent:o,setSelectedAgent:l,activeSessionId:c,deviceId:d,booting:f,status:g,send:b,connected:_,agentGroups:$,startDevice:F,resetDevice:G,handleBack:ae,handleBackToMacs:V,handleSessionEnded:ce},e[29]=c,e[30]=$,e[31]=f,e[32]=_,e[33]=d,e[34]=ae,e[35]=V,e[36]=ce,e[37]=o,e[38]=b,e[39]=s,e[40]=g,e[41]=de):de=e[41],de}function Pi(n,e){const t=ue.c(24),[s,r]=a.useState(""),[o,l]=a.useState(""),[c,u]=a.useState("app-only"),[d,p]=a.useState("app-only");let f;t[0]!==(n==null?void 0:n.capabilities)?(f=(n==null?void 0:n.capabilities.includes("full-reset"))??!1,t[0]=n==null?void 0:n.capabilities,t[1]=f):f=t[1];const m=f;let g;t[2]!==m||t[3]!==c?(g=()=>{p(m?c:"app-only"),u("app-only")},t[2]=m,t[3]=c,t[4]=g):g=t[4];const v=g;let h,E,b;if(t[5]!==o||t[6]!==e||t[7]!==s||t[8]!==(n==null?void 0:n.devices)){h=(n==null?void 0:n.devices.filter(k=>k.platform===e))??[],E=[...new Set(h.map(Li).filter(Boolean))].sort(Ii);let S;t[12]!==o?(S=k=>!o||k.name.toLowerCase().includes(o.toLowerCase()),t[12]=o,t[13]=S):S=t[13],b=(s?h.filter(k=>k.osVersion===s):h).filter(S),t[5]=o,t[6]=e,t[7]=s,t[8]=n==null?void 0:n.devices,t[9]=h,t[10]=E,t[11]=b}else h=t[9],E=t[10],b=t[11];const _=b;let T;return t[14]!==d||t[15]!==v||t[16]!==o||t[17]!==h||t[18]!==m||t[19]!==s||t[20]!==E||t[21]!==c||t[22]!==_?(T={filteredDevices:h,osVersions:E,osVersion:s,setOsVersion:r,deviceSearch:o,setDeviceSearch:l,versionedDevices:_,resetMode:c,setResetMode:u,appliedResetMode:d,consumeResetMode:v,fullResetSupported:m},t[14]=d,t[15]=v,t[16]=o,t[17]=h,t[18]=m,t[19]=s,t[20]=E,t[21]=c,t[22]=_,t[23]=T):T=t[23],T}function Ii(n,e){const t=Di,[s,r]=[t(n),t(e)];for(let o=0;o<Math.max(s.length,r.length);o++){const l=(r[o]??0)-(s[o]??0);if(l!==0)return l}return 0}function Di(n){return n.replace(/^[^\d]*/,"").split(".").map(Number)}function Li(n){return n.osVersion}function Mi(){const n=ue.c(8),[e]=ps();let t;n[0]!==e?(t=e.get("perf"),n[0]=e,n[1]=t):t=n[1];const s=t==="1",[r,o]=a.useState(!1),[l,c]=a.useState(s);l!==s&&(c(s),s||o(!1));let u,d;n[2]!==s?(u=()=>{if(!s)return;const m=g=>{g.ctrlKey&&g.shiftKey&&g.key==="P"&&o($i)};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},d=[s],n[2]=s,n[3]=u,n[4]=d):(u=n[3],d=n[4]),a.useEffect(u,d);const p=s&&!r;let f;return n[5]!==s||n[6]!==p?(f={perfMode:s,visible:p},n[5]=s,n[6]=p,n[7]=f):f=n[7],f}function $i(n){return!n}function Vs(n){const e=n.rolloverOffset.x-n.buttonW/2,t=n.anchor==="top"?n.rolloverOffset.y:n.normalOffset.y-n.buttonH/2;return{left:e,top:t,right:e+n.buttonW,bottom:t+n.buttonH}}function Ui(n,e,t){const s=Math.max(t.left-n,0,n-t.right),r=Math.max(t.top-e,0,e-t.bottom);return Math.hypot(s,r)}function Fi(n,e,t,s){let r=null,o=1/0;for(const l of t){const c=Ui(n,e,Vs(l));c<o&&(o=c,r=l.name)}return o<=s?r:null}const zi=["video/mp4;codecs=avc1","video/webm;codecs=vp9","video/webm;codecs=vp8","video/webm"];function qs({sessionId:n,buildId:e,onRecordingUploaded:t}){const[s,r]=a.useState("idle"),o=a.useRef(null),l=a.useRef(t);a.useEffect(()=>{l.current=t},[t]);const c=a.useRef(!1),u=a.useRef(null),d=a.useRef([]),p=a.useRef(""),f=a.useRef(0),m=a.useRef(null),g=a.useCallback(function b(){var _;c.current&&((_=m.current)==null||_.call(m),f.current=requestAnimationFrame(b))},[]),v=a.useCallback(b=>{m.current=b},[]),h=a.useCallback(()=>{const b=o.current;if(!b)return;const _=b.getContext("2d");_&&(_.fillStyle="#000",_.fillRect(0,0,b.width,b.height));const T=zi.find(k=>MediaRecorder.isTypeSupported(k))??"";if(!T)return;p.current=T,d.current=[];const S=new MediaRecorder(b.captureStream(30),{mimeType:T});S.ondataavailable=k=>{k.data.size>0&&d.current.push(k.data)},u.current=S,S.start(1e3),c.current=!0,f.current=requestAnimationFrame(g),r("recording")},[g]),E=a.useCallback(async()=>{var C;r("uploading"),c.current=!1,cancelAnimationFrame(f.current);const b=u.current;if(!b){r("idle");return}await new Promise(R=>{const I=setTimeout(R,5e3);b.onstop=()=>{clearTimeout(I),R()};try{b.stop()}catch{clearTimeout(I),R()}}),u.current=null;const _=p.current,T=_.includes("mp4")?".mp4":".webm",S=new Blob(d.current,{type:_});d.current=[];const k=new FormData;k.append("file",S,`tapflow-${Date.now()}${T}`);try{const R=new URLSearchParams({sessionId:n});e&&R.set("buildId",String(e));const I=await fetch(`/api/v1/recordings/upload?${R}`,{method:"POST",credentials:"include",body:k}),M=await I.json();if(I.ok&&M.url){const P=document.createElement("a");P.href=M.url,P.download="",P.click(),(C=l.current)==null||C.call(l),r("done"),setTimeout(()=>r("idle"),2e3)}else r("idle")}catch{r("idle")}},[n,e]);return a.useEffect(()=>{if(s!=="recording")return;const b=()=>{document.visibilityState==="hidden"&&E()};return document.addEventListener("visibilitychange",b),()=>{var _;document.removeEventListener("visibilitychange",b),c.current&&(c.current=!1,cancelAnimationFrame(f.current),(_=u.current)==null||_.stop(),u.current=null)}},[s,E]),{recordState:s,recordCanvasRef:o,setComposeFrame:v,startClientRecording:h,stopClientRecording:E}}function Ks(){const n=ue.c(4),e=a.useRef(0),[t,s]=a.useState(0);let r,o;n[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{const c=setInterval(()=>{s(e.current),e.current=0},1e3);return()=>clearInterval(c)},o=[],n[0]=r,n[1]=o):(r=n[0],o=n[1]),a.useEffect(r,o);let l;return n[2]!==t?(l={fps:t,frameCount:e},n[2]=t,n[3]=l):l=n[3],l}function tr(n){const e=ue.c(8);let t,s;e[0]!==n?({className:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let r;e[3]!==t?(r=He("bg-muted text-muted-foreground pointer-events-none inline-flex h-5 w-fit min-w-5 select-none items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium","[&_svg:not([class*='size-'])]:size-3","[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==s||e[6]!==r?(o=i.jsx("kbd",{"data-slot":"kbd",className:r,...s}),e[5]=s,e[6]=r,e[7]=o):o=e[7],o}function Pr(n){const e=ue.c(8);let t,s;e[0]!==n?({className:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let r;e[3]!==t?(r=He("inline-flex items-center gap-1",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==s||e[6]!==r?(o=i.jsx("kbd",{"data-slot":"kbd-group",className:r,...s}),e[5]=s,e[6]=r,e[7]=o):o=e[7],o}function fr(n){const e=ue.c(7),{label:t,keys:s}=n;let r;e[0]!==s?(r=s.map(Hi),e[0]=s,e[1]=r):r=e[1];let o;e[2]!==r?(o=i.jsx(Pr,{children:r}),e[2]=r,e[3]=o):o=e[3];let l;return e[4]!==t||e[5]!==o?(l=i.jsxs("span",{className:"flex items-center gap-3",children:[t,o]}),e[4]=t,e[5]=o,e[6]=l):l=e[6],l}function Hi(n){return i.jsx(tr,{children:n},n)}const Qr="text-muted-foreground hover:text-muted-foreground",Zr="text-destructive hover:text-destructive";function Bi(n){switch(n){case"awaiting-app":return" Launch an app through tapflow so it is told too.";case"not-armed":return" Restart the device so tapflow can set it up.";case"state-unconfirmed":return" tapflow could not confirm the change — try again.";case"unsupported-device":return" The device did not change when tapflow asked — try again, or use another device.";case"filter-unavailable":return" This Mac is not set up to take devices off the network — see the network control guide.";case"enforcement-lost":return" It went back on the network on its own.";case"hooks-not-installed":return" tapflow cannot tell this app it is off the network.";default:return" tapflow cannot change it right now."}}function Oi({position:n,steerable:e,reason:t}){const s=t==="awaiting-app",r=!e&&t==="state-unconfirmed"?" animate-pulse":"",o=e?"":Bi(t);switch(n){case"offline":return{Icon:vi,className:(e||s?"text-amber-500 hover:text-amber-500":Zr)+r,status:`Device is offline.${o}`};case"online":return{Icon:Cr,className:(e||s?"":Zr)+r,status:`Device is on the network.${o}`};case"waiting":return{Icon:Cr,className:`${Qr} animate-pulse`,status:"Checking the network state."};case"unknown":return{Icon:Cr,className:Qr,status:"No network state has been reported."}}}function Wi({position:n,steerable:e,reason:t}){const s=n==="offline"?"Bring device online":n==="online"?"Take device offline":"Toggle device network",r=n==="online"||n==="offline",o=t==="state-unconfirmed"||t==="unsupported-device";return e||!r||t==="awaiting-app"?s:o?`Retry: ${s.toLowerCase()}`:`${s} — unavailable`}function Xs(n){var Ce;const e=ue.c(82),{joined:t,onScreenshot:s,onRecordToggle:r,recordState:o,onRotate:l,posture:c,onDeepLink:u,navigationSlot:d,deviceSlot:p,launchSlot:f,network:m,reboot:g}=n,v=a.useId(),h=a.useId(),E=a.useId(),b=a.useId(),[_,T]=a.useState(!1);if(!t)return null;let S;e[0]===Symbol.for("react.memo_cache_sentinel")?(S=i.jsx(Ns,{className:"h-4 w-4"}),e[0]=S):S=e[0];let k;e[1]!==u?(k=i.jsx(Tt,{asChild:!0,children:i.jsx(qe,{variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":"Open a deeplink",onClick:u,children:S})}),e[1]=u,e[2]=k):k=e[2];let C;e[3]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(At,{side:"left",children:i.jsx(fr,{label:"Deeplink",keys:["⌘","K"]})}),e[3]=C):C=e[3];let R;e[4]!==k?(R=i.jsxs(Et,{children:[k,C]}),e[4]=k,e[5]=R):R=e[5];let I;e[6]!==f||e[7]!==d||e[8]!==R?(I=i.jsxs("div",{role:"group","aria-label":"Navigation",className:"flex flex-col items-center gap-0.5",children:[f,d,R]}),e[6]=f,e[7]=d,e[8]=R,e[9]=I):I=e[9];let M;e[10]===Symbol.for("react.memo_cache_sentinel")?(M=i.jsx("div",{role:"separator","aria-orientation":"horizontal",className:"w-4 h-px bg-border my-1"}),e[10]=M):M=e[10];let P;e[11]===Symbol.for("react.memo_cache_sentinel")?(P=i.jsx(Ri,{className:"h-4 w-4"}),e[11]=P):P=e[11];let L;e[12]!==l?(L=i.jsx(Tt,{asChild:!0,children:i.jsx(qe,{variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":"Rotate the device",onClick:l,children:P})}),e[12]=l,e[13]=L):L=e[13];let $;e[14]===Symbol.for("react.memo_cache_sentinel")?($=i.jsx(At,{side:"left",children:i.jsx(fr,{label:"Rotate",keys:["⌘","⇧","O"]})}),e[14]=$):$=e[14];let B;e[15]!==L?(B=i.jsxs(Et,{children:[L,$]}),e[15]=L,e[16]=B):B=e[16];let F;e[17]!==c||e[18]!==E?(F=c&&c.postures.length===2&&i.jsx("span",{id:E,role:"status","aria-live":"polite",className:"sr-only",children:c.pending?"Changing posture":((Ce=c.postures.find(pe=>pe.id===c.currentId))==null?void 0:Ce.label)??"Current posture unknown"}),e[17]=c,e[18]=E,e[19]=F):F=e[19];let Y;e[20]!==c||e[21]!==E?(Y=c&&c.postures.length===2&&(()=>{const pe=c.postures.findIndex(Fe=>Fe.id===c.currentId),fe=pe===-1?null:c.postures[pe],Ze=c.postures[(pe+1)%2],Be=pe===0,Xe=Be?ki:gi,xe=Be?"Unfold":"Fold",ye=fe?`${xe}: ${fe.label} to ${Ze.label}`:`${xe}: ${Ze.label}`,Ye=Fe=>i.jsx(qe,{variant:"ghost",size:"icon",className:"h-8 w-8 aria-disabled:opacity-50","aria-label":c.pending?`${ye} — changing`:ye,"aria-busy":c.pending,"aria-disabled":c.pending,"aria-describedby":E,onClick:()=>{c.pending||Fe==null||Fe()},children:c.pending?i.jsx(rr,{className:"h-4 w-4 animate-spin"}):i.jsx(Xe,{className:"h-4 w-4"})});return i.jsxs(Et,{children:[i.jsx(Tt,{asChild:!0,children:Ye(()=>c.onSelect(Ze.id))}),i.jsx(At,{side:"left",children:c.pending?`${ye} — changing`:ye})]})})(),e[20]=c,e[21]=E,e[22]=Y):Y=e[22];let G;e[23]!==g||e[24]!==h?(G=g&&(()=>{const pe=g.pending?"Restarting the device":"Restart the device";return i.jsxs(i.Fragment,{children:[i.jsxs(Et,{children:[i.jsx(Tt,{asChild:!0,children:i.jsx(qe,{ref:g.buttonRef,variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":pe,"aria-busy":g.pending,"aria-disabled":g.pending,"aria-describedby":h,onClick:()=>{g.pending||T(!0)},children:g.pending?i.jsx(rr,{className:"h-4 w-4 animate-spin"}):i.jsx(Si,{className:"h-4 w-4"})})}),i.jsx(At,{side:"left",children:pe})]}),i.jsx("span",{id:h,role:"status",className:"sr-only",children:g.pending?"Restarting the device.":""})]})})(),e[23]=g,e[24]=h,e[25]=G):G=e[25];let Q;e[26]!==p||e[27]!==B||e[28]!==F||e[29]!==Y||e[30]!==G?(Q=i.jsxs("div",{role:"group","aria-label":"Device",className:"flex flex-col items-center gap-0.5",children:[p,B,F,Y,G]}),e[26]=p,e[27]=B,e[28]=F,e[29]=Y,e[30]=G,e[31]=Q):Q=e[31];let ae;e[32]===Symbol.for("react.memo_cache_sentinel")?(ae=i.jsx("div",{role:"separator","aria-orientation":"horizontal",className:"w-4 h-px bg-border my-1"}),e[32]=ae):ae=e[32];let se;e[33]===Symbol.for("react.memo_cache_sentinel")?(se=i.jsx(hi,{className:"h-4 w-4"}),e[33]=se):se=e[33];let V;e[34]!==s?(V=i.jsx(Tt,{asChild:!0,children:i.jsx(qe,{variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":"Take a screenshot",onClick:s,children:se})}),e[34]=s,e[35]=V):V=e[35];let O;e[36]===Symbol.for("react.memo_cache_sentinel")?(O=i.jsx(At,{side:"left",children:i.jsx(fr,{label:"Screenshot",keys:["⌘","S"]})}),e[36]=O):O=e[36];let ce;e[37]!==V?(ce=i.jsxs(Et,{children:[V,O]}),e[37]=V,e[38]=ce):ce=e[38];const de=o==="recording"&&"text-red-500 hover:text-red-500";let q;e[39]!==de?(q=He("h-8 w-8 aria-disabled:opacity-50",de),e[39]=de,e[40]=q):q=e[40];const oe=o==="recording"?"Stop recording":o==="uploading"?"Processing the recording":o==="done"?"Recording saved":"Start recording",Se=o==="uploading",je=o==="uploading"||o==="done";let ge;e[41]!==r||e[42]!==o?(ge=()=>{(o==="idle"||o==="recording")&&r()},e[41]=r,e[42]=o,e[43]=ge):ge=e[43];let Te;e[44]!==o?(Te=o==="uploading"?i.jsx(rr,{className:"h-4 w-4 animate-spin"}):o==="recording"?i.jsx(ji,{className:"h-4 w-4 fill-current"}):i.jsx(Ci,{className:"h-4 w-4"}),e[44]=o,e[45]=Te):Te=e[45];let J;e[46]!==b||e[47]!==q||e[48]!==oe||e[49]!==Se||e[50]!==je||e[51]!==ge||e[52]!==Te?(J=i.jsx(Tt,{asChild:!0,children:i.jsx(qe,{variant:"ghost",size:"icon",className:q,"aria-label":oe,"aria-busy":Se,"aria-disabled":je,"aria-describedby":b,onClick:ge,children:Te})}),e[46]=b,e[47]=q,e[48]=oe,e[49]=Se,e[50]=je,e[51]=ge,e[52]=Te,e[53]=J):J=e[53];let he;e[54]!==o?(he=o==="idle"?i.jsx(fr,{label:"Start recording",keys:["⌘","⇧","Y"]}):o==="recording"?i.jsx(fr,{label:"Stop recording",keys:["⌘","⇧","Y"]}):o==="done"?"Recording saved":"Processing the recording",e[54]=o,e[55]=he):he=e[55];let ee;e[56]!==he?(ee=i.jsx(At,{side:"left",children:he}),e[56]=he,e[57]=ee):ee=e[57];let Re;e[58]!==J||e[59]!==ee?(Re=i.jsxs(Et,{children:[J,ee]}),e[58]=J,e[59]=ee,e[60]=Re):Re=e[60];const z=o==="recording"?"Recording.":o==="uploading"?"Processing the recording.":o==="done"?"Recording saved.":"";let Z;e[61]!==b||e[62]!==z?(Z=i.jsx("span",{id:b,role:"status",className:"sr-only",children:z}),e[61]=b,e[62]=z,e[63]=Z):Z=e[63];let be;e[64]!==ce||e[65]!==Re||e[66]!==Z?(be=i.jsxs("div",{role:"group","aria-label":"Capture",className:"flex flex-col items-center gap-0.5",children:[ce,Re,Z]}),e[64]=ce,e[65]=Re,e[66]=Z,e[67]=be):be=e[67];let Ue;e[68]!==v||e[69]!==m?(Ue=m&&i.jsxs(i.Fragment,{children:[i.jsx("div",{role:"separator","aria-orientation":"horizontal",className:"w-4 h-px bg-border my-1"}),i.jsx("div",{role:"group","aria-label":"Environment",className:"flex flex-col items-center gap-0.5",children:m&&(()=>{const{Icon:pe,className:fe,status:Ze}=Oi(m),Be=Wi(m),Xe=m.position==="waiting"||m.position==="unknown"||!m.steerable;return i.jsxs(Et,{children:[i.jsx(Tt,{asChild:!0,children:i.jsx(qe,{variant:"ghost",size:"icon",className:He("h-8 w-8",fe),"aria-label":Be,"aria-busy":m.pending,"aria-disabled":m.pending,"aria-describedby":v,onClick:()=>{m.pending||m.onToggle()},children:m.pending?i.jsx(rr,{className:"h-4 w-4 animate-spin"}):i.jsx(pe,{className:"h-4 w-4"})})}),i.jsx("span",{id:v,role:"status",className:"sr-only",children:m.pending?"Changing the network state.":Ze}),i.jsx(At,{side:"left",children:Xe?`${Be} — ${Ze}`:Be})]})})()})]}),e[68]=v,e[69]=m,e[70]=Ue):Ue=e[70];let ke;e[71]!==Q||e[72]!==be||e[73]!==Ue||e[74]!==I?(ke=i.jsxs("div",{className:"flex flex-col items-center gap-0.5 rounded-2xl border bg-background/90 backdrop-blur-sm px-1.5 py-2.5 shrink-0 mt-3",children:[I,M,Q,ae,be,Ue]}),e[71]=Q,e[72]=be,e[73]=Ue,e[74]=I,e[75]=ke):ke=e[75];let Ke;e[76]!==_||e[77]!==g?(Ke=g&&i.jsx(Wo,{open:_,onOpenChange:T,children:i.jsxs(Vo,{children:[i.jsxs(qo,{children:[i.jsx(Ko,{children:"Restart this device?"}),i.jsx(Xo,{children:"Anything open on the device closes, and whatever you had set up on screen is gone. The app under test is reinstalled, which clears its data; other apps keep theirs. The device takes a moment to come back."})]}),i.jsxs(Yo,{children:[i.jsx(Go,{children:"Cancel"}),i.jsx(Jo,{onClick:()=>{T(!1),g.onReboot()},children:"Restart"})]})]})}),e[76]=_,e[77]=g,e[78]=Ke):Ke=e[78];let Ne;return e[79]!==ke||e[80]!==Ke?(Ne=i.jsxs(Nr,{delayDuration:400,children:[ke,Ke]}),e[79]=ke,e[80]=Ke,e[81]=Ne):Ne=e[81],Ne}const Vi=3e3,qi=8e3;function Ys(n){const e=ue.c(40),{sessionId:t,send:s,supported:r,deviceReady:o,handlerRef:l,onError:c}=n,[u,d]=a.useState("waiting"),[p,f]=a.useState(!0),[m,g]=a.useState(void 0),v=a.useRef(void 0),[h,E]=a.useState(!1),b=a.useRef(null);let _;e[0]===Symbol.for("react.memo_cache_sentinel")?(_=new Set,e[0]=_):_=e[0];const T=a.useRef(_),S=a.useRef(c);let k,C;e[1]!==c?(k=()=>{S.current=c},C=[c],e[1]=c,e[2]=k,e[3]=C):(k=e[2],C=e[3]),a.useEffect(k,C);const R=a.useRef(o);let I,M;e[4]!==o?(I=()=>{R.current=o},M=[o],e[4]=o,e[5]=I,e[6]=M):(I=e[5],M=e[6]),a.useEffect(I,M);const P=a.useRef(o),[L,$]=a.useState(t);L!==t&&($(t),d("waiting"),f(!0),g(void 0),E(!1));let B;e[7]===Symbol.for("react.memo_cache_sentinel")?(B=()=>{v.current=void 0,b.current=null,P.current=R.current,T.current.clear()},e[7]=B):B=e[7];let F;e[8]!==t?(F=[t],e[8]=t,e[9]=F):F=e[9],a.useEffect(B,F);let Y,G;e[10]!==o?(Y=()=>{var J;if(o){P.current=!0,d("waiting");return}d(P.current?"unknown":"waiting"),f(!0),g(void 0),v.current=void 0,b.current&&((J=S.current)==null||J.call(S,"The device became unavailable before it answered. Its network state is unchanged as far as tapflow can tell."),T.current.add(b.current)),E(!1),b.current=null},G=[o],e[10]=o,e[11]=Y,e[12]=G):(Y=e[11],G=e[12]),a.useEffect(Y,G);let Q,ae;e[13]!==l||e[14]!==r?(Q=()=>{if(r)return l.current=J=>{var ee,Re;if(J.type==="network:error"){J.requestId===b.current&&(b.current=null,E(!1),(ee=S.current)==null||ee.call(S,J.message));return}if(J.type!=="network:state"||!R.current||J.requestId!==void 0&&T.current.has(J.requestId))return;const he=J.payload.available?void 0:J.payload.reason;d(J.payload.offline?"offline":"online"),f(J.payload.available),g(he),he==="enforcement-lost"&&v.current!=="enforcement-lost"&&((Re=S.current)==null||Re.call(S,"The device went back on the network before you took it off. Anything checked while it was offline needs checking again.")),v.current=he,J.requestId!==void 0&&J.requestId===b.current&&(b.current=null,E(!1))},()=>{l.current=void 0}},ae=[l,r],e[13]=l,e[14]=r,e[15]=Q,e[16]=ae):(Q=e[15],ae=e[16]),a.useEffect(Q,ae);let se,V;e[17]!==o||e[18]!==u||e[19]!==r?(se=()=>{if(!r||!o||u!=="waiting")return;const J=setTimeout(()=>d(Ki),Vi);return()=>clearTimeout(J)},V=[r,o,u],e[17]=o,e[18]=u,e[19]=r,e[20]=se,e[21]=V):(se=e[20],V=e[21]),a.useEffect(se,V);let O;e[22]!==h||e[23]!==u||e[24]!==s||e[25]!==t||e[26]!==r?(O=()=>{if(!r||h)return;const J=ve();b.current=J,E(!0),s({type:"network:set",sessionId:t,requestId:J,payload:{offline:u!=="offline"}})},e[22]=h,e[23]=u,e[24]=s,e[25]=t,e[26]=r,e[27]=O):O=e[27];const ce=O,[de,q]=a.useState(null);let oe,Se;e[28]!==h?(oe=()=>{q(h?b.current:null)},Se=[h],e[28]=h,e[29]=oe,e[30]=Se):(oe=e[29],Se=e[30]),a.useEffect(oe,Se);let je,ge;e[31]!==de?(je=()=>{if(de===null)return;const J=setTimeout(()=>{var he;b.current===de&&(b.current=null,E(!1),(he=S.current)==null||he.call(S,"The device did not answer. Its network state is unchanged as far as tapflow can tell."))},qi);return()=>clearTimeout(J)},ge=[de],e[31]=de,e[32]=je,e[33]=ge):(je=e[32],ge=e[33]),a.useEffect(je,ge);let Te;return e[34]!==h||e[35]!==u||e[36]!==m||e[37]!==p||e[38]!==ce?(Te={position:u,steerable:p,reason:m,pending:h,toggle:ce},e[34]=h,e[35]=u,e[36]=m,e[37]=p,e[38]=ce,e[39]=Te):Te=e[39],Te}function Ki(n){return n==="waiting"?"unknown":n}class Ir{constructor(e){this.bytes=e,this.bitPos=0}get position(){return this.bitPos}bit(){const e=this.bitPos>>3,t=7-(this.bitPos&7);return this.bitPos++,e>=this.bytes.length?0:this.bytes[e]>>t&1}bits(e){let t=0;for(let s=0;s<e;s++)t=t<<1|this.bit();return t>>>0}flag(){return this.bit()===1}ue(){let e=0;for(;this.bit()===0&&e<32;)e++;return e===0?0:(1<<e)-1+this.bits(e)}se(){const e=this.ue();return e&1?Math.ceil(e/2):-Math.ceil(e/2)}}class Xi{constructor(){this.bitsArr=[]}bit(e){this.bitsArr.push(e&1)}ue(e){const t=e+1,s=Math.floor(Math.log2(t));for(let r=0;r<s;r++)this.bit(0);for(let r=s;r>=0;r--)this.bit(t>>r&1)}toBytes(){const e=[];for(let t=0;t<this.bitsArr.length;t+=8){let s=0;for(let r=0;r<8;r++)s=s<<1|(this.bitsArr[t+r]??0);e.push(s)}return new Uint8Array(e)}}function Gs(n){const e=[];let t=0;for(let s=1;s<n.length;s++){const r=n[s];if(t>=2&&r===3){t=0;continue}e.push(r),t=r===0?t+1:0}return new Uint8Array(e)}function Yi(n){const e=[];let t=0;for(const s of n)t>=2&&s<=3&&(e.push(3),t=0),e.push(s),t=s===0?t+1:0;return new Uint8Array(e)}const Gi=new Set([100,110,122,244,44,83,86,118,128,138,139,134,135]);function es(n){const e=n.ue()+1;n.bits(4),n.bits(4);for(let t=0;t<e;t++)n.ue(),n.ue(),n.flag();n.bits(5),n.bits(5),n.bits(5),n.bits(5)}function Js(n){const e=n.bits(8);n.bits(8);const t=n.bits(8);if(n.ue(),Gi.has(e)){const f=n.ue();if(f===3&&n.flag(),n.ue(),n.ue(),n.flag(),n.flag()){const m=f!==3?8:12;for(let g=0;g<m;g++)if(n.flag()){const v=g<6?16:64;let h=8,E=8;for(let b=0;b<v;b++)E!==0&&(E=(h+n.se()+256)%256),h=E===0?h:E}}}n.ue();const s=n.ue();if(s===0)n.ue();else if(s===1){n.flag(),n.se(),n.se();const f=n.ue();for(let m=0;m<f;m++)n.se()}const r=n.ue();n.flag(),n.ue(),n.ue(),n.flag()||n.flag(),n.flag(),n.flag()&&(n.ue(),n.ue(),n.ue(),n.ue());const o={profileIdc:e,levelIdc:t,numRefFrames:r,bitstreamRestriction:!1,maxNumReorderFrames:null,maxDecFrameBuffering:null};if(!n.flag())return{...o,vuiPresent:!1,restrictionFlagPos:-1};n.flag()&&n.bits(8)===255&&(n.bits(16),n.bits(16)),n.flag()&&n.flag(),n.flag()&&(n.bits(3),n.flag(),n.flag()&&(n.bits(8),n.bits(8),n.bits(8))),n.flag()&&(n.ue(),n.ue()),n.flag()&&(n.bits(32),n.bits(32),n.flag());const c=n.flag();c&&es(n);const u=n.flag();u&&es(n),(c||u)&&n.flag(),n.flag();const d=n.position;return n.flag()?(n.flag(),n.ue(),n.ue(),n.ue(),n.ue(),{...o,vuiPresent:!0,bitstreamRestriction:!0,maxNumReorderFrames:n.ue(),maxDecFrameBuffering:n.ue(),restrictionFlagPos:d}):{...o,vuiPresent:!0,restrictionFlagPos:d}}function Ji(n){const e=Js(new Ir(Gs(n)));return{profileIdc:e.profileIdc,levelIdc:e.levelIdc,vuiPresent:e.vuiPresent,bitstreamRestriction:e.bitstreamRestriction,maxNumReorderFrames:e.maxNumReorderFrames,maxDecFrameBuffering:e.maxDecFrameBuffering}}function Qi(n){const e=Gs(n),t=Js(new Ir(e));if(!t.vuiPresent||t.restrictionFlagPos<0||t.bitstreamRestriction)return null;const s=new Xi,r=new Ir(e);for(let o=0;o<t.restrictionFlagPos;o++)s.bit(r.bit());return s.bit(1),s.bit(1),s.ue(0),s.ue(0),s.ue(0),s.ue(0),s.ue(0),s.ue(t.numRefFrames),s.bit(1),Uint8Array.from([n[0],...Yi(s.toBytes())])}function Zi(n){const e=[],t=n.length;let s=-1,r=0;for(;r+2<t;){const o=r+3<t&&n[r]===0&&n[r+1]===0&&n[r+2]===0&&n[r+3]===1,l=n[r]===0&&n[r+1]===0&&n[r+2]===1;o||l?(s>=0&&e.push(n.subarray(s,r)),r+=o?4:3,s=r):r++}return s>=0&&e.push(n.subarray(s,t)),e}class el{constructor(e){this.onFrame=e,this.decoder=null,this.sps=null,this.pps=null,this.frameCount=0,this.submitAt=new Map,this.spsLogged=!1}setDecodeSampler(e){this.decodeSampler=e}decode(e){const t=[];let s=!1;for(const d of Zi(new Uint8Array(e))){const p=d[0]&31;if(p===7){const f=!this.sps||d.length!==this.sps.length||d.some((m,g)=>m!==this.sps[g]);this.sps=d,f&&this.decoder&&(this.decoder.close(),this.decoder=null)}else p===8?this.pps=d:p>=1&&p<=5&&(p===5&&(s=!0),t.push(d))}if(s&&this.sps&&this.pps&&!this.decoder&&this.initDecoder(this.sps,this.pps),!this.decoder||t.length===0)return;let r=0;for(const d of t)r+=4+d.length;const o=new Uint8Array(r),l=new DataView(o.buffer);let c=0;for(const d of t)l.setUint32(c,d.length,!1),c+=4,o.set(d,c),c+=d.length;const u=Math.round(this.frameCount++*(1e6/30));if(this.decodeSampler&&(this.submitAt.set(u,performance.now()),this.submitAt.size>120)){const d=this.submitAt.keys().next().value;d!==void 0&&this.submitAt.delete(d)}try{this.decoder.decode(new EncodedVideoChunk({type:s?"key":"delta",timestamp:u,data:o}))}catch{}}sampleDecode(e){var s;if(!this.decodeSampler)return;const t=this.submitAt.get(e.timestamp);t!==void 0&&(this.submitAt.delete(e.timestamp),this.decodeSampler({decodeMs:performance.now()-t,queueSize:((s=this.decoder)==null?void 0:s.decodeQueueSize)??0}))}close(){var e;(e=this.decoder)==null||e.close(),this.decoder=null}logSpsVui(e){if(!(this.spsLogged||!this.decodeSampler)){this.spsLogged=!0;try{console.log("[sps-vui]",JSON.stringify(Ji(e)))}catch(t){console.warn("[sps-vui] parse failed",t)}}}initDecoder(e,t){this.logSpsVui(e);const s=Qi(e)??e,r=s[0]===0?s.subarray(4):s,o=`avc1.${r[1].toString(16).padStart(2,"0")}${r[2].toString(16).padStart(2,"0")}${r[3].toString(16).padStart(2,"0")}`,l=this.buildAVCC(s,t);this.decoder=new VideoDecoder({output:c=>{this.sampleDecode(c),this.onFrame(c)},error:c=>console.error("[WebCodecsCore]",c)}),this.decoder.configure({codec:o,description:l,optimizeForLatency:!0})}buildAVCC(e,t){const s=e[0]===0?e.subarray(4):e,r=t[0]===0?t.subarray(4):t,o=new Uint8Array(8+s.length+1+2+r.length);let l=0;return o[l++]=1,o[l++]=s[1],o[l++]=s[2],o[l++]=s[3],o[l++]=255,o[l++]=225,o[l++]=s.length>>8&255,o[l++]=s.length&255,o.set(s,l),l+=s.length,o[l++]=1,o[l++]=r.length>>8&255,o[l++]=r.length&255,o.set(r,l),o}}const tl=`#version 300 es
|
|
117
|
+
in vec2 a_pos;
|
|
118
|
+
out vec2 v_uv;
|
|
119
|
+
void main() {
|
|
120
|
+
v_uv = vec2(a_pos.x * 0.5 + 0.5, 0.5 - a_pos.y * 0.5);
|
|
121
|
+
gl_Position = vec4(a_pos, 0.0, 1.0);
|
|
122
|
+
}`,nl=`#version 300 es
|
|
123
|
+
precision mediump float;
|
|
124
|
+
in vec2 v_uv;
|
|
125
|
+
uniform sampler2D u_tex;
|
|
126
|
+
out vec4 out_color;
|
|
127
|
+
void main() {
|
|
128
|
+
out_color = texture(u_tex, v_uv);
|
|
129
|
+
}`;function rl(n){const e=n.getContext("webgl2",{alpha:!1,antialias:!1,powerPreference:"high-performance",preserveDrawingBuffer:!0});if(!e)return null;const t=(p,f)=>{const m=e.createShader(p);return e.shaderSource(m,f),e.compileShader(m),m},s=e.createProgram(),r=t(e.VERTEX_SHADER,tl),o=t(e.FRAGMENT_SHADER,nl);e.attachShader(s,r),e.attachShader(s,o),e.linkProgram(s),e.deleteShader(r),e.deleteShader(o),e.useProgram(s);const l=e.createVertexArray();e.bindVertexArray(l);const c=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,c),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),e.STATIC_DRAW);const u=e.getAttribLocation(s,"a_pos");e.enableVertexAttribArray(u),e.vertexAttribPointer(u,2,e.FLOAT,!1,0,0),e.bindVertexArray(null);const d=e.createTexture();return e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,d),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.uniform1i(e.getUniformLocation(s,"u_tex"),0),{gl:e,program:s,tex:d,vao:l}}class sl{constructor(e){this.canvas=e,this.state=null}init(){return this.state=rl(this.canvas),this.state!==null}drawFrame(e){const t=this.state;if(!t)return e.close(),null;const s=e.displayWidth,r=e.displayHeight;try{return(this.canvas.width!==s||this.canvas.height!==r)&&(this.canvas.width=s,this.canvas.height=r,t.gl.viewport(0,0,s,r)),t.gl.activeTexture(t.gl.TEXTURE0),t.gl.bindTexture(t.gl.TEXTURE_2D,t.tex),t.gl.texImage2D(t.gl.TEXTURE_2D,0,t.gl.RGBA,t.gl.RGBA,t.gl.UNSIGNED_BYTE,e),t.gl.bindVertexArray(t.vao),t.gl.drawArrays(t.gl.TRIANGLES,0,6),t.gl.bindVertexArray(null),t.gl.bindTexture(t.gl.TEXTURE_2D,null),{width:s,height:r}}finally{e.close()}}dispose(){const e=this.state;e&&(e.gl.deleteTexture(e.tex),e.gl.deleteVertexArray(e.vao),e.gl.deleteProgram(e.program),this.state=null)}}function ol(n){const e=new sl(n);return e.init(),e}class il{constructor(e=ol){this._size=null,this.canvas=document.createElement("canvas"),this.renderer=e(this.canvas),this.core=new el(t=>this.render(t))}get surface(){return this.canvas}get size(){return this._size}onResize(e){this.resizeCb=e}onDecodedFrame(e){this.decodedCb=e,this.core.setDecodeSampler(t=>{this.lastSample=t})}decode(e){this.core.decode(e)}close(){this.core.close(),this.renderer.dispose()}render(e){var s,r;const t=this.renderer.drawFrame(e);t&&((s=this.decodedCb)==null||s.call(this,performance.now(),this.lastSample),this.lastSample=void 0,(!this._size||this._size.width!==t.width||this._size.height!==t.height)&&(this._size=t,(r=this.resizeCb)==null||r.call(this,t)))}}const ll=`#version 300 es
|
|
130
|
+
in vec2 a_pos;
|
|
131
|
+
out vec2 v_uv;
|
|
132
|
+
void main() {
|
|
133
|
+
v_uv = vec2(a_pos.x * 0.5 + 0.5, 0.5 - a_pos.y * 0.5);
|
|
134
|
+
gl_Position = vec4(a_pos, 0.0, 1.0);
|
|
135
|
+
}`,al=`#version 300 es
|
|
136
|
+
precision mediump float;
|
|
137
|
+
in vec2 v_uv;
|
|
138
|
+
uniform sampler2D u_texY;
|
|
139
|
+
uniform sampler2D u_texU;
|
|
140
|
+
uniform sampler2D u_texV;
|
|
141
|
+
out vec4 out_color;
|
|
142
|
+
void main() {
|
|
143
|
+
float Y = (texture(u_texY, v_uv).r - 0.0627451) * 1.1643836; // (y-16/255)*255/219
|
|
144
|
+
float U = (texture(u_texU, v_uv).r - 0.5019608) * 1.1383929; // (u-128/255)*255/224
|
|
145
|
+
float V = (texture(u_texV, v_uv).r - 0.5019608) * 1.1383929;
|
|
146
|
+
float r = Y + 1.5748 * V;
|
|
147
|
+
float g = Y - 0.1873 * U - 0.4681 * V;
|
|
148
|
+
float b = Y + 1.8556 * U;
|
|
149
|
+
out_color = vec4(r, g, b, 1.0);
|
|
150
|
+
}`;function Er(n,e,t,s){const r=n.createTexture();return n.activeTexture(n.TEXTURE0+e),n.bindTexture(n.TEXTURE_2D,r),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.uniform1i(n.getUniformLocation(s,t),e),r}function cl(n){const e=n.getContext("webgl2",{alpha:!1,antialias:!1,powerPreference:"high-performance",preserveDrawingBuffer:!0});if(!e)return null;const t=(m,g)=>{const v=e.createShader(m);return e.shaderSource(v,g),e.compileShader(v),v},s=e.createProgram(),r=t(e.VERTEX_SHADER,ll),o=t(e.FRAGMENT_SHADER,al);e.attachShader(s,r),e.attachShader(s,o),e.linkProgram(s),e.deleteShader(r),e.deleteShader(o),e.useProgram(s);const l=e.createVertexArray();e.bindVertexArray(l);const c=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,c),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),e.STATIC_DRAW);const u=e.getAttribLocation(s,"a_pos");e.enableVertexAttribArray(u),e.vertexAttribPointer(u,2,e.FLOAT,!1,0,0),e.bindVertexArray(null),e.pixelStorei(e.UNPACK_ALIGNMENT,1);const d=Er(e,0,"u_texY",s),p=Er(e,1,"u_texU",s),f=Er(e,2,"u_texV",s);return{gl:e,program:s,texY:d,texU:p,texV:f,vao:l}}class dl{constructor(e){this.canvas=e,this.state=null}init(){return this.state=cl(this.canvas),this.state!==null}drawI420(e,t,s){const r=this.state;if(!r)return null;const{gl:o}=r,l=t+1>>1,c=s+1>>1,u=t*s,d=l*c,p=e.subarray(0,u),f=e.subarray(u,u+d),m=e.subarray(u+d,u+2*d);(this.canvas.width!==t||this.canvas.height!==s)&&(this.canvas.width=t,this.canvas.height=s,o.viewport(0,0,t,s));const g=(v,h,E,b,_)=>{o.activeTexture(o.TEXTURE0+v),o.bindTexture(o.TEXTURE_2D,h),o.texImage2D(o.TEXTURE_2D,0,o.R8,E,b,0,o.RED,o.UNSIGNED_BYTE,_)};return g(0,r.texY,t,s,p),g(1,r.texU,l,c,f),g(2,r.texV,l,c,m),o.bindVertexArray(r.vao),o.drawArrays(o.TRIANGLES,0,6),o.bindVertexArray(null),{width:t,height:s}}dispose(){const e=this.state;e&&(e.gl.deleteTexture(e.texY),e.gl.deleteTexture(e.texU),e.gl.deleteTexture(e.texV),e.gl.deleteVertexArray(e.vao),e.gl.deleteProgram(e.program),this.state=null)}}const ul=0;function fl(n){const e=new dl(n);return e.init(),e}function hl(){return new Worker(new URL("/assets/tinyh264.worker-DiJ50Hai.js",import.meta.url),{type:"module"})}class pl{constructor(e=fl,t=hl){this.ready=!1,this.pending=[],this._size=null,this.canvas=document.createElement("canvas"),this.renderer=e(this.canvas),this.worker=t(),this.worker.onmessage=s=>this.onMessage(s.data)}get surface(){return this.canvas}get size(){return this._size}onResize(e){this.resizeCb=e}onDecodedFrame(e){this.decodedCb=e}decode(e){if(!this.ready){this.pending.push(e);return}this.post(e)}close(){this.worker.terminate(),this.renderer.dispose()}post(e){this.worker.postMessage({type:"decode",data:e,offset:0,length:e.byteLength,renderStateId:ul},[e])}onMessage(e){var s,r;if(e.type==="decoderReady"){this.ready=!0;for(const o of this.pending)this.post(o);this.pending.length=0;return}const t=this.renderer.drawI420(new Uint8Array(e.data),e.width,e.height);t&&((s=this.decodedCb)==null||s.call(this,performance.now()),(!this._size||this._size.width!==t.width||this._size.height!==t.height)&&(this._size=t,(r=this.resizeCb)==null||r.call(this,t)))}}function $r(){const n=typeof window<"u";let e=!1;try{e=!!document.createElement("canvas").getContext("webgl2")}catch{e=!1}return{secureContext:n&&window.isSecureContext===!0,webCodecs:n&&"VideoDecoder"in window,webgl2:e,wasm:typeof WebAssembly<"u"&&typeof Worker<"u"}}function ml(n=$r()){return n.secureContext&&n.webCodecs&&n.webgl2?new il:n.wasm&&n.webgl2?new pl:null}function gl(n=$r()){return n.secureContext&&n.webCodecs&&n.webgl2||n.wasm&&n.webgl2}function bl(n=$r()){return n.secureContext&&n.webCodecs&&n.webgl2?"high":n.wasm&&n.webgl2?"standard":"unsupported"}const xl="https://www.tapflow.dev/operate/https#pick-a-method";function yl(n){const e=ue.c(9),{open:t,onOpenChange:s}=n;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(ms,{children:"Streaming in Standard mode"}),e[0]=r):r=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsxs(Qo,{children:[r,i.jsxs(Zo,{className:"space-y-3 pt-1",children:[i.jsx("span",{className:"block",children:"This screen is running in Standard mode. For a faster, smoother picture, switch to Smooth."}),i.jsx("span",{className:"block",children:"Smooth needs the relay served over HTTPS. If you didn't set up tapflow, ask whoever did."})]})]}),e[1]=o):o=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(qe,{variant:"outline",onClick:wl,children:"How to enable"}),e[2]=l):l=e[2];let c;e[3]!==s?(c=i.jsxs(gs,{className:"sm:max-w-[440px]",children:[o,i.jsxs(ei,{children:[l,i.jsx(qe,{onClick:()=>s(!1),children:"Got it"})]})]}),e[3]=s,e[4]=c):c=e[4];let u;return e[5]!==s||e[6]!==t||e[7]!==c?(u=i.jsx(bs,{open:t,onOpenChange:s,children:c}),e[5]=s,e[6]=t,e[7]=c,e[8]=u):u=e[8],u}function wl(){return window.open(xl,"_blank","noopener,noreferrer")}const ts="tapflow.perfModeNoticeDismissed";function vl(n,e){return n==="standard"&&!e}const Sl={high:"Smooth",standard:"Standard",unsupported:null};function Rl(n){const{connected:e,joined:t,bootError:s,deviceReady:r,installing:o,installError:l,agentAway:c,decoderUnsupported:u}=n;return e?t?c?"The agent went away — waiting for it to come back…":s?`Boot failed: ${s.length>40?s.slice(0,40)+"…":s}`:r?o?"Installing app…":l?`Install failed: ${l}`:u?"Streaming is not supported in this environment.":null:"Starting device…":"Joining session…":"Connecting…"}function Ur(n){const e=ue.c(30),{joined:t,fps:s,keyboardActive:r}=n;let o;e[0]!==n?(o=Rl(n),e[0]=n,e[1]=o):o=e[1];const l=o,c=s>15,u=c?"#10b981":"#94a3b8",d=c?"Active":"Idle";let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=bl(),e[2]=p):p=e[2];const f=p,m=Sl[f];let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{let F=!1;try{F=localStorage.getItem(ts)==="1"}catch{}return vl(f,F)},e[3]=g):g=e[3];const[v,h]=a.useState(g);let E;e[4]===Symbol.for("react.memo_cache_sentinel")?(E=F=>{if(h(F),!F)try{localStorage.setItem(ts,"1")}catch{}},e[4]=E):E=e[4];const b=E,_=r?"text-emerald-500":"text-muted-foreground";let T;e[5]!==_?(T=He("flex items-center",_),e[5]=_,e[6]=T):T=e[6];let S,k,C;e[7]===Symbol.for("react.memo_cache_sentinel")?(S={gap:6},k=i.jsx(_i,{className:"h-3.5 w-3.5 shrink-0"}),C=i.jsx("span",{className:"text-[12px] font-medium",children:"Focus"}),e[7]=S,e[8]=k,e[9]=C):(S=e[7],k=e[8],C=e[9]);let R;e[10]!==T?(R=i.jsxs("div",{className:T,style:S,children:[k,C]}),e[10]=T,e[11]=R):R=e[11];let I;e[12]!==u||e[13]!==s||e[14]!==c||e[15]!==t||e[16]!==d?(I=t&&i.jsxs("div",{className:"flex items-center gap-[12px]",children:[i.jsxs("div",{className:"flex items-center gap-[4px]",children:[i.jsx("span",{className:"h-2 w-2 rounded-full shrink-0 mr-1",style:{background:u}}),i.jsx("span",{className:"text-[12px] font-mono text-foreground/75",children:s}),i.jsx("span",{className:"text-[12px] text-muted-foreground",children:"fps"}),i.jsx("span",{className:"text-[11px] text-muted-foreground/60",children:"·"}),i.jsx("span",{className:He("text-[11px]",c?"text-emerald-500":"text-muted-foreground/60"),children:d})]}),m&&i.jsxs(i.Fragment,{children:[i.jsx(cs,{orientation:"vertical",className:"h-3"}),f==="standard"?i.jsx("button",{type:"button",onClick:()=>h(!0),className:"text-[11px] text-foreground/70 hover:text-foreground underline-offset-2 hover:underline",children:m}):i.jsx("span",{className:"text-[11px] text-muted-foreground",children:m})]})]}),e[12]=u,e[13]=s,e[14]=c,e[15]=t,e[16]=d,e[17]=I):I=e[17];const M=l?void 0:"sr-only";let P;e[18]!==l?(P=l&&i.jsx("p",{className:"text-[12px] text-muted-foreground leading-relaxed break-words",children:l}),e[18]=l,e[19]=P):P=e[19];let L;e[20]!==M||e[21]!==P?(L=i.jsx("div",{role:"status",className:M,children:P}),e[20]=M,e[21]=P,e[22]=L):L=e[22];let $;e[23]!==v?($=i.jsx(yl,{open:v,onOpenChange:b}),e[23]=v,e[24]=$):$=e[24];let B;return e[25]!==I||e[26]!==L||e[27]!==$||e[28]!==R?(B=i.jsxs("div",{className:"w-[300px] shrink-0 mt-3 rounded-xl border bg-background px-4 py-4 flex flex-col gap-3",children:[R,I,L,$]}),e[25]=I,e[26]=L,e[27]=$,e[28]=R,e[29]=B):B=e[29],B}function Qs(n){const e=ue.c(11),{open:t,onOpenChange:s,openUrl:r}=n,[o,l]=a.useState(0),[c,u]=a.useState(t);c!==t&&(u(t),t&&l(_l));let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(ms,{className:"sr-only",children:"Open Deeplink"}),e[0]=d):d=e[0];let p;e[1]!==s?(p=()=>s(!1),e[1]=s,e[2]=p):p=e[2];let f;e[3]!==r||e[4]!==o||e[5]!==p?(f=i.jsxs(gs,{className:"w-[500px] max-w-[500px] h-[52px] !rounded-[18px] p-[10px] border border-border bg-background shadow-lg overflow-hidden [&>button]:hidden","aria-describedby":void 0,children:[d,i.jsx(jl,{openUrl:r,close:p},o)]}),e[3]=r,e[4]=o,e[5]=p,e[6]=f):f=e[6];let m;return e[7]!==s||e[8]!==t||e[9]!==f?(m=i.jsx(bs,{open:t,onOpenChange:s,children:f}),e[7]=s,e[8]=t,e[9]=f,e[10]=m):m=e[10],m}function _l(n){return n+1}function jl(n){const e=ue.c(21),{openUrl:t,close:s}=n,[r,o]=a.useState(""),l=a.useRef(null);let c,u;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=()=>{const T=setTimeout(()=>{var S;return(S=l.current)==null?void 0:S.focus()},0);return()=>clearTimeout(T)},u=[],e[0]=c,e[1]=u):(c=e[0],u=e[1]),a.useEffect(c,u);let d;e[2]!==s||e[3]!==t||e[4]!==r?(d=()=>{r.trim()&&(t(r.trim()),s())},e[2]=s,e[3]=t,e[4]=r,e[5]=d):d=e[5];const p=d;let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(ii,{className:"h-4 w-4 text-muted-foreground shrink-0","aria-hidden":"true"}),e[6]=f):f=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=T=>o(T.target.value),e[7]=m):m=e[7];let g;e[8]!==p?(g=T=>{T.key==="Enter"&&p()},e[8]=p,e[9]=g):g=e[9];let v;e[10]!==g||e[11]!==r?(v=i.jsxs("div",{className:"flex-1 h-[32px] flex items-center gap-2 pl-[4px] pb-[1px]",children:[f,i.jsx("input",{ref:l,"aria-label":"Deeplink URL",className:"flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground min-w-0",placeholder:"myapp://home...",value:r,onChange:m,onKeyDown:g})]}),e[10]=g,e[11]=r,e[12]=v):v=e[12];let h;e[13]!==r?(h=r.trim(),e[13]=r,e[14]=h):h=e[14];const E=!h;let b;e[15]!==p||e[16]!==E?(b=i.jsx(qe,{size:"sm",disabled:E,onClick:p,className:"shrink-0 rounded-xl h-8 px-4",children:"Open"}),e[15]=p,e[16]=E,e[17]=b):b=e[17];let _;return e[18]!==b||e[19]!==v?(_=i.jsx(i.Fragment,{children:i.jsxs("div",{className:"flex items-center gap-3",children:[v,b]})}),e[18]=b,e[19]=v,e[20]=_):_=e[20],_}function kl(n,e,t,s,r,o){const{x:l,y:c,width:u,height:d}=r;let p,f;if(o){const m=(n.x-e.left)/e.width;p=(1-(n.y-e.top)/e.height)*t,f=m*s}else p=(n.x-e.left)*(t/e.width),f=(n.y-e.top)*(s/e.height);return p<l||p>l+u||f<c||f>c+d?null:{x:(p-l)/u,y:(f-c)/d}}function Cl(n,e,t){const s=(n.x-e.left)/e.width,r=(n.y-e.top)/e.height;return s<0||s>1||r<0||r>1?null:t?{x:r,y:1-s}:{x:s,y:r}}function Zs(n){return{f0:{x:1-n.x,y:1-n.y},f1:n}}function El(n,e){return n>0?Math.min(1,e/n):1}function Tl(n,e){return(n+(e?90:0))%360}function gr(n,e,t){const s=t===90||t===270;return{width:s?e:n,height:s?n:e}}function Al(n,e,t,s,r){const{width:o,height:l}=gr(t,s,r),c=Math.min(n/o,e/l);return{picW:o,picH:l,scale:c,left:(n-o*c)/2,top:(e-l*c)/2}}function Nl(n,e,t){const s=n===90||n===270,r=s?t:e,o=s?e:t;return{width:r,height:o,left:(e-r)/2,top:(t-o)/2}}function Pl(n,e,t,s){const{width:r,height:o}=gr(n,e,s);return{width:r,height:o,turn:(t-s+360)%360}}function Il(n){return!n.ready||n.rotating?!1:n.aspectAgrees||!n.frameIsAhead}function Dl(n,e,t){if(!n||!e)return!0;const{width:s,height:r}=gr(n.width,n.height,t);return Math.abs(s/r-e.width/e.height)<.05}function Ll(n,e){return Math.max(0,n-e)}const Dr=22,ns=[84,70,70,69],Ml=1,$l=0,jr=1,eo=2,Ul=1,Fl=2,zl=4;function Hl(n){if(n.byteLength<Dr)return null;const e=new DataView(n);for(let r=0;r<ns.length;r++)if(e.getUint8(r)!==ns[r])return null;if(e.getUint8(4)!==Ml)return null;const t=e.getUint8(5),s=t&zl?eo:t&Ul?jr:$l;return{capturedAt:Number(e.getBigUint64(6)),relayedAt:Number(e.getBigUint64(14)),codec:s,keyframe:s===jr&&(t&Fl)!==0}}function to(n){const{binaryFrameHandlerRef:e,perfHookRef:t,frameCount:s}=n,r=a.useRef(n);a.useLayoutEffect(()=>{r.current=n},[n]),a.useEffect(()=>{let o=null,l=!1,c=!1,u;const d=()=>{if(o)return o;if(l)return null;const p=ml();return p?(o=p,p.onResize(f=>r.current.onResize(f)),u=r.current.onDecoderReady(p),p):(l=!0,r.current.onUnsupported(),console.warn("[decoder] none available — set up HTTPS or use a supported browser"),null)};return e.current=(p,f)=>{const m=r.current.onJpegFrame;if(m&&(f==null?void 0:f.codec)!==jr){m(p,f);return}const g=d();if(g){if(!c){if(!(f!=null&&f.keyframe))return;c=!0}g.decode(p),s.current+=1}},()=>{e.current=void 0,typeof u=="function"&&u(),o==null||o.close(),o==null||o.surface.remove(),o=null}},[e,t,s])}const Bl=3e3+5*300,Ol=Bl+500,wr=8;function Wl(){var n;return window.isSecureContext&&typeof ClipboardItem<"u"&&!!((n=navigator.clipboard)!=null&&n.write)}class hr extends Error{}function Vl(n){const e=n.then(t=>new Blob([t],{type:"text/plain"}));return navigator.clipboard.write([new ClipboardItem({"text/plain":e})])}function Fr(n){return!(n.metaKey||n.ctrlKey)||n.altKey?!1:n.code==="KeyV"?!0:!n.shiftKey&&(n.code==="KeyC"||n.code==="KeyX")}const ql=1024*1024,Kl=n=>new TextEncoder().encode(n).length,Xl=n=>{var e;return!!((e=n.payload)!=null&&e.unsupported)},Yl=n=>{var e,t;return((e=n.payload)==null?void 0:e.sentinelParked)===!1||((t=n.payload)==null?void 0:t.unsupported)===!0};function Gl(){const n=window.getSelection();return!!n&&!n.isCollapsed&&n.toString().length>0}function rs(){const n=document.activeElement;return!!n&&(n.tagName==="INPUT"||n.tagName==="TEXTAREA"||n.isContentEditable)}function no(n){const e=ue.c(16),{sessionId:t,send:s,active:r,supported:o,handlerRef:l,sendChord:c,onError:u}=n;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=new Map,e[0]=d):d=e[0];const p=a.useRef(d),f=a.useRef(null),m=a.useRef(u);let g;e[1]!==u?(g=()=>{m.current=u},e[1]=u,e[2]=g):g=e[2],a.useLayoutEffect(g);let v;e[3]===Symbol.for("react.memo_cache_sentinel")?(v=C=>{var R;f.current!==C&&(f.current=C,(R=m.current)==null||R.call(m,C))},e[3]=v):v=e[3];const h=v;let E,b;e[4]!==l?(E=()=>(l.current=C=>{if(!C.requestId)return;const R=p.current.get(C.requestId);R&&(p.current.delete(C.requestId),R(C))},()=>{l.current=void 0}),b=[l],e[4]=l,e[5]=E,e[6]=b):(E=e[5],b=e[6]),a.useEffect(E,b);let _;e[7]!==s||e[8]!==t?(_=(...C)=>{const[R,I]=C,M=ve();return new Promise(P=>{const L=setTimeout(()=>{p.current.delete(M),P(null)},Ol);p.current.set(M,$=>{clearTimeout(L),P($)}),s({type:R,sessionId:t,requestId:M,payload:I})})},e[7]=s,e[8]=t,e[9]=_):_=e[9];const T=_;let S,k;e[10]!==r||e[11]!==T||e[12]!==c||e[13]!==o?(S=()=>{if(!r||!o)return;const C=async I=>{if(I.code==="KeyV"||!Fr(I))return;const M=I.code==="KeyX";if(rs()||Gl()||(I.preventDefault(),I.repeat))return;if(!Wl()){c(M?"KeyX":"KeyC",wr),h("Copied on the device. Serving the dashboard over HTTPS also brings it to your clipboard.");return}let P,L;const $=new Promise((G,Q)=>{P=G,L=Q});$.catch(Jl);const B=Vl($).catch(G=>{G instanceof hr||h(G instanceof Error&&G.name==="NotAllowedError"?"Your browser blocked the clipboard write":"Could not write to your clipboard")}),F=await T("clipboard:read",{press:M?"cut":"copy"});if(!F){L(new hr("timeout")),h("The device is taking too long — try again");return}if(F.type==="clipboard:error"){L(new hr(F.message||"read failed")),h(F.message||"Clipboard read failed"),Yl(F)&&c(M?"KeyX":"KeyC",wr);return}if(F.type!=="clipboard:data"){L(new hr("unexpected reply")),h("Clipboard read failed");return}const{text:Y}=F.payload;if(f.current=null,!Y){L(new hr("empty"));return}P(Y),await B},R=I=>{var P;if(rs())return;const M=((P=I.clipboardData)==null?void 0:P.getData("text"))??"";if(I.preventDefault(),!M){c("KeyV",wr);return}if(Kl(M)>ql){h("That text is too large to send to the device");return}T("clipboard:write",{text:M,pasteAfter:!0}).then(L=>{if(!L){h("The device is taking too long — try again");return}if(L.type==="clipboard:write-done"){f.current=null;return}if(L.type!=="clipboard:error"){h("Clipboard write failed");return}h(L.message||"Clipboard write failed"),Xl(L)&&c("KeyV",wr)})};return document.addEventListener("keydown",C),document.addEventListener("paste",R),()=>{document.removeEventListener("keydown",C),document.removeEventListener("paste",R)}},k=[r,o,T,c,h],e[10]=r,e[11]=T,e[12]=c,e[13]=o,e[14]=S,e[15]=k):(S=e[14],k=e[15]),a.useEffect(S,k)}function Jl(){}const Sn=13,Zn=8,ss=16,Ql=.02,Zl=100;function ea(n){const e=ue.c(271),{sessionId:t,buildId:s,send:r,openUrl:o,launchApp:l,connected:c,joined:u,deviceReady:d,installing:p,installed:f,installError:m,bootError:g,launching:v,chrome:h,binaryFrameHandlerRef:E,clipboardHandlerRef:b,clipboardSupported:_,networkHandlerRef:T,networkSupported:S,onRecordingUploaded:k,swKeyboardVisible:C,swKeyboardPending:R,onKbdToggle:I,rebootPending:M,onReboot:P,restartButtonRef:L,perfHookRef:$}=n,B=a.useRef(null),F=a.useRef(null),Y=a.useRef(null),{fps:G,frameCount:Q}=Ks(),ae=a.useRef(0);let se;e[0]!==s||e[1]!==k||e[2]!==t?(se={sessionId:t,buildId:s,onRecordingUploaded:k},e[0]=s,e[1]=k,e[2]=t,e[3]=se):se=e[3];const{recordState:V,recordCanvasRef:O,setComposeFrame:ce,startClientRecording:de,stopClientRecording:q}=qs(se),oe=a.useRef(0),[Se,je]=a.useState(!1),[ge,Te]=a.useState(!1),[J,he]=a.useState(!1),[ee,Re]=a.useState(!1),[z,Z]=a.useState(!1),[be,Ue]=a.useState(null),[ke,Ke]=a.useState(null),[Ne,Ce]=a.useState(!1),[pe,fe]=a.useState(null),Ze=a.useRef(pe);let Be,Xe;e[4]!==pe?(Be=()=>{Ze.current=pe},Xe=[pe],e[4]=pe,e[5]=Be,e[6]=Xe):(Be=e[5],Xe=e[6]),a.useEffect(Be,Xe);const xe=a.useRef(null),ye=a.useRef(null),Ye=a.useRef(!1),Fe=a.useRef(!1),Kt=a.useRef(0),De=a.useRef(null),gt=a.useRef(null),me=a.useRef("idle"),ze=a.useRef(null),et=a.useRef(null),tt=a.useRef(null);let nt,Oe;e[7]!==h?(nt=()=>{tt.current=h},Oe=[h],e[7]=h,e[8]=nt,e[9]=Oe):(nt=e[8],Oe=e[9]),a.useEffect(nt,Oe);let Pe,bt;e[10]!==h.framePng?(Pe=()=>{const x=new Image;x.onload=()=>{et.current=x},x.src=`data:image/png;base64,${h.framePng}`},bt=[h.framePng],e[10]=h.framePng,e[11]=Pe,e[12]=bt):(Pe=e[11],bt=e[12]),a.useEffect(Pe,bt);let Nt;e[13]===Symbol.for("react.memo_cache_sentinel")?(Nt=()=>he(!0),e[13]=Nt):Nt=e[13];let st;e[14]!==O?(st=x=>{const w=B.current;if(w&&(w.width!==x.width||w.height!==x.height)&&(w.width=x.width,w.height=x.height,!tt.current)){const y=O.current;y&&(y.width=x.width,y.height=x.height)}Te(!0)},e[14]=O,e[15]=st):st=e[15];let Xt;e[16]===Symbol.for("react.memo_cache_sentinel")?(Xt=x=>{var D;const w=x.surface,y=B.current;w.style.position="absolute",y&&(w.style.left=y.style.left,w.style.top=y.style.top,w.style.width=y.style.width,w.style.height=y.style.height,w.style.borderRadius=y.style.borderRadius),w.style.objectFit="fill",w.style.zIndex="3",w.style.pointerEvents="none",(D=F.current)==null||D.appendChild(w);let X=null;const K=()=>{const W=B.current,ne=W==null?void 0:W.getContext("2d");if(W&&ne&&x.size)try{ne.drawImage(x.surface,0,0,W.width,W.height)}catch{}X=requestAnimationFrame(K)};return X=requestAnimationFrame(K),()=>{X!==null&&cancelAnimationFrame(X)}},e[16]=Xt):Xt=e[16];let Le;e[17]!==Q||e[18]!==$||e[19]!==O?(Le=x=>{const w=performance.now();ae.current&&w-ae.current,ae.current=w;const y=oe.current;createImageBitmap(new Blob([x],{type:"image/jpeg"})).then(X=>{if(performance.now()-w,oe.current!==y){X.close();return}const K=B.current,D=K==null?void 0:K.getContext("2d");if(!K||!D){X.close();return}if((K.width!==X.width||K.height!==X.height)&&(K.width=X.width,K.height=X.height,!tt.current)){const ne=O.current;ne&&(ne.width=X.width,ne.height=X.height)}const W=performance.now();D.drawImage(X,0,0),performance.now()-W,X.close(),Te(!0),Q.current=Q.current+1}).catch(oa)},e[17]=Q,e[18]=$,e[19]=O,e[20]=Le):Le=e[20];let ln;e[21]!==E||e[22]!==Q||e[23]!==$||e[24]!==Le||e[25]!==st?(ln={binaryFrameHandlerRef:E,perfHookRef:$,frameCount:Q,onUnsupported:Nt,onResize:st,onDecoderReady:Xt,onJpegFrame:Le},e[21]=E,e[22]=Q,e[23]=$,e[24]=Le,e[25]=st,e[26]=ln):ln=e[26],to(ln);let lt;e[27]!==O?(lt=()=>{const x=O.current,w=F.current;x&&w&&(x.width=w.clientWidth,x.height=w.clientHeight)},e[27]=O,e[28]=lt):lt=e[28];let Ve;e[29]!==h||e[30]!==O?(Ve=[h,O],e[29]=h,e[30]=O,e[31]=Ve):Ve=e[31],a.useEffect(lt,Ve);let xt;e[32]!==O?(xt=()=>{const x=O.current,w=B.current;if(!x||!w)return;const y=x.getContext("2d");if(!y)return;const X=tt.current;if(y.clearRect(0,0,x.width,x.height),X){et.current&&y.drawImage(et.current,0,0,x.width,x.height);const W=Math.round(X.screenCornerRadius/2*(x.height/(X.compositeHeight/2)));y.save(),y.beginPath(),W>0?y.roundRect(w.offsetLeft,w.offsetTop,w.clientWidth,w.clientHeight,W):y.rect(w.offsetLeft,w.offsetTop,w.clientWidth,w.clientHeight),y.clip(),y.drawImage(w,w.offsetLeft,w.offsetTop,w.clientWidth,w.clientHeight),y.restore()}else y.drawImage(w,0,0,x.width,x.height);const K=Ze.current;if(K)for(const W of[K.f0,K.f1]){const ne=X?w.offsetLeft+W.x*w.clientWidth:W.x*x.width,$e=X?w.offsetTop+W.y*w.clientHeight:W.y*x.height;Ye.current?(y.beginPath(),y.arc(ne,$e,Zn,0,Math.PI*2),y.fillStyle="rgba(255,255,255,0.92)",y.fill(),y.strokeStyle="rgba(0,0,0,0.2)",y.lineWidth=1,y.stroke()):(y.beginPath(),y.arc(ne,$e,Sn,0,Math.PI*2),y.strokeStyle="rgba(0,0,0,0.3)",y.lineWidth=3,y.stroke(),y.beginPath(),y.arc(ne,$e,Sn,0,Math.PI*2),y.strokeStyle="rgba(255,255,255,0.65)",y.lineWidth=1.5,y.stroke())}const D=gt.current;if(D){const W=me.current,ne=ze.current;if(y.save(),W==="down")y.beginPath(),y.arc(D.x,D.y,Zn,0,Math.PI*2),y.fillStyle="rgba(255,255,255,0.92)",y.fill(),y.strokeStyle="rgba(0,0,0,0.2)",y.lineWidth=1,y.stroke();else if(W==="release"&&ne){const $e=Math.min((performance.now()-ne.startTime)/350,1);y.beginPath(),y.arc(D.x,D.y,Zn+26*$e,0,Math.PI*2),y.strokeStyle=`rgba(255,255,255,${(1-$e)*.55})`,y.lineWidth=1.5,y.stroke(),$e>=1&&(me.current="idle",ze.current=null)}else y.beginPath(),y.arc(D.x,D.y,Sn,0,Math.PI*2),y.strokeStyle="rgba(0,0,0,0.3)",y.lineWidth=3,y.stroke(),y.beginPath(),y.arc(D.x,D.y,Sn,0,Math.PI*2),y.strokeStyle="rgba(255,255,255,0.65)",y.lineWidth=1.5,y.stroke();y.restore()}},e[32]=O,e[33]=xt):xt=e[33];const yt=xt;let Pt,wt;e[34]!==yt||e[35]!==ce?(Pt=()=>{ce(yt)},wt=[yt,ce],e[34]=yt,e[35]=ce,e[36]=Pt,e[37]=wt):(Pt=e[36],wt=e[37]),a.useLayoutEffect(Pt,wt);let It;e[38]===Symbol.for("react.memo_cache_sentinel")?(It=()=>{const x=B.current;if(!x)return;const w=document.createElement("canvas"),y=w.getContext("2d");y&&(w.width=x.width,w.height=x.height,y.drawImage(x,0,0),w.toBlob(sa,"image/png"))},e[38]=It):It=e[38];const at=It;let vt;e[39]!==O||e[40]!==V||e[41]!==de||e[42]!==q?(vt=()=>{if(V==="idle"){const x=O.current;if(!x)return;const w=F.current;if(w&&w.clientWidth>0)x.width=w.clientWidth,x.height=w.clientHeight;else{const y=B.current;if(y&&y.width>0)x.width=y.width,x.height=y.height;else return}de()}else V==="recording"&&q()},e[39]=O,e[40]=V,e[41]=de,e[42]=q,e[43]=vt):vt=e[43];const We=vt;let Ge;e[44]!==r||e[45]!==t?(Ge=()=>{r({type:"input:rotate",sessionId:t}),Re(ra)},e[44]=r,e[45]=t,e[46]=Ge):Ge=e[46];const ct=Ge,Je=a.useRef(null);let St,Rt;e[47]!==ee||e[48]!==r||e[49]!==t?(St=()=>{Je.current=ee?()=>r({type:"input:rotate",sessionId:t}):null},Rt=[ee,r,t],e[47]=ee,e[48]=r,e[49]=t,e[50]=St,e[51]=Rt):(St=e[50],Rt=e[51]),a.useEffect(St,Rt);let dt,Ht;e[52]===Symbol.for("react.memo_cache_sentinel")?(dt=()=>()=>{var x;(x=Je.current)==null||x.call(Je)},Ht=[],e[52]=dt,e[53]=Ht):(dt=e[52],Ht=e[53]),a.useEffect(dt,Ht);let ot;e[54]!==r||e[55]!==t?(ot=(x,w)=>{r({type:"input:key",sessionId:t,requestId:ve(),payload:{code:x,modifiers:w}})},e[54]=r,e[55]=t,e[56]=ot):ot=e[56];const it=ot;let ut;e[57]!==b||e[58]!==_||e[59]!==z||e[60]!==r||e[61]!==it||e[62]!==t?(ut={sessionId:t,send:r,active:z,supported:_,handlerRef:b,sendChord:it,onError:na},e[57]=b,e[58]=_,e[59]=z,e[60]=r,e[61]=it,e[62]=t,e[63]=ut):ut=e[63],no(ut);let _t;e[64]!==d||e[65]!==T||e[66]!==S||e[67]!==r||e[68]!==t?(_t={sessionId:t,send:r,supported:S,deviceReady:d,handlerRef:T,onError:ta},e[64]=d,e[65]=T,e[66]=S,e[67]=r,e[68]=t,e[69]=_t):_t=e[69];const j=Ys(_t);let te,Ee;e[70]!==_||e[71]!==We||e[72]!==ct||e[73]!==z||e[74]!==I||e[75]!==r||e[76]!==t||e[77]!==R?(te=()=>{const x=new Set(["ShiftLeft","ShiftRight","ControlLeft","ControlRight","MetaLeft","MetaRight"]),w=D=>{if(D.code==="AltLeft"||D.code==="AltRight"){Fe.current=!0;return}if(D.metaKey){const ne=document.activeElement;if(!ne||ne.tagName!=="INPUT"&&ne.tagName!=="TEXTAREA"){if(!D.shiftKey&&D.code==="KeyK"){D.preventDefault(),je(!0);return}if(!D.shiftKey&&D.code==="KeyS"){D.preventDefault(),at();return}if(D.shiftKey&&D.code==="KeyY"){D.preventDefault(),We();return}if(D.shiftKey&&D.code==="KeyO"){D.preventDefault(),ct();return}if(D.shiftKey&&D.code==="KeyU"){D.preventDefault(),r({type:"input:button",sessionId:t,requestId:ve(),payload:{name:"home"}});return}if(D.shiftKey&&D.code==="KeyK"){D.preventDefault(),R||I();return}}}if(!z||x.has(D.code)||_&&Fr(D))return;D.preventDefault();const W=(D.shiftKey?2:0)|(D.ctrlKey?1:0)|(D.metaKey?8:0);r({type:"input:key",sessionId:t,requestId:ve(),payload:{code:D.code,modifiers:W}})},y=()=>{Ye.current&&(Ye.current=!1,Ce(!1),r({type:"input:pinch:end",sessionId:t,requestId:ve()})),Fe.current=!1,fe(null)},X=D=>{(D.code==="AltLeft"||D.code==="AltRight")&&y()},K=()=>{Fe.current&&y()};return window.addEventListener("keydown",w),window.addEventListener("keyup",X),window.addEventListener("blur",K),()=>{window.removeEventListener("keydown",w),window.removeEventListener("keyup",X),window.removeEventListener("blur",K)}},Ee=[z,_,r,t,at,We,ct,I,R],e[70]=_,e[71]=We,e[72]=ct,e[73]=z,e[74]=I,e[75]=r,e[76]=t,e[77]=R,e[78]=te,e[79]=Ee):(te=e[78],Ee=e[79]),a.useEffect(te,Ee);let Ae,ie;e[80]!==z?(Ae=()=>{if(!z)return;const x=w=>{const y=F.current??B.current;y&&!y.contains(w.target)&&Z(!1)};return document.addEventListener("pointerdown",x),()=>document.removeEventListener("pointerdown",x)},ie=[z],e[80]=z,e[81]=Ae,e[82]=ie):(Ae=e[81],ie=e[82]),a.useEffect(Ae,ie);let rt;e[83]!==h.compositeHeight||e[84]!==h.compositeWidth||e[85]!==h.screenRect.height||e[86]!==h.screenRect.width||e[87]!==h.screenRect.x||e[88]!==h.screenRect.y||e[89]!==ee?(rt=x=>{const w=(ee?Y.current:null)??F.current;if(!w)return null;const y=w.getBoundingClientRect(),X=h.compositeWidth/2,K=h.compositeHeight/2,D=h.screenRect.x/2,W=h.screenRect.y/2,ne=h.screenRect.width/2,$e=h.screenRect.height/2;return kl({x:x.clientX,y:x.clientY},y,X,K,{x:D,y:W,width:ne,height:$e},ee)},e[83]=h.compositeHeight,e[84]=h.compositeWidth,e[85]=h.screenRect.height,e[86]=h.screenRect.width,e[87]=h.screenRect.x,e[88]=h.screenRect.y,e[89]=ee,e[90]=rt):rt=e[90];const ft=rt;let Rn;e[91]!==ft?(Rn=x=>{const w=ft(x);return w?Zs(w):null},e[91]=ft,e[92]=Rn):Rn=e[92];const Bt=Rn;let _n;e[93]!==h.buttons||e[94]!==h.compositeHeight||e[95]!==h.compositeWidth||e[96]!==h.screenRect||e[97]!==ee?(_n=x=>{const w=ee?Y.current:F.current;if(!w)return null;const y=w.getBoundingClientRect();let X,K;if(ee){const W=y.height-(x.clientY-y.top),ne=x.clientX-y.left;X=W*(h.compositeWidth/y.height),K=ne*(h.compositeHeight/y.width)}else X=(x.clientX-y.left)*(h.compositeWidth/y.width),K=(x.clientY-y.top)*(h.compositeHeight/y.height);const D=h.screenRect;return X>=D.x&&X<=D.x+D.width&&K>=D.y&&K<=D.y+D.height?null:Fi(X,K,h.buttons,Zl)},e[93]=h.buttons,e[94]=h.compositeHeight,e[95]=h.compositeWidth,e[96]=h.screenRect,e[97]=ee,e[98]=_n):_n=e[98];const Yt=_n;let jn;e[99]!==O?(jn=x=>{const w=B.current,y=O.current;return w&&w.clientWidth>0?{x:w.offsetLeft+x.x*w.clientWidth,y:w.offsetTop+x.y*w.clientHeight}:{x:x.x*((y==null?void 0:y.width)??1),y:x.y*((y==null?void 0:y.height)??1)}},e[99]=O,e[100]=jn):jn=e[100];const Gt=jn;let kn;e[101]!==Gt||e[102]!==r||e[103]!==t||e[104]!==Yt||e[105]!==ft||e[106]!==Bt?(kn=x=>{if(Z(!0),Fe.current){const D=Bt(x);if(!D)return;Ye.current=!0,Ce(!0),x.target.setPointerCapture(x.pointerId),fe(D),r({type:"input:pinch:start",sessionId:t,payload:D});return}const w=Yt(x);if(w){xe.current=w,Ue(w),x.target.setPointerCapture(x.pointerId),r({type:"input:button",sessionId:t,requestId:ve(),payload:{name:w,phase:"down"}});return}const y=ft(x);if(!y)return;ye.current=y,x.target.setPointerCapture(x.pointerId),gt.current=Gt(y),me.current="down",ze.current=null;const X=x.currentTarget.getBoundingClientRect(),K=De.current;K&&(K.style.display="block",K.style.left=`${x.clientX-X.left}px`,K.style.top=`${x.clientY-X.top}px`,K.style.width=`${Zn*2}px`,K.style.height=`${Zn*2}px`,K.style.background="rgba(255,255,255,0.92)",K.style.border="1.5px solid rgba(0,0,0,0.2)",K.style.boxShadow="0 0 0 1px rgba(0,0,0,0.15), 0 0 8px rgba(255,255,255,0.25)"),r({type:"input:touch:start",sessionId:t,payload:y})},e[101]=Gt,e[102]=r,e[103]=t,e[104]=Yt,e[105]=ft,e[106]=Bt,e[107]=kn):kn=e[107];const Ln=kn;let Ot;e[108]!==Gt||e[109]!==r||e[110]!==t||e[111]!==Yt||e[112]!==ft||e[113]!==Bt?(Ot=x=>{if(x.buttons===0){if(Ke(Yt(x)),Fe.current){fe(Bt(x)),gt.current=null;const W=De.current;W&&(W.style.display="none")}else{fe(null);const W=ft(x);gt.current=W?Gt(W):null,me.current!=="down"&&(me.current="idle");const ne=De.current;if(ne)if(W){const $e=x.currentTarget.getBoundingClientRect();ne.style.display="block",ne.style.left=`${x.clientX-$e.left}px`,ne.style.top=`${x.clientY-$e.top}px`,ne.style.width=`${Sn*2}px`,ne.style.height=`${Sn*2}px`,ne.style.background="transparent",ne.style.border="1.5px solid rgba(255,255,255,0.6)",ne.style.boxShadow="0 0 0 1px rgba(0,0,0,0.3)"}else ne.style.display="none"}return}if(Ye.current){const W=Bt(x);if(!W)return;const ne=performance.now();if(ne-Kt.current<ss)return;Kt.current=ne,fe(W),r({type:"input:pinch:move",sessionId:t,payload:W});return}if(xe.current||!ye.current)return;const w=ft(x);if(!w)return;const y=w.x-ye.current.x,X=w.y-ye.current.y;if(Math.sqrt(y*y+X*X)<Ql)return;const K=performance.now();if(K-Kt.current<ss)return;Kt.current=K,gt.current=Gt(w);const D=De.current;if(D&&D.style.display!=="none"){const W=x.currentTarget.getBoundingClientRect();D.style.left=`${x.clientX-W.left}px`,D.style.top=`${x.clientY-W.top}px`}r({type:"input:touch:move",sessionId:t,payload:w})},e[108]=Gt,e[109]=r,e[110]=t,e[111]=Yt,e[112]=ft,e[113]=Bt,e[114]=Ot):Ot=e[114];const Mn=Ot;let Cn;e[115]!==r||e[116]!==t?(Cn=()=>{if(Ye.current){Ye.current=!1,Ce(!1),fe(null),r({type:"input:pinch:end",sessionId:t,requestId:ve()});return}if(ye.current=null,xe.current){r({type:"input:button",sessionId:t,requestId:ve(),payload:{name:xe.current,phase:"up"}}),xe.current=null,setTimeout(()=>Ue(null),100);return}me.current="release",ze.current={startTime:performance.now()};const x=De.current;x&&(x.style.width=`${Sn*2}px`,x.style.height=`${Sn*2}px`,x.style.background="transparent",x.style.border="1.5px solid rgba(255,255,255,0.6)",x.style.boxShadow="0 0 0 1px rgba(0,0,0,0.3)"),r({type:"input:touch:end",sessionId:t,requestId:ve()})},e[115]=r,e[116]=t,e[117]=Cn):Cn=e[117];const $n=Cn;let En;e[118]!==r||e[119]!==t?(En=()=>{if(Ye.current){Ye.current=!1,Ce(!1),fe(null),r({type:"input:pinch:end",sessionId:t,requestId:ve()});return}if(ye.current=null,xe.current){r({type:"input:button",sessionId:t,requestId:ve(),payload:{name:xe.current,phase:"up"}}),xe.current=null,Ue(null);return}me.current="release",ze.current={startTime:performance.now()},r({type:"input:touch:end",sessionId:t,requestId:ve()})},e[118]=r,e[119]=t,e[120]=En):En=e[120];const or=En;let Tn;e[121]===Symbol.for("react.memo_cache_sentinel")?(Tn=()=>{Ke(null),fe(null),gt.current=null;const x=De.current;x&&(x.style.display="none")},e[121]=Tn):Tn=e[121];const ir=Tn,lr=h.compositeWidth/2,ar=h.compositeHeight/2,Un=El(ar,750),Dt=Math.round(lr*Un),jt=Math.round(ar*Un),kt=h.screenRect.x/h.compositeWidth*100,ht=h.screenRect.y/h.compositeHeight*100,Ct=h.screenRect.width/h.compositeWidth*100,pt=h.screenRect.height/h.compositeHeight*100,an=Math.round(h.screenCornerRadius/2*Un);let Jt;e[122]!==r||e[123]!==t?(Jt=()=>r({type:"input:button",sessionId:t,requestId:ve(),payload:{name:"home"}}),e[122]=r,e[123]=t,e[124]=Jt):Jt=e[124];let Fn;e[125]===Symbol.for("react.memo_cache_sentinel")?(Fn=i.jsx(Cs,{className:"h-4 w-4"}),e[125]=Fn):Fn=e[125];let An;e[126]!==Jt?(An=i.jsx(Tt,{asChild:!0,children:i.jsx(qe,{variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":"Home",onClick:Jt,children:Fn})}),e[126]=Jt,e[127]=An):An=e[127];let zn;e[128]===Symbol.for("react.memo_cache_sentinel")?(zn=i.jsx(At,{side:"left",children:i.jsxs("span",{className:"flex items-center gap-3",children:["Home ",i.jsxs(Pr,{children:[i.jsx(tr,{children:"⌘"}),i.jsx(tr,{children:"⇧"}),i.jsx(tr,{children:"U"})]})]})}),e[128]=zn):zn=e[128];let Yn;e[129]!==An?(Yn=i.jsx(i.Fragment,{children:i.jsxs(Et,{children:[An,zn]})}),e[129]=An,e[130]=Yn):Yn=e[130];const Hn=Yn,Qt=a.useId(),Bn=R?"Changing the software keyboard.":C?"The software keyboard is up.":"The software keyboard is down.";let Zt;e[131]!==Qt||e[132]!==Bn?(Zt=i.jsx("span",{id:Qt,role:"status",className:"sr-only",children:Bn}),e[131]=Qt,e[132]=Bn,e[133]=Zt):Zt=e[133];const cr=R?"Software keyboard — changing it":"Software keyboard";let en;e[134]!==I||e[135]!==R?(en=()=>{R||I()},e[134]=I,e[135]=R,e[136]=en):en=e[136];let Wt;e[137]!==R?(Wt=R?i.jsx(rr,{className:"h-4 w-4 animate-spin"}):i.jsx(xi,{className:"h-4 w-4"}),e[137]=R,e[138]=Wt):Wt=e[138];let cn;e[139]!==Qt||e[140]!==R||e[141]!==C||e[142]!==cr||e[143]!==en||e[144]!==Wt?(cn=i.jsx(Tt,{asChild:!0,children:i.jsx(qe,{variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":cr,"aria-pressed":C,"aria-busy":R,"aria-disabled":R,"aria-describedby":Qt,onClick:en,"data-active":C,children:Wt})}),e[139]=Qt,e[140]=R,e[141]=C,e[142]=cr,e[143]=en,e[144]=Wt,e[145]=cn):cn=e[145];let dn;e[146]!==R?(dn=i.jsx(At,{side:"left",children:R?i.jsx("span",{children:"Software keyboard — changing it"}):i.jsxs("span",{className:"flex items-center gap-3",children:["Software keyboard ",i.jsxs(Pr,{children:[i.jsx(tr,{children:"⌘"}),i.jsx(tr,{children:"⇧"}),i.jsx(tr,{children:"K"})]})]})}),e[146]=R,e[147]=dn):dn=e[147];let un;e[148]!==cn||e[149]!==dn?(un=i.jsxs(Et,{children:[cn,dn]}),e[148]=cn,e[149]=dn,e[150]=un):un=e[150];let Nn;e[151]!==Zt||e[152]!==un?(Nn=i.jsxs(i.Fragment,{children:[Zt,un]}),e[151]=Zt,e[152]=un,e[153]=Nn):Nn=e[153];const Gn=Nn;let tn;e[154]!==s||e[155]!==f||e[156]!==l||e[157]!==v?(tn=f&&s?i.jsxs(Et,{children:[i.jsx(Tt,{asChild:!0,children:i.jsx(qe,{variant:"ghost",size:"icon",className:"h-8 w-8",disabled:v,"aria-label":"Launch app",onClick:l,children:v?i.jsx(rr,{className:"h-4 w-4 animate-spin"}):i.jsx(ys,{className:"h-4 w-4"})})}),i.jsx(At,{side:"left",children:v?"Launching…":"Launch app"})]}):null,e[154]=s,e[155]=f,e[156]=l,e[157]=v,e[158]=tn):tn=e[158];const On=tn;let Wn;e[159]===Symbol.for("react.memo_cache_sentinel")?(Wn={display:"none"},e[159]=Wn):Wn=e[159];let nn;e[160]!==O?(nn=i.jsx("canvas",{ref:O,style:Wn}),e[160]=O,e[161]=nn):nn=e[161];let fn;e[162]!==Se||e[163]!==o?(fn=i.jsx(Qs,{open:Se,onOpenChange:je,openUrl:o}),e[162]=Se,e[163]=o,e[164]=fn):fn=e[164];let Pn;e[165]===Symbol.for("react.memo_cache_sentinel")?(Pn=()=>je(!0),e[165]=Pn):Pn=e[165];let Lt;e[166]!==j||e[167]!==S?(Lt=S?{position:j.position,steerable:j.steerable,reason:j.reason,pending:j.pending,onToggle:j.toggle}:void 0,e[166]=j,e[167]=S,e[168]=Lt):Lt=e[168];let Mt;e[169]!==P||e[170]!==M||e[171]!==L?(Mt={pending:M,onReboot:P,buttonRef:L},e[169]=P,e[170]=M,e[171]=L,e[172]=Mt):Mt=e[172];let rn;e[173]!==Gn||e[174]!==We||e[175]!==ct||e[176]!==u||e[177]!==On||e[178]!==Hn||e[179]!==V||e[180]!==Lt||e[181]!==Mt?(rn=i.jsx(Xs,{joined:u,onDeepLink:Pn,onScreenshot:at,onRecordToggle:We,recordState:V,onRotate:ct,navigationSlot:Hn,deviceSlot:Gn,launchSlot:On,network:Lt,reboot:Mt}),e[173]=Gn,e[174]=We,e[175]=ct,e[176]=u,e[177]=On,e[178]=Hn,e[179]=V,e[180]=Lt,e[181]=Mt,e[182]=rn):rn=e[182];const hn=ee?jt:Dt,pn=ee?Dt:jt;let $t;e[183]!==hn||e[184]!==pn?($t={width:hn,height:pn,position:"relative",flexShrink:0},e[183]=hn,e[184]=pn,e[185]=$t):$t=e[185];const mn=`relative ${ke?"cursor-pointer":"cursor-default"}`;let gn;e[186]!==jt||e[187]!==Dt||e[188]!==ee?(gn=ee?{position:"absolute",top:(Dt-jt)/2,left:(jt-Dt)/2,transform:"rotate(-90deg)",transformOrigin:"center center"}:{},e[186]=jt,e[187]=Dt,e[188]=ee,e[189]=gn):gn=e[189];let Ut;e[190]!==jt||e[191]!==Dt||e[192]!==gn?(Ut={width:Dt,height:jt,...gn},e[190]=jt,e[191]=Dt,e[192]=gn,e[193]=Ut):Ut=e[193];const Jn=`data:image/png;base64,${h.framePng}`;let sn;e[194]===Symbol.for("react.memo_cache_sentinel")?(sn={position:"absolute",top:0,left:0,zIndex:2,width:"100%",height:"100%",display:"block",pointerEvents:"none",userSelect:"none"},e[194]=sn):sn=e[194];let Ft;e[195]!==Jn?(Ft=i.jsx("img",{src:Jn,style:sn,draggable:!1,alt:""}),e[195]=Jn,e[196]=Ft):Ft=e[196];const bn=`${kt}%`,xn=`${ht}%`,yn=`${Ct}%`,wn=`${pt}%`,Vn=an>0?`${an}px`:void 0,A=ge?"visible":"hidden";let U;e[197]!==bn||e[198]!==xn||e[199]!==yn||e[200]!==wn||e[201]!==Vn||e[202]!==A?(U=i.jsx("canvas",{ref:B,style:{position:"absolute",zIndex:3,left:bn,top:xn,width:yn,height:wn,borderRadius:Vn,backgroundColor:"#010101",cursor:"none",visibility:A}}),e[197]=bn,e[198]=xn,e[199]=yn,e[200]=wn,e[201]=Vn,e[202]=A,e[203]=U):U=e[203];let re;e[204]!==ge||e[205]!==an||e[206]!==pt||e[207]!==kt||e[208]!==ht||e[209]!==Ct?(re=!ge&&i.jsx("div",{className:"absolute animate-pulse bg-zinc-700",style:{zIndex:3,left:`${kt}%`,top:`${ht}%`,width:`${Ct}%`,height:`${pt}%`,borderRadius:an>0?`${an}px`:void 0}}),e[204]=ge,e[205]=an,e[206]=pt,e[207]=kt,e[208]=ht,e[209]=Ct,e[210]=re):re=e[210];let N;e[211]!==Ne||e[212]!==pe||e[213]!==pt||e[214]!==kt||e[215]!==ht||e[216]!==Ct?(N=pe&&(()=>{const x=kt/100,w=ht/100,y=Ct/100,X=pt/100,K=(D,W)=>({left:`${(x+D*y)*100}%`,top:`${(w+W*X)*100}%`});return i.jsx(i.Fragment,{children:[pe.f0,pe.f1].map((D,W)=>i.jsx("div",{style:{position:"absolute",zIndex:10,borderRadius:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none",transition:"width 0.1s ease, height 0.1s ease, background 0.1s ease",...Ne?{width:Zn*2,height:Zn*2,background:"rgba(255,255,255,0.92)",border:"1.5px solid rgba(0,0,0,0.2)",boxShadow:"0 0 0 1px rgba(0,0,0,0.15), 0 0 8px rgba(255,255,255,0.25)"}:{width:Sn*2,height:Sn*2,background:"transparent",border:"1.5px solid rgba(255,255,255,0.6)",boxShadow:"0 0 0 1px rgba(0,0,0,0.3)"},...K(D.x,D.y)}},W))})})(),e[211]=Ne,e[212]=pe,e[213]=pt,e[214]=kt,e[215]=ht,e[216]=Ct,e[217]=N):N=e[217];let _e;e[218]!==G||e[219]!==u||e[220]!==pt||e[221]!==kt||e[222]!==ht||e[223]!==Ct?(_e=u&&G===0&&i.jsx("div",{style:{position:"absolute",zIndex:8,left:`${kt}%`,top:`${ht}%`,width:`${Ct}%`,height:`${pt}%`,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:i.jsx("span",{style:{color:"white",fontSize:"0.875rem"},children:"Waiting for first frame..."})}),e[218]=G,e[219]=u,e[220]=pt,e[221]=kt,e[222]=ht,e[223]=Ct,e[224]=_e):_e=e[224];let H;if(e[225]!==h.buttons||e[226]!==h.compositeHeight||e[227]!==h.compositeWidth||e[228]!==be||e[229]!==ke){let x;e[231]!==h.compositeHeight||e[232]!==h.compositeWidth||e[233]!==be||e[234]!==ke?(x=w=>{const y=be===w.name,X=ke===w.name,K=w.anchor==="top",D=Vs(w),W=D.top/h.compositeHeight*100,ne=w.buttonH/h.compositeHeight*100,$e=w.buttonW/h.compositeWidth*100,vn=w.buttonW/2,on=D.left/h.compositeWidth*100,dr=(2*w.rolloverOffset.x-w.normalOffset.x-vn)/h.compositeWidth*100,ur=w.rolloverOffset.x/h.compositeWidth*100,_o=W,Kr=K?(2*w.rolloverOffset.y-w.normalOffset.y)/h.compositeHeight*100:0,jo=w.onTop?4:1;return i.jsxs(a.Fragment,{children:[w.buttonPng&&i.jsx("img",{src:`data:image/png;base64,${w.buttonPng}`,style:{position:"absolute",zIndex:jo,top:`${K&&X?Kr:W}%`,left:`${K?on:X?dr:on}%`,width:`${$e}%`,height:`${ne}%`,transition:K?"top 0.15s ease":"left 0.15s ease",pointerEvents:"none",userSelect:"none"},draggable:!1,alt:""}),y&&w.pressedPng&&w.pressedRect&&i.jsx("img",{src:`data:image/png;base64,${w.pressedPng}`,style:{position:"absolute",zIndex:w.onTop?3:1,left:`${K?on:X?dr:on}%`,top:`${K&&X?Kr:W}%`,width:`${w.pressedRect.width/h.compositeWidth*100}%`,height:`${w.pressedRect.height/h.compositeHeight*100}%`,pointerEvents:"none",userSelect:"none"},draggable:!1,alt:""}),X&&i.jsx("div",{className:"bg-foreground/85 text-background text-[11px] px-[7px] py-1.5 rounded-lg whitespace-nowrap pointer-events-none",style:{position:"absolute",zIndex:5,left:`${ur}%`,top:`${_o}%`,transform:"translate(-50%, calc(-100% - 8px))"},children:w.accessibilityTitle})]},w.name)},e[231]=h.compositeHeight,e[232]=h.compositeWidth,e[233]=be,e[234]=ke,e[235]=x):x=e[235],H=h.buttons.map(x),e[225]=h.buttons,e[226]=h.compositeHeight,e[227]=h.compositeWidth,e[228]=be,e[229]=ke,e[230]=H}else H=e[230];let Me;e[236]!==or||e[237]!==Ln||e[238]!==Mn||e[239]!==$n||e[240]!==mn||e[241]!==Ut||e[242]!==Ft||e[243]!==U||e[244]!==re||e[245]!==N||e[246]!==_e||e[247]!==H?(Me=i.jsxs("div",{ref:F,className:mn,style:Ut,onPointerDown:Ln,onPointerMove:Mn,onPointerUp:$n,onPointerCancel:or,onPointerLeave:ir,children:[Ft,U,re,N,_e,H]}),e[236]=or,e[237]=Ln,e[238]=Mn,e[239]=$n,e[240]=mn,e[241]=Ut,e[242]=Ft,e[243]=U,e[244]=re,e[245]=N,e[246]=_e,e[247]=H,e[248]=Me):Me=e[248];let Qe;e[249]===Symbol.for("react.memo_cache_sentinel")?(Qe=i.jsx("div",{ref:De,style:{display:"none",position:"absolute",zIndex:20,borderRadius:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none",transition:"width 0.1s ease, height 0.1s ease, background 0.1s ease, box-shadow 0.1s ease"}}),e[249]=Qe):Qe=e[249];let mt;e[250]!==$t||e[251]!==Me?(mt=i.jsxs("div",{ref:Y,style:$t,children:[Me,Qe]}),e[250]=$t,e[251]=Me,e[252]=mt):mt=e[252];let we;e[253]!==g||e[254]!==c||e[255]!==J||e[256]!==d||e[257]!==G||e[258]!==m||e[259]!==p||e[260]!==u||e[261]!==z?(we=i.jsx(Ur,{joined:u,fps:G,connected:c,deviceReady:d,bootError:g,installing:p,installError:m,decoderUnsupported:J,keyboardActive:z}),e[253]=g,e[254]=c,e[255]=J,e[256]=d,e[257]=G,e[258]=m,e[259]=p,e[260]=u,e[261]=z,e[262]=we):we=e[262];let Vt;e[263]!==mt||e[264]!==we?(Vt=i.jsxs("div",{className:"flex items-start gap-8",children:[mt,we]}),e[263]=mt,e[264]=we,e[265]=Vt):Vt=e[265];let Qn;return e[266]!==nn||e[267]!==fn||e[268]!==rn||e[269]!==Vt?(Qn=i.jsxs("div",{role:"region","aria-label":"Device screen",className:"flex items-start justify-center gap-16",children:[nn,fn,rn,Vt]}),e[266]=nn,e[267]=fn,e[268]=rn,e[269]=Vt,e[270]=Qn):Qn=e[270],Qn}function ta(n){return zt.error(n)}function na(n){return zt.error(n)}function ra(n){return!n}function sa(n){if(!n)return;const e=URL.createObjectURL(n),t=document.createElement("a");t.href=e,t.download=`tapflow-${Date.now()}.png`,t.click(),URL.revokeObjectURL(e)}function oa(){}const er=13,pr=8,os=16,ia=.02,Tr=720;function la(n){const e=ue.c(192),{sessionId:t,buildId:s,send:r,openUrl:o,launchApp:l,connected:c,joined:u,deviceReady:d,installing:p,installed:f,installError:m,bootError:g,launching:v,androidButtons:h,binaryFrameHandlerRef:E,clipboardHandlerRef:b,clipboardSupported:_,networkHandlerRef:T,networkSupported:S,onRecordingUploaded:k,rebootPending:C,onReboot:R,restartButtonRef:I,screenWidth:M,screenHeight:P,cornerRadius:L,postures:$,streamRotation:B,perfHookRef:F}=n,Y=B===void 0?0:B,G=a.useRef(null),Q=a.useRef(null),ae=a.useRef(null),{fps:se,frameCount:V}=Ks();let O;e[0]!==s||e[1]!==k||e[2]!==t?(O={sessionId:t,buildId:s,onRecordingUploaded:k},e[0]=s,e[1]=k,e[2]=t,e[3]=O):O=e[3];const{recordState:ce,recordCanvasRef:de,setComposeFrame:q,startClientRecording:oe,stopClientRecording:Se}=qs(O),[je,ge]=a.useState(!1),[Te,J]=a.useState(!1),[he,ee]=a.useState(!1),Re=a.useRef(null),[z,Z]=a.useState(null),[be,Ue]=a.useState(!1),ke=`${Y}:${M??""}:${P??""}`,[Ke,Ne]=a.useState(ke);Ke!==ke&&(Ne(ke),Ue(!1));const[Ce,pe]=a.useState(!1),[fe,Ze]=a.useState(!1),[Be,Xe]=a.useState(!1),[xe,ye]=a.useState(null),Ye=a.useRef(xe);let Fe,Kt;e[4]!==xe?(Fe=()=>{Ye.current=xe},Kt=[xe],e[4]=xe,e[5]=Fe,e[6]=Kt):(Fe=e[5],Kt=e[6]),a.useEffect(Fe,Kt);const De=a.useRef(!1),gt=a.useRef(!1),me=a.useRef(null),ze=a.useRef(0),et=a.useRef(null),tt=a.useRef(null),nt=a.useRef("idle"),Oe=a.useRef(null);let Pe,bt,Nt;e[7]===Symbol.for("react.memo_cache_sentinel")?(Pe=()=>ee(!0),bt=A=>{J(!0);const U=Re.current;(!U||U.width!==A.width||U.height!==A.height)&&(Re.current=A,Z(A),Ue(!0))},Nt=A=>{var re;ae.current=A;const U=A.surface;U.style.display="block",U.style.width="100%",U.style.height="100%",U.style.objectFit="fill",(re=G.current)==null||re.appendChild(U)},e[7]=Pe,e[8]=bt,e[9]=Nt):(Pe=e[7],bt=e[8],Nt=e[9]);let st;e[10]!==E||e[11]!==V||e[12]!==F?(st={binaryFrameHandlerRef:E,perfHookRef:F,frameCount:V,onUnsupported:Pe,onResize:bt,onDecoderReady:Nt},e[10]=E,e[11]=V,e[12]=F,e[13]=st):st=e[13],to(st);const Xt=M&&P?{width:M,height:P}:null,Le=Xt??z,ln=Le?Le.width>Le.height:!1,lt=Ce&&!ln,Ve=Tl(Y,lt);let xt;e[14]!==de||e[15]!==Y||e[16]!==Ve?(xt=()=>{var ne;const A=de.current,U=(ne=ae.current)==null?void 0:ne.surface,re=Re.current;if(!A||!U||!re)return;const N=A.getContext("2d");if(!N)return;const _e=re.width,H=re.height,Me=Ve,{picW:Qe,picH:mt,scale:we,left:Vt,top:Qn}=Al(A.width,A.height,_e,H,Me);N.clearRect(0,0,A.width,A.height),N.save(),N.translate(Vt+Qe*we/2,Qn+mt*we/2),N.scale(we,we),N.rotate(Me*Math.PI/180),N.drawImage(U,-_e/2,-H/2,_e,H),N.restore();const x=Pl(_e,H,Me,Y);N.save(),N.translate(Vt+Qe*we/2,Qn+mt*we/2),N.scale(we,we),N.rotate(x.turn*Math.PI/180),N.translate(-x.width/2,-x.height/2);const w=Math.max(x.width,x.height),y=w>Tr?w/Tr:1,X=er*y,K=pr*y,D=Ye.current;if(D)for(const $e of[D.f0,D.f1]){const vn=$e.x*x.width,on=$e.y*x.height;De.current?(N.beginPath(),N.arc(vn,on,K,0,Math.PI*2),N.fillStyle="rgba(255,255,255,0.92)",N.fill(),N.strokeStyle="rgba(0,0,0,0.2)",N.lineWidth=y,N.stroke()):(N.beginPath(),N.arc(vn,on,X,0,Math.PI*2),N.strokeStyle="rgba(0,0,0,0.3)",N.lineWidth=3*y,N.stroke(),N.beginPath(),N.arc(vn,on,X,0,Math.PI*2),N.strokeStyle="rgba(255,255,255,0.65)",N.lineWidth=1.5*y,N.stroke())}const W=tt.current;if(W){const $e=W.x*x.width,vn=W.y*x.height,on=nt.current,dr=Oe.current;if(on==="down")N.beginPath(),N.arc($e,vn,K,0,Math.PI*2),N.fillStyle="rgba(255,255,255,0.92)",N.fill(),N.strokeStyle="rgba(0,0,0,0.2)",N.lineWidth=y,N.stroke();else if(on==="release"&&dr){const ur=Math.min((performance.now()-dr.startTime)/350,1);N.beginPath(),N.arc($e,vn,K+26*y*ur,0,Math.PI*2),N.strokeStyle=`rgba(255,255,255,${(1-ur)*.55})`,N.lineWidth=1.5*y,N.stroke(),ur>=1&&(nt.current="idle",Oe.current=null)}else N.beginPath(),N.arc($e,vn,X,0,Math.PI*2),N.strokeStyle="rgba(0,0,0,0.3)",N.lineWidth=3*y,N.stroke(),N.beginPath(),N.arc($e,vn,X,0,Math.PI*2),N.strokeStyle="rgba(255,255,255,0.65)",N.lineWidth=1.5*y,N.stroke()}N.restore()},e[14]=de,e[15]=Y,e[16]=Ve,e[17]=xt):xt=e[17];const yt=xt;let Pt,wt;e[18]!==yt||e[19]!==q?(Pt=()=>{q(yt)},wt=[yt,q],e[18]=yt,e[19]=q,e[20]=Pt,e[21]=wt):(Pt=e[20],wt=e[21]),a.useLayoutEffect(Pt,wt);let It;e[22]!==Ve?(It=()=>{var Me;const A=(Me=ae.current)==null?void 0:Me.surface,U=Re.current;if(!A||!U)return;const re=document.createElement("canvas"),N=re.getContext("2d");if(!N)return;const _e=Ve,H=gr(U.width,U.height,_e);re.width=H.width,re.height=H.height,N.translate(re.width/2,re.height/2),N.rotate(_e*Math.PI/180),N.drawImage(A,-U.width/2,-U.height/2,U.width,U.height),re.toBlob(ha,"image/png")},e[22]=Ve,e[23]=It):It=e[23];const at=It;let vt;e[24]!==de||e[25]!==ce||e[26]!==oe||e[27]!==Se||e[28]!==Ve?(vt=()=>{if(ce==="idle"){const A=de.current;if(!A)return;const U=Re.current;if(!U)return;const re=gr(U.width,U.height,Ve);A.width=re.width,A.height=re.height,oe()}else ce==="recording"&&Se()},e[24]=de,e[25]=ce,e[26]=oe,e[27]=Se,e[28]=Ve,e[29]=vt):vt=e[29];const We=vt,[Ge,ct]=a.useState(null),Je=Ge!==null,St=a.useRef(0);let Rt;e[30]!==r||e[31]!==t?(Rt=A=>{St.current=Date.now()+8e3,ct(A),r({type:"input:posture",sessionId:t,payload:{postureId:A}})},e[30]=r,e[31]=t,e[32]=Rt):Rt=e[32];const dt=Rt;let Ht;e[33]!==Ge||e[34]!==($==null?void 0:$.currentId)?(Ht=()=>{if(Ge===null)return;const A=($==null?void 0:$.currentId)===Ge,U=setTimeout(()=>ct(null),A?0:Ll(St.current,Date.now()));return()=>clearTimeout(U)},e[33]=Ge,e[34]=$==null?void 0:$.currentId,e[35]=Ht):Ht=e[35];let ot;e[36]!==Ge||e[37]!==$?(ot=[Ge,$],e[36]=Ge,e[37]=$,e[38]=ot):ot=e[38],a.useEffect(Ht,ot);const[it,ut]=a.useState(!1);let _t,j;e[39]!==it?(_t=()=>{if(!it)return;const A=setTimeout(()=>ut(!1),400);return()=>clearTimeout(A)},j=[it],e[39]=it,e[40]=_t,e[41]=j):(_t=e[40],j=e[41]),a.useEffect(_t,j);const te=a.useRef(!1);let Ee;e[42]===Symbol.for("react.memo_cache_sentinel")?(Ee=()=>{if(!te.current){te.current=!0;return}ut(!1)},e[42]=Ee):Ee=e[42];let Ae;e[43]!==P||e[44]!==M||e[45]!==Y?(Ae=[Y,M,P],e[43]=P,e[44]=M,e[45]=Y,e[46]=Ae):Ae=e[46],a.useEffect(Ee,Ae);let ie;e[47]!==r||e[48]!==t?(ie=()=>{ut(!0),r({type:"input:rotate",sessionId:t}),pe(fa)},e[47]=r,e[48]=t,e[49]=ie):ie=e[49];const rt=ie,ft=a.useRef(null);let Rn,Bt;e[50]!==r||e[51]!==t||e[52]!==Ce?(Rn=()=>{ft.current=Ce?()=>r({type:"input:rotate",sessionId:t}):null},Bt=[Ce,r,t],e[50]=r,e[51]=t,e[52]=Ce,e[53]=Rn,e[54]=Bt):(Rn=e[53],Bt=e[54]),a.useEffect(Rn,Bt);let _n,Yt;e[55]===Symbol.for("react.memo_cache_sentinel")?(_n=()=>()=>{var A;(A=ft.current)==null||A.call(ft)},Yt=[],e[55]=_n,e[56]=Yt):(_n=e[55],Yt=e[56]),a.useEffect(_n,Yt);let jn;e[57]!==r||e[58]!==t?(jn=(A,U)=>{r({type:"input:key",sessionId:t,requestId:ve(),payload:{code:A,modifiers:U}})},e[57]=r,e[58]=t,e[59]=jn):jn=e[59];const Gt=jn;let kn;e[60]!==b||e[61]!==_||e[62]!==fe||e[63]!==r||e[64]!==Gt||e[65]!==t?(kn={sessionId:t,send:r,active:fe,supported:_,handlerRef:b,sendChord:Gt,onError:ua},e[60]=b,e[61]=_,e[62]=fe,e[63]=r,e[64]=Gt,e[65]=t,e[66]=kn):kn=e[66],no(kn);let Ln;e[67]!==d||e[68]!==T||e[69]!==S||e[70]!==r||e[71]!==t?(Ln={sessionId:t,send:r,supported:S,deviceReady:d,handlerRef:T,onError:da},e[67]=d,e[68]=T,e[69]=S,e[70]=r,e[71]=t,e[72]=Ln):Ln=e[72];const Ot=Ys(Ln);let Mn,Cn;e[73]!==_||e[74]!==We||e[75]!==rt||e[76]!==at||e[77]!==fe||e[78]!==r||e[79]!==t?(Mn=()=>{const A=new Set(["ShiftLeft","ShiftRight","ControlLeft","ControlRight","MetaLeft","MetaRight"]),U=H=>{if(H.code==="AltLeft"||H.code==="AltRight"){gt.current=!0;return}if(H.metaKey){const Qe=document.activeElement;if(!Qe||Qe.tagName!=="INPUT"&&Qe.tagName!=="TEXTAREA"){if(!H.shiftKey&&H.code==="KeyK"){H.preventDefault(),ge(!0);return}if(!H.shiftKey&&H.code==="KeyS"){H.preventDefault(),at();return}if(H.shiftKey&&H.code==="KeyY"){H.preventDefault(),We();return}if(H.shiftKey&&H.code==="KeyO"){H.preventDefault(),rt();return}}}if(!fe||A.has(H.code)||_&&Fr(H))return;H.preventDefault();const Me=(H.shiftKey?2:0)|(H.ctrlKey?1:0)|(H.metaKey?8:0);r({type:"input:key",sessionId:t,requestId:ve(),payload:{code:H.code,modifiers:Me}})},re=()=>{De.current&&(De.current=!1,Xe(!1),r({type:"input:pinch:end",sessionId:t,requestId:ve()})),gt.current=!1,ye(null)},N=H=>{(H.code==="AltLeft"||H.code==="AltRight")&&re()},_e=()=>{gt.current&&re()};return window.addEventListener("keydown",U),window.addEventListener("keyup",N),window.addEventListener("blur",_e),()=>{window.removeEventListener("keydown",U),window.removeEventListener("keyup",N),window.removeEventListener("blur",_e)}},Cn=[fe,_,r,t,at,We,rt],e[73]=_,e[74]=We,e[75]=rt,e[76]=at,e[77]=fe,e[78]=r,e[79]=t,e[80]=Mn,e[81]=Cn):(Mn=e[80],Cn=e[81]),a.useEffect(Mn,Cn);let $n,En;e[82]!==fe?($n=()=>{if(!fe)return;const A=U=>{const re=Q.current??G.current;re&&!re.contains(U.target)&&Ze(!1)};return document.addEventListener("pointerdown",A),()=>document.removeEventListener("pointerdown",A)},En=[fe],e[82]=fe,e[83]=$n,e[84]=En):($n=e[83],En=e[84]),a.useEffect($n,En);const or=a.useRef(!1);let Tn;e[85]===Symbol.for("react.memo_cache_sentinel")?(Tn=A=>{const U=G.current;if(!U)return null;const re=U.getBoundingClientRect();return Cl({x:A.clientX,y:A.clientY},re,or.current)},e[85]=Tn):Tn=e[85];const ir=Tn;let lr;e[86]===Symbol.for("react.memo_cache_sentinel")?(lr=A=>{const U=ir(A);return U?Zs(U):null},e[86]=lr):lr=e[86];const ar=lr;let Un;e[87]!==r||e[88]!==t?(Un=A=>{if(gt.current){const _e=ar(A);if(!_e)return;De.current=!0,Xe(!0),A.target.setPointerCapture(A.pointerId);const H=et.current;H&&(H.style.display="none"),ye(_e),r({type:"input:pinch:start",sessionId:t,payload:_e});return}const U=ir(A);if(!U)return;Ze(!0),me.current=U,A.target.setPointerCapture(A.pointerId);const re=A.currentTarget.getBoundingClientRect();tt.current=U,nt.current="down",Oe.current=null;const N=et.current;N&&(N.style.display="block",N.style.left=`${A.clientX-re.left}px`,N.style.top=`${A.clientY-re.top}px`,N.style.width=`${pr*2}px`,N.style.height=`${pr*2}px`,N.style.background="rgba(255,255,255,0.92)",N.style.border="1.5px solid rgba(0,0,0,0.2)",N.style.boxShadow="0 0 0 1px rgba(0,0,0,0.15), 0 0 8px rgba(255,255,255,0.25)"),r({type:"input:touch:start",sessionId:t,payload:U})},e[87]=r,e[88]=t,e[89]=Un):Un=e[89];const Dt=Un;let jt;e[90]!==r||e[91]!==t?(jt=A=>{if(A.buttons===0){if(gt.current){ye(ar(A)),tt.current=null;const Vt=et.current;Vt&&(Vt.style.display="none");return}const Qe=ir(A),mt=A.currentTarget.getBoundingClientRect(),we=et.current;Qe?(tt.current=Qe,nt.current!=="down"&&(nt.current="idle"),we&&(we.style.display="block",we.style.left=`${A.clientX-mt.left}px`,we.style.top=`${A.clientY-mt.top}px`,we.style.width=`${er*2}px`,we.style.height=`${er*2}px`,we.style.background="transparent",we.style.border="1.5px solid rgba(255,255,255,0.6)",we.style.boxShadow="0 0 0 1px rgba(0,0,0,0.3)")):(tt.current=null,we&&(we.style.display="none"));return}if(De.current){const Qe=ar(A);if(!Qe)return;const mt=performance.now();if(mt-ze.current<os)return;ze.current=mt,ye(Qe),r({type:"input:pinch:move",sessionId:t,payload:Qe});return}if(!me.current)return;const U=ir(A);if(!U)return;const re=U.x-me.current.x,N=U.y-me.current.y;if(Math.sqrt(re*re+N*N)<ia)return;const _e=performance.now();if(_e-ze.current<os)return;ze.current=_e;const H=A.currentTarget.getBoundingClientRect();tt.current=U;const Me=et.current;Me&&Me.style.display!=="none"&&(Me.style.left=`${A.clientX-H.left}px`,Me.style.top=`${A.clientY-H.top}px`),r({type:"input:touch:move",sessionId:t,payload:U})},e[90]=r,e[91]=t,e[92]=jt):jt=e[92];const kt=jt;let ht;e[93]!==r||e[94]!==t?(ht=()=>{if(De.current){De.current=!1,Xe(!1),ye(null),r({type:"input:pinch:end",sessionId:t,requestId:ve()});return}me.current=null,nt.current="release",Oe.current={startTime:performance.now()};const A=et.current;A&&(A.style.width=`${er*2}px`,A.style.height=`${er*2}px`,A.style.background="transparent",A.style.border="1.5px solid rgba(255,255,255,0.6)",A.style.boxShadow="0 0 0 1px rgba(0,0,0,0.3)"),r({type:"input:touch:end",sessionId:t,requestId:ve()})},e[93]=r,e[94]=t,e[95]=ht):ht=e[95];const Ct=ht;let pt;e[96]!==r||e[97]!==t?(pt=()=>{if(De.current){De.current=!1,Xe(!1),ye(null),r({type:"input:pinch:end",sessionId:t,requestId:ve()});return}me.current=null,nt.current="release",Oe.current={startTime:performance.now()},r({type:"input:touch:end",sessionId:t,requestId:ve()})},e[96]=r,e[97]=t,e[98]=pt):pt=e[98];const an=pt;let Jt;e[99]===Symbol.for("react.memo_cache_sentinel")?(Jt=()=>{ye(null),tt.current=null;const A=et.current;A&&(A.style.display="none")},e[99]=Jt):Jt=e[99];const Fn=Jt,An=Le?Math.min(1,Tr/Math.max(Le.width,Le.height)):.3,zn=Le?Math.round(Le.width*An):324,Yn=Le?Math.round(Le.height*An):720;let Hn,Qt;e[100]!==lt?(Hn=()=>{or.current=lt},Qt=[lt],e[100]=lt,e[101]=Hn,e[102]=Qt):(Hn=e[101],Qt=e[102]),a.useLayoutEffect(Hn,Qt);const Bn=lt?Yn:zn,Zt=lt?zn:Yn,cr=L!=null?Math.round(L*zn):22,en=Dl(z,Xt,Y),Wt=Il({ready:Te,aspectAgrees:en,frameIsAhead:be,rotating:it}),cn=Nl(Ve,Bn,Zt),dn=`rotate(${Ve}deg)`,un=Wt?"visible":"hidden";let Nn;e[103]!==cn||e[104]!==dn||e[105]!==un?(Nn={position:"absolute",...cn,transform:dn,transformOrigin:"center center",visibility:un,cursor:"none"},e[103]=cn,e[104]=dn,e[105]=un,e[106]=Nn):Nn=e[106];const Gn=Nn;let tn,On;if(e[107]!==h||e[108]!==r||e[109]!==t){const A=["home","back","recent_apps"],U=["volume_up","volume_down","power"],re=ca,N=_e=>i.jsx(i.Fragment,{children:_e.map(H=>h==null?void 0:h.find(Me=>Me.name===H)).filter(aa).map(H=>i.jsxs(Et,{children:[i.jsx(Tt,{asChild:!0,children:i.jsx(qe,{variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":H.accessibilityTitle,onClick:()=>r({type:"input:button",sessionId:t,requestId:ve(),payload:{name:H.name}}),children:re(H.name)})}),i.jsx(At,{side:"left",children:H.accessibilityTitle})]},H.name))});tn=N(A),On=N(U),e[107]=h,e[108]=r,e[109]=t,e[110]=tn,e[111]=On}else tn=e[110],On=e[111];const Wn=On;let nn;e[112]!==s||e[113]!==f||e[114]!==p||e[115]!==l||e[116]!==v?(nn=f&&s?i.jsxs(Et,{children:[i.jsx(Tt,{asChild:!0,children:i.jsx(qe,{variant:"ghost",size:"icon",className:"h-8 w-8",disabled:v||p,"aria-label":"Launch app",onClick:l,children:v?i.jsx(rr,{className:"h-4 w-4 animate-spin"}):i.jsx(ys,{className:"h-4 w-4"})})}),i.jsx(At,{side:"left",children:v?"Launching…":p?"Installing…":"Launch app"})]}):null,e[112]=s,e[113]=f,e[114]=p,e[115]=l,e[116]=v,e[117]=nn):nn=e[117];const fn=nn;let Pn;e[118]===Symbol.for("react.memo_cache_sentinel")?(Pn={display:"none"},e[118]=Pn):Pn=e[118];let Lt;e[119]!==de?(Lt=i.jsx("canvas",{ref:de,style:Pn}),e[119]=de,e[120]=Lt):Lt=e[120];let Mt;e[121]!==je||e[122]!==o?(Mt=i.jsx(Qs,{open:je,onOpenChange:ge,openUrl:o}),e[121]=je,e[122]=o,e[123]=Mt):Mt=e[123];let rn;e[124]===Symbol.for("react.memo_cache_sentinel")?(rn=()=>ge(!0),e[124]=rn):rn=e[124];let hn;e[125]!==dt||e[126]!==Je||e[127]!==$?(hn=$&&$.postures.length>1?{postures:$.postures,currentId:$.currentId,pending:Je,onSelect:dt}:void 0,e[125]=dt,e[126]=Je,e[127]=$,e[128]=hn):hn=e[128];let pn;e[129]!==Ot||e[130]!==S?(pn=S?{position:Ot.position,steerable:Ot.steerable,reason:Ot.reason,pending:Ot.pending,onToggle:Ot.toggle}:void 0,e[129]=Ot,e[130]=S,e[131]=pn):pn=e[131];let $t;e[132]!==R||e[133]!==C||e[134]!==I?($t={pending:C,onReboot:R,buttonRef:I},e[132]=R,e[133]=C,e[134]=I,e[135]=$t):$t=e[135];let mn;e[136]!==Wn||e[137]!==We||e[138]!==rt||e[139]!==at||e[140]!==u||e[141]!==fn||e[142]!==tn||e[143]!==ce||e[144]!==hn||e[145]!==pn||e[146]!==$t?(mn=i.jsx(Xs,{joined:u,onDeepLink:rn,onScreenshot:at,onRecordToggle:We,recordState:ce,onRotate:rt,posture:hn,navigationSlot:tn,deviceSlot:Wn,launchSlot:fn,network:pn,reboot:$t}),e[136]=Wn,e[137]=We,e[138]=rt,e[139]=at,e[140]=u,e[141]=fn,e[142]=tn,e[143]=ce,e[144]=hn,e[145]=pn,e[146]=$t,e[147]=mn):mn=e[147];const gn=`${cr+12}px`;let Ut;e[148]!==gn?(Ut={background:"#1c1c1e",borderRadius:gn,padding:"12px",flexShrink:0,boxShadow:"0 8px 32px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.06)"},e[148]=gn,e[149]=Ut):Ut=e[149];const Jn=`${cr}px`;let sn;e[150]!==Zt||e[151]!==Bn||e[152]!==Jn?(sn={width:Bn,height:Zt,backgroundColor:"#010101",borderRadius:Jn,overflow:"hidden"},e[150]=Zt,e[151]=Bn,e[152]=Jn,e[153]=sn):sn=e[153];let Ft;e[154]!==Gn||e[155]!==he||e[156]!==d||e[157]!==en||e[158]!==an||e[159]!==Dt||e[160]!==Fn||e[161]!==kt||e[162]!==Ct||e[163]!==Wt||e[164]!==Be||e[165]!==xe||e[166]!==Je?(Ft=!he&&i.jsxs(i.Fragment,{children:[i.jsx("div",{ref:G,style:Gn,onPointerDown:Dt,onPointerMove:kt,onPointerUp:Ct,onPointerCancel:an,onPointerLeave:Fn}),!Wt&&i.jsx("div",{className:"absolute inset-0 animate-pulse bg-zinc-700"}),!Wt&&d&&i.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:i.jsx("span",{style:{color:"rgba(255,255,255,0.6)",fontSize:"0.875rem"},children:Je||!en?"Changing posture…":"Waiting for stream…"})}),i.jsx("div",{ref:et,style:{display:"none",position:"absolute",zIndex:20,borderRadius:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none",transition:"width 0.1s ease, height 0.1s ease, background 0.1s ease, box-shadow 0.1s ease"}}),xe&&i.jsx(i.Fragment,{children:[xe.f0,xe.f1].map((A,U)=>i.jsx("div",{style:{position:"absolute",zIndex:10,borderRadius:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none",transition:"width 0.1s ease, height 0.1s ease, background 0.1s ease",left:`${A.x*100}%`,top:`${A.y*100}%`,...Be?{width:pr*2,height:pr*2,background:"rgba(255,255,255,0.92)",border:"1.5px solid rgba(0,0,0,0.2)",boxShadow:"0 0 0 1px rgba(0,0,0,0.15), 0 0 8px rgba(255,255,255,0.25)"}:{width:er*2,height:er*2,background:"transparent",border:"1.5px solid rgba(255,255,255,0.6)",boxShadow:"0 0 0 1px rgba(0,0,0,0.3)"}}},U))})]}),e[154]=Gn,e[155]=he,e[156]=d,e[157]=en,e[158]=an,e[159]=Dt,e[160]=Fn,e[161]=kt,e[162]=Ct,e[163]=Wt,e[164]=Be,e[165]=xe,e[166]=Je,e[167]=Ft):Ft=e[167];let bn;e[168]!==sn||e[169]!==Ft?(bn=i.jsx("div",{ref:Q,className:"relative",style:sn,children:Ft}),e[168]=sn,e[169]=Ft,e[170]=bn):bn=e[170];let xn;e[171]!==Ut||e[172]!==bn?(xn=i.jsx("div",{style:Ut,children:bn}),e[171]=Ut,e[172]=bn,e[173]=xn):xn=e[173];let yn;e[174]!==g||e[175]!==c||e[176]!==he||e[177]!==d||e[178]!==se||e[179]!==m||e[180]!==p||e[181]!==u||e[182]!==fe?(yn=i.jsx(Ur,{joined:u,fps:se,connected:c,deviceReady:d,bootError:g,installing:p,installError:m,decoderUnsupported:he,keyboardActive:fe}),e[174]=g,e[175]=c,e[176]=he,e[177]=d,e[178]=se,e[179]=m,e[180]=p,e[181]=u,e[182]=fe,e[183]=yn):yn=e[183];let wn;e[184]!==xn||e[185]!==yn?(wn=i.jsxs("div",{className:"flex items-start gap-8",children:[xn,yn]}),e[184]=xn,e[185]=yn,e[186]=wn):wn=e[186];let Vn;return e[187]!==Lt||e[188]!==Mt||e[189]!==mn||e[190]!==wn?(Vn=i.jsxs("div",{role:"region","aria-label":"Device screen",className:"flex items-start justify-center gap-16",children:[Lt,Mt,mn,wn]}),e[187]=Lt,e[188]=Mt,e[189]=mn,e[190]=wn,e[191]=Vn):Vn=e[191],Vn}function aa(n){return n!==void 0}function ca(n){return n==="back"?i.jsx(ui,{className:"h-4 w-4"}):n==="recent_apps"?i.jsx(Co,{className:"h-4 w-4"}):n==="volume_up"?i.jsx(Ti,{className:"h-4 w-4"}):n==="volume_down"?i.jsx(Ei,{className:"h-4 w-4"}):n==="power"?i.jsx(wi,{className:"h-4 w-4"}):i.jsx(Cs,{className:"h-4 w-4"})}function da(n){return zt.error(n)}function ua(n){return zt.error(n)}function fa(n){return!n}function ha(n){if(!n)return;const e=URL.createObjectURL(n),t=document.createElement("a");t.href=e,t.download=`tapflow-${Date.now()}.png`,t.click(),URL.revokeObjectURL(e)}function pa(n,e){const t=new DataView(n),s=Math.floor(n.byteLength/2),r=Math.floor(s/e),o=[];for(let l=0;l<e;l++)o.push(new Float32Array(r));for(let l=0;l<r;l++)for(let c=0;c<e;c++){const u=t.getInt16((l*e+c)*2,!0);o[c][l]=u/32768}return o}const ma=44100,Ar=2,is=.06,ga=.3;function ba(){const n=ue.c(5),e=a.useRef(null),t=a.useRef(0);let s;n[0]===Symbol.for("react.memo_cache_sentinel")?(s=()=>{if(e.current)return e.current;const p=window.AudioContext??window.webkitAudioContext;return p?(e.current=new p,e.current):null},n[0]=s):s=n[0];const r=s;let o;n[1]===Symbol.for("react.memo_cache_sentinel")?(o=p=>{var _;const f=r();if(!f)return;f.state==="suspended"&&f.resume();const m=pa(p,Ar),g=((_=m[0])==null?void 0:_.length)??0;if(g===0)return;const v=f.createBuffer(Ar,g,ma);for(let T=0;T<Ar;T++)v.getChannelData(T).set(m[T]);const h=f.createBufferSource();h.buffer=v,h.connect(f.destination);const E=f.currentTime;let b=t.current;(b<E+.005||b>E+ga+is)&&(b=E+is),h.start(b),t.current=b+v.duration},n[1]=o):o=n[1];const l=o;let c,u;n[2]===Symbol.for("react.memo_cache_sentinel")?(c=()=>()=>{var p;(p=e.current)==null||p.close(),e.current=null},u=[],n[2]=c,n[3]=u):(c=n[2],u=n[3]),a.useEffect(c,u);let d;return n[4]===Symbol.for("react.memo_cache_sentinel")?(d={pushFrame:l},n[4]=d):d=n[4],d}const xa=2e4;function ya(n){const e=ue.c(32),{sessionId:t,deviceId:s,deviceReady:r,send:o,handlerRef:l,onShutdownComplete:c,onError:u}=n,[d,p]=a.useState(!1),f=a.useRef(null),m=a.useRef(c),g=a.useRef(u);let v,h;e[0]!==c?(v=()=>{m.current=c},h=[c],e[0]=c,e[1]=v,e[2]=h):(v=e[1],h=e[2]),a.useEffect(v,h);let E,b;e[3]!==u?(E=()=>{g.current=u},b=[u],e[3]=u,e[4]=E,e[5]=b):(E=e[4],b=e[5]),a.useEffect(E,b);let _;e[6]!==r||e[7]!==t?(_={sessionId:t,deviceReady:r},e[6]=r,e[7]=t,e[8]=_):_=e[8];const[T,S]=a.useState(_);(T.sessionId!==t||T.deviceReady!==r)&&(S({sessionId:t,deviceReady:r}),(T.sessionId!==t||!r)&&p(!1));let k;e[9]===Symbol.for("react.memo_cache_sentinel")?(k=()=>{f.current=null},e[9]=k):k=e[9];let C;e[10]!==t?(C=[t],e[10]=t,e[11]=C):C=e[11],a.useEffect(k,C);let R,I;e[12]!==r?(R=()=>{r||(f.current=null)},I=[r],e[12]=r,e[13]=R,e[14]=I):(R=e[13],I=e[14]),a.useEffect(R,I);let M,P;e[15]!==l?(M=()=>(l.current=V=>{if(V.requestId===f.current){if(f.current=null,p(!1),V.type==="device:shutdown-error"){g.current(`The device was not restarted. ${V.message}`);return}m.current()}},()=>{l.current=void 0}),P=[l],e[15]=l,e[16]=M,e[17]=P):(M=e[16],P=e[17]),a.useEffect(M,P);const[L,$]=a.useState(null);let B,F;e[18]!==d?(B=()=>{$(d?f.current:null)},F=[d],e[18]=d,e[19]=B,e[20]=F):(B=e[19],F=e[20]),a.useEffect(B,F);let Y,G;e[21]!==L?(Y=()=>{if(L===null)return;const V=setTimeout(()=>{f.current===L&&(p(!1),g.current("The device has not answered the restart yet. If its answer arrives tapflow will finish restarting it; if nothing changes, press Restart again."))},xa);return()=>clearTimeout(V)},G=[L],e[21]=L,e[22]=Y,e[23]=G):(Y=e[22],G=e[23]),a.useEffect(Y,G);let Q;e[24]!==s||e[25]!==d||e[26]!==o||e[27]!==t?(Q=()=>{if(d)return;const V=ve();f.current=V,p(!0),o({type:"device:shutdown",sessionId:t,requestId:V,payload:{deviceId:s}})},e[24]=s,e[25]=d,e[26]=o,e[27]=t,e[28]=Q):Q=e[28];const ae=Q;let se;return e[29]!==d||e[30]!==ae?(se={pending:d,reboot:ae},e[29]=d,e[30]=ae,e[31]=se):se=e[31],se}const ls={"channel-unavailable":{title:"Input is not reaching this device",action:"Rejoin the session to continue."},"not-booted":{title:"The device is not running",action:"Start it again to continue testing."},"dispatch-failed":{title:"The device rejected that input",action:"Try once more. If it keeps failing, restart the device."},unsupported:{title:"That input is not supported on this device",action:"Everything else still works — this one has no equivalent here."},malformed:{title:"tapflow sent a malformed input",action:"This is a bug in tapflow — please report it with what you were doing."},"channel-starting":null,"no-gesture":null,"not-session-owner":{title:"This session is no longer yours",action:"Go back and open the device again — another tester may have taken it. Nothing you just did reached the device."}};function wa(n){const e=n!==void 0&&Object.hasOwn(ls,n)?n:"channel-unavailable";return{key:e,notice:ls[e]}}function va(n){const e=ue.c(109),{sessionId:t,deviceId:s,buildId:r,resetMode:o,onRecordingUploaded:l,onSessionEnded:c}=n,u=a.useRef(_a),d=a.useRef(!1);let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={pending:0,appInstalled:!1},e[0]=p):p=e[0];const f=a.useRef(p),{perfMode:m,visible:g}=Mi(),v=a.useRef(null),h=a.useRef(null);let E;e[1]===Symbol.for("react.memo_cache_sentinel")?(E=[],e[1]=E):E=e[1];const b=a.useRef(E);let _;e[2]===Symbol.for("react.memo_cache_sentinel")?(_={onFrameBegin:()=>{var j;return(j=v.current)==null?void 0:j.onFrameBegin()},onFrameEnd:j=>{var Ae,ie;const te=b.current.shift()??null,Ee=te?{...j,capturedAt:te.capturedAt,relayedAt:te.relayedAt}:j;(Ae=v.current)==null||Ae.onFrameEnd(Ee),(ie=h.current)==null||ie.call(h,Ee)}},e[2]=_):_=e[2],a.useRef(_);const[T,S]=a.useState(!1),[k,C]=a.useState(!1),[R,I]=a.useState(!1),[M,P]=a.useState(null);let L;e[3]===Symbol.for("react.memo_cache_sentinel")?(L={postures:[],currentId:null},e[3]=L):L=e[3];const[$,B]=a.useState(L),[F,Y]=a.useState(!1),[G,Q]=a.useState(!1),[ae,se]=a.useState(null),[V,O]=a.useState(null),[ce,de]=a.useState(!1);let q;e[4]===Symbol.for("react.memo_cache_sentinel")?(q=[],e[4]=q):q=e[4];const[oe,Se]=a.useState(q);let je;e[5]===Symbol.for("react.memo_cache_sentinel")?(je=new Set,e[5]=je):je=e[5];const ge=a.useRef(je),Te=a.useRef(null);let J;e[6]===Symbol.for("react.memo_cache_sentinel")?(J=new Set,e[6]=J):J=e[6];const he=a.useRef(J);let ee;e[7]===Symbol.for("react.memo_cache_sentinel")?(ee=new Set,e[7]=ee):ee=e[7];const Re=a.useRef(ee);let z;e[8]===Symbol.for("react.memo_cache_sentinel")?(z=new Set,e[8]=z):z=e[8];const Z=a.useRef(z),[be,Ue]=a.useState(!1),[ke,Ke]=a.useState(!1),Ne=a.useRef(null);let Ce,pe;e[9]===Symbol.for("react.memo_cache_sentinel")?(Ce=()=>()=>{Ne.current&&clearTimeout(Ne.current)},pe=[],e[9]=Ce,e[10]=pe):(Ce=e[9],pe=e[10]),a.useEffect(Ce,pe);const fe=a.useRef(void 0),Ze=a.useRef(void 0),Be=a.useRef(void 0),Xe=a.useRef(void 0);let xe;e[11]!==s||e[12]!==t?(xe=j=>{const te=ve();ge.current.add(te),Te.current=te,u.current({type:"device:boot",sessionId:t,requestId:te,payload:{deviceId:s,resetMode:j,acceptH264:gl(),secureContext:window.isSecureContext}})},e[11]=s,e[12]=t,e[13]=xe):xe=e[13];const ye=xe,{pushFrame:Ye}=ba();let Fe;e[14]!==k||e[15]!==r||e[16]!==G||e[17]!==c||e[18]!==o||e[19]!==ye||e[20]!==t?(Fe=j=>{var te,Ee,Ae;if(!("sessionId"in j&&j.sessionId!==t)){if(j.type==="session:joined"){f.current={pending:0,appInstalled:!1},S(!0),C(!1),Se(j.capabilities??[]);const ie=d.current?"app-only":o;d.current=!0,ge.current.clear(),ye(ie)}if(j.type==="session:agent-away"){C(!0),P(null),I(!1);return}if(j.type==="session:terminated"){c==null||c(j.reason);return}if(j.type==="session:rebound"){I(!1),P(null),Y(!1),se(null),O(null),de(!1),Ke(!1),Ne.current&&clearTimeout(Ne.current),Ue(!1),b.current=[],Se(j.capabilities);const ie=k;C(!1),f.current={pending:f.current.pending+1,appInstalled:f.current.pending>0?f.current.appInstalled:G},d.current=!0,ye("app-only"),ie||zt.info("The agent restarted — reconnecting to the device.");return}if(j.type==="device:boot-error"){if(j.requestId!==void 0&&j.requestId!==Te.current||k)return;f.current={pending:0,appInstalled:!1},O(j.message)}if(j.type==="input:error"){if(k)return;const{key:ie,notice:rt}=wa(j.reason);j.reason!==void 0&&j.reason!==ie&&console.debug(`[tapflow] unrecognised input:error reason "${j.reason}", treated as ${ie}`),rt?zt.error(rt.title,{id:`input:${t}:${ie}`,description:j.message?`${rt.action} (${j.message})`:rt.action,duration:6e3}):console.debug(`[tapflow] input refused, shown nowhere: ${ie}${j.message?` — ${j.message}`:""}`)}if(j.type==="device:booting"&&(I(!1),Y(!1),Q(!1),se(null),O(null),B({postures:[],currentId:null}),Re.current.clear(),Z.current.clear(),P(null)),j.type==="device:ready"){if(I(!0),j.requestId!==void 0&&!ge.current.delete(j.requestId))return;if(f.current.pending>0){const{appInstalled:ie}=f.current;if(f.current={pending:f.current.pending-1,appInstalled:ie},ie){Q(!0);return}}if(r){Y(!0);const ie=ve();Re.current.add(ie),u.current({type:"app:install",sessionId:t,requestId:ie,buildId:r})}}if(j.type==="app:install-done"||j.type==="app:install-error"){if(!Re.current.delete(j.requestId))return;Y(!1),j.type==="app:install-done"?Q(!0):se(j.message)}if(j.type==="app:launch-done"||j.type==="app:launch-error"){if(!Z.current.delete(j.requestId))return;de(!1)}if(j.type==="session:chrome"&&P(j.payload),j.type==="device:postures"&&B(j.payload),j.type==="keyboard:toggled"){const{visible:ie}=j.payload;Ue(ie),Ke(!1),Ne.current&&clearTimeout(Ne.current)}if(j.type==="network:state"||j.type==="network:error"){(te=Be.current)==null||te.call(Be,j);return}if(j.type==="device:shutdown-done"||j.type==="device:shutdown-error"){(Ee=Xe.current)==null||Ee.call(Xe,j);return}if((j.type==="clipboard:data"||j.type==="clipboard:write-done"||j.type==="clipboard:error")&&((Ae=Ze.current)==null||Ae.call(Ze,j)),j.type==="open-url:done"||j.type==="open-url:error"){if(!he.current.delete(j.requestId))return;j.type==="open-url:done"?zt.success("Deeplink opened"):zt.error(j.message)}if(j.type==="error")switch(j.reason){case"session-not-found":{c==null||c("agent-disconnected");return}case"session-busy":{c==null||c("busy-elsewhere");return}case"agent-resources-exhausted":{c==null||c("mac-overloaded");return}}}},e[14]=k,e[15]=r,e[16]=G,e[17]=c,e[18]=o,e[19]=ye,e[20]=t,e[21]=Fe):Fe=e[21];const Kt=Fe;let De;e[22]!==Ye?(De=j=>{var ie;const te=Hl(j);if(te&&te.codec===eo){Ye(j.slice(Dr));return}te&&te.codec===jr||b.current.push(te);const Ee=te?j.slice(Dr):j,Ae=te?{codec:te.codec,keyframe:te.keyframe,capturedAt:te.capturedAt,relayedAt:te.relayedAt}:void 0;(ie=fe.current)==null||ie.call(fe,Ee,Ae)},e[22]=Ye,e[23]=De):De=e[23];const gt=De,{send:me,connected:ze}=hs(Kt,gt);let et;e[24]!==me?(et=()=>{u.current=me},e[24]=me,e[25]=et):et=e[25],a.useLayoutEffect(et);let tt,nt;e[26]!==ze||e[27]!==me||e[28]!==t?(tt=()=>{ze&&me({type:"session:start",sessionId:t})},nt=[ze,me,t],e[26]=ze,e[27]=me,e[28]=t,e[29]=tt,e[30]=nt):(tt=e[29],nt=e[30]),a.useEffect(tt,nt);const Oe=M!==null&&"framePng"in M?M:null,Pe=M!==null&&!("framePng"in M)?M:null;let bt;e[31]!==me||e[32]!==t?(bt=()=>{Ke(!0),Ne.current&&clearTimeout(Ne.current),Ne.current=setTimeout(()=>{Ke(!1),zt.error("The device did not answer. The software keyboard is where it was, as far as tapflow can tell.")},8e3),me({type:"input:keyboard:toggle",sessionId:t})},e[31]=me,e[32]=t,e[33]=bt):bt=e[33];const Nt=bt;let st;e[34]!==t?(st=j=>{const te=ve();he.current.add(te),u.current({type:"open-url",sessionId:t,requestId:te,payload:{url:j}})},e[34]=t,e[35]=st):st=e[35];const Xt=st;let Le;e[36]!==r||e[37]!==t?(Le=()=>{if(r===void 0)return;const j=ve();Z.current.add(j),de(!0),u.current({type:"app:launch",sessionId:t,requestId:j,buildId:r})},e[36]=r,e[37]=t,e[38]=Le):Le=e[38];const ln=Le,lt=a.useRef(null),Ve=a.useRef(!1),xt=a.useRef(!1);let yt;e[39]!==ye?(yt=()=>{xt.current=!0,ye("app-only")},e[39]=ye,e[40]=yt):yt=e[40];const Pt=yt;let wt;e[41]!==s||e[42]!==R||e[43]!==me||e[44]!==t||e[45]!==Pt?(wt={sessionId:t,deviceId:s,deviceReady:R,send:me,handlerRef:Xe,onShutdownComplete:Pt,onError:Ra},e[41]=s,e[42]=R,e[43]=me,e[44]=t,e[45]=Pt,e[46]=wt):wt=e[46];const{pending:It,reboot:at}=ya(wt);let vt,We;e[47]!==Pe||e[48]!==Oe?(vt=()=>{var Ee;const j=!!(Oe??Pe),te=!Ve.current&&j;Ve.current=j,!(!te||!xt.current)&&(xt.current=!1,document.activeElement===document.body&&((Ee=lt.current)==null||Ee.focus()))},We=[Oe,Pe],e[47]=Pe,e[48]=Oe,e[49]=vt,e[50]=We):(vt=e[49],We=e[50]),a.useEffect(vt,We);let Ge,ct;e[51]!==k||e[52]!==V?(Ge=()=>{(V||k)&&(xt.current=!1)},ct=[V,k],e[51]=k,e[52]=V,e[53]=Ge,e[54]=ct):(Ge=e[53],ct=e[54]),a.useEffect(Ge,ct);let Je;e[55]!==oe?(Je=oe.includes("clipboard"),e[55]=oe,e[56]=Je):Je=e[56];let St;e[57]!==oe?(St=oe.includes("network-control"),e[57]=oe,e[58]=St):St=e[58];let Rt;e[59]!==V||e[60]!==r||e[61]!==ze||e[62]!==R||e[63]!==ae||e[64]!==G||e[65]!==F||e[66]!==T||e[67]!==ln||e[68]!==ce||e[69]!==Nt||e[70]!==l||e[71]!==Xt||e[72]!==at||e[73]!==It||e[74]!==me||e[75]!==t||e[76]!==ke||e[77]!==be||e[78]!==Je||e[79]!==St?(Rt={sessionId:t,buildId:r,send:me,openUrl:Xt,launchApp:ln,connected:ze,joined:T,deviceReady:R,installing:F,installed:G,installError:ae,bootError:V,launching:ce,binaryFrameHandlerRef:fe,clipboardHandlerRef:Ze,clipboardSupported:Je,networkHandlerRef:Be,networkSupported:St,onRecordingUploaded:l,swKeyboardVisible:be,swKeyboardPending:ke,onKbdToggle:Nt,rebootPending:It,onReboot:at,restartButtonRef:lt},e[59]=V,e[60]=r,e[61]=ze,e[62]=R,e[63]=ae,e[64]=G,e[65]=F,e[66]=T,e[67]=ln,e[68]=ce,e[69]=Nt,e[70]=l,e[71]=Xt,e[72]=at,e[73]=It,e[74]=me,e[75]=t,e[76]=ke,e[77]=be,e[78]=Je,e[79]=St,e[80]=Rt):Rt=e[80];const dt=Rt;if(!Oe&&!Pe){let j;e[81]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsx("div",{"aria-hidden":"true",className:"flex flex-col items-center gap-0.5 rounded-2xl border bg-background/90 px-1.5 py-2.5 shrink-0 mt-3 opacity-40",children:Array.from({length:5}).map(Sa)}),e[81]=j):j=e[81];let te;e[82]===Symbol.for("react.memo_cache_sentinel")?(te={background:"#1c1c1e",borderRadius:"34px",padding:"12px",flexShrink:0},e[82]=te):te=e[82];let Ee;e[83]===Symbol.for("react.memo_cache_sentinel")?(Ee=i.jsx("div",{"aria-hidden":"true",style:te,children:i.jsx("div",{className:"animate-pulse bg-zinc-700",style:{width:324,height:720,borderRadius:"22px"}})}),e[83]=Ee):Ee=e[83];let Ae;e[84]!==k||e[85]!==V||e[86]!==ze||e[87]!==R||e[88]!==ae||e[89]!==F||e[90]!==T?(Ae=i.jsxs("div",{className:"flex items-start gap-8",children:[Ee,i.jsx(Ur,{joined:T,fps:0,connected:ze,deviceReady:R,bootError:V,installing:F,installError:ae,decoderUnsupported:!1,keyboardActive:!1,agentAway:k})]}),e[84]=k,e[85]=V,e[86]=ze,e[87]=R,e[88]=ae,e[89]=F,e[90]=T,e[91]=Ae):Ae=e[91];let ie;return e[92]!==j||e[93]!==Ae?(ie=i.jsxs("div",{role:"region","aria-label":"Device screen",className:"flex items-start justify-center gap-16",children:[j,Ae]}),e[92]=j,e[93]=Ae,e[94]=ie):ie=e[94],ie}const Ht=void 0;let ot;e[95]!==dt||e[96]!==Oe?(ot=Oe&&i.jsx(ea,{...dt,chrome:Oe,perfHookRef:Ht}),e[95]=dt,e[96]=Oe,e[97]=ot):ot=e[97];let it;e[98]!==Pe||e[99]!==dt||e[100]!==$?(it=Pe&&i.jsx(la,{...dt,androidButtons:Pe.buttons,screenWidth:Pe.screenWidth,screenHeight:Pe.screenHeight,cornerRadius:Pe.cornerRadius,postures:$,streamRotation:Pe.streamRotation,perfHookRef:Ht}),e[98]=Pe,e[99]=dt,e[100]=$,e[101]=it):it=e[101];let ut;e[102]!==m||e[103]!==g?(ut=!1,e[102]=m,e[103]=g,e[104]=ut):ut=e[104];let _t;return e[105]!==ot||e[106]!==it||e[107]!==ut?(_t=i.jsxs(i.Fragment,{children:[ot,it,ut]}),e[105]=ot,e[106]=it,e[107]=ut,e[108]=_t):_t=e[108],_t}function Sa(n,e){return i.jsx("div",{className:"h-8 w-8 rounded-md bg-muted animate-pulse"},e)}function Ra(n){zt.error(n)}function _a(){}const ro=a.forwardRef((n,e)=>{const t=ue.c(9);let s,r;t[0]!==n?({className:s,...r}=n,t[0]=n,t[1]=s,t[2]=r):(s=t[1],r=t[2]);let o;t[3]!==s?(o=He("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",s),t[3]=s,t[4]=o):o=t[4];let l;return t[5]!==r||t[6]!==e||t[7]!==o?(l=i.jsx("textarea",{className:o,ref:e,...r}),t[5]=r,t[6]=e,t[7]=o,t[8]=l):l=t[8],l});ro.displayName="Textarea";var ja=Object.defineProperty,le=(n,e)=>ja(n,"name",{value:e,configurable:!0});function so(n,e){return a.useReducer((t,s)=>e[t][s]??t,n)}le(so,"useStateMachine");var oo="ScrollArea",[io,Rc]=ds(oo),[ka,qt]=io(oo),Ca=a.forwardRef(le(function(e,t){const{__scopeScrollArea:s,type:r="hover",dir:o,scrollHideDelay:l=600,...c}=e,[u,d]=a.useState(null),[p,f]=a.useState(null),[m,g]=a.useState(null),[v,h]=a.useState(null),[E,b]=a.useState(null),[_,T]=a.useState(0),[S,k]=a.useState(0),[C,R]=a.useState(!1),[I,M]=a.useState(!1),P=Kn(t,d),L=To(o);return i.jsx(ka,{scope:s,type:r,dir:L,scrollHideDelay:l,scrollArea:u,viewport:p,onViewportChange:f,content:m,onContentChange:g,scrollbarX:v,onScrollbarXChange:h,scrollbarXEnabled:C,onScrollbarXEnabledChange:R,scrollbarY:E,onScrollbarYChange:b,scrollbarYEnabled:I,onScrollbarYEnabledChange:M,onCornerWidthChange:T,onCornerHeightChange:k,children:i.jsx(Xn.div,{dir:L,...c,ref:P,style:{position:"relative","--radix-scroll-area-corner-width":_+"px","--radix-scroll-area-corner-height":S+"px",...e.style}})})},"ScrollArea")),Ea="ScrollAreaViewport",Ta=a.forwardRef(le(function(e,t){const{__scopeScrollArea:s,children:r,nonce:o,...l}=e,c=qt(Ea,s),u=a.useRef(null),d=Kn(t,u,c.onViewportChange);return i.jsxs(i.Fragment,{children:[i.jsx(Aa,{nonce:o}),i.jsx(Xn.div,{"data-radix-scroll-area-viewport":"",...l,ref:d,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...e.style},children:i.jsx("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})},"ScrollAreaViewport")),Aa=a.memo(le(function({nonce:e}){return i.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:e})},"ScrollAreaViewportStyle"),(n,e)=>n.nonce===e.nonce),Dn="ScrollAreaScrollbar",lo=a.forwardRef(le(function(e,t){const{forceMount:s,...r}=e,o=qt(Dn,e.__scopeScrollArea),{onScrollbarXEnabledChange:l,onScrollbarYEnabledChange:c}=o,u=e.orientation==="horizontal";return a.useEffect(()=>(u?l(!0):c(!0),()=>{u?l(!1):c(!1)}),[u,l,c]),o.type==="hover"?i.jsx(Na,{...r,ref:t,forceMount:s}):o.type==="scroll"?i.jsx(Pa,{...r,ref:t,forceMount:s}):o.type==="auto"?i.jsx(ao,{...r,ref:t,forceMount:s}):o.type==="always"?i.jsx(zr,{...r,ref:t,"data-state":"visible"}):null},"ScrollAreaScrollbar")),Na=a.forwardRef(le(function(e,t){const{forceMount:s,...r}=e,o=qt(Dn,e.__scopeScrollArea),[l,c]=a.useState(!1);return a.useEffect(()=>{const u=o.scrollArea;let d=0;if(u){const p=le(()=>{window.clearTimeout(d),c(!0)},"handlePointerEnter"),f=le(()=>{d=window.setTimeout(()=>c(!1),o.scrollHideDelay)},"handlePointerLeave");return u.addEventListener("pointerenter",p),u.addEventListener("pointerleave",f),()=>{window.clearTimeout(d),u.removeEventListener("pointerenter",p),u.removeEventListener("pointerleave",f)}}},[o.scrollArea,o.scrollHideDelay]),i.jsx(kr,{present:s||l,children:i.jsx(ao,{"data-state":l?"visible":"hidden",...r,ref:t})})},"ScrollAreaScrollbarHover")),Pa=a.forwardRef(le(function(e,t){const{forceMount:s,...r}=e,o=qt(Dn,e.__scopeScrollArea),l=e.orientation==="horizontal",c=yr(()=>d("SCROLL_END"),100),[u,d]=so("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return a.useEffect(()=>{if(u==="idle"){const p=window.setTimeout(()=>d("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(p)}},[u,o.scrollHideDelay,d]),a.useEffect(()=>{const p=o.viewport,f=l?"scrollLeft":"scrollTop";if(p){let m=p[f];const g=le(()=>{const v=p[f];m!==v&&(d("SCROLL"),c()),m=v},"handleScroll");return p.addEventListener("scroll",g),()=>p.removeEventListener("scroll",g)}},[o.viewport,l,d,c]),i.jsx(kr,{present:s||u!=="hidden",children:i.jsx(zr,{"data-state":u==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:In(e.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:In(e.onPointerLeave,()=>d("POINTER_LEAVE"))})})},"ScrollAreaScrollbarScroll")),ao=a.forwardRef(le(function(e,t){const s=qt(Dn,e.__scopeScrollArea),{forceMount:r,...o}=e,[l,c]=a.useState(!1),u=e.orientation==="horizontal",d=yr(()=>{if(s.viewport){const p=s.viewport.offsetWidth<s.viewport.scrollWidth,f=s.viewport.offsetHeight<s.viewport.scrollHeight;c(u?p:f)}},10);return sr(s.viewport,d),sr(s.content,d),i.jsx(kr,{present:r||l,children:i.jsx(zr,{"data-state":l?"visible":"hidden",...o,ref:t})})},"ScrollAreaScrollbarAuto")),zr=a.forwardRef(le(function(e,t){const{orientation:s="vertical",...r}=e,o=qt(Dn,e.__scopeScrollArea),l=a.useRef(null),c=a.useRef(0),[u,d]=a.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),p=Hr(u.viewport,u.content),f={...r,sizes:u,onSizesChange:d,hasThumb:p>0&&p<1,onThumbChange:le(g=>l.current=g,"onThumbChange"),onThumbPointerUp:le(()=>c.current=0,"onThumbPointerUp"),onThumbPointerDown:le(g=>c.current=g,"onThumbPointerDown")};function m(g,v){return ho(g,c.current,u,v)}return le(m,"getScrollPosition"),s==="horizontal"?i.jsx(Ia,{...f,ref:t,onThumbPositionChange:()=>{if(o.viewport&&l.current){const g=o.viewport.scrollLeft,v=Mr(g,u,o.dir);l.current.style.transform=`translate3d(${v}px, 0, 0)`}},onWheelScroll:g=>{o.viewport&&(o.viewport.scrollLeft=g)},onDragScroll:g=>{o.viewport&&(o.viewport.scrollLeft=m(g,o.dir))}}):s==="vertical"?i.jsx(Da,{...f,ref:t,onThumbPositionChange:()=>{if(o.viewport&&l.current){const g=o.viewport.scrollTop,v=Mr(g,u);l.current.style.transform=`translate3d(0, ${v}px, 0)`}},onWheelScroll:g=>{o.viewport&&(o.viewport.scrollTop=g)},onDragScroll:g=>{o.viewport&&(o.viewport.scrollTop=m(g))}}):null},"ScrollAreaScrollbarVisible")),Ia=a.forwardRef(le(function(e,t){const{sizes:s,onSizesChange:r,...o}=e,l=qt(Dn,e.__scopeScrollArea),[c,u]=a.useState(),d=a.useRef(null),p=Kn(t,d,l.onScrollbarXChange);return a.useEffect(()=>{d.current&&u(getComputedStyle(d.current))},[d]),i.jsx(uo,{"data-orientation":"horizontal",...o,ref:p,sizes:s,style:{bottom:0,left:l.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:l.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":xr(s)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.x),onDragScroll:f=>e.onDragScroll(f.x),onWheelScroll:(f,m)=>{if(l.viewport){const g=l.viewport.scrollLeft+f.deltaX;e.onWheelScroll(g),Or(g,m)&&f.preventDefault()}},onResize:()=>{d.current&&l.viewport&&c&&r({content:l.viewport.scrollWidth,viewport:l.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:br(c.paddingLeft),paddingEnd:br(c.paddingRight)}})}})},"ScrollAreaScrollbarX")),Da=a.forwardRef(le(function(e,t){const{sizes:s,onSizesChange:r,...o}=e,l=qt(Dn,e.__scopeScrollArea),[c,u]=a.useState(),d=a.useRef(null),p=Kn(t,d,l.onScrollbarYChange);return a.useEffect(()=>{d.current&&u(getComputedStyle(d.current))},[d]),i.jsx(uo,{"data-orientation":"vertical",...o,ref:p,sizes:s,style:{top:0,right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":xr(s)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.y),onDragScroll:f=>e.onDragScroll(f.y),onWheelScroll:(f,m)=>{if(l.viewport){const g=l.viewport.scrollTop+f.deltaY;e.onWheelScroll(g),Or(g,m)&&f.preventDefault()}},onResize:()=>{d.current&&l.viewport&&c&&r({content:l.viewport.scrollHeight,viewport:l.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:br(c.paddingTop),paddingEnd:br(c.paddingBottom)}})}})},"ScrollAreaScrollbarY")),[La,co]=io(Dn),uo=a.forwardRef(le(function(e,t){const{__scopeScrollArea:s,sizes:r,hasThumb:o,onThumbChange:l,onThumbPointerUp:c,onThumbPointerDown:u,onThumbPositionChange:d,onDragScroll:p,onWheelScroll:f,onResize:m,...g}=e,v=qt(Dn,s),[h,E]=a.useState(null),b=Kn(t,E),_=a.useRef(null),T=a.useRef(""),S=v.viewport,k=r.content-r.viewport,C=nr(f),R=nr(d),I=yr(m,10);function M(P){if(_.current){const L=P.clientX-_.current.left,$=P.clientY-_.current.top;p({x:L,y:$})}}return le(M,"handleDragScroll"),a.useEffect(()=>{const P=le(L=>{const $=L.target;(h==null?void 0:h.contains($))&&C(L,k)},"handleWheel");return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[S,h,k,C]),a.useEffect(R,[r,R]),sr(h,I),sr(v.content,I),i.jsx(La,{scope:s,scrollbar:h,hasThumb:o,onThumbChange:nr(l),onThumbPointerUp:nr(c),onThumbPositionChange:R,onThumbPointerDown:nr(u),children:i.jsx(Xn.div,{...g,ref:b,style:{position:"absolute",...g.style},onPointerDown:In(e.onPointerDown,P=>{P.button===0&&(P.target.setPointerCapture(P.pointerId),_.current=h.getBoundingClientRect(),T.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",v.viewport&&(v.viewport.style.scrollBehavior="auto"),M(P))}),onPointerMove:In(e.onPointerMove,M),onPointerUp:In(e.onPointerUp,P=>{const L=P.target;L.hasPointerCapture(P.pointerId)&&L.releasePointerCapture(P.pointerId),document.body.style.webkitUserSelect=T.current,v.viewport&&(v.viewport.style.scrollBehavior=""),_.current=null})})})},"ScrollAreaScrollbarImpl")),Lr="ScrollAreaThumb",Ma=a.forwardRef(le(function(e,t){const{forceMount:s,...r}=e,o=co(Lr,e.__scopeScrollArea);return i.jsx(kr,{present:s||o.hasThumb,children:i.jsx($a,{ref:t,...r})})},"ScrollAreaThumb")),$a=a.forwardRef(le(function(e,t){const{__scopeScrollArea:s,style:r,...o}=e,l=qt(Lr,s),c=co(Lr,s),{onThumbPositionChange:u}=c,d=Kn(t,c.onThumbChange),p=a.useRef(void 0),f=yr(()=>{p.current&&(p.current(),p.current=void 0)},100);return a.useEffect(()=>{const m=l.viewport;if(m){const g=le(()=>{if(f(),!p.current){const v=za(m,u);p.current=v,u()}},"handleScroll");return u(),m.addEventListener("scroll",g),()=>m.removeEventListener("scroll",g)}},[l.viewport,f,u]),i.jsx(Xn.div,{"data-state":c.hasThumb?"visible":"hidden",...o,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:In(e.onPointerDownCapture,m=>{const v=m.target.getBoundingClientRect(),h=m.clientX-v.left,E=m.clientY-v.top;c.onThumbPointerDown({x:h,y:E})}),onPointerUp:In(e.onPointerUp,c.onThumbPointerUp)})},"ScrollAreaThumbImpl")),fo="ScrollAreaCorner",Ua=a.forwardRef(le(function(e,t){const s=qt(fo,e.__scopeScrollArea),r=!!(s.scrollbarX&&s.scrollbarY);return s.type!=="scroll"&&r?i.jsx(Fa,{...e,ref:t}):null},"ScrollAreaCorner")),Fa=a.forwardRef(le(function(e,t){const{__scopeScrollArea:s,...r}=e,o=qt(fo,s),[l,c]=a.useState(0),[u,d]=a.useState(0),p=!!(l&&u),{onCornerWidthChange:f,onCornerHeightChange:m}=o;return sr(o.scrollbarX,()=>{var v;const g=((v=o.scrollbarX)==null?void 0:v.offsetHeight)||0;o.onCornerHeightChange(g),d(g)}),sr(o.scrollbarY,()=>{var v;const g=((v=o.scrollbarY)==null?void 0:v.offsetWidth)||0;o.onCornerWidthChange(g),c(g)}),a.useEffect(()=>()=>{f(0),m(0)},[f,m]),p?i.jsx(Xn.div,{...r,ref:t,style:{width:l,height:u,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null},"ScrollAreaCornerImpl"));function br(n){return n?parseInt(n,10):0}le(br,"toInt");function Hr(n,e){const t=n/e;return isNaN(t)?0:t}le(Hr,"getThumbRatio");function xr(n){const e=Hr(n.viewport,n.content),t=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,s=(n.scrollbar.size-t)*e;return Math.max(s,18)}le(xr,"getThumbSize");function ho(n,e,t,s="ltr"){const r=xr(t),o=r/2,l=e||o,c=r-l,u=t.scrollbar.paddingStart+l,d=t.scrollbar.size-t.scrollbar.paddingEnd-c,p=t.content-t.viewport,f=s==="ltr"?[0,p]:[p*-1,0];return Br([u,d],f)(n)}le(ho,"getScrollPositionFromPointer");function Mr(n,e,t="ltr"){const s=xr(e),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,o=e.scrollbar.size-r,l=e.content-e.viewport,c=o-s,u=t==="ltr"?[0,l]:[l*-1,0],d=ti(n,u);return Br([0,l],[0,c])(d)}le(Mr,"getThumbOffsetFromScroll");function Br(n,e){return t=>{if(n[0]===n[1]||e[0]===e[1])return e[0];const s=(e[1]-e[0])/(n[1]-n[0]);return e[0]+s*(t-n[0])}}le(Br,"linearScale");function Or(n,e){return n>0&&n<e}le(Or,"isScrollingWithinScrollbarBounds");var za=le((n,e=()=>{})=>{let t={left:n.scrollLeft,top:n.scrollTop},s=0;return le((function r(){const o={left:n.scrollLeft,top:n.scrollTop},l=t.left!==o.left,c=t.top!==o.top;(l||c)&&e(),t=o,s=window.requestAnimationFrame(r)}),"loop")(),()=>window.cancelAnimationFrame(s)},"addUnlinkedScrollListener");function yr(n,e){const t=nr(n),s=a.useRef(0);return a.useEffect(()=>()=>window.clearTimeout(s.current),[]),a.useCallback(()=>{window.clearTimeout(s.current),s.current=window.setTimeout(t,e)},[t,e])}le(yr,"useDebounceCallback");function sr(n,e){const t=nr(e);Eo(()=>{let s=0;if(n){const r=new ResizeObserver(()=>{cancelAnimationFrame(s),s=window.requestAnimationFrame(t)});return r.observe(n),()=>{window.cancelAnimationFrame(s),r.unobserve(n)}}},[n,t])}le(sr,"useResizeObserver");var po=Ca,Ha=Ta,Ba=Ua;const mo=a.forwardRef((n,e)=>{const t=ue.c(15);let s,r,o;t[0]!==n?({className:r,children:s,...o}=n,t[0]=n,t[1]=s,t[2]=r,t[3]=o):(s=t[1],r=t[2],o=t[3]);let l;t[4]!==r?(l=He("relative overflow-hidden",r),t[4]=r,t[5]=l):l=t[5];let c;t[6]!==s?(c=i.jsx(Ha,{className:"h-full w-full rounded-[inherit]",children:s}),t[6]=s,t[7]=c):c=t[7];let u,d;t[8]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(go,{}),d=i.jsx(Ba,{}),t[8]=u,t[9]=d):(u=t[8],d=t[9]);let p;return t[10]!==o||t[11]!==e||t[12]!==l||t[13]!==c?(p=i.jsxs(po,{ref:e,className:l,...o,children:[c,u,d]}),t[10]=o,t[11]=e,t[12]=l,t[13]=c,t[14]=p):p=t[14],p});mo.displayName=po.displayName;const go=a.forwardRef((n,e)=>{const t=ue.c(14);let s,r,o;t[0]!==n?({className:s,orientation:o,...r}=n,t[0]=n,t[1]=s,t[2]=r,t[3]=o):(s=t[1],r=t[2],o=t[3]);const l=o===void 0?"vertical":o,c=l==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",u=l==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]";let d;t[4]!==s||t[5]!==c||t[6]!==u?(d=He("flex touch-none select-none transition-colors",c,u,s),t[4]=s,t[5]=c,t[6]=u,t[7]=d):d=t[7];let p;t[8]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsx(Ma,{className:"relative flex-1 rounded-full bg-border"}),t[8]=p):p=t[8];let f;return t[9]!==l||t[10]!==r||t[11]!==e||t[12]!==d?(f=i.jsx(lo,{ref:e,orientation:l,className:d,...r,children:p}),t[9]=l,t[10]=r,t[11]=e,t[12]=d,t[13]=f):f=t[13],f});go.displayName=lo.displayName;function bo(n){return/[Zz]|[+-]\d{2}/.test(n)?new Date(n):new Date(n.replace(" ","T")+"Z")}function Oa(n){const e=new Map;for(const r of n){const o=bo(r.created_at).toDateString();e.has(o)||e.set(o,[]),e.get(o).push(r)}const t=new Date().toDateString(),s=new Date(Date.now()-864e5).toDateString();return Array.from(e.entries()).map(([r,o])=>{let l;if(r===t)l="Today";else if(r===s)l="Yesterday";else{const c=new Date(r);l=c.toLocaleDateString(void 0,{month:"short",day:"numeric",...c.getFullYear()!==new Date().getFullYear()?{year:"numeric"}:{}})}return{label:l,items:o}})}function Wa(n){return bo(n).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}const Va=5*1024*1024,qa=["image/png","image/jpeg","image/webp"];function Ka({buildId:n}){const e=a.useId(),[t,s]=a.useState(""),[r,o]=a.useState(null),[l,c]=a.useState(!1),[u,d]=a.useState(""),p=a.useRef(null),f=a.useRef({}),m=us(),g=fs({queryKey:_r.comments(n),queryFn:()=>Ao(n)}),v=g.data??[],h=()=>{m.invalidateQueries({queryKey:_r.comments(n)})};a.useEffect(()=>{const S=window.location.hash;if(!S.startsWith("#comment-"))return;const k=Number(S.replace("#comment-","")),C=f.current[k];if(!C)return;C.scrollIntoView({behavior:"smooth"});const R=document.documentElement.classList.contains("dark");C.style.backgroundColor=R?"rgb(0 112 243 / 0.18)":"#d3e5ff",setTimeout(()=>{C.style.backgroundColor=""},2e3)},[g.data]),a.useEffect(()=>{Jr()},[]);async function E(S){const{linkBase:k}=await Jr(),C=ci(k,`${location.pathname}${location.search}#comment-${S}`);try{if(!navigator.clipboard)throw new Error("no clipboard");await navigator.clipboard.writeText(C),zt.success("Link copied")}catch{zt.error("Could not copy link")}}function b(S){if(d(""),!qa.includes(S.type)){d("Only png, jpg, webp allowed");return}if(S.size>Va){d("Max 5MB");return}o(S)}async function _(S){if(S.preventDefault(),!t.trim()&&!r)return;c(!0);const k=new FormData;k.append("build_id",String(n)),k.append("body",t),r&&k.append("attachment",r),(await fetch("/api/v1/comments",{method:"POST",credentials:"include",body:k})).ok&&(s(""),o(null),h()),c(!1)}const T=Oa(v);return i.jsxs("div",{className:"flex h-full flex-col gap-3 px-1",children:[i.jsx(mo,{className:"flex-1 rounded-md border",children:i.jsx("div",{className:"p-3",children:g.isPending?i.jsx("p",{className:"text-sm text-muted-foreground text-center py-8",children:"Loading comments…"}):g.isError&&!g.data?i.jsx("p",{className:"text-sm text-muted-foreground text-center py-8",children:"Couldn't load comments."}):v.length===0?i.jsx("p",{className:"text-sm text-muted-foreground text-center py-8",children:"No comments yet."}):i.jsx("div",{className:"flex flex-col",children:T.map(({label:S,items:k})=>i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2 py-3",children:[i.jsx("div",{className:"h-px flex-1 bg-border"}),i.jsx("span",{className:"text-[11px] font-medium text-muted-foreground px-1 select-none",children:S}),i.jsx("div",{className:"h-px flex-1 bg-border"})]}),i.jsx("div",{className:"flex flex-col gap-4",children:k.map(C=>i.jsxs("div",{id:`comment-${C.id}`,ref:R=>{f.current[C.id]=R},className:"group flex gap-2.5 rounded-md px-2 py-1.5 transition-all",children:[i.jsx("div",{className:"mt-0.5 shrink-0",children:i.jsx(No,{name:C.author,avatarUrl:C.authorAvatarUrl,size:28})}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:"text-sm font-semibold leading-none",children:C.author}),i.jsx("span",{className:"text-[11px] text-muted-foreground leading-none",children:Wa(C.created_at)}),i.jsx(qe,{variant:"ghost",size:"icon",className:"h-4 w-4 ml-0.5 opacity-0 group-hover:opacity-50 hover:!opacity-100 group-focus-within:opacity-50 focus-visible:!opacity-100 transition-opacity","aria-label":"Copy link to comment",onClick:()=>void E(C.id),children:i.jsx(Ns,{className:"h-3 w-3","aria-hidden":"true"})})]}),i.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap mt-1",children:C.body}),C.attachments.map(R=>{const I=decodeURIComponent(R.file_path.split("/").pop()??"image");return i.jsx("a",{href:R.file_path,target:"_blank",rel:"noreferrer",className:"mt-1.5 block","aria-label":`Open ${I} in a new tab`,children:i.jsx("img",{src:R.file_path,alt:I,className:"max-h-48 rounded border object-contain"})},R.id)})]})]},C.id))})]},S))})})}),i.jsx("div",{className:"pb-1",children:i.jsx("form",{onSubmit:_,children:i.jsxs("div",{className:"rounded-md border border-input bg-background ring-offset-background transition-shadow focus-within:outline-none focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",children:[i.jsx(ro,{"aria-label":"Comment",placeholder:"Leave a comment…",value:t,onChange:S=>s(S.target.value),className:"min-h-16 resize-none border-0 bg-transparent shadow-none focus-visible:ring-0 focus-visible:ring-offset-0 text-sm"}),(r||u)&&i.jsxs("div",{className:"px-3 -mt-1 pb-1",children:[r&&i.jsx("p",{className:"text-xs text-muted-foreground",children:r.name}),u&&i.jsx("p",{id:e,role:"alert",className:"text-xs text-destructive",children:u})]}),i.jsxs("div",{className:"flex items-center gap-2 px-2 py-2",children:[i.jsx(qe,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground","aria-label":"Attach image","aria-describedby":u?e:void 0,onClick:()=>{var S;return(S=p.current)==null?void 0:S.click()},children:i.jsx(bi,{className:"h-4 w-4","aria-hidden":"true"})}),i.jsx("input",{ref:p,type:"file",accept:"image/png,image/jpeg,image/webp",className:"hidden",onChange:S=>{var C;const k=(C=S.target.files)==null?void 0:C[0];k&&b(k)}}),i.jsx("div",{className:"flex-1"}),i.jsx(qe,{type:"submit",size:"icon",className:"h-7 w-7 rounded-full","aria-label":"Post comment",disabled:l||!t.trim()&&!r,children:i.jsx(fi,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})]})})})]})}function Xa(n){return n<1024*1024?`${(n/1024).toFixed(0)} KB`:`${(n/1024/1024).toFixed(1)} MB`}function Ya(n){return new Date(n).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Ga(n){const e=new Date(n).getTime()-Date.now();if(e<=0)return{label:"Expired",urgent:!0};const t=Math.floor(e/36e5);return t<1?{label:"< 1 hour left",urgent:!0}:t<24?{label:`Expires in ${t}h`,urgent:t<6}:{label:`Expires in ${Math.floor(t/24)}d`,urgent:!1}}function Ja(n,e,t){const s=ue.c(7),[r,o]=a.useState(!1);let l;s[0]!==n||s[1]!==e?(l=()=>{if(!n)return;const u=setTimeout(()=>o(!0),e);return()=>{clearTimeout(u),o(!1)}},s[0]=n,s[1]=e,s[2]=l):l=s[2];let c;return s[3]!==n||s[4]!==t||s[5]!==e?(c=[n,e,t],s[3]=n,s[4]=t,s[5]=e,s[6]=c):c=s[6],a.useEffect(l,c),n&&r}function Qa(n){const e=ue.c(17),{buildId:t}=n;let s;e[0]!==t?(s=_r.recordings(t),e[0]=t,e[1]=s):s=e[1];let r;e[2]!==t?(r=()=>Po(t),e[2]=t,e[3]=r):r=e[3];let o;e[4]!==s||e[5]!==r?(o={queryKey:s,queryFn:r},e[4]=s,e[5]=r,e[6]=o):o=e[6];const l=fs(o);let c;e[7]!==l.data?(c=l.data??[],e[7]=l.data,e[8]=c):c=e[8];const u=c,d=Ja(l.isPending,250,t);if(l.isPending){let m;return e[9]!==d?(m=d?i.jsx("p",{className:"text-xs text-muted-foreground",children:"Loading recordings…"}):null,e[9]=d,e[10]=m):m=e[10],m}if(l.isError&&!l.data){let m;return e[11]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:"Couldn't load recordings."}),e[11]=m):m=e[11],m}if(u.length===0){let m;return e[12]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:"No recordings yet."}),e[12]=m):m=e[12],m}let p;e[13]!==u?(p=u.map(Za),e[13]=u,e[14]=p):p=e[14];let f;return e[15]!==p?(f=i.jsx("div",{className:"flex flex-col gap-2",children:p}),e[15]=p,e[16]=f):f=e[16],f}function Za(n){const e=Ga(n.expiresAt);return i.jsxs("div",{className:"flex items-center justify-between rounded-md border border-border px-3 py-2 text-sm",children:[i.jsxs("div",{className:"flex flex-col gap-0.5 min-w-0",children:[i.jsx("span",{className:"text-xs font-medium truncate",children:Ya(n.createdAt)}),i.jsxs("span",{className:`text-xs ${e.urgent?"text-destructive":"text-muted-foreground"}`,children:[e.label," · ",Xa(n.fileSize)]})]}),i.jsx(qe,{variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0 ml-2",title:"Download",onClick:()=>{const t=document.createElement("a");t.href=n.url,t.download="",t.click()},children:i.jsx(pi,{className:"h-3.5 w-3.5"})})]},n.id)}function ec(n){const e=ue.c(9),{buildId:t}=n;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsxs(Xr,{value:"comments",className:"flex-1 gap-1.5",children:[i.jsx(yi,{className:"h-3.5 w-3.5"}),"Comments"]}),e[0]=s):s=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("div",{className:"shrink-0 px-1",children:i.jsxs(Fo,{className:"w-full",children:[s,i.jsxs(Xr,{value:"recordings",className:"flex-1 gap-1.5",children:[i.jsx(mi,{className:"h-3.5 w-3.5"}),"Recordings"]})]})}),e[1]=r):r=e[1];let o;e[2]!==t?(o=i.jsx(Yr,{value:"comments",className:"mt-3 min-h-0 flex-1 overflow-hidden",children:i.jsx(Ka,{buildId:t})}),e[2]=t,e[3]=o):o=e[3];let l;e[4]!==t?(l=i.jsx(Yr,{value:"recordings",className:"mt-3 min-h-0 flex-1 overflow-y-auto",children:i.jsx(Qa,{buildId:t})}),e[4]=t,e[5]=l):l=e[5];let c;return e[6]!==o||e[7]!==l?(c=i.jsxs(zo,{defaultValue:"comments",className:"flex h-full flex-col",children:[r,o,l]}),e[6]=o,e[7]=l,e[8]=c):c=e[8],c}const xo=a.forwardRef((n,e)=>{const t=ue.c(5);let s;t[0]!==n?({...s}=n,t[0]=n,t[1]=s):s=t[1];let r;return t[2]!==s||t[3]!==e?(r=i.jsx("nav",{ref:e,"aria-label":"breadcrumb",...s}),t[2]=s,t[3]=e,t[4]=r):r=t[4],r});xo.displayName="Breadcrumb";const yo=a.forwardRef((n,e)=>{const t=ue.c(9);let s,r;t[0]!==n?({className:s,...r}=n,t[0]=n,t[1]=s,t[2]=r):(s=t[1],r=t[2]);let o;t[3]!==s?(o=He("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",s),t[3]=s,t[4]=o):o=t[4];let l;return t[5]!==r||t[6]!==e||t[7]!==o?(l=i.jsx("ol",{ref:e,className:o,...r}),t[5]=r,t[6]=e,t[7]=o,t[8]=l):l=t[8],l});yo.displayName="BreadcrumbList";const mr=a.forwardRef((n,e)=>{const t=ue.c(9);let s,r;t[0]!==n?({className:s,...r}=n,t[0]=n,t[1]=s,t[2]=r):(s=t[1],r=t[2]);let o;t[3]!==s?(o=He("inline-flex items-center gap-1.5",s),t[3]=s,t[4]=o):o=t[4];let l;return t[5]!==r||t[6]!==e||t[7]!==o?(l=i.jsx("li",{ref:e,className:o,...r}),t[5]=r,t[6]=e,t[7]=o,t[8]=l):l=t[8],l});mr.displayName="BreadcrumbItem";const vr=a.forwardRef((n,e)=>{const t=ue.c(11);let s,r,o;t[0]!==n?({asChild:s,className:r,...o}=n,t[0]=n,t[1]=s,t[2]=r,t[3]=o):(s=t[1],r=t[2],o=t[3]);const l=s?Io:"a";let c;t[4]!==r?(c=He("transition-colors hover:text-foreground cursor-pointer",r),t[4]=r,t[5]=c):c=t[5];let u;return t[6]!==l||t[7]!==o||t[8]!==e||t[9]!==c?(u=i.jsx(l,{ref:e,className:c,...o}),t[6]=l,t[7]=o,t[8]=e,t[9]=c,t[10]=u):u=t[10],u});vr.displayName="BreadcrumbLink";const Sr=a.forwardRef((n,e)=>{const t=ue.c(9);let s,r;t[0]!==n?({className:s,...r}=n,t[0]=n,t[1]=s,t[2]=r):(s=t[1],r=t[2]);let o;t[3]!==s?(o=He("font-medium text-foreground",s),t[3]=s,t[4]=o):o=t[4];let l;return t[5]!==r||t[6]!==e||t[7]!==o?(l=i.jsx("span",{ref:e,role:"link","aria-disabled":"true","aria-current":"page",className:o,...r}),t[5]=r,t[6]=e,t[7]=o,t[8]=l):l=t[8],l});Sr.displayName="BreadcrumbPage";const Rr=n=>{const e=ue.c(12);let t,s,r;e[0]!==n?({children:t,className:s,...r}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=r):(t=e[1],s=e[2],r=e[3]);let o;e[4]!==s?(o=He("[&>svg]:h-3.5 [&>svg]:w-3.5",s),e[4]=s,e[5]=o):o=e[5];let l;e[6]!==t?(l=t??i.jsx(Do,{}),e[6]=t,e[7]=l):l=e[7];let c;return e[8]!==r||e[9]!==o||e[10]!==l?(c=i.jsx("li",{role:"presentation","aria-hidden":"true",className:o,...r,children:l}),e[8]=r,e[9]=o,e[10]=l,e[11]=c):c=e[11],c};Rr.displayName="BreadcrumbSeparator";var tc=Object.defineProperty,qn=(n,e)=>tc(n,"name",{value:e,configurable:!0}),Wr="Switch",[nc,_c]=ds(Wr),[rc,Vr]=nc(Wr);function wo(n){const{__scopeSwitch:e,checked:t,children:s,defaultChecked:r,disabled:o,form:l,name:c,onCheckedChange:u,required:d,value:p="on",internal_do_not_use_render:f}=n,[m,g]=Mo({prop:t,defaultProp:r??!1,onChange:u,caller:Wr}),[v,h]=a.useState(null),[E,b]=a.useState(null),_=a.useRef(!1),[T,S]=a.useReducer(R=>R+1,0),k=v?!!l||!!v.closest("form"):!0,C={checked:m,setChecked:g,disabled:o,control:v,setControl:h,name:c,form:l,value:p,hasConsumerStoppedPropagationRef:_,userInteractionCount:T,onUserInteraction:S,required:d,defaultChecked:r,isFormControl:k,bubbleInput:E,setBubbleInput:b};return i.jsx(rc,{scope:e,...C,children:So(f)?f(C):s})}qn(wo,"SwitchProvider");var sc="SwitchTrigger",oc=a.forwardRef(qn(function({__scopeSwitch:e,onClick:t,...s},r){const{control:o,form:l,value:c,disabled:u,checked:d,required:p,setControl:f,setChecked:m,hasConsumerStoppedPropagationRef:g,onUserInteraction:v,isFormControl:h,bubbleInput:E}=Vr(sc,e),b=Kn(r,f),_=a.useRef(d);return a.useEffect(()=>{const T=l?o==null?void 0:o.ownerDocument.getElementById(l):o==null?void 0:o.form;if(T instanceof HTMLFormElement){const S=qn(()=>m(_.current),"reset");return T.addEventListener("reset",S),()=>T.removeEventListener("reset",S)}},[o,l,m]),i.jsx(Xn.button,{type:"button",role:"switch","aria-checked":d,"aria-required":p,"data-state":qr(d),"data-disabled":u?"":void 0,disabled:u,value:c,...s,ref:b,onClick:In(t,T=>{v(),m(S=>!S),E&&h&&(g.current=T.isPropagationStopped(),g.current||T.stopPropagation())})})},"SwitchTrigger")),vo=a.forwardRef(qn(function(e,t){const{__scopeSwitch:s,name:r,checked:o,defaultChecked:l,required:c,disabled:u,value:d,onCheckedChange:p,form:f,...m}=e;return i.jsx(wo,{__scopeSwitch:s,checked:o,defaultChecked:l,disabled:u,required:c,onCheckedChange:p,name:r,form:f,value:d,internal_do_not_use_render:({isFormControl:g})=>i.jsxs(i.Fragment,{children:[i.jsx(oc,{...m,ref:t,__scopeSwitch:s}),g&&i.jsx(cc,{__scopeSwitch:s})]})})},"Switch")),ic="SwitchThumb",lc=a.forwardRef(qn(function(e,t){const{__scopeSwitch:s,...r}=e,o=Vr(ic,s);return i.jsx(Xn.span,{"data-state":qr(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})},"SwitchThumb")),ac="SwitchBubbleInput",cc=a.forwardRef(qn(function({__scopeSwitch:e,onClick:t,...s},r){const{control:o,hasConsumerStoppedPropagationRef:l,userInteractionCount:c,checked:u,defaultChecked:d,required:p,disabled:f,name:m,value:g,form:v,bubbleInput:h,setBubbleInput:E}=Vr(ac,e),b=Kn(r,E),_=Lo(o),T=a.useRef(!1),S=a.useRef(u),k=a.useRef(c);a.useEffect(()=>{const R=h;if(!R)return;const I=window.HTMLInputElement.prototype,P=Object.getOwnPropertyDescriptor(I,"checked").set,L=c!==k.current;k.current=c;const $=S.current!==u;S.current=u;const B=!(L&&l.current);if($&&P){T.current=!L;const F=new Event("click",{bubbles:B});P.call(R,u),R.dispatchEvent(F),T.current=!1}},[h,u,l,c]);const C=a.useRef(u);return i.jsx(Xn.input,{type:"checkbox","aria-hidden":!0,defaultChecked:d??C.current,required:p,disabled:f,name:m,value:g,form:v,...s,tabIndex:-1,ref:b,onClick:In(t,R=>{T.current&&R.stopPropagation()}),style:{...s.style,..._,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function So(n){return typeof n=="function"}qn(So,"isFunction");function qr(n){return n?"checked":"unchecked"}qn(qr,"getState");const Ro=a.forwardRef((n,e)=>{const t=ue.c(10);let s,r;t[0]!==n?({className:s,...r}=n,t[0]=n,t[1]=s,t[2]=r):(s=t[1],r=t[2]);let o;t[3]!==s?(o=He("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",s),t[3]=s,t[4]=o):o=t[4];let l;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(lc,{className:He("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")}),t[5]=l):l=t[5];let c;return t[6]!==r||t[7]!==e||t[8]!==o?(c=i.jsx(vo,{className:o,...r,ref:e,children:l}),t[6]=r,t[7]=e,t[8]=o,t[9]=c):c=t[9],c});Ro.displayName=vo.displayName;const dc={"agent-disconnected":{title:"The agent disconnected — this session ended.",description:"Pick the Mac again to start a new session."},"busy-elsewhere":{title:"This device is already open in another browser session.",description:"Someone else may be testing it. If you reloaded while your connection was down it is your own tab, and that clears within about 45 seconds."},"mac-overloaded":{title:"That Mac is too busy to start a session.",description:"Pick a different Mac, or wait for it to settle."}};function jc(){const n=ue.c(60),[e]=ps(),t=Oo();let s;n[0]!==e?(s=e.get("id"),n[0]=e,n[1]=s):s=n[1];const r=s,{build:o}=Ai(r),l=us(),c=(o==null?void 0:o.platform)??"ios",{sessions:u,selectedAgent:d,setSelectedAgent:p,activeSessionId:f,deviceId:m,booting:g,status:v,connected:h,agentGroups:E,startDevice:b,resetDevice:_,handleBack:T,handleBackToMacs:S,handleSessionEnded:k}=Ni(c);let C;if(n[2]!==E||n[3]!==d){let z;n[5]!==d?(z=Z=>Z.agentName===d,n[5]=d,n[6]=z):z=n[6],C=E.find(z),n[2]=E,n[3]=d,n[4]=C}else C=n[4];const R=C,{osVersions:I,osVersion:M,setOsVersion:P,deviceSearch:L,setDeviceSearch:$,versionedDevices:B,resetMode:F,setResetMode:Y,appliedResetMode:G,consumeResetMode:Q,fullResetSupported:ae}=Pi(R,c);let se;if(n[7]!==m||n[8]!==u){const z=u.flatMap(fc);let Z;n[10]!==m?(Z=be=>be.id===m,n[10]=m,n[11]=Z):Z=n[11],se=z.find(Z),n[7]=m,n[8]=u,n[9]=se}else se=n[9];const V=se,O=V?`${V.name}${V.osVersion?` · ${V.osVersion}`:""}`:"";let ce;n[12]!==l?(ce=()=>{l.invalidateQueries({queryKey:_r.allRecordings})},n[12]=l,n[13]=ce):ce=n[13];const de=ce;let q;n[14]!==Q||n[15]!==b?(q=z=>{Q(),b(z)},n[14]=Q,n[15]=b,n[16]=q):q=n[16];const oe=q;let Se;n[17]!==k?(Se=z=>{const Z=dc[z];zt.error(Z.title,{description:Z.description}),k()},n[17]=k,n[18]=Se):Se=n[18];const je=Se,{setNode:ge}=$o();let Te,J;n[19]!==f||n[20]!==o||n[21]!==O||n[22]!==T||n[23]!==S||n[24]!==t||n[25]!==d||n[26]!==ge?(Te=()=>{if(o)return ge(i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(xo,{children:i.jsxs(yo,{children:[i.jsx(mr,{children:i.jsx(vr,{asChild:!0,children:i.jsx("button",{onClick:()=>t(`/app-center?appId=${o.app_id}`),children:o.name})})}),i.jsx(Rr,{}),i.jsx(mr,{children:d?i.jsx(vr,{asChild:!0,children:i.jsx("button",{onClick:S,children:Gr(o)})}):i.jsx(Sr,{children:Gr(o)})}),d&&i.jsxs(i.Fragment,{children:[i.jsx(Rr,{}),i.jsx(mr,{children:f?i.jsx(vr,{asChild:!0,children:i.jsx("button",{onClick:T,children:d})}):i.jsx(Sr,{children:d})})]}),f&&i.jsxs(i.Fragment,{children:[i.jsx(Rr,{}),i.jsx(mr,{children:i.jsx(Sr,{children:O})})]})]})}),!d&&o.status_label&&i.jsx(di,{tone:ai[o.status_label],children:o.status_label})]})),()=>ge(null)},J=[o,d,f,O,t,T,S,ge],n[19]=f,n[20]=o,n[21]=O,n[22]=T,n[23]=S,n[24]=t,n[25]=d,n[26]=ge,n[27]=Te,n[28]=J):(Te=n[27],J=n[28]),a.useEffect(Te,J);let he;n[29]!==f||n[30]!==E||n[31]!==G||n[32]!==g||n[33]!==(o==null?void 0:o.id)||n[34]!==h||n[35]!==m||n[36]!==L||n[37]!==ae||n[38]!==S||n[39]!==de||n[40]!==oe||n[41]!==je||n[42]!==c||n[43]!==M||n[44]!==I||n[45]!==_||n[46]!==F||n[47]!==d||n[48]!==$||n[49]!==P||n[50]!==Y||n[51]!==p||n[52]!==v||n[53]!==B?(he=i.jsx("div",{className:"flex flex-col gap-3 flex-1 min-w-0 min-h-0",children:i.jsx("div",{className:"flex-1 min-h-0 overflow-auto -ml-1 pl-1 -mr-4 pr-4",children:f?i.jsx("div",{className:"min-h-full flex items-center justify-center py-6 px-8 min-w-max",children:i.jsx(va,{sessionId:f,deviceId:m,buildId:o==null?void 0:o.id,resetMode:G,onRecordingUploaded:de,onSessionEnded:je})}):d?i.jsxs("div",{className:"flex flex-col gap-5",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("button",{onClick:S,className:"text-sm text-muted-foreground hover:text-foreground transition-colors",children:"← All Macs"}),i.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Select device"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(li,{"aria-label":"Search devices",placeholder:"Search device…",value:L,onChange:$}),I.length>0&&i.jsxs(ni,{value:M||"__all__",onValueChange:z=>{P(z==="__all__"?"":z),_()},children:[i.jsx(ri,{className:"h-8 w-36 shrink-0","aria-label":"Filter by OS version",children:i.jsx(si,{})}),i.jsxs(oi,{children:[i.jsx(xs,{value:"__all__",children:"Any version"}),I.map(uc)]})]}),ae&&i.jsx(Nr,{children:i.jsxs(Et,{children:[i.jsx(Tt,{asChild:!0,children:i.jsxs("div",{className:"ml-auto flex items-center gap-2 shrink-0",children:[i.jsx(Uo,{htmlFor:"reset-mode",className:"text-sm cursor-pointer whitespace-nowrap",children:"Full reset"}),i.jsx("span",{id:"reset-mode-desc",className:"sr-only",children:"When on, erases all data on the next device you pick"}),i.jsx(Ro,{id:"reset-mode","aria-describedby":"reset-mode-desc",checked:F==="full-erase",onCheckedChange:z=>Y(z?"full-erase":"app-only")})]})}),i.jsx(At,{children:F==="full-erase"?"Erase all data on the next device you pick":"Keep existing data"})]})})]}),B.length===0?i.jsx("p",{className:"text-sm text-muted-foreground",children:h?"No devices available for this OS.":"Connecting to relay…"}):i.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 2xl:grid-cols-3 gap-2",children:B.map(z=>{const Z=z.status==="booted",be=z.busy,Ue=be?"In use":Z?"Booted":"Available",ke=be?"bg-amber-400":Z?"bg-emerald-400":"bg-muted-foreground/40";return i.jsxs("button",{disabled:be||g||!h,onClick:()=>oe(z),className:He("flex flex-col gap-3 rounded-lg border p-3 text-left transition-colors min-h-[100px]","hover:bg-accent disabled:cursor-not-allowed disabled:opacity-50"),children:[i.jsx("span",{className:"text-sm font-medium leading-tight",children:z.name}),z.osVersion&&i.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:z.osVersion}),i.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[i.jsx("span",{className:He("inline-block h-1.5 w-1.5 rounded-full",ke)}),Ue]})]},z.id)})}),v&&i.jsx("p",{className:"text-sm text-muted-foreground",children:v})]}):i.jsxs("div",{className:"flex flex-col gap-5",children:[i.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Select Mac"}),E.length===0?i.jsx("p",{className:"text-sm text-muted-foreground",children:h?`No agents available for ${c}.`:"Connecting to relay…"}):i.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 2xl:grid-cols-3 gap-2",children:E.map(z=>{const Z=z.resources,be=Z?Date.now()-Z.reportedAt>Ho:!1,Ue=z.devices.filter(pe=>pe.platform===c).length,ke=(Z==null?void 0:Z.cpuPercent)??0,Ke=Z?Z.memUsedMB/Z.memTotalMB*100:0,Ne=Bo(Z,be),Ce=Ne==="overloaded";return i.jsx(Nr,{children:i.jsxs(Et,{children:[i.jsx(Tt,{asChild:!0,children:i.jsx("span",{tabIndex:Ce?0:void 0,className:Ce?"cursor-not-allowed":void 0,children:i.jsxs("button",{disabled:Ce,"aria-disabled":Ce,onClick:()=>p(z.agentName??null),className:He("flex flex-col gap-3 rounded-lg border p-3 text-left transition-colors min-h-[100px] w-full",Ce?"pointer-events-none":"hover:bg-accent"),children:[i.jsxs("div",{className:"flex items-start justify-between gap-2",children:[i.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[i.jsx(hc,{health:Ne}),i.jsx("span",{className:"text-sm font-medium leading-tight truncate",children:z.agentName??"Unknown"})]}),be&&i.jsx("span",{className:"shrink-0 text-[10px] font-medium text-amber-500",children:"Stale"})]}),i.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[i.jsxs("span",{children:[Ue," device",Ue!==1?"s":""]}),Z&&i.jsxs(i.Fragment,{children:[i.jsx("span",{children:"·"}),i.jsxs("span",{children:[Z.slotsAvailable,"/",Z.slotsTotal," slots"]})]})]}),Z&&!be&&i.jsxs("div",{className:"flex flex-col gap-1.5 w-full",children:[i.jsx(as,{label:"CPU",percent:ke,colorClass:"bg-blue-400"}),i.jsx(as,{label:"RAM",percent:Ke,colorClass:"bg-violet-400"})]})]})})}),Ce&&i.jsx(At,{children:"This Mac is currently overloaded. Try again later."})]})},z.agentName)})})]})})}),n[29]=f,n[30]=E,n[31]=G,n[32]=g,n[33]=o==null?void 0:o.id,n[34]=h,n[35]=m,n[36]=L,n[37]=ae,n[38]=S,n[39]=de,n[40]=oe,n[41]=je,n[42]=c,n[43]=M,n[44]=I,n[45]=_,n[46]=F,n[47]=d,n[48]=$,n[49]=P,n[50]=Y,n[51]=p,n[52]=v,n[53]=B,n[54]=he):he=n[54];let ee;n[55]!==r?(ee=r&&i.jsxs(i.Fragment,{children:[i.jsx(cs,{orientation:"vertical",className:"h-auto"}),i.jsx("div",{className:"w-80 shrink-0 h-full",children:i.jsx(ec,{buildId:Number(r)})})]}),n[55]=r,n[56]=ee):ee=n[56];let Re;return n[57]!==he||n[58]!==ee?(Re=i.jsxs("div",{className:"flex h-full min-h-0 gap-6 p-6",children:[he,ee]}),n[57]=he,n[58]=ee,n[59]=Re):Re=n[59],Re}function uc(n){return i.jsx(xs,{value:n,children:n},n)}function fc(n){return n.devices}function hc(n){const e=ue.c(6),{health:t}=n;let s,r;if(e[0]!==t){const l={unknown:"bg-muted-foreground/40",healthy:"bg-emerald-400",warning:"bg-amber-400",overloaded:"bg-red-500"}[t];s="resource-health-dot",r=He("inline-block h-2 w-2 shrink-0 rounded-full",l),e[0]=t,e[1]=s,e[2]=r}else s=e[1],r=e[2];let o;return e[3]!==s||e[4]!==r?(o=i.jsx("span",{"data-testid":s,className:r}),e[3]=s,e[4]=r,e[5]=o):o=e[5],o}function as(n){const e=ue.c(19),{label:t,percent:s,colorClass:r}=n;let o;e[0]!==t?(o=i.jsx("span",{children:t}),e[0]=t,e[1]=o):o=e[1];let l;e[2]!==s?(l=s.toFixed(0),e[2]=s,e[3]=l):l=e[3];let c;e[4]!==l?(c=i.jsxs("span",{children:[l,"%"]}),e[4]=l,e[5]=c):c=e[5];let u;e[6]!==o||e[7]!==c?(u=i.jsxs("div",{className:"flex justify-between text-[10px] text-muted-foreground",children:[o,c]}),e[6]=o,e[7]=c,e[8]=u):u=e[8];let d;e[9]!==r?(d=He("h-full rounded-full transition-all",r),e[9]=r,e[10]=d):d=e[10];const p=`${Math.min(100,s)}%`;let f;e[11]!==p?(f={width:p},e[11]=p,e[12]=f):f=e[12];let m;e[13]!==d||e[14]!==f?(m=i.jsx("div",{className:"h-1 w-full rounded-full bg-muted overflow-hidden",children:i.jsx("div",{className:d,style:f})}),e[13]=d,e[14]=f,e[15]=m):m=e[15];let g;return e[16]!==u||e[17]!==m?(g=i.jsxs("div",{className:"flex flex-col gap-0.5",children:[u,m]}),e[16]=u,e[17]=m,e[18]=g):g=e[18],g}export{jc as QASession};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./vendor-react-BlPSzrEe.js";import{
|
|
1
|
+
import{j as e}from"./vendor-react-BlPSzrEe.js";import{aF as F,aw as P,aJ as T,aI as E,C as w,c as h,d as f,b as x,a as I,L as g,I as j,F as i,B as R,aq as v,ap as K,au as y,aN as L}from"./index-C1Fo8g_c.js";import{b as Q,c as B}from"./vendor-router-B_lVHrKl.js";const J=K({password:y().min(8,"Password must be at least 8 characters"),confirm:y()}).refine(a=>a.password===a.confirm,{message:"Passwords do not match",path:["confirm"]});function H(){var l,m,p;const a=Q(),[b]=B(),r=b.get("token")??"",{register:o,handleSubmit:N,setError:t,formState:{errors:s,isSubmitting:n}}=F({resolver:P(J)}),C=T(),d=E({queryKey:v.resetToken(r),queryFn:()=>L(r),enabled:r!=="",staleTime:1/0}),c=!r||d.isError?"invalid":d.isPending?"loading":"valid";async function k(S){try{const u=await fetch("/api/v1/auth/reset-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:r,password:S.password})});if(!u.ok){const q=await u.json();t("root",{message:q.error??"Failed to reset password"});return}C.removeQueries({queryKey:v.resetToken(r)}),a("/login",{replace:!0})}catch{t("root",{message:"Network error. Please try again."})}}return c==="loading"?e.jsx("div",{className:"flex min-h-svh items-center justify-center"}):c==="invalid"?e.jsx("div",{className:"bg-mesh-gradient flex min-h-svh items-center justify-center overflow-hidden p-4",children:e.jsx(w,{level:4,className:"w-full max-w-sm text-center",children:e.jsxs(h,{children:[e.jsx(f,{children:"Link expired"}),e.jsx(x,{children:"This password reset link is invalid or has expired. Ask your admin to send a new one."})]})})}):e.jsx("div",{className:"bg-mesh-gradient flex min-h-svh items-center justify-center overflow-hidden p-4",children:e.jsxs(w,{level:4,className:"w-full max-w-sm",children:[e.jsxs(h,{className:"text-center",children:[e.jsx(f,{children:"Reset password"}),e.jsx(x,{children:"Enter your new password below."})]}),e.jsx(I,{children:e.jsxs("form",{onSubmit:N(k),className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(g,{htmlFor:"password",children:"New password"}),e.jsx(j,{id:"password",type:"password","aria-required":"true",autoComplete:"new-password","aria-invalid":!!s.password,"aria-describedby":s.password?"password-error":void 0,...o("password")}),e.jsx(i,{id:"password-error",message:(l=s.password)==null?void 0:l.message})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(g,{htmlFor:"confirm",children:"Confirm password"}),e.jsx(j,{id:"confirm",type:"password","aria-required":"true",autoComplete:"new-password","aria-invalid":!!s.confirm,"aria-describedby":s.confirm?"confirm-error":void 0,...o("confirm")}),e.jsx(i,{id:"confirm-error",message:(m=s.confirm)==null?void 0:m.message})]}),e.jsx(i,{assertive:!0,id:"resetpassword-error",message:(p=s.root)==null?void 0:p.message}),e.jsx(R,{type:"submit",disabled:n,className:"w-full",children:n?"Saving…":"Set new password"})]})})]})})}export{H as ResetPassword};
|
|
Binary file
|
|
Binary file
|