@camstack/addon-training 0.1.6 → 0.1.7
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-Kfg9dl6B.mjs +686 -0
- package/dist/{MotionZonesSettings-DPtcv80q.mjs → MotionZonesSettings-DKtYdHUO.mjs} +101 -119
- package/dist/{PrivacyMaskSettings-Wsn5QL0_.mjs → PrivacyMaskSettings-BvLUVz86.mjs} +45 -70
- package/dist/ReactKonva-DGuYUN0L.mjs +5416 -0
- package/dist/{SceneMonitorEditor-BlMwyiH8.mjs → SceneMonitorEditor-rFYGkGHV.mjs} +82 -82
- package/dist/_stub.js +28146 -12781
- package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_training_page-Cbrdn9ib.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_training_page-B3xXUcaU.mjs} +3 -3
- package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-C7dks3FG.mjs +26 -0
- package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DpjirGmB.mjs +89 -0
- package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare___mf_0_trpc_mf_1_client__loadShare__.js-CFCVuRAs.mjs +58 -0
- package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.js-BkvDudqY.mjs +62 -0
- package/dist/{_virtual_mf___mfe_internal__addon_training_page__loadShare__react__loadShare__.js-BT_wL8s3.mjs → _virtual_mf___mfe_internal__addon_training_page__loadShare__react__loadShare__.js-DeDbF7NI.mjs} +1 -1
- package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-DnrbBvrw.mjs +34 -0
- package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare__react_mf_2_dom__loadShare__.js-DAZkHxxU.mjs +45 -0
- package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-CHqN9NLt.mjs +34 -0
- package/dist/addon-training.css +1 -1
- package/dist/{dist-BhCRZEE4.js → dist-DVDBSrjw.js} +270 -146
- package/dist/{dist-Cqa2fHNk.mjs → dist-Phot2UwD.mjs} +271 -141
- package/dist/grid-2x2-Bl3xw1w7.mjs +21 -0
- package/dist/{hostInit-BI98RYIm.mjs → hostInit-BAGO4XYA.mjs} +2 -2
- package/dist/index.js +100 -39
- package/dist/index.mjs +99 -38
- package/dist/lib-CVGFTwe0.mjs +7770 -0
- package/dist/orchestrator/training.addon.js +376 -222
- package/dist/orchestrator/training.addon.mjs +376 -222
- package/dist/{player-overlays-BX3obOMu.mjs → player-overlays-BT-6fK9N.mjs} +26 -7
- package/dist/providers/modal/training-modal.addon.js +361 -155
- package/dist/providers/modal/training-modal.addon.mjs +364 -158
- package/dist/remoteEntry.js +1 -1
- package/dist/{responsive-CdDIJCpI.mjs → responsive-Dy5RAD1s.mjs} +42 -38
- package/dist/{scene-monitor-copy-5u5w3K-Y.mjs → scene-monitor-copy-7HImRbA5.mjs} +4 -4
- package/dist/{square-C-P1-89Q.mjs → square-DoPBhbZN.mjs} +29 -4
- package/dist/{trash-2-BikGYiWf.mjs → trash-2-BwunNgLf.mjs} +1 -1
- package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_training_page__remoteEntry_js-DGLUs0o6.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_training_page__remoteEntry_js-gU49KvnZ.mjs} +399 -390
- package/package.json +1 -1
- package/dist/MaskShapeCanvas-BokARvOj.mjs +0 -13806
- package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-BkKuzhOJ.mjs +0 -26
- package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CaB1jnkt.mjs +0 -25
- package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare___mf_0_trpc_mf_1_client__loadShare__.js-B3rryujf.mjs +0 -25
- package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.js-nL4MGFRP.mjs +0 -26
- package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-DDBEvLdo.mjs +0 -26
- package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare__react_mf_2_dom__loadShare__.js-i_pnGDxd.mjs +0 -25
- package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-gTIQrhKs.mjs +0 -25
|
@@ -1,122 +1,104 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
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
|
|
1
|
+
import { S as e, _ as t, c as n, g as r, m as i, u as a } from "./_virtual_mf___mfe_internal__addon_training_page__loadShare__react__loadShare__.js-DeDbF7NI.mjs";
|
|
2
|
+
import { c as o, d as s, m as ee, u as te } from "./responsive-Dy5RAD1s.mjs";
|
|
3
|
+
import { r as c, t as l } from "./player-overlays-BT-6fK9N.mjs";
|
|
4
|
+
import { t as ne } from "./grid-2x2-Bl3xw1w7.mjs";
|
|
5
|
+
import { n as u, r as d, t as f } from "./_virtual_mf___mfe_internal__addon_training_page__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-DnrbBvrw.mjs";
|
|
6
|
+
import { MaskShapeCanvas as p } from "./MaskShapeCanvas-Kfg9dl6B.mjs";
|
|
25
7
|
//#region ../ui-library/src/composites/cap-settings/MotionZonesSettings.tsx
|
|
26
8
|
e();
|
|
27
|
-
var
|
|
9
|
+
var m = 110, h = "motion-zones", g = 0, _ = [
|
|
28
10
|
1,
|
|
29
11
|
2,
|
|
30
12
|
3
|
|
31
|
-
],
|
|
32
|
-
function
|
|
13
|
+
], v = 1, y = "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", b = "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";
|
|
14
|
+
function x(e, t, n) {
|
|
33
15
|
let r = t * n, i = Array.from({ length: r });
|
|
34
16
|
for (let t = 0; t < r; t += 1) i[t] = e[t] === !0;
|
|
35
17
|
return i;
|
|
36
18
|
}
|
|
37
|
-
function
|
|
19
|
+
function S(e, t) {
|
|
38
20
|
if (e.length !== t.length) return !1;
|
|
39
21
|
for (let n = 0; n < e.length; n += 1) if (e[n] !== t[n]) return !1;
|
|
40
22
|
return !0;
|
|
41
23
|
}
|
|
42
|
-
function
|
|
24
|
+
function C(e, t) {
|
|
43
25
|
return Math.ceil(e / t);
|
|
44
26
|
}
|
|
45
|
-
function
|
|
27
|
+
function w(e, t, n) {
|
|
46
28
|
return Math.min(n - 1, Math.floor((e + .5) / t * n));
|
|
47
29
|
}
|
|
48
|
-
function
|
|
49
|
-
let i =
|
|
30
|
+
function T(e, t, n, r) {
|
|
31
|
+
let i = C(t, r), a = C(n, r), o = Array.from({ length: i * a }, () => !1);
|
|
50
32
|
for (let r = 0; r < n; r += 1) {
|
|
51
|
-
let s =
|
|
52
|
-
for (let n = 0; n < t; n += 1) e[r * t + n] === !0 && (o[s * i +
|
|
33
|
+
let s = w(r, n, a);
|
|
34
|
+
for (let n = 0; n < t; n += 1) e[r * t + n] === !0 && (o[s * i + w(n, t, i)] = !0);
|
|
53
35
|
}
|
|
54
36
|
return o;
|
|
55
37
|
}
|
|
56
|
-
function
|
|
57
|
-
let i =
|
|
38
|
+
function E(e, t, n, r) {
|
|
39
|
+
let i = C(t, r), a = C(n, r), o = Array.from({ length: t * n }, () => !1);
|
|
58
40
|
for (let r = 0; r < n; r += 1) {
|
|
59
|
-
let s =
|
|
60
|
-
for (let n = 0; n < t; n += 1) o[r * t + n] = e[s * i +
|
|
41
|
+
let s = w(r, n, a);
|
|
42
|
+
for (let n = 0; n < t; n += 1) o[r * t + n] = e[s * i + w(n, t, i)] === !0;
|
|
61
43
|
}
|
|
62
44
|
return o;
|
|
63
45
|
}
|
|
64
|
-
function
|
|
65
|
-
let
|
|
46
|
+
function D({ deviceId: e }) {
|
|
47
|
+
let w = s(ee().trpcClient, e), [D, O] = t(null), [k, A] = t(!1), [j, M] = t(null), [N, P] = t(null), [F, I] = t(v), [L, R] = t(!1), [z, B] = t(!1), V = r(!1);
|
|
66
48
|
a(() => {
|
|
67
|
-
if (!
|
|
49
|
+
if (!w) return;
|
|
68
50
|
let e = !1;
|
|
69
|
-
return V.current = !1, O(null), A(!1), M(null), P(null), I(
|
|
51
|
+
return V.current = !1, O(null), A(!1), M(null), P(null), I(v), B(!1), (async () => {
|
|
70
52
|
try {
|
|
71
|
-
let t = await
|
|
53
|
+
let t = await w.motionZones?.getOptions({});
|
|
72
54
|
if (e) return;
|
|
73
55
|
if (!t) throw Error("device proxy not ready");
|
|
74
56
|
if (O(t), V.current) return;
|
|
75
|
-
let n = await
|
|
57
|
+
let n = await w.motionZones?.getStatus({});
|
|
76
58
|
if (e) return;
|
|
77
59
|
if (!n) throw Error("device proxy not ready");
|
|
78
60
|
V.current = !0;
|
|
79
|
-
let r = n.regions.find((e) => e.shape.kind === "grid"), i =
|
|
80
|
-
P(i), M(
|
|
61
|
+
let r = n.regions.find((e) => e.shape.kind === "grid"), i = x(r ? r.shape.cells : [], t.grid.width, t.grid.height);
|
|
62
|
+
P(i), M(T(i, t.grid.width, t.grid.height, v));
|
|
81
63
|
} catch (t) {
|
|
82
64
|
if (e) return;
|
|
83
|
-
|
|
65
|
+
te(t) ? A(!0) : console.error("Motion Zones load failed", t);
|
|
84
66
|
}
|
|
85
67
|
})(), () => {
|
|
86
68
|
e = !0;
|
|
87
69
|
};
|
|
88
|
-
}, [
|
|
89
|
-
let H =
|
|
70
|
+
}, [w]);
|
|
71
|
+
let H = D ? D.grid.width : 0, U = D ? D.grid.height : 0, W = C(H, F), G = C(U, F), K = i(() => j && D ? E(j, H, U, F) : null, [
|
|
90
72
|
j,
|
|
91
|
-
|
|
73
|
+
D,
|
|
92
74
|
H,
|
|
93
75
|
U,
|
|
94
76
|
F
|
|
95
|
-
]), q = i(() => K !== null && N !== null && !
|
|
77
|
+
]), q = i(() => K !== null && N !== null && !S(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 = n((e) => {
|
|
96
78
|
X > 0 && M(Array.from({ length: X }, () => e));
|
|
97
|
-
}, [X]), re =
|
|
79
|
+
}, [X]), re = n(() => {
|
|
98
80
|
M((e) => e && e.map((e) => !e));
|
|
99
|
-
}, []), ie =
|
|
100
|
-
N &&
|
|
81
|
+
}, []), ie = n(() => {
|
|
82
|
+
N && D && M(T(N, H, U, F));
|
|
101
83
|
}, [
|
|
102
84
|
N,
|
|
103
|
-
|
|
85
|
+
D,
|
|
104
86
|
H,
|
|
105
87
|
U,
|
|
106
88
|
F
|
|
107
|
-
]), ae =
|
|
108
|
-
e === F || !
|
|
89
|
+
]), ae = n((e) => {
|
|
90
|
+
e === F || !D || M((t) => {
|
|
109
91
|
if (!t) return I(e), t;
|
|
110
|
-
let n = E(
|
|
92
|
+
let n = T(E(t, H, U, F), H, U, e);
|
|
111
93
|
return I(e), n;
|
|
112
94
|
});
|
|
113
95
|
}, [
|
|
114
96
|
F,
|
|
115
|
-
|
|
97
|
+
D,
|
|
116
98
|
H,
|
|
117
99
|
U
|
|
118
|
-
]), Q = i(() =>
|
|
119
|
-
id:
|
|
100
|
+
]), Q = i(() => D && j ? [{
|
|
101
|
+
id: g,
|
|
120
102
|
shape: {
|
|
121
103
|
kind: "grid",
|
|
122
104
|
gridWidth: W,
|
|
@@ -124,31 +106,31 @@ function O({ deviceId: e }) {
|
|
|
124
106
|
cells: [...j]
|
|
125
107
|
}
|
|
126
108
|
}] : [], [
|
|
127
|
-
|
|
109
|
+
D,
|
|
128
110
|
j,
|
|
129
111
|
W,
|
|
130
112
|
G
|
|
131
|
-
]), $ =
|
|
113
|
+
]), $ = n((e, t) => {
|
|
132
114
|
t.kind === "grid" && M(t.cells);
|
|
133
|
-
}, []), oe =
|
|
134
|
-
if (!(!
|
|
115
|
+
}, []), oe = n(async () => {
|
|
116
|
+
if (!(!w || !j || !D)) {
|
|
135
117
|
R(!0);
|
|
136
118
|
try {
|
|
137
|
-
let e =
|
|
119
|
+
let e = E(j, D.grid.width, D.grid.height, F), t = {
|
|
138
120
|
kind: "grid",
|
|
139
|
-
gridWidth:
|
|
140
|
-
gridHeight:
|
|
121
|
+
gridWidth: D.grid.width,
|
|
122
|
+
gridHeight: D.grid.height,
|
|
141
123
|
cells: e
|
|
142
124
|
};
|
|
143
|
-
await
|
|
144
|
-
id:
|
|
125
|
+
await w.motionZones?.setZone({ patch: { regions: [{
|
|
126
|
+
id: g,
|
|
145
127
|
enabled: !0,
|
|
146
128
|
shape: t
|
|
147
129
|
}] } });
|
|
148
|
-
let n = await
|
|
130
|
+
let n = await w.motionZones?.getStatus({});
|
|
149
131
|
if (n) {
|
|
150
|
-
let e = n.regions.find((e) => e.shape.kind === "grid"), t =
|
|
151
|
-
P(t), M(
|
|
132
|
+
let e = n.regions.find((e) => e.shape.kind === "grid"), t = x(e ? e.shape.cells : [], D.grid.width, D.grid.height);
|
|
133
|
+
P(t), M(T(t, D.grid.width, D.grid.height, F));
|
|
152
134
|
}
|
|
153
135
|
} catch (e) {
|
|
154
136
|
console.error("Motion Zones save failed", e);
|
|
@@ -157,15 +139,15 @@ function O({ deviceId: e }) {
|
|
|
157
139
|
}
|
|
158
140
|
}
|
|
159
141
|
}, [
|
|
160
|
-
|
|
142
|
+
w,
|
|
161
143
|
j,
|
|
162
|
-
|
|
144
|
+
D,
|
|
163
145
|
F
|
|
164
146
|
]);
|
|
165
|
-
return
|
|
166
|
-
id:
|
|
167
|
-
order:
|
|
168
|
-
node: /* @__PURE__ */
|
|
147
|
+
return l(i(() => z && !k && D && j ? {
|
|
148
|
+
id: h,
|
|
149
|
+
order: m,
|
|
150
|
+
node: /* @__PURE__ */ u(p, {
|
|
169
151
|
transparent: !0,
|
|
170
152
|
items: Q,
|
|
171
153
|
supportedShapes: ["grid"],
|
|
@@ -173,7 +155,7 @@ function O({ deviceId: e }) {
|
|
|
173
155
|
width: W,
|
|
174
156
|
height: G
|
|
175
157
|
},
|
|
176
|
-
selectedId:
|
|
158
|
+
selectedId: g,
|
|
177
159
|
onSelect: () => {},
|
|
178
160
|
onShapeChange: $,
|
|
179
161
|
onDrawComplete: () => {},
|
|
@@ -182,129 +164,129 @@ function O({ deviceId: e }) {
|
|
|
182
164
|
} : null, [
|
|
183
165
|
z,
|
|
184
166
|
k,
|
|
185
|
-
|
|
167
|
+
D,
|
|
186
168
|
j,
|
|
187
169
|
Q,
|
|
188
170
|
$,
|
|
189
171
|
W,
|
|
190
172
|
G
|
|
191
|
-
])),
|
|
173
|
+
])), w ? /* @__PURE__ */ u(c, {
|
|
192
174
|
title: "Motion Zones",
|
|
193
|
-
icon: /* @__PURE__ */
|
|
194
|
-
children: /* @__PURE__ */
|
|
175
|
+
icon: /* @__PURE__ */ u(ne, { className: "h-3.5 w-3.5 text-foreground-subtle" }),
|
|
176
|
+
children: /* @__PURE__ */ u("div", {
|
|
195
177
|
className: "flex flex-col gap-3",
|
|
196
|
-
children: k ? /* @__PURE__ */
|
|
197
|
-
className: `${
|
|
178
|
+
children: k ? /* @__PURE__ */ u("p", {
|
|
179
|
+
className: `${o} leading-relaxed`,
|
|
198
180
|
children: "This camera doesn't expose an on-board motion zones grid."
|
|
199
|
-
}) : !k &&
|
|
200
|
-
className: `${
|
|
181
|
+
}) : !k && D !== null && j !== null ? /* @__PURE__ */ d(f, { children: [/* @__PURE__ */ d("p", {
|
|
182
|
+
className: `${o} leading-relaxed`,
|
|
201
183
|
children: [
|
|
202
184
|
"Toggle ",
|
|
203
|
-
/* @__PURE__ */
|
|
185
|
+
/* @__PURE__ */ u("strong", {
|
|
204
186
|
className: "text-foreground",
|
|
205
187
|
children: "Edit grid"
|
|
206
188
|
}),
|
|
207
189
|
" to paint the region directly on the live frame, then ",
|
|
208
|
-
/* @__PURE__ */
|
|
190
|
+
/* @__PURE__ */ u("strong", {
|
|
209
191
|
className: "text-foreground",
|
|
210
192
|
children: "Save"
|
|
211
193
|
}),
|
|
212
194
|
" to push the mask to the camera. Pick a bigger",
|
|
213
195
|
" ",
|
|
214
|
-
/* @__PURE__ */
|
|
196
|
+
/* @__PURE__ */ u("strong", {
|
|
215
197
|
className: "text-foreground",
|
|
216
198
|
children: "Cell size"
|
|
217
199
|
}),
|
|
218
200
|
" for quicker, broad-stroke painting — it's resampled to the camera's native ",
|
|
219
|
-
|
|
201
|
+
D.grid.width,
|
|
220
202
|
"×",
|
|
221
|
-
|
|
203
|
+
D.grid.height,
|
|
222
204
|
" grid on save (×1 is the finest)."
|
|
223
205
|
]
|
|
224
|
-
}), /* @__PURE__ */
|
|
206
|
+
}), /* @__PURE__ */ d("div", {
|
|
225
207
|
className: "flex items-center gap-2 flex-wrap",
|
|
226
208
|
children: [
|
|
227
|
-
/* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ u("button", {
|
|
228
210
|
type: "button",
|
|
229
211
|
onClick: () => B((e) => !e),
|
|
230
212
|
disabled: L,
|
|
231
213
|
"aria-pressed": z,
|
|
232
|
-
className: z ?
|
|
214
|
+
className: z ? b : y,
|
|
233
215
|
children: z ? "Done editing" : "Edit grid"
|
|
234
216
|
}),
|
|
235
|
-
/* @__PURE__ */
|
|
217
|
+
/* @__PURE__ */ u("button", {
|
|
236
218
|
type: "button",
|
|
237
219
|
onClick: () => Z(!0),
|
|
238
220
|
disabled: L,
|
|
239
|
-
className:
|
|
221
|
+
className: y,
|
|
240
222
|
children: "All on"
|
|
241
223
|
}),
|
|
242
|
-
/* @__PURE__ */
|
|
224
|
+
/* @__PURE__ */ u("button", {
|
|
243
225
|
type: "button",
|
|
244
226
|
onClick: () => Z(!1),
|
|
245
227
|
disabled: L,
|
|
246
|
-
className:
|
|
228
|
+
className: y,
|
|
247
229
|
children: "All off"
|
|
248
230
|
}),
|
|
249
|
-
/* @__PURE__ */
|
|
231
|
+
/* @__PURE__ */ u("button", {
|
|
250
232
|
type: "button",
|
|
251
233
|
onClick: re,
|
|
252
234
|
disabled: L,
|
|
253
|
-
className:
|
|
235
|
+
className: y,
|
|
254
236
|
children: "Invert"
|
|
255
237
|
}),
|
|
256
|
-
/* @__PURE__ */
|
|
238
|
+
/* @__PURE__ */ d("div", {
|
|
257
239
|
className: "flex items-center gap-1 ml-1",
|
|
258
240
|
role: "group",
|
|
259
241
|
"aria-label": "Cell size",
|
|
260
|
-
children: [/* @__PURE__ */
|
|
261
|
-
className: `${
|
|
242
|
+
children: [/* @__PURE__ */ u("span", {
|
|
243
|
+
className: `${o} mr-0.5`,
|
|
262
244
|
children: "Cell size"
|
|
263
|
-
}),
|
|
245
|
+
}), _.map((e) => /* @__PURE__ */ d("button", {
|
|
264
246
|
type: "button",
|
|
265
247
|
onClick: () => ae(e),
|
|
266
248
|
disabled: L,
|
|
267
249
|
"aria-pressed": F === e,
|
|
268
|
-
title: e === 1 ? `Camera grid ${H}×${U} (finest)` : `${
|
|
269
|
-
className: F === e ?
|
|
250
|
+
title: e === 1 ? `Camera grid ${H}×${U} (finest)` : `${C(H, e)}×${C(U, e)} painting grid · cells ×${e} bigger`,
|
|
251
|
+
className: F === e ? b : y,
|
|
270
252
|
children: ["×", e]
|
|
271
253
|
}, e))]
|
|
272
254
|
}),
|
|
273
|
-
/* @__PURE__ */
|
|
274
|
-
className: `${
|
|
255
|
+
/* @__PURE__ */ d("span", {
|
|
256
|
+
className: `${o} ml-1 tabular-nums`,
|
|
275
257
|
children: [
|
|
276
258
|
J,
|
|
277
259
|
" / ",
|
|
278
260
|
Y,
|
|
279
261
|
" cells · ",
|
|
280
|
-
|
|
262
|
+
D.grid.width,
|
|
281
263
|
"×",
|
|
282
|
-
|
|
264
|
+
D.grid.height,
|
|
283
265
|
F === 1 ? "" : ` · paint ${W}×${G}`
|
|
284
266
|
]
|
|
285
267
|
}),
|
|
286
|
-
/* @__PURE__ */
|
|
287
|
-
/* @__PURE__ */
|
|
268
|
+
/* @__PURE__ */ u("span", { className: "flex-1" }),
|
|
269
|
+
/* @__PURE__ */ u("button", {
|
|
288
270
|
type: "button",
|
|
289
271
|
onClick: ie,
|
|
290
272
|
disabled: L || !q,
|
|
291
273
|
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
274
|
children: "Revert"
|
|
293
275
|
}),
|
|
294
|
-
/* @__PURE__ */
|
|
276
|
+
/* @__PURE__ */ u("button", {
|
|
295
277
|
type: "button",
|
|
296
278
|
onClick: () => void oe(),
|
|
297
279
|
disabled: L || !q,
|
|
298
|
-
className:
|
|
280
|
+
className: b,
|
|
299
281
|
children: L ? "Saving…" : "Save"
|
|
300
282
|
})
|
|
301
283
|
]
|
|
302
|
-
})] }) : /* @__PURE__ */
|
|
303
|
-
className: `${
|
|
284
|
+
})] }) : /* @__PURE__ */ u("p", {
|
|
285
|
+
className: `${o} leading-relaxed`,
|
|
304
286
|
children: "Loading the camera's grid…"
|
|
305
287
|
})
|
|
306
288
|
})
|
|
307
289
|
}) : null;
|
|
308
290
|
}
|
|
309
291
|
//#endregion
|
|
310
|
-
export {
|
|
292
|
+
export { D as MotionZonesSettings };
|
|
@@ -1,39 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { t as
|
|
6
|
-
import { n as l, r as u, t as
|
|
7
|
-
import { MaskShapeCanvas as
|
|
8
|
-
var
|
|
1
|
+
import { S as e, _ as t, c as n, g as r, m as i, u as a } from "./_virtual_mf___mfe_internal__addon_training_page__loadShare__react__loadShare__.js-DeDbF7NI.mjs";
|
|
2
|
+
import { c as o, d as ee, g as s, m as te, u as ne } from "./responsive-Dy5RAD1s.mjs";
|
|
3
|
+
import { r as re, t as ie } from "./player-overlays-BT-6fK9N.mjs";
|
|
4
|
+
import { i as ae, n as oe, r as se, t as c } from "./square-DoPBhbZN.mjs";
|
|
5
|
+
import { t as ce } from "./trash-2-BwunNgLf.mjs";
|
|
6
|
+
import { n as l, r as u, t as le } from "./_virtual_mf___mfe_internal__addon_training_page__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-DnrbBvrw.mjs";
|
|
7
|
+
import { MaskShapeCanvas as ue } from "./MaskShapeCanvas-Kfg9dl6B.mjs";
|
|
8
|
+
var de = s("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();
|
|
@@ -68,17 +43,17 @@ function he(e, t) {
|
|
|
68
43
|
return !0;
|
|
69
44
|
}
|
|
70
45
|
function v({ deviceId: e }) {
|
|
71
|
-
let
|
|
46
|
+
let s = ee(te().trpcClient, e), [d, f] = t(null), [v, y] = t(!1), [b, x] = t(!1), [S, C] = t(null), [w, T] = t(null), [E, D] = t(!1), [O, k] = t(!1), [A, j] = t(null), [M, N] = t(null), [ge, P] = t(null), [F, I] = t(null), [L, R] = t(null), z = r(!1);
|
|
72
47
|
a(() => {
|
|
73
|
-
if (!
|
|
48
|
+
if (!s) 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 () => {
|
|
76
51
|
try {
|
|
77
|
-
let t = await
|
|
52
|
+
let t = await s.privacyMask?.getOptions({});
|
|
78
53
|
if (e) return;
|
|
79
54
|
if (!t) throw Error("device proxy not ready");
|
|
80
55
|
if (f(t), z.current) return;
|
|
81
|
-
let n = await
|
|
56
|
+
let n = await s.privacyMask?.getStatus({});
|
|
82
57
|
if (e) return;
|
|
83
58
|
if (!n) throw Error("device proxy not ready");
|
|
84
59
|
if (n.regions === null) {
|
|
@@ -93,29 +68,29 @@ function v({ deviceId: e }) {
|
|
|
93
68
|
T(r), C(r), P(n.audioEnabled);
|
|
94
69
|
} catch (t) {
|
|
95
70
|
if (e) return;
|
|
96
|
-
|
|
71
|
+
ne(t) ? y(!0) : console.error("Privacy Mask load failed", t);
|
|
97
72
|
}
|
|
98
73
|
})(), () => {
|
|
99
74
|
e = !0;
|
|
100
75
|
};
|
|
101
|
-
}, [
|
|
76
|
+
}, [s]);
|
|
102
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);
|
|
103
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 = n(() => {
|
|
107
82
|
C((e) => e && {
|
|
108
83
|
...e,
|
|
109
84
|
enabled: !e.enabled
|
|
110
85
|
});
|
|
111
|
-
}, []), G =
|
|
86
|
+
}, []), G = n((e) => {
|
|
112
87
|
j(typeof e == "number" ? e : null);
|
|
113
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 = n((e, t) => {
|
|
119
94
|
let n = _(t);
|
|
120
95
|
n && C((t) => t && {
|
|
121
96
|
...t,
|
|
@@ -124,7 +99,7 @@ function v({ deviceId: e }) {
|
|
|
124
99
|
shape: n
|
|
125
100
|
} : t)
|
|
126
101
|
});
|
|
127
|
-
}, []), J =
|
|
102
|
+
}, []), J = n((e) => {
|
|
128
103
|
let t = _(e);
|
|
129
104
|
t && (N(null), C((e) => {
|
|
130
105
|
if (!e) return e;
|
|
@@ -140,29 +115,29 @@ function v({ deviceId: e }) {
|
|
|
140
115
|
regions: [...e.regions, i]
|
|
141
116
|
};
|
|
142
117
|
}));
|
|
143
|
-
}, []), Y =
|
|
118
|
+
}, []), Y = n((e) => {
|
|
144
119
|
k(!0), j(null), N(e);
|
|
145
|
-
}, []), ve =
|
|
120
|
+
}, []), ve = n((e) => {
|
|
146
121
|
k(!0), N(null), j(e);
|
|
147
|
-
}, []), X =
|
|
122
|
+
}, []), X = n((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 = n(() => {
|
|
153
128
|
N(null), j(null), w && C({
|
|
154
129
|
enabled: w.enabled,
|
|
155
130
|
regions: w.regions
|
|
156
131
|
});
|
|
157
|
-
}, [w]), be =
|
|
158
|
-
if (!(!
|
|
132
|
+
}, [w]), be = n(async () => {
|
|
133
|
+
if (!(!s || !S)) {
|
|
159
134
|
D(!0);
|
|
160
135
|
try {
|
|
161
|
-
await
|
|
136
|
+
await s.privacyMask?.setMask({ patch: {
|
|
162
137
|
enabled: S.enabled,
|
|
163
138
|
regions: [...S.regions]
|
|
164
139
|
} });
|
|
165
|
-
let e = await
|
|
140
|
+
let e = await s.privacyMask?.getStatus({});
|
|
166
141
|
if (e && e.regions !== null) {
|
|
167
142
|
let t = {
|
|
168
143
|
enabled: e.enabled,
|
|
@@ -176,17 +151,17 @@ function v({ deviceId: e }) {
|
|
|
176
151
|
D(!1);
|
|
177
152
|
}
|
|
178
153
|
}
|
|
179
|
-
}, [
|
|
154
|
+
}, [s, S]), Z = p({
|
|
180
155
|
supportsAudioMute: d === null ? null : d.supportsAudioMute,
|
|
181
156
|
audioEnabled: ge,
|
|
182
157
|
pendingOn: F
|
|
183
|
-
}), xe =
|
|
158
|
+
}), xe = n(async () => {
|
|
184
159
|
let e = m(Z);
|
|
185
|
-
if (!(!
|
|
160
|
+
if (!(!s || e === null)) {
|
|
186
161
|
I(e.enabled), R(null);
|
|
187
162
|
try {
|
|
188
|
-
await
|
|
189
|
-
let t = await
|
|
163
|
+
await s.privacyMask?.setAudioEnabled(e);
|
|
164
|
+
let t = await s.privacyMask?.getStatus({});
|
|
190
165
|
t && P(t.audioEnabled);
|
|
191
166
|
} catch (e) {
|
|
192
167
|
console.error("Privacy microphone write failed — reverting", e), R(e instanceof Error ? e.message : String(e));
|
|
@@ -194,13 +169,13 @@ function v({ deviceId: e }) {
|
|
|
194
169
|
I(null);
|
|
195
170
|
}
|
|
196
171
|
}
|
|
197
|
-
}, [
|
|
172
|
+
}, [s, Z]), Se = n(() => {
|
|
198
173
|
k((e) => (e && (N(null), j(null)), !e));
|
|
199
174
|
}, []), Q = d?.supportedShapes ?? [];
|
|
200
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,
|
|
@@ -225,20 +200,20 @@ function v({ deviceId: e }) {
|
|
|
225
200
|
M
|
|
226
201
|
]));
|
|
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
|
-
return
|
|
203
|
+
return s ? /* @__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", {
|
|
234
|
-
className: `${
|
|
209
|
+
className: `${o} leading-relaxed`,
|
|
235
210
|
children: "This camera doesn't support an on-board privacy mask."
|
|
236
211
|
}) : b ? /* @__PURE__ */ l("p", {
|
|
237
|
-
className: `${
|
|
212
|
+
className: `${o} 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
|
-
className: `${
|
|
216
|
+
className: `${o} leading-relaxed`,
|
|
242
217
|
children: [
|
|
243
218
|
"Toggle ",
|
|
244
219
|
/* @__PURE__ */ l("strong", {
|
|
@@ -291,7 +266,7 @@ function v({ deviceId: e }) {
|
|
|
291
266
|
children: "+ Polygon"
|
|
292
267
|
}),
|
|
293
268
|
/* @__PURE__ */ u("span", {
|
|
294
|
-
className: `${
|
|
269
|
+
className: `${o} ml-1 tabular-nums`,
|
|
295
270
|
children: [
|
|
296
271
|
V,
|
|
297
272
|
" / ",
|
|
@@ -319,7 +294,7 @@ function v({ deviceId: e }) {
|
|
|
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,13 +317,13 @@ function v({ deviceId: e }) {
|
|
|
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
|
})
|
|
349
324
|
}) : null
|
|
350
325
|
] }) : /* @__PURE__ */ l("p", {
|
|
351
|
-
className: `${
|
|
326
|
+
className: `${o} leading-relaxed`,
|
|
352
327
|
children: "Loading the camera's privacy mask…"
|
|
353
328
|
}), Z.supported && /* @__PURE__ */ u("div", {
|
|
354
329
|
className: "flex items-start gap-3 rounded-md border border-border bg-surface px-2 py-2",
|
|
@@ -363,7 +338,7 @@ function v({ deviceId: e }) {
|
|
|
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",
|