@camstack/addon-osd-manager 0.1.124 → 0.1.125
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-a5Xl2ZE4.mjs +310 -0
- package/dist/{PrivacyMaskSettings-9rCXAZlR.mjs → PrivacyMaskSettings-B2UgOTdb.mjs} +26 -26
- package/dist/{SceneMonitorEditor-D2ATIIZD.mjs → SceneMonitorEditor-8tp57K86.mjs} +295 -295
- package/dist/_stub.js +243 -243
- package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_osd_manager_page-B2cBM7jE.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_osd_manager_page-Co7z8wQJ.mjs} +3 -3
- package/dist/addon-osd-manager.css +1 -1
- package/dist/{responsive-CC0j2h-d.mjs → cap-error-DC-GOnm5.mjs} +7 -7
- package/dist/{hostInit-Du2Me1GR.mjs → hostInit-p8Mnw5w9.mjs} +2 -2
- package/dist/index.js +36 -18
- package/dist/index.mjs +36 -18
- package/dist/{player-overlays-CMeXfcep.mjs → player-overlays-C7IiQKvf.mjs} +1 -1
- package/dist/remoteEntry.js +1 -1
- package/dist/{scene-monitor-copy-CjiHJ4pT.mjs → scene-monitor-copy-B5sXPAoG.mjs} +1 -1
- package/dist/{square-hvOcBhdH.mjs → square-MsYzEBNo.mjs} +1 -1
- package/dist/{trash-2-rb-x3jwf.mjs → trash-2-CahmDJ9h.mjs} +1 -1
- package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_osd_manager_page__remoteEntry_js-D8j_yb3G.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_osd_manager_page__remoteEntry_js-B0w_cAoJ.mjs} +1 -1
- package/package.json +1 -1
- package/dist/MotionZonesSettings-DOFOB5MX.mjs +0 -310
|
@@ -101,8 +101,11 @@ function w(n) {
|
|
|
101
101
|
return t(r, i, i);
|
|
102
102
|
}
|
|
103
103
|
//#endregion
|
|
104
|
+
//#region ../ui-library/src/lib/responsive.ts
|
|
105
|
+
var T = "text-[10px] text-foreground-subtle";
|
|
106
|
+
//#endregion
|
|
104
107
|
//#region ../ui-library/src/lib/cap-error.ts
|
|
105
|
-
function
|
|
108
|
+
function E(e) {
|
|
106
109
|
if (typeof e != "object" || !e) return null;
|
|
107
110
|
let t = Reflect.get(e, "data");
|
|
108
111
|
if (typeof t == "object" && t) {
|
|
@@ -111,12 +114,9 @@ function T(e) {
|
|
|
111
114
|
}
|
|
112
115
|
return null;
|
|
113
116
|
}
|
|
114
|
-
function
|
|
115
|
-
let t =
|
|
117
|
+
function D(e) {
|
|
118
|
+
let t = E(e);
|
|
116
119
|
return t === null ? (e instanceof Error ? e.message : String(e)).includes("provider not available") : t === "no-provider" || t === "node-offline";
|
|
117
120
|
}
|
|
118
121
|
//#endregion
|
|
119
|
-
|
|
120
|
-
var D = "text-[10px] text-foreground-subtle";
|
|
121
|
-
//#endregion
|
|
122
|
-
export { x as a, w as i, E as n, y as o, C as r, v as s, D as t };
|
|
122
|
+
export { x as a, w as i, T as n, y as o, C as r, v as s, D as t };
|
|
@@ -36,7 +36,7 @@ async function r() {
|
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
"@camstack/types": {
|
|
39
|
-
version: "1.2.
|
|
39
|
+
version: "1.2.235",
|
|
40
40
|
scope: "default",
|
|
41
41
|
shareConfig: {
|
|
42
42
|
singleton: !0,
|
|
@@ -81,7 +81,7 @@ async function r() {
|
|
|
81
81
|
}
|
|
82
82
|
},
|
|
83
83
|
"@camstack/ui-library": {
|
|
84
|
-
version: "1.2.
|
|
84
|
+
version: "1.2.191",
|
|
85
85
|
scope: "default",
|
|
86
86
|
shareConfig: {
|
|
87
87
|
singleton: !0,
|
package/dist/index.js
CHANGED
|
@@ -5363,7 +5363,7 @@ var ZodIssueCode = {
|
|
|
5363
5363
|
var ZodFirstPartyTypeKind;
|
|
5364
5364
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5365
5365
|
//#endregion
|
|
5366
|
-
//#region ../types/dist/sleep-
|
|
5366
|
+
//#region ../types/dist/sleep-7AN_Txmu.mjs
|
|
5367
5367
|
/**
|
|
5368
5368
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5369
5369
|
* window to float samples (D455).
|
|
@@ -5563,12 +5563,6 @@ Object.fromEntries([
|
|
|
5563
5563
|
icon: "circle-dot",
|
|
5564
5564
|
order: 40
|
|
5565
5565
|
},
|
|
5566
|
-
{
|
|
5567
|
-
id: "clips",
|
|
5568
|
-
label: "Clips",
|
|
5569
|
-
icon: "clapperboard",
|
|
5570
|
-
order: 41
|
|
5571
|
-
},
|
|
5572
5566
|
{
|
|
5573
5567
|
id: "engine",
|
|
5574
5568
|
label: "Inference Engine",
|
|
@@ -29271,17 +29265,31 @@ var videoclipsCapability = {
|
|
|
29271
29265
|
* `device-config-widget-wrapped-binding.spec.ts` pins that a `kind:'wrapped'`
|
|
29272
29266
|
* binding entry derives the same section a native one does.
|
|
29273
29267
|
*
|
|
29274
|
-
*
|
|
29275
|
-
*
|
|
29276
|
-
*
|
|
29268
|
+
* **It is a SECTION of the Recording tab, at the end of it — not a tab of
|
|
29269
|
+
* its own.** It shipped as a `clips` top-tab and the operator rejected the
|
|
29270
|
+
* placement: *"utilizzerei la stessa tab recordings, lì abbiamo già tutto il
|
|
29271
|
+
* necessario, una nuova sezione alla fine per le clips"*. The Recording tab
|
|
29272
|
+
* already holds the recorder's panel, the schedule bands and the unified
|
|
29273
|
+
* retention policy; footage the camera itself holds is the same question,
|
|
29274
|
+
* asked of a different store. `order: 100` puts it after all of them with
|
|
29275
|
+
* room left in front. The `clips` entry in `WELL_KNOWN_TABS` went with it —
|
|
29276
|
+
* a well-known id nobody declares is an invitation to mint the tab again.
|
|
29277
|
+
*
|
|
29278
|
+
* `topTab` stays: the browser owns a pane (a day's tiles, a source list and
|
|
29279
|
+
* a player) and the Config tab's inner bar has no room for one. The widget
|
|
29280
|
+
* itself is `host/clips-browser` in ui-library's `HOST_WIDGETS`, and because
|
|
29281
|
+
* the admin Recordings page renders every `location:'top-tab'` +
|
|
29282
|
+
* `tab:'recording'` section behind its camera picker
|
|
29283
|
+
* (`CameraRecordingSettingsSection`), this declaration lands the section on
|
|
29284
|
+
* BOTH surfaces with no second wiring.
|
|
29277
29285
|
*/
|
|
29278
29286
|
deviceConfig: { ui: {
|
|
29279
29287
|
kind: "widget",
|
|
29280
29288
|
widgetId: "host/clips-browser",
|
|
29281
|
-
tab: "
|
|
29289
|
+
tab: "recording",
|
|
29282
29290
|
topTab: true,
|
|
29283
29291
|
label: "Clips",
|
|
29284
|
-
order:
|
|
29292
|
+
order: 100
|
|
29285
29293
|
} },
|
|
29286
29294
|
methods: {
|
|
29287
29295
|
listClips: method(object({
|
|
@@ -29290,13 +29298,23 @@ var videoclipsCapability = {
|
|
|
29290
29298
|
until: number(),
|
|
29291
29299
|
limit: number().int().positive().optional(),
|
|
29292
29300
|
/**
|
|
29293
|
-
*
|
|
29294
|
-
*
|
|
29295
|
-
*
|
|
29296
|
-
*
|
|
29297
|
-
*
|
|
29301
|
+
* WHICH provider to ask — the `addonId` a {@link ClipSourceSchema} row
|
|
29302
|
+
* carries, never a source id and never a list.
|
|
29303
|
+
*
|
|
29304
|
+
* Absent means the device's BOUND provider, which is CamStack on every
|
|
29305
|
+
* camera today because that is what `deviceManager.getBindings`
|
|
29306
|
+
* answers with. A provider the device is not bound to is refused by
|
|
29307
|
+
* name rather than answered by another one (D552's
|
|
29308
|
+
* `rejectUnresolvedAddonPin` rule).
|
|
29309
|
+
*
|
|
29310
|
+
* It replaced `sources?: string[]`, a VIEW filter over source ids that
|
|
29311
|
+
* assumed the answer was a fan-out over everything a camera has. The
|
|
29312
|
+
* operator settled otherwise on 2026-09-20 — *"il get videoclips
|
|
29313
|
+
* prendere un provider opzionale, di default va su camstack"*,
|
|
29314
|
+
* *"l'utilizzatore è uno solo"* — so the list is asked of one provider
|
|
29315
|
+
* at a time and there is nothing to filter out of it.
|
|
29298
29316
|
*/
|
|
29299
|
-
|
|
29317
|
+
provider: string().optional()
|
|
29300
29318
|
}), array(ClipSchema).readonly(), {
|
|
29301
29319
|
kind: "query",
|
|
29302
29320
|
auth: "protected"
|
package/dist/index.mjs
CHANGED
|
@@ -5359,7 +5359,7 @@ var ZodIssueCode = {
|
|
|
5359
5359
|
var ZodFirstPartyTypeKind;
|
|
5360
5360
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5361
5361
|
//#endregion
|
|
5362
|
-
//#region ../types/dist/sleep-
|
|
5362
|
+
//#region ../types/dist/sleep-7AN_Txmu.mjs
|
|
5363
5363
|
/**
|
|
5364
5364
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5365
5365
|
* window to float samples (D455).
|
|
@@ -5559,12 +5559,6 @@ Object.fromEntries([
|
|
|
5559
5559
|
icon: "circle-dot",
|
|
5560
5560
|
order: 40
|
|
5561
5561
|
},
|
|
5562
|
-
{
|
|
5563
|
-
id: "clips",
|
|
5564
|
-
label: "Clips",
|
|
5565
|
-
icon: "clapperboard",
|
|
5566
|
-
order: 41
|
|
5567
|
-
},
|
|
5568
5562
|
{
|
|
5569
5563
|
id: "engine",
|
|
5570
5564
|
label: "Inference Engine",
|
|
@@ -29267,17 +29261,31 @@ var videoclipsCapability = {
|
|
|
29267
29261
|
* `device-config-widget-wrapped-binding.spec.ts` pins that a `kind:'wrapped'`
|
|
29268
29262
|
* binding entry derives the same section a native one does.
|
|
29269
29263
|
*
|
|
29270
|
-
*
|
|
29271
|
-
*
|
|
29272
|
-
*
|
|
29264
|
+
* **It is a SECTION of the Recording tab, at the end of it — not a tab of
|
|
29265
|
+
* its own.** It shipped as a `clips` top-tab and the operator rejected the
|
|
29266
|
+
* placement: *"utilizzerei la stessa tab recordings, lì abbiamo già tutto il
|
|
29267
|
+
* necessario, una nuova sezione alla fine per le clips"*. The Recording tab
|
|
29268
|
+
* already holds the recorder's panel, the schedule bands and the unified
|
|
29269
|
+
* retention policy; footage the camera itself holds is the same question,
|
|
29270
|
+
* asked of a different store. `order: 100` puts it after all of them with
|
|
29271
|
+
* room left in front. The `clips` entry in `WELL_KNOWN_TABS` went with it —
|
|
29272
|
+
* a well-known id nobody declares is an invitation to mint the tab again.
|
|
29273
|
+
*
|
|
29274
|
+
* `topTab` stays: the browser owns a pane (a day's tiles, a source list and
|
|
29275
|
+
* a player) and the Config tab's inner bar has no room for one. The widget
|
|
29276
|
+
* itself is `host/clips-browser` in ui-library's `HOST_WIDGETS`, and because
|
|
29277
|
+
* the admin Recordings page renders every `location:'top-tab'` +
|
|
29278
|
+
* `tab:'recording'` section behind its camera picker
|
|
29279
|
+
* (`CameraRecordingSettingsSection`), this declaration lands the section on
|
|
29280
|
+
* BOTH surfaces with no second wiring.
|
|
29273
29281
|
*/
|
|
29274
29282
|
deviceConfig: { ui: {
|
|
29275
29283
|
kind: "widget",
|
|
29276
29284
|
widgetId: "host/clips-browser",
|
|
29277
|
-
tab: "
|
|
29285
|
+
tab: "recording",
|
|
29278
29286
|
topTab: true,
|
|
29279
29287
|
label: "Clips",
|
|
29280
|
-
order:
|
|
29288
|
+
order: 100
|
|
29281
29289
|
} },
|
|
29282
29290
|
methods: {
|
|
29283
29291
|
listClips: method(object({
|
|
@@ -29286,13 +29294,23 @@ var videoclipsCapability = {
|
|
|
29286
29294
|
until: number(),
|
|
29287
29295
|
limit: number().int().positive().optional(),
|
|
29288
29296
|
/**
|
|
29289
|
-
*
|
|
29290
|
-
*
|
|
29291
|
-
*
|
|
29292
|
-
*
|
|
29293
|
-
*
|
|
29297
|
+
* WHICH provider to ask — the `addonId` a {@link ClipSourceSchema} row
|
|
29298
|
+
* carries, never a source id and never a list.
|
|
29299
|
+
*
|
|
29300
|
+
* Absent means the device's BOUND provider, which is CamStack on every
|
|
29301
|
+
* camera today because that is what `deviceManager.getBindings`
|
|
29302
|
+
* answers with. A provider the device is not bound to is refused by
|
|
29303
|
+
* name rather than answered by another one (D552's
|
|
29304
|
+
* `rejectUnresolvedAddonPin` rule).
|
|
29305
|
+
*
|
|
29306
|
+
* It replaced `sources?: string[]`, a VIEW filter over source ids that
|
|
29307
|
+
* assumed the answer was a fan-out over everything a camera has. The
|
|
29308
|
+
* operator settled otherwise on 2026-09-20 — *"il get videoclips
|
|
29309
|
+
* prendere un provider opzionale, di default va su camstack"*,
|
|
29310
|
+
* *"l'utilizzatore è uno solo"* — so the list is asked of one provider
|
|
29311
|
+
* at a time and there is nothing to filter out of it.
|
|
29294
29312
|
*/
|
|
29295
|
-
|
|
29313
|
+
provider: string().optional()
|
|
29296
29314
|
}), array(ClipSchema).readonly(), {
|
|
29297
29315
|
kind: "query",
|
|
29298
29316
|
auth: "protected"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h as e, l as t, u as n, y as r } from "./_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare__react__loadShare__.js-Bs1t18EM.mjs";
|
|
2
|
-
import { o as i, s as a } from "./
|
|
2
|
+
import { o as i, s as a } from "./cap-error-DC-GOnm5.mjs";
|
|
3
3
|
import { n as o, r as s, t as c } from "./_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-DalfdIDw.mjs";
|
|
4
4
|
var l = a("chevron-down", [["path", {
|
|
5
5
|
d: "m6 9 6 6 6-6",
|
package/dist/remoteEntry.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, t } from "./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_osd_manager_page__remoteEntry_js-
|
|
1
|
+
import { n as e, t } from "./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_osd_manager_page__remoteEntry_js-B0w_cAoJ.mjs";
|
|
2
2
|
export { t as get, e as init };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as e, h as t, p as n, y as r } from "./_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare__react__loadShare__.js-Bs1t18EM.mjs";
|
|
2
|
-
import { s as i } from "./
|
|
2
|
+
import { s as i } from "./cap-error-DC-GOnm5.mjs";
|
|
3
3
|
var a = i("camera", [["path", {
|
|
4
4
|
d: "M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",
|
|
5
5
|
key: "18u6gg"
|
|
@@ -2753,7 +2753,7 @@ async function rr(e) {
|
|
|
2753
2753
|
}
|
|
2754
2754
|
}
|
|
2755
2755
|
async function ir() {
|
|
2756
|
-
return tr ||= rr(() => import("./_virtual_mf-localSharedImportMap___mfe_internal__addon_osd_manager_page-
|
|
2756
|
+
return tr ||= rr(() => import("./_virtual_mf-localSharedImportMap___mfe_internal__addon_osd_manager_page-Co7z8wQJ.mjs")).catch((e) => {
|
|
2757
2757
|
throw tr = void 0, e;
|
|
2758
2758
|
}), tr;
|
|
2759
2759
|
}
|
package/package.json
CHANGED
|
@@ -1,310 +0,0 @@
|
|
|
1
|
-
import { c as e, h as t, m as n, p as r, u as i, y as a } from "./_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare__react__loadShare__.js-Bs1t18EM.mjs";
|
|
2
|
-
import { a as o, n as s, r as c, s as l, t as u } from "./responsive-CC0j2h-d.mjs";
|
|
3
|
-
import { n as d, t as f } from "./player-overlays-CMeXfcep.mjs";
|
|
4
|
-
import { n as p, r as m, t as ee } 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-BEVxAjNq.mjs";
|
|
6
|
-
var g = l("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
|
-
a();
|
|
27
|
-
var _ = 110, v = "motion-zones", y = 0, b = [
|
|
28
|
-
1,
|
|
29
|
-
2,
|
|
30
|
-
3
|
|
31
|
-
], x = 1, S = "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", C = "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 w(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 T(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 E(e, t) {
|
|
43
|
-
return Math.ceil(e / t);
|
|
44
|
-
}
|
|
45
|
-
function D(e, t, n) {
|
|
46
|
-
return Math.min(n - 1, Math.floor((e + .5) / t * n));
|
|
47
|
-
}
|
|
48
|
-
function O(e, t, n, r) {
|
|
49
|
-
let i = E(t, r), a = E(n, r), o = Array.from({ length: i * a }, () => !1);
|
|
50
|
-
for (let r = 0; r < n; r += 1) {
|
|
51
|
-
let s = D(r, n, a);
|
|
52
|
-
for (let n = 0; n < t; n += 1) e[r * t + n] === !0 && (o[s * i + D(n, t, i)] = !0);
|
|
53
|
-
}
|
|
54
|
-
return o;
|
|
55
|
-
}
|
|
56
|
-
function k(e, t, n, r) {
|
|
57
|
-
let i = E(t, r), a = E(n, r), o = Array.from({ length: t * n }, () => !1);
|
|
58
|
-
for (let r = 0; r < n; r += 1) {
|
|
59
|
-
let s = D(r, n, a);
|
|
60
|
-
for (let n = 0; n < t; n += 1) o[r * t + n] = e[s * i + D(n, t, i)] === !0;
|
|
61
|
-
}
|
|
62
|
-
return o;
|
|
63
|
-
}
|
|
64
|
-
function A({ deviceId: a }) {
|
|
65
|
-
let l = c(o().trpcClient, a), [D, A] = t(null), [j, M] = t(!1), [N, P] = t(null), [F, I] = t(null), [L, R] = t(x), [z, B] = t(!1), [V, H] = t(!1), U = n(!1);
|
|
66
|
-
i(() => {
|
|
67
|
-
if (!l) return;
|
|
68
|
-
let e = !1;
|
|
69
|
-
return U.current = !1, A(null), M(!1), P(null), I(null), R(x), H(!1), (async () => {
|
|
70
|
-
try {
|
|
71
|
-
let t = await l.motionZones?.getOptions({});
|
|
72
|
-
if (e) return;
|
|
73
|
-
if (!t) throw Error("device proxy not ready");
|
|
74
|
-
if (A(t), U.current) return;
|
|
75
|
-
let n = await l.motionZones?.getStatus({});
|
|
76
|
-
if (e) return;
|
|
77
|
-
if (!n) throw Error("device proxy not ready");
|
|
78
|
-
U.current = !0;
|
|
79
|
-
let r = n.regions.find((e) => e.shape.kind === "grid"), i = w(r ? r.shape.cells : [], t.grid.width, t.grid.height);
|
|
80
|
-
I(i), P(O(i, t.grid.width, t.grid.height, x));
|
|
81
|
-
} catch (t) {
|
|
82
|
-
if (e) return;
|
|
83
|
-
s(t) ? M(!0) : console.error("Motion Zones load failed", t);
|
|
84
|
-
}
|
|
85
|
-
})(), () => {
|
|
86
|
-
e = !0;
|
|
87
|
-
};
|
|
88
|
-
}, [l]);
|
|
89
|
-
let W = D ? D.grid.width : 0, G = D ? D.grid.height : 0, K = E(W, L), q = E(G, L), J = r(() => N && D ? k(N, W, G, L) : null, [
|
|
90
|
-
N,
|
|
91
|
-
D,
|
|
92
|
-
W,
|
|
93
|
-
G,
|
|
94
|
-
L
|
|
95
|
-
]), Y = r(() => J !== null && F !== null && !T(J, F), [J, F]), te = r(() => J ? J.reduce((e, t) => t ? e + 1 : e, 0) : 0, [J]), ne = W * G, X = K * q, Z = e((e) => {
|
|
96
|
-
X > 0 && P(Array.from({ length: X }, () => e));
|
|
97
|
-
}, [X]), re = e(() => {
|
|
98
|
-
P((e) => e && e.map((e) => !e));
|
|
99
|
-
}, []), ie = e(() => {
|
|
100
|
-
F && D && P(O(F, W, G, L));
|
|
101
|
-
}, [
|
|
102
|
-
F,
|
|
103
|
-
D,
|
|
104
|
-
W,
|
|
105
|
-
G,
|
|
106
|
-
L
|
|
107
|
-
]), ae = e((e) => {
|
|
108
|
-
e === L || !D || P((t) => {
|
|
109
|
-
if (!t) return R(e), t;
|
|
110
|
-
let n = O(k(t, W, G, L), W, G, e);
|
|
111
|
-
return R(e), n;
|
|
112
|
-
});
|
|
113
|
-
}, [
|
|
114
|
-
L,
|
|
115
|
-
D,
|
|
116
|
-
W,
|
|
117
|
-
G
|
|
118
|
-
]), Q = r(() => D && N ? [{
|
|
119
|
-
id: y,
|
|
120
|
-
shape: {
|
|
121
|
-
kind: "grid",
|
|
122
|
-
gridWidth: K,
|
|
123
|
-
gridHeight: q,
|
|
124
|
-
cells: [...N]
|
|
125
|
-
}
|
|
126
|
-
}] : [], [
|
|
127
|
-
D,
|
|
128
|
-
N,
|
|
129
|
-
K,
|
|
130
|
-
q
|
|
131
|
-
]), $ = e((e, t) => {
|
|
132
|
-
t.kind === "grid" && P(t.cells);
|
|
133
|
-
}, []), oe = e(async () => {
|
|
134
|
-
if (!(!l || !N || !D)) {
|
|
135
|
-
B(!0);
|
|
136
|
-
try {
|
|
137
|
-
let e = k(N, D.grid.width, D.grid.height, L), t = {
|
|
138
|
-
kind: "grid",
|
|
139
|
-
gridWidth: D.grid.width,
|
|
140
|
-
gridHeight: D.grid.height,
|
|
141
|
-
cells: e
|
|
142
|
-
};
|
|
143
|
-
await l.motionZones?.setZone({ patch: { regions: [{
|
|
144
|
-
id: y,
|
|
145
|
-
enabled: !0,
|
|
146
|
-
shape: t
|
|
147
|
-
}] } });
|
|
148
|
-
let n = await l.motionZones?.getStatus({});
|
|
149
|
-
if (n) {
|
|
150
|
-
let e = n.regions.find((e) => e.shape.kind === "grid"), t = w(e ? e.shape.cells : [], D.grid.width, D.grid.height);
|
|
151
|
-
I(t), P(O(t, D.grid.width, D.grid.height, L));
|
|
152
|
-
}
|
|
153
|
-
} catch (e) {
|
|
154
|
-
console.error("Motion Zones save failed", e);
|
|
155
|
-
} finally {
|
|
156
|
-
B(!1);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}, [
|
|
160
|
-
l,
|
|
161
|
-
N,
|
|
162
|
-
D,
|
|
163
|
-
L
|
|
164
|
-
]);
|
|
165
|
-
return f(r(() => V && !j && D && N ? {
|
|
166
|
-
id: v,
|
|
167
|
-
order: _,
|
|
168
|
-
node: /* @__PURE__ */ p(h, {
|
|
169
|
-
transparent: !0,
|
|
170
|
-
items: Q,
|
|
171
|
-
supportedShapes: ["grid"],
|
|
172
|
-
grid: {
|
|
173
|
-
width: K,
|
|
174
|
-
height: q
|
|
175
|
-
},
|
|
176
|
-
selectedId: y,
|
|
177
|
-
onSelect: () => {},
|
|
178
|
-
onShapeChange: $,
|
|
179
|
-
onDrawComplete: () => {},
|
|
180
|
-
drawingKind: null
|
|
181
|
-
})
|
|
182
|
-
} : null, [
|
|
183
|
-
V,
|
|
184
|
-
j,
|
|
185
|
-
D,
|
|
186
|
-
N,
|
|
187
|
-
Q,
|
|
188
|
-
$,
|
|
189
|
-
K,
|
|
190
|
-
q
|
|
191
|
-
])), l ? /* @__PURE__ */ p(d, {
|
|
192
|
-
title: "Motion Zones",
|
|
193
|
-
icon: /* @__PURE__ */ p(g, { className: "h-3.5 w-3.5 text-foreground-subtle" }),
|
|
194
|
-
children: /* @__PURE__ */ p("div", {
|
|
195
|
-
className: "flex flex-col gap-3",
|
|
196
|
-
children: j ? /* @__PURE__ */ p("p", {
|
|
197
|
-
className: `${u} leading-relaxed`,
|
|
198
|
-
children: "This camera doesn't expose an on-board motion zones grid."
|
|
199
|
-
}) : !j && D !== null && N !== null ? /* @__PURE__ */ m(ee, { children: [/* @__PURE__ */ m("p", {
|
|
200
|
-
className: `${u} leading-relaxed`,
|
|
201
|
-
children: [
|
|
202
|
-
"Toggle ",
|
|
203
|
-
/* @__PURE__ */ p("strong", {
|
|
204
|
-
className: "text-foreground",
|
|
205
|
-
children: "Edit grid"
|
|
206
|
-
}),
|
|
207
|
-
" to paint the region directly on the live frame, then ",
|
|
208
|
-
/* @__PURE__ */ p("strong", {
|
|
209
|
-
className: "text-foreground",
|
|
210
|
-
children: "Save"
|
|
211
|
-
}),
|
|
212
|
-
" to push the mask to the camera. Pick a bigger",
|
|
213
|
-
" ",
|
|
214
|
-
/* @__PURE__ */ p("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
|
-
D.grid.width,
|
|
220
|
-
"×",
|
|
221
|
-
D.grid.height,
|
|
222
|
-
" grid on save (×1 is the finest)."
|
|
223
|
-
]
|
|
224
|
-
}), /* @__PURE__ */ m("div", {
|
|
225
|
-
className: "flex items-center gap-2 flex-wrap",
|
|
226
|
-
children: [
|
|
227
|
-
/* @__PURE__ */ p("button", {
|
|
228
|
-
type: "button",
|
|
229
|
-
onClick: () => H((e) => !e),
|
|
230
|
-
disabled: z,
|
|
231
|
-
"aria-pressed": V,
|
|
232
|
-
className: V ? C : S,
|
|
233
|
-
children: V ? "Done editing" : "Edit grid"
|
|
234
|
-
}),
|
|
235
|
-
/* @__PURE__ */ p("button", {
|
|
236
|
-
type: "button",
|
|
237
|
-
onClick: () => Z(!0),
|
|
238
|
-
disabled: z,
|
|
239
|
-
className: S,
|
|
240
|
-
children: "All on"
|
|
241
|
-
}),
|
|
242
|
-
/* @__PURE__ */ p("button", {
|
|
243
|
-
type: "button",
|
|
244
|
-
onClick: () => Z(!1),
|
|
245
|
-
disabled: z,
|
|
246
|
-
className: S,
|
|
247
|
-
children: "All off"
|
|
248
|
-
}),
|
|
249
|
-
/* @__PURE__ */ p("button", {
|
|
250
|
-
type: "button",
|
|
251
|
-
onClick: re,
|
|
252
|
-
disabled: z,
|
|
253
|
-
className: S,
|
|
254
|
-
children: "Invert"
|
|
255
|
-
}),
|
|
256
|
-
/* @__PURE__ */ m("div", {
|
|
257
|
-
className: "flex items-center gap-1 ml-1",
|
|
258
|
-
role: "group",
|
|
259
|
-
"aria-label": "Cell size",
|
|
260
|
-
children: [/* @__PURE__ */ p("span", {
|
|
261
|
-
className: `${u} mr-0.5`,
|
|
262
|
-
children: "Cell size"
|
|
263
|
-
}), b.map((e) => /* @__PURE__ */ m("button", {
|
|
264
|
-
type: "button",
|
|
265
|
-
onClick: () => ae(e),
|
|
266
|
-
disabled: z,
|
|
267
|
-
"aria-pressed": L === e,
|
|
268
|
-
title: e === 1 ? `Camera grid ${W}×${G} (finest)` : `${E(W, e)}×${E(G, e)} painting grid · cells ×${e} bigger`,
|
|
269
|
-
className: L === e ? C : S,
|
|
270
|
-
children: ["×", e]
|
|
271
|
-
}, e))]
|
|
272
|
-
}),
|
|
273
|
-
/* @__PURE__ */ m("span", {
|
|
274
|
-
className: `${u} ml-1 tabular-nums`,
|
|
275
|
-
children: [
|
|
276
|
-
te,
|
|
277
|
-
" / ",
|
|
278
|
-
ne,
|
|
279
|
-
" cells · ",
|
|
280
|
-
D.grid.width,
|
|
281
|
-
"×",
|
|
282
|
-
D.grid.height,
|
|
283
|
-
L === 1 ? "" : ` · paint ${K}×${q}`
|
|
284
|
-
]
|
|
285
|
-
}),
|
|
286
|
-
/* @__PURE__ */ p("span", { className: "flex-1" }),
|
|
287
|
-
/* @__PURE__ */ p("button", {
|
|
288
|
-
type: "button",
|
|
289
|
-
onClick: ie,
|
|
290
|
-
disabled: z || !Y,
|
|
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__ */ p("button", {
|
|
295
|
-
type: "button",
|
|
296
|
-
onClick: () => void oe(),
|
|
297
|
-
disabled: z || !Y,
|
|
298
|
-
className: C,
|
|
299
|
-
children: z ? "Saving…" : "Save"
|
|
300
|
-
})
|
|
301
|
-
]
|
|
302
|
-
})] }) : /* @__PURE__ */ p("p", {
|
|
303
|
-
className: `${u} leading-relaxed`,
|
|
304
|
-
children: "Loading the camera's grid…"
|
|
305
|
-
})
|
|
306
|
-
})
|
|
307
|
-
}) : null;
|
|
308
|
-
}
|
|
309
|
-
//#endregion
|
|
310
|
-
export { A as MotionZonesSettings };
|