@camstack/addon-osd-manager 0.1.156 → 0.1.157
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{MaskShapeCanvas-BEVxAjNq.mjs → MaskShapeCanvas-BT714ljC.mjs} +113 -113
- package/dist/MotionZonesSettings-vYt4dibj.mjs +310 -0
- package/dist/{PrivacyMaskSettings-Ci65qYWB.mjs → PrivacyMaskSettings-BiQ78hst.mjs} +35 -60
- package/dist/{SceneMonitorEditor-BG9mHyrC.mjs → SceneMonitorEditor-CJtJIyMf.mjs} +307 -307
- package/dist/_stub.js +11764 -4485
- package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_osd_manager_page-BDKvyj3r.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_osd_manager_page-DdAtpC7z.mjs} +3 -3
- package/dist/_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-BtgV-Ym5.mjs +26 -0
- package/dist/_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CHxDN0gE.mjs +26 -0
- package/dist/{_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare__react__loadShare__.js-Bs1t18EM.mjs → _virtual_mf___mfe_internal__addon_osd_manager_page__loadShare__react__loadShare__.js-C5jUMd7X.mjs} +1 -1
- package/dist/{_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare__react_mf_2_dom__loadShare__.js-C0K4h_0e.mjs → _virtual_mf___mfe_internal__addon_osd_manager_page__loadShare__react_mf_2_dom__loadShare__.js-qB5uHZAd.mjs} +8 -7
- package/dist/addon-osd-manager.css +1 -1
- package/dist/{hostInit-DdhUwSkK.mjs → hostInit-0Mc7Fm1R.mjs} +2 -2
- package/dist/index.js +537 -31
- package/dist/index.mjs +537 -31
- package/dist/{player-overlays-C_Gmuzev.mjs → player-overlays-BPyna-eI.mjs} +14 -14
- package/dist/remoteEntry.js +1 -1
- package/dist/{responsive-C-9Ko8kt.mjs → responsive-B0yDP9vf.mjs} +31 -27
- package/dist/{scene-monitor-copy-DudW1LZg.mjs → scene-monitor-copy-BzX20O6q.mjs} +13 -13
- package/dist/{square-CpweDmax.mjs → square-BOMOn_6j.mjs} +29 -4
- package/dist/{trash-2-cb_YtxOy.mjs → trash-2-BolGRl2P.mjs} +1 -1
- package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_osd_manager_page__remoteEntry_js-Dly_n9Qj.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_osd_manager_page__remoteEntry_js-UY9P_4V2.mjs} +1 -1
- package/package.json +1 -1
- package/dist/MotionZonesSettings-DaDfau7A.mjs +0 -310
- package/dist/_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-BTkfkwrM.mjs +0 -26
- package/dist/_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DmzTg7Gl.mjs +0 -25
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
import { b as e, c as t, g as n, h as r, m as i, u as a } from "./_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare__react__loadShare__.js-C5jUMd7X.mjs";
|
|
2
|
+
import { c as o, n as s, o as c, r as ee, t as l } from "./responsive-B0yDP9vf.mjs";
|
|
3
|
+
import { n as u, t as d } from "./player-overlays-BPyna-eI.mjs";
|
|
4
|
+
import { n as f, r as p, t as m } from "./_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-DalfdIDw.mjs";
|
|
5
|
+
import { MaskShapeCanvas as h } from "./MaskShapeCanvas-BT714ljC.mjs";
|
|
6
|
+
var g = o("grid-2x2", [
|
|
7
|
+
["path", {
|
|
8
|
+
d: "M12 3v18",
|
|
9
|
+
key: "108xh3"
|
|
10
|
+
}],
|
|
11
|
+
["path", {
|
|
12
|
+
d: "M3 12h18",
|
|
13
|
+
key: "1i2n21"
|
|
14
|
+
}],
|
|
15
|
+
["rect", {
|
|
16
|
+
x: "3",
|
|
17
|
+
y: "3",
|
|
18
|
+
width: "18",
|
|
19
|
+
height: "18",
|
|
20
|
+
rx: "2",
|
|
21
|
+
key: "h1oib"
|
|
22
|
+
}]
|
|
23
|
+
]);
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region ../ui-library/src/composites/cap-settings/MotionZonesSettings.tsx
|
|
26
|
+
e();
|
|
27
|
+
var _ = 110, te = "motion-zones", v = 0, y = [
|
|
28
|
+
1,
|
|
29
|
+
2,
|
|
30
|
+
3
|
|
31
|
+
], b = 1, x = "rounded-md border border-border bg-surface px-2 py-1 text-[11px] font-medium text-foreground-subtle hover:bg-surface-hover disabled:opacity-40 transition-colors", S = "rounded-md border border-primary/50 bg-primary/15 px-2.5 py-1 text-[11px] font-medium text-primary hover:bg-primary/25 disabled:opacity-40 transition-colors";
|
|
32
|
+
function C(e, t, n) {
|
|
33
|
+
let r = t * n, i = Array.from({ length: r });
|
|
34
|
+
for (let t = 0; t < r; t += 1) i[t] = e[t] === !0;
|
|
35
|
+
return i;
|
|
36
|
+
}
|
|
37
|
+
function ne(e, t) {
|
|
38
|
+
if (e.length !== t.length) return !1;
|
|
39
|
+
for (let n = 0; n < e.length; n += 1) if (e[n] !== t[n]) return !1;
|
|
40
|
+
return !0;
|
|
41
|
+
}
|
|
42
|
+
function w(e, t) {
|
|
43
|
+
return Math.ceil(e / t);
|
|
44
|
+
}
|
|
45
|
+
function T(e, t, n) {
|
|
46
|
+
return Math.min(n - 1, Math.floor((e + .5) / t * n));
|
|
47
|
+
}
|
|
48
|
+
function E(e, t, n, r) {
|
|
49
|
+
let i = w(t, r), a = w(n, r), o = Array.from({ length: i * a }, () => !1);
|
|
50
|
+
for (let r = 0; r < n; r += 1) {
|
|
51
|
+
let s = T(r, n, a);
|
|
52
|
+
for (let n = 0; n < t; n += 1) e[r * t + n] === !0 && (o[s * i + T(n, t, i)] = !0);
|
|
53
|
+
}
|
|
54
|
+
return o;
|
|
55
|
+
}
|
|
56
|
+
function D(e, t, n, r) {
|
|
57
|
+
let i = w(t, r), a = w(n, r), o = Array.from({ length: t * n }, () => !1);
|
|
58
|
+
for (let r = 0; r < n; r += 1) {
|
|
59
|
+
let s = T(r, n, a);
|
|
60
|
+
for (let n = 0; n < t; n += 1) o[r * t + n] = e[s * i + T(n, t, i)] === !0;
|
|
61
|
+
}
|
|
62
|
+
return o;
|
|
63
|
+
}
|
|
64
|
+
function O({ deviceId: e }) {
|
|
65
|
+
let o = ee(c().trpcClient, e), [T, O] = n(null), [k, A] = n(!1), [j, M] = n(null), [N, P] = n(null), [F, I] = n(b), [L, R] = n(!1), [z, B] = n(!1), V = r(!1);
|
|
66
|
+
a(() => {
|
|
67
|
+
if (!o) return;
|
|
68
|
+
let e = !1;
|
|
69
|
+
return V.current = !1, O(null), A(!1), M(null), P(null), I(b), B(!1), (async () => {
|
|
70
|
+
try {
|
|
71
|
+
let t = await o.motionZones?.getOptions({});
|
|
72
|
+
if (e) return;
|
|
73
|
+
if (!t) throw Error("device proxy not ready");
|
|
74
|
+
if (O(t), V.current) return;
|
|
75
|
+
let n = await o.motionZones?.getStatus({});
|
|
76
|
+
if (e) return;
|
|
77
|
+
if (!n) throw Error("device proxy not ready");
|
|
78
|
+
V.current = !0;
|
|
79
|
+
let r = n.regions.find((e) => e.shape.kind === "grid"), i = C(r ? r.shape.cells : [], t.grid.width, t.grid.height);
|
|
80
|
+
P(i), M(E(i, t.grid.width, t.grid.height, b));
|
|
81
|
+
} catch (t) {
|
|
82
|
+
if (e) return;
|
|
83
|
+
s(t) ? A(!0) : console.error("Motion Zones load failed", t);
|
|
84
|
+
}
|
|
85
|
+
})(), () => {
|
|
86
|
+
e = !0;
|
|
87
|
+
};
|
|
88
|
+
}, [o]);
|
|
89
|
+
let H = T ? T.grid.width : 0, U = T ? T.grid.height : 0, W = w(H, F), G = w(U, F), K = i(() => j && T ? D(j, H, U, F) : null, [
|
|
90
|
+
j,
|
|
91
|
+
T,
|
|
92
|
+
H,
|
|
93
|
+
U,
|
|
94
|
+
F
|
|
95
|
+
]), q = i(() => K !== null && N !== null && !ne(K, N), [K, N]), J = i(() => K ? K.reduce((e, t) => t ? e + 1 : e, 0) : 0, [K]), Y = H * U, X = W * G, Z = t((e) => {
|
|
96
|
+
X > 0 && M(Array.from({ length: X }, () => e));
|
|
97
|
+
}, [X]), re = t(() => {
|
|
98
|
+
M((e) => e && e.map((e) => !e));
|
|
99
|
+
}, []), ie = t(() => {
|
|
100
|
+
N && T && M(E(N, H, U, F));
|
|
101
|
+
}, [
|
|
102
|
+
N,
|
|
103
|
+
T,
|
|
104
|
+
H,
|
|
105
|
+
U,
|
|
106
|
+
F
|
|
107
|
+
]), ae = t((e) => {
|
|
108
|
+
e === F || !T || M((t) => {
|
|
109
|
+
if (!t) return I(e), t;
|
|
110
|
+
let n = E(D(t, H, U, F), H, U, e);
|
|
111
|
+
return I(e), n;
|
|
112
|
+
});
|
|
113
|
+
}, [
|
|
114
|
+
F,
|
|
115
|
+
T,
|
|
116
|
+
H,
|
|
117
|
+
U
|
|
118
|
+
]), Q = i(() => T && j ? [{
|
|
119
|
+
id: v,
|
|
120
|
+
shape: {
|
|
121
|
+
kind: "grid",
|
|
122
|
+
gridWidth: W,
|
|
123
|
+
gridHeight: G,
|
|
124
|
+
cells: [...j]
|
|
125
|
+
}
|
|
126
|
+
}] : [], [
|
|
127
|
+
T,
|
|
128
|
+
j,
|
|
129
|
+
W,
|
|
130
|
+
G
|
|
131
|
+
]), $ = t((e, t) => {
|
|
132
|
+
t.kind === "grid" && M(t.cells);
|
|
133
|
+
}, []), oe = t(async () => {
|
|
134
|
+
if (!(!o || !j || !T)) {
|
|
135
|
+
R(!0);
|
|
136
|
+
try {
|
|
137
|
+
let e = D(j, T.grid.width, T.grid.height, F), t = {
|
|
138
|
+
kind: "grid",
|
|
139
|
+
gridWidth: T.grid.width,
|
|
140
|
+
gridHeight: T.grid.height,
|
|
141
|
+
cells: e
|
|
142
|
+
};
|
|
143
|
+
await o.motionZones?.setZone({ patch: { regions: [{
|
|
144
|
+
id: v,
|
|
145
|
+
enabled: !0,
|
|
146
|
+
shape: t
|
|
147
|
+
}] } });
|
|
148
|
+
let n = await o.motionZones?.getStatus({});
|
|
149
|
+
if (n) {
|
|
150
|
+
let e = n.regions.find((e) => e.shape.kind === "grid"), t = C(e ? e.shape.cells : [], T.grid.width, T.grid.height);
|
|
151
|
+
P(t), M(E(t, T.grid.width, T.grid.height, F));
|
|
152
|
+
}
|
|
153
|
+
} catch (e) {
|
|
154
|
+
console.error("Motion Zones save failed", e);
|
|
155
|
+
} finally {
|
|
156
|
+
R(!1);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}, [
|
|
160
|
+
o,
|
|
161
|
+
j,
|
|
162
|
+
T,
|
|
163
|
+
F
|
|
164
|
+
]);
|
|
165
|
+
return d(i(() => z && !k && T && j ? {
|
|
166
|
+
id: te,
|
|
167
|
+
order: _,
|
|
168
|
+
node: /* @__PURE__ */ f(h, {
|
|
169
|
+
transparent: !0,
|
|
170
|
+
items: Q,
|
|
171
|
+
supportedShapes: ["grid"],
|
|
172
|
+
grid: {
|
|
173
|
+
width: W,
|
|
174
|
+
height: G
|
|
175
|
+
},
|
|
176
|
+
selectedId: v,
|
|
177
|
+
onSelect: () => {},
|
|
178
|
+
onShapeChange: $,
|
|
179
|
+
onDrawComplete: () => {},
|
|
180
|
+
drawingKind: null
|
|
181
|
+
})
|
|
182
|
+
} : null, [
|
|
183
|
+
z,
|
|
184
|
+
k,
|
|
185
|
+
T,
|
|
186
|
+
j,
|
|
187
|
+
Q,
|
|
188
|
+
$,
|
|
189
|
+
W,
|
|
190
|
+
G
|
|
191
|
+
])), o ? /* @__PURE__ */ f(u, {
|
|
192
|
+
title: "Motion Zones",
|
|
193
|
+
icon: /* @__PURE__ */ f(g, { className: "h-3.5 w-3.5 text-foreground-subtle" }),
|
|
194
|
+
children: /* @__PURE__ */ f("div", {
|
|
195
|
+
className: "flex flex-col gap-3",
|
|
196
|
+
children: k ? /* @__PURE__ */ f("p", {
|
|
197
|
+
className: `${l} leading-relaxed`,
|
|
198
|
+
children: "This camera doesn't expose an on-board motion zones grid."
|
|
199
|
+
}) : !k && T !== null && j !== null ? /* @__PURE__ */ p(m, { children: [/* @__PURE__ */ p("p", {
|
|
200
|
+
className: `${l} leading-relaxed`,
|
|
201
|
+
children: [
|
|
202
|
+
"Toggle ",
|
|
203
|
+
/* @__PURE__ */ f("strong", {
|
|
204
|
+
className: "text-foreground",
|
|
205
|
+
children: "Edit grid"
|
|
206
|
+
}),
|
|
207
|
+
" to paint the region directly on the live frame, then ",
|
|
208
|
+
/* @__PURE__ */ f("strong", {
|
|
209
|
+
className: "text-foreground",
|
|
210
|
+
children: "Save"
|
|
211
|
+
}),
|
|
212
|
+
" to push the mask to the camera. Pick a bigger",
|
|
213
|
+
" ",
|
|
214
|
+
/* @__PURE__ */ f("strong", {
|
|
215
|
+
className: "text-foreground",
|
|
216
|
+
children: "Cell size"
|
|
217
|
+
}),
|
|
218
|
+
" for quicker, broad-stroke painting — it's resampled to the camera's native ",
|
|
219
|
+
T.grid.width,
|
|
220
|
+
"×",
|
|
221
|
+
T.grid.height,
|
|
222
|
+
" grid on save (×1 is the finest)."
|
|
223
|
+
]
|
|
224
|
+
}), /* @__PURE__ */ p("div", {
|
|
225
|
+
className: "flex items-center gap-2 flex-wrap",
|
|
226
|
+
children: [
|
|
227
|
+
/* @__PURE__ */ f("button", {
|
|
228
|
+
type: "button",
|
|
229
|
+
onClick: () => B((e) => !e),
|
|
230
|
+
disabled: L,
|
|
231
|
+
"aria-pressed": z,
|
|
232
|
+
className: z ? S : x,
|
|
233
|
+
children: z ? "Done editing" : "Edit grid"
|
|
234
|
+
}),
|
|
235
|
+
/* @__PURE__ */ f("button", {
|
|
236
|
+
type: "button",
|
|
237
|
+
onClick: () => Z(!0),
|
|
238
|
+
disabled: L,
|
|
239
|
+
className: x,
|
|
240
|
+
children: "All on"
|
|
241
|
+
}),
|
|
242
|
+
/* @__PURE__ */ f("button", {
|
|
243
|
+
type: "button",
|
|
244
|
+
onClick: () => Z(!1),
|
|
245
|
+
disabled: L,
|
|
246
|
+
className: x,
|
|
247
|
+
children: "All off"
|
|
248
|
+
}),
|
|
249
|
+
/* @__PURE__ */ f("button", {
|
|
250
|
+
type: "button",
|
|
251
|
+
onClick: re,
|
|
252
|
+
disabled: L,
|
|
253
|
+
className: x,
|
|
254
|
+
children: "Invert"
|
|
255
|
+
}),
|
|
256
|
+
/* @__PURE__ */ p("div", {
|
|
257
|
+
className: "flex items-center gap-1 ml-1",
|
|
258
|
+
role: "group",
|
|
259
|
+
"aria-label": "Cell size",
|
|
260
|
+
children: [/* @__PURE__ */ f("span", {
|
|
261
|
+
className: `${l} mr-0.5`,
|
|
262
|
+
children: "Cell size"
|
|
263
|
+
}), y.map((e) => /* @__PURE__ */ p("button", {
|
|
264
|
+
type: "button",
|
|
265
|
+
onClick: () => ae(e),
|
|
266
|
+
disabled: L,
|
|
267
|
+
"aria-pressed": F === e,
|
|
268
|
+
title: e === 1 ? `Camera grid ${H}×${U} (finest)` : `${w(H, e)}×${w(U, e)} painting grid · cells ×${e} bigger`,
|
|
269
|
+
className: F === e ? S : x,
|
|
270
|
+
children: ["×", e]
|
|
271
|
+
}, e))]
|
|
272
|
+
}),
|
|
273
|
+
/* @__PURE__ */ p("span", {
|
|
274
|
+
className: `${l} ml-1 tabular-nums`,
|
|
275
|
+
children: [
|
|
276
|
+
J,
|
|
277
|
+
" / ",
|
|
278
|
+
Y,
|
|
279
|
+
" cells · ",
|
|
280
|
+
T.grid.width,
|
|
281
|
+
"×",
|
|
282
|
+
T.grid.height,
|
|
283
|
+
F === 1 ? "" : ` · paint ${W}×${G}`
|
|
284
|
+
]
|
|
285
|
+
}),
|
|
286
|
+
/* @__PURE__ */ f("span", { className: "flex-1" }),
|
|
287
|
+
/* @__PURE__ */ f("button", {
|
|
288
|
+
type: "button",
|
|
289
|
+
onClick: ie,
|
|
290
|
+
disabled: L || !q,
|
|
291
|
+
className: "rounded-md border border-border bg-surface px-2 py-1 text-[11px] text-foreground-subtle hover:bg-surface-hover disabled:opacity-40 transition-colors",
|
|
292
|
+
children: "Revert"
|
|
293
|
+
}),
|
|
294
|
+
/* @__PURE__ */ f("button", {
|
|
295
|
+
type: "button",
|
|
296
|
+
onClick: () => void oe(),
|
|
297
|
+
disabled: L || !q,
|
|
298
|
+
className: S,
|
|
299
|
+
children: L ? "Saving…" : "Save"
|
|
300
|
+
})
|
|
301
|
+
]
|
|
302
|
+
})] }) : /* @__PURE__ */ f("p", {
|
|
303
|
+
className: `${l} leading-relaxed`,
|
|
304
|
+
children: "Loading the camera's grid…"
|
|
305
|
+
})
|
|
306
|
+
})
|
|
307
|
+
}) : null;
|
|
308
|
+
}
|
|
309
|
+
//#endregion
|
|
310
|
+
export { O as MotionZonesSettings };
|
|
@@ -1,42 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { n as re, t as ie } from "./player-overlays-
|
|
4
|
-
import {
|
|
5
|
-
import { t as
|
|
6
|
-
import { n as l, r as u, t as
|
|
7
|
-
import { MaskShapeCanvas as
|
|
8
|
-
var
|
|
1
|
+
import { b as e, c as t, g as n, h as r, m as i, u as a } from "./_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare__react__loadShare__.js-C5jUMd7X.mjs";
|
|
2
|
+
import { c as o, n as ee, o as te, r as ne, t as s } from "./responsive-B0yDP9vf.mjs";
|
|
3
|
+
import { n as re, t as ie } from "./player-overlays-BPyna-eI.mjs";
|
|
4
|
+
import { i as ae, n as oe, r as se, t as c } from "./square-BOMOn_6j.mjs";
|
|
5
|
+
import { t as ce } from "./trash-2-BolGRl2P.mjs";
|
|
6
|
+
import { n as l, r as u, t as le } from "./_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-DalfdIDw.mjs";
|
|
7
|
+
import { MaskShapeCanvas as ue } from "./MaskShapeCanvas-BT714ljC.mjs";
|
|
8
|
+
var de = o("hexagon", [["path", {
|
|
9
9
|
d: "M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z",
|
|
10
10
|
key: "yt0hxn"
|
|
11
|
-
}]])
|
|
12
|
-
["path", {
|
|
13
|
-
d: "M12 19v3",
|
|
14
|
-
key: "npa21l"
|
|
15
|
-
}],
|
|
16
|
-
["path", {
|
|
17
|
-
d: "M15 9.34V5a3 3 0 0 0-5.68-1.33",
|
|
18
|
-
key: "1gzdoj"
|
|
19
|
-
}],
|
|
20
|
-
["path", {
|
|
21
|
-
d: "M16.95 16.95A7 7 0 0 1 5 12v-2",
|
|
22
|
-
key: "cqa7eg"
|
|
23
|
-
}],
|
|
24
|
-
["path", {
|
|
25
|
-
d: "M18.89 13.23A7 7 0 0 0 19 12v-2",
|
|
26
|
-
key: "16hl24"
|
|
27
|
-
}],
|
|
28
|
-
["path", {
|
|
29
|
-
d: "m2 2 20 20",
|
|
30
|
-
key: "1ooewy"
|
|
31
|
-
}],
|
|
32
|
-
["path", {
|
|
33
|
-
d: "M9 9v3a3 3 0 0 0 5.12 2.12",
|
|
34
|
-
key: "r2i35w"
|
|
35
|
-
}]
|
|
36
|
-
]);
|
|
11
|
+
}]]);
|
|
37
12
|
//#endregion
|
|
38
13
|
//#region ../ui-library/src/composites/cap-settings/privacy-mask-audio.ts
|
|
39
|
-
|
|
14
|
+
e();
|
|
40
15
|
var d = "Microphone", f = "The camera encodes no audio at all — live view, recordings, exports and the audio analyzer are all silent.";
|
|
41
16
|
function p(e) {
|
|
42
17
|
let t = e.supportsAudioMute === !0, n = t ? e.audioEnabled : null, r = e.pendingOn ?? null;
|
|
@@ -67,9 +42,9 @@ function he(e, t) {
|
|
|
67
42
|
for (let n = 0; n < e.length; n += 1) if (JSON.stringify(e[n]) !== JSON.stringify(t[n])) return !1;
|
|
68
43
|
return !0;
|
|
69
44
|
}
|
|
70
|
-
function v({ deviceId:
|
|
71
|
-
let o = ne(
|
|
72
|
-
|
|
45
|
+
function v({ deviceId: e }) {
|
|
46
|
+
let o = ne(te().trpcClient, e), [d, f] = n(null), [v, y] = n(!1), [b, x] = n(!1), [S, C] = n(null), [w, T] = n(null), [E, D] = n(!1), [O, k] = n(!1), [A, j] = n(null), [M, N] = n(null), [ge, P] = n(null), [F, I] = n(null), [L, R] = n(null), z = r(!1);
|
|
47
|
+
a(() => {
|
|
73
48
|
if (!o) return;
|
|
74
49
|
let e = !1;
|
|
75
50
|
return z.current = !1, f(null), y(!1), x(!1), C(null), T(null), k(!1), j(null), N(null), P(null), I(null), R(null), (async () => {
|
|
@@ -93,29 +68,29 @@ function v({ deviceId: a }) {
|
|
|
93
68
|
T(r), C(r), P(n.audioEnabled);
|
|
94
69
|
} catch (t) {
|
|
95
70
|
if (e) return;
|
|
96
|
-
|
|
71
|
+
ee(t) ? y(!0) : console.error("Privacy Mask load failed", t);
|
|
97
72
|
}
|
|
98
73
|
})(), () => {
|
|
99
74
|
e = !0;
|
|
100
75
|
};
|
|
101
76
|
}, [o]);
|
|
102
|
-
let B =
|
|
103
|
-
|
|
77
|
+
let B = i(() => S !== null && w !== null && (S.enabled !== w.enabled || !he(S.regions, w.regions)), [S, w]), V = S ? S.regions.length : 0, H = d ? d.maxRegions : 0, U = r(0);
|
|
78
|
+
a(() => {
|
|
104
79
|
U.current = H;
|
|
105
80
|
}, [H]);
|
|
106
|
-
let W = H > 0 && V >= H, _e =
|
|
81
|
+
let W = H > 0 && V >= H, _e = t(() => {
|
|
107
82
|
C((e) => e && {
|
|
108
83
|
...e,
|
|
109
84
|
enabled: !e.enabled
|
|
110
85
|
});
|
|
111
|
-
}, []), G =
|
|
86
|
+
}, []), G = t((e) => {
|
|
112
87
|
j(typeof e == "number" ? e : null);
|
|
113
|
-
}, []), K =
|
|
88
|
+
}, []), K = i(() => S ? S.regions.map((e) => ({
|
|
114
89
|
id: e.id,
|
|
115
90
|
shape: e.shape,
|
|
116
91
|
enabled: e.enabled,
|
|
117
92
|
label: `Zone ${String(e.id)}`
|
|
118
|
-
})) : [], [S]), q =
|
|
93
|
+
})) : [], [S]), q = t((e, t) => {
|
|
119
94
|
let n = _(t);
|
|
120
95
|
n && C((t) => t && {
|
|
121
96
|
...t,
|
|
@@ -124,7 +99,7 @@ function v({ deviceId: a }) {
|
|
|
124
99
|
shape: n
|
|
125
100
|
} : t)
|
|
126
101
|
});
|
|
127
|
-
}, []), J =
|
|
102
|
+
}, []), J = t((e) => {
|
|
128
103
|
let t = _(e);
|
|
129
104
|
t && (N(null), C((e) => {
|
|
130
105
|
if (!e) return e;
|
|
@@ -140,21 +115,21 @@ function v({ deviceId: a }) {
|
|
|
140
115
|
regions: [...e.regions, i]
|
|
141
116
|
};
|
|
142
117
|
}));
|
|
143
|
-
}, []), Y =
|
|
118
|
+
}, []), Y = t((e) => {
|
|
144
119
|
k(!0), j(null), N(e);
|
|
145
|
-
}, []), ve =
|
|
120
|
+
}, []), ve = t((e) => {
|
|
146
121
|
k(!0), N(null), j(e);
|
|
147
|
-
}, []), X =
|
|
122
|
+
}, []), X = t((e) => {
|
|
148
123
|
j((t) => t === e ? null : t), C((t) => t && {
|
|
149
124
|
...t,
|
|
150
125
|
regions: t.regions.filter((t) => t.id !== e)
|
|
151
126
|
});
|
|
152
|
-
}, []), ye =
|
|
127
|
+
}, []), ye = t(() => {
|
|
153
128
|
N(null), j(null), w && C({
|
|
154
129
|
enabled: w.enabled,
|
|
155
130
|
regions: w.regions
|
|
156
131
|
});
|
|
157
|
-
}, [w]), be =
|
|
132
|
+
}, [w]), be = t(async () => {
|
|
158
133
|
if (!(!o || !S)) {
|
|
159
134
|
D(!0);
|
|
160
135
|
try {
|
|
@@ -180,7 +155,7 @@ function v({ deviceId: a }) {
|
|
|
180
155
|
supportsAudioMute: d === null ? null : d.supportsAudioMute,
|
|
181
156
|
audioEnabled: ge,
|
|
182
157
|
pendingOn: F
|
|
183
|
-
}), xe =
|
|
158
|
+
}), xe = t(async () => {
|
|
184
159
|
let e = m(Z);
|
|
185
160
|
if (!(!o || e === null)) {
|
|
186
161
|
I(e.enabled), R(null);
|
|
@@ -194,13 +169,13 @@ function v({ deviceId: a }) {
|
|
|
194
169
|
I(null);
|
|
195
170
|
}
|
|
196
171
|
}
|
|
197
|
-
}, [o, Z]), Se =
|
|
172
|
+
}, [o, Z]), Se = t(() => {
|
|
198
173
|
k((e) => (e && (N(null), j(null)), !e));
|
|
199
174
|
}, []), Q = d?.supportedShapes ?? [];
|
|
200
|
-
ie(
|
|
175
|
+
ie(i(() => O && !v && d && S ? {
|
|
201
176
|
id: pe,
|
|
202
177
|
order: fe,
|
|
203
|
-
node: /* @__PURE__ */ l(
|
|
178
|
+
node: /* @__PURE__ */ l(ue, {
|
|
204
179
|
transparent: !0,
|
|
205
180
|
items: K,
|
|
206
181
|
supportedShapes: Q,
|
|
@@ -227,7 +202,7 @@ function v({ deviceId: a }) {
|
|
|
227
202
|
let Ce = d?.supportedShapes.includes("rect") ?? !1, we = d?.supportedShapes.includes("polygon") ?? !1, $ = d !== null && (d.maxRegions <= 0 || d.supportedShapes.length === 0);
|
|
228
203
|
return o ? /* @__PURE__ */ l(re, {
|
|
229
204
|
title: "Privacy Mask",
|
|
230
|
-
icon: /* @__PURE__ */ l(
|
|
205
|
+
icon: /* @__PURE__ */ l(ae, { className: "h-3.5 w-3.5 text-foreground-subtle" }),
|
|
231
206
|
children: /* @__PURE__ */ u("div", {
|
|
232
207
|
className: "flex flex-col gap-3",
|
|
233
208
|
children: [v || $ ? /* @__PURE__ */ l("p", {
|
|
@@ -236,7 +211,7 @@ function v({ deviceId: a }) {
|
|
|
236
211
|
}) : b ? /* @__PURE__ */ l("p", {
|
|
237
212
|
className: `${s} leading-relaxed`,
|
|
238
213
|
children: "This camera hasn't answered, so what it currently masks is unknown — the editor stays closed rather than showing an empty frame you could save over. A battery camera answers once it wakes; otherwise check that it is reachable."
|
|
239
|
-
}) : !v && !$ && !b && d !== null && S !== null ? /* @__PURE__ */ u(
|
|
214
|
+
}) : !v && !$ && !b && d !== null && S !== null ? /* @__PURE__ */ u(le, { children: [
|
|
240
215
|
/* @__PURE__ */ u("p", {
|
|
241
216
|
className: `${s} leading-relaxed`,
|
|
242
217
|
children: [
|
|
@@ -319,7 +294,7 @@ function v({ deviceId: a }) {
|
|
|
319
294
|
V > 0 ? /* @__PURE__ */ l("div", {
|
|
320
295
|
className: "flex flex-col gap-1",
|
|
321
296
|
children: S.regions.map((e) => {
|
|
322
|
-
let t = A === e.id, n = e.shape.kind === "polygon" ?
|
|
297
|
+
let t = A === e.id, n = e.shape.kind === "polygon" ? de : c;
|
|
323
298
|
return /* @__PURE__ */ u("div", {
|
|
324
299
|
className: `flex items-center gap-2 rounded-md border px-2 py-1 transition-colors ${t ? "border-primary/50 bg-primary/10" : "border-border bg-surface"}`,
|
|
325
300
|
children: [/* @__PURE__ */ u("button", {
|
|
@@ -342,7 +317,7 @@ function v({ deviceId: a }) {
|
|
|
342
317
|
"aria-label": `Delete zone ${String(e.id)}`,
|
|
343
318
|
title: "Delete zone",
|
|
344
319
|
className: "inline-flex h-6 w-6 items-center justify-center rounded border border-border bg-surface text-foreground-subtle hover:border-red-400/40 hover:bg-red-500/10 hover:text-red-400 disabled:opacity-40 transition-colors",
|
|
345
|
-
children: /* @__PURE__ */ l(
|
|
320
|
+
children: /* @__PURE__ */ l(ce, { className: "h-3.5 w-3.5" })
|
|
346
321
|
})]
|
|
347
322
|
}, e.id);
|
|
348
323
|
})
|
|
@@ -363,7 +338,7 @@ function v({ deviceId: a }) {
|
|
|
363
338
|
className: Z.on === !1 || Z.on === null ? h : g,
|
|
364
339
|
children: /* @__PURE__ */ u("span", {
|
|
365
340
|
className: "inline-flex items-center gap-1.5",
|
|
366
|
-
children: [Z.on === !1 ? /* @__PURE__ */ l(
|
|
341
|
+
children: [Z.on === !1 ? /* @__PURE__ */ l(se, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ l(oe, { className: "h-3.5 w-3.5" }), Z.on === null ? "Microphone unknown" : Z.on ? "Microphone on" : "Microphone off"]
|
|
367
342
|
})
|
|
368
343
|
}), /* @__PURE__ */ l("p", {
|
|
369
344
|
className: "text-[10px] text-foreground-subtle flex-1 leading-relaxed",
|