@limrun/ui 0.20.0 → 0.20.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.
@@ -1,21 +1,8 @@
1
- import { jsx as m, jsxs as $, Fragment as mt } from "react/jsx-runtime";
2
- import { f as Bt, c as pt, d as jt, b as Gt, h as qt, i as Qt, s as we, j as Zt, e as Jt, k as Y, l as Ge, m as en, o as He, p as E, q as We, a as tn, r as nn, t as p, u as on } from "./core-BhHpU_lr.mjs";
3
- import { memo as qe, useState as R, useEffect as x, useMemo as Te, useCallback as rn, lazy as cn, forwardRef as sn, useRef as S, useImperativeHandle as an, Suspense as ln } from "react";
4
- import { createPortal as dn } from "react-dom";
5
- import './index.css';function gt(d) {
6
- var r, h, u = "";
7
- if (typeof d == "string" || typeof d == "number") u += d;
8
- else if (typeof d == "object") if (Array.isArray(d)) {
9
- var b = d.length;
10
- for (r = 0; r < b; r++) d[r] && (h = gt(d[r])) && (u && (u += " "), u += h);
11
- } else for (h in d) d[h] && (u && (u += " "), u += h);
12
- return u;
13
- }
14
- function de() {
15
- for (var d, r, h = 0, u = "", b = arguments.length; h < b; h++) (d = arguments[h]) && (r = gt(d)) && (u && (u += " "), u += r);
16
- return u;
17
- }
18
- const un = async (d) => {
1
+ import { jsx as f, jsxs as $, Fragment as ft } from "react/jsx-runtime";
2
+ import { f as Kt, c as pt, d as Vt, b as Bt, h as jt, i as Gt, s as ye, j as qt, e as Qt, k as Y, l as je, m as Zt, o as Le, p as R, q as He, a as Jt, r as en, t as m, u as tn } from "./core-BhHpU_lr.mjs";
3
+ import { memo as Ge, useState as N, useEffect as x, useMemo as we, useCallback as nn, lazy as on, forwardRef as rn, useRef as _, useImperativeHandle as cn, Suspense as sn } from "react";
4
+ import { createPortal as an } from "react-dom";
5
+ import './index.css';const ln = async (d) => {
19
6
  if (!d) return !1;
20
7
  try {
21
8
  if (typeof navigator < "u" && navigator.clipboard?.writeText)
@@ -25,94 +12,94 @@ const un = async (d) => {
25
12
  try {
26
13
  const r = document.createElement("textarea");
27
14
  r.value = d, r.style.position = "fixed", r.style.opacity = "0", document.body.appendChild(r), r.select();
28
- const h = document.execCommand("copy");
29
- return document.body.removeChild(r), h;
15
+ const p = document.execCommand("copy");
16
+ return document.body.removeChild(r), p;
30
17
  } catch {
31
18
  return !1;
32
19
  }
33
- }, hn = qe(
34
- function({ element: r, screen: h, highlighted: u, selected: b, selectable: K, onClick: M }) {
35
- const T = Bt(r.frame, h);
20
+ }, dn = Ge(
21
+ function({ element: r, screen: p, highlighted: h, selected: k, selectable: K, onClick: I }) {
22
+ const T = Kt(r.frame, p);
36
23
  if (!T) return null;
37
24
  const U = pt(r);
38
- return /* @__PURE__ */ m(
25
+ return /* @__PURE__ */ f(
39
26
  "button",
40
27
  {
41
28
  type: "button",
42
- className: de("rc-inspect-box", !r.enabled && "rc-inspect-box-disabled"),
29
+ className: r.enabled ? "rc-inspect-box" : "rc-inspect-box rc-inspect-box-disabled",
43
30
  "data-ax-id": r.id,
44
31
  "data-ax-path": r.path,
45
32
  "data-ax-label": r.label || void 0,
46
33
  "data-ax-role": r.role || void 0,
47
- "data-highlighted": u ? "true" : "false",
48
- "data-selected": b ? "true" : "false",
34
+ "data-highlighted": h ? "true" : "false",
35
+ "data-selected": k ? "true" : "false",
49
36
  "aria-label": U,
50
37
  onClick: (H) => {
51
- K && (H.preventDefault(), H.stopPropagation(), M(r, { x: H.clientX, y: H.clientY }));
38
+ K && (H.preventDefault(), H.stopPropagation(), I(r, { x: H.clientX, y: H.clientY }));
52
39
  },
53
40
  style: {
54
- left: `${T.x / h.width * 100}%`,
55
- top: `${T.y / h.height * 100}%`,
56
- width: `${T.width / h.width * 100}%`,
57
- height: `${T.height / h.height * 100}%`
41
+ left: `${T.x / p.width * 100}%`,
42
+ top: `${T.y / p.height * 100}%`,
43
+ width: `${T.width / p.width * 100}%`,
44
+ height: `${T.height / p.height * 100}%`
58
45
  }
59
46
  }
60
47
  );
61
48
  },
62
- (d, r) => d.highlighted === r.highlighted && d.selected === r.selected && d.selectable === r.selectable && d.screen.width === r.screen.width && d.screen.height === r.screen.height && d.onClick === r.onClick && jt(d.element, r.element)
63
- ), fn = 260, mn = 220, pn = 6, gn = 8, vn = qe(function({
49
+ (d, r) => d.highlighted === r.highlighted && d.selected === r.selected && d.selectable === r.selectable && d.screen.width === r.screen.width && d.screen.height === r.screen.height && d.onClick === r.onClick && Vt(d.element, r.element)
50
+ ), un = 260, hn = 220, fn = 6, pn = 8, mn = Ge(function({
64
51
  element: r,
65
- platform: h,
66
- anchor: u,
67
- cursorAnchored: b,
52
+ platform: p,
53
+ anchor: h,
54
+ cursorAnchored: k,
68
55
  showActions: K,
69
- onTap: M
56
+ onTap: I
70
57
  }) {
71
- const [T, U] = R(null);
58
+ const [T, U] = N(null);
72
59
  x(() => {
73
60
  if (!T) return;
74
61
  const A = window.setTimeout(() => U(null), 1100);
75
62
  return () => window.clearTimeout(A);
76
63
  }, [T]);
77
- const H = Te(() => {
78
- const A = fn, F = mn, X = pn, g = gn, Q = typeof window < "u" ? window.innerWidth : 1024, oe = typeof window < "u" ? window.innerHeight : 768, Z = u.x + X + A <= Q - g, J = u.y - X - F >= g;
79
- let ue = Z ? u.x + X : u.x - X, be = J ? u.y - X : u.y + X;
80
- const Oe = `translate(${Z ? "0" : "-100%"}, ${J ? "-100%" : "0"})`;
81
- return ue = Math.max(g + (Z ? 0 : A), Math.min(Q - g - (Z ? A : 0), ue)), be = Math.max(g + (J ? F : 0), Math.min(oe - g - (J ? 0 : F), be)), { left: `${ue}px`, top: `${be}px`, transform: Oe };
82
- }, [u.x, u.y]), O = Te(() => Gt(r, h), [r, h]), W = h === "ios" ? r.selectors.AXUniqueId : r.selectors.resourceId, B = h === "ios" ? "AXUniqueId" : "resourceId", q = rn(async (A, F) => {
64
+ const H = we(() => {
65
+ const A = un, F = hn, X = fn, g = pn, Q = typeof window < "u" ? window.innerWidth : 1024, oe = typeof window < "u" ? window.innerHeight : 768, Z = h.x + X + A <= Q - g, J = h.y - X - F >= g;
66
+ let de = Z ? h.x + X : h.x - X, Ae = J ? h.y - X : h.y + X;
67
+ const Me = `translate(${Z ? "0" : "-100%"}, ${J ? "-100%" : "0"})`;
68
+ return de = Math.max(g + (Z ? 0 : A), Math.min(Q - g - (Z ? A : 0), de)), Ae = Math.max(g + (J ? F : 0), Math.min(oe - g - (J ? 0 : F), Ae)), { left: `${de}px`, top: `${Ae}px`, transform: Me };
69
+ }, [h.x, h.y]), M = we(() => Bt(r, p), [r, p]), W = p === "ios" ? r.selectors.AXUniqueId : r.selectors.resourceId, B = p === "ios" ? "AXUniqueId" : "resourceId", q = nn(async (A, F) => {
83
70
  if (!A) return;
84
- await un(A) && U(F);
85
- }, []), P = qt(r), Ae = r.label || r.value || P, ne = pt(r);
86
- return dn(
71
+ await ln(A) && U(F);
72
+ }, []), S = jt(r), Te = r.label || r.value || S, ne = pt(r);
73
+ return an(
87
74
  /* @__PURE__ */ $(
88
75
  "div",
89
76
  {
90
77
  className: "rc-inspect-card",
91
- "data-cursor-anchored": b ? "true" : "false",
78
+ "data-cursor-anchored": k ? "true" : "false",
92
79
  style: H,
93
80
  onClick: (A) => A.stopPropagation(),
94
81
  onMouseDown: (A) => A.stopPropagation(),
95
82
  onMouseMove: (A) => A.stopPropagation(),
96
83
  children: [
97
84
  /* @__PURE__ */ $("div", { className: "rc-inspect-card-header", children: [
98
- /* @__PURE__ */ m("span", { className: "rc-inspect-card-role", children: P }),
99
- !r.enabled && /* @__PURE__ */ m("span", { className: "rc-inspect-card-tag", children: "disabled" }),
100
- r.focused && /* @__PURE__ */ m("span", { className: "rc-inspect-card-tag rc-inspect-card-tag-blue", children: "focused" })
85
+ /* @__PURE__ */ f("span", { className: "rc-inspect-card-role", children: S }),
86
+ !r.enabled && /* @__PURE__ */ f("span", { className: "rc-inspect-card-tag", children: "disabled" }),
87
+ r.focused && /* @__PURE__ */ f("span", { className: "rc-inspect-card-tag rc-inspect-card-tag-blue", children: "focused" })
101
88
  ] }),
102
- /* @__PURE__ */ m("p", { className: "rc-inspect-card-title", title: ne, children: Ae }),
89
+ /* @__PURE__ */ f("p", { className: "rc-inspect-card-title", title: ne, children: Te }),
103
90
  W && /* @__PURE__ */ $("div", { className: "rc-inspect-card-row", children: [
104
91
  /* @__PURE__ */ $("span", { className: "rc-inspect-card-row-label", children: [
105
92
  B,
106
93
  ":"
107
94
  ] }),
108
- /* @__PURE__ */ m("span", { className: "rc-inspect-card-row-value", children: W })
95
+ /* @__PURE__ */ f("span", { className: "rc-inspect-card-row-value", children: W })
109
96
  ] }),
110
97
  r.value && r.value !== r.label && /* @__PURE__ */ $("div", { className: "rc-inspect-card-row", children: [
111
- /* @__PURE__ */ m("span", { className: "rc-inspect-card-row-label", children: "value:" }),
112
- /* @__PURE__ */ m("span", { className: "rc-inspect-card-row-value", children: r.value })
98
+ /* @__PURE__ */ f("span", { className: "rc-inspect-card-row-label", children: "value:" }),
99
+ /* @__PURE__ */ f("span", { className: "rc-inspect-card-row-value", children: r.value })
113
100
  ] }),
114
101
  /* @__PURE__ */ $("div", { className: "rc-inspect-card-row", children: [
115
- /* @__PURE__ */ m("span", { className: "rc-inspect-card-row-label", children: "frame:" }),
102
+ /* @__PURE__ */ f("span", { className: "rc-inspect-card-row-label", children: "frame:" }),
116
103
  /* @__PURE__ */ $("span", { className: "rc-inspect-card-row-value", children: [
117
104
  Math.round(r.frame.width),
118
105
  "×",
@@ -124,31 +111,31 @@ const un = async (d) => {
124
111
  ] })
125
112
  ] }),
126
113
  K && /* @__PURE__ */ $("div", { className: "rc-inspect-card-actions", children: [
127
- /* @__PURE__ */ m(
114
+ /* @__PURE__ */ f(
128
115
  "button",
129
116
  {
130
117
  type: "button",
131
118
  className: "rc-inspect-card-btn rc-inspect-card-btn-primary",
132
- onClick: () => M(r, u),
119
+ onClick: () => I(r, h),
133
120
  children: "Tap"
134
121
  }
135
122
  ),
136
- /* @__PURE__ */ m(
123
+ /* @__PURE__ */ f(
137
124
  "button",
138
125
  {
139
126
  type: "button",
140
- className: de("rc-inspect-card-btn", T === "selector" && "rc-inspect-card-btn-copied"),
141
- disabled: !O,
142
- title: O ?? "No usable selector for this element",
143
- onClick: () => q(O ?? void 0, "selector"),
127
+ className: T === "selector" ? "rc-inspect-card-btn rc-inspect-card-btn-copied" : "rc-inspect-card-btn",
128
+ disabled: !M,
129
+ title: M ?? "No usable selector for this element",
130
+ onClick: () => q(M ?? void 0, "selector"),
144
131
  children: T === "selector" ? "Copied!" : "Copy selector"
145
132
  }
146
133
  ),
147
- /* @__PURE__ */ m(
134
+ /* @__PURE__ */ f(
148
135
  "button",
149
136
  {
150
137
  type: "button",
151
- className: de("rc-inspect-card-btn", T === "id" && "rc-inspect-card-btn-copied"),
138
+ className: T === "id" ? "rc-inspect-card-btn rc-inspect-card-btn-copied" : "rc-inspect-card-btn",
152
139
  disabled: !W,
153
140
  title: W ?? `No ${B}`,
154
141
  onClick: () => q(W, "id"),
@@ -161,57 +148,57 @@ const un = async (d) => {
161
148
  ),
162
149
  document.body
163
150
  );
164
- }), yn = qe(function({
151
+ }), gn = Ge(function({
165
152
  snapshot: r,
166
- geometry: h,
167
- highlightedId: u,
168
- selectedId: b,
153
+ geometry: p,
154
+ highlightedId: h,
155
+ selectedId: k,
169
156
  mode: K,
170
- cursorPosition: M,
157
+ cursorPosition: I,
171
158
  frozenCursorPosition: T,
172
159
  onSelectChange: U,
173
160
  onTapElement: H
174
161
  }) {
175
- const O = K === "select", W = O ? u !== null && u !== b : u !== null, B = O ? u ?? b : u, q = Te(() => {
162
+ const M = K === "select", W = M ? h !== null && h !== k : h !== null, B = M ? h ?? k : h, q = we(() => {
176
163
  const g = /* @__PURE__ */ new Map();
177
164
  if (!r) return g;
178
165
  for (const Q of r.elements) g.set(Q.id, Q);
179
166
  return g;
180
- }, [r]), P = Te(() => B ? q.get(B) ?? null : null, [B, q]);
181
- if (!(!!r && !!h && r.screen.width > 0 && r.screen.height > 0 && r.elements.length > 0)) return null;
182
- const ne = W ? M : T ?? M, A = W, F = O && !W && b !== null, X = (g) => {
183
- O && g.target === g.currentTarget && U(null, null);
167
+ }, [r]), S = we(() => B ? q.get(B) ?? null : null, [B, q]);
168
+ if (!(!!r && !!p && r.screen.width > 0 && r.screen.height > 0 && r.elements.length > 0)) return null;
169
+ const ne = W ? I : T ?? I, A = W, F = M && !W && k !== null, X = (g) => {
170
+ M && g.target === g.currentTarget && U(null, null);
184
171
  };
185
- return /* @__PURE__ */ $(mt, { children: [
186
- /* @__PURE__ */ m(
172
+ return /* @__PURE__ */ $(ft, { children: [
173
+ /* @__PURE__ */ f(
187
174
  "div",
188
175
  {
189
- className: de("rc-inspect-overlay", O && "rc-inspect-overlay-select"),
176
+ className: M ? "rc-inspect-overlay rc-inspect-overlay-select" : "rc-inspect-overlay",
190
177
  style: {
191
- left: `${h.left}px`,
192
- top: `${h.top}px`,
193
- width: `${h.width}px`,
194
- height: `${h.height}px`
178
+ left: `${p.left}px`,
179
+ top: `${p.top}px`,
180
+ width: `${p.width}px`,
181
+ height: `${p.height}px`
195
182
  },
196
183
  onClick: X,
197
- children: r.elements.map((g) => /* @__PURE__ */ m(
198
- hn,
184
+ children: r.elements.map((g) => /* @__PURE__ */ f(
185
+ dn,
199
186
  {
200
187
  element: g,
201
188
  screen: r.screen,
202
- highlighted: g.id === u,
203
- selected: g.id === b,
204
- selectable: O,
189
+ highlighted: g.id === h,
190
+ selected: g.id === k,
191
+ selectable: M,
205
192
  onClick: U
206
193
  },
207
194
  g.id
208
195
  ))
209
196
  }
210
197
  ),
211
- P && ne && /* @__PURE__ */ m(
212
- vn,
198
+ S && ne && /* @__PURE__ */ f(
199
+ mn,
213
200
  {
214
- element: P,
201
+ element: S,
215
202
  platform: r.platform,
216
203
  anchor: ne,
217
204
  cursorAnchored: A,
@@ -220,9 +207,9 @@ const un = async (d) => {
220
207
  }
221
208
  )
222
209
  ] });
223
- }), wn = cn(() => import("./duo-view-tndcvbIi.mjs").then((d) => d.d)), xe = (d) => Object.entries(p).find(
224
- ([h, u]) => h.startsWith("ACTION_") && u === d
225
- )?.[0] ?? String(d), ht = 1920, ft = 1200, Tn = (d, r) => d === ht && r === ft || d === ft && r === ht, An = {
210
+ }), vn = on(() => import("./duo-view-tndcvbIi.mjs").then((d) => d.d)), We = (d) => Object.entries(m).find(
211
+ ([p, h]) => p.startsWith("ACTION_") && h === d
212
+ )?.[0] ?? String(d), ut = 1920, ht = 1200, yn = (d, r) => d === ut && r === ht || d === ht && r === ut, wn = {
226
213
  ios: {
227
214
  videoBorderRadiusMultiplier: 0.15,
228
215
  loadingLogoSize: "20%",
@@ -242,33 +229,33 @@ const un = async (d) => {
242
229
  }
243
230
  }
244
231
  };
245
- function bn(d) {
246
- const r = d.code, h = nn[r];
247
- if (!h)
248
- return Ge(`Unknown event.code: ${r}, key: ${d.key}`), null;
249
- let u = E.META_NONE;
250
- const b = r >= "KeyA" && r <= "KeyZ", K = d.getModifierState("CapsLock"), M = d.shiftKey;
251
- let T = M;
252
- return b && (T = M !== K), T && (u |= E.META_SHIFT_ON), d.ctrlKey && (u |= E.META_CTRL_ON), d.altKey && (u |= E.META_ALT_ON), d.metaKey && (u |= E.META_META_ON), { keycode: h, metaState: u };
232
+ function Tn(d) {
233
+ const r = d.code, p = en[r];
234
+ if (!p)
235
+ return je(`Unknown event.code: ${r}, key: ${d.key}`), null;
236
+ let h = R.META_NONE;
237
+ const k = r >= "KeyA" && r <= "KeyZ", K = d.getModifierState("CapsLock"), I = d.shiftKey;
238
+ let T = I;
239
+ return k && (T = I !== K), T && (h |= R.META_SHIFT_ON), d.ctrlKey && (h |= R.META_CTRL_ON), d.altKey && (h |= R.META_ALT_ON), d.metaKey && (h |= R.META_META_ON), { keycode: p, metaState: h };
253
240
  }
254
- const In = sn(
241
+ const Rn = rn(
255
242
  ({
256
243
  className: d,
257
244
  url: r,
258
- token: h,
259
- sessionId: u,
260
- openUrl: b,
245
+ token: p,
246
+ sessionId: h,
247
+ openUrl: k,
261
248
  showFrame: K = !0,
262
- deviceModel: M,
249
+ deviceModel: I,
263
250
  duoModelUrl: T,
264
251
  autoReconnect: U = !1,
265
252
  jitterBufferTargetMs: H,
266
- onPlaybackStats: O,
253
+ onPlaybackStats: M,
267
254
  onTerminated: W,
268
255
  assets: B,
269
256
  onConnectionStateChange: q,
270
- inspectMode: P,
271
- onAxSnapshotChange: Ae,
257
+ inspectMode: S,
258
+ onAxSnapshotChange: Te,
272
259
  onInspectSelectionChange: ne,
273
260
  onAxStatusChange: A,
274
261
  axPollIntervalMs: F,
@@ -278,61 +265,61 @@ const In = sn(
278
265
  onCameraStats: oe,
279
266
  onTrace: Z,
280
267
  microphoneEnabled: J = !1,
281
- onMicrophoneStateChange: ue
282
- }, be) => {
283
- const Ce = S(null), I = S(null), Oe = S(null), [vt, yt] = R(!1), z = M === "iphone-duo" || vt, _e = S(null), [Qe, wt] = R(null), [Ze, Tt] = R(), [At, bt] = R(!1), [Ct, Nt] = R(!1), [Rt, Et] = R(!1), [Je, et] = R(!1), [It, tt] = R(!1), [Mt, $e] = R({}), Ue = S(null), _ = S(/* @__PURE__ */ new Map()), re = S(!1), [Ot, _t] = R(!1), C = S(null), he = S(null), Ne = S({
268
+ onMicrophoneStateChange: de
269
+ }, Ae) => {
270
+ const be = _(null), E = _(null), Me = _(null), [mt, gt] = N(!1), z = I === "iphone-duo" || mt, Oe = _(null), [qe, vt] = N(null), [Qe, yt] = N(), [wt, Tt] = N(!1), [At, bt] = N(!1), [Ct, Nt] = N(!1), [Ze, Je] = N(!1), [Rt, et] = N(!1), [Et, xe] = N({}), $e = _(null), O = _(/* @__PURE__ */ new Map()), re = _(!1), [It, Mt] = N(!1), b = _(null), ue = _(null), Ce = _({
284
271
  handle: () => {
285
272
  },
286
273
  end: () => {
287
274
  }
288
- }), [ie, Se] = R(null), [nt, Fe] = R(null), [ze, Re] = R(null), [Ke, Pe] = R(null), [St, ot] = R(null), [Pt, rt] = R(null), ke = S(null), j = S(void 0), it = (e) => {
289
- ke.current = e, j.current === void 0 && (j.current = window.requestAnimationFrame(() => {
290
- j.current = void 0, rt(ke.current);
275
+ }), [ie, _e] = N(null), [tt, Ue] = N(null), [Fe, Ne] = N(null), [ze, Se] = N(null), [Ot, nt] = N(null), [_t, ot] = N(null), Pe = _(null), j = _(void 0), rt = (e) => {
276
+ Pe.current = e, j.current === void 0 && (j.current = window.requestAnimationFrame(() => {
277
+ j.current = void 0, ot(Pe.current);
291
278
  }));
292
- }, [kt, fe] = R(null), ce = S(null);
293
- ce.current = nt;
294
- const me = S(ne);
295
- me.current = ne;
296
- const Ee = P === !0 || P === "hover-only", Yt = P === "hover-only" ? "hover-only" : "select", ee = Te(() => Qt(r), [r]), Xt = Te(
297
- () => u || Array.from(crypto.getRandomValues(new Uint32Array(4)), (e) => e.toString(36)).join(""),
298
- [u]
299
- ), pe = An[ee], Ie = B?.[ee], ct = ee === "android" && It ? Je ? Ie?.tabletFrameLandscape : Ie?.tabletFrame : Je ? Ie?.frameLandscape : Ie?.frame, st = Ie?.loadingLogo, Ye = !z && K && !!ct, v = S(null), V = (e) => v.current?.sendControl(e), Ve = (e, n) => v.current?.sendDuoControl(e, n) ?? Promise.reject(new Error("Simulator disconnected")), at = -10, lt = (e, n) => {
300
- const o = Me();
279
+ }, [St, he] = N(null), ce = _(null);
280
+ ce.current = tt;
281
+ const fe = _(ne);
282
+ fe.current = ne;
283
+ const Re = S === !0 || S === "hover-only", Pt = S === "hover-only" ? "hover-only" : "select", ee = we(() => Gt(r), [r]), kt = we(
284
+ () => h || Array.from(crypto.getRandomValues(new Uint32Array(4)), (e) => e.toString(36)).join(""),
285
+ [h]
286
+ ), pe = wn[ee], Ee = B?.[ee], it = ee === "android" && Rt ? Ze ? Ee?.tabletFrameLandscape : Ee?.tabletFrame : Ze ? Ee?.frameLandscape : Ee?.frame, ct = Ee?.loadingLogo, ke = !z && K && !!it, v = _(null), V = (e) => v.current?.sendControl(e), Ke = (e, n) => v.current?.sendDuoControl(e, n) ?? Promise.reject(new Error("Simulator disconnected")), st = -10, at = (e, n) => {
287
+ const o = Ie();
301
288
  if (!o) return;
302
- const t = ve(o, e, n);
289
+ const t = ge(o, e, n);
303
290
  if (!t) return;
304
- const { videoX: c, videoY: s, videoWidth: i, videoHeight: a } = t, l = We(
305
- p.ACTION_DOWN,
306
- at,
291
+ const { videoX: c, videoY: s, videoWidth: i, videoHeight: a } = t, l = He(
292
+ m.ACTION_DOWN,
293
+ st,
307
294
  i,
308
295
  a,
309
296
  c,
310
297
  s,
311
298
  1,
312
- p.BUTTON_PRIMARY,
313
- p.BUTTON_PRIMARY
299
+ m.BUTTON_PRIMARY,
300
+ m.BUTTON_PRIMARY
314
301
  );
315
302
  l && V(l), window.setTimeout(() => {
316
- const f = We(
317
- p.ACTION_UP,
318
- at,
303
+ const u = He(
304
+ m.ACTION_UP,
305
+ st,
319
306
  i,
320
307
  a,
321
308
  c,
322
309
  s,
323
310
  0,
324
- p.BUTTON_PRIMARY,
325
- p.BUTTON_PRIMARY
311
+ m.BUTTON_PRIMARY,
312
+ m.BUTTON_PRIMARY
326
313
  );
327
- f && V(f);
314
+ u && V(u);
328
315
  }, 60);
329
- }, Dt = (e, n) => {
330
- const o = Me();
316
+ }, Yt = (e, n) => {
317
+ const o = Ie();
331
318
  if (!o || n.screen.width <= 0 || n.screen.height <= 0) return;
332
319
  const t = e.frame.x + e.frame.width / 2, c = e.frame.y + e.frame.height / 2, s = t / n.screen.width * o.actualWidth, i = c / n.screen.height * o.actualHeight, a = o.videoRect.left + o.offsetX + s, l = o.videoRect.top + o.offsetY + i;
333
- lt(a, l);
334
- }, Xe = -1, De = -2, se = -3, ge = (e, n, o, t, c, s) => {
335
- const i = We(
320
+ at(a, l);
321
+ }, Ye = -1, Xe = -2, se = -3, me = (e, n, o, t, c, s) => {
322
+ const i = He(
336
323
  e,
337
324
  n,
338
325
  o,
@@ -341,12 +328,12 @@ const In = sn(
341
328
  s,
342
329
  1,
343
330
  // pressure
344
- p.BUTTON_PRIMARY,
345
- p.BUTTON_PRIMARY
331
+ m.BUTTON_PRIMARY,
332
+ m.BUTTON_PRIMARY
346
333
  );
347
334
  i && (Y("[rc-touch] sendSingleTouch", {
348
335
  action: e,
349
- actionName: xe(e),
336
+ actionName: We(e),
350
337
  pointerId: n,
351
338
  x: c,
352
339
  y: s,
@@ -355,18 +342,18 @@ const In = sn(
355
342
  }, ae = (e, n, o) => {
356
343
  if (!o) return;
357
344
  const { videoX: t, videoY: c, videoWidth: s, videoHeight: i } = o;
358
- let a = null, l = null, f = 1;
359
- const N = p.BUTTON_PRIMARY;
345
+ let a = null, l = null, u = 1;
346
+ const C = m.BUTTON_PRIMARY;
360
347
  switch (n) {
361
348
  case "down":
362
- e !== se && Ne.current.end(), a = _.current.size === 0 ? p.ACTION_DOWN : p.ACTION_POINTER_DOWN, l = { x: t, y: c }, _.current.set(e, l), e === -1 && I.current?.focus();
349
+ e !== se && Ce.current.end(), a = O.current.size === 0 ? m.ACTION_DOWN : m.ACTION_POINTER_DOWN, l = { x: t, y: c }, O.current.set(e, l), e === -1 && E.current?.focus();
363
350
  break;
364
351
  case "move":
365
- _.current.has(e) && (a = p.ACTION_MOVE, l = { x: t, y: c }, _.current.set(e, l));
352
+ O.current.has(e) && (a = m.ACTION_MOVE, l = { x: t, y: c }, O.current.set(e, l));
366
353
  break;
367
354
  case "up":
368
355
  case "cancel":
369
- _.current.has(e) && (l = _.current.get(e), _.current.delete(e), n === "cancel" ? a = p.ACTION_CANCEL : a = _.current.size === 0 ? p.ACTION_UP : p.ACTION_POINTER_UP);
356
+ O.current.has(e) && (l = O.current.get(e), O.current.delete(e), n === "cancel" ? a = m.ACTION_CANCEL : a = O.current.size === 0 ? m.ACTION_UP : m.ACTION_POINTER_UP);
370
357
  break;
371
358
  }
372
359
  if (a !== null && l !== null) {
@@ -374,69 +361,69 @@ const In = sn(
374
361
  pointerId: e,
375
362
  eventType: n,
376
363
  action: a,
377
- actionName: xe(a),
364
+ actionName: We(a),
378
365
  positionToSend: l,
379
366
  video: { width: s, height: i },
380
367
  altHeld: re.current,
381
- activePointersAfter: Array.from(_.current.entries()).map(([k, w]) => ({
382
- id: k,
368
+ activePointersAfter: Array.from(O.current.entries()).map(([P, w]) => ({
369
+ id: P,
383
370
  x: w.x,
384
371
  y: w.y
385
372
  }))
386
373
  });
387
- const y = We(
374
+ const y = He(
388
375
  a,
389
376
  e,
390
377
  s,
391
378
  i,
392
379
  l.x,
393
380
  l.y,
394
- f,
395
- N,
396
- N
381
+ u,
382
+ C,
383
+ C
397
384
  );
398
385
  y && (Y("[rc-touch][mouse->touch] buffer", {
399
386
  pointerId: e,
400
- actionName: xe(a),
387
+ actionName: We(a),
401
388
  byteLength: y.byteLength
402
389
  }), V(y));
403
- } else (n === "up" || n === "cancel") && _.current.delete(e);
404
- }, Be = (e) => {
405
- if (re.current !== e && (re.current = e, _t(e), e || Se(null), Y("[rc-touch][alt] updateAltHeld", {
390
+ } else (n === "up" || n === "cancel") && O.current.delete(e);
391
+ }, Ve = (e) => {
392
+ if (re.current !== e && (re.current = e, Mt(e), e || _e(null), Y("[rc-touch][alt] updateAltHeld", {
406
393
  nextHeld: e,
407
- activePointerIds: Array.from(_.current.keys())
394
+ activePointerIds: Array.from(O.current.keys())
408
395
  }), ee === "ios" && v.current?.getState().controlReady)) {
409
- const n = e ? E.ACTION_DOWN : E.ACTION_UP, o = He(
396
+ const n = e ? R.ACTION_DOWN : R.ACTION_UP, o = Le(
410
397
  n,
411
- E.KEYCODE_ALT_LEFT,
398
+ R.KEYCODE_ALT_LEFT,
412
399
  0,
413
- E.META_NONE
400
+ R.META_NONE
414
401
  );
415
402
  Y("[rc-touch][alt] sending Indigo modifier keycode", {
416
403
  action: n,
417
- keycode: E.KEYCODE_ALT_LEFT
404
+ keycode: R.KEYCODE_ALT_LEFT
418
405
  }), o && V(o);
419
406
  }
420
- }, Me = () => {
421
- const e = I.current, n = Ce.current;
407
+ }, Ie = () => {
408
+ const e = E.current, n = be.current;
422
409
  if (!e || !n) return null;
423
410
  const o = e.videoWidth, t = e.videoHeight;
424
411
  if (!o || !t) return null;
425
- const c = e.getBoundingClientRect(), s = n.getBoundingClientRect(), i = c.width, a = c.height, l = o / t, f = i / a;
426
- let N = i, y = a;
427
- l > f ? y = i / l : N = a * l;
428
- const k = (i - N) / 2, w = (a - y) / 2;
412
+ const c = e.getBoundingClientRect(), s = n.getBoundingClientRect(), i = c.width, a = c.height, l = o / t, u = i / a;
413
+ let C = i, y = a;
414
+ l > u ? y = i / l : C = a * l;
415
+ const P = (i - C) / 2, w = (a - y) / 2;
429
416
  return {
430
417
  videoWidth: o,
431
418
  videoHeight: t,
432
419
  videoRect: c,
433
420
  containerRect: s,
434
- actualWidth: N,
421
+ actualWidth: C,
435
422
  actualHeight: y,
436
- offsetX: k,
423
+ offsetX: P,
437
424
  offsetY: w
438
425
  };
439
- }, ve = (e, n, o) => {
426
+ }, ge = (e, n, o) => {
440
427
  const t = n - e.videoRect.left - e.offsetX, c = o - e.videoRect.top - e.offsetY, s = Math.max(0, Math.min(e.actualWidth, t)), i = Math.max(0, Math.min(e.actualHeight, c)), a = Math.max(
441
428
  0,
442
429
  Math.min(e.videoWidth, s / e.actualWidth * e.videoWidth)
@@ -450,14 +437,14 @@ const In = sn(
450
437
  videoWidth: e.videoWidth,
451
438
  videoHeight: e.videoHeight
452
439
  };
453
- }, Lt = (e, n, o) => {
440
+ }, Xt = (e, n, o) => {
454
441
  const t = n - e.videoRect.left - e.offsetX, c = o - e.videoRect.top - e.offsetY, s = Math.max(0, Math.min(e.actualWidth, t)), i = Math.max(0, Math.min(e.actualHeight, c)), a = Math.max(
455
442
  0,
456
443
  Math.min(e.videoWidth, s / e.actualWidth * e.videoWidth)
457
444
  ), l = Math.max(
458
445
  0,
459
446
  Math.min(e.videoHeight, i / e.actualHeight * e.videoHeight)
460
- ), f = e.videoWidth - a, N = e.videoHeight - l, y = e.videoRect.left + e.offsetX, k = e.videoRect.top + e.offsetY, w = y - e.containerRect.left + s, G = k - e.containerRect.top + i, le = y - e.containerRect.left + (e.actualWidth - s), L = k - e.containerRect.top + (e.actualHeight - i);
447
+ ), u = e.videoWidth - a, C = e.videoHeight - l, y = e.videoRect.left + e.offsetX, P = e.videoRect.top + e.offsetY, w = y - e.containerRect.left + s, G = P - e.containerRect.top + i, le = y - e.containerRect.left + (e.actualWidth - s), L = P - e.containerRect.top + (e.actualHeight - i);
461
448
  return {
462
449
  containerX: w,
463
450
  containerY: G,
@@ -465,58 +452,58 @@ const In = sn(
465
452
  mirrorContainerY: L,
466
453
  videoX: a,
467
454
  videoY: l,
468
- mirrorVideoX: f,
469
- mirrorVideoY: N,
455
+ mirrorVideoX: u,
456
+ mirrorVideoY: C,
470
457
  videoWidth: e.videoWidth,
471
458
  videoHeight: e.videoHeight
472
459
  };
473
- }, Ht = (e, n, o, t, c, s, i) => {
474
- const a = on(e, n, o, t, c, s, i);
460
+ }, Dt = (e, n, o, t, c, s, i) => {
461
+ const a = tn(e, n, o, t, c, s, i);
475
462
  Y("[rc-touch2] sendTwoFingerMessage (iOS)", {
476
- actionName: xe(e),
463
+ actionName: We(e),
477
464
  video: { width: n, height: o },
478
465
  p0: { x: t, y: c },
479
466
  p1: { x: s, y: i },
480
467
  byteLength: a.byteLength
481
468
  }), V(a);
482
- }, ye = (e, n, o, t, c, s, i, a, l) => {
469
+ }, ve = (e, n, o, t, c, s, i, a, l) => {
483
470
  if (Y("[rc-touch2] applyTwoFingerEvent", {
484
471
  platform: ee,
485
472
  eventType: e,
486
473
  video: { width: n, height: o },
487
474
  p0: { x: t, y: c, id: a },
488
475
  p1: { x: s, y: i, id: l }
489
- }), e === "down" && Ne.current.end(), ee === "ios") {
490
- const f = e === "down" ? p.ACTION_DOWN : e === "move" ? p.ACTION_MOVE : p.ACTION_UP;
491
- Ht(f, n, o, t, c, s, i);
476
+ }), e === "down" && Ce.current.end(), ee === "ios") {
477
+ const u = e === "down" ? m.ACTION_DOWN : e === "move" ? m.ACTION_MOVE : m.ACTION_UP;
478
+ Dt(u, n, o, t, c, s, i);
492
479
  } else
493
- e === "down" ? (ge(p.ACTION_DOWN, a, n, o, t, c), ge(p.ACTION_POINTER_DOWN, l, n, o, s, i)) : e === "move" ? (ge(p.ACTION_MOVE, a, n, o, t, c), ge(p.ACTION_MOVE, l, n, o, s, i)) : (ge(p.ACTION_POINTER_UP, l, n, o, s, i), ge(p.ACTION_UP, a, n, o, t, c));
494
- }, Wt = (e, n, o) => {
480
+ e === "down" ? (me(m.ACTION_DOWN, a, n, o, t, c), me(m.ACTION_POINTER_DOWN, l, n, o, s, i)) : e === "move" ? (me(m.ACTION_MOVE, a, n, o, t, c), me(m.ACTION_MOVE, l, n, o, s, i)) : (me(m.ACTION_POINTER_UP, l, n, o, s, i), me(m.ACTION_UP, a, n, o, t, c));
481
+ }, Lt = (e, n, o) => {
495
482
  if (!re.current) {
496
- ie !== null && Se(null);
483
+ ie !== null && _e(null);
497
484
  return;
498
485
  }
499
- const t = Lt(e, n, o);
500
- Se(t);
501
- }, xt = (e, n, o) => {
486
+ const t = Xt(e, n, o);
487
+ _e(t);
488
+ }, Ht = (e, n, o) => {
502
489
  const t = ce.current;
503
490
  if (!t || t.screen.width <= 0 || t.screen.height <= 0) return null;
504
491
  const c = n - e.videoRect.left - e.offsetX, s = o - e.videoRect.top - e.offsetY;
505
492
  if (c < 0 || s < 0 || c > e.actualWidth || s > e.actualHeight) return null;
506
493
  const i = c / e.actualWidth * t.screen.width, a = s / e.actualHeight * t.screen.height;
507
- return tn(t, i, a);
494
+ return Jt(t, i, a);
508
495
  }, te = (e) => {
509
496
  if (z) return;
510
497
  e.preventDefault(), e.stopPropagation();
511
- const n = Me();
512
- if ((P === !0 || P === "hover-only") && !("touches" in e))
498
+ const n = Ie();
499
+ if ((S === !0 || S === "hover-only") && !("touches" in e))
513
500
  if (e.type === "mousemove") {
514
- if (it({ x: e.clientX, y: e.clientY }), n) {
515
- const t = xt(n, e.clientX, e.clientY);
516
- Re(t?.id ?? null);
501
+ if (rt({ x: e.clientX, y: e.clientY }), n) {
502
+ const t = Ht(n, e.clientX, e.clientY);
503
+ Ne(t?.id ?? null);
517
504
  }
518
- } else e.type === "mouseleave" && (it(null), Re(null));
519
- if (P !== !0 && (!("touches" in e) && n && (e.type === "mousemove" ? Wt(n, e.clientX, e.clientY) : e.type === "mouseleave" && Se(null)), !(!v.current?.getState().controlReady || !I.current || !n)))
505
+ } else e.type === "mouseleave" && (rt(null), Ne(null));
506
+ if (S !== !0 && (!("touches" in e) && n && (e.type === "mousemove" ? Lt(n, e.clientX, e.clientY) : e.type === "mouseleave" && _e(null)), !(!v.current?.getState().controlReady || !E.current || !n)))
520
507
  if ("touches" in e) {
521
508
  const t = e.touches, c = e.changedTouches;
522
509
  let s;
@@ -537,39 +524,39 @@ const In = sn(
537
524
  return;
538
525
  }
539
526
  if (t.length === 2) {
540
- const i = t[0], a = t[1], l = ve(n, i.clientX, i.clientY), f = ve(n, a.clientX, a.clientY);
541
- if (!l || !f) return;
542
- C.current ? C.current.source === "real-touch" && (C.current.finger0 = { x: l.videoX, y: l.videoY }, C.current.finger1 = { x: f.videoX, y: f.videoY }, ye(
527
+ const i = t[0], a = t[1], l = ge(n, i.clientX, i.clientY), u = ge(n, a.clientX, a.clientY);
528
+ if (!l || !u) return;
529
+ b.current ? b.current.source === "real-touch" && (b.current.finger0 = { x: l.videoX, y: l.videoY }, b.current.finger1 = { x: u.videoX, y: u.videoY }, ve(
543
530
  "move",
544
531
  l.videoWidth,
545
532
  l.videoHeight,
546
533
  l.videoX,
547
534
  l.videoY,
548
- f.videoX,
549
- f.videoY,
550
- C.current.pointerId0,
551
- C.current.pointerId1
552
- )) : (C.current = {
535
+ u.videoX,
536
+ u.videoY,
537
+ b.current.pointerId0,
538
+ b.current.pointerId1
539
+ )) : (b.current = {
553
540
  finger0: { x: l.videoX, y: l.videoY },
554
- finger1: { x: f.videoX, y: f.videoY },
541
+ finger1: { x: u.videoX, y: u.videoY },
555
542
  videoSize: { width: l.videoWidth, height: l.videoHeight },
556
543
  source: "real-touch",
557
544
  pointerId0: i.identifier,
558
545
  pointerId1: a.identifier
559
- }, ye(
546
+ }, ve(
560
547
  "down",
561
548
  l.videoWidth,
562
549
  l.videoHeight,
563
550
  l.videoX,
564
551
  l.videoY,
565
- f.videoX,
566
- f.videoY,
552
+ u.videoX,
553
+ u.videoY,
567
554
  i.identifier,
568
555
  a.identifier
569
556
  ));
570
- } else if (t.length < 2 && C.current?.source === "real-touch") {
571
- const i = C.current;
572
- ye(
557
+ } else if (t.length < 2 && b.current?.source === "real-touch") {
558
+ const i = b.current;
559
+ ve(
573
560
  "up",
574
561
  i.videoSize.width,
575
562
  i.videoSize.height,
@@ -579,7 +566,7 @@ const In = sn(
579
566
  i.finger1.y,
580
567
  i.pointerId0,
581
568
  i.pointerId1
582
- ), C.current = null;
569
+ ), b.current = null;
583
570
  return;
584
571
  } else {
585
572
  if (t.length > 2)
@@ -587,30 +574,30 @@ const In = sn(
587
574
  {
588
575
  const i = c[0];
589
576
  if (i) {
590
- const a = ve(n, i.clientX, i.clientY);
577
+ const a = ge(n, i.clientX, i.clientY);
591
578
  ae(i.identifier, s, a);
592
579
  }
593
580
  }
594
581
  }
595
582
  } else {
596
583
  let c = null;
597
- const s = C.current?.source === "alt-mouse";
584
+ const s = b.current?.source === "alt-mouse";
598
585
  switch (e.type) {
599
586
  case "mousedown":
600
587
  e.button === 0 && (c = "down");
601
588
  break;
602
589
  case "mousemove":
603
- (s || _.current.has(-1)) && (c = "move");
590
+ (s || O.current.has(-1)) && (c = "move");
604
591
  break;
605
592
  case "mouseup":
606
593
  e.button === 0 && (c = "up");
607
594
  break;
608
595
  case "mouseleave":
609
- (s || _.current.has(-1)) && (c = "up");
596
+ (s || O.current.has(-1)) && (c = "up");
610
597
  break;
611
598
  }
612
599
  if (c) {
613
- const i = ve(n, e.clientX, e.clientY);
600
+ const i = ge(n, e.clientX, e.clientY);
614
601
  if (!i)
615
602
  return;
616
603
  Y("[rc-touch][mouse] event", {
@@ -627,21 +614,21 @@ const In = sn(
627
614
  videoWidth: i.videoWidth,
628
615
  videoHeight: i.videoHeight
629
616
  },
630
- activePointerIds: Array.from(_.current.keys())
631
- }), re.current || s ? $t(c, i) : ae(-1, c, i);
617
+ activePointerIds: Array.from(O.current.keys())
618
+ }), re.current || s ? Wt(c, i) : ae(-1, c, i);
632
619
  }
633
620
  }
634
- }, $t = (e, n) => {
621
+ }, Wt = (e, n) => {
635
622
  const { videoX: o, videoY: t, videoWidth: c, videoHeight: s } = n, i = c - o, a = s - t;
636
623
  if (e === "down") {
637
- C.current = {
624
+ b.current = {
638
625
  finger0: { x: o, y: t },
639
626
  finger1: { x: i, y: a },
640
627
  videoSize: { width: c, height: s },
641
628
  source: "alt-mouse",
642
- pointerId0: Xe,
643
- pointerId1: De
644
- }, I.current?.focus(), ye(
629
+ pointerId0: Ye,
630
+ pointerId1: Xe
631
+ }, E.current?.focus(), ve(
645
632
  "down",
646
633
  c,
647
634
  s,
@@ -649,13 +636,13 @@ const In = sn(
649
636
  t,
650
637
  i,
651
638
  a,
652
- Xe,
653
- De
639
+ Ye,
640
+ Xe
654
641
  );
655
642
  return;
656
643
  }
657
644
  if (e === "move") {
658
- C.current?.source === "alt-mouse" && (C.current.finger0 = { x: o, y: t }, C.current.finger1 = { x: i, y: a }, ye(
645
+ b.current?.source === "alt-mouse" && (b.current.finger0 = { x: o, y: t }, b.current.finger1 = { x: i, y: a }, ve(
659
646
  "move",
660
647
  c,
661
648
  s,
@@ -663,95 +650,95 @@ const In = sn(
663
650
  t,
664
651
  i,
665
652
  a,
666
- Xe,
667
- De
653
+ Ye,
654
+ Xe
668
655
  ));
669
656
  return;
670
657
  }
671
658
  if (e === "up" || e === "cancel") {
672
- const l = C.current;
659
+ const l = b.current;
673
660
  if (l?.source === "alt-mouse") {
674
- const { finger0: f, finger1: N, videoSize: y } = l;
675
- ye(
661
+ const { finger0: u, finger1: C, videoSize: y } = l;
662
+ ve(
676
663
  "up",
677
664
  y.width,
678
665
  y.height,
679
- f.x,
680
- f.y,
681
- N.x,
682
- N.y,
683
- Xe,
684
- De
685
- ), C.current = null;
666
+ u.x,
667
+ u.y,
668
+ C.x,
669
+ C.y,
670
+ Ye,
671
+ Xe
672
+ ), b.current = null;
686
673
  }
687
674
  return;
688
675
  }
689
- }, Ut = 150, dt = () => {
690
- const e = he.current;
691
- e && (window.clearTimeout(e.endTimer), ae(se, "up", e.pos), he.current = null);
692
- }, Ft = (e) => {
693
- if (e.ctrlKey || re.current || C.current) return;
694
- const n = _.current.size;
695
- if (n > 1 || n === 1 && !_.current.has(se)) return;
696
- const o = Me();
676
+ }, xt = 150, lt = () => {
677
+ const e = ue.current;
678
+ e && (window.clearTimeout(e.endTimer), ae(se, "up", e.pos), ue.current = null);
679
+ }, $t = (e) => {
680
+ if (e.ctrlKey || re.current || b.current) return;
681
+ const n = O.current.size;
682
+ if (n > 1 || n === 1 && !O.current.has(se)) return;
683
+ const o = Ie();
697
684
  if (!o) return;
698
685
  const t = e.clientX - o.videoRect.left - o.offsetX, c = e.clientY - o.videoRect.top - o.offsetY;
699
686
  if (t < 0 || t > o.actualWidth || c < 0 || c > o.actualHeight)
700
687
  return;
701
- const s = ve(o, e.clientX, e.clientY);
688
+ const s = ge(o, e.clientX, e.clientY);
702
689
  if (!s) return;
703
690
  e.preventDefault();
704
- const i = (e.deltaMode === 1 ? 16 : e.deltaMode === 2 ? o.actualWidth : 1) * (o.videoWidth / o.actualWidth), a = (e.deltaMode === 1 ? 16 : e.deltaMode === 2 ? o.actualHeight : 1) * (o.videoHeight / o.actualHeight), l = -e.deltaX * i, f = -e.deltaY * a, N = (L) => {
705
- window.clearTimeout(L.endTimer), L.endTimer = window.setTimeout(dt, Ut);
691
+ const i = (e.deltaMode === 1 ? 16 : e.deltaMode === 2 ? o.actualWidth : 1) * (o.videoWidth / o.actualWidth), a = (e.deltaMode === 1 ? 16 : e.deltaMode === 2 ? o.actualHeight : 1) * (o.videoHeight / o.actualHeight), l = -e.deltaX * i, u = -e.deltaY * a, C = (L) => {
692
+ window.clearTimeout(L.endTimer), L.endTimer = window.setTimeout(lt, xt);
706
693
  };
707
- if (l === 0 && f === 0) {
708
- he.current && N(he.current);
694
+ if (l === 0 && u === 0) {
695
+ ue.current && C(ue.current);
709
696
  return;
710
697
  }
711
698
  const y = () => ({
712
699
  videoWidth: s.videoWidth,
713
700
  videoHeight: s.videoHeight,
714
- videoX: Math.abs(l) > Math.abs(f) ? Math.min(Math.max(s.videoX, s.videoWidth * 0.2), s.videoWidth * 0.8) : s.videoX,
715
- videoY: Math.abs(f) >= Math.abs(l) ? Math.min(Math.max(s.videoY, s.videoHeight * 0.2), s.videoHeight * 0.8) : s.videoY
716
- }), k = (L) => ({
701
+ videoX: Math.abs(l) > Math.abs(u) ? Math.min(Math.max(s.videoX, s.videoWidth * 0.2), s.videoWidth * 0.8) : s.videoX,
702
+ videoY: Math.abs(u) >= Math.abs(l) ? Math.min(Math.max(s.videoY, s.videoHeight * 0.2), s.videoHeight * 0.8) : s.videoY
703
+ }), P = (L) => ({
717
704
  ...L,
718
705
  videoX: Math.min(Math.max(L.videoX + l, 0), L.videoWidth),
719
- videoY: Math.min(Math.max(L.videoY + f, 0), L.videoHeight)
706
+ videoY: Math.min(Math.max(L.videoY + u, 0), L.videoHeight)
720
707
  });
721
- let w = he.current;
708
+ let w = ue.current;
722
709
  if (w)
723
710
  window.clearTimeout(w.endTimer);
724
711
  else {
725
712
  const L = y();
726
- ae(se, "down", L), w = { pos: L, endTimer: 0 }, he.current = w;
713
+ ae(se, "down", L), w = { pos: L, endTimer: 0 }, ue.current = w;
727
714
  }
728
- let G = w.pos, le = k(G);
729
- le.videoX === G.videoX && le.videoY === G.videoY && (ae(se, "up", G), G = y(), ae(se, "down", G), le = k(G)), ae(se, "move", le), w.pos = le, N(w);
715
+ let G = w.pos, le = P(G);
716
+ le.videoX === G.videoX && le.videoY === G.videoY && (ae(se, "up", G), G = y(), ae(se, "down", G), le = P(G)), ae(se, "move", le), w.pos = le, C(w);
730
717
  };
731
718
  x(() => {
732
- Ne.current = { handle: Ft, end: dt };
719
+ Ce.current = { handle: $t, end: lt };
733
720
  }), x(() => {
734
- const e = Ce.current;
721
+ const e = be.current;
735
722
  if (!e) return;
736
- const n = (o) => Ne.current.handle(o);
723
+ const n = (o) => Ce.current.handle(o);
737
724
  return e.addEventListener("wheel", n, { passive: !1 }), () => {
738
- Ne.current.end(), e.removeEventListener("wheel", n);
725
+ Ce.current.end(), e.removeEventListener("wheel", n);
739
726
  };
740
727
  }, []), x(() => {
741
728
  const e = (t) => {
742
- t.key === "Alt" && Be(!0);
729
+ t.key === "Alt" && Ve(!0);
743
730
  }, n = (t) => {
744
- t.key === "Alt" && Be(!1);
731
+ t.key === "Alt" && Ve(!1);
745
732
  }, o = () => {
746
- Be(!1);
733
+ Ve(!1);
747
734
  };
748
735
  return window.addEventListener("keydown", e, !0), window.addEventListener("keyup", n, !0), window.addEventListener("blur", o), () => {
749
736
  window.removeEventListener("keydown", e, !0), window.removeEventListener("keyup", n, !0), window.removeEventListener("blur", o);
750
737
  };
751
738
  }, []);
752
- const Le = (e) => {
739
+ const De = (e) => {
753
740
  e.preventDefault(), e.stopPropagation();
754
- const n = document.activeElement === I.current || z && document.activeElement === e.currentTarget;
741
+ const n = document.activeElement === E.current || z && document.activeElement === e.currentTarget;
755
742
  if (Y("Keyboard event:", {
756
743
  type: e.type,
757
744
  key: e.key,
@@ -760,11 +747,11 @@ const In = sn(
760
747
  target: e.target.tagName,
761
748
  focused: n
762
749
  }), !n) {
763
- Ge("Simulator input not focused, skipping keyboard event");
750
+ je("Simulator input not focused, skipping keyboard event");
764
751
  return;
765
752
  }
766
753
  if (!v.current?.getState().controlReady) {
767
- Ge("Data channel not ready for keyboard event:", v.current?.getState().connection);
754
+ je("Data channel not ready for keyboard event:", v.current?.getState().connection);
768
755
  return;
769
756
  }
770
757
  if (e.type === "keydown") {
@@ -775,7 +762,7 @@ const In = sn(
775
762
  "Pasting text via SET_CLIPBOARD:",
776
763
  t.substring(0, 20) + (t.length > 20 ? "..." : "")
777
764
  );
778
- const c = en(t, !0);
765
+ const c = Zt(t, !0);
779
766
  V(c);
780
767
  }
781
768
  }).catch((t) => {
@@ -785,29 +772,29 @@ const In = sn(
785
772
  }
786
773
  if (e.key.toLowerCase() === "m" && (e.metaKey || e.ctrlKey)) {
787
774
  Y("Menu shortcut detected");
788
- const t = He(
789
- E.ACTION_DOWN,
790
- E.MENU,
775
+ const t = Le(
776
+ R.ACTION_DOWN,
777
+ R.MENU,
791
778
  0,
792
- E.META_NONE
779
+ R.META_NONE
793
780
  // Modifiers are handled by the shortcut check, not passed down
794
781
  );
795
782
  V(t);
796
- const c = He(
797
- E.ACTION_UP,
798
- E.MENU,
783
+ const c = Le(
784
+ R.ACTION_UP,
785
+ R.MENU,
799
786
  0,
800
- E.META_NONE
787
+ R.META_NONE
801
788
  );
802
789
  V(c);
803
790
  return;
804
791
  }
805
792
  }
806
- const o = bn(e);
793
+ const o = Tn(e);
807
794
  if (o) {
808
- const { keycode: t, metaState: c } = o, s = e.type === "keydown" ? E.ACTION_DOWN : E.ACTION_UP;
795
+ const { keycode: t, metaState: c } = o, s = e.type === "keydown" ? R.ACTION_DOWN : R.ACTION_UP;
809
796
  Y(`Sending Keycode: key=${e.key}, code=${t}, action=${s}, meta=${c}`);
810
- const i = He(
797
+ const i = Le(
811
798
  s,
812
799
  t,
813
800
  0,
@@ -817,101 +804,101 @@ const In = sn(
817
804
  V(i);
818
805
  } else
819
806
  Y(`Ignoring unhandled key event: type=${e.type}, key=${e.key}`);
820
- }, zt = (e) => {
807
+ }, Ut = (e) => {
821
808
  e.stopPropagation(), v.current?.reconnect();
822
- }, D = S({
823
- onAxSnapshotChange: Ae,
809
+ }, D = _({
810
+ onAxSnapshotChange: Te,
824
811
  onAxStatusChange: A,
825
812
  onCameraDemandChange: Q,
826
813
  onCameraStats: oe,
827
- onMicrophoneStateChange: ue,
814
+ onMicrophoneStateChange: de,
828
815
  onTrace: Z,
829
816
  onTerminated: W,
830
817
  onConnectionStateChange: q,
831
- onPlaybackStats: O
818
+ onPlaybackStats: M
832
819
  });
833
820
  D.current = {
834
- onAxSnapshotChange: Ae,
821
+ onAxSnapshotChange: Te,
835
822
  onAxStatusChange: A,
836
823
  onCameraDemandChange: Q,
837
824
  onCameraStats: oe,
838
- onMicrophoneStateChange: ue,
825
+ onMicrophoneStateChange: de,
839
826
  onTrace: Z,
840
827
  onTerminated: W,
841
828
  onConnectionStateChange: q,
842
- onPlaybackStats: O
829
+ onPlaybackStats: M
843
830
  };
844
- const je = !!Z;
831
+ const Be = !!Z;
845
832
  x(() => {
846
- Ue.current = null, et(!1), tt(!1), $e({});
847
- }, [r, M]), x(() => {
833
+ $e.current = null, Je(!1), et(!1), xe({});
834
+ }, [r, I]), x(() => {
848
835
  let e = !0;
849
- ce.current !== null && (ce.current = null, Fe(null), we("onAxSnapshotChange", D.current.onAxSnapshotChange, null));
850
- const n = Zt({
836
+ ce.current !== null && (ce.current = null, Ue(null), ye("onAxSnapshotChange", D.current.onAxSnapshotChange, null));
837
+ const n = qt({
851
838
  url: r,
852
- token: h,
853
- sessionId: Xt,
854
- deviceModel: M,
839
+ token: p,
840
+ sessionId: kt,
841
+ deviceModel: I,
855
842
  autoReconnect: U,
856
843
  jitterBufferTargetMs: H,
857
- openUrl: b,
858
- inspectMode: P,
844
+ openUrl: k,
845
+ inspectMode: S,
859
846
  axPollIntervalMs: F,
860
847
  axMaxBackoffMs: X,
861
848
  androidElementTreeOptions: g,
862
849
  microphoneEnabled: J,
863
850
  onStateChange: (t) => {
864
- (t.videoReady || t.connection === "idle" || t.connection === "connecting" || t.connection === "reconnecting") && bt(t.videoReady), Nt(t.connection === "failed"), Et(t.connection === "terminated"), yt(t.duo), wt(t.duoState), Tt(t.duoError);
851
+ (t.videoReady || t.connection === "idle" || t.connection === "connecting" || t.connection === "reconnecting") && Tt(t.videoReady), bt(t.connection === "failed"), Nt(t.connection === "terminated"), gt(t.duo), vt(t.duoState), yt(t.duoError);
865
852
  },
866
853
  onAxSnapshotChange: (t) => {
867
- e && (Fe((c) => Jt(c, t) ? c : t), D.current.onAxSnapshotChange?.(t));
854
+ e && (Ue((c) => Qt(c, t) ? c : t), D.current.onAxSnapshotChange?.(t));
868
855
  },
869
856
  onAxStatusChange: (...t) => D.current.onAxStatusChange?.(...t),
870
857
  onCameraDemandChange: (...t) => D.current.onCameraDemandChange?.(...t),
871
858
  onCameraStats: oe ? (...t) => D.current.onCameraStats?.(...t) : void 0,
872
859
  onMicrophoneStateChange: (...t) => D.current.onMicrophoneStateChange?.(...t),
873
- onTrace: je ? (...t) => D.current.onTrace?.(...t) : void 0,
860
+ onTrace: Be ? (...t) => D.current.onTrace?.(...t) : void 0,
874
861
  onTerminated: () => D.current.onTerminated?.(),
875
862
  onConnectionStateChange: (...t) => D.current.onConnectionStateChange?.(...t),
876
- onPlaybackStats: O ? (...t) => D.current.onPlaybackStats?.(...t) : void 0
863
+ onPlaybackStats: M ? (...t) => D.current.onPlaybackStats?.(...t) : void 0
877
864
  });
878
865
  v.current = n;
879
- const o = I.current ? n.attachVideo(I.current) : void 0;
866
+ const o = E.current ? n.attachVideo(E.current) : void 0;
880
867
  return n.start(), () => {
881
868
  e = !1, n.dispose(), o?.(), v.current = null;
882
869
  };
883
- }, [r, h, u, M, je]), x(() => {
884
- if (z && _e.current)
885
- return v.current?.attachVideo(_e.current, "inner");
886
- }, [z, r, h, u, M, je]), x(() => {
870
+ }, [r, p, h, I, Be]), x(() => {
871
+ if (z && Oe.current)
872
+ return v.current?.attachVideo(Oe.current, "inner");
873
+ }, [z, r, p, h, I, Be]), x(() => {
887
874
  v.current?.updateOptions({
888
- openUrl: b,
875
+ openUrl: k,
889
876
  axPollIntervalMs: F,
890
877
  axMaxBackoffMs: X,
891
878
  androidElementTreeOptions: g,
892
879
  autoReconnect: U,
893
880
  jitterBufferTargetMs: H,
894
881
  microphoneEnabled: J,
895
- inspectMode: P,
896
- onPlaybackStats: O ? (...e) => D.current.onPlaybackStats?.(...e) : void 0,
882
+ inspectMode: S,
883
+ onPlaybackStats: M ? (...e) => D.current.onPlaybackStats?.(...e) : void 0,
897
884
  onCameraStats: oe ? (...e) => D.current.onCameraStats?.(...e) : void 0
898
885
  });
899
886
  }, [
900
887
  U,
901
888
  H,
902
889
  J,
903
- P,
904
- !!O,
890
+ S,
891
+ !!M,
905
892
  !!oe,
906
- b,
893
+ k,
907
894
  F,
908
895
  X,
909
896
  g
910
897
  ]);
911
- const ut = () => {
912
- const e = Me();
898
+ const dt = () => {
899
+ const e = Ie();
913
900
  if (!e) {
914
- ot(null);
901
+ nt(null);
915
902
  return;
916
903
  }
917
904
  const n = {
@@ -920,36 +907,36 @@ const In = sn(
920
907
  width: e.actualWidth,
921
908
  height: e.actualHeight
922
909
  };
923
- ot(
910
+ nt(
924
911
  (o) => o && o.left === n.left && o.top === n.top && o.width === n.width && o.height === n.height ? o : n
925
912
  );
926
913
  };
927
914
  x(() => {
928
- const e = I.current, n = Oe.current, o = Ce.current;
915
+ const e = E.current, n = Me.current, o = be.current;
929
916
  if (!e) return;
930
917
  const t = () => {
931
918
  const i = e.videoWidth > 0 && e.videoHeight > 0;
932
- i && (Ue.current = { width: e.videoWidth, height: e.videoHeight });
933
- const a = Ue.current, l = a ? `${a.width} / ${a.height}` : void 0;
934
- if (!Ye || !n) {
935
- $e(
919
+ i && ($e.current = { width: e.videoWidth, height: e.videoHeight });
920
+ const a = $e.current, l = a ? `${a.width} / ${a.height}` : void 0;
921
+ if (!ke || !n) {
922
+ xe(
936
923
  !i && a ? {
937
924
  aspectRatio: l,
938
925
  contain: "size",
939
926
  containIntrinsicSize: `${a.width}px ${a.height}px`
940
927
  } : {}
941
- ), ut();
928
+ ), dt();
942
929
  return;
943
930
  }
944
- const f = n.clientWidth, N = n.clientHeight;
945
- if (f === 0 || N === 0) return;
931
+ const u = n.clientWidth, C = n.clientHeight;
932
+ if (u === 0 || C === 0) return;
946
933
  const y = a ? a.width > a.height : !1;
947
- et(y), tt(
948
- ee === "android" && !!a && Tn(a.width, a.height)
934
+ Je(y), et(
935
+ ee === "android" && !!a && yn(a.width, a.height)
949
936
  );
950
- const k = y ? pe.videoPosition.landscape : pe.videoPosition.portrait;
937
+ const P = y ? pe.videoPosition.landscape : pe.videoPosition.portrait;
951
938
  let w = { aspectRatio: l };
952
- k.heightMultiplier ? (w.height = `${N * k.heightMultiplier}px`, w.width = "auto") : k.widthMultiplier && (w.width = `${f * k.widthMultiplier}px`, w.height = "auto"), w.borderRadius = `${y ? N * pe.videoBorderRadiusMultiplier : f * pe.videoBorderRadiusMultiplier}px`, $e(w), ut();
939
+ P.heightMultiplier ? (w.height = `${C * P.heightMultiplier}px`, w.width = "auto") : P.widthMultiplier && (w.width = `${u * P.widthMultiplier}px`, w.height = "auto"), w.borderRadius = `${y ? C * pe.videoBorderRadiusMultiplier : u * pe.videoBorderRadiusMultiplier}px`, xe(w), dt();
953
940
  }, c = new ResizeObserver(() => {
954
941
  t();
955
942
  });
@@ -958,21 +945,21 @@ const In = sn(
958
945
  return e.addEventListener("resize", s), t(), () => {
959
946
  c.disconnect(), e.removeEventListener("loadedmetadata", t), e.removeEventListener("resize", t), e.removeEventListener("resize", s), n && n.removeEventListener("load", t);
960
947
  };
961
- }, [pe, Ye, r, M]), x(() => {
962
- Ee || (Fe(null), Re(null), Pe(null), rt(null), fe(null), ke.current = null, j.current !== void 0 && (window.cancelAnimationFrame(j.current), j.current = void 0));
963
- }, [Ee]), x(() => () => {
948
+ }, [pe, ke, r, I]), x(() => {
949
+ Re || (Ue(null), Ne(null), Se(null), ot(null), he(null), Pe.current = null, j.current !== void 0 && (window.cancelAnimationFrame(j.current), j.current = void 0));
950
+ }, [Re]), x(() => () => {
964
951
  j.current !== void 0 && (window.cancelAnimationFrame(j.current), j.current = void 0);
965
952
  }, []), x(() => {
966
- if (!Ee) return;
953
+ if (!Re) return;
967
954
  const e = (n) => {
968
- n.key === "Escape" && (Ke || ze) && (Pe(null), Re(null), fe(null), we("onInspectSelectionChange", me.current, null));
955
+ n.key === "Escape" && (ze || Fe) && (Se(null), Ne(null), he(null), ye("onInspectSelectionChange", fe.current, null));
969
956
  };
970
957
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
971
- }, [Ee, Ke, ze]);
972
- const Kt = () => {
973
- I.current && I.current.focus();
958
+ }, [Re, ze, Fe]);
959
+ const Ft = () => {
960
+ E.current && E.current.focus();
974
961
  };
975
- an(be, () => ({
962
+ cn(Ae, () => ({
976
963
  openUrl: (e) => v.current?.openUrl(e),
977
964
  sendKeyEvent: (e) => v.current?.sendKeyEvent(e),
978
965
  screenshot: (e) => v.current?.screenshot(e) ?? Promise.reject(new Error("Simulator disconnected")),
@@ -981,21 +968,21 @@ const In = sn(
981
968
  refreshAxTree: () => v.current?.refreshAxTree() ?? Promise.reject(new Error("Simulator disconnected")),
982
969
  getAxSnapshot: () => v.current?.getAxSnapshot() ?? null,
983
970
  setInspectHighlight: (e) => {
984
- Re(e?.id ?? null);
971
+ Ne(e?.id ?? null);
985
972
  },
986
973
  setInspectSelection: (e) => {
987
- Pe(e?.id ?? null), fe(e ? ke.current : null);
974
+ Se(e?.id ?? null), he(e ? Pe.current : null);
988
975
  const n = ce.current;
989
- e && n ? we("onInspectSelectionChange", me.current, { element: e, snapshot: n }) : we("onInspectSelectionChange", me.current, null);
976
+ e && n ? ye("onInspectSelectionChange", fe.current, { element: e, snapshot: n }) : ye("onInspectSelectionChange", fe.current, null);
990
977
  },
991
978
  getAxStatus: () => v.current?.getAxStatus() ?? "idle"
992
979
  }));
993
- const Vt = Ot && ie !== null;
980
+ const zt = It && ie !== null;
994
981
  return /* @__PURE__ */ $(
995
982
  "div",
996
983
  {
997
- ref: Ce,
998
- className: de("rc-container", d),
984
+ ref: be,
985
+ className: ["rc-container", d].filter(Boolean).join(" "),
999
986
  style: { touchAction: "none" },
1000
987
  onMouseDown: te,
1001
988
  onMouseMove: te,
@@ -1006,8 +993,8 @@ const In = sn(
1006
993
  onTouchEnd: te,
1007
994
  onTouchCancel: te,
1008
995
  children: [
1009
- Vt && ie && /* @__PURE__ */ $(mt, { children: [
1010
- /* @__PURE__ */ m(
996
+ zt && ie && /* @__PURE__ */ $(ft, { children: [
997
+ /* @__PURE__ */ f(
1011
998
  "div",
1012
999
  {
1013
1000
  className: "rc-touch-indicator",
@@ -1017,7 +1004,7 @@ const In = sn(
1017
1004
  }
1018
1005
  }
1019
1006
  ),
1020
- /* @__PURE__ */ m(
1007
+ /* @__PURE__ */ f(
1021
1008
  "div",
1022
1009
  {
1023
1010
  className: "rc-touch-indicator",
@@ -1028,30 +1015,26 @@ const In = sn(
1028
1015
  }
1029
1016
  )
1030
1017
  ] }),
1031
- Ye && /* @__PURE__ */ m(
1018
+ ke && /* @__PURE__ */ f(
1032
1019
  "img",
1033
1020
  {
1034
- ref: Oe,
1035
- src: ct,
1021
+ ref: Me,
1022
+ src: it,
1036
1023
  alt: "",
1037
- className: ee === "ios" ? de("rc-phone-frame", "rc-phone-frame-ios") : "rc-phone-frame",
1024
+ className: ee === "ios" ? "rc-phone-frame rc-phone-frame-ios" : "rc-phone-frame",
1038
1025
  draggable: !1
1039
1026
  }
1040
1027
  ),
1041
- /* @__PURE__ */ m(
1028
+ /* @__PURE__ */ f(
1042
1029
  "video",
1043
1030
  {
1044
- ref: I,
1045
- className: de(
1046
- "rc-video",
1047
- !Ye && "rc-video-frameless",
1048
- !At && "rc-video-loading"
1049
- ),
1031
+ ref: E,
1032
+ className: ["rc-video", !ke && "rc-video-frameless", !wt && "rc-video-loading"].filter(Boolean).join(" "),
1050
1033
  style: {
1051
- ...Mt,
1034
+ ...Et,
1052
1035
  ...z ? { opacity: 0, width: 1, height: 1, pointerEvents: "none" } : {},
1053
- ...st ? {
1054
- backgroundImage: `url("${st}")`,
1036
+ ...ct ? {
1037
+ backgroundImage: `url("${ct}")`,
1055
1038
  backgroundRepeat: "no-repeat",
1056
1039
  backgroundPosition: "center",
1057
1040
  backgroundSize: pe.loadingLogoSize
@@ -1061,85 +1044,85 @@ const In = sn(
1061
1044
  playsInline: !0,
1062
1045
  muted: !0,
1063
1046
  tabIndex: z ? -1 : 0,
1064
- onKeyDown: Le,
1065
- onKeyUp: Le,
1066
- onClick: Kt,
1047
+ onKeyDown: De,
1048
+ onKeyUp: De,
1049
+ onClick: Ft,
1067
1050
  onFocus: () => {
1068
- I.current && (I.current.style.outline = "none");
1051
+ E.current && (E.current.style.outline = "none");
1069
1052
  },
1070
1053
  onBlur: () => {
1071
- I.current && (I.current.style.outline = "none");
1054
+ E.current && (E.current.style.outline = "none");
1072
1055
  }
1073
1056
  }
1074
1057
  ),
1075
- z && /* @__PURE__ */ m(
1058
+ z && /* @__PURE__ */ f(
1076
1059
  "video",
1077
1060
  {
1078
- ref: _e,
1061
+ ref: Oe,
1079
1062
  autoPlay: !0,
1080
1063
  playsInline: !0,
1081
1064
  muted: !0,
1082
1065
  style: { position: "absolute", width: 1, height: 1, opacity: 0, pointerEvents: "none" }
1083
1066
  }
1084
1067
  ),
1085
- z && Qe && /* @__PURE__ */ m(ln, { fallback: /* @__PURE__ */ m("div", { children: "Loading iPhone Duo…" }), children: /* @__PURE__ */ m(
1086
- wn,
1068
+ z && qe && /* @__PURE__ */ f(sn, { fallback: /* @__PURE__ */ f("div", { children: "Loading iPhone Duo…" }), children: /* @__PURE__ */ f(
1069
+ vn,
1087
1070
  {
1088
1071
  showFrame: K,
1089
1072
  modelUrl: T,
1090
- outer: I.current,
1091
- inner: _e.current,
1092
- state: Qe,
1093
- setAngle: (e) => Ve("setHingeAngle", { angleDegrees: e }),
1094
- setOrientation: (e) => Ve("setDuoOrientation", { orientation: e }),
1095
- button: (e, n) => Ve("performActions", {
1073
+ outer: E.current,
1074
+ inner: Oe.current,
1075
+ state: qe,
1076
+ setAngle: (e) => Ke("setHingeAngle", { angleDegrees: e }),
1077
+ setOrientation: (e) => Ke("setDuoOrientation", { orientation: e }),
1078
+ button: (e, n) => Ke("performActions", {
1096
1079
  actions: [{ type: n ? "buttonDown" : "buttonUp", button: e }]
1097
1080
  }),
1098
1081
  touch: (e, n, o, t) => {
1099
1082
  v.current?.sendDisplayTouch(e, n, o, t);
1100
1083
  },
1101
- onKeyDown: Le,
1102
- onKeyUp: Le
1084
+ onKeyDown: De,
1085
+ onKeyUp: De
1103
1086
  }
1104
1087
  ) }),
1105
- z && Ze && /* @__PURE__ */ m("div", { role: "alert", className: "rc-duo-error", children: Ze }),
1106
- !z && Ee && /* @__PURE__ */ m(
1107
- yn,
1088
+ z && Qe && /* @__PURE__ */ f("div", { role: "alert", className: "rc-duo-error", children: Qe }),
1089
+ !z && Re && /* @__PURE__ */ f(
1090
+ gn,
1108
1091
  {
1109
- snapshot: nt,
1110
- geometry: St,
1111
- highlightedId: ze,
1112
- selectedId: Ke,
1113
- mode: Yt,
1114
- cursorPosition: Pt,
1115
- frozenCursorPosition: kt,
1092
+ snapshot: tt,
1093
+ geometry: Ot,
1094
+ highlightedId: Fe,
1095
+ selectedId: ze,
1096
+ mode: Pt,
1097
+ cursorPosition: _t,
1098
+ frozenCursorPosition: St,
1116
1099
  onSelectChange: (e, n) => {
1117
- Pe(e?.id ?? null), e && n ? fe(n) : e || fe(null);
1100
+ Se(e?.id ?? null), e && n ? he(n) : e || he(null);
1118
1101
  const o = ce.current;
1119
- e && o ? we("onInspectSelectionChange", me.current, {
1102
+ e && o ? ye("onInspectSelectionChange", fe.current, {
1120
1103
  element: e,
1121
1104
  snapshot: o
1122
- }) : we("onInspectSelectionChange", me.current, null);
1105
+ }) : ye("onInspectSelectionChange", fe.current, null);
1123
1106
  },
1124
1107
  onTapElement: (e, n) => {
1125
1108
  if (n) {
1126
- lt(n.x, n.y);
1109
+ at(n.x, n.y);
1127
1110
  return;
1128
1111
  }
1129
1112
  const o = ce.current;
1130
- o && Dt(e, o);
1113
+ o && Yt(e, o);
1131
1114
  }
1132
1115
  }
1133
1116
  ),
1134
- Rt ? /* @__PURE__ */ $("div", { className: "rc-terminated", role: "status", children: [
1135
- /* @__PURE__ */ m("div", { className: "rc-terminated-title", children: "Instance terminated" }),
1136
- /* @__PURE__ */ m("div", { className: "rc-terminated-message", children: "This instance no longer exists and can't be reconnected." })
1137
- ] }) : Ct && /* @__PURE__ */ m("button", { type: "button", className: "rc-retry-button", onClick: zt, children: "Retry" })
1117
+ Ct ? /* @__PURE__ */ $("div", { className: "rc-terminated", role: "status", children: [
1118
+ /* @__PURE__ */ f("div", { className: "rc-terminated-title", children: "Instance terminated" }),
1119
+ /* @__PURE__ */ f("div", { className: "rc-terminated-message", children: "This instance no longer exists and can't be reconnected." })
1120
+ ] }) : At && /* @__PURE__ */ f("button", { type: "button", className: "rc-retry-button", onClick: Ut, children: "Retry" })
1138
1121
  ]
1139
1122
  }
1140
1123
  );
1141
1124
  }
1142
1125
  );
1143
1126
  export {
1144
- In as R
1127
+ Rn as R
1145
1128
  };