@dominevo/ui-library 0.1.0 → 0.1.1

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.
Files changed (45) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/{SceneMonitorEditor-CU24Au1r.cjs → SceneMonitorEditor-Bres0ZEA.cjs} +1 -1
  3. package/dist/{SceneMonitorEditor-Bj_BN2Ar.js → SceneMonitorEditor-grGP7vRI.js} +1 -1
  4. package/dist/composites/adaptive-downlink.d.ts +1 -1
  5. package/dist/composites/camera-stream-player.d.ts +1 -1
  6. package/dist/composites/charts/StateTimeline.d.ts +3 -1
  7. package/dist/composites/charts/TimeSeriesChart.d.ts +3 -1
  8. package/dist/composites/charts/chart-frame.d.ts +3 -1
  9. package/dist/composites/charts/chart-palette.d.ts +1 -1
  10. package/dist/composites/clips/ClipBandBar.d.ts +1 -1
  11. package/dist/composites/clips/ClipTile.d.ts +1 -1
  12. package/dist/composites/clips/ClipsSection.d.ts +1 -1
  13. package/dist/composites/clips/clip-tile-media.d.ts +2 -2
  14. package/dist/composites/device-card/connected/MeasuredPieCard.d.ts +1 -11
  15. package/dist/composites/device-card/connected/ReadingHistory.d.ts +20 -0
  16. package/dist/composites/device-card/scenes/sensor/ReadingTile.d.ts +1 -1
  17. package/dist/composites/device-card/scenes/sensor/SensorPieCard.d.ts +9 -7
  18. package/dist/composites/device-card/scenes/sensor/pie-css.d.ts +4 -4
  19. package/dist/composites/device-card/scenes/sensor/pie-model.d.ts +5 -0
  20. package/dist/composites/device-card/scenes/sensor/reading-colour.d.ts +32 -0
  21. package/dist/composites/device-export-panel.d.ts +1 -1
  22. package/dist/composites/device-list/url-state.d.ts +1 -1
  23. package/dist/composites/device-picker/device-picker-grouping.d.ts +1 -1
  24. package/dist/composites/device-picker/device-selection.d.ts +1 -1
  25. package/dist/contexts/recorded-playback.d.ts +2 -2
  26. package/dist/contexts/widget-registry.d.ts +1 -1
  27. package/dist/hooks/use-capability-presence.d.ts +21 -0
  28. package/dist/hooks/use-device-list-page-size.d.ts +2 -2
  29. package/dist/hooks/use-url-query.d.ts +2 -2
  30. package/dist/index.cjs +740 -656
  31. package/dist/index.js +741 -657
  32. package/dist/lib/recorded-control-protocol.d.ts +1 -1
  33. package/dist/lib/shared-context.d.ts +1 -1
  34. package/dist/theme/create-theme.d.ts +2 -2
  35. package/dist/theme/defaults.d.ts +4 -4
  36. package/dist/theme/index.cjs +1 -1
  37. package/dist/theme/index.d.ts +1 -1
  38. package/dist/theme/index.js +1 -1
  39. package/dist/theme/theme-to-css.d.ts +2 -2
  40. package/dist/theme/theme-to-root-css.d.ts +2 -2
  41. package/dist/theme/tokens.d.ts +1 -1
  42. package/dist/theme/types.d.ts +4 -4
  43. package/dist/trpc-react.d.ts +3 -3
  44. package/package.json +7 -7
  45. /package/src/tailwind/{camstack-theme.css → dominevo-theme.css} +0 -0
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import * as __mfHostReact from "react";
5
5
  import React, { Children, Fragment, Suspense, cloneElement, createContext, createElement, forwardRef, isValidElement, lazy, useCallback, useContext, useEffect, useId, useImperativeHandle, useLayoutEffect, useMemo, useReducer, useRef, useState, useSyncExternalStore } from "react";
6
6
  import * as __mfHostReactJsxRuntime from "react/jsx-runtime";
7
7
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
8
- import { ALL_CAPABILITY_DEFINITIONS, AUTOMATION_LEAF_CATEGORIES, AUTOMATION_LEAF_KINDS, CAM_PROFILE_ORDER, CAP_VOCABULARY_BY_NAME, CLIMATE_ROLES as CLIMATE_ROLES$1, CLIP_STILL_DISPOSITION_HEADER, CLIP_STILL_REASON_CODE_HEADER, CLIP_STILL_REASON_HEADER, COMPOSER_ADDON_ID, CONTAINER_CHILD_PRIORITY, CONTAINER_PRIMARY_CHILD_RULES, ConsumableLevelSchema, DEFAULT_DISPLAY_PREFERENCE, DEFAULT_EVENTS_BAND_BUFFER_SEC, DEFAULT_TAG_ICON, DEVICE_HISTORY_ENERGY_KEY, DEVICE_HISTORY_QUERY_MANY_MAX_ITEMS, DEVICE_ROLE_ICON, DEVICE_TYPE_CONTROL_KIND, DEVICE_TYPE_ICON, DISPLAY_PREFERENCES, DaylightPhaseSchema, DeviceExportStatusSchema, DeviceFeature, DeviceRole, DeviceType, EVENT_CATEGORY_CATALOG, EVENT_CATEGORY_GROUPS, EXPRESSION_BUILTIN_NAMES, EXPRESSION_INJECTED_NOW, EXTENSION_SLOTS, EXTENSION_SLOT_IDS, EventCategory, EventEmitterStatusSchema, ExportEntityKindSchema, ExportInstanceSchema, ExposedDeviceSchema, ExposedEntitySchema, FIRST_LEVEL_MACRO_CLASSES, HERO_CAP_COVERAGE, HERO_ROW_LABELS, HERO_SCENES, HISTORY_CATALOG, HISTORY_PRIMARY, ICON_CATEGORIES, KNOWN_CAP_NAMES, LATER_PHASE, MAX_LAYOUT_SPAN, MAX_SENSOR_TRIGGER_DEVICES, METHOD_DEVICE_SELECTORS, MODEL_PROVIDER_IDS, NAVIGATION_LIGHT_LEVEL_MAX, NAVIGATION_LIGHT_LEVEL_MIN, NODE_COLOR_IDS, NOT_REPORTED, NodeColorIdSchema, PALETTE_ENTRY_IDS, PET_FEEDER_MANUAL_FEED_MAX, PET_FEEDER_MANUAL_FEED_MIN, QUANTITY_BASE, RECORDING_AUDIO_TRIGGER_OFFERED_DBFS, RECORDING_SOURCE_CAMSTACK_ADDON, REDACTED_SECRET, REMOTE_KNOWN_ROLES, ReadingQuantitySchema, RecordingConfigSchema, RecordingStatusSchema, RemoteLayoutPayloadSchema, SECRET_CLEAR, SOURCE_CAP_ACTIVE_FIELD, STATIONARY_OVERLAY_STYLE, SUBJECT_PATH_DWELL_EPS, SUBJECT_PATH_FULL_FRAME_COVERAGE, SUBJECT_PATH_MAX_POINTS, SunEventSchema, TAGS_PER_RECORD_MAX, TAG_COLOR_IDS, TAG_NAME_MAX_LENGTH, TIMEZONES, TimeWindowDraftSchema, TimeWindowSchema, USE_ROOT_MODEL_SETTING_KEY, assignNodeColorId, assignNodeColorId as assignNodeColorId$1, baseUnitForQuantity, baseUnitOf, buildModelVariantGroups, buildSubjectPath, builtinRemoteComponent, bundledCamstack, canConvertUnit, canonicalIconKey, clearModelBoundOverrides, clearModelBoundSetting, climateRoleOf as climateRoleOf$1, clusterStepSettingFieldsFor, collectModelBoundKeys, consumableFormOf, consumableKindOf, convertQuantityInput, convertUnit, coreBlockComposition, createDeviceProxy, createLazyTrpcSource, createSliceHandle, customKeyOfRole, defaultTagColorId, dehydrateSchema, deriveMediaPlayerView, deriveRecordingMode, deriveWorkloadControls, describeModelVariant, deviceIconKey, displayUnitFor, effectiveStepSettings, expandTimeWindowPreset, findTimezone, findVocabularyEntry, formatParkedFor, formatReading, hasModelBoundOverrides, heatPumpInstantCop, heatPumpPeriodCop, heroArgsWithValue, holdVarSlots, iconCategoryLabel, iconsInCategory, insertComponent, isDrawableSubjectPath, isKeychainStoredField, isModelScopedStepSettingKey, isNotReported, isReadingQuantity, isRemoteKnownRole, isRemoteWidgetRole, isRootSuppliableStepId, isSecretClear, isSecretFieldView, isSecretMarker, isSwitchLight, kindServesCap, leafCatalogEntry, leafKindsFor, lockDoorLinkOfComposition, modelBindingKey, moveGroup as moveGroup$1, netPowerOf, noiseEventCategories, normalizeTags, normalizeUnit, notificationTargetKindOf, offerableEventCategories, paintHex, parseOccupancyScope, pickPrimarySeriesKey, primaryChildPreferenceOf, primarySeriesKey, projectSubjectPath, quantityFromUnit, readEventVocabulary, rectsOverlap, remoteRoleIcon, remoteRoleLabel, remoteRoleLegend, removeGroup, resolveContainerPrimaryChild, resolveDeviceControlKind, resolveIconKey, resolveModelBoundSetting, resolveRecordingProfiles, resolveRootSupply, resolveVariantModelId, resolveViewableDeviceIds, runtimeFieldUnit, sameTag, searchIcons, selectAssignedProfileSlots, stepSettingSource, subjectPathSampleFromBox, subjectPathSvgPoints, tagKey, templateCapKey, timedRunLimitOf, timedRunMaxIn, timedRunRemaining, tryConvertUnit, unitDimension, unitsForDimension, unitsForQuantity, weekdayKeyOfIndex, withFieldFrom, withoutField, writeModelBoundSetting } from "@dominevo/types";
8
+ import { ALL_CAPABILITY_DEFINITIONS, AUTOMATION_LEAF_CATEGORIES, AUTOMATION_LEAF_KINDS, CAM_PROFILE_ORDER, CAP_VOCABULARY_BY_NAME, CLIMATE_ROLES as CLIMATE_ROLES$1, CLIP_STILL_DISPOSITION_HEADER, CLIP_STILL_REASON_CODE_HEADER, CLIP_STILL_REASON_HEADER, COMPOSER_ADDON_ID, CONTAINER_CHILD_PRIORITY, CONTAINER_PRIMARY_CHILD_RULES, ConsumableLevelSchema, DEFAULT_DISPLAY_PREFERENCE, DEFAULT_EVENTS_BAND_BUFFER_SEC, DEFAULT_TAG_ICON, DEVICE_HISTORY_ENERGY_KEY, DEVICE_HISTORY_QUERY_MANY_MAX_ITEMS, DEVICE_ROLE_ICON, DEVICE_TYPE_CONTROL_KIND, DEVICE_TYPE_ICON, DISPLAY_PREFERENCES, DaylightPhaseSchema, DeviceExportStatusSchema, DeviceFeature, DeviceRole, DeviceType, EVENT_CATEGORY_CATALOG, EVENT_CATEGORY_GROUPS, EXPRESSION_BUILTIN_NAMES, EXPRESSION_INJECTED_NOW, EXTENSION_SLOTS, EXTENSION_SLOT_IDS, EventCategory, EventEmitterStatusSchema, ExportEntityKindSchema, ExportInstanceSchema, ExposedDeviceSchema, ExposedEntitySchema, FIRST_LEVEL_MACRO_CLASSES, HERO_CAP_COVERAGE, HERO_ROW_LABELS, HERO_SCENES, HISTORY_CATALOG, HISTORY_PRIMARY, ICON_CATEGORIES, KNOWN_CAP_NAMES, LATER_PHASE, MAX_LAYOUT_SPAN, MAX_SENSOR_TRIGGER_DEVICES, METHOD_DEVICE_SELECTORS, MODEL_PROVIDER_IDS, NAVIGATION_LIGHT_LEVEL_MAX, NAVIGATION_LIGHT_LEVEL_MIN, NODE_COLOR_IDS, NOT_REPORTED, NodeColorIdSchema, PALETTE_ENTRY_IDS, PET_FEEDER_MANUAL_FEED_MAX, PET_FEEDER_MANUAL_FEED_MIN, QUANTITY_BASE, RECORDING_AUDIO_TRIGGER_OFFERED_DBFS, RECORDING_SOURCE_DOMINEVO_ADDON, REDACTED_SECRET, REMOTE_KNOWN_ROLES, ReadingQuantitySchema, RecordingConfigSchema, RecordingStatusSchema, RemoteLayoutPayloadSchema, SECRET_CLEAR, SOURCE_CAP_ACTIVE_FIELD, STATIONARY_OVERLAY_STYLE, SUBJECT_PATH_DWELL_EPS, SUBJECT_PATH_FULL_FRAME_COVERAGE, SUBJECT_PATH_MAX_POINTS, SunEventSchema, TAGS_PER_RECORD_MAX, TAG_COLOR_IDS, TAG_NAME_MAX_LENGTH, TIMEZONES, TimeWindowDraftSchema, TimeWindowSchema, USE_ROOT_MODEL_SETTING_KEY, assignNodeColorId, assignNodeColorId as assignNodeColorId$1, baseUnitForQuantity, baseUnitOf, buildModelVariantGroups, buildSubjectPath, builtinRemoteComponent, bundledDominevo, canConvertUnit, canonicalIconKey, clearModelBoundOverrides, clearModelBoundSetting, climateRoleOf as climateRoleOf$1, clusterStepSettingFieldsFor, collectModelBoundKeys, consumableFormOf, consumableKindOf, convertQuantityInput, convertUnit, coreBlockComposition, createDeviceProxy, createLazyTrpcSource, createSliceHandle, customKeyOfRole, defaultTagColorId, dehydrateSchema, deriveMediaPlayerView, deriveRecordingMode, deriveWorkloadControls, describeModelVariant, deviceIconKey, displayUnitFor, effectiveStepSettings, expandTimeWindowPreset, findTimezone, findVocabularyEntry, formatParkedFor, formatReading, hasModelBoundOverrides, heatPumpInstantCop, heatPumpPeriodCop, heroArgsWithValue, holdVarSlots, iconCategoryLabel, iconsInCategory, insertComponent, isDrawableSubjectPath, isKeychainStoredField, isModelScopedStepSettingKey, isNotReported, isReadingQuantity, isRemoteKnownRole, isRemoteWidgetRole, isRootSuppliableStepId, isSecretClear, isSecretFieldView, isSecretMarker, isSwitchLight, kindServesCap, leafCatalogEntry, leafKindsFor, lockDoorLinkOfComposition, modelBindingKey, moveGroup as moveGroup$1, netPowerOf, noiseEventCategories, normalizeTags, normalizeUnit, notificationTargetKindOf, offerableEventCategories, paintHex, parseOccupancyScope, pickPrimarySeriesKey, primaryChildPreferenceOf, primarySeriesKey, projectSubjectPath, quantityFromUnit, readEventVocabulary, rectsOverlap, remoteRoleIcon, remoteRoleLabel, remoteRoleLegend, removeGroup, resolveContainerPrimaryChild, resolveDeviceControlKind, resolveIconKey, resolveModelBoundSetting, resolveRecordingProfiles, resolveRootSupply, resolveVariantModelId, resolveViewableDeviceIds, runtimeFieldUnit, sameTag, searchIcons, selectAssignedProfileSlots, stepSettingSource, subjectPathSampleFromBox, subjectPathSvgPoints, tagKey, templateCapKey, timedRunLimitOf, timedRunMaxIn, timedRunRemaining, tryConvertUnit, unitDimension, unitsForDimension, unitsForQuantity, weekdayKeyOfIndex, withFieldFrom, withoutField, writeModelBoundSetting } from "@dominevo/types";
9
9
  import * as __mfHostTrpcReactQuery from "@trpc/react-query";
10
10
  import { createTRPCReact } from "@trpc/react-query";
11
11
  import * as __mfHostReactDOM from "react-dom";
@@ -9417,7 +9417,7 @@ var ZoomOut = createLucideIcon("zoom-out", [
9417
9417
  /**
9418
9418
  * Shared typed React Query proxy for the backend AppRouter.
9419
9419
  *
9420
- * The proxy is exposed on `window.__camstackTrpcReact` so addon-page
9420
+ * The proxy is exposed on `window.__dominevoTrpcReact` so addon-page
9421
9421
  * bundles (which load AFTER the host admin-ui sets the global) reuse
9422
9422
  * the host's `createTRPCReact` instance instead of creating a separate
9423
9423
  * one. Sharing the instance is mandatory because the typed React-Query
@@ -9427,16 +9427,16 @@ var ZoomOut = createLucideIcon("zoom-out", [
9427
9427
  *
9428
9428
  * Boot order:
9429
9429
  * 1. admin-ui's `main.tsx` is the first script to evaluate this
9430
- * module, sees `window.__camstackTrpcReact === undefined`,
9430
+ * module, sees `window.__dominevoTrpcReact === undefined`,
9431
9431
  * creates the proxy, stashes it on the window.
9432
9432
  * 2. Addon bundles are loaded later by `AddonPageLoader` — when
9433
9433
  * their entrypoint evaluates this same module (resolved through
9434
9434
  * Vite alias to ui-library/src), the global is already set, so
9435
9435
  * they pick up the host instance and skip the second create.
9436
9436
  */
9437
- var existing = typeof globalThis !== "undefined" ? globalThis.__camstackTrpcReact : void 0;
9437
+ var existing = typeof globalThis !== "undefined" ? globalThis.__dominevoTrpcReact : void 0;
9438
9438
  var trpc = existing ?? createTRPCReact();
9439
- if (typeof globalThis !== "undefined" && !existing) globalThis.__camstackTrpcReact = trpc;
9439
+ if (typeof globalThis !== "undefined" && !existing) globalThis.__dominevoTrpcReact = trpc;
9440
9440
  //#endregion
9441
9441
  //#region src/lib/shared-context.ts
9442
9442
  /**
@@ -9466,9 +9466,9 @@ if (typeof globalThis !== "undefined" && !existing) globalThis.__camstackTrpcRea
9466
9466
  */
9467
9467
  function createSharedContext(name, defaultValue) {
9468
9468
  if (typeof globalThis === "undefined") return createContext(defaultValue);
9469
- const existingMap = globalThis.__camstackSharedContexts;
9469
+ const existingMap = globalThis.__dominevoSharedContexts;
9470
9470
  const map = existingMap ?? /* @__PURE__ */ new Map();
9471
- if (!existingMap) globalThis.__camstackSharedContexts = map;
9471
+ if (!existingMap) globalThis.__dominevoSharedContexts = map;
9472
9472
  const existing = map.get(name);
9473
9473
  if (existing) return existing;
9474
9474
  const ctx = createContext(defaultValue);
@@ -9499,7 +9499,7 @@ function createSharedContext(name, defaultValue) {
9499
9499
  * `createContext()` produces a fresh instance that never matches the
9500
9500
  * host's `<SystemProvider>`.
9501
9501
  */
9502
- var SystemContext = createSharedContext("camstack:system", null);
9502
+ var SystemContext = createSharedContext("dominevo:system", null);
9503
9503
  function SystemProvider({ system, children }) {
9504
9504
  return /* @__PURE__ */ jsx(SystemContext.Provider, {
9505
9505
  value: system,
@@ -9702,6 +9702,22 @@ function useCapabilityPresence(capabilityName) {
9702
9702
  return classifyCapability(query.data);
9703
9703
  }
9704
9704
  /**
9705
+ * Presence of a DEVICE-NATIVE capability, from a device search that requires it.
9706
+ *
9707
+ * A device-native capability has no addon-level provider: providers register it
9708
+ * on the devices they own, so the registry row (`getCapability`) answers
9709
+ * `providers: []` forever and `useCapabilityPresence` would say `absent` while
9710
+ * the cluster has the capability on many devices. The authority is the device
9711
+ * search: `present` when at least one compatible device carries it, `absent`
9712
+ * only when the search ANSWERED with none, `pending` until it answers,
9713
+ * `unknown` when it failed (D315).
9714
+ */
9715
+ function classifyDeviceNativePresence(answer) {
9716
+ if (answer.status === "pending") return "pending";
9717
+ if (answer.status === "error") return "unknown";
9718
+ return (answer.data?.items ?? []).some((item) => item.compatible) ? "present" : "absent";
9719
+ }
9720
+ /**
9705
9721
  * Classify ONE node from the registry's answer — the per-node form of
9706
9722
  * `useCapabilityPresence`, for a picker that offers only the nodes running a
9707
9723
  * provider.
@@ -12041,7 +12057,7 @@ var SECRET_REVEAL_MS = 1e4;
12041
12057
  var SECRET_MASK_PLACEHOLDER = "••••••••";
12042
12058
  /** How long a refused reveal's reason stays on the eye. */
12043
12059
  var REVEAL_ERROR_MS = 5e3;
12044
- var SecretRevealContext = createSharedContext("camstack:secret-reveal", null);
12060
+ var SecretRevealContext = createSharedContext("dominevo:secret-reveal", null);
12045
12061
  function SecretRevealProvider({ reveal, children }) {
12046
12062
  return /* @__PURE__ */ jsx(SecretRevealContext.Provider, {
12047
12063
  value: reveal,
@@ -17549,7 +17565,7 @@ function DeviceValuePanel(props) {
17549
17565
  }
17550
17566
  //#endregion
17551
17567
  //#region src/composites/device-value-picker/use-recent-devices.ts
17552
- var STORAGE_PREFIX$1 = "camstack.deviceValuePicker.recent.";
17568
+ var STORAGE_PREFIX$1 = "dominevo.deviceValuePicker.recent.";
17553
17569
  function read$1(key) {
17554
17570
  try {
17555
17571
  const raw = JSON.parse(window.localStorage.getItem(STORAGE_PREFIX$1 + key) ?? "[]");
@@ -18720,7 +18736,7 @@ function ConfigNotificationTargetSelectFieldView({ field, value, onChange, disab
18720
18736
  * dynamic dispatch, so the implementation must validate / cast).
18721
18737
  * - `value`, `onChange`, `disabled` — same as built-in fields.
18722
18738
  */
18723
- var CustomFieldRenderersContext = createSharedContext("camstack:custom-field-renderers", {});
18739
+ var CustomFieldRenderersContext = createSharedContext("dominevo:custom-field-renderers", {});
18724
18740
  function CustomFieldRenderersProvider({ renderers, children }) {
18725
18741
  return /* @__PURE__ */ jsx(CustomFieldRenderersContext.Provider, {
18726
18742
  value: renderers,
@@ -19058,7 +19074,7 @@ function SecretPresenceField({ field, values }) {
19058
19074
  * stopping there keeps the event from reaching the `window` Escape listener
19059
19075
  * of whatever modal is underneath: one Escape closes ONE dialog.
19060
19076
  */
19061
- var ConfirmContext = createSharedContext("camstack:confirm-dialog", null);
19077
+ var ConfirmContext = createSharedContext("dominevo:confirm-dialog", null);
19062
19078
  function useDialogContext$1() {
19063
19079
  const ctx = useContext(ConfirmContext);
19064
19080
  if (!ctx) throw new Error("useConfirm must be used within ConfirmDialogProvider");
@@ -19264,7 +19280,7 @@ function DialogSurface({ state, onClose }) {
19264
19280
  accept();
19265
19281
  }, [accept]);
19266
19282
  const style = VARIANT_STYLES$1[variantOf(state)];
19267
- const titleId = "camstack-dialog-title";
19283
+ const titleId = "dominevo-dialog-title";
19268
19284
  const body = state.kind === "prompt" ? /* @__PURE__ */ jsx(PromptBody, {
19269
19285
  options: state.options,
19270
19286
  value,
@@ -19337,7 +19353,7 @@ function DialogSurface({ state, onClose }) {
19337
19353
  function PromptBody({ options, value, error, inputRef, onChange }) {
19338
19354
  const readOnly = options.readOnly === true;
19339
19355
  const isPassword = !readOnly && options.inputType === "password";
19340
- const inputId = "camstack-dialog-input";
19356
+ const inputId = "dominevo-dialog-input";
19341
19357
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [
19342
19358
  options.message !== void 0 && /* @__PURE__ */ jsx("p", {
19343
19359
  className: "mt-2 max-h-48 overflow-y-auto text-xs text-foreground-subtle leading-relaxed whitespace-pre-line",
@@ -19391,7 +19407,7 @@ function PromptBody({ options, value, error, inputRef, onChange }) {
19391
19407
  * mounted in subtrees that don't carry the snapshot — they fall back
19392
19408
  * to their own query in that case.
19393
19409
  */
19394
- var DeviceContext = createSharedContext("camstack:device-context", null);
19410
+ var DeviceContext = createSharedContext("dominevo:device-context", null);
19395
19411
  function DeviceContextProvider({ deviceId, device, children }) {
19396
19412
  const value = {
19397
19413
  deviceId,
@@ -23193,7 +23209,7 @@ setGlobalFederationConstructor(ModuleFederation);
23193
23209
  * - npm packages (react, react-dom, @tanstack/react-query, @trpc/*)
23194
23210
  * are read off the bundler's import graph via namespace imports.
23195
23211
  * - workspace packages (`@dominevo/{ui-library,sdk,types}`) come off
23196
- * `window.__camstack{UiLibrary,Sdk,Types}` globals set by
23212
+ * `window.__dominevo{UiLibrary,Sdk,Types}` globals set by
23197
23213
  * `addon-admin-ui/src/main.tsx` to avoid double-bundling them here.
23198
23214
  *
23199
23215
  * The runtime `init({ shared: ... })` call is still required so that
@@ -23245,9 +23261,9 @@ function populateShareCache() {
23245
23261
  cache.share["@tanstack/react-query"] ??= __mfHostTanstackQuery;
23246
23262
  cache.share["@trpc/client"] ??= __mfHostTrpcClient;
23247
23263
  cache.share["@trpc/react-query"] ??= __mfHostTrpcReactQuery;
23248
- cache.share["@dominevo/ui-library"] ??= readHostGlobal("__camstackUiLibrary");
23249
- cache.share["@dominevo/sdk"] ??= readHostGlobal("__camstackSdk");
23250
- cache.share["@dominevo/types"] ??= readHostGlobal("__camstackTypes");
23264
+ cache.share["@dominevo/ui-library"] ??= readHostGlobal("__dominevoUiLibrary");
23265
+ cache.share["@dominevo/sdk"] ??= readHostGlobal("__dominevoSdk");
23266
+ cache.share["@dominevo/types"] ??= readHostGlobal("__dominevoTypes");
23251
23267
  }
23252
23268
  var lazyNpmShared = (importFn) => ({
23253
23269
  version: "0.0.0",
@@ -23281,9 +23297,9 @@ function ensureMfHostInit() {
23281
23297
  "@trpc/react-query": npmShared(() => __mfHostTrpcReactQuery),
23282
23298
  "react-konva": lazyNpmShared(() => import("react-konva")),
23283
23299
  konva: lazyNpmShared(() => import("konva")),
23284
- "@dominevo/ui-library": npmShared(() => readHostGlobal("__camstackUiLibrary")),
23285
- "@dominevo/sdk": npmShared(() => readHostGlobal("__camstackSdk")),
23286
- "@dominevo/types": npmShared(() => readHostGlobal("__camstackTypes"))
23300
+ "@dominevo/ui-library": npmShared(() => readHostGlobal("__dominevoUiLibrary")),
23301
+ "@dominevo/sdk": npmShared(() => readHostGlobal("__dominevoSdk")),
23302
+ "@dominevo/types": npmShared(() => readHostGlobal("__dominevoTypes"))
23287
23303
  }
23288
23304
  });
23289
23305
  }
@@ -23293,13 +23309,13 @@ function ensureMfHostInit() {
23293
23309
  * Where the hub is, from inside a page the hub served.
23294
23310
  *
23295
23311
  * The admin UI is not always at the hub's root. The Home Assistant component
23296
- * frames it through a same-origin relay — `https://<ha>/api/camstack/p/<grant>/…`
23312
+ * frames it through a same-origin relay — `https://<ha>/api/dominevo/p/<grant>/…`
23297
23313
  * → `https://<hub>:4443/…` — so the browser never has to trust the hub's
23298
23314
  * local certificate. The relay sends `X-Forwarded-Prefix` and the hub
23299
23315
  * injects two things into the shell it serves for that request:
23300
23316
  *
23301
23317
  * <base href="<prefix>/">
23302
- * <meta name="camstack-mount" content="<prefix>/">
23318
+ * <meta name="dominevo-mount" content="<prefix>/">
23303
23319
  *
23304
23320
  * This module is the ONE reader of that fact. Every URL the page composes
23305
23321
  * toward the hub — tRPC HTTP and WS, `/api/webrtc`, `/addon/…` data planes,
@@ -23323,7 +23339,7 @@ function ensureMfHostInit() {
23323
23339
  * `scripts/check-hub-paths-through-mount.ts` keeps every other module from
23324
23340
  * spelling a hub path directly.
23325
23341
  */
23326
- var MOUNT_META_NAME = "camstack-mount";
23342
+ var MOUNT_META_NAME = "dominevo-mount";
23327
23343
  /** A clean absolute path: no scheme, no `//`, no `..`, no query. */
23328
23344
  var MOUNT_PATH_RE = /^\/(?:[A-Za-z0-9_\-.]+\/)*$/;
23329
23345
  var resolvedMount = null;
@@ -23417,7 +23433,7 @@ function resetHubMountForTests() {
23417
23433
  * Why MF instead of raw ESM:
23418
23434
  * - automatic dedup of shared deps (react/react-dom/@tanstack/etc.)
23419
23435
  * against the host's instances — no more hand-rolled vendor stubs +
23420
- * importmap shims pointing at `window.__camstack*` globals.
23436
+ * importmap shims pointing at `window.__dominevo*` globals.
23421
23437
  * - version negotiation (we pin `singleton: true` everywhere; the host
23422
23438
  * wins by default).
23423
23439
  * - cross-bundle context invariant preserved automatically: every
@@ -23431,7 +23447,7 @@ function resetHubMountForTests() {
23431
23447
  * Cache resilience — same `staleTime: 0` + `refetchOnMount` + boot-
23432
23448
  * window poll fallback as `AppLayout`'s addon-pages query.
23433
23449
  */
23434
- var WidgetRegistryContext = createSharedContext("camstack:widget-registry", null);
23450
+ var WidgetRegistryContext = createSharedContext("dominevo:widget-registry", null);
23435
23451
  /**
23436
23452
  * Process-global cache for resolved remote bundles, keyed by
23437
23453
  * `<remoteName>::<exposedModule>`. Each cached value is the exposed
@@ -24517,7 +24533,7 @@ function useDevice(deviceId) {
24517
24533
  *
24518
24534
  * Returns the same URL the viewer uses: `/addon/snapshot/media/<id>.jpg?w=<n>`,
24519
24535
  * served by the wrapper over the HTTP data plane. Relative and same-origin, so
24520
- * the admin UI's `camstack_session` cookie authenticates it — the endpoint is
24536
+ * the admin UI's `dominevo_session` cookie authenticates it — the endpoint is
24521
24537
  * `access: 'authenticated'`, which accepts either a Bearer header or that
24522
24538
  * cookie, and a bare `<img>` can only send the cookie. This is the same
24523
24539
  * mechanism the native `<video>` fallback in `hls-video.tsx` already relies on.
@@ -25866,7 +25882,7 @@ function EmptyState({ icon: Icon, title, description, action, className }) {
25866
25882
  * The chart family's colours — theme tokens only.
25867
25883
  *
25868
25884
  * Categorical identity comes from the eight `--color-chart-series-*` tokens in
25869
- * `tailwind/camstack-theme.css`, in FIXED order (a blue, b magenta, c yellow,
25885
+ * `tailwind/dominevo-theme.css`, in FIXED order (a blue, b magenta, c yellow,
25870
25886
  * d aqua, e orange, f violet, g green, h red). A series keeps its slot for as
25871
25887
  * long as it is on screen: the caller assigns the index, never the rank, so a
25872
25888
  * filter that hides one series does not repaint the others.
@@ -25958,7 +25974,7 @@ function withAlpha(color, alpha) {
25958
25974
  }
25959
25975
  //#endregion
25960
25976
  //#region src/composites/charts/chart-frame.tsx
25961
- function ChartFrame({ title, actions, readoutTime, legend, summary, footer, placeholder, controls, className, children }) {
25977
+ function ChartFrame({ title, hideTitle = false, actions, readoutTime, legend, summary, footer, placeholder, controls, className, children }) {
25962
25978
  const single = legend.length === 1 ? legend[0] : void 0;
25963
25979
  return /* @__PURE__ */ jsxs("figure", {
25964
25980
  className: cn("min-w-0 m-0", className),
@@ -25967,7 +25983,7 @@ function ChartFrame({ title, actions, readoutTime, legend, summary, footer, plac
25967
25983
  /* @__PURE__ */ jsxs("div", {
25968
25984
  className: "flex items-baseline justify-between gap-2 mb-1 min-w-0",
25969
25985
  children: [/* @__PURE__ */ jsx("figcaption", {
25970
- className: cn("text-[10px] tracking-wider text-foreground-subtle truncate min-w-0", unitDimension(title) === void 0 ? "uppercase" : "normal-case"),
25986
+ className: cn("text-[10px] tracking-wider text-foreground-subtle truncate min-w-0", hideTitle && "sr-only", unitDimension(title) === void 0 ? "uppercase" : "normal-case"),
25971
25987
  children: title
25972
25988
  }), /* @__PURE__ */ jsxs("div", {
25973
25989
  className: "flex items-center gap-2 shrink-0",
@@ -27978,7 +27994,7 @@ function zoomLabel(spanMs) {
27978
27994
  * ## What it does NOT take from the recording timeline
27979
27995
  *
27980
27996
  * `CoverageTrack` stays behind. There it is the seek surface — a click drives
27981
- * the hero player through the `camstack-control` channel or an HLS VOD
27997
+ * the hero player through the `dominevo-control` channel or an HLS VOD
27982
27998
  * request. A copy here would either be a dead bar or a SECOND thing claiming
27983
27999
  * to move the playhead, and two components holding two ideas of the same
27984
28000
  * position is the defect this repo keeps paying for. The clips section plays a
@@ -28068,7 +28084,7 @@ function ClipBandBar({ day, onDayChange, view, dayBounds, onViewChange, buckets,
28068
28084
  * outside a provider get the inert default (no-op), so a StreamPanel mounted
28069
28085
  * on a page without the Recording widget stays live-only without crashing.
28070
28086
  */
28071
- var VodPlaybackContext = createSharedContext("camstack:vod-playback", {
28087
+ var VodPlaybackContext = createSharedContext("dominevo:vod-playback", {
28072
28088
  request: null,
28073
28089
  play: () => {},
28074
28090
  clear: () => {}
@@ -28316,9 +28332,9 @@ function describeRefusal(headers, t = defaultUiText) {
28316
28332
  *
28317
28333
  * ## Three headers, one of which decides everything (D563)
28318
28334
  *
28319
- * `x-camstack-reason-code` is the token the tile keys its words on,
28320
- * `x-camstack-reason` is the camera's own prose, and
28321
- * `x-camstack-disposition` says whether to come back. This module reads them;
28335
+ * `x-dominevo-reason-code` is the token the tile keys its words on,
28336
+ * `x-dominevo-reason` is the camera's own prose, and
28337
+ * `x-dominevo-disposition` says whether to come back. This module reads them;
28322
28338
  * it does not classify them. A response with no disposition — every
28323
28339
  * provider-reolink build before D563 — is FINAL, which is precisely the
28324
28340
  * behaviour that shipped.
@@ -28396,7 +28412,7 @@ function planStillRetry(input) {
28396
28412
  *
28397
28413
  * The picture is resolved by `resolveTileMedia` — vouched JPEG, an offer, or
28398
28414
  * the reason there is none (D549 decision 5). An offer is fetched rather than
28399
- * dropped into an `<img src>`, because the route's **204 + x-camstack-reason**
28415
+ * dropped into an `<img src>`, because the route's **204 + x-dominevo-reason**
28400
28416
  * is invisible to an `<img>`: it fires `onerror` with nothing to say. The
28401
28417
  * refusal is LATCHED for the life of the tile and never retried behind the
28402
28418
  * operator's back.
@@ -28901,7 +28917,7 @@ function resolveClipsView(input, t = defaultUiText) {
28901
28917
  * configuration that lives somewhere else. The operator put it exactly:
28902
28918
  * *"non è affatto necessario lo stato di abilitato o meno delle sources. Loro
28903
28919
  * vivono lì, ad esempio hksv c'è se la camera è esportata su homekit, reolink
28904
- * la dà di suo così come il camstack."* [the enabled-or-not state of the sources is not necessary at all. They live there, for example hksv is there if the camera is exported to homekit, reolink provides it on its own, as does camstack.] HKSV is there if the camera is
28920
+ * la dà di suo così come il dominevo."* [the enabled-or-not state of the sources is not necessary at all. They live there, for example hksv is there if the camera is exported to homekit, reolink provides it on its own, as does dominevo.] HKSV is there if the camera is
28905
28921
  * exported to HomeKit; the Reolink source is there because Reolink is that
28906
28922
  * camera's provider; Dominevo's is always there. None of that is a decision to
28907
28923
  * make in a clips list, so this surface offers no switch and writes no
@@ -32895,7 +32911,7 @@ function parseRecordedServerMessage(raw) {
32895
32911
  //#region src/contexts/recorded-playback.tsx
32896
32912
  /**
32897
32913
  * RecordedPlayback — shared context wiring the hero player's
32898
- * `camstack-control` RTCDataChannel to the Recording timeline (R9).
32914
+ * `dominevo-control` RTCDataChannel to the Recording timeline (R9).
32899
32915
  *
32900
32916
  * The hero `StreamPanel` (host side) BINDS the channel that
32901
32917
  * `CameraStreamPlayer` opens on the live WebRTC session; the Recording
@@ -32906,7 +32922,7 @@ function parseRecordedServerMessage(raw) {
32906
32922
  * server's playback state + ~1 Hz position reports.
32907
32923
  *
32908
32924
  * This is the admin-ui port of the shipped viewer's default recorded path
32909
- * (srcV2 → embed → `camstack-control`), replacing "manifest-window HLS only".
32925
+ * (srcV2 → embed → `dominevo-control`), replacing "manifest-window HLS only".
32910
32926
  * The HLS VOD path (VodPlayback context) remains available as a fallback.
32911
32927
  *
32912
32928
  * Built on `createSharedContext` (NOT a plain `createContext`) so it crosses
@@ -32915,7 +32931,7 @@ function parseRecordedServerMessage(raw) {
32915
32931
  * is null (StreamPanel then opens NO datachannel — plain live player) and
32916
32932
  * `channelOpen` is false (RecordingTimeline stays on the HLS path).
32917
32933
  */
32918
- var RecordedPlaybackContext = createSharedContext("camstack:recorded-playback", {
32934
+ var RecordedPlaybackContext = createSharedContext("dominevo:recorded-playback", {
32919
32935
  bindControlChannel: null,
32920
32936
  channelOpen: false,
32921
32937
  mode: "live",
@@ -32993,7 +33009,7 @@ function useRecordedPlayback() {
32993
33009
  * Ported from the proven srcV2 viewer implementation
32994
33010
  * (camstack/srcV2/recording/scrub-controller.ts): the same throttle,
32995
33011
  * commit-dedupe, and live→recorded-bypass semantics, now driving the
32996
- * admin-ui `RecordingTimeline` through the `camstack-control` datachannel.
33012
+ * admin-ui `RecordingTimeline` through the `dominevo-control` datachannel.
32997
33013
  *
32998
33014
  * Two layers:
32999
33015
  * 1. Pure reducer + helpers (unit-tested, no React deps):
@@ -34087,7 +34103,7 @@ function RecordingTimeline({ deviceId, seekTo, onExportRange, onViewChange, dens
34087
34103
  const bucketMs = bucketMsForSpan(view.toMs - view.fromMs);
34088
34104
  const availabilityQuery = useRecordingGetAvailability({
34089
34105
  deviceId,
34090
- provider: RECORDING_SOURCE_CAMSTACK_ADDON,
34106
+ provider: RECORDING_SOURCE_DOMINEVO_ADDON,
34091
34107
  fromMs: view.fromMs,
34092
34108
  toMs: view.toMs
34093
34109
  });
@@ -34106,7 +34122,7 @@ function RecordingTimeline({ deviceId, seekTo, onExportRange, onViewChange, dens
34106
34122
  const [nowForCalendar] = useState(() => Date.now());
34107
34123
  const daysQuery = useRecordingGetDaysWithRecordings({
34108
34124
  deviceId,
34109
- provider: RECORDING_SOURCE_CAMSTACK_ADDON,
34125
+ provider: RECORDING_SOURCE_DOMINEVO_ADDON,
34110
34126
  fromMs: nowForCalendar - LATEST_LOOKBACK_MS,
34111
34127
  toMs: nowForCalendar,
34112
34128
  tzOffsetMinutes: -new Date(nowForCalendar).getTimezoneOffset()
@@ -34116,7 +34132,7 @@ function RecordingTimeline({ deviceId, seekTo, onExportRange, onViewChange, dens
34116
34132
  const latestDayWindow = useMemo(() => latestDayMs === null ? null : dayWindow(new Date(latestDayMs), latestDayMs + DAY_MS$4), [latestDayMs]);
34117
34133
  const latestAvailability = useRecordingGetAvailability({
34118
34134
  deviceId,
34119
- provider: RECORDING_SOURCE_CAMSTACK_ADDON,
34135
+ provider: RECORDING_SOURCE_DOMINEVO_ADDON,
34120
34136
  fromMs: latestDayWindow?.fromMs ?? 0,
34121
34137
  toMs: latestDayWindow?.toMs ?? 0
34122
34138
  }, { enabled: latestDayWindow !== null });
@@ -34204,7 +34220,7 @@ function RecordingTimeline({ deviceId, seekTo, onExportRange, onViewChange, dens
34204
34220
  try {
34205
34221
  const playback = await system.trpcClient.recording.getPlayback.query({
34206
34222
  deviceId,
34207
- provider: RECORDING_SOURCE_CAMSTACK_ADDON,
34223
+ provider: RECORDING_SOURCE_DOMINEVO_ADDON,
34208
34224
  fromMs,
34209
34225
  toMs
34210
34226
  });
@@ -34509,7 +34525,7 @@ function RecordingPanel({ deviceId }) {
34509
34525
  const toMs = useMemo(() => Date.now(), []);
34510
34526
  const availabilityQuery = useRecordingGetAvailability({
34511
34527
  deviceId,
34512
- provider: RECORDING_SOURCE_CAMSTACK_ADDON,
34528
+ provider: RECORDING_SOURCE_DOMINEVO_ADDON,
34513
34529
  fromMs: toMs - DAY_MS$3,
34514
34530
  toMs
34515
34531
  });
@@ -35972,7 +35988,7 @@ function TimezoneSelector({ value, onChange, disabled }) {
35972
35988
  * host supplies the picker here. Without one, `instance-select` still lists the existing instances
35973
35989
  * and lets the operator choose; it just cannot create.
35974
35990
  */
35975
- var InstancePickerSlotContext = createSharedContext("camstack:instance-picker-slot", null);
35991
+ var InstancePickerSlotContext = createSharedContext("dominevo:instance-picker-slot", null);
35976
35992
  function InstancePickerSlotProvider({ picker, children }) {
35977
35993
  return createElement(InstancePickerSlotContext.Provider, { value: picker }, children);
35978
35994
  }
@@ -38904,13 +38920,13 @@ function GroupedModelSelector({ catalog, value, onChange, disabled }) {
38904
38920
  //#endregion
38905
38921
  //#region src/composites/model-picker.tsx
38906
38922
  var PROVIDER_LABEL = {
38907
- camstack: "Dominevo",
38923
+ dominevo: "Dominevo",
38908
38924
  frigate: "plus catalog",
38909
38925
  scrypted: "plugin catalog",
38910
38926
  custom: "Custom"
38911
38927
  };
38912
38928
  function providerOf(model) {
38913
- return model.provider ?? "camstack";
38929
+ return model.provider ?? "dominevo";
38914
38930
  }
38915
38931
  /**
38916
38932
  * Shared model picker — the ONE model-selection control across the app.
@@ -38938,7 +38954,7 @@ function ModelPicker({ models, value, onChange, disabled, defaultModelId }) {
38938
38954
  const defaultProvider = useMemo(() => {
38939
38955
  const pinned = models.find((m) => m.id === value);
38940
38956
  return pinned ? providerOf(pinned) : void 0;
38941
- }, [models, value]) ?? (presentProviders.includes("camstack") ? "camstack" : presentProviders[0] ?? "camstack");
38957
+ }, [models, value]) ?? (presentProviders.includes("dominevo") ? "dominevo" : presentProviders[0] ?? "dominevo");
38942
38958
  const [provider, setProvider] = useState(defaultProvider);
38943
38959
  useEffect(() => {
38944
38960
  setProvider(defaultProvider);
@@ -40738,7 +40754,7 @@ var SWIPE_OPEN_FRACTION = .35;
40738
40754
  var SWIPE_HINT_DELAY_MS = 600;
40739
40755
  var SWIPE_HINT_HOLD_MS = 700;
40740
40756
  /** Set once the hint has played in this browser. */
40741
- var SWIPE_HINT_STORAGE_KEY = "camstack.swipe-actions.hint-seen";
40757
+ var SWIPE_HINT_STORAGE_KEY = "dominevo.swipe-actions.hint-seen";
40742
40758
  /** Storage can be blocked or absent; then the hint simply does not play. */
40743
40759
  function claimSwipeHint() {
40744
40760
  try {
@@ -42089,7 +42105,7 @@ function shouldUpgradeAfterProbe(mbps) {
42089
42105
  /**
42090
42106
  * An http(s) base — origin plus any path prefix, no trailing slash — or null
42091
42107
  * for anything that cannot serve the probe. The prefix is kept because a hub
42092
- * reached through a path-mounted relay (`https://<ha>/api/camstack/p/<g>`)
42108
+ * reached through a path-mounted relay (`https://<ha>/api/dominevo/p/<g>`)
42093
42109
  * serves `/adaptive-probe` UNDER that prefix; the bare origin is the relay.
42094
42110
  */
42095
42111
  function httpOrigin(value) {
@@ -42110,7 +42126,7 @@ function httpOrigin(value) {
42110
42126
  * `adaptive-probe.routes.ts`) and it is only true for the web viewer and the
42111
42127
  * iframe embed, both served by the hub. The NATIVE viewer loads this same
42112
42128
  * player from an asset bundled with the app (`useNativeEmbedSource` resolves
42113
- * `assets/embed/camstack-embed.html` through `Image.resolveAssetSource`), so
42129
+ * `assets/embed/dominevo-embed.html` through `Image.resolveAssetSource`), so
42114
42130
  * inside the WKWebView `window.location.origin` is `file://` — and
42115
42131
  * `file:///adaptive-probe` is not a request any hub can answer. The probe
42116
42132
  * therefore returned null on EVERY native connect, `downlinkMbps` was never
@@ -43716,7 +43732,7 @@ function CameraStreamPlayer({ serverUrl, streamKey, label, autoPlay = true, mute
43716
43732
  pc.addTransceiver("video", { direction: "recvonly" });
43717
43733
  pc.addTransceiver("audio", { direction: "recvonly" });
43718
43734
  if (onControlChannelRef.current) {
43719
- const control = pc.createDataChannel("camstack-control");
43735
+ const control = pc.createDataChannel("dominevo-control");
43720
43736
  control.addEventListener("message", (ev) => {
43721
43737
  if (isLandMessage(ev.data)) markLandRef.current();
43722
43738
  });
@@ -43898,7 +43914,7 @@ function CameraStreamPlayer({ serverUrl, streamKey, label, autoPlay = true, mute
43898
43914
  pc.addTransceiver("video", { direction: "recvonly" });
43899
43915
  pc.addTransceiver("audio", { direction: "recvonly" });
43900
43916
  if (onControlChannelRef.current) {
43901
- const control = pc.createDataChannel("camstack-control");
43917
+ const control = pc.createDataChannel("dominevo-control");
43902
43918
  control.addEventListener("message", (ev) => {
43903
43919
  if (isLandMessage(ev.data)) markLandRef.current();
43904
43920
  });
@@ -46271,7 +46287,7 @@ function EndpointTestCard({ loadServers }) {
46271
46287
  var DEFAULT_FRESH_TTL_MS = 5 * 6e4;
46272
46288
  /** Half of the shortest provider credential lifetime in the fleet (24 h). */
46273
46289
  var DEFAULT_STALE_CAP_MS = 720 * 6e4;
46274
- var DEFAULT_STORAGE_KEY = "camstack:turn-servers:v1";
46290
+ var DEFAULT_STORAGE_KEY = "dominevo:turn-servers:v1";
46275
46291
  function defaultStorage() {
46276
46292
  const g = globalThis;
46277
46293
  try {
@@ -48784,7 +48800,7 @@ function useDataTableFilter(rows, config, initialState = EMPTY_DATA_TABLE_FILTER
48784
48800
  * A mounted {@link DisplayPaletteProvider} paints the cluster's effective
48785
48801
  * palette instead. There is no second hex table here.
48786
48802
  */
48787
- var BUNDLED$1 = bundledCamstack();
48803
+ var BUNDLED$1 = bundledDominevo();
48788
48804
  /** Marks that are palette entries and not detection classes. */
48789
48805
  var MARK_IDS = new Set([
48790
48806
  "live",
@@ -48824,7 +48840,7 @@ function getClassColor(className, customColors, palette) {
48824
48840
  * Dominevo preset. Only `ready` replaces it. Callers that must say the
48825
48841
  * store was unreadable read {@link useDisplayPaletteView}.
48826
48842
  */
48827
- var BUNDLED = bundledCamstack();
48843
+ var BUNDLED = bundledDominevo();
48828
48844
  var DisplayPaletteContext = createContext({ status: "absent" });
48829
48845
  function DisplayPaletteProvider({ value, children }) {
48830
48846
  return /* @__PURE__ */ jsx(DisplayPaletteContext.Provider, {
@@ -50376,7 +50392,7 @@ function LoginForm({ onLogin, serverUrl, logoSrc, error: externalError, classNam
50376
50392
  }
50377
50393
  //#endregion
50378
50394
  //#region src/composites/dev-shell.tsx
50379
- var STORAGE_KEY$1 = "camstack_dev_token";
50395
+ var STORAGE_KEY$1 = "dominevo_dev_token";
50380
50396
  var DevShellContext = createContext(null);
50381
50397
  function useDevShell() {
50382
50398
  const ctx = useContext(DevShellContext);
@@ -50893,7 +50909,7 @@ function visibleLogColumns(input) {
50893
50909
  }
50894
50910
  //#endregion
50895
50911
  //#region src/hooks/use-log-stream-columns.ts
50896
- var STORAGE_KEY = "camstack.logStream.columns";
50912
+ var STORAGE_KEY = "dominevo.logStream.columns";
50897
50913
  function readStored$1() {
50898
50914
  try {
50899
50915
  return parseStoredLogColumns(localStorage.getItem(STORAGE_KEY));
@@ -50971,7 +50987,7 @@ function logExportQuery(selection, now) {
50971
50987
  return query.length > 0 ? `?${query}` : "";
50972
50988
  }
50973
50989
  function logExportFileName(now, zip = false) {
50974
- return `camstack-logs-${new Date(now).toISOString().replace(/[:.]/g, "-")}.${zip ? "zip" : "ndjson"}`;
50990
+ return `dominevo-logs-${new Date(now).toISOString().replace(/[:.]/g, "-")}.${zip ? "zip" : "ndjson"}`;
50975
50991
  }
50976
50992
  /** The stream's lock becomes the export's filters; an open level exports everything. */
50977
50993
  function logExportScopeOf(input) {
@@ -51029,7 +51045,7 @@ function initialExportSource(wanted, sources) {
51029
51045
  * the dialog says so.
51030
51046
  */
51031
51047
  /** The host's session token, as every admin-side data-plane fetch reads it. */
51032
- var ADMIN_TOKEN_STORAGE_KEY = "camstack_admin_token";
51048
+ var ADMIN_TOKEN_STORAGE_KEY = "dominevo_admin_token";
51033
51049
  async function defaultFetchBlob(url) {
51034
51050
  let token = null;
51035
51051
  try {
@@ -58771,7 +58787,7 @@ function useDeviceProviderLabelsWith(trpcClient, enabled) {
58771
58787
  * area pill updates `?section=` while the Notifications header still shows
58772
58788
  * "New rule" from a stale snapshot.
58773
58789
  */
58774
- var URL_QUERY_EVENT = "camstack:url-query";
58790
+ var URL_QUERY_EVENT = "dominevo:url-query";
58775
58791
  function readParam(key) {
58776
58792
  return new URLSearchParams(window.location.search).get(key);
58777
58793
  }
@@ -58787,7 +58803,7 @@ function writeParam(key, value) {
58787
58803
  window.history.replaceState(null, "", url);
58788
58804
  }
58789
58805
  /** Router-made entries keep their `state` option under `usr`. */
58790
- var FORM_OPEN_ROUTER_STATE = { camstackFormOpen: true };
58806
+ var FORM_OPEN_ROUTER_STATE = { dominevoFormOpen: true };
58791
58807
  function isRecord$4(value) {
58792
58808
  return typeof value === "object" && value !== null;
58793
58809
  }
@@ -58795,9 +58811,9 @@ function isRecord$4(value) {
58795
58811
  function isFormOpenEntry() {
58796
58812
  const state = window.history.state;
58797
58813
  if (!isRecord$4(state)) return false;
58798
- if (state["camstackFormOpen"] === true) return true;
58814
+ if (state["dominevoFormOpen"] === true) return true;
58799
58815
  const usr = state["usr"];
58800
- return isRecord$4(usr) && usr["camstackFormOpen"] === true;
58816
+ return isRecord$4(usr) && usr["dominevoFormOpen"] === true;
58801
58817
  }
58802
58818
  /**
58803
58819
  * Several params in ONE history write. `push` adds an entry (marked as an
@@ -58899,7 +58915,7 @@ function stateStyle(row, state) {
58899
58915
  if (row.kind === "boolean") return state === row.states[1] ? { token: chartSeriesStyle(base).token } : { token: "border" };
58900
58916
  return { token: chartSeriesStyle(base + Math.max(0, row.states.indexOf(state))).token };
58901
58917
  }
58902
- function StateTimeline({ title, rows, range, syncKey, reserveRightAxis, pending = false, emptyMessage, actions, className }) {
58918
+ function StateTimeline({ title, hideTitle = false, rows, range, syncKey, reserveRightAxis, pending = false, emptyMessage, actions, className }) {
58903
58919
  const t = useUiText();
58904
58920
  const [cursorT, setCursorT] = useState(null);
58905
58921
  const rowsRef = useRef(rows);
@@ -58995,7 +59011,7 @@ function StateTimeline({ title, rows, range, syncKey, reserveRightAxis, pending
58995
59011
  /* @__PURE__ */ jsxs("div", {
58996
59012
  className: "flex items-baseline justify-between gap-2 mb-1 min-w-0",
58997
59013
  children: [/* @__PURE__ */ jsx("figcaption", {
58998
- className: "text-[10px] uppercase tracking-wider text-foreground-subtle truncate min-w-0",
59014
+ className: cn("text-[10px] uppercase tracking-wider text-foreground-subtle truncate min-w-0", hideTitle && "sr-only"),
58999
59015
  children: title
59000
59016
  }), /* @__PURE__ */ jsxs("div", {
59001
59017
  className: "flex items-center gap-2 shrink-0",
@@ -59173,7 +59189,7 @@ function seriesTooltip(input) {
59173
59189
  onDataX: input.onDataX
59174
59190
  };
59175
59191
  }
59176
- function TimeSeriesChart({ title, series, bands = NO_BANDS, range, height = DEFAULT_HEIGHT, stacked = false, area = false, syncKey, reserveRightAxis, formatValue, displayPreference, axisFor, emptyMessage, pending = false, actions, footer, windowToggle, className }) {
59192
+ function TimeSeriesChart({ title, hideTitle = false, series, bands = NO_BANDS, range, height = DEFAULT_HEIGHT, stacked = false, area = false, syncKey, reserveRightAxis, formatValue, displayPreference, axisFor, emptyMessage, pending = false, actions, footer, windowToggle, className }) {
59177
59193
  const t = useUiText();
59178
59194
  const model = useMemo(() => buildTimeSeriesModel(series, stacked), [series, stacked]);
59179
59195
  const [cursorIdx, setCursorIdx] = useState(null);
@@ -59380,6 +59396,7 @@ function TimeSeriesChart({ title, series, bands = NO_BANDS, range, height = DEFA
59380
59396
  const sizeClass = height <= 64 ? "sm" : height <= 120 ? "md" : "lg";
59381
59397
  return /* @__PURE__ */ jsx(ChartFrame, {
59382
59398
  title,
59399
+ hideTitle,
59383
59400
  actions: toolbar,
59384
59401
  readoutTime,
59385
59402
  legend,
@@ -68343,468 +68360,242 @@ function quantityLabel(t, quantity) {
68343
68360
  case "aqi": return t("uiLibrary.sensorPie.quantity.aqi", "Air quality");
68344
68361
  }
68345
68362
  }
68346
- /**
68347
- * The layout of a sensor, or `null` when it is not drawn as a sensor card: no
68348
- * reading, or a row the operator can still set (a sensor with controls keeps the
68349
- * full hero card, which draws them).
68350
- */
68351
- function sensorLayoutOf(model) {
68352
- const gated = new Set(model.gated);
68353
- if (model.rows.some((row) => !gated.has(row.id) && row.controls.length > 0)) return null;
68354
- const all = model.measurements ?? (model.measurement === void 0 ? [] : [model.measurement]);
68355
- const [only, ...rest] = all;
68356
- if (only === void 0) return null;
68357
- if (rest.length === 0) return {
68358
- kind: "single",
68359
- measurement: only
68360
- };
68361
- return {
68362
- kind: all.length <= 6 ? "pie" : "grid",
68363
- shown: all
68364
- };
68363
+ //#endregion
68364
+ //#region src/composites/device-card/scenes/sensor/reading-colour.ts
68365
+ var PREFERRED_SLOT = {
68366
+ humidity: 0,
68367
+ voc: 1,
68368
+ illuminance: 2,
68369
+ co2: 3,
68370
+ temperature: 4,
68371
+ motion: 5,
68372
+ pm25: 6,
68373
+ pm10: 7,
68374
+ aqi: 6,
68375
+ power: 7,
68376
+ contact: 3,
68377
+ text: 5
68378
+ };
68379
+ /** The slot of each reading of a card, in order; all different while the palette lasts. */
68380
+ function assignReadingSlots(quantities) {
68381
+ const size = CHART_SERIES_TOKENS.length;
68382
+ const taken = /* @__PURE__ */ new Set();
68383
+ return quantities.map((quantity) => {
68384
+ let slot = PREFERRED_SLOT[quantity];
68385
+ for (let tried = 0; tried < size && taken.has(slot); tried += 1) slot = (slot + 1) % size;
68386
+ taken.add(slot);
68387
+ if (taken.size >= size) taken.clear();
68388
+ return slot;
68389
+ });
68390
+ }
68391
+ var SLOT_A = {
68392
+ wedge: "fill-chart-series-a/25 stroke-chart-series-a/60",
68393
+ wedgeSelected: "fill-chart-series-a/45 stroke-chart-series-a",
68394
+ tile: "bg-chart-series-a/10 border-chart-series-a/40",
68395
+ tileSelected: "bg-chart-series-a/25 border-chart-series-a"
68396
+ };
68397
+ /** Spelled out so Tailwind finds every class. */
68398
+ var SLOT_CLASSES = [
68399
+ SLOT_A,
68400
+ {
68401
+ wedge: "fill-chart-series-b/25 stroke-chart-series-b/60",
68402
+ wedgeSelected: "fill-chart-series-b/45 stroke-chart-series-b",
68403
+ tile: "bg-chart-series-b/10 border-chart-series-b/40",
68404
+ tileSelected: "bg-chart-series-b/25 border-chart-series-b"
68405
+ },
68406
+ {
68407
+ wedge: "fill-chart-series-c/25 stroke-chart-series-c/60",
68408
+ wedgeSelected: "fill-chart-series-c/45 stroke-chart-series-c",
68409
+ tile: "bg-chart-series-c/10 border-chart-series-c/40",
68410
+ tileSelected: "bg-chart-series-c/25 border-chart-series-c"
68411
+ },
68412
+ {
68413
+ wedge: "fill-chart-series-d/25 stroke-chart-series-d/60",
68414
+ wedgeSelected: "fill-chart-series-d/45 stroke-chart-series-d",
68415
+ tile: "bg-chart-series-d/10 border-chart-series-d/40",
68416
+ tileSelected: "bg-chart-series-d/25 border-chart-series-d"
68417
+ },
68418
+ {
68419
+ wedge: "fill-chart-series-e/25 stroke-chart-series-e/60",
68420
+ wedgeSelected: "fill-chart-series-e/45 stroke-chart-series-e",
68421
+ tile: "bg-chart-series-e/10 border-chart-series-e/40",
68422
+ tileSelected: "bg-chart-series-e/25 border-chart-series-e"
68423
+ },
68424
+ {
68425
+ wedge: "fill-chart-series-f/25 stroke-chart-series-f/60",
68426
+ wedgeSelected: "fill-chart-series-f/45 stroke-chart-series-f",
68427
+ tile: "bg-chart-series-f/10 border-chart-series-f/40",
68428
+ tileSelected: "bg-chart-series-f/25 border-chart-series-f"
68429
+ },
68430
+ {
68431
+ wedge: "fill-chart-series-g/25 stroke-chart-series-g/60",
68432
+ wedgeSelected: "fill-chart-series-g/45 stroke-chart-series-g",
68433
+ tile: "bg-chart-series-g/10 border-chart-series-g/40",
68434
+ tileSelected: "bg-chart-series-g/25 border-chart-series-g"
68435
+ },
68436
+ {
68437
+ wedge: "fill-chart-series-h/25 stroke-chart-series-h/60",
68438
+ wedgeSelected: "fill-chart-series-h/45 stroke-chart-series-h",
68439
+ tile: "bg-chart-series-h/10 border-chart-series-h/40",
68440
+ tileSelected: "bg-chart-series-h/25 border-chart-series-h"
68441
+ }
68442
+ ];
68443
+ /** The slot a reading wears: the card-assigned one, else its quantity's preferred one. */
68444
+ function readingSlot(reading) {
68445
+ return (reading.slot ?? PREFERRED_SLOT[reading.quantity]) % SLOT_CLASSES.length;
68365
68446
  }
68366
- var ACTIVE_TONES = new Set([
68367
- "primary",
68368
- "warning",
68369
- "danger"
68370
- ]);
68371
- function readingStateOf(m) {
68372
- if (!(m.reading !== null || !isNotReported(m.value))) return "empty";
68373
- return ACTIVE_TONES.has(m.tone) ? "active" : "idle";
68447
+ function readingClasses(reading) {
68448
+ return SLOT_CLASSES[readingSlot(reading)] ?? SLOT_A;
68374
68449
  }
68375
- /** How far from the centre a wedge's label sits, as a share of the radius. */
68376
- var LABEL_RADIUS_SHARE = .62;
68377
- var point = (deg, radius) => {
68378
- const rad = deg * Math.PI / 180;
68450
+ //#endregion
68451
+ //#region src/composites/device-card/connected/ReadingHistory.tsx
68452
+ /** The state series of a reading that is on/off rather than a number (no trend line). */
68453
+ var STATE_READING_HISTORY_KEY = {
68454
+ motion: "cap:motion.detected",
68455
+ contact: "cap:contact.entryOpen"
68456
+ };
68457
+ var CHART_HEIGHT = 120;
68458
+ /** One reading's last day, read through the device history. */
68459
+ function useReadingSeries(deviceId, seriesKey) {
68460
+ const { presence, list } = useDeviceSeriesList(deviceId);
68461
+ const info = list.status === "ok" ? list.data.find((s) => s.key === seriesKey && s.scope === "") : void 0;
68462
+ const to = anchorNow(Date.now(), HISTORY_WINDOW_MS["24h"]);
68463
+ const window = useMemo(() => ({
68464
+ from: to - HISTORY_WINDOW_MS["24h"],
68465
+ to
68466
+ }), [to]);
68467
+ const reads = useHistoryReads(useMemo(() => [{
68468
+ deviceId,
68469
+ key: seriesKey
68470
+ }], [deviceId, seriesKey]), window, false, presence === "present" && info !== void 0);
68471
+ const entry = reads.status === "ok" ? reads.data.current.get(readItemId({
68472
+ deviceId,
68473
+ key: seriesKey
68474
+ })) : void 0;
68379
68475
  return {
68380
- x: Number((100 + radius * Math.sin(rad)).toFixed(2)),
68381
- y: Number((100 - radius * Math.cos(rad)).toFixed(2))
68476
+ info,
68477
+ result: entry?.ok === true ? entry.result : void 0,
68478
+ window,
68479
+ phase: presence === "absent" || list.status === "ok" && info === void 0 ? "absent" : list.status === "error" || reads.status === "error" ? "error" : list.status === "pending" || reads.status === "pending" || presence !== "present" ? "pending" : "ok"
68382
68480
  };
68383
- };
68384
- /** `count` equal wedges starting at 12 o'clock, clockwise. */
68385
- function pieGeometry(count) {
68386
- const step = 360 / count;
68387
- return Array.from({ length: count }, (_, index) => {
68388
- const startDeg = index * step;
68389
- const endDeg = (index + 1) * step;
68390
- const from = point(startDeg, 96);
68391
- const to = point(endDeg, 96);
68392
- const large = step > 180 ? 1 : 0;
68393
- return {
68394
- index,
68395
- startDeg,
68396
- endDeg,
68397
- path: `M100 100 L${from.x} ${from.y} A96 96 0 ${large} 1 ${to.x} ${to.y} Z`,
68398
- centroid: point((startDeg + endDeg) / 2, 96 * LABEL_RADIUS_SHARE)
68399
- };
68481
+ }
68482
+ function NoHistory() {
68483
+ return /* @__PURE__ */ jsx("span", {
68484
+ className: "text-xs text-foreground-muted",
68485
+ "data-testid": "dc-pie-no-history",
68486
+ children: useUiText()("uiLibrary.sensorPie.noHistory", "No history is kept for this reading.")
68400
68487
  });
68401
68488
  }
68402
- //#endregion
68403
- //#region src/composites/device-card/scenes/sensor/ReadingTile.tsx
68404
- /** A tile's tint and edge: the quantity's theme token, the same one its pie wedge uses (literal classes, so Tailwind sees them). */
68405
- var TILE_TONE = {
68406
- temperature: "bg-danger/10 border-danger/40",
68407
- humidity: "bg-info/10 border-info/40",
68408
- illuminance: "bg-warning/10 border-warning/40",
68409
- power: "bg-primary/10 border-primary/40",
68410
- motion: "bg-chart-series-f/10 border-chart-series-f/40",
68411
- contact: "bg-success/10 border-success/40",
68412
- text: "bg-foreground-muted/10 border-foreground-muted/40",
68413
- co2: "bg-chart-series-a/10 border-chart-series-a/40",
68414
- voc: "bg-chart-series-b/10 border-chart-series-b/40",
68415
- pm25: "bg-chart-series-c/10 border-chart-series-c/40",
68416
- pm10: "bg-chart-series-e/10 border-chart-series-e/40",
68417
- aqi: "bg-chart-series-d/10 border-chart-series-d/40"
68418
- };
68419
- /** The selected tile: a stronger tint and a full-colour edge. */
68420
- var TILE_SELECTED = {
68421
- temperature: "bg-danger/25 border-danger",
68422
- humidity: "bg-info/25 border-info",
68423
- illuminance: "bg-warning/25 border-warning",
68424
- power: "bg-primary/25 border-primary",
68425
- motion: "bg-chart-series-f/25 border-chart-series-f",
68426
- contact: "bg-success/25 border-success",
68427
- text: "bg-foreground-muted/25 border-foreground-muted",
68428
- co2: "bg-chart-series-a/25 border-chart-series-a",
68429
- voc: "bg-chart-series-b/25 border-chart-series-b",
68430
- pm25: "bg-chart-series-c/25 border-chart-series-c",
68431
- pm10: "bg-chart-series-e/25 border-chart-series-e",
68432
- aqi: "bg-chart-series-d/25 border-chart-series-d"
68433
- };
68434
- /**
68435
- * One reading as a tile: its quantity's tint, value and unit big, the short name above,
68436
- * the single-reading card's own motion behind it and its last-day trend under it. A
68437
- * reading with no data is a dashed tile with a "—". The grid and the pie's legend draw it.
68438
- */
68439
- function ReadingTile({ reading, selected, dimmed, onSelect, testId }) {
68440
- return /* @__PURE__ */ jsxs("button", {
68441
- type: "button",
68442
- "data-testid": testId,
68443
- "data-quantity": reading.quantity,
68444
- "data-state": reading.state,
68445
- "data-selected": selected ? "true" : void 0,
68446
- "aria-pressed": selected,
68447
- "aria-label": `${reading.label} ${reading.value}${reading.unit === null ? "" : ` ${reading.unit}`}`,
68448
- onClick: () => onSelect?.(reading.id),
68449
- className: cn("relative isolate flex w-full min-w-0 cursor-pointer flex-col items-start gap-0.5 overflow-hidden rounded-lg border px-2.5 py-2 text-left transition-opacity", reading.state === "empty" ? "border-dashed border-foreground-subtle bg-surface" : selected ? TILE_SELECTED[reading.quantity] : TILE_TONE[reading.quantity], dimmed && "opacity-40"),
68450
- children: [
68451
- reading.visual == null ? null : /* @__PURE__ */ jsx(MeasurementFx, { visual: reading.visual }),
68452
- /* @__PURE__ */ jsx("span", {
68453
- className: "max-w-full truncate text-xs text-foreground-muted",
68454
- children: reading.label
68455
- }),
68456
- /* @__PURE__ */ jsxs("span", {
68457
- className: cn("max-w-full truncate text-lg font-semibold tabular-nums", reading.state === "empty" ? "text-foreground-muted" : "text-foreground"),
68458
- children: [reading.value, reading.unit === null ? null : /* @__PURE__ */ jsx("span", {
68459
- className: "ml-1 text-xs font-normal text-foreground-muted",
68460
- children: reading.unit
68461
- })]
68462
- }),
68463
- reading.trend ?? null
68464
- ]
68489
+ function HistoryError() {
68490
+ return /* @__PURE__ */ jsx("p", {
68491
+ className: "text-xs text-danger",
68492
+ "data-testid": "dc-pie-history-error",
68493
+ children: useUiText()("uiLibrary.deviceCard.energy.day.error", "The history could not be read.")
68465
68494
  });
68466
68495
  }
68467
- /** The columns a row of reading tiles holds: as many as the card's width fits (two on a phone). */
68468
- var READING_TILES_GRID = "grid w-full grid-cols-[repeat(auto-fit,minmax(6.5rem,1fr))] gap-2";
68469
- //#endregion
68470
- //#region src/composites/device-card/scenes/sensor/SensorGridCard.tsx
68471
68496
  /**
68472
- * A sensor with many readings (seven or more, past what a pie shows legibly): a
68473
- * grid of tiles, one per reading, as many columns as the card's width holds (two
68474
- * on a phone). Each tile is tinted by its quantity like a pie wedge: value and
68475
- * unit big, the short name under it; a reading with no data is a dashed tile with
68476
- * a "—". Tapping a tile highlights it (the others dim) and draws its history below
68477
- * the grid.
68497
+ * The compact "express" chart of the energy system card (`TimeSeriesChart`, one line,
68498
+ * no title) over one reading's last day, on the reading's own palette colour and in
68499
+ * the unit the card shows.
68478
68500
  */
68479
- function SensorGridCard({ model, actions, orientation = "vertical", showName = true, onSelect, selectedId = null, detail = null }) {
68480
- const lead = model.readings[0];
68481
- return /* @__PURE__ */ jsx(DeviceCard, {
68482
- kind: "sensor",
68483
- common: model.common,
68484
- orientation,
68485
- showName,
68486
- state: model.state,
68487
- activity: lead?.quantity ?? "sensor",
68488
- ...actions === void 0 ? {} : { actions },
68489
- scene: {
68490
- fx: null,
68491
- columns: {},
68492
- image: /* @__PURE__ */ jsxs("div", {
68493
- "data-testid": "dc-sensor-grid",
68494
- "data-tiles": model.readings.length,
68495
- className: "flex w-full flex-col gap-3",
68496
- children: [
68497
- model.updated === null ? null : /* @__PURE__ */ jsx("span", {
68498
- "data-testid": "dc-grid-updated",
68499
- className: "text-xs text-foreground-muted",
68500
- children: model.updated
68501
- }),
68502
- /* @__PURE__ */ jsx("ul", {
68503
- className: READING_TILES_GRID,
68504
- children: model.readings.map((reading) => /* @__PURE__ */ jsx("li", {
68505
- className: "min-w-0",
68506
- children: /* @__PURE__ */ jsx(ReadingTile, {
68507
- reading,
68508
- selected: reading.id === selectedId,
68509
- dimmed: selectedId !== null && reading.id !== selectedId,
68510
- onSelect,
68511
- testId: "dc-grid-tile"
68512
- })
68513
- }, reading.id))
68514
- }),
68515
- detail === null ? null : /* @__PURE__ */ jsx("div", {
68516
- "data-testid": "dc-grid-detail",
68517
- className: "flex w-full flex-col items-center gap-3",
68518
- children: detail
68519
- })
68520
- ]
68521
- })
68522
- }
68501
+ function ReadingChart({ deviceId, seriesKey, label, unit, slot }) {
68502
+ const t = useUiText();
68503
+ const { info, result, window, phase } = useReadingSeries(deviceId, seriesKey);
68504
+ const series = useMemo(() => {
68505
+ if (info === void 0) return [];
68506
+ const shaped = linePoints(info, result, window.from, Math.min(window.to, Date.now()));
68507
+ const base = info.unit;
68508
+ const shown = base !== null && unit !== null && chartUnitChoices(base).includes(unit) ? unit : base;
68509
+ return [{
68510
+ id: seriesKey,
68511
+ label,
68512
+ unit: shown,
68513
+ points: base !== null && shown !== null ? convertPoints(shaped.points, base, shown) : shaped.points,
68514
+ colorIndex: slot,
68515
+ gapMs: shaped.gapMs,
68516
+ interpolation: shaped.held ? "step" : "linear"
68517
+ }];
68518
+ }, [
68519
+ info,
68520
+ result,
68521
+ window,
68522
+ seriesKey,
68523
+ unit,
68524
+ label,
68525
+ slot
68526
+ ]);
68527
+ if (phase === "absent") return /* @__PURE__ */ jsx(NoHistory, {});
68528
+ if (phase === "error") return /* @__PURE__ */ jsx(HistoryError, {});
68529
+ if (phase === "pending") return /* @__PURE__ */ jsx(Skeleton, { className: "h-28 w-full" });
68530
+ return /* @__PURE__ */ jsx(TimeSeriesChart, {
68531
+ title: label,
68532
+ hideTitle: true,
68533
+ series,
68534
+ range: window,
68535
+ height: CHART_HEIGHT,
68536
+ className: "w-full",
68537
+ emptyMessage: t("uiLibrary.sensorPie.noHistory", "No history is kept for this reading.")
68523
68538
  });
68524
68539
  }
68525
- //#endregion
68526
- //#region src/composites/device-card/scenes/sensor/pie-css.ts
68527
68540
  /**
68528
- * The pie's motion: a breathing fill and one small animation per quantity, kept
68529
- * inside its wedge by a clip path. Colours come through `currentColor` / theme
68530
- * token classes on the elements; under `prefers-reduced-motion` nothing moves.
68541
+ * A state reading (motion, contact) as the library's one state band, in the reading's
68542
+ * own colour and with no title: the highlighted wedge or tile names it.
68531
68543
  */
68532
- var SENSOR_PIE_CSS = `
68533
- .dc-pie-wedge{outline:none}
68534
- .dc-pie-wedge:focus-visible>path{stroke-width:3}
68535
- .dc-pie-empty{stroke-dasharray:4 4}
68536
- .dc-pie-breathe{animation:dc-pie-breathe 2.8s ease-in-out infinite}
68537
- @keyframes dc-pie-breathe{0%,100%{fill-opacity:.55}50%{fill-opacity:1}}
68538
- .dc-pie-ring{transform-box:fill-box;transform-origin:center;stroke-width:1.4;opacity:0;animation:dc-pie-ring 2.4s ease-out infinite}
68539
- @keyframes dc-pie-ring{0%{transform:scale(.4);opacity:.7}100%{transform:scale(5);opacity:0}}
68540
- .dc-pie-drop{opacity:0;animation:dc-pie-drop 2s linear infinite}
68541
- @keyframes dc-pie-drop{0%{transform:translateY(0);opacity:0}20%,70%{opacity:.7}100%{transform:translateY(56px);opacity:0}}
68542
- .dc-pie-wisp{stroke-width:1.4;stroke-linecap:round;opacity:0;animation:dc-pie-wisp 2.2s ease-out infinite}
68543
- @keyframes dc-pie-wisp{0%{transform:translateY(0);opacity:0}30%{opacity:.7}100%{transform:translateY(-26px);opacity:0}}
68544
- .dc-pie-flow{stroke-width:1.6;stroke-dasharray:5 6;opacity:.7;animation:dc-pie-flow 1.2s linear infinite}
68545
- @keyframes dc-pie-flow{to{stroke-dashoffset:-11}}
68546
- .dc-pie-step-1{animation-delay:.6s}
68547
- .dc-pie-step-2{animation-delay:1.2s}
68548
- @media (prefers-reduced-motion:reduce){.dc-pie-breathe,.dc-pie-ring,.dc-pie-drop,.dc-pie-wisp,.dc-pie-flow{animation:none!important}.dc-pie-ring,.dc-pie-drop,.dc-pie-wisp{opacity:.35}}
68549
- `;
68550
- //#endregion
68551
- //#region src/composites/device-card/scenes/sensor/SensorPieCard.tsx
68552
- /**
68553
- * What tints a wedge and colours its edge: the quantity's theme token, ONE per
68554
- * quantity (literal classes, so Tailwind sees them). Motion takes the series
68555
- * violet because the brand orange reads as the warning amber next to it; the warm
68556
- * pair that remains (power, illuminance) rarely sits on one sensor.
68557
- */
68558
- var WEDGE_FILL = {
68559
- temperature: "fill-danger/25 stroke-danger/60",
68560
- humidity: "fill-info/25 stroke-info/60",
68561
- illuminance: "fill-warning/25 stroke-warning/60",
68562
- power: "fill-primary/25 stroke-primary/60",
68563
- motion: "fill-chart-series-f/25 stroke-chart-series-f/60",
68564
- contact: "fill-success/25 stroke-success/60",
68565
- text: "fill-foreground-muted/25 stroke-foreground-muted/60",
68566
- co2: "fill-chart-series-a/25 stroke-chart-series-a/60",
68567
- voc: "fill-chart-series-b/25 stroke-chart-series-b/60",
68568
- pm25: "fill-chart-series-c/25 stroke-chart-series-c/60",
68569
- pm10: "fill-chart-series-e/25 stroke-chart-series-e/60",
68570
- aqi: "fill-chart-series-d/25 stroke-chart-series-d/60"
68571
- };
68572
- /** The selected wedge: a stronger tint and a full-colour edge, still its own quantity's. */
68573
- var WEDGE_FILL_SELECTED = {
68574
- temperature: "fill-danger/45 stroke-danger",
68575
- humidity: "fill-info/45 stroke-info",
68576
- illuminance: "fill-warning/45 stroke-warning",
68577
- power: "fill-primary/45 stroke-primary",
68578
- motion: "fill-chart-series-f/45 stroke-chart-series-f",
68579
- contact: "fill-success/45 stroke-success",
68580
- text: "fill-foreground-muted/45 stroke-foreground-muted",
68581
- co2: "fill-chart-series-a/45 stroke-chart-series-a",
68582
- voc: "fill-chart-series-b/45 stroke-chart-series-b",
68583
- pm25: "fill-chart-series-c/45 stroke-chart-series-c",
68584
- pm10: "fill-chart-series-e/45 stroke-chart-series-e",
68585
- aqi: "fill-chart-series-d/45 stroke-chart-series-d"
68586
- };
68587
- /** Colours the quantity's motion (it draws in `currentColor`). */
68588
- var WEDGE_FX_TEXT = {
68589
- temperature: "text-danger",
68590
- humidity: "text-info",
68591
- illuminance: "text-warning",
68592
- power: "text-primary",
68593
- motion: "text-chart-series-f",
68594
- contact: "text-success",
68595
- text: "text-foreground-muted",
68596
- co2: "text-chart-series-a",
68597
- voc: "text-chart-series-b",
68598
- pm25: "text-chart-series-c",
68599
- pm10: "text-chart-series-e",
68600
- aqi: "text-chart-series-d"
68601
- };
68602
- /** The size of the value, so a word and a long number stay inside the wedge. */
68603
- function valueSizeClass(n, value) {
68604
- if (value.length > 6) return "text-[9px]";
68605
- if (n >= 5 || value.length > 4) return "text-[12px]";
68606
- return n >= 3 ? "text-[16px]" : "text-[20px]";
68607
- }
68608
- function onKey(handler) {
68609
- return (e) => {
68610
- if (e.key === "Enter" || e.key === " ") {
68611
- e.preventDefault();
68612
- handler();
68613
- }
68614
- };
68615
- }
68616
- /** The quantity's motion, drawn inside the clipped wedge. */
68617
- function WedgeFx({ quantity, at }) {
68618
- switch (quantity) {
68619
- case "motion": return /* @__PURE__ */ jsx("g", {
68620
- "data-fx": "rings",
68621
- className: "dc-pie-fx",
68622
- children: [
68623
- 0,
68624
- 1,
68625
- 2
68626
- ].map((i) => /* @__PURE__ */ jsx("circle", {
68627
- cx: at.x,
68628
- cy: at.y,
68629
- r: 8,
68630
- className: cn("dc-pie-ring fill-none stroke-current", `dc-pie-step-${String(i)}`)
68631
- }, i))
68632
- });
68633
- case "humidity": return /* @__PURE__ */ jsx("g", {
68634
- "data-fx": "drops",
68635
- className: "dc-pie-fx",
68636
- children: [
68637
- -14,
68638
- 0,
68639
- 14
68640
- ].map((dx, i) => /* @__PURE__ */ jsx("ellipse", {
68641
- cx: at.x + dx,
68642
- cy: at.y - 26,
68643
- rx: 1.6,
68644
- ry: 3.2,
68645
- className: cn("dc-pie-drop fill-current", `dc-pie-step-${String(i)}`)
68646
- }, dx))
68647
- });
68648
- case "temperature": return /* @__PURE__ */ jsx("g", {
68649
- "data-fx": "wisps",
68650
- className: "dc-pie-fx",
68651
- children: [
68652
- -12,
68653
- 0,
68654
- 12
68655
- ].map((dx, i) => /* @__PURE__ */ jsx("path", {
68656
- d: `M${String(at.x + dx)} ${String(at.y + 24)} q4 -6 0 -12`,
68657
- className: cn("dc-pie-wisp fill-none stroke-current", `dc-pie-step-${String(i)}`)
68658
- }, dx))
68659
- });
68660
- case "power": return /* @__PURE__ */ jsx("g", {
68661
- "data-fx": "flow",
68662
- className: "dc-pie-fx",
68663
- children: /* @__PURE__ */ jsx("line", {
68664
- x1: 100,
68665
- y1: 100,
68666
- x2: at.x,
68667
- y2: at.y,
68668
- className: "dc-pie-flow stroke-current"
68669
- })
68670
- });
68671
- default: return null;
68672
- }
68673
- }
68674
- function Wedge({ wedge, count, reading, clipId, selected, dimmed, onSelect }) {
68675
- const { centroid: at } = wedge;
68676
- const tap = () => onSelect?.(reading.id);
68677
- return /* @__PURE__ */ jsxs("g", {
68678
- "data-testid": "dc-pie-wedge",
68679
- "data-quantity": reading.quantity,
68680
- "data-state": reading.state,
68681
- "data-selected": selected ? "true" : void 0,
68682
- role: "button",
68683
- "aria-pressed": selected,
68684
- tabIndex: 0,
68685
- "aria-label": `${reading.label} ${reading.value}${reading.unit === null ? "" : ` ${reading.unit}`}`,
68686
- className: cn("dc-pie-wedge cursor-pointer transition-opacity", WEDGE_FX_TEXT[reading.quantity], dimmed && "opacity-40"),
68687
- onClick: tap,
68688
- onKeyDown: onKey(tap),
68689
- children: [
68690
- /* @__PURE__ */ jsx("clipPath", {
68691
- id: clipId,
68692
- children: /* @__PURE__ */ jsx("path", { d: wedge.path })
68693
- }),
68694
- /* @__PURE__ */ jsx("path", {
68695
- d: wedge.path,
68696
- className: cn(reading.state === "empty" ? "fill-surface stroke-foreground-subtle dc-pie-empty" : selected ? WEDGE_FILL_SELECTED[reading.quantity] : WEDGE_FILL[reading.quantity], reading.state === "active" && "dc-pie-breathe"),
68697
- strokeWidth: selected ? 3 : 1.5
68698
- }),
68699
- reading.state === "active" ? /* @__PURE__ */ jsx("g", {
68700
- clipPath: `url(#${clipId})`,
68701
- children: /* @__PURE__ */ jsx(WedgeFx, {
68702
- quantity: reading.quantity,
68703
- at
68704
- })
68705
- }) : null,
68706
- /* @__PURE__ */ jsxs("text", {
68707
- x: at.x,
68708
- y: at.y - 2,
68709
- textAnchor: "middle",
68710
- className: cn("font-semibold tabular-nums", reading.state === "empty" ? "fill-foreground-muted" : "fill-foreground", valueSizeClass(count, reading.value)),
68711
- children: [reading.value, reading.unit === null ? null : /* @__PURE__ */ jsx("tspan", {
68712
- dx: 1.5,
68713
- className: "fill-foreground-muted text-[8px] font-normal",
68714
- children: reading.unit
68715
- })]
68716
- }),
68717
- /* @__PURE__ */ jsx("text", {
68718
- x: at.x,
68719
- y: at.y + 10,
68720
- textAnchor: "middle",
68721
- className: "fill-foreground-muted text-[8px]",
68722
- children: reading.label
68723
- })
68724
- ]
68544
+ function ReadingStateChart({ deviceId, seriesKey, label, slot }) {
68545
+ const t = useUiText();
68546
+ const { info, result, window, phase } = useReadingSeries(deviceId, seriesKey);
68547
+ if (phase === "pending") return /* @__PURE__ */ jsx(Skeleton, { className: "h-16 w-full" });
68548
+ if (phase === "error") return /* @__PURE__ */ jsx(HistoryError, {});
68549
+ if (phase === "absent" || info === void 0) return /* @__PURE__ */ jsx(NoHistory, {});
68550
+ const row = stateRow(info, result, window.from, window.to);
68551
+ const labels = booleanLabels(seriesKey, t);
68552
+ return /* @__PURE__ */ jsx(StateTimeline, {
68553
+ title: label,
68554
+ hideTitle: true,
68555
+ range: window,
68556
+ className: "w-full",
68557
+ emptyMessage: t("uiLibrary.sensorPie.noHistory", "No history is kept for this reading."),
68558
+ rows: [{
68559
+ id: seriesKey,
68560
+ label,
68561
+ kind: info.kind === "boolean" ? "boolean" : "enum",
68562
+ states: row.states,
68563
+ segments: row.segments,
68564
+ totals: row.totals,
68565
+ colorIndex: slot,
68566
+ stateLabel: info.kind === "boolean" ? (s) => s === "true" ? labels.on : labels.off : void 0
68567
+ }]
68725
68568
  });
68726
68569
  }
68727
68570
  /**
68728
- * A sensor with several readings: a pie of equal wedges from 12 o'clock, each
68729
- * tinted by its quantity, its value, unit and short name at the wedge's centre. A
68730
- * reading that is on or alarming breathes, with its quantity's motion clipped
68731
- * inside the wedge; one with no data is a dashed wedge with a "—". Under the pie each
68732
- * reading is also a `ReadingTile` (its motion and trend, as in the grid). Tapping a
68733
- * wedge or a tile highlights it (the others dim) and draws its history below the pie. Seven or more readings are `SensorGridCard`.
68571
+ * One reading's last day, under the card: no title (the highlighted wedge or tile
68572
+ * names it), the axis in the unit the reading is shown in, the line in the reading's
68573
+ * own colour. A state reading (motion, contact) is one state band of ITS
68574
+ * series, never the device's whole History.
68734
68575
  */
68735
- function SensorPieCard({ model, actions, orientation = "vertical", showName = true, onSelect, selectedId = null, detail = null }) {
68736
- const uid = useId();
68737
- const count = model.readings.length;
68738
- const wedges = pieGeometry(count);
68739
- const lead = model.readings[0];
68740
- return /* @__PURE__ */ jsx(DeviceCard, {
68741
- kind: "sensor",
68742
- common: model.common,
68743
- orientation,
68744
- showName,
68745
- state: model.state,
68746
- activity: lead?.quantity ?? "sensor",
68747
- ...actions === void 0 ? {} : { actions },
68748
- scene: {
68749
- fx: null,
68750
- columns: {},
68751
- image: /* @__PURE__ */ jsxs("div", {
68752
- "data-testid": "dc-sensor-pie",
68753
- "data-wedges": count,
68754
- className: "relative flex w-full flex-col items-center justify-center gap-3",
68755
- children: [
68756
- /* @__PURE__ */ jsx("style", { children: SENSOR_PIE_CSS }),
68757
- model.updated === null ? null : /* @__PURE__ */ jsx("span", {
68758
- "data-testid": "dc-pie-updated",
68759
- className: "absolute left-0 top-0 text-xs text-foreground-muted",
68760
- children: model.updated
68761
- }),
68762
- /* @__PURE__ */ jsxs("svg", {
68763
- viewBox: "0 0 200 200",
68764
- role: "group",
68765
- "aria-label": model.common.name,
68766
- className: "aspect-square w-full max-w-72",
68767
- children: [/* @__PURE__ */ jsx("circle", {
68768
- cx: 100,
68769
- cy: 100,
68770
- r: 98,
68771
- className: "fill-surface stroke-border",
68772
- strokeWidth: 1
68773
- }), model.readings.map((reading, i) => {
68774
- const wedge = wedges[i];
68775
- return wedge === void 0 ? null : /* @__PURE__ */ jsx(Wedge, {
68776
- wedge,
68777
- count,
68778
- reading,
68779
- clipId: `${uid}-w${String(i)}`,
68780
- selected: reading.id === selectedId,
68781
- dimmed: selectedId !== null && reading.id !== selectedId,
68782
- onSelect
68783
- }, reading.id);
68784
- })]
68785
- }),
68786
- /* @__PURE__ */ jsx("ul", {
68787
- className: READING_TILES_GRID,
68788
- "data-testid": "dc-pie-legend",
68789
- children: model.readings.map((reading) => /* @__PURE__ */ jsx("li", {
68790
- className: "min-w-0",
68791
- children: /* @__PURE__ */ jsx(ReadingTile, {
68792
- reading,
68793
- selected: reading.id === selectedId,
68794
- dimmed: selectedId !== null && reading.id !== selectedId,
68795
- onSelect,
68796
- testId: "dc-pie-tile"
68797
- })
68798
- }, reading.id))
68799
- }),
68800
- detail === null ? null : /* @__PURE__ */ jsx("div", {
68801
- "data-testid": "dc-pie-detail",
68802
- className: "flex w-full flex-col items-center gap-3",
68803
- children: detail
68804
- })
68805
- ]
68806
- })
68807
- }
68576
+ function ReadingHistory({ deviceId, measurement, since, unit = null, slot }) {
68577
+ const label = quantityLabel(useUiText(), measurement.quantity);
68578
+ const stateKey = STATE_READING_HISTORY_KEY[measurement.quantity];
68579
+ const colour = slot ?? readingSlot(measurement);
68580
+ const body = measurement.historyKey !== null ? /* @__PURE__ */ jsx(ReadingChart, {
68581
+ deviceId,
68582
+ seriesKey: measurement.historyKey,
68583
+ label,
68584
+ unit,
68585
+ slot: colour
68586
+ }) : stateKey !== void 0 ? /* @__PURE__ */ jsx(ReadingStateChart, {
68587
+ deviceId,
68588
+ seriesKey: stateKey,
68589
+ label,
68590
+ slot: colour
68591
+ }) : /* @__PURE__ */ jsx(NoHistory, {});
68592
+ return /* @__PURE__ */ jsxs("div", {
68593
+ className: "flex w-full flex-col items-center gap-2",
68594
+ "data-testid": "dc-pie-history",
68595
+ children: [since === null ? null : /* @__PURE__ */ jsx("span", {
68596
+ className: "text-xs text-foreground-muted",
68597
+ children: since
68598
+ }), body]
68808
68599
  });
68809
68600
  }
68810
68601
  //#endregion
@@ -68845,125 +68636,6 @@ function SensorTrend({ deviceId, historyKey, label, reading, subject, compact =
68845
68636
  });
68846
68637
  }
68847
68638
  //#endregion
68848
- //#region src/composites/device-card/connected/MeasuredPieCard.tsx
68849
- /** Two readings of one quantity would share a key: the index keeps them apart. */
68850
- var idOf = (m, index) => `${m.quantity}-${String(index)}`;
68851
- /** The newest moment any reading was observed; `null` = none was. */
68852
- function latestSince(all) {
68853
- const moments = all.flatMap((m) => m.since === null ? [] : [m.since]);
68854
- return moments.length === 0 ? null : Math.max(...moments);
68855
- }
68856
- /** A sensor with several readings: the pie (or, past six, the grid), and the history behind each reading. */
68857
- function MeasuredPieCard({ deviceId, canActuate, shown, grid = false, orientation, showName, onDrawn }) {
68858
- useEffect(() => {
68859
- onDrawn?.(true);
68860
- }, [onDrawn]);
68861
- const t = useUiText();
68862
- const lang = useHeroLang();
68863
- const unitPreferences = useUnitPreferences();
68864
- const roleDefaults = useRoleDisplayDefaults();
68865
- const card = useCardCommon({
68866
- deviceId,
68867
- canActuate
68868
- });
68869
- const device = useDeviceManagerGetDevice({ deviceId }, { staleTime: 6e4 });
68870
- const subject = device.data === void 0 || device.data === null ? null : {
68871
- role: device.data.role ?? null,
68872
- ...device.data.display === void 0 ? {} : { display: device.data.display }
68873
- };
68874
- const [selected, setSelected] = useState(null);
68875
- const textOf = (m) => measurementText({
68876
- measurement: m,
68877
- lang,
68878
- subject,
68879
- unitPreferences,
68880
- roleDefaults
68881
- });
68882
- const readingOf = (m, index) => {
68883
- const text = textOf(m);
68884
- return {
68885
- id: idOf(m, index),
68886
- quantity: m.quantity,
68887
- value: text.value,
68888
- unit: text.unit,
68889
- label: quantityLabel(t, m.quantity),
68890
- state: readingStateOf(m),
68891
- visual: measurementVisual(m),
68892
- trend: m.historyKey === null || m.reading === null ? null : /* @__PURE__ */ jsx(SensorTrend, {
68893
- deviceId,
68894
- historyKey: m.historyKey,
68895
- label: text.value,
68896
- reading: m.reading,
68897
- subject,
68898
- compact: true
68899
- })
68900
- };
68901
- };
68902
- const lead = shown[0];
68903
- const ago = formatLastSeen(latestSince(shown), t);
68904
- const picked = shown.findIndex((m, i) => idOf(m, i) === selected);
68905
- const pickedMeasurement = picked < 0 ? void 0 : shown[picked];
68906
- const model = {
68907
- common: card.common,
68908
- state: {
68909
- label: lead === void 0 ? "" : pickText(lead.word, lang),
68910
- since: null,
68911
- tone: lead === void 0 ? "muted" : lead.tone
68912
- },
68913
- readings: shown.map(readingOf),
68914
- updated: ago === null ? null : t("uiLibrary.sensorPie.updated", "Updated · {{ago}}", { ago })
68915
- };
68916
- const detail = pickedMeasurement === void 0 ? null : /* @__PURE__ */ jsx(ReadingHistory, {
68917
- deviceId,
68918
- measurement: pickedMeasurement,
68919
- since: measurementSinceText(pickedMeasurement, t)
68920
- });
68921
- const common = {
68922
- model,
68923
- actions: card.actions,
68924
- showName,
68925
- selectedId: pickedMeasurement === void 0 ? null : selected,
68926
- onSelect: (id) => setSelected((current) => current === id ? null : id),
68927
- detail,
68928
- ...orientation === void 0 ? {} : { orientation }
68929
- };
68930
- return grid ? /* @__PURE__ */ jsx(SensorGridCard, { ...common }) : /* @__PURE__ */ jsx(SensorPieCard, { ...common });
68931
- }
68932
- /** The state series of a reading that is on/off rather than a number (no trend line). */
68933
- var STATE_READING_HISTORY_KEY = {
68934
- motion: "cap:motion.detected",
68935
- contact: "cap:contact.entryOpen"
68936
- };
68937
- /** One reading's value and the last day of it; a state reading shows ITS series only, never the device's whole History. */
68938
- function ReadingHistory({ deviceId, measurement, since }) {
68939
- const t = useUiText();
68940
- const seriesKey = measurement.historyKey ?? STATE_READING_HISTORY_KEY[measurement.quantity];
68941
- const chart = seriesKey === void 0 ? null : /* @__PURE__ */ jsx(DeviceHistoryView, {
68942
- deviceId,
68943
- seriesKeys: [seriesKey],
68944
- fixedWindow: "24h"
68945
- });
68946
- return /* @__PURE__ */ jsxs("div", {
68947
- className: "flex w-full flex-col items-center gap-2",
68948
- "data-testid": "dc-pie-history",
68949
- children: [
68950
- /* @__PURE__ */ jsx("span", {
68951
- className: "text-sm font-medium text-foreground",
68952
- children: quantityLabel(t, measurement.quantity)
68953
- }),
68954
- since === null ? null : /* @__PURE__ */ jsx("span", {
68955
- className: "text-xs text-foreground-muted",
68956
- children: since
68957
- }),
68958
- chart ?? /* @__PURE__ */ jsx("span", {
68959
- className: "text-xs text-foreground-muted",
68960
- "data-testid": "dc-pie-no-history",
68961
- children: t("uiLibrary.sensorPie.noHistory", "No history is kept for this reading.")
68962
- })
68963
- ]
68964
- });
68965
- }
68966
- //#endregion
68967
68639
  //#region src/composites/device-card/connected/use-measurement-readings.tsx
68968
68640
  var NONE$1 = [];
68969
68641
  /**
@@ -68987,23 +68659,30 @@ function useMeasurementReadings(deviceId) {
68987
68659
  const idOf = (m, index) => `${m.quantity}-${String(index)}`;
68988
68660
  const pickedIndex = (measurements ?? []).findIndex((m, i) => idOf(m, i) === selectedId);
68989
68661
  const picked = pickedIndex < 0 ? void 0 : measurements?.[pickedIndex];
68662
+ const subject = device.data === void 0 || device.data === null ? null : {
68663
+ role: device.data.role ?? null,
68664
+ ...device.data.display === void 0 ? {} : { display: device.data.display }
68665
+ };
68990
68666
  const open = {
68991
68667
  selectedId: picked === void 0 ? null : selectedId,
68992
68668
  onSelect: (id) => setSelectedId((current) => current === id ? null : id),
68993
68669
  detail: picked === void 0 ? null : /* @__PURE__ */ jsx(ReadingHistory, {
68994
68670
  deviceId,
68995
68671
  measurement: picked,
68996
- since: measurementSinceText(picked, t)
68672
+ since: measurementSinceText(picked, t),
68673
+ unit: measurementText({
68674
+ measurement: picked,
68675
+ lang,
68676
+ subject,
68677
+ unitPreferences,
68678
+ roleDefaults
68679
+ }).unit
68997
68680
  })
68998
68681
  };
68999
68682
  if (measurements === void 0) return {
69000
68683
  readings: NONE$1,
69001
68684
  open
69002
68685
  };
69003
- const subject = device.data === void 0 || device.data === null ? null : {
69004
- role: device.data.role ?? null,
69005
- ...device.data.display === void 0 ? {} : { display: device.data.display }
69006
- };
69007
68686
  return {
69008
68687
  readings: measurements.map((m, index) => {
69009
68688
  const text = measurementText({
@@ -69323,7 +69002,7 @@ function ConnectedGatewayCard({ deviceId, canActuate = true, orientation, showNa
69323
69002
  * never wire it themselves; without a provider (unit tests, embeds that do
69324
69003
  * not host the modal) a row click navigates to the device page.
69325
69004
  */
69326
- var DeviceQuickDetailContext = createSharedContext("camstack:device-quick-detail", null);
69005
+ var DeviceQuickDetailContext = createSharedContext("dominevo:device-quick-detail", null);
69327
69006
  function DeviceQuickDetailProvider({ open, children }) {
69328
69007
  return /* @__PURE__ */ jsx(DeviceQuickDetailContext.Provider, {
69329
69008
  value: open,
@@ -77876,6 +77555,409 @@ function SensorCard({ model, actions, orientation = "vertical", showName = true,
77876
77555
  }
77877
77556
  });
77878
77557
  }
77558
+ /**
77559
+ * The layout of a sensor, or `null` when it is not drawn as a sensor card: no
77560
+ * reading, or a row the operator can still set (a sensor with controls keeps the
77561
+ * full hero card, which draws them).
77562
+ */
77563
+ function sensorLayoutOf(model) {
77564
+ const gated = new Set(model.gated);
77565
+ if (model.rows.some((row) => !gated.has(row.id) && row.controls.length > 0)) return null;
77566
+ const all = model.measurements ?? (model.measurement === void 0 ? [] : [model.measurement]);
77567
+ const [only, ...rest] = all;
77568
+ if (only === void 0) return null;
77569
+ if (rest.length === 0) return {
77570
+ kind: "single",
77571
+ measurement: only
77572
+ };
77573
+ return {
77574
+ kind: all.length <= 6 ? "pie" : "grid",
77575
+ shown: all
77576
+ };
77577
+ }
77578
+ var ACTIVE_TONES = new Set([
77579
+ "primary",
77580
+ "warning",
77581
+ "danger"
77582
+ ]);
77583
+ function readingStateOf(m) {
77584
+ if (!(m.reading !== null || !isNotReported(m.value))) return "empty";
77585
+ return ACTIVE_TONES.has(m.tone) ? "active" : "idle";
77586
+ }
77587
+ /** How far from the centre a wedge's label sits, as a share of the radius. */
77588
+ var LABEL_RADIUS_SHARE = .62;
77589
+ var point = (deg, radius) => {
77590
+ const rad = deg * Math.PI / 180;
77591
+ return {
77592
+ x: Number((100 + radius * Math.sin(rad)).toFixed(2)),
77593
+ y: Number((100 - radius * Math.cos(rad)).toFixed(2))
77594
+ };
77595
+ };
77596
+ /** `count` equal wedges starting at 12 o'clock, clockwise. */
77597
+ function pieGeometry(count) {
77598
+ const step = 360 / count;
77599
+ return Array.from({ length: count }, (_, index) => {
77600
+ const startDeg = index * step;
77601
+ const endDeg = (index + 1) * step;
77602
+ const from = point(startDeg, 96);
77603
+ const to = point(endDeg, 96);
77604
+ const large = step > 180 ? 1 : 0;
77605
+ return {
77606
+ index,
77607
+ startDeg,
77608
+ endDeg,
77609
+ path: `M100 100 L${from.x} ${from.y} A96 96 0 ${large} 1 ${to.x} ${to.y} Z`,
77610
+ centroid: point((startDeg + endDeg) / 2, 96 * LABEL_RADIUS_SHARE)
77611
+ };
77612
+ });
77613
+ }
77614
+ /** Degrees between two points of a wedge's arc in the clip outline. */
77615
+ var CLIP_ARC_STEP_DEG = 4;
77616
+ /**
77617
+ * The CSS `polygon()` of a wedge as percentages of the pie's square (so it scales with
77618
+ * it): the centre, then the arc from its start to its end.
77619
+ */
77620
+ function wedgeClipPolygon(wedge) {
77621
+ const radiusPct = 96 / 200 * 100;
77622
+ const pct = (deg) => {
77623
+ const rad = deg * Math.PI / 180;
77624
+ const x = 50 + radiusPct * Math.sin(rad);
77625
+ const y = 50 - radiusPct * Math.cos(rad);
77626
+ return `${x.toFixed(2)}% ${y.toFixed(2)}%`;
77627
+ };
77628
+ const steps = Math.max(1, Math.ceil((wedge.endDeg - wedge.startDeg) / CLIP_ARC_STEP_DEG));
77629
+ return `polygon(50% 50%, ${Array.from({ length: steps + 1 }, (_, i) => pct(wedge.startDeg + (wedge.endDeg - wedge.startDeg) * i / steps)).join(", ")})`;
77630
+ }
77631
+ //#endregion
77632
+ //#region src/composites/device-card/scenes/sensor/ReadingTile.tsx
77633
+ /**
77634
+ * One reading as a tile: its quantity's tint, value and unit big, the short name above,
77635
+ * the single-reading card's own motion behind it and its last-day trend under it. A
77636
+ * reading with no data is a dashed tile with a "—". The grid draws it.
77637
+ */
77638
+ function ReadingTile({ reading, selected, dimmed, onSelect, testId }) {
77639
+ const classes = readingClasses(reading);
77640
+ return /* @__PURE__ */ jsxs("button", {
77641
+ type: "button",
77642
+ "data-testid": testId,
77643
+ "data-quantity": reading.quantity,
77644
+ "data-state": reading.state,
77645
+ "data-selected": selected ? "true" : void 0,
77646
+ "aria-pressed": selected,
77647
+ "aria-label": `${reading.label} ${reading.value}${reading.unit === null ? "" : ` ${reading.unit}`}`,
77648
+ onClick: () => onSelect?.(reading.id),
77649
+ className: cn("relative isolate flex w-full min-w-0 cursor-pointer flex-col items-start gap-0.5 overflow-hidden rounded-lg border px-2.5 py-2 text-left transition-opacity", reading.state === "empty" ? "border-dashed border-foreground-subtle bg-surface" : selected ? classes.tileSelected : classes.tile, dimmed && "opacity-40"),
77650
+ children: [
77651
+ reading.visual == null ? null : /* @__PURE__ */ jsx(MeasurementFx, { visual: reading.visual }),
77652
+ /* @__PURE__ */ jsx("span", {
77653
+ className: "max-w-full truncate text-xs text-foreground-muted",
77654
+ children: reading.label
77655
+ }),
77656
+ /* @__PURE__ */ jsxs("span", {
77657
+ className: cn("max-w-full truncate text-lg font-semibold tabular-nums", reading.state === "empty" ? "text-foreground-muted" : "text-foreground"),
77658
+ children: [reading.value, reading.unit === null ? null : /* @__PURE__ */ jsx("span", {
77659
+ className: "ml-1 text-xs font-normal text-foreground-muted",
77660
+ children: reading.unit
77661
+ })]
77662
+ }),
77663
+ reading.trend ?? null
77664
+ ]
77665
+ });
77666
+ }
77667
+ /** The columns a row of reading tiles holds: as many as the card's width fits (two on a phone). */
77668
+ var READING_TILES_GRID = "grid w-full grid-cols-[repeat(auto-fit,minmax(6.5rem,1fr))] gap-2";
77669
+ //#endregion
77670
+ //#region src/composites/device-card/scenes/sensor/SensorGridCard.tsx
77671
+ /**
77672
+ * A sensor with many readings (seven or more, past what a pie shows legibly): a
77673
+ * grid of tiles, one per reading, as many columns as the card's width holds (two
77674
+ * on a phone). Each tile is tinted by its quantity like a pie wedge: value and
77675
+ * unit big, the short name under it; a reading with no data is a dashed tile with
77676
+ * a "—". Tapping a tile highlights it (the others dim) and draws its history below
77677
+ * the grid.
77678
+ */
77679
+ function SensorGridCard({ model, actions, orientation = "vertical", showName = true, onSelect, selectedId = null, detail = null }) {
77680
+ const lead = model.readings[0];
77681
+ return /* @__PURE__ */ jsx(DeviceCard, {
77682
+ kind: "sensor",
77683
+ common: model.common,
77684
+ orientation,
77685
+ showName,
77686
+ state: model.state,
77687
+ activity: lead?.quantity ?? "sensor",
77688
+ ...actions === void 0 ? {} : { actions },
77689
+ scene: {
77690
+ fx: null,
77691
+ columns: {},
77692
+ image: /* @__PURE__ */ jsxs("div", {
77693
+ "data-testid": "dc-sensor-grid",
77694
+ "data-tiles": model.readings.length,
77695
+ className: "flex w-full flex-col gap-3",
77696
+ children: [
77697
+ model.updated === null ? null : /* @__PURE__ */ jsx("span", {
77698
+ "data-testid": "dc-grid-updated",
77699
+ className: "text-xs text-foreground-muted",
77700
+ children: model.updated
77701
+ }),
77702
+ /* @__PURE__ */ jsx("ul", {
77703
+ className: READING_TILES_GRID,
77704
+ children: model.readings.map((reading) => /* @__PURE__ */ jsx("li", {
77705
+ className: "min-w-0",
77706
+ children: /* @__PURE__ */ jsx(ReadingTile, {
77707
+ reading,
77708
+ selected: reading.id === selectedId,
77709
+ dimmed: selectedId !== null && reading.id !== selectedId,
77710
+ onSelect,
77711
+ testId: "dc-grid-tile"
77712
+ })
77713
+ }, reading.id))
77714
+ }),
77715
+ detail === null ? null : /* @__PURE__ */ jsx("div", {
77716
+ "data-testid": "dc-grid-detail",
77717
+ className: "flex w-full flex-col items-center gap-3",
77718
+ children: detail
77719
+ })
77720
+ ]
77721
+ })
77722
+ }
77723
+ });
77724
+ }
77725
+ //#endregion
77726
+ //#region src/composites/device-card/scenes/sensor/pie-css.ts
77727
+ /**
77728
+ * The pie's own motion: a breathing fill on an active wedge. The reading's backdrop
77729
+ * motion is the single-reading card's (`MeasurementFx`), clipped to the wedge. Under
77730
+ * `prefers-reduced-motion` nothing moves.
77731
+ */
77732
+ var SENSOR_PIE_CSS = `
77733
+ .dc-pie-wedge{outline:none}
77734
+ .dc-pie-wedge:focus-visible>path{stroke-width:3}
77735
+ .dc-pie-empty{stroke-dasharray:4 4}
77736
+ .dc-pie-breathe{animation:dc-pie-breathe 2.8s ease-in-out infinite}
77737
+ @keyframes dc-pie-breathe{0%,100%{fill-opacity:.55}50%{fill-opacity:1}}
77738
+ @media (prefers-reduced-motion:reduce){.dc-pie-breathe{animation:none!important}}
77739
+ `;
77740
+ //#endregion
77741
+ //#region src/composites/device-card/scenes/sensor/SensorPieCard.tsx
77742
+ /** The size of the value, so a word and a long number stay inside the wedge. */
77743
+ function valueSizeClass(n, value) {
77744
+ if (value.length > 6) return "text-[9px]";
77745
+ if (n >= 5 || value.length > 4) return "text-[12px]";
77746
+ return n >= 3 ? "text-[16px]" : "text-[20px]";
77747
+ }
77748
+ function onKey(handler) {
77749
+ return (e) => {
77750
+ if (e.key === "Enter" || e.key === " ") {
77751
+ e.preventDefault();
77752
+ handler();
77753
+ }
77754
+ };
77755
+ }
77756
+ function Wedge({ wedge, count, reading, selected, dimmed, onSelect }) {
77757
+ const { centroid: at } = wedge;
77758
+ const classes = readingClasses(reading);
77759
+ const tap = () => onSelect?.(reading.id);
77760
+ return /* @__PURE__ */ jsxs("g", {
77761
+ "data-testid": "dc-pie-wedge",
77762
+ "data-quantity": reading.quantity,
77763
+ "data-state": reading.state,
77764
+ "data-selected": selected ? "true" : void 0,
77765
+ role: "button",
77766
+ "aria-pressed": selected,
77767
+ tabIndex: 0,
77768
+ "aria-label": `${reading.label} ${reading.value}${reading.unit === null ? "" : ` ${reading.unit}`}`,
77769
+ className: cn("dc-pie-wedge cursor-pointer transition-opacity", dimmed && "opacity-40"),
77770
+ onClick: tap,
77771
+ onKeyDown: onKey(tap),
77772
+ children: [
77773
+ /* @__PURE__ */ jsx("path", {
77774
+ d: wedge.path,
77775
+ className: cn(reading.state === "empty" ? "fill-surface stroke-foreground-subtle dc-pie-empty" : selected ? classes.wedgeSelected : classes.wedge, reading.state === "active" && "dc-pie-breathe"),
77776
+ strokeWidth: selected ? 3 : 1.5
77777
+ }),
77778
+ /* @__PURE__ */ jsxs("text", {
77779
+ x: at.x,
77780
+ y: at.y - 2,
77781
+ textAnchor: "middle",
77782
+ className: cn("font-semibold tabular-nums", reading.state === "empty" ? "fill-foreground-muted" : "fill-foreground", valueSizeClass(count, reading.value)),
77783
+ children: [reading.value, reading.unit === null ? null : /* @__PURE__ */ jsx("tspan", {
77784
+ dx: 1.5,
77785
+ className: "fill-foreground-muted text-[8px] font-normal",
77786
+ children: reading.unit
77787
+ })]
77788
+ }),
77789
+ /* @__PURE__ */ jsx("text", {
77790
+ x: at.x,
77791
+ y: at.y + 10,
77792
+ textAnchor: "middle",
77793
+ className: "fill-foreground-muted text-[8px]",
77794
+ children: reading.label
77795
+ })
77796
+ ]
77797
+ });
77798
+ }
77799
+ /**
77800
+ * A sensor with two to six readings: a pie of equal wedges from 12 o'clock, each in
77801
+ * its own chart-palette colour, its value, unit and short name at the wedge's centre.
77802
+ * Each wedge that has a value carries its reading's own motion (the single-reading card's
77803
+ * backdrop), clipped to the wedge; a reading with no data is a still, dashed wedge with a "—". Tapping
77804
+ * a wedge highlights it (the others dim) and draws its history below the pie. This is
77805
+ * the ONLY layout of such a card: seven or more readings are `SensorGridCard`.
77806
+ */
77807
+ function SensorPieCard({ model, actions, orientation = "vertical", showName = true, onSelect, selectedId = null, detail = null }) {
77808
+ const count = model.readings.length;
77809
+ const wedges = pieGeometry(count);
77810
+ const lead = model.readings[0];
77811
+ return /* @__PURE__ */ jsx(DeviceCard, {
77812
+ kind: "sensor",
77813
+ common: model.common,
77814
+ orientation,
77815
+ showName,
77816
+ state: model.state,
77817
+ activity: lead?.quantity ?? "sensor",
77818
+ ...actions === void 0 ? {} : { actions },
77819
+ scene: {
77820
+ fx: null,
77821
+ columns: {},
77822
+ image: /* @__PURE__ */ jsxs("div", {
77823
+ "data-testid": "dc-sensor-pie",
77824
+ "data-wedges": count,
77825
+ className: "relative flex w-full flex-col items-center justify-center gap-3",
77826
+ children: [
77827
+ /* @__PURE__ */ jsx("style", { children: SENSOR_PIE_CSS }),
77828
+ model.updated === null ? null : /* @__PURE__ */ jsx("span", {
77829
+ "data-testid": "dc-pie-updated",
77830
+ className: "absolute left-0 top-0 text-xs text-foreground-muted",
77831
+ children: model.updated
77832
+ }),
77833
+ /* @__PURE__ */ jsxs("div", {
77834
+ className: "relative isolate aspect-square w-full max-w-72 overflow-hidden rounded-full border border-border bg-surface",
77835
+ children: [model.readings.map((reading, i) => {
77836
+ const wedge = wedges[i];
77837
+ return wedge === void 0 || reading.visual == null || reading.state === "empty" ? null : /* @__PURE__ */ jsx("div", {
77838
+ "data-testid": "dc-pie-fx",
77839
+ "data-quantity": reading.quantity,
77840
+ className: cn("pointer-events-none absolute inset-0 transition-opacity", selectedId !== null && reading.id !== selectedId && "opacity-40"),
77841
+ style: { clipPath: wedgeClipPolygon(wedge) },
77842
+ children: /* @__PURE__ */ jsx(MeasurementFx, { visual: reading.visual })
77843
+ }, reading.id);
77844
+ }), /* @__PURE__ */ jsx("svg", {
77845
+ viewBox: "0 0 200 200",
77846
+ role: "group",
77847
+ "aria-label": model.common.name,
77848
+ className: "absolute inset-0 size-full",
77849
+ children: model.readings.map((reading, i) => {
77850
+ const wedge = wedges[i];
77851
+ return wedge === void 0 ? null : /* @__PURE__ */ jsx(Wedge, {
77852
+ wedge,
77853
+ count,
77854
+ reading,
77855
+ selected: reading.id === selectedId,
77856
+ dimmed: selectedId !== null && reading.id !== selectedId,
77857
+ onSelect
77858
+ }, reading.id);
77859
+ })
77860
+ })]
77861
+ }),
77862
+ detail === null ? null : /* @__PURE__ */ jsx("div", {
77863
+ "data-testid": "dc-pie-detail",
77864
+ className: "flex w-full flex-col items-center gap-3",
77865
+ children: detail
77866
+ })
77867
+ ]
77868
+ })
77869
+ }
77870
+ });
77871
+ }
77872
+ //#endregion
77873
+ //#region src/composites/device-card/connected/MeasuredPieCard.tsx
77874
+ /** Two readings of one quantity would share a key: the index keeps them apart. */
77875
+ var idOf = (m, index) => `${m.quantity}-${String(index)}`;
77876
+ /** The newest moment any reading was observed; `null` = none was. */
77877
+ function latestSince(all) {
77878
+ const moments = all.flatMap((m) => m.since === null ? [] : [m.since]);
77879
+ return moments.length === 0 ? null : Math.max(...moments);
77880
+ }
77881
+ /** A sensor with several readings: the pie (or, past six, the grid), and the history behind each reading. */
77882
+ function MeasuredPieCard({ deviceId, canActuate, shown, grid = false, orientation, showName, onDrawn }) {
77883
+ useEffect(() => {
77884
+ onDrawn?.(true);
77885
+ }, [onDrawn]);
77886
+ const t = useUiText();
77887
+ const lang = useHeroLang();
77888
+ const unitPreferences = useUnitPreferences();
77889
+ const roleDefaults = useRoleDisplayDefaults();
77890
+ const card = useCardCommon({
77891
+ deviceId,
77892
+ canActuate
77893
+ });
77894
+ const device = useDeviceManagerGetDevice({ deviceId }, { staleTime: 6e4 });
77895
+ const subject = device.data === void 0 || device.data === null ? null : {
77896
+ role: device.data.role ?? null,
77897
+ ...device.data.display === void 0 ? {} : { display: device.data.display }
77898
+ };
77899
+ const [selected, setSelected] = useState(null);
77900
+ const textOf = (m) => measurementText({
77901
+ measurement: m,
77902
+ lang,
77903
+ subject,
77904
+ unitPreferences,
77905
+ roleDefaults
77906
+ });
77907
+ const slots = assignReadingSlots(shown.map((m) => m.quantity));
77908
+ const readingOf = (m, index) => {
77909
+ const text = textOf(m);
77910
+ return {
77911
+ id: idOf(m, index),
77912
+ slot: slots[index] ?? 0,
77913
+ quantity: m.quantity,
77914
+ value: text.value,
77915
+ unit: text.unit,
77916
+ label: quantityLabel(t, m.quantity),
77917
+ state: readingStateOf(m),
77918
+ visual: measurementVisual(m),
77919
+ trend: m.historyKey === null || m.reading === null ? null : /* @__PURE__ */ jsx(SensorTrend, {
77920
+ deviceId,
77921
+ historyKey: m.historyKey,
77922
+ label: text.value,
77923
+ reading: m.reading,
77924
+ subject,
77925
+ compact: true
77926
+ })
77927
+ };
77928
+ };
77929
+ const lead = shown[0];
77930
+ const ago = formatLastSeen(latestSince(shown), t);
77931
+ const picked = shown.findIndex((m, i) => idOf(m, i) === selected);
77932
+ const pickedMeasurement = picked < 0 ? void 0 : shown[picked];
77933
+ const model = {
77934
+ common: card.common,
77935
+ state: {
77936
+ label: lead === void 0 ? "" : pickText(lead.word, lang),
77937
+ since: null,
77938
+ tone: lead === void 0 ? "muted" : lead.tone
77939
+ },
77940
+ readings: shown.map(readingOf),
77941
+ updated: ago === null ? null : t("uiLibrary.sensorPie.updated", "Updated · {{ago}}", { ago })
77942
+ };
77943
+ const detail = pickedMeasurement === void 0 ? null : /* @__PURE__ */ jsx(ReadingHistory, {
77944
+ deviceId,
77945
+ measurement: pickedMeasurement,
77946
+ since: measurementSinceText(pickedMeasurement, t),
77947
+ unit: textOf(pickedMeasurement).unit,
77948
+ slot: slots[picked] ?? 0
77949
+ });
77950
+ const common = {
77951
+ model,
77952
+ actions: card.actions,
77953
+ showName,
77954
+ selectedId: pickedMeasurement === void 0 ? null : selected,
77955
+ onSelect: (id) => setSelected((current) => current === id ? null : id),
77956
+ detail,
77957
+ ...orientation === void 0 ? {} : { orientation }
77958
+ };
77959
+ return grid ? /* @__PURE__ */ jsx(SensorGridCard, { ...common }) : /* @__PURE__ */ jsx(SensorPieCard, { ...common });
77960
+ }
77879
77961
  //#endregion
77880
77962
  //#region src/composites/hero-model/use-hero-live-refresh.ts
77881
77963
  var COALESCE_MS = 250;
@@ -87547,7 +87629,7 @@ function effectivePageSize(size, totalItems) {
87547
87629
  * useDeviceListPageSize — global page-size preference for the device-list
87548
87630
  * surfaces (Devices, Integrations, integration detail).
87549
87631
  *
87550
- * ONE shared localStorage key (`camstack.device-list.pageSize`) so changing
87632
+ * ONE shared localStorage key (`dominevo.device-list.pageSize`) so changing
87551
87633
  * the per-page size on any device-list page applies everywhere. The stored
87552
87634
  * value is validated against {@link DEVICE_LIST_PAGE_SIZE_OPTIONS}; any
87553
87635
  * garbage / out-of-range value falls back to the provided default.
@@ -87564,7 +87646,7 @@ var DEVICE_LIST_PAGE_SIZE_OPTIONS = [
87564
87646
  200
87565
87647
  ];
87566
87648
  /** Single global key shared across every device-list surface. */
87567
- var DEVICE_LIST_PAGE_SIZE_KEY = "camstack.device-list.pageSize";
87649
+ var DEVICE_LIST_PAGE_SIZE_KEY = "dominevo.device-list.pageSize";
87568
87650
  /**
87569
87651
  * @param defaultSize fallback when nothing valid is stored. If it is not itself
87570
87652
  * a member of {@link DEVICE_LIST_PAGE_SIZE_OPTIONS}, it is replaced by
@@ -89932,7 +90014,7 @@ function addTag(current, raw) {
89932
90014
  }
89933
90015
  /** The `localStorage` key of one section's view mode. */
89934
90016
  function tagViewStorageKey(section) {
89935
- return `camstack.tags.view.${section}`;
90017
+ return `dominevo.tags.view.${section}`;
89936
90018
  }
89937
90019
  /** The remembered view mode; `flat` when nothing (readable) is stored. */
89938
90020
  function readTagViewMode(key) {
@@ -90973,7 +91055,7 @@ function paramKey(scope, base) {
90973
91055
  }
90974
91056
  function readFromLS(lsKey) {
90975
91057
  try {
90976
- const raw = localStorage.getItem(`camstack:${lsKey}:lastFilters`);
91058
+ const raw = localStorage.getItem(`dominevo:${lsKey}:lastFilters`);
90977
91059
  if (!raw) return {};
90978
91060
  const parsed = JSON.parse(raw);
90979
91061
  if (typeof parsed !== "object" || parsed === null) return {};
@@ -90984,7 +91066,7 @@ function readFromLS(lsKey) {
90984
91066
  }
90985
91067
  function writeToLS(lsKey, filters) {
90986
91068
  try {
90987
- localStorage.setItem(`camstack:${lsKey}:lastFilters`, JSON.stringify(filters));
91069
+ localStorage.setItem(`dominevo:${lsKey}:lastFilters`, JSON.stringify(filters));
90988
91070
  } catch {}
90989
91071
  }
90990
91072
  function readUrlState(scope, ls) {
@@ -92540,7 +92622,7 @@ var IntegrationRowsSchema = z.array(z.object({
92540
92622
  var SupportedKindsSchema = z.array(z.string());
92541
92623
  var STATUS_POLL_INTERVAL_MS = 1e4;
92542
92624
  /** Where the viewer's "rows per page" choice for this table is remembered. */
92543
- var DEVICE_EXPORT_PAGE_SIZE_KEY = "camstack.device-export.pageSize";
92625
+ var DEVICE_EXPORT_PAGE_SIZE_KEY = "dominevo.device-export.pageSize";
92544
92626
  /**
92545
92627
  * The exposed-devices table's page sizes. Its own key and options, not the
92546
92628
  * Devices page's (25/50/100/200, default 50): the operator asked for a short
@@ -95174,16 +95256,18 @@ var SEARCH_LIMIT = 200;
95174
95256
  /** A topology older than this is re-read on window focus. */
95175
95257
  var TOPOLOGY_STALE_MS = 15e3;
95176
95258
  function useMeshNetworks() {
95177
- const presence = useCapabilityPresence(DEVICE_MESH_CAP);
95178
95259
  const utils = trpc.useUtils();
95179
95260
  const search = trpc.deviceManager.search.useQuery({
95180
95261
  requires: { caps: [DEVICE_MESH_CAP] },
95181
95262
  limit: SEARCH_LIMIT
95182
95263
  }, {
95183
- enabled: presence === "present",
95184
95264
  staleTime: TOPOLOGY_STALE_MS,
95185
95265
  refetchOnWindowFocus: true
95186
95266
  });
95267
+ const presence = classifyDeviceNativePresence({
95268
+ status: search.status,
95269
+ data: search.data
95270
+ });
95187
95271
  const deviceIds = (search.data?.items ?? []).filter((i) => i.compatible).map((i) => i.id);
95188
95272
  const networks = useQuery({
95189
95273
  queryKey: [
@@ -98903,8 +98987,8 @@ function StreamBrokerSelector({ deviceId, value, onChange, disabled, label, clas
98903
98987
  * provider per `deviceId`; switching device IDs unmounts the
98904
98988
  * provider naturally.
98905
98989
  */
98906
- var PlayerOverlaysStateContext = createSharedContext("camstack:player-overlays-state", null);
98907
- var PlayerOverlaysActionsContext = createSharedContext("camstack:player-overlays-actions", null);
98990
+ var PlayerOverlaysStateContext = createSharedContext("dominevo:player-overlays-state", null);
98991
+ var PlayerOverlaysActionsContext = createSharedContext("dominevo:player-overlays-actions", null);
98908
98992
  function PlayerOverlaysProvider({ children }) {
98909
98993
  const [layers, setLayers] = useState(() => /* @__PURE__ */ new Map());
98910
98994
  const [buttons, setButtons] = useState(() => /* @__PURE__ */ new Map());
@@ -100443,7 +100527,7 @@ function withResolvedParentDetail(devices) {
100443
100527
  * from a read that did not answer (D315). The model then groups by
100444
100528
  * location and the panel says why.
100445
100529
  */
100446
- var DEVICE_PICKER_GROUP_STORAGE_KEY = "camstack.admin.device-picker.group-by";
100530
+ var DEVICE_PICKER_GROUP_STORAGE_KEY = "dominevo.admin.device-picker.group-by";
100447
100531
  /**
100448
100532
  * Under `listSiteZones`'s own prefix, so the Locations page's invalidation of
100449
100533
  * `[['deviceManager', 'listSiteZones']]` refreshes it too.
@@ -100453,7 +100537,7 @@ var PICKER_ZONES_STALE_MS = 6e4;
100453
100537
  /** The stored choice; the default when storage is absent, throws or is unreadable. */
100454
100538
  function readStoredGroupBy() {
100455
100539
  try {
100456
- const raw = globalThis.localStorage?.getItem("camstack.admin.device-picker.group-by") ?? null;
100540
+ const raw = globalThis.localStorage?.getItem("dominevo.admin.device-picker.group-by") ?? null;
100457
100541
  return raw === null ? PICKER_DEFAULT_GROUP_BY : parsePickerGroupBy(raw);
100458
100542
  } catch {
100459
100543
  return PICKER_DEFAULT_GROUP_BY;
@@ -101496,7 +101580,7 @@ function resizeSplit(sizes, index, deltaPct, minPct = 10) {
101496
101580
  });
101497
101581
  }
101498
101582
  function storageName(key, count) {
101499
- return `camstack.columns.${key}.${String(count)}`;
101583
+ return `dominevo.columns.${key}.${String(count)}`;
101500
101584
  }
101501
101585
  function isValidSplit(value, count, minPct) {
101502
101586
  if (!Array.isArray(value) || value.length !== count) return false;
@@ -102075,7 +102159,7 @@ function rememberRecentKind(recent, picked) {
102075
102159
  }
102076
102160
  //#endregion
102077
102161
  //#region src/composites/condition-kind-picker/use-recent-kinds.ts
102078
- var STORAGE_PREFIX = "camstack.conditionKindPicker.recent.";
102162
+ var STORAGE_PREFIX = "dominevo.conditionKindPicker.recent.";
102079
102163
  function isKind(value) {
102080
102164
  return AUTOMATION_LEAF_KINDS.some((kind) => kind === value);
102081
102165
  }
@@ -103138,7 +103222,7 @@ function DeviceTemplateSuggest(props) {
103138
103222
  }
103139
103223
  //#endregion
103140
103224
  //#region src/composites/device-template-field/DeviceTemplateField.tsx
103141
- var DEVICE_TEMPLATE_DOCS_URL = "https://camstack-docs.zentik.app/docs/day-to-day/device-templates";
103225
+ var DEVICE_TEMPLATE_DOCS_URL = "https://dominevo.app/docs/day-to-day/device-templates";
103142
103226
  function isSuggestKey(event) {
103143
103227
  return event.ctrlKey && !event.metaKey && !event.altKey && event.code === "Space";
103144
103228
  }
@@ -103854,7 +103938,7 @@ function TaggedDataTable({ section, rows, columns, getTags, searchText, searchLa
103854
103938
  }
103855
103939
  //#endregion
103856
103940
  //#region src/ui-library-version.ts
103857
- var uiLibraryVersion = "0.1.0";
103941
+ var uiLibraryVersion = "0.1.1";
103858
103942
  //#endregion
103859
103943
  //#region src/hooks/use-account-unit-preferences.ts
103860
103944
  /**
@@ -103958,7 +104042,7 @@ function UnitPreferencesFromServer({ children }) {
103958
104042
  * write — operators saw 8-character zone renames cycle the
103959
104043
  * pipeline 8 times.
103960
104044
  */
103961
- var ZoneEditingContext = createSharedContext("camstack:zone-editing", null);
104045
+ var ZoneEditingContext = createSharedContext("dominevo:zone-editing", null);
103962
104046
  function ZoneEditingProvider({ children }) {
103963
104047
  const [editing, setEditingRaw] = useState(false);
103964
104048
  const [drawingKind, setDrawingKindRaw] = useState(null);
@@ -104969,7 +105053,7 @@ var MotionZonesSettings = lazy(() => import("./MotionZonesSettings-C2AIvd4c.js")
104969
105053
  /** Lazy-wrapped `SceneMonitorEditor` — code-split off the main bundle for the
104970
105054
  * same reason: it mounts `MaskShapeCanvas`, which chains react-konva. Render
104971
105055
  * inside `<Suspense>`; the admin-ui `/scenes` dialog is its only caller. */
104972
- var SceneMonitorEditor = lazy(() => import("./SceneMonitorEditor-Bj_BN2Ar.js").then((m) => ({ default: m.SceneMonitorEditor })));
105056
+ var SceneMonitorEditor = lazy(() => import("./SceneMonitorEditor-grGP7vRI.js").then((m) => ({ default: m.SceneMonitorEditor })));
104973
105057
  /** Lazy-wrapped `PrivacyMaskSettings` — code-split off the main bundle. */
104974
105058
  var PrivacyMaskSettings = lazy(() => import("./PrivacyMaskSettings-FNCxdQCg.js").then((m) => ({ default: m.PrivacyMaskSettings })));
104975
105059
  //#endregion