@camstack/addon-benchmark 0.1.15 → 0.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/_stub.js CHANGED
@@ -170,18 +170,18 @@ const wn = (e, t) => {
170
170
  let l = 0, d = 0, m = 0, u;
171
171
  const p = a.length;
172
172
  for (let v = 0; v < p; v++) {
173
- const x = a[v];
173
+ const y = a[v];
174
174
  if (l === 0 && d === 0) {
175
- if (x === Kt) {
175
+ if (y === Kt) {
176
176
  i.push(a.slice(m, v)), m = v + 1;
177
177
  continue;
178
178
  }
179
- if (x === "/") {
179
+ if (y === "/") {
180
180
  u = v;
181
181
  continue;
182
182
  }
183
183
  }
184
- x === "[" ? l++ : x === "]" ? l-- : x === "(" ? d++ : x === ")" && d--;
184
+ y === "[" ? l++ : y === "]" ? l-- : y === "(" ? d++ : y === ")" && d--;
185
185
  }
186
186
  const g = i.length === 0 ? a : a.slice(m);
187
187
  let f = g, b = !1;
@@ -192,8 +192,8 @@ const wn = (e, t) => {
192
192
  */
193
193
  g.startsWith(Rt) && (f = g.slice(1), b = !0)
194
194
  );
195
- const y = u && u > m ? u - m : void 0;
196
- return Yt(i, b, f, y);
195
+ const x = u && u > m ? u - m : void 0;
196
+ return Yt(i, b, f, x);
197
197
  };
198
198
  if (t) {
199
199
  const a = t + Kt, i = s;
@@ -238,30 +238,30 @@ const wn = (e, t) => {
238
238
  isExternal: g,
239
239
  modifiers: f,
240
240
  hasImportantModifier: b,
241
- baseClassName: y,
241
+ baseClassName: x,
242
242
  maybePostfixModifierPosition: v
243
243
  } = n(p);
244
244
  if (g) {
245
245
  m = p + (m.length > 0 ? " " + m : m);
246
246
  continue;
247
247
  }
248
- let x = !!v, w = s(x ? y.substring(0, v) : y);
248
+ let y = !!v, w = s(y ? x.substring(0, v) : x);
249
249
  if (!w) {
250
- if (!x) {
250
+ if (!y) {
251
251
  m = p + (m.length > 0 ? " " + m : m);
252
252
  continue;
253
253
  }
254
- if (w = s(y), !w) {
254
+ if (w = s(x), !w) {
255
255
  m = p + (m.length > 0 ? " " + m : m);
256
256
  continue;
257
257
  }
258
- x = !1;
258
+ y = !1;
259
259
  }
260
260
  const N = f.length === 0 ? "" : f.length === 1 ? f[0] : i(f).join(":"), S = b ? N + Rt : N, P = S + w;
261
261
  if (l.indexOf(P) > -1)
262
262
  continue;
263
263
  l.push(P);
264
- const A = a(w, x);
264
+ const A = a(w, y);
265
265
  for (let F = 0; F < A.length; ++F) {
266
266
  const j = A[F];
267
267
  l.push(S + j);
@@ -309,7 +309,7 @@ const wn = (e, t) => {
309
309
  const s = Tr.exec(e);
310
310
  return s ? s[1] ? t(s[1]) : n : !1;
311
311
  }, Qr = (e) => e === "position" || e === "percentage", Or = (e) => e === "image" || e === "url", Fr = (e) => e === "length" || e === "size" || e === "bg-size", Lr = (e) => e === "length", is = (e) => e === "number", zr = (e) => e === "family-name", Br = (e) => e === "number" || e === "weight", _r = (e) => e === "shadow", ls = () => {
312
- const e = Se("color"), t = Se("font"), n = Se("text"), s = Se("font-weight"), a = Se("tracking"), i = Se("leading"), l = Se("breakpoint"), d = Se("container"), m = Se("spacing"), u = Se("radius"), p = Se("shadow"), g = Se("inset-shadow"), f = Se("text-shadow"), b = Se("drop-shadow"), y = Se("blur"), v = Se("perspective"), x = Se("aspect"), w = Se("ease"), N = Se("animate"), S = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], P = () => [
312
+ const e = Se("color"), t = Se("font"), n = Se("text"), s = Se("font-weight"), a = Se("tracking"), i = Se("leading"), l = Se("breakpoint"), d = Se("container"), m = Se("spacing"), u = Se("radius"), p = Se("shadow"), g = Se("inset-shadow"), f = Se("text-shadow"), b = Se("drop-shadow"), x = Se("blur"), v = Se("perspective"), y = Se("aspect"), w = Se("ease"), N = Se("animate"), S = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], P = () => [
313
313
  "center",
314
314
  "top",
315
315
  "bottom",
@@ -347,7 +347,7 @@ const wn = (e, t) => {
347
347
  // Deprecated since Tailwind CSS v4.0.0
348
348
  "",
349
349
  "none",
350
- y,
350
+ x,
351
351
  B,
352
352
  z
353
353
  ], ue = () => ["none", X, B, z], O = () => ["none", X, B, z], D = () => [X, B, z], K = () => [Fe, "full", ...E()];
@@ -383,7 +383,7 @@ const wn = (e, t) => {
383
383
  * @see https://tailwindcss.com/docs/aspect-ratio
384
384
  */
385
385
  aspect: [{
386
- aspect: ["auto", "square", Fe, z, B, x]
386
+ aspect: ["auto", "square", Fe, z, B, y]
387
387
  }],
388
388
  /**
389
389
  * Container
@@ -3417,15 +3417,15 @@ const no = [
3417
3417
  return f === void 0 || (u[g] = f), u;
3418
3418
  }, {}), m = t == null || (s = t.compoundVariants) === null || s === void 0 ? void 0 : s.reduce((u, p) => {
3419
3419
  let { class: g, className: f, ...b } = p;
3420
- return Object.entries(b).every((y) => {
3421
- let [v, x] = y;
3422
- return Array.isArray(x) ? x.includes({
3420
+ return Object.entries(b).every((x) => {
3421
+ let [v, y] = x;
3422
+ return Array.isArray(y) ? y.includes({
3423
3423
  ...i,
3424
3424
  ...d
3425
3425
  }[v]) : {
3426
3426
  ...i,
3427
3427
  ...d
3428
- }[v] === x;
3428
+ }[v] === y;
3429
3429
  }) ? [
3430
3430
  ...u,
3431
3431
  g,
@@ -3836,19 +3836,19 @@ function lr({
3836
3836
  offsetIndex: d = 0,
3837
3837
  className: m
3838
3838
  }) {
3839
- const [u, p] = k({ x: 80 + d * 30, y: 80 + d * 30 }), [g, f] = k({ w: s, h: a }), [b, y] = k(!1), v = se(!1), x = se(!1), w = se({ x: 0, y: 0 }), N = Io(), S = Me((A) => {
3839
+ const [u, p] = k({ x: 80 + d * 30, y: 80 + d * 30 }), [g, f] = k({ w: s, h: a }), [b, x] = k(!1), v = se(!1), y = se(!1), w = se({ x: 0, y: 0 }), N = Io(), S = Me((A) => {
3840
3840
  A.preventDefault(), v.current = !0, w.current = { x: A.clientX - u.x, y: A.clientY - u.y };
3841
3841
  }, [u]), P = Me((A) => {
3842
- A.preventDefault(), A.stopPropagation(), x.current = !0, w.current = { x: A.clientX, y: A.clientY };
3842
+ A.preventDefault(), A.stopPropagation(), y.current = !0, w.current = { x: A.clientX, y: A.clientY };
3843
3843
  }, []);
3844
3844
  return G(() => {
3845
3845
  const A = (j) => {
3846
- if (v.current && p({ x: j.clientX - w.current.x, y: j.clientY - w.current.y }), x.current) {
3846
+ if (v.current && p({ x: j.clientX - w.current.x, y: j.clientY - w.current.y }), y.current) {
3847
3847
  const E = j.clientX - w.current.x, U = j.clientY - w.current.y;
3848
3848
  w.current = { x: j.clientX, y: j.clientY }, f((Z) => ({ w: Math.max(i, Z.w + E), h: Math.max(l, Z.h + U) }));
3849
3849
  }
3850
3850
  }, F = () => {
3851
- v.current = !1, x.current = !1;
3851
+ v.current = !1, y.current = !1;
3852
3852
  };
3853
3853
  return window.addEventListener("mousemove", A), window.addEventListener("mouseup", F), () => {
3854
3854
  window.removeEventListener("mousemove", A), window.removeEventListener("mouseup", F);
@@ -3868,7 +3868,7 @@ function lr({
3868
3868
  /* @__PURE__ */ r(
3869
3869
  "button",
3870
3870
  {
3871
- onClick: () => y(!b),
3871
+ onClick: () => x(!b),
3872
3872
  className: "p-0.5 rounded hover:bg-surface-hover text-foreground-muted transition-colors",
3873
3873
  children: b ? /* @__PURE__ */ r(rr, { size: 12 }) : /* @__PURE__ */ r(nr, { size: 12 })
3874
3874
  }
@@ -3909,7 +3909,7 @@ function lr({
3909
3909
  /* @__PURE__ */ r(
3910
3910
  "button",
3911
3911
  {
3912
- onClick: () => y(!b),
3912
+ onClick: () => x(!b),
3913
3913
  className: "p-0.5 rounded hover:bg-surface-hover text-foreground-muted transition-colors",
3914
3914
  title: b ? "Restore" : "Minimize",
3915
3915
  children: b ? /* @__PURE__ */ r(rr, { size: 12 }) : /* @__PURE__ */ r(nr, { size: 12 })
@@ -3960,9 +3960,9 @@ function kt({
3960
3960
  inheritedEnabled: p,
3961
3961
  hideModelAndSettings: g = !1
3962
3962
  }) {
3963
- const [f, b] = k(!1), y = Ro(t);
3964
- if (y.length > 0 && !y.some((x) => x.id === e.modelId) && !l) {
3965
- const w = (t?.defaultModelId ? y.find((N) => N.id === t.defaultModelId) : null) ?? y[0];
3963
+ const [f, b] = k(!1), x = Ro(t);
3964
+ if (x.length > 0 && !x.some((y) => y.id === e.modelId) && !l) {
3965
+ const w = (t?.defaultModelId ? x.find((N) => N.id === t.defaultModelId) : null) ?? x[0];
3966
3966
  w && w.id !== e.modelId && queueMicrotask(() => a({ ...e, modelId: w.id }));
3967
3967
  }
3968
3968
  const v = /* @__PURE__ */ c(Te, { children: [
@@ -3970,16 +3970,16 @@ function kt({
3970
3970
  /* @__PURE__ */ r("span", { className: "text-[10px] uppercase tracking-wider font-medium text-foreground-subtle/60 block leading-none", children: e.slot }),
3971
3971
  /* @__PURE__ */ r("span", { className: "text-sm font-semibold text-foreground truncate block leading-tight", children: e.addonName }),
3972
3972
  /* @__PURE__ */ c("div", { className: "flex items-center gap-1 mt-0.5 flex-wrap", children: [
3973
- e.inputClasses.map((x) => /* @__PURE__ */ r("span", { className: "text-[9px] uppercase font-semibold tracking-wide px-1.5 py-0.5 rounded bg-blue-500/12 text-blue-400", children: x }, x)),
3973
+ e.inputClasses.map((y) => /* @__PURE__ */ r("span", { className: "text-[9px] uppercase font-semibold tracking-wide px-1.5 py-0.5 rounded bg-blue-500/12 text-blue-400", children: y }, y)),
3974
3974
  e.inputClasses.length > 0 && e.outputClasses.length > 0 && /* @__PURE__ */ r("span", { className: "text-foreground-subtle/40 text-[10px]", children: "→" }),
3975
- e.outputClasses.map((x) => /* @__PURE__ */ r("span", { className: "text-[9px] uppercase font-semibold tracking-wide px-1.5 py-0.5 rounded bg-green-500/12 text-green-400", children: x }, x))
3975
+ e.outputClasses.map((y) => /* @__PURE__ */ r("span", { className: "text-[9px] uppercase font-semibold tracking-wide px-1.5 py-0.5 rounded bg-green-500/12 text-green-400", children: y }, y))
3976
3976
  ] })
3977
3977
  ] }),
3978
3978
  !l && d === "simple" && /* @__PURE__ */ r(
3979
3979
  "button",
3980
3980
  {
3981
- onClick: (x) => {
3982
- x.stopPropagation(), a({ ...e, enabled: !e.enabled });
3981
+ onClick: (y) => {
3982
+ y.stopPropagation(), a({ ...e, enabled: !e.enabled });
3983
3983
  },
3984
3984
  className: de(
3985
3985
  "relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors",
@@ -3995,7 +3995,7 @@ function kt({
3995
3995
  "div",
3996
3996
  {
3997
3997
  className: "flex items-center gap-0.5 rounded-md border border-border p-0.5",
3998
- onClick: (x) => x.stopPropagation(),
3998
+ onClick: (y) => y.stopPropagation(),
3999
3999
  children: [
4000
4000
  /* @__PURE__ */ r(
4001
4001
  Mt,
@@ -4043,8 +4043,8 @@ function kt({
4043
4043
  label: "Model",
4044
4044
  value: e.modelId,
4045
4045
  disabled: l,
4046
- options: y.map((x) => ({ value: x.id, label: x.name })),
4047
- onChange: (x) => a({ ...e, modelId: x })
4046
+ options: x.map((y) => ({ value: y.id, label: y.name })),
4047
+ onChange: (y) => a({ ...e, modelId: y })
4048
4048
  }
4049
4049
  ),
4050
4050
  e.slot === "audio-classifier" && e.engine && /* @__PURE__ */ r(
@@ -4058,22 +4058,22 @@ function kt({
4058
4058
  { value: "node/coreml", label: "Node.js — Apple SoundAnalysis (macOS)" },
4059
4059
  { value: "python/cpu", label: "Python — ONNX CPU" }
4060
4060
  ],
4061
- onChange: (x) => {
4062
- const [w, N] = x.split("/");
4061
+ onChange: (y) => {
4062
+ const [w, N] = y.split("/");
4063
4063
  a({ ...e, engine: { runtime: w, backend: N, format: N === "coreml" ? "coreml" : "onnx" } });
4064
4064
  }
4065
4065
  }
4066
4066
  ),
4067
- t?.configSchema?.map((x) => /* @__PURE__ */ r(
4067
+ t?.configSchema?.map((y) => /* @__PURE__ */ r(
4068
4068
  Do,
4069
4069
  {
4070
- field: x,
4070
+ field: y,
4071
4071
  allFields: t.configSchema ?? [],
4072
4072
  step: e,
4073
4073
  disabled: l,
4074
4074
  onChange: a
4075
4075
  },
4076
- x.key
4076
+ y.key
4077
4077
  ))
4078
4078
  ] })
4079
4079
  }
@@ -4169,13 +4169,13 @@ function Do({ field: e, allFields: t, step: n, disabled: s, onChange: a }) {
4169
4169
  );
4170
4170
  }
4171
4171
  if (e.type === "slider" || e.type === "number") {
4172
- const d = n.settings?.[e.key], m = typeof e.default == "number" ? e.default : e.min ?? 0, u = typeof d == "number" ? d : m, p = e.min ?? 0, g = e.max ?? 1, f = e.step ?? 0.01, b = e.type === "slider" ? e.showValue : !0, y = "unit" in e ? e.unit : void 0, v = e.type === "slider" ? e.displayScale : void 0, x = v ? u / v : u;
4172
+ const d = n.settings?.[e.key], m = typeof e.default == "number" ? e.default : e.min ?? 0, u = typeof d == "number" ? d : m, p = e.min ?? 0, g = e.max ?? 1, f = e.step ?? 0.01, b = e.type === "slider" ? e.showValue : !0, x = "unit" in e ? e.unit : void 0, v = e.type === "slider" ? e.displayScale : void 0, y = v ? u / v : u;
4173
4173
  return /* @__PURE__ */ c("div", { children: [
4174
4174
  /* @__PURE__ */ c("div", { className: "flex items-center justify-between mb-1", children: [
4175
4175
  /* @__PURE__ */ r("span", { className: "text-[10px] font-medium text-foreground-subtle uppercase tracking-wide", children: e.label }),
4176
4176
  b && /* @__PURE__ */ c("span", { className: "text-xs font-medium text-foreground tabular-nums", children: [
4177
- typeof x == "number" ? x.toFixed(2).replace(/\.?0+$/, "") : x,
4178
- y ? ` ${y}` : ""
4177
+ typeof y == "number" ? y.toFixed(2).replace(/\.?0+$/, "") : y,
4178
+ x ? ` ${x}` : ""
4179
4179
  ] })
4180
4180
  ] }),
4181
4181
  e.description && /* @__PURE__ */ r("p", { className: "text-[10px] text-foreground-subtle/60 mb-1.5", children: e.description }),
@@ -4432,18 +4432,18 @@ function Wo({
4432
4432
  hideTemplates: g = !1,
4433
4433
  showOnlyEnabled: f = !1,
4434
4434
  showSlotLabels: b = !1,
4435
- toggleMode: y = "simple",
4435
+ toggleMode: x = "simple",
4436
4436
  overrides: v = {},
4437
- onOverrideChange: x,
4437
+ onOverrideChange: y,
4438
4438
  inheritedEnabledByAddon: w = {},
4439
4439
  hideModelAndSettings: N = !1
4440
4440
  }) {
4441
4441
  const S = (T) => ({
4442
- toggleMode: y,
4442
+ toggleMode: x,
4443
4443
  hideModelAndSettings: N,
4444
- ...y === "threeState" ? {
4444
+ ...x === "threeState" ? {
4445
4445
  overrideState: v[T] !== void 0 ? v[T] : null,
4446
- onOverrideChange: x ? (I) => x(T, I) : void 0,
4446
+ onOverrideChange: y ? (I) => y(T, I) : void 0,
4447
4447
  inheritedEnabled: w[T]
4448
4448
  } : {}
4449
4449
  }), P = Ce(() => new Set(p), [p]), A = Ce(() => jo(e), [e]), [F, j] = k([]), E = a ? JSON.stringify(t) !== JSON.stringify(s.find((T) => T.id === a)?.steps) : !1;
@@ -4789,7 +4789,7 @@ function qo({
4789
4789
  function g(w) {
4790
4790
  return Ie(w, a);
4791
4791
  }
4792
- const f = i ?? (t && n ? `${t}/${n}` : "16/9"), b = s.filter((w) => w.score >= u), y = b.filter((w) => w.kind === "first-level"), v = b.filter((w) => w.kind === "detail"), x = Go(v, (w) => w.parentId ?? "");
4792
+ const f = i ?? (t && n ? `${t}/${n}` : "16/9"), b = s.filter((w) => w.score >= u), x = b.filter((w) => w.kind === "first-level"), v = b.filter((w) => w.kind === "detail"), y = Go(v, (w) => w.parentId ?? "");
4793
4793
  return /* @__PURE__ */ r(
4794
4794
  "div",
4795
4795
  {
@@ -4815,8 +4815,8 @@ function qo({
4815
4815
  `mask-${N}`
4816
4816
  ) : null
4817
4817
  ),
4818
- y.map((w) => {
4819
- const N = x.get(w.id) ?? [];
4818
+ x.map((w) => {
4819
+ const N = y.get(w.id) ?? [];
4820
4820
  return /* @__PURE__ */ r(
4821
4821
  dr,
4822
4822
  {
@@ -4840,7 +4840,7 @@ function qo({
4840
4840
  `det-${w.id}`
4841
4841
  );
4842
4842
  }),
4843
- v.filter((w) => !w.parentId || !y.some((N) => N.id === w.parentId)).map((w) => /* @__PURE__ */ r(
4843
+ v.filter((w) => !w.parentId || !x.some((N) => N.id === w.parentId)).map((w) => /* @__PURE__ */ r(
4844
4844
  dr,
4845
4845
  {
4846
4846
  detection: w,
@@ -4936,12 +4936,12 @@ function Uo({
4936
4936
  if (!u) return;
4937
4937
  const p = atob(e), g = new Uint8Array(p.length);
4938
4938
  for (let w = 0; w < p.length; w++) g[w] = p.charCodeAt(w);
4939
- const f = parseInt(l.slice(1, 3), 16), b = parseInt(l.slice(3, 5), 16), y = parseInt(l.slice(5, 7), 16);
4939
+ const f = parseInt(l.slice(1, 3), 16), b = parseInt(l.slice(3, 5), 16), x = parseInt(l.slice(5, 7), 16);
4940
4940
  m.width = t, m.height = n;
4941
- const v = u.createImageData(t, n), x = t * n;
4942
- for (let w = 0; w < x; w++) {
4941
+ const v = u.createImageData(t, n), y = t * n;
4942
+ for (let w = 0; w < y; w++) {
4943
4943
  const N = w < g.length ? g[w] : 0, S = w * 4;
4944
- N > 0 && (v.data[S] = f, v.data[S + 1] = b, v.data[S + 2] = y, v.data[S + 3] = 120);
4944
+ N > 0 && (v.data[S] = f, v.data[S + 1] = b, v.data[S + 2] = x, v.data[S + 3] = 120);
4945
4945
  }
4946
4946
  u.putImageData(v, 0, 0);
4947
4947
  }, [e, t, n, l]), /* @__PURE__ */ r(
@@ -5740,25 +5740,25 @@ const cn = (e, t, n, s, a = [], i = [], l = /* @__PURE__ */ new Map()) => {
5740
5740
  } : b;
5741
5741
  }
5742
5742
  if (!ka(e, n)) {
5743
- const b = gr(e, n), y = b ? {
5743
+ const b = gr(e, n), x = b ? {
5744
5744
  transformedValue: b.value,
5745
5745
  annotations: [b.type]
5746
5746
  } : {
5747
5747
  transformedValue: e
5748
5748
  };
5749
- return d || l.set(e, y), y;
5749
+ return d || l.set(e, x), x;
5750
5750
  }
5751
5751
  if (pt(i, e))
5752
5752
  return {
5753
5753
  transformedValue: null
5754
5754
  };
5755
5755
  const m = gr(e, n), u = m?.value ?? e, p = Be(u) ? [] : {}, g = {};
5756
- Ye(u, (b, y) => {
5757
- if (y === "__proto__" || y === "constructor" || y === "prototype")
5758
- throw new Error(`Detected property ${y}. This is a prototype pollution risk, please remove it from your object.`);
5759
- const v = cn(b, t, n, s, [...a, y], [...i, e], l);
5760
- p[y] = v.transformedValue, Be(v.annotations) ? g[Dt(y)] = v.annotations : rt(v.annotations) && Ye(v.annotations, (x, w) => {
5761
- g[Dt(y) + "." + w] = x;
5756
+ Ye(u, (b, x) => {
5757
+ if (x === "__proto__" || x === "constructor" || x === "prototype")
5758
+ throw new Error(`Detected property ${x}. This is a prototype pollution risk, please remove it from your object.`);
5759
+ const v = cn(b, t, n, s, [...a, x], [...i, e], l);
5760
+ p[x] = v.transformedValue, Be(v.annotations) ? g[Dt(x)] = v.annotations : rt(v.annotations) && Ye(v.annotations, (y, w) => {
5761
+ g[Dt(x) + "." + w] = y;
5762
5762
  });
5763
5763
  });
5764
5764
  const f = Tt(g) ? {
@@ -6674,7 +6674,7 @@ function Ha({
6674
6674
  disabled: s,
6675
6675
  translationFn: a
6676
6676
  }) {
6677
- const i = t == null, l = e.nullable === !0, d = i ? e.default ?? e.min : Number(t), m = e.showValue !== !1, u = e.nullLabel ?? "Auto", p = s || e.disabled, g = e.displayScale ?? 1, f = e.min / g, b = e.max / g, y = d / g, v = (e.step ?? 1) / g;
6677
+ const i = t == null, l = e.nullable === !0, d = i ? e.default ?? e.min : Number(t), m = e.showValue !== !1, u = e.nullLabel ?? "Auto", p = s || e.disabled, g = e.displayScale ?? 1, f = e.min / g, b = e.max / g, x = d / g, v = (e.step ?? 1) / g;
6678
6678
  if (l && i)
6679
6679
  return /* @__PURE__ */ r(ve, { label: e.label, description: e.description, required: e.required, span: e.span, translationFn: a, children: /* @__PURE__ */ c(
6680
6680
  "button",
@@ -6688,7 +6688,7 @@ function Ha({
6688
6688
  ]
6689
6689
  }
6690
6690
  ) });
6691
- const x = e.showStepper === !0 && m, w = (S) => {
6691
+ const y = e.showStepper === !0 && m, w = (S) => {
6692
6692
  const P = d + S * (e.step ?? 1), A = Math.min(e.max, Math.max(e.min, P));
6693
6693
  A !== d && n(A);
6694
6694
  }, N = "flex h-6 w-6 shrink-0 items-center justify-center rounded border border-border bg-surface text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors disabled:cursor-not-allowed disabled:opacity-40";
@@ -6703,7 +6703,7 @@ function Ha({
6703
6703
  min: f,
6704
6704
  max: b,
6705
6705
  step: v,
6706
- value: y,
6706
+ value: x,
6707
6707
  disabled: p,
6708
6708
  onChange: (S) => n(Number(S.target.value) * g)
6709
6709
  }
@@ -6711,7 +6711,7 @@ function Ha({
6711
6711
  /* @__PURE__ */ r("span", { className: "text-[10px] text-foreground-subtle tabular-nums shrink-0", children: b })
6712
6712
  ] }),
6713
6713
  (m || l || e.unit) && /* @__PURE__ */ c("div", { className: "flex shrink-0 items-center gap-2", children: [
6714
- x && /* @__PURE__ */ r(
6714
+ y && /* @__PURE__ */ r(
6715
6715
  "button",
6716
6716
  {
6717
6717
  type: "button",
@@ -6731,7 +6731,7 @@ function Ha({
6731
6731
  min: f,
6732
6732
  max: b,
6733
6733
  step: v,
6734
- value: y,
6734
+ value: x,
6735
6735
  disabled: p,
6736
6736
  onChange: (S) => {
6737
6737
  if (S.target.value === "") {
@@ -6743,7 +6743,7 @@ function Ha({
6743
6743
  }
6744
6744
  }
6745
6745
  ),
6746
- x && /* @__PURE__ */ r(
6746
+ y && /* @__PURE__ */ r(
6747
6747
  "button",
6748
6748
  {
6749
6749
  type: "button",
@@ -6778,11 +6778,11 @@ function Ga({
6778
6778
  }) {
6779
6779
  const i = Array.isArray(t) ? t : [], [l, d] = k(""), m = se(null), u = Me(
6780
6780
  (b) => {
6781
- const y = b.trim();
6782
- !y || i.includes(y) || e.maxTags !== void 0 && i.length >= e.maxTags || (n([...i, y]), d(""));
6781
+ const x = b.trim();
6782
+ !x || i.includes(x) || e.maxTags !== void 0 && i.length >= e.maxTags || (n([...i, x]), d(""));
6783
6783
  },
6784
6784
  [i, e.maxTags, n]
6785
- ), p = (b) => n(i.filter((y) => y !== b)), g = (b) => {
6785
+ ), p = (b) => n(i.filter((x) => x !== b)), g = (b) => {
6786
6786
  b.key === "Enter" || b.key === "," ? (b.preventDefault(), u(l)) : b.key === "Backspace" && l === "" && i.length > 0 && p(i[i.length - 1]);
6787
6787
  }, f = s || e.disabled;
6788
6788
  return /* @__PURE__ */ r(ve, { label: e.label, description: e.description, required: e.required, span: e.span, translationFn: a, children: /* @__PURE__ */ c(
@@ -6935,8 +6935,8 @@ function Xa({
6935
6935
  onAction: l,
6936
6936
  externalProbe: d
6937
6937
  }) {
6938
- const [m, u] = k("idle"), [p, g] = k(null), f = d?.status ?? m, b = d?.result ?? p, y = !!i || !!l, v = Me(async () => {
6939
- if (y) {
6938
+ const [m, u] = k("idle"), [p, g] = k(null), f = d?.status ?? m, b = d?.result ?? p, x = !!i || !!l, v = Me(async () => {
6939
+ if (x) {
6940
6940
  u("probing"), g(null);
6941
6941
  try {
6942
6942
  const N = i ? await i(e.key, t) : await l("test-probe", e.key, t), S = N && typeof N == "object" ? N : { status: "error", error: "Probe handler returned no result" };
@@ -6945,7 +6945,7 @@ function Xa({
6945
6945
  g({ status: "error", error: N instanceof Error ? N.message : String(N) }), u("error");
6946
6946
  }
6947
6947
  }
6948
- }, [i, l, e.key, t, y]), x = f === "probing" ? "border-primary/40 bg-primary/10 text-primary" : f === "ok" ? "border-success/40 bg-success/10 text-success hover:bg-success/15" : f === "error" ? "border-danger/40 bg-danger/10 text-danger hover:bg-danger/15" : "border-border text-foreground-subtle hover:text-foreground hover:bg-surface-hover", w = f === "probing" ? /* @__PURE__ */ r(Vr, { className: "h-3 w-3 animate-spin" }) : f === "ok" ? /* @__PURE__ */ r(Ns, { className: "h-3 w-3" }) : f === "error" ? /* @__PURE__ */ r(vs, { className: "h-3 w-3" }) : /* @__PURE__ */ r(eo, { className: "h-3 w-3" });
6948
+ }, [i, l, e.key, t, x]), y = f === "probing" ? "border-primary/40 bg-primary/10 text-primary" : f === "ok" ? "border-success/40 bg-success/10 text-success hover:bg-success/15" : f === "error" ? "border-danger/40 bg-danger/10 text-danger hover:bg-danger/15" : "border-border text-foreground-subtle hover:text-foreground hover:bg-surface-hover", w = f === "probing" ? /* @__PURE__ */ r(Vr, { className: "h-3 w-3 animate-spin" }) : f === "ok" ? /* @__PURE__ */ r(Ns, { className: "h-3 w-3" }) : f === "error" ? /* @__PURE__ */ r(vs, { className: "h-3 w-3" }) : /* @__PURE__ */ r(eo, { className: "h-3 w-3" });
6949
6949
  return /* @__PURE__ */ c(ve, { label: e.label, description: e.description, required: e.required, span: e.span, translationFn: a, children: [
6950
6950
  /* @__PURE__ */ c(
6951
6951
  "div",
@@ -6959,8 +6959,8 @@ function Xa({
6959
6959
  type: "button",
6960
6960
  onClick: v,
6961
6961
  title: "Test",
6962
- disabled: e.disabled || f === "probing" || !y || !t,
6963
- className: `flex-shrink-0 inline-flex items-center gap-1.5 rounded-md border px-2 py-2 text-xs font-medium transition-colors disabled:opacity-50 disabled:cursor-not-allowed @[280px]:px-3 ${x}`,
6962
+ disabled: e.disabled || f === "probing" || !x || !t,
6963
+ className: `flex-shrink-0 inline-flex items-center gap-1.5 rounded-md border px-2 py-2 text-xs font-medium transition-colors disabled:opacity-50 disabled:cursor-not-allowed @[280px]:px-3 ${y}`,
6964
6964
  children: [
6965
6965
  w,
6966
6966
  /* @__PURE__ */ r("span", { className: "hidden @[280px]:inline", children: "Test" })
@@ -7070,7 +7070,7 @@ function ei({
7070
7070
  );
7071
7071
  }) }),
7072
7072
  e.tabs.map((g) => g.id !== m ? null : /* @__PURE__ */ r("div", { role: "tabpanel", className: "px-3 pb-3 pt-2 grid grid-cols-2 gap-x-4 gap-y-3", children: g.fields.map((f, b) => {
7073
- const y = "key" in f && typeof f.key == "string" ? f.key : `__${g.id}__${b}`;
7073
+ const x = "key" in f && typeof f.key == "string" ? f.key : `__${g.id}__${b}`;
7074
7074
  return /* @__PURE__ */ r(
7075
7075
  ot,
7076
7076
  {
@@ -7082,7 +7082,7 @@ function ei({
7082
7082
  onTestField: i,
7083
7083
  onAction: l
7084
7084
  },
7085
- y
7085
+ x
7086
7086
  );
7087
7087
  }) }, g.id))
7088
7088
  ] })
@@ -7197,35 +7197,35 @@ function li({
7197
7197
  onTestField: i,
7198
7198
  onAction: l
7199
7199
  }) {
7200
- const d = Array.isArray(t) ? t : [], m = e.minRows ?? 0, u = e.maxRows ?? Number.POSITIVE_INFINITY, p = (x, w, N) => {
7201
- const S = d.slice(), P = S[x] ?? {};
7202
- S[x] = { ...P, [w]: N }, n(S);
7203
- }, g = (x) => {
7204
- d.length <= m || n(d.filter((w, N) => N !== x));
7200
+ const d = Array.isArray(t) ? t : [], m = e.minRows ?? 0, u = e.maxRows ?? Number.POSITIVE_INFINITY, p = (y, w, N) => {
7201
+ const S = d.slice(), P = S[y] ?? {};
7202
+ S[y] = { ...P, [w]: N }, n(S);
7203
+ }, g = (y) => {
7204
+ d.length <= m || n(d.filter((w, N) => N !== y));
7205
7205
  }, f = () => {
7206
7206
  if (d.length >= u) return;
7207
- const x = e.defaultItem ?? {};
7208
- n([...d, { ...x }]);
7209
- }, b = (x, w) => e.rowTitleTemplate ? e.rowTitleTemplate.replace(/\{(\w+)\}/g, (N, S) => {
7210
- const P = x[S];
7207
+ const y = e.defaultItem ?? {};
7208
+ n([...d, { ...y }]);
7209
+ }, b = (y, w) => e.rowTitleTemplate ? e.rowTitleTemplate.replace(/\{(\w+)\}/g, (N, S) => {
7210
+ const P = y[S];
7211
7211
  return P == null || P === "" ? "—" : String(P);
7212
- }) : `Row ${w + 1}`, y = d.length > m, v = d.length < u;
7212
+ }) : `Row ${w + 1}`, x = d.length > m, v = d.length < u;
7213
7213
  return /* @__PURE__ */ c("div", { className: "col-span-full space-y-2", children: [
7214
7214
  /* @__PURE__ */ c("div", { className: "space-y-0.5", children: [
7215
7215
  e.label && /* @__PURE__ */ r("p", { className: "text-[11px] font-semibold uppercase tracking-wider text-foreground-subtle", children: Re(e.label, a) }),
7216
7216
  e.description && /* @__PURE__ */ r("p", { className: "text-[11px] text-foreground-subtle", children: Re(e.description, a) })
7217
7217
  ] }),
7218
- d.length === 0 ? /* @__PURE__ */ r("div", { className: "rounded-md border border-dashed border-border bg-background px-3 py-3 text-center text-[11px] text-foreground-subtle", children: e.emptyMessage ?? "No entries" }) : /* @__PURE__ */ r("div", { className: "space-y-2", children: d.map((x, w) => /* @__PURE__ */ c("div", { className: "rounded-md border border-border bg-background", children: [
7218
+ d.length === 0 ? /* @__PURE__ */ r("div", { className: "rounded-md border border-dashed border-border bg-background px-3 py-3 text-center text-[11px] text-foreground-subtle", children: e.emptyMessage ?? "No entries" }) : /* @__PURE__ */ r("div", { className: "space-y-2", children: d.map((y, w) => /* @__PURE__ */ c("div", { className: "rounded-md border border-border bg-background", children: [
7219
7219
  /* @__PURE__ */ c("div", { className: "flex items-center justify-between border-b border-border px-3 py-1.5", children: [
7220
- /* @__PURE__ */ r("span", { className: "text-xs font-medium text-foreground", children: b(x, w) }),
7220
+ /* @__PURE__ */ r("span", { className: "text-xs font-medium text-foreground", children: b(y, w) }),
7221
7221
  /* @__PURE__ */ c(
7222
7222
  "button",
7223
7223
  {
7224
7224
  type: "button",
7225
7225
  onClick: () => g(w),
7226
- disabled: s || !y,
7226
+ disabled: s || !x,
7227
7227
  className: "inline-flex items-center gap-1 rounded px-2 py-0.5 text-[10px] text-danger hover:bg-danger/10 disabled:opacity-30 disabled:cursor-not-allowed",
7228
- title: y ? "Remove this row" : `At least ${m} row(s) required`,
7228
+ title: x ? "Remove this row" : `At least ${m} row(s) required`,
7229
7229
  children: [
7230
7230
  /* @__PURE__ */ r(qr, { className: "h-3 w-3" }),
7231
7231
  "Remove"
@@ -7237,7 +7237,7 @@ function li({
7237
7237
  ot,
7238
7238
  {
7239
7239
  field: N,
7240
- values: x,
7240
+ values: y,
7241
7241
  onChange: (S, P) => p(w, S, P),
7242
7242
  disabled: s,
7243
7243
  translationFn: a,
@@ -7323,7 +7323,7 @@ function di({
7323
7323
  }) {
7324
7324
  const [l, d] = k(!1), [m, u] = k(null), [p, g] = k(null), f = mn(e, n), b = Object.keys(e.paramsFromForm ?? {}).some(
7325
7325
  (N) => f[N] === void 0
7326
- ), y = (e.refreshOn ?? Object.values(e.paramsFromForm ?? {})).map((N) => `${N}=${JSON.stringify(n[N])}`).join("|");
7326
+ ), x = (e.refreshOn ?? Object.values(e.paramsFromForm ?? {})).map((N) => `${N}=${JSON.stringify(n[N])}`).join("|");
7327
7327
  G(() => {
7328
7328
  if (!i || b) {
7329
7329
  g(null), u(null);
@@ -7352,8 +7352,8 @@ function di({
7352
7352
  }), () => {
7353
7353
  N = !0;
7354
7354
  };
7355
- }, [y, i, e.action, e.key]);
7356
- const v = e.mapOption.value, x = e.mapOption.label, w = e.mapOption.description;
7355
+ }, [x, i, e.action, e.key]);
7356
+ const v = e.mapOption.value, y = e.mapOption.label, w = e.mapOption.description;
7357
7357
  return /* @__PURE__ */ r(ve, { label: e.label, description: e.description, required: e.required, span: e.span, children: b ? /* @__PURE__ */ r("div", { className: "text-[11px] text-foreground-subtle italic", children: e.emptyParamsMessage ?? "Fill the prerequisite fields above first." }) : l ? /* @__PURE__ */ c("div", { className: "flex items-center gap-2 text-[11px] text-foreground-subtle", children: [
7358
7358
  /* @__PURE__ */ r(Vr, { className: "h-3 w-3 animate-spin" }),
7359
7359
  " Loading options…"
@@ -7372,7 +7372,7 @@ function di({
7372
7372
  children: [
7373
7373
  !N && /* @__PURE__ */ r("option", { value: "", children: "— Select —" }),
7374
7374
  (p ?? []).map((S, P) => {
7375
- const A = S[v], F = S[x], j = w ? S[w] : void 0, E = typeof A == "string" && A !== "" ? A : `row-${P}`;
7375
+ const A = S[v], F = S[y], j = w ? S[w] : void 0, E = typeof A == "string" && A !== "" ? A : `row-${P}`;
7376
7376
  return /* @__PURE__ */ c("option", { value: typeof A == "string" ? A : String(A ?? ""), children: [
7377
7377
  typeof F == "string" ? F : String(F ?? E),
7378
7378
  j !== void 0 ? ` (${String(j)})` : ""
@@ -7399,11 +7399,11 @@ function ui({
7399
7399
  const g = mn(e, t);
7400
7400
  i(!0), d(null);
7401
7401
  try {
7402
- const f = await s(e.action, e.key, g), b = e.successMessage ? e.successMessage.replace(/\{(\w+)\}/g, (y, v) => {
7403
- const x = f?.[v];
7404
- return x === void 0 ? "" : String(x);
7402
+ const f = await s(e.action, e.key, g), b = typeof f == "object" && f !== null ? f : null, x = e.successMessage ? e.successMessage.replace(/\{(\w+)\}/g, (v, y) => {
7403
+ const w = b?.[y];
7404
+ return w === void 0 ? "" : String(w);
7405
7405
  }) : "Done.";
7406
- d({ kind: "ok", text: b });
7406
+ d({ kind: "ok", text: x });
7407
7407
  } catch (f) {
7408
7408
  d({ kind: "error", text: f instanceof Error ? f.message : String(f) });
7409
7409
  } finally {
@@ -7546,15 +7546,15 @@ function xi({
7546
7546
  allFields: d,
7547
7547
  onAction: m
7548
7548
  }) {
7549
- const u = e.multiple, p = u.min, g = u.max, f = t[e.key], y = [...Array.isArray(f) ? f : f != null ? [f] : []], v = u.itemDefault !== void 0 ? u.itemDefault : "default" in e && e.default !== void 0 ? e.default : "";
7550
- for (; y.length < p; ) y.push(v);
7551
- const x = (A) => n(e.key, [...A]), w = (A, F) => {
7552
- const j = [...y];
7553
- j[A] = F, x(j);
7549
+ const u = e.multiple, p = u.min, g = u.max, f = t[e.key], x = [...Array.isArray(f) ? f : f != null ? [f] : []], v = u.itemDefault !== void 0 ? u.itemDefault : "default" in e && e.default !== void 0 ? e.default : "";
7550
+ for (; x.length < p; ) x.push(v);
7551
+ const y = (A) => n(e.key, [...A]), w = (A, F) => {
7552
+ const j = [...x];
7553
+ j[A] = F, y(j);
7554
7554
  }, N = () => {
7555
- y.length >= g || x([...y, v]);
7555
+ x.length >= g || y([...x, v]);
7556
7556
  }, S = (A) => {
7557
- y.length <= p || x(y.filter((F, j) => j !== A));
7557
+ x.length <= p || y(x.filter((F, j) => j !== A));
7558
7558
  }, P = () => {
7559
7559
  const { multiple: A, ...F } = e;
7560
7560
  return { ...F, ...{ label: void 0, description: void 0, required: !1 } };
@@ -7568,7 +7568,7 @@ function xi({
7568
7568
  span: e.span,
7569
7569
  translationFn: a,
7570
7570
  children: /* @__PURE__ */ c("div", { className: "space-y-2", children: [
7571
- y.map((A, F) => {
7571
+ x.map((A, F) => {
7572
7572
  const j = u.itemLabel?.replace("${n}", String(F + 1));
7573
7573
  return /* @__PURE__ */ c("div", { className: "space-y-1", children: [
7574
7574
  j && /* @__PURE__ */ r("div", { className: xt, children: j }),
@@ -7586,7 +7586,7 @@ function xi({
7586
7586
  allFields: d
7587
7587
  }
7588
7588
  ) }),
7589
- y.length > p && /* @__PURE__ */ r(
7589
+ x.length > p && /* @__PURE__ */ r(
7590
7590
  "button",
7591
7591
  {
7592
7592
  type: "button",
@@ -7601,7 +7601,7 @@ function xi({
7601
7601
  ] }, F);
7602
7602
  }),
7603
7603
  /* @__PURE__ */ c("div", { className: "flex items-center justify-between pt-1", children: [
7604
- y.length < g ? /* @__PURE__ */ c(
7604
+ x.length < g ? /* @__PURE__ */ c(
7605
7605
  "button",
7606
7606
  {
7607
7607
  type: "button",
@@ -7615,7 +7615,7 @@ function xi({
7615
7615
  }
7616
7616
  ) : /* @__PURE__ */ r("span", {}),
7617
7617
  /* @__PURE__ */ c("span", { className: "text-[10px] text-foreground-subtle tabular-nums", children: [
7618
- y.length,
7618
+ x.length,
7619
7619
  "/",
7620
7620
  g
7621
7621
  ] })
@@ -7837,7 +7837,7 @@ function Ut({
7837
7837
  mode: u,
7838
7838
  onOverrideChange: p
7839
7839
  }) {
7840
- const g = u ?? "persist", [f, b] = k(null), [y, v] = k(!0), [x, w] = k(null), [N, S] = k(!1), [P, A] = k(m ?? !1), [F, j] = k({}), [E, U] = k(null);
7840
+ const g = u ?? "persist", [f, b] = k(null), [x, v] = k(!0), [y, w] = k(null), [N, S] = k(!1), [P, A] = k(m ?? !1), [F, j] = k({}), [E, U] = k(null);
7841
7841
  G(() => {
7842
7842
  U(null), j({});
7843
7843
  }, [e, t, n, l, g]);
@@ -7879,15 +7879,15 @@ function Ut({
7879
7879
  }
7880
7880
  }
7881
7881
  };
7882
- if (y) return /* @__PURE__ */ c("div", { className: "text-xs text-foreground-subtle animate-pulse", children: [
7882
+ if (x) return /* @__PURE__ */ c("div", { className: "text-xs text-foreground-subtle animate-pulse", children: [
7883
7883
  "Loading ",
7884
7884
  s ?? t,
7885
7885
  "…"
7886
7886
  ] });
7887
- if (x) return /* @__PURE__ */ c("div", { className: "text-xs text-red-400", children: [
7887
+ if (y) return /* @__PURE__ */ c("div", { className: "text-xs text-red-400", children: [
7888
7888
  s ?? t,
7889
7889
  ": ",
7890
- x
7890
+ y
7891
7891
  ] });
7892
7892
  if (!f || !fe) return /* @__PURE__ */ c("div", { className: "text-xs text-foreground-subtle", children: [
7893
7893
  s ?? t,
@@ -8005,8 +8005,8 @@ function Ii({
8005
8005
  }) {
8006
8006
  return t === 0 || n === 0 ? null : /* @__PURE__ */ r(Te, { children: e.map((s) => {
8007
8007
  const { x: a, y: i, width: l, height: d } = s.bbox, m = a / t * 100, u = i / n * 100, p = l / t * 100, g = d / n * 100, f = Ie(s.macroClass), b = [`${s.macroClass} ${(s.score * 100).toFixed(0)}%`];
8008
- for (const y of s.labels)
8009
- b.push(y.label);
8008
+ for (const x of s.labels)
8009
+ b.push(x.label);
8010
8010
  return /* @__PURE__ */ r(
8011
8011
  "div",
8012
8012
  {
@@ -8055,18 +8055,18 @@ function Ti({
8055
8055
  closeSession: f,
8056
8056
  hintsOverride: b
8057
8057
  }) {
8058
- const y = se(null), v = se(null), x = se(null), w = se(/* @__PURE__ */ new Set()), N = se(null), S = se(null), P = se(0), A = se(!0), [F, j] = k("idle"), [E, U] = k(""), [Z, J] = k(a), [fe, ae] = k(!1), [le, ce] = k(!1), V = se(null), ie = se(!1);
8058
+ const x = se(null), v = se(null), y = se(null), w = se(/* @__PURE__ */ new Set()), N = se(null), S = se(null), P = se(0), A = se(!0), [F, j] = k("idle"), [E, U] = k(""), [Z, J] = k(a), [fe, ae] = k(!1), [le, ce] = k(!1), V = se(null), ie = se(!1);
8059
8059
  (g || p) && (ie.current = !0);
8060
8060
  const W = ie.current, re = Me((O) => {
8061
8061
  j(O), d?.(O);
8062
8062
  }, [d]), $ = Me(() => {
8063
- if (N.current?.abort(), N.current = null, S.current && (clearTimeout(S.current), S.current = null), x.current && (x.current.close(), x.current = null), f && w.current.size > 0) {
8063
+ if (N.current?.abort(), N.current = null, S.current && (clearTimeout(S.current), S.current = null), y.current && (y.current.close(), y.current = null), f && w.current.size > 0) {
8064
8064
  for (const O of w.current)
8065
8065
  f(O).catch(() => {
8066
8066
  });
8067
8067
  w.current.clear();
8068
8068
  }
8069
- y.current && (y.current.srcObject = null);
8069
+ x.current && (x.current.srcObject = null);
8070
8070
  }, [f]), T = Me(async () => {
8071
8071
  if (!A.current || !p || !g) return;
8072
8072
  $(), re("connecting");
@@ -8082,15 +8082,15 @@ function Ti({
8082
8082
  const he = new RTCPeerConnection({
8083
8083
  iceServers: [{ urls: "stun:stun.l.google.com:19302" }]
8084
8084
  });
8085
- x.current = he;
8085
+ y.current = he;
8086
8086
  const Ne = new MediaStream();
8087
8087
  he.ontrack = (ke) => {
8088
- console.debug("[WebRTC] ontrack", ke.track.kind, ke.track.readyState), Ne.addTrack(ke.track), y.current && (y.current.srcObject = Ne, y.current.play().catch(() => {
8088
+ console.debug("[WebRTC] ontrack", ke.track.kind, ke.track.readyState), Ne.addTrack(ke.track), x.current && (x.current.srcObject = Ne, x.current.play().catch(() => {
8089
8089
  }));
8090
8090
  }, he.oniceconnectionstatechange = () => {
8091
8091
  if (!A.current) return;
8092
8092
  const ke = he.iceConnectionState;
8093
- console.debug("[WebRTC] ICE state:", ke), ke === "connected" || ke === "completed" ? (P.current = 0, re("playing"), y.current?.paused && (console.debug("[WebRTC] video was paused at ICE connected — calling play()"), y.current.play().catch(() => {
8093
+ console.debug("[WebRTC] ICE state:", ke), ke === "connected" || ke === "completed" ? (P.current = 0, re("playing"), x.current?.paused && (console.debug("[WebRTC] video was paused at ICE connected — calling play()"), x.current.play().catch(() => {
8094
8094
  }))) : (ke === "failed" || ke === "disconnected" || ke === "closed") && (re("disconnected"), C());
8095
8095
  }, he.onicecandidateerror = (ke) => {
8096
8096
  console.debug("[WebRTC] ICE candidate error:", ke);
@@ -8103,7 +8103,7 @@ function Ti({
8103
8103
  const Xe = he, Je = () => {
8104
8104
  const ke = Xe.connectionState;
8105
8105
  if (ke === "closed" || ke === "failed") return;
8106
- const He = y.current;
8106
+ const He = x.current;
8107
8107
  He && He.readyState === 0 && console.log(`[WebRTC] no video data yet (ice=${Xe.iceConnectionState})`);
8108
8108
  };
8109
8109
  setTimeout(Je, 3e3), setTimeout(Je, 8e3);
@@ -8119,15 +8119,15 @@ function Ti({
8119
8119
  const O = new RTCPeerConnection({
8120
8120
  iceServers: [{ urls: "stun:stun.l.google.com:19302" }]
8121
8121
  });
8122
- x.current = O, O.addTransceiver("video", { direction: "recvonly" }), O.addTransceiver("audio", { direction: "recvonly" });
8122
+ y.current = O, O.addTransceiver("video", { direction: "recvonly" }), O.addTransceiver("audio", { direction: "recvonly" });
8123
8123
  const D = new MediaStream();
8124
8124
  O.ontrack = (Ne) => {
8125
- D.addTrack(Ne.track), y.current && (y.current.srcObject = D, y.current.play().catch(() => {
8125
+ D.addTrack(Ne.track), x.current && (x.current.srcObject = D, x.current.play().catch(() => {
8126
8126
  }));
8127
8127
  }, O.oniceconnectionstatechange = () => {
8128
8128
  if (!A.current) return;
8129
8129
  const Ne = O.iceConnectionState;
8130
- Ne === "connected" || Ne === "completed" ? (P.current = 0, re("playing"), y.current?.paused && y.current.play().catch(() => {
8130
+ Ne === "connected" || Ne === "completed" ? (P.current = 0, re("playing"), x.current?.paused && x.current.play().catch(() => {
8131
8131
  })) : (Ne === "failed" || Ne === "disconnected" || Ne === "closed") && (re("disconnected"), C());
8132
8132
  };
8133
8133
  const K = await O.createOffer();
@@ -8160,12 +8160,12 @@ function Ti({
8160
8160
  }), [e, t]);
8161
8161
  const h = se(!1);
8162
8162
  G(() => {
8163
- !s || !W || !p || !g || h.current || x.current || (h.current = !0, H());
8163
+ !s || !W || !p || !g || h.current || y.current || (h.current = !0, H());
8164
8164
  }, [s, W, p, g, H]);
8165
8165
  const M = () => {
8166
8166
  P.current = 0, H();
8167
8167
  }, R = () => {
8168
- y.current && (y.current.muted = !y.current.muted, J(y.current.muted));
8168
+ x.current && (x.current.muted = !x.current.muted, J(x.current.muted));
8169
8169
  }, L = async () => {
8170
8170
  if (v.current)
8171
8171
  try {
@@ -8174,12 +8174,12 @@ function Ti({
8174
8174
  console.warn(`Fullscreen toggle failed: ${O instanceof Error ? O.message : O}`);
8175
8175
  }
8176
8176
  }, ee = () => {
8177
- if (!y.current) return;
8177
+ if (!x.current) return;
8178
8178
  const O = document.createElement("canvas");
8179
- O.width = y.current.videoWidth || 1280, O.height = y.current.videoHeight || 720;
8179
+ O.width = x.current.videoWidth || 1280, O.height = x.current.videoHeight || 720;
8180
8180
  const D = O.getContext("2d");
8181
8181
  if (!D) return;
8182
- D.drawImage(y.current, 0, 0);
8182
+ D.drawImage(x.current, 0, 0);
8183
8183
  const K = document.createElement("a");
8184
8184
  K.download = `${t.replace(/[/:]/g, "-")}-${Date.now()}.jpg`, K.href = O.toDataURL("image/jpeg", 0.92), K.click();
8185
8185
  };
@@ -8201,7 +8201,7 @@ function Ti({
8201
8201
  /* @__PURE__ */ r(
8202
8202
  "video",
8203
8203
  {
8204
- ref: y,
8204
+ ref: x,
8205
8205
  autoPlay: s,
8206
8206
  muted: Z,
8207
8207
  playsInline: !0,
@@ -8298,15 +8298,15 @@ function Di({
8298
8298
  if (!g || !f || !e || e.length === 0) return;
8299
8299
  const b = f.clientWidth;
8300
8300
  if (b === 0) return;
8301
- const y = window.devicePixelRatio || 1;
8302
- g.width = b * y, g.height = n * y, g.style.width = `${b}px`, g.style.height = `${n}px`;
8301
+ const x = window.devicePixelRatio || 1;
8302
+ g.width = b * x, g.height = n * x, g.style.width = `${b}px`, g.style.height = `${n}px`;
8303
8303
  const v = g.getContext("2d");
8304
8304
  if (!v) return;
8305
- v.scale(y, y), i !== "transparent" ? (v.fillStyle = i, v.fillRect(0, 0, b, n)) : v.clearRect(0, 0, b, n);
8306
- const x = e.length / b, w = n / 2;
8305
+ v.scale(x, x), i !== "transparent" ? (v.fillStyle = i, v.fillRect(0, 0, b, n)) : v.clearRect(0, 0, b, n);
8306
+ const y = e.length / b, w = n / 2;
8307
8307
  v.fillStyle = a, v.globalAlpha = 0.7;
8308
8308
  for (let N = 0; N < b; N++) {
8309
- const S = Math.floor(N * x), P = Math.min(Math.floor((N + 1) * x), e.length);
8309
+ const S = Math.floor(N * y), P = Math.min(Math.floor((N + 1) * y), e.length);
8310
8310
  let A = 0, F = 0;
8311
8311
  for (let Z = S; Z < P; Z++) {
8312
8312
  const J = e[Z];
@@ -8350,14 +8350,14 @@ function Qi({
8350
8350
  const u = se(null), p = se(null), [g, f] = k([]);
8351
8351
  G(() => {
8352
8352
  e !== null && f((v) => {
8353
- const x = [...v, { dbfs: e, timestamp: Date.now() }];
8354
- return x.length > n ? x.slice(-n) : x;
8353
+ const y = [...v, { dbfs: e, timestamp: Date.now() }];
8354
+ return y.length > n ? y.slice(-n) : y;
8355
8355
  });
8356
8356
  }, [e, n]);
8357
8357
  const b = Me(() => {
8358
- const v = u.current, x = p.current;
8359
- if (!v || !x) return;
8360
- const w = x.clientWidth;
8358
+ const v = u.current, y = p.current;
8359
+ if (!v || !y) return;
8360
+ const w = y.clientWidth;
8361
8361
  if (w === 0) return;
8362
8362
  const N = window.devicePixelRatio || 1;
8363
8363
  v.width = w * N, v.height = s * N, v.style.width = `${w}px`, v.style.height = `${s}px`;
@@ -8377,18 +8377,18 @@ function Qi({
8377
8377
  G(() => {
8378
8378
  b();
8379
8379
  }, [b]), G(() => {
8380
- const v = new ResizeObserver(() => b()), x = p.current;
8381
- return x && v.observe(x), () => v.disconnect();
8380
+ const v = new ResizeObserver(() => b()), y = p.current;
8381
+ return y && v.observe(y), () => v.disconnect();
8382
8382
  }, [b]);
8383
- const y = g.length > 0 ? g[g.length - 1].dbfs : null;
8383
+ const x = g.length > 0 ? g[g.length - 1].dbfs : null;
8384
8384
  return /* @__PURE__ */ c("div", { ref: p, className: `relative ${a}`, children: [
8385
8385
  /* @__PURE__ */ r("canvas", { ref: u, className: "w-full rounded-md" }),
8386
8386
  /* @__PURE__ */ c("div", { className: "absolute top-1 left-2 text-[9px] text-foreground-subtle/50 font-mono", children: [
8387
8387
  t,
8388
8388
  "s"
8389
8389
  ] }),
8390
- y !== null && /* @__PURE__ */ c("div", { className: "absolute bottom-1 right-2 text-[9px] text-foreground-subtle/50 font-mono", children: [
8391
- y.toFixed(1),
8390
+ x !== null && /* @__PURE__ */ c("div", { className: "absolute bottom-1 right-2 text-[9px] text-foreground-subtle/50 font-mono", children: [
8391
+ x.toFixed(1),
8392
8392
  " dBFS · ",
8393
8393
  g.length,
8394
8394
  " samples"
@@ -8469,14 +8469,14 @@ function gn(e, t) {
8469
8469
  const [n, s] = k(null), [a, i] = k(null), [l, d] = k(null), [m, u] = k("watching"), p = se(void 0), g = se(void 0), f = se(void 0);
8470
8470
  return G(() => {
8471
8471
  if (t === null) return;
8472
- const b = ut(e, "detection.motion-analysis", (y) => {
8473
- const v = y;
8472
+ const b = ut(e, "detection.motion-analysis", (x) => {
8473
+ const v = x;
8474
8474
  if (!mt(v?.source, t)) return;
8475
- const x = v.data;
8476
- !x?.regions || x.regions.length === 0 || (s({
8477
- zones: x.regions.map((w) => ({ ...w.bbox, intensity: w.intensity })),
8478
- frameWidth: x.frameWidth,
8479
- frameHeight: x.frameHeight
8475
+ const y = v.data;
8476
+ !y?.regions || y.regions.length === 0 || (s({
8477
+ zones: y.regions.map((w) => ({ ...w.bbox, intensity: w.intensity })),
8478
+ frameWidth: y.frameWidth,
8479
+ frameHeight: y.frameHeight
8480
8480
  }), p.current && clearTimeout(p.current), p.current = setTimeout(() => s(null), vr));
8481
8481
  });
8482
8482
  return () => {
@@ -8484,15 +8484,15 @@ function gn(e, t) {
8484
8484
  };
8485
8485
  }, [e, t]), G(() => {
8486
8486
  if (t === null) return;
8487
- const b = ut(e, "detection.motion-zones-raw", (y) => {
8488
- const v = y;
8487
+ const b = ut(e, "detection.motion-zones-raw", (x) => {
8488
+ const v = x;
8489
8489
  if (!mt(v?.source, t)) return;
8490
- const x = v.data;
8491
- x?.zones && (i({
8492
- boxes: x.zones.map((w) => ({ bbox: w.bbox, changeScore: w.changeScore })),
8493
- frameWidth: x.frameSize?.width ?? 0,
8494
- frameHeight: x.frameSize?.height ?? 0,
8495
- motionScore: x.zones.length > 0 ? x.zones.reduce((w, N) => w + N.changeScore, 0) / x.zones.length : 0
8490
+ const y = v.data;
8491
+ y?.zones && (i({
8492
+ boxes: y.zones.map((w) => ({ bbox: w.bbox, changeScore: w.changeScore })),
8493
+ frameWidth: y.frameSize?.width ?? 0,
8494
+ frameHeight: y.frameSize?.height ?? 0,
8495
+ motionScore: y.zones.length > 0 ? y.zones.reduce((w, N) => w + N.changeScore, 0) / y.zones.length : 0
8496
8496
  }), g.current && clearTimeout(g.current), g.current = setTimeout(() => i(null), vr));
8497
8497
  });
8498
8498
  return () => {
@@ -8500,14 +8500,14 @@ function gn(e, t) {
8500
8500
  };
8501
8501
  }, [e, t]), G(() => {
8502
8502
  if (t === null) return;
8503
- const b = ut(e, "detection.result", (y) => {
8504
- const v = y;
8503
+ const b = ut(e, "detection.result", (x) => {
8504
+ const v = x;
8505
8505
  if (!mt(v?.source, t)) return;
8506
- const x = v.data?.frame;
8507
- x?.detections?.length && (d({
8508
- detections: x.detections,
8509
- frameWidth: x.width,
8510
- frameHeight: x.height
8506
+ const y = v.data?.frame;
8507
+ y?.detections?.length && (d({
8508
+ detections: y.detections,
8509
+ frameWidth: y.width,
8510
+ frameHeight: y.height
8511
8511
  }), f.current && clearTimeout(f.current), f.current = setTimeout(() => d(null), zi));
8512
8512
  });
8513
8513
  return () => {
@@ -8515,8 +8515,8 @@ function gn(e, t) {
8515
8515
  };
8516
8516
  }, [e, t]), G(() => {
8517
8517
  if (t === null) return;
8518
- const b = ut(e, "detection.phase-transition", (y) => {
8519
- const v = y;
8518
+ const b = ut(e, "detection.phase-transition", (x) => {
8519
+ const v = x;
8520
8520
  mt(v?.source, t) && v.data?.to && u(v.data.to);
8521
8521
  });
8522
8522
  return () => {
@@ -8536,9 +8536,9 @@ function Bi(e, t, n = 5e3) {
8536
8536
  });
8537
8537
  };
8538
8538
  b();
8539
- const y = setInterval(b, n);
8539
+ const x = setInterval(b, n);
8540
8540
  return () => {
8541
- f = !0, clearInterval(y);
8541
+ f = !0, clearInterval(x);
8542
8542
  };
8543
8543
  }, [e, t, n]);
8544
8544
  const [i, l] = k(null);
@@ -8576,8 +8576,8 @@ function Bi(e, t, n = 5e3) {
8576
8576
  bitrateKbps: b.bitrateKbps
8577
8577
  })), hasWebrtc: !0 }, [t, s]), u = Me(async (f, b) => {
8578
8578
  if (t === null) throw new Error("No device selected");
8579
- const y = await e.webrtcSession.createSession.mutate({ deviceId: t, target: f, hints: b });
8580
- return { sessionId: y.sessionId, sdpOffer: y.sdpOffer };
8579
+ const x = await e.webrtcSession.createSession.mutate({ deviceId: t, target: f, hints: b });
8580
+ return { sessionId: x.sessionId, sdpOffer: x.sdpOffer };
8581
8581
  }, [e, t]), p = Me(async (f, b) => {
8582
8582
  if (t === null) throw new Error("No device selected");
8583
8583
  await e.webrtcSession.handleAnswer.mutate({ deviceId: t, sessionId: f, sdpAnswer: b });
@@ -8665,12 +8665,12 @@ function qi({
8665
8665
  /* @__PURE__ */ c("div", { className: "p-3 space-y-3", children: [
8666
8666
  /* @__PURE__ */ c("div", { className: "flex flex-wrap gap-1.5", children: [
8667
8667
  bn.map((b) => {
8668
- const y = !n && e.label === b.label;
8668
+ const x = !n && e.label === b.label;
8669
8669
  return /* @__PURE__ */ r(
8670
8670
  "button",
8671
8671
  {
8672
8672
  onClick: () => p(b),
8673
- className: `px-2.5 py-1 text-[10px] font-medium rounded-md border transition-colors ${y ? "bg-primary/15 text-primary border-primary/30" : "border-border text-foreground-subtle hover:text-foreground hover:bg-surface-hover"}`,
8673
+ className: `px-2.5 py-1 text-[10px] font-medium rounded-md border transition-colors ${x ? "bg-primary/15 text-primary border-primary/30" : "border-border text-foreground-subtle hover:text-foreground hover:bg-surface-hover"}`,
8674
8674
  title: b.description,
8675
8675
  children: b.label
8676
8676
  },
@@ -9004,18 +9004,18 @@ function Ji({
9004
9004
  return;
9005
9005
  }
9006
9006
  const p = [], f = Ke(e, "detection.result", {
9007
- onData: ((b) => (y) => {
9008
- if (!gt(y.source, t)) return;
9009
- const v = y.data;
9007
+ onData: ((b) => (x) => {
9008
+ if (!gt(x.source, t)) return;
9009
+ const v = x.data;
9010
9010
  if (!v) return;
9011
- const x = typeof v.captureTimestamp == "number" ? v.captureTimestamp : void 0, w = typeof v.emitTimestamp == "number" ? v.emitTimestamp : void 0;
9012
- if (x === void 0 || w === void 0) return;
9011
+ const y = typeof v.captureTimestamp == "number" ? v.captureTimestamp : void 0, w = typeof v.emitTimestamp == "number" ? v.emitTimestamp : void 0;
9012
+ if (y === void 0 || w === void 0) return;
9013
9013
  const N = Date.now();
9014
9014
  a((S) => {
9015
9015
  const P = [...S, {
9016
- serverMs: w - x,
9016
+ serverMs: w - y,
9017
9017
  transportMs: N - w,
9018
- e2eMs: N - x,
9018
+ e2eMs: N - y,
9019
9019
  type: b
9020
9020
  }];
9021
9021
  return P.length > i ? P.slice(-i) : P;
@@ -9039,7 +9039,7 @@ function Ji({
9039
9039
  };
9040
9040
  }, u = (p, g) => {
9041
9041
  if (g.length === 0) return null;
9042
- const f = m(g.map((N) => N.serverMs)), b = m(g.map((N) => N.transportMs)), y = m(g.map((N) => N.e2eMs)), v = y.avg, x = v > 0 ? f.avg / v * 100 : 0, w = v > 0 ? b.avg / v * 100 : 0;
9042
+ const f = m(g.map((N) => N.serverMs)), b = m(g.map((N) => N.transportMs)), x = m(g.map((N) => N.e2eMs)), v = x.avg, y = v > 0 ? f.avg / v * 100 : 0, w = v > 0 ? b.avg / v * 100 : 0;
9043
9043
  return /* @__PURE__ */ c("tr", { className: "border-b border-border/50", children: [
9044
9044
  /* @__PURE__ */ r("td", { className: "px-3 py-2 font-medium text-foreground", children: p }),
9045
9045
  /* @__PURE__ */ r("td", { className: "px-3 py-2 text-right font-mono", children: g.length }),
@@ -9047,10 +9047,10 @@ function Ji({
9047
9047
  /* @__PURE__ */ r("td", { className: "px-3 py-2 text-right font-mono text-amber-400/60", children: f.p95 }),
9048
9048
  /* @__PURE__ */ r("td", { className: "px-3 py-2 text-right font-mono text-sky-400", children: b.avg }),
9049
9049
  /* @__PURE__ */ r("td", { className: "px-3 py-2 text-right font-mono text-sky-400/60", children: b.p95 }),
9050
- /* @__PURE__ */ r("td", { className: "px-3 py-2 text-right font-mono font-semibold text-foreground", children: y.avg }),
9051
- /* @__PURE__ */ r("td", { className: "px-3 py-2 text-right font-mono text-foreground-subtle", children: y.p95 }),
9052
- /* @__PURE__ */ r("td", { className: "px-3 py-2", children: /* @__PURE__ */ c("div", { className: "h-2 w-full rounded overflow-hidden flex", title: `server: ${x.toFixed(0)}% transport: ${w.toFixed(0)}%`, children: [
9053
- /* @__PURE__ */ r("div", { className: "bg-amber-500 h-full", style: { width: `${x}%` } }),
9050
+ /* @__PURE__ */ r("td", { className: "px-3 py-2 text-right font-mono font-semibold text-foreground", children: x.avg }),
9051
+ /* @__PURE__ */ r("td", { className: "px-3 py-2 text-right font-mono text-foreground-subtle", children: x.p95 }),
9052
+ /* @__PURE__ */ r("td", { className: "px-3 py-2", children: /* @__PURE__ */ c("div", { className: "h-2 w-full rounded overflow-hidden flex", title: `server: ${y.toFixed(0)}% transport: ${w.toFixed(0)}%`, children: [
9053
+ /* @__PURE__ */ r("div", { className: "bg-amber-500 h-full", style: { width: `${y}%` } }),
9054
9054
  /* @__PURE__ */ r("div", { className: "bg-sky-500 h-full", style: { width: `${w}%` } })
9055
9055
  ] }) })
9056
9056
  ] }, p);
@@ -9111,28 +9111,28 @@ function Nr({
9111
9111
  const [s, a] = k([]), i = se(null);
9112
9112
  G(() => {
9113
9113
  if (t === null || !n) return;
9114
- const m = (b, y) => {
9114
+ const m = (b, x) => {
9115
9115
  a((v) => {
9116
- const x = [...v, { ts: Date.now(), cat: b, msg: y }];
9117
- return x.length > wr ? x.slice(-wr) : x;
9116
+ const y = [...v, { ts: Date.now(), cat: b, msg: x }];
9117
+ return y.length > wr ? y.slice(-wr) : y;
9118
9118
  });
9119
9119
  }, u = [], p = Ke(e, "detection.result", {
9120
9120
  onData: (b) => {
9121
9121
  if (!gt(b.source, t)) return;
9122
- const y = b.data;
9123
- if (y)
9124
- if (y.type === "pipeline.trace") {
9125
- const v = Pe(y.trace) ? y.trace : void 0;
9122
+ const x = b.data;
9123
+ if (x)
9124
+ if (x.type === "pipeline.trace") {
9125
+ const v = Pe(x.trace) ? x.trace : void 0;
9126
9126
  if (!v) return;
9127
- const x = Array.isArray(v.steps) ? v.steps : [];
9128
- m("trace", `${String(v.totalMs ?? "?")}ms | ${String(v.detectionCount ?? 0)} det(s) | ${x.length} steps`);
9127
+ const y = Array.isArray(v.steps) ? v.steps : [];
9128
+ m("trace", `${String(v.totalMs ?? "?")}ms | ${String(v.detectionCount ?? 0)} det(s) | ${y.length} steps`);
9129
9129
  } else {
9130
- const v = Pe(y.pipelineResult) ? y.pipelineResult : void 0, x = Array.isArray(v?.detections) ? v.detections : [], w = x.map((N) => {
9130
+ const v = Pe(x.pipelineResult) ? x.pipelineResult : void 0, y = Array.isArray(v?.detections) ? v.detections : [], w = y.map((N) => {
9131
9131
  if (!Pe(N)) return "?";
9132
9132
  const S = typeof N.className == "string" ? N.className : "?", P = typeof N.confidence == "number" ? (N.confidence * 100).toFixed(0) : "?", A = Array.isArray(N.children) ? N.children.length : 0;
9133
9133
  return A > 0 ? `${S}(${P}%)+${A}ch` : `${S}(${P}%)`;
9134
9134
  }).join(", ");
9135
- m("det", `${x.length} obj: ${w} [${String(y.frameWidth ?? "?")}x${String(y.frameHeight ?? "?")}]`);
9135
+ m("det", `${y.length} obj: ${w} [${String(x.frameWidth ?? "?")}x${String(x.frameHeight ?? "?")}]`);
9136
9136
  }
9137
9137
  }
9138
9138
  });
@@ -9140,19 +9140,19 @@ function Nr({
9140
9140
  const g = Ke(e, "detection.motion-analysis", {
9141
9141
  onData: (b) => {
9142
9142
  if (!gt(b.source, t)) return;
9143
- const y = b.data;
9144
- if (!y) return;
9145
- const v = Array.isArray(y.regions) ? y.regions : [];
9146
- m("motion", `${v.length} zone(s) [${String(y.frameWidth ?? "?")}x${String(y.frameHeight ?? "?")}]`);
9143
+ const x = b.data;
9144
+ if (!x) return;
9145
+ const v = Array.isArray(x.regions) ? x.regions : [];
9146
+ m("motion", `${v.length} zone(s) [${String(x.frameWidth ?? "?")}x${String(x.frameHeight ?? "?")}]`);
9147
9147
  }
9148
9148
  });
9149
9149
  g && u.push(g);
9150
9150
  const f = Ke(e, "detection.motion-zones-raw", {
9151
9151
  onData: (b) => {
9152
9152
  if (!gt(b.source, t)) return;
9153
- const y = b.data;
9154
- if (!y) return;
9155
- const v = Array.isArray(y.zones) ? y.zones : [], x = v.map((A) => Pe(A) && typeof A.changeScore == "number" ? A.changeScore : null).filter((A) => A !== null), w = x.length > 0 ? Math.max(...x).toFixed(2) : "?", N = Pe(y.frameSize) ? y.frameSize : void 0, S = typeof N?.width == "number" ? N.width : "?", P = typeof N?.height == "number" ? N.height : "?";
9153
+ const x = b.data;
9154
+ if (!x) return;
9155
+ const v = Array.isArray(x.zones) ? x.zones : [], y = v.map((A) => Pe(A) && typeof A.changeScore == "number" ? A.changeScore : null).filter((A) => A !== null), w = y.length > 0 ? Math.max(...y).toFixed(2) : "?", N = Pe(x.frameSize) ? x.frameSize : void 0, S = typeof N?.width == "number" ? N.width : "?", P = typeof N?.height == "number" ? N.height : "?";
9156
9156
  m("raw", `${v.length} zone(s) maxScore=${w} [${String(S)}x${String(P)}]`);
9157
9157
  }
9158
9158
  });
@@ -9221,26 +9221,26 @@ function el({
9221
9221
  }
9222
9222
  const f = Ke(e, "pipeline.audio-inference-result", {
9223
9223
  onData: (b) => {
9224
- const y = b.data;
9225
- if (!y || !Pe(y)) return;
9226
- const v = y.deviceId;
9224
+ const x = b.data;
9225
+ if (!x || !Pe(x)) return;
9226
+ const v = x.deviceId;
9227
9227
  if (v !== void 0) {
9228
9228
  const S = typeof v == "number" ? v : typeof v == "string" ? Number(v) : Number.NaN;
9229
9229
  if (!Number.isFinite(S) || S !== t) return;
9230
9230
  }
9231
- const x = Pe(y.frame) ? y.frame : void 0;
9232
- if (!x) return;
9233
- const w = Pe(x.level) ? x.level : void 0;
9231
+ const y = Pe(x.frame) ? x.frame : void 0;
9232
+ if (!y) return;
9233
+ const w = Pe(y.level) ? y.level : void 0;
9234
9234
  if (w) {
9235
9235
  const S = typeof w.dbfs == "number" ? w.dbfs : 0, P = typeof w.rms == "number" ? w.rms : 0;
9236
9236
  i({ dbfs: S, rms: P }), u((A) => A + 1);
9237
9237
  }
9238
- const N = Array.isArray(x.detections) ? x.detections : [];
9238
+ const N = Array.isArray(y.detections) ? y.detections : [];
9239
9239
  if (N.length > 0) {
9240
9240
  const S = N.filter(Pe).map((j) => ({
9241
9241
  className: typeof j.macroClass == "string" ? j.macroClass : "",
9242
9242
  score: typeof j.score == "number" ? j.score : 0
9243
- })), P = Pe(x.debug) ? x.debug : void 0, A = typeof P?.totalInferenceMs == "number" ? P.totalInferenceMs : 0, F = typeof w?.dbfs == "number" ? w.dbfs : 0;
9243
+ })), P = Pe(y.debug) ? y.debug : void 0, A = typeof P?.totalInferenceMs == "number" ? P.totalInferenceMs : 0, F = typeof w?.dbfs == "number" ? w.dbfs : 0;
9244
9244
  d({
9245
9245
  classifications: S,
9246
9246
  inferenceMs: A,
@@ -9301,11 +9301,11 @@ function el({
9301
9301
  }
9302
9302
  ),
9303
9303
  l ? /* @__PURE__ */ r("div", { className: "flex flex-wrap gap-2", children: l.classifications.slice(0, 5).map((f, b) => {
9304
- const y = (f.score * 100).toFixed(0), v = f.score >= 0.7 ? "text-emerald-400" : f.score >= 0.4 ? "text-amber-400" : "text-foreground-subtle";
9304
+ const x = (f.score * 100).toFixed(0), v = f.score >= 0.7 ? "text-emerald-400" : f.score >= 0.4 ? "text-amber-400" : "text-foreground-subtle";
9305
9305
  return /* @__PURE__ */ c("span", { className: "inline-flex items-center gap-1.5 px-2 py-1 rounded-md bg-surface-hover text-xs", children: [
9306
9306
  /* @__PURE__ */ r("span", { className: "font-medium text-foreground", children: f.className }),
9307
9307
  /* @__PURE__ */ c("span", { className: `font-mono ${v}`, children: [
9308
- y,
9308
+ x,
9309
9309
  "%"
9310
9310
  ] })
9311
9311
  ] }, `${f.className}-${b}`);
@@ -9377,7 +9377,7 @@ function tl({ trpc: e }) {
9377
9377
  Number.isFinite(R) && (C.has(R) || C.set(R, []), C.get(R).push(h));
9378
9378
  }
9379
9379
  return C;
9380
- }, [s]), y = Ce(() => t.filter((C) => b.has(C.id)), [t, b]), v = Ce(() => y.find((h) => h.online)?.id ?? y[0]?.id ?? null, [y]), x = i ?? v, w = x !== null ? t.find((C) => C.id === x) ?? null : null, N = x !== null ? b.get(x) ?? [] : [], S = Bi(e, x), { createSession: P, sendAnswer: A } = S, F = S.closeSession, j = gn(e, x), U = j.phase === "active", [Z, J] = k(null), [fe, ae] = k(null), [le, ce] = k(!1), [V, ie] = k(!0), [W, re] = k(!1), [$, T] = k(!1), I = Z ? N.find((C) => C.brokerId === Z) ?? N[0] : N[0], H = fe ?? (x !== null ? `${x}/adaptive` : ""), _ = Ce(() => {
9380
+ }, [s]), x = Ce(() => t.filter((C) => b.has(C.id)), [t, b]), v = Ce(() => x.find((h) => h.online)?.id ?? x[0]?.id ?? null, [x]), y = i ?? v, w = y !== null ? t.find((C) => C.id === y) ?? null : null, N = y !== null ? b.get(y) ?? [] : [], S = Bi(e, y), { createSession: P, sendAnswer: A } = S, F = S.closeSession, j = gn(e, y), U = j.phase === "active", [Z, J] = k(null), [fe, ae] = k(null), [le, ce] = k(!1), [V, ie] = k(!0), [W, re] = k(!1), [$, T] = k(!1), I = Z ? N.find((C) => C.brokerId === Z) ?? N[0] : N[0], H = fe ?? (y !== null ? `${y}/adaptive` : ""), _ = Ce(() => {
9381
9381
  const C = S.streams.find((M) => M.id === H);
9382
9382
  if (C) return C.target;
9383
9383
  const h = H.indexOf("/");
@@ -9388,9 +9388,9 @@ function tl({ trpc: e }) {
9388
9388
  return { kind: "adaptive" };
9389
9389
  }, [S.streams, H]);
9390
9390
  return G(() => {
9391
- if (x === null) return;
9391
+ if (y === null) return;
9392
9392
  let C = !1;
9393
- return e.deviceManager.getStreamSources.query({ deviceId: x }).then((h) => {
9393
+ return e.deviceManager.getStreamSources.query({ deviceId: y }).then((h) => {
9394
9394
  if (C) return;
9395
9395
  const M = /* @__PURE__ */ new Map();
9396
9396
  h.forEach((R, L) => {
@@ -9402,17 +9402,17 @@ function tl({ trpc: e }) {
9402
9402
  }), () => {
9403
9403
  C = !0;
9404
9404
  };
9405
- }, [e, x]), G(() => {
9405
+ }, [e, y]), G(() => {
9406
9406
  J(null), ae(null);
9407
- }, [x]), G(() => {
9408
- x !== null && f(x, u);
9409
- }, [x, u, f]), /* @__PURE__ */ c("div", { className: "space-y-4", children: [
9407
+ }, [y]), G(() => {
9408
+ y !== null && f(y, u);
9409
+ }, [y, u, f]), /* @__PURE__ */ c("div", { className: "space-y-4", children: [
9410
9410
  /* @__PURE__ */ r("div", { className: "flex items-center justify-end gap-4 flex-wrap", children: /* @__PURE__ */ r("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ c("div", { className: "flex items-center gap-1.5", children: [
9411
9411
  /* @__PURE__ */ r("span", { className: "text-[10px] font-medium text-foreground-subtle", children: "Camera" }),
9412
9412
  /* @__PURE__ */ r(
9413
9413
  "select",
9414
9414
  {
9415
- value: x ?? "",
9415
+ value: y ?? "",
9416
9416
  onChange: (C) => {
9417
9417
  const h = C.target.value;
9418
9418
  if (h === "") {
@@ -9423,7 +9423,7 @@ function tl({ trpc: e }) {
9423
9423
  l(Number.isFinite(M) ? M : null);
9424
9424
  },
9425
9425
  className: "px-3 py-1.5 text-xs rounded-md border border-border bg-surface text-foreground focus:outline-none focus:ring-2 focus:ring-primary min-w-[200px]",
9426
- children: y.length === 0 ? /* @__PURE__ */ r("option", { value: "", children: "No cameras with active streams" }) : y.map((C) => {
9426
+ children: x.length === 0 ? /* @__PURE__ */ r("option", { value: "", children: "No cameras with active streams" }) : x.map((C) => {
9427
9427
  const M = (b.get(C.id) ?? []).some((L) => L.status === "streaming"), R = !C.online;
9428
9428
  return /* @__PURE__ */ c("option", { value: C.id, disabled: R, children: [
9429
9429
  M ? "● " : "○ ",
@@ -9451,7 +9451,7 @@ function tl({ trpc: e }) {
9451
9451
  },
9452
9452
  className: "px-2 py-0.5 text-[10px] rounded border border-border bg-surface text-foreground focus:outline-none focus:ring-1 focus:ring-primary",
9453
9453
  children: [
9454
- x !== null && /* @__PURE__ */ r("option", { value: `${x}/adaptive`, children: "Adaptive" }),
9454
+ y !== null && /* @__PURE__ */ r("option", { value: `${y}/adaptive`, children: "Adaptive" }),
9455
9455
  N.map((C) => {
9456
9456
  const h = C.brokerId.split("/")[1] ?? C.brokerId, M = d.get(h)?.toUpperCase() ?? h;
9457
9457
  return /* @__PURE__ */ c("option", { value: C.brokerId, children: [
@@ -9479,7 +9479,7 @@ function tl({ trpc: e }) {
9479
9479
  ] }),
9480
9480
  /* @__PURE__ */ r("span", { children: Vi(I.uptimeMs) })
9481
9481
  ] }),
9482
- x !== null && /* @__PURE__ */ c(Te, { children: [
9482
+ y !== null && /* @__PURE__ */ c(Te, { children: [
9483
9483
  /* @__PURE__ */ c("span", { className: "flex items-center gap-1", children: [
9484
9484
  /* @__PURE__ */ r("span", { className: `w-1.5 h-1.5 rounded-full ${U ? "bg-red-500 animate-pulse" : "bg-emerald-500"}` }),
9485
9485
  /* @__PURE__ */ r("span", { className: `text-[10px] font-semibold uppercase tracking-wider ${U ? "text-red-400" : "text-emerald-400"}`, children: U ? "Active" : "Watching" })
@@ -9531,7 +9531,7 @@ function tl({ trpc: e }) {
9531
9531
  sendAnswer: A,
9532
9532
  closeSession: F,
9533
9533
  hintsOverride: u.bandwidthKbps > 0 ? { downlinkMbps: u.bandwidthKbps / 1e3 } : void 0,
9534
- overlay: (V || le) && x !== null ? /* @__PURE__ */ r(
9534
+ overlay: (V || le) && y !== null ? /* @__PURE__ */ r(
9535
9535
  Si,
9536
9536
  {
9537
9537
  detections: j,
@@ -9549,12 +9549,12 @@ function tl({ trpc: e }) {
9549
9549
  /* @__PURE__ */ r("p", { className: "text-sm", children: "No active stream brokers found" }),
9550
9550
  /* @__PURE__ */ r("p", { className: "text-xs", children: "Cameras will appear here once they start streaming." })
9551
9551
  ] }) }),
9552
- x !== null && I?.status === "streaming" && /* @__PURE__ */ c("div", { className: "flex flex-col gap-2", children: [
9552
+ y !== null && I?.status === "streaming" && /* @__PURE__ */ c("div", { className: "flex flex-col gap-2", children: [
9553
9553
  /* @__PURE__ */ r(
9554
9554
  Ui,
9555
9555
  {
9556
9556
  trpc: e,
9557
- deviceId: x,
9557
+ deviceId: y,
9558
9558
  streaming: !0
9559
9559
  }
9560
9560
  ),
@@ -9562,7 +9562,7 @@ function tl({ trpc: e }) {
9562
9562
  el,
9563
9563
  {
9564
9564
  trpc: e,
9565
- deviceId: x,
9565
+ deviceId: y,
9566
9566
  streaming: !0,
9567
9567
  visible: !0
9568
9568
  }
@@ -9572,7 +9572,7 @@ function tl({ trpc: e }) {
9572
9572
  Xi,
9573
9573
  {
9574
9574
  trpc: e,
9575
- deviceId: x,
9575
+ deviceId: y,
9576
9576
  streaming: I?.status === "streaming"
9577
9577
  }
9578
9578
  ),
@@ -9580,7 +9580,7 @@ function tl({ trpc: e }) {
9580
9580
  Ji,
9581
9581
  {
9582
9582
  trpc: e,
9583
- deviceId: x,
9583
+ deviceId: y,
9584
9584
  streaming: I?.status === "streaming"
9585
9585
  }
9586
9586
  ),
@@ -9591,19 +9591,19 @@ function tl({ trpc: e }) {
9591
9591
  onChange: p
9592
9592
  }
9593
9593
  ),
9594
- W && x !== null && /* @__PURE__ */ r(lr, { title: "Event Log", onClose: () => re(!1), defaultWidth: 500, defaultHeight: 400, offsetIndex: 0, children: /* @__PURE__ */ r(
9594
+ W && y !== null && /* @__PURE__ */ r(lr, { title: "Event Log", onClose: () => re(!1), defaultWidth: 500, defaultHeight: 400, offsetIndex: 0, children: /* @__PURE__ */ r(
9595
9595
  Nr,
9596
9596
  {
9597
9597
  trpc: e,
9598
- deviceId: x,
9598
+ deviceId: y,
9599
9599
  streaming: I?.status === "streaming"
9600
9600
  }
9601
9601
  ) }),
9602
- $ && x !== null && /* @__PURE__ */ r(lr, { title: "Raw Events", onClose: () => T(!1), defaultWidth: 500, defaultHeight: 400, offsetIndex: 1, children: /* @__PURE__ */ r(
9602
+ $ && y !== null && /* @__PURE__ */ r(lr, { title: "Raw Events", onClose: () => T(!1), defaultWidth: 500, defaultHeight: 400, offsetIndex: 1, children: /* @__PURE__ */ r(
9603
9603
  Nr,
9604
9604
  {
9605
9605
  trpc: e,
9606
- deviceId: x,
9606
+ deviceId: y,
9607
9607
  streaming: I?.status === "streaming"
9608
9608
  }
9609
9609
  ) })
@@ -9687,7 +9687,7 @@ function kr(e, t) {
9687
9687
  return { runtime: n, backend: s, format: a, ...i ? { device: i } : {} };
9688
9688
  }
9689
9689
  function nl({ trpc: e, nodeId: t }) {
9690
- const [n, s] = k(null), [a, i] = k([]), [l, d] = k(null), [m, u] = k([]), [p, g] = k(""), [f, b] = k(null), [y, v] = k(""), [x, w] = k(null), [N, S] = k({ w: 640, h: 480 }), [P, A] = k([]), [F, j] = k(!1), [E, U] = k(""), [Z, J] = k(null), [fe, ae] = k(!0), [le, ce] = k([]), [V, ie] = k({}), [W, re] = k({}), [$, T] = k(200), [I, H] = k(4), [_, C] = k(1), [h, M] = k(!1), [R, L] = k(null), [ee, ue] = k(null), [O, D] = k(null), K = se(null), [we, ne] = k(/* @__PURE__ */ new Set()), he = Me((Q, q) => {
9690
+ const [n, s] = k(null), [a, i] = k([]), [l, d] = k(null), [m, u] = k([]), [p, g] = k(""), [f, b] = k(null), [x, v] = k(""), [y, w] = k(null), [N, S] = k({ w: 640, h: 480 }), [P, A] = k([]), [F, j] = k(!1), [E, U] = k(""), [Z, J] = k(null), [fe, ae] = k(!0), [le, ce] = k([]), [V, ie] = k({}), [W, re] = k({}), [$, T] = k(200), [I, H] = k(4), [_, C] = k(1), [h, M] = k(!1), [R, L] = k(null), [ee, ue] = k(null), [O, D] = k(null), K = se(null), [we, ne] = k(/* @__PURE__ */ new Set()), he = Me((Q, q) => {
9691
9691
  ne((te) => {
9692
9692
  const oe = new Set(te);
9693
9693
  return q ? oe.delete(Q) : oe.add(Q), oe;
@@ -9898,7 +9898,7 @@ ${pe(q)}
9898
9898
  {
9899
9899
  images: m,
9900
9900
  selectedFilename: p,
9901
- uploadedName: y,
9901
+ uploadedName: x,
9902
9902
  onSelect: yt,
9903
9903
  onUpload: (Q, q, te) => {
9904
9904
  b(Q), v(q), g(""), Ne(te), J(null);
@@ -10079,7 +10079,7 @@ ${pe(q)}
10079
10079
  /* @__PURE__ */ r(
10080
10080
  qo,
10081
10081
  {
10082
- src: x,
10082
+ src: y,
10083
10083
  imageWidth: Je,
10084
10084
  imageHeight: ke,
10085
10085
  detections: at,
@@ -10186,30 +10186,30 @@ function Mr(e) {
10186
10186
  const g = Math.min(m + p, s.byteLength);
10187
10187
  if (i === 3 && d === 32) {
10188
10188
  const f = (g - m) / 4, b = new Float32Array(f);
10189
- for (let y = 0; y < f; y++)
10190
- b[y] = a.getFloat32(m + y * 4, !0);
10189
+ for (let x = 0; x < f; x++)
10190
+ b[x] = a.getFloat32(m + x * 4, !0);
10191
10191
  if (l > 1) {
10192
- const y = new Float32Array(f / l);
10193
- for (let v = 0; v < y.length; v++) {
10194
- let x = 0;
10195
- for (let w = 0; w < l; w++) x += b[v * l + w];
10196
- y[v] = x / l;
10192
+ const x = new Float32Array(f / l);
10193
+ for (let v = 0; v < x.length; v++) {
10194
+ let y = 0;
10195
+ for (let w = 0; w < l; w++) y += b[v * l + w];
10196
+ x[v] = y / l;
10197
10197
  }
10198
- return y;
10198
+ return x;
10199
10199
  }
10200
10200
  return b;
10201
10201
  } else if (i === 1 && d === 16) {
10202
10202
  const f = (g - m) / 2, b = new Float32Array(f);
10203
- for (let y = 0; y < f; y++)
10204
- b[y] = a.getInt16(m + y * 2, !0) / 32768;
10203
+ for (let x = 0; x < f; x++)
10204
+ b[x] = a.getInt16(m + x * 2, !0) / 32768;
10205
10205
  if (l > 1) {
10206
- const y = new Float32Array(f / l);
10207
- for (let v = 0; v < y.length; v++) {
10208
- let x = 0;
10209
- for (let w = 0; w < l; w++) x += b[v * l + w];
10210
- y[v] = x / l;
10206
+ const x = new Float32Array(f / l);
10207
+ for (let v = 0; v < x.length; v++) {
10208
+ let y = 0;
10209
+ for (let w = 0; w < l; w++) y += b[v * l + w];
10210
+ x[v] = y / l;
10211
10211
  }
10212
- return y;
10212
+ return x;
10213
10213
  }
10214
10214
  return b;
10215
10215
  }
@@ -10223,7 +10223,7 @@ function Mr(e) {
10223
10223
  }
10224
10224
  }
10225
10225
  function sl({ trpc: e, nodeId: t }) {
10226
- const [n, s] = k([]), [a, i] = k(""), [l, d] = k(null), [m, u] = k(""), [p, g] = k(null), [f, b] = k(!1), [y, v] = k(""), [x, w] = k(null), [N, S] = k(!0), [P, A] = k(null), [F, j] = k(""), [E, U] = k({}), [Z, J] = k(null);
10226
+ const [n, s] = k([]), [a, i] = k(""), [l, d] = k(null), [m, u] = k(""), [p, g] = k(null), [f, b] = k(!1), [x, v] = k(""), [y, w] = k(null), [N, S] = k(!0), [P, A] = k(null), [F, j] = k(""), [E, U] = k({}), [Z, J] = k(null);
10227
10227
  G(() => {
10228
10228
  e.pipelineExecutor.getReferenceAudioFiles.query().then(async (h) => {
10229
10229
  if (s(h), h.length > 0) {
@@ -10385,7 +10385,7 @@ function sl({ trpc: e, nodeId: t }) {
10385
10385
  }
10386
10386
  if (N)
10387
10387
  return /* @__PURE__ */ r("div", { className: "text-sm text-foreground-subtle animate-pulse py-8 text-center", children: "Loading audio pipeline..." });
10388
- const $ = x?.frame, T = $?.detections ?? [], I = T[0]?.debug?.alternateLabels?.["audio-classifier"] ?? [], _ = $?.debug?.stepTimings?.find((h) => h.source === "audio-classifier")?.ms, C = $?.debug?.totalInferenceMs;
10388
+ const $ = y?.frame, T = $?.detections ?? [], I = T[0]?.debug?.alternateLabels?.["audio-classifier"] ?? [], _ = $?.debug?.stepTimings?.find((h) => h.source === "audio-classifier")?.ms, C = $?.debug?.totalInferenceMs;
10389
10389
  return /* @__PURE__ */ c("div", { className: "space-y-4", children: [
10390
10390
  /* @__PURE__ */ r(
10391
10391
  Ut,
@@ -10412,7 +10412,7 @@ function sl({ trpc: e, nodeId: t }) {
10412
10412
  uploadLabel: "Upload WAV"
10413
10413
  }
10414
10414
  ),
10415
- y && /* @__PURE__ */ r("div", { className: "rounded-md bg-danger/10 border border-danger/20 px-3 py-2 text-xs text-danger", children: y }),
10415
+ x && /* @__PURE__ */ r("div", { className: "rounded-md bg-danger/10 border border-danger/20 px-3 py-2 text-xs text-danger", children: x }),
10416
10416
  /* @__PURE__ */ c("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
10417
10417
  /* @__PURE__ */ c("div", { className: "space-y-3", children: [
10418
10418
  /* @__PURE__ */ c("div", { className: "rounded-xl border border-border bg-surface overflow-hidden", children: [
@@ -10433,7 +10433,7 @@ function sl({ trpc: e, nodeId: t }) {
10433
10433
  }
10434
10434
  ) : /* @__PURE__ */ r("div", { className: "h-[140px] flex items-center justify-center text-xs text-foreground-subtle", children: "Select an audio file above" }) })
10435
10435
  ] }),
10436
- x?.success && T.length > 0 && (() => {
10436
+ y?.success && T.length > 0 && (() => {
10437
10437
  const h = T[0], M = h.debug?.originalClass;
10438
10438
  return /* @__PURE__ */ c("div", { className: "rounded-xl border border-primary/30 bg-primary/5 px-3 py-2 flex items-center justify-between", children: [
10439
10439
  /* @__PURE__ */ c("div", { className: "flex items-center gap-2 min-w-0", children: [
@@ -10455,7 +10455,7 @@ function sl({ trpc: e, nodeId: t }) {
10455
10455
  ] })
10456
10456
  ] });
10457
10457
  })(),
10458
- x?.success && C != null && /* @__PURE__ */ c("div", { className: "rounded-xl border border-border bg-surface overflow-hidden", children: [
10458
+ y?.success && C != null && /* @__PURE__ */ c("div", { className: "rounded-xl border border-border bg-surface overflow-hidden", children: [
10459
10459
  /* @__PURE__ */ r("div", { className: "px-3 py-2 border-b border-border", children: /* @__PURE__ */ r("h3", { className: "text-xs font-medium text-foreground", children: "Timings" }) }),
10460
10460
  /* @__PURE__ */ c("div", { className: "px-3 py-2 space-y-1.5", children: [
10461
10461
  _ != null && /* @__PURE__ */ c("div", { className: "flex items-center justify-between text-xs", children: [
@@ -10508,7 +10508,7 @@ function sl({ trpc: e, nodeId: t }) {
10508
10508
  ] }, `${h.label}-${M}`);
10509
10509
  }) }) : /* @__PURE__ */ r("div", { className: "text-[10px] text-foreground-subtle py-2 text-center", children: "No classifications" }) })
10510
10510
  ] }),
10511
- /* @__PURE__ */ r(pn, { data: x, label: "Audio Classification Response" })
10511
+ /* @__PURE__ */ r(pn, { data: y, label: "Audio Classification Response" })
10512
10512
  ] }),
10513
10513
  /* @__PURE__ */ c("div", { className: "space-y-3", children: [
10514
10514
  P && /* @__PURE__ */ c("div", { className: "rounded-xl border border-border bg-surface overflow-hidden", children: [
@@ -10577,7 +10577,7 @@ function Sr(e, t) {
10577
10577
  }
10578
10578
  }
10579
10579
  function ol({ trpc: e, nodeId: t }) {
10580
- const [n, s] = k([]), [a, i] = k(""), [l, d] = k(3), [m, u] = k(25), [p, g] = k("jpeg"), [f, b] = k("duration"), [y, v] = k(60), [x, w] = k(1e3), [N, S] = k(15), [P, A] = k(2e3), [F, j] = k(5), [E, U] = k(20), [Z] = k("decoder-nodeav"), [J, fe] = k(""), [ae, le] = k(""), [ce] = k(0), [V, ie] = k(null), [W, re] = k(!1), [$, T] = k(""), [I, H] = k(null), [_, C] = k("idle"), [h, M] = k(null), [R, L] = k(!0), ee = se(null);
10580
+ const [n, s] = k([]), [a, i] = k(""), [l, d] = k(3), [m, u] = k(25), [p, g] = k("jpeg"), [f, b] = k("duration"), [x, v] = k(60), [y, w] = k(1e3), [N, S] = k(15), [P, A] = k(2e3), [F, j] = k(5), [E, U] = k(20), [Z] = k("decoder-nodeav"), [J, fe] = k(""), [ae, le] = k(""), [ce] = k(0), [V, ie] = k(null), [W, re] = k(!1), [$, T] = k(""), [I, H] = k(null), [_, C] = k("idle"), [h, M] = k(null), [R, L] = k(!0), ee = se(null);
10581
10581
  G(() => {
10582
10582
  e.addons.custom.mutate({
10583
10583
  addonId: "benchmark",
@@ -10631,7 +10631,7 @@ function ol({ trpc: e, nodeId: t }) {
10631
10631
  const K = V || J || ae || "none", we = {
10632
10632
  sessionId: D,
10633
10633
  cameras: l,
10634
- mode: f === "duration" ? { kind: "duration", durationSec: y } : { kind: "iterations", iterations: x },
10634
+ mode: f === "duration" ? { kind: "duration", durationSec: x } : { kind: "iterations", iterations: y },
10635
10635
  source: { kind: "sample", fixtureFilename: a },
10636
10636
  format: p,
10637
10637
  fps: m,
@@ -10658,7 +10658,7 @@ function ol({ trpc: e, nodeId: t }) {
10658
10658
  cameras: l,
10659
10659
  format: p,
10660
10660
  sourceLabel: `sample:${a}${he ? ` (${he.resolutionLabel})` : ""}`,
10661
- modeLabel: f === "duration" ? `duration:${y}s` : `iterations:${x}`,
10661
+ modeLabel: f === "duration" ? `duration:${x}s` : `iterations:${y}`,
10662
10662
  rssSlopeMBMin: ne.slopes.rssMBMin,
10663
10663
  heapSlopeMBMin: ne.slopes.heapMBMin,
10664
10664
  externalSlopeMBMin: ne.slopes.externalMBMin,
@@ -10811,7 +10811,7 @@ function ol({ trpc: e, nodeId: t }) {
10811
10811
  min: 5,
10812
10812
  max: 1800,
10813
10813
  className: "mt-1 w-full px-2 py-1 text-sm bg-background border border-border rounded",
10814
- value: y,
10814
+ value: x,
10815
10815
  onChange: (D) => v(Number(D.target.value)),
10816
10816
  disabled: W
10817
10817
  }
@@ -10825,7 +10825,7 @@ function ol({ trpc: e, nodeId: t }) {
10825
10825
  min: 10,
10826
10826
  max: 1e6,
10827
10827
  className: "mt-1 w-full px-2 py-1 text-sm bg-background border border-border rounded",
10828
- value: x,
10828
+ value: y,
10829
10829
  onChange: (D) => w(Number(D.target.value)),
10830
10830
  disabled: W
10831
10831
  }
@@ -11012,13 +11012,13 @@ function il({ trpc: e }) {
11012
11012
  console.error("[benchmark:history] Failed to load history:", N);
11013
11013
  }).finally(() => a(!1));
11014
11014
  }, [e]);
11015
- const g = t.filter((N) => N.kind === "pipeline"), f = [...new Set(g.map((N) => N.stepId))], b = [...new Set(g.map((N) => N.modelId))], y = t.filter((N) => !(i !== "all" && N.kind !== i || N.kind === "pipeline" && (d && N.stepId !== d || u && N.modelId !== u))), v = async (N) => {
11015
+ const g = t.filter((N) => N.kind === "pipeline"), f = [...new Set(g.map((N) => N.stepId))], b = [...new Set(g.map((N) => N.modelId))], x = t.filter((N) => !(i !== "all" && N.kind !== i || N.kind === "pipeline" && (d && N.stepId !== d || u && N.modelId !== u))), v = async (N) => {
11016
11016
  try {
11017
11017
  await e.addons.custom.mutate({ addonId: "benchmark", action: "deleteBenchmarkResult", input: { id: N } }), n((S) => S.filter((P) => P.id !== N));
11018
11018
  } catch (S) {
11019
11019
  console.error("[benchmark:history] Delete failed:", S);
11020
11020
  }
11021
- }, x = (N) => {
11021
+ }, y = (N) => {
11022
11022
  const S = new Blob([JSON.stringify(N, null, 2)], { type: "application/json" }), P = document.createElement("a");
11023
11023
  P.href = URL.createObjectURL(S), P.download = `benchmark-${N.id}.json`, P.click();
11024
11024
  }, w = async () => {
@@ -11079,14 +11079,14 @@ function il({ trpc: e }) {
11079
11079
  ] })
11080
11080
  ] }),
11081
11081
  /* @__PURE__ */ c("div", { className: "text-[10px] text-foreground-subtle pb-1.5", children: [
11082
- y.length,
11082
+ x.length,
11083
11083
  " result",
11084
- y.length === 1 ? "" : "s"
11084
+ x.length === 1 ? "" : "s"
11085
11085
  ] }),
11086
11086
  /* @__PURE__ */ r("div", { className: "flex-1" }),
11087
11087
  t.length > 0 && /* @__PURE__ */ r("button", { onClick: w, className: "px-3 py-1.5 text-xs rounded-md border border-danger/30 text-danger hover:bg-danger/10 transition-colors", children: "Clear All" })
11088
11088
  ] }),
11089
- y.length > 0 ? /* @__PURE__ */ r("div", { className: "space-y-2", children: y.map((N) => N.kind === "pipeline" ? /* @__PURE__ */ r(ll, { entry: N, onDelete: v, onExport: x }, N.id) : /* @__PURE__ */ r(cl, { entry: N, onDelete: v, onExport: x }, N.id)) }) : /* @__PURE__ */ r("div", { className: "text-xs text-foreground-subtle italic text-center py-8", children: t.length === 0 ? "No benchmark results yet." : "No entries match filters." })
11089
+ x.length > 0 ? /* @__PURE__ */ r("div", { className: "space-y-2", children: x.map((N) => N.kind === "pipeline" ? /* @__PURE__ */ r(ll, { entry: N, onDelete: v, onExport: y }, N.id) : /* @__PURE__ */ r(cl, { entry: N, onDelete: v, onExport: y }, N.id)) }) : /* @__PURE__ */ r("div", { className: "text-xs text-foreground-subtle italic text-center py-8", children: t.length === 0 ? "No benchmark results yet." : "No entries match filters." })
11090
11090
  ] });
11091
11091
  }
11092
11092
  function ll({ entry: e, onDelete: t, onExport: n }) {