@camstack/addon-pipeline 1.2.69 → 1.2.71

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/audio-analyzer/index.js +1 -1
  2. package/dist/audio-analyzer/index.mjs +1 -1
  3. package/dist/detection-pipeline/index.js +32 -30
  4. package/dist/detection-pipeline/index.mjs +32 -30
  5. package/dist/{dist-tJF2BzWi.js → dist-CtOVWTCi.js} +586 -41
  6. package/dist/{dist-DGLqaonv.mjs → dist-D1Xk5Tji.mjs} +586 -41
  7. package/dist/{event-loop-stall-monitor-D9d2e49f.js → event-loop-stall-monitor-BJs7Yws7.js} +1 -1
  8. package/dist/{event-loop-stall-monitor-C6_VDupx.mjs → event-loop-stall-monitor-Cmbt664E.mjs} +1 -1
  9. package/dist/motion-wasm/index.js +1 -1
  10. package/dist/motion-wasm/index.mjs +1 -1
  11. package/dist/pipeline-runner/index.js +100 -30
  12. package/dist/pipeline-runner/index.mjs +100 -30
  13. package/dist/recorder/index.js +734 -104
  14. package/dist/recorder/index.mjs +734 -104
  15. package/dist/session-decode/decode-worker-child.js +483 -52
  16. package/dist/session-decode/decode-worker-child.mjs +483 -52
  17. package/dist/stream-broker/_stub.js +660 -556
  18. package/dist/stream-broker/{_virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-DCyQ7RKH.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-BWf4H4Nl.mjs} +3 -3
  19. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-Cu_kQpIy.mjs +26 -0
  20. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-CExO0piw.mjs +26 -0
  21. package/dist/stream-broker/{hostInit-DxqtIjAe.mjs → hostInit-DD5Z1U6p.mjs} +3 -3
  22. package/dist/stream-broker/index.js +501 -32
  23. package/dist/stream-broker/index.mjs +501 -32
  24. package/dist/stream-broker/remoteEntry.js +1 -1
  25. package/dist/{worker-protocol-D6tXz9Or.js → worker-protocol-DEV7g32b.js} +26 -19
  26. package/dist/{worker-protocol-DuftUFEI.mjs → worker-protocol-Dm6LQ9Ls.mjs} +26 -19
  27. package/package.json +1 -1
  28. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-ircnzt0s.mjs +0 -26
  29. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-DU7u9EJt.mjs +0 -26
@@ -1,15 +1,15 @@
1
- import { a as e, c as t, d as n, i as r, l as i, n as a, o, r as s, s as c, t as l, u } from "./_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-DU7u9EJt.mjs";
2
- import { a as d, i as f, n as p, o as m, r as h, t as g } from "./_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare__react__loadShare__.js-C9j-2lBe.mjs";
3
- import { n as _, r as v, t as y } from "./_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-XO0-Pyu6.mjs";
4
- import { n as b, t as x } from "./_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-BO7TIbJV.mjs";
5
- import { t as S } from "./_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-ircnzt0s.mjs";
1
+ import { a as e, c as t, d as n, f as r, i, l as a, n as o, o as s, p as c, r as l, s as u, t as d, u as f } from "./_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-CExO0piw.mjs";
2
+ import { a as p, i as m, n as h, o as g, r as _, t as v } from "./_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare__react__loadShare__.js-C9j-2lBe.mjs";
3
+ import { n as y, r as b, t as x } from "./_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-XO0-Pyu6.mjs";
4
+ import { t as S } from "./_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-Cu_kQpIy.mjs";
5
+ import { n as C, t as w } from "./_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-BO7TIbJV.mjs";
6
6
  //#region ../../node_modules/lucide-react/dist/esm/shared/src/utils.js
7
- var C = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), w = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), T = (e) => {
8
- let t = w(e);
7
+ var T = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), E = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), D = (e) => {
8
+ let t = E(e);
9
9
  return t.charAt(0).toUpperCase() + t.slice(1);
10
- }, E = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), D = (e) => {
10
+ }, O = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), k = (e) => {
11
11
  for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
12
- }, O = {
12
+ }, A = {
13
13
  xmlns: "http://www.w3.org/2000/svg",
14
14
  width: 24,
15
15
  height: 24,
@@ -19,34 +19,34 @@ var C = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), w = (e) =
19
19
  strokeWidth: 2,
20
20
  strokeLinecap: "round",
21
21
  strokeLinejoin: "round"
22
- }, k = p(({ color: e = "currentColor", size: t = 24, strokeWidth: n = 2, absoluteStrokeWidth: r, className: i = "", children: a, iconNode: o, ...s }, c) => g("svg", {
22
+ }, j = h(({ color: e = "currentColor", size: t = 24, strokeWidth: n = 2, absoluteStrokeWidth: r, className: i = "", children: a, iconNode: o, ...s }, c) => v("svg", {
23
23
  ref: c,
24
- ...O,
24
+ ...A,
25
25
  width: t,
26
26
  height: t,
27
27
  stroke: e,
28
28
  strokeWidth: r ? Number(n) * 24 / Number(t) : n,
29
- className: E("lucide", i),
30
- ...!a && !D(s) && { "aria-hidden": "true" },
29
+ className: O("lucide", i),
30
+ ...!a && !k(s) && { "aria-hidden": "true" },
31
31
  ...s
32
- }, [...o.map(([e, t]) => g(e, t)), ...Array.isArray(a) ? a : [a]])), A = (e, t) => {
33
- let n = p(({ className: n, ...r }, i) => g(k, {
32
+ }, [...o.map(([e, t]) => v(e, t)), ...Array.isArray(a) ? a : [a]])), M = (e, t) => {
33
+ let n = h(({ className: n, ...r }, i) => v(j, {
34
34
  ref: i,
35
35
  iconNode: t,
36
- className: E(`lucide-${C(T(e))}`, `lucide-${e}`, n),
36
+ className: O(`lucide-${T(D(e))}`, `lucide-${e}`, n),
37
37
  ...r
38
38
  }));
39
- return n.displayName = T(e), n;
40
- }, j = A("check", [["path", {
39
+ return n.displayName = D(e), n;
40
+ }, N = M("check", [["path", {
41
41
  d: "M20 6 9 17l-5-5",
42
42
  key: "1gmf2c"
43
- }]]), M = A("chevron-down", [["path", {
43
+ }]]), P = M("chevron-down", [["path", {
44
44
  d: "m6 9 6 6 6-6",
45
45
  key: "qrunsl"
46
- }]]), N = A("chevron-right", [["path", {
46
+ }]]), F = M("chevron-right", [["path", {
47
47
  d: "m9 18 6-6-6-6",
48
48
  key: "mthhwq"
49
- }]]), ee = A("circle-alert", [
49
+ }]]), ee = M("circle-alert", [
50
50
  ["circle", {
51
51
  cx: "12",
52
52
  cy: "12",
@@ -67,16 +67,16 @@ var C = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), w = (e) =
67
67
  y2: "16",
68
68
  key: "4dfq90"
69
69
  }]
70
- ]), te = A("loader-circle", [["path", {
70
+ ]), te = M("loader-circle", [["path", {
71
71
  d: "M21 12a9 9 0 1 1-6.219-8.56",
72
72
  key: "13zald"
73
- }]]), ne = A("plus", [["path", {
73
+ }]]), ne = M("plus", [["path", {
74
74
  d: "M5 12h14",
75
75
  key: "1ays0h"
76
76
  }], ["path", {
77
77
  d: "M12 5v14",
78
78
  key: "s699le"
79
- }]]), P = A("radio", [
79
+ }]]), I = M("radio", [
80
80
  ["path", {
81
81
  d: "M4.9 19.1C1 15.2 1 8.8 4.9 4.9",
82
82
  key: "1vaf9d"
@@ -99,7 +99,39 @@ var C = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), w = (e) =
99
99
  d: "M19.1 4.9C23 8.8 23 15.1 19.1 19",
100
100
  key: "10b0cb"
101
101
  }]
102
- ]), re = A("x", [["path", {
102
+ ]), re = M("volume-2", [
103
+ ["path", {
104
+ d: "M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",
105
+ key: "uqj9uw"
106
+ }],
107
+ ["path", {
108
+ d: "M16 9a5 5 0 0 1 0 6",
109
+ key: "1q6k2b"
110
+ }],
111
+ ["path", {
112
+ d: "M19.364 18.364a9 9 0 0 0 0-12.728",
113
+ key: "ijwkga"
114
+ }]
115
+ ]), ie = M("volume-x", [
116
+ ["path", {
117
+ d: "M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",
118
+ key: "uqj9uw"
119
+ }],
120
+ ["line", {
121
+ x1: "22",
122
+ x2: "16",
123
+ y1: "9",
124
+ y2: "15",
125
+ key: "1ewh16"
126
+ }],
127
+ ["line", {
128
+ x1: "16",
129
+ x2: "22",
130
+ y1: "9",
131
+ y2: "15",
132
+ key: "5ykzw1"
133
+ }]
134
+ ]), ae = M("x", [["path", {
103
135
  d: "M18 6 6 18",
104
136
  key: "1bl5f8"
105
137
  }], ["path", {
@@ -108,7 +140,7 @@ var C = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), w = (e) =
108
140
  }]]);
109
141
  //#endregion
110
142
  //#region src/stream-broker/widgets/GeometryBuilder.tsx
111
- function ie(e) {
143
+ function oe(e) {
112
144
  let t = [];
113
145
  if (e.crop && t.push(`crop=${e.crop.w}:${e.crop.h}:${e.crop.x}:${e.crop.y}`), e.targetAspect && e.width !== void 0 && e.height !== void 0) {
114
146
  let n = e.targetAspect.replace(":", "/");
@@ -116,7 +148,7 @@ function ie(e) {
116
148
  }
117
149
  return e.rotate === 90 ? t.push("transpose=1") : e.rotate === 270 ? t.push("transpose=2") : e.rotate === 180 && t.push("hflip", "vflip"), e.hflip && e.rotate !== 180 && t.push("hflip"), e.vflip && e.rotate !== 180 && t.push("vflip"), t.join(",");
118
150
  }
119
- function ae(e, t) {
151
+ function se(e, t) {
120
152
  let n = [];
121
153
  for (let t = 0; t < e.length; t++) {
122
154
  if (e[t] === "-vf") {
@@ -128,9 +160,9 @@ function ae(e, t) {
128
160
  }
129
161
  return t.length > 0 && n.push("-vf", t), n;
130
162
  }
131
- var F = "text-[11px] uppercase tracking-wider text-foreground-subtle font-medium";
132
- function oe({ outputArgs: e, onChange: t }) {
133
- let [n, r] = m(""), [i, a] = m("pad"), [o, s] = m("1920"), [c, l] = m("1080"), [u, d] = m(!1), [f, p] = m("0"), [h, g] = m("0"), [b, x] = m("0"), [S, C] = m("0"), [w, T] = m(0), [E, D] = m(!1), [O, k] = m(!1), A = ie((() => {
163
+ var L = "text-[11px] uppercase tracking-wider text-foreground-subtle font-medium";
164
+ function ce({ outputArgs: e, onChange: t }) {
165
+ let [n, r] = g(""), [i, a] = g("pad"), [o, s] = g("1920"), [c, l] = g("1080"), [u, d] = g(!1), [f, p] = g("0"), [m, h] = g("0"), [_, v] = g("0"), [S, C] = g("0"), [w, T] = g(0), [E, D] = g(!1), [O, k] = g(!1), A = oe((() => {
134
166
  let e = {
135
167
  rotate: w,
136
168
  hflip: E,
@@ -138,87 +170,87 @@ function oe({ outputArgs: e, onChange: t }) {
138
170
  };
139
171
  return n !== "" && (e.targetAspect = n, e.mode = i, e.width = Number(o), e.height = Number(c)), u && (e.crop = {
140
172
  x: Number(f),
141
- y: Number(h),
142
- w: Number(b),
173
+ y: Number(m),
174
+ w: Number(_),
143
175
  h: Number(S)
144
176
  }), e;
145
177
  })());
146
- return /* @__PURE__ */ v("div", {
178
+ return /* @__PURE__ */ b("div", {
147
179
  className: "space-y-2 rounded border border-border/50 bg-surface-2/30 px-3 py-2",
148
180
  children: [
149
- /* @__PURE__ */ v("div", {
181
+ /* @__PURE__ */ b("div", {
150
182
  className: "flex items-center justify-between",
151
- children: [/* @__PURE__ */ v("span", {
152
- className: F,
153
- children: ["Geometry / zoom", /* @__PURE__ */ _("span", {
183
+ children: [/* @__PURE__ */ b("span", {
184
+ className: L,
185
+ children: ["Geometry / zoom", /* @__PURE__ */ y("span", {
154
186
  className: "ml-2 text-[10px] normal-case text-foreground-subtle italic",
155
187
  children: "composes a single -vf into output args"
156
188
  })]
157
- }), /* @__PURE__ */ _("button", {
189
+ }), /* @__PURE__ */ y("button", {
158
190
  type: "button",
159
- onClick: () => t(ae(e, A)),
191
+ onClick: () => t(se(e, A)),
160
192
  className: "rounded-md border border-border bg-surface-hover px-2 py-0.5 text-[10px] font-medium text-foreground hover:bg-surface-hover/70 transition-colors",
161
193
  children: "Apply geometry"
162
194
  })]
163
195
  }),
164
- /* @__PURE__ */ v("div", {
196
+ /* @__PURE__ */ b("div", {
165
197
  className: "flex flex-wrap items-center gap-2",
166
198
  children: [
167
- /* @__PURE__ */ _("label", {
168
- className: F,
199
+ /* @__PURE__ */ y("label", {
200
+ className: L,
169
201
  htmlFor: "geom-aspect",
170
202
  children: "Aspect"
171
203
  }),
172
- /* @__PURE__ */ v("select", {
204
+ /* @__PURE__ */ b("select", {
173
205
  id: "geom-aspect",
174
206
  value: n,
175
207
  onChange: (e) => r(e.target.value),
176
208
  className: "rounded border border-border bg-surface-2 px-2 py-1 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-accent disabled:opacity-50 disabled:cursor-not-allowed appearance-none pr-6 min-w-[90px]",
177
209
  children: [
178
- /* @__PURE__ */ _("option", {
210
+ /* @__PURE__ */ y("option", {
179
211
  value: "",
180
212
  children: "none"
181
213
  }),
182
- /* @__PURE__ */ _("option", {
214
+ /* @__PURE__ */ y("option", {
183
215
  value: "16:9",
184
216
  children: "16:9"
185
217
  }),
186
- /* @__PURE__ */ _("option", {
218
+ /* @__PURE__ */ y("option", {
187
219
  value: "4:3",
188
220
  children: "4:3"
189
221
  }),
190
- /* @__PURE__ */ _("option", {
222
+ /* @__PURE__ */ y("option", {
191
223
  value: "1:1",
192
224
  children: "1:1"
193
225
  })
194
226
  ]
195
227
  }),
196
- n !== "" && /* @__PURE__ */ v(y, { children: [
197
- /* @__PURE__ */ v("select", {
228
+ n !== "" && /* @__PURE__ */ b(x, { children: [
229
+ /* @__PURE__ */ b("select", {
198
230
  "aria-label": "Aspect mode",
199
231
  value: i,
200
232
  onChange: (e) => a(e.target.value),
201
233
  className: "rounded border border-border bg-surface-2 px-2 py-1 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-accent disabled:opacity-50 disabled:cursor-not-allowed appearance-none pr-6 min-w-[80px]",
202
- children: [/* @__PURE__ */ _("option", {
234
+ children: [/* @__PURE__ */ y("option", {
203
235
  value: "pad",
204
236
  children: "pad"
205
- }), /* @__PURE__ */ _("option", {
237
+ }), /* @__PURE__ */ y("option", {
206
238
  value: "crop",
207
239
  children: "crop"
208
240
  })]
209
241
  }),
210
- /* @__PURE__ */ _("input", {
242
+ /* @__PURE__ */ y("input", {
211
243
  type: "number",
212
244
  "aria-label": "Aspect width",
213
245
  value: o,
214
246
  onChange: (e) => s(e.target.value),
215
247
  className: "rounded border border-border bg-surface-2 px-2 py-1 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-accent disabled:opacity-50 disabled:cursor-not-allowed w-20 text-right"
216
248
  }),
217
- /* @__PURE__ */ _("span", {
249
+ /* @__PURE__ */ y("span", {
218
250
  className: "text-[11px] text-foreground-subtle",
219
251
  children: "×"
220
252
  }),
221
- /* @__PURE__ */ _("input", {
253
+ /* @__PURE__ */ y("input", {
222
254
  type: "number",
223
255
  "aria-label": "Aspect height",
224
256
  value: c,
@@ -228,17 +260,17 @@ function oe({ outputArgs: e, onChange: t }) {
228
260
  ] })
229
261
  ]
230
262
  }),
231
- /* @__PURE__ */ v("div", {
263
+ /* @__PURE__ */ b("div", {
232
264
  className: "flex flex-wrap items-center gap-2",
233
- children: [/* @__PURE__ */ v("label", {
265
+ children: [/* @__PURE__ */ b("label", {
234
266
  className: "text-[11px] uppercase tracking-wider text-foreground-subtle font-medium inline-flex items-center gap-1",
235
- children: [/* @__PURE__ */ _("input", {
267
+ children: [/* @__PURE__ */ y("input", {
236
268
  type: "checkbox",
237
269
  checked: u,
238
270
  onChange: (e) => d(e.target.checked)
239
271
  }), "Crop / zoom"]
240
- }), u && /* @__PURE__ */ v(y, { children: [
241
- /* @__PURE__ */ _("input", {
272
+ }), u && /* @__PURE__ */ b(x, { children: [
273
+ /* @__PURE__ */ y("input", {
242
274
  type: "number",
243
275
  "aria-label": "Crop x",
244
276
  value: f,
@@ -246,23 +278,23 @@ function oe({ outputArgs: e, onChange: t }) {
246
278
  className: "rounded border border-border bg-surface-2 px-2 py-1 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-accent disabled:opacity-50 disabled:cursor-not-allowed w-16 text-right",
247
279
  placeholder: "x"
248
280
  }),
249
- /* @__PURE__ */ _("input", {
281
+ /* @__PURE__ */ y("input", {
250
282
  type: "number",
251
283
  "aria-label": "Crop y",
252
- value: h,
253
- onChange: (e) => g(e.target.value),
284
+ value: m,
285
+ onChange: (e) => h(e.target.value),
254
286
  className: "rounded border border-border bg-surface-2 px-2 py-1 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-accent disabled:opacity-50 disabled:cursor-not-allowed w-16 text-right",
255
287
  placeholder: "y"
256
288
  }),
257
- /* @__PURE__ */ _("input", {
289
+ /* @__PURE__ */ y("input", {
258
290
  type: "number",
259
291
  "aria-label": "Crop width",
260
- value: b,
261
- onChange: (e) => x(e.target.value),
292
+ value: _,
293
+ onChange: (e) => v(e.target.value),
262
294
  className: "rounded border border-border bg-surface-2 px-2 py-1 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-accent disabled:opacity-50 disabled:cursor-not-allowed w-20 text-right",
263
295
  placeholder: "w"
264
296
  }),
265
- /* @__PURE__ */ _("input", {
297
+ /* @__PURE__ */ y("input", {
266
298
  type: "number",
267
299
  "aria-label": "Crop height",
268
300
  value: S,
@@ -272,49 +304,49 @@ function oe({ outputArgs: e, onChange: t }) {
272
304
  })
273
305
  ] })]
274
306
  }),
275
- /* @__PURE__ */ v("div", {
307
+ /* @__PURE__ */ b("div", {
276
308
  className: "flex flex-wrap items-center gap-2",
277
309
  children: [
278
- /* @__PURE__ */ _("label", {
279
- className: F,
310
+ /* @__PURE__ */ y("label", {
311
+ className: L,
280
312
  htmlFor: "geom-rotate",
281
313
  children: "Rotate"
282
314
  }),
283
- /* @__PURE__ */ v("select", {
315
+ /* @__PURE__ */ b("select", {
284
316
  id: "geom-rotate",
285
317
  value: String(w),
286
318
  onChange: (e) => T(Number(e.target.value)),
287
319
  className: "rounded border border-border bg-surface-2 px-2 py-1 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-accent disabled:opacity-50 disabled:cursor-not-allowed appearance-none pr-6 min-w-[80px]",
288
320
  children: [
289
- /* @__PURE__ */ _("option", {
321
+ /* @__PURE__ */ y("option", {
290
322
  value: "0",
291
323
  children: "0°"
292
324
  }),
293
- /* @__PURE__ */ _("option", {
325
+ /* @__PURE__ */ y("option", {
294
326
  value: "90",
295
327
  children: "90°"
296
328
  }),
297
- /* @__PURE__ */ _("option", {
329
+ /* @__PURE__ */ y("option", {
298
330
  value: "180",
299
331
  children: "180°"
300
332
  }),
301
- /* @__PURE__ */ _("option", {
333
+ /* @__PURE__ */ y("option", {
302
334
  value: "270",
303
335
  children: "270°"
304
336
  })
305
337
  ]
306
338
  }),
307
- /* @__PURE__ */ v("label", {
339
+ /* @__PURE__ */ b("label", {
308
340
  className: "text-[11px] uppercase tracking-wider text-foreground-subtle font-medium inline-flex items-center gap-1",
309
- children: [/* @__PURE__ */ _("input", {
341
+ children: [/* @__PURE__ */ y("input", {
310
342
  type: "checkbox",
311
343
  checked: E,
312
344
  onChange: (e) => D(e.target.checked)
313
345
  }), "hflip"]
314
346
  }),
315
- /* @__PURE__ */ v("label", {
347
+ /* @__PURE__ */ b("label", {
316
348
  className: "text-[11px] uppercase tracking-wider text-foreground-subtle font-medium inline-flex items-center gap-1",
317
- children: [/* @__PURE__ */ _("input", {
349
+ children: [/* @__PURE__ */ y("input", {
318
350
  type: "checkbox",
319
351
  checked: O,
320
352
  onChange: (e) => k(e.target.checked)
@@ -322,9 +354,9 @@ function oe({ outputArgs: e, onChange: t }) {
322
354
  })
323
355
  ]
324
356
  }),
325
- /* @__PURE__ */ v("div", {
357
+ /* @__PURE__ */ b("div", {
326
358
  className: "font-mono text-[10px] text-foreground-subtle break-all",
327
- children: ["-vf ", A.length > 0 ? A : /* @__PURE__ */ _("span", {
359
+ children: ["-vf ", A.length > 0 ? A : /* @__PURE__ */ y("span", {
328
360
  className: "italic",
329
361
  children: "(empty)"
330
362
  })]
@@ -334,7 +366,7 @@ function oe({ outputArgs: e, onChange: t }) {
334
366
  }
335
367
  //#endregion
336
368
  //#region src/stream-broker/widgets/FfmpegParamsField.tsx
337
- var se = [
369
+ var le = [
338
370
  {
339
371
  group: "Demuxer",
340
372
  label: "-thread_queue_size 1024",
@@ -389,7 +421,7 @@ var se = [
389
421
  args: ["-fflags", "+genpts+igndts"],
390
422
  description: "Generate PTS + ignore DTS"
391
423
  }
392
- ], ce = [
424
+ ], ue = [
393
425
  {
394
426
  group: "Muxer",
395
427
  label: "-flush_packets 1",
@@ -480,31 +512,31 @@ var se = [
480
512
  args: ["-muxdelay", "0"],
481
513
  description: "No mux buffering delay"
482
514
  }
483
- ], le = {
515
+ ], de = {
484
516
  video: { codec: "copy" },
485
517
  audio: "passthrough"
486
- }, I = "w-full rounded border border-border bg-surface-2 px-2 py-1.5 text-[11px] font-mono text-foreground focus:outline-none focus:ring-1 focus:ring-accent disabled:opacity-50 read-only:opacity-60 min-h-[60px] resize-y", L = "flex items-center justify-between gap-3 py-1.5", R = "text-[11px] uppercase tracking-wider text-foreground-subtle font-medium", z = "rounded-lg border border-border bg-surface overflow-hidden", B = "border-b border-border px-3 py-1.5 flex items-center justify-between bg-surface-hover/30", V = "text-[11px] font-semibold text-foreground uppercase tracking-wider";
487
- function ue({ config: e, value: t, onSave: n, saveStatus: r }) {
488
- let [i, a] = m(!1), o = e.argsOnly === !0, s = t ?? le, [c, l] = m(() => (s.inputArgs ?? []).join("\n")), [u, f] = m(() => (s.outputArgs ?? []).join("\n")), p = d(s);
489
- p.current !== s && (p.current = s, l((s.inputArgs ?? []).join("\n")), f((s.outputArgs ?? []).join("\n")));
490
- let h = (e) => {
518
+ }, R = "w-full rounded border border-border bg-surface-2 px-2 py-1.5 text-[11px] font-mono text-foreground focus:outline-none focus:ring-1 focus:ring-accent disabled:opacity-50 read-only:opacity-60 min-h-[60px] resize-y", z = "flex items-center justify-between gap-3 py-1.5", B = "text-[11px] uppercase tracking-wider text-foreground-subtle font-medium", V = "rounded-lg border border-border bg-surface overflow-hidden", H = "border-b border-border px-3 py-1.5 flex items-center justify-between bg-surface-hover/30", U = "text-[11px] font-semibold text-foreground uppercase tracking-wider";
519
+ function fe({ config: e, value: t, onSave: n, saveStatus: r }) {
520
+ let [i, a] = g(!1), o = e.argsOnly === !0, s = t ?? de, [c, l] = g(() => (s.inputArgs ?? []).join("\n")), [u, d] = g(() => (s.outputArgs ?? []).join("\n")), f = p(s);
521
+ f.current !== s && (f.current = s, l((s.inputArgs ?? []).join("\n")), d((s.outputArgs ?? []).join("\n")));
522
+ let m = (e) => {
491
523
  n(e(s));
492
- }, g = (e) => h((t) => ({
524
+ }, h = (e) => m((t) => ({
493
525
  ...t,
494
526
  video: {
495
527
  ...t.video,
496
528
  codec: e
497
529
  }
498
- })), b = (e) => {
499
- !Number.isFinite(e) || e <= 0 || h((t) => ({
530
+ })), _ = (e) => {
531
+ !Number.isFinite(e) || e <= 0 || m((t) => ({
500
532
  ...t,
501
533
  video: {
502
534
  ...t.video,
503
535
  width: e
504
536
  }
505
537
  }));
506
- }, x = (e) => {
507
- !Number.isFinite(e) || e <= 0 || h((t) => ({
538
+ }, v = (e) => {
539
+ !Number.isFinite(e) || e <= 0 || m((t) => ({
508
540
  ...t,
509
541
  video: {
510
542
  ...t.video,
@@ -512,7 +544,7 @@ function ue({ config: e, value: t, onSave: n, saveStatus: r }) {
512
544
  }
513
545
  }));
514
546
  }, S = (e) => {
515
- !Number.isFinite(e) || e <= 0 || h((t) => ({
547
+ !Number.isFinite(e) || e <= 0 || m((t) => ({
516
548
  ...t,
517
549
  video: {
518
550
  ...t.video,
@@ -520,24 +552,24 @@ function ue({ config: e, value: t, onSave: n, saveStatus: r }) {
520
552
  }
521
553
  }));
522
554
  }, C = (e) => {
523
- !Number.isFinite(e) || e <= 0 || h((t) => ({
555
+ !Number.isFinite(e) || e <= 0 || m((t) => ({
524
556
  ...t,
525
557
  video: {
526
558
  ...t.video,
527
559
  bitrateKbps: e
528
560
  }
529
561
  }));
530
- }, w = () => h((e) => ({
562
+ }, w = () => m((e) => ({
531
563
  ...e,
532
564
  audio: "passthrough"
533
- })), T = (e) => h((t) => ({
565
+ })), T = (e) => m((t) => ({
534
566
  ...t,
535
567
  audio: typeof t.audio == "object" ? {
536
568
  ...t.audio,
537
569
  codec: e
538
570
  } : { codec: e }
539
571
  })), E = (e) => {
540
- !Number.isFinite(e) || e <= 0 || h((t) => ({
572
+ !Number.isFinite(e) || e <= 0 || m((t) => ({
541
573
  ...t,
542
574
  audio: typeof t.audio == "object" ? {
543
575
  ...t.audio,
@@ -547,10 +579,10 @@ function ue({ config: e, value: t, onSave: n, saveStatus: r }) {
547
579
  bitrateKbps: e
548
580
  }
549
581
  }));
550
- }, D = (e) => h((t) => ({
582
+ }, D = (e) => m((t) => ({
551
583
  ...t,
552
584
  inputArgs: e.split("\n").map((e) => e.trim()).filter((e) => e.length > 0)
553
- })), O = (e) => h((t) => ({
585
+ })), O = (e) => m((t) => ({
554
586
  ...t,
555
587
  outputArgs: e.split("\n").map((e) => e.trim()).filter((e) => e.length > 0)
556
588
  })), k = (e, t) => {
@@ -560,159 +592,159 @@ function ue({ config: e, value: t, onSave: n, saveStatus: r }) {
560
592
  l(e), D(e);
561
593
  } else {
562
594
  let e = u.length === 0 ? n : `${u}\n${n}`;
563
- f(e), O(e);
595
+ d(e), O(e);
564
596
  }
565
- }, A = /* @__PURE__ */ v("div", {
597
+ }, A = /* @__PURE__ */ b("div", {
566
598
  className: "space-y-1.5",
567
- children: [/* @__PURE__ */ v("div", {
599
+ children: [/* @__PURE__ */ b("div", {
568
600
  className: "flex items-center justify-between",
569
- children: [/* @__PURE__ */ v("label", {
601
+ children: [/* @__PURE__ */ b("label", {
570
602
  htmlFor: `${e.fieldKey}-input-args`,
571
- className: R,
572
- children: ["Input args", /* @__PURE__ */ _("span", {
603
+ className: B,
604
+ children: ["Input args", /* @__PURE__ */ y("span", {
573
605
  className: "ml-2 text-[10px] normal-case text-foreground-subtle italic",
574
606
  children: "one per line · inserted between globals and -i"
575
607
  })]
576
- }), /* @__PURE__ */ _(H, {
608
+ }), /* @__PURE__ */ y(W, {
577
609
  id: `${e.fieldKey}-input-picker`,
578
610
  disabled: !1,
579
- catalogue: se,
611
+ catalogue: le,
580
612
  onPick: (e) => k("input", e)
581
613
  })]
582
- }), /* @__PURE__ */ _("textarea", {
614
+ }), /* @__PURE__ */ y("textarea", {
583
615
  id: `${e.fieldKey}-input-args`,
584
616
  value: c,
585
617
  onChange: (e) => l(e.target.value),
586
618
  onBlur: (e) => D(e.target.value),
587
619
  placeholder: "-thread_queue_size 1024",
588
- className: I
620
+ className: R
589
621
  })]
590
- }), j = /* @__PURE__ */ v("div", {
622
+ }), j = /* @__PURE__ */ b("div", {
591
623
  className: "space-y-1.5",
592
- children: [/* @__PURE__ */ v("div", {
624
+ children: [/* @__PURE__ */ b("div", {
593
625
  className: "flex items-center justify-between",
594
- children: [/* @__PURE__ */ v("label", {
626
+ children: [/* @__PURE__ */ b("label", {
595
627
  htmlFor: `${e.fieldKey}-output-args`,
596
- className: R,
597
- children: ["Output args", /* @__PURE__ */ _("span", {
628
+ className: B,
629
+ children: ["Output args", /* @__PURE__ */ y("span", {
598
630
  className: "ml-2 text-[10px] normal-case text-foreground-subtle italic",
599
631
  children: "one per line · inserted before the final muxer"
600
632
  })]
601
- }), /* @__PURE__ */ _(H, {
633
+ }), /* @__PURE__ */ y(W, {
602
634
  id: `${e.fieldKey}-output-picker`,
603
635
  disabled: !1,
604
- catalogue: ce,
636
+ catalogue: ue,
605
637
  onPick: (e) => k("output", e)
606
638
  })]
607
- }), /* @__PURE__ */ _("textarea", {
639
+ }), /* @__PURE__ */ y("textarea", {
608
640
  id: `${e.fieldKey}-output-args`,
609
641
  value: u,
610
- onChange: (e) => f(e.target.value),
642
+ onChange: (e) => d(e.target.value),
611
643
  onBlur: (e) => O(e.target.value),
612
644
  placeholder: "-bsf:v h264_mp4toannexb",
613
- className: I
645
+ className: R
614
646
  })]
615
647
  });
616
- return /* @__PURE__ */ v("div", {
648
+ return /* @__PURE__ */ b("div", {
617
649
  className: "space-y-3",
618
650
  children: [
619
- r !== void 0 && /* @__PURE__ */ _("div", {
651
+ r !== void 0 && /* @__PURE__ */ y("div", {
620
652
  className: "flex items-center justify-end",
621
- children: /* @__PURE__ */ _(de, { status: r })
653
+ children: /* @__PURE__ */ y(pe, { status: r })
622
654
  }),
623
- e.sourceParams !== void 0 && /* @__PURE__ */ v("div", {
624
- className: z,
625
- children: [/* @__PURE__ */ v("div", {
626
- className: B,
627
- children: [/* @__PURE__ */ _("h3", {
628
- className: V,
655
+ e.sourceParams !== void 0 && /* @__PURE__ */ b("div", {
656
+ className: V,
657
+ children: [/* @__PURE__ */ b("div", {
658
+ className: H,
659
+ children: [/* @__PURE__ */ y("h3", {
660
+ className: U,
629
661
  children: "Source (probed)"
630
- }), /* @__PURE__ */ _("span", {
662
+ }), /* @__PURE__ */ y("span", {
631
663
  className: "text-[10px] text-foreground-subtle italic",
632
664
  children: "From the publisher"
633
665
  })]
634
- }), /* @__PURE__ */ _("div", {
666
+ }), /* @__PURE__ */ y("div", {
635
667
  className: "px-3 py-2 flex flex-wrap gap-1.5",
636
- children: /* @__PURE__ */ _(fe, { profile: e.sourceParams })
668
+ children: /* @__PURE__ */ y(me, { profile: e.sourceParams })
637
669
  })]
638
670
  }),
639
- !o && /* @__PURE__ */ _("div", {
671
+ !o && /* @__PURE__ */ y("div", {
640
672
  className: "@container",
641
- children: /* @__PURE__ */ v("div", {
673
+ children: /* @__PURE__ */ b("div", {
642
674
  className: "grid grid-cols-1 @[480px]:grid-cols-2 gap-3",
643
- children: [/* @__PURE__ */ v("div", {
644
- className: z,
645
- children: [/* @__PURE__ */ _("div", {
646
- className: B,
647
- children: /* @__PURE__ */ _("h3", {
648
- className: V,
675
+ children: [/* @__PURE__ */ b("div", {
676
+ className: V,
677
+ children: [/* @__PURE__ */ y("div", {
678
+ className: H,
679
+ children: /* @__PURE__ */ y("h3", {
680
+ className: U,
649
681
  children: "Video"
650
682
  })
651
- }), /* @__PURE__ */ v("div", {
683
+ }), /* @__PURE__ */ b("div", {
652
684
  className: "px-3 py-2 divide-y divide-border/30",
653
- children: [/* @__PURE__ */ v("div", {
654
- className: L,
655
- children: [/* @__PURE__ */ _("label", {
685
+ children: [/* @__PURE__ */ b("div", {
686
+ className: z,
687
+ children: [/* @__PURE__ */ y("label", {
656
688
  htmlFor: `${e.fieldKey}-video-codec`,
657
- className: R,
689
+ className: B,
658
690
  children: "Codec"
659
- }), /* @__PURE__ */ v("select", {
691
+ }), /* @__PURE__ */ b("select", {
660
692
  id: `${e.fieldKey}-video-codec`,
661
693
  value: s.video.codec,
662
- onChange: (e) => g(e.target.value),
694
+ onChange: (e) => h(e.target.value),
663
695
  className: "rounded border border-border bg-surface-2 px-2 py-1 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-accent disabled:opacity-50 disabled:cursor-not-allowed read-only:opacity-60 read-only:cursor-not-allowed appearance-none pr-6 min-w-[120px]",
664
696
  children: [
665
- /* @__PURE__ */ _("option", {
697
+ /* @__PURE__ */ y("option", {
666
698
  value: "h264",
667
699
  children: "h264"
668
700
  }),
669
- /* @__PURE__ */ _("option", {
701
+ /* @__PURE__ */ y("option", {
670
702
  value: "h265",
671
703
  children: "h265"
672
704
  }),
673
- /* @__PURE__ */ _("option", {
705
+ /* @__PURE__ */ y("option", {
674
706
  value: "copy",
675
707
  children: "copy (passthrough)"
676
708
  })
677
709
  ]
678
710
  })]
679
- }), s.video.codec !== "copy" && /* @__PURE__ */ v(y, { children: [
680
- /* @__PURE__ */ v("div", {
681
- className: L,
682
- children: [/* @__PURE__ */ _("label", {
711
+ }), s.video.codec !== "copy" && /* @__PURE__ */ b(x, { children: [
712
+ /* @__PURE__ */ b("div", {
713
+ className: z,
714
+ children: [/* @__PURE__ */ y("label", {
683
715
  htmlFor: `${e.fieldKey}-video-width`,
684
- className: R,
716
+ className: B,
685
717
  children: "Width"
686
- }), /* @__PURE__ */ _("input", {
718
+ }), /* @__PURE__ */ y("input", {
687
719
  id: `${e.fieldKey}-video-width`,
688
720
  type: "number",
689
721
  "aria-label": "Width",
690
722
  value: s.video.width ?? "",
691
- onChange: (e) => b(Number(e.target.value)),
723
+ onChange: (e) => _(Number(e.target.value)),
692
724
  className: "rounded border border-border bg-surface-2 px-2 py-1 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-accent disabled:opacity-50 disabled:cursor-not-allowed read-only:opacity-60 read-only:cursor-not-allowed w-24 text-right"
693
725
  })]
694
726
  }),
695
- /* @__PURE__ */ v("div", {
696
- className: L,
697
- children: [/* @__PURE__ */ _("label", {
727
+ /* @__PURE__ */ b("div", {
728
+ className: z,
729
+ children: [/* @__PURE__ */ y("label", {
698
730
  htmlFor: `${e.fieldKey}-video-height`,
699
- className: R,
731
+ className: B,
700
732
  children: "Height"
701
- }), /* @__PURE__ */ _("input", {
733
+ }), /* @__PURE__ */ y("input", {
702
734
  id: `${e.fieldKey}-video-height`,
703
735
  type: "number",
704
736
  value: s.video.height ?? "",
705
- onChange: (e) => x(Number(e.target.value)),
737
+ onChange: (e) => v(Number(e.target.value)),
706
738
  className: "rounded border border-border bg-surface-2 px-2 py-1 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-accent disabled:opacity-50 disabled:cursor-not-allowed read-only:opacity-60 read-only:cursor-not-allowed w-24 text-right"
707
739
  })]
708
740
  }),
709
- /* @__PURE__ */ v("div", {
710
- className: L,
711
- children: [/* @__PURE__ */ _("label", {
741
+ /* @__PURE__ */ b("div", {
742
+ className: z,
743
+ children: [/* @__PURE__ */ y("label", {
712
744
  htmlFor: `${e.fieldKey}-video-fps`,
713
- className: R,
745
+ className: B,
714
746
  children: "FPS"
715
- }), /* @__PURE__ */ _("input", {
747
+ }), /* @__PURE__ */ y("input", {
716
748
  id: `${e.fieldKey}-video-fps`,
717
749
  type: "number",
718
750
  value: s.video.fps ?? "",
@@ -720,13 +752,13 @@ function ue({ config: e, value: t, onSave: n, saveStatus: r }) {
720
752
  className: "rounded border border-border bg-surface-2 px-2 py-1 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-accent disabled:opacity-50 disabled:cursor-not-allowed read-only:opacity-60 read-only:cursor-not-allowed w-24 text-right"
721
753
  })]
722
754
  }),
723
- /* @__PURE__ */ v("div", {
724
- className: L,
725
- children: [/* @__PURE__ */ _("label", {
755
+ /* @__PURE__ */ b("div", {
756
+ className: z,
757
+ children: [/* @__PURE__ */ y("label", {
726
758
  htmlFor: `${e.fieldKey}-video-bitrate`,
727
- className: R,
759
+ className: B,
728
760
  children: "Bitrate (kbps)"
729
- }), /* @__PURE__ */ _("input", {
761
+ }), /* @__PURE__ */ y("input", {
730
762
  id: `${e.fieldKey}-video-bitrate`,
731
763
  type: "number",
732
764
  value: s.video.bitrateKbps ?? "",
@@ -736,72 +768,72 @@ function ue({ config: e, value: t, onSave: n, saveStatus: r }) {
736
768
  })
737
769
  ] })]
738
770
  })]
739
- }), /* @__PURE__ */ v("div", {
740
- className: z,
741
- children: [/* @__PURE__ */ _("div", {
742
- className: B,
743
- children: /* @__PURE__ */ _("h3", {
744
- className: V,
771
+ }), /* @__PURE__ */ b("div", {
772
+ className: V,
773
+ children: [/* @__PURE__ */ y("div", {
774
+ className: H,
775
+ children: /* @__PURE__ */ y("h3", {
776
+ className: U,
745
777
  children: "Audio"
746
778
  })
747
- }), /* @__PURE__ */ _("div", {
779
+ }), /* @__PURE__ */ y("div", {
748
780
  className: "px-3 py-2",
749
- children: s.audio === "passthrough" ? /* @__PURE__ */ v("div", {
781
+ children: s.audio === "passthrough" ? /* @__PURE__ */ b("div", {
750
782
  className: "flex items-center justify-between gap-3",
751
- children: [/* @__PURE__ */ _("span", {
783
+ children: [/* @__PURE__ */ y("span", {
752
784
  className: "text-[11px] text-foreground-subtle italic",
753
785
  children: "Source audio forwarded without re-encode."
754
- }), /* @__PURE__ */ _("button", {
786
+ }), /* @__PURE__ */ y("button", {
755
787
  type: "button",
756
788
  onClick: () => T("opus"),
757
789
  className: "rounded-md border border-border bg-surface-hover px-2 py-1 text-[11px] text-foreground hover:bg-surface-hover/70 transition-colors",
758
790
  children: "Switch to custom encode"
759
791
  })]
760
- }) : /* @__PURE__ */ v("div", {
792
+ }) : /* @__PURE__ */ b("div", {
761
793
  className: "divide-y divide-border/30",
762
794
  children: [
763
- /* @__PURE__ */ v("div", {
764
- className: L,
765
- children: [/* @__PURE__ */ _("label", {
795
+ /* @__PURE__ */ b("div", {
796
+ className: z,
797
+ children: [/* @__PURE__ */ y("label", {
766
798
  htmlFor: `${e.fieldKey}-audio-codec`,
767
- className: R,
799
+ className: B,
768
800
  children: "Codec"
769
- }), /* @__PURE__ */ v("select", {
801
+ }), /* @__PURE__ */ b("select", {
770
802
  id: `${e.fieldKey}-audio-codec`,
771
803
  value: s.audio.codec,
772
804
  onChange: (e) => T(e.target.value),
773
805
  className: "rounded border border-border bg-surface-2 px-2 py-1 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-accent disabled:opacity-50 disabled:cursor-not-allowed read-only:opacity-60 read-only:cursor-not-allowed appearance-none pr-6 min-w-[120px]",
774
806
  children: [
775
- /* @__PURE__ */ _("option", {
807
+ /* @__PURE__ */ y("option", {
776
808
  value: "opus",
777
809
  children: "opus"
778
810
  }),
779
- /* @__PURE__ */ _("option", {
811
+ /* @__PURE__ */ y("option", {
780
812
  value: "aac",
781
813
  children: "aac"
782
814
  }),
783
- /* @__PURE__ */ _("option", {
815
+ /* @__PURE__ */ y("option", {
784
816
  value: "pcmu",
785
817
  children: "pcmu"
786
818
  }),
787
- /* @__PURE__ */ _("option", {
819
+ /* @__PURE__ */ y("option", {
788
820
  value: "pcma",
789
821
  children: "pcma"
790
822
  }),
791
- /* @__PURE__ */ _("option", {
823
+ /* @__PURE__ */ y("option", {
792
824
  value: "copy",
793
825
  children: "copy (passthrough)"
794
826
  })
795
827
  ]
796
828
  })]
797
829
  }),
798
- /* @__PURE__ */ v("div", {
799
- className: L,
800
- children: [/* @__PURE__ */ _("label", {
830
+ /* @__PURE__ */ b("div", {
831
+ className: z,
832
+ children: [/* @__PURE__ */ y("label", {
801
833
  htmlFor: `${e.fieldKey}-audio-bitrate`,
802
- className: R,
834
+ className: B,
803
835
  children: "Bitrate (kbps)"
804
- }), /* @__PURE__ */ _("input", {
836
+ }), /* @__PURE__ */ y("input", {
805
837
  id: `${e.fieldKey}-audio-bitrate`,
806
838
  type: "number",
807
839
  value: s.audio.bitrateKbps ?? "",
@@ -809,9 +841,9 @@ function ue({ config: e, value: t, onSave: n, saveStatus: r }) {
809
841
  className: "rounded border border-border bg-surface-2 px-2 py-1 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-accent disabled:opacity-50 disabled:cursor-not-allowed read-only:opacity-60 read-only:cursor-not-allowed w-24 text-right"
810
842
  })]
811
843
  }),
812
- /* @__PURE__ */ _("div", {
844
+ /* @__PURE__ */ y("div", {
813
845
  className: "pt-2",
814
- children: /* @__PURE__ */ _("button", {
846
+ children: /* @__PURE__ */ y("button", {
815
847
  type: "button",
816
848
  onClick: w,
817
849
  className: "text-[11px] text-foreground-subtle hover:text-foreground underline-offset-2 hover:underline",
@@ -824,51 +856,51 @@ function ue({ config: e, value: t, onSave: n, saveStatus: r }) {
824
856
  })]
825
857
  })
826
858
  }),
827
- o ? /* @__PURE__ */ v(y, { children: [/* @__PURE__ */ v("div", {
828
- className: z,
829
- children: [/* @__PURE__ */ _("div", {
830
- className: B,
831
- children: /* @__PURE__ */ _("h3", {
832
- className: V,
859
+ o ? /* @__PURE__ */ b(x, { children: [/* @__PURE__ */ b("div", {
860
+ className: V,
861
+ children: [/* @__PURE__ */ y("div", {
862
+ className: H,
863
+ children: /* @__PURE__ */ y("h3", {
864
+ className: U,
833
865
  children: "Input args"
834
866
  })
835
- }), /* @__PURE__ */ _("div", {
867
+ }), /* @__PURE__ */ y("div", {
836
868
  className: "px-3 py-2",
837
869
  children: A
838
870
  })]
839
- }), /* @__PURE__ */ v("div", {
840
- className: z,
841
- children: [/* @__PURE__ */ _("div", {
842
- className: B,
843
- children: /* @__PURE__ */ _("h3", {
844
- className: V,
871
+ }), /* @__PURE__ */ b("div", {
872
+ className: V,
873
+ children: [/* @__PURE__ */ y("div", {
874
+ className: H,
875
+ children: /* @__PURE__ */ y("h3", {
876
+ className: U,
845
877
  children: "Output args"
846
878
  })
847
- }), /* @__PURE__ */ _("div", {
879
+ }), /* @__PURE__ */ y("div", {
848
880
  className: "px-3 py-2",
849
881
  children: j
850
882
  })]
851
- })] }) : /* @__PURE__ */ v("div", {
852
- className: z,
853
- children: [/* @__PURE__ */ v("button", {
883
+ })] }) : /* @__PURE__ */ b("div", {
884
+ className: V,
885
+ children: [/* @__PURE__ */ b("button", {
854
886
  type: "button",
855
887
  onClick: () => a((e) => !e),
856
888
  className: "w-full px-3 py-1.5 flex items-center justify-between bg-surface-hover/30 hover:bg-surface-hover transition-colors",
857
- children: [/* @__PURE__ */ v("span", {
889
+ children: [/* @__PURE__ */ b("span", {
858
890
  className: "inline-flex items-center gap-1.5 text-[11px] font-semibold text-foreground uppercase tracking-wider",
859
- children: [_(i ? M : N, { className: "h-3 w-3" }), "Advanced — raw ffmpeg args"]
860
- }), /* @__PURE__ */ v("span", {
891
+ children: [y(i ? P : F, { className: "h-3 w-3" }), "Advanced — raw ffmpeg args"]
892
+ }), /* @__PURE__ */ b("span", {
861
893
  className: "text-[10px] text-foreground-subtle italic",
862
894
  children: [(s.inputArgs?.length ?? 0) + (s.outputArgs?.length ?? 0), " args"]
863
895
  })]
864
- }), i && /* @__PURE__ */ v("div", {
896
+ }), i && /* @__PURE__ */ b("div", {
865
897
  className: "px-3 py-2 space-y-3 border-t border-border/50",
866
898
  children: [
867
899
  A,
868
- /* @__PURE__ */ _(oe, {
900
+ /* @__PURE__ */ y(ce, {
869
901
  outputArgs: s.outputArgs ?? [],
870
902
  onChange: (e) => {
871
- f(e.join("\n")), O(e.join("\n"));
903
+ d(e.join("\n")), O(e.join("\n"));
872
904
  }
873
905
  }),
874
906
  j
@@ -878,50 +910,50 @@ function ue({ config: e, value: t, onSave: n, saveStatus: r }) {
878
910
  ]
879
911
  });
880
912
  }
881
- function de({ status: e }) {
913
+ function pe({ status: e }) {
882
914
  let t = "inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px] font-medium border";
883
- return e === "saving" ? /* @__PURE__ */ v("span", {
915
+ return e === "saving" ? /* @__PURE__ */ b("span", {
884
916
  className: `${t} bg-accent/10 text-accent border-accent/30`,
885
- children: [/* @__PURE__ */ _(te, { className: "h-2.5 w-2.5 animate-spin" }), "Saving…"]
886
- }) : e === "saved" ? /* @__PURE__ */ v("span", {
917
+ children: [/* @__PURE__ */ y(te, { className: "h-2.5 w-2.5 animate-spin" }), "Saving…"]
918
+ }) : e === "saved" ? /* @__PURE__ */ b("span", {
887
919
  className: `${t} bg-success/10 text-success border-success/30`,
888
- children: [/* @__PURE__ */ _(j, { className: "h-2.5 w-2.5" }), "Saved"]
889
- }) : e === "error" ? /* @__PURE__ */ v("span", {
920
+ children: [/* @__PURE__ */ y(N, { className: "h-2.5 w-2.5" }), "Saved"]
921
+ }) : e === "error" ? /* @__PURE__ */ b("span", {
890
922
  className: `${t} bg-red-500/10 text-red-400 border-red-500/30`,
891
- children: [/* @__PURE__ */ _(ee, { className: "h-2.5 w-2.5" }), "Save failed"]
892
- }) : /* @__PURE__ */ _("span", {
923
+ children: [/* @__PURE__ */ y(ee, { className: "h-2.5 w-2.5" }), "Save failed"]
924
+ }) : /* @__PURE__ */ y("span", {
893
925
  className: `${t} bg-foreground-subtle/10 text-foreground-subtle border-border`,
894
926
  children: "Autosaves"
895
927
  });
896
928
  }
897
- function fe({ profile: e }) {
929
+ function me({ profile: e }) {
898
930
  let t = "inline-flex items-center gap-1 rounded-full bg-foreground-subtle/10 border border-border px-2 py-0.5 text-[11px] font-mono text-foreground-subtle", { video: n, audio: r } = e, i = n.width !== void 0 && n.height !== void 0 ? `${n.width}×${n.height}` : void 0;
899
- return /* @__PURE__ */ v(y, { children: [
900
- /* @__PURE__ */ v("span", {
931
+ return /* @__PURE__ */ b(x, { children: [
932
+ /* @__PURE__ */ b("span", {
901
933
  className: t,
902
- children: [/* @__PURE__ */ _("span", {
934
+ children: [/* @__PURE__ */ y("span", {
903
935
  className: "opacity-60",
904
936
  children: "codec"
905
937
  }), n.codec]
906
938
  }),
907
- i !== void 0 && /* @__PURE__ */ v("span", {
939
+ i !== void 0 && /* @__PURE__ */ b("span", {
908
940
  className: t,
909
- children: [/* @__PURE__ */ _("span", {
941
+ children: [/* @__PURE__ */ y("span", {
910
942
  className: "opacity-60",
911
943
  children: "res"
912
944
  }), i]
913
945
  }),
914
- n.fps !== void 0 && /* @__PURE__ */ v("span", {
946
+ n.fps !== void 0 && /* @__PURE__ */ b("span", {
915
947
  className: t,
916
- children: [/* @__PURE__ */ _("span", {
948
+ children: [/* @__PURE__ */ y("span", {
917
949
  className: "opacity-60",
918
950
  children: "fps"
919
951
  }), n.fps]
920
952
  }),
921
- n.bitrateKbps !== void 0 && /* @__PURE__ */ v("span", {
953
+ n.bitrateKbps !== void 0 && /* @__PURE__ */ b("span", {
922
954
  className: t,
923
955
  children: [
924
- /* @__PURE__ */ _("span", {
956
+ /* @__PURE__ */ y("span", {
925
957
  className: "opacity-60",
926
958
  children: "bitrate"
927
959
  }),
@@ -929,24 +961,24 @@ function fe({ profile: e }) {
929
961
  "k"
930
962
  ]
931
963
  }),
932
- r === "passthrough" ? /* @__PURE__ */ v("span", {
964
+ r === "passthrough" ? /* @__PURE__ */ b("span", {
933
965
  className: t,
934
- children: [/* @__PURE__ */ _("span", {
966
+ children: [/* @__PURE__ */ y("span", {
935
967
  className: "opacity-60",
936
968
  children: "audio"
937
969
  }), "passthrough"]
938
- }) : /* @__PURE__ */ v(y, { children: [
939
- /* @__PURE__ */ v("span", {
970
+ }) : /* @__PURE__ */ b(x, { children: [
971
+ /* @__PURE__ */ b("span", {
940
972
  className: t,
941
- children: [/* @__PURE__ */ _("span", {
973
+ children: [/* @__PURE__ */ y("span", {
942
974
  className: "opacity-60",
943
975
  children: "audio"
944
976
  }), r.codec]
945
977
  }),
946
- r.bitrateKbps !== void 0 && /* @__PURE__ */ v("span", {
978
+ r.bitrateKbps !== void 0 && /* @__PURE__ */ b("span", {
947
979
  className: t,
948
980
  children: [
949
- /* @__PURE__ */ _("span", {
981
+ /* @__PURE__ */ y("span", {
950
982
  className: "opacity-60",
951
983
  children: "a-bitrate"
952
984
  }),
@@ -954,10 +986,10 @@ function fe({ profile: e }) {
954
986
  "k"
955
987
  ]
956
988
  }),
957
- r.sampleRateHz !== void 0 && /* @__PURE__ */ v("span", {
989
+ r.sampleRateHz !== void 0 && /* @__PURE__ */ b("span", {
958
990
  className: t,
959
991
  children: [
960
- /* @__PURE__ */ _("span", {
992
+ /* @__PURE__ */ y("span", {
961
993
  className: "opacity-60",
962
994
  children: "a-sr"
963
995
  }),
@@ -965,9 +997,9 @@ function fe({ profile: e }) {
965
997
  "Hz"
966
998
  ]
967
999
  }),
968
- r.channels !== void 0 && /* @__PURE__ */ v("span", {
1000
+ r.channels !== void 0 && /* @__PURE__ */ b("span", {
969
1001
  className: t,
970
- children: [/* @__PURE__ */ _("span", {
1002
+ children: [/* @__PURE__ */ y("span", {
971
1003
  className: "opacity-60",
972
1004
  children: "a-ch"
973
1005
  }), r.channels]
@@ -975,8 +1007,8 @@ function fe({ profile: e }) {
975
1007
  ] })
976
1008
  ] });
977
1009
  }
978
- function pe(e) {
979
- let t = e.config ?? {}, n = c(), [r, i] = m(() => t.initialValue), a = h((r) => {
1010
+ function he(e) {
1011
+ let t = e.config ?? {}, n = a(), [r, i] = g(() => t.initialValue), o = _((r) => {
980
1012
  if (i(r), e.deviceId === void 0) return;
981
1013
  let a = t.writerCapName, o = t.writerAddonId, s = t.fieldKey;
982
1014
  if (a === void 0 || o === void 0 || s === void 0) {
@@ -997,28 +1029,28 @@ function pe(e) {
997
1029
  t.writerAddonId,
998
1030
  n
999
1031
  ]);
1000
- if (e.deviceId === void 0) return /* @__PURE__ */ _("div", {
1032
+ if (e.deviceId === void 0) return /* @__PURE__ */ y("div", {
1001
1033
  className: "rounded-lg border border-warning/30 bg-warning/10 px-3 py-2 text-xs text-warning",
1002
1034
  children: "ffmpeg-params: no deviceId in widget context — this widget only renders inside a device tab."
1003
1035
  });
1004
- let o = t.fieldKey;
1005
- if (o === void 0 || o.length === 0) return /* @__PURE__ */ _("div", {
1036
+ let s = t.fieldKey;
1037
+ if (s === void 0 || s.length === 0) return /* @__PURE__ */ y("div", {
1006
1038
  className: "rounded-lg border border-warning/30 bg-warning/10 px-3 py-2 text-xs text-warning",
1007
1039
  children: "ffmpeg-params: widgetConfig.fieldKey is required — fix the contribution builder."
1008
1040
  });
1009
- let s = n.isPending ? "saving" : n.isError ? "error" : n.isSuccess ? "saved" : "idle";
1010
- return /* @__PURE__ */ _(ue, {
1041
+ let c = n.isPending ? "saving" : n.isError ? "error" : n.isSuccess ? "saved" : "idle";
1042
+ return /* @__PURE__ */ y(fe, {
1011
1043
  config: {
1012
1044
  ...t,
1013
- fieldKey: o
1045
+ fieldKey: s
1014
1046
  },
1015
1047
  value: r,
1016
- onSave: a,
1017
- saveStatus: s
1048
+ onSave: o,
1049
+ saveStatus: c
1018
1050
  });
1019
1051
  }
1020
- function H({ id: e, disabled: t, catalogue: n, onPick: r }) {
1021
- let [i, a] = m(!1), o = f(() => {
1052
+ function W({ id: e, disabled: t, catalogue: n, onPick: r }) {
1053
+ let [i, a] = g(!1), o = m(() => {
1022
1054
  let e = /* @__PURE__ */ new Map();
1023
1055
  for (let t of n) {
1024
1056
  let n = e.get(t.group) ?? [];
@@ -1026,37 +1058,37 @@ function H({ id: e, disabled: t, catalogue: n, onPick: r }) {
1026
1058
  }
1027
1059
  return e;
1028
1060
  }, [n]);
1029
- return /* @__PURE__ */ v("div", {
1061
+ return /* @__PURE__ */ b("div", {
1030
1062
  className: "relative",
1031
- children: [/* @__PURE__ */ v("button", {
1063
+ children: [/* @__PURE__ */ b("button", {
1032
1064
  id: e,
1033
1065
  type: "button",
1034
1066
  disabled: t,
1035
1067
  onClick: () => a((e) => !e),
1036
1068
  className: "inline-flex items-center gap-1 rounded-md border border-border bg-surface-hover px-2 py-0.5 text-[10px] font-medium text-foreground-subtle hover:bg-surface-hover/70 disabled:opacity-40 disabled:cursor-not-allowed transition-colors",
1037
- children: [/* @__PURE__ */ _(ne, { className: "h-3 w-3" }), "Add flag…"]
1038
- }), i && !t && /* @__PURE__ */ v(y, { children: [/* @__PURE__ */ _("div", {
1069
+ children: [/* @__PURE__ */ y(ne, { className: "h-3 w-3" }), "Add flag…"]
1070
+ }), i && !t && /* @__PURE__ */ b(x, { children: [/* @__PURE__ */ y("div", {
1039
1071
  className: "fixed inset-0 z-40",
1040
1072
  onClick: () => a(!1),
1041
1073
  "aria-hidden": "true"
1042
- }), /* @__PURE__ */ _("div", {
1074
+ }), /* @__PURE__ */ y("div", {
1043
1075
  className: "absolute right-0 top-full z-50 mt-1 max-h-72 w-72 overflow-y-auto rounded-lg border border-border bg-surface shadow-lg",
1044
1076
  role: "menu",
1045
- children: Array.from(o.entries()).map(([e, t]) => /* @__PURE__ */ v("div", {
1077
+ children: Array.from(o.entries()).map(([e, t]) => /* @__PURE__ */ b("div", {
1046
1078
  className: "border-b border-border/30 last:border-b-0",
1047
- children: [/* @__PURE__ */ _("div", {
1079
+ children: [/* @__PURE__ */ y("div", {
1048
1080
  className: "sticky top-0 bg-surface-hover/80 backdrop-blur px-2 py-1 text-[9px] font-semibold uppercase tracking-wider text-foreground-subtle",
1049
1081
  children: e
1050
- }), t.map((e) => /* @__PURE__ */ v("button", {
1082
+ }), t.map((e) => /* @__PURE__ */ b("button", {
1051
1083
  type: "button",
1052
1084
  onClick: () => {
1053
1085
  r(e), a(!1);
1054
1086
  },
1055
1087
  className: "w-full text-left px-2 py-1.5 hover:bg-surface-hover transition-colors group",
1056
- children: [/* @__PURE__ */ _("div", {
1088
+ children: [/* @__PURE__ */ y("div", {
1057
1089
  className: "font-mono text-[11px] text-foreground",
1058
1090
  children: e.label
1059
- }), e.description !== void 0 && /* @__PURE__ */ _("div", {
1091
+ }), e.description !== void 0 && /* @__PURE__ */ y("div", {
1060
1092
  className: "text-[10px] text-foreground-subtle leading-snug mt-0.5",
1061
1093
  children: e.description
1062
1094
  })]
@@ -1066,37 +1098,62 @@ function H({ id: e, disabled: t, catalogue: n, onPick: r }) {
1066
1098
  });
1067
1099
  }
1068
1100
  //#endregion
1101
+ //#region src/stream-broker/widgets/broker-audio-switch.ts
1102
+ var ge = "Audio", _e = "This node distributes no audio for the camera — live subscribers and new recordings are silent. The camera itself keeps capturing sound.";
1103
+ function ve(e) {
1104
+ let t = e.sourceNodeId !== null && e.sourceNodeId !== "", n = t && e.muted !== null ? !e.muted : null, r = e.pendingOn ?? null;
1105
+ return {
1106
+ label: ge,
1107
+ on: n === null ? null : r ?? n,
1108
+ available: n !== null,
1109
+ costWhenOff: _e,
1110
+ nodeId: t ? e.sourceNodeId : null
1111
+ };
1112
+ }
1113
+ function ye(e, t) {
1114
+ return !e.available || e.on === null || e.nodeId === null ? null : {
1115
+ deviceId: t,
1116
+ muted: e.on,
1117
+ nodeId: e.nodeId
1118
+ };
1119
+ }
1120
+ //#endregion
1069
1121
  //#region src/stream-broker/widgets/format-ua.ts
1070
- var U = 24;
1071
- function me(e) {
1122
+ var G = 24;
1123
+ function be(e) {
1072
1124
  return /\bEdg\b|\bEdgA\b|\bEdgiOS\b|Edge\//.test(e) ? "Edge" : /\bOPR\b|Opera/.test(e) ? "Opera" : /Firefox\/|\bFxiOS\b/.test(e) ? "Firefox" : /Chrome\/|\bCriOS\b/.test(e) ? "Chrome" : /Safari\//.test(e) ? "Safari" : null;
1073
1125
  }
1074
- function he(e) {
1126
+ function xe(e) {
1075
1127
  return /iPhone|iPad|iPod|\biOS\b|CriOS|FxiOS/.test(e) ? "iOS" : /Mac OS X|Macintosh/.test(e) ? "macOS" : /Windows/.test(e) ? "Windows" : /Android/.test(e) ? "Android" : /Linux/.test(e) ? "Linux" : null;
1076
1128
  }
1077
- function W(e) {
1129
+ function K(e) {
1078
1130
  let t = e.trim();
1079
1131
  if (t.length === 0) return "";
1080
- let n = me(t), r = he(t);
1081
- return n && r ? `${n}/${r}` : n || r || (t.length > U ? `${t.slice(0, U)}…` : t);
1132
+ let n = be(t), r = xe(t);
1133
+ return n && r ? `${n}/${r}` : n || r || (t.length > G ? `${t.slice(0, G)}…` : t);
1082
1134
  }
1083
1135
  //#endregion
1084
1136
  //#region src/stream-broker/widgets/StreamBrokerPanel.tsx
1085
- function ge(e) {
1137
+ function Se(e) {
1138
+ if (typeof e != "object" || !e) return null;
1139
+ let t = { ...e }.muted;
1140
+ return typeof t == "boolean" ? t : null;
1141
+ }
1142
+ function Ce(e) {
1086
1143
  let t = Math.floor(e / 1e3);
1087
1144
  if (t < 60) return `${t}s`;
1088
1145
  let n = Math.floor(t / 60);
1089
1146
  return n < 60 ? `${n}m` : `${Math.floor(n / 60)}h ${n % 60}m`;
1090
1147
  }
1091
- var G = {
1148
+ var q = {
1092
1149
  high: "High",
1093
1150
  mid: "Mid",
1094
1151
  low: "Low"
1095
- }, K = [
1152
+ }, J = [
1096
1153
  "high",
1097
1154
  "mid",
1098
1155
  "low"
1099
- ], _e = {
1156
+ ], we = {
1100
1157
  alexa: "bg-blue-500/15 text-blue-400",
1101
1158
  homekit: "bg-purple-500/15 text-purple-400",
1102
1159
  "webrtc-browser": "bg-emerald-500/15 text-emerald-400",
@@ -1109,7 +1166,7 @@ var G = {
1109
1166
  snapshot: "bg-cyan-500/15 text-cyan-400",
1110
1167
  warmup: "bg-foreground-subtle/10 text-foreground-subtle",
1111
1168
  unknown: "bg-foreground-subtle/10 text-foreground-subtle"
1112
- }, q = {
1169
+ }, Y = {
1113
1170
  alexa: "ALEXA",
1114
1171
  homekit: "HOMEKIT",
1115
1172
  "webrtc-browser": "BROWSER",
@@ -1123,116 +1180,163 @@ var G = {
1123
1180
  warmup: "WARMUP",
1124
1181
  unknown: "—"
1125
1182
  };
1126
- function ve(e) {
1127
- return q[e] ?? e.toUpperCase().slice(0, 8);
1183
+ function Te(e) {
1184
+ return Y[e] ?? e.toUpperCase().slice(0, 8);
1128
1185
  }
1129
- function ye(e) {
1130
- return q[e] ?? e;
1186
+ function Ee(e) {
1187
+ return Y[e] ?? e;
1131
1188
  }
1132
- function be(e) {
1189
+ function De(e) {
1133
1190
  let t = e.config ?? {};
1134
- return e.deviceId === void 0 ? /* @__PURE__ */ _("div", {
1191
+ return e.deviceId === void 0 ? /* @__PURE__ */ y("div", {
1135
1192
  className: "rounded-lg border border-warning/30 bg-warning/10 px-3 py-2 text-xs text-warning",
1136
1193
  children: "StreamBrokerPanel requires a deviceId"
1137
- }) : /* @__PURE__ */ _(xe, {
1194
+ }) : /* @__PURE__ */ y(Oe, {
1138
1195
  deviceId: e.deviceId,
1139
1196
  title: t.title,
1140
1197
  variant: t.variant,
1141
1198
  hideEmpty: t.hideEmpty
1142
1199
  });
1143
1200
  }
1144
- function xe({ deviceId: e, title: a = "Stream Brokers", variant: s = "full", hideEmpty: c = !1 }) {
1145
- i(["streamBroker", "listAllProfileSlots"], [
1201
+ function Oe({ deviceId: r, title: i = "Stream Brokers", variant: a = "full", hideEmpty: s = !1 }) {
1202
+ n(["streamBroker", "listAllProfileSlots"], [
1146
1203
  "device.streams-registered",
1147
1204
  "device.streams-unregistered",
1148
1205
  "device.registered",
1149
1206
  "device.unregistered"
1150
1207
  ]);
1151
- let { data: l } = r(void 0, { staleTime: 3e4 }), u = (l ?? []).filter((t) => t.deviceId === e && t.sourceCamStreamId !== null).slice().toSorted((e, t) => K.indexOf(e.profile) - K.indexOf(t.profile)), d = t(o().trpcClient, e), { data: f } = x({
1208
+ let { data: l } = e(void 0, { staleTime: 3e4 }), d = (l ?? []).filter((e) => e.deviceId === r && e.sourceCamStreamId !== null).slice().toSorted((e, t) => J.indexOf(e.profile) - J.indexOf(t.profile)), p = f(t().trpcClient, r), { data: m } = w({
1152
1209
  queryKey: [
1153
1210
  "device",
1154
- e,
1211
+ r,
1155
1212
  "cameraStreams.getCameraStreams"
1156
1213
  ],
1157
- queryFn: () => d?.cameraStreams?.getCameraStreams({}) ?? [],
1158
- enabled: !!d,
1214
+ queryFn: () => p?.cameraStreams?.getCameraStreams({}) ?? [],
1215
+ enabled: !!p,
1159
1216
  staleTime: 3e4
1160
- }), p = /* @__PURE__ */ new Map();
1161
- for (let e of f ?? []) p.set(e.camStreamId, e);
1162
- let { data: m } = n({ deviceId: e }, { staleTime: 3e4 }), h = m?.assignment.sourceNodeId ?? null, g = new Set(u.map((e) => e.sourceCamStreamId).filter((e) => e !== null)), y = (f ?? []).filter((e) => !g.has(e.camStreamId)), b = u.length > 0, S = y.length > 0;
1163
- return c && !b && !S ? null : s === "compact" ? b ? /* @__PURE__ */ _("div", {
1217
+ }), h = /* @__PURE__ */ new Map();
1218
+ for (let e of m ?? []) h.set(e.camStreamId, e);
1219
+ let { data: v } = c({ deviceId: r }, { staleTime: 3e4 }), x = v?.assignment.sourceNodeId ?? null, S = C(), [T, E] = g(null), [D, O] = g(null), k = ve({
1220
+ muted: Se(o({
1221
+ deviceId: r,
1222
+ nodeId: x ?? void 0
1223
+ }, {
1224
+ enabled: x !== null,
1225
+ staleTime: 3e4
1226
+ }).data),
1227
+ sourceNodeId: x,
1228
+ pendingOn: T
1229
+ }), A = u({
1230
+ onError: (e) => {
1231
+ console.error("[StreamBrokerPanel] audio mute write failed — reverting", {
1232
+ tags: { deviceId: r },
1233
+ meta: {
1234
+ nodeId: x,
1235
+ error: e instanceof Error ? e.message : String(e)
1236
+ }
1237
+ }), E(null), O(e instanceof Error ? e.message : String(e)), S.invalidateQueries({ queryKey: [["streamBroker", "getDeviceAudioMute"]] });
1238
+ },
1239
+ onSuccess: () => {
1240
+ O(null), E(null), S.invalidateQueries({ queryKey: [["streamBroker"]] }), S.invalidateQueries({ queryKey: [["pipelineOrchestrator"]] });
1241
+ }
1242
+ }), j = _(() => {
1243
+ let e = ye(k, r);
1244
+ e !== null && (E(!e.muted), O(null), A.mutate(e));
1245
+ }, [
1246
+ k,
1247
+ r,
1248
+ A
1249
+ ]), M = new Set(d.map((e) => e.sourceCamStreamId).filter((e) => e !== null)), N = (m ?? []).filter((e) => !M.has(e.camStreamId)), P = d.length > 0, F = N.length > 0;
1250
+ return s && !P && !F ? null : a === "compact" ? P ? /* @__PURE__ */ y("div", {
1164
1251
  className: "divide-y divide-border/30",
1165
- children: u.map((e) => /* @__PURE__ */ _(Y, {
1252
+ children: d.map((e) => /* @__PURE__ */ y(je, {
1166
1253
  slot: e,
1167
- camStreams: p,
1254
+ camStreams: h,
1168
1255
  compact: !0
1169
1256
  }, e.brokerId))
1170
- }) : /* @__PURE__ */ _("div", {
1257
+ }) : /* @__PURE__ */ y("div", {
1171
1258
  className: "text-[11px] text-foreground-subtle italic px-2 py-1",
1172
1259
  children: "No active profile slots"
1173
- }) : /* @__PURE__ */ v("div", {
1260
+ }) : /* @__PURE__ */ b("div", {
1174
1261
  className: "rounded-lg border border-border bg-surface overflow-hidden",
1175
1262
  children: [
1176
- /* @__PURE__ */ v("div", {
1263
+ /* @__PURE__ */ b("div", {
1177
1264
  className: "border-b border-border px-4 py-2 flex flex-wrap items-center justify-between gap-x-2 gap-y-1",
1178
- children: [/* @__PURE__ */ _("h2", {
1265
+ children: [/* @__PURE__ */ y("h2", {
1179
1266
  className: "text-xs font-semibold text-foreground uppercase tracking-wider shrink-0",
1180
- children: a
1181
- }), /* @__PURE__ */ v("div", {
1267
+ children: i
1268
+ }), /* @__PURE__ */ b("div", {
1182
1269
  className: "flex items-center gap-1.5 min-w-0",
1183
- children: [h !== null && /* @__PURE__ */ v("span", {
1184
- title: `Cluster node dialing this camera's source: ${h}`,
1270
+ children: [x !== null && /* @__PURE__ */ b("span", {
1271
+ title: `Cluster node dialing this camera's source: ${x}`,
1185
1272
  className: "inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[10px] font-medium bg-accent/10 text-accent border border-accent/30 min-w-0 max-w-full",
1186
- children: [/* @__PURE__ */ _(P, { className: "h-2.5 w-2.5 shrink-0" }), /* @__PURE__ */ _("span", {
1273
+ children: [/* @__PURE__ */ y(I, { className: "h-2.5 w-2.5 shrink-0" }), /* @__PURE__ */ y("span", {
1187
1274
  className: "truncate",
1188
- children: h
1275
+ children: x
1189
1276
  })]
1190
- }), b && /* @__PURE__ */ v("span", {
1277
+ }), P && /* @__PURE__ */ b("span", {
1191
1278
  className: "inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[10px] font-medium bg-foreground-subtle/10 text-foreground-subtle border border-border shrink-0 whitespace-nowrap",
1192
- children: [u.length, " assigned"]
1279
+ children: [d.length, " assigned"]
1193
1280
  })]
1194
1281
  })]
1195
1282
  }),
1196
- b ? /* @__PURE__ */ _("div", {
1283
+ /* @__PURE__ */ b("div", {
1284
+ className: "border-b border-border px-4 py-2 flex items-center gap-3",
1285
+ children: [/* @__PURE__ */ b("button", {
1286
+ type: "button",
1287
+ role: "switch",
1288
+ "aria-label": k.label,
1289
+ "aria-checked": k.on === !0,
1290
+ disabled: !k.available || A.isPending,
1291
+ onClick: j,
1292
+ title: k.on === null ? "Audio distribution — unknown: the node that serves this camera did not answer." : k.on ? `Audio is distributed by ${k.nodeId ?? "this node"}. Muting it: ${k.costWhenOff}` : `Muted on ${k.nodeId ?? "this node"}. ${k.costWhenOff}`,
1293
+ className: `inline-flex items-center gap-1.5 rounded-lg border px-2 py-1 text-[11px] font-medium transition-colors disabled:cursor-not-allowed shrink-0 ${D === null ? k.on === null ? "border-dashed border-border text-foreground-subtle/50" : k.on === !1 ? "border-warning/40 text-warning hover:bg-warning/10" : "border-success/30 text-success hover:bg-success/10" : "border-danger/50 text-danger bg-danger/5"}`,
1294
+ children: [k.on === !1 ? /* @__PURE__ */ y(ie, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ y(re, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ y("span", { children: k.on === null ? "Audio unknown" : k.on ? "Audio on" : "Audio muted" })]
1295
+ }), /* @__PURE__ */ y("p", {
1296
+ className: "min-w-0 flex-1 text-[10px] leading-relaxed text-foreground-subtle",
1297
+ children: D === null ? k.on === null ? "The node that serves this camera did not answer, so its audio policy is unknown." : k.costWhenOff : `Write failed: ${D}`
1298
+ })]
1299
+ }),
1300
+ P ? /* @__PURE__ */ y("div", {
1197
1301
  className: "divide-y divide-border/30",
1198
- children: u.map((e) => /* @__PURE__ */ _(Y, {
1302
+ children: d.map((e) => /* @__PURE__ */ y(je, {
1199
1303
  slot: e,
1200
- camStreams: p,
1304
+ camStreams: h,
1201
1305
  compact: !1
1202
1306
  }, e.brokerId))
1203
- }) : /* @__PURE__ */ v("div", {
1307
+ }) : /* @__PURE__ */ b("div", {
1204
1308
  className: "px-4 py-6 flex flex-col items-center text-center text-foreground-subtle",
1205
- children: [/* @__PURE__ */ _(P, { className: "h-5 w-5 mb-2 opacity-30" }), /* @__PURE__ */ _("p", {
1309
+ children: [/* @__PURE__ */ y(I, { className: "h-5 w-5 mb-2 opacity-30" }), /* @__PURE__ */ y("p", {
1206
1310
  className: "text-xs",
1207
1311
  children: "No profile slots assigned for this device"
1208
1312
  })]
1209
1313
  }),
1210
- S && /* @__PURE__ */ _(Se, {
1211
- deviceId: e,
1212
- camStreamIds: y.map((e) => e.camStreamId),
1213
- camStreams: p
1314
+ F && /* @__PURE__ */ y(ke, {
1315
+ deviceId: r,
1316
+ camStreamIds: N.map((e) => e.camStreamId),
1317
+ camStreams: h
1214
1318
  })
1215
1319
  ]
1216
1320
  });
1217
1321
  }
1218
- function Se({ deviceId: e, camStreamIds: t, camStreams: n }) {
1219
- let [r, i] = m(!1);
1220
- return /* @__PURE__ */ v("div", {
1322
+ function ke({ deviceId: e, camStreamIds: t, camStreams: n }) {
1323
+ let [r, i] = g(!1);
1324
+ return /* @__PURE__ */ b("div", {
1221
1325
  className: "border-t border-border/50",
1222
- children: [/* @__PURE__ */ v("button", {
1326
+ children: [/* @__PURE__ */ b("button", {
1223
1327
  type: "button",
1224
1328
  onClick: () => i((e) => !e),
1225
1329
  className: "w-full px-4 py-1.5 flex items-center justify-between bg-surface-hover/30 hover:bg-surface-hover transition-colors",
1226
- children: [/* @__PURE__ */ v("span", {
1330
+ children: [/* @__PURE__ */ b("span", {
1227
1331
  className: "inline-flex items-center gap-1.5 text-[11px] uppercase tracking-wider text-foreground-subtle",
1228
- children: [_(r ? M : N, { className: "h-3 w-3" }), "Other active streams"]
1229
- }), /* @__PURE__ */ _("span", {
1332
+ children: [y(r ? P : F, { className: "h-3 w-3" }), "Other active streams"]
1333
+ }), /* @__PURE__ */ y("span", {
1230
1334
  className: "rounded-full px-2 py-0.5 text-[10px] font-medium bg-foreground-subtle/10 text-foreground-subtle border border-border",
1231
1335
  children: t.length
1232
1336
  })]
1233
- }), r && /* @__PURE__ */ _("div", {
1337
+ }), r && /* @__PURE__ */ y("div", {
1234
1338
  className: "divide-y divide-border/30",
1235
- children: t.map((t) => /* @__PURE__ */ _(Ce, {
1339
+ children: t.map((t) => /* @__PURE__ */ y(Ae, {
1236
1340
  deviceId: e,
1237
1341
  camStreamId: t,
1238
1342
  camStreams: n
@@ -1240,82 +1344,82 @@ function Se({ deviceId: e, camStreamIds: t, camStreams: n }) {
1240
1344
  })]
1241
1345
  });
1242
1346
  }
1243
- function Ce({ deviceId: e, camStreamId: t, camStreams: n }) {
1244
- let r = S(e, t), i = u("stream-broker.metrics-snapshot", (e) => e.brokerId === r)?.stats, a = n.get(t), o = i?.status === "streaming";
1245
- return /* @__PURE__ */ v("div", {
1347
+ function Ae({ deviceId: e, camStreamId: t, camStreams: n }) {
1348
+ let i = S(e, t), a = r("stream-broker.metrics-snapshot", (e) => e.brokerId === i)?.stats, o = n.get(t), s = a?.status === "streaming";
1349
+ return /* @__PURE__ */ b("div", {
1246
1350
  className: "px-4 py-2",
1247
- children: [/* @__PURE__ */ _("div", {
1351
+ children: [/* @__PURE__ */ y("div", {
1248
1352
  className: "flex items-center justify-between mb-1",
1249
- children: /* @__PURE__ */ v("div", {
1353
+ children: /* @__PURE__ */ b("div", {
1250
1354
  className: "flex items-center gap-1.5",
1251
1355
  children: [
1252
- /* @__PURE__ */ _("span", { className: `h-1.5 w-1.5 rounded-full ${o ? "bg-success" : "bg-foreground-subtle/40"}` }),
1253
- /* @__PURE__ */ _("span", {
1356
+ /* @__PURE__ */ y("span", { className: `h-1.5 w-1.5 rounded-full ${s ? "bg-success" : "bg-foreground-subtle/40"}` }),
1357
+ /* @__PURE__ */ y("span", {
1254
1358
  className: "text-[11px] font-medium text-foreground",
1255
- children: a?.label ?? t
1359
+ children: o?.label ?? t
1256
1360
  }),
1257
- a?.resolution && /* @__PURE__ */ v("span", {
1361
+ o?.resolution && /* @__PURE__ */ b("span", {
1258
1362
  className: "text-[10px] text-foreground-subtle",
1259
1363
  children: [
1260
- a.resolution.width,
1364
+ o.resolution.width,
1261
1365
  "×",
1262
- a.resolution.height
1366
+ o.resolution.height
1263
1367
  ]
1264
1368
  }),
1265
- /* @__PURE__ */ _("span", {
1266
- className: `text-[10px] ${o ? "text-success" : "text-foreground-subtle"}`,
1267
- children: i?.status ?? "idle"
1369
+ /* @__PURE__ */ y("span", {
1370
+ className: `text-[10px] ${s ? "text-success" : "text-foreground-subtle"}`,
1371
+ children: a?.status ?? "idle"
1268
1372
  })
1269
1373
  ]
1270
1374
  })
1271
- }), i && o && /* @__PURE__ */ v("div", {
1375
+ }), a && s && /* @__PURE__ */ b("div", {
1272
1376
  className: "flex flex-wrap gap-x-3 gap-y-1 text-[10px]",
1273
1377
  children: [
1274
- /* @__PURE__ */ v("span", {
1378
+ /* @__PURE__ */ b("span", {
1275
1379
  className: "inline-flex whitespace-nowrap gap-1",
1276
- children: [/* @__PURE__ */ _("span", {
1380
+ children: [/* @__PURE__ */ y("span", {
1277
1381
  className: "text-foreground-subtle",
1278
1382
  children: "FPS:"
1279
- }), /* @__PURE__ */ _("span", {
1383
+ }), /* @__PURE__ */ y("span", {
1280
1384
  className: "text-foreground",
1281
- children: i.inputFps.toFixed(1)
1385
+ children: a.inputFps.toFixed(1)
1282
1386
  })]
1283
1387
  }),
1284
- /* @__PURE__ */ v("span", {
1388
+ /* @__PURE__ */ b("span", {
1285
1389
  className: "inline-flex whitespace-nowrap gap-1",
1286
- children: [/* @__PURE__ */ _("span", {
1390
+ children: [/* @__PURE__ */ y("span", {
1287
1391
  className: "text-foreground-subtle",
1288
1392
  children: "Bitrate:"
1289
- }), /* @__PURE__ */ _("span", {
1393
+ }), /* @__PURE__ */ y("span", {
1290
1394
  className: "text-foreground",
1291
- children: i.bitrateKbps >= 1e3 ? `${(i.bitrateKbps / 1e3).toFixed(1)} Mbps` : `${i.bitrateKbps} kbps`
1395
+ children: a.bitrateKbps >= 1e3 ? `${(a.bitrateKbps / 1e3).toFixed(1)} Mbps` : `${a.bitrateKbps} kbps`
1292
1396
  })]
1293
1397
  }),
1294
- /* @__PURE__ */ v("span", {
1398
+ /* @__PURE__ */ b("span", {
1295
1399
  className: "inline-flex whitespace-nowrap gap-1",
1296
- children: [/* @__PURE__ */ _("span", {
1400
+ children: [/* @__PURE__ */ y("span", {
1297
1401
  className: "text-foreground-subtle",
1298
1402
  children: "Codec:"
1299
- }), /* @__PURE__ */ _("span", {
1403
+ }), /* @__PURE__ */ y("span", {
1300
1404
  className: "text-foreground",
1301
- children: i.codec?.toUpperCase() ?? "—"
1405
+ children: a.codec?.toUpperCase() ?? "—"
1302
1406
  })]
1303
1407
  }),
1304
- /* @__PURE__ */ v("span", {
1408
+ /* @__PURE__ */ b("span", {
1305
1409
  className: "inline-flex whitespace-nowrap gap-1",
1306
- children: [/* @__PURE__ */ _("span", {
1410
+ children: [/* @__PURE__ */ y("span", {
1307
1411
  className: "text-foreground-subtle",
1308
1412
  children: "Pkts:"
1309
- }), /* @__PURE__ */ _("span", {
1413
+ }), /* @__PURE__ */ y("span", {
1310
1414
  className: "text-foreground",
1311
- children: i.packetCount > 1e3 ? `${(i.packetCount / 1e3).toFixed(1)}k` : i.packetCount
1415
+ children: a.packetCount > 1e3 ? `${(a.packetCount / 1e3).toFixed(1)}k` : a.packetCount
1312
1416
  })]
1313
1417
  })
1314
1418
  ]
1315
1419
  })]
1316
1420
  });
1317
1421
  }
1318
- function J(e, t) {
1422
+ function X(e, t) {
1319
1423
  let n = (e) => {
1320
1424
  if (!e || typeof e != "object") return;
1321
1425
  let r = e;
@@ -1336,65 +1440,65 @@ function J(e, t) {
1336
1440
  if (t !== void 0) return t;
1337
1441
  }
1338
1442
  }
1339
- function Y({ slot: t, camStreams: n, compact: r }) {
1340
- let o = b(), c = u("stream-broker.metrics-snapshot", (e) => e.brokerId === t.brokerId)?.stats;
1341
- i(["streamBroker", "listClients"], ["stream-broker.metrics-snapshot"]);
1342
- let { data: d } = e({ brokerId: t.brokerId }, {
1443
+ function je({ slot: e, camStreams: t, compact: a }) {
1444
+ let o = C(), c = r("stream-broker.metrics-snapshot", (t) => t.brokerId === e.brokerId)?.stats;
1445
+ n(["streamBroker", "listClients"], ["stream-broker.metrics-snapshot"]);
1446
+ let { data: u } = s({ brokerId: e.brokerId }, {
1343
1447
  enabled: c?.status === "streaming",
1344
1448
  staleTime: 2e3
1345
- }), { data: f } = a({ deviceId: t.deviceId }, { staleTime: 15e3 }), p = t.sourceCamStreamId ?? t.profile, m = !!(J(f, `preBufferEnabled:${p}`) ?? !0), g = J(f, `preBufferSec:${p}`), x = l({ onSuccess: () => {
1449
+ }), { data: f } = l({ deviceId: e.deviceId }, { staleTime: 15e3 }), p = e.sourceCamStreamId ?? e.profile, m = !!(X(f, `preBufferEnabled:${p}`) ?? !0), h = X(f, `preBufferSec:${p}`), g = d({ onSuccess: () => {
1346
1450
  o.invalidateQueries({ queryKey: [["streamBroker", "getDeviceSettingsContribution"]] });
1347
- } }), S = (e) => {
1348
- x.mutate({
1349
- deviceId: t.deviceId,
1350
- patch: { [`preBufferEnabled:${p}`]: e }
1451
+ } }), v = (t) => {
1452
+ g.mutate({
1453
+ deviceId: e.deviceId,
1454
+ patch: { [`preBufferEnabled:${p}`]: t }
1351
1455
  });
1352
- }, C = s({ onSuccess: () => {
1456
+ }, S = i({ onSuccess: () => {
1353
1457
  o.invalidateQueries({ queryKey: [["streamBroker", "listClients"]] });
1354
- } }), w = h((e) => {
1355
- C.mutate({
1356
- brokerId: t.brokerId,
1357
- ...e
1458
+ } }), w = _((t) => {
1459
+ S.mutate({
1460
+ brokerId: e.brokerId,
1461
+ ...t
1358
1462
  });
1359
- }, [C, t.brokerId]), T = (t.sourceCamStreamId ? n.get(t.sourceCamStreamId) : void 0)?.resolution ?? t.resolution, E = c?.status === "streaming", D = T ? `${G[t.profile]} (${T.width}×${T.height})` : G[t.profile], O = c ? c.encodedSubscribers + c.decodedSubscribers + (c.rtspClients ?? 0) + (c.pipeClients ?? 0) : 0;
1360
- return /* @__PURE__ */ v("div", {
1361
- className: `@container ${r ? "px-3 py-1.5" : "px-4 py-2"}`,
1463
+ }, [S, e.brokerId]), T = (e.sourceCamStreamId ? t.get(e.sourceCamStreamId) : void 0)?.resolution ?? e.resolution, E = c?.status === "streaming", D = T ? `${q[e.profile]} (${T.width}×${T.height})` : q[e.profile], O = c ? c.encodedSubscribers + c.decodedSubscribers + (c.rtspClients ?? 0) + (c.pipeClients ?? 0) : 0;
1464
+ return /* @__PURE__ */ b("div", {
1465
+ className: `@container ${a ? "px-3 py-1.5" : "px-4 py-2"}`,
1362
1466
  style: { containerType: "inline-size" },
1363
1467
  children: [
1364
- /* @__PURE__ */ v("div", {
1468
+ /* @__PURE__ */ b("div", {
1365
1469
  className: "flex items-center justify-between gap-2 mb-1.5",
1366
- children: [/* @__PURE__ */ v("div", {
1470
+ children: [/* @__PURE__ */ b("div", {
1367
1471
  className: "flex items-center gap-1.5 min-w-0",
1368
1472
  children: [
1369
- /* @__PURE__ */ _("span", { className: `h-1.5 w-1.5 shrink-0 rounded-full ${E ? t.profile === "high" ? "bg-success" : t.profile === "mid" ? "bg-warning" : "bg-foreground-subtle" : "bg-foreground-subtle/40"}` }),
1370
- /* @__PURE__ */ _("span", {
1473
+ /* @__PURE__ */ y("span", { className: `h-1.5 w-1.5 shrink-0 rounded-full ${E ? e.profile === "high" ? "bg-success" : e.profile === "mid" ? "bg-warning" : "bg-foreground-subtle" : "bg-foreground-subtle/40"}` }),
1474
+ /* @__PURE__ */ y("span", {
1371
1475
  className: "text-[11px] font-medium text-foreground whitespace-nowrap shrink-0",
1372
1476
  children: D
1373
1477
  }),
1374
- /* @__PURE__ */ _("span", {
1478
+ /* @__PURE__ */ y("span", {
1375
1479
  className: `text-[10px] shrink-0 ${E ? "text-success" : "text-foreground-subtle"}`,
1376
1480
  children: c?.status ?? "loading"
1377
1481
  }),
1378
- t.sourceCamStreamId && /* @__PURE__ */ v("span", {
1482
+ e.sourceCamStreamId && /* @__PURE__ */ b("span", {
1379
1483
  className: "text-[10px] text-foreground-subtle truncate min-w-0",
1380
- title: t.sourceCamStreamId,
1381
- children: ["← ", t.sourceCamStreamId]
1484
+ title: e.sourceCamStreamId,
1485
+ children: ["← ", e.sourceCamStreamId]
1382
1486
  })
1383
1487
  ]
1384
- }), /* @__PURE__ */ _("span", {
1488
+ }), /* @__PURE__ */ y("span", {
1385
1489
  className: "text-[10px] text-foreground-subtle shrink-0 whitespace-nowrap",
1386
- children: c && c.uptimeMs > 0 ? ge(c.uptimeMs) : "—"
1490
+ children: c && c.uptimeMs > 0 ? Ce(c.uptimeMs) : "—"
1387
1491
  })]
1388
1492
  }),
1389
- c && E ? r ? /* @__PURE__ */ v("div", {
1493
+ c && E ? a ? /* @__PURE__ */ b("div", {
1390
1494
  className: "flex flex-wrap gap-x-3 gap-y-0.5 text-[10px]",
1391
1495
  children: [
1392
- /* @__PURE__ */ v("span", {
1496
+ /* @__PURE__ */ b("span", {
1393
1497
  className: "inline-flex whitespace-nowrap gap-1",
1394
- children: [/* @__PURE__ */ _("span", {
1498
+ children: [/* @__PURE__ */ y("span", {
1395
1499
  className: "text-foreground-subtle",
1396
1500
  children: "FPS:"
1397
- }), /* @__PURE__ */ v("span", {
1501
+ }), /* @__PURE__ */ b("span", {
1398
1502
  className: "text-foreground",
1399
1503
  children: [
1400
1504
  c.inputFps.toFixed(1),
@@ -1403,56 +1507,56 @@ function Y({ slot: t, camStreams: n, compact: r }) {
1403
1507
  ]
1404
1508
  })]
1405
1509
  }),
1406
- /* @__PURE__ */ v("span", {
1510
+ /* @__PURE__ */ b("span", {
1407
1511
  className: "inline-flex whitespace-nowrap gap-1",
1408
- children: [/* @__PURE__ */ _("span", {
1512
+ children: [/* @__PURE__ */ y("span", {
1409
1513
  className: "text-foreground-subtle",
1410
1514
  children: "Bitrate:"
1411
- }), /* @__PURE__ */ _("span", {
1515
+ }), /* @__PURE__ */ y("span", {
1412
1516
  className: "text-foreground",
1413
1517
  children: c.bitrateKbps >= 1e3 ? `${(c.bitrateKbps / 1e3).toFixed(1)} Mbps` : `${c.bitrateKbps} kbps`
1414
1518
  })]
1415
1519
  }),
1416
- /* @__PURE__ */ v("span", {
1520
+ /* @__PURE__ */ b("span", {
1417
1521
  className: "inline-flex whitespace-nowrap gap-1",
1418
- children: [/* @__PURE__ */ _("span", {
1522
+ children: [/* @__PURE__ */ y("span", {
1419
1523
  className: "text-foreground-subtle",
1420
1524
  children: "Codec:"
1421
- }), /* @__PURE__ */ _("span", {
1525
+ }), /* @__PURE__ */ y("span", {
1422
1526
  className: "text-foreground",
1423
1527
  children: c.codec?.toUpperCase() ?? "—"
1424
1528
  })]
1425
1529
  }),
1426
- /* @__PURE__ */ v("span", {
1530
+ /* @__PURE__ */ b("span", {
1427
1531
  className: "inline-flex items-center whitespace-nowrap gap-1",
1428
1532
  children: [
1429
- /* @__PURE__ */ _("span", {
1533
+ /* @__PURE__ */ y("span", {
1430
1534
  className: "text-foreground-subtle",
1431
1535
  children: "Clients:"
1432
1536
  }),
1433
- /* @__PURE__ */ _("span", {
1537
+ /* @__PURE__ */ y("span", {
1434
1538
  className: "text-foreground font-semibold",
1435
1539
  children: O
1436
1540
  }),
1437
- /* @__PURE__ */ _("span", {
1541
+ /* @__PURE__ */ y("span", {
1438
1542
  className: "text-foreground-subtle/70",
1439
1543
  children: "("
1440
1544
  }),
1441
- /* @__PURE__ */ _(Oe, {
1545
+ /* @__PURE__ */ y(Le, {
1442
1546
  count: c.encodedSubscribers + c.decodedSubscribers,
1443
- clients: d,
1547
+ clients: u,
1444
1548
  onKill: w
1445
1549
  }),
1446
- /* @__PURE__ */ _("span", {
1550
+ /* @__PURE__ */ y("span", {
1447
1551
  className: "text-foreground-subtle/70",
1448
1552
  children: "·"
1449
1553
  }),
1450
- /* @__PURE__ */ _(Ae, {
1554
+ /* @__PURE__ */ y(ze, {
1451
1555
  count: c.rtspClients ?? 0,
1452
- clients: d,
1556
+ clients: u,
1453
1557
  onKill: w
1454
1558
  }),
1455
- /* @__PURE__ */ v("span", {
1559
+ /* @__PURE__ */ b("span", {
1456
1560
  className: "text-foreground-subtle/70",
1457
1561
  children: [
1458
1562
  "· pipe ",
@@ -1463,165 +1567,165 @@ function Y({ slot: t, camStreams: n, compact: r }) {
1463
1567
  ]
1464
1568
  })
1465
1569
  ]
1466
- }) : /* @__PURE__ */ v(y, { children: [/* @__PURE__ */ v("div", {
1570
+ }) : /* @__PURE__ */ b(x, { children: [/* @__PURE__ */ b("div", {
1467
1571
  className: "flex flex-wrap gap-x-3 gap-y-1 text-[10px]",
1468
1572
  children: [
1469
- /* @__PURE__ */ v("span", {
1573
+ /* @__PURE__ */ b("span", {
1470
1574
  className: "inline-flex whitespace-nowrap gap-1",
1471
- children: [/* @__PURE__ */ _("span", {
1575
+ children: [/* @__PURE__ */ y("span", {
1472
1576
  className: "text-foreground-subtle",
1473
1577
  children: "In:"
1474
- }), /* @__PURE__ */ v("span", {
1578
+ }), /* @__PURE__ */ b("span", {
1475
1579
  className: "text-foreground",
1476
1580
  children: [c.inputFps.toFixed(1), " fps"]
1477
1581
  })]
1478
1582
  }),
1479
- /* @__PURE__ */ v("span", {
1583
+ /* @__PURE__ */ b("span", {
1480
1584
  className: "inline-flex whitespace-nowrap gap-1",
1481
- children: [/* @__PURE__ */ _("span", {
1585
+ children: [/* @__PURE__ */ y("span", {
1482
1586
  className: "text-foreground-subtle",
1483
1587
  children: "Dec:"
1484
- }), /* @__PURE__ */ v("span", {
1588
+ }), /* @__PURE__ */ b("span", {
1485
1589
  className: "text-foreground",
1486
1590
  children: [c.decodeFps.toFixed(1), " fps"]
1487
1591
  })]
1488
1592
  }),
1489
- /* @__PURE__ */ v("span", {
1593
+ /* @__PURE__ */ b("span", {
1490
1594
  className: "inline-flex whitespace-nowrap gap-1",
1491
- children: [/* @__PURE__ */ _("span", {
1595
+ children: [/* @__PURE__ */ y("span", {
1492
1596
  className: "text-foreground-subtle",
1493
1597
  children: "Bitrate:"
1494
- }), /* @__PURE__ */ _("span", {
1598
+ }), /* @__PURE__ */ y("span", {
1495
1599
  className: "text-foreground",
1496
1600
  children: c.bitrateKbps >= 1e3 ? `${(c.bitrateKbps / 1e3).toFixed(1)} Mbps` : `${c.bitrateKbps} kbps`
1497
1601
  })]
1498
1602
  }),
1499
- /* @__PURE__ */ v("span", {
1603
+ /* @__PURE__ */ b("span", {
1500
1604
  className: "hidden @[480px]:inline-flex whitespace-nowrap gap-1",
1501
- children: [/* @__PURE__ */ _("span", {
1605
+ children: [/* @__PURE__ */ y("span", {
1502
1606
  className: "text-foreground-subtle",
1503
1607
  children: "IDR:"
1504
- }), /* @__PURE__ */ _("span", {
1608
+ }), /* @__PURE__ */ y("span", {
1505
1609
  className: "text-foreground",
1506
1610
  children: c.idrIntervalMs > 0 ? `${(c.idrIntervalMs / 1e3).toFixed(1)}s` : "—"
1507
1611
  })]
1508
1612
  }),
1509
- /* @__PURE__ */ v("span", {
1613
+ /* @__PURE__ */ b("span", {
1510
1614
  className: "inline-flex whitespace-nowrap gap-1",
1511
- children: [/* @__PURE__ */ _("span", {
1615
+ children: [/* @__PURE__ */ y("span", {
1512
1616
  className: "text-foreground-subtle",
1513
1617
  children: "Codec:"
1514
- }), /* @__PURE__ */ _("span", {
1618
+ }), /* @__PURE__ */ y("span", {
1515
1619
  className: "text-foreground",
1516
1620
  children: c.codec?.toUpperCase() ?? "—"
1517
1621
  })]
1518
1622
  }),
1519
- /* @__PURE__ */ v("span", {
1623
+ /* @__PURE__ */ b("span", {
1520
1624
  className: "hidden @[480px]:inline-flex whitespace-nowrap gap-1 max-w-full overflow-hidden",
1521
- children: [/* @__PURE__ */ _("span", {
1625
+ children: [/* @__PURE__ */ y("span", {
1522
1626
  className: "text-foreground-subtle",
1523
1627
  children: "Decoder:"
1524
- }), /* @__PURE__ */ _("span", {
1628
+ }), /* @__PURE__ */ y("span", {
1525
1629
  className: "text-foreground font-mono truncate",
1526
- children: c.decoderNodeId ?? /* @__PURE__ */ _("span", {
1630
+ children: c.decoderNodeId ?? /* @__PURE__ */ y("span", {
1527
1631
  className: "text-foreground-subtle italic",
1528
1632
  children: "deferred"
1529
1633
  })
1530
1634
  })]
1531
1635
  }),
1532
- /* @__PURE__ */ v("span", {
1636
+ /* @__PURE__ */ b("span", {
1533
1637
  className: "hidden @[640px]:inline-flex whitespace-nowrap gap-1",
1534
- children: [/* @__PURE__ */ _("span", {
1638
+ children: [/* @__PURE__ */ y("span", {
1535
1639
  className: "text-foreground-subtle",
1536
1640
  children: "Pipe:"
1537
- }), /* @__PURE__ */ _("span", {
1641
+ }), /* @__PURE__ */ y("span", {
1538
1642
  className: "text-foreground",
1539
1643
  children: c.pipeClients ?? 0
1540
1644
  })]
1541
1645
  }),
1542
- /* @__PURE__ */ v("span", {
1646
+ /* @__PURE__ */ b("span", {
1543
1647
  className: "hidden @[640px]:inline-flex whitespace-nowrap gap-1",
1544
- children: [/* @__PURE__ */ _("span", {
1648
+ children: [/* @__PURE__ */ y("span", {
1545
1649
  className: "text-foreground-subtle",
1546
1650
  children: "Packets:"
1547
- }), /* @__PURE__ */ _("span", {
1651
+ }), /* @__PURE__ */ y("span", {
1548
1652
  className: "text-foreground",
1549
1653
  children: c.packetCount > 1e3 ? `${(c.packetCount / 1e3).toFixed(1)}k` : c.packetCount
1550
1654
  })]
1551
1655
  }),
1552
- /* @__PURE__ */ v("span", {
1656
+ /* @__PURE__ */ b("span", {
1553
1657
  className: "hidden @[640px]:inline-flex whitespace-nowrap gap-1",
1554
- children: [/* @__PURE__ */ _("span", {
1658
+ children: [/* @__PURE__ */ y("span", {
1555
1659
  className: "text-foreground-subtle",
1556
1660
  children: "Data:"
1557
- }), /* @__PURE__ */ _("span", {
1661
+ }), /* @__PURE__ */ y("span", {
1558
1662
  className: "text-foreground",
1559
1663
  children: c.totalBytes > 1048576 ? `${(c.totalBytes / 1048576).toFixed(1)} MB` : `${(c.totalBytes / 1024).toFixed(0)} KB`
1560
1664
  })]
1561
1665
  }),
1562
- c.audio && /* @__PURE__ */ v("div", {
1666
+ c.audio && /* @__PURE__ */ b("div", {
1563
1667
  className: "basis-full flex flex-wrap items-center gap-x-1.5 gap-y-0.5",
1564
1668
  children: [
1565
- /* @__PURE__ */ _("span", {
1669
+ /* @__PURE__ */ y("span", {
1566
1670
  className: "text-foreground-subtle whitespace-nowrap",
1567
1671
  children: "Audio:"
1568
1672
  }),
1569
- /* @__PURE__ */ v("span", {
1673
+ /* @__PURE__ */ b("span", {
1570
1674
  className: "inline-flex whitespace-nowrap items-center gap-1.5",
1571
1675
  children: [
1572
- /* @__PURE__ */ _("span", {
1676
+ /* @__PURE__ */ y("span", {
1573
1677
  className: "text-foreground",
1574
1678
  children: c.audio.codec.toUpperCase()
1575
1679
  }),
1576
- /* @__PURE__ */ _("span", {
1680
+ /* @__PURE__ */ y("span", {
1577
1681
  className: "text-foreground-subtle",
1578
1682
  children: "·"
1579
1683
  }),
1580
- /* @__PURE__ */ _("span", {
1684
+ /* @__PURE__ */ y("span", {
1581
1685
  className: "text-foreground",
1582
1686
  children: c.audio.sampleRate >= 1e3 ? `${(c.audio.sampleRate / 1e3).toFixed(c.audio.sampleRate % 1e3 == 0 ? 0 : 1)}kHz` : `${c.audio.sampleRate}Hz`
1583
1687
  }),
1584
- /* @__PURE__ */ _("span", {
1688
+ /* @__PURE__ */ y("span", {
1585
1689
  className: "text-foreground-subtle",
1586
1690
  children: "·"
1587
1691
  }),
1588
- /* @__PURE__ */ _("span", {
1692
+ /* @__PURE__ */ y("span", {
1589
1693
  className: "text-foreground",
1590
1694
  children: c.audio.channels === 1 ? "mono" : c.audio.channels === 2 ? "stereo" : `${c.audio.channels}ch`
1591
1695
  })
1592
1696
  ]
1593
1697
  }),
1594
- /* @__PURE__ */ _("span", {
1698
+ /* @__PURE__ */ y("span", {
1595
1699
  className: `px-1 py-px rounded text-[8px] font-medium whitespace-nowrap ${c.audio.supported ? "bg-success/15 text-success" : "bg-amber-500/15 text-amber-500"}`,
1596
1700
  children: c.audio.supported ? "decoded" : "no decoder"
1597
1701
  })
1598
1702
  ]
1599
1703
  })
1600
1704
  ]
1601
- }), /* @__PURE__ */ _(De, {
1602
- clients: d,
1705
+ }), /* @__PURE__ */ y(Ie, {
1706
+ clients: u,
1603
1707
  encodedCount: c.encodedSubscribers,
1604
1708
  onKill: w
1605
- })] }) : /* @__PURE__ */ _("p", {
1709
+ })] }) : /* @__PURE__ */ y("p", {
1606
1710
  className: "text-[10px] text-foreground-subtle italic",
1607
1711
  children: "No demand — stream suspended"
1608
1712
  }),
1609
- /* @__PURE__ */ v("div", {
1713
+ /* @__PURE__ */ b("div", {
1610
1714
  className: "mt-1.5 flex items-center gap-1.5 text-[10px]",
1611
1715
  children: [
1612
- /* @__PURE__ */ _("span", {
1716
+ /* @__PURE__ */ y("span", {
1613
1717
  className: "text-foreground-subtle",
1614
1718
  children: "Buffer:"
1615
1719
  }),
1616
- /* @__PURE__ */ _(ke, {
1720
+ /* @__PURE__ */ y(Re, {
1617
1721
  enabled: m,
1618
- onToggle: (e) => S(e),
1619
- disabled: x.isPending
1722
+ onToggle: (e) => v(e),
1723
+ disabled: g.isPending
1620
1724
  }),
1621
- /* @__PURE__ */ v("span", {
1725
+ /* @__PURE__ */ b("span", {
1622
1726
  className: "text-foreground",
1623
1727
  children: [
1624
- g ?? c?.preBufferSec ?? 0,
1728
+ h ?? c?.preBufferSec ?? 0,
1625
1729
  "s",
1626
1730
  c && E ? ` (${c.preBufferPackets}p)` : ""
1627
1731
  ]
@@ -1631,27 +1735,27 @@ function Y({ slot: t, camStreams: n, compact: r }) {
1631
1735
  ]
1632
1736
  });
1633
1737
  }
1634
- var we = 280, Te = 120;
1635
- function X({ trigger: e, content: t, widthClass: n }) {
1636
- let r = d(null), i = d(null), [a, o] = m(!1), [s, c] = m(!1), l = h(() => {
1738
+ var Me = 280, Ne = 120;
1739
+ function Pe({ trigger: e, content: t, widthClass: n }) {
1740
+ let r = p(null), i = p(null), [a, o] = g(!1), [s, c] = g(!1), l = _(() => {
1637
1741
  i.current &&= (clearTimeout(i.current), null);
1638
- }, []), u = h(() => {
1639
- l(), i.current = setTimeout(() => o(!1), Te);
1742
+ }, []), u = _(() => {
1743
+ l(), i.current = setTimeout(() => o(!1), Ne);
1640
1744
  }, [l]);
1641
- return /* @__PURE__ */ v("span", {
1745
+ return /* @__PURE__ */ b("span", {
1642
1746
  ref: r,
1643
1747
  className: "relative inline-block",
1644
- onMouseEnter: h(() => {
1748
+ onMouseEnter: _(() => {
1645
1749
  l();
1646
1750
  let e = r.current;
1647
1751
  if (e) {
1648
1752
  let t = e.getBoundingClientRect(), n = window.innerHeight - t.bottom, r = t.top;
1649
- c(n < we && r > n);
1753
+ c(n < Me && r > n);
1650
1754
  }
1651
1755
  o(!0);
1652
1756
  }, [l]),
1653
1757
  onMouseLeave: u,
1654
- children: [e, a && /* @__PURE__ */ _("div", {
1758
+ children: [e, a && /* @__PURE__ */ y("div", {
1655
1759
  className: `absolute left-0 ${s ? "bottom-full mb-1" : "top-full mt-1"} z-50 ${n} rounded-md border border-border bg-surface shadow-xl p-2 text-[10px] normal-case`,
1656
1760
  onMouseEnter: l,
1657
1761
  onMouseLeave: u,
@@ -1666,21 +1770,21 @@ function Z(e) {
1666
1770
  let n = Math.floor(t / 60);
1667
1771
  return n < 60 ? `${n}m ${t % 60}s` : `${Math.floor(n / 60)}h ${n % 60}m`;
1668
1772
  }
1669
- function Ee(e) {
1773
+ function Fe(e) {
1670
1774
  return e < 1024 ? `${e} B` : e < 1048576 ? `${(e / 1024).toFixed(1)} KB` : e < 1073741824 ? `${(e / 1048576).toFixed(1)} MB` : `${(e / 1073741824).toFixed(2)} GB`;
1671
1775
  }
1672
- function De({ clients: e, encodedCount: t, onKill: n }) {
1673
- let r = e?.decoded ?? [], i = e?.audio ?? [], a = e?.rtsp ?? [], o = e?.encoded ?? [], s = r.length + i.length + a.length + o.length, [c, l] = m(!0);
1674
- return s === 0 ? /* @__PURE__ */ _("div", {
1776
+ function Ie({ clients: e, encodedCount: t, onKill: n }) {
1777
+ let r = e?.decoded ?? [], i = e?.audio ?? [], a = e?.rtsp ?? [], o = e?.encoded ?? [], s = r.length + i.length + a.length + o.length, [c, l] = g(!0);
1778
+ return s === 0 ? /* @__PURE__ */ y("div", {
1675
1779
  className: "mt-1.5 text-[10px] text-foreground-subtle italic",
1676
1780
  children: "No active subscribers"
1677
- }) : /* @__PURE__ */ v("div", {
1781
+ }) : /* @__PURE__ */ b("div", {
1678
1782
  className: "mt-1.5 border-t border-border/30 pt-1.5",
1679
- children: [/* @__PURE__ */ v("button", {
1783
+ children: [/* @__PURE__ */ b("button", {
1680
1784
  type: "button",
1681
1785
  onClick: () => l((e) => !e),
1682
1786
  className: "flex items-center gap-1 text-[10px] text-foreground-subtle hover:text-foreground transition-colors",
1683
- children: [_(c ? M : N, { className: "h-3 w-3" }), /* @__PURE__ */ v("span", {
1787
+ children: [y(c ? P : F, { className: "h-3 w-3" }), /* @__PURE__ */ b("span", {
1684
1788
  className: "uppercase tracking-wider",
1685
1789
  children: [
1686
1790
  "Subscribers (",
@@ -1688,10 +1792,10 @@ function De({ clients: e, encodedCount: t, onKill: n }) {
1688
1792
  ")"
1689
1793
  ]
1690
1794
  })]
1691
- }), c && /* @__PURE__ */ v("div", {
1795
+ }), c && /* @__PURE__ */ b("div", {
1692
1796
  className: "mt-1 divide-y divide-border/20",
1693
1797
  children: [
1694
- r.map((e, t) => /* @__PURE__ */ _(Q, {
1798
+ r.map((e, t) => /* @__PURE__ */ y(Q, {
1695
1799
  kind: "DECODED",
1696
1800
  kindClass: "bg-success/10 text-success",
1697
1801
  tag: e.tag || "unknown",
@@ -1709,7 +1813,7 @@ function De({ clients: e, encodedCount: t, onKill: n }) {
1709
1813
  handle: e.tag
1710
1814
  }) : void 0
1711
1815
  }, `d-${t}`)),
1712
- i.map((e, t) => /* @__PURE__ */ _(Q, {
1816
+ i.map((e, t) => /* @__PURE__ */ y(Q, {
1713
1817
  kind: "AUDIO",
1714
1818
  kindClass: "bg-info/10 text-info",
1715
1819
  tag: e.tag || "unknown",
@@ -1722,15 +1826,15 @@ function De({ clients: e, encodedCount: t, onKill: n }) {
1722
1826
  }, `a-${t}`)),
1723
1827
  a.map((e) => {
1724
1828
  let t = Date.now() - e.lastRtpAt, r = t > 5e3, i = e.playing ? r ? "stalled" : "playing" : "paused", a = e.playing ? r ? "bg-amber-400/10 text-amber-400" : "bg-success/10 text-success" : "bg-foreground-subtle/10 text-foreground-subtle";
1725
- return /* @__PURE__ */ _(Q, {
1829
+ return /* @__PURE__ */ y(Q, {
1726
1830
  kind: "RTSP",
1727
1831
  kindClass: "bg-warning/10 text-warning",
1728
- tag: e.userAgent ? W(e.userAgent) : e.remoteAddr,
1832
+ tag: e.userAgent ? K(e.userAgent) : e.remoteAddr,
1729
1833
  state: {
1730
1834
  text: i + (e.muted ? " · muted" : ""),
1731
1835
  className: a
1732
1836
  },
1733
- metrics: [Ee(e.bytesSent), `last rtp ${Z(t)} ago`],
1837
+ metrics: [Fe(e.bytesSent), `last rtp ${Z(t)} ago`],
1734
1838
  age: Date.now() - e.connectedAt,
1735
1839
  onKill: n ? () => n({
1736
1840
  channel: "rtsp",
@@ -1739,21 +1843,21 @@ function De({ clients: e, encodedCount: t, onKill: n }) {
1739
1843
  }, `r-${e.sessionId}`);
1740
1844
  }),
1741
1845
  o.map((e) => {
1742
- let t = e.attribution, n = _e[t.kind] ?? "bg-foreground-subtle/10 text-foreground-subtle", r = t.sessionId ? t.sessionId.slice(0, 8) : null, i = [];
1743
- t.label && i.push(t.label), r && i.push(`sess ${r}`), t.userId && i.push(`user ${t.userId.slice(0, 8)}`), t.remoteAddr && i.push(`@${t.remoteAddr}`), t.userAgent && i.push(W(t.userAgent));
1744
- let a = i.length > 0 ? i.join(" · ") : ye(t.kind), o = [];
1745
- return t.media && o.push({ text: t.media }), t.targetCodec && o.push(t.targetCodec), t.transport && o.push(t.transport), o.push(`${e.packetsDelivered} pkts`), /* @__PURE__ */ _(Q, {
1746
- kind: ve(t.kind),
1846
+ let t = e.attribution, n = we[t.kind] ?? "bg-foreground-subtle/10 text-foreground-subtle", r = t.sessionId ? t.sessionId.slice(0, 8) : null, i = [];
1847
+ t.label && i.push(t.label), r && i.push(`sess ${r}`), t.userId && i.push(`user ${t.userId.slice(0, 8)}`), t.remoteAddr && i.push(`@${t.remoteAddr}`), t.userAgent && i.push(K(t.userAgent));
1848
+ let a = i.length > 0 ? i.join(" · ") : Ee(t.kind), o = [];
1849
+ return t.media && o.push({ text: t.media }), t.targetCodec && o.push(t.targetCodec), t.transport && o.push(t.transport), o.push(`${e.packetsDelivered} pkts`), /* @__PURE__ */ y(Q, {
1850
+ kind: Te(t.kind),
1747
1851
  kindClass: n,
1748
1852
  tag: a,
1749
1853
  metrics: o,
1750
1854
  age: Date.now() - e.subscribedAt
1751
1855
  }, e.id);
1752
1856
  }),
1753
- o.length === 0 && t > 0 && /* @__PURE__ */ v("div", {
1857
+ o.length === 0 && t > 0 && /* @__PURE__ */ b("div", {
1754
1858
  className: "py-0.5 text-[10px] text-foreground-subtle",
1755
1859
  children: [
1756
- /* @__PURE__ */ _("span", {
1860
+ /* @__PURE__ */ y("span", {
1757
1861
  className: "inline-block px-1 rounded text-[9px] font-bold bg-foreground-subtle/10 text-foreground-subtle mr-2",
1758
1862
  children: "ENCODED"
1759
1863
  }),
@@ -1766,82 +1870,82 @@ function De({ clients: e, encodedCount: t, onKill: n }) {
1766
1870
  });
1767
1871
  }
1768
1872
  function Q({ kind: e, kindClass: t, tag: n, state: r, metrics: i, age: a, onKill: o }) {
1769
- return /* @__PURE__ */ v("div", {
1873
+ return /* @__PURE__ */ b("div", {
1770
1874
  className: "flex flex-col gap-y-0.5 py-0.5 text-[10px] @[420px]:flex-row @[420px]:items-center @[420px]:gap-2",
1771
1875
  children: [
1772
- /* @__PURE__ */ v("div", {
1876
+ /* @__PURE__ */ b("div", {
1773
1877
  className: "flex items-center gap-2 min-w-0 @[420px]:flex-1",
1774
1878
  children: [
1775
- /* @__PURE__ */ _("span", {
1879
+ /* @__PURE__ */ y("span", {
1776
1880
  className: `inline-block px-1 rounded text-[9px] font-bold shrink-0 w-14 text-center ${t}`,
1777
1881
  children: e
1778
1882
  }),
1779
- /* @__PURE__ */ _("span", {
1883
+ /* @__PURE__ */ y("span", {
1780
1884
  className: "text-foreground font-medium truncate min-w-0 flex-1",
1781
1885
  title: n,
1782
1886
  children: n
1783
1887
  }),
1784
- o && /* @__PURE__ */ _("div", {
1888
+ o && /* @__PURE__ */ y("div", {
1785
1889
  className: "shrink-0 flex items-center justify-end @[420px]:hidden",
1786
- children: /* @__PURE__ */ _($, { onClick: o })
1890
+ children: /* @__PURE__ */ y($, { onClick: o })
1787
1891
  })
1788
1892
  ]
1789
1893
  }),
1790
- /* @__PURE__ */ v("div", {
1894
+ /* @__PURE__ */ b("div", {
1791
1895
  className: "flex items-center flex-wrap gap-1.5 text-foreground-subtle pl-16 @[420px]:pl-0 @[420px]:flex-nowrap @[420px]:shrink-0",
1792
1896
  children: [
1793
- r && /* @__PURE__ */ _("span", {
1897
+ r && /* @__PURE__ */ y("span", {
1794
1898
  className: `text-[9px] px-1 rounded shrink-0 ${r.className}`,
1795
1899
  children: r.text
1796
1900
  }),
1797
- i.map((e, t) => /* @__PURE__ */ v("span", {
1901
+ i.map((e, t) => /* @__PURE__ */ b("span", {
1798
1902
  className: "whitespace-nowrap",
1799
- children: [t > 0 && /* @__PURE__ */ _("span", {
1903
+ children: [t > 0 && /* @__PURE__ */ y("span", {
1800
1904
  className: "mr-1.5 text-foreground-subtle/50",
1801
1905
  children: "·"
1802
- }), typeof e == "string" ? e : /* @__PURE__ */ _("span", {
1906
+ }), typeof e == "string" ? e : /* @__PURE__ */ y("span", {
1803
1907
  className: e.warn ? "text-amber-400" : "",
1804
1908
  children: e.text
1805
1909
  })]
1806
1910
  }, t)),
1807
- /* @__PURE__ */ v("span", {
1911
+ /* @__PURE__ */ b("span", {
1808
1912
  className: "text-foreground-subtle/70 whitespace-nowrap",
1809
1913
  children: ["· ", Z(a)]
1810
1914
  })
1811
1915
  ]
1812
1916
  }),
1813
- /* @__PURE__ */ _("div", {
1917
+ /* @__PURE__ */ y("div", {
1814
1918
  className: "hidden @[420px]:flex w-5 flex-shrink-0 items-center justify-end",
1815
- children: o ? /* @__PURE__ */ _($, { onClick: o }) : null
1919
+ children: o ? /* @__PURE__ */ y($, { onClick: o }) : null
1816
1920
  })
1817
1921
  ]
1818
1922
  });
1819
1923
  }
1820
- function Oe({ count: e, clients: t, onKill: n }) {
1821
- let r = t?.decoded ?? [], i = t?.audio ?? [], a = t ? t.encodedSubscribers : 0, o = r.length > 0 || i.length > 0 || a > 0, s = /* @__PURE__ */ _("span", {
1924
+ function Le({ count: e, clients: t, onKill: n }) {
1925
+ let r = t?.decoded ?? [], i = t?.audio ?? [], a = t ? t.encodedSubscribers : 0, o = r.length > 0 || i.length > 0 || a > 0, s = /* @__PURE__ */ y("span", {
1822
1926
  className: `text-foreground ${o ? "underline decoration-dotted decoration-foreground-subtle/50 underline-offset-2 cursor-help" : ""}`,
1823
1927
  children: e
1824
1928
  });
1825
- return o ? /* @__PURE__ */ _(X, {
1929
+ return o ? /* @__PURE__ */ y(Pe, {
1826
1930
  trigger: s,
1827
- content: /* @__PURE__ */ v(y, { children: [
1828
- r.length > 0 && /* @__PURE__ */ v("div", {
1931
+ content: /* @__PURE__ */ b(x, { children: [
1932
+ r.length > 0 && /* @__PURE__ */ b("div", {
1829
1933
  className: "mb-2",
1830
- children: [/* @__PURE__ */ _("div", {
1934
+ children: [/* @__PURE__ */ y("div", {
1831
1935
  className: "text-foreground-subtle uppercase text-[9px] tracking-wider mb-1",
1832
1936
  children: "Decoded subscribers"
1833
- }), r.map((e, t) => /* @__PURE__ */ v("div", {
1937
+ }), r.map((e, t) => /* @__PURE__ */ b("div", {
1834
1938
  className: "flex items-center justify-between gap-2 py-0.5",
1835
- children: [/* @__PURE__ */ _("span", {
1939
+ children: [/* @__PURE__ */ y("span", {
1836
1940
  className: "text-foreground font-medium truncate",
1837
1941
  children: e.tag || "unknown"
1838
- }), /* @__PURE__ */ v("span", {
1942
+ }), /* @__PURE__ */ b("span", {
1839
1943
  className: "text-foreground-subtle text-[9px] flex items-center gap-1.5 shrink-0",
1840
1944
  children: [
1841
- /* @__PURE__ */ v("span", { children: [e.maxFps.toFixed(0), "fps"] }),
1842
- /* @__PURE__ */ _("span", { children: "·" }),
1843
- /* @__PURE__ */ v("span", { children: [e.framesDelivered, " del"] }),
1844
- e.framesDropped > 0 && /* @__PURE__ */ v("span", {
1945
+ /* @__PURE__ */ b("span", { children: [e.maxFps.toFixed(0), "fps"] }),
1946
+ /* @__PURE__ */ y("span", { children: "·" }),
1947
+ /* @__PURE__ */ b("span", { children: [e.framesDelivered, " del"] }),
1948
+ e.framesDropped > 0 && /* @__PURE__ */ b("span", {
1845
1949
  className: "text-amber-400",
1846
1950
  children: [
1847
1951
  "· ",
@@ -1849,9 +1953,9 @@ function Oe({ count: e, clients: t, onKill: n }) {
1849
1953
  " drop"
1850
1954
  ]
1851
1955
  }),
1852
- /* @__PURE__ */ _("span", { children: "·" }),
1853
- /* @__PURE__ */ _("span", { children: Z(Date.now() - e.subscribedAt) }),
1854
- n && e.tag && /* @__PURE__ */ _($, { onClick: () => n({
1956
+ /* @__PURE__ */ y("span", { children: "·" }),
1957
+ /* @__PURE__ */ y("span", { children: Z(Date.now() - e.subscribedAt) }),
1958
+ n && e.tag && /* @__PURE__ */ y($, { onClick: () => n({
1855
1959
  channel: "decoded",
1856
1960
  handle: e.tag
1857
1961
  }) })
@@ -1859,23 +1963,23 @@ function Oe({ count: e, clients: t, onKill: n }) {
1859
1963
  })]
1860
1964
  }, `d-${t}`))]
1861
1965
  }),
1862
- i.length > 0 && /* @__PURE__ */ v("div", {
1966
+ i.length > 0 && /* @__PURE__ */ b("div", {
1863
1967
  className: "mb-2",
1864
- children: [/* @__PURE__ */ _("div", {
1968
+ children: [/* @__PURE__ */ y("div", {
1865
1969
  className: "text-foreground-subtle uppercase text-[9px] tracking-wider mb-1",
1866
1970
  children: "Audio subscribers"
1867
- }), i.map((e, t) => /* @__PURE__ */ v("div", {
1971
+ }), i.map((e, t) => /* @__PURE__ */ b("div", {
1868
1972
  className: "flex items-center justify-between gap-2 py-0.5",
1869
- children: [/* @__PURE__ */ _("span", {
1973
+ children: [/* @__PURE__ */ y("span", {
1870
1974
  className: "text-foreground font-medium truncate",
1871
1975
  children: e.tag || "unknown"
1872
- }), /* @__PURE__ */ v("span", {
1976
+ }), /* @__PURE__ */ b("span", {
1873
1977
  className: "text-foreground-subtle text-[9px] flex items-center gap-1.5 shrink-0",
1874
1978
  children: [
1875
- /* @__PURE__ */ v("span", { children: [e.chunksDelivered, " chunks"] }),
1876
- /* @__PURE__ */ _("span", { children: "·" }),
1877
- /* @__PURE__ */ _("span", { children: Z(Date.now() - e.subscribedAt) }),
1878
- n && e.tag && /* @__PURE__ */ _($, { onClick: () => n({
1979
+ /* @__PURE__ */ b("span", { children: [e.chunksDelivered, " chunks"] }),
1980
+ /* @__PURE__ */ y("span", { children: "·" }),
1981
+ /* @__PURE__ */ y("span", { children: Z(Date.now() - e.subscribedAt) }),
1982
+ n && e.tag && /* @__PURE__ */ y($, { onClick: () => n({
1879
1983
  channel: "audio",
1880
1984
  handle: e.tag
1881
1985
  }) })
@@ -1883,10 +1987,10 @@ function Oe({ count: e, clients: t, onKill: n }) {
1883
1987
  })]
1884
1988
  }, `a-${t}`))]
1885
1989
  }),
1886
- a > 0 && /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("div", {
1990
+ a > 0 && /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("div", {
1887
1991
  className: "text-foreground-subtle uppercase text-[9px] tracking-wider mb-1",
1888
1992
  children: "Encoded"
1889
- }), /* @__PURE__ */ v("div", {
1993
+ }), /* @__PURE__ */ b("div", {
1890
1994
  className: "text-foreground",
1891
1995
  children: [a, " callback subscriber(s)"]
1892
1996
  })] })
@@ -1894,8 +1998,8 @@ function Oe({ count: e, clients: t, onKill: n }) {
1894
1998
  widthClass: "min-w-[260px] max-w-[360px]"
1895
1999
  }) : s;
1896
2000
  }
1897
- function ke({ enabled: e, onToggle: t, disabled: n }) {
1898
- return /* @__PURE__ */ _("button", {
2001
+ function Re({ enabled: e, onToggle: t, disabled: n }) {
2002
+ return /* @__PURE__ */ y("button", {
1899
2003
  type: "button",
1900
2004
  role: "switch",
1901
2005
  "aria-checked": e,
@@ -1903,59 +2007,59 @@ function ke({ enabled: e, onToggle: t, disabled: n }) {
1903
2007
  onClick: () => t(!e),
1904
2008
  className: `relative inline-flex h-3 w-6 shrink-0 items-center rounded-full transition-colors ${e ? "bg-success/60" : "bg-foreground-subtle/30"} ${n ? "opacity-50 cursor-wait" : "cursor-pointer"}`,
1905
2009
  title: e ? "Pre-buffer enabled — click to disable" : "Pre-buffer disabled — click to enable",
1906
- children: /* @__PURE__ */ _("span", { className: `inline-block h-2.5 w-2.5 rounded-full bg-white shadow transition-transform ${e ? "translate-x-3" : "translate-x-0.5"}` })
2010
+ children: /* @__PURE__ */ y("span", { className: `inline-block h-2.5 w-2.5 rounded-full bg-white shadow transition-transform ${e ? "translate-x-3" : "translate-x-0.5"}` })
1907
2011
  });
1908
2012
  }
1909
2013
  function $({ onClick: e }) {
1910
- return /* @__PURE__ */ _("button", {
2014
+ return /* @__PURE__ */ y("button", {
1911
2015
  type: "button",
1912
2016
  title: "Force-disconnect this client",
1913
2017
  onClick: (t) => {
1914
2018
  t.stopPropagation(), e();
1915
2019
  },
1916
2020
  className: "inline-flex items-center justify-center h-4 w-4 rounded-sm border border-border/60 text-foreground-subtle hover:bg-red-500/10 hover:text-red-400 hover:border-red-500/40 transition-colors",
1917
- children: /* @__PURE__ */ _(re, { className: "h-2.5 w-2.5" })
2021
+ children: /* @__PURE__ */ y(ae, { className: "h-2.5 w-2.5" })
1918
2022
  });
1919
2023
  }
1920
- function Ae({ count: e, clients: t, onKill: n }) {
1921
- let r = t?.rtsp ?? [], i = r.length > 0, a = /* @__PURE__ */ _("span", {
2024
+ function ze({ count: e, clients: t, onKill: n }) {
2025
+ let r = t?.rtsp ?? [], i = r.length > 0, a = /* @__PURE__ */ y("span", {
1922
2026
  className: `text-foreground ${i ? "underline decoration-dotted decoration-foreground-subtle/50 underline-offset-2 cursor-help" : ""}`,
1923
2027
  children: e
1924
2028
  });
1925
- return i ? /* @__PURE__ */ _(X, {
2029
+ return i ? /* @__PURE__ */ y(Pe, {
1926
2030
  trigger: a,
1927
- content: /* @__PURE__ */ v(y, { children: [/* @__PURE__ */ _("div", {
2031
+ content: /* @__PURE__ */ b(x, { children: [/* @__PURE__ */ y("div", {
1928
2032
  className: "text-foreground-subtle uppercase text-[9px] tracking-wider mb-1",
1929
2033
  children: "RTSP sessions"
1930
2034
  }), r.map((e) => {
1931
2035
  let t = Date.now() - e.lastRtpAt, r = t > 5e3;
1932
- return /* @__PURE__ */ v("div", {
2036
+ return /* @__PURE__ */ b("div", {
1933
2037
  className: "py-1 border-b border-border/40 last:border-b-0",
1934
- children: [/* @__PURE__ */ v("div", {
2038
+ children: [/* @__PURE__ */ b("div", {
1935
2039
  className: "flex items-center justify-between gap-2",
1936
- children: [/* @__PURE__ */ _("span", {
2040
+ children: [/* @__PURE__ */ y("span", {
1937
2041
  className: "text-foreground font-mono",
1938
- children: e.userAgent ? W(e.userAgent) : e.remoteAddr
1939
- }), /* @__PURE__ */ v("span", {
2042
+ children: e.userAgent ? K(e.userAgent) : e.remoteAddr
2043
+ }), /* @__PURE__ */ b("span", {
1940
2044
  className: "flex items-center gap-1 shrink-0",
1941
- children: [/* @__PURE__ */ v("span", {
2045
+ children: [/* @__PURE__ */ b("span", {
1942
2046
  className: `text-[9px] px-1 rounded ${e.playing ? r ? "bg-amber-400/10 text-amber-400" : "bg-success/10 text-success" : "bg-foreground-subtle/10 text-foreground-subtle"}`,
1943
2047
  children: [e.playing ? r ? "stalled" : "playing" : "paused", e.muted && " · muted"]
1944
- }), n && /* @__PURE__ */ _($, { onClick: () => n({
2048
+ }), n && /* @__PURE__ */ y($, { onClick: () => n({
1945
2049
  channel: "rtsp",
1946
2050
  handle: e.sessionId
1947
2051
  }) })]
1948
2052
  })]
1949
- }), /* @__PURE__ */ v("div", {
2053
+ }), /* @__PURE__ */ b("div", {
1950
2054
  className: "flex items-center justify-between gap-2 text-foreground-subtle text-[9px] mt-0.5",
1951
2055
  children: [
1952
- /* @__PURE__ */ v("span", { children: [Ee(e.bytesSent), " sent"] }),
1953
- /* @__PURE__ */ v("span", { children: [
2056
+ /* @__PURE__ */ b("span", { children: [Fe(e.bytesSent), " sent"] }),
2057
+ /* @__PURE__ */ b("span", { children: [
1954
2058
  "connected ",
1955
2059
  Z(Date.now() - e.connectedAt),
1956
2060
  " ago"
1957
2061
  ] }),
1958
- /* @__PURE__ */ v("span", { children: [
2062
+ /* @__PURE__ */ b("span", { children: [
1959
2063
  "last rtp ",
1960
2064
  Z(t),
1961
2065
  " ago"
@@ -1969,9 +2073,9 @@ function Ae({ count: e, clients: t, onKill: n }) {
1969
2073
  }
1970
2074
  //#endregion
1971
2075
  //#region src/stream-broker/widgets/index.tsx
1972
- var je = {
1973
- "stream-broker-panel": be,
1974
- "ffmpeg-params": pe
2076
+ var Be = {
2077
+ "stream-broker-panel": De,
2078
+ "ffmpeg-params": he
1975
2079
  };
1976
2080
  //#endregion
1977
- export { je as default };
2081
+ export { Be as default };