@camstack/addon-training 0.1.40 → 0.1.42
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/{MotionZonesSettings-DBtAXpEm.mjs → MotionZonesSettings-DZgoN8V_.mjs} +55 -55
- package/dist/{PrivacyMaskSettings-C3tyM8s9.mjs → PrivacyMaskSettings-7L2OX3dp.mjs} +82 -86
- package/dist/{SceneMonitorEditor-D6Q3z17B.mjs → SceneMonitorEditor-CwULmLkP.mjs} +318 -339
- package/dist/_stub.js +5170 -9054
- package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_training_page-CHYHBYUh.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_training_page-DzsEYUgl.mjs} +3 -3
- package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-LhaXEy4l.mjs +26 -0
- package/dist/addon-training.css +1 -1
- package/dist/chevron-right-D3StkdcR.mjs +10 -0
- package/dist/createLucideIcon-CPP1Jzoz.mjs +44 -0
- package/dist/{dist-CbTzxq0W.mjs → dist-BtEl1kYQ.mjs} +47970 -29426
- package/dist/{dist-CJXTMYT2.js → dist-wRpOWEq6.js} +47970 -29426
- package/dist/{grid-2x2-tkDBCRad.mjs → grid-2x2-Yngdckwo.mjs} +1 -1
- package/dist/{hostInit-GIXFhqMx.mjs → hostInit-1OJB0wPE.mjs} +2 -2
- package/dist/icons-C4_Ji5S0.mjs +27953 -0
- package/dist/index.js +1 -1
- package/dist/mic-off-DPNSd6G7.mjs +32 -0
- package/dist/orchestrator/training.addon.js +1 -1
- package/dist/orchestrator/training.addon.mjs +1 -1
- package/dist/{player-overlays-DMLlEwmn.mjs → player-overlays-CqD89xkd.mjs} +21 -28
- package/dist/providers/modal/training-modal.addon.js +1 -1
- package/dist/providers/modal/training-modal.addon.mjs +1 -1
- package/dist/remoteEntry.js +1 -1
- package/dist/responsive-Dwyuxd3q.mjs +84 -0
- package/dist/rotate-ccw-Dak-lXgZ.mjs +52 -0
- package/dist/{scene-monitor-copy-B-6xPmDm.mjs → scene-monitor-copy-DX2u-htD.mjs} +40 -91
- package/dist/settings-2-Cgiv3kQb.mjs +25 -0
- package/dist/{square-D49AvsjC.mjs → square-B_679zIX.mjs} +4 -29
- package/dist/{trash-2-BwTJ2h2p.mjs → trash-2-DC8LDYlI.mjs} +1 -1
- package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_training_page__remoteEntry_js-B3ZFopEz.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_training_page__remoteEntry_js-D0zbWJUR.mjs} +1 -1
- package/dist/zoom-out-BJoVDYa3.mjs +2729 -0
- package/package.json +1 -1
- package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-NCFNuw0Q.mjs +0 -26
- package/dist/responsive-C0tM8Z6S.mjs +0 -126
|
@@ -1,39 +1,18 @@
|
|
|
1
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 {
|
|
3
|
-
import {
|
|
4
|
-
import { t as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
d: "M14 17H5",
|
|
10
|
-
key: "gfn3mx"
|
|
11
|
-
}],
|
|
12
|
-
["path", {
|
|
13
|
-
d: "M19 7h-9",
|
|
14
|
-
key: "6i9tg"
|
|
15
|
-
}],
|
|
16
|
-
["circle", {
|
|
17
|
-
cx: "17",
|
|
18
|
-
cy: "17",
|
|
19
|
-
r: "3",
|
|
20
|
-
key: "18b49y"
|
|
21
|
-
}],
|
|
22
|
-
["circle", {
|
|
23
|
-
cx: "7",
|
|
24
|
-
cy: "7",
|
|
25
|
-
r: "3",
|
|
26
|
-
key: "dfmy0x"
|
|
27
|
-
}]
|
|
28
|
-
]);
|
|
29
|
-
//#endregion
|
|
2
|
+
import { n as o, r as s, t as c } from "./rotate-ccw-Dak-lXgZ.mjs";
|
|
3
|
+
import { t as l } from "./settings-2-Cgiv3kQb.mjs";
|
|
4
|
+
import { t as u } from "./trash-2-DC8LDYlI.mjs";
|
|
5
|
+
import { _ as d, f, h as p, m, v as h } from "./responsive-Dwyuxd3q.mjs";
|
|
6
|
+
import { n as g, r as _, t as v } from "./_virtual_mf___mfe_internal__addon_training_page__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-DnrbBvrw.mjs";
|
|
7
|
+
import { a as ee, c as y, i as b, n as te, o as x, r as S, s as ne, t as re } from "./scene-monitor-copy-DX2u-htD.mjs";
|
|
8
|
+
import { MaskShapeCanvas as C } from "./MaskShapeCanvas-Kfg9dl6B.mjs";
|
|
30
9
|
//#region ../ui-library/src/composites/cap-settings/SceneReferenceGallery.tsx
|
|
31
10
|
e();
|
|
32
|
-
var
|
|
33
|
-
function
|
|
34
|
-
return `${
|
|
11
|
+
var w = y("/addon/pipeline-analytics/event-media");
|
|
12
|
+
function T(e) {
|
|
13
|
+
return `${w}/m/${e}`;
|
|
35
14
|
}
|
|
36
|
-
function
|
|
15
|
+
function E(e) {
|
|
37
16
|
let t = /* @__PURE__ */ new Map();
|
|
38
17
|
for (let n of e.states) n.references.forEach((e, r) => {
|
|
39
18
|
let i = t.get(e.condition) ?? [];
|
|
@@ -48,45 +27,45 @@ function j(e) {
|
|
|
48
27
|
tiles: [...t].sort((e, t) => t.reference.capturedAt - e.reference.capturedAt)
|
|
49
28
|
})).sort((e, t) => e.condition.localeCompare(t.condition));
|
|
50
29
|
}
|
|
51
|
-
function
|
|
30
|
+
function D(e) {
|
|
52
31
|
return e.states.reduce((e, t) => e + t.references.length, 0);
|
|
53
32
|
}
|
|
54
|
-
var
|
|
55
|
-
function
|
|
56
|
-
let i =
|
|
57
|
-
return i.length === 0 ? /* @__PURE__ */
|
|
58
|
-
className: `${
|
|
33
|
+
var O = "rounded border border-danger/50 bg-danger/10 px-1 py-0.5 text-[10px] font-medium text-danger hover:bg-danger/20 disabled:opacity-40 transition-colors";
|
|
34
|
+
function k({ monitor: e, disabled: n, onDelete: r }) {
|
|
35
|
+
let i = E(e), a = D(e), [o, s] = t(null);
|
|
36
|
+
return i.length === 0 ? /* @__PURE__ */ g("p", {
|
|
37
|
+
className: `${f} leading-relaxed`,
|
|
59
38
|
children: "No photographs captured yet. Press “Capture daylight” to take the one this scene will judge everything against."
|
|
60
|
-
}) : /* @__PURE__ */
|
|
39
|
+
}) : /* @__PURE__ */ g("div", {
|
|
61
40
|
className: "flex flex-col gap-2",
|
|
62
|
-
children: i.map((e) => /* @__PURE__ */
|
|
41
|
+
children: i.map((e) => /* @__PURE__ */ _("div", {
|
|
63
42
|
className: "flex flex-col gap-1",
|
|
64
|
-
children: [/* @__PURE__ */
|
|
43
|
+
children: [/* @__PURE__ */ _("p", {
|
|
65
44
|
className: "text-[10px] font-semibold uppercase tracking-wide text-foreground-subtle",
|
|
66
45
|
children: [
|
|
67
|
-
|
|
46
|
+
x(e.condition),
|
|
68
47
|
" · ",
|
|
69
48
|
e.tiles.length
|
|
70
49
|
]
|
|
71
|
-
}), /* @__PURE__ */
|
|
50
|
+
}), /* @__PURE__ */ g("ul", {
|
|
72
51
|
className: "flex flex-wrap gap-1.5",
|
|
73
52
|
children: e.tiles.map((t) => {
|
|
74
|
-
let i = `${t.stateId}:${String(t.index)}`,
|
|
75
|
-
return /* @__PURE__ */
|
|
53
|
+
let i = `${t.stateId}:${String(t.index)}`, c = a === 1, l = o === i;
|
|
54
|
+
return /* @__PURE__ */ _("li", {
|
|
76
55
|
className: "flex w-24 flex-col gap-1 rounded-md border border-border p-1",
|
|
77
56
|
children: [
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
-
className: `${
|
|
81
|
-
children:
|
|
57
|
+
/* @__PURE__ */ g(A, { reference: t.reference }),
|
|
58
|
+
/* @__PURE__ */ g("span", {
|
|
59
|
+
className: `${f} tabular-nums`,
|
|
60
|
+
children: j(t.reference.capturedAt)
|
|
82
61
|
}),
|
|
83
|
-
/* @__PURE__ */
|
|
62
|
+
/* @__PURE__ */ _("button", {
|
|
84
63
|
type: "button",
|
|
85
|
-
className:
|
|
64
|
+
className: O,
|
|
86
65
|
disabled: n,
|
|
87
|
-
"aria-label": `Delete the ${
|
|
66
|
+
"aria-label": `Delete the ${x(e.condition).toLowerCase()} photograph from ${j(t.reference.capturedAt)}`,
|
|
88
67
|
onClick: () => {
|
|
89
|
-
if (
|
|
68
|
+
if (c && !l) {
|
|
90
69
|
s(i);
|
|
91
70
|
return;
|
|
92
71
|
}
|
|
@@ -95,9 +74,9 @@ function ee({ monitor: e, disabled: n, onDelete: r }) {
|
|
|
95
74
|
index: t.index
|
|
96
75
|
});
|
|
97
76
|
},
|
|
98
|
-
children: [/* @__PURE__ */
|
|
77
|
+
children: [/* @__PURE__ */ g(u, { className: "mr-1 inline h-3 w-3" }), l ? "Confirm" : "Delete"]
|
|
99
78
|
}),
|
|
100
|
-
|
|
79
|
+
l && /* @__PURE__ */ g("p", {
|
|
101
80
|
className: "text-[10px] leading-snug text-warning",
|
|
102
81
|
children: "This is the only photograph this scene has. Delete it and the scene no longer knows what normal looks like — it stops judging until you capture again."
|
|
103
82
|
})
|
|
@@ -108,24 +87,24 @@ function ee({ monitor: e, disabled: n, onDelete: r }) {
|
|
|
108
87
|
}, e.condition))
|
|
109
88
|
});
|
|
110
89
|
}
|
|
111
|
-
function
|
|
90
|
+
function A({ reference: e }) {
|
|
112
91
|
let [n, r] = t(!1), i = e.thumbnailMediaId;
|
|
113
|
-
return i === void 0 || n ? /* @__PURE__ */
|
|
92
|
+
return i === void 0 || n ? /* @__PURE__ */ _("div", {
|
|
114
93
|
className: "flex h-16 w-full flex-col items-center justify-center gap-0.5 rounded bg-surface text-foreground-subtle",
|
|
115
94
|
title: "The picture for this reference is no longer stored. The reference itself is intact and still being scored against.",
|
|
116
|
-
children: [/* @__PURE__ */
|
|
95
|
+
children: [/* @__PURE__ */ g(o, { className: "h-4 w-4" }), /* @__PURE__ */ g("span", {
|
|
117
96
|
className: "text-[9px]",
|
|
118
97
|
children: "no picture"
|
|
119
98
|
})]
|
|
120
|
-
}) : /* @__PURE__ */
|
|
121
|
-
src:
|
|
99
|
+
}) : /* @__PURE__ */ g("img", {
|
|
100
|
+
src: T(i),
|
|
122
101
|
alt: "",
|
|
123
102
|
loading: "lazy",
|
|
124
103
|
className: "h-16 w-full rounded object-cover",
|
|
125
104
|
onError: () => r(!0)
|
|
126
105
|
});
|
|
127
106
|
}
|
|
128
|
-
function
|
|
107
|
+
function j(e) {
|
|
129
108
|
let t = new Date(e);
|
|
130
109
|
return `${t.toLocaleDateString()} ${t.toLocaleTimeString([], {
|
|
131
110
|
hour: "2-digit",
|
|
@@ -135,15 +114,15 @@ function F(e) {
|
|
|
135
114
|
//#endregion
|
|
136
115
|
//#region ../ui-library/src/composites/cap-settings/SceneSettingsForm.tsx
|
|
137
116
|
e();
|
|
138
|
-
var
|
|
117
|
+
var M = "rounded-md border border-border bg-surface px-2 py-1 text-[11px] text-foreground focus:border-primary focus:outline-none disabled:opacity-50", N = "text-[10px] font-medium text-foreground-subtle", P = "flex flex-col gap-2 rounded-md border border-border bg-surface/40 p-2", F = "text-[10px] font-semibold uppercase tracking-wide text-foreground-subtle", I = 5, L = 3600, R = {
|
|
139
118
|
periodic: "Only on the clock. Predictable, and it notices a change even on a camera nothing ever moves in front of.",
|
|
140
119
|
"on-motion": "Only after the camera has been still again for the quiet window below. Cheapest, but a change nobody walks past is never seen.",
|
|
141
120
|
both: "Both — the clock is the safety net that lets the motion path miss. This is the right answer for almost every scene."
|
|
142
|
-
},
|
|
121
|
+
}, z = {
|
|
143
122
|
skip: "Sit that light out. No verdict, no alarm, no flag touched — it picks itself back up when a light it knows returns. This is why the night capture is optional.",
|
|
144
123
|
"judge-anyway": "Compare against the references you do have. Only correct when the two lights genuinely look alike (a floodlit driveway, an indoor lamp) — against a real infrared frame it will report a change that did not happen."
|
|
145
124
|
};
|
|
146
|
-
function
|
|
125
|
+
function B(e) {
|
|
147
126
|
return {
|
|
148
127
|
label: e.label,
|
|
149
128
|
checkIntervalSec: e.checkIntervalSec ?? 60,
|
|
@@ -154,389 +133,389 @@ function W(e) {
|
|
|
154
133
|
confirmPrompt: e.confirm?.prompt ?? ""
|
|
155
134
|
};
|
|
156
135
|
}
|
|
157
|
-
function
|
|
158
|
-
let [i, o] = t(() =>
|
|
136
|
+
function V({ monitor: e, disabled: n, onPatch: r }) {
|
|
137
|
+
let [i, o] = t(() => B(e)), [s, c] = t(!1);
|
|
159
138
|
a(() => {
|
|
160
|
-
s || o(
|
|
139
|
+
s || o(B(e));
|
|
161
140
|
}, [e, s]);
|
|
162
|
-
let
|
|
163
|
-
|
|
164
|
-
},
|
|
141
|
+
let l = (e) => {
|
|
142
|
+
c(!1), r(e);
|
|
143
|
+
}, u = (t) => e.check.mode === "similarity" ? {
|
|
165
144
|
mode: "similarity",
|
|
166
145
|
threshold: t.threshold ?? e.check.threshold,
|
|
167
146
|
hysteresisCount: t.hysteresisCount ?? e.check.hysteresisCount
|
|
168
147
|
} : {
|
|
169
148
|
...e.check,
|
|
170
149
|
hysteresisCount: t.hysteresisCount ?? e.check.hysteresisCount
|
|
171
|
-
},
|
|
172
|
-
return /* @__PURE__ */
|
|
150
|
+
}, d = e.confirm?.enabled === !0, p = e.check.mode === "similarity" ? e.check.threshold : null;
|
|
151
|
+
return /* @__PURE__ */ _("div", {
|
|
173
152
|
className: "flex flex-col gap-2",
|
|
174
153
|
children: [
|
|
175
|
-
/* @__PURE__ */
|
|
176
|
-
className:
|
|
154
|
+
/* @__PURE__ */ _("div", {
|
|
155
|
+
className: P,
|
|
177
156
|
children: [
|
|
178
|
-
/* @__PURE__ */
|
|
179
|
-
className:
|
|
157
|
+
/* @__PURE__ */ g("p", {
|
|
158
|
+
className: F,
|
|
180
159
|
children: "What it watches"
|
|
181
160
|
}),
|
|
182
|
-
/* @__PURE__ */
|
|
161
|
+
/* @__PURE__ */ _("label", {
|
|
183
162
|
className: "flex flex-col gap-1",
|
|
184
|
-
children: [/* @__PURE__ */
|
|
185
|
-
className:
|
|
163
|
+
children: [/* @__PURE__ */ g("span", {
|
|
164
|
+
className: N,
|
|
186
165
|
children: "Name"
|
|
187
|
-
}), /* @__PURE__ */
|
|
166
|
+
}), /* @__PURE__ */ g("input", {
|
|
188
167
|
type: "text",
|
|
189
168
|
value: i.label,
|
|
190
169
|
disabled: n,
|
|
191
|
-
className:
|
|
192
|
-
onFocus: () =>
|
|
170
|
+
className: M,
|
|
171
|
+
onFocus: () => c(!0),
|
|
193
172
|
onChange: (e) => o((t) => ({
|
|
194
173
|
...t,
|
|
195
174
|
label: e.target.value
|
|
196
175
|
})),
|
|
197
176
|
onBlur: () => {
|
|
198
177
|
let t = i.label.trim();
|
|
199
|
-
t.length > 0 && t !== e.label ?
|
|
178
|
+
t.length > 0 && t !== e.label ? l({ label: t }) : c(!1);
|
|
200
179
|
}
|
|
201
180
|
})]
|
|
202
181
|
}),
|
|
203
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ _("label", {
|
|
204
183
|
className: "flex items-center gap-2",
|
|
205
|
-
children: [/* @__PURE__ */
|
|
184
|
+
children: [/* @__PURE__ */ g("input", {
|
|
206
185
|
type: "checkbox",
|
|
207
186
|
checked: e.enabled,
|
|
208
187
|
disabled: n,
|
|
209
|
-
onChange: (e) =>
|
|
210
|
-
}), /* @__PURE__ */
|
|
211
|
-
className:
|
|
188
|
+
onChange: (e) => l({ enabled: e.target.checked })
|
|
189
|
+
}), /* @__PURE__ */ g("span", {
|
|
190
|
+
className: N,
|
|
212
191
|
children: "Watching"
|
|
213
192
|
})]
|
|
214
193
|
}),
|
|
215
|
-
/* @__PURE__ */
|
|
216
|
-
className:
|
|
194
|
+
/* @__PURE__ */ g("p", {
|
|
195
|
+
className: f,
|
|
217
196
|
children: "Turned off, the scene keeps its region, its references and its flag — it simply stops checking. Nothing is lost by pausing one for a while."
|
|
218
197
|
}),
|
|
219
|
-
/* @__PURE__ */
|
|
198
|
+
/* @__PURE__ */ _("label", {
|
|
220
199
|
className: "flex flex-col gap-1",
|
|
221
|
-
children: [/* @__PURE__ */
|
|
222
|
-
className:
|
|
200
|
+
children: [/* @__PURE__ */ g("span", {
|
|
201
|
+
className: N,
|
|
223
202
|
children: "When to look"
|
|
224
|
-
}), /* @__PURE__ */
|
|
203
|
+
}), /* @__PURE__ */ _("select", {
|
|
225
204
|
value: e.triggerMode,
|
|
226
205
|
disabled: n,
|
|
227
|
-
className:
|
|
206
|
+
className: M,
|
|
228
207
|
onChange: (e) => {
|
|
229
208
|
let t = e.target.value;
|
|
230
|
-
(t === "periodic" || t === "on-motion" || t === "both") &&
|
|
209
|
+
(t === "periodic" || t === "on-motion" || t === "both") && l({ triggerMode: t });
|
|
231
210
|
},
|
|
232
211
|
children: [
|
|
233
|
-
/* @__PURE__ */
|
|
212
|
+
/* @__PURE__ */ g("option", {
|
|
234
213
|
value: "both",
|
|
235
214
|
children: "On the clock and after motion settles"
|
|
236
215
|
}),
|
|
237
|
-
/* @__PURE__ */
|
|
216
|
+
/* @__PURE__ */ g("option", {
|
|
238
217
|
value: "periodic",
|
|
239
218
|
children: "On the clock only"
|
|
240
219
|
}),
|
|
241
|
-
/* @__PURE__ */
|
|
220
|
+
/* @__PURE__ */ g("option", {
|
|
242
221
|
value: "on-motion",
|
|
243
222
|
children: "After motion settles only"
|
|
244
223
|
})
|
|
245
224
|
]
|
|
246
225
|
})]
|
|
247
226
|
}),
|
|
248
|
-
/* @__PURE__ */
|
|
249
|
-
className:
|
|
250
|
-
children:
|
|
227
|
+
/* @__PURE__ */ g("p", {
|
|
228
|
+
className: f,
|
|
229
|
+
children: R[e.triggerMode]
|
|
251
230
|
}),
|
|
252
|
-
/* @__PURE__ */
|
|
231
|
+
/* @__PURE__ */ _("label", {
|
|
253
232
|
className: "flex flex-col gap-1",
|
|
254
|
-
children: [/* @__PURE__ */
|
|
255
|
-
className:
|
|
233
|
+
children: [/* @__PURE__ */ g("span", {
|
|
234
|
+
className: N,
|
|
256
235
|
children: "Check every (seconds)"
|
|
257
|
-
}), /* @__PURE__ */
|
|
236
|
+
}), /* @__PURE__ */ g("input", {
|
|
258
237
|
type: "number",
|
|
259
|
-
min:
|
|
260
|
-
max:
|
|
238
|
+
min: I,
|
|
239
|
+
max: L,
|
|
261
240
|
value: i.checkIntervalSec,
|
|
262
241
|
disabled: n,
|
|
263
|
-
className:
|
|
264
|
-
onFocus: () =>
|
|
242
|
+
className: M,
|
|
243
|
+
onFocus: () => c(!0),
|
|
265
244
|
onChange: (e) => o((t) => ({
|
|
266
245
|
...t,
|
|
267
246
|
checkIntervalSec: Number(e.target.value) || 0
|
|
268
247
|
})),
|
|
269
248
|
onBlur: () => {
|
|
270
|
-
let t =
|
|
271
|
-
t === e.checkIntervalSec ?
|
|
249
|
+
let t = H(i.checkIntervalSec, I, L);
|
|
250
|
+
t === e.checkIntervalSec ? c(!1) : l({ checkIntervalSec: t });
|
|
272
251
|
}
|
|
273
252
|
})]
|
|
274
253
|
}),
|
|
275
|
-
/* @__PURE__ */
|
|
276
|
-
className:
|
|
254
|
+
/* @__PURE__ */ g("p", {
|
|
255
|
+
className: f,
|
|
277
256
|
children: "60 s suits “is the bin still out”. Every check costs one photograph and one encode, so going below about 30 s buys latency you almost never need and multiplies the cost by the number of scenes you own."
|
|
278
257
|
})
|
|
279
258
|
]
|
|
280
259
|
}),
|
|
281
|
-
/* @__PURE__ */
|
|
282
|
-
className:
|
|
260
|
+
/* @__PURE__ */ _("div", {
|
|
261
|
+
className: P,
|
|
283
262
|
children: [
|
|
284
|
-
/* @__PURE__ */
|
|
285
|
-
className:
|
|
263
|
+
/* @__PURE__ */ g("p", {
|
|
264
|
+
className: F,
|
|
286
265
|
children: "How sure it has to be"
|
|
287
266
|
}),
|
|
288
|
-
e.check.mode === "similarity" && /* @__PURE__ */
|
|
267
|
+
e.check.mode === "similarity" && /* @__PURE__ */ _(v, { children: [/* @__PURE__ */ _("label", {
|
|
289
268
|
className: "flex flex-col gap-1",
|
|
290
|
-
children: [/* @__PURE__ */
|
|
291
|
-
className:
|
|
292
|
-
children: ["Match threshold — ", /* @__PURE__ */
|
|
269
|
+
children: [/* @__PURE__ */ _("span", {
|
|
270
|
+
className: N,
|
|
271
|
+
children: ["Match threshold — ", /* @__PURE__ */ g("span", {
|
|
293
272
|
className: "tabular-nums",
|
|
294
273
|
children: i.threshold.toFixed(2)
|
|
295
274
|
})]
|
|
296
|
-
}), /* @__PURE__ */
|
|
275
|
+
}), /* @__PURE__ */ g("input", {
|
|
297
276
|
type: "range",
|
|
298
277
|
min: .3,
|
|
299
278
|
max: .99,
|
|
300
279
|
step: .01,
|
|
301
280
|
value: i.threshold,
|
|
302
281
|
disabled: n,
|
|
303
|
-
onFocus: () =>
|
|
282
|
+
onFocus: () => c(!0),
|
|
304
283
|
onChange: (e) => o((t) => ({
|
|
305
284
|
...t,
|
|
306
285
|
threshold: Number(e.target.value)
|
|
307
286
|
})),
|
|
308
287
|
onMouseUp: () => {
|
|
309
|
-
i.threshold === p ?
|
|
288
|
+
i.threshold === p ? c(!1) : l({ check: u({ threshold: i.threshold }) });
|
|
310
289
|
},
|
|
311
290
|
onBlur: () => {
|
|
312
|
-
i.threshold === p ?
|
|
291
|
+
i.threshold === p ? c(!1) : l({ check: u({ threshold: i.threshold }) });
|
|
313
292
|
}
|
|
314
293
|
})]
|
|
315
|
-
}), /* @__PURE__ */
|
|
294
|
+
}), /* @__PURE__ */ g("p", {
|
|
316
295
|
className: "text-[10px] text-foreground-subtle",
|
|
317
296
|
children: "How closely the region still has to resemble the photograph to count as unchanged. Higher means fussier: at 0.95 a passing cloud can read as a change; at 0.60 the bin can be taken and the scene will shrug. 0.80 is a sensible start — if it cries wolf, lower it; if it misses the thing you care about, raise it."
|
|
318
297
|
})] }),
|
|
319
|
-
/* @__PURE__ */
|
|
298
|
+
/* @__PURE__ */ _("label", {
|
|
320
299
|
className: "flex flex-col gap-1",
|
|
321
|
-
children: [/* @__PURE__ */
|
|
322
|
-
className:
|
|
300
|
+
children: [/* @__PURE__ */ g("span", {
|
|
301
|
+
className: N,
|
|
323
302
|
children: "Agreeing checks before it changes its mind"
|
|
324
|
-
}), /* @__PURE__ */
|
|
303
|
+
}), /* @__PURE__ */ g("input", {
|
|
325
304
|
type: "number",
|
|
326
305
|
min: 1,
|
|
327
306
|
max: 10,
|
|
328
307
|
value: i.hysteresisCount,
|
|
329
308
|
disabled: n,
|
|
330
|
-
className:
|
|
331
|
-
onFocus: () =>
|
|
309
|
+
className: M,
|
|
310
|
+
onFocus: () => c(!0),
|
|
332
311
|
onChange: (e) => o((t) => ({
|
|
333
312
|
...t,
|
|
334
313
|
hysteresisCount: Number(e.target.value) || 1
|
|
335
314
|
})),
|
|
336
315
|
onBlur: () => {
|
|
337
|
-
let t =
|
|
338
|
-
t === e.check.hysteresisCount ?
|
|
316
|
+
let t = H(i.hysteresisCount, 1, 10);
|
|
317
|
+
t === e.check.hysteresisCount ? c(!1) : l({ check: u({ hysteresisCount: t }) });
|
|
339
318
|
}
|
|
340
319
|
})]
|
|
341
320
|
}),
|
|
342
|
-
/* @__PURE__ */
|
|
343
|
-
className:
|
|
321
|
+
/* @__PURE__ */ g("p", {
|
|
322
|
+
className: f,
|
|
344
323
|
children: "One bad photograph must never be able to flip a scene. 3 agreeing checks at 60 s is about four minutes of latency and is what makes the answer trustworthy — leaving a state costs exactly the same as entering one."
|
|
345
324
|
}),
|
|
346
|
-
/* @__PURE__ */
|
|
325
|
+
/* @__PURE__ */ _("label", {
|
|
347
326
|
className: "flex flex-col gap-1",
|
|
348
|
-
children: [/* @__PURE__ */
|
|
349
|
-
className:
|
|
327
|
+
children: [/* @__PURE__ */ g("span", {
|
|
328
|
+
className: N,
|
|
350
329
|
children: "Quiet for (seconds) before a check counts"
|
|
351
|
-
}), /* @__PURE__ */
|
|
330
|
+
}), /* @__PURE__ */ g("input", {
|
|
352
331
|
type: "number",
|
|
353
332
|
min: 0,
|
|
354
333
|
max: 3600,
|
|
355
334
|
value: i.quietSeconds,
|
|
356
335
|
disabled: n,
|
|
357
|
-
className:
|
|
358
|
-
onFocus: () =>
|
|
336
|
+
className: M,
|
|
337
|
+
onFocus: () => c(!0),
|
|
359
338
|
onChange: (e) => o((t) => ({
|
|
360
339
|
...t,
|
|
361
340
|
quietSeconds: Number(e.target.value) || 0
|
|
362
341
|
})),
|
|
363
342
|
onBlur: () => {
|
|
364
|
-
let t =
|
|
365
|
-
t === e.quietSeconds ?
|
|
343
|
+
let t = H(i.quietSeconds, 0, 3600);
|
|
344
|
+
t === e.quietSeconds ? c(!1) : l({ quietSeconds: t });
|
|
366
345
|
}
|
|
367
346
|
})]
|
|
368
347
|
}),
|
|
369
|
-
/* @__PURE__ */
|
|
370
|
-
className:
|
|
348
|
+
/* @__PURE__ */ g("p", {
|
|
349
|
+
className: f,
|
|
371
350
|
children: "A check taken while something is moving is a photograph of the van parked in front of the bin, so it is discarded rather than merely delayed. 0 disables the gate."
|
|
372
351
|
}),
|
|
373
|
-
/* @__PURE__ */
|
|
352
|
+
/* @__PURE__ */ _("label", {
|
|
374
353
|
className: "flex flex-col gap-1",
|
|
375
|
-
children: [/* @__PURE__ */
|
|
376
|
-
className:
|
|
354
|
+
children: [/* @__PURE__ */ g("span", {
|
|
355
|
+
className: N,
|
|
377
356
|
children: "Minimum gap between counted checks (seconds)"
|
|
378
|
-
}), /* @__PURE__ */
|
|
357
|
+
}), /* @__PURE__ */ g("input", {
|
|
379
358
|
type: "number",
|
|
380
359
|
min: 0,
|
|
381
360
|
max: 3600,
|
|
382
361
|
value: i.minObservationSpacingSec,
|
|
383
362
|
disabled: n,
|
|
384
|
-
className:
|
|
385
|
-
onFocus: () =>
|
|
363
|
+
className: M,
|
|
364
|
+
onFocus: () => c(!0),
|
|
386
365
|
onChange: (e) => o((t) => ({
|
|
387
366
|
...t,
|
|
388
367
|
minObservationSpacingSec: Number(e.target.value) || 0
|
|
389
368
|
})),
|
|
390
369
|
onBlur: () => {
|
|
391
|
-
let t =
|
|
392
|
-
t === e.minObservationSpacingSec ?
|
|
370
|
+
let t = H(i.minObservationSpacingSec, 0, 3600);
|
|
371
|
+
t === e.minObservationSpacingSec ? c(!1) : l({ minObservationSpacingSec: t });
|
|
393
372
|
}
|
|
394
373
|
})]
|
|
395
374
|
}),
|
|
396
|
-
/* @__PURE__ */
|
|
397
|
-
className:
|
|
375
|
+
/* @__PURE__ */ g("p", {
|
|
376
|
+
className: f,
|
|
398
377
|
children: "Spreads the agreeing checks over real time instead of letting three adjacent polls inside one long occlusion be mistaken for three independent opinions."
|
|
399
378
|
})
|
|
400
379
|
]
|
|
401
380
|
}),
|
|
402
|
-
/* @__PURE__ */
|
|
403
|
-
className:
|
|
381
|
+
/* @__PURE__ */ _("div", {
|
|
382
|
+
className: P,
|
|
404
383
|
children: [
|
|
405
|
-
/* @__PURE__ */
|
|
406
|
-
className:
|
|
384
|
+
/* @__PURE__ */ g("p", {
|
|
385
|
+
className: F,
|
|
407
386
|
children: "Lighting"
|
|
408
387
|
}),
|
|
409
|
-
/* @__PURE__ */
|
|
388
|
+
/* @__PURE__ */ _("label", {
|
|
410
389
|
className: "flex flex-col gap-1",
|
|
411
|
-
children: [/* @__PURE__ */
|
|
412
|
-
className:
|
|
390
|
+
children: [/* @__PURE__ */ g("span", {
|
|
391
|
+
className: N,
|
|
413
392
|
children: "When a light has no reference of its own"
|
|
414
|
-
}), /* @__PURE__ */
|
|
393
|
+
}), /* @__PURE__ */ _("select", {
|
|
415
394
|
value: e.onUncoveredCondition,
|
|
416
395
|
disabled: n,
|
|
417
|
-
className:
|
|
396
|
+
className: M,
|
|
418
397
|
onChange: (e) => {
|
|
419
398
|
let t = e.target.value;
|
|
420
|
-
(t === "skip" || t === "judge-anyway") &&
|
|
399
|
+
(t === "skip" || t === "judge-anyway") && l({ onUncoveredCondition: t });
|
|
421
400
|
},
|
|
422
|
-
children: [/* @__PURE__ */
|
|
401
|
+
children: [/* @__PURE__ */ g("option", {
|
|
423
402
|
value: "skip",
|
|
424
403
|
children: "Skip the check (recommended)"
|
|
425
|
-
}), /* @__PURE__ */
|
|
404
|
+
}), /* @__PURE__ */ g("option", {
|
|
426
405
|
value: "judge-anyway",
|
|
427
406
|
children: "Judge against the other light anyway"
|
|
428
407
|
})]
|
|
429
408
|
})]
|
|
430
409
|
}),
|
|
431
|
-
/* @__PURE__ */
|
|
432
|
-
className:
|
|
433
|
-
children:
|
|
410
|
+
/* @__PURE__ */ g("p", {
|
|
411
|
+
className: f,
|
|
412
|
+
children: z[e.onUncoveredCondition]
|
|
434
413
|
})
|
|
435
414
|
]
|
|
436
415
|
}),
|
|
437
|
-
/* @__PURE__ */
|
|
438
|
-
className:
|
|
416
|
+
/* @__PURE__ */ _("div", {
|
|
417
|
+
className: P,
|
|
439
418
|
children: [
|
|
440
|
-
/* @__PURE__ */
|
|
441
|
-
className:
|
|
419
|
+
/* @__PURE__ */ g("p", {
|
|
420
|
+
className: F,
|
|
442
421
|
children: "What you get told"
|
|
443
422
|
}),
|
|
444
|
-
/* @__PURE__ */
|
|
423
|
+
/* @__PURE__ */ _("label", {
|
|
445
424
|
className: "flex flex-col gap-1",
|
|
446
|
-
children: [/* @__PURE__ */
|
|
447
|
-
className:
|
|
425
|
+
children: [/* @__PURE__ */ g("span", {
|
|
426
|
+
className: N,
|
|
448
427
|
children: "Notifications follow"
|
|
449
|
-
}), /* @__PURE__ */
|
|
428
|
+
}), /* @__PURE__ */ _("select", {
|
|
450
429
|
value: e.emit,
|
|
451
430
|
disabled: n,
|
|
452
|
-
className:
|
|
431
|
+
className: M,
|
|
453
432
|
onChange: (e) => {
|
|
454
433
|
let t = e.target.value;
|
|
455
|
-
(t === "latched" || t === "live") &&
|
|
434
|
+
(t === "latched" || t === "live") && l({ emit: t });
|
|
456
435
|
},
|
|
457
|
-
children: [/* @__PURE__ */
|
|
436
|
+
children: [/* @__PURE__ */ g("option", {
|
|
458
437
|
value: "latched",
|
|
459
438
|
children: "The flag — told once, still visible at breakfast"
|
|
460
|
-
}), /* @__PURE__ */
|
|
439
|
+
}), /* @__PURE__ */ g("option", {
|
|
461
440
|
value: "live",
|
|
462
441
|
children: "The live state — follows the region as it changes"
|
|
463
442
|
})]
|
|
464
443
|
})]
|
|
465
444
|
}),
|
|
466
|
-
/* @__PURE__ */
|
|
467
|
-
className:
|
|
445
|
+
/* @__PURE__ */ g("p", {
|
|
446
|
+
className: f,
|
|
468
447
|
children: "“Is the bin gone” is a flag: you want to be told once and still see it later. “Is the gate open” is a live state."
|
|
469
448
|
}),
|
|
470
|
-
/* @__PURE__ */
|
|
449
|
+
/* @__PURE__ */ _("label", {
|
|
471
450
|
className: "flex items-center gap-2",
|
|
472
|
-
children: [/* @__PURE__ */
|
|
451
|
+
children: [/* @__PURE__ */ g("input", {
|
|
473
452
|
type: "checkbox",
|
|
474
453
|
checked: e.autoRestore,
|
|
475
454
|
disabled: n,
|
|
476
|
-
onChange: (e) =>
|
|
477
|
-
}), /* @__PURE__ */
|
|
478
|
-
className:
|
|
455
|
+
onChange: (e) => l({ autoRestore: e.target.checked })
|
|
456
|
+
}), /* @__PURE__ */ g("span", {
|
|
457
|
+
className: N,
|
|
479
458
|
children: "Clear the flag by itself when things look normal again"
|
|
480
459
|
})]
|
|
481
460
|
}),
|
|
482
|
-
/* @__PURE__ */
|
|
483
|
-
className:
|
|
461
|
+
/* @__PURE__ */ g("p", {
|
|
462
|
+
className: f,
|
|
484
463
|
children: "Off by default, so an alarm never silently clears itself. The “back to normal” moment is recorded either way, so an automation can still react to it."
|
|
485
464
|
})
|
|
486
465
|
]
|
|
487
466
|
}),
|
|
488
|
-
/* @__PURE__ */
|
|
489
|
-
className:
|
|
467
|
+
/* @__PURE__ */ _("div", {
|
|
468
|
+
className: P,
|
|
490
469
|
children: [
|
|
491
|
-
/* @__PURE__ */
|
|
492
|
-
className:
|
|
470
|
+
/* @__PURE__ */ g("p", {
|
|
471
|
+
className: F,
|
|
493
472
|
children: "AI double-check"
|
|
494
473
|
}),
|
|
495
|
-
/* @__PURE__ */
|
|
474
|
+
/* @__PURE__ */ _("label", {
|
|
496
475
|
className: "flex items-center gap-2",
|
|
497
|
-
children: [/* @__PURE__ */
|
|
476
|
+
children: [/* @__PURE__ */ g("input", {
|
|
498
477
|
type: "checkbox",
|
|
499
|
-
checked:
|
|
478
|
+
checked: d,
|
|
500
479
|
disabled: n || i.confirmPrompt.trim().length === 0,
|
|
501
|
-
onChange: (e) =>
|
|
502
|
-
...
|
|
480
|
+
onChange: (e) => l(e.target.checked ? { confirm: {
|
|
481
|
+
...U(i.confirmPrompt.trim()),
|
|
503
482
|
enabled: !0
|
|
504
483
|
} } : { confirm: null })
|
|
505
|
-
}), /* @__PURE__ */
|
|
506
|
-
className:
|
|
484
|
+
}), /* @__PURE__ */ g("span", {
|
|
485
|
+
className: N,
|
|
507
486
|
children: "Ask a vision model before changing the answer"
|
|
508
487
|
})]
|
|
509
488
|
}),
|
|
510
|
-
/* @__PURE__ */
|
|
489
|
+
/* @__PURE__ */ _("label", {
|
|
511
490
|
className: "flex flex-col gap-1",
|
|
512
|
-
children: [/* @__PURE__ */
|
|
513
|
-
className:
|
|
491
|
+
children: [/* @__PURE__ */ g("span", {
|
|
492
|
+
className: N,
|
|
514
493
|
children: "The question to ask"
|
|
515
|
-
}), /* @__PURE__ */
|
|
494
|
+
}), /* @__PURE__ */ g("input", {
|
|
516
495
|
type: "text",
|
|
517
496
|
value: i.confirmPrompt,
|
|
518
497
|
placeholder: "e.g. Is the wheelie bin still there?",
|
|
519
498
|
disabled: n,
|
|
520
|
-
className:
|
|
521
|
-
onFocus: () =>
|
|
499
|
+
className: M,
|
|
500
|
+
onFocus: () => c(!0),
|
|
522
501
|
onChange: (e) => o((t) => ({
|
|
523
502
|
...t,
|
|
524
503
|
confirmPrompt: e.target.value
|
|
525
504
|
})),
|
|
526
505
|
onBlur: () => {
|
|
527
506
|
let t = i.confirmPrompt.trim();
|
|
528
|
-
t.length > 0 && t !== e.confirm?.prompt ?
|
|
529
|
-
...
|
|
530
|
-
enabled:
|
|
531
|
-
} }) :
|
|
507
|
+
t.length > 0 && t !== e.confirm?.prompt ? l({ confirm: {
|
|
508
|
+
...U(t),
|
|
509
|
+
enabled: d
|
|
510
|
+
} }) : c(!1);
|
|
532
511
|
}
|
|
533
512
|
})]
|
|
534
513
|
}),
|
|
535
|
-
/* @__PURE__ */
|
|
536
|
-
className:
|
|
514
|
+
/* @__PURE__ */ _("p", {
|
|
515
|
+
className: f,
|
|
537
516
|
children: [
|
|
538
517
|
"The model is asked ",
|
|
539
|
-
/* @__PURE__ */
|
|
518
|
+
/* @__PURE__ */ g("strong", { children: "only" }),
|
|
540
519
|
" when the region has already changed enough to flip the answer — roughly twice a week for a bin, not once a minute. It reasons about the object rather than the pixels, so rain, shadows and a repositioned bin stop counting as the thing being taken. If it cannot be reached, the change is held rather than announced."
|
|
541
520
|
]
|
|
542
521
|
})
|
|
@@ -545,10 +524,10 @@ function G({ monitor: e, disabled: n, onPatch: r }) {
|
|
|
545
524
|
]
|
|
546
525
|
});
|
|
547
526
|
}
|
|
548
|
-
function
|
|
527
|
+
function H(e, t, n) {
|
|
549
528
|
return Math.min(n, Math.max(t, e));
|
|
550
529
|
}
|
|
551
|
-
function
|
|
530
|
+
function U(e) {
|
|
552
531
|
return {
|
|
553
532
|
enabled: !1,
|
|
554
533
|
prompt: e,
|
|
@@ -560,37 +539,37 @@ function q(e) {
|
|
|
560
539
|
//#endregion
|
|
561
540
|
//#region ../ui-library/src/composites/cap-settings/SceneMonitorEditor.tsx
|
|
562
541
|
e();
|
|
563
|
-
var
|
|
542
|
+
var W = "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", G = "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", K = "rounded-md border border-danger/50 bg-danger/10 px-2 py-1 text-[11px] font-medium text-danger hover:bg-danger/20 disabled:opacity-40 transition-colors", q = {
|
|
564
543
|
alarm: "border-danger/50 bg-danger/15 text-danger",
|
|
565
544
|
ok: "border-success/50 bg-success/15 text-success",
|
|
566
545
|
unknown: "border-border bg-surface text-foreground-subtle"
|
|
567
|
-
},
|
|
568
|
-
function
|
|
569
|
-
let
|
|
546
|
+
}, J = .8, ie = 3;
|
|
547
|
+
function Y({ deviceId: e }) {
|
|
548
|
+
let o = p(h().trpcClient, e), y = d(o?.state.sceneMonitor), w = ne(e, { width: 640 }), [T, E] = t(null), [D, O] = t(!1), [A, j] = t(null), [M, N] = t(null), [P, F] = t(null), [I, L] = t(null), [R, z] = t(!1), [B, H] = t(null), [U, Y] = t(""), X = r(!0);
|
|
570
549
|
a(() => (X.current = !0, () => {
|
|
571
550
|
X.current = !1;
|
|
572
551
|
}), []);
|
|
573
552
|
let Z = n(async () => {
|
|
574
|
-
if (
|
|
575
|
-
let e = await
|
|
553
|
+
if (o) try {
|
|
554
|
+
let e = await o.sceneMonitor?.listScenes({});
|
|
576
555
|
if (!X.current) return;
|
|
577
|
-
e &&
|
|
556
|
+
e && E(e);
|
|
578
557
|
} catch (e) {
|
|
579
558
|
if (!X.current) return;
|
|
580
|
-
|
|
559
|
+
m(e) ? O(!0) : N(e instanceof Error ? e.message : String(e));
|
|
581
560
|
}
|
|
582
|
-
}, [
|
|
561
|
+
}, [o]);
|
|
583
562
|
a(() => {
|
|
584
|
-
|
|
563
|
+
E(null), O(!1), N(null), Z();
|
|
585
564
|
}, [Z]);
|
|
586
|
-
let Q =
|
|
587
|
-
|
|
565
|
+
let Q = y?.monitors ?? T?.monitors ?? [], ae = Date.now(), $ = n(async (e, t) => {
|
|
566
|
+
j(e), N(null);
|
|
588
567
|
try {
|
|
589
568
|
await t(), await Z();
|
|
590
569
|
} catch (e) {
|
|
591
|
-
X.current &&
|
|
570
|
+
X.current && N(e instanceof Error ? e.message : String(e));
|
|
592
571
|
} finally {
|
|
593
|
-
X.current &&
|
|
572
|
+
X.current && j(null);
|
|
594
573
|
}
|
|
595
574
|
}, [Z]), oe = i(() => {
|
|
596
575
|
let e = Q.map((e) => ({
|
|
@@ -599,223 +578,223 @@ function X({ deviceId: e }) {
|
|
|
599
578
|
label: e.label,
|
|
600
579
|
enabled: e.enabled
|
|
601
580
|
}));
|
|
602
|
-
return
|
|
581
|
+
return B === null ? e : [...e, {
|
|
603
582
|
id: "__draft__",
|
|
604
|
-
shape:
|
|
583
|
+
shape: B,
|
|
605
584
|
label: "New scene"
|
|
606
585
|
}];
|
|
607
|
-
}, [Q,
|
|
586
|
+
}, [Q, B]), se = n((e, t) => {
|
|
608
587
|
if (t.kind === "rect") {
|
|
609
588
|
if (e === "__draft__") {
|
|
610
|
-
|
|
589
|
+
H(t);
|
|
611
590
|
return;
|
|
612
591
|
}
|
|
613
|
-
$(`roi-${String(e)}`, async () =>
|
|
592
|
+
$(`roi-${String(e)}`, async () => o?.sceneMonitor?.updateScene({
|
|
614
593
|
monitorId: String(e),
|
|
615
594
|
patch: { roi: t }
|
|
616
595
|
}));
|
|
617
596
|
}
|
|
618
|
-
}, [
|
|
619
|
-
e.kind === "rect" &&
|
|
597
|
+
}, [o, $]), ce = n((e) => {
|
|
598
|
+
e.kind === "rect" && H(e);
|
|
620
599
|
}, []), le = n(async () => {
|
|
621
|
-
|
|
622
|
-
await
|
|
623
|
-
label:
|
|
624
|
-
roi:
|
|
600
|
+
B === null || U.trim().length === 0 || (await $("create", async () => {
|
|
601
|
+
await o?.sceneMonitor?.createScene({
|
|
602
|
+
label: U.trim(),
|
|
603
|
+
roi: B,
|
|
625
604
|
check: {
|
|
626
605
|
mode: "similarity",
|
|
627
|
-
threshold:
|
|
606
|
+
threshold: J,
|
|
628
607
|
hysteresisCount: ie
|
|
629
608
|
}
|
|
630
609
|
});
|
|
631
|
-
}),
|
|
610
|
+
}), H(null), Y(""), z(!1));
|
|
632
611
|
}, [
|
|
633
|
-
|
|
612
|
+
o,
|
|
613
|
+
B,
|
|
634
614
|
U,
|
|
635
|
-
K,
|
|
636
615
|
$
|
|
637
616
|
]);
|
|
638
|
-
return
|
|
617
|
+
return o ? /* @__PURE__ */ g("div", {
|
|
639
618
|
className: "flex flex-col gap-3",
|
|
640
|
-
children:
|
|
641
|
-
className: `${
|
|
619
|
+
children: D ? /* @__PURE__ */ g("p", {
|
|
620
|
+
className: `${f} leading-relaxed`,
|
|
642
621
|
children: "Scene monitoring is not available for this camera."
|
|
643
|
-
}) : /* @__PURE__ */
|
|
644
|
-
/* @__PURE__ */
|
|
645
|
-
className: `${
|
|
622
|
+
}) : /* @__PURE__ */ _(v, { children: [
|
|
623
|
+
/* @__PURE__ */ g("p", {
|
|
624
|
+
className: `${f} leading-relaxed`,
|
|
646
625
|
children: "A scene watches one region of this camera and tells you when it stops looking like the picture you captured. Draw a box around the thing you care about — a wheelie bin, a gate, a parking space — then capture what “normal” looks like. Daylight is enough to start: the night reference is optional, and without it the scene simply sits the infrared hours out instead of reporting a problem."
|
|
647
626
|
}),
|
|
648
|
-
/* @__PURE__ */
|
|
627
|
+
/* @__PURE__ */ g("div", {
|
|
649
628
|
className: "relative overflow-hidden rounded-md border border-border",
|
|
650
|
-
children: /* @__PURE__ */
|
|
629
|
+
children: /* @__PURE__ */ g(C, {
|
|
651
630
|
items: oe,
|
|
652
631
|
supportedShapes: ["rect"],
|
|
653
|
-
selectedId:
|
|
654
|
-
onSelect: (e) =>
|
|
632
|
+
selectedId: P ?? (B === null ? null : "__draft__"),
|
|
633
|
+
onSelect: (e) => F(e === null ? null : String(e)),
|
|
655
634
|
onShapeChange: se,
|
|
656
635
|
onDrawComplete: ce,
|
|
657
|
-
drawingKind:
|
|
658
|
-
backdrop:
|
|
659
|
-
src:
|
|
636
|
+
drawingKind: R && B === null ? "rect" : null,
|
|
637
|
+
backdrop: w.src === null ? null : /* @__PURE__ */ g("img", {
|
|
638
|
+
src: w.src,
|
|
660
639
|
alt: "",
|
|
661
640
|
className: "h-full w-full object-contain",
|
|
662
641
|
draggable: !1
|
|
663
642
|
})
|
|
664
643
|
})
|
|
665
644
|
}),
|
|
666
|
-
/* @__PURE__ */
|
|
645
|
+
/* @__PURE__ */ _("div", {
|
|
667
646
|
className: "flex flex-wrap items-center gap-2",
|
|
668
|
-
children: [/* @__PURE__ */
|
|
647
|
+
children: [/* @__PURE__ */ g("button", {
|
|
669
648
|
type: "button",
|
|
670
|
-
className:
|
|
671
|
-
"aria-pressed":
|
|
649
|
+
className: R ? G : W,
|
|
650
|
+
"aria-pressed": R,
|
|
672
651
|
onClick: () => {
|
|
673
|
-
|
|
652
|
+
z((e) => !e), H(null);
|
|
674
653
|
},
|
|
675
|
-
disabled:
|
|
676
|
-
children:
|
|
677
|
-
}), /* @__PURE__ */
|
|
654
|
+
disabled: A !== null,
|
|
655
|
+
children: R ? "Cancel" : "+ New scene"
|
|
656
|
+
}), /* @__PURE__ */ g("button", {
|
|
678
657
|
type: "button",
|
|
679
|
-
className:
|
|
680
|
-
onClick:
|
|
681
|
-
disabled:
|
|
658
|
+
className: W,
|
|
659
|
+
onClick: w.refresh,
|
|
660
|
+
disabled: A !== null,
|
|
682
661
|
children: "Refresh frame"
|
|
683
662
|
})]
|
|
684
663
|
}),
|
|
685
|
-
|
|
664
|
+
R && /* @__PURE__ */ _("div", {
|
|
686
665
|
className: "flex flex-col gap-2 rounded-md border border-border bg-surface p-2",
|
|
687
666
|
children: [
|
|
688
|
-
/* @__PURE__ */
|
|
667
|
+
/* @__PURE__ */ g("p", {
|
|
689
668
|
className: "text-[10px] text-foreground-subtle",
|
|
690
|
-
children:
|
|
669
|
+
children: B === null ? "Click on the frame to drop a box, then drag its corner to fit it around the thing you want watched." : "Name it, then create. You capture what “normal” looks like next."
|
|
691
670
|
}),
|
|
692
|
-
|
|
671
|
+
B !== null && b(B) && /* @__PURE__ */ g("p", {
|
|
693
672
|
className: "text-[11px] leading-relaxed text-warning",
|
|
694
673
|
children: "That box covers most of the frame. A scene that big is dominated by the weather, the sky and passing cars — it will quietly stop noticing the thing you actually care about. Draw it tighter."
|
|
695
674
|
}),
|
|
696
|
-
/* @__PURE__ */
|
|
675
|
+
/* @__PURE__ */ _("div", {
|
|
697
676
|
className: "flex items-center gap-2",
|
|
698
|
-
children: [/* @__PURE__ */
|
|
677
|
+
children: [/* @__PURE__ */ g("input", {
|
|
699
678
|
type: "text",
|
|
700
|
-
value:
|
|
701
|
-
onChange: (e) =>
|
|
679
|
+
value: U,
|
|
680
|
+
onChange: (e) => Y(e.target.value),
|
|
702
681
|
placeholder: "e.g. Immondizia prelevata",
|
|
703
682
|
className: "flex-1 rounded-md border border-border bg-surface px-2 py-1 text-[12px] text-foreground"
|
|
704
|
-
}), /* @__PURE__ */
|
|
683
|
+
}), /* @__PURE__ */ g("button", {
|
|
705
684
|
type: "button",
|
|
706
|
-
className:
|
|
685
|
+
className: G,
|
|
707
686
|
onClick: () => void le(),
|
|
708
|
-
disabled:
|
|
687
|
+
disabled: B === null || U.trim().length === 0 || A !== null,
|
|
709
688
|
children: "Create"
|
|
710
689
|
})]
|
|
711
690
|
})
|
|
712
691
|
]
|
|
713
692
|
}),
|
|
714
|
-
|
|
693
|
+
M !== null && /* @__PURE__ */ g("p", {
|
|
715
694
|
className: "text-[11px] leading-relaxed text-danger",
|
|
716
|
-
children:
|
|
695
|
+
children: M
|
|
717
696
|
}),
|
|
718
|
-
Q.length === 0 ? /* @__PURE__ */
|
|
719
|
-
className: `${
|
|
697
|
+
Q.length === 0 ? /* @__PURE__ */ g("p", {
|
|
698
|
+
className: `${f} leading-relaxed`,
|
|
720
699
|
children: "No scenes on this camera yet."
|
|
721
|
-
}) : /* @__PURE__ */
|
|
700
|
+
}) : /* @__PURE__ */ g("ul", {
|
|
722
701
|
className: "flex flex-col gap-2",
|
|
723
702
|
children: Q.map((e) => {
|
|
724
|
-
let t =
|
|
725
|
-
return /* @__PURE__ */
|
|
726
|
-
className: `flex flex-col gap-1.5 rounded-md border p-2 ${
|
|
703
|
+
let t = te(e);
|
|
704
|
+
return /* @__PURE__ */ _("li", {
|
|
705
|
+
className: `flex flex-col gap-1.5 rounded-md border p-2 ${P === e.id ? "border-primary/50" : "border-border"}`,
|
|
727
706
|
children: [
|
|
728
|
-
/* @__PURE__ */
|
|
707
|
+
/* @__PURE__ */ _("div", {
|
|
729
708
|
className: "flex items-center gap-2",
|
|
730
|
-
children: [/* @__PURE__ */
|
|
709
|
+
children: [/* @__PURE__ */ g("button", {
|
|
731
710
|
type: "button",
|
|
732
711
|
className: "flex-1 text-left text-[12px] font-medium text-foreground",
|
|
733
|
-
onClick: () =>
|
|
712
|
+
onClick: () => F(e.id),
|
|
734
713
|
children: e.label
|
|
735
|
-
}), /* @__PURE__ */
|
|
736
|
-
className: `rounded border px-1.5 py-0.5 text-[10px] font-medium ${
|
|
714
|
+
}), /* @__PURE__ */ g("span", {
|
|
715
|
+
className: `rounded border px-1.5 py-0.5 text-[10px] font-medium ${q[t.tone]}`,
|
|
737
716
|
children: t.text
|
|
738
717
|
})]
|
|
739
718
|
}),
|
|
740
|
-
/* @__PURE__ */
|
|
741
|
-
className: `${
|
|
742
|
-
children:
|
|
719
|
+
/* @__PURE__ */ g("p", {
|
|
720
|
+
className: `${f} leading-relaxed`,
|
|
721
|
+
children: ee(e, ae)
|
|
743
722
|
}),
|
|
744
|
-
/* @__PURE__ */
|
|
745
|
-
className: `${
|
|
746
|
-
children:
|
|
723
|
+
/* @__PURE__ */ g("p", {
|
|
724
|
+
className: `${f} tabular-nums`,
|
|
725
|
+
children: S(e)
|
|
747
726
|
}),
|
|
748
|
-
/* @__PURE__ */
|
|
727
|
+
/* @__PURE__ */ g(k, {
|
|
749
728
|
monitor: e,
|
|
750
|
-
disabled:
|
|
751
|
-
onDelete: ({ stateId: t, index: n }) => void $(`refdel-${e.id}-${t}-${String(n)}`, async () =>
|
|
729
|
+
disabled: A !== null,
|
|
730
|
+
onDelete: ({ stateId: t, index: n }) => void $(`refdel-${e.id}-${t}-${String(n)}`, async () => o.sceneMonitor?.deleteReference({
|
|
752
731
|
monitorId: e.id,
|
|
753
732
|
stateId: t,
|
|
754
733
|
index: n
|
|
755
734
|
}))
|
|
756
735
|
}),
|
|
757
|
-
/* @__PURE__ */
|
|
736
|
+
/* @__PURE__ */ _("div", {
|
|
758
737
|
className: "flex flex-wrap items-center gap-1.5",
|
|
759
738
|
children: [
|
|
760
|
-
|
|
739
|
+
re.map((t) => {
|
|
761
740
|
let n = t === "ir";
|
|
762
|
-
return /* @__PURE__ */
|
|
741
|
+
return /* @__PURE__ */ _("button", {
|
|
763
742
|
type: "button",
|
|
764
|
-
className:
|
|
765
|
-
disabled:
|
|
766
|
-
title: n ? "Optional. Without a night reference the checks in infrared are simply skipped — the scene keeps working in daylight and nothing is reported as broken." : `Take a fresh photo now and store it as the ${
|
|
767
|
-
onClick: () => void $(`cap-${e.id}-${t}`, async () =>
|
|
743
|
+
className: W,
|
|
744
|
+
disabled: A !== null,
|
|
745
|
+
title: n ? "Optional. Without a night reference the checks in infrared are simply skipped — the scene keeps working in daylight and nothing is reported as broken." : `Take a fresh photo now and store it as the ${x(t).toLowerCase()} reference`,
|
|
746
|
+
onClick: () => void $(`cap-${e.id}-${t}`, async () => o.sceneMonitor?.captureReference({
|
|
768
747
|
monitorId: e.id,
|
|
769
748
|
condition: t
|
|
770
749
|
})),
|
|
771
750
|
children: [
|
|
772
|
-
/* @__PURE__ */
|
|
751
|
+
/* @__PURE__ */ g(s, { className: "mr-1 inline h-3 w-3" }),
|
|
773
752
|
"Capture ",
|
|
774
|
-
|
|
775
|
-
n && /* @__PURE__ */
|
|
753
|
+
x(t).toLowerCase(),
|
|
754
|
+
n && /* @__PURE__ */ g("span", {
|
|
776
755
|
className: "ml-1 text-foreground-subtle/70",
|
|
777
756
|
children: "(optional)"
|
|
778
757
|
})
|
|
779
758
|
]
|
|
780
759
|
}, t);
|
|
781
760
|
}),
|
|
782
|
-
/* @__PURE__ */
|
|
761
|
+
/* @__PURE__ */ _("button", {
|
|
783
762
|
type: "button",
|
|
784
|
-
className:
|
|
785
|
-
disabled:
|
|
763
|
+
className: G,
|
|
764
|
+
disabled: A !== null || e.states.length === 0,
|
|
786
765
|
title: "Clear the flag and re-photograph what normal looks like right now",
|
|
787
|
-
onClick: () => void $(`reset-${e.id}`, async () =>
|
|
788
|
-
children: [/* @__PURE__ */
|
|
766
|
+
onClick: () => void $(`reset-${e.id}`, async () => o.sceneMonitor?.resetScene({ monitorId: e.id })),
|
|
767
|
+
children: [/* @__PURE__ */ g(c, { className: "mr-1 inline h-3 w-3" }), "Reset"]
|
|
789
768
|
}),
|
|
790
|
-
/* @__PURE__ */
|
|
769
|
+
/* @__PURE__ */ g("button", {
|
|
791
770
|
type: "button",
|
|
792
|
-
className:
|
|
793
|
-
disabled:
|
|
794
|
-
onClick: () => void $(`check-${e.id}`, async () =>
|
|
771
|
+
className: W,
|
|
772
|
+
disabled: A !== null,
|
|
773
|
+
onClick: () => void $(`check-${e.id}`, async () => o.sceneMonitor?.recheckNow({ monitorId: e.id })),
|
|
795
774
|
children: "Check now"
|
|
796
775
|
}),
|
|
797
|
-
/* @__PURE__ */
|
|
776
|
+
/* @__PURE__ */ _("button", {
|
|
798
777
|
type: "button",
|
|
799
|
-
className:
|
|
800
|
-
"aria-pressed":
|
|
778
|
+
className: I === e.id ? G : W,
|
|
779
|
+
"aria-pressed": I === e.id,
|
|
801
780
|
"aria-label": `Settings for ${e.label}`,
|
|
802
|
-
disabled:
|
|
803
|
-
onClick: () =>
|
|
804
|
-
children: [/* @__PURE__ */
|
|
781
|
+
disabled: A !== null,
|
|
782
|
+
onClick: () => L((t) => t === e.id ? null : e.id),
|
|
783
|
+
children: [/* @__PURE__ */ g(l, { className: "mr-1 inline h-3 w-3" }), "Settings"]
|
|
805
784
|
}),
|
|
806
|
-
/* @__PURE__ */
|
|
785
|
+
/* @__PURE__ */ g("button", {
|
|
807
786
|
type: "button",
|
|
808
|
-
className:
|
|
809
|
-
disabled:
|
|
810
|
-
onClick: () => void $(`del-${e.id}`, async () =>
|
|
811
|
-
children: /* @__PURE__ */
|
|
787
|
+
className: K,
|
|
788
|
+
disabled: A !== null,
|
|
789
|
+
onClick: () => void $(`del-${e.id}`, async () => o.sceneMonitor?.deleteScene({ monitorId: e.id })),
|
|
790
|
+
children: /* @__PURE__ */ g(u, { className: "h-3 w-3" })
|
|
812
791
|
})
|
|
813
792
|
]
|
|
814
793
|
}),
|
|
815
|
-
|
|
794
|
+
I === e.id && /* @__PURE__ */ g(V, {
|
|
816
795
|
monitor: e,
|
|
817
|
-
disabled:
|
|
818
|
-
onPatch: (t) => void $(`tune-${e.id}`, async () =>
|
|
796
|
+
disabled: A !== null,
|
|
797
|
+
onPatch: (t) => void $(`tune-${e.id}`, async () => o.sceneMonitor?.updateScene({
|
|
819
798
|
monitorId: e.id,
|
|
820
799
|
patch: t
|
|
821
800
|
}))
|
|
@@ -828,4 +807,4 @@ function X({ deviceId: e }) {
|
|
|
828
807
|
}) : null;
|
|
829
808
|
}
|
|
830
809
|
//#endregion
|
|
831
|
-
export {
|
|
810
|
+
export { Y as SceneMonitorEditor };
|