@camstack/addon-agent-ui 1.2.259 → 1.2.261
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/addon.js +214 -87
- package/dist/assets/{MotionZonesSettings-B6BtRoYS.js → MotionZonesSettings-C_YOWO3E.js} +1 -1
- package/dist/assets/{PrivacyMaskSettings-BsysxJzQ.js → PrivacyMaskSettings-Dlpk_fTf.js} +1 -1
- package/dist/assets/{SceneMonitorEditor-BRMobVMG.js → SceneMonitorEditor-C_S5uhEQ.js} +1 -1
- package/dist/assets/index-DVzo-8Se.css +2 -0
- package/dist/assets/index-DrK0zMfa.js +112 -0
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/dist/assets/index-CRF94rJy.css +0 -2
- package/dist/assets/index-D-rt-7-s.js +0 -112
package/dist/addon.js
CHANGED
|
@@ -5432,7 +5432,7 @@ var ZodIssueCode = {
|
|
|
5432
5432
|
var ZodFirstPartyTypeKind;
|
|
5433
5433
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5434
5434
|
//#endregion
|
|
5435
|
-
//#region ../types/dist/sleep-
|
|
5435
|
+
//#region ../types/dist/sleep-CUp20JkO.mjs
|
|
5436
5436
|
/**
|
|
5437
5437
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5438
5438
|
* window to float samples (D455).
|
|
@@ -8257,7 +8257,11 @@ var ContributionSectionSchema = object({
|
|
|
8257
8257
|
literal(4)
|
|
8258
8258
|
]).optional(),
|
|
8259
8259
|
tab: string().optional(),
|
|
8260
|
-
location: _enum([
|
|
8260
|
+
location: _enum([
|
|
8261
|
+
"settings",
|
|
8262
|
+
"top-tab",
|
|
8263
|
+
"hero"
|
|
8264
|
+
]).optional(),
|
|
8261
8265
|
order: number().optional(),
|
|
8262
8266
|
fields: array(any())
|
|
8263
8267
|
});
|
|
@@ -13194,7 +13198,11 @@ var ConfigSectionWithValuesSchema = object({
|
|
|
13194
13198
|
literal(4)
|
|
13195
13199
|
]).optional(),
|
|
13196
13200
|
tab: string().optional(),
|
|
13197
|
-
location: _enum([
|
|
13201
|
+
location: _enum([
|
|
13202
|
+
"settings",
|
|
13203
|
+
"top-tab",
|
|
13204
|
+
"hero"
|
|
13205
|
+
]).optional(),
|
|
13198
13206
|
order: number().optional(),
|
|
13199
13207
|
fields: array(any())
|
|
13200
13208
|
});
|
|
@@ -16968,6 +16976,52 @@ var TierStatusSchema = object({
|
|
|
16968
16976
|
countedAt: number().nullable()
|
|
16969
16977
|
});
|
|
16970
16978
|
/** Operator/diagnostic view: rows per tier, last runs, refusals and drops since boot. */
|
|
16979
|
+
/**
|
|
16980
|
+
* Why a series is orphan. `device-gone`: its device is absent from the
|
|
16981
|
+
* successful device listings (the departure clock). `undeclared`: its `cap:`
|
|
16982
|
+
* key is declared by no capability any more (a field a cap removed).
|
|
16983
|
+
*/
|
|
16984
|
+
var DeviceHistoryOrphanReasonSchema = _enum(["device-gone", "undeclared"]);
|
|
16985
|
+
/** Rows held per stored tier. */
|
|
16986
|
+
var TierRowsSchema = object({
|
|
16987
|
+
raw: number().int(),
|
|
16988
|
+
"5m": number().int(),
|
|
16989
|
+
"1h": number().int(),
|
|
16990
|
+
"1d": number().int()
|
|
16991
|
+
});
|
|
16992
|
+
var OrphanSeriesSchema = object({
|
|
16993
|
+
seriesId: number().int(),
|
|
16994
|
+
deviceId: number().int(),
|
|
16995
|
+
key: string(),
|
|
16996
|
+
scope: string(),
|
|
16997
|
+
/** The metric's display name; `null` when its metric row is gone too. */
|
|
16998
|
+
displayName: string().nullable(),
|
|
16999
|
+
reason: DeviceHistoryOrphanReasonSchema,
|
|
17000
|
+
/** `device-gone`: since when the device has been absent; `null` otherwise. */
|
|
17001
|
+
missingSince: number().nullable(),
|
|
17002
|
+
firstTs: number(),
|
|
17003
|
+
lastTs: number(),
|
|
17004
|
+
rows: TierRowsSchema
|
|
17005
|
+
});
|
|
17006
|
+
var DeviceHistoryOrphanDeleteRefusalSchema = _enum([
|
|
17007
|
+
"not-found",
|
|
17008
|
+
"not-orphan",
|
|
17009
|
+
"failed"
|
|
17010
|
+
]);
|
|
17011
|
+
var OrphanDeleteEntrySchema = discriminatedUnion("ok", [object({
|
|
17012
|
+
seriesId: number().int(),
|
|
17013
|
+
ok: literal(true),
|
|
17014
|
+
deleted: TierRowsSchema
|
|
17015
|
+
}), object({
|
|
17016
|
+
seriesId: number().int(),
|
|
17017
|
+
ok: literal(false),
|
|
17018
|
+
reason: DeviceHistoryOrphanDeleteRefusalSchema
|
|
17019
|
+
})]);
|
|
17020
|
+
var OrphanListSchema = object({
|
|
17021
|
+
series: array(OrphanSeriesSchema).readonly(),
|
|
17022
|
+
/** More orphans exist than {@link DEVICE_HISTORY_ORPHAN_LIST_MAX}. */
|
|
17023
|
+
truncated: boolean()
|
|
17024
|
+
});
|
|
16971
17025
|
var DeviceHistoryStatusSchema = object({
|
|
16972
17026
|
startedAt: number(),
|
|
16973
17027
|
/** The store is declared, series loaded and the first reconcile has answered. */
|
|
@@ -17065,7 +17119,10 @@ method(object({ deviceId: number().int() }), array(SeriesInfoSchema).readonly())
|
|
|
17065
17119
|
}), object({ enabled: boolean() }), {
|
|
17066
17120
|
kind: "mutation",
|
|
17067
17121
|
auth: "admin"
|
|
17068
|
-
}), method(object({}), DeviceHistoryStatusSchema, { auth: "admin" })
|
|
17122
|
+
}), method(object({}), DeviceHistoryStatusSchema, { auth: "admin" }), method(object({}), OrphanListSchema, { auth: "admin" }), method(object({ seriesIds: array(number().int()).min(1).max(50) }), object({ results: array(OrphanDeleteEntrySchema).readonly() }), {
|
|
17123
|
+
kind: "mutation",
|
|
17124
|
+
auth: "admin"
|
|
17125
|
+
});
|
|
17069
17126
|
var DeviceCaStatusSchema = discriminatedUnion("state", [
|
|
17070
17127
|
object({ state: literal("absent") }),
|
|
17071
17128
|
object({
|
|
@@ -49739,6 +49796,19 @@ var NodeInferenceDeviceSchema = object({
|
|
|
49739
49796
|
/** Whether the node's live probe reports the device as usable right now. */
|
|
49740
49797
|
available: boolean(),
|
|
49741
49798
|
/**
|
|
49799
|
+
* Is the device on the node at all (D919)? `present` — the live probe
|
|
49800
|
+
* reported it; `absent` — the probe ANSWERED and did not report it, so only
|
|
49801
|
+
* its stored settings remain (unplugged, moved to another node): never
|
|
49802
|
+
* eligible, whatever its stored `enabled`, and forgettable with
|
|
49803
|
+
* `forgetInferenceDevice`; `unknown` — the probe did not answer, nothing is
|
|
49804
|
+
* claimed (D315). Optional only for an orchestrator older than the field.
|
|
49805
|
+
*/
|
|
49806
|
+
presence: _enum([
|
|
49807
|
+
"present",
|
|
49808
|
+
"absent",
|
|
49809
|
+
"unknown"
|
|
49810
|
+
]).optional(),
|
|
49811
|
+
/**
|
|
49742
49812
|
* Whether this device participates in dispatch. AUTO default (spec C2):
|
|
49743
49813
|
* accelerators are opt-OUT (a discovered NPU/iGPU/Coral/ANE with no stored
|
|
49744
49814
|
* entry is `true`); CPU is opt-IN (`false` by default — the fallback pool,
|
|
@@ -49964,7 +50034,13 @@ method(object({
|
|
|
49964
50034
|
}), object({ success: literal(true) }), {
|
|
49965
50035
|
kind: "mutation",
|
|
49966
50036
|
auth: "admin"
|
|
49967
|
-
}), method(object({ nodeId: string() }), NodeInferenceDevicesSchema), method(object({
|
|
50037
|
+
}), method(object({ nodeId: string() }), NodeInferenceDevicesSchema), method(object({
|
|
50038
|
+
agentNodeId: string(),
|
|
50039
|
+
deviceKey: string()
|
|
50040
|
+
}), object({ success: literal(true) }), {
|
|
50041
|
+
kind: "mutation",
|
|
50042
|
+
auth: "admin"
|
|
50043
|
+
}), method(object({ agentNodeId: string() }), object({
|
|
49968
50044
|
success: literal(true),
|
|
49969
50045
|
/** Hardware-aware default detection model now in effect on the node (null when unresolvable). */
|
|
49970
50046
|
effectiveModelId: string().nullable(),
|
|
@@ -54074,17 +54150,69 @@ object({
|
|
|
54074
54150
|
});
|
|
54075
54151
|
DeviceType.Sensor;
|
|
54076
54152
|
/**
|
|
54077
|
-
* Generic device-consumables capability —
|
|
54078
|
-
*
|
|
54079
|
-
* descaling cycles,
|
|
54080
|
-
*
|
|
54081
|
-
*
|
|
54082
|
-
*
|
|
54153
|
+
* Generic device-consumables capability — the ONE place a device reports what
|
|
54154
|
+
* it uses up or fills: wear parts (vacuum filters/brushes, cartridges,
|
|
54155
|
+
* descaling cycles), supplies it draws from (a vacuum's clean-water tank and
|
|
54156
|
+
* detergent, a dishwasher's salt and rinse aid) and waste it collects (a dirty
|
|
54157
|
+
* water tank, a dust bin). Each item carries its remaining life or fill and an
|
|
54158
|
+
* optional "Replaced" reset action. Device-agnostic: any provider that knows
|
|
54159
|
+
* its device tracks consumables registers it; the provider names each item
|
|
54160
|
+
* verbatim and says which `kind` it is.
|
|
54161
|
+
*
|
|
54162
|
+
* The admin UI renders it as ONE collapsible section directly under the
|
|
54163
|
+
* device page's hero card (`placement: 'hero'`), for every device bound to
|
|
54164
|
+
* this cap — never drawn by a device type's hero card itself (D915).
|
|
54083
54165
|
*
|
|
54084
54166
|
* Like `childLayout`, the cap is INERT until a provider sets items: no
|
|
54085
54167
|
* provider populates it by guessing (no HA inference). The UI renders a
|
|
54086
54168
|
* "No consumables reported" placeholder when `items` is empty.
|
|
54087
54169
|
*/
|
|
54170
|
+
/**
|
|
54171
|
+
* What an item IS, which decides which direction is bad:
|
|
54172
|
+
* - `wear` — a part that wears out (a brush, a filter); low life is bad.
|
|
54173
|
+
* - `supply` — something the device draws from (clean water, detergent,
|
|
54174
|
+
* salt, rinse aid); low or empty is bad.
|
|
54175
|
+
* - `waste` — something the device fills (dirty water, a dust bin); full is
|
|
54176
|
+
* bad.
|
|
54177
|
+
* Absent = `wear`.
|
|
54178
|
+
*/
|
|
54179
|
+
var ConsumableKindSchema = _enum([
|
|
54180
|
+
"wear",
|
|
54181
|
+
"supply",
|
|
54182
|
+
"waste"
|
|
54183
|
+
]);
|
|
54184
|
+
/**
|
|
54185
|
+
* What an item LOOKS like, which decides how a client draws it — independent
|
|
54186
|
+
* of `kind`, which decides which direction is bad:
|
|
54187
|
+
* - `part` — a part that wears (a brush, a filter, a mop pad): a wear bar,
|
|
54188
|
+
* remaining time and a reset.
|
|
54189
|
+
* - `tank` — a container of liquid (clean water, dirty water): a fill gauge.
|
|
54190
|
+
* - `product` — something bought and refilled (detergent, salt, rinse aid):
|
|
54191
|
+
* a stepped level and "refill".
|
|
54192
|
+
* - `bin` — a container that collects waste (a dust bin): a fill gauge
|
|
54193
|
+
* that warns when full.
|
|
54194
|
+
* Absent = derived from the kind ({@link consumableFormOf}).
|
|
54195
|
+
*/
|
|
54196
|
+
var ConsumableFormSchema = _enum([
|
|
54197
|
+
"part",
|
|
54198
|
+
"tank",
|
|
54199
|
+
"product",
|
|
54200
|
+
"bin"
|
|
54201
|
+
]);
|
|
54202
|
+
/** The provider's own discrete verdict on an item. */
|
|
54203
|
+
var ConsumableStatusSchema = _enum([
|
|
54204
|
+
"ok",
|
|
54205
|
+
"low",
|
|
54206
|
+
"empty",
|
|
54207
|
+
"full",
|
|
54208
|
+
"replace"
|
|
54209
|
+
]);
|
|
54210
|
+
_enum([
|
|
54211
|
+
"ok",
|
|
54212
|
+
"low",
|
|
54213
|
+
"empty",
|
|
54214
|
+
"full"
|
|
54215
|
+
]);
|
|
54088
54216
|
/** Units a remaining-life counter is reported in. Closed: the panel renders
|
|
54089
54217
|
* each. */
|
|
54090
54218
|
var ConsumableRemainingUnitSchema = _enum([
|
|
@@ -54104,10 +54232,14 @@ var ConsumablesStatusSchema = object({
|
|
|
54104
54232
|
key: string().min(1),
|
|
54105
54233
|
/** Display name. */
|
|
54106
54234
|
label: string().min(1),
|
|
54107
|
-
/** Remaining life % when known (0..100). */
|
|
54235
|
+
/** Remaining life % (`wear`) or fill % (`supply`, `waste`) when known (0..100). */
|
|
54108
54236
|
level: number().min(0).max(100).nullable(),
|
|
54109
|
-
/**
|
|
54110
|
-
status:
|
|
54237
|
+
/** The provider's discrete verdict when known (binary mode). */
|
|
54238
|
+
status: ConsumableStatusSchema.nullable(),
|
|
54239
|
+
/** What the item is — decides whether low or full is bad. Absent = `wear`. */
|
|
54240
|
+
kind: ConsumableKindSchema.optional(),
|
|
54241
|
+
/** How the item is drawn (part, tank, product, bin). Absent = derived from `kind`. */
|
|
54242
|
+
form: ConsumableFormSchema.optional(),
|
|
54111
54243
|
/** Ms epoch of the last replace, when known. */
|
|
54112
54244
|
lastResetAt: number().nullable(),
|
|
54113
54245
|
/** Whether `reset()` is meaningful for this item. */
|
|
@@ -54342,8 +54474,9 @@ object({
|
|
|
54342
54474
|
status: DeviceStatusSchema
|
|
54343
54475
|
});
|
|
54344
54476
|
/**
|
|
54345
|
-
* Smart-dishwasher cap — program lifecycle, door / remote-start gates
|
|
54346
|
-
*
|
|
54477
|
+
* Smart-dishwasher cap — program lifecycle, door / remote-start gates and
|
|
54478
|
+
* common program options. Salt and rinse aid are NOT here: they are items of
|
|
54479
|
+
* the device's `consumables` cap, like every other device's (D915).
|
|
54347
54480
|
*
|
|
54348
54481
|
* Sources: native Bosch Home Connect (`dishwasher` device type). Reusable
|
|
54349
54482
|
* by any integration that exposes the same program / option surface.
|
|
@@ -54391,11 +54524,6 @@ var DishwasherAvailabilitySchema = _enum([
|
|
|
54391
54524
|
"offline",
|
|
54392
54525
|
"description-missing"
|
|
54393
54526
|
]);
|
|
54394
|
-
var DishwasherConsumableLevelSchema = _enum([
|
|
54395
|
-
"ok",
|
|
54396
|
-
"low",
|
|
54397
|
-
"empty"
|
|
54398
|
-
]);
|
|
54399
54527
|
object({
|
|
54400
54528
|
availability: DishwasherAvailabilitySchema,
|
|
54401
54529
|
/** Coarse state for compact surfaces; `unavailable` whenever the appliance state is not known. */
|
|
@@ -54428,8 +54556,6 @@ object({
|
|
|
54428
54556
|
powerOn: boolean().nullable(),
|
|
54429
54557
|
/** The raw power state (`On`, `Off`, `Standby`, …); null when not known. */
|
|
54430
54558
|
powerState: string().nullable(),
|
|
54431
|
-
saltLevel: DishwasherConsumableLevelSchema.nullable(),
|
|
54432
|
-
rinseAidLevel: DishwasherConsumableLevelSchema.nullable(),
|
|
54433
54559
|
/**
|
|
54434
54560
|
* True while the appliance asks for its filter to be cleaned (smart-filter, filter-system or
|
|
54435
54561
|
* combined care-and-filter reminder raised); false when every such reminder reads clear; null
|
|
@@ -56469,7 +56595,7 @@ DeviceType.Light, DeviceType.Siren, DeviceType.Switch, method(object({
|
|
|
56469
56595
|
enabled: boolean()
|
|
56470
56596
|
}), _void(), {
|
|
56471
56597
|
kind: "mutation",
|
|
56472
|
-
auth: "
|
|
56598
|
+
auth: "protected"
|
|
56473
56599
|
}), object({
|
|
56474
56600
|
deviceId: number(),
|
|
56475
56601
|
enabled: boolean(),
|
|
@@ -56959,6 +57085,13 @@ var TopologyNodeSchema = object({
|
|
|
56959
57085
|
cpuModel: string().nullable(),
|
|
56960
57086
|
cpuCores: number(),
|
|
56961
57087
|
memoryMB: number(),
|
|
57088
|
+
/**
|
|
57089
|
+
* The inference RUNTIMES installed on the node (`pythonRuntimes`: onnx,
|
|
57090
|
+
* openvino, edgetpu …) — not its devices. An installed runtime says nothing
|
|
57091
|
+
* about whether its hardware is there (a Coral delegate stays installed
|
|
57092
|
+
* after the stick leaves, D919); the live device set is
|
|
57093
|
+
* `pipelineOrchestrator.getNodeInferenceDevices`.
|
|
57094
|
+
*/
|
|
56962
57095
|
engines: array(string()).readonly(),
|
|
56963
57096
|
isHub: boolean(),
|
|
56964
57097
|
isOnline: boolean(),
|
|
@@ -57923,7 +58056,28 @@ var ResolvedInferenceConfigSchema = object({
|
|
|
57923
58056
|
format: ModelFormatSchema,
|
|
57924
58057
|
reason: string()
|
|
57925
58058
|
});
|
|
57926
|
-
|
|
58059
|
+
/**
|
|
58060
|
+
* The answer of an accelerator rescan (D919): the node's device list after
|
|
58061
|
+
* the re-probe, what changed, and the evidence that decided the Coral answer
|
|
58062
|
+
* (`usbBus` — could the USB bus be read at all; `decidedBy` — USB ids, the PCI
|
|
58063
|
+
* bus, the installed-delegate fallback, or nothing).
|
|
58064
|
+
*/
|
|
58065
|
+
var AcceleratorRescanSchema = object({
|
|
58066
|
+
devices: array(InferenceDeviceDescriptorSchema).readonly(),
|
|
58067
|
+
appeared: array(string()).readonly(),
|
|
58068
|
+
disappeared: array(string()).readonly(),
|
|
58069
|
+
usbBus: _enum(["observed", "unobservable"]),
|
|
58070
|
+
decidedBy: _enum([
|
|
58071
|
+
"usb-ids",
|
|
58072
|
+
"pci",
|
|
58073
|
+
"delegate-fallback",
|
|
58074
|
+
"none"
|
|
58075
|
+
])
|
|
58076
|
+
});
|
|
58077
|
+
method(_void(), PlatformCapabilitiesSchema), method(_void(), HardwareInfoSchema), method(object({ requirements: array(ModelRequirementSchema).readonly() }), ResolvedInferenceConfigSchema), method(object({ prefer: HwAccelBackendInputSchema }), HwAccelResolutionSchema), method(_void(), AcceleratorRescanSchema, {
|
|
58078
|
+
kind: "mutation",
|
|
58079
|
+
auth: "admin"
|
|
58080
|
+
});
|
|
57927
58081
|
object({
|
|
57928
58082
|
/** Instantaneous power draw in watts. */
|
|
57929
58083
|
watts: number().optional(),
|
|
@@ -61212,60 +61366,17 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
|
|
|
61212
61366
|
auth: "admin",
|
|
61213
61367
|
access: "delete"
|
|
61214
61368
|
});
|
|
61215
|
-
/**
|
|
61216
|
-
* Robot-vacuum cap. Models HA `vacuum.*` entities — anything with a
|
|
61217
|
-
* cleaning lifecycle plus a return-to-base / locate surface and an
|
|
61218
|
-
* optional fan-speed selector.
|
|
61219
|
-
*
|
|
61220
|
-
* State follows HA's canonical vacuum lifecycle: `idle` / `cleaning` /
|
|
61221
|
-
* `paused` / `returning` / `docked` / `error`. `batteryLevel`
|
|
61222
|
-
* (0..100) is nullable — some vacuums don't report a battery
|
|
61223
|
-
* percentage. `fanSpeed` is the current speed token (provider-verbatim,
|
|
61224
|
-
* e.g. `'standard'` / `'turbo'`) and `availableFanSpeeds` lists the
|
|
61225
|
-
* tokens the hardware accepts so the UI renders only supported choices.
|
|
61226
|
-
*
|
|
61227
|
-
* The `setFanSpeed` method takes the bare `speed` token — the provider
|
|
61228
|
-
* validates it against the vacuum's own list. `locate` triggers the
|
|
61229
|
-
* find-me chirp; `returnToBase` sends it home.
|
|
61230
|
-
*
|
|
61231
|
-
* Consumable / waste tanks: `cleanWater` / `dirtyWater` / `detergent` /
|
|
61232
|
-
* `dustBin` each carry a nullable `{ level (0..100 %), status ('ok' |
|
|
61233
|
-
* 'low' | 'full') }` reading. Native providers (e.g. Dreame, Roborock)
|
|
61234
|
-
* SHOULD populate whichever tanks the hardware has — leave a field `null`
|
|
61235
|
-
* only when the device has no such tank at all, and use a `TankStatus`
|
|
61236
|
-
* with both inner fields `null` when the tank exists but its level is
|
|
61237
|
-
* currently unknown. HA `vacuum.*` entities expose no per-tank telemetry,
|
|
61238
|
-
* so the HA provider leaves all four `null`.
|
|
61239
|
-
*/
|
|
61240
|
-
var VacuumStateSchema = _enum([
|
|
61241
|
-
"idle",
|
|
61242
|
-
"cleaning",
|
|
61243
|
-
"paused",
|
|
61244
|
-
"returning",
|
|
61245
|
-
"docked",
|
|
61246
|
-
"drying",
|
|
61247
|
-
"error"
|
|
61248
|
-
]);
|
|
61249
|
-
/**
|
|
61250
|
-
* One consumable / waste tank on a robot vacuum (clean-water, dirty-water,
|
|
61251
|
-
* detergent or dust-bin). A tank can report a numeric fill `level` (0..100),
|
|
61252
|
-
* a discrete `status` (binary-style hardware), or both. Both `null` means the
|
|
61253
|
-
* level is currently unknown; the OWNING field being `null` means the
|
|
61254
|
-
* hardware has no such tank at all.
|
|
61255
|
-
*/
|
|
61256
|
-
var TankStatusSchema = object({
|
|
61257
|
-
/** Numeric fill 0..100 when the hardware reports a percentage; null otherwise. */
|
|
61258
|
-
level: number().min(0).max(100).nullable(),
|
|
61259
|
-
/** Discrete state when the hardware is binary-mode; null otherwise. */
|
|
61260
|
-
status: _enum([
|
|
61261
|
-
"ok",
|
|
61262
|
-
"low",
|
|
61263
|
-
"full"
|
|
61264
|
-
]).nullable()
|
|
61265
|
-
});
|
|
61266
61369
|
object({
|
|
61267
61370
|
/** Lifecycle state of the vacuum. */
|
|
61268
|
-
state:
|
|
61371
|
+
state: _enum([
|
|
61372
|
+
"idle",
|
|
61373
|
+
"cleaning",
|
|
61374
|
+
"paused",
|
|
61375
|
+
"returning",
|
|
61376
|
+
"docked",
|
|
61377
|
+
"drying",
|
|
61378
|
+
"error"
|
|
61379
|
+
]),
|
|
61269
61380
|
/** 0..100 battery percentage. Null when the device has no battery
|
|
61270
61381
|
* reading. */
|
|
61271
61382
|
batteryLevel: number().min(0).max(100).nullable(),
|
|
@@ -61274,14 +61385,6 @@ object({
|
|
|
61274
61385
|
fanSpeed: string().nullable(),
|
|
61275
61386
|
/** Speed tokens the hardware accepts — drives the UI selector. */
|
|
61276
61387
|
availableFanSpeeds: array(string()),
|
|
61277
|
-
/** Clean-water (mop) tank. Null when the hardware has no clean-water tank. */
|
|
61278
|
-
cleanWater: TankStatusSchema.nullable(),
|
|
61279
|
-
/** Dirty-water (recovery) tank. Null when the hardware has no dirty-water tank. */
|
|
61280
|
-
dirtyWater: TankStatusSchema.nullable(),
|
|
61281
|
-
/** Detergent tank. Null when the hardware has no detergent tank. */
|
|
61282
|
-
detergent: TankStatusSchema.nullable(),
|
|
61283
|
-
/** Dust bin. Null when the hardware has no dust bin. */
|
|
61284
|
-
dustBin: TankStatusSchema.nullable(),
|
|
61285
61388
|
/** 0..100 cleaning-completion percentage of the current task, or null. */
|
|
61286
61389
|
progressPercent: number().min(0).max(100).nullable(),
|
|
61287
61390
|
/** Current error code (0 / null = no error). */
|
|
@@ -63822,6 +63925,12 @@ Object.freeze({
|
|
|
63822
63925
|
addonId: null,
|
|
63823
63926
|
access: "create"
|
|
63824
63927
|
},
|
|
63928
|
+
"deviceHistory.deleteOrphanSeries": {
|
|
63929
|
+
capName: "device-history",
|
|
63930
|
+
capScope: "system",
|
|
63931
|
+
addonId: null,
|
|
63932
|
+
access: "delete"
|
|
63933
|
+
},
|
|
63825
63934
|
"deviceHistory.getDeviceEnabled": {
|
|
63826
63935
|
capName: "device-history",
|
|
63827
63936
|
capScope: "system",
|
|
@@ -63840,6 +63949,12 @@ Object.freeze({
|
|
|
63840
63949
|
addonId: null,
|
|
63841
63950
|
access: "view"
|
|
63842
63951
|
},
|
|
63952
|
+
"deviceHistory.listOrphanSeries": {
|
|
63953
|
+
capName: "device-history",
|
|
63954
|
+
capScope: "system",
|
|
63955
|
+
addonId: null,
|
|
63956
|
+
access: "view"
|
|
63957
|
+
},
|
|
63843
63958
|
"deviceHistory.listSeries": {
|
|
63844
63959
|
capName: "device-history",
|
|
63845
63960
|
capScope: "system",
|
|
@@ -67464,6 +67579,12 @@ Object.freeze({
|
|
|
67464
67579
|
addonId: null,
|
|
67465
67580
|
access: "delete"
|
|
67466
67581
|
},
|
|
67582
|
+
"pipelineOrchestrator.forgetInferenceDevice": {
|
|
67583
|
+
capName: "pipeline-orchestrator",
|
|
67584
|
+
capScope: "system",
|
|
67585
|
+
addonId: null,
|
|
67586
|
+
access: "delete"
|
|
67587
|
+
},
|
|
67467
67588
|
"pipelineOrchestrator.getAgentLoad": {
|
|
67468
67589
|
capName: "pipeline-orchestrator",
|
|
67469
67590
|
capScope: "system",
|
|
@@ -68040,6 +68161,12 @@ Object.freeze({
|
|
|
68040
68161
|
addonId: null,
|
|
68041
68162
|
access: "view"
|
|
68042
68163
|
},
|
|
68164
|
+
"platformProbe.rescanAccelerators": {
|
|
68165
|
+
capName: "platform-probe",
|
|
68166
|
+
capScope: "system",
|
|
68167
|
+
addonId: null,
|
|
68168
|
+
access: "create"
|
|
68169
|
+
},
|
|
68043
68170
|
"platformProbe.resolveHwAccel": {
|
|
68044
68171
|
capName: "platform-probe",
|
|
68045
68172
|
capScope: "system",
|
|
@@ -73845,7 +73972,7 @@ var STATE_SUMMARY_VARS = [
|
|
|
73845
73972
|
([...RULE_TEXT], [...COMBINED_ALARM]),
|
|
73846
73973
|
([...RULE_TEXT], [...DEVICE_EVENTS]),
|
|
73847
73974
|
([...RULE_TEXT], [...BATTERY, ...CONSUMABLE]),
|
|
73848
|
-
([...RULE_TEXT], [...CONSUMABLE]),
|
|
73975
|
+
([...RULE_TEXT], [...CONSUMABLE, ...TANK]),
|
|
73849
73976
|
([...RULE_TEXT], [...TANK]),
|
|
73850
73977
|
[...RULE_TEXT],
|
|
73851
73978
|
([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
|
|
@@ -74563,7 +74690,7 @@ var AgentUIAddon = class extends BaseAddon {
|
|
|
74563
74690
|
capability: adminUiCapability,
|
|
74564
74691
|
provider: {
|
|
74565
74692
|
getStaticDir: async () => ({ staticDir: path.resolve(__dirname) }),
|
|
74566
|
-
getVersion: async () => ({ version: "1.2.
|
|
74693
|
+
getVersion: async () => ({ version: "1.2.261" })
|
|
74567
74694
|
}
|
|
74568
74695
|
}];
|
|
74569
74696
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,i as t,l as n,n as r,o as i}from"./scheduler-0XZJE03d.js";import{C as a,c as o,d as s,h as c,l,p as u,t as ee}from"./index-
|
|
1
|
+
import{a as e,i as t,l as n,n as r,o as i}from"./scheduler-0XZJE03d.js";import{C as a,c as o,d as s,h as c,l,p as u,t as ee}from"./index-DrK0zMfa.js";import{MaskShapeCanvas as d}from"./MaskShapeCanvas-BTvl6Rin.js";var f=a(`grid-2x2`,[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]),p=n(i(),1),m=n(e(),1),h=110,g=`motion-zones`,_=0,te=[1,2,3],v=1,y=`rounded-md border border-border bg-surface px-2 py-1 text-[11px] font-medium text-foreground-subtle hover:bg-surface-hover disabled:opacity-40 transition-colors`,b=`rounded-md border border-primary/50 bg-primary/15 px-2.5 py-1 text-[11px] font-medium text-primary hover:bg-primary/25 disabled:opacity-40 transition-colors`;function x(e,t,n){let r=t*n,i=Array.from({length:r});for(let t=0;t<r;t+=1)i[t]=e[t]===!0;return i}function S(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function C(e,t){return Math.ceil(e/t)}function w(e,t,n){return Math.min(n-1,Math.floor((e+.5)/t*n))}function T(e,t,n,r){let i=C(t,r),a=C(n,r),o=Array.from({length:i*a},()=>!1);for(let r=0;r<n;r+=1){let s=w(r,n,a);for(let n=0;n<t;n+=1)e[r*t+n]===!0&&(o[s*i+w(n,t,i)]=!0)}return o}function E(e,t,n,r){let i=C(t,r),a=C(n,r),o=Array.from({length:t*n},()=>!1);for(let r=0;r<n;r+=1){let s=w(r,n,a);for(let n=0;n<t;n+=1)o[r*t+n]=e[s*i+w(n,t,i)]===!0}return o}function D({deviceId:e}){let n=t(),i=s(c().trpcClient,e),[a,w]=(0,p.useState)(null),[D,O]=(0,p.useState)(!1),[k,A]=(0,p.useState)(null),[j,M]=(0,p.useState)(null),[N,P]=(0,p.useState)(v),[F,I]=(0,p.useState)(!1),[L,R]=(0,p.useState)(!1),z=(0,p.useRef)(!1);(0,p.useEffect)(()=>{if(!i)return;let e=!1;return z.current=!1,w(null),O(!1),A(null),M(null),P(v),R(!1),(async()=>{try{let t=await i.motionZones?.getOptions({});if(e)return;if(!t)throw Error(`device proxy not ready`);if(w(t),z.current)return;let n=await i.motionZones?.getStatus({});if(e)return;if(!n)throw Error(`device proxy not ready`);z.current=!0;let r=n.regions.find(e=>e.shape.kind===`grid`),a=x(r?r.shape.cells:[],t.grid.width,t.grid.height);M(a),A(T(a,t.grid.width,t.grid.height,v))}catch(t){if(e)return;l(t)?O(!0):console.error(`Motion Zones load failed`,t)}})(),()=>{e=!0}},[i]);let B=a?a.grid.width:0,V=a?a.grid.height:0,H=C(B,N),U=C(V,N),W=(0,p.useMemo)(()=>k&&a?E(k,B,V,N):null,[k,a,B,V,N]),G=(0,p.useMemo)(()=>W!==null&&j!==null&&!S(W,j),[W,j]),K=(0,p.useMemo)(()=>W?W.reduce((e,t)=>t?e+1:e,0):0,[W]),q=B*V,J=H*U,Y=(0,p.useCallback)(e=>{J>0&&A(Array.from({length:J},()=>e))},[J]),X=(0,p.useCallback)(()=>{A(e=>e&&e.map(e=>!e))},[]),Z=(0,p.useCallback)(()=>{j&&a&&A(T(j,B,V,N))},[j,a,B,V,N]),ne=(0,p.useCallback)(e=>{e===N||!a||A(t=>{if(!t)return P(e),t;let n=T(E(t,B,V,N),B,V,e);return P(e),n})},[N,a,B,V]),Q=(0,p.useMemo)(()=>a&&k?[{id:_,shape:{kind:`grid`,gridWidth:H,gridHeight:U,cells:[...k]}}]:[],[a,k,H,U]),$=(0,p.useCallback)((e,t)=>{t.kind===`grid`&&A(t.cells)},[]),re=(0,p.useCallback)(async()=>{if(!(!i||!k||!a)){I(!0);try{let e=E(k,a.grid.width,a.grid.height,N),t={kind:`grid`,gridWidth:a.grid.width,gridHeight:a.grid.height,cells:e};await i.motionZones?.setZone({patch:{regions:[{id:_,enabled:!0,shape:t}]}});let n=await i.motionZones?.getStatus({});if(n){let e=n.regions.find(e=>e.shape.kind===`grid`),t=x(e?e.shape.cells:[],a.grid.width,a.grid.height);M(t),A(T(t,a.grid.width,a.grid.height,N))}}catch(e){console.error(`Motion Zones save failed`,e)}finally{I(!1)}}},[i,k,a,N]);ee((0,p.useMemo)(()=>L&&!D&&a&&k?{id:g,order:h,node:(0,m.jsx)(d,{transparent:!0,items:Q,supportedShapes:[`grid`],grid:{width:H,height:U},selectedId:_,onSelect:()=>{},onShapeChange:$,onDrawComplete:()=>{},drawingKind:null})}:null,[L,D,a,k,Q,$,H,U]));let ie=!D&&a!==null&&k!==null;return i?(0,m.jsx)(u,{title:n(`uiLibrary.motionZones.title`,`Motion Zones`),icon:(0,m.jsx)(f,{className:`h-3.5 w-3.5 text-foreground-subtle`}),children:(0,m.jsx)(`div`,{className:`flex flex-col gap-3`,children:D?(0,m.jsx)(`p`,{className:`${o} leading-relaxed`,children:n(`uiLibrary.motionZones.unsupported`,`This camera doesn't expose an on-board motion zones grid.`)}):ie?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`p`,{className:`${o} leading-relaxed`,children:(0,m.jsx)(r,{uiKey:`uiLibrary.motionZones.intro`,fallback:`Toggle <0>Edit grid</0> to paint the region directly on the live frame, then <1>Save</1> to push the mask to the camera. Pick a bigger <2>Cell size</2> for quicker, broad-stroke painting — it's resampled to the camera's native {{width}}×{{height}} grid on save (×1 is the finest).`,components:[(0,m.jsx)(`strong`,{className:`text-foreground`},`e`),(0,m.jsx)(`strong`,{className:`text-foreground`},`s`),(0,m.jsx)(`strong`,{className:`text-foreground`},`c`)],values:{width:a.grid.width,height:a.grid.height}})}),(0,m.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,m.jsx)(`button`,{type:`button`,onClick:()=>R(e=>!e),disabled:F,"aria-pressed":L,className:L?b:y,children:L?n(`uiLibrary.motionZones.doneEditing`,`Done editing`):n(`uiLibrary.motionZones.editGrid`,`Edit grid`)}),(0,m.jsx)(`button`,{type:`button`,onClick:()=>Y(!0),disabled:F,className:y,children:n(`uiLibrary.motionZones.allOn`,`All on`)}),(0,m.jsx)(`button`,{type:`button`,onClick:()=>Y(!1),disabled:F,className:y,children:n(`uiLibrary.motionZones.allOff`,`All off`)}),(0,m.jsx)(`button`,{type:`button`,onClick:X,disabled:F,className:y,children:n(`uiLibrary.motionZones.invert`,`Invert`)}),(0,m.jsxs)(`div`,{className:`flex items-center gap-1 ml-1`,role:`group`,"aria-label":n(`uiLibrary.motionZones.cellSize`,`Cell size`),children:[(0,m.jsx)(`span`,{className:`${o} mr-0.5`,children:n(`uiLibrary.motionZones.cellSize`,`Cell size`)}),te.map(e=>(0,m.jsxs)(`button`,{type:`button`,onClick:()=>ne(e),disabled:F,"aria-pressed":N===e,title:e===1?n(`uiLibrary.motionZones.cameraGrid`,`Camera grid {{width}}×{{height}} (finest)`,{width:B,height:V}):n(`uiLibrary.motionZones.paintingGrid`,`{{width}}×{{height}} painting grid · cells ×{{factor}} bigger`,{width:C(B,e),height:C(V,e),factor:e}),className:N===e?b:y,children:[`×`,e]},e))]}),(0,m.jsxs)(`span`,{className:`${o} ml-1 tabular-nums`,children:[n(`uiLibrary.motionZones.cells`,`{{active}} / {{total}} cells · {{width}}×{{height}}`,{active:K,total:q,width:a.grid.width,height:a.grid.height}),N===1?``:n(`uiLibrary.motionZones.paintSuffix`,` · paint {{width}}×{{height}}`,{width:H,height:U})]}),(0,m.jsx)(`span`,{className:`flex-1`}),(0,m.jsx)(`button`,{type:`button`,onClick:Z,disabled:F||!G,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`,children:n(`uiLibrary.motionZones.revert`,`Revert`)}),(0,m.jsx)(`button`,{type:`button`,onClick:()=>void re(),disabled:F||!G,className:b,children:F?n(`uiLibrary.motionZones.saving`,`Saving…`):n(`uiLibrary.motionZones.save`,`Save`)})]})]}):(0,m.jsx)(`p`,{className:`${o} leading-relaxed`,children:n(`uiLibrary.motionZones.loading`,`Loading the camera's grid…`)})})}):null}export{D as MotionZonesSettings};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,i as t,l as n,n as r,o as i}from"./scheduler-0XZJE03d.js";import{C as a,_ as ee,c as o,d as te,g as ne,h as s,l as c,p as re,t as l,x as u,y as d}from"./index-D-rt-7-s.js";import{MaskShapeCanvas as ie}from"./MaskShapeCanvas-BTvl6Rin.js";var ae=a(`hexagon`,[[`path`,{d:`M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z`,key:`yt0hxn`}]]),oe=a(`mic-off`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M15 9.34V5a3 3 0 0 0-5.68-1.33`,key:`1gzdoj`}],[`path`,{d:`M16.95 16.95A7 7 0 0 1 5 12v-2`,key:`cqa7eg`}],[`path`,{d:`M18.89 13.23A7 7 0 0 0 19 12v-2`,key:`16hl24`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v3a3 3 0 0 0 5.12 2.12`,key:`r2i35w`}]]),f=n(i(),1),p=`Microphone`,m=`The camera encodes no audio at all — live view, recordings, exports and the audio analyzer are all silent.`;function se(e){let t=e.supportsAudioMute===!0,n=t?e.audioEnabled:null,r=e.pendingOn??null;return{label:p,supported:t,on:n===null?null:r??n,available:t&&n!==null,costWhenOff:m}}function ce(e){return!e.available||e.on===null?null:{enabled:!e.on}}var h=n(e(),1),le=120,ue=`privacy-mask`,g=`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`,_=`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`;function v(e){return e.kind===`rect`||e.kind===`polygon`?e:null}function de(e){let t=new Set(e.map(e=>e.id)),n=0;for(;t.has(n);)n+=1;return n}function fe(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(JSON.stringify(e[n])!==JSON.stringify(t[n]))return!1;return!0}function y({deviceId:e}){let n=t(),i=te(s().trpcClient,e),[a,p]=(0,f.useState)(null),[m,y]=(0,f.useState)(!1),[b,x]=(0,f.useState)(!1),[S,C]=(0,f.useState)(null),[w,T]=(0,f.useState)(null),[E,D]=(0,f.useState)(!1),[O,k]=(0,f.useState)(!1),[A,j]=(0,f.useState)(null),[M,N]=(0,f.useState)(null),[pe,P]=(0,f.useState)(null),[F,I]=(0,f.useState)(null),[L,R]=(0,f.useState)(null),z=(0,f.useRef)(!1);(0,f.useEffect)(()=>{if(!i)return;let e=!1;return z.current=!1,p(null),y(!1),x(!1),C(null),T(null),k(!1),j(null),N(null),P(null),I(null),R(null),(async()=>{try{let t=await i.privacyMask?.getOptions({});if(e)return;if(!t)throw Error(`device proxy not ready`);if(p(t),z.current)return;let n=await i.privacyMask?.getStatus({});if(e)return;if(!n)throw Error(`device proxy not ready`);if(n.regions===null){x(!0),P(n.audioEnabled);return}z.current=!0;let r={enabled:n.enabled,regions:n.regions};T(r),C(r),P(n.audioEnabled)}catch(t){if(e)return;c(t)?y(!0):console.error(`Privacy Mask load failed`,t)}})(),()=>{e=!0}},[i]);let B=(0,f.useMemo)(()=>S!==null&&w!==null&&(S.enabled!==w.enabled||!fe(S.regions,w.regions)),[S,w]),V=S?S.regions.length:0,H=a?a.maxRegions:0,U=(0,f.useRef)(0);(0,f.useEffect)(()=>{U.current=H},[H]);let W=H>0&&V>=H,me=(0,f.useCallback)(()=>{C(e=>e&&{...e,enabled:!e.enabled})},[]),G=(0,f.useCallback)(e=>{j(typeof e==`number`?e:null)},[]),K=(0,f.useMemo)(()=>S?S.regions.map(e=>({id:e.id,shape:e.shape,enabled:e.enabled,label:n(`uiLibrary.privacyMaskSettings.zoneN`,`Zone {{id}}`,{id:e.id})})):[],[S,n]),q=(0,f.useCallback)((e,t)=>{let n=v(t);n&&C(t=>t&&{...t,regions:t.regions.map(t=>t.id===e?{...t,shape:n}:t)})},[]),J=(0,f.useCallback)(e=>{let t=v(e);t&&(N(null),C(e=>{if(!e)return e;let n=U.current;if(n>0&&e.regions.length>=n)return e;let r=de(e.regions),i={id:r,enabled:!0,shape:t};return j(r),{...e,regions:[...e.regions,i]}}))},[]),Y=(0,f.useCallback)(e=>{k(!0),j(null),N(e)},[]),he=(0,f.useCallback)(e=>{k(!0),N(null),j(e)},[]),ge=(0,f.useCallback)(e=>{j(t=>t===e?null:t),C(t=>t&&{...t,regions:t.regions.filter(t=>t.id!==e)})},[]),_e=(0,f.useCallback)(()=>{N(null),j(null),w&&C({enabled:w.enabled,regions:w.regions})},[w]),X=(0,f.useCallback)(async()=>{if(!(!i||!S)){D(!0);try{await i.privacyMask?.setMask({patch:{enabled:S.enabled,regions:[...S.regions]}});let e=await i.privacyMask?.getStatus({});if(e&&e.regions!==null){let t={enabled:e.enabled,regions:e.regions};T(t),C(t)}}catch(e){console.error(`Privacy Mask save failed`,e)}finally{D(!1)}}},[i,S]),Z=se({supportsAudioMute:a===null?null:a.supportsAudioMute,audioEnabled:pe,pendingOn:F}),ve=(0,f.useCallback)(async()=>{let e=ce(Z);if(!(!i||e===null)){I(e.enabled),R(null);try{await i.privacyMask?.setAudioEnabled(e);let t=await i.privacyMask?.getStatus({});t&&P(t.audioEnabled)}catch(e){console.error(`Privacy microphone write failed — reverting`,e),R(e instanceof Error?e.message:String(e))}finally{I(null)}}},[i,Z]),ye=(0,f.useCallback)(()=>{k(e=>(e&&(N(null),j(null)),!e))},[]),Q=a?.supportedShapes??[];l((0,f.useMemo)(()=>O&&!m&&a&&S?{id:ue,order:le,node:(0,h.jsx)(ie,{transparent:!0,items:K,supportedShapes:Q,polygonVertices:a.polygonVertices,selectedId:A,onSelect:G,onShapeChange:q,onDrawComplete:J,drawingKind:M})}:null,[O,m,a,S,K,Q,A,G,q,J,M]));let be=a?.supportedShapes.includes(`rect`)??!1,xe=a?.supportedShapes.includes(`polygon`)??!1,$=a!==null&&(a.maxRegions<=0||a.supportedShapes.length===0),Se=!m&&!$&&!b&&a!==null&&S!==null;return i?(0,h.jsx)(re,{title:n(`uiLibrary.privacyMaskSettings.title`,`Privacy Mask`),icon:(0,h.jsx)(u,{className:`h-3.5 w-3.5 text-foreground-subtle`}),children:(0,h.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[m||$?(0,h.jsx)(`p`,{className:`${o} leading-relaxed`,children:n(`uiLibrary.privacyMaskSettings.unsupported`,`This camera doesn't support an on-board privacy mask.`)}):b?(0,h.jsx)(`p`,{className:`${o} leading-relaxed`,children:n(`uiLibrary.privacyMaskSettings.unreadable`,`This camera hasn't answered, so what it currently masks is unknown — the editor stays closed rather than showing an empty frame you could save over. A battery camera answers once it wakes; otherwise check that it is reachable.`)}):Se?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`p`,{className:`${o} leading-relaxed`,children:(0,h.jsx)(r,{uiKey:`uiLibrary.privacyMaskSettings.help`,fallback:`Toggle <0>Edit mask</0> to draw blanked-out zones on the live frame, then <1>Save</1> to push them to the camera. Drag a rectangle to move, its corner to resize; drag polygon vertices, click an edge midpoint to add one, or right-click a vertex to remove it.`,components:[(0,h.jsx)(`strong`,{className:`text-foreground`},`edit`),(0,h.jsx)(`strong`,{className:`text-foreground`},`save`)]})}),(0,h.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,h.jsx)(`button`,{type:`button`,onClick:ye,disabled:E,"aria-pressed":O,className:O?_:g,children:O?n(`uiLibrary.privacyMaskSettings.doneEditing`,`Done editing`):n(`uiLibrary.privacyMaskSettings.editMask`,`Edit mask`)}),(0,h.jsx)(`button`,{type:`button`,onClick:me,disabled:E,"aria-pressed":S.enabled,className:S.enabled?_:g,children:S.enabled?n(`uiLibrary.privacyMaskSettings.maskOn`,`Mask on`):n(`uiLibrary.privacyMaskSettings.maskOff`,`Mask off`)}),be&&(0,h.jsx)(`button`,{type:`button`,onClick:()=>Y(`rect`),disabled:E||W,"aria-pressed":M===`rect`,className:M===`rect`?_:g,title:W?n(`uiLibrary.privacyMaskSettings.maxZones`,`Maximum zones reached`):n(`uiLibrary.privacyMaskSettings.addRect`,`Add a rectangle zone`),children:n(`uiLibrary.privacyMaskSettings.rectButton`,`+ Rect`)}),xe&&(0,h.jsx)(`button`,{type:`button`,onClick:()=>Y(`polygon`),disabled:E||W,"aria-pressed":M===`polygon`,className:M===`polygon`?_:g,title:W?n(`uiLibrary.privacyMaskSettings.maxZones`,`Maximum zones reached`):n(`uiLibrary.privacyMaskSettings.addPolygon`,`Add a polygon zone`),children:n(`uiLibrary.privacyMaskSettings.polygonButton`,`+ Polygon`)}),(0,h.jsx)(`span`,{className:`${o} ml-1 tabular-nums`,children:n(`uiLibrary.privacyMaskSettings.zoneCount`,`{{active}} / {{max}} zones`,{active:V,max:H})}),(0,h.jsx)(`span`,{className:`flex-1`}),(0,h.jsx)(`button`,{type:`button`,onClick:_e,disabled:E||!B,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`,children:n(`uiLibrary.privacyMaskSettings.revert`,`Revert`)}),(0,h.jsx)(`button`,{type:`button`,onClick:()=>void X(),disabled:E||!B,className:_,children:E?n(`uiLibrary.privacyMaskSettings.saving`,`Saving…`):n(`uiLibrary.privacyMaskSettings.save`,`Save`)})]}),V>0?(0,h.jsx)(`div`,{className:`flex flex-col gap-1`,children:S.regions.map(e=>{let t=A===e.id,r=e.shape.kind===`polygon`?ae:ee;return(0,h.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border px-2 py-1 transition-colors ${t?`border-primary/50 bg-primary/10`:`border-border bg-surface`}`,children:[(0,h.jsxs)(`button`,{type:`button`,onClick:()=>he(e.id),disabled:E,className:`flex flex-1 items-center gap-2 text-left text-[11px] font-medium text-foreground-subtle hover:text-foreground disabled:opacity-40 transition-colors`,children:[(0,h.jsx)(r,{className:`h-3.5 w-3.5 shrink-0`}),(0,h.jsx)(`span`,{children:n(`uiLibrary.privacyMaskSettings.zoneN`,`Zone {{id}}`,{id:e.id})}),(0,h.jsx)(`span`,{className:`text-foreground-faint capitalize`,children:e.shape.kind})]}),(0,h.jsx)(`button`,{type:`button`,onClick:()=>ge(e.id),disabled:E,"aria-label":n(`uiLibrary.privacyMaskSettings.deleteZoneN`,`Delete zone {{id}}`,{id:e.id}),title:n(`uiLibrary.privacyMaskSettings.deleteZone`,`Delete zone`),className:`inline-flex h-6 w-6 items-center justify-center rounded border border-border bg-surface text-foreground-subtle hover:border-red-400/40 hover:bg-red-500/10 hover:text-red-400 disabled:opacity-40 transition-colors`,children:(0,h.jsx)(ne,{className:`h-3.5 w-3.5`})})]},e.id)})}):null]}):(0,h.jsx)(`p`,{className:`${o} leading-relaxed`,children:n(`uiLibrary.privacyMaskSettings.loading`,`Loading the camera's privacy mask…`)}),Z.supported&&(0,h.jsxs)(`div`,{className:`flex items-start gap-3 rounded-md border border-border bg-surface px-2 py-2`,children:[(0,h.jsx)(`button`,{type:`button`,role:`switch`,"aria-label":Z.label,"aria-checked":Z.on===!0,disabled:!Z.available||F!==null,onClick:()=>void ve(),title:Z.on===null?n(`uiLibrary.privacyMaskSettings.micTitleUnknown`,`Microphone — state unknown; the camera did not answer.`):Z.on?n(`uiLibrary.privacyMaskSettings.micTitleOn`,`The camera is capturing sound. Turning it off: {{cost}}`,{cost:Z.costWhenOff}):n(`uiLibrary.privacyMaskSettings.micTitleOff`,`The camera is silent. {{cost}}`,{cost:Z.costWhenOff}),className:Z.on===!1||Z.on===null?g:_,children:(0,h.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[Z.on===!1?(0,h.jsx)(oe,{className:`h-3.5 w-3.5`}):(0,h.jsx)(d,{className:`h-3.5 w-3.5`}),Z.on===null?n(`uiLibrary.privacyMaskSettings.micUnknown`,`Microphone unknown`):Z.on?n(`uiLibrary.privacyMaskSettings.micOn`,`Microphone on`):n(`uiLibrary.privacyMaskSettings.micOff`,`Microphone off`)]})}),(0,h.jsx)(`p`,{className:`text-[10px] text-foreground-subtle flex-1 leading-relaxed`,children:L===null?Z.on===null?n(`uiLibrary.privacyMaskSettings.micNotReported`,`The camera did not report its microphone, so this state is unknown.`):Z.costWhenOff:n(`uiLibrary.privacyMaskSettings.writeFailed`,`Write failed: {{reason}}`,{reason:L})})]})]})}):null}export{y as PrivacyMaskSettings};
|
|
1
|
+
import{a as e,i as t,l as n,n as r,o as i}from"./scheduler-0XZJE03d.js";import{C as a,_ as ee,c as o,d as te,g as ne,h as s,l as c,p as re,t as l,x as u,y as d}from"./index-DrK0zMfa.js";import{MaskShapeCanvas as ie}from"./MaskShapeCanvas-BTvl6Rin.js";var ae=a(`hexagon`,[[`path`,{d:`M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z`,key:`yt0hxn`}]]),oe=a(`mic-off`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M15 9.34V5a3 3 0 0 0-5.68-1.33`,key:`1gzdoj`}],[`path`,{d:`M16.95 16.95A7 7 0 0 1 5 12v-2`,key:`cqa7eg`}],[`path`,{d:`M18.89 13.23A7 7 0 0 0 19 12v-2`,key:`16hl24`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v3a3 3 0 0 0 5.12 2.12`,key:`r2i35w`}]]),f=n(i(),1),p=`Microphone`,m=`The camera encodes no audio at all — live view, recordings, exports and the audio analyzer are all silent.`;function se(e){let t=e.supportsAudioMute===!0,n=t?e.audioEnabled:null,r=e.pendingOn??null;return{label:p,supported:t,on:n===null?null:r??n,available:t&&n!==null,costWhenOff:m}}function ce(e){return!e.available||e.on===null?null:{enabled:!e.on}}var h=n(e(),1),le=120,ue=`privacy-mask`,g=`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`,_=`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`;function v(e){return e.kind===`rect`||e.kind===`polygon`?e:null}function de(e){let t=new Set(e.map(e=>e.id)),n=0;for(;t.has(n);)n+=1;return n}function fe(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(JSON.stringify(e[n])!==JSON.stringify(t[n]))return!1;return!0}function y({deviceId:e}){let n=t(),i=te(s().trpcClient,e),[a,p]=(0,f.useState)(null),[m,y]=(0,f.useState)(!1),[b,x]=(0,f.useState)(!1),[S,C]=(0,f.useState)(null),[w,T]=(0,f.useState)(null),[E,D]=(0,f.useState)(!1),[O,k]=(0,f.useState)(!1),[A,j]=(0,f.useState)(null),[M,N]=(0,f.useState)(null),[pe,P]=(0,f.useState)(null),[F,I]=(0,f.useState)(null),[L,R]=(0,f.useState)(null),z=(0,f.useRef)(!1);(0,f.useEffect)(()=>{if(!i)return;let e=!1;return z.current=!1,p(null),y(!1),x(!1),C(null),T(null),k(!1),j(null),N(null),P(null),I(null),R(null),(async()=>{try{let t=await i.privacyMask?.getOptions({});if(e)return;if(!t)throw Error(`device proxy not ready`);if(p(t),z.current)return;let n=await i.privacyMask?.getStatus({});if(e)return;if(!n)throw Error(`device proxy not ready`);if(n.regions===null){x(!0),P(n.audioEnabled);return}z.current=!0;let r={enabled:n.enabled,regions:n.regions};T(r),C(r),P(n.audioEnabled)}catch(t){if(e)return;c(t)?y(!0):console.error(`Privacy Mask load failed`,t)}})(),()=>{e=!0}},[i]);let B=(0,f.useMemo)(()=>S!==null&&w!==null&&(S.enabled!==w.enabled||!fe(S.regions,w.regions)),[S,w]),V=S?S.regions.length:0,H=a?a.maxRegions:0,U=(0,f.useRef)(0);(0,f.useEffect)(()=>{U.current=H},[H]);let W=H>0&&V>=H,me=(0,f.useCallback)(()=>{C(e=>e&&{...e,enabled:!e.enabled})},[]),G=(0,f.useCallback)(e=>{j(typeof e==`number`?e:null)},[]),K=(0,f.useMemo)(()=>S?S.regions.map(e=>({id:e.id,shape:e.shape,enabled:e.enabled,label:n(`uiLibrary.privacyMaskSettings.zoneN`,`Zone {{id}}`,{id:e.id})})):[],[S,n]),q=(0,f.useCallback)((e,t)=>{let n=v(t);n&&C(t=>t&&{...t,regions:t.regions.map(t=>t.id===e?{...t,shape:n}:t)})},[]),J=(0,f.useCallback)(e=>{let t=v(e);t&&(N(null),C(e=>{if(!e)return e;let n=U.current;if(n>0&&e.regions.length>=n)return e;let r=de(e.regions),i={id:r,enabled:!0,shape:t};return j(r),{...e,regions:[...e.regions,i]}}))},[]),Y=(0,f.useCallback)(e=>{k(!0),j(null),N(e)},[]),he=(0,f.useCallback)(e=>{k(!0),N(null),j(e)},[]),ge=(0,f.useCallback)(e=>{j(t=>t===e?null:t),C(t=>t&&{...t,regions:t.regions.filter(t=>t.id!==e)})},[]),_e=(0,f.useCallback)(()=>{N(null),j(null),w&&C({enabled:w.enabled,regions:w.regions})},[w]),X=(0,f.useCallback)(async()=>{if(!(!i||!S)){D(!0);try{await i.privacyMask?.setMask({patch:{enabled:S.enabled,regions:[...S.regions]}});let e=await i.privacyMask?.getStatus({});if(e&&e.regions!==null){let t={enabled:e.enabled,regions:e.regions};T(t),C(t)}}catch(e){console.error(`Privacy Mask save failed`,e)}finally{D(!1)}}},[i,S]),Z=se({supportsAudioMute:a===null?null:a.supportsAudioMute,audioEnabled:pe,pendingOn:F}),ve=(0,f.useCallback)(async()=>{let e=ce(Z);if(!(!i||e===null)){I(e.enabled),R(null);try{await i.privacyMask?.setAudioEnabled(e);let t=await i.privacyMask?.getStatus({});t&&P(t.audioEnabled)}catch(e){console.error(`Privacy microphone write failed — reverting`,e),R(e instanceof Error?e.message:String(e))}finally{I(null)}}},[i,Z]),ye=(0,f.useCallback)(()=>{k(e=>(e&&(N(null),j(null)),!e))},[]),Q=a?.supportedShapes??[];l((0,f.useMemo)(()=>O&&!m&&a&&S?{id:ue,order:le,node:(0,h.jsx)(ie,{transparent:!0,items:K,supportedShapes:Q,polygonVertices:a.polygonVertices,selectedId:A,onSelect:G,onShapeChange:q,onDrawComplete:J,drawingKind:M})}:null,[O,m,a,S,K,Q,A,G,q,J,M]));let be=a?.supportedShapes.includes(`rect`)??!1,xe=a?.supportedShapes.includes(`polygon`)??!1,$=a!==null&&(a.maxRegions<=0||a.supportedShapes.length===0),Se=!m&&!$&&!b&&a!==null&&S!==null;return i?(0,h.jsx)(re,{title:n(`uiLibrary.privacyMaskSettings.title`,`Privacy Mask`),icon:(0,h.jsx)(u,{className:`h-3.5 w-3.5 text-foreground-subtle`}),children:(0,h.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[m||$?(0,h.jsx)(`p`,{className:`${o} leading-relaxed`,children:n(`uiLibrary.privacyMaskSettings.unsupported`,`This camera doesn't support an on-board privacy mask.`)}):b?(0,h.jsx)(`p`,{className:`${o} leading-relaxed`,children:n(`uiLibrary.privacyMaskSettings.unreadable`,`This camera hasn't answered, so what it currently masks is unknown — the editor stays closed rather than showing an empty frame you could save over. A battery camera answers once it wakes; otherwise check that it is reachable.`)}):Se?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`p`,{className:`${o} leading-relaxed`,children:(0,h.jsx)(r,{uiKey:`uiLibrary.privacyMaskSettings.help`,fallback:`Toggle <0>Edit mask</0> to draw blanked-out zones on the live frame, then <1>Save</1> to push them to the camera. Drag a rectangle to move, its corner to resize; drag polygon vertices, click an edge midpoint to add one, or right-click a vertex to remove it.`,components:[(0,h.jsx)(`strong`,{className:`text-foreground`},`edit`),(0,h.jsx)(`strong`,{className:`text-foreground`},`save`)]})}),(0,h.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,h.jsx)(`button`,{type:`button`,onClick:ye,disabled:E,"aria-pressed":O,className:O?_:g,children:O?n(`uiLibrary.privacyMaskSettings.doneEditing`,`Done editing`):n(`uiLibrary.privacyMaskSettings.editMask`,`Edit mask`)}),(0,h.jsx)(`button`,{type:`button`,onClick:me,disabled:E,"aria-pressed":S.enabled,className:S.enabled?_:g,children:S.enabled?n(`uiLibrary.privacyMaskSettings.maskOn`,`Mask on`):n(`uiLibrary.privacyMaskSettings.maskOff`,`Mask off`)}),be&&(0,h.jsx)(`button`,{type:`button`,onClick:()=>Y(`rect`),disabled:E||W,"aria-pressed":M===`rect`,className:M===`rect`?_:g,title:W?n(`uiLibrary.privacyMaskSettings.maxZones`,`Maximum zones reached`):n(`uiLibrary.privacyMaskSettings.addRect`,`Add a rectangle zone`),children:n(`uiLibrary.privacyMaskSettings.rectButton`,`+ Rect`)}),xe&&(0,h.jsx)(`button`,{type:`button`,onClick:()=>Y(`polygon`),disabled:E||W,"aria-pressed":M===`polygon`,className:M===`polygon`?_:g,title:W?n(`uiLibrary.privacyMaskSettings.maxZones`,`Maximum zones reached`):n(`uiLibrary.privacyMaskSettings.addPolygon`,`Add a polygon zone`),children:n(`uiLibrary.privacyMaskSettings.polygonButton`,`+ Polygon`)}),(0,h.jsx)(`span`,{className:`${o} ml-1 tabular-nums`,children:n(`uiLibrary.privacyMaskSettings.zoneCount`,`{{active}} / {{max}} zones`,{active:V,max:H})}),(0,h.jsx)(`span`,{className:`flex-1`}),(0,h.jsx)(`button`,{type:`button`,onClick:_e,disabled:E||!B,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`,children:n(`uiLibrary.privacyMaskSettings.revert`,`Revert`)}),(0,h.jsx)(`button`,{type:`button`,onClick:()=>void X(),disabled:E||!B,className:_,children:E?n(`uiLibrary.privacyMaskSettings.saving`,`Saving…`):n(`uiLibrary.privacyMaskSettings.save`,`Save`)})]}),V>0?(0,h.jsx)(`div`,{className:`flex flex-col gap-1`,children:S.regions.map(e=>{let t=A===e.id,r=e.shape.kind===`polygon`?ae:ee;return(0,h.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border px-2 py-1 transition-colors ${t?`border-primary/50 bg-primary/10`:`border-border bg-surface`}`,children:[(0,h.jsxs)(`button`,{type:`button`,onClick:()=>he(e.id),disabled:E,className:`flex flex-1 items-center gap-2 text-left text-[11px] font-medium text-foreground-subtle hover:text-foreground disabled:opacity-40 transition-colors`,children:[(0,h.jsx)(r,{className:`h-3.5 w-3.5 shrink-0`}),(0,h.jsx)(`span`,{children:n(`uiLibrary.privacyMaskSettings.zoneN`,`Zone {{id}}`,{id:e.id})}),(0,h.jsx)(`span`,{className:`text-foreground-faint capitalize`,children:e.shape.kind})]}),(0,h.jsx)(`button`,{type:`button`,onClick:()=>ge(e.id),disabled:E,"aria-label":n(`uiLibrary.privacyMaskSettings.deleteZoneN`,`Delete zone {{id}}`,{id:e.id}),title:n(`uiLibrary.privacyMaskSettings.deleteZone`,`Delete zone`),className:`inline-flex h-6 w-6 items-center justify-center rounded border border-border bg-surface text-foreground-subtle hover:border-red-400/40 hover:bg-red-500/10 hover:text-red-400 disabled:opacity-40 transition-colors`,children:(0,h.jsx)(ne,{className:`h-3.5 w-3.5`})})]},e.id)})}):null]}):(0,h.jsx)(`p`,{className:`${o} leading-relaxed`,children:n(`uiLibrary.privacyMaskSettings.loading`,`Loading the camera's privacy mask…`)}),Z.supported&&(0,h.jsxs)(`div`,{className:`flex items-start gap-3 rounded-md border border-border bg-surface px-2 py-2`,children:[(0,h.jsx)(`button`,{type:`button`,role:`switch`,"aria-label":Z.label,"aria-checked":Z.on===!0,disabled:!Z.available||F!==null,onClick:()=>void ve(),title:Z.on===null?n(`uiLibrary.privacyMaskSettings.micTitleUnknown`,`Microphone — state unknown; the camera did not answer.`):Z.on?n(`uiLibrary.privacyMaskSettings.micTitleOn`,`The camera is capturing sound. Turning it off: {{cost}}`,{cost:Z.costWhenOff}):n(`uiLibrary.privacyMaskSettings.micTitleOff`,`The camera is silent. {{cost}}`,{cost:Z.costWhenOff}),className:Z.on===!1||Z.on===null?g:_,children:(0,h.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[Z.on===!1?(0,h.jsx)(oe,{className:`h-3.5 w-3.5`}):(0,h.jsx)(d,{className:`h-3.5 w-3.5`}),Z.on===null?n(`uiLibrary.privacyMaskSettings.micUnknown`,`Microphone unknown`):Z.on?n(`uiLibrary.privacyMaskSettings.micOn`,`Microphone on`):n(`uiLibrary.privacyMaskSettings.micOff`,`Microphone off`)]})}),(0,h.jsx)(`p`,{className:`text-[10px] text-foreground-subtle flex-1 leading-relaxed`,children:L===null?Z.on===null?n(`uiLibrary.privacyMaskSettings.micNotReported`,`The camera did not report its microphone, so this state is unknown.`):Z.costWhenOff:n(`uiLibrary.privacyMaskSettings.writeFailed`,`Write failed: {{reason}}`,{reason:L})})]})]})}):null}export{y as PrivacyMaskSettings};
|