@tapflowio/relay 0.27.0 → 0.27.1

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.
Files changed (136) hide show
  1. package/dist/RelayServer.d.ts +20 -0
  2. package/dist/RelayServer.d.ts.map +1 -1
  3. package/dist/RelayServer.js +98 -6
  4. package/dist/RelayServer.js.map +1 -1
  5. package/dist/api/builds.d.ts.map +1 -1
  6. package/dist/api/builds.js +13 -8
  7. package/dist/api/builds.js.map +1 -1
  8. package/dist/api/comments.d.ts.map +1 -1
  9. package/dist/api/comments.js +5 -7
  10. package/dist/api/comments.js.map +1 -1
  11. package/dist/api/invitations.d.ts.map +1 -1
  12. package/dist/api/invitations.js +3 -0
  13. package/dist/api/invitations.js.map +1 -1
  14. package/dist/api/profile.d.ts.map +1 -1
  15. package/dist/api/profile.js +28 -9
  16. package/dist/api/profile.js.map +1 -1
  17. package/dist/api/recordings.d.ts.map +1 -1
  18. package/dist/api/recordings.js +5 -6
  19. package/dist/api/recordings.js.map +1 -1
  20. package/dist/api/settings.d.ts.map +1 -1
  21. package/dist/api/settings.js +28 -9
  22. package/dist/api/settings.js.map +1 -1
  23. package/dist/lib/clientAddress.d.ts +12 -0
  24. package/dist/lib/clientAddress.d.ts.map +1 -1
  25. package/dist/lib/clientAddress.js +22 -0
  26. package/dist/lib/clientAddress.js.map +1 -1
  27. package/dist/lib/uploads.d.ts +13 -0
  28. package/dist/lib/uploads.d.ts.map +1 -1
  29. package/dist/lib/uploads.js +41 -0
  30. package/dist/lib/uploads.js.map +1 -1
  31. package/package.json +3 -3
  32. package/public/assets/{AppCenter-BMdYtQbV.js → AppCenter-CeLjUbnR.js} +1 -1
  33. package/public/assets/AppCenter-CeLjUbnR.js.br +0 -0
  34. package/public/assets/AppCenter-CeLjUbnR.js.gz +0 -0
  35. package/public/assets/{Default-0DHHVGaN.js → Default-UB0Pa3lN.js} +1 -1
  36. package/public/assets/Default-UB0Pa3lN.js.br +0 -0
  37. package/public/assets/Default-UB0Pa3lN.js.gz +0 -0
  38. package/public/assets/{Invite-C0ZB_HiU.js → Invite-Dv3omu3x.js} +1 -1
  39. package/public/assets/Invite-Dv3omu3x.js.br +0 -0
  40. package/public/assets/Invite-Dv3omu3x.js.gz +0 -0
  41. package/public/assets/{MacResources-DmY5pRV2.js → MacResources-CY4-OdGt.js} +1 -1
  42. package/public/assets/MacResources-CY4-OdGt.js.br +0 -0
  43. package/public/assets/MacResources-CY4-OdGt.js.gz +0 -0
  44. package/public/assets/QASession-H5eRSwZv.js +150 -0
  45. package/public/assets/QASession-H5eRSwZv.js.br +0 -0
  46. package/public/assets/QASession-H5eRSwZv.js.gz +0 -0
  47. package/public/assets/{ResetPassword-jNRuertx.js → ResetPassword-nFTigYt2.js} +1 -1
  48. package/public/assets/ResetPassword-nFTigYt2.js.br +0 -0
  49. package/public/assets/ResetPassword-nFTigYt2.js.gz +0 -0
  50. package/public/assets/{Setup-CF_FN9Dt.js → Setup-UmLtF2PF.js} +1 -1
  51. package/public/assets/Setup-UmLtF2PF.js.br +0 -0
  52. package/public/assets/Setup-UmLtF2PF.js.gz +0 -0
  53. package/public/assets/{Team-BbiyOGau.js → Team-DW40kt3H.js} +1 -1
  54. package/public/assets/Team-DW40kt3H.js.br +0 -0
  55. package/public/assets/Team-DW40kt3H.js.gz +0 -0
  56. package/public/assets/{Tokens-CZo4sPTx.js → Tokens-B1a4ChJK.js} +1 -1
  57. package/public/assets/Tokens-B1a4ChJK.js.br +0 -0
  58. package/public/assets/Tokens-B1a4ChJK.js.gz +0 -0
  59. package/public/assets/{alert-dialog-DFz8G_zu.js → alert-dialog-aoqYdAwx.js} +1 -1
  60. package/public/assets/alert-dialog-aoqYdAwx.js.br +0 -0
  61. package/public/assets/alert-dialog-aoqYdAwx.js.gz +0 -0
  62. package/public/assets/{badge-B3vaBVIQ.js → badge-DNaS0Mu3.js} +1 -1
  63. package/public/assets/badge-DNaS0Mu3.js.br +0 -0
  64. package/public/assets/badge-DNaS0Mu3.js.gz +0 -0
  65. package/public/assets/{build-format-dbQPU3A4.js → build-format-DF5aFcag.js} +1 -1
  66. package/public/assets/build-format-DF5aFcag.js.br +0 -0
  67. package/public/assets/build-format-DF5aFcag.js.gz +0 -0
  68. package/public/assets/{dialog-DeBPk-I3.js → dialog-DE2WUMuX.js} +1 -1
  69. package/public/assets/dialog-DE2WUMuX.js.br +0 -0
  70. package/public/assets/dialog-DE2WUMuX.js.gz +0 -0
  71. package/public/assets/{field-hint-CMKmbVpy.js → field-hint-Csb40Gzp.js} +1 -1
  72. package/public/assets/field-hint-Csb40Gzp.js.br +2 -0
  73. package/public/assets/field-hint-Csb40Gzp.js.gz +0 -0
  74. package/public/assets/index-BbCkTtjO.css +1 -0
  75. package/public/assets/index-BbCkTtjO.css.br +0 -0
  76. package/public/assets/index-BbCkTtjO.css.gz +0 -0
  77. package/public/assets/{index-B4w4Lh3e.js → index-DSW9h8XX.js} +2 -2
  78. package/public/assets/index-DSW9h8XX.js.br +0 -0
  79. package/public/assets/index-DSW9h8XX.js.gz +0 -0
  80. package/public/assets/{list-view-BvINA5t4.js → list-view-C0w97ltJ.js} +1 -1
  81. package/public/assets/list-view-C0w97ltJ.js.br +0 -0
  82. package/public/assets/list-view-C0w97ltJ.js.gz +0 -0
  83. package/public/assets/{pencil-CycAOoC_.js → pencil-BN18R4oa.js} +1 -1
  84. package/public/assets/pencil-BN18R4oa.js.br +0 -0
  85. package/public/assets/pencil-BN18R4oa.js.gz +0 -0
  86. package/public/assets/{resource-health-C1qSG3MK.js → resource-health-Bi20EUDs.js} +1 -1
  87. package/public/assets/resource-health-Bi20EUDs.js.br +0 -0
  88. package/public/assets/resource-health-Bi20EUDs.js.gz +0 -0
  89. package/public/assets/{trash-BXQnOI5U.js → trash-D1l1Fm-Z.js} +1 -1
  90. package/public/assets/trash-D1l1Fm-Z.js.br +0 -0
  91. package/public/assets/trash-D1l1Fm-Z.js.gz +0 -0
  92. package/public/index.html +2 -2
  93. package/public/index.html.br +0 -0
  94. package/public/index.html.gz +0 -0
  95. package/public/assets/AppCenter-BMdYtQbV.js.br +0 -0
  96. package/public/assets/AppCenter-BMdYtQbV.js.gz +0 -0
  97. package/public/assets/Default-0DHHVGaN.js.br +0 -0
  98. package/public/assets/Default-0DHHVGaN.js.gz +0 -0
  99. package/public/assets/Invite-C0ZB_HiU.js.br +0 -0
  100. package/public/assets/Invite-C0ZB_HiU.js.gz +0 -0
  101. package/public/assets/MacResources-DmY5pRV2.js.br +0 -0
  102. package/public/assets/MacResources-DmY5pRV2.js.gz +0 -0
  103. package/public/assets/QASession-2QogWEX7.js +0 -150
  104. package/public/assets/QASession-2QogWEX7.js.br +0 -0
  105. package/public/assets/QASession-2QogWEX7.js.gz +0 -0
  106. package/public/assets/ResetPassword-jNRuertx.js.br +0 -0
  107. package/public/assets/ResetPassword-jNRuertx.js.gz +0 -0
  108. package/public/assets/Setup-CF_FN9Dt.js.br +0 -0
  109. package/public/assets/Setup-CF_FN9Dt.js.gz +0 -0
  110. package/public/assets/Team-BbiyOGau.js.br +0 -0
  111. package/public/assets/Team-BbiyOGau.js.gz +0 -0
  112. package/public/assets/Tokens-CZo4sPTx.js.br +0 -0
  113. package/public/assets/Tokens-CZo4sPTx.js.gz +0 -0
  114. package/public/assets/alert-dialog-DFz8G_zu.js.br +0 -0
  115. package/public/assets/alert-dialog-DFz8G_zu.js.gz +0 -0
  116. package/public/assets/badge-B3vaBVIQ.js.br +0 -0
  117. package/public/assets/badge-B3vaBVIQ.js.gz +0 -0
  118. package/public/assets/build-format-dbQPU3A4.js.br +0 -0
  119. package/public/assets/build-format-dbQPU3A4.js.gz +0 -0
  120. package/public/assets/dialog-DeBPk-I3.js.br +0 -0
  121. package/public/assets/dialog-DeBPk-I3.js.gz +0 -0
  122. package/public/assets/field-hint-CMKmbVpy.js.br +0 -0
  123. package/public/assets/field-hint-CMKmbVpy.js.gz +0 -0
  124. package/public/assets/index-B4w4Lh3e.js.br +0 -0
  125. package/public/assets/index-B4w4Lh3e.js.gz +0 -0
  126. package/public/assets/index-CDWu0GQL.css +0 -1
  127. package/public/assets/index-CDWu0GQL.css.br +0 -0
  128. package/public/assets/index-CDWu0GQL.css.gz +0 -0
  129. package/public/assets/list-view-BvINA5t4.js.br +0 -0
  130. package/public/assets/list-view-BvINA5t4.js.gz +0 -0
  131. package/public/assets/pencil-CycAOoC_.js.br +0 -0
  132. package/public/assets/pencil-CycAOoC_.js.gz +0 -0
  133. package/public/assets/resource-health-C1qSG3MK.js.br +0 -0
  134. package/public/assets/resource-health-C1qSG3MK.js.gz +0 -0
  135. package/public/assets/trash-BXQnOI5U.js.br +0 -0
  136. package/public/assets/trash-BXQnOI5U.js.gz +0 -0
package/public/index.html CHANGED
@@ -5,10 +5,10 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <link rel="icon" href="/favicon.svg" type="image/svg+xml" />
7
7
  <title>tapflow</title>
8
- <script type="module" crossorigin src="/assets/index-B4w4Lh3e.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-DSW9h8XX.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="/assets/vendor-react-BlPSzrEe.js">
10
10
  <link rel="modulepreload" crossorigin href="/assets/vendor-router-B_lVHrKl.js">
11
- <link rel="stylesheet" crossorigin href="/assets/index-CDWu0GQL.css">
11
+ <link rel="stylesheet" crossorigin href="/assets/index-BbCkTtjO.css">
12
12
  </head>
13
13
  <body>
14
14
  <div id="root"></div>
Binary file
Binary file
Binary file
Binary file
@@ -1,150 +0,0 @@
1
- import{f as de,k as a,j as i}from"./vendor-react-BlPSzrEe.js";import{a6 as De,ae as Ho,a0 as Le,T as Dt,O as Mt,K as Lt,B as Ve,N as Or,S as Rs,aA as $t,u as Oo,aG as or,z as ir,a4 as _s,aF as hr,aM as Bo,aI as Wo,y as $r,a1 as Vn,aO as ks,aN as js,ag as Vo,av as Mr,U as qo,aj as Ko,H as Xo,f as Yo,aP as Go,aH as Qo,aE as Jo,L as Zo}from"./index-B4w4Lh3e.js";import{u as Es,n as _e,c as ls,b as ei,a as as,T as ti,R as ni,g as ri}from"./resource-health-C1qSG3MK.js";import{c as Cs,b as si}from"./vendor-router-B_lVHrKl.js";import{A as oi,c as ii,f as li,g as ai,d as ci,e as di,b as ui,a as fi}from"./alert-dialog-DFz8G_zu.js";import{e as Ts,d as hi,b as pi,a as Ns,c as mi,D as As,k as gi,S as bi,i as xi,j as yi,g as wi,h as Is}from"./dialog-DeBPk-I3.js";import{a as vi,P as Ps,b as Si,c as cs,S as Ri}from"./build-format-dbQPU3A4.js";import{l as ds,j as _i}from"./publicLink-D6zKS_wu.js";import{B as ki}from"./badge-B3vaBVIQ.js";/**
2
- * @license lucide-react v1.48.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 Ds={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};Ds.node;const ji=De(Ds);/**
7
- * @license lucide-react v1.48.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 Ms={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]};Ms.node;const Ei=De(Ms);/**
12
- * @license lucide-react v1.48.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 Ls={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"}]]};Ls.node;const Ci=De(Ls);/**
17
- * @license lucide-react v1.48.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 $s={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"}]]};$s.node;const Ti=De($s);/**
22
- * @license lucide-react v1.48.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 Fs={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"}]]};Fs.node;const Ni=De(Fs);/**
27
- * @license lucide-react v1.48.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 Us={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"}]]};Us.node;const Ai=De(Us);/**
32
- * @license lucide-react v1.48.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 zs={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"]};zs.node;const Hs=De(zs);/**
37
- * @license lucide-react v1.48.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 Os={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"}]]};Os.node;const Ii=De(Os);/**
42
- * @license lucide-react v1.48.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 Bs={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"}]]};Bs.node;const Pi=De(Bs);/**
47
- * @license lucide-react v1.48.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 Ws={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"}]]};Ws.node;const Vs=De(Ws);/**
52
- * @license lucide-react v1.48.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 qs={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]};qs.node;const pr=De(qs);/**
57
- * @license lucide-react v1.48.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 Ks={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"}]]};Ks.node;const Di=De(Ks);/**
62
- * @license lucide-react v1.48.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 Xs={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"}]]};Xs.node;const Mi=De(Xs);/**
67
- * @license lucide-react v1.48.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 Ys={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"}]]};Ys.node;const Li=De(Ys);/**
72
- * @license lucide-react v1.48.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 Gs={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"}]]};Gs.node;const Fr=De(Gs);/**
77
- * @license lucide-react v1.48.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 Qs={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"}]]};Qs.node;const $i=De(Qs);/**
82
- * @license lucide-react v1.48.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 Js={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"}]]};Js.node;const Fi=De(Js);/**
87
- * @license lucide-react v1.48.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 Zs={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"}]]};Zs.node;const Ui=De(Zs);/**
92
- * @license lucide-react v1.48.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 eo={name:"square",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]};eo.node;const zi=De(eo);/**
97
- * @license lucide-react v1.48.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 to={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"}]]};to.node;const Hi=De(to);/**
102
- * @license lucide-react v1.48.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 no={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"}]]};no.node;const Oi=De(no);/**
107
- * @license lucide-react v1.48.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 ro={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"}]]};ro.node;const Bi=De(ro);/**
112
- * @license lucide-react v1.48.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 so={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"}]]};so.node;const Wi=De(so);function Vi(n){const e=de.c(5),[t,s]=a.useState(null);let r,o;e[0]!==n?(r=()=>{n&&Ho(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 qi(n){const e=de.c(43);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,f]=a.useState(""),[p,m]=a.useState(void 0),[g,x]=a.useState(!1),[h,E]=a.useState("");let w;e[1]!==c||e[2]!==d?(w={sessionId:c,deviceId:d},e[1]=c,e[2]=d,e[3]=w):w=e[3];const T=a.useRef(w);let C,S;e[4]!==c||e[5]!==d?(C=()=>{T.current={sessionId:c,deviceId:d}},S=[c,d],e[4]=c,e[5]=d,e[6]=C,e[7]=S):(C=e[6],S=e[7]),a.useEffect(C,S);let j;e[8]===Symbol.for("react.memo_cache_sentinel")?(j=q=>{var se;if(q.type==="agents:listed"){r(q.sessions);const{deviceId:ue}=T.current,ge=ue?(se=q.sessions.flatMap(Ki).find(X=>X.id===ue))==null?void 0:se.formFactor:void 0;ge&&m(ge)}q.type==="session:joined"&&(x(!1),E("Connected")),q.type==="error"&&(x(!1),E(`Error: ${q.message}`))},e[8]=j):j=e[8];const A=j,{send:R,connected:k}=Es(A);let D,P;e[9]!==k||e[10]!==R?(D=()=>{if(!k)return;R({type:"agents:list"});const q=setInterval(()=>R({type:"agents:list"}),5e3);return()=>clearInterval(q)},P=[k,R],e[9]=k,e[10]=R,e[11]=D,e[12]=P):(D=e[11],P=e[12]),a.useEffect(D,P);let M,$;e[13]!==R?(M=()=>()=>{const{sessionId:q,deviceId:se}=T.current;q&&se&&R({type:"device:shutdown",sessionId:q,payload:{deviceId:se}})},$=[R],e[13]=R,e[14]=M,e[15]=$):(M=e[14],$=e[15]),a.useEffect(M,$);let W;if(e[16]!==n||e[17]!==s){let q;e[19]!==n?(q=se=>se.devices.some(ue=>ue.platform===n),e[19]=n,e[20]=q):q=e[20],W=s.filter(q),e[16]=n,e[17]=s,e[18]=W}else W=e[18];const U=W;let H;e[21]===Symbol.for("react.memo_cache_sentinel")?(H=q=>{m(q.formFactor),f(q.id),x(!0),E("Booting…"),u(q.sessionId)},e[21]=H):H=e[21];const Y=H;let V;e[22]===Symbol.for("react.memo_cache_sentinel")?(V=()=>f(""),e[22]=V):V=e[22];const re=V;let Q;e[23]!==R?(Q=()=>{const{sessionId:q,deviceId:se}=T.current;q&&se&&R({type:"device:shutdown",sessionId:q,payload:{deviceId:se}}),u(null),x(!1),E("")},e[23]=R,e[24]=Q):Q=e[24];const ee=Q;let K;e[25]!==R?(K=()=>{const{sessionId:q,deviceId:se}=T.current;q&&se&&R({type:"device:shutdown",sessionId:q,payload:{deviceId:se}}),u(null),l(null),x(!1),E(""),R({type:"agents:list"})},e[25]=R,e[26]=K):K=e[26];const O=K;let G;e[27]!==R?(G=()=>{u(null),l(null),x(!1),E(""),R({type:"agents:list"})},e[27]=R,e[28]=G):G=e[28];const ye=G;let me;return e[29]!==p||e[30]!==c||e[31]!==U||e[32]!==g||e[33]!==k||e[34]!==d||e[35]!==ee||e[36]!==O||e[37]!==ye||e[38]!==o||e[39]!==R||e[40]!==s||e[41]!==h?(me={sessions:s,activeFormFactor:p,selectedAgent:o,setSelectedAgent:l,activeSessionId:c,deviceId:d,booting:g,status:h,send:R,connected:k,agentGroups:U,startDevice:Y,resetDevice:re,handleBack:ee,handleBackToMacs:O,handleSessionEnded:ye},e[29]=p,e[30]=c,e[31]=U,e[32]=g,e[33]=k,e[34]=d,e[35]=ee,e[36]=O,e[37]=ye,e[38]=o,e[39]=R,e[40]=s,e[41]=h,e[42]=me):me=e[42],me}function Ki(n){return n.devices}function Xi(n,e){const t=de.c(24),[s,r]=a.useState(""),[o,l]=a.useState(""),[c,u]=a.useState("app-only"),[d,f]=a.useState("app-only");let p;t[0]!==(n==null?void 0:n.capabilities)?(p=(n==null?void 0:n.capabilities.includes("full-reset"))??!1,t[0]=n==null?void 0:n.capabilities,t[1]=p):p=t[1];const m=p;let g;t[2]!==m||t[3]!==c?(g=()=>{f(m?c:"app-only"),u("app-only")},t[2]=m,t[3]=c,t[4]=g):g=t[4];const x=g;let h,E,w;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(j=>j.platform===e))??[],E=[...new Set(h.map(Qi).filter(Boolean))].sort(Yi);let S;t[12]!==o?(S=j=>!o||j.name.toLowerCase().includes(o.toLowerCase()),t[12]=o,t[13]=S):S=t[13],w=(s?h.filter(j=>j.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]=w}else h=t[9],E=t[10],w=t[11];const T=w;let C;return t[14]!==d||t[15]!==x||t[16]!==o||t[17]!==h||t[18]!==m||t[19]!==s||t[20]!==E||t[21]!==c||t[22]!==T?(C={filteredDevices:h,osVersions:E,osVersion:s,setOsVersion:r,deviceSearch:o,setDeviceSearch:l,versionedDevices:T,resetMode:c,setResetMode:u,appliedResetMode:d,consumeResetMode:x,fullResetSupported:m},t[14]=d,t[15]=x,t[16]=o,t[17]=h,t[18]=m,t[19]=s,t[20]=E,t[21]=c,t[22]=T,t[23]=C):C=t[23],C}function Yi(n,e){const t=Gi,[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 Gi(n){return n.replace(/^[^\d]*/,"").split(".").map(Number)}function Qi(n){return n.osVersion}const Ji={width:324,height:720},us={width:540,height:720};function Zi(n,e){return n==="foldable"?us:n!=="tablet"?Ji:e==="android"?{width:720,height:450}:us}function el(){const n=de.c(8),[e]=Cs();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(tl)};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 f=s&&!r;let p;return n[5]!==s||n[6]!==f?(p={perfMode:s,visible:f},n[5]=s,n[6]=f,n[7]=p):p=n[7],p}function tl(n){return!n}function Xr(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 nl(n,e){return n.map(t=>{const s=Xr(t);if(t.onTop)return s;const r=(s.left+s.right)/2,o=(s.top+s.bottom)/2;switch(t.anchor){case"left":return{...s,left:0,right:r};case"right":return{...s,left:r,right:e.width};case"top":return{...s,top:0,bottom:o};case"bottom":return{...s,top:o,bottom:e.height};default:return s}})}const rl=12,sl=233,ol=234;function il(n,e,t,s){const r=n.map(m=>m.accessibilityTitle);if(s!=="tablet")return r;const o=m=>n.findIndex(g=>g.usagePage===rl&&g.usage===m),l=o(sl),c=o(ol);if(l<0||c<0)return r;const u=m=>{const g=Xr(m),x=(g.left+g.right)/2,h=(g.top+g.bottom)/2;return t?{x:h,y:e.width-x}:{x,y:h}},d=u(n[l]),f=u(n[c]);return(Math.abs(d.x-f.x)>Math.abs(d.y-f.y)?d.x>f.x:d.y<f.y)||([r[l],r[c]]=[r[c],r[l]]),r}const ll=["video/mp4;codecs=avc1","video/webm;codecs=vp9","video/webm;codecs=vp8","video/webm"];function oo({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([]),f=a.useRef(""),p=a.useRef(0),m=a.useRef(null),g=a.useCallback(function w(){var T;c.current&&((T=m.current)==null||T.call(m),p.current=requestAnimationFrame(w))},[]),x=a.useCallback(w=>{m.current=w},[]),h=a.useCallback(()=>{const w=o.current;if(!w)return;const T=w.getContext("2d");T&&(T.fillStyle="#000",T.fillRect(0,0,w.width,w.height));const C=ll.find(j=>MediaRecorder.isTypeSupported(j))??"";if(!C)return;f.current=C,d.current=[];const S=new MediaRecorder(w.captureStream(30),{mimeType:C});S.ondataavailable=j=>{j.data.size>0&&d.current.push(j.data)},u.current=S,S.start(1e3),c.current=!0,p.current=requestAnimationFrame(g),r("recording")},[g]),E=a.useCallback(async()=>{var A;r("uploading"),c.current=!1,cancelAnimationFrame(p.current);const w=u.current;if(!w){r("idle");return}await new Promise(R=>{const k=setTimeout(R,5e3);w.onstop=()=>{clearTimeout(k),R()};try{w.stop()}catch{clearTimeout(k),R()}}),u.current=null;const T=f.current,C=T.includes("mp4")?".mp4":".webm",S=new Blob(d.current,{type:T});d.current=[];const j=new FormData;j.append("file",S,`tapflow-${Date.now()}${C}`);try{const R=new URLSearchParams({sessionId:n});e&&R.set("buildId",String(e));const k=await fetch(`/api/v1/recordings/upload?${R}`,{method:"POST",credentials:"include",body:j}),D=await k.json();if(k.ok&&D.url){const P=document.createElement("a");P.href=D.url,P.download="",P.click(),(A=l.current)==null||A.call(l),r("done"),setTimeout(()=>r("idle"),2e3)}else r("idle")}catch{r("idle")}},[n,e]);return a.useEffect(()=>{if(s!=="recording")return;const w=()=>{document.visibilityState==="hidden"&&E()};return document.addEventListener("visibilitychange",w),()=>{var T;document.removeEventListener("visibilitychange",w),c.current&&(c.current=!1,cancelAnimationFrame(p.current),(T=u.current)==null||T.stop(),u.current=null)}},[s,E]),{recordState:s,recordCanvasRef:o,setComposeFrame:x,startClientRecording:h,stopClientRecording:E}}function io(){const n=de.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 fr(n){const e=de.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=Le("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 Br(n){const e=de.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=Le("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 wr(n){const e=de.c(7),{label:t,keys:s}=n;let r;e[0]!==s?(r=s.map(al),e[0]=s,e[1]=r):r=e[1];let o;e[2]!==r?(o=i.jsx(Br,{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 al(n){return i.jsx(fr,{children:n},n)}const fs="text-muted-foreground hover:text-muted-foreground",hs="text-destructive hover:text-destructive";function cl(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 dl({position:n,steerable:e,reason:t}){const s=t==="awaiting-app",r=!e&&t==="state-unconfirmed"?" animate-pulse":"",o=e?"":cl(t);switch(n){case"offline":return{Icon:Li,className:(e||s?"text-amber-500 hover:text-amber-500":hs)+r,status:`Device is offline.${o}`};case"online":return{Icon:Fr,className:(e||s?"":hs)+r,status:`Device is on the network.${o}`};case"waiting":return{Icon:Fr,className:`${fs} animate-pulse`,status:"Checking the network state."};case"unknown":return{Icon:Fr,className:fs,status:e?"No network state has been reported.":"tapflow could not read the network state — try again."}}}function ul({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=n==="unknown"&&!e&&t==="state-unconfirmed",l=t==="state-unconfirmed"||t==="unsupported-device";return e||!(r||o)||t==="awaiting-app"?s:l?`Retry: ${s.toLowerCase()}`:`${s} — unavailable`}function lo(n){var ft;const e=de.c(82),{joined:t,onScreenshot:s,onRecordToggle:r,recordState:o,onRotate:l,posture:c,onDeepLink:u,navigationSlot:d,deviceSlot:f,launchSlot:p,network:m,reboot:g}=n,x=a.useId(),h=a.useId(),E=a.useId(),w=a.useId(),[T,C]=a.useState(!1);if(!t)return null;let S;e[0]===Symbol.for("react.memo_cache_sentinel")?(S=i.jsx(Vs,{className:"h-4 w-4"}),e[0]=S):S=e[0];let j;e[1]!==u?(j=i.jsx(Mt,{asChild:!0,children:i.jsx(Ve,{variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":"Open a deeplink",onClick:u,children:S})}),e[1]=u,e[2]=j):j=e[2];let A;e[3]===Symbol.for("react.memo_cache_sentinel")?(A=i.jsx(Lt,{side:"left",children:i.jsx(wr,{label:"Deeplink",keys:["⌘","K"]})}),e[3]=A):A=e[3];let R;e[4]!==j?(R=i.jsxs(Dt,{children:[j,A]}),e[4]=j,e[5]=R):R=e[5];let k;e[6]!==p||e[7]!==d||e[8]!==R?(k=i.jsxs("div",{role:"group","aria-label":"Navigation",className:"flex flex-col items-center gap-0.5",children:[p,d,R]}),e[6]=p,e[7]=d,e[8]=R,e[9]=k):k=e[9];let D;e[10]===Symbol.for("react.memo_cache_sentinel")?(D=i.jsx("div",{role:"separator","aria-orientation":"horizontal",className:"w-4 h-px bg-border my-1"}),e[10]=D):D=e[10];let P;e[11]===Symbol.for("react.memo_cache_sentinel")?(P=i.jsx(Fi,{className:"h-4 w-4"}),e[11]=P):P=e[11];let M;e[12]!==l?(M=i.jsx(Mt,{asChild:!0,children:i.jsx(Ve,{variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":"Rotate the device",onClick:l,children:P})}),e[12]=l,e[13]=M):M=e[13];let $;e[14]===Symbol.for("react.memo_cache_sentinel")?($=i.jsx(Lt,{side:"left",children:i.jsx(wr,{label:"Rotate",keys:["⌘","⇧","O"]})}),e[14]=$):$=e[14];let W;e[15]!==M?(W=i.jsxs(Dt,{children:[M,$]}),e[15]=M,e[16]=W):W=e[16];let U;e[17]!==c||e[18]!==E?(U=c&&c.postures.length===2&&i.jsx("span",{id:E,role:"status","aria-live":"polite",className:"sr-only",children:c.pending?"Changing posture":((ft=c.postures.find(xe=>xe.id===c.currentId))==null?void 0:ft.label)??"Current posture unknown"}),e[17]=c,e[18]=E,e[19]=U):U=e[19];let H;e[20]!==c||e[21]!==E?(H=c&&c.postures.length===2&&(()=>{const xe=c.postures.findIndex(Ue=>Ue.id===c.currentId),te=xe===-1?null:c.postures[xe],Ae=c.postures[(xe+1)%2],qe=xe===0,Ke=qe?Hi:Ai,Ie=qe?"Unfold":"Fold",ve=te?`${Ie}: ${te.label} to ${Ae.label}`:`${Ie}: ${Ae.label}`,xt=Ue=>i.jsx(Ve,{variant:"ghost",size:"icon",className:"h-8 w-8 aria-disabled:opacity-50","aria-label":c.pending?`${ve} — changing`:ve,"aria-busy":c.pending,"aria-disabled":c.pending,"aria-describedby":E,onClick:()=>{c.pending||Ue==null||Ue()},children:c.pending?i.jsx(pr,{className:"h-4 w-4 animate-spin"}):i.jsx(Ke,{className:"h-4 w-4"})});return i.jsxs(Dt,{children:[i.jsx(Mt,{asChild:!0,children:xt(()=>c.onSelect(Ae.id))}),i.jsx(Lt,{side:"left",children:c.pending?`${ve} — changing`:ve})]})})(),e[20]=c,e[21]=E,e[22]=H):H=e[22];let Y;e[23]!==g||e[24]!==h?(Y=g&&(()=>{const xe=g.pending?"Restarting the device":"Restart the device";return i.jsxs(i.Fragment,{children:[i.jsxs(Dt,{children:[i.jsx(Mt,{asChild:!0,children:i.jsx(Ve,{ref:g.buttonRef,variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":xe,"aria-busy":g.pending,"aria-disabled":g.pending,"aria-describedby":h,onClick:()=>{g.pending||C(!0)},children:g.pending?i.jsx(pr,{className:"h-4 w-4 animate-spin"}):i.jsx($i,{className:"h-4 w-4"})})}),i.jsx(Lt,{side:"left",children:xe})]}),i.jsx("span",{id:h,role:"status",className:"sr-only",children:g.pending?"Restarting the device.":""})]})})(),e[23]=g,e[24]=h,e[25]=Y):Y=e[25];let V;e[26]!==f||e[27]!==W||e[28]!==U||e[29]!==H||e[30]!==Y?(V=i.jsxs("div",{role:"group","aria-label":"Device",className:"flex flex-col items-center gap-0.5",children:[f,W,U,H,Y]}),e[26]=f,e[27]=W,e[28]=U,e[29]=H,e[30]=Y,e[31]=V):V=e[31];let re;e[32]===Symbol.for("react.memo_cache_sentinel")?(re=i.jsx("div",{role:"separator","aria-orientation":"horizontal",className:"w-4 h-px bg-border my-1"}),e[32]=re):re=e[32];let Q;e[33]===Symbol.for("react.memo_cache_sentinel")?(Q=i.jsx(Ci,{className:"h-4 w-4"}),e[33]=Q):Q=e[33];let ee;e[34]!==s?(ee=i.jsx(Mt,{asChild:!0,children:i.jsx(Ve,{variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":"Take a screenshot",onClick:s,children:Q})}),e[34]=s,e[35]=ee):ee=e[35];let K;e[36]===Symbol.for("react.memo_cache_sentinel")?(K=i.jsx(Lt,{side:"left",children:i.jsx(wr,{label:"Screenshot",keys:["⌘","S"]})}),e[36]=K):K=e[36];let O;e[37]!==ee?(O=i.jsxs(Dt,{children:[ee,K]}),e[37]=ee,e[38]=O):O=e[38];const G=o==="recording"&&"text-red-500 hover:text-red-500";let ye;e[39]!==G?(ye=Le("h-8 w-8 aria-disabled:opacity-50",G),e[39]=G,e[40]=ye):ye=e[40];const me=o==="recording"?"Stop recording":o==="uploading"?"Processing the recording":o==="done"?"Recording saved":"Start recording",q=o==="uploading",se=o==="uploading"||o==="done";let ue;e[41]!==r||e[42]!==o?(ue=()=>{(o==="idle"||o==="recording")&&r()},e[41]=r,e[42]=o,e[43]=ue):ue=e[43];let ge;e[44]!==o?(ge=o==="uploading"?i.jsx(pr,{className:"h-4 w-4 animate-spin"}):o==="recording"?i.jsx(zi,{className:"h-4 w-4 fill-current"}):i.jsx(Oi,{className:"h-4 w-4"}),e[44]=o,e[45]=ge):ge=e[45];let X;e[46]!==w||e[47]!==ye||e[48]!==me||e[49]!==q||e[50]!==se||e[51]!==ue||e[52]!==ge?(X=i.jsx(Mt,{asChild:!0,children:i.jsx(Ve,{variant:"ghost",size:"icon",className:ye,"aria-label":me,"aria-busy":q,"aria-disabled":se,"aria-describedby":w,onClick:ue,children:ge})}),e[46]=w,e[47]=ye,e[48]=me,e[49]=q,e[50]=se,e[51]=ue,e[52]=ge,e[53]=X):X=e[53];let he;e[54]!==o?(he=o==="idle"?i.jsx(wr,{label:"Start recording",keys:["⌘","⇧","Y"]}):o==="recording"?i.jsx(wr,{label:"Stop recording",keys:["⌘","⇧","Y"]}):o==="done"?"Recording saved":"Processing the recording",e[54]=o,e[55]=he):he=e[55];let Te;e[56]!==he?(Te=i.jsx(Lt,{side:"left",children:he}),e[56]=he,e[57]=Te):Te=e[57];let oe;e[58]!==X||e[59]!==Te?(oe=i.jsxs(Dt,{children:[X,Te]}),e[58]=X,e[59]=Te,e[60]=oe):oe=e[60];const rt=o==="recording"?"Recording.":o==="uploading"?"Processing the recording.":o==="done"?"Recording saved.":"";let z;e[61]!==w||e[62]!==rt?(z=i.jsx("span",{id:w,role:"status",className:"sr-only",children:rt}),e[61]=w,e[62]=rt,e[63]=z):z=e[63];let J;e[64]!==O||e[65]!==oe||e[66]!==z?(J=i.jsxs("div",{role:"group","aria-label":"Capture",className:"flex flex-col items-center gap-0.5",children:[O,oe,z]}),e[64]=O,e[65]=oe,e[66]=z,e[67]=J):J=e[67];let be;e[68]!==x||e[69]!==m?(be=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:xe,className:te,status:Ae}=dl(m),qe=ul(m),Ke=m.position==="waiting"||m.position==="unknown"||!m.steerable;return i.jsxs(Dt,{children:[i.jsx(Mt,{asChild:!0,children:i.jsx(Ve,{variant:"ghost",size:"icon",className:Le("h-8 w-8",te),"aria-label":qe,"aria-busy":m.pending,"aria-disabled":m.pending,"aria-describedby":x,onClick:()=>{m.pending||m.onToggle()},children:m.pending?i.jsx(pr,{className:"h-4 w-4 animate-spin"}):i.jsx(xe,{className:"h-4 w-4"})})}),i.jsx("span",{id:x,role:"status",className:"sr-only",children:m.pending?"Changing the network state.":Ae}),i.jsx(Lt,{side:"left",children:Ke?`${qe} — ${Ae}`:qe})]})})()})]}),e[68]=x,e[69]=m,e[70]=be):be=e[70];let Ne;e[71]!==V||e[72]!==J||e[73]!==be||e[74]!==k?(Ne=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:[k,D,V,re,J,be]}),e[71]=V,e[72]=J,e[73]=be,e[74]=k,e[75]=Ne):Ne=e[75];let Me;e[76]!==T||e[77]!==g?(Me=g&&i.jsx(oi,{open:T,onOpenChange:C,children:i.jsxs(ii,{children:[i.jsxs(li,{children:[i.jsx(ai,{children:"Restart this device?"}),i.jsx(ci,{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(di,{children:[i.jsx(ui,{children:"Cancel"}),i.jsx(fi,{onClick:()=>{C(!1),g.onReboot()},children:"Restart"})]})]})}),e[76]=T,e[77]=g,e[78]=Me):Me=e[78];let ut;return e[79]!==Ne||e[80]!==Me?(ut=i.jsxs(Or,{delayDuration:400,children:[Ne,Me]}),e[79]=Ne,e[80]=Me,e[81]=ut):ut=e[81],ut}const fl=3e3,hl=8e3;function ao(n){const e=de.c(40),{sessionId:t,send:s,supported:r,deviceReady:o,handlerRef:l,onError:c}=n,[u,d]=a.useState("waiting"),[f,p]=a.useState(!0),[m,g]=a.useState(void 0),x=a.useRef(void 0),[h,E]=a.useState(!1),w=a.useRef(null);let T;e[0]===Symbol.for("react.memo_cache_sentinel")?(T=new Set,e[0]=T):T=e[0];const C=a.useRef(T),S=a.useRef(c);let j,A;e[1]!==c?(j=()=>{S.current=c},A=[c],e[1]=c,e[2]=j,e[3]=A):(j=e[2],A=e[3]),a.useEffect(j,A);const R=a.useRef(o);let k,D;e[4]!==o?(k=()=>{R.current=o},D=[o],e[4]=o,e[5]=k,e[6]=D):(k=e[5],D=e[6]),a.useEffect(k,D);const P=a.useRef(o),[M,$]=a.useState(t);M!==t&&($(t),d("waiting"),p(!0),g(void 0),E(!1));let W;e[7]===Symbol.for("react.memo_cache_sentinel")?(W=()=>{x.current=void 0,w.current=null,P.current=R.current,C.current.clear()},e[7]=W):W=e[7];let U;e[8]!==t?(U=[t],e[8]=t,e[9]=U):U=e[9],a.useEffect(W,U);let H,Y;e[10]!==o?(H=()=>{var X;if(o){P.current=!0,d("waiting");return}d(P.current?"unknown":"waiting"),p(!0),g(void 0),x.current=void 0,w.current&&((X=S.current)==null||X.call(S,"The device became unavailable before it answered. Its network state is unchanged as far as tapflow can tell."),C.current.add(w.current)),E(!1),w.current=null},Y=[o],e[10]=o,e[11]=H,e[12]=Y):(H=e[11],Y=e[12]),a.useEffect(H,Y);let V,re;e[13]!==l||e[14]!==r?(V=()=>{if(r)return l.current=X=>{var Te,oe;if(X.type==="network:error"){X.requestId===w.current&&(w.current=null,E(!1),(Te=S.current)==null||Te.call(S,X.message));return}if(X.type!=="network:state"||!R.current||X.requestId!==void 0&&C.current.has(X.requestId))return;const he=X.payload.available?void 0:X.payload.reason;d(X.payload.offline===void 0?"unknown":X.payload.offline?"offline":"online"),p(X.payload.available),g(he),he==="enforcement-lost"&&x.current!=="enforcement-lost"&&((oe=S.current)==null||oe.call(S,"The device went back on the network before you took it off. Anything checked while it was offline needs checking again.")),x.current=he,X.requestId!==void 0&&X.requestId===w.current&&(w.current=null,E(!1))},()=>{l.current=void 0}},re=[l,r],e[13]=l,e[14]=r,e[15]=V,e[16]=re):(V=e[15],re=e[16]),a.useEffect(V,re);let Q,ee;e[17]!==o||e[18]!==u||e[19]!==r?(Q=()=>{if(!r||!o||u!=="waiting")return;const X=setTimeout(()=>d(pl),fl);return()=>clearTimeout(X)},ee=[r,o,u],e[17]=o,e[18]=u,e[19]=r,e[20]=Q,e[21]=ee):(Q=e[20],ee=e[21]),a.useEffect(Q,ee);let K;e[22]!==h||e[23]!==u||e[24]!==s||e[25]!==t||e[26]!==r?(K=()=>{if(!r||h)return;const X=_e();w.current=X,E(!0),s({type:"network:set",sessionId:t,requestId:X,payload:{offline:u!=="offline"}})},e[22]=h,e[23]=u,e[24]=s,e[25]=t,e[26]=r,e[27]=K):K=e[27];const O=K,[G,ye]=a.useState(null);let me,q;e[28]!==h?(me=()=>{ye(h?w.current:null)},q=[h],e[28]=h,e[29]=me,e[30]=q):(me=e[29],q=e[30]),a.useEffect(me,q);let se,ue;e[31]!==G?(se=()=>{if(G===null)return;const X=setTimeout(()=>{var he;w.current===G&&(w.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."))},hl);return()=>clearTimeout(X)},ue=[G],e[31]=G,e[32]=se,e[33]=ue):(se=e[32],ue=e[33]),a.useEffect(se,ue);let ge;return e[34]!==h||e[35]!==u||e[36]!==m||e[37]!==f||e[38]!==O?(ge={position:u,steerable:f,reason:m,pending:h,toggle:O},e[34]=h,e[35]=u,e[36]=m,e[37]=f,e[38]=O,e[39]=ge):ge=e[39],ge}function pl(n){return n==="waiting"?"unknown":n}class Wr{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 ml{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 co(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 gl(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 bl=new Set([100,110,122,244,44,83,86,118,128,138,139,134,135]);function ps(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 uo(n){const e=n.bits(8);n.bits(8);const t=n.bits(8);if(n.ue(),bl.has(e)){const p=n.ue();if(p===3&&n.flag(),n.ue(),n.ue(),n.flag(),n.flag()){const m=p!==3?8:12;for(let g=0;g<m;g++)if(n.flag()){const x=g<6?16:64;let h=8,E=8;for(let w=0;w<x;w++)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 p=n.ue();for(let m=0;m<p;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&&ps(n);const u=n.flag();u&&ps(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 xl(n){const e=uo(new Wr(co(n)));return{profileIdc:e.profileIdc,levelIdc:e.levelIdc,vuiPresent:e.vuiPresent,bitstreamRestriction:e.bitstreamRestriction,maxNumReorderFrames:e.maxNumReorderFrames,maxDecFrameBuffering:e.maxDecFrameBuffering}}function yl(n){const e=co(n),t=uo(new Wr(e));if(!t.vuiPresent||t.restrictionFlagPos<0||t.bitstreamRestriction)return null;const s=new ml,r=new Wr(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],...gl(s.toBytes())])}function wl(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 vl{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 wl(new Uint8Array(e))){const f=d[0]&31;if(f===7){const p=!this.sps||d.length!==this.sps.length||d.some((m,g)=>m!==this.sps[g]);this.sps=d,p&&this.decoder&&(this.decoder.close(),this.decoder=null)}else f===8?this.pps=d:f>=1&&f<=5&&(f===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(xl(e)))}catch(t){console.warn("[sps-vui] parse failed",t)}}}initDecoder(e,t){this.logSpsVui(e);const s=yl(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 Sl=`#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
- }`,Rl=`#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 _l(n){const e=n.getContext("webgl2",{alpha:!1,antialias:!1,powerPreference:"high-performance",preserveDrawingBuffer:!0});if(!e)return null;const t=(f,p)=>{const m=e.createShader(f);return e.shaderSource(m,p),e.compileShader(m),m},s=e.createProgram(),r=t(e.VERTEX_SHADER,Sl),o=t(e.FRAGMENT_SHADER,Rl);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 kl{constructor(e){this.canvas=e,this.state=null}init(){return this.state=_l(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 jl(n){const e=new kl(n);return e.init(),e}class El{constructor(e=jl){this._size=null,this.canvas=document.createElement("canvas"),this.renderer=e(this.canvas),this.core=new vl(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 Cl=`#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
- }`,Tl=`#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 Ur(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 Nl(n){const e=n.getContext("webgl2",{alpha:!1,antialias:!1,powerPreference:"high-performance",preserveDrawingBuffer:!0});if(!e)return null;const t=(m,g)=>{const x=e.createShader(m);return e.shaderSource(x,g),e.compileShader(x),x},s=e.createProgram(),r=t(e.VERTEX_SHADER,Cl),o=t(e.FRAGMENT_SHADER,Tl);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=Ur(e,0,"u_texY",s),f=Ur(e,1,"u_texU",s),p=Ur(e,2,"u_texV",s);return{gl:e,program:s,texY:d,texU:f,texV:p,vao:l}}class Al{constructor(e){this.canvas=e,this.state=null}init(){return this.state=Nl(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,f=e.subarray(0,u),p=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=(x,h,E,w,T)=>{o.activeTexture(o.TEXTURE0+x),o.bindTexture(o.TEXTURE_2D,h),o.texImage2D(o.TEXTURE_2D,0,o.R8,E,w,0,o.RED,o.UNSIGNED_BYTE,T)};return g(0,r.texY,t,s,f),g(1,r.texU,l,c,p),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 Il=0;function Pl(n){const e=new Al(n);return e.init(),e}function Dl(){return new Worker(new URL("/assets/tinyh264.worker-DiJ50Hai.js",import.meta.url),{type:"module"})}class Ml{constructor(e=Pl,t=Dl){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:Il},[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 Yr(){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 Ll(n=Yr()){return n.secureContext&&n.webCodecs&&n.webgl2?new El:n.wasm&&n.webgl2?new Ml:null}function $l(n=Yr()){return n.secureContext&&n.webCodecs&&n.webgl2||n.wasm&&n.webgl2}function Fl(n=Yr()){return n.secureContext&&n.webCodecs&&n.webgl2?"high":n.wasm&&n.webgl2?"standard":"unsupported"}const Ul="https://www.tapflow.dev/operate/https#pick-a-method";function zl(n){const e=de.c(9),{open:t,onOpenChange:s}=n;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(Ts,{children:"Streaming in Standard mode"}),e[0]=r):r=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsxs(hi,{children:[r,i.jsxs(pi,{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(Ve,{variant:"outline",onClick:Hl,children:"How to enable"}),e[2]=l):l=e[2];let c;e[3]!==s?(c=i.jsxs(Ns,{className:"sm:max-w-[440px]",children:[o,i.jsxs(mi,{children:[l,i.jsx(Ve,{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(As,{open:t,onOpenChange:s,children:c}),e[5]=s,e[6]=t,e[7]=c,e[8]=u):u=e[8],u}function Hl(){return window.open(Ul,"_blank","noopener,noreferrer")}const ms="tapflow.perfModeNoticeDismissed";function Ol(n,e){return n==="standard"&&!e}const Bl={high:"Smooth",standard:"Standard",unsupported:null};function Wl(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 Gr(n){const e=de.c(37),{joined:t,fps:s,keyboardActive:r}=n;let o;e[0]!==n?(o=Wl(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 f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=Fl(),e[2]=f):f=e[2];const p=f,m=Bl[p];let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{let Q=!1;try{Q=localStorage.getItem(ms)==="1"}catch{}return Ol(p,Q)},e[3]=g):g=e[3];const[x,h]=a.useState(g);let E;e[4]===Symbol.for("react.memo_cache_sentinel")?(E=Q=>{if(h(Q),!Q)try{localStorage.setItem(ms,"1")}catch{}},e[4]=E):E=e[4];const w=E,T=r?"text-emerald-500":"text-muted-foreground";let C;e[5]!==T?(C=Le("flex items-center",T),e[5]=T,e[6]=C):C=e[6];let S,j,A,R;e[7]===Symbol.for("react.memo_cache_sentinel")?(S={gap:6},j=i.jsx(Ui,{className:"h-3.5 w-3.5 shrink-0"}),A=i.jsx("span",{className:"text-[12px] font-medium",children:"Focus"}),R=i.jsx("span",{"aria-hidden":"true",className:"text-[11px] text-muted-foreground/60",children:"·"}),e[7]=S,e[8]=j,e[9]=A,e[10]=R):(S=e[7],j=e[8],A=e[9],R=e[10]);const k=r?"text-emerald-500":"text-muted-foreground/60";let D;e[11]!==k?(D=Le("text-[11px]",k),e[11]=k,e[12]=D):D=e[12];const P=r?"On":"Off";let M;e[13]!==D||e[14]!==P?(M=i.jsx("span",{className:D,children:P}),e[13]=D,e[14]=P,e[15]=M):M=e[15];let $;e[16]!==M||e[17]!==C?($=i.jsxs("div",{className:C,style:S,children:[j,A,R,M]}),e[16]=M,e[17]=C,e[18]=$):$=e[18];let W;e[19]!==u||e[20]!==s||e[21]!==c||e[22]!==t||e[23]!==d?(W=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:Le("text-[11px]",c?"text-emerald-500":"text-muted-foreground/60"),children:d})]}),m&&i.jsxs(i.Fragment,{children:[i.jsx(Rs,{orientation:"vertical",className:"h-3"}),p==="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[19]=u,e[20]=s,e[21]=c,e[22]=t,e[23]=d,e[24]=W):W=e[24];const U=l?void 0:"sr-only";let H;e[25]!==l?(H=l&&i.jsx("p",{className:"text-[12px] text-muted-foreground leading-relaxed break-words",children:l}),e[25]=l,e[26]=H):H=e[26];let Y;e[27]!==U||e[28]!==H?(Y=i.jsx("div",{role:"status",className:U,children:H}),e[27]=U,e[28]=H,e[29]=Y):Y=e[29];let V;e[30]!==x?(V=i.jsx(zl,{open:x,onOpenChange:w}),e[30]=x,e[31]=V):V=e[31];let re;return e[32]!==$||e[33]!==W||e[34]!==Y||e[35]!==V?(re=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:[$,W,Y,V]}),e[32]=$,e[33]=W,e[34]=Y,e[35]=V,e[36]=re):re=e[36],re}function fo(n){const e=de.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(Vl));let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(Ts,{className:"sr-only",children:"Open Deeplink"}),e[0]=d):d=e[0];let f;e[1]!==s?(f=()=>s(!1),e[1]=s,e[2]=f):f=e[2];let p;e[3]!==r||e[4]!==o||e[5]!==f?(p=i.jsxs(Ns,{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(ql,{openUrl:r,close:f},o)]}),e[3]=r,e[4]=o,e[5]=f,e[6]=p):p=e[6];let m;return e[7]!==s||e[8]!==t||e[9]!==p?(m=i.jsx(As,{open:t,onOpenChange:s,children:p}),e[7]=s,e[8]=t,e[9]=p,e[10]=m):m=e[10],m}function Vl(n){return n+1}function ql(n){const e=de.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 C=setTimeout(()=>{var S;return(S=l.current)==null?void 0:S.focus()},0);return()=>clearTimeout(C)},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 f=d;let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsx(vi,{className:"h-4 w-4 text-muted-foreground shrink-0","aria-hidden":"true"}),e[6]=p):p=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=C=>o(C.target.value),e[7]=m):m=e[7];let g;e[8]!==f?(g=C=>{C.key==="Enter"&&f()},e[8]=f,e[9]=g):g=e[9];let x;e[10]!==g||e[11]!==r?(x=i.jsxs("div",{className:"flex-1 h-[32px] flex items-center gap-2 pl-[4px] pb-[1px]",children:[p,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]=x):x=e[12];let h;e[13]!==r?(h=r.trim(),e[13]=r,e[14]=h):h=e[14];const E=!h;let w;e[15]!==f||e[16]!==E?(w=i.jsx(Ve,{size:"sm",disabled:E,onClick:f,className:"shrink-0 rounded-xl h-8 px-4",children:"Open"}),e[15]=f,e[16]=E,e[17]=w):w=e[17];let T;return e[18]!==w||e[19]!==x?(T=i.jsx(i.Fragment,{children:i.jsxs("div",{className:"flex items-center gap-3",children:[x,w]})}),e[18]=w,e[19]=x,e[20]=T):T=e[20],T}function Kl(n,e,t,s,r,o){const{x:l,y:c,width:u,height:d}=r;let f,p;if(o){const m=(n.x-e.left)/e.width;f=(1-(n.y-e.top)/e.height)*t,p=m*s}else f=(n.x-e.left)*(t/e.width),p=(n.y-e.top)*(s/e.height);return f<l||f>l+u||p<c||p>c+d?null:{x:(f-l)/u,y:(p-c)/d}}function Xl(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 ho(n){return{f0:{x:1-n.x,y:1-n.y},f1:n}}function Yl(n,e){return n>0?Math.min(1,e/n):1}function Gl(n,e){return(n+(e?90:0))%360}function _r(n,e,t){const s=t===90||t===270;return{width:s?e:n,height:s?n:e}}function Ql(n,e,t,s,r){const{width:o,height:l}=_r(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 Jl(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 Zl(n,e,t,s){const{width:r,height:o}=_r(n,e,s);return{width:r,height:o,turn:(t-s+360)%360}}function ea(n){return!n.ready||n.rotating?!1:n.aspectAgrees||!n.frameIsAhead}function ta(n,e,t){if(!n||!e)return!0;const{width:s,height:r}=_r(n.width,n.height,t);return Math.abs(s/r-e.width/e.height)<.05}function na(n,e){return Math.max(0,n-e)}const Vr=22,gs=[84,70,70,69],ra=1,sa=0,Lr=1,po=2,oa=1,ia=2,la=4;function aa(n){if(n.byteLength<Vr)return null;const e=new DataView(n);for(let r=0;r<gs.length;r++)if(e.getUint8(r)!==gs[r])return null;if(e.getUint8(4)!==ra)return null;const t=e.getUint8(5),s=t&la?po:t&oa?Lr:sa;return{capturedAt:Number(e.getBigUint64(6)),relayedAt:Number(e.getBigUint64(14)),codec:s,keyframe:s===Lr&&(t&ia)!==0}}function mo(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 f=Ll();return f?(o=f,f.onResize(p=>r.current.onResize(p)),u=r.current.onDecoderReady(f),f):(l=!0,r.current.onUnsupported(),console.warn("[decoder] none available — set up HTTPS or use a supported browser"),null)};return e.current=(f,p)=>{const m=r.current.onJpegFrame;if(m&&(p==null?void 0:p.codec)!==Lr){m(f,p);return}const g=d();if(g){if(!c){if(!(p!=null&&p.keyframe))return;c=!0}g.decode(f),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 ca=3e3+5*300,da=ca+500,Ar=8;function ua(){var n;return window.isSecureContext&&typeof ClipboardItem<"u"&&!!((n=navigator.clipboard)!=null&&n.write)}class vr extends Error{}function fa(n){const e=n.then(t=>new Blob([t],{type:"text/plain"}));return navigator.clipboard.write([new ClipboardItem({"text/plain":e})])}function Qr(n){return!(n.metaKey||n.ctrlKey)||n.altKey?!1:n.code==="KeyV"?!0:!n.shiftKey&&(n.code==="KeyC"||n.code==="KeyX")}const ha=1024*1024,pa=n=>new TextEncoder().encode(n).length,ma=n=>{var e;return!!((e=n.payload)!=null&&e.unsupported)},ga=n=>{var e,t;return((e=n.payload)==null?void 0:e.sentinelParked)===!1||((t=n.payload)==null?void 0:t.unsupported)===!0};function ba(){const n=window.getSelection();return!!n&&!n.isCollapsed&&n.toString().length>0}function bs(){const n=document.activeElement;return!!n&&(n.tagName==="INPUT"||n.tagName==="TEXTAREA"||n.isContentEditable)}function go(n){const e=de.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 f=a.useRef(d),p=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 x;e[3]===Symbol.for("react.memo_cache_sentinel")?(x=A=>{var R;p.current!==A&&(p.current=A,(R=m.current)==null||R.call(m,A))},e[3]=x):x=e[3];const h=x;let E,w;e[4]!==l?(E=()=>(l.current=A=>{if(!A.requestId)return;const R=f.current.get(A.requestId);R&&(f.current.delete(A.requestId),R(A))},()=>{l.current=void 0}),w=[l],e[4]=l,e[5]=E,e[6]=w):(E=e[5],w=e[6]),a.useEffect(E,w);let T;e[7]!==s||e[8]!==t?(T=(...A)=>{const[R,k]=A,D=_e();return new Promise(P=>{const M=setTimeout(()=>{f.current.delete(D),P(null)},da);f.current.set(D,$=>{clearTimeout(M),P($)}),s({type:R,sessionId:t,requestId:D,payload:k})})},e[7]=s,e[8]=t,e[9]=T):T=e[9];const C=T;let S,j;e[10]!==r||e[11]!==C||e[12]!==c||e[13]!==o?(S=()=>{if(!r||!o)return;const A=async k=>{if(k.code==="KeyV"||!Qr(k))return;const D=k.code==="KeyX";if(bs()||ba()||(k.preventDefault(),k.repeat))return;if(!ua()){c(D?"KeyX":"KeyC",Ar),h("Copied on the device. Serving the dashboard over HTTPS also brings it to your clipboard.");return}let P,M;const $=new Promise((Y,V)=>{P=Y,M=V});$.catch(xa);const W=fa($).catch(Y=>{Y instanceof vr||h(Y instanceof Error&&Y.name==="NotAllowedError"?"Your browser blocked the clipboard write":"Could not write to your clipboard")}),U=await C("clipboard:read",{press:D?"cut":"copy"});if(!U){M(new vr("timeout")),h("The device is taking too long — try again");return}if(U.type==="clipboard:error"){M(new vr(U.message||"read failed")),h(U.message||"Clipboard read failed"),ga(U)&&c(D?"KeyX":"KeyC",Ar);return}if(U.type!=="clipboard:data"){M(new vr("unexpected reply")),h("Clipboard read failed");return}const{text:H}=U.payload;if(p.current=null,!H){M(new vr("empty"));return}P(H),await W},R=k=>{var P;if(bs())return;const D=((P=k.clipboardData)==null?void 0:P.getData("text"))??"";if(k.preventDefault(),!D){c("KeyV",Ar);return}if(pa(D)>ha){h("That text is too large to send to the device");return}C("clipboard:write",{text:D,pasteAfter:!0}).then(M=>{if(!M){h("The device is taking too long — try again");return}if(M.type==="clipboard:write-done"){p.current=null;return}if(M.type!=="clipboard:error"){h("Clipboard write failed");return}h(M.message||"Clipboard write failed"),ma(M)&&c("KeyV",Ar)})};return document.addEventListener("keydown",A),document.addEventListener("paste",R),()=>{document.removeEventListener("keydown",A),document.removeEventListener("paste",R)}},j=[r,o,C,c,h],e[10]=r,e[11]=C,e[12]=c,e[13]=o,e[14]=S,e[15]=j):(S=e[14],j=e[15]),a.useEffect(S,j)}function xa(){}function ya(n){return n.includes("Firefox/")&&n.includes("Macintosh")?"linear-gradient(#fff,#fff)":void 0}const En=13,dr=8,xs=16,wa=.02;function va(n){const e=de.c(283),{sessionId:t,buildId:s,send:r,openUrl:o,launchApp:l,connected:c,joined:u,deviceReady:d,installing:f,installed:p,installError:m,bootError:g,launching:x,chrome:h,formFactor:E,binaryFrameHandlerRef:w,clipboardHandlerRef:T,clipboardSupported:C,networkHandlerRef:S,networkSupported:j,onRecordingUploaded:A,swKeyboardVisible:R,swKeyboardPending:k,onKbdToggle:D,rebootPending:P,onReboot:M,restartButtonRef:$,perfHookRef:W}=n,U=a.useRef(null),H=a.useRef(null),Y=a.useRef(null),{fps:V,frameCount:re}=io(),Q=a.useRef(0);let ee;e[0]!==s||e[1]!==A||e[2]!==t?(ee={sessionId:t,buildId:s,onRecordingUploaded:A},e[0]=s,e[1]=A,e[2]=t,e[3]=ee):ee=e[3];const{recordState:K,recordCanvasRef:O,setComposeFrame:G,startClientRecording:ye,stopClientRecording:me}=oo(ee),q=a.useRef(0),[se,ue]=a.useState(!1),[ge,X]=a.useState(!1),[he,Te]=a.useState(!1),[oe,rt]=a.useState(!1),[z,J]=a.useState(!1),[be,Ne]=a.useState(null),[Me,ut]=a.useState(null),[ft,xe]=a.useState(!1),[te,Ae]=a.useState(null),qe=a.useRef(te);let Ke,Ie;e[4]!==te?(Ke=()=>{qe.current=te},Ie=[te],e[4]=te,e[5]=Ke,e[6]=Ie):(Ke=e[5],Ie=e[6]),a.useEffect(Ke,Ie);const ve=a.useRef(null);let xt;e[7]===Symbol.for("react.memo_cache_sentinel")?(xt=new Set,e[7]=xt):xt=e[7];const Ue=a.useRef(xt),ze=a.useRef(null);let Xe,ht;e[8]===Symbol.for("react.memo_cache_sentinel")?(Xe=()=>()=>{ze.current&&clearTimeout(ze.current)},ht=[],e[8]=Xe,e[9]=ht):(Xe=e[8],ht=e[9]),a.useEffect(Xe,ht);const pt=a.useRef(null),Oe=a.useRef(!1),Qe=a.useRef(!1),we=a.useRef(0),ke=a.useRef(null),Je=a.useRef(null),Ze=a.useRef("idle"),mt=a.useRef(null),Ye=a.useRef(null),Pe=a.useRef(null);let Yt,Be;e[10]!==h?(Yt=()=>{Pe.current=h},Be=[h],e[10]=h,e[11]=Yt,e[12]=Be):(Yt=e[11],Be=e[12]),a.useEffect(Yt,Be);let sn,st;e[13]!==h.framePng?(st=()=>{const y=new Image;y.onload=()=>{Ye.current=y},y.src=`data:image/png;base64,${h.framePng}`},sn=[h.framePng],e[13]=h.framePng,e[14]=sn,e[15]=st):(sn=e[14],st=e[15]),a.useEffect(st,sn);let $e;e[16]===Symbol.for("react.memo_cache_sentinel")?($e=()=>Te(!0),e[16]=$e):$e=e[16];let gt;e[17]!==O?(gt=y=>{const b=U.current;if(b&&(b.width!==y.width||b.height!==y.height)&&(b.width=y.width,b.height=y.height,!Pe.current)){const v=O.current;v&&(v.width=y.width,v.height=y.height)}X(!0)},e[17]=O,e[18]=gt):gt=e[18];let Gt;e[19]===Symbol.for("react.memo_cache_sentinel")?(Gt=y=>{var L;const b=y.surface,v=U.current;b.style.position="absolute",v&&(b.style.left=v.style.left,b.style.top=v.style.top,b.style.width=v.style.width,b.style.height=v.style.height,b.style.borderRadius=v.style.borderRadius,b.style.maskImage=v.style.maskImage),b.style.objectFit="fill",b.style.zIndex="3",b.style.pointerEvents="none",(L=H.current)==null||L.appendChild(b);let Z=null;const fe=()=>{const pe=U.current,le=pe==null?void 0:pe.getContext("2d");if(pe&&le&&y.size)try{le.drawImage(y.surface,0,0,pe.width,pe.height)}catch{}Z=requestAnimationFrame(fe)};return Z=requestAnimationFrame(fe),()=>{Z!==null&&cancelAnimationFrame(Z)}},e[19]=Gt):Gt=e[19];let yt;e[20]!==re||e[21]!==W||e[22]!==O?(yt=y=>{const b=performance.now();Q.current&&b-Q.current,Q.current=b;const v=q.current;createImageBitmap(new Blob([y],{type:"image/jpeg"})).then(Z=>{if(performance.now()-b,q.current!==v){Z.close();return}const fe=U.current,L=fe==null?void 0:fe.getContext("2d");if(!fe||!L){Z.close();return}if((fe.width!==Z.width||fe.height!==Z.height)&&(fe.width=Z.width,fe.height=Z.height,!Pe.current)){const le=O.current;le&&(le.width=Z.width,le.height=Z.height)}const pe=performance.now();L.drawImage(Z,0,0),performance.now()-pe,Z.close(),X(!0),re.current=re.current+1}).catch(ka)},e[20]=re,e[21]=W,e[22]=O,e[23]=yt):yt=e[23];let wt;e[24]!==w||e[25]!==re||e[26]!==W||e[27]!==gt||e[28]!==yt?(wt={binaryFrameHandlerRef:w,perfHookRef:W,frameCount:re,onUnsupported:$e,onResize:gt,onDecoderReady:Gt,onJpegFrame:yt},e[24]=w,e[25]=re,e[26]=W,e[27]=gt,e[28]=yt,e[29]=wt):wt=e[29],mo(wt);let vt;e[30]!==O?(vt=()=>{const y=O.current,b=H.current;y&&b&&(y.width=b.clientWidth,y.height=b.clientHeight)},e[30]=O,e[31]=vt):vt=e[31];let ot;e[32]!==h||e[33]!==O?(ot=[h,O],e[32]=h,e[33]=O,e[34]=ot):ot=e[34],a.useEffect(vt,ot);let St;e[35]!==O?(St=()=>{const y=O.current,b=U.current;if(!y||!b)return;const v=y.getContext("2d");if(!v)return;const Z=Pe.current;if(v.clearRect(0,0,y.width,y.height),Z){Ye.current&&v.drawImage(Ye.current,0,0,y.width,y.height);const pe=Math.round(Z.screenCornerRadius/2*(y.height/(Z.compositeHeight/2)));v.save(),v.beginPath(),pe>0?v.roundRect(b.offsetLeft,b.offsetTop,b.clientWidth,b.clientHeight,pe):v.rect(b.offsetLeft,b.offsetTop,b.clientWidth,b.clientHeight),v.clip(),v.drawImage(b,b.offsetLeft,b.offsetTop,b.clientWidth,b.clientHeight),v.restore()}else v.drawImage(b,0,0,y.width,y.height);const fe=qe.current;if(fe)for(const pe of[fe.f0,fe.f1]){const le=Z?b.offsetLeft+pe.x*b.clientWidth:pe.x*y.width,Ee=Z?b.offsetTop+pe.y*b.clientHeight:pe.y*y.height;Oe.current?(v.beginPath(),v.arc(le,Ee,dr,0,Math.PI*2),v.fillStyle="rgba(255,255,255,0.92)",v.fill(),v.strokeStyle="rgba(0,0,0,0.2)",v.lineWidth=1,v.stroke()):(v.beginPath(),v.arc(le,Ee,En,0,Math.PI*2),v.strokeStyle="rgba(0,0,0,0.3)",v.lineWidth=3,v.stroke(),v.beginPath(),v.arc(le,Ee,En,0,Math.PI*2),v.strokeStyle="rgba(255,255,255,0.65)",v.lineWidth=1.5,v.stroke())}const L=Je.current;if(L){const pe=Ze.current,le=mt.current;if(v.save(),pe==="down")v.beginPath(),v.arc(L.x,L.y,dr,0,Math.PI*2),v.fillStyle="rgba(255,255,255,0.92)",v.fill(),v.strokeStyle="rgba(0,0,0,0.2)",v.lineWidth=1,v.stroke();else if(pe==="release"&&le){const Ee=Math.min((performance.now()-le.startTime)/350,1);v.beginPath(),v.arc(L.x,L.y,dr+26*Ee,0,Math.PI*2),v.strokeStyle=`rgba(255,255,255,${(1-Ee)*.55})`,v.lineWidth=1.5,v.stroke(),Ee>=1&&(Ze.current="idle",mt.current=null)}else v.beginPath(),v.arc(L.x,L.y,En,0,Math.PI*2),v.strokeStyle="rgba(0,0,0,0.3)",v.lineWidth=3,v.stroke(),v.beginPath(),v.arc(L.x,L.y,En,0,Math.PI*2),v.strokeStyle="rgba(255,255,255,0.65)",v.lineWidth=1.5,v.stroke();v.restore()}},e[35]=O,e[36]=St):St=e[36];const it=St;let et,Qt;e[37]!==it||e[38]!==G?(et=()=>{G(it)},Qt=[it,G],e[37]=it,e[38]=G,e[39]=et,e[40]=Qt):(et=e[39],Qt=e[40]),a.useLayoutEffect(et,Qt);let lt;e[41]===Symbol.for("react.memo_cache_sentinel")?(lt=()=>{const y=U.current;if(!y)return;const b=document.createElement("canvas"),v=b.getContext("2d");v&&(b.width=y.width,b.height=y.height,v.drawImage(y,0,0),b.toBlob(_a,"image/png"))},e[41]=lt):lt=e[41];const on=lt;let Rt;e[42]!==O||e[43]!==K||e[44]!==ye||e[45]!==me?(Rt=()=>{if(K==="idle"){const y=O.current;if(!y)return;const b=H.current;if(b&&b.clientWidth>0)y.width=b.clientWidth,y.height=b.clientHeight;else{const v=U.current;if(v&&v.width>0)y.width=v.width,y.height=v.height;else return}ye()}else K==="recording"&&me()},e[42]=O,e[43]=K,e[44]=ye,e[45]=me,e[46]=Rt):Rt=e[46];const Ge=Rt,bt=a.useRef(!1);let _t;e[47]!==r||e[48]!==t?(_t=()=>{const y=!bt.current;bt.current=y,rt(y),r({type:"input:rotate",sessionId:t,payload:{orientation:y?"landscape":"portrait"}})},e[47]=r,e[48]=t,e[49]=_t):_t=e[49];const He=_t,ln=a.useRef(null);let at,ct;e[50]!==r||e[51]!==t?(at=()=>{ln.current=()=>{bt.current&&r({type:"input:rotate",sessionId:t,payload:{orientation:"portrait"}})}},ct=[r,t],e[50]=r,e[51]=t,e[52]=at,e[53]=ct):(at=e[52],ct=e[53]),a.useEffect(at,ct);let kt,jt;e[54]===Symbol.for("react.memo_cache_sentinel")?(kt=()=>()=>{var y;(y=ln.current)==null||y.call(ln)},jt=[],e[54]=kt,e[55]=jt):(kt=e[54],jt=e[55]),a.useEffect(kt,jt);let _;e[56]!==r||e[57]!==t?(_=(y,b)=>{r({type:"input:key",sessionId:t,requestId:_e(),payload:{code:y,modifiers:b}})},e[56]=r,e[57]=t,e[58]=_):_=e[58];const ie=_;let Se;e[59]!==T||e[60]!==C||e[61]!==z||e[62]!==r||e[63]!==ie||e[64]!==t?(Se={sessionId:t,send:r,active:z,supported:C,handlerRef:T,sendChord:ie,onError:Ra},e[59]=T,e[60]=C,e[61]=z,e[62]=r,e[63]=ie,e[64]=t,e[65]=Se):Se=e[65],go(Se);let Re;e[66]!==d||e[67]!==S||e[68]!==j||e[69]!==r||e[70]!==t?(Re={sessionId:t,send:r,supported:j,deviceReady:d,handlerRef:S,onError:Sa},e[66]=d,e[67]=S,e[68]=j,e[69]=r,e[70]=t,e[71]=Re):Re=e[71];const ne=ao(Re);let Fe,Et;e[72]!==C||e[73]!==Ge||e[74]!==He||e[75]!==z||e[76]!==D||e[77]!==r||e[78]!==t||e[79]!==k?(Fe=()=>{const y=new Set(["ShiftLeft","ShiftRight","ControlLeft","ControlRight","MetaLeft","MetaRight"]),b=L=>{if(L.code==="AltLeft"||L.code==="AltRight"){Qe.current=!0;return}if(L.metaKey){const le=document.activeElement;if(!le||le.tagName!=="INPUT"&&le.tagName!=="TEXTAREA"){if(!L.shiftKey&&L.code==="KeyK"){L.preventDefault(),ue(!0);return}if(!L.shiftKey&&L.code==="KeyS"){L.preventDefault(),on();return}if(L.shiftKey&&L.code==="KeyY"){L.preventDefault(),Ge();return}if(L.shiftKey&&L.code==="KeyO"){L.preventDefault(),L.repeat||He();return}if(L.shiftKey&&L.code==="KeyU"){L.preventDefault(),r({type:"input:button",sessionId:t,requestId:_e(),payload:{name:"home"}});return}if(L.shiftKey&&L.code==="KeyK"){L.preventDefault(),k||D();return}}}if(!z||y.has(L.code)||C&&Qr(L))return;L.preventDefault();const pe=(L.shiftKey?2:0)|(L.ctrlKey?1:0)|(L.metaKey?8:0);r({type:"input:key",sessionId:t,requestId:_e(),payload:{code:L.code,modifiers:pe}})},v=()=>{Oe.current&&(Oe.current=!1,xe(!1),r({type:"input:pinch:end",sessionId:t,requestId:_e()})),Qe.current=!1,Ae(null)},Z=L=>{(L.code==="AltLeft"||L.code==="AltRight")&&v()},fe=()=>{Qe.current&&v()};return window.addEventListener("keydown",b),window.addEventListener("keyup",Z),window.addEventListener("blur",fe),()=>{window.removeEventListener("keydown",b),window.removeEventListener("keyup",Z),window.removeEventListener("blur",fe)}},Et=[z,C,r,t,on,Ge,He,D,k],e[72]=C,e[73]=Ge,e[74]=He,e[75]=z,e[76]=D,e[77]=r,e[78]=t,e[79]=k,e[80]=Fe,e[81]=Et):(Fe=e[80],Et=e[81]),a.useEffect(Fe,Et);let Cn,Tn;e[82]!==z?(Cn=()=>{if(!z)return;const y=b=>{const v=H.current??U.current;v&&!v.contains(b.target)&&J(!1)};return document.addEventListener("pointerdown",y),()=>document.removeEventListener("pointerdown",y)},Tn=[z],e[82]=z,e[83]=Cn,e[84]=Tn):(Cn=e[83],Tn=e[84]),a.useEffect(Cn,Tn);let Nn;e[85]!==h.compositeHeight||e[86]!==h.compositeWidth||e[87]!==h.screenRect.height||e[88]!==h.screenRect.width||e[89]!==h.screenRect.x||e[90]!==h.screenRect.y||e[91]!==oe?(Nn=y=>{const b=(oe?Y.current:null)??H.current;if(!b)return null;const v=b.getBoundingClientRect(),Z=h.compositeWidth/2,fe=h.compositeHeight/2,L=h.screenRect.x/2,pe=h.screenRect.y/2,le=h.screenRect.width/2,Ee=h.screenRect.height/2;return Kl({x:y.clientX,y:y.clientY},v,Z,fe,{x:L,y:pe,width:le,height:Ee},oe)},e[85]=h.compositeHeight,e[86]=h.compositeWidth,e[87]=h.screenRect.height,e[88]=h.screenRect.width,e[89]=h.screenRect.x,e[90]=h.screenRect.y,e[91]=oe,e[92]=Nn):Nn=e[92];const Ct=Nn;let An;e[93]!==Ct?(An=y=>{const b=Ct(y);return b?ho(b):null},e[93]=Ct,e[94]=An):An=e[94];const Jt=An;let Zt;e[95]!==O?(Zt=y=>{const b=U.current,v=O.current;return b&&b.clientWidth>0?{x:b.offsetLeft+y.x*b.clientWidth,y:b.offsetTop+y.y*b.clientHeight}:{x:y.x*((v==null?void 0:v.width)??1),y:y.y*((v==null?void 0:v.height)??1)}},e[95]=O,e[96]=Zt):Zt=e[96];const en=Zt;let In;e[97]!==en||e[98]!==r||e[99]!==t||e[100]!==Ct||e[101]!==Jt?(In=y=>{if(J(!0),Qe.current){const fe=Jt(y);if(!fe)return;Oe.current=!0,xe(!0),y.target.setPointerCapture(y.pointerId),Ae(fe),r({type:"input:pinch:start",sessionId:t,payload:fe});return}const b=Ct(y);if(!b)return;pt.current=b,y.target.setPointerCapture(y.pointerId),Je.current=en(b),Ze.current="down",mt.current=null;const v=y.currentTarget.getBoundingClientRect(),Z=ke.current;Z&&(Z.style.display="block",Z.style.left=`${y.clientX-v.left}px`,Z.style.top=`${y.clientY-v.top}px`,Z.style.width=`${dr*2}px`,Z.style.height=`${dr*2}px`,Z.style.background="rgba(255,255,255,0.92)",Z.style.border="1.5px solid rgba(0,0,0,0.2)",Z.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:b})},e[97]=en,e[98]=r,e[99]=t,e[100]=Ct,e[101]=Jt,e[102]=In):In=e[102];const Kn=In;let Pn;e[103]!==r||e[104]!==t?(Pn=(y,b)=>{if(!Qe.current){if(b.stopPropagation(),ve.current){Ue.current.add(b.pointerId);return}J(!0),ze.current&&(clearTimeout(ze.current),ze.current=null),ve.current={name:y,pointerId:b.pointerId},Ne(y),b.currentTarget.setPointerCapture(b.pointerId),r({type:"input:button",sessionId:t,requestId:_e(),payload:{name:y,phase:"down"}})}},e[103]=r,e[104]=t,e[105]=Pn):Pn=e[105];const Xn=Pn;let Dn;e[106]!==en||e[107]!==r||e[108]!==t||e[109]!==Ct||e[110]!==Jt?(Dn=y=>{var pe;if(Ue.current.has(y.pointerId))return;if(y.buttons===0){if(Qe.current){Ae(Jt(y)),Je.current=null;const le=ke.current;le&&(le.style.display="none")}else{Ae(null);const le=Ct(y);Je.current=le?en(le):null,Ze.current!=="down"&&(Ze.current="idle");const Ee=ke.current;if(Ee)if(le){const Cr=y.currentTarget.getBoundingClientRect();Ee.style.display="block",Ee.style.left=`${y.clientX-Cr.left}px`,Ee.style.top=`${y.clientY-Cr.top}px`,Ee.style.width=`${En*2}px`,Ee.style.height=`${En*2}px`,Ee.style.background="transparent",Ee.style.border="1.5px solid rgba(255,255,255,0.6)",Ee.style.boxShadow="0 0 0 1px rgba(0,0,0,0.3)"}else Ee.style.display="none"}return}if(Oe.current){const le=Jt(y);if(!le)return;const Ee=performance.now();if(Ee-we.current<xs)return;we.current=Ee,Ae(le),r({type:"input:pinch:move",sessionId:t,payload:le});return}if(((pe=ve.current)==null?void 0:pe.pointerId)===y.pointerId||!pt.current)return;const b=Ct(y);if(!b)return;const v=b.x-pt.current.x,Z=b.y-pt.current.y;if(Math.sqrt(v*v+Z*Z)<wa)return;const fe=performance.now();if(fe-we.current<xs)return;we.current=fe,Je.current=en(b);const L=ke.current;if(L&&L.style.display!=="none"){const le=y.currentTarget.getBoundingClientRect();L.style.left=`${y.clientX-le.left}px`,L.style.top=`${y.clientY-le.top}px`}r({type:"input:touch:move",sessionId:t,payload:b})},e[106]=en,e[107]=r,e[108]=t,e[109]=Ct,e[110]=Jt,e[111]=Dn):Dn=e[111];const Yn=Dn;let Mn;e[112]!==r||e[113]!==t?(Mn=y=>{var v;if(Ue.current.delete(y.pointerId))return;if(Oe.current){Oe.current=!1,xe(!1),Ae(null),r({type:"input:pinch:end",sessionId:t,requestId:_e()});return}if(pt.current=null,((v=ve.current)==null?void 0:v.pointerId)===y.pointerId){r({type:"input:button",sessionId:t,requestId:_e(),payload:{name:ve.current.name,phase:"up"}}),ve.current=null,ze.current=setTimeout(()=>{ze.current=null,Ne(null)},100);return}Ze.current="release",mt.current={startTime:performance.now()};const b=ke.current;b&&(b.style.width=`${En*2}px`,b.style.height=`${En*2}px`,b.style.background="transparent",b.style.border="1.5px solid rgba(255,255,255,0.6)",b.style.boxShadow="0 0 0 1px rgba(0,0,0,0.3)"),r({type:"input:touch:end",sessionId:t,requestId:_e()})},e[112]=r,e[113]=t,e[114]=Mn):Mn=e[114];const lr=Mn;let Ln;e[115]!==r||e[116]!==t?(Ln=y=>{var b;if(!Ue.current.delete(y.pointerId)){if(Oe.current){Oe.current=!1,xe(!1),Ae(null),r({type:"input:pinch:end",sessionId:t,requestId:_e()});return}if(pt.current=null,((b=ve.current)==null?void 0:b.pointerId)===y.pointerId){r({type:"input:button",sessionId:t,requestId:_e(),payload:{name:ve.current.name,phase:"up"}}),ve.current=null,Ne(null);return}Ze.current="release",mt.current={startTime:performance.now()},r({type:"input:touch:end",sessionId:t,requestId:_e()})}},e[115]=r,e[116]=t,e[117]=Ln):Ln=e[117];const ar=Ln;let $n;e[118]===Symbol.for("react.memo_cache_sentinel")?($n=()=>{ut(null),Ae(null),Je.current=null;const y=ke.current;y&&(y.style.display="none")},e[118]=$n):$n=e[118];const yr=$n,gr=h.compositeWidth/2,br=h.compositeHeight/2,Gn=Yl(br,750),Ft=Math.round(gr*Gn),Tt=Math.round(br*Gn),Nt=h.screenRect.x/h.compositeWidth*100,Ut=h.screenRect.y/h.compositeHeight*100,At=h.screenRect.width/h.compositeWidth*100,zt=h.screenRect.height/h.compositeHeight*100,It=Math.round(h.screenCornerRadius/2*Gn);let Fn;e[119]!==It?(Fn=It>0?ya(navigator.userAgent):void 0,e[119]=It,e[120]=Fn):Fn=e[120];const Qn=Fn;let Un,an;if(e[121]!==h.buttons||e[122]!==h.compositeHeight||e[123]!==h.compositeWidth||e[124]!==E||e[125]!==oe){const y={width:h.compositeWidth,height:h.compositeHeight};an=nl(h.buttons,y),Un=il(h.buttons,y,oe,E),e[121]=h.buttons,e[122]=h.compositeHeight,e[123]=h.compositeWidth,e[124]=E,e[125]=oe,e[126]=Un,e[127]=an}else Un=e[126],an=e[127];const gn=Un;let tn;e[128]!==r||e[129]!==t?(tn=()=>r({type:"input:button",sessionId:t,requestId:_e(),payload:{name:"home"}}),e[128]=r,e[129]=t,e[130]=tn):tn=e[130];let Jn;e[131]===Symbol.for("react.memo_cache_sentinel")?(Jn=i.jsx(Hs,{className:"h-4 w-4"}),e[131]=Jn):Jn=e[131];let bn;e[132]!==tn?(bn=i.jsx(Mt,{asChild:!0,children:i.jsx(Ve,{variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":"Home",onClick:tn,children:Jn})}),e[132]=tn,e[133]=bn):bn=e[133];let Zn;e[134]===Symbol.for("react.memo_cache_sentinel")?(Zn=i.jsx(Lt,{side:"left",children:i.jsxs("span",{className:"flex items-center gap-3",children:["Home ",i.jsxs(Br,{children:[i.jsx(fr,{children:"⌘"}),i.jsx(fr,{children:"⇧"}),i.jsx(fr,{children:"U"})]})]})}),e[134]=Zn):Zn=e[134];let zn;e[135]!==bn?(zn=i.jsx(i.Fragment,{children:i.jsxs(Dt,{children:[bn,Zn]})}),e[135]=bn,e[136]=zn):zn=e[136];const cr=zn,Ht=a.useId(),er=k?"Changing the software keyboard.":R?"The software keyboard is up.":"The software keyboard is down.";let xn;e[137]!==Ht||e[138]!==er?(xn=i.jsx("span",{id:Ht,role:"status",className:"sr-only",children:er}),e[137]=Ht,e[138]=er,e[139]=xn):xn=e[139];const tr=k?"Software keyboard — changing it":"Software keyboard";let yn;e[140]!==D||e[141]!==k?(yn=()=>{k||D()},e[140]=D,e[141]=k,e[142]=yn):yn=e[142];let cn;e[143]!==k?(cn=k?i.jsx(pr,{className:"h-4 w-4 animate-spin"}):i.jsx(Pi,{className:"h-4 w-4"}),e[143]=k,e[144]=cn):cn=e[144];let Ot;e[145]!==Ht||e[146]!==k||e[147]!==R||e[148]!==tr||e[149]!==yn||e[150]!==cn?(Ot=i.jsx(Mt,{asChild:!0,children:i.jsx(Ve,{variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":tr,"aria-pressed":R,"aria-busy":k,"aria-disabled":k,"aria-describedby":Ht,onClick:yn,"data-active":R,children:cn})}),e[145]=Ht,e[146]=k,e[147]=R,e[148]=tr,e[149]=yn,e[150]=cn,e[151]=Ot):Ot=e[151];let Bt;e[152]!==k?(Bt=i.jsx(Lt,{side:"left",children:k?i.jsx("span",{children:"Software keyboard — changing it"}):i.jsxs("span",{className:"flex items-center gap-3",children:["Software keyboard ",i.jsxs(Br,{children:[i.jsx(fr,{children:"⌘"}),i.jsx(fr,{children:"⇧"}),i.jsx(fr,{children:"K"})]})]})}),e[152]=k,e[153]=Bt):Bt=e[153];let dn;e[154]!==Ot||e[155]!==Bt?(dn=i.jsxs(Dt,{children:[Ot,Bt]}),e[154]=Ot,e[155]=Bt,e[156]=dn):dn=e[156];let un;e[157]!==xn||e[158]!==dn?(un=i.jsxs(i.Fragment,{children:[xn,dn]}),e[157]=xn,e[158]=dn,e[159]=un):un=e[159];const wn=un;let fn;e[160]!==s||e[161]!==p||e[162]!==l||e[163]!==x?(fn=p&&s?i.jsxs(Dt,{children:[i.jsx(Mt,{asChild:!0,children:i.jsx(Ve,{variant:"ghost",size:"icon",className:"h-8 w-8",disabled:x,"aria-label":"Launch app",onClick:l,children:x?i.jsx(pr,{className:"h-4 w-4 animate-spin"}):i.jsx(Ps,{className:"h-4 w-4"})})}),i.jsx(Lt,{side:"left",children:x?"Launching…":"Launch app"})]}):null,e[160]=s,e[161]=p,e[162]=l,e[163]=x,e[164]=fn):fn=e[164];const vn=fn;let nr;e[165]===Symbol.for("react.memo_cache_sentinel")?(nr={display:"none"},e[165]=nr):nr=e[165];let Wt;e[166]!==O?(Wt=i.jsx("canvas",{ref:O,style:nr}),e[166]=O,e[167]=Wt):Wt=e[167];let Sn;e[168]!==se||e[169]!==o?(Sn=i.jsx(fo,{open:se,onOpenChange:ue,openUrl:o}),e[168]=se,e[169]=o,e[170]=Sn):Sn=e[170];let hn;e[171]===Symbol.for("react.memo_cache_sentinel")?(hn=()=>ue(!0),e[171]=hn):hn=e[171];let Vt;e[172]!==ne||e[173]!==j?(Vt=j?{position:ne.position,steerable:ne.steerable,reason:ne.reason,pending:ne.pending,onToggle:ne.toggle}:void 0,e[172]=ne,e[173]=j,e[174]=Vt):Vt=e[174];let qt;e[175]!==M||e[176]!==P||e[177]!==$?(qt={pending:P,onReboot:M,buttonRef:$},e[175]=M,e[176]=P,e[177]=$,e[178]=qt):qt=e[178];let Kt;e[179]!==wn||e[180]!==Ge||e[181]!==He||e[182]!==u||e[183]!==vn||e[184]!==cr||e[185]!==K||e[186]!==Vt||e[187]!==qt?(Kt=i.jsx(lo,{joined:u,onDeepLink:hn,onScreenshot:on,onRecordToggle:Ge,recordState:K,onRotate:He,navigationSlot:cr,deviceSlot:wn,launchSlot:vn,network:Vt,reboot:qt}),e[179]=wn,e[180]=Ge,e[181]=He,e[182]=u,e[183]=vn,e[184]=cr,e[185]=K,e[186]=Vt,e[187]=qt,e[188]=Kt):Kt=e[188];const Rn=oe?Tt:Ft,_n=oe?Ft:Tt;let pn;e[189]!==Rn||e[190]!==_n?(pn={width:Rn,height:_n,position:"relative",flexShrink:0},e[189]=Rn,e[190]=_n,e[191]=pn):pn=e[191];let N;e[192]!==Tt||e[193]!==Ft||e[194]!==oe?(N=oe?{position:"absolute",top:(Ft-Tt)/2,left:(Tt-Ft)/2,transform:"rotate(-90deg)",transformOrigin:"center center"}:{},e[192]=Tt,e[193]=Ft,e[194]=oe,e[195]=N):N=e[195];let F;e[196]!==Tt||e[197]!==Ft||e[198]!==N?(F={width:Ft,height:Tt,...N},e[196]=Tt,e[197]=Ft,e[198]=N,e[199]=F):F=e[199];const ce=`data:image/png;base64,${h.framePng}`;let I;e[200]===Symbol.for("react.memo_cache_sentinel")?(I={position:"absolute",top:0,left:0,zIndex:2,width:"100%",height:"100%",display:"block",pointerEvents:"none",userSelect:"none"},e[200]=I):I=e[200];let je;e[201]!==ce?(je=i.jsx("img",{src:ce,style:I,draggable:!1,alt:""}),e[201]=ce,e[202]=je):je=e[202];const B=`${Nt}%`,We=`${Ut}%`,tt=`${At}%`,nn=`${zt}%`,Ce=It>0?`${It}px`:void 0,Hn=ge?"visible":"hidden";let On;e[203]!==Qn||e[204]!==B||e[205]!==We||e[206]!==tt||e[207]!==nn||e[208]!==Ce||e[209]!==Hn?(On=i.jsx("canvas",{ref:U,style:{position:"absolute",zIndex:3,left:B,top:We,width:tt,height:nn,borderRadius:Ce,maskImage:Qn,backgroundColor:"#010101",cursor:"none",visibility:Hn}}),e[203]=Qn,e[204]=B,e[205]=We,e[206]=tt,e[207]=nn,e[208]=Ce,e[209]=Hn,e[210]=On):On=e[210];let dt;e[211]!==ge||e[212]!==It||e[213]!==zt||e[214]!==Nt||e[215]!==Ut||e[216]!==At?(dt=!ge&&i.jsx("div",{className:"absolute animate-pulse bg-zinc-700",style:{zIndex:3,left:`${Nt}%`,top:`${Ut}%`,width:`${At}%`,height:`${zt}%`,borderRadius:It>0?`${It}px`:void 0}}),e[211]=ge,e[212]=It,e[213]=zt,e[214]=Nt,e[215]=Ut,e[216]=At,e[217]=dt):dt=e[217];let Bn;e[218]!==ft||e[219]!==te||e[220]!==zt||e[221]!==Nt||e[222]!==Ut||e[223]!==At?(Bn=te&&(()=>{const y=Nt/100,b=Ut/100,v=At/100,Z=zt/100,fe=(L,pe)=>({left:`${(y+L*v)*100}%`,top:`${(b+pe*Z)*100}%`});return i.jsx(i.Fragment,{children:[te.f0,te.f1].map((L,pe)=>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",...ft?{width:dr*2,height:dr*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:En*2,height:En*2,background:"transparent",border:"1.5px solid rgba(255,255,255,0.6)",boxShadow:"0 0 0 1px rgba(0,0,0,0.3)"},...fe(L.x,L.y)}},pe))})})(),e[218]=ft,e[219]=te,e[220]=zt,e[221]=Nt,e[222]=Ut,e[223]=At,e[224]=Bn):Bn=e[224];let nt;e[225]!==V||e[226]!==u||e[227]!==zt||e[228]!==Nt||e[229]!==Ut||e[230]!==At?(nt=u&&V===0&&i.jsx("div",{style:{position:"absolute",zIndex:8,left:`${Nt}%`,top:`${Ut}%`,width:`${At}%`,height:`${zt}%`,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:i.jsx("span",{style:{color:"white",fontSize:"0.875rem"},children:"Waiting for first frame..."})}),e[225]=V,e[226]=u,e[227]=zt,e[228]=Nt,e[229]=Ut,e[230]=At,e[231]=nt):nt=e[231];let mn;if(e[232]!==h.buttons||e[233]!==h.compositeHeight||e[234]!==h.compositeWidth||e[235]!==be||e[236]!==Me||e[237]!==Xn||e[238]!==an||e[239]!==gn){let y;e[241]!==h.compositeHeight||e[242]!==h.compositeWidth||e[243]!==be||e[244]!==Me||e[245]!==Xn||e[246]!==an||e[247]!==gn?(y=(b,v)=>{const Z=be===b.name,fe=Me===b.name,L=b.anchor==="top",pe=Xr(b),le=pe.top/h.compositeHeight*100,Ee=b.buttonH/h.compositeHeight*100,Cr=b.buttonW/h.compositeWidth*100,$o=b.buttonW/2,Tr=pe.left/h.compositeWidth*100,os=(2*b.rolloverOffset.x-b.normalOffset.x-$o)/h.compositeWidth*100,Fo=b.rolloverOffset.x/h.compositeWidth*100,Uo=le,is=L?(2*b.rolloverOffset.y-b.normalOffset.y)/h.compositeHeight*100:0,zo=b.onTop?4:1,xr=an[v];return i.jsxs(a.Fragment,{children:[i.jsx("div",{"data-frame-button":b.name,"aria-hidden":"true",onPointerDown:Nr=>Xn(b.name,Nr),onPointerEnter:()=>ut(b.name),onPointerLeave:()=>ut(Nr=>Nr===b.name?null:Nr),style:{position:"absolute",zIndex:6,cursor:"pointer",left:`${xr.left/h.compositeWidth*100}%`,top:`${xr.top/h.compositeHeight*100}%`,width:`${(xr.right-xr.left)/h.compositeWidth*100}%`,height:`${(xr.bottom-xr.top)/h.compositeHeight*100}%`}}),b.buttonPng&&i.jsx("img",{src:`data:image/png;base64,${b.buttonPng}`,style:{position:"absolute",zIndex:zo,top:`${L&&fe?is:le}%`,left:`${L?Tr:fe?os:Tr}%`,width:`${Cr}%`,height:`${Ee}%`,transition:L?"top 0.15s ease":"left 0.15s ease",pointerEvents:"none",userSelect:"none"},draggable:!1,alt:""}),Z&&b.pressedPng&&b.pressedRect&&i.jsx("img",{src:`data:image/png;base64,${b.pressedPng}`,style:{position:"absolute",zIndex:b.onTop?3:1,left:`${L?Tr:fe?os:Tr}%`,top:`${L&&fe?is:le}%`,width:`${b.pressedRect.width/h.compositeWidth*100}%`,height:`${b.pressedRect.height/h.compositeHeight*100}%`,pointerEvents:"none",userSelect:"none"},draggable:!1,alt:""}),fe&&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:`${Fo}%`,top:`${Uo}%`,transform:"translate(-50%, calc(-100% - 8px))"},children:gn[v]})]},b.name)},e[241]=h.compositeHeight,e[242]=h.compositeWidth,e[243]=be,e[244]=Me,e[245]=Xn,e[246]=an,e[247]=gn,e[248]=y):y=e[248],mn=h.buttons.map(y),e[232]=h.buttons,e[233]=h.compositeHeight,e[234]=h.compositeWidth,e[235]=be,e[236]=Me,e[237]=Xn,e[238]=an,e[239]=gn,e[240]=mn}else mn=e[240];let kn;e[249]!==ar||e[250]!==Kn||e[251]!==Yn||e[252]!==lr||e[253]!==F||e[254]!==je||e[255]!==On||e[256]!==dt||e[257]!==Bn||e[258]!==nt||e[259]!==mn?(kn=i.jsxs("div",{ref:H,className:"relative cursor-default",style:F,onPointerDown:Kn,onPointerMove:Yn,onPointerUp:lr,onPointerCancel:ar,onPointerLeave:yr,children:[je,On,dt,Bn,nt,mn]}),e[249]=ar,e[250]=Kn,e[251]=Yn,e[252]=lr,e[253]=F,e[254]=je,e[255]=On,e[256]=dt,e[257]=Bn,e[258]=nt,e[259]=mn,e[260]=kn):kn=e[260];let rr;e[261]===Symbol.for("react.memo_cache_sentinel")?(rr=i.jsx("div",{ref:ke,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[261]=rr):rr=e[261];let jn;e[262]!==pn||e[263]!==kn?(jn=i.jsxs("div",{ref:Y,style:pn,children:[kn,rr]}),e[262]=pn,e[263]=kn,e[264]=jn):jn=e[264];let Wn;e[265]!==g||e[266]!==c||e[267]!==he||e[268]!==d||e[269]!==V||e[270]!==m||e[271]!==f||e[272]!==u||e[273]!==z?(Wn=i.jsx(Gr,{joined:u,fps:V,connected:c,deviceReady:d,bootError:g,installing:f,installError:m,decoderUnsupported:he,keyboardActive:z}),e[265]=g,e[266]=c,e[267]=he,e[268]=d,e[269]=V,e[270]=m,e[271]=f,e[272]=u,e[273]=z,e[274]=Wn):Wn=e[274];let Pt;e[275]!==jn||e[276]!==Wn?(Pt=i.jsxs("div",{className:"flex items-start gap-8",children:[jn,Wn]}),e[275]=jn,e[276]=Wn,e[277]=Pt):Pt=e[277];let Xt;return e[278]!==Wt||e[279]!==Sn||e[280]!==Kt||e[281]!==Pt?(Xt=i.jsxs("div",{role:"region","aria-label":"Device screen",className:"flex items-start justify-center gap-16",children:[Wt,Sn,Kt,Pt]}),e[278]=Wt,e[279]=Sn,e[280]=Kt,e[281]=Pt,e[282]=Xt):Xt=e[282],Xt}function Sa(n){return $t.error(n)}function Ra(n){return $t.error(n)}function _a(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 ka(){}const ur=13,Sr=8,ys=16,ja=.02,zr=720;function Ea(n){const e=de.c(191),{sessionId:t,buildId:s,send:r,openUrl:o,launchApp:l,connected:c,joined:u,deviceReady:d,installing:f,installed:p,installError:m,bootError:g,launching:x,androidButtons:h,binaryFrameHandlerRef:E,clipboardHandlerRef:w,clipboardSupported:T,networkHandlerRef:C,networkSupported:S,onRecordingUploaded:j,rebootPending:A,onReboot:R,restartButtonRef:k,screenWidth:D,screenHeight:P,cornerRadius:M,postures:$,streamRotation:W,perfHookRef:U}=n,H=W===void 0?0:W,Y=a.useRef(null),V=a.useRef(null),re=a.useRef(null),{fps:Q,frameCount:ee}=io();let K;e[0]!==s||e[1]!==j||e[2]!==t?(K={sessionId:t,buildId:s,onRecordingUploaded:j},e[0]=s,e[1]=j,e[2]=t,e[3]=K):K=e[3];const{recordState:O,recordCanvasRef:G,setComposeFrame:ye,startClientRecording:me,stopClientRecording:q}=oo(K),[se,ue]=a.useState(!1),[ge,X]=a.useState(!1),[he,Te]=a.useState(!1),oe=a.useRef(null),[rt,z]=a.useState(null),[J,be]=a.useState(!1),Ne=`${H}:${D??""}:${P??""}`,[Me,ut]=a.useState(Ne);Me!==Ne&&(ut(Ne),be(!1));const[ft,xe]=a.useState(!1),[te,Ae]=a.useState(!1),[qe,Ke]=a.useState(!1),[Ie,ve]=a.useState(null),xt=a.useRef(Ie);let Ue,ze;e[4]!==Ie?(Ue=()=>{xt.current=Ie},ze=[Ie],e[4]=Ie,e[5]=Ue,e[6]=ze):(Ue=e[5],ze=e[6]),a.useEffect(Ue,ze);const Xe=a.useRef(!1),ht=a.useRef(!1),pt=a.useRef(null),Oe=a.useRef(0),Qe=a.useRef(null),we=a.useRef(null),ke=a.useRef("idle"),Je=a.useRef(null);let Ze,mt,Ye;e[7]===Symbol.for("react.memo_cache_sentinel")?(Ze=()=>Te(!0),mt=N=>{X(!0);const F=oe.current;(!F||F.width!==N.width||F.height!==N.height)&&(oe.current=N,z(N),be(!0))},Ye=N=>{var ce;re.current=N;const F=N.surface;F.style.display="block",F.style.width="100%",F.style.height="100%",F.style.objectFit="fill",(ce=Y.current)==null||ce.appendChild(F)},e[7]=Ze,e[8]=mt,e[9]=Ye):(Ze=e[7],mt=e[8],Ye=e[9]);let Pe;e[10]!==E||e[11]!==ee||e[12]!==U?(Pe={binaryFrameHandlerRef:E,perfHookRef:U,frameCount:ee,onUnsupported:Ze,onResize:mt,onDecoderReady:Ye},e[10]=E,e[11]=ee,e[12]=U,e[13]=Pe):Pe=e[13],mo(Pe);const Yt=D&&P?{width:D,height:P}:null,Be=Yt??rt,sn=Be?Be.width>Be.height:!1,st=ft&&!sn,$e=Gl(H,st);let gt;e[14]!==G||e[15]!==H||e[16]!==$e?(gt=()=>{var Wn;const N=G.current,F=(Wn=re.current)==null?void 0:Wn.surface,ce=oe.current;if(!N||!F||!ce)return;const I=N.getContext("2d");if(!I)return;const je=ce.width,B=ce.height,We=$e,{picW:tt,picH:nn,scale:Ce,left:Hn,top:On}=Ql(N.width,N.height,je,B,We);I.clearRect(0,0,N.width,N.height),I.save(),I.translate(Hn+tt*Ce/2,On+nn*Ce/2),I.scale(Ce,Ce),I.rotate(We*Math.PI/180),I.drawImage(F,-je/2,-B/2,je,B),I.restore();const dt=Zl(je,B,We,H);I.save(),I.translate(Hn+tt*Ce/2,On+nn*Ce/2),I.scale(Ce,Ce),I.rotate(dt.turn*Math.PI/180),I.translate(-dt.width/2,-dt.height/2);const Bn=Math.max(dt.width,dt.height),nt=Bn>zr?Bn/zr:1,mn=ur*nt,kn=Sr*nt,rr=xt.current;if(rr)for(const Pt of[rr.f0,rr.f1]){const Xt=Pt.x*dt.width,y=Pt.y*dt.height;Xe.current?(I.beginPath(),I.arc(Xt,y,kn,0,Math.PI*2),I.fillStyle="rgba(255,255,255,0.92)",I.fill(),I.strokeStyle="rgba(0,0,0,0.2)",I.lineWidth=nt,I.stroke()):(I.beginPath(),I.arc(Xt,y,mn,0,Math.PI*2),I.strokeStyle="rgba(0,0,0,0.3)",I.lineWidth=3*nt,I.stroke(),I.beginPath(),I.arc(Xt,y,mn,0,Math.PI*2),I.strokeStyle="rgba(255,255,255,0.65)",I.lineWidth=1.5*nt,I.stroke())}const jn=we.current;if(jn){const Pt=jn.x*dt.width,Xt=jn.y*dt.height,y=ke.current,b=Je.current;if(y==="down")I.beginPath(),I.arc(Pt,Xt,kn,0,Math.PI*2),I.fillStyle="rgba(255,255,255,0.92)",I.fill(),I.strokeStyle="rgba(0,0,0,0.2)",I.lineWidth=nt,I.stroke();else if(y==="release"&&b){const v=Math.min((performance.now()-b.startTime)/350,1);I.beginPath(),I.arc(Pt,Xt,kn+26*nt*v,0,Math.PI*2),I.strokeStyle=`rgba(255,255,255,${(1-v)*.55})`,I.lineWidth=1.5*nt,I.stroke(),v>=1&&(ke.current="idle",Je.current=null)}else I.beginPath(),I.arc(Pt,Xt,mn,0,Math.PI*2),I.strokeStyle="rgba(0,0,0,0.3)",I.lineWidth=3*nt,I.stroke(),I.beginPath(),I.arc(Pt,Xt,mn,0,Math.PI*2),I.strokeStyle="rgba(255,255,255,0.65)",I.lineWidth=1.5*nt,I.stroke()}I.restore()},e[14]=G,e[15]=H,e[16]=$e,e[17]=gt):gt=e[17];const Gt=gt;let yt,wt;e[18]!==Gt||e[19]!==ye?(yt=()=>{ye(Gt)},wt=[Gt,ye],e[18]=Gt,e[19]=ye,e[20]=yt,e[21]=wt):(yt=e[20],wt=e[21]),a.useLayoutEffect(yt,wt);let vt;e[22]!==$e?(vt=()=>{var We;const N=(We=re.current)==null?void 0:We.surface,F=oe.current;if(!N||!F)return;const ce=document.createElement("canvas"),I=ce.getContext("2d");if(!I)return;const je=$e,B=_r(F.width,F.height,je);ce.width=B.width,ce.height=B.height,I.translate(ce.width/2,ce.height/2),I.rotate(je*Math.PI/180),I.drawImage(N,-F.width/2,-F.height/2,F.width,F.height),ce.toBlob(Ia,"image/png")},e[22]=$e,e[23]=vt):vt=e[23];const ot=vt;let St;e[24]!==G||e[25]!==O||e[26]!==me||e[27]!==q||e[28]!==$e?(St=()=>{if(O==="idle"){const N=G.current;if(!N)return;const F=oe.current;if(!F)return;const ce=_r(F.width,F.height,$e);N.width=ce.width,N.height=ce.height,me()}else O==="recording"&&q()},e[24]=G,e[25]=O,e[26]=me,e[27]=q,e[28]=$e,e[29]=St):St=e[29];const it=St,[et,Qt]=a.useState(null),lt=et!==null,on=a.useRef(0);let Rt;e[30]!==r||e[31]!==t?(Rt=N=>{on.current=Date.now()+8e3,Qt(N),r({type:"input:posture",sessionId:t,payload:{postureId:N}})},e[30]=r,e[31]=t,e[32]=Rt):Rt=e[32];const Ge=Rt;let bt;e[33]!==et||e[34]!==($==null?void 0:$.currentId)?(bt=()=>{if(et===null)return;const N=($==null?void 0:$.currentId)===et,F=setTimeout(()=>Qt(null),N?0:na(on.current,Date.now()));return()=>clearTimeout(F)},e[33]=et,e[34]=$==null?void 0:$.currentId,e[35]=bt):bt=e[35];let _t;e[36]!==et||e[37]!==$?(_t=[et,$],e[36]=et,e[37]=$,e[38]=_t):_t=e[38],a.useEffect(bt,_t);const[He,ln]=a.useState(!1);let at,ct;e[39]!==He?(at=()=>{if(!He)return;const N=setTimeout(()=>ln(!1),400);return()=>clearTimeout(N)},ct=[He],e[39]=He,e[40]=at,e[41]=ct):(at=e[40],ct=e[41]),a.useEffect(at,ct);const kt=a.useRef(!1);let jt;e[42]===Symbol.for("react.memo_cache_sentinel")?(jt=()=>{if(!kt.current){kt.current=!0;return}ln(!1)},e[42]=jt):jt=e[42];let _;e[43]!==P||e[44]!==D||e[45]!==H?(_=[H,D,P],e[43]=P,e[44]=D,e[45]=H,e[46]=_):_=e[46],a.useEffect(jt,_);const ie=a.useRef(!1);let Se;e[47]!==r||e[48]!==t?(Se=()=>{const N=!ie.current;ie.current=N,ln(!0),r({type:"input:rotate",sessionId:t,payload:{orientation:N?"landscape":"portrait"}}),xe(N)},e[47]=r,e[48]=t,e[49]=Se):Se=e[49];const Re=Se,ne=a.useRef(null);let Fe,Et;e[50]!==r||e[51]!==t?(Fe=()=>{ne.current=()=>{ie.current&&r({type:"input:rotate",sessionId:t,payload:{orientation:"portrait"}})}},Et=[r,t],e[50]=r,e[51]=t,e[52]=Fe,e[53]=Et):(Fe=e[52],Et=e[53]),a.useEffect(Fe,Et);let Cn,Tn;e[54]===Symbol.for("react.memo_cache_sentinel")?(Cn=()=>()=>{var N;(N=ne.current)==null||N.call(ne)},Tn=[],e[54]=Cn,e[55]=Tn):(Cn=e[54],Tn=e[55]),a.useEffect(Cn,Tn);let Nn;e[56]!==r||e[57]!==t?(Nn=(N,F)=>{r({type:"input:key",sessionId:t,requestId:_e(),payload:{code:N,modifiers:F}})},e[56]=r,e[57]=t,e[58]=Nn):Nn=e[58];const Ct=Nn;let An;e[59]!==w||e[60]!==T||e[61]!==te||e[62]!==r||e[63]!==Ct||e[64]!==t?(An={sessionId:t,send:r,active:te,supported:T,handlerRef:w,sendChord:Ct,onError:Aa},e[59]=w,e[60]=T,e[61]=te,e[62]=r,e[63]=Ct,e[64]=t,e[65]=An):An=e[65],go(An);let Jt;e[66]!==d||e[67]!==C||e[68]!==S||e[69]!==r||e[70]!==t?(Jt={sessionId:t,send:r,supported:S,deviceReady:d,handlerRef:C,onError:Na},e[66]=d,e[67]=C,e[68]=S,e[69]=r,e[70]=t,e[71]=Jt):Jt=e[71];const Zt=ao(Jt);let en,In;e[72]!==T||e[73]!==it||e[74]!==Re||e[75]!==ot||e[76]!==te||e[77]!==r||e[78]!==t?(en=()=>{const N=new Set(["ShiftLeft","ShiftRight","ControlLeft","ControlRight","MetaLeft","MetaRight"]),F=B=>{if(B.code==="AltLeft"||B.code==="AltRight"){ht.current=!0;return}if(B.metaKey){const tt=document.activeElement;if(!tt||tt.tagName!=="INPUT"&&tt.tagName!=="TEXTAREA"){if(!B.shiftKey&&B.code==="KeyK"){B.preventDefault(),ue(!0);return}if(!B.shiftKey&&B.code==="KeyS"){B.preventDefault(),ot();return}if(B.shiftKey&&B.code==="KeyY"){B.preventDefault(),it();return}if(B.shiftKey&&B.code==="KeyO"){B.preventDefault(),B.repeat||Re();return}}}if(!te||N.has(B.code)||T&&Qr(B))return;B.preventDefault();const We=(B.shiftKey?2:0)|(B.ctrlKey?1:0)|(B.metaKey?8:0);r({type:"input:key",sessionId:t,requestId:_e(),payload:{code:B.code,modifiers:We}})},ce=()=>{Xe.current&&(Xe.current=!1,Ke(!1),r({type:"input:pinch:end",sessionId:t,requestId:_e()})),ht.current=!1,ve(null)},I=B=>{(B.code==="AltLeft"||B.code==="AltRight")&&ce()},je=()=>{ht.current&&ce()};return window.addEventListener("keydown",F),window.addEventListener("keyup",I),window.addEventListener("blur",je),()=>{window.removeEventListener("keydown",F),window.removeEventListener("keyup",I),window.removeEventListener("blur",je)}},In=[te,T,r,t,ot,it,Re],e[72]=T,e[73]=it,e[74]=Re,e[75]=ot,e[76]=te,e[77]=r,e[78]=t,e[79]=en,e[80]=In):(en=e[79],In=e[80]),a.useEffect(en,In);let Kn,Pn;e[81]!==te?(Kn=()=>{if(!te)return;const N=F=>{const ce=V.current??Y.current;ce&&!ce.contains(F.target)&&Ae(!1)};return document.addEventListener("pointerdown",N),()=>document.removeEventListener("pointerdown",N)},Pn=[te],e[81]=te,e[82]=Kn,e[83]=Pn):(Kn=e[82],Pn=e[83]),a.useEffect(Kn,Pn);const Xn=a.useRef(!1);let Dn;e[84]===Symbol.for("react.memo_cache_sentinel")?(Dn=N=>{const F=Y.current;if(!F)return null;const ce=F.getBoundingClientRect();return Xl({x:N.clientX,y:N.clientY},ce,Xn.current)},e[84]=Dn):Dn=e[84];const Yn=Dn;let Mn;e[85]===Symbol.for("react.memo_cache_sentinel")?(Mn=N=>{const F=Yn(N);return F?ho(F):null},e[85]=Mn):Mn=e[85];const lr=Mn;let Ln;e[86]!==r||e[87]!==t?(Ln=N=>{if(ht.current){const je=lr(N);if(!je)return;Xe.current=!0,Ke(!0),N.target.setPointerCapture(N.pointerId);const B=Qe.current;B&&(B.style.display="none"),ve(je),r({type:"input:pinch:start",sessionId:t,payload:je});return}const F=Yn(N);if(!F)return;Ae(!0),pt.current=F,N.target.setPointerCapture(N.pointerId);const ce=N.currentTarget.getBoundingClientRect();we.current=F,ke.current="down",Je.current=null;const I=Qe.current;I&&(I.style.display="block",I.style.left=`${N.clientX-ce.left}px`,I.style.top=`${N.clientY-ce.top}px`,I.style.width=`${Sr*2}px`,I.style.height=`${Sr*2}px`,I.style.background="rgba(255,255,255,0.92)",I.style.border="1.5px solid rgba(0,0,0,0.2)",I.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:F})},e[86]=r,e[87]=t,e[88]=Ln):Ln=e[88];const ar=Ln;let $n;e[89]!==r||e[90]!==t?($n=N=>{if(N.buttons===0){if(ht.current){ve(lr(N)),we.current=null;const Hn=Qe.current;Hn&&(Hn.style.display="none");return}const tt=Yn(N),nn=N.currentTarget.getBoundingClientRect(),Ce=Qe.current;tt?(we.current=tt,ke.current!=="down"&&(ke.current="idle"),Ce&&(Ce.style.display="block",Ce.style.left=`${N.clientX-nn.left}px`,Ce.style.top=`${N.clientY-nn.top}px`,Ce.style.width=`${ur*2}px`,Ce.style.height=`${ur*2}px`,Ce.style.background="transparent",Ce.style.border="1.5px solid rgba(255,255,255,0.6)",Ce.style.boxShadow="0 0 0 1px rgba(0,0,0,0.3)")):(we.current=null,Ce&&(Ce.style.display="none"));return}if(Xe.current){const tt=lr(N);if(!tt)return;const nn=performance.now();if(nn-Oe.current<ys)return;Oe.current=nn,ve(tt),r({type:"input:pinch:move",sessionId:t,payload:tt});return}if(!pt.current)return;const F=Yn(N);if(!F)return;const ce=F.x-pt.current.x,I=F.y-pt.current.y;if(Math.sqrt(ce*ce+I*I)<ja)return;const je=performance.now();if(je-Oe.current<ys)return;Oe.current=je;const B=N.currentTarget.getBoundingClientRect();we.current=F;const We=Qe.current;We&&We.style.display!=="none"&&(We.style.left=`${N.clientX-B.left}px`,We.style.top=`${N.clientY-B.top}px`),r({type:"input:touch:move",sessionId:t,payload:F})},e[89]=r,e[90]=t,e[91]=$n):$n=e[91];const yr=$n;let gr;e[92]!==r||e[93]!==t?(gr=()=>{if(Xe.current){Xe.current=!1,Ke(!1),ve(null),r({type:"input:pinch:end",sessionId:t,requestId:_e()});return}pt.current=null,ke.current="release",Je.current={startTime:performance.now()};const N=Qe.current;N&&(N.style.width=`${ur*2}px`,N.style.height=`${ur*2}px`,N.style.background="transparent",N.style.border="1.5px solid rgba(255,255,255,0.6)",N.style.boxShadow="0 0 0 1px rgba(0,0,0,0.3)"),r({type:"input:touch:end",sessionId:t,requestId:_e()})},e[92]=r,e[93]=t,e[94]=gr):gr=e[94];const br=gr;let Gn;e[95]!==r||e[96]!==t?(Gn=()=>{if(Xe.current){Xe.current=!1,Ke(!1),ve(null),r({type:"input:pinch:end",sessionId:t,requestId:_e()});return}pt.current=null,ke.current="release",Je.current={startTime:performance.now()},r({type:"input:touch:end",sessionId:t,requestId:_e()})},e[95]=r,e[96]=t,e[97]=Gn):Gn=e[97];const Ft=Gn;let Tt;e[98]===Symbol.for("react.memo_cache_sentinel")?(Tt=()=>{ve(null),we.current=null;const N=Qe.current;N&&(N.style.display="none")},e[98]=Tt):Tt=e[98];const Nt=Tt,Ut=Be?Math.min(1,zr/Math.max(Be.width,Be.height)):.3,At=Be?Math.round(Be.width*Ut):324,zt=Be?Math.round(Be.height*Ut):720;let It,Fn;e[99]!==st?(It=()=>{Xn.current=st},Fn=[st],e[99]=st,e[100]=It,e[101]=Fn):(It=e[100],Fn=e[101]),a.useLayoutEffect(It,Fn);const Qn=st?zt:At,Un=st?At:zt,an=M!=null?Math.round(M*At):22,gn=ta(rt,Yt,H),tn=ea({ready:ge,aspectAgrees:gn,frameIsAhead:J,rotating:He}),Jn=Jl($e,Qn,Un),bn=`rotate(${$e}deg)`,Zn=tn?"visible":"hidden";let zn;e[102]!==Jn||e[103]!==bn||e[104]!==Zn?(zn={position:"absolute",...Jn,transform:bn,transformOrigin:"center center",visibility:Zn,cursor:"none"},e[102]=Jn,e[103]=bn,e[104]=Zn,e[105]=zn):zn=e[105];const cr=zn;let Ht,er;if(e[106]!==h||e[107]!==r||e[108]!==t){const N=["home","back","recent_apps"],F=["volume_up","volume_down","power"],ce=Ta,I=je=>i.jsx(i.Fragment,{children:je.map(B=>h==null?void 0:h.find(We=>We.name===B)).filter(Ca).map(B=>i.jsxs(Dt,{children:[i.jsx(Mt,{asChild:!0,children:i.jsx(Ve,{variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":B.accessibilityTitle,onClick:()=>r({type:"input:button",sessionId:t,requestId:_e(),payload:{name:B.name}}),children:ce(B.name)})}),i.jsx(Lt,{side:"left",children:B.accessibilityTitle})]},B.name))});Ht=I(N),er=I(F),e[106]=h,e[107]=r,e[108]=t,e[109]=Ht,e[110]=er}else Ht=e[109],er=e[110];const xn=er;let tr;e[111]!==s||e[112]!==p||e[113]!==f||e[114]!==l||e[115]!==x?(tr=p&&s?i.jsxs(Dt,{children:[i.jsx(Mt,{asChild:!0,children:i.jsx(Ve,{variant:"ghost",size:"icon",className:"h-8 w-8",disabled:x||f,"aria-label":"Launch app",onClick:l,children:x?i.jsx(pr,{className:"h-4 w-4 animate-spin"}):i.jsx(Ps,{className:"h-4 w-4"})})}),i.jsx(Lt,{side:"left",children:x?"Launching…":f?"Installing…":"Launch app"})]}):null,e[111]=s,e[112]=p,e[113]=f,e[114]=l,e[115]=x,e[116]=tr):tr=e[116];const yn=tr;let cn;e[117]===Symbol.for("react.memo_cache_sentinel")?(cn={display:"none"},e[117]=cn):cn=e[117];let Ot;e[118]!==G?(Ot=i.jsx("canvas",{ref:G,style:cn}),e[118]=G,e[119]=Ot):Ot=e[119];let Bt;e[120]!==se||e[121]!==o?(Bt=i.jsx(fo,{open:se,onOpenChange:ue,openUrl:o}),e[120]=se,e[121]=o,e[122]=Bt):Bt=e[122];let dn;e[123]===Symbol.for("react.memo_cache_sentinel")?(dn=()=>ue(!0),e[123]=dn):dn=e[123];let un;e[124]!==Ge||e[125]!==lt||e[126]!==$?(un=$&&$.postures.length>1?{postures:$.postures,currentId:$.currentId,pending:lt,onSelect:Ge}:void 0,e[124]=Ge,e[125]=lt,e[126]=$,e[127]=un):un=e[127];let wn;e[128]!==Zt||e[129]!==S?(wn=S?{position:Zt.position,steerable:Zt.steerable,reason:Zt.reason,pending:Zt.pending,onToggle:Zt.toggle}:void 0,e[128]=Zt,e[129]=S,e[130]=wn):wn=e[130];let fn;e[131]!==R||e[132]!==A||e[133]!==k?(fn={pending:A,onReboot:R,buttonRef:k},e[131]=R,e[132]=A,e[133]=k,e[134]=fn):fn=e[134];let vn;e[135]!==xn||e[136]!==it||e[137]!==Re||e[138]!==ot||e[139]!==u||e[140]!==yn||e[141]!==Ht||e[142]!==O||e[143]!==un||e[144]!==wn||e[145]!==fn?(vn=i.jsx(lo,{joined:u,onDeepLink:dn,onScreenshot:ot,onRecordToggle:it,recordState:O,onRotate:Re,posture:un,navigationSlot:Ht,deviceSlot:xn,launchSlot:yn,network:wn,reboot:fn}),e[135]=xn,e[136]=it,e[137]=Re,e[138]=ot,e[139]=u,e[140]=yn,e[141]=Ht,e[142]=O,e[143]=un,e[144]=wn,e[145]=fn,e[146]=vn):vn=e[146];const nr=`${an+12}px`;let Wt;e[147]!==nr?(Wt={background:"#1c1c1e",borderRadius:nr,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[147]=nr,e[148]=Wt):Wt=e[148];const Sn=`${an}px`;let hn;e[149]!==Un||e[150]!==Qn||e[151]!==Sn?(hn={width:Qn,height:Un,backgroundColor:"#010101",borderRadius:Sn,overflow:"hidden"},e[149]=Un,e[150]=Qn,e[151]=Sn,e[152]=hn):hn=e[152];let Vt;e[153]!==cr||e[154]!==he||e[155]!==d||e[156]!==gn||e[157]!==Ft||e[158]!==ar||e[159]!==Nt||e[160]!==yr||e[161]!==br||e[162]!==tn||e[163]!==qe||e[164]!==Ie||e[165]!==lt?(Vt=!he&&i.jsxs(i.Fragment,{children:[i.jsx("div",{ref:Y,style:cr,onPointerDown:ar,onPointerMove:yr,onPointerUp:br,onPointerCancel:Ft,onPointerLeave:Nt}),!tn&&i.jsx("div",{className:"absolute inset-0 animate-pulse bg-zinc-700"}),!tn&&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:lt||!gn?"Changing posture…":"Waiting for stream…"})}),i.jsx("div",{ref:Qe,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"}}),Ie&&i.jsx(i.Fragment,{children:[Ie.f0,Ie.f1].map((N,F)=>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:`${N.x*100}%`,top:`${N.y*100}%`,...qe?{width:Sr*2,height:Sr*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:ur*2,height:ur*2,background:"transparent",border:"1.5px solid rgba(255,255,255,0.6)",boxShadow:"0 0 0 1px rgba(0,0,0,0.3)"}}},F))})]}),e[153]=cr,e[154]=he,e[155]=d,e[156]=gn,e[157]=Ft,e[158]=ar,e[159]=Nt,e[160]=yr,e[161]=br,e[162]=tn,e[163]=qe,e[164]=Ie,e[165]=lt,e[166]=Vt):Vt=e[166];let qt;e[167]!==hn||e[168]!==Vt?(qt=i.jsx("div",{ref:V,className:"relative",style:hn,children:Vt}),e[167]=hn,e[168]=Vt,e[169]=qt):qt=e[169];let Kt;e[170]!==Wt||e[171]!==qt?(Kt=i.jsx("div",{style:Wt,children:qt}),e[170]=Wt,e[171]=qt,e[172]=Kt):Kt=e[172];let Rn;e[173]!==g||e[174]!==c||e[175]!==he||e[176]!==d||e[177]!==Q||e[178]!==m||e[179]!==f||e[180]!==u||e[181]!==te?(Rn=i.jsx(Gr,{joined:u,fps:Q,connected:c,deviceReady:d,bootError:g,installing:f,installError:m,decoderUnsupported:he,keyboardActive:te}),e[173]=g,e[174]=c,e[175]=he,e[176]=d,e[177]=Q,e[178]=m,e[179]=f,e[180]=u,e[181]=te,e[182]=Rn):Rn=e[182];let _n;e[183]!==Kt||e[184]!==Rn?(_n=i.jsxs("div",{className:"flex items-start gap-8",children:[Kt,Rn]}),e[183]=Kt,e[184]=Rn,e[185]=_n):_n=e[185];let pn;return e[186]!==Ot||e[187]!==Bt||e[188]!==vn||e[189]!==_n?(pn=i.jsxs("div",{role:"region","aria-label":"Device screen",className:"flex items-start justify-center gap-16",children:[Ot,Bt,vn,_n]}),e[186]=Ot,e[187]=Bt,e[188]=vn,e[189]=_n,e[190]=pn):pn=e[190],pn}function Ca(n){return n!==void 0}function Ta(n){return n==="back"?i.jsx(ji,{className:"h-4 w-4"}):n==="recent_apps"?i.jsx(Oo,{className:"h-4 w-4"}):n==="volume_up"?i.jsx(Wi,{className:"h-4 w-4"}):n==="volume_down"?i.jsx(Bi,{className:"h-4 w-4"}):n==="power"?i.jsx(Mi,{className:"h-4 w-4"}):i.jsx(Hs,{className:"h-4 w-4"})}function Na(n){return $t.error(n)}function Aa(n){return $t.error(n)}function Ia(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 Da=44100,Hr=2,ws=.06,Ma=.3;function La(){const n=de.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 f=window.AudioContext??window.webkitAudioContext;return f?(e.current=new f,e.current):null},n[0]=s):s=n[0];const r=s;let o;n[1]===Symbol.for("react.memo_cache_sentinel")?(o=f=>{var T;const p=r();if(!p)return;p.state==="suspended"&&p.resume();const m=Pa(f,Hr),g=((T=m[0])==null?void 0:T.length)??0;if(g===0)return;const x=p.createBuffer(Hr,g,Da);for(let C=0;C<Hr;C++)x.getChannelData(C).set(m[C]);const h=p.createBufferSource();h.buffer=x,h.connect(p.destination);const E=p.currentTime;let w=t.current;(w<E+.005||w>E+Ma+ws)&&(w=E+ws),h.start(w),t.current=w+x.duration},n[1]=o):o=n[1];const l=o;let c,u;n[2]===Symbol.for("react.memo_cache_sentinel")?(c=()=>()=>{var f;(f=e.current)==null||f.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 $a=2e4;function Fa(n){const e=de.c(32),{sessionId:t,deviceId:s,deviceReady:r,send:o,handlerRef:l,onShutdownComplete:c,onError:u}=n,[d,f]=a.useState(!1),p=a.useRef(null),m=a.useRef(c),g=a.useRef(u);let x,h;e[0]!==c?(x=()=>{m.current=c},h=[c],e[0]=c,e[1]=x,e[2]=h):(x=e[1],h=e[2]),a.useEffect(x,h);let E,w;e[3]!==u?(E=()=>{g.current=u},w=[u],e[3]=u,e[4]=E,e[5]=w):(E=e[4],w=e[5]),a.useEffect(E,w);let T;e[6]!==r||e[7]!==t?(T={sessionId:t,deviceReady:r},e[6]=r,e[7]=t,e[8]=T):T=e[8];const[C,S]=a.useState(T);(C.sessionId!==t||C.deviceReady!==r)&&(S({sessionId:t,deviceReady:r}),(C.sessionId!==t||!r)&&f(!1));let j;e[9]===Symbol.for("react.memo_cache_sentinel")?(j=()=>{p.current=null},e[9]=j):j=e[9];let A;e[10]!==t?(A=[t],e[10]=t,e[11]=A):A=e[11],a.useEffect(j,A);let R,k;e[12]!==r?(R=()=>{r||(p.current=null)},k=[r],e[12]=r,e[13]=R,e[14]=k):(R=e[13],k=e[14]),a.useEffect(R,k);let D,P;e[15]!==l?(D=()=>(l.current=ee=>{if(ee.requestId===p.current){if(p.current=null,f(!1),ee.type==="device:shutdown-error"){g.current(`The device was not restarted. ${ee.message}`);return}m.current()}},()=>{l.current=void 0}),P=[l],e[15]=l,e[16]=D,e[17]=P):(D=e[16],P=e[17]),a.useEffect(D,P);const[M,$]=a.useState(null);let W,U;e[18]!==d?(W=()=>{$(d?p.current:null)},U=[d],e[18]=d,e[19]=W,e[20]=U):(W=e[19],U=e[20]),a.useEffect(W,U);let H,Y;e[21]!==M?(H=()=>{if(M===null)return;const ee=setTimeout(()=>{p.current===M&&(f(!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."))},$a);return()=>clearTimeout(ee)},Y=[M],e[21]=M,e[22]=H,e[23]=Y):(H=e[22],Y=e[23]),a.useEffect(H,Y);let V;e[24]!==s||e[25]!==d||e[26]!==o||e[27]!==t?(V=()=>{if(d)return;const ee=_e();p.current=ee,f(!0),o({type:"device:shutdown",sessionId:t,requestId:ee,payload:{deviceId:s}})},e[24]=s,e[25]=d,e[26]=o,e[27]=t,e[28]=V):V=e[28];const re=V;let Q;return e[29]!==d||e[30]!==re?(Q={pending:d,reboot:re},e[29]=d,e[30]=re,e[31]=Q):Q=e[31],Q}const vs={"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 Ua(n){const e=n!==void 0&&Object.hasOwn(vs,n)?n:"channel-unavailable";return{key:e,notice:vs[e]}}function za(n){const e=de.c(117),{sessionId:t,deviceId:s,formFactor:r,platform:o,buildId:l,resetMode:c,onRecordingUploaded:u,onSessionEnded:d}=n,f=o===void 0?"ios":o,p=a.useRef(Ba),m=a.useRef(!1);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g={pending:0,appInstalled:!1},e[0]=g):g=e[0];const x=a.useRef(g),{perfMode:h,visible:E}=el(),w=a.useRef(null),T=a.useRef(null);let C;e[1]===Symbol.for("react.memo_cache_sentinel")?(C=[],e[1]=C):C=e[1];const S=a.useRef(C);let j;e[2]===Symbol.for("react.memo_cache_sentinel")?(j={onFrameBegin:()=>{var _;return(_=w.current)==null?void 0:_.onFrameBegin()},onFrameEnd:_=>{var Re,ne;const ie=S.current.shift()??null,Se=ie?{..._,capturedAt:ie.capturedAt,relayedAt:ie.relayedAt}:_;(Re=w.current)==null||Re.onFrameEnd(Se),(ne=T.current)==null||ne.call(T,Se)}},e[2]=j):j=e[2],a.useRef(j);const[A,R]=a.useState(!1),[k,D]=a.useState(!1),[P,M]=a.useState(!1),[$,W]=a.useState(null);let U;e[3]===Symbol.for("react.memo_cache_sentinel")?(U={postures:[],currentId:null},e[3]=U):U=e[3];const[H,Y]=a.useState(U),[V,re]=a.useState(!1),[Q,ee]=a.useState(!1),[K,O]=a.useState(null),[G,ye]=a.useState(null),[me,q]=a.useState(!1);let se;e[4]===Symbol.for("react.memo_cache_sentinel")?(se=[],e[4]=se):se=e[4];const[ue,ge]=a.useState(se);let X;e[5]===Symbol.for("react.memo_cache_sentinel")?(X=new Set,e[5]=X):X=e[5];const he=a.useRef(X),Te=a.useRef(null);let oe;e[6]===Symbol.for("react.memo_cache_sentinel")?(oe=new Set,e[6]=oe):oe=e[6];const rt=a.useRef(oe);let z;e[7]===Symbol.for("react.memo_cache_sentinel")?(z=new Set,e[7]=z):z=e[7];const J=a.useRef(z);let be;e[8]===Symbol.for("react.memo_cache_sentinel")?(be=new Set,e[8]=be):be=e[8];const Ne=a.useRef(be),[Me,ut]=a.useState(!1),[ft,xe]=a.useState(!1),te=a.useRef(null);let Ae,qe;e[9]===Symbol.for("react.memo_cache_sentinel")?(Ae=()=>()=>{te.current&&clearTimeout(te.current)},qe=[],e[9]=Ae,e[10]=qe):(Ae=e[9],qe=e[10]),a.useEffect(Ae,qe);const Ke=a.useRef(void 0),Ie=a.useRef(void 0),ve=a.useRef(void 0),xt=a.useRef(void 0);let Ue;e[11]!==s||e[12]!==t?(Ue=_=>{const ie=_e();he.current.add(ie),Te.current=ie,p.current({type:"device:boot",sessionId:t,requestId:ie,payload:{deviceId:s,resetMode:_,acceptH264:$l(),secureContext:window.isSecureContext}})},e[11]=s,e[12]=t,e[13]=Ue):Ue=e[13];const ze=Ue,{pushFrame:Xe}=La();let ht;e[14]!==k||e[15]!==l||e[16]!==Q||e[17]!==d||e[18]!==c||e[19]!==ze||e[20]!==t?(ht=_=>{var ie,Se,Re;if(!("sessionId"in _&&_.sessionId!==t)){if(_.type==="session:joined"){x.current={pending:0,appInstalled:!1},R(!0),D(!1),ge(_.capabilities??[]);const ne=m.current?"app-only":c;m.current=!0,he.current.clear(),ze(ne)}if(_.type==="session:agent-away"){D(!0),W(null),M(!1);return}if(_.type==="session:terminated"){d==null||d(_.reason);return}if(_.type==="session:rebound"){M(!1),W(null),re(!1),O(null),ye(null),q(!1),xe(!1),te.current&&clearTimeout(te.current),ut(!1),S.current=[],ge(_.capabilities);const ne=k;D(!1),x.current={pending:x.current.pending+1,appInstalled:x.current.pending>0?x.current.appInstalled:Q},m.current=!0,ze("app-only"),ne||$t.info("The agent restarted — reconnecting to the device.");return}if(_.type==="device:boot-error"){if(_.requestId!==void 0&&_.requestId!==Te.current||k)return;x.current={pending:0,appInstalled:!1},ye(_.message)}if(_.type==="input:error"){if(k)return;const{key:ne,notice:Fe}=Ua(_.reason);_.reason!==void 0&&_.reason!==ne&&console.debug(`[tapflow] unrecognised input:error reason "${_.reason}", treated as ${ne}`),Fe?$t.error(Fe.title,{id:`input:${t}:${ne}`,description:_.message?`${Fe.action} (${_.message})`:Fe.action,duration:6e3}):console.debug(`[tapflow] input refused, shown nowhere: ${ne}${_.message?` — ${_.message}`:""}`)}if(_.type==="device:booting"&&(M(!1),re(!1),ee(!1),O(null),ye(null),Y({postures:[],currentId:null}),J.current.clear(),Ne.current.clear(),W(null)),_.type==="device:ready"){if(M(!0),_.requestId!==void 0&&!he.current.delete(_.requestId))return;if(x.current.pending>0){const{appInstalled:ne}=x.current;if(x.current={pending:x.current.pending-1,appInstalled:ne},ne){ee(!0);return}}if(l){re(!0);const ne=_e();J.current.add(ne),p.current({type:"app:install",sessionId:t,requestId:ne,buildId:l})}}if(_.type==="app:install-done"||_.type==="app:install-error"){if(!J.current.delete(_.requestId))return;re(!1),_.type==="app:install-done"?ee(!0):O(_.message)}if(_.type==="app:launch-done"||_.type==="app:launch-error"){if(!Ne.current.delete(_.requestId))return;q(!1),_.type==="app:launch-error"&&$t.error("The app did not launch",{description:_.message})}if(_.type==="session:chrome"&&W(_.payload),_.type==="device:postures"&&Y(_.payload),_.type==="keyboard:toggled"){const{visible:ne}=_.payload;ut(ne),xe(!1),te.current&&clearTimeout(te.current)}if(_.type==="network:state"||_.type==="network:error"){(ie=ve.current)==null||ie.call(ve,_);return}if(_.type==="device:shutdown-done"||_.type==="device:shutdown-error"){(Se=xt.current)==null||Se.call(xt,_);return}if((_.type==="clipboard:data"||_.type==="clipboard:write-done"||_.type==="clipboard:error")&&((Re=Ie.current)==null||Re.call(Ie,_)),_.type==="open-url:done"||_.type==="open-url:error"){if(!rt.current.delete(_.requestId))return;_.type==="open-url:done"?$t.success("Deeplink opened"):$t.error(_.message)}if(_.type==="error")switch(_.reason){case"session-not-found":{d==null||d("agent-disconnected");return}case"session-busy":{d==null||d("busy-elsewhere");return}case"agent-resources-exhausted":{d==null||d("mac-overloaded");return}}}},e[14]=k,e[15]=l,e[16]=Q,e[17]=d,e[18]=c,e[19]=ze,e[20]=t,e[21]=ht):ht=e[21];const pt=ht;let Oe;e[22]!==Xe?(Oe=_=>{var ne;const ie=aa(_);if(ie&&ie.codec===po){Xe(_.slice(Vr));return}ie&&ie.codec===Lr||S.current.push(ie);const Se=ie?_.slice(Vr):_,Re=ie?{codec:ie.codec,keyframe:ie.keyframe,capturedAt:ie.capturedAt,relayedAt:ie.relayedAt}:void 0;(ne=Ke.current)==null||ne.call(Ke,Se,Re)},e[22]=Xe,e[23]=Oe):Oe=e[23];const Qe=Oe,{send:we,connected:ke}=Es(pt,Qe);let Je;e[24]!==we?(Je=()=>{p.current=we},e[24]=we,e[25]=Je):Je=e[25],a.useLayoutEffect(Je);let Ze,mt;e[26]!==ke||e[27]!==we||e[28]!==t?(Ze=()=>{ke&&we({type:"session:start",sessionId:t})},mt=[ke,we,t],e[26]=ke,e[27]=we,e[28]=t,e[29]=Ze,e[30]=mt):(Ze=e[29],mt=e[30]),a.useEffect(Ze,mt);const Ye=$!==null&&"framePng"in $?$:null,Pe=$!==null&&!("framePng"in $)?$:null;let Yt;e[31]!==we||e[32]!==t?(Yt=()=>{xe(!0),te.current&&clearTimeout(te.current),te.current=setTimeout(()=>{xe(!1),$t.error("The device did not answer. The software keyboard is where it was, as far as tapflow can tell.")},8e3),we({type:"input:keyboard:toggle",sessionId:t})},e[31]=we,e[32]=t,e[33]=Yt):Yt=e[33];const Be=Yt;let sn;e[34]!==t?(sn=_=>{const ie=_e();rt.current.add(ie),p.current({type:"open-url",sessionId:t,requestId:ie,payload:{url:_}})},e[34]=t,e[35]=sn):sn=e[35];const st=sn;let $e;e[36]!==l||e[37]!==t?($e=()=>{if(l===void 0)return;const _=_e();Ne.current.add(_),q(!0),p.current({type:"app:launch",sessionId:t,requestId:_,buildId:l})},e[36]=l,e[37]=t,e[38]=$e):$e=e[38];const gt=$e,Gt=a.useRef(null),yt=a.useRef(!1),wt=a.useRef(!1);let vt;e[39]!==ze?(vt=()=>{wt.current=!0,ze("app-only")},e[39]=ze,e[40]=vt):vt=e[40];const ot=vt;let St;e[41]!==s||e[42]!==P||e[43]!==we||e[44]!==t||e[45]!==ot?(St={sessionId:t,deviceId:s,deviceReady:P,send:we,handlerRef:xt,onShutdownComplete:ot,onError:Oa},e[41]=s,e[42]=P,e[43]=we,e[44]=t,e[45]=ot,e[46]=St):St=e[46];const{pending:it,reboot:et}=Fa(St);let Qt,lt;e[47]!==Pe||e[48]!==Ye?(Qt=()=>{var Se;const _=!!(Ye??Pe),ie=!yt.current&&_;yt.current=_,!(!ie||!wt.current)&&(wt.current=!1,document.activeElement===document.body&&((Se=Gt.current)==null||Se.focus()))},lt=[Ye,Pe],e[47]=Pe,e[48]=Ye,e[49]=Qt,e[50]=lt):(Qt=e[49],lt=e[50]),a.useEffect(Qt,lt);let on,Rt;e[51]!==k||e[52]!==G?(on=()=>{(G||k)&&(wt.current=!1)},Rt=[G,k],e[51]=k,e[52]=G,e[53]=on,e[54]=Rt):(on=e[53],Rt=e[54]),a.useEffect(on,Rt);let Ge;e[55]!==ue?(Ge=ue.includes("clipboard"),e[55]=ue,e[56]=Ge):Ge=e[56];let bt;e[57]!==ue?(bt=ue.includes("network-control"),e[57]=ue,e[58]=bt):bt=e[58];let _t;e[59]!==G||e[60]!==l||e[61]!==ke||e[62]!==P||e[63]!==K||e[64]!==Q||e[65]!==V||e[66]!==A||e[67]!==gt||e[68]!==me||e[69]!==Be||e[70]!==u||e[71]!==st||e[72]!==et||e[73]!==it||e[74]!==we||e[75]!==t||e[76]!==ft||e[77]!==Me||e[78]!==Ge||e[79]!==bt?(_t={sessionId:t,buildId:l,send:we,openUrl:st,launchApp:gt,connected:ke,joined:A,deviceReady:P,installing:V,installed:Q,installError:K,bootError:G,launching:me,binaryFrameHandlerRef:Ke,clipboardHandlerRef:Ie,clipboardSupported:Ge,networkHandlerRef:ve,networkSupported:bt,onRecordingUploaded:u,swKeyboardVisible:Me,swKeyboardPending:ft,onKbdToggle:Be,rebootPending:it,onReboot:et,restartButtonRef:Gt},e[59]=G,e[60]=l,e[61]=ke,e[62]=P,e[63]=K,e[64]=Q,e[65]=V,e[66]=A,e[67]=gt,e[68]=me,e[69]=Be,e[70]=u,e[71]=st,e[72]=et,e[73]=it,e[74]=we,e[75]=t,e[76]=ft,e[77]=Me,e[78]=Ge,e[79]=bt,e[80]=_t):_t=e[80];const He=_t;if(!Ye&&!Pe){let _;e[81]===Symbol.for("react.memo_cache_sentinel")?(_=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(Ha)}),e[81]=_):_=e[81];let ie;e[82]===Symbol.for("react.memo_cache_sentinel")?(ie={background:"#1c1c1e",borderRadius:"34px",padding:"12px",flexShrink:0},e[82]=ie):ie=e[82];let Se;e[83]!==r||e[84]!==f?(Se=Zi(r,f),e[83]=r,e[84]=f,e[85]=Se):Se=e[85];let Re;e[86]!==Se?(Re=i.jsx("div",{"aria-hidden":"true",style:ie,children:i.jsx("div",{"data-testid":"device-skeleton",className:"animate-pulse bg-zinc-700",style:{...Se,borderRadius:"22px"}})}),e[86]=Se,e[87]=Re):Re=e[87];let ne;e[88]!==k||e[89]!==G||e[90]!==ke||e[91]!==P||e[92]!==K||e[93]!==V||e[94]!==A?(ne=i.jsx(Gr,{joined:A,fps:0,connected:ke,deviceReady:P,bootError:G,installing:V,installError:K,decoderUnsupported:!1,keyboardActive:!1,agentAway:k}),e[88]=k,e[89]=G,e[90]=ke,e[91]=P,e[92]=K,e[93]=V,e[94]=A,e[95]=ne):ne=e[95];let Fe;e[96]!==Re||e[97]!==ne?(Fe=i.jsxs("div",{className:"flex items-start gap-8",children:[Re,ne]}),e[96]=Re,e[97]=ne,e[98]=Fe):Fe=e[98];let Et;return e[99]!==_||e[100]!==Fe?(Et=i.jsxs("div",{role:"region","aria-label":"Device screen",className:"flex items-start justify-center gap-16",children:[_,Fe]}),e[99]=_,e[100]=Fe,e[101]=Et):Et=e[101],Et}const ln=void 0;let at;e[102]!==He||e[103]!==r||e[104]!==Ye?(at=Ye&&i.jsx(va,{...He,chrome:Ye,formFactor:r,perfHookRef:ln}),e[102]=He,e[103]=r,e[104]=Ye,e[105]=at):at=e[105];let ct;e[106]!==Pe||e[107]!==He||e[108]!==H?(ct=Pe&&i.jsx(Ea,{...He,androidButtons:Pe.buttons,screenWidth:Pe.screenWidth,screenHeight:Pe.screenHeight,cornerRadius:Pe.cornerRadius,postures:H,streamRotation:Pe.streamRotation,perfHookRef:ln}),e[106]=Pe,e[107]=He,e[108]=H,e[109]=ct):ct=e[109];let kt;e[110]!==h||e[111]!==E?(kt=!1,e[110]=h,e[111]=E,e[112]=kt):kt=e[112];let jt;return e[113]!==at||e[114]!==ct||e[115]!==kt?(jt=i.jsxs(i.Fragment,{children:[at,ct,kt]}),e[113]=at,e[114]=ct,e[115]=kt,e[116]=jt):jt=e[116],jt}function Ha(n,e){return i.jsx("div",{className:"h-8 w-8 rounded-md bg-muted animate-pulse"},e)}function Oa(n){$t.error(n)}function Ba(){}const bo=a.forwardRef((n,e)=>{const t=de.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=Le("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});bo.displayName="Textarea";var Wa=Object.defineProperty,ae=(n,e)=>Wa(n,"name",{value:e,configurable:!0});function xo(n,e){return a.useReducer((t,s)=>e[t][s]??t,n)}ae(xo,"useStateMachine");var yo="ScrollArea",[wo,Oc]=_s(yo),[Va,rn]=wo(yo),qa=a.forwardRef(ae(function(e,t){const{__scopeScrollArea:s,type:r="hover",dir:o,scrollHideDelay:l=600,...c}=e,[u,d]=a.useState(null),[f,p]=a.useState(null),[m,g]=a.useState(null),[x,h]=a.useState(null),[E,w]=a.useState(null),[T,C]=a.useState(0),[S,j]=a.useState(0),[A,R]=a.useState(!1),[k,D]=a.useState(!1),P=or(t,d),M=Wo(o);return i.jsx(Va,{scope:s,type:r,dir:M,scrollHideDelay:l,scrollArea:u,viewport:f,onViewportChange:p,content:m,onContentChange:g,scrollbarX:x,onScrollbarXChange:h,scrollbarXEnabled:A,onScrollbarXEnabledChange:R,scrollbarY:E,onScrollbarYChange:w,scrollbarYEnabled:k,onScrollbarYEnabledChange:D,onCornerWidthChange:C,onCornerHeightChange:j,children:i.jsx(ir.div,{dir:M,...c,ref:P,style:{position:"relative","--radix-scroll-area-corner-width":T+"px","--radix-scroll-area-corner-height":S+"px",...e.style}})})},"ScrollArea")),Ka="ScrollAreaViewport",Xa=a.forwardRef(ae(function(e,t){const{__scopeScrollArea:s,children:r,nonce:o,...l}=e,c=rn(Ka,s),u=a.useRef(null),d=or(t,u,c.onViewportChange);return i.jsxs(i.Fragment,{children:[i.jsx(Ya,{nonce:o}),i.jsx(ir.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")),Ya=a.memo(ae(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),qn="ScrollAreaScrollbar",vo=a.forwardRef(ae(function(e,t){const{forceMount:s,...r}=e,o=rn(qn,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(Ga,{...r,ref:t,forceMount:s}):o.type==="scroll"?i.jsx(Qa,{...r,ref:t,forceMount:s}):o.type==="auto"?i.jsx(So,{...r,ref:t,forceMount:s}):o.type==="always"?i.jsx(Jr,{...r,ref:t,"data-state":"visible"}):null},"ScrollAreaScrollbar")),Ga=a.forwardRef(ae(function(e,t){const{forceMount:s,...r}=e,o=rn(qn,e.__scopeScrollArea),[l,c]=a.useState(!1);return a.useEffect(()=>{const u=o.scrollArea;let d=0;if(u){const f=ae(()=>{window.clearTimeout(d),c(!0)},"handlePointerEnter"),p=ae(()=>{d=window.setTimeout(()=>c(!1),o.scrollHideDelay)},"handlePointerLeave");return u.addEventListener("pointerenter",f),u.addEventListener("pointerleave",p),()=>{window.clearTimeout(d),u.removeEventListener("pointerenter",f),u.removeEventListener("pointerleave",p)}}},[o.scrollArea,o.scrollHideDelay]),i.jsx($r,{present:s||l,children:i.jsx(So,{"data-state":l?"visible":"hidden",...r,ref:t})})},"ScrollAreaScrollbarHover")),Qa=a.forwardRef(ae(function(e,t){const{forceMount:s,...r}=e,o=rn(qn,e.__scopeScrollArea),l=e.orientation==="horizontal",c=Er(()=>d("SCROLL_END"),100),[u,d]=xo("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 f=window.setTimeout(()=>d("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(f)}},[u,o.scrollHideDelay,d]),a.useEffect(()=>{const f=o.viewport,p=l?"scrollLeft":"scrollTop";if(f){let m=f[p];const g=ae(()=>{const x=f[p];m!==x&&(d("SCROLL"),c()),m=x},"handleScroll");return f.addEventListener("scroll",g),()=>f.removeEventListener("scroll",g)}},[o.viewport,l,d,c]),i.jsx($r,{present:s||u!=="hidden",children:i.jsx(Jr,{"data-state":u==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Vn(e.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:Vn(e.onPointerLeave,()=>d("POINTER_LEAVE"))})})},"ScrollAreaScrollbarScroll")),So=a.forwardRef(ae(function(e,t){const s=rn(qn,e.__scopeScrollArea),{forceMount:r,...o}=e,[l,c]=a.useState(!1),u=e.orientation==="horizontal",d=Er(()=>{if(s.viewport){const f=s.viewport.offsetWidth<s.viewport.scrollWidth,p=s.viewport.offsetHeight<s.viewport.scrollHeight;c(u?f:p)}},10);return mr(s.viewport,d),mr(s.content,d),i.jsx($r,{present:r||l,children:i.jsx(Jr,{"data-state":l?"visible":"hidden",...o,ref:t})})},"ScrollAreaScrollbarAuto")),Jr=a.forwardRef(ae(function(e,t){const{orientation:s="vertical",...r}=e,o=rn(qn,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}}),f=Zr(u.viewport,u.content),p={...r,sizes:u,onSizesChange:d,hasThumb:f>0&&f<1,onThumbChange:ae(g=>l.current=g,"onThumbChange"),onThumbPointerUp:ae(()=>c.current=0,"onThumbPointerUp"),onThumbPointerDown:ae(g=>c.current=g,"onThumbPointerDown")};function m(g,x){return jo(g,c.current,u,x)}return ae(m,"getScrollPosition"),s==="horizontal"?i.jsx(Ja,{...p,ref:t,onThumbPositionChange:()=>{if(o.viewport&&l.current){const g=o.viewport.scrollLeft,x=Kr(g,u,o.dir);l.current.style.transform=`translate3d(${x}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(Za,{...p,ref:t,onThumbPositionChange:()=>{if(o.viewport&&l.current){const g=o.viewport.scrollTop,x=Kr(g,u);l.current.style.transform=`translate3d(0, ${x}px, 0)`}},onWheelScroll:g=>{o.viewport&&(o.viewport.scrollTop=g)},onDragScroll:g=>{o.viewport&&(o.viewport.scrollTop=m(g))}}):null},"ScrollAreaScrollbarVisible")),Ja=a.forwardRef(ae(function(e,t){const{sizes:s,onSizesChange:r,...o}=e,l=rn(qn,e.__scopeScrollArea),[c,u]=a.useState(),d=a.useRef(null),f=or(t,d,l.onScrollbarXChange);return a.useEffect(()=>{d.current&&u(getComputedStyle(d.current))},[d]),i.jsx(_o,{"data-orientation":"horizontal",...o,ref:f,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":jr(s)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.x),onDragScroll:p=>e.onDragScroll(p.x),onWheelScroll:(p,m)=>{if(l.viewport){const g=l.viewport.scrollLeft+p.deltaX;e.onWheelScroll(g),ts(g,m)&&p.preventDefault()}},onResize:()=>{d.current&&l.viewport&&c&&r({content:l.viewport.scrollWidth,viewport:l.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:kr(c.paddingLeft),paddingEnd:kr(c.paddingRight)}})}})},"ScrollAreaScrollbarX")),Za=a.forwardRef(ae(function(e,t){const{sizes:s,onSizesChange:r,...o}=e,l=rn(qn,e.__scopeScrollArea),[c,u]=a.useState(),d=a.useRef(null),f=or(t,d,l.onScrollbarYChange);return a.useEffect(()=>{d.current&&u(getComputedStyle(d.current))},[d]),i.jsx(_o,{"data-orientation":"vertical",...o,ref:f,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":jr(s)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.y),onDragScroll:p=>e.onDragScroll(p.y),onWheelScroll:(p,m)=>{if(l.viewport){const g=l.viewport.scrollTop+p.deltaY;e.onWheelScroll(g),ts(g,m)&&p.preventDefault()}},onResize:()=>{d.current&&l.viewport&&c&&r({content:l.viewport.scrollHeight,viewport:l.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:kr(c.paddingTop),paddingEnd:kr(c.paddingBottom)}})}})},"ScrollAreaScrollbarY")),[ec,Ro]=wo(qn),_o=a.forwardRef(ae(function(e,t){const{__scopeScrollArea:s,sizes:r,hasThumb:o,onThumbChange:l,onThumbPointerUp:c,onThumbPointerDown:u,onThumbPositionChange:d,onDragScroll:f,onWheelScroll:p,onResize:m,...g}=e,x=rn(qn,s),[h,E]=a.useState(null),w=or(t,E),T=a.useRef(null),C=a.useRef(""),S=x.viewport,j=r.content-r.viewport,A=hr(p),R=hr(d),k=Er(m,10);function D(P){if(T.current){const M=P.clientX-T.current.left,$=P.clientY-T.current.top;f({x:M,y:$})}}return ae(D,"handleDragScroll"),a.useEffect(()=>{const P=ae(M=>{const $=M.target;(h==null?void 0:h.contains($))&&A(M,j)},"handleWheel");return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[S,h,j,A]),a.useEffect(R,[r,R]),mr(h,k),mr(x.content,k),i.jsx(ec,{scope:s,scrollbar:h,hasThumb:o,onThumbChange:hr(l),onThumbPointerUp:hr(c),onThumbPositionChange:R,onThumbPointerDown:hr(u),children:i.jsx(ir.div,{...g,ref:w,style:{position:"absolute",...g.style},onPointerDown:Vn(e.onPointerDown,P=>{P.button===0&&(P.target.setPointerCapture(P.pointerId),T.current=h.getBoundingClientRect(),C.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",x.viewport&&(x.viewport.style.scrollBehavior="auto"),D(P))}),onPointerMove:Vn(e.onPointerMove,D),onPointerUp:Vn(e.onPointerUp,P=>{const M=P.target;M.hasPointerCapture(P.pointerId)&&M.releasePointerCapture(P.pointerId),document.body.style.webkitUserSelect=C.current,x.viewport&&(x.viewport.style.scrollBehavior=""),T.current=null})})})},"ScrollAreaScrollbarImpl")),qr="ScrollAreaThumb",tc=a.forwardRef(ae(function(e,t){const{forceMount:s,...r}=e,o=Ro(qr,e.__scopeScrollArea);return i.jsx($r,{present:s||o.hasThumb,children:i.jsx(nc,{ref:t,...r})})},"ScrollAreaThumb")),nc=a.forwardRef(ae(function(e,t){const{__scopeScrollArea:s,style:r,...o}=e,l=rn(qr,s),c=Ro(qr,s),{onThumbPositionChange:u}=c,d=or(t,c.onThumbChange),f=a.useRef(void 0),p=Er(()=>{f.current&&(f.current(),f.current=void 0)},100);return a.useEffect(()=>{const m=l.viewport;if(m){const g=ae(()=>{if(p(),!f.current){const x=oc(m,u);f.current=x,u()}},"handleScroll");return u(),m.addEventListener("scroll",g),()=>m.removeEventListener("scroll",g)}},[l.viewport,p,u]),i.jsx(ir.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:Vn(e.onPointerDownCapture,m=>{const x=m.target.getBoundingClientRect(),h=m.clientX-x.left,E=m.clientY-x.top;c.onThumbPointerDown({x:h,y:E})}),onPointerUp:Vn(e.onPointerUp,c.onThumbPointerUp)})},"ScrollAreaThumbImpl")),ko="ScrollAreaCorner",rc=a.forwardRef(ae(function(e,t){const s=rn(ko,e.__scopeScrollArea),r=!!(s.scrollbarX&&s.scrollbarY);return s.type!=="scroll"&&r?i.jsx(sc,{...e,ref:t}):null},"ScrollAreaCorner")),sc=a.forwardRef(ae(function(e,t){const{__scopeScrollArea:s,...r}=e,o=rn(ko,s),[l,c]=a.useState(0),[u,d]=a.useState(0),f=!!(l&&u),{onCornerWidthChange:p,onCornerHeightChange:m}=o;return mr(o.scrollbarX,()=>{var x;const g=((x=o.scrollbarX)==null?void 0:x.offsetHeight)||0;o.onCornerHeightChange(g),d(g)}),mr(o.scrollbarY,()=>{var x;const g=((x=o.scrollbarY)==null?void 0:x.offsetWidth)||0;o.onCornerWidthChange(g),c(g)}),a.useEffect(()=>()=>{p(0),m(0)},[p,m]),f?i.jsx(ir.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 kr(n){return n?parseInt(n,10):0}ae(kr,"toInt");function Zr(n,e){const t=n/e;return isNaN(t)?0:t}ae(Zr,"getThumbRatio");function jr(n){const e=Zr(n.viewport,n.content),t=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,s=(n.scrollbar.size-t)*e;return Math.max(s,18)}ae(jr,"getThumbSize");function jo(n,e,t,s="ltr"){const r=jr(t),o=r/2,l=e||o,c=r-l,u=t.scrollbar.paddingStart+l,d=t.scrollbar.size-t.scrollbar.paddingEnd-c,f=t.content-t.viewport,p=s==="ltr"?[0,f]:[f*-1,0];return es([u,d],p)(n)}ae(jo,"getScrollPositionFromPointer");function Kr(n,e,t="ltr"){const s=jr(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=gi(n,u);return es([0,l],[0,c])(d)}ae(Kr,"getThumbOffsetFromScroll");function es(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])}}ae(es,"linearScale");function ts(n,e){return n>0&&n<e}ae(ts,"isScrollingWithinScrollbarBounds");var oc=ae((n,e=()=>{})=>{let t={left:n.scrollLeft,top:n.scrollTop},s=0;return ae((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 Er(n,e){const t=hr(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])}ae(Er,"useDebounceCallback");function mr(n,e){const t=hr(e);Bo(()=>{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])}ae(mr,"useResizeObserver");var Eo=qa,ic=Xa,lc=rc;const Co=a.forwardRef((n,e)=>{const t=de.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=Le("relative overflow-hidden",r),t[4]=r,t[5]=l):l=t[5];let c;t[6]!==s?(c=i.jsx(ic,{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(To,{}),d=i.jsx(lc,{}),t[8]=u,t[9]=d):(u=t[8],d=t[9]);let f;return t[10]!==o||t[11]!==e||t[12]!==l||t[13]!==c?(f=i.jsxs(Eo,{ref:e,className:l,...o,children:[c,u,d]}),t[10]=o,t[11]=e,t[12]=l,t[13]=c,t[14]=f):f=t[14],f});Co.displayName=Eo.displayName;const To=a.forwardRef((n,e)=>{const t=de.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=Le("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 f;t[8]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(tc,{className:"relative flex-1 rounded-full bg-border"}),t[8]=f):f=t[8];let p;return t[9]!==l||t[10]!==r||t[11]!==e||t[12]!==d?(p=i.jsx(vo,{ref:e,orientation:l,className:d,...r,children:f}),t[9]=l,t[10]=r,t[11]=e,t[12]=d,t[13]=p):p=t[13],p});To.displayName=vo.displayName;function No(n){return/[Zz]|[+-]\d{2}/.test(n)?new Date(n):new Date(n.replace(" ","T")+"Z")}function ac(n){const e=new Map;for(const r of n){const o=No(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 cc(n){return No(n).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}const dc=5*1024*1024,uc=["image/png","image/jpeg","image/webp"];function fc({buildId:n}){const e=a.useId(),[t,s]=a.useState(""),[r,o]=a.useState(null),[l,c]=a.useState(!1),[u,d]=a.useState(""),f=a.useRef(null),p=a.useRef({}),m=ks(),g=js({queryKey:Mr.comments(n),queryFn:()=>Vo(n)}),x=g.data??[],h=()=>{m.invalidateQueries({queryKey:Mr.comments(n)})};a.useEffect(()=>{const S=window.location.hash;if(!S.startsWith("#comment-"))return;const j=Number(S.replace("#comment-","")),A=p.current[j];if(!A)return;A.scrollIntoView({behavior:"smooth"});const R=document.documentElement.classList.contains("dark");A.style.backgroundColor=R?"rgb(0 112 243 / 0.18)":"#d3e5ff",setTimeout(()=>{A.style.backgroundColor=""},2e3)},[g.data]),a.useEffect(()=>{ds()},[]);async function E(S){const{linkBase:j}=await ds(),A=_i(j,`${location.pathname}${location.search}#comment-${S}`);try{if(!navigator.clipboard)throw new Error("no clipboard");await navigator.clipboard.writeText(A),$t.success("Link copied")}catch{$t.error("Could not copy link")}}function w(S){if(d(""),!uc.includes(S.type)){d("Only png, jpg, webp allowed");return}if(S.size>dc){d("Max 5MB");return}o(S)}async function T(S){if(S.preventDefault(),!t.trim()&&!r)return;c(!0);const j=new FormData;j.append("build_id",String(n)),j.append("body",t),r&&j.append("attachment",r),(await fetch("/api/v1/comments",{method:"POST",credentials:"include",body:j})).ok&&(s(""),o(null),h()),c(!1)}const C=ac(x);return i.jsxs("div",{className:"flex h-full flex-col gap-3 px-1",children:[i.jsx(Co,{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."}):x.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:C.map(({label:S,items:j})=>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:j.map(A=>i.jsxs("div",{id:`comment-${A.id}`,ref:R=>{p.current[A.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(qo,{name:A.author,avatarUrl:A.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:A.author}),i.jsx("span",{className:"text-[11px] text-muted-foreground leading-none",children:cc(A.created_at)}),i.jsx(Ve,{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(A.id),children:i.jsx(Vs,{className:"h-3 w-3","aria-hidden":"true"})})]}),i.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap mt-1",children:A.body}),A.attachments.map(R=>{const k=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 ${k} in a new tab`,children:i.jsx("img",{src:R.file_path,alt:k,className:"max-h-48 rounded border object-contain"})},R.id)})]})]},A.id))})]},S))})})}),i.jsx("div",{className:"pb-1",children:i.jsx("form",{onSubmit:T,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(bo,{"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(Ve,{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=f.current)==null?void 0:S.click()},children:i.jsx(Ii,{className:"h-4 w-4","aria-hidden":"true"})}),i.jsx("input",{ref:f,type:"file",accept:"image/png,image/jpeg,image/webp",className:"hidden",onChange:S=>{var A;const j=(A=S.target.files)==null?void 0:A[0];j&&w(j)}}),i.jsx("div",{className:"flex-1"}),i.jsx(Ve,{type:"submit",size:"icon",className:"h-7 w-7 rounded-full","aria-label":"Post comment",disabled:l||!t.trim()&&!r,children:i.jsx(Ei,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})]})})})]})}function hc(n){return n<1024*1024?`${(n/1024).toFixed(0)} KB`:`${(n/1024/1024).toFixed(1)} MB`}function pc(n){return new Date(n).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function mc(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 gc(n,e,t){const s=de.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 bc(n){const e=de.c(17),{buildId:t}=n;let s;e[0]!==t?(s=Mr.recordings(t),e[0]=t,e[1]=s):s=e[1];let r;e[2]!==t?(r=()=>Ko(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=js(o);let c;e[7]!==l.data?(c=l.data??[],e[7]=l.data,e[8]=c):c=e[8];const u=c,d=gc(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 f;e[13]!==u?(f=u.map(xc),e[13]=u,e[14]=f):f=e[14];let p;return e[15]!==f?(p=i.jsx("div",{className:"flex flex-col gap-2",children:f}),e[15]=f,e[16]=p):p=e[16],p}function xc(n){const e=mc(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:pc(n.createdAt)}),i.jsxs("span",{className:`text-xs ${e.urgent?"text-destructive":"text-muted-foreground"}`,children:[e.label," · ",hc(n.fileSize)]})]}),i.jsx(Ve,{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(Ti,{className:"h-3.5 w-3.5"})})]},n.id)}function yc(n){const e=de.c(9),{buildId:t}=n;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsxs(ls,{value:"comments",className:"flex-1 gap-1.5",children:[i.jsx(Di,{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(ei,{className:"w-full",children:[s,i.jsxs(ls,{value:"recordings",className:"flex-1 gap-1.5",children:[i.jsx(Ni,{className:"h-3.5 w-3.5"}),"Recordings"]})]})}),e[1]=r):r=e[1];let o;e[2]!==t?(o=i.jsx(as,{value:"comments",className:"mt-3 min-h-0 flex-1 overflow-hidden",children:i.jsx(fc,{buildId:t})}),e[2]=t,e[3]=o):o=e[3];let l;e[4]!==t?(l=i.jsx(as,{value:"recordings",className:"mt-3 min-h-0 flex-1 overflow-y-auto",children:i.jsx(bc,{buildId:t})}),e[4]=t,e[5]=l):l=e[5];let c;return e[6]!==o||e[7]!==l?(c=i.jsxs(ti,{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 Ao=a.forwardRef((n,e)=>{const t=de.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});Ao.displayName="Breadcrumb";const Io=a.forwardRef((n,e)=>{const t=de.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=Le("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});Io.displayName="BreadcrumbList";const Rr=a.forwardRef((n,e)=>{const t=de.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=Le("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});Rr.displayName="BreadcrumbItem";const Ir=a.forwardRef((n,e)=>{const t=de.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?Xo:"a";let c;t[4]!==r?(c=Le("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});Ir.displayName="BreadcrumbLink";const Pr=a.forwardRef((n,e)=>{const t=de.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=Le("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});Pr.displayName="BreadcrumbPage";const Dr=n=>{const e=de.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=Le("[&>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(Yo,{}),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};Dr.displayName="BreadcrumbSeparator";var wc=Object.defineProperty,sr=(n,e)=>wc(n,"name",{value:e,configurable:!0}),ns="Switch",[vc,Bc]=_s(ns),[Sc,rs]=vc(ns);function Po(n){const{__scopeSwitch:e,checked:t,children:s,defaultChecked:r,disabled:o,form:l,name:c,onCheckedChange:u,required:d,value:f="on",internal_do_not_use_render:p}=n,[m,g]=Qo({prop:t,defaultProp:r??!1,onChange:u,caller:ns}),[x,h]=a.useState(null),[E,w]=a.useState(null),T=a.useRef(!1),[C,S]=a.useReducer(R=>R+1,0),j=x?!!l||!!x.closest("form"):!0,A={checked:m,setChecked:g,disabled:o,control:x,setControl:h,name:c,form:l,value:f,hasConsumerStoppedPropagationRef:T,userInteractionCount:C,onUserInteraction:S,required:d,defaultChecked:r,isFormControl:j,bubbleInput:E,setBubbleInput:w};return i.jsx(Sc,{scope:e,...A,children:Mo(p)?p(A):s})}sr(Po,"SwitchProvider");var Rc="SwitchTrigger",_c=a.forwardRef(sr(function({__scopeSwitch:e,onClick:t,...s},r){const{control:o,form:l,value:c,disabled:u,checked:d,required:f,setControl:p,setChecked:m,hasConsumerStoppedPropagationRef:g,onUserInteraction:x,isFormControl:h,bubbleInput:E}=rs(Rc,e),w=or(r,p),T=a.useRef(d);return a.useEffect(()=>{const C=l?o==null?void 0:o.ownerDocument.getElementById(l):o==null?void 0:o.form;if(C instanceof HTMLFormElement){const S=sr(()=>m(T.current),"reset");return C.addEventListener("reset",S),()=>C.removeEventListener("reset",S)}},[o,l,m]),i.jsx(ir.button,{type:"button",role:"switch","aria-checked":d,"aria-required":f,"data-state":ss(d),"data-disabled":u?"":void 0,disabled:u,value:c,...s,ref:w,onClick:Vn(t,C=>{x(),m(S=>!S),E&&h&&(g.current=C.isPropagationStopped(),g.current||C.stopPropagation())})})},"SwitchTrigger")),Do=a.forwardRef(sr(function(e,t){const{__scopeSwitch:s,name:r,checked:o,defaultChecked:l,required:c,disabled:u,value:d,onCheckedChange:f,form:p,...m}=e;return i.jsx(Po,{__scopeSwitch:s,checked:o,defaultChecked:l,disabled:u,required:c,onCheckedChange:f,name:r,form:p,value:d,internal_do_not_use_render:({isFormControl:g})=>i.jsxs(i.Fragment,{children:[i.jsx(_c,{...m,ref:t,__scopeSwitch:s}),g&&i.jsx(Cc,{__scopeSwitch:s})]})})},"Switch")),kc="SwitchThumb",jc=a.forwardRef(sr(function(e,t){const{__scopeSwitch:s,...r}=e,o=rs(kc,s);return i.jsx(ir.span,{"data-state":ss(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})},"SwitchThumb")),Ec="SwitchBubbleInput",Cc=a.forwardRef(sr(function({__scopeSwitch:e,onClick:t,...s},r){const{control:o,hasConsumerStoppedPropagationRef:l,userInteractionCount:c,checked:u,defaultChecked:d,required:f,disabled:p,name:m,value:g,form:x,bubbleInput:h,setBubbleInput:E}=rs(Ec,e),w=or(r,E),T=Go(o),C=a.useRef(!1),S=a.useRef(u),j=a.useRef(c);a.useEffect(()=>{const R=h;if(!R)return;const k=window.HTMLInputElement.prototype,P=Object.getOwnPropertyDescriptor(k,"checked").set,M=c!==j.current;j.current=c;const $=S.current!==u;S.current=u;const W=!(M&&l.current);if($&&P){C.current=!M;const U=new Event("click",{bubbles:W});P.call(R,u),R.dispatchEvent(U),C.current=!1}},[h,u,l,c]);const A=a.useRef(u);return i.jsx(ir.input,{type:"checkbox","aria-hidden":!0,defaultChecked:d??A.current,required:f,disabled:p,name:m,value:g,form:x,...s,tabIndex:-1,ref:w,onClick:Vn(t,R=>{C.current&&R.stopPropagation()}),style:{...s.style,...T,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function Mo(n){return typeof n=="function"}sr(Mo,"isFunction");function ss(n){return n?"checked":"unchecked"}sr(ss,"getState");const Lo=a.forwardRef((n,e)=>{const t=de.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=Le("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(jc,{className:Le("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(Do,{className:o,...r,ref:e,children:l}),t[6]=r,t[7]=e,t[8]=o,t[9]=c):c=t[9],c});Lo.displayName=Do.displayName;const Tc={"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 Wc(){const n=de.c(62),[e]=Cs(),t=si();let s;n[0]!==e?(s=e.get("id"),n[0]=e,n[1]=s):s=n[1];const r=s,{build:o}=Vi(r),l=ks(),c=(o==null?void 0:o.platform)??"ios",{sessions:u,activeFormFactor:d,selectedAgent:f,setSelectedAgent:p,activeSessionId:m,deviceId:g,booting:x,status:h,connected:E,agentGroups:w,startDevice:T,resetDevice:C,handleBack:S,handleBackToMacs:j,handleSessionEnded:A}=qi(c);let R;if(n[2]!==w||n[3]!==f){let z;n[5]!==f?(z=J=>J.agentName===f,n[5]=f,n[6]=z):z=n[6],R=w.find(z),n[2]=w,n[3]=f,n[4]=R}else R=n[4];const k=R,{osVersions:D,osVersion:P,setOsVersion:M,deviceSearch:$,setDeviceSearch:W,versionedDevices:U,resetMode:H,setResetMode:Y,appliedResetMode:V,consumeResetMode:re,fullResetSupported:Q}=Xi(k,c);let ee;if(n[7]!==g||n[8]!==u){const z=u.flatMap(Ac);let J;n[10]!==g?(J=be=>be.id===g,n[10]=g,n[11]=J):J=n[11],ee=z.find(J),n[7]=g,n[8]=u,n[9]=ee}else ee=n[9];const K=ee,O=K?`${K.name}${K.osVersion?` · ${K.osVersion}`:""}`:"";let G;n[12]!==l?(G=()=>{l.invalidateQueries({queryKey:Mr.allRecordings})},n[12]=l,n[13]=G):G=n[13];const ye=G;let me;n[14]!==re||n[15]!==T?(me=z=>{re(),T(z)},n[14]=re,n[15]=T,n[16]=me):me=n[16];const q=me;let se;n[17]!==A?(se=z=>{const J=Tc[z];$t.error(J.title,{description:J.description}),A()},n[17]=A,n[18]=se):se=n[18];const ue=se,{setNode:ge}=Jo();let X,he;n[19]!==m||n[20]!==o||n[21]!==O||n[22]!==S||n[23]!==j||n[24]!==t||n[25]!==f||n[26]!==ge?(X=()=>{if(o)return ge(i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(Ao,{children:i.jsxs(Io,{children:[i.jsx(Rr,{children:i.jsx(Ir,{asChild:!0,children:i.jsx("button",{onClick:()=>t(`/app-center?appId=${o.app_id}`),children:o.name})})}),i.jsx(Dr,{}),i.jsx(Rr,{children:f?i.jsx(Ir,{asChild:!0,children:i.jsx("button",{onClick:j,children:cs(o)})}):i.jsx(Pr,{children:cs(o)})}),f&&i.jsxs(i.Fragment,{children:[i.jsx(Dr,{}),i.jsx(Rr,{children:m?i.jsx(Ir,{asChild:!0,children:i.jsx("button",{onClick:S,children:f})}):i.jsx(Pr,{children:f})})]}),m&&i.jsxs(i.Fragment,{children:[i.jsx(Dr,{}),i.jsx(Rr,{children:i.jsx(Pr,{children:O})})]})]})}),!f&&o.status_label&&i.jsx(ki,{tone:Ri[o.status_label],children:o.status_label})]})),()=>ge(null)},he=[o,f,m,O,t,S,j,ge],n[19]=m,n[20]=o,n[21]=O,n[22]=S,n[23]=j,n[24]=t,n[25]=f,n[26]=ge,n[27]=X,n[28]=he):(X=n[27],he=n[28]),a.useEffect(X,he);let Te;n[29]!==d||n[30]!==m||n[31]!==w||n[32]!==V||n[33]!==x||n[34]!==(o==null?void 0:o.id)||n[35]!==E||n[36]!==g||n[37]!==$||n[38]!==Q||n[39]!==j||n[40]!==ye||n[41]!==q||n[42]!==ue||n[43]!==c||n[44]!==P||n[45]!==D||n[46]!==C||n[47]!==H||n[48]!==f||n[49]!==(K==null?void 0:K.formFactor)||n[50]!==W||n[51]!==M||n[52]!==Y||n[53]!==p||n[54]!==h||n[55]!==U?(Te=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:m?i.jsx("div",{className:"min-h-full flex items-center justify-center py-6 px-8 min-w-max",children:i.jsx(za,{sessionId:m,deviceId:g,formFactor:(K==null?void 0:K.formFactor)??d,platform:c,buildId:o==null?void 0:o.id,resetMode:V,onRecordingUploaded:ye,onSessionEnded:ue})}):f?i.jsxs("div",{className:"flex flex-col gap-5",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("button",{onClick:j,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(Si,{"aria-label":"Search devices",placeholder:"Search device…",value:$,onChange:W}),D.length>0&&i.jsxs(bi,{value:P||"__all__",onValueChange:z=>{M(z==="__all__"?"":z),C()},children:[i.jsx(xi,{className:"h-8 w-36 shrink-0","aria-label":"Filter by OS version",children:i.jsx(yi,{})}),i.jsxs(wi,{children:[i.jsx(Is,{value:"__all__",children:"Any version"}),D.map(Nc)]})]}),Q&&i.jsx(Or,{children:i.jsxs(Dt,{children:[i.jsx(Mt,{asChild:!0,children:i.jsxs("div",{className:"ml-auto flex items-center gap-2 shrink-0",children:[i.jsx(Zo,{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(Lo,{id:"reset-mode","aria-describedby":"reset-mode-desc",checked:H==="full-erase",onCheckedChange:z=>Y(z?"full-erase":"app-only")})]})}),i.jsx(Lt,{children:H==="full-erase"?"Erase all data on the next device you pick":"Keep existing data"})]})})]}),U.length===0?i.jsx("p",{className:"text-sm text-muted-foreground",children:E?"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:U.map(z=>{const J=z.status==="booted",be=z.busy,Ne=be?"In use":J?"Booted":"Available",Me=be?"bg-amber-400":J?"bg-emerald-400":"bg-muted-foreground/40";return i.jsxs("button",{disabled:be||x||!E,onClick:()=>q(z),className:Le("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:Le("inline-block h-1.5 w-1.5 rounded-full",Me)}),Ne]})]},z.id)})}),h&&i.jsx("p",{className:"text-sm text-muted-foreground",children:h})]}):i.jsxs("div",{className:"flex flex-col gap-5",children:[i.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Select Mac"}),w.length===0?i.jsx("p",{className:"text-sm text-muted-foreground",children:E?`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:w.map(z=>{const J=z.resources,be=J?Date.now()-J.reportedAt>ni:!1,Ne=z.devices.filter(te=>te.platform===c).length,Me=(J==null?void 0:J.cpuPercent)??0,ut=J?J.memUsedMB/J.memTotalMB*100:0,ft=ri(J,be),xe=ft==="overloaded";return i.jsx(Or,{children:i.jsxs(Dt,{children:[i.jsx(Mt,{asChild:!0,children:i.jsx("span",{tabIndex:xe?0:void 0,className:xe?"cursor-not-allowed":void 0,children:i.jsxs("button",{disabled:xe,"aria-disabled":xe,onClick:()=>p(z.agentName??null),className:Le("flex flex-col gap-3 rounded-lg border p-3 text-left transition-colors min-h-[100px] w-full",xe?"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(Ic,{health:ft}),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:[Ne," device",Ne!==1?"s":""]}),J&&i.jsxs(i.Fragment,{children:[i.jsx("span",{children:"·"}),i.jsxs("span",{children:[J.slotsAvailable,"/",J.slotsTotal," slots"]})]})]}),J&&!be&&i.jsxs("div",{className:"flex flex-col gap-1.5 w-full",children:[i.jsx(Ss,{label:"CPU",percent:Me,colorClass:"bg-blue-400"}),i.jsx(Ss,{label:"RAM",percent:ut,colorClass:"bg-violet-400"})]})]})})}),xe&&i.jsx(Lt,{children:"This Mac is currently overloaded. Try again later."})]})},z.agentName)})})]})})}),n[29]=d,n[30]=m,n[31]=w,n[32]=V,n[33]=x,n[34]=o==null?void 0:o.id,n[35]=E,n[36]=g,n[37]=$,n[38]=Q,n[39]=j,n[40]=ye,n[41]=q,n[42]=ue,n[43]=c,n[44]=P,n[45]=D,n[46]=C,n[47]=H,n[48]=f,n[49]=K==null?void 0:K.formFactor,n[50]=W,n[51]=M,n[52]=Y,n[53]=p,n[54]=h,n[55]=U,n[56]=Te):Te=n[56];let oe;n[57]!==r?(oe=r&&i.jsxs(i.Fragment,{children:[i.jsx(Rs,{orientation:"vertical",className:"h-auto"}),i.jsx("div",{className:"w-80 shrink-0 h-full",children:i.jsx(yc,{buildId:Number(r)})})]}),n[57]=r,n[58]=oe):oe=n[58];let rt;return n[59]!==Te||n[60]!==oe?(rt=i.jsxs("div",{className:"flex h-full min-h-0 gap-6 p-6",children:[Te,oe]}),n[59]=Te,n[60]=oe,n[61]=rt):rt=n[61],rt}function Nc(n){return i.jsx(Is,{value:n,children:n},n)}function Ac(n){return n.devices}function Ic(n){const e=de.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=Le("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 Ss(n){const e=de.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=Le("h-full rounded-full transition-all",r),e[9]=r,e[10]=d):d=e[10];const f=`${Math.min(100,s)}%`;let p;e[11]!==f?(p={width:f},e[11]=f,e[12]=p):p=e[12];let m;e[13]!==d||e[14]!==p?(m=i.jsx("div",{className:"h-1 w-full rounded-full bg-muted overflow-hidden",children:i.jsx("div",{className:d,style:p})}),e[13]=d,e[14]=p,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{Wc as QASession};