@camstack/addon-osd-manager 0.1.160 → 0.1.161
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-gJgHYJJc.mjs → MotionZonesSettings-CSheC3_V.mjs} +2 -2
- package/dist/{PrivacyMaskSettings-HmUc5RFn.mjs → PrivacyMaskSettings-I6eE4GFM.mjs} +4 -4
- package/dist/{SceneMonitorEditor-Dqc4eAZT.mjs → SceneMonitorEditor-mNJ89n0T.mjs} +3 -3
- package/dist/_stub.js +155 -167
- package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_osd_manager_page-BX8u4O5k.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_osd_manager_page-BYQUZdGL.mjs} +2 -2
- package/dist/{_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-BzuGVFNp.mjs → _virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-B2mEdhqd.mjs} +1 -1
- package/dist/{hostInit-o9ggbWOT.mjs → hostInit-DFyjx8Xk.mjs} +1 -1
- package/dist/index.js +115 -36
- package/dist/index.mjs +108 -37
- package/dist/{player-overlays-BgDqoYs3.mjs → player-overlays-DFXmMB9Y.mjs} +1 -1
- package/dist/remoteEntry.js +1 -1
- package/dist/{responsive-B7zCyVCX.mjs → responsive-DLFs-5i_.mjs} +1 -1
- package/dist/{scene-monitor-copy-DWIcj1X6.mjs → scene-monitor-copy-DVNcikwa.mjs} +1 -1
- package/dist/{square-D0YQUHMC.mjs → square-Co3Eglp3.mjs} +1 -1
- package/dist/{trash-2-C_1H5SIl.mjs → trash-2-DnKldIWK.mjs} +1 -1
- package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_osd_manager_page__remoteEntry_js-BAuPDG6y.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_osd_manager_page__remoteEntry_js-C3yC0JaQ.mjs} +1 -1
- package/package.json +1 -1
package/dist/_stub.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import "./virtualExposes-BgZ5Cn7S.mjs";
|
|
2
|
-
import "./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_osd_manager_page__remoteEntry_js-
|
|
2
|
+
import "./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_osd_manager_page__remoteEntry_js-C3yC0JaQ.mjs";
|
|
3
3
|
import { _ as e, b as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, p as d, r as f, t as p, u as m, v as h } from "./_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare__react__loadShare__.js-C5jUMd7X.mjs";
|
|
4
|
-
import { a as g, c as _, i as v, n as y, o as b, r as x, s as S } from "./responsive-
|
|
5
|
-
import { d as C, l as w, s as T, u as E } from "./scene-monitor-copy-
|
|
6
|
-
import { i as D, r as O } from "./player-overlays-
|
|
7
|
-
import { i as ee, n as te, r as ne, t as k } from "./square-
|
|
8
|
-
import { t as re } from "./trash-2-
|
|
4
|
+
import { a as g, c as _, i as v, n as y, o as b, r as x, s as S } from "./responsive-DLFs-5i_.mjs";
|
|
5
|
+
import { d as C, l as w, s as T, u as E } from "./scene-monitor-copy-DVNcikwa.mjs";
|
|
6
|
+
import { i as D, r as O } from "./player-overlays-DFXmMB9Y.mjs";
|
|
7
|
+
import { i as ee, n as te, r as ne, t as k } from "./square-Co3Eglp3.mjs";
|
|
8
|
+
import { t as re } from "./trash-2-DnKldIWK.mjs";
|
|
9
9
|
import { t as ie } from "./_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.js-BpP33rwB.mjs";
|
|
10
10
|
import { n as A, r as j, t as M } from "./_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-DalfdIDw.mjs";
|
|
11
11
|
import { t as ae } from "./_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare__react_mf_2_dom__loadShare__.js-qB5uHZAd.mjs";
|
|
12
12
|
import { n as N, t as oe } from "./_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CHxDN0gE.mjs";
|
|
13
13
|
import "./_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-Dhy3m6Ij.mjs";
|
|
14
14
|
import "./_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_trpc_mf_1_client__loadShare__.js-C7omKvJr.mjs";
|
|
15
|
-
import { _ as P, a as F, b as I, c as se, d as L, f as ce, g as le, h as ue, l as de, m as fe, n as pe, o as me, p as he, r as ge, s as _e, t as ve, u as ye, v as R, y as be } from "./_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-
|
|
15
|
+
import { _ as P, a as F, b as I, c as se, d as L, f as ce, g as le, h as ue, l as de, m as fe, n as pe, o as me, p as he, r as ge, s as _e, t as ve, u as ye, v as R, y as be } from "./_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-B2mEdhqd.mjs";
|
|
16
16
|
import "./_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_camstack_mf_1_sdk__loadShare__.js-B_4MkXHU.mjs";
|
|
17
17
|
var xe = _("activity", [["path", {
|
|
18
18
|
d: "M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",
|
|
@@ -6100,7 +6100,7 @@ t(), t(), t(), S("camstack:recorded-playback", {
|
|
|
6100
6100
|
mode: "live",
|
|
6101
6101
|
positionMs: null,
|
|
6102
6102
|
send: () => !1
|
|
6103
|
-
}), t(), t(), t(), t(), t(), t(), s(() => import("./MotionZonesSettings-
|
|
6103
|
+
}), t(), t(), t(), t(), t(), t(), s(() => import("./MotionZonesSettings-CSheC3_V.mjs").then((e) => ({ default: e.MotionZonesSettings }))), s(() => import("./PrivacyMaskSettings-I6eE4GFM.mjs").then((e) => ({ default: e.PrivacyMaskSettings }))), t(), t();
|
|
6104
6104
|
var Oo = Object.defineProperty, ko = Object.getOwnPropertySymbols, Ao = Object.prototype.hasOwnProperty, jo = Object.prototype.propertyIsEnumerable, Mo = (e, t, n) => t in e ? Oo(e, t, {
|
|
6105
6105
|
enumerable: !0,
|
|
6106
6106
|
configurable: !0,
|
|
@@ -22468,7 +22468,7 @@ var IT = class {
|
|
|
22468
22468
|
} catch {}
|
|
22469
22469
|
}
|
|
22470
22470
|
};
|
|
22471
|
-
t(), new IT(), t(), t(), t(), s(() => import("./MaskShapeCanvas-BT714ljC.mjs").then((e) => ({ default: e.MaskShapeCanvas }))), s(() => import("./MotionZonesSettings-
|
|
22471
|
+
t(), new IT(), t(), t(), t(), s(() => import("./MaskShapeCanvas-BT714ljC.mjs").then((e) => ({ default: e.MaskShapeCanvas }))), s(() => import("./MotionZonesSettings-CSheC3_V.mjs").then((e) => ({ default: e.MotionZonesSettings }))), s(() => import("./SceneMonitorEditor-mNJ89n0T.mjs").then((e) => ({ default: e.SceneMonitorEditor }))), s(() => import("./PrivacyMaskSettings-I6eE4GFM.mjs").then((e) => ({ default: e.PrivacyMaskSettings })));
|
|
22472
22472
|
//#endregion
|
|
22473
22473
|
//#region src/ui/osd-page-model.ts
|
|
22474
22474
|
function LT() {
|
|
@@ -22717,23 +22717,60 @@ function yE(e, t) {
|
|
|
22717
22717
|
return e.find((e) => e.id === t);
|
|
22718
22718
|
}
|
|
22719
22719
|
//#endregion
|
|
22720
|
-
//#region src/
|
|
22721
|
-
t();
|
|
22720
|
+
//#region src/unit-display.ts
|
|
22722
22721
|
function bE(e) {
|
|
22723
|
-
return `${e.deviceId}:${e.capName}:${e.valuePath}`;
|
|
22724
|
-
}
|
|
22725
|
-
function xE(e) {
|
|
22726
22722
|
if (e === void 0) return;
|
|
22727
22723
|
let t = F(e);
|
|
22728
|
-
|
|
22724
|
+
if (t !== void 0) return L(t);
|
|
22725
|
+
}
|
|
22726
|
+
function xE(e, t, n) {
|
|
22727
|
+
let r = t === void 0 ? void 0 : F(t), i = n === void 0 ? void 0 : F(n);
|
|
22728
|
+
if (r === void 0 || i === void 0 || r === i) return {
|
|
22729
|
+
value: e,
|
|
22730
|
+
unit: i ?? r ?? ""
|
|
22731
|
+
};
|
|
22732
|
+
let a = ye(e, r, i);
|
|
22733
|
+
return a === void 0 ? {
|
|
22734
|
+
value: e,
|
|
22735
|
+
unit: r
|
|
22736
|
+
} : {
|
|
22737
|
+
value: a,
|
|
22738
|
+
unit: i
|
|
22739
|
+
};
|
|
22740
|
+
}
|
|
22741
|
+
function SE(e, t) {
|
|
22742
|
+
if (typeof e != "object" || !e || Array.isArray(e)) return;
|
|
22743
|
+
let n = { ...e }, r = t.split(".");
|
|
22744
|
+
if (r.length >= 1) {
|
|
22745
|
+
let e = n;
|
|
22746
|
+
for (let t of r.slice(0, -1)) {
|
|
22747
|
+
if (typeof e != "object" || !e || Array.isArray(e)) {
|
|
22748
|
+
e = void 0;
|
|
22749
|
+
break;
|
|
22750
|
+
}
|
|
22751
|
+
e = { ...e }[t];
|
|
22752
|
+
}
|
|
22753
|
+
if (typeof e == "object" && e && !Array.isArray(e)) {
|
|
22754
|
+
let t = { ...e }.unit;
|
|
22755
|
+
if (typeof t == "string" && t.length > 0) return t;
|
|
22756
|
+
}
|
|
22757
|
+
}
|
|
22758
|
+
let i = n.unit;
|
|
22759
|
+
return typeof i == "string" && i.length > 0 ? i : void 0;
|
|
22760
|
+
}
|
|
22761
|
+
//#endregion
|
|
22762
|
+
//#region src/components/DeviceStateSourceEditor.tsx
|
|
22763
|
+
t();
|
|
22764
|
+
function CE(e) {
|
|
22765
|
+
return `${e.deviceId}:${e.capName}:${e.valuePath}`;
|
|
22729
22766
|
}
|
|
22730
|
-
function
|
|
22767
|
+
function wE(e) {
|
|
22731
22768
|
let t = e.toLowerCase();
|
|
22732
22769
|
if (t.includes("temp")) return "°C";
|
|
22733
22770
|
if (t.includes("humid")) return "%";
|
|
22734
22771
|
if (t.includes("pressure") || t.includes("hpa")) return "hPa";
|
|
22735
22772
|
}
|
|
22736
|
-
function
|
|
22773
|
+
function TE(e) {
|
|
22737
22774
|
return e.map((e) => ({
|
|
22738
22775
|
id: e.id,
|
|
22739
22776
|
name: e.name,
|
|
@@ -22742,12 +22779,12 @@ function CE(e) {
|
|
|
22742
22779
|
parentDeviceId: "parentDeviceId" in e && typeof e.parentDeviceId == "number" ? e.parentDeviceId : null
|
|
22743
22780
|
}));
|
|
22744
22781
|
}
|
|
22745
|
-
function
|
|
22746
|
-
let o = l(() =>
|
|
22782
|
+
function EE({ source: e, sources: t, pickerDevices: n, listState: r, onChange: i }) {
|
|
22783
|
+
let o = l(() => TE(n), [n]), s = l(() => new Set(t.map((e) => e.deviceId)), [t]), [c, u] = a(void 0), d = e.deviceId, f = c ?? d, p = c !== void 0 && gE(yE(o, c)?.type) ? c : void 0, m = p === void 0 ? [] : vE(p, o, s), h = l(() => d === void 0 || p !== void 0 ? void 0 : dE(t, d), [
|
|
22747
22784
|
t,
|
|
22748
22785
|
d,
|
|
22749
22786
|
p
|
|
22750
|
-
]), g = d === void 0 || p !== void 0 ? void 0 : t.find((t) => t.deviceId === d && t.capName === e.capName && t.valuePath === e.valuePath), _ =
|
|
22787
|
+
]), g = d === void 0 || p !== void 0 ? void 0 : t.find((t) => t.deviceId === d && t.capName === e.capName && t.valuePath === e.valuePath), _ = wE(e.valuePath), v = bE(_);
|
|
22751
22788
|
return /* @__PURE__ */ j("div", {
|
|
22752
22789
|
className: "space-y-2",
|
|
22753
22790
|
"data-testid": "osd-device-state-editor",
|
|
@@ -22854,17 +22891,17 @@ function wE({ source: e, sources: t, pickerDevices: n, listState: r, onChange: i
|
|
|
22854
22891
|
}), /* @__PURE__ */ A(po, {
|
|
22855
22892
|
id: "osd-field-pick",
|
|
22856
22893
|
"data-testid": "osd-field-pick",
|
|
22857
|
-
value:
|
|
22894
|
+
value: CE(g || {
|
|
22858
22895
|
deviceId: d ?? 0,
|
|
22859
22896
|
capName: e.capName,
|
|
22860
22897
|
valuePath: e.valuePath
|
|
22861
22898
|
}),
|
|
22862
22899
|
options: h.fields.map((e) => ({
|
|
22863
|
-
value:
|
|
22900
|
+
value: CE(e),
|
|
22864
22901
|
label: e.label
|
|
22865
22902
|
})),
|
|
22866
22903
|
onChange: (t) => {
|
|
22867
|
-
let n = h.fields.find((e) =>
|
|
22904
|
+
let n = h.fields.find((e) => CE(e) === t.target.value);
|
|
22868
22905
|
n && i({
|
|
22869
22906
|
kind: "device-state",
|
|
22870
22907
|
deviceId: n.deviceId,
|
|
@@ -22906,7 +22943,7 @@ function wE({ source: e, sources: t, pickerDevices: n, listState: r, onChange: i
|
|
|
22906
22943
|
//#endregion
|
|
22907
22944
|
//#region src/components/SourceEditor.tsx
|
|
22908
22945
|
t();
|
|
22909
|
-
var
|
|
22946
|
+
var DE = [
|
|
22910
22947
|
{
|
|
22911
22948
|
value: "static",
|
|
22912
22949
|
label: "Static text"
|
|
@@ -22928,7 +22965,7 @@ var TE = [
|
|
|
22928
22965
|
label: "Named template"
|
|
22929
22966
|
}
|
|
22930
22967
|
];
|
|
22931
|
-
function
|
|
22968
|
+
function OE({ source: e, sources: t, pickerDevices: n, listState: r, templates: i, onChange: a }) {
|
|
22932
22969
|
let o = l(() => i.map((e) => ({
|
|
22933
22970
|
value: e.id,
|
|
22934
22971
|
label: e.name || e.id
|
|
@@ -22942,7 +22979,7 @@ function EE({ source: e, sources: t, pickerDevices: n, listState: r, templates:
|
|
|
22942
22979
|
}), /* @__PURE__ */ A(po, {
|
|
22943
22980
|
id: "osd-source-kind",
|
|
22944
22981
|
value: e.kind,
|
|
22945
|
-
options:
|
|
22982
|
+
options: DE,
|
|
22946
22983
|
onChange: (e) => {
|
|
22947
22984
|
let t = e.target.value;
|
|
22948
22985
|
if (t === "static") a({
|
|
@@ -23013,7 +23050,7 @@ function EE({ source: e, sources: t, pickerDevices: n, listState: r, templates:
|
|
|
23013
23050
|
})
|
|
23014
23051
|
})] })]
|
|
23015
23052
|
}),
|
|
23016
|
-
e.kind === "device-state" && /* @__PURE__ */ A(
|
|
23053
|
+
e.kind === "device-state" && /* @__PURE__ */ A(EE, {
|
|
23017
23054
|
source: e,
|
|
23018
23055
|
sources: t,
|
|
23019
23056
|
pickerDevices: n,
|
|
@@ -23058,7 +23095,7 @@ function EE({ source: e, sources: t, pickerDevices: n, listState: r, templates:
|
|
|
23058
23095
|
}
|
|
23059
23096
|
//#endregion
|
|
23060
23097
|
//#region src/components/ValueMapEditor.tsx
|
|
23061
|
-
function
|
|
23098
|
+
function kE({ valueMap: e, onChange: t }) {
|
|
23062
23099
|
let n = Object.entries(e ?? {});
|
|
23063
23100
|
function r(e) {
|
|
23064
23101
|
if (e.length === 0) {
|
|
@@ -23118,13 +23155,13 @@ function DE({ valueMap: e, onChange: t }) {
|
|
|
23118
23155
|
}
|
|
23119
23156
|
//#endregion
|
|
23120
23157
|
//#region src/components/ScheduleEditor.tsx
|
|
23121
|
-
function
|
|
23158
|
+
function AE(e, t, n) {
|
|
23122
23159
|
return {
|
|
23123
23160
|
...e,
|
|
23124
23161
|
windows: e.windows.map((e, r) => r === t ? n : e)
|
|
23125
23162
|
};
|
|
23126
23163
|
}
|
|
23127
|
-
function
|
|
23164
|
+
function jE({ schedule: e, onChange: t }) {
|
|
23128
23165
|
let n = e !== void 0;
|
|
23129
23166
|
return /* @__PURE__ */ j("div", {
|
|
23130
23167
|
className: "space-y-3",
|
|
@@ -23145,7 +23182,7 @@ function kE({ schedule: e, onChange: t }) {
|
|
|
23145
23182
|
type: "button",
|
|
23146
23183
|
"aria-pressed": n.days.includes(a),
|
|
23147
23184
|
className: ["px-1.5 py-0.5 rounded text-[10px] font-medium", n.days.includes(a) ? "bg-primary text-primary-foreground" : "bg-surface-hover text-foreground-muted"].join(" "),
|
|
23148
|
-
onClick: () => t(
|
|
23185
|
+
onClick: () => t(AE(e, r, sE(n, a))),
|
|
23149
23186
|
children: i
|
|
23150
23187
|
}, a))
|
|
23151
23188
|
}),
|
|
@@ -23159,7 +23196,7 @@ function kE({ schedule: e, onChange: t }) {
|
|
|
23159
23196
|
type: "time",
|
|
23160
23197
|
className: "h-7 w-full px-2 text-xs bg-surface border border-border rounded-md text-foreground",
|
|
23161
23198
|
value: aE(n.startMinute),
|
|
23162
|
-
onChange: (i) => t(
|
|
23199
|
+
onChange: (i) => t(AE(e, r, {
|
|
23163
23200
|
...n,
|
|
23164
23201
|
startMinute: oE(i.target.value)
|
|
23165
23202
|
}))
|
|
@@ -23171,7 +23208,7 @@ function kE({ schedule: e, onChange: t }) {
|
|
|
23171
23208
|
type: "time",
|
|
23172
23209
|
className: "h-7 w-full px-2 text-xs bg-surface border border-border rounded-md text-foreground",
|
|
23173
23210
|
value: aE(n.endMinute),
|
|
23174
|
-
onChange: (i) => t(
|
|
23211
|
+
onChange: (i) => t(AE(e, r, {
|
|
23175
23212
|
...n,
|
|
23176
23213
|
endMinute: oE(i.target.value)
|
|
23177
23214
|
}))
|
|
@@ -23203,7 +23240,7 @@ function kE({ schedule: e, onChange: t }) {
|
|
|
23203
23240
|
}
|
|
23204
23241
|
//#endregion
|
|
23205
23242
|
//#region src/components/ConditionsEditor.tsx
|
|
23206
|
-
function
|
|
23243
|
+
function ME({ conditions: e, supported: t, devices: n, deviceStateSnapshot: r, onSelectDeviceStateDevice: i, onChange: a }) {
|
|
23207
23244
|
let o = t.includes("deviceState"), s = lE(r);
|
|
23208
23245
|
return /* @__PURE__ */ j("div", {
|
|
23209
23246
|
className: "space-y-3",
|
|
@@ -23274,7 +23311,7 @@ function AE({ conditions: e, supported: t, devices: n, deviceStateSnapshot: r, o
|
|
|
23274
23311
|
//#endregion
|
|
23275
23312
|
//#region src/components/SlotEditor.tsx
|
|
23276
23313
|
t();
|
|
23277
|
-
function
|
|
23314
|
+
function NE({ deviceId: e, slot: t, sources: n, conditionSupport: r, devices: i, pickerDevices: o, listState: s, templates: c, onClose: u, onSaved: d }) {
|
|
23278
23315
|
let [f, p] = a(() => RT(t)), [m, h] = a(f.conditions?.deviceState?.deviceId), [g, _] = a(void 0), v = gi({ deviceId: m ?? 0 }, { enabled: m !== void 0 }), y = xi(), b = Si(), x = wi(), S = y.isPending || b.isPending || x.isPending, C = y.error ?? b.error ?? x.error, w = l(() => [{
|
|
23279
23316
|
id: "value",
|
|
23280
23317
|
label: "${value}",
|
|
@@ -23342,7 +23379,7 @@ function jE({ deviceId: e, slot: t, sources: n, conditionSupport: r, devices: i,
|
|
|
23342
23379
|
}))
|
|
23343
23380
|
}), "Binding enabled"]
|
|
23344
23381
|
}),
|
|
23345
|
-
/* @__PURE__ */ A(
|
|
23382
|
+
/* @__PURE__ */ A(OE, {
|
|
23346
23383
|
source: f.source,
|
|
23347
23384
|
sources: n,
|
|
23348
23385
|
pickerDevices: o,
|
|
@@ -23433,21 +23470,21 @@ function jE({ deviceId: e, slot: t, sources: n, conditionSupport: r, devices: i,
|
|
|
23433
23470
|
})
|
|
23434
23471
|
]
|
|
23435
23472
|
}),
|
|
23436
|
-
/* @__PURE__ */ A(
|
|
23473
|
+
/* @__PURE__ */ A(kE, {
|
|
23437
23474
|
valueMap: f.valueMap,
|
|
23438
23475
|
onChange: (e) => p((t) => ({
|
|
23439
23476
|
...t,
|
|
23440
23477
|
valueMap: e
|
|
23441
23478
|
}))
|
|
23442
23479
|
}),
|
|
23443
|
-
/* @__PURE__ */ A(
|
|
23480
|
+
/* @__PURE__ */ A(jE, {
|
|
23444
23481
|
schedule: f.schedule,
|
|
23445
23482
|
onChange: (e) => p((t) => ({
|
|
23446
23483
|
...t,
|
|
23447
23484
|
schedule: e
|
|
23448
23485
|
}))
|
|
23449
23486
|
}),
|
|
23450
|
-
/* @__PURE__ */ A(
|
|
23487
|
+
/* @__PURE__ */ A(ME, {
|
|
23451
23488
|
conditions: f.conditions,
|
|
23452
23489
|
supported: r,
|
|
23453
23490
|
devices: i,
|
|
@@ -23505,7 +23542,7 @@ function jE({ deviceId: e, slot: t, sources: n, conditionSupport: r, devices: i,
|
|
|
23505
23542
|
//#endregion
|
|
23506
23543
|
//#region src/components/DuplicateIntoAction.tsx
|
|
23507
23544
|
t();
|
|
23508
|
-
function
|
|
23545
|
+
function PE({ source: e, destinations: t, onDuplicated: n }) {
|
|
23509
23546
|
let [r, i] = a(!1), [o, s] = a(void 0), [c, l] = a(void 0), [u, d] = a(void 0), f = Ci();
|
|
23510
23547
|
if (t.length === 0) return null;
|
|
23511
23548
|
function p() {
|
|
@@ -23600,7 +23637,7 @@ function ME({ source: e, destinations: t, onDuplicated: n }) {
|
|
|
23600
23637
|
//#endregion
|
|
23601
23638
|
//#region src/components/CameraOsdRow.tsx
|
|
23602
23639
|
t();
|
|
23603
|
-
function
|
|
23640
|
+
function FE({ cameraId: e, supportsOsd: t, onRefetchReady: n }) {
|
|
23604
23641
|
let r = vi({ deviceId: e }, { enabled: t });
|
|
23605
23642
|
if (m(() => {
|
|
23606
23643
|
t && n(e, () => void r.refetch());
|
|
@@ -23615,7 +23652,7 @@ function NE({ cameraId: e, supportsOsd: t, onRefetchReady: n }) {
|
|
|
23615
23652
|
children: WT(i)
|
|
23616
23653
|
});
|
|
23617
23654
|
}
|
|
23618
|
-
function
|
|
23655
|
+
function IE({ cameraId: e, supportsOsd: t, deviceNameById: n }) {
|
|
23619
23656
|
let r = vi({ deviceId: e }, { enabled: t });
|
|
23620
23657
|
if (!t) return /* @__PURE__ */ A("span", {
|
|
23621
23658
|
className: "text-xs text-foreground-subtle",
|
|
@@ -23638,7 +23675,7 @@ function PE({ cameraId: e, supportsOsd: t, deviceNameById: n }) {
|
|
|
23638
23675
|
}, e.key))
|
|
23639
23676
|
});
|
|
23640
23677
|
}
|
|
23641
|
-
function
|
|
23678
|
+
function LE({ camera: e, allDevices: t, conditionSupport: n, pickerDevices: r, listState: i, templates: o, destinations: s, onRefetchReady: c, refetchCamera: u }) {
|
|
23642
23679
|
let [d, f] = a(null), [p, h] = a(0), g = vi({ deviceId: e.id }, { enabled: e.supportsOsd }), _ = g.data?.slots ?? [], v = l(() => d !== null && _.some((e) => e.slotId === d) ? d : XT(_), [d, _]), y = _.find((e) => e.slotId === v), b = yi({ deviceId: e.id }, { enabled: e.supportsOsd && y !== void 0 && !y.readOnly }), x = Ti();
|
|
23643
23680
|
m(() => {
|
|
23644
23681
|
e.supportsOsd && c(e.id, () => void g.refetch());
|
|
@@ -23667,7 +23704,7 @@ function FE({ camera: e, allDevices: t, conditionSupport: n, pickerDevices: r, l
|
|
|
23667
23704
|
disabled: x.isPending,
|
|
23668
23705
|
onClick: () => x.mutate({ deviceId: e.id }, { onSuccess: () => void g.refetch() }),
|
|
23669
23706
|
children: [x.isPending ? /* @__PURE__ */ A(un, { className: "h-3.5 w-3.5 animate-spin" }) : null, "Render now"]
|
|
23670
|
-
}) : null, e.supportsOsd ? /* @__PURE__ */ A(
|
|
23707
|
+
}) : null, e.supportsOsd ? /* @__PURE__ */ A(PE, {
|
|
23671
23708
|
source: e,
|
|
23672
23709
|
destinations: s,
|
|
23673
23710
|
onDuplicated: (e) => {
|
|
@@ -23701,9 +23738,9 @@ function FE({ camera: e, allDevices: t, conditionSupport: n, pickerDevices: r, l
|
|
|
23701
23738
|
},
|
|
23702
23739
|
children: /* @__PURE__ */ A(Rs, {
|
|
23703
23740
|
className: "mb-3",
|
|
23704
|
-
children: _.map((e) => /* @__PURE__ */ A(
|
|
23741
|
+
children: _.map((e) => /* @__PURE__ */ A(RE, { slot: e }, e.slotId))
|
|
23705
23742
|
})
|
|
23706
|
-
}), y === void 0 ? null : /* @__PURE__ */ A(
|
|
23743
|
+
}), y === void 0 ? null : /* @__PURE__ */ A(zE, {
|
|
23707
23744
|
cameraId: e.id,
|
|
23708
23745
|
slot: y,
|
|
23709
23746
|
editorEpoch: p,
|
|
@@ -23721,7 +23758,7 @@ function FE({ camera: e, allDevices: t, conditionSupport: n, pickerDevices: r, l
|
|
|
23721
23758
|
]
|
|
23722
23759
|
});
|
|
23723
23760
|
}
|
|
23724
|
-
function
|
|
23761
|
+
function RE({ slot: e }) {
|
|
23725
23762
|
let t = qT(e);
|
|
23726
23763
|
return /* @__PURE__ */ j(zs, {
|
|
23727
23764
|
value: e.slotId,
|
|
@@ -23732,7 +23769,7 @@ function IE({ slot: e }) {
|
|
|
23732
23769
|
})]
|
|
23733
23770
|
});
|
|
23734
23771
|
}
|
|
23735
|
-
function
|
|
23772
|
+
function zE({ cameraId: e, slot: t, editorEpoch: n, sources: r, conditionSupport: i, devices: a, pickerDevices: o, listState: s, templates: c, onSaved: l }) {
|
|
23736
23773
|
return t.readOnly ? /* @__PURE__ */ j("div", {
|
|
23737
23774
|
className: "rounded-lg border border-border bg-surface p-4 space-y-2",
|
|
23738
23775
|
"data-testid": "osd-slot-readonly",
|
|
@@ -23764,7 +23801,7 @@ function LE({ cameraId: e, slot: t, editorEpoch: n, sources: r, conditionSupport
|
|
|
23764
23801
|
children: VT(t.binding)
|
|
23765
23802
|
})
|
|
23766
23803
|
]
|
|
23767
|
-
}) : /* @__PURE__ */ A(
|
|
23804
|
+
}) : /* @__PURE__ */ A(NE, {
|
|
23768
23805
|
deviceId: e,
|
|
23769
23806
|
slot: t,
|
|
23770
23807
|
sources: r,
|
|
@@ -23779,7 +23816,7 @@ function LE({ cameraId: e, slot: t, editorEpoch: n, sources: r, conditionSupport
|
|
|
23779
23816
|
//#endregion
|
|
23780
23817
|
//#region src/components/CameraOsdTable.tsx
|
|
23781
23818
|
t();
|
|
23782
|
-
function
|
|
23819
|
+
function BE({ cameras: e, osdCapableIds: t, allDevices: n, conditionSupport: r, pickerDevices: i, listState: s, templates: c }) {
|
|
23783
23820
|
let [u, d] = a(void 0), f = o(/* @__PURE__ */ new Map()), p = l(() => new Map(n.map((e) => [e.id, e.name])), [n]), m = l(() => e.map((e) => ({
|
|
23784
23821
|
id: e.id,
|
|
23785
23822
|
name: e.name,
|
|
@@ -23840,7 +23877,7 @@ function RE({ cameras: e, osdCapableIds: t, allDevices: n, conditionSupport: r,
|
|
|
23840
23877
|
{
|
|
23841
23878
|
key: "status",
|
|
23842
23879
|
header: "Status",
|
|
23843
|
-
cell: (e) => /* @__PURE__ */ A(
|
|
23880
|
+
cell: (e) => /* @__PURE__ */ A(FE, {
|
|
23844
23881
|
cameraId: e.id,
|
|
23845
23882
|
supportsOsd: e.supportsOsd,
|
|
23846
23883
|
onRefetchReady: h
|
|
@@ -23849,7 +23886,7 @@ function RE({ cameras: e, osdCapableIds: t, allDevices: n, conditionSupport: r,
|
|
|
23849
23886
|
{
|
|
23850
23887
|
key: "sources",
|
|
23851
23888
|
header: "Active sources",
|
|
23852
|
-
cell: (e) => /* @__PURE__ */ A(
|
|
23889
|
+
cell: (e) => /* @__PURE__ */ A(IE, {
|
|
23853
23890
|
cameraId: e.id,
|
|
23854
23891
|
supportsOsd: e.supportsOsd,
|
|
23855
23892
|
deviceNameById: p
|
|
@@ -23859,7 +23896,7 @@ function RE({ cameras: e, osdCapableIds: t, allDevices: n, conditionSupport: r,
|
|
|
23859
23896
|
isExpanded: (e) => u === e.id,
|
|
23860
23897
|
renderExpanded: (e) => /* @__PURE__ */ A("div", {
|
|
23861
23898
|
id: `osd-camera-detail-${e.id}`,
|
|
23862
|
-
children: /* @__PURE__ */ A(
|
|
23899
|
+
children: /* @__PURE__ */ A(LE, {
|
|
23863
23900
|
camera: e,
|
|
23864
23901
|
allDevices: n,
|
|
23865
23902
|
conditionSupport: r,
|
|
@@ -23877,7 +23914,7 @@ function RE({ cameras: e, osdCapableIds: t, allDevices: n, conditionSupport: r,
|
|
|
23877
23914
|
}
|
|
23878
23915
|
//#endregion
|
|
23879
23916
|
//#region src/format.ts
|
|
23880
|
-
function
|
|
23917
|
+
function VE(e, t) {
|
|
23881
23918
|
if (!Number.isFinite(e)) return "";
|
|
23882
23919
|
if (t <= 0) return String(Math.trunc(e));
|
|
23883
23920
|
let n = 10 ** t, r = Math.trunc(e * n) / n;
|
|
@@ -23885,16 +23922,39 @@ function zE(e, t) {
|
|
|
23885
23922
|
}
|
|
23886
23923
|
//#endregion
|
|
23887
23924
|
//#region src/template-tokens.ts
|
|
23888
|
-
function
|
|
23889
|
-
return `{${e}}`;
|
|
23925
|
+
function HE(e, t = "full") {
|
|
23926
|
+
return t === "full" ? `{${e}}` : `{${e}.${t}}`;
|
|
23927
|
+
}
|
|
23928
|
+
function UE(e) {
|
|
23929
|
+
return `{${e}.full}`;
|
|
23890
23930
|
}
|
|
23891
|
-
function
|
|
23892
|
-
|
|
23931
|
+
function WE(e) {
|
|
23932
|
+
let t = e.alias;
|
|
23933
|
+
return [
|
|
23934
|
+
{
|
|
23935
|
+
id: `${t}.value`,
|
|
23936
|
+
label: `${t} · value`,
|
|
23937
|
+
token: HE(t, "value"),
|
|
23938
|
+
kind: "value"
|
|
23939
|
+
},
|
|
23940
|
+
{
|
|
23941
|
+
id: `${t}.unit`,
|
|
23942
|
+
label: `${t} · unit`,
|
|
23943
|
+
token: HE(t, "unit"),
|
|
23944
|
+
kind: "unit"
|
|
23945
|
+
},
|
|
23946
|
+
{
|
|
23947
|
+
id: `${t}.full`,
|
|
23948
|
+
label: `${t} · value+unit`,
|
|
23949
|
+
token: UE(t),
|
|
23950
|
+
kind: "full"
|
|
23951
|
+
}
|
|
23952
|
+
];
|
|
23893
23953
|
}
|
|
23894
|
-
function
|
|
23954
|
+
function GE(e, t, n) {
|
|
23895
23955
|
return e.replaceAll(t, n);
|
|
23896
23956
|
}
|
|
23897
|
-
function
|
|
23957
|
+
function KE(e, t, n = "b") {
|
|
23898
23958
|
let r = e.trim().toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "").replace(/^(\d)/, "a$1").slice(0, 24), i = r.length > 0 ? r : n;
|
|
23899
23959
|
if (!t.has(i)) return i;
|
|
23900
23960
|
for (let e = 2; e < 1e3; e += 1) {
|
|
@@ -23904,51 +23964,14 @@ function UE(e, t, n = "b") {
|
|
|
23904
23964
|
return `${n}${Date.now().toString(36)}`;
|
|
23905
23965
|
}
|
|
23906
23966
|
//#endregion
|
|
23907
|
-
//#region src/unit-display.ts
|
|
23908
|
-
function WE(e, t, n) {
|
|
23909
|
-
let r = t === void 0 ? void 0 : F(t), i = n === void 0 ? void 0 : F(n);
|
|
23910
|
-
if (r === void 0 || i === void 0 || r === i) return {
|
|
23911
|
-
value: e,
|
|
23912
|
-
unit: i ?? r ?? ""
|
|
23913
|
-
};
|
|
23914
|
-
let a = ye(e, r, i);
|
|
23915
|
-
return a === void 0 ? {
|
|
23916
|
-
value: e,
|
|
23917
|
-
unit: r
|
|
23918
|
-
} : {
|
|
23919
|
-
value: a,
|
|
23920
|
-
unit: i
|
|
23921
|
-
};
|
|
23922
|
-
}
|
|
23923
|
-
function GE(e, t) {
|
|
23924
|
-
if (typeof e != "object" || !e || Array.isArray(e)) return;
|
|
23925
|
-
let n = { ...e }, r = t.split(".");
|
|
23926
|
-
if (r.length >= 1) {
|
|
23927
|
-
let e = n;
|
|
23928
|
-
for (let t of r.slice(0, -1)) {
|
|
23929
|
-
if (typeof e != "object" || !e || Array.isArray(e)) {
|
|
23930
|
-
e = void 0;
|
|
23931
|
-
break;
|
|
23932
|
-
}
|
|
23933
|
-
e = { ...e }[t];
|
|
23934
|
-
}
|
|
23935
|
-
if (typeof e == "object" && e && !Array.isArray(e)) {
|
|
23936
|
-
let t = { ...e }.unit;
|
|
23937
|
-
if (typeof t == "string" && t.length > 0) return t;
|
|
23938
|
-
}
|
|
23939
|
-
}
|
|
23940
|
-
let i = n.unit;
|
|
23941
|
-
return typeof i == "string" && i.length > 0 ? i : void 0;
|
|
23942
|
-
}
|
|
23943
|
-
//#endregion
|
|
23944
23967
|
//#region src/named-template-render.ts
|
|
23945
|
-
function
|
|
23968
|
+
function qE(e, t, n) {
|
|
23946
23969
|
if (n === "value") return e;
|
|
23947
23970
|
if (n === "unit") return t;
|
|
23948
23971
|
let r = e.trim(), i = t.trim();
|
|
23949
23972
|
return r === "" ? i : i === "" ? r : `${r} ${i}`;
|
|
23950
23973
|
}
|
|
23951
|
-
function
|
|
23974
|
+
function JE(e, t) {
|
|
23952
23975
|
let n = e.pick.deviceId, r = t.stateByDevice.get(n);
|
|
23953
23976
|
if (r === void 0) return { reason: `no state mirrored for device ${n}` };
|
|
23954
23977
|
let i = r[e.capName];
|
|
@@ -23957,52 +23980,37 @@ function qE(e, t) {
|
|
|
23957
23980
|
if (a === void 0) return { reason: `"${e.capName}.${e.valuePath}" is absent on device ${n}` };
|
|
23958
23981
|
let o, s = "";
|
|
23959
23982
|
if (typeof a == "number") {
|
|
23960
|
-
let t =
|
|
23961
|
-
o =
|
|
23983
|
+
let t = xE(a, SE(i, e.valuePath), e.displayUnit);
|
|
23984
|
+
o = VE(t.value, e.maxDecimals), s = t.unit;
|
|
23962
23985
|
} else o = typeof a == "boolean" ? a ? "ON" : "OFF" : a === null ? "" : String(a);
|
|
23963
23986
|
return {
|
|
23964
23987
|
value: o,
|
|
23965
23988
|
unit: s,
|
|
23966
|
-
formatted:
|
|
23989
|
+
formatted: qE(o, s, "full")
|
|
23967
23990
|
};
|
|
23968
23991
|
}
|
|
23969
|
-
function
|
|
23992
|
+
function YE(e, t, n) {
|
|
23993
|
+
let r = e;
|
|
23994
|
+
return r = GE(r, UE(t), n.formatted), r = GE(r, HE(t, "value"), n.value), r = GE(r, HE(t, "unit"), n.unit), r = GE(r, HE(t, "full"), n.formatted), r;
|
|
23995
|
+
}
|
|
23996
|
+
function XE(e, t) {
|
|
23970
23997
|
let n = e.parser;
|
|
23971
23998
|
if (e.bindings.length === 0) return n.trim() === "" ? { reason: `template "${e.id}" has no bindings` } : { text: n };
|
|
23972
23999
|
for (let r of e.bindings) {
|
|
23973
|
-
let e =
|
|
24000
|
+
let e = JE(r, t);
|
|
23974
24001
|
if ("reason" in e) return e;
|
|
23975
|
-
n =
|
|
24002
|
+
n = YE(n, r.alias, e);
|
|
23976
24003
|
}
|
|
23977
24004
|
return { text: n };
|
|
23978
24005
|
}
|
|
23979
24006
|
//#endregion
|
|
23980
24007
|
//#region src/template-id.ts
|
|
23981
|
-
function
|
|
24008
|
+
function ZE() {
|
|
23982
24009
|
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `tpl-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
|
|
23983
24010
|
}
|
|
23984
24011
|
//#endregion
|
|
23985
24012
|
//#region src/components/TemplatesPanel.tsx
|
|
23986
24013
|
t();
|
|
23987
|
-
var XE = [
|
|
23988
|
-
{
|
|
23989
|
-
value: "value+unit",
|
|
23990
|
-
label: "Value + unit"
|
|
23991
|
-
},
|
|
23992
|
-
{
|
|
23993
|
-
value: "value",
|
|
23994
|
-
label: "Value"
|
|
23995
|
-
},
|
|
23996
|
-
{
|
|
23997
|
-
value: "unit",
|
|
23998
|
-
label: "Unit"
|
|
23999
|
-
}
|
|
24000
|
-
];
|
|
24001
|
-
function ZE(e) {
|
|
24002
|
-
if (e === void 0) return;
|
|
24003
|
-
let t = F(e);
|
|
24004
|
-
return t === void 0 ? void 0 : L(t);
|
|
24005
|
-
}
|
|
24006
24014
|
function QE(e) {
|
|
24007
24015
|
return e.pick.containerId ?? e.pick.deviceId;
|
|
24008
24016
|
}
|
|
@@ -24030,7 +24038,7 @@ function eD() {
|
|
|
24030
24038
|
size: "sm",
|
|
24031
24039
|
"data-testid": "osd-template-new",
|
|
24032
24040
|
onClick: () => o({
|
|
24033
|
-
id:
|
|
24041
|
+
id: ZE(),
|
|
24034
24042
|
name: "New template",
|
|
24035
24043
|
bindings: [],
|
|
24036
24044
|
parser: ""
|
|
@@ -24105,11 +24113,7 @@ function tD({ draft: e, pickerDevices: t, listState: n, busy: r, onChange: i, on
|
|
|
24105
24113
|
let c = t.find((e) => !gE(e.type))?.id ?? 0, u = yi({ deviceId: c }, { enabled: c > 0 }).data?.sources ?? [], d = l(() => new Set(u.map((e) => e.deviceId)), [u]), [f, p] = a([]), m = l(() => {
|
|
24106
24114
|
let t = e.bindings.map(QE);
|
|
24107
24115
|
return [...new Set([...t, ...f])];
|
|
24108
|
-
}, [e.bindings, f]), h = l(() => e.bindings.
|
|
24109
|
-
id: e.alias,
|
|
24110
|
-
label: `{${e.alias}}`,
|
|
24111
|
-
token: VE(e)
|
|
24112
|
-
})), [e.bindings]), g = rD(e.bindings), _ = l(() => JE(e, { stateByDevice: g }), [e, g]), v = e.name.trim().length > 0 && f.length === 0 && e.bindings.every((e) => e.capName !== "" && e.valuePath !== "" && e.alias !== "");
|
|
24116
|
+
}, [e.bindings, f]), h = l(() => e.bindings.flatMap((e) => WE(e)), [e.bindings]), g = rD(e.bindings), _ = l(() => XE(e, { stateByDevice: g }), [e, g]), v = e.name.trim().length > 0 && f.length === 0 && e.bindings.every((e) => e.capName !== "" && e.valuePath !== "" && e.alias !== "");
|
|
24113
24117
|
return /* @__PURE__ */ j(xo, {
|
|
24114
24118
|
className: "p-4 space-y-3",
|
|
24115
24119
|
"data-testid": "osd-template-editor",
|
|
@@ -24149,13 +24153,12 @@ function tD({ draft: e, pickerDevices: t, listState: n, busy: r, onChange: i, on
|
|
|
24149
24153
|
if (!d.has(e)) continue;
|
|
24150
24154
|
let i = dE(u, e), a = i.auto ?? fE(i.fields);
|
|
24151
24155
|
if (a === void 0) continue;
|
|
24152
|
-
let p =
|
|
24156
|
+
let p = KE(n.name || a.valuePath, l);
|
|
24153
24157
|
l.add(p), c.push({
|
|
24154
24158
|
alias: p,
|
|
24155
24159
|
pick: { deviceId: e },
|
|
24156
24160
|
capName: a.capName,
|
|
24157
24161
|
valuePath: a.valuePath,
|
|
24158
|
-
format: "value+unit",
|
|
24159
24162
|
maxDecimals: 1
|
|
24160
24163
|
});
|
|
24161
24164
|
}
|
|
@@ -24201,7 +24204,7 @@ function tD({ draft: e, pickerDevices: t, listState: n, busy: r, onChange: i, on
|
|
|
24201
24204
|
if (!Number.isFinite(a) || a <= 0) return;
|
|
24202
24205
|
let o = yE(t, a), s = dE(u, a), c = s.auto ?? fE(s.fields);
|
|
24203
24206
|
if (c === void 0) return;
|
|
24204
|
-
let l = $E(e.bindings), d =
|
|
24207
|
+
let l = $E(e.bindings), d = KE(o?.name ?? c.valuePath, l);
|
|
24205
24208
|
p(f.filter((e) => e !== n)), i({
|
|
24206
24209
|
...e,
|
|
24207
24210
|
bindings: [...e.bindings, {
|
|
@@ -24212,7 +24215,6 @@ function tD({ draft: e, pickerDevices: t, listState: n, busy: r, onChange: i, on
|
|
|
24212
24215
|
},
|
|
24213
24216
|
capName: c.capName,
|
|
24214
24217
|
valuePath: c.valuePath,
|
|
24215
|
-
format: "value+unit",
|
|
24216
24218
|
maxDecimals: 1
|
|
24217
24219
|
}]
|
|
24218
24220
|
});
|
|
@@ -24252,7 +24254,7 @@ function tD({ draft: e, pickerDevices: t, listState: n, busy: r, onChange: i, on
|
|
|
24252
24254
|
}),
|
|
24253
24255
|
chips: h,
|
|
24254
24256
|
multiline: !0,
|
|
24255
|
-
placeholder: "e.g. {t} / {h}",
|
|
24257
|
+
placeholder: "e.g. {t.value} {t.unit} / {h.full}",
|
|
24256
24258
|
testId: "osd-tpl-parser",
|
|
24257
24259
|
maxLength: 256
|
|
24258
24260
|
}),
|
|
@@ -24290,7 +24292,7 @@ function tD({ draft: e, pickerDevices: t, listState: n, busy: r, onChange: i, on
|
|
|
24290
24292
|
});
|
|
24291
24293
|
}
|
|
24292
24294
|
function nD({ binding: e, index: t, draft: n, pickerDevices: r, sources: i, stateByDevice: a, onChange: o }) {
|
|
24293
|
-
let s = dE(i, e.pick.deviceId), c = yE(r, e.pick.deviceId), l = e.pick.containerId === void 0 ? void 0 : yE(r, e.pick.containerId), u = l === void 0 ? c?.name ?? `#${e.pick.deviceId}` : `${l.name} › ${c?.name ?? `#${e.pick.deviceId}`}`, d =
|
|
24295
|
+
let s = dE(i, e.pick.deviceId), c = yE(r, e.pick.deviceId), l = e.pick.containerId === void 0 ? void 0 : yE(r, e.pick.containerId), u = l === void 0 ? c?.name ?? `#${e.pick.deviceId}` : `${l.name} › ${c?.name ?? `#${e.pick.deviceId}`}`, d = JE(e, { stateByDevice: a }), f = a.get(e.pick.deviceId)?.[e.capName], p = SE(f, e.valuePath), m = bE(p), h = (e) => {
|
|
24294
24296
|
o({
|
|
24295
24297
|
...n,
|
|
24296
24298
|
bindings: n.bindings.map((n, r) => r === t ? e : n)
|
|
@@ -24305,9 +24307,16 @@ function nD({ binding: e, index: t, draft: n, pickerDevices: r, sources: i, stat
|
|
|
24305
24307
|
children: [/* @__PURE__ */ A("p", {
|
|
24306
24308
|
className: "text-[11px] text-foreground-muted truncate",
|
|
24307
24309
|
children: u
|
|
24308
|
-
}), /* @__PURE__ */
|
|
24310
|
+
}), /* @__PURE__ */ j("p", {
|
|
24309
24311
|
className: "text-[10px] font-mono text-foreground-muted shrink-0",
|
|
24310
|
-
children:
|
|
24312
|
+
children: [
|
|
24313
|
+
HE(e.alias),
|
|
24314
|
+
" · ",
|
|
24315
|
+
HE(e.alias, "value"),
|
|
24316
|
+
" ·",
|
|
24317
|
+
" ",
|
|
24318
|
+
HE(e.alias, "unit")
|
|
24319
|
+
]
|
|
24311
24320
|
})]
|
|
24312
24321
|
}),
|
|
24313
24322
|
/* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A(K, { children: "Alias" }), /* @__PURE__ */ A(os, {
|
|
@@ -24316,7 +24325,7 @@ function nD({ binding: e, index: t, draft: n, pickerDevices: r, sources: i, stat
|
|
|
24316
24325
|
maxLength: 32,
|
|
24317
24326
|
onChange: (r) => {
|
|
24318
24327
|
let i = r.target.value, a = $E(n.bindings, t);
|
|
24319
|
-
i !== "" && a.has(i) ||
|
|
24328
|
+
i !== "" && a.has(i) || h({
|
|
24320
24329
|
...e,
|
|
24321
24330
|
alias: i
|
|
24322
24331
|
});
|
|
@@ -24332,7 +24341,7 @@ function nD({ binding: e, index: t, draft: n, pickerDevices: r, sources: i, stat
|
|
|
24332
24341
|
})),
|
|
24333
24342
|
onChange: (t) => {
|
|
24334
24343
|
let n = s.fields.find((e) => `${e.capName}:${e.valuePath}` === t.target.value);
|
|
24335
|
-
n &&
|
|
24344
|
+
n && h({
|
|
24336
24345
|
...e,
|
|
24337
24346
|
capName: n.capName,
|
|
24338
24347
|
valuePath: n.valuePath
|
|
@@ -24340,36 +24349,15 @@ function nD({ binding: e, index: t, draft: n, pickerDevices: r, sources: i, stat
|
|
|
24340
24349
|
}
|
|
24341
24350
|
})]
|
|
24342
24351
|
}),
|
|
24343
|
-
/* @__PURE__ */ j("div", {
|
|
24344
|
-
className: "col-span-3",
|
|
24345
|
-
children: [/* @__PURE__ */ A(K, { children: "Format" }), /* @__PURE__ */ A("div", {
|
|
24346
|
-
className: "flex gap-1 mt-1",
|
|
24347
|
-
role: "radiogroup",
|
|
24348
|
-
"aria-label": `Format for ${e.alias}`,
|
|
24349
|
-
"data-testid": `osd-tpl-format-${t}`,
|
|
24350
|
-
children: XE.map((t) => /* @__PURE__ */ A(G, {
|
|
24351
|
-
type: "button",
|
|
24352
|
-
size: "sm",
|
|
24353
|
-
variant: e.format === t.value ? "primary" : "outline",
|
|
24354
|
-
"aria-checked": e.format === t.value,
|
|
24355
|
-
role: "radio",
|
|
24356
|
-
onClick: () => f({
|
|
24357
|
-
...e,
|
|
24358
|
-
format: t.value
|
|
24359
|
-
}),
|
|
24360
|
-
children: t.label
|
|
24361
|
-
}, t.value))
|
|
24362
|
-
})]
|
|
24363
|
-
}),
|
|
24364
24352
|
/* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A(K, { children: "Unit" }), /* @__PURE__ */ A(ET, {
|
|
24365
|
-
dimension:
|
|
24353
|
+
dimension: m,
|
|
24366
24354
|
value: e.displayUnit ?? "",
|
|
24367
|
-
onChange: (t) =>
|
|
24355
|
+
onChange: (t) => h({
|
|
24368
24356
|
...e,
|
|
24369
24357
|
displayUnit: t === "" ? void 0 : t
|
|
24370
24358
|
}),
|
|
24371
24359
|
inheritLabel: "Source",
|
|
24372
|
-
emptyReason: "
|
|
24360
|
+
emptyReason: p === void 0 ? "Source unit unknown (waiting for sensor state)" : "Source unit has no same-dimension conversions",
|
|
24373
24361
|
"aria-label": `Unit for ${e.alias}`
|
|
24374
24362
|
})] }),
|
|
24375
24363
|
/* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A(K, { children: "Decimals" }), /* @__PURE__ */ A(os, {
|
|
@@ -24377,7 +24365,7 @@ function nD({ binding: e, index: t, draft: n, pickerDevices: r, sources: i, stat
|
|
|
24377
24365
|
min: 0,
|
|
24378
24366
|
max: 4,
|
|
24379
24367
|
value: e.maxDecimals,
|
|
24380
|
-
onChange: (t) =>
|
|
24368
|
+
onChange: (t) => h({
|
|
24381
24369
|
...e,
|
|
24382
24370
|
maxDecimals: Number(t.target.value)
|
|
24383
24371
|
})
|
|
@@ -24480,7 +24468,7 @@ function iD(e) {
|
|
|
24480
24468
|
!h && t === "cameras" && s.length > 0 ? /* @__PURE__ */ A(xo, {
|
|
24481
24469
|
className: "p-4",
|
|
24482
24470
|
"data-testid": "osd-cameras",
|
|
24483
|
-
children: /* @__PURE__ */ A(
|
|
24471
|
+
children: /* @__PURE__ */ A(BE, {
|
|
24484
24472
|
cameras: s,
|
|
24485
24473
|
osdCapableIds: f,
|
|
24486
24474
|
allDevices: c,
|