@air-jam/sdk 0.9.3 → 1.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (594) hide show
  1. package/README.md +168 -205
  2. package/dist/actions-D4eh6Xaa.d.cts +72 -0
  3. package/dist/actions-D4eh6Xaa.d.ts +72 -0
  4. package/dist/{agent-contract-CD2QnbBJ.d.cts → agent-contract-BMvCMvhE.d.ts} +3 -19
  5. package/dist/{agent-contract-CD2QnbBJ.d.ts → agent-contract-DtYf3ici.d.cts} +3 -19
  6. package/dist/agent-tooling.cjs +135 -46
  7. package/dist/agent-tooling.cjs.map +1 -1
  8. package/dist/agent-tooling.d.cts +96 -5
  9. package/dist/agent-tooling.d.ts +96 -5
  10. package/dist/agent-tooling.js +15 -14
  11. package/dist/agent-tooling.js.map +1 -1
  12. package/dist/{use-air-jam-host-COLy8t4s.d.ts → air-jam-context-B1fQvyYY.d.ts} +121 -114
  13. package/dist/{use-air-jam-host-DM-ybB3C.d.cts → air-jam-context-BKg_ujpd.d.cts} +121 -114
  14. package/dist/arcade/bridge/controller.cjs +873 -603
  15. package/dist/arcade/bridge/controller.cjs.map +1 -1
  16. package/dist/arcade/bridge/controller.d.cts +28 -76
  17. package/dist/arcade/bridge/controller.d.ts +28 -76
  18. package/dist/arcade/bridge/controller.js +27 -28
  19. package/dist/arcade/bridge/controller.js.map +1 -1
  20. package/dist/arcade/bridge/host.cjs +1017 -252
  21. package/dist/arcade/bridge/host.cjs.map +1 -1
  22. package/dist/arcade/bridge/host.d.cts +6 -72
  23. package/dist/arcade/bridge/host.d.ts +6 -72
  24. package/dist/arcade/bridge/host.js +19 -22
  25. package/dist/arcade/bridge/host.js.map +1 -1
  26. package/dist/arcade/bridge/iframe.cjs +3 -31
  27. package/dist/arcade/bridge/iframe.cjs.map +1 -1
  28. package/dist/arcade/bridge/iframe.d.cts +4 -46
  29. package/dist/arcade/bridge/iframe.d.ts +4 -46
  30. package/dist/arcade/bridge/iframe.js +6 -18
  31. package/dist/arcade/bridge/iframe.js.map +1 -1
  32. package/dist/arcade/host.cjs +0 -502
  33. package/dist/arcade/host.cjs.map +1 -1
  34. package/dist/arcade/host.d.cts +1 -19
  35. package/dist/arcade/host.d.ts +1 -19
  36. package/dist/arcade/host.js +0 -14
  37. package/dist/arcade/host.js.map +1 -1
  38. package/dist/arcade/runtime.cjs +10373 -4688
  39. package/dist/arcade/runtime.cjs.map +1 -1
  40. package/dist/arcade/runtime.d.cts +45 -13
  41. package/dist/arcade/runtime.d.ts +45 -13
  42. package/dist/arcade/runtime.js +37 -24
  43. package/dist/arcade/runtime.js.map +1 -1
  44. package/dist/arcade/surface.cjs +3 -35
  45. package/dist/arcade/surface.cjs.map +1 -1
  46. package/dist/arcade/surface.d.cts +14 -2
  47. package/dist/arcade/surface.d.ts +14 -2
  48. package/dist/arcade/surface.js +7 -13
  49. package/dist/arcade/surface.js.map +1 -1
  50. package/dist/arcade/url.cjs +45 -283
  51. package/dist/arcade/url.cjs.map +1 -1
  52. package/dist/arcade/url.d.cts +3 -56
  53. package/dist/arcade/url.d.ts +3 -56
  54. package/dist/arcade/url.js +33 -16
  55. package/dist/arcade/url.js.map +1 -1
  56. package/dist/chunk-24NZZOIO.js +700 -0
  57. package/dist/chunk-24NZZOIO.js.map +1 -0
  58. package/dist/chunk-27QLKLZL.js +469 -0
  59. package/dist/chunk-27QLKLZL.js.map +1 -0
  60. package/dist/{chunk-UWJOIVON.js → chunk-2H2FGF3H.js} +3 -6
  61. package/dist/chunk-2H2FGF3H.js.map +1 -0
  62. package/dist/chunk-3LDQCQL2.js +307 -0
  63. package/dist/chunk-3LDQCQL2.js.map +1 -0
  64. package/dist/chunk-3M7656SU.js +389 -0
  65. package/dist/chunk-3M7656SU.js.map +1 -0
  66. package/dist/{chunk-K4OZ54UD.js → chunk-5CRZFIN6.js} +2 -55
  67. package/dist/chunk-5CRZFIN6.js.map +1 -0
  68. package/dist/chunk-5L3O3G5K.js +802 -0
  69. package/dist/chunk-5L3O3G5K.js.map +1 -0
  70. package/dist/{chunk-O6X7FJ6N.js → chunk-6PLOJMJD.js} +619 -643
  71. package/dist/chunk-6PLOJMJD.js.map +1 -0
  72. package/dist/{chunk-EVZJA6RN.js → chunk-6ZJUA63D.js} +183 -2
  73. package/dist/chunk-6ZJUA63D.js.map +1 -0
  74. package/dist/chunk-A6EOGRRG.js +49 -0
  75. package/dist/chunk-A6EOGRRG.js.map +1 -0
  76. package/dist/chunk-AXG6FA2H.js +366 -0
  77. package/dist/chunk-AXG6FA2H.js.map +1 -0
  78. package/dist/chunk-BEM77SVQ.js +57 -0
  79. package/dist/chunk-BEM77SVQ.js.map +1 -0
  80. package/dist/chunk-BQHGPXXN.js +1995 -0
  81. package/dist/chunk-BQHGPXXN.js.map +1 -0
  82. package/dist/chunk-C5722GTG.js +176 -0
  83. package/dist/chunk-C5722GTG.js.map +1 -0
  84. package/dist/{chunk-CV3PBXPT.js → chunk-C5GS2GMK.js} +99 -105
  85. package/dist/chunk-C5GS2GMK.js.map +1 -0
  86. package/dist/chunk-CDL7LYZH.js +19 -0
  87. package/dist/chunk-CDL7LYZH.js.map +1 -0
  88. package/dist/{chunk-PSUYTD2L.js → chunk-DA3TE4OP.js} +1 -1
  89. package/dist/chunk-DA3TE4OP.js.map +1 -0
  90. package/dist/chunk-DBF7NJ3S.js +72 -0
  91. package/dist/chunk-DBF7NJ3S.js.map +1 -0
  92. package/dist/chunk-DRBPVG47.js +89 -0
  93. package/dist/chunk-DRBPVG47.js.map +1 -0
  94. package/dist/chunk-FCG42U7D.js +131 -0
  95. package/dist/chunk-FCG42U7D.js.map +1 -0
  96. package/dist/chunk-FJ4J2BEC.js +26 -0
  97. package/dist/chunk-FJ4J2BEC.js.map +1 -0
  98. package/dist/chunk-H4DEVMTO.js +221 -0
  99. package/dist/chunk-H4DEVMTO.js.map +1 -0
  100. package/dist/chunk-ISQZ7F3N.js +83 -0
  101. package/dist/chunk-ISQZ7F3N.js.map +1 -0
  102. package/dist/{chunk-IG6GZZSS.js → chunk-JCGTL77W.js} +1 -1
  103. package/dist/chunk-JCGTL77W.js.map +1 -0
  104. package/dist/chunk-JJVCBUYM.js +98 -0
  105. package/dist/chunk-JJVCBUYM.js.map +1 -0
  106. package/dist/chunk-K6BJJJJM.js +138 -0
  107. package/dist/chunk-K6BJJJJM.js.map +1 -0
  108. package/dist/{chunk-MIMPMB7O.js → chunk-KGY4PV2A.js} +24 -3
  109. package/dist/chunk-KGY4PV2A.js.map +1 -0
  110. package/dist/chunk-KKRLHT2M.js +2477 -0
  111. package/dist/chunk-KKRLHT2M.js.map +1 -0
  112. package/dist/chunk-KSYN4I5Y.js +50 -0
  113. package/dist/chunk-KSYN4I5Y.js.map +1 -0
  114. package/dist/chunk-KUGROY5S.js +265 -0
  115. package/dist/chunk-KUGROY5S.js.map +1 -0
  116. package/dist/chunk-LX6CTPDW.js +16 -0
  117. package/dist/chunk-LX6CTPDW.js.map +1 -0
  118. package/dist/{chunk-BE6Z4SIT.js → chunk-M5553I2G.js} +2 -11
  119. package/dist/chunk-M5553I2G.js.map +1 -0
  120. package/dist/{chunk-X24K52DG.js → chunk-MD25536W.js} +1 -1
  121. package/dist/chunk-MD25536W.js.map +1 -0
  122. package/dist/{chunk-3USU7GY2.js → chunk-MJAWAHLT.js} +1 -1
  123. package/dist/chunk-MJAWAHLT.js.map +1 -0
  124. package/dist/chunk-NBA7UIWG.js +921 -0
  125. package/dist/chunk-NBA7UIWG.js.map +1 -0
  126. package/dist/chunk-OAXCFPZ7.js +14 -0
  127. package/dist/chunk-OAXCFPZ7.js.map +1 -0
  128. package/dist/{chunk-D4VDEVTZ.js → chunk-QHBRHYMV.js} +18 -17
  129. package/dist/chunk-QHBRHYMV.js.map +1 -0
  130. package/dist/chunk-QTNYGAZ7.js +45 -0
  131. package/dist/chunk-QTNYGAZ7.js.map +1 -0
  132. package/dist/chunk-UC24OG4X.js +129 -0
  133. package/dist/chunk-UC24OG4X.js.map +1 -0
  134. package/dist/chunk-VN2PX2I3.js +188 -0
  135. package/dist/chunk-VN2PX2I3.js.map +1 -0
  136. package/dist/chunk-WAFGYJZN.js +1513 -0
  137. package/dist/chunk-WAFGYJZN.js.map +1 -0
  138. package/dist/chunk-WGHNGQUS.js +78 -0
  139. package/dist/chunk-WGHNGQUS.js.map +1 -0
  140. package/dist/{chunk-X35LLCWV.js → chunk-X5HZBQ6K.js} +6 -8
  141. package/dist/chunk-X5HZBQ6K.js.map +1 -0
  142. package/dist/chunk-XLY44PXZ.js +46 -0
  143. package/dist/chunk-XLY44PXZ.js.map +1 -0
  144. package/dist/chunk-YXHAWWVU.js +7 -0
  145. package/dist/chunk-YXHAWWVU.js.map +1 -0
  146. package/dist/connection-store-CqW-E7ma.d.cts +41 -0
  147. package/dist/connection-store-ffHWMrMe.d.ts +41 -0
  148. package/dist/control-Bv8dWjyp.d.ts +1400 -0
  149. package/dist/control-CNzybWMd.d.cts +1400 -0
  150. package/dist/controller-ClW0R8mZ.d.cts +26 -0
  151. package/dist/controller-DRKCa7uQ.d.ts +26 -0
  152. package/dist/controller-agent-vOiuK7T6.d.cts +130 -0
  153. package/dist/controller-agent-vOiuK7T6.d.ts +130 -0
  154. package/dist/controller-bridge.cjs +992 -0
  155. package/dist/controller-bridge.cjs.map +1 -0
  156. package/dist/controller-bridge.d.cts +52 -0
  157. package/dist/controller-bridge.d.ts +52 -0
  158. package/dist/controller-bridge.js +23 -0
  159. package/dist/controller-bridge.js.map +1 -0
  160. package/dist/controller-capture-2GKKGHJ2.js +8 -0
  161. package/dist/controller-capture-2GKKGHJ2.js.map +1 -0
  162. package/dist/controller-press-EWWIMVXP.js +231 -0
  163. package/dist/controller-press-EWWIMVXP.js.map +1 -0
  164. package/dist/core-BAO0pHrJ.d.cts +15 -0
  165. package/dist/core-BAO0pHrJ.d.ts +15 -0
  166. package/dist/core.cjs +5956 -0
  167. package/dist/core.cjs.map +1 -0
  168. package/dist/core.d.cts +250 -0
  169. package/dist/core.d.ts +250 -0
  170. package/dist/core.js +910 -0
  171. package/dist/core.js.map +1 -0
  172. package/dist/dev-events-BffobOfb.d.ts +31 -0
  173. package/dist/dev-events-Ct7QEgKb.d.cts +31 -0
  174. package/dist/dev-log-events-B1_B3guZ.d.cts +47 -0
  175. package/dist/dev-log-events-B1_B3guZ.d.ts +47 -0
  176. package/dist/frames-D-xKuODS.d.cts +686 -0
  177. package/dist/frames-D-xKuODS.d.ts +686 -0
  178. package/dist/game-5n-dh5np.d.cts +77 -0
  179. package/dist/game-RYb97BN8.d.ts +77 -0
  180. package/dist/host-runtime-BRtUidEJ.d.cts +399 -0
  181. package/dist/host-runtime-RrO4pCXI.d.ts +399 -0
  182. package/dist/index.cjs +11571 -7554
  183. package/dist/index.cjs.map +1 -1
  184. package/dist/index.d.cts +100 -358
  185. package/dist/index.d.ts +100 -358
  186. package/dist/index.js +414 -1903
  187. package/dist/index.js.map +1 -1
  188. package/dist/input-D7FNeehb.d.cts +92 -0
  189. package/dist/input-D7FNeehb.d.ts +92 -0
  190. package/dist/input-bindings-686sTen7.d.ts +129 -0
  191. package/dist/input-bindings-BRac-P0e.d.cts +129 -0
  192. package/dist/leased-control-BEg4JuXA.d.cts +158 -0
  193. package/dist/leased-control-BEg4JuXA.d.ts +158 -0
  194. package/dist/metadata.cjs +3 -9
  195. package/dist/metadata.cjs.map +1 -1
  196. package/dist/metadata.d.cts +6 -16
  197. package/dist/metadata.d.ts +6 -16
  198. package/dist/metadata.js +8 -76
  199. package/dist/metadata.js.map +1 -1
  200. package/dist/phone-room-session-Byomkt92.d.cts +439 -0
  201. package/dist/phone-room-session-D9C8cSxS.d.ts +439 -0
  202. package/dist/platform-machine.cjs +133 -3
  203. package/dist/platform-machine.cjs.map +1 -1
  204. package/dist/platform-machine.d.cts +525 -27
  205. package/dist/platform-machine.d.ts +525 -27
  206. package/dist/platform-machine.js +119 -4
  207. package/dist/platform-machine.js.map +1 -1
  208. package/dist/{platform-settings-DUWs4JTy.d.cts → platform-settings-Yb0fQ1dl.d.cts} +1 -3
  209. package/dist/{platform-settings-DUWs4JTy.d.ts → platform-settings-Yb0fQ1dl.d.ts} +1 -3
  210. package/dist/prefabs.cjs +134 -3
  211. package/dist/prefabs.cjs.map +1 -1
  212. package/dist/prefabs.d.cts +23 -47
  213. package/dist/prefabs.d.ts +23 -47
  214. package/dist/prefabs.js +23 -4
  215. package/dist/prefabs.js.map +1 -1
  216. package/dist/preview.cjs +2199 -767
  217. package/dist/preview.cjs.map +1 -1
  218. package/dist/preview.d.cts +193 -38
  219. package/dist/preview.d.ts +193 -38
  220. package/dist/preview.js +478 -254
  221. package/dist/preview.js.map +1 -1
  222. package/dist/protocol.cjs +585 -391
  223. package/dist/protocol.cjs.map +1 -1
  224. package/dist/protocol.d.cts +13 -117
  225. package/dist/protocol.d.ts +13 -117
  226. package/dist/protocol.js +43 -80
  227. package/dist/protocol.js.map +1 -1
  228. package/dist/release.cjs.map +1 -1
  229. package/dist/release.d.cts +2 -2
  230. package/dist/release.d.ts +2 -2
  231. package/dist/release.js +1 -1
  232. package/dist/release.js.map +1 -1
  233. package/dist/replay-input-log-D0NpnA3P.d.ts +31 -0
  234. package/dist/replay-input-log-bg0g-PCz.d.cts +31 -0
  235. package/dist/room-protocol.cjs +794 -0
  236. package/dist/room-protocol.cjs.map +1 -0
  237. package/dist/room-protocol.d.cts +63 -0
  238. package/dist/room-protocol.d.ts +63 -0
  239. package/dist/room-protocol.js +143 -0
  240. package/dist/room-protocol.js.map +1 -0
  241. package/dist/room-session.cjs +2336 -0
  242. package/dist/room-session.cjs.map +1 -0
  243. package/dist/room-session.d.cts +77 -0
  244. package/dist/room-session.d.ts +77 -0
  245. package/dist/room-session.js +103 -0
  246. package/dist/room-session.js.map +1 -0
  247. package/dist/runtime/prefab-inspection-bridge.cjs +207 -0
  248. package/dist/runtime/prefab-inspection-bridge.cjs.map +1 -0
  249. package/dist/runtime/prefab-inspection-bridge.d.cts +156 -0
  250. package/dist/runtime/prefab-inspection-bridge.d.ts +156 -0
  251. package/dist/runtime/prefab-inspection-bridge.js +22 -0
  252. package/dist/runtime/prefab-inspection-bridge.js.map +1 -0
  253. package/dist/runtime-control.cjs +2133 -8
  254. package/dist/runtime-control.cjs.map +1 -1
  255. package/dist/runtime-control.d.cts +980 -12
  256. package/dist/runtime-control.d.ts +980 -12
  257. package/dist/runtime-control.js +264 -4
  258. package/dist/runtime-control.js.map +1 -1
  259. package/dist/runtime-inspection.cjs +1222 -558
  260. package/dist/runtime-inspection.cjs.map +1 -1
  261. package/dist/runtime-inspection.d.cts +530 -22
  262. package/dist/runtime-inspection.d.ts +530 -22
  263. package/dist/runtime-inspection.js +21 -22
  264. package/dist/runtime-inspection.js.map +1 -1
  265. package/dist/runtime-reporting-K_ZXpubu.d.cts +43 -0
  266. package/dist/runtime-reporting-K_ZXpubu.d.ts +43 -0
  267. package/dist/runtime-topology.cjs +2 -5
  268. package/dist/runtime-topology.cjs.map +1 -1
  269. package/dist/runtime-topology.d.cts +1 -1
  270. package/dist/runtime-topology.d.ts +1 -1
  271. package/dist/runtime-topology.js +1 -1
  272. package/dist/runtime-topology.js.map +1 -1
  273. package/dist/scoped-connector-DEOZvCCG.d.cts +66 -0
  274. package/dist/scoped-connector-nTHACYTl.d.ts +66 -0
  275. package/dist/sdk-channels-S6j6AH8v.d.cts +103 -0
  276. package/dist/sdk-channels-S6j6AH8v.d.ts +103 -0
  277. package/dist/simulation-DL9j-ghn.d.ts +782 -0
  278. package/dist/simulation-HmgsvF5H.d.cts +782 -0
  279. package/dist/{standard-match-phase-BzSgBYFg.d.ts → standard-match-phase-D4N-AU0d.d.cts} +3 -13
  280. package/dist/{standard-match-phase-CvJUW8Oe.d.cts → standard-match-phase-abt8ZjCh.d.ts} +3 -13
  281. package/dist/transport-CWF29jU6.d.cts +173 -0
  282. package/dist/transport-CWF29jU6.d.ts +173 -0
  283. package/dist/types-p28maMEo.d.cts +102 -0
  284. package/dist/types-p28maMEo.d.ts +102 -0
  285. package/dist/ui.cjs +2167 -892
  286. package/dist/ui.cjs.map +1 -1
  287. package/dist/ui.d.cts +75 -17
  288. package/dist/ui.d.ts +75 -17
  289. package/dist/ui.js +554 -393
  290. package/dist/ui.js.map +1 -1
  291. package/package.json +38 -21
  292. package/src/agent/agent-action.ts +0 -39
  293. package/src/agent/agent-contract-conformance.ts +8 -1
  294. package/src/agent/agent-contract.ts +2 -4
  295. package/src/agent/agent-evaluator.ts +95 -0
  296. package/src/agent/capture-canvas.ts +79 -0
  297. package/src/agent/host-canvas-capture.ts +189 -0
  298. package/src/agent-tooling.ts +5 -20
  299. package/src/arcade/bridge/controller.ts +8 -11
  300. package/src/arcade/bridge/host.ts +6 -11
  301. package/src/arcade/bridge/iframe.ts +1 -50
  302. package/src/arcade/host.ts +0 -1
  303. package/src/arcade/surface.ts +5 -1
  304. package/src/arcade/url.ts +2 -9
  305. package/src/audio/audio-manager.ts +23 -47
  306. package/src/audio/hooks.tsx +59 -72
  307. package/src/components/controller-player-name-field.tsx +2 -2
  308. package/src/components/controller-primary-action.tsx +1 -1
  309. package/src/components/controls.tsx +398 -0
  310. package/src/components/gamepad-layout.tsx +69 -0
  311. package/src/components/join-url-controls.tsx +5 -1
  312. package/src/components/lifecycle-action-group.tsx +1 -1
  313. package/src/components/player-avatar.tsx +50 -3
  314. package/src/components/room-qr-code.tsx +36 -77
  315. package/src/components/stage-capture-surface.tsx +91 -0
  316. package/src/components/surface-viewport.tsx +16 -3
  317. package/src/components/ui/button.tsx +1 -1
  318. package/src/constants.ts +0 -15
  319. package/src/context/air-jam-context.tsx +56 -187
  320. package/src/context/session-providers.tsx +13 -10
  321. package/src/controller-bridge.ts +7 -0
  322. package/src/core/assets.ts +48 -0
  323. package/src/core/config.ts +70 -0
  324. package/src/core/connection-store.ts +77 -0
  325. package/src/core/controller-input.ts +147 -0
  326. package/src/core/controller-runtime.ts +427 -0
  327. package/src/core/dev-events.ts +18 -0
  328. package/src/core/environment.ts +132 -0
  329. package/src/core/game-description.ts +44 -0
  330. package/src/core/game.ts +130 -0
  331. package/src/core/host-input.ts +207 -0
  332. package/src/core/host-runtime.ts +988 -0
  333. package/src/core/hosted-rooms.ts +65 -0
  334. package/src/core/input-bindings.ts +180 -0
  335. package/src/core/input-log.ts +144 -0
  336. package/src/core/input.ts +228 -0
  337. package/src/core/local-input.ts +319 -0
  338. package/src/core/replay-input-log.ts +298 -0
  339. package/src/core/replicated-store.ts +1178 -0
  340. package/src/core/room-action-ack.ts +43 -0
  341. package/src/core/settings.ts +202 -0
  342. package/src/core/simulation.ts +307 -0
  343. package/src/core/theme.ts +33 -0
  344. package/src/core.ts +167 -0
  345. package/src/dev/browser-log-sink.ts +35 -12
  346. package/src/diagnostics.ts +5 -6
  347. package/src/hooks/internal/use-controller-runtime-api.ts +58 -925
  348. package/src/hooks/internal/use-host-runtime-api.ts +98 -1270
  349. package/src/hooks/internal/use-runtime-inspection-contract.ts +14 -2
  350. package/src/hooks/use-air-jam-controller.ts +32 -53
  351. package/src/hooks/use-air-jam-host.ts +59 -100
  352. package/src/hooks/use-air-jam-settings.ts +27 -0
  353. package/src/hooks/use-controller-toasts.ts +16 -19
  354. package/src/hooks/use-host-agent-capture.ts +31 -0
  355. package/src/hooks/use-lifecycle-action-group-model.ts +1 -1
  356. package/src/hooks/use-send-signal.ts +23 -156
  357. package/src/hooks/use-simulation.ts +83 -0
  358. package/src/index.ts +24 -85
  359. package/src/lifecycle/index.ts +0 -4
  360. package/src/lifecycle/standard-match-phase.ts +1 -22
  361. package/src/metadata/manifest.ts +8 -19
  362. package/src/metadata.ts +1 -1
  363. package/src/platform-machine.ts +127 -3
  364. package/src/prefabs/types.ts +91 -20
  365. package/src/prefabs/view.ts +82 -0
  366. package/src/prefabs.ts +19 -0
  367. package/src/preview/host-workspace.tsx +4 -9
  368. package/src/preview/identity.ts +31 -23
  369. package/src/preview/layout.ts +5 -1
  370. package/src/preview/manager.ts +205 -78
  371. package/src/preview/messages.ts +47 -0
  372. package/src/preview/ownership.ts +6 -1
  373. package/src/preview/url.ts +46 -23
  374. package/src/preview/window.tsx +26 -69
  375. package/src/preview/workspace-local-seats.ts +166 -0
  376. package/src/preview/workspace.tsx +89 -37
  377. package/src/preview.ts +27 -15
  378. package/src/protocol/actions.ts +58 -0
  379. package/src/protocol/arcade-platform-actions.ts +2 -16
  380. package/src/protocol/controller.ts +14 -174
  381. package/src/protocol/core.ts +8 -15
  382. package/src/protocol/dev-log-events.ts +5 -81
  383. package/src/protocol/leased-control.ts +177 -0
  384. package/src/protocol/room/addressing.ts +35 -0
  385. package/src/protocol/room/close-codes.ts +33 -0
  386. package/src/protocol/room/frames.ts +343 -0
  387. package/src/protocol/room/input-codec.ts +182 -0
  388. package/src/protocol/room/limits.ts +58 -0
  389. package/src/protocol/room/patch.ts +135 -0
  390. package/src/protocol/room/sdk-channels.ts +81 -0
  391. package/src/protocol/room/seat-id.ts +31 -0
  392. package/src/protocol/room/transport.ts +63 -0
  393. package/src/protocol/room/weight.ts +58 -0
  394. package/src/protocol/runtime-reporting.ts +56 -10
  395. package/src/protocol.ts +2 -7
  396. package/src/qrcode.d.ts +3 -13
  397. package/src/room-protocol.ts +10 -0
  398. package/src/room-session/browser-wake-events.ts +14 -0
  399. package/src/room-session/channel-state.ts +293 -0
  400. package/src/room-session/clock.ts +24 -0
  401. package/src/room-session/host-room-session.ts +379 -0
  402. package/src/room-session/input-lane.ts +125 -0
  403. package/src/room-session/listeners.ts +22 -0
  404. package/src/room-session/loopback-link.ts +58 -0
  405. package/src/room-session/phone-room-session.ts +368 -0
  406. package/src/room-session/port-link.ts +116 -0
  407. package/src/room-session/room-key.ts +9 -0
  408. package/src/room-session/roster.ts +23 -0
  409. package/src/room-session/scoped-connector.ts +577 -0
  410. package/src/room-session/session-link.ts +306 -0
  411. package/src/room-session/web-socket-link.ts +57 -0
  412. package/src/room-session.ts +12 -0
  413. package/src/runtime/air-jam-config.ts +49 -37
  414. package/src/runtime/air-jam-error-boundary.tsx +9 -3
  415. package/src/runtime/arcade-runtime-url.ts +8 -9
  416. package/src/runtime/browser-controller-environment.ts +116 -0
  417. package/src/runtime/browser-host-environment.ts +137 -0
  418. package/src/runtime/browser-replay.ts +211 -0
  419. package/src/runtime/browser-room.ts +41 -0
  420. package/src/runtime/connected-runtime-error-boundary.tsx +35 -8
  421. package/src/runtime/contracts/agent-control.ts +195 -0
  422. package/src/runtime/contracts/clip.ts +169 -0
  423. package/src/runtime/contracts/control.ts +653 -16
  424. package/src/runtime/contracts/controller-agent.ts +130 -0
  425. package/src/runtime/contracts/input-log.ts +38 -0
  426. package/src/runtime/contracts/inspection.ts +25 -22
  427. package/src/runtime/contracts/observation.ts +186 -0
  428. package/src/runtime/contracts/runtime-identity.ts +43 -0
  429. package/src/runtime/contracts/timeline.ts +59 -0
  430. package/src/runtime/controller-agent-bridge.ts +152 -0
  431. package/src/runtime/controller-bridge-context.ts +29 -0
  432. package/src/runtime/controller-capture.ts +50 -0
  433. package/src/runtime/controller-identity.ts +53 -142
  434. package/src/runtime/controller-presentation.ts +47 -17
  435. package/src/runtime/controller-press.ts +271 -0
  436. package/src/runtime/create-air-jam-app.tsx +103 -74
  437. package/src/runtime/dev-runtime-events.ts +6 -18
  438. package/src/runtime/embedded-parent.ts +22 -0
  439. package/src/runtime/embedded-runtime-adapters.ts +10 -9
  440. package/src/runtime/host-agent-bridge.ts +127 -0
  441. package/src/runtime/host-capture-boundary.tsx +92 -0
  442. package/src/runtime/host-capture-context.ts +7 -0
  443. package/src/runtime/host-clip-reader.ts +93 -0
  444. package/src/runtime/host-clip-recorder.ts +342 -0
  445. package/src/runtime/host-input-log-reader.ts +120 -0
  446. package/src/runtime/host-observation.ts +207 -0
  447. package/src/runtime/host-pace.ts +36 -0
  448. package/src/runtime/host-runtime-fault.ts +51 -0
  449. package/src/runtime/host-timeline.ts +152 -0
  450. package/src/runtime/local-players.tsx +96 -0
  451. package/src/runtime/local-seats.ts +612 -0
  452. package/src/runtime/participant-control.ts +162 -0
  453. package/src/runtime/prefab-inspection-bridge.ts +174 -0
  454. package/src/runtime/prefab-inspection-clock.ts +12 -0
  455. package/src/runtime/prefab-inspection-context.ts +20 -0
  456. package/src/runtime/prefab-inspection-runtime.tsx +328 -0
  457. package/src/runtime/preview-inspection-bridge.ts +130 -0
  458. package/src/runtime/replay-runtime.tsx +101 -0
  459. package/src/runtime/room-bridge.ts +110 -0
  460. package/src/runtime/runtime-owner-contexts.tsx +9 -0
  461. package/src/runtime/runtime-session-params.ts +20 -23
  462. package/src/runtime/session-runtimes.tsx +231 -64
  463. package/src/runtime/stage-capture.ts +25 -0
  464. package/src/runtime-control.ts +41 -0
  465. package/src/runtime-inspection.ts +14 -7
  466. package/src/runtime-topology.ts +7 -8
  467. package/src/settings/platform-settings-runtime.tsx +47 -2
  468. package/src/settings/platform-settings.ts +0 -65
  469. package/src/store/use-air-jam-store.ts +73 -0
  470. package/src/ui.ts +3 -3
  471. package/src/utils/is-rpc-serializable.ts +11 -19
  472. package/src/utils/url-builder.ts +0 -7
  473. package/dist/air-jam-context-BlLPvCup.d.cts +0 -175
  474. package/dist/air-jam-context-DTsxF-tP.d.ts +0 -175
  475. package/dist/arcade/bridge.cjs +0 -1087
  476. package/dist/arcade/bridge.cjs.map +0 -1
  477. package/dist/arcade/bridge.d.cts +0 -11
  478. package/dist/arcade/bridge.d.ts +0 -11
  479. package/dist/arcade/bridge.js +0 -78
  480. package/dist/arcade/bridge.js.map +0 -1
  481. package/dist/arcade-runtime-url-BW-MUAOY.d.cts +0 -28
  482. package/dist/arcade-runtime-url-l8qj01Pg.d.ts +0 -28
  483. package/dist/arcade.cjs +0 -1767
  484. package/dist/arcade.cjs.map +0 -1
  485. package/dist/arcade.d.cts +0 -18
  486. package/dist/arcade.d.ts +0 -18
  487. package/dist/arcade.js +0 -129
  488. package/dist/arcade.js.map +0 -1
  489. package/dist/chunk-2SZ2YYGJ.js +0 -280
  490. package/dist/chunk-2SZ2YYGJ.js.map +0 -1
  491. package/dist/chunk-32RSSFSF.js +0 -214
  492. package/dist/chunk-32RSSFSF.js.map +0 -1
  493. package/dist/chunk-3USU7GY2.js.map +0 -1
  494. package/dist/chunk-3YMUAKPU.js +0 -10
  495. package/dist/chunk-3YMUAKPU.js.map +0 -1
  496. package/dist/chunk-56DM2KEW.js +0 -14
  497. package/dist/chunk-56DM2KEW.js.map +0 -1
  498. package/dist/chunk-BE6Z4SIT.js.map +0 -1
  499. package/dist/chunk-CM53YLT5.js +0 -59
  500. package/dist/chunk-CM53YLT5.js.map +0 -1
  501. package/dist/chunk-CV3PBXPT.js.map +0 -1
  502. package/dist/chunk-D4VDEVTZ.js.map +0 -1
  503. package/dist/chunk-EVZJA6RN.js.map +0 -1
  504. package/dist/chunk-FUA6EMSJ.js +0 -90
  505. package/dist/chunk-FUA6EMSJ.js.map +0 -1
  506. package/dist/chunk-GMLU7RI5.js +0 -70
  507. package/dist/chunk-GMLU7RI5.js.map +0 -1
  508. package/dist/chunk-IG6GZZSS.js.map +0 -1
  509. package/dist/chunk-IKKDONQL.js +0 -1
  510. package/dist/chunk-IKKDONQL.js.map +0 -1
  511. package/dist/chunk-ITMQSBTH.js +0 -26
  512. package/dist/chunk-ITMQSBTH.js.map +0 -1
  513. package/dist/chunk-J5MCII33.js +0 -620
  514. package/dist/chunk-J5MCII33.js.map +0 -1
  515. package/dist/chunk-JTF47B56.js +0 -1
  516. package/dist/chunk-JTF47B56.js.map +0 -1
  517. package/dist/chunk-K4OZ54UD.js.map +0 -1
  518. package/dist/chunk-LIHEEAVE.js +0 -191
  519. package/dist/chunk-LIHEEAVE.js.map +0 -1
  520. package/dist/chunk-LIXPF4P6.js +0 -22
  521. package/dist/chunk-LIXPF4P6.js.map +0 -1
  522. package/dist/chunk-MIMPMB7O.js.map +0 -1
  523. package/dist/chunk-MPDMJIX5.js +0 -1
  524. package/dist/chunk-MPDMJIX5.js.map +0 -1
  525. package/dist/chunk-O6X7FJ6N.js.map +0 -1
  526. package/dist/chunk-PSUYTD2L.js.map +0 -1
  527. package/dist/chunk-QO4KFUEI.js +0 -32
  528. package/dist/chunk-QO4KFUEI.js.map +0 -1
  529. package/dist/chunk-QTLYZADF.js +0 -125
  530. package/dist/chunk-QTLYZADF.js.map +0 -1
  531. package/dist/chunk-TGRTEWYV.js +0 -195
  532. package/dist/chunk-TGRTEWYV.js.map +0 -1
  533. package/dist/chunk-TTQDHKXL.js +0 -3017
  534. package/dist/chunk-TTQDHKXL.js.map +0 -1
  535. package/dist/chunk-UCPY7UJC.js +0 -8
  536. package/dist/chunk-UCPY7UJC.js.map +0 -1
  537. package/dist/chunk-UPV6YWT5.js +0 -43
  538. package/dist/chunk-UPV6YWT5.js.map +0 -1
  539. package/dist/chunk-UWJOIVON.js.map +0 -1
  540. package/dist/chunk-W2VK36RO.js +0 -11
  541. package/dist/chunk-W2VK36RO.js.map +0 -1
  542. package/dist/chunk-X24K52DG.js.map +0 -1
  543. package/dist/chunk-X35LLCWV.js.map +0 -1
  544. package/dist/chunk-YXHH3MQT.js +0 -230
  545. package/dist/chunk-YXHH3MQT.js.map +0 -1
  546. package/dist/controller-PZEM_1cH.d.ts +0 -176
  547. package/dist/controller-vj82tKm4.d.cts +0 -176
  548. package/dist/dev-log-events-BCJKmygo.d.cts +0 -120
  549. package/dist/dev-log-events-BCJKmygo.d.ts +0 -120
  550. package/dist/handshake-CC_LrK5g.d.cts +0 -31
  551. package/dist/handshake-CC_LrK5g.d.ts +0 -31
  552. package/dist/host-B9pRy0Aa.d.cts +0 -122
  553. package/dist/host-DylGsX7p.d.ts +0 -122
  554. package/dist/notices-C4bao3oi.d.ts +0 -38
  555. package/dist/notices-DNdOjwtj.d.cts +0 -38
  556. package/dist/realtime-client-Cu8yVJFw.d.cts +0 -15
  557. package/dist/realtime-client-Cu8yVJFw.d.ts +0 -15
  558. package/dist/runtime-reporting-pe-eryVz.d.cts +0 -27
  559. package/dist/runtime-reporting-pe-eryVz.d.ts +0 -27
  560. package/dist/signals-ZHftIKuc.d.cts +0 -33
  561. package/dist/signals-ZHftIKuc.d.ts +0 -33
  562. package/dist/sync-xtPfWhif.d.cts +0 -81
  563. package/dist/sync-xtPfWhif.d.ts +0 -81
  564. package/src/arcade/bridge.ts +0 -3
  565. package/src/arcade.ts +0 -4
  566. package/src/context/socket-manager.ts +0 -72
  567. package/src/events.ts +0 -119
  568. package/src/hooks/use-connection-status.ts +0 -8
  569. package/src/hooks/use-controller-tick.ts +0 -65
  570. package/src/hooks/use-get-input.ts +0 -100
  571. package/src/hooks/use-host-arcade-restore.ts +0 -35
  572. package/src/hooks/use-host-tick.ts +0 -171
  573. package/src/hooks/use-input-writer.ts +0 -83
  574. package/src/hooks/use-players.ts +0 -12
  575. package/src/internal/input-manager.ts +0 -356
  576. package/src/protocol/errors.ts +0 -21
  577. package/src/protocol/host-grant.ts +0 -103
  578. package/src/protocol/host.ts +0 -150
  579. package/src/protocol/notices.ts +0 -43
  580. package/src/protocol/signals.ts +0 -38
  581. package/src/protocol/socket-events.ts +0 -152
  582. package/src/protocol/sync.ts +0 -105
  583. package/src/runtime/admission-retry.ts +0 -62
  584. package/src/runtime/bridge-envelope-args.ts +0 -21
  585. package/src/runtime/controller-bridge.ts +0 -439
  586. package/src/runtime/controller-realtime-client.ts +0 -552
  587. package/src/runtime/host-bridge.ts +0 -380
  588. package/src/runtime/host-realtime-client.ts +0 -550
  589. package/src/runtime/realtime-client.ts +0 -20
  590. package/src/runtime/validate-arcade-bridge-attach.ts +0 -14
  591. package/src/state/connection-store.ts +0 -159
  592. package/src/store/create-air-jam-store.ts +0 -1193
  593. package/src/store/index.ts +0 -1
  594. package/src/utils/ids.ts +0 -58
package/dist/ui.js CHANGED
@@ -1,42 +1,53 @@
1
1
  import {
2
- readEmbeddedControllerRuntimeParams
3
- } from "./chunk-D4VDEVTZ.js";
2
+ publishEmbeddedControllerPresentation
3
+ } from "./chunk-QTNYGAZ7.js";
4
4
  import {
5
5
  useAirJamController
6
- } from "./chunk-X35LLCWV.js";
7
- import {
8
- createControllerPresentationSyncMessage
9
- } from "./chunk-32RSSFSF.js";
10
- import "./chunk-56DM2KEW.js";
11
- import "./chunk-X24K52DG.js";
6
+ } from "./chunk-X5HZBQ6K.js";
12
7
  import {
13
8
  Button,
14
9
  Slider,
15
- buttonVariants,
16
10
  cn,
11
+ createSurfaceViewportScaleStyle,
12
+ resolveSurfaceViewportAvailableSize,
13
+ resolveSurfaceViewportReferenceSize,
14
+ resolveSurfaceViewportScale,
17
15
  shellFieldClassName,
18
16
  shellHeaderClassName,
19
17
  shellHelperTextClassName,
20
18
  shellLabelClassName,
21
19
  shellUtilityButtonClassName
22
- } from "./chunk-EVZJA6RN.js";
23
- import {
24
- usePlatformAudioSettings
25
- } from "./chunk-2SZ2YYGJ.js";
26
- import "./chunk-3YMUAKPU.js";
27
- import "./chunk-BE6Z4SIT.js";
28
- import "./chunk-MIMPMB7O.js";
29
- import "./chunk-CV3PBXPT.js";
20
+ } from "./chunk-6ZJUA63D.js";
30
21
  import {
22
+ controllerRuntimeContext,
23
+ fixedControllerOrientationContext,
24
+ readEmbeddedHostChildSession,
25
+ usePlatformAudioSettings,
31
26
  useSessionScope
32
- } from "./chunk-O6X7FJ6N.js";
33
- import "./chunk-W2VK36RO.js";
34
- import "./chunk-UWJOIVON.js";
35
- import "./chunk-LIXPF4P6.js";
36
- import "./chunk-J5MCII33.js";
37
- import "./chunk-3USU7GY2.js";
38
- import "./chunk-K4OZ54UD.js";
39
- import "./chunk-UCPY7UJC.js";
27
+ } from "./chunk-6PLOJMJD.js";
28
+ import "./chunk-QHBRHYMV.js";
29
+ import "./chunk-M5553I2G.js";
30
+ import "./chunk-KGY4PV2A.js";
31
+ import "./chunk-VN2PX2I3.js";
32
+ import "./chunk-LX6CTPDW.js";
33
+ import "./chunk-FJ4J2BEC.js";
34
+ import "./chunk-MD25536W.js";
35
+ import "./chunk-C5GS2GMK.js";
36
+ import "./chunk-YXHAWWVU.js";
37
+ import {
38
+ createAirJamDiagnosticError
39
+ } from "./chunk-DBF7NJ3S.js";
40
+ import "./chunk-KUGROY5S.js";
41
+ import "./chunk-MJAWAHLT.js";
42
+ import "./chunk-AXG6FA2H.js";
43
+ import "./chunk-KSYN4I5Y.js";
44
+ import "./chunk-CDL7LYZH.js";
45
+ import "./chunk-WAFGYJZN.js";
46
+ import "./chunk-H4DEVMTO.js";
47
+ import "./chunk-2H2FGF3H.js";
48
+ import "./chunk-C5722GTG.js";
49
+ import "./chunk-5CRZFIN6.js";
50
+ import "./chunk-24NZZOIO.js";
40
51
 
41
52
  // src/components/connection-status-pill.tsx
42
53
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -218,7 +229,7 @@ var ControllerPrimaryAction = ({
218
229
  children: [
219
230
  /* @__PURE__ */ jsxs3("div", { className: "min-w-0", children: [
220
231
  /* @__PURE__ */ jsx3("div", { className: "truncate text-base font-black tracking-[0.12em] uppercase sm:text-lg", children: label }),
221
- helper ? /* @__PURE__ */ jsx3("div", { className: "mt-1 text-sm/5 font-medium tracking-normal normal-case opacity-80", children: helper }) : null
232
+ helper ? /* @__PURE__ */ jsx3("div", { className: "mt-1 text-sm/5 font-medium tracking-normal whitespace-normal normal-case opacity-80", children: helper }) : null
222
233
  ] }),
223
234
  icon ? /* @__PURE__ */ jsx3("div", { className: "ml-4 flex shrink-0 items-center justify-center", children: icon }) : null
224
235
  ]
@@ -226,9 +237,332 @@ var ControllerPrimaryAction = ({
226
237
  ) });
227
238
  };
228
239
 
240
+ // src/components/controls.tsx
241
+ import {
242
+ useCallback as useCallback2,
243
+ useContext,
244
+ useEffect as useEffect2,
245
+ useRef as useRef2,
246
+ useState as useState2,
247
+ useSyncExternalStore
248
+ } from "react";
249
+ import { Fragment, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
250
+ var useControllerInput = () => {
251
+ const runtime = useContext(
252
+ controllerRuntimeContext
253
+ );
254
+ if (!runtime?.input)
255
+ throw createAirJamDiagnosticError(
256
+ "AJ_INPUT_NOT_DECLARED",
257
+ "Phone controls send declared controls. Declare them with defineAirJamGame({ input }) and render controls inside <airjam.Controller>."
258
+ );
259
+ return runtime.input;
260
+ };
261
+ var capturePointer = (event) => {
262
+ try {
263
+ event.currentTarget.setPointerCapture(event.pointerId);
264
+ } catch {
265
+ }
266
+ };
267
+ var isPressKey = (event) => event.key === " " || event.key === "Enter";
268
+ var usePress = (start, disabled, onActiveChange) => {
269
+ const release = useRef2(null);
270
+ const pointer = useRef2(null);
271
+ const [active, setActive] = useState2(false);
272
+ const onActiveChangeRef = useRef2(onActiveChange);
273
+ useEffect2(() => {
274
+ onActiveChangeRef.current = onActiveChange;
275
+ });
276
+ const begin = useCallback2(() => {
277
+ if (release.current) return false;
278
+ release.current = start();
279
+ setActive(true);
280
+ onActiveChangeRef.current?.(true);
281
+ return true;
282
+ }, [start]);
283
+ const end = useCallback2(() => {
284
+ pointer.current = null;
285
+ if (!release.current) return;
286
+ release.current();
287
+ release.current = null;
288
+ setActive(false);
289
+ onActiveChangeRef.current?.(false);
290
+ }, []);
291
+ useEffect2(() => {
292
+ if (disabled) end();
293
+ }, [disabled, end]);
294
+ useEffect2(() => end, [end]);
295
+ const endPointer = (event) => {
296
+ if (event.pointerId === pointer.current) end();
297
+ };
298
+ return {
299
+ active,
300
+ handlers: {
301
+ onPointerDown: (event) => {
302
+ if (disabled || event.button !== 0 || !begin()) return;
303
+ event.preventDefault();
304
+ pointer.current = event.pointerId;
305
+ capturePointer(event);
306
+ },
307
+ onPointerUp: endPointer,
308
+ onPointerCancel: endPointer,
309
+ onLostPointerCapture: endPointer,
310
+ onKeyDown: (event) => {
311
+ if (disabled || !isPressKey(event)) return;
312
+ event.preventDefault();
313
+ if (!event.repeat) begin();
314
+ },
315
+ onKeyUp: (event) => {
316
+ if (!isPressKey(event)) return;
317
+ event.preventDefault();
318
+ end();
319
+ },
320
+ // Focus leaving ends a key hold; a finger still down keeps its press.
321
+ onBlur: () => {
322
+ if (pointer.current === null) end();
323
+ },
324
+ onContextMenu: (event) => event.preventDefault()
325
+ }
326
+ };
327
+ };
328
+ var ControlButton = ({
329
+ control,
330
+ disabled = false,
331
+ onActiveChange,
332
+ className,
333
+ ...props
334
+ }) => {
335
+ const input = useControllerInput();
336
+ const press = useCallback2(
337
+ () => input.press(control.name),
338
+ [input, control.name]
339
+ );
340
+ const { active, handlers } = usePress(press, disabled, onActiveChange);
341
+ return /* @__PURE__ */ jsx4(
342
+ "button",
343
+ {
344
+ type: "button",
345
+ ...props,
346
+ ...handlers,
347
+ disabled,
348
+ "data-active": active,
349
+ className: cn("touch-none select-none", className)
350
+ }
351
+ );
352
+ };
353
+ var AxisButton = ({
354
+ control,
355
+ value,
356
+ disabled = false,
357
+ onActiveChange,
358
+ className,
359
+ ...props
360
+ }) => {
361
+ const input = useControllerInput();
362
+ const hold = useCallback2(
363
+ () => input.hold(control.name, value),
364
+ [input, control.name, value]
365
+ );
366
+ const { active, handlers } = usePress(hold, disabled, onActiveChange);
367
+ return /* @__PURE__ */ jsx4(
368
+ "button",
369
+ {
370
+ type: "button",
371
+ ...props,
372
+ ...handlers,
373
+ disabled,
374
+ "data-active": active,
375
+ className: cn("touch-none select-none", className)
376
+ }
377
+ );
378
+ };
379
+ var centre = (element) => {
380
+ const rect = element?.getBoundingClientRect();
381
+ return rect ? { x: rect.x + rect.width / 2, y: rect.y + rect.height / 2 } : null;
382
+ };
383
+ var resolveStickPoint = (point, origin, right, bottom) => {
384
+ const xAxis = { x: right.x - origin.x, y: right.y - origin.y };
385
+ const yAxis = { x: bottom.x - origin.x, y: bottom.y - origin.y };
386
+ const determinant = xAxis.x * yAxis.y - xAxis.y * yAxis.x;
387
+ if (!Number.isFinite(determinant) || Math.abs(determinant) < 1e-3)
388
+ return { x: 0, y: 0 };
389
+ const offset = { x: point.x - origin.x, y: point.y - origin.y };
390
+ const across = (offset.x * yAxis.y - offset.y * yAxis.x) / determinant;
391
+ const down = (xAxis.x * offset.y - xAxis.y * offset.x) / determinant;
392
+ return { x: 2 * across - 1, y: 2 * down - 1 };
393
+ };
394
+ var shapeStick = (vector, directions, deadzone) => {
395
+ const length = Math.hypot(vector.x, vector.y);
396
+ if (length <= deadzone) return { x: 0, y: 0 };
397
+ if (directions === "4-way")
398
+ return Math.abs(vector.x) > Math.abs(vector.y) ? { x: Math.sign(vector.x), y: 0 } : { x: 0, y: Math.sign(vector.y) };
399
+ return length > 1 ? { x: vector.x / length, y: vector.y / length } : vector;
400
+ };
401
+ var CENTRE = { x: 0, y: 0 };
402
+ var Stick = ({
403
+ control,
404
+ directions = "any",
405
+ deadzone = 0,
406
+ disabled = false,
407
+ knobClassName,
408
+ knob,
409
+ children,
410
+ onActiveChange,
411
+ className,
412
+ ...props
413
+ }) => {
414
+ const fixedOrientation = useContext(fixedControllerOrientationContext);
415
+ if (fixedOrientation === null)
416
+ throw new Error(
417
+ "Stick requires joystick input: declare 'joystick' in inputModalities in airjam.config."
418
+ );
419
+ const input = useControllerInput();
420
+ const origin = useRef2(null);
421
+ const right = useRef2(null);
422
+ const bottom = useRef2(null);
423
+ const pointer = useRef2(null);
424
+ const [active, setActive] = useState2(false);
425
+ const subscribe = useCallback2(
426
+ (listener) => input.subscribe(listener),
427
+ [input]
428
+ );
429
+ const value = useSyncExternalStore(
430
+ subscribe,
431
+ () => input.value(control.name),
432
+ () => CENTRE
433
+ );
434
+ const setActiveState = (next) => {
435
+ setActive(next);
436
+ onActiveChange?.(next);
437
+ };
438
+ const follow = (event) => {
439
+ const corners = [origin, right, bottom].map(
440
+ ({ current }) => centre(current)
441
+ );
442
+ const [topLeft, topRight, bottomLeft] = corners;
443
+ if (!topLeft || !topRight || !bottomLeft) return;
444
+ input.set(
445
+ control.name,
446
+ shapeStick(
447
+ resolveStickPoint(
448
+ { x: event.clientX, y: event.clientY },
449
+ topLeft,
450
+ topRight,
451
+ bottomLeft
452
+ ),
453
+ directions,
454
+ deadzone
455
+ )
456
+ );
457
+ };
458
+ const end = (event) => {
459
+ if (event.pointerId !== pointer.current) return;
460
+ pointer.current = null;
461
+ input.set(control.name, CENTRE);
462
+ setActiveState(false);
463
+ };
464
+ useEffect2(() => {
465
+ if (!disabled || pointer.current === null) return;
466
+ pointer.current = null;
467
+ input.set(control.name, CENTRE);
468
+ setActive(false);
469
+ }, [disabled, input, control.name]);
470
+ const marker = "pointer-events-none absolute size-0";
471
+ return /* @__PURE__ */ jsxs4(
472
+ "div",
473
+ {
474
+ role: "application",
475
+ "aria-label": "Joystick",
476
+ ...props,
477
+ "data-active": active,
478
+ className: cn("relative touch-none select-none", className),
479
+ onPointerDown: (event) => {
480
+ if (disabled || pointer.current !== null || event.button !== 0) return;
481
+ event.preventDefault();
482
+ pointer.current = event.pointerId;
483
+ capturePointer(event);
484
+ setActiveState(true);
485
+ follow(event);
486
+ },
487
+ onPointerMove: (event) => {
488
+ if (event.pointerId === pointer.current) follow(event);
489
+ },
490
+ onPointerUp: end,
491
+ onPointerCancel: end,
492
+ onLostPointerCapture: end,
493
+ onContextMenu: (event) => event.preventDefault(),
494
+ children: [
495
+ /* @__PURE__ */ jsx4("span", { ref: origin, className: cn(marker, "top-0 left-0") }),
496
+ /* @__PURE__ */ jsx4("span", { ref: right, className: cn(marker, "top-0 left-full") }),
497
+ /* @__PURE__ */ jsx4("span", { ref: bottom, className: cn(marker, "top-full left-0") }),
498
+ typeof children === "function" ? children({ value, active }) : /* @__PURE__ */ jsxs4(Fragment, { children: [
499
+ children,
500
+ /* @__PURE__ */ jsx4(
501
+ "span",
502
+ {
503
+ className: cn(
504
+ "pointer-events-none absolute top-1/2 left-1/2 flex size-1/3 items-center justify-center rounded-full bg-current/30",
505
+ !active && "transition-transform duration-150 ease-out",
506
+ knobClassName
507
+ ),
508
+ style: {
509
+ transform: `translate(calc(-50% + ${value.x * 100}%), calc(-50% + ${value.y * 100}%))`
510
+ },
511
+ children: knob
512
+ }
513
+ )
514
+ ] })
515
+ ]
516
+ }
517
+ );
518
+ };
519
+
520
+ // src/components/gamepad-layout.tsx
521
+ import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
522
+ var layoutStyle = {
523
+ containerType: "size",
524
+ "--airjam-thumb-size": "min(62cqh, 27cqw)",
525
+ "--airjam-thumb-margin": "min(10cqh, 5cqw)"
526
+ };
527
+ var zoneStyle = {
528
+ width: "calc(var(--airjam-thumb-size) + 2 * var(--airjam-thumb-margin))"
529
+ };
530
+ var slotStyle = {
531
+ width: "var(--airjam-thumb-size)",
532
+ height: "var(--airjam-thumb-size)"
533
+ };
534
+ var ThumbZone = ({ children }) => /* @__PURE__ */ jsx5(
535
+ "div",
536
+ {
537
+ className: "flex h-full flex-none items-center justify-center",
538
+ style: zoneStyle,
539
+ children: /* @__PURE__ */ jsx5("div", { className: "grid *:size-full", style: slotStyle, children })
540
+ }
541
+ );
542
+ var GamepadLayout = ({
543
+ left,
544
+ right,
545
+ center,
546
+ className,
547
+ style,
548
+ ...props
549
+ }) => /* @__PURE__ */ jsxs5(
550
+ "div",
551
+ {
552
+ ...props,
553
+ className: cn("flex h-full w-full items-center", className),
554
+ style: { ...layoutStyle, ...style },
555
+ children: [
556
+ /* @__PURE__ */ jsx5(ThumbZone, { children: left }),
557
+ /* @__PURE__ */ jsx5("div", { className: "flex h-full min-w-0 flex-1 flex-col items-center justify-center gap-2 text-center", children: center }),
558
+ /* @__PURE__ */ jsx5(ThumbZone, { children: right })
559
+ ]
560
+ }
561
+ );
562
+
229
563
  // src/components/host-mute-button.tsx
230
564
  import { Volume2, VolumeX } from "lucide-react";
231
- import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
565
+ import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
232
566
  function HostMuteButton({
233
567
  muted,
234
568
  onToggle,
@@ -238,7 +572,7 @@ function HostMuteButton({
238
572
  unmutedLabel = "Mute"
239
573
  }) {
240
574
  const label = muted ? mutedLabel : unmutedLabel;
241
- return /* @__PURE__ */ jsxs4(
575
+ return /* @__PURE__ */ jsxs6(
242
576
  Button,
243
577
  {
244
578
  type: "button",
@@ -253,8 +587,8 @@ function HostMuteButton({
253
587
  className
254
588
  ),
255
589
  children: [
256
- muted ? /* @__PURE__ */ jsx4(VolumeX, { className: "size-4" }) : /* @__PURE__ */ jsx4(Volume2, { className: "size-4" }),
257
- /* @__PURE__ */ jsx4(
590
+ muted ? /* @__PURE__ */ jsx6(VolumeX, { className: "size-4" }) : /* @__PURE__ */ jsx6(Volume2, { className: "size-4" }),
591
+ /* @__PURE__ */ jsx6(
258
592
  "span",
259
593
  {
260
594
  className: cn(
@@ -274,9 +608,9 @@ import { useEffect as useEffect3, useState as useState3 } from "react";
274
608
  import { createPortal } from "react-dom";
275
609
 
276
610
  // src/components/room-qr-code.tsx
277
- import { toDataURL } from "qrcode";
278
- import { useEffect as useEffect2, useState as useState2 } from "react";
279
- import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
611
+ import { create } from "qrcode";
612
+ import { useMemo } from "react";
613
+ import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
280
614
  var RoomQrCode = ({
281
615
  value,
282
616
  size = 180,
@@ -289,58 +623,24 @@ var RoomQrCode = ({
289
623
  alt = "Room join QR code"
290
624
  }) => {
291
625
  const trimmed = value.trim();
292
- const qrKey = `${trimmed}\0${size}\0${padding}\0${foregroundColor}\0${backgroundColor}\0${errorCorrectionLevel}`;
293
- const [qrState, setQrState] = useState2({
294
- key: null,
295
- dataUrl: null,
296
- error: false
297
- });
298
- useEffect2(() => {
299
- if (!trimmed) {
300
- return;
301
- }
302
- let cancelled = false;
303
- void toDataURL(trimmed, {
304
- width: size,
305
- margin: padding,
306
- errorCorrectionLevel,
307
- color: {
308
- dark: foregroundColor,
309
- light: backgroundColor
310
- }
311
- }).then((nextUrl) => {
312
- if (!cancelled) {
313
- setQrState({
314
- key: qrKey,
315
- dataUrl: nextUrl,
316
- error: false
317
- });
318
- }
319
- }).catch(() => {
320
- if (!cancelled) {
321
- setQrState({
322
- key: qrKey,
323
- dataUrl: null,
324
- error: true
325
- });
626
+ const qr = useMemo(() => {
627
+ if (!trimmed) return null;
628
+ try {
629
+ const { modules } = create(trimmed, { errorCorrectionLevel });
630
+ let path = "";
631
+ for (let row = 0; row < modules.size; row += 1) {
632
+ for (let column = 0; column < modules.size; column += 1) {
633
+ if (modules.data[row * modules.size + column]) {
634
+ path += `M${column},${row}h1v1h-1z`;
635
+ }
636
+ }
326
637
  }
327
- });
328
- return () => {
329
- cancelled = true;
330
- };
331
- }, [
332
- backgroundColor,
333
- errorCorrectionLevel,
334
- foregroundColor,
335
- padding,
336
- size,
337
- qrKey,
338
- trimmed
339
- ]);
340
- const imageSrc = trimmed && qrState.key === qrKey && qrState.dataUrl ? qrState.dataUrl : null;
341
- const isLoading = !!trimmed && qrState.key !== qrKey;
342
- const isUnavailable = !trimmed || qrState.key === qrKey && qrState.error;
343
- return /* @__PURE__ */ jsx5(
638
+ return { path, size: modules.size };
639
+ } catch {
640
+ return null;
641
+ }
642
+ }, [trimmed, errorCorrectionLevel]);
643
+ return /* @__PURE__ */ jsx7(
344
644
  "div",
345
645
  {
346
646
  className,
@@ -351,25 +651,37 @@ var RoomQrCode = ({
351
651
  },
352
652
  "aria-live": "polite",
353
653
  "aria-label": alt,
354
- children: imageSrc ? /* @__PURE__ */ jsx5(
355
- "img",
654
+ children: qr ? /* @__PURE__ */ jsxs7(
655
+ "svg",
356
656
  {
357
- src: imageSrc,
358
- alt,
657
+ role: "img",
658
+ "aria-label": alt,
359
659
  width: size,
360
660
  height: size,
361
- className: "h-full w-full rounded-md object-cover"
661
+ viewBox: `${-padding} ${-padding} ${qr.size + padding * 2} ${qr.size + padding * 2}`,
662
+ shapeRendering: "crispEdges",
663
+ className: "h-full w-full rounded-md",
664
+ children: [
665
+ /* @__PURE__ */ jsx7(
666
+ "rect",
667
+ {
668
+ x: -padding,
669
+ y: -padding,
670
+ width: qr.size + padding * 2,
671
+ height: qr.size + padding * 2,
672
+ fill: backgroundColor
673
+ }
674
+ ),
675
+ /* @__PURE__ */ jsx7("path", { d: qr.path, fill: foregroundColor })
676
+ ]
362
677
  }
363
- ) : isLoading ? /* @__PURE__ */ jsxs5("div", { className: "flex h-full w-full flex-col items-center justify-center gap-2 rounded-md bg-black/15 text-xs text-white/70", children: [
364
- /* @__PURE__ */ jsx5("span", { className: "h-5 w-5 animate-spin rounded-full border-2 border-white/20 border-t-white/80" }),
365
- /* @__PURE__ */ jsx5("span", { children: "Generating QR\u2026" })
366
- ] }) : /* @__PURE__ */ jsx5("div", { className: "flex h-full w-full items-center justify-center rounded-md bg-black/15 text-xs text-white/70", children: isUnavailable ? "QR unavailable" : "Generating QR\u2026" })
678
+ ) : /* @__PURE__ */ jsx7("div", { className: "flex h-full w-full items-center justify-center rounded-md bg-black/15 text-xs text-white/70", children: "QR unavailable" })
367
679
  }
368
680
  );
369
681
  };
370
682
 
371
683
  // src/components/join-qr-overlay.tsx
372
- import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
684
+ import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
373
685
  var JoinQrOverlay = ({
374
686
  open,
375
687
  value,
@@ -429,7 +741,7 @@ var JoinQrOverlay = ({
429
741
  const handlePanelClick = (event) => {
430
742
  event.stopPropagation();
431
743
  };
432
- const dialog = /* @__PURE__ */ jsx6(
744
+ const dialog = /* @__PURE__ */ jsx8(
433
745
  "div",
434
746
  {
435
747
  role: "dialog",
@@ -441,7 +753,7 @@ var JoinQrOverlay = ({
441
753
  className
442
754
  ),
443
755
  onClick: onClose,
444
- children: /* @__PURE__ */ jsxs6(
756
+ children: /* @__PURE__ */ jsxs8(
445
757
  "div",
446
758
  {
447
759
  className: cn(
@@ -451,11 +763,11 @@ var JoinQrOverlay = ({
451
763
  ),
452
764
  onClick: handlePanelClick,
453
765
  children: [
454
- /* @__PURE__ */ jsxs6("div", { className: "space-y-1", children: [
455
- /* @__PURE__ */ jsx6("p", { className: "text-[11px] tracking-[0.18em] text-slate-400 uppercase", children: roomLabel }),
456
- roomId ? /* @__PURE__ */ jsx6("p", { className: "text-2xl font-semibold tracking-tight text-white tabular-nums", children: roomId }) : null
766
+ /* @__PURE__ */ jsxs8("div", { className: "space-y-1", children: [
767
+ /* @__PURE__ */ jsx8("p", { className: "text-[11px] tracking-[0.18em] text-slate-400 uppercase", children: roomLabel }),
768
+ roomId ? /* @__PURE__ */ jsx8("p", { className: "text-2xl font-semibold tracking-tight text-white tabular-nums", children: roomId }) : null
457
769
  ] }),
458
- effectiveStatus === "loading" ? /* @__PURE__ */ jsxs6(
770
+ effectiveStatus === "loading" ? /* @__PURE__ */ jsxs8(
459
771
  "div",
460
772
  {
461
773
  className: cn(
@@ -468,11 +780,11 @@ var JoinQrOverlay = ({
468
780
  aspectRatio: "1 / 1"
469
781
  },
470
782
  children: [
471
- /* @__PURE__ */ jsx6("span", { className: "h-8 w-8 animate-spin rounded-full border-2 border-white/15 border-t-white/85" }),
472
- /* @__PURE__ */ jsx6("span", { children: loadingLabel })
783
+ /* @__PURE__ */ jsx8("span", { className: "h-8 w-8 animate-spin rounded-full border-2 border-white/15 border-t-white/85" }),
784
+ /* @__PURE__ */ jsx8("span", { children: loadingLabel })
473
785
  ]
474
786
  }
475
- ) : effectiveStatus === "ready" ? /* @__PURE__ */ jsx6(
787
+ ) : effectiveStatus === "ready" ? /* @__PURE__ */ jsx8(
476
788
  RoomQrCode,
477
789
  {
478
790
  value: joinUrlValue,
@@ -491,7 +803,7 @@ var JoinQrOverlay = ({
491
803
  },
492
804
  alt: qrAlt ?? (roomId ? `QR code to join room ${roomId}` : "QR code to join as a controller")
493
805
  }
494
- ) : /* @__PURE__ */ jsx6(
806
+ ) : /* @__PURE__ */ jsx8(
495
807
  "div",
496
808
  {
497
809
  className: cn(
@@ -506,7 +818,7 @@ var JoinQrOverlay = ({
506
818
  children: unavailableLabel
507
819
  }
508
820
  ),
509
- /* @__PURE__ */ jsx6(
821
+ /* @__PURE__ */ jsx8(
510
822
  "p",
511
823
  {
512
824
  className: cn(
@@ -516,7 +828,7 @@ var JoinQrOverlay = ({
516
828
  children: description
517
829
  }
518
830
  ),
519
- showCloseButton ? /* @__PURE__ */ jsx6(
831
+ showCloseButton ? /* @__PURE__ */ jsx8(
520
832
  Button,
521
833
  {
522
834
  type: "button",
@@ -543,7 +855,7 @@ var JoinQrOverlay = ({
543
855
 
544
856
  // src/components/join-url-action-buttons.tsx
545
857
  import { Check, Copy, ExternalLink, QrCode } from "lucide-react";
546
- import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
858
+ import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
547
859
  var JoinUrlActionButtons = ({
548
860
  hasValue,
549
861
  copied = false,
@@ -555,7 +867,7 @@ var JoinUrlActionButtons = ({
555
867
  buttonClassName
556
868
  }) => {
557
869
  const showsQrButton = typeof onToggleQr === "function";
558
- return /* @__PURE__ */ jsxs7(
870
+ return /* @__PURE__ */ jsxs9(
559
871
  "div",
560
872
  {
561
873
  className: cn(
@@ -564,7 +876,7 @@ var JoinUrlActionButtons = ({
564
876
  className
565
877
  ),
566
878
  children: [
567
- /* @__PURE__ */ jsxs7(
879
+ /* @__PURE__ */ jsxs9(
568
880
  Button,
569
881
  {
570
882
  type: "button",
@@ -579,12 +891,12 @@ var JoinUrlActionButtons = ({
579
891
  buttonClassName
580
892
  ),
581
893
  children: [
582
- copied ? /* @__PURE__ */ jsx7(Check, { className: "h-4 w-4", "aria-hidden": true }) : /* @__PURE__ */ jsx7(Copy, { className: "h-4 w-4", "aria-hidden": true }),
583
- /* @__PURE__ */ jsx7("span", { className: "truncate", children: copied ? "Copied" : "Copy" })
894
+ copied ? /* @__PURE__ */ jsx9(Check, { className: "h-4 w-4", "aria-hidden": true }) : /* @__PURE__ */ jsx9(Copy, { className: "h-4 w-4", "aria-hidden": true }),
895
+ /* @__PURE__ */ jsx9("span", { className: "truncate", children: copied ? "Copied" : "Copy" })
584
896
  ]
585
897
  }
586
898
  ),
587
- /* @__PURE__ */ jsxs7(
899
+ /* @__PURE__ */ jsxs9(
588
900
  Button,
589
901
  {
590
902
  type: "button",
@@ -599,12 +911,12 @@ var JoinUrlActionButtons = ({
599
911
  buttonClassName
600
912
  ),
601
913
  children: [
602
- /* @__PURE__ */ jsx7(ExternalLink, { className: "h-4 w-4", "aria-hidden": true }),
603
- /* @__PURE__ */ jsx7("span", { className: "truncate", children: "New tab" })
914
+ /* @__PURE__ */ jsx9(ExternalLink, { className: "h-4 w-4", "aria-hidden": true }),
915
+ /* @__PURE__ */ jsx9("span", { className: "truncate", children: "New tab" })
604
916
  ]
605
917
  }
606
918
  ),
607
- showsQrButton ? /* @__PURE__ */ jsxs7(
919
+ showsQrButton ? /* @__PURE__ */ jsxs9(
608
920
  Button,
609
921
  {
610
922
  type: "button",
@@ -620,8 +932,8 @@ var JoinUrlActionButtons = ({
620
932
  buttonClassName
621
933
  ),
622
934
  children: [
623
- /* @__PURE__ */ jsx7(QrCode, { className: "h-4 w-4", "aria-hidden": true }),
624
- /* @__PURE__ */ jsx7("span", { className: "truncate", children: qrVisible ? "Hide QR" : "QR code" })
935
+ /* @__PURE__ */ jsx9(QrCode, { className: "h-4 w-4", "aria-hidden": true }),
936
+ /* @__PURE__ */ jsx9("span", { className: "truncate", children: qrVisible ? "Hide QR" : "QR code" })
625
937
  ]
626
938
  }
627
939
  ) : null
@@ -632,7 +944,7 @@ var JoinUrlActionButtons = ({
632
944
 
633
945
  // src/components/join-url-field.tsx
634
946
  import { useId } from "react";
635
- import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
947
+ import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
636
948
  var JoinUrlField = ({
637
949
  value,
638
950
  label = "Controller link",
@@ -645,9 +957,9 @@ var JoinUrlField = ({
645
957
  const hasValue = Boolean(value && value.trim().length > 0);
646
958
  const generatedInputId = useId();
647
959
  const resolvedInputId = inputId ?? generatedInputId;
648
- return /* @__PURE__ */ jsxs8("div", { className: cn("space-y-2.5", className), children: [
649
- /* @__PURE__ */ jsx8("label", { className: shellLabelClassName, htmlFor: resolvedInputId, children: label }),
650
- /* @__PURE__ */ jsx8(
960
+ return /* @__PURE__ */ jsxs10("div", { className: cn("space-y-2.5", className), children: [
961
+ /* @__PURE__ */ jsx10("label", { className: shellLabelClassName, htmlFor: resolvedInputId, children: label }),
962
+ /* @__PURE__ */ jsx10(
651
963
  "input",
652
964
  {
653
965
  id: resolvedInputId,
@@ -660,12 +972,12 @@ var JoinUrlField = ({
660
972
  className: cn(shellFieldClassName, inputClassName)
661
973
  }
662
974
  ),
663
- helperText ? /* @__PURE__ */ jsx8("div", { className: shellHelperTextClassName, children: helperText }) : null
975
+ helperText ? /* @__PURE__ */ jsx10("div", { className: shellHelperTextClassName, children: helperText }) : null
664
976
  ] });
665
977
  };
666
978
 
667
979
  // src/components/join-url-controls.tsx
668
- import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
980
+ import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
669
981
  var JoinUrlControls = ({
670
982
  value,
671
983
  label = "Controller link",
@@ -679,9 +991,10 @@ var JoinUrlControls = ({
679
991
  inputClassName,
680
992
  buttonClassName
681
993
  }) => {
994
+ if (readEmbeddedHostChildSession()) return null;
682
995
  const hasValue = Boolean(value && value.trim().length > 0);
683
- return /* @__PURE__ */ jsx9("div", { className: cn("w-full space-y-3", className), children: /* @__PURE__ */ jsxs9("div", { className: "flex flex-col gap-3", children: [
684
- /* @__PURE__ */ jsx9(
996
+ return /* @__PURE__ */ jsx11("div", { className: cn("w-full space-y-3", className), children: /* @__PURE__ */ jsxs11("div", { className: "flex flex-col gap-3", children: [
997
+ /* @__PURE__ */ jsx11(
685
998
  JoinUrlField,
686
999
  {
687
1000
  value,
@@ -691,7 +1004,7 @@ var JoinUrlControls = ({
691
1004
  inputClassName
692
1005
  }
693
1006
  ),
694
- /* @__PURE__ */ jsx9(
1007
+ /* @__PURE__ */ jsx11(
695
1008
  JoinUrlActionButtons,
696
1009
  {
697
1010
  hasValue,
@@ -767,7 +1080,7 @@ var useLifecycleActionGroupModel = ({
767
1080
  };
768
1081
 
769
1082
  // src/components/lifecycle-action-group.tsx
770
- import { jsx as jsx10 } from "react/jsx-runtime";
1083
+ import { jsx as jsx12 } from "react/jsx-runtime";
771
1084
  var LifecycleActionGroup = ({
772
1085
  phase,
773
1086
  runtimeState,
@@ -803,23 +1116,23 @@ var LifecycleActionGroup = ({
803
1116
  const renderIcon = (kind, label) => {
804
1117
  switch (kind) {
805
1118
  case "start":
806
- return /* @__PURE__ */ jsx10(Play, { "aria-hidden": true, className: "size-4.5" });
1119
+ return /* @__PURE__ */ jsx12(Play, { "aria-hidden": true, className: "size-4.5" });
807
1120
  case "pause-toggle":
808
- return label.toLowerCase() === "resume" ? /* @__PURE__ */ jsx10(Play, { "aria-hidden": true, className: "size-4.5" }) : /* @__PURE__ */ jsx10(Pause, { "aria-hidden": true, className: "size-4.5" });
1121
+ return label.toLowerCase() === "resume" ? /* @__PURE__ */ jsx12(Play, { "aria-hidden": true, className: "size-4.5" }) : /* @__PURE__ */ jsx12(Pause, { "aria-hidden": true, className: "size-4.5" });
809
1122
  case "restart":
810
- return /* @__PURE__ */ jsx10(RotateCcw, { "aria-hidden": true, className: "size-4.5" });
1123
+ return /* @__PURE__ */ jsx12(RotateCcw, { "aria-hidden": true, className: "size-4.5" });
811
1124
  case "back-to-lobby":
812
- return /* @__PURE__ */ jsx10(House, { "aria-hidden": true, className: "size-4.5" });
1125
+ return /* @__PURE__ */ jsx12(House, { "aria-hidden": true, className: "size-4.5" });
813
1126
  }
814
1127
  };
815
- return /* @__PURE__ */ jsx10(
1128
+ return /* @__PURE__ */ jsx12(
816
1129
  "div",
817
1130
  {
818
1131
  className: cn(
819
1132
  "flex min-w-0 flex-nowrap items-center justify-end gap-1.5 overflow-x-auto",
820
1133
  className
821
1134
  ),
822
- children: actions.map((action) => /* @__PURE__ */ jsx10(
1135
+ children: actions.map((action) => /* @__PURE__ */ jsx12(
823
1136
  Button,
824
1137
  {
825
1138
  type: "button",
@@ -842,7 +1155,8 @@ var LifecycleActionGroup = ({
842
1155
  };
843
1156
 
844
1157
  // src/components/player-avatar.tsx
845
- import { Bot } from "lucide-react";
1158
+ import { Bot, UserRound } from "lucide-react";
1159
+ import { useState as useState4 } from "react";
846
1160
 
847
1161
  // src/utils/player-avatar-url.ts
848
1162
  var DIEBEAR_ADVENTURER_NEUTRAL_SVG_BASE = "https://api.dicebear.com/9.x/adventurer-neutral/svg";
@@ -874,7 +1188,7 @@ var getDiceBearAdventurerNeutralUrl = (seed) => `${DIEBEAR_ADVENTURER_NEUTRAL_SV
874
1188
  var getPlayerAvatarImageUrl = (player) => getDiceBearAdventurerNeutralUrl(resolvePlayerAvatarSeed(player));
875
1189
 
876
1190
  // src/components/player-avatar.tsx
877
- import { jsx as jsx11 } from "react/jsx-runtime";
1191
+ import { jsx as jsx13 } from "react/jsx-runtime";
878
1192
  var hexToRgba = (hex, opacity) => {
879
1193
  const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
880
1194
  if (!result) return `rgba(0, 0, 0, ${opacity})`;
@@ -889,6 +1203,7 @@ var PlayerAvatar = ({
889
1203
  size = "md",
890
1204
  className = ""
891
1205
  }) => {
1206
+ const [failedSrc, setFailedSrc] = useState4(null);
892
1207
  const accentColor = player.color || "hsl(var(--border))";
893
1208
  const sizeClasses = {
894
1209
  sm: "h-9 w-9 border-2",
@@ -911,7 +1226,7 @@ var PlayerAvatar = ({
911
1226
  className
912
1227
  );
913
1228
  if (isBot) {
914
- return /* @__PURE__ */ jsx11(
1229
+ return /* @__PURE__ */ jsx13(
915
1230
  "div",
916
1231
  {
917
1232
  role: "img",
@@ -925,15 +1240,38 @@ var PlayerAvatar = ({
925
1240
  color: accentColor,
926
1241
  boxShadow: shadowStyles[size]
927
1242
  },
928
- children: /* @__PURE__ */ jsx11(Bot, { "aria-hidden": "true", className: iconSizeClasses[size] })
1243
+ children: /* @__PURE__ */ jsx13(Bot, { "aria-hidden": "true", className: iconSizeClasses[size] })
1244
+ }
1245
+ );
1246
+ }
1247
+ const src = getPlayerAvatarImageUrl(player);
1248
+ if (failedSrc === src) {
1249
+ const initials = playerInitials(player.label);
1250
+ return /* @__PURE__ */ jsx13(
1251
+ "div",
1252
+ {
1253
+ role: "img",
1254
+ "aria-label": player.label,
1255
+ className: cn(
1256
+ "bg-secondary/40 flex items-center justify-center font-semibold uppercase",
1257
+ initialsSizeClasses[size],
1258
+ shellClassName
1259
+ ),
1260
+ style: {
1261
+ borderColor: accentColor,
1262
+ color: accentColor,
1263
+ boxShadow: shadowStyles[size]
1264
+ },
1265
+ children: initials ? /* @__PURE__ */ jsx13("span", { "aria-hidden": "true", children: initials }) : /* @__PURE__ */ jsx13(UserRound, { "aria-hidden": "true", className: iconSizeClasses[size] })
929
1266
  }
930
1267
  );
931
1268
  }
932
- return /* @__PURE__ */ jsx11(
1269
+ return /* @__PURE__ */ jsx13(
933
1270
  "img",
934
1271
  {
935
- src: getPlayerAvatarImageUrl(player),
1272
+ src,
936
1273
  alt: player.label,
1274
+ onError: () => setFailedSrc(src),
937
1275
  className: cn("bg-secondary/30", shellClassName),
938
1276
  style: {
939
1277
  borderColor: accentColor,
@@ -942,9 +1280,15 @@ var PlayerAvatar = ({
942
1280
  }
943
1281
  );
944
1282
  };
1283
+ var initialsSizeClasses = {
1284
+ sm: "text-xs",
1285
+ md: "text-sm",
1286
+ lg: "text-base"
1287
+ };
1288
+ var playerInitials = (label) => label.trim().split(/\s+/).filter(Boolean).slice(0, 2).map((word) => Array.from(word)[0] ?? "").join("");
945
1289
 
946
1290
  // src/components/player-avatar-strip.tsx
947
- import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
1291
+ import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
948
1292
  var overflowSizeClasses = {
949
1293
  sm: "h-9 w-9 min-h-9 min-w-9 text-[0.625rem]",
950
1294
  md: "h-12 w-12 min-h-12 min-w-12 text-[11px]",
@@ -960,8 +1304,8 @@ var PlayerAvatarStrip = ({
960
1304
  }) => {
961
1305
  const visible = players.slice(0, maxVisible);
962
1306
  const overflow = Math.max(0, players.length - maxVisible);
963
- return /* @__PURE__ */ jsxs10("div", { className: cn("flex items-center -space-x-2", className), children: [
964
- visible.map((player) => /* @__PURE__ */ jsx12(
1307
+ return /* @__PURE__ */ jsxs12("div", { className: cn("flex items-center -space-x-2", className), children: [
1308
+ visible.map((player) => /* @__PURE__ */ jsx14(
965
1309
  PlayerAvatar,
966
1310
  {
967
1311
  player,
@@ -970,7 +1314,7 @@ var PlayerAvatarStrip = ({
970
1314
  },
971
1315
  player.id
972
1316
  )),
973
- overflow > 0 && /* @__PURE__ */ jsxs10(
1317
+ overflow > 0 && /* @__PURE__ */ jsxs12(
974
1318
  "div",
975
1319
  {
976
1320
  className: cn(
@@ -989,14 +1333,14 @@ var PlayerAvatarStrip = ({
989
1333
  };
990
1334
 
991
1335
  // src/components/runtime-shell-header.tsx
992
- import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
1336
+ import { jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
993
1337
  var RuntimeShellHeader = ({
994
1338
  connectionStatus,
995
1339
  leftSlot,
996
1340
  rightSlot,
997
1341
  className
998
1342
  }) => {
999
- return /* @__PURE__ */ jsxs11(
1343
+ return /* @__PURE__ */ jsxs13(
1000
1344
  "header",
1001
1345
  {
1002
1346
  className: cn(
@@ -1005,10 +1349,10 @@ var RuntimeShellHeader = ({
1005
1349
  className
1006
1350
  ),
1007
1351
  children: [
1008
- /* @__PURE__ */ jsx13("div", { className: "min-w-0 flex-1", children: leftSlot }),
1009
- /* @__PURE__ */ jsxs11("div", { className: "flex shrink-0 items-center gap-2.5", children: [
1010
- /* @__PURE__ */ jsx13(ConnectionStatusPill, { status: connectionStatus }),
1011
- rightSlot ? /* @__PURE__ */ jsx13("div", { className: "flex items-center justify-end", children: rightSlot }) : null
1352
+ /* @__PURE__ */ jsx15("div", { className: "min-w-0 flex-1", children: leftSlot }),
1353
+ /* @__PURE__ */ jsxs13("div", { className: "flex shrink-0 items-center gap-2.5", children: [
1354
+ /* @__PURE__ */ jsx15(ConnectionStatusPill, { status: connectionStatus }),
1355
+ rightSlot ? /* @__PURE__ */ jsx15("div", { className: "flex items-center justify-end", children: rightSlot }) : null
1012
1356
  ] })
1013
1357
  ]
1014
1358
  }
@@ -1016,25 +1360,7 @@ var RuntimeShellHeader = ({
1016
1360
  };
1017
1361
 
1018
1362
  // src/components/surface-viewport.tsx
1019
- import { useEffect as useEffect4, useMemo, useRef as useRef2, useState as useState4 } from "react";
1020
-
1021
- // src/runtime/controller-presentation.ts
1022
- var publishEmbeddedControllerPresentation = (orientation) => {
1023
- if (typeof window === "undefined" || window.parent === window) {
1024
- return;
1025
- }
1026
- const runtimeParams = readEmbeddedControllerRuntimeParams();
1027
- if (!runtimeParams) {
1028
- return;
1029
- }
1030
- window.parent.postMessage(
1031
- createControllerPresentationSyncMessage({
1032
- orientation,
1033
- arcadeSurface: runtimeParams.arcadeSurface
1034
- }),
1035
- runtimeParams.topology.embedParentOrigin ?? "*"
1036
- );
1037
- };
1363
+ import { useContext as useContext2, useEffect as useEffect4, useMemo as useMemo2, useRef as useRef3, useState as useState5 } from "react";
1038
1364
 
1039
1365
  // src/components/surface-orientation-layout.ts
1040
1366
  var AIRJAM_SAFE_AREA_TOP = "env(safe-area-inset-top, 0px)";
@@ -1086,181 +1412,8 @@ var resolveForcedOrientationFrameStyle = (desired, needsRotation) => {
1086
1412
  };
1087
1413
  };
1088
1414
 
1089
- // src/components/surface-viewport-layout.ts
1090
- var CONTROLLER_REFERENCE_SIZE = {
1091
- portrait: {
1092
- width: 412,
1093
- height: 915
1094
- },
1095
- landscape: {
1096
- width: 915,
1097
- height: 412
1098
- }
1099
- };
1100
- var HOST_REFERENCE_SIZE = {
1101
- portrait: {
1102
- width: 900,
1103
- height: 1600
1104
- },
1105
- landscape: {
1106
- width: 1600,
1107
- height: 900
1108
- }
1109
- };
1110
- var resolveSurfaceViewportScopeReferenceSize = (sessionScope) => {
1111
- if (sessionScope === "controller") {
1112
- return CONTROLLER_REFERENCE_SIZE;
1113
- }
1114
- if (sessionScope === "host") {
1115
- return HOST_REFERENCE_SIZE;
1116
- }
1117
- return null;
1118
- };
1119
- var resolveSurfaceViewportReferenceSize = ({
1120
- sessionScope,
1121
- designWidth,
1122
- designHeight,
1123
- orientation,
1124
- availableWidth,
1125
- availableHeight
1126
- }) => {
1127
- if (typeof designWidth === "number" && Number.isFinite(designWidth) && designWidth > 0 && typeof designHeight === "number" && Number.isFinite(designHeight) && designHeight > 0) {
1128
- return {
1129
- width: designWidth,
1130
- height: designHeight
1131
- };
1132
- }
1133
- const scopedReferenceSize = resolveSurfaceViewportScopeReferenceSize(sessionScope);
1134
- if (scopedReferenceSize) {
1135
- return scopedReferenceSize[orientation];
1136
- }
1137
- return {
1138
- width: Math.max(availableWidth, 1),
1139
- height: Math.max(availableHeight, 1)
1140
- };
1141
- };
1142
- var SURFACE_VIEWPORT_TEXT_SIZE_BASES = {
1143
- xs: "0.75rem",
1144
- sm: "0.875rem",
1145
- base: "1rem",
1146
- lg: "1.125rem",
1147
- xl: "1.25rem",
1148
- "2xl": "1.5rem",
1149
- "3xl": "1.875rem",
1150
- "4xl": "2.25rem",
1151
- "5xl": "3rem",
1152
- "6xl": "3.75rem",
1153
- "7xl": "4.5rem",
1154
- "8xl": "6rem",
1155
- "9xl": "8rem"
1156
- };
1157
- var SURFACE_VIEWPORT_CONTAINER_BASES = {
1158
- "3xs": "16rem",
1159
- "2xs": "18rem",
1160
- xs: "20rem",
1161
- sm: "24rem",
1162
- md: "28rem",
1163
- lg: "32rem",
1164
- xl: "36rem",
1165
- "2xl": "42rem",
1166
- "3xl": "48rem",
1167
- "4xl": "56rem",
1168
- "5xl": "64rem",
1169
- "6xl": "72rem",
1170
- "7xl": "80rem"
1171
- };
1172
- var SURFACE_VIEWPORT_RADIUS_BASES = {
1173
- xs: "0.125rem",
1174
- sm: "0.375rem",
1175
- md: "0.5rem",
1176
- lg: "0.625rem",
1177
- xl: "0.875rem",
1178
- "2xl": "1rem",
1179
- "3xl": "1.5rem",
1180
- "4xl": "2rem"
1181
- };
1182
- var resolveSurfaceViewportAvailableSize = ({
1183
- safeViewportWidth,
1184
- safeViewportHeight,
1185
- orientation,
1186
- needsRotation
1187
- }) => {
1188
- if (!orientation || !needsRotation) {
1189
- return {
1190
- width: safeViewportWidth,
1191
- height: safeViewportHeight
1192
- };
1193
- }
1194
- return {
1195
- width: safeViewportHeight,
1196
- height: safeViewportWidth
1197
- };
1198
- };
1199
- var resolveSurfaceViewportScale = ({
1200
- availableWidth,
1201
- availableHeight,
1202
- referenceWidth,
1203
- referenceHeight,
1204
- scaleMode = "fit",
1205
- uiScaleMultiplier = 1,
1206
- minScale,
1207
- maxScale
1208
- }) => {
1209
- const safeAvailableWidth = Math.max(availableWidth, 1);
1210
- const safeAvailableHeight = Math.max(availableHeight, 1);
1211
- const safeReferenceWidth = Math.max(referenceWidth, 1);
1212
- const safeReferenceHeight = Math.max(referenceHeight, 1);
1213
- const widthScale = safeAvailableWidth / safeReferenceWidth;
1214
- const heightScale = safeAvailableHeight / safeReferenceHeight;
1215
- const baseScale = scaleMode === "width" ? widthScale : scaleMode === "height" ? heightScale : Math.min(widthScale, heightScale);
1216
- let scale = baseScale * uiScaleMultiplier;
1217
- if (typeof minScale === "number" && Number.isFinite(minScale)) {
1218
- scale = Math.max(scale, minScale);
1219
- }
1220
- if (typeof maxScale === "number" && Number.isFinite(maxScale)) {
1221
- scale = Math.min(scale, maxScale);
1222
- }
1223
- return scale;
1224
- };
1225
- var createScaledVariableValue = (baseValue) => `calc(${baseValue} * var(--airjam-ui-scale))`;
1226
- var createSurfaceViewportScaleStyle = ({
1227
- scale,
1228
- referenceWidth,
1229
- referenceHeight
1230
- }) => {
1231
- const style = {
1232
- position: "relative",
1233
- width: "100%",
1234
- height: "100%",
1235
- overflow: "hidden",
1236
- fontSize: createScaledVariableValue("1rem"),
1237
- "--airjam-ui-scale": String(scale),
1238
- "--airjam-ui-rem": createScaledVariableValue("1rem"),
1239
- "--airjam-reference-width": `${referenceWidth}px`,
1240
- "--airjam-reference-height": `${referenceHeight}px`,
1241
- "--spacing": createScaledVariableValue("0.25rem"),
1242
- "--radius": createScaledVariableValue("0.625rem")
1243
- };
1244
- for (const [name, baseValue] of Object.entries(
1245
- SURFACE_VIEWPORT_TEXT_SIZE_BASES
1246
- )) {
1247
- style[`--text-${name}`] = createScaledVariableValue(baseValue);
1248
- }
1249
- for (const [name, baseValue] of Object.entries(
1250
- SURFACE_VIEWPORT_CONTAINER_BASES
1251
- )) {
1252
- style[`--container-${name}`] = createScaledVariableValue(baseValue);
1253
- }
1254
- for (const [name, baseValue] of Object.entries(
1255
- SURFACE_VIEWPORT_RADIUS_BASES
1256
- )) {
1257
- style[`--radius-${name}`] = createScaledVariableValue(baseValue);
1258
- }
1259
- return style;
1260
- };
1261
-
1262
1415
  // src/components/surface-viewport.tsx
1263
- import { jsx as jsx14 } from "react/jsx-runtime";
1416
+ import { jsx as jsx16 } from "react/jsx-runtime";
1264
1417
  var readLayoutViewportSize = () => {
1265
1418
  if (typeof window === "undefined") {
1266
1419
  return { width: 0, height: 0 };
@@ -1333,7 +1486,7 @@ var getOrientation = ({
1333
1486
  };
1334
1487
  var SurfaceViewport = ({
1335
1488
  children,
1336
- orientation,
1489
+ orientation: requestedOrientation,
1337
1490
  lockOnGesture = true,
1338
1491
  className,
1339
1492
  contentClassName,
@@ -1344,9 +1497,16 @@ var SurfaceViewport = ({
1344
1497
  minScale,
1345
1498
  maxScale
1346
1499
  }) => {
1347
- const [viewport, setViewport] = useState4(null);
1348
- const viewportRef = useRef2(null);
1349
1500
  const sessionScope = useSessionScope();
1501
+ const declaredOrientation = useContext2(fixedControllerOrientationContext);
1502
+ const fixedOrientation = sessionScope === "controller" ? declaredOrientation : null;
1503
+ if (fixedOrientation && requestedOrientation && requestedOrientation !== fixedOrientation)
1504
+ throw new Error(
1505
+ "SurfaceViewport orientation conflicts with inputModalities: ['joystick'] in airjam.config: joystick games always use landscape; omit orientation."
1506
+ );
1507
+ const orientation = fixedOrientation ?? requestedOrientation;
1508
+ const [viewport, setViewport] = useState5(null);
1509
+ const viewportRef = useRef3(null);
1350
1510
  useEffect4(() => {
1351
1511
  if (typeof window === "undefined") {
1352
1512
  return;
@@ -1402,11 +1562,11 @@ var SurfaceViewport = ({
1402
1562
  const currentOrientation = viewport ? getOrientation(viewport) : "portrait";
1403
1563
  const effectiveOrientation = orientation ?? currentOrientation;
1404
1564
  const needsRotation = orientation ? currentOrientation !== orientation : false;
1405
- const shellStyle = useMemo(
1565
+ const shellStyle = useMemo2(
1406
1566
  () => orientation ? resolveForcedOrientationFrameStyle(orientation, needsRotation) : resolveForcedOrientationFrameStyle(effectiveOrientation, false),
1407
1567
  [effectiveOrientation, needsRotation, orientation]
1408
1568
  );
1409
- const availableSize = useMemo(
1569
+ const availableSize = useMemo2(
1410
1570
  () => resolveSurfaceViewportAvailableSize({
1411
1571
  safeViewportWidth: viewport?.width ?? 0,
1412
1572
  safeViewportHeight: viewport?.height ?? 0,
@@ -1415,7 +1575,7 @@ var SurfaceViewport = ({
1415
1575
  }),
1416
1576
  [needsRotation, orientation, viewport]
1417
1577
  );
1418
- const referenceSize = useMemo(
1578
+ const referenceSize = useMemo2(
1419
1579
  () => resolveSurfaceViewportReferenceSize({
1420
1580
  sessionScope,
1421
1581
  designWidth,
@@ -1433,7 +1593,7 @@ var SurfaceViewport = ({
1433
1593
  sessionScope
1434
1594
  ]
1435
1595
  );
1436
- const scale = useMemo(() => {
1596
+ const scale = useMemo2(() => {
1437
1597
  const scaleMode = sessionScope === "controller" ? effectiveOrientation === "portrait" ? "width" : "height" : "fit";
1438
1598
  return resolveSurfaceViewportScale({
1439
1599
  availableWidth: availableSize.width,
@@ -1456,7 +1616,7 @@ var SurfaceViewport = ({
1456
1616
  sessionScope,
1457
1617
  uiScaleMultiplier
1458
1618
  ]);
1459
- return /* @__PURE__ */ jsx14(
1619
+ return /* @__PURE__ */ jsx16(
1460
1620
  "div",
1461
1621
  {
1462
1622
  className: cn("fixed inset-0 overflow-hidden", className),
@@ -1464,7 +1624,7 @@ var SurfaceViewport = ({
1464
1624
  ...createSurfaceViewportOuterStyle(),
1465
1625
  ...style
1466
1626
  },
1467
- children: /* @__PURE__ */ jsx14("div", { style: shellStyle, children: /* @__PURE__ */ jsx14(
1627
+ children: /* @__PURE__ */ jsx16("div", { style: shellStyle, children: /* @__PURE__ */ jsx16(
1468
1628
  "div",
1469
1629
  {
1470
1630
  className: cn("h-full w-full overflow-hidden", contentClassName),
@@ -1474,7 +1634,7 @@ var SurfaceViewport = ({
1474
1634
  referenceWidth: referenceSize.width,
1475
1635
  referenceHeight: referenceSize.height
1476
1636
  }),
1477
- children: /* @__PURE__ */ jsx14("div", { className: "h-full w-full", "data-airjam-surface-root": "true", children })
1637
+ children: /* @__PURE__ */ jsx16("div", { className: "h-full w-full", "data-airjam-surface-root": "true", children })
1478
1638
  }
1479
1639
  ) })
1480
1640
  }
@@ -1483,12 +1643,12 @@ var SurfaceViewport = ({
1483
1643
 
1484
1644
  // src/components/volume-controls.tsx
1485
1645
  import { Headphones, Music, Volume2 as Volume22 } from "lucide-react";
1486
- import { jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
1646
+ import { jsx as jsx17, jsxs as jsxs14 } from "react/jsx-runtime";
1487
1647
  function VolumeControls(props) {
1488
1648
  if (props.values) {
1489
- return /* @__PURE__ */ jsx15(ControlledVolumeControls, { ...props });
1649
+ return /* @__PURE__ */ jsx17(ControlledVolumeControls, { ...props });
1490
1650
  }
1491
- return /* @__PURE__ */ jsx15(OwnedVolumeControls, { ...props });
1651
+ return /* @__PURE__ */ jsx17(OwnedVolumeControls, { ...props });
1492
1652
  }
1493
1653
  function OwnedVolumeControls({ className, compact }) {
1494
1654
  const {
@@ -1499,7 +1659,7 @@ function OwnedVolumeControls({ className, compact }) {
1499
1659
  setMusicVolume,
1500
1660
  setSfxVolume
1501
1661
  } = usePlatformAudioSettings();
1502
- return /* @__PURE__ */ jsx15(
1662
+ return /* @__PURE__ */ jsx17(
1503
1663
  ControlledVolumeControls,
1504
1664
  {
1505
1665
  className,
@@ -1525,20 +1685,20 @@ function ControlledVolumeControls({
1525
1685
  throw new Error("ControlledVolumeControls requires values");
1526
1686
  }
1527
1687
  const { masterVolume, musicVolume, sfxVolume } = values;
1528
- return /* @__PURE__ */ jsxs12("div", { className: cn("flex flex-col gap-3", compact && "gap-1", className), children: [
1529
- /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-2", children: [
1530
- /* @__PURE__ */ jsx15(Volume22, { className: "text-muted-foreground h-4 w-4" }),
1531
- /* @__PURE__ */ jsx15("span", { className: "text-sm font-medium", children: "Volume" })
1688
+ return /* @__PURE__ */ jsxs14("div", { className: cn("flex flex-col gap-3", compact && "gap-1", className), children: [
1689
+ /* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-2", children: [
1690
+ /* @__PURE__ */ jsx17(Volume22, { className: "text-muted-foreground h-4 w-4" }),
1691
+ /* @__PURE__ */ jsx17("span", { className: "text-sm font-medium", children: "Volume" })
1532
1692
  ] }),
1533
- /* @__PURE__ */ jsxs12("div", { className: "space-y-1.5", children: [
1534
- /* @__PURE__ */ jsxs12("div", { className: "flex items-center justify-between", children: [
1535
- /* @__PURE__ */ jsx15("label", { className: "text-muted-foreground text-xs", children: "Master" }),
1536
- /* @__PURE__ */ jsxs12("span", { className: "text-muted-foreground font-mono text-xs", children: [
1693
+ /* @__PURE__ */ jsxs14("div", { className: "space-y-1.5", children: [
1694
+ /* @__PURE__ */ jsxs14("div", { className: "flex items-center justify-between", children: [
1695
+ /* @__PURE__ */ jsx17("label", { className: "text-muted-foreground text-xs", children: "Master" }),
1696
+ /* @__PURE__ */ jsxs14("span", { className: "text-muted-foreground font-mono text-xs", children: [
1537
1697
  Math.round(masterVolume * 100),
1538
1698
  "%"
1539
1699
  ] })
1540
1700
  ] }),
1541
- /* @__PURE__ */ jsx15(
1701
+ /* @__PURE__ */ jsx17(
1542
1702
  Slider,
1543
1703
  {
1544
1704
  "data-testid": "platform-settings-master-volume",
@@ -1553,18 +1713,18 @@ function ControlledVolumeControls({
1553
1713
  }
1554
1714
  )
1555
1715
  ] }),
1556
- /* @__PURE__ */ jsxs12("div", { className: "space-y-1.5", children: [
1557
- /* @__PURE__ */ jsxs12("div", { className: "flex items-center justify-between", children: [
1558
- /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-1.5", children: [
1559
- /* @__PURE__ */ jsx15(Music, { className: "text-muted-foreground h-3 w-3" }),
1560
- /* @__PURE__ */ jsx15("label", { className: "text-muted-foreground text-xs", children: "Music" })
1716
+ /* @__PURE__ */ jsxs14("div", { className: "space-y-1.5", children: [
1717
+ /* @__PURE__ */ jsxs14("div", { className: "flex items-center justify-between", children: [
1718
+ /* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-1.5", children: [
1719
+ /* @__PURE__ */ jsx17(Music, { className: "text-muted-foreground h-3 w-3" }),
1720
+ /* @__PURE__ */ jsx17("label", { className: "text-muted-foreground text-xs", children: "Music" })
1561
1721
  ] }),
1562
- /* @__PURE__ */ jsxs12("span", { className: "text-muted-foreground font-mono text-xs", children: [
1722
+ /* @__PURE__ */ jsxs14("span", { className: "text-muted-foreground font-mono text-xs", children: [
1563
1723
  Math.round(musicVolume * 100),
1564
1724
  "%"
1565
1725
  ] })
1566
1726
  ] }),
1567
- /* @__PURE__ */ jsx15(
1727
+ /* @__PURE__ */ jsx17(
1568
1728
  Slider,
1569
1729
  {
1570
1730
  "data-testid": "platform-settings-music-volume",
@@ -1579,18 +1739,18 @@ function ControlledVolumeControls({
1579
1739
  }
1580
1740
  )
1581
1741
  ] }),
1582
- /* @__PURE__ */ jsxs12("div", { className: "space-y-1.5", children: [
1583
- /* @__PURE__ */ jsxs12("div", { className: "flex items-center justify-between", children: [
1584
- /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-1.5", children: [
1585
- /* @__PURE__ */ jsx15(Headphones, { className: "text-muted-foreground h-3 w-3" }),
1586
- /* @__PURE__ */ jsx15("label", { className: "text-muted-foreground text-xs", children: "SFX" })
1742
+ /* @__PURE__ */ jsxs14("div", { className: "space-y-1.5", children: [
1743
+ /* @__PURE__ */ jsxs14("div", { className: "flex items-center justify-between", children: [
1744
+ /* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-1.5", children: [
1745
+ /* @__PURE__ */ jsx17(Headphones, { className: "text-muted-foreground h-3 w-3" }),
1746
+ /* @__PURE__ */ jsx17("label", { className: "text-muted-foreground text-xs", children: "SFX" })
1587
1747
  ] }),
1588
- /* @__PURE__ */ jsxs12("span", { className: "text-muted-foreground font-mono text-xs", children: [
1748
+ /* @__PURE__ */ jsxs14("span", { className: "text-muted-foreground font-mono text-xs", children: [
1589
1749
  Math.round(sfxVolume * 100),
1590
1750
  "%"
1591
1751
  ] })
1592
1752
  ] }),
1593
- /* @__PURE__ */ jsx15(
1753
+ /* @__PURE__ */ jsx17(
1594
1754
  Slider,
1595
1755
  {
1596
1756
  "data-testid": "platform-settings-sfx-volume",
@@ -1666,7 +1826,7 @@ var useControllerShellStatus = ({
1666
1826
  };
1667
1827
 
1668
1828
  // src/hooks/use-host-join-controls.ts
1669
- import { useCallback as useCallback2, useEffect as useEffect5, useMemo as useMemo2, useRef as useRef3, useState as useState5 } from "react";
1829
+ import { useCallback as useCallback3, useEffect as useEffect5, useMemo as useMemo3, useRef as useRef4, useState as useState6 } from "react";
1670
1830
  var copyTextToClipboard = async (text) => {
1671
1831
  if (!text) {
1672
1832
  return false;
@@ -1701,17 +1861,17 @@ var useHostJoinControls = ({
1701
1861
  onStartMatch,
1702
1862
  copiedDurationMs = 1800
1703
1863
  }) => {
1704
- const [copied, setCopied] = useState5(false);
1705
- const [joinQrVisible, setJoinQrVisible] = useState5(false);
1706
- const resetTimerRef = useRef3(null);
1707
- const joinUrlValue = useMemo2(() => joinUrl ?? "", [joinUrl]);
1864
+ const [copied, setCopied] = useState6(false);
1865
+ const [joinQrVisible, setJoinQrVisible] = useState6(false);
1866
+ const resetTimerRef = useRef4(null);
1867
+ const joinUrlValue = useMemo3(() => joinUrl ?? "", [joinUrl]);
1708
1868
  const hasJoinUrl = joinUrlValue.length > 0;
1709
1869
  useEffect5(() => {
1710
1870
  if (!hasJoinUrl) {
1711
1871
  setJoinQrVisible(false);
1712
1872
  }
1713
1873
  }, [hasJoinUrl]);
1714
- const handleCopy = useCallback2(async () => {
1874
+ const handleCopy = useCallback3(async () => {
1715
1875
  if (!joinUrlValue) {
1716
1876
  return;
1717
1877
  }
@@ -1728,28 +1888,28 @@ var useHostJoinControls = ({
1728
1888
  resetTimerRef.current = null;
1729
1889
  }, copiedDurationMs);
1730
1890
  }, [copiedDurationMs, joinUrlValue]);
1731
- const handleOpen = useCallback2(() => {
1891
+ const handleOpen = useCallback3(() => {
1732
1892
  if (!joinUrlValue || typeof window === "undefined") {
1733
1893
  return;
1734
1894
  }
1735
1895
  window.open(joinUrlValue, "_blank", "noopener,noreferrer");
1736
1896
  }, [joinUrlValue]);
1737
- const showJoinQr = useCallback2(() => {
1897
+ const showJoinQr = useCallback3(() => {
1738
1898
  if (!hasJoinUrl) {
1739
1899
  return;
1740
1900
  }
1741
1901
  setJoinQrVisible(true);
1742
1902
  }, [hasJoinUrl]);
1743
- const hideJoinQr = useCallback2(() => {
1903
+ const hideJoinQr = useCallback3(() => {
1744
1904
  setJoinQrVisible(false);
1745
1905
  }, []);
1746
- const toggleJoinQr = useCallback2(() => {
1906
+ const toggleJoinQr = useCallback3(() => {
1747
1907
  if (!hasJoinUrl) {
1748
1908
  return;
1749
1909
  }
1750
1910
  setJoinQrVisible((current) => !current);
1751
1911
  }, [hasJoinUrl]);
1752
- const handleStart = useCallback2(() => {
1912
+ const handleStart = useCallback3(() => {
1753
1913
  if (!canStartMatch) {
1754
1914
  return;
1755
1915
  }
@@ -1771,10 +1931,13 @@ var useHostJoinControls = ({
1771
1931
  };
1772
1932
  export {
1773
1933
  AIRJAM_DEFAULT_AVATAR_SEEDS,
1934
+ AxisButton,
1774
1935
  Button,
1775
1936
  ConnectionStatusPill,
1937
+ ControlButton,
1776
1938
  ControllerPlayerNameField,
1777
1939
  ControllerPrimaryAction,
1940
+ GamepadLayout,
1778
1941
  HostMuteButton,
1779
1942
  JoinQrOverlay,
1780
1943
  JoinUrlActionButtons,
@@ -1786,12 +1949,10 @@ export {
1786
1949
  RoomQrCode,
1787
1950
  RuntimeShellHeader,
1788
1951
  Slider,
1952
+ Stick,
1789
1953
  SurfaceViewport,
1790
1954
  VolumeControls,
1791
- buttonVariants,
1792
1955
  getDiceBearAdventurerNeutralUrl,
1793
- getPlayerAvatarImageUrl,
1794
- resolvePlayerAvatarSeed,
1795
1956
  useControllerLifecycleIntents,
1796
1957
  useControllerLifecyclePermissions,
1797
1958
  useControllerShellStatus,