@camstack/ui-library 1.2.242 → 1.2.244

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -8024,6 +8024,8 @@ var usePipelineOrchestratorSetCameraStepToggle = trpc.pipelineOrchestrator.setCa
8024
8024
  var usePipelineOrchestratorGetCameraStepOverrides = trpc.pipelineOrchestrator.getCameraStepOverrides.useQuery;
8025
8025
  /** Generated alias around `trpc.pipelineOrchestrator.setCameraStepOverride.useMutation`. */
8026
8026
  var usePipelineOrchestratorSetCameraStepOverride = trpc.pipelineOrchestrator.setCameraStepOverride.useMutation;
8027
+ /** Generated alias around `trpc.pipelineOrchestrator.setCameraStepSettings.useMutation`. */
8028
+ var usePipelineOrchestratorSetCameraStepSettings = trpc.pipelineOrchestrator.setCameraStepSettings.useMutation;
8027
8029
  /** Generated alias around `trpc.pipelineOrchestrator.setCameraPipelineForAgent.useMutation`. */
8028
8030
  var usePipelineOrchestratorSetCameraPipelineForAgent = trpc.pipelineOrchestrator.setCameraPipelineForAgent.useMutation;
8029
8031
  /** Generated alias around `trpc.pipelineOrchestrator.resolvePipeline.useQuery`. */
@@ -31611,6 +31613,27 @@ function nextClientSample(prev, cur, ctx) {
31611
31613
  };
31612
31614
  }
31613
31615
  //#endregion
31616
+ //#region src/composites/peer-connection-config.ts
31617
+ /**
31618
+ * The player's `RTCConfiguration`, in one place for every connect path.
31619
+ *
31620
+ * The player never forces `iceTransportPolicy: 'relay'` on its own (werift's
31621
+ * relay forward is unreliable across two real TURN servers, and relay would
31622
+ * defeat the direct LAN/Tailscale path). The policy exists for the WebRTC
31623
+ * diagnostics only, which run the SAME player once with `all` and once with
31624
+ * `relay` to tell a reachable relay path from a dead one. Absent, the key is
31625
+ * not set at all, so a production connect is byte-for-byte what it was.
31626
+ */
31627
+ /** Public STUN kept as a fallback beside whatever the hub's TURN provider returns. */
31628
+ var FALLBACK_STUN_SERVER = { urls: "stun:stun.l.google.com:19302" };
31629
+ function buildPeerConnectionConfig(iceServers, iceTransportPolicy) {
31630
+ const servers = [...iceServers ?? [], FALLBACK_STUN_SERVER];
31631
+ return iceTransportPolicy === void 0 ? { iceServers: servers } : {
31632
+ iceServers: servers,
31633
+ iceTransportPolicy
31634
+ };
31635
+ }
31636
+ //#endregion
31614
31637
  //#region src/composites/stream-debug/webrtc-debug-stats.ts
31615
31638
  /** Beyond this the log is a scroll, not a signal. */
31616
31639
  var RESOLUTION_LOG_MAX = 8;
@@ -32334,7 +32357,7 @@ function mergePlayerHints(autoHints, override, downlinkMbps, coldStart) {
32334
32357
  return coldStart ? stripDownlinkForColdStart(merged) : merged;
32335
32358
  }
32336
32359
  var FIRST_FRAME_TIMEOUT_MS = 8e3;
32337
- function CameraStreamPlayer({ serverUrl, streamKey, label, autoPlay = true, muted: initialMuted = true, showControls = true, showStats = false, onDebugStats, onPlaybackStats, onClientNetworkSample, probeAuthToken, onConnectTiming, className = "", onStateChange, onError, onReconnectAttempt, overlay, createSession, sendAnswer, handleOffer, getIceServers, addIceCandidate, getIceCandidates, closeSession, getSessionState, getSessionDebug, applyDownlinkProbe, reoffer, posterUrl, hintsOverride, onAdaptiveHints, reconnectSignal, onControlChannel, onVideoElement }) {
32360
+ function CameraStreamPlayer({ serverUrl, streamKey, label, autoPlay = true, muted: initialMuted = true, showControls = true, showStats = false, onDebugStats, onPlaybackStats, onClientNetworkSample, probeAuthToken, onConnectTiming, className = "", onStateChange, onError, onReconnectAttempt, overlay, createSession, sendAnswer, handleOffer, getIceServers, addIceCandidate, getIceCandidates, closeSession, getSessionState, getSessionDebug, applyDownlinkProbe, reoffer, posterUrl, hintsOverride, onAdaptiveHints, reconnectSignal, onControlChannel, onVideoElement, iceTransportPolicy, onPeerConnection }) {
32338
32361
  const videoRef = useRef(null);
32339
32362
  const containerRef = useRef(null);
32340
32363
  const pcRef = useRef(null);
@@ -32350,6 +32373,12 @@ function CameraStreamPlayer({ serverUrl, streamKey, label, autoPlay = true, mute
32350
32373
  * consumer, without re-creating the connect callback on every render. */
32351
32374
  const onControlChannelRef = useRef(onControlChannel);
32352
32375
  onControlChannelRef.current = onControlChannel;
32376
+ /** Read at connect time through refs so neither diagnostics prop re-creates
32377
+ * the connect callbacks (and so neither forces a reconnect when it changes). */
32378
+ const iceTransportPolicyRef = useRef(iceTransportPolicy);
32379
+ iceTransportPolicyRef.current = iceTransportPolicy;
32380
+ const onPeerConnectionRef = useRef(onPeerConnection);
32381
+ onPeerConnectionRef.current = onPeerConnection;
32353
32382
  /** Same pattern for the video-element handle: delivered once on mount, null
32354
32383
  * on unmount — the ref keeps the latest consumer without re-running. */
32355
32384
  const onVideoElementRef = useRef(onVideoElement);
@@ -32559,7 +32588,8 @@ function CameraStreamPlayer({ serverUrl, streamKey, label, autoPlay = true, mute
32559
32588
  sessionIdsRef.current.delete(sessionId);
32560
32589
  return;
32561
32590
  }
32562
- const pc = new RTCPeerConnection({ iceServers: [...iceServers ?? [], { urls: "stun:stun.l.google.com:19302" }] });
32591
+ const pc = new RTCPeerConnection(buildPeerConnectionConfig(iceServers, iceTransportPolicyRef.current));
32592
+ onPeerConnectionRef.current?.(pc);
32563
32593
  if (!seamless) pcRef.current = pc;
32564
32594
  const combinedStream = new MediaStream();
32565
32595
  if (!withDownlink) probeAfterThisStreamsFirstFrame({
@@ -32760,7 +32790,8 @@ function CameraStreamPlayer({ serverUrl, streamKey, label, autoPlay = true, mute
32760
32790
  const iceServers = await getIceServers?.();
32761
32791
  timing.iceServersMs = ms();
32762
32792
  if (!mountedRef.current || abort.signal.aborted) return;
32763
- const pc = new RTCPeerConnection({ iceServers: [...iceServers ?? [], { urls: "stun:stun.l.google.com:19302" }] });
32793
+ const pc = new RTCPeerConnection(buildPeerConnectionConfig(iceServers, iceTransportPolicyRef.current));
32794
+ onPeerConnectionRef.current?.(pc);
32764
32795
  if (!seamless) pcRef.current = pc;
32765
32796
  const combinedStream = new MediaStream();
32766
32797
  /** This connect's server session — known once `handleOffer` answers,
@@ -32966,7 +32997,8 @@ function CameraStreamPlayer({ serverUrl, streamKey, label, autoPlay = true, mute
32966
32997
  try {
32967
32998
  const iceServers = await getIceServers?.();
32968
32999
  if (!mountedRef.current) return;
32969
- const pc = new RTCPeerConnection({ iceServers: [...iceServers ?? [], { urls: "stun:stun.l.google.com:19302" }] });
33000
+ const pc = new RTCPeerConnection(buildPeerConnectionConfig(iceServers, iceTransportPolicyRef.current));
33001
+ onPeerConnectionRef.current?.(pc);
32970
33002
  const newStream = new MediaStream();
32971
33003
  let swappedIn = false;
32972
33004
  let warmupStarted = false;
@@ -33806,281 +33838,6 @@ async function waitForIceGathering(pc) {
33806
33838
  });
33807
33839
  }
33808
33840
  //#endregion
33809
- //#region src/composites/cap-settings/scene-monitor-copy.ts
33810
- /** The lighting variants an operator is OFFERED. The resolver can also report
33811
- * `night`, `dawn` and `dusk`; those are shown when present but never demanded,
33812
- * because most installs only ever see day and IR. */
33813
- var SCENE_CAPTURE_VARIANTS = ["day", "ir"];
33814
- var VARIANT_LABEL = {
33815
- day: "Daylight",
33816
- ir: "Night (IR)",
33817
- night: "Night",
33818
- dawn: "Dawn",
33819
- dusk: "Dusk"
33820
- };
33821
- function variantLabel(condition) {
33822
- return VARIANT_LABEL[condition] ?? condition;
33823
- }
33824
- /**
33825
- * "Daylight ✓ · Night (IR) ✗ — optional; checks in night (ir) are skipped."
33826
- *
33827
- * Converts the silent cross-condition fallback this engine used to have into an
33828
- * operator-visible fact. Without it, a scene with only a daylight reference
33829
- * simply stops answering after sunset and nothing anywhere says why.
33830
- *
33831
- * It used to end *"reports 'can't tell' in night (ir)"*, which was accurate and
33832
- * read as a defect: the operator saw a ✗ and a complaint for a scene that was
33833
- * configured exactly as they meant it. The missing half is now named as what it
33834
- * is — the part you do not have to do — and the sentence says what actually
33835
- * happens instead, which differs by the scene's own policy.
33836
- */
33837
- function coverageLine(monitor) {
33838
- const covered = new Set(monitor.coveredConditions);
33839
- const parts = SCENE_CAPTURE_VARIANTS.map((v) => `${variantLabel(v)} ${covered.has(v) ? "✓" : "✗"}`);
33840
- const extra = [...covered].filter((c) => !SCENE_CAPTURE_VARIANTS.some((v) => v === c));
33841
- for (const c of extra) parts.push(`${variantLabel(c)} ✓`);
33842
- const missing = SCENE_CAPTURE_VARIANTS.filter((v) => !covered.has(v));
33843
- if (missing.length === 0) return parts.join(" · ");
33844
- if (covered.size === 0) return `${parts.join(" · ")} — nothing captured yet, so this scene is not watching.`;
33845
- const names = missing.map((v) => variantLabel(v).toLowerCase()).join(" and ");
33846
- return monitor.onUncoveredCondition === "judge-anyway" ? `${parts.join(" · ")} — ${names} judged against the references you do have.` : `${parts.join(" · ")} — optional; checks in ${names} are skipped.`;
33847
- }
33848
- /**
33849
- * The calm sentence for a scene that is sitting the current light out — `null`
33850
- * whenever it is checking normally.
33851
- *
33852
- * Separate from {@link statusLine} because it is not a verdict and must not
33853
- * read like one. A paused scene has not failed, has not lost its flag, and
33854
- * needs nothing from the operator; the only thing worth saying is which light
33855
- * it is waiting out and that it will pick itself back up.
33856
- */
33857
- function suspensionLine(monitor) {
33858
- if (monitor.suspendedCondition === null) return null;
33859
- const light = variantLabel(monitor.suspendedCondition).toLowerCase();
33860
- return `Paused — nothing was captured in ${light}, so checks are on hold until the light changes back. Capture ${light} if you want it watched around the clock.`;
33861
- }
33862
- var UNAVAILABLE_SENTENCE = {
33863
- "no-reference-for-condition": "can’t tell — nothing has been captured for this scene yet. Press “Capture daylight” to photograph what normal looks like.",
33864
- "view-shifted": "can’t tell — the camera view has moved since the reference was captured. Re-capture it.",
33865
- "no-vision-profile": "can’t tell — the vision model is unreachable, so the change is on hold.",
33866
- "encoder-model-changed": "can’t tell — the embedding model changed, so the stored references are unreadable. Re-capture them.",
33867
- "no-snapshot": "can’t tell — this camera did not return a frame."
33868
- };
33869
- /**
33870
- * The one line under a scene's name. It answers, in order: can it judge, what
33871
- * does it say, and how long has it said it.
33872
- */
33873
- function statusLine(monitor, now) {
33874
- if (monitor.states.length === 0) return "Not armed yet — capture the initial state to start watching.";
33875
- if (monitor.verdict === "unknown") return monitor.unavailable !== null ? UNAVAILABLE_SENTENCE[monitor.unavailable] : "can’t tell right now.";
33876
- const since = monitor.verdict === "diverged" ? monitor.divergedAt : monitor.armedAt;
33877
- const held = since !== null ? ` for ${humanDuration(Math.max(0, now - since))}` : "";
33878
- if (monitor.latched) return monitor.verdict === "diverged" ? `CHANGED${held} — press Reset when you have dealt with it.` : `Back to normal, but still flagged as changed${held}. Press Reset to clear it.`;
33879
- const paused = suspensionLine(monitor);
33880
- if (paused !== null) return paused;
33881
- return monitor.verdict === "diverged" ? `CHANGED${held}` : `Normal${held}`;
33882
- }
33883
- /** The badge word. `latched` wins over `verdict`, because the latch is the
33884
- * thing the operator asked to be told and it outlives the live state.
33885
- *
33886
- * A scene sitting out an uncovered light reads `Paused`, in the NEUTRAL tone —
33887
- * never `alarm`, and never the `danger` variant the page maps that to. A
33888
- * missing IR reference must not be able to paint a red badge on a scene that
33889
- * is doing exactly what it was configured to do. */
33890
- function badgeFor(monitor) {
33891
- if (monitor.states.length === 0) return {
33892
- text: "Not armed",
33893
- tone: "unknown"
33894
- };
33895
- if (monitor.latched) return {
33896
- text: "Changed",
33897
- tone: "alarm"
33898
- };
33899
- if (monitor.suspendedCondition !== null) return {
33900
- text: "Paused",
33901
- tone: "unknown"
33902
- };
33903
- if (monitor.verdict === "unknown") return {
33904
- text: "Can’t tell",
33905
- tone: "unknown"
33906
- };
33907
- return monitor.verdict === "diverged" ? {
33908
- text: "Changed",
33909
- tone: "alarm"
33910
- } : {
33911
- text: "Normal",
33912
- tone: "ok"
33913
- };
33914
- }
33915
- /** A rect covering most of the frame is dominated by weather, sky and parked
33916
- * cars: the bin is 2 % of the pixels and CLIP will not notice it leaving. The
33917
- * failure is silent INSENSITIVITY, which is the worst kind — hence a warning
33918
- * rather than a refusal. */
33919
- var ROI_AREA_WARN_FRACTION = .4;
33920
- function roiTooLarge(roi) {
33921
- return roi.width * roi.height > ROI_AREA_WARN_FRACTION;
33922
- }
33923
- function humanDuration(ms) {
33924
- const s = Math.floor(ms / 1e3);
33925
- if (s < 60) return `${s}s`;
33926
- const m = Math.floor(s / 60);
33927
- if (m < 60) return `${m}m`;
33928
- const h = Math.floor(m / 60);
33929
- if (h < 48) return `${h}h`;
33930
- return `${Math.floor(h / 24)}d`;
33931
- }
33932
- //#endregion
33933
- //#region src/composites/code-block.tsx
33934
- function CodeBlock({ children, maxHeight = 300, className }) {
33935
- const [copied, setCopied] = useState(false);
33936
- const handleCopy = useCallback(() => {
33937
- navigator.clipboard.writeText(children).then(() => {
33938
- setCopied(true);
33939
- setTimeout(() => setCopied(false), 2e3);
33940
- });
33941
- }, [children]);
33942
- return /* @__PURE__ */ jsxs("div", {
33943
- className: cn("relative group", className),
33944
- children: [/* @__PURE__ */ jsx(ScrollArea, {
33945
- style: { maxHeight },
33946
- children: /* @__PURE__ */ jsx("pre", {
33947
- className: "font-mono text-xs bg-surface p-3 rounded-md border border-border-subtle",
33948
- children: /* @__PURE__ */ jsx("code", { children })
33949
- })
33950
- }), /* @__PURE__ */ jsx("div", {
33951
- className: "absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",
33952
- children: /* @__PURE__ */ jsx(IconButton, {
33953
- icon: copied ? Check : Copy,
33954
- "aria-label": "Copy code",
33955
- variant: "ghost",
33956
- size: "sm",
33957
- onClick: handleCopy
33958
- })
33959
- })]
33960
- });
33961
- }
33962
- //#endregion
33963
- //#region src/composites/confirm-action-button.tsx
33964
- /**
33965
- * ConfirmActionButton — destructive-action button with a modal confirm.
33966
- *
33967
- * Two-step UX for any operation operators shouldn't trigger by accident:
33968
- * reboot device, restart addon, regenerate token, etc. The trigger is a
33969
- * normal Button that opens a Dialog; confirming runs the async action,
33970
- * the trigger spinner-disables itself for the duration, and the dialog
33971
- * closes on success. Errors surface inline at the dialog's bottom.
33972
- *
33973
- * Generic on `TResult` so callers don't have to discard the return
33974
- * value. Pass an `icon` to render it inside the trigger (e.g. RotateCw
33975
- * for reboot, RefreshCw for restart).
33976
- */
33977
- function ConfirmActionButton({ label, icon: Icon, title = "Confirm action", description, confirmLabel, triggerVariant = "outline", confirmVariant = "danger", size = "sm", disabled, className, action, onSuccess }) {
33978
- const [open, setOpen] = useState(false);
33979
- const [running, setRunning] = useState(false);
33980
- const [error, setError] = useState(null);
33981
- const handleConfirm = async () => {
33982
- setError(null);
33983
- setRunning(true);
33984
- try {
33985
- const result = await action();
33986
- onSuccess?.(result);
33987
- setOpen(false);
33988
- } catch (err) {
33989
- setError(err instanceof Error ? err.message : String(err));
33990
- } finally {
33991
- setRunning(false);
33992
- }
33993
- };
33994
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs(Button, {
33995
- type: "button",
33996
- variant: triggerVariant,
33997
- size,
33998
- disabled,
33999
- onClick: () => {
34000
- setError(null);
34001
- setOpen(true);
34002
- },
34003
- className,
34004
- children: [Icon && /* @__PURE__ */ jsx(Icon, { className: "h-3.5 w-3.5" }), label]
34005
- }), /* @__PURE__ */ jsx(Dialog, {
34006
- open,
34007
- onOpenChange: (next) => !running && setOpen(next),
34008
- children: /* @__PURE__ */ jsxs(DialogContent, { children: [
34009
- /* @__PURE__ */ jsxs(DialogHeader, { children: [/* @__PURE__ */ jsxs(DialogTitle, {
34010
- className: "flex items-center gap-2",
34011
- children: [/* @__PURE__ */ jsx(TriangleAlert, { className: "h-4 w-4 text-amber-400" }), title]
34012
- }), typeof description === "string" ? /* @__PURE__ */ jsx(DialogDescription, { children: description }) : description] }),
34013
- error && /* @__PURE__ */ jsx("div", {
34014
- className: cn("mt-2 px-3 py-2 rounded border border-danger/40 bg-danger/10", "text-xs text-danger"),
34015
- children: error
34016
- }),
34017
- /* @__PURE__ */ jsxs(DialogFooter, { children: [/* @__PURE__ */ jsx(Button, {
34018
- type: "button",
34019
- variant: "ghost",
34020
- size,
34021
- disabled: running,
34022
- onClick: () => setOpen(false),
34023
- children: "Cancel"
34024
- }), /* @__PURE__ */ jsxs(Button, {
34025
- type: "button",
34026
- variant: confirmVariant,
34027
- size,
34028
- disabled: running,
34029
- onClick: () => {
34030
- handleConfirm();
34031
- },
34032
- children: [running && /* @__PURE__ */ jsx(LoaderCircle, { className: "h-3.5 w-3.5 animate-spin" }), confirmLabel ?? label]
34033
- })] })
34034
- ] })
34035
- })] });
34036
- }
34037
- //#endregion
34038
- //#region src/composites/copy-button.tsx
34039
- /**
34040
- * `CopyButton` — a compact button that copies a string `value` to the
34041
- * clipboard via `navigator.clipboard.writeText`, showing a brief
34042
- * "copied" check state. Addon-agnostic; used wherever a secret / URL
34043
- * needs a one-click copy affordance (export setup panels, etc.).
34044
- */
34045
- var COPIED_RESET_MS = 2e3;
34046
- function CopyButton({ value, label, srLabel, className, disabled }) {
34047
- const [copied, setCopied] = useState(false);
34048
- const handleCopy = useCallback(() => {
34049
- if (!value) return;
34050
- navigator.clipboard.writeText(value).then(() => {
34051
- setCopied(true);
34052
- setTimeout(() => setCopied(false), COPIED_RESET_MS);
34053
- });
34054
- }, [value]);
34055
- return /* @__PURE__ */ jsxs(Button, {
34056
- size: "sm",
34057
- variant: "ghost",
34058
- type: "button",
34059
- disabled: disabled || value.length === 0,
34060
- onClick: handleCopy,
34061
- className: cn(className),
34062
- "aria-label": copied ? "Copied" : `Copy ${srLabel ?? label ?? "value"}`,
34063
- children: [copied ? /* @__PURE__ */ jsx(Check, { className: "h-3.5 w-3.5 text-success" }) : /* @__PURE__ */ jsx(Copy, { className: "h-3.5 w-3.5" }), label ? /* @__PURE__ */ jsx("span", {
34064
- className: "ml-1",
34065
- children: copied ? "Copied" : label
34066
- }) : null]
34067
- });
34068
- }
34069
- //#endregion
34070
- //#region src/composites/data-table-layout.ts
34071
- /**
34072
- * At this many columns and above, `auto` switches a narrow viewport to cards.
34073
- * Three columns still fit a phone at a readable size; four do not.
34074
- */
34075
- var CARD_MODE_MIN_COLUMNS = 4;
34076
- function resolveTableLayout({ mode, columnCount, isNarrow }) {
34077
- if (!isNarrow) return "table";
34078
- if (mode === "scroll") return "table";
34079
- if (mode === "cards") return "cards";
34080
- if (columnCount === 0) return "table";
34081
- return columnCount >= 4 ? "cards" : "table";
34082
- }
34083
- //#endregion
34084
33841
  //#region src/lib/responsive.ts
34085
33842
  /**
34086
33843
  * Responsive design tokens — three-tier system.
@@ -34192,6 +33949,20 @@ var CHIP_BASE = "inline-flex items-center gap-1 rounded-full border px-1.5 py-0.
34192
33949
  var CHIP_ACTIVE = "border-primary/50 bg-primary/15 text-primary";
34193
33950
  var CHIP_INACTIVE = "border-border bg-surface text-foreground-subtle hover:bg-surface-hover";
34194
33951
  //#endregion
33952
+ //#region src/composites/data-table-layout.ts
33953
+ /**
33954
+ * At this many columns and above, `auto` switches a narrow viewport to cards.
33955
+ * Three columns still fit a phone at a readable size; four do not.
33956
+ */
33957
+ var CARD_MODE_MIN_COLUMNS = 4;
33958
+ function resolveTableLayout({ mode, columnCount, isNarrow }) {
33959
+ if (!isNarrow) return "table";
33960
+ if (mode === "scroll") return "table";
33961
+ if (mode === "cards") return "cards";
33962
+ if (columnCount === 0) return "table";
33963
+ return columnCount >= 4 ? "cards" : "table";
33964
+ }
33965
+ //#endregion
34195
33966
  //#region src/composites/setting-row.tsx
34196
33967
  function SettingRow({ label, children, actions, elements = "plain", className, valueClassName }) {
34197
33968
  const LabelTag = elements === "description" ? "dt" : "span";
@@ -34227,263 +33998,2418 @@ function SortHeaderButton({ label, active, dir, onSort }) {
34227
33998
  children: [/* @__PURE__ */ jsx("span", { children: label }), active ? dir === "asc" ? /* @__PURE__ */ jsx(ChevronUp, { className: "h-3 w-3 flex-shrink-0" }) : /* @__PURE__ */ jsx(ChevronDown, { className: "h-3 w-3 flex-shrink-0" }) : /* @__PURE__ */ jsx(ChevronUp, { className: cn("h-3 w-3 flex-shrink-0 opacity-0 transition-opacity", "group-hover/sort:opacity-30") })]
34228
33999
  });
34229
34000
  }
34230
- //#endregion
34231
- //#region src/composites/table-sort.ts
34001
+ //#endregion
34002
+ //#region src/composites/table-sort.ts
34003
+ /**
34004
+ * The toggle rule, and the only copy of it.
34005
+ *
34006
+ * none → asc → desc → none, and a click on a DIFFERENT column starts that
34007
+ * column fresh at `asc`. `sameColumn` says whether the clicked column is the
34008
+ * one currently sorted; `currentDir` is its direction (`null` when nothing is
34009
+ * sorted). Returns the next direction, or `null` for "unsorted".
34010
+ *
34011
+ * Split out from {@link nextTableSort} so the device list — whose sort state
34012
+ * keys columns by `columnId`, not `columnKey` — can reuse the rule without a
34013
+ * cast and without a second copy of it.
34014
+ */
34015
+ function nextSortDirection(sameColumn, currentDir) {
34016
+ if (!sameColumn || currentDir === null) return "asc";
34017
+ return currentDir === "asc" ? "desc" : null;
34018
+ }
34019
+ /**
34020
+ * Toggle a column's sort on header click: none → asc → desc → none.
34021
+ * Clicking a DIFFERENT column starts it fresh at `asc`.
34022
+ */
34023
+ function nextTableSort(current, columnKey) {
34024
+ const dir = nextSortDirection(current !== null && current.columnKey === columnKey, current === null ? null : current.dir);
34025
+ return dir === null ? null : {
34026
+ columnKey,
34027
+ dir
34028
+ };
34029
+ }
34030
+ /**
34031
+ * Ascending comparison of two cell values.
34032
+ *
34033
+ * Numbers compare numerically and strings compare with `localeCompare` — a
34034
+ * numeric column must never be ordered as text ("100" before "9"), and a text
34035
+ * column must respect the locale's collation. A mixed column (one row a
34036
+ * number, another a string) falls back to string comparison of both, which is
34037
+ * the only total order available; it is not a shape any caller should build on
34038
+ * purpose.
34039
+ *
34040
+ * `null` is NOT handled here — {@link sortRowsByColumn} pulls it out first,
34041
+ * because its placement is direction-independent and a comparator that is
34042
+ * multiplied by the direction factor cannot express that.
34043
+ */
34044
+ function compareValues(a, b) {
34045
+ if (typeof a === "number" && typeof b === "number") return a - b;
34046
+ return String(a).localeCompare(String(b));
34047
+ }
34048
+ /**
34049
+ * Return a NEW array of `rows` ordered by `sort`.
34050
+ *
34051
+ * `valueOf` is the column's `sortValue` — it is called once per row per
34052
+ * comparison, so it must be cheap (read a field, do not format a string).
34053
+ * `sort === null` ⇒ a fresh shallow copy in the incoming order.
34054
+ */
34055
+ function sortRowsByColumn(rows, sort, valueOf) {
34056
+ if (sort === null) return [...rows];
34057
+ const factor = sort.dir === "asc" ? 1 : -1;
34058
+ return rows.toSorted((a, b) => {
34059
+ const av = valueOf(a);
34060
+ const bv = valueOf(b);
34061
+ if (av === null || bv === null) {
34062
+ if (av === bv) return 0;
34063
+ return av === null ? 1 : -1;
34064
+ }
34065
+ return factor * compareValues(av, bv);
34066
+ });
34067
+ }
34068
+ /** Derive the `<th>` `aria-sort` for `columnKey` from the table's sort state. */
34069
+ function ariaSortForColumn(sort, columnKey) {
34070
+ if (sort === null || sort.columnKey !== columnKey) return "none";
34071
+ return sort.dir === "asc" ? "ascending" : "descending";
34072
+ }
34073
+ //#endregion
34074
+ //#region src/composites/data-table.tsx
34075
+ /**
34076
+ * DataTable — shared responsive table for admin pages.
34077
+ *
34078
+ * Recipes baked in:
34079
+ * - `overflow-x-auto` wrapper so narrow viewports don't clip the
34080
+ * right edge (the rounded border survives the scroll).
34081
+ * - `min-w-[Npx]` on the inner table so columns don't squash below
34082
+ * readable width before the scroll kicks in.
34083
+ * - `whitespace-nowrap` on headers — column titles never wrap to
34084
+ * two lines (`AUTO-KILL` was the regression that triggered this).
34085
+ * - Themed `bg-surface` + `border-border` so contrast works in both
34086
+ * light and dark themes.
34087
+ *
34088
+ * Column model: caller supplies `columns: DataColumn<T>[]` and
34089
+ * `rows: T[]`. Each column declares `header`, optional `align`,
34090
+ * optional `nowrap`, and a `render(row) => ReactNode` that produces
34091
+ * the cell content.
34092
+ *
34093
+ * <DataTable
34094
+ * columns={[
34095
+ * { key: 'username', header: 'Username', render: (u) => u.username },
34096
+ * { key: 'role', header: 'Role', render: (u) => <RoleBadge .../> },
34097
+ * { key: 'actions', header: '', align: 'right', render: (u) => <Actions .../> },
34098
+ * ]}
34099
+ * rows={users}
34100
+ * minWidthPx={560}
34101
+ * />
34102
+ *
34103
+ * If finer header markup is needed, pass `headerRender` instead of
34104
+ * `header` (e.g. for a sortable click affordance).
34105
+ *
34106
+ * ── Narrow viewports ──────────────────────────────────────────────────────
34107
+ * The table stays a table. The wrapper is `overflow-x-auto`, so a phone
34108
+ * scrolls the columns sideways INSIDE the table — the page body never moves
34109
+ * sideways, and the cells stay one line (`whitespace-nowrap`). That is the
34110
+ * default (`mobileMode="scroll"`). Cards are opt-in via `mobileMode="cards"`;
34111
+ * `auto` still applies the old column-count rule for a surface that wants it.
34112
+ * See `resolveTableLayout`.
34113
+ *
34114
+ * ── Scrolling the BODY, not the page ──────────────────────────────────────
34115
+ * `maxBodyHeight` caps the table and scrolls its rows INSIDE the container
34116
+ * with the column header pinned. It is ONE prop, not two, because "this list
34117
+ * scrolls internally" and "its header stays visible" are the same decision: a
34118
+ * capped table whose header scrolls away is a list of unlabelled cells.
34119
+ *
34120
+ * Use it wherever the row count is open-ended (rules, targets, delivery
34121
+ * history) so the page keeps its own header, filters and actions in view while
34122
+ * the operator moves through the rows.
34123
+ */
34124
+ /**
34125
+ * The default cap for an internally-scrolling table.
34126
+ *
34127
+ * `60vh` leaves the page header, its filters and its actions on screen at
34128
+ * every viewport while still showing ~10 rows — and it is a fraction, so it
34129
+ * does not need a breakpoint of its own.
34130
+ */
34131
+ var TABLE_SCROLL_MAX_H = "max-h-[60vh]";
34132
+ var ALIGN_CLASS = {
34133
+ left: "text-left",
34134
+ right: "text-right",
34135
+ center: "text-center"
34136
+ };
34137
+ function DataTable({ columns, rows, rowKey, onRowClick, minWidthPx = 480, emptyMessage, className, bordered = true, rowClassName, mobileMode = "scroll", maxBodyHeight, defaultSort }) {
34138
+ const isNarrow = useIsMobile();
34139
+ const [sort, setSort] = useState(defaultSort ?? null);
34140
+ const layout = resolveTableLayout({
34141
+ mode: mobileMode,
34142
+ columnCount: columns.length,
34143
+ isNarrow
34144
+ });
34145
+ const scrolls = maxBodyHeight !== void 0;
34146
+ const sortedColumn = useMemo(() => sort === null ? void 0 : columns.find((col) => col.key === sort.columnKey && col.sortValue !== void 0), [columns, sort]);
34147
+ const sortValue = sortedColumn?.sortValue;
34148
+ const displayRows = useMemo(() => sortValue === void 0 ? rows : sortRowsByColumn(rows, sort, sortValue), [
34149
+ rows,
34150
+ sort,
34151
+ sortValue
34152
+ ]);
34153
+ const activeSort = sortedColumn === void 0 ? null : sort;
34154
+ if (rows.length === 0 && emptyMessage) return /* @__PURE__ */ jsx("div", {
34155
+ className: `rounded-lg ${bordered ? "border border-border" : ""} bg-surface px-3 py-4 text-xs text-foreground-subtle text-center ${className ?? ""}`,
34156
+ children: emptyMessage
34157
+ });
34158
+ if (rows.length === 0) return null;
34159
+ if (layout === "cards") return /* @__PURE__ */ jsx("div", {
34160
+ className: `space-y-2 ${scrolls ? `${maxBodyHeight} overflow-y-auto` : ""} ${className ?? ""}`,
34161
+ children: displayRows.map((row, rowIndex) => /* @__PURE__ */ jsx(DataTableCard, {
34162
+ row,
34163
+ rowIndex,
34164
+ columns,
34165
+ bordered,
34166
+ onRowClick,
34167
+ rowClassName
34168
+ }, rowKey ? rowKey(row, rowIndex) : rowIndex))
34169
+ });
34170
+ return /* @__PURE__ */ jsx("div", {
34171
+ className: [
34172
+ "rounded-lg",
34173
+ bordered ? "border border-border" : "",
34174
+ "bg-surface overflow-x-auto",
34175
+ scrolls ? `${maxBodyHeight} overflow-y-auto` : "",
34176
+ className ?? ""
34177
+ ].filter(Boolean).join(" "),
34178
+ children: /* @__PURE__ */ jsxs("table", {
34179
+ className: `w-full text-xs ${scrolls ? "border-separate border-spacing-0" : ""}`,
34180
+ style: { minWidth: `${minWidthPx}px` },
34181
+ children: [/* @__PURE__ */ jsx("thead", {
34182
+ className: "bg-surface",
34183
+ children: /* @__PURE__ */ jsx("tr", { children: columns.map((col) => {
34184
+ const align = col.align ?? "left";
34185
+ const nowrap = col.nowrap ?? true;
34186
+ const sortable = col.sortValue !== void 0;
34187
+ const isSorted = activeSort !== null && activeSort.columnKey === col.key;
34188
+ return /* @__PURE__ */ jsx("th", {
34189
+ "aria-sort": sortable ? ariaSortForColumn(activeSort, col.key) : void 0,
34190
+ title: sortable ? void 0 : col.notSortableReason,
34191
+ className: [
34192
+ "px-3 py-2 text-foreground-subtle font-medium bg-surface border-b border-border",
34193
+ scrolls ? "sticky top-0 z-10" : "",
34194
+ ALIGN_CLASS[align],
34195
+ nowrap ? "whitespace-nowrap" : "",
34196
+ col.width ?? ""
34197
+ ].filter(Boolean).join(" "),
34198
+ children: sortable ? /* @__PURE__ */ jsx(SortHeaderButton, {
34199
+ label: col.headerRender ? col.headerRender() : col.header,
34200
+ active: isSorted,
34201
+ dir: isSorted && activeSort !== null ? activeSort.dir : "asc",
34202
+ onSort: () => setSort((prev) => nextTableSort(prev, col.key))
34203
+ }) : col.headerRender ? col.headerRender() : col.header
34204
+ }, col.key);
34205
+ }) })
34206
+ }), /* @__PURE__ */ jsx("tbody", { children: displayRows.map((row, rowIndex) => {
34207
+ const key = rowKey ? rowKey(row, rowIndex) : rowIndex;
34208
+ const extra = rowClassName?.(row, rowIndex) ?? "";
34209
+ const interactive = onRowClick !== void 0;
34210
+ return /* @__PURE__ */ jsx("tr", {
34211
+ onClick: interactive ? () => onRowClick(row, rowIndex) : void 0,
34212
+ className: [interactive ? "cursor-pointer hover:bg-primary/5" : "hover:bg-primary/5", extra].filter(Boolean).join(" "),
34213
+ children: columns.map((col) => {
34214
+ const align = col.align ?? "left";
34215
+ const nowrap = col.nowrap ?? true;
34216
+ return /* @__PURE__ */ jsx("td", {
34217
+ className: [
34218
+ "px-3 py-2 text-foreground border-b border-border",
34219
+ ALIGN_CLASS[align],
34220
+ nowrap ? "whitespace-nowrap" : ""
34221
+ ].filter(Boolean).join(" "),
34222
+ children: col.render(row, rowIndex)
34223
+ }, col.key);
34224
+ })
34225
+ }, key);
34226
+ }) })]
34227
+ })
34228
+ });
34229
+ }
34230
+ /**
34231
+ * One row as a card. Columns that carry a plain-text `header` become labelled
34232
+ * `SettingRow`s — the label is the column title and the value gets the full
34233
+ * card width. Columns with no text header (an actions column, a
34234
+ * `headerRender`-only column) have no label to show, so they render as a
34235
+ * full-width strip at the foot of the card.
34236
+ */
34237
+ function DataTableCard({ row, rowIndex, columns, bordered, onRowClick, rowClassName }) {
34238
+ const labelled = columns.filter((col) => col.header !== void 0 && col.header !== "");
34239
+ const unlabelled = columns.filter((col) => col.header === void 0 || col.header === "");
34240
+ const interactive = onRowClick !== void 0;
34241
+ const extra = rowClassName?.(row, rowIndex) ?? "";
34242
+ return /* @__PURE__ */ jsxs("div", {
34243
+ "data-data-table-card": "",
34244
+ onClick: interactive ? () => onRowClick(row, rowIndex) : void 0,
34245
+ className: [
34246
+ "rounded-lg bg-surface px-3 py-1.5 divide-y divide-border-subtle",
34247
+ bordered ? "border border-border" : "",
34248
+ interactive ? "cursor-pointer hover:bg-primary/5" : "",
34249
+ extra
34250
+ ].filter(Boolean).join(" "),
34251
+ children: [labelled.map((col) => /* @__PURE__ */ jsx(SettingRow, {
34252
+ label: col.header,
34253
+ children: col.render(row, rowIndex)
34254
+ }, col.key)), unlabelled.length > 0 && /* @__PURE__ */ jsx("div", {
34255
+ className: "flex flex-wrap items-center justify-end gap-2 py-1.5",
34256
+ children: unlabelled.map((col) => /* @__PURE__ */ jsx("div", { children: col.render(row, rowIndex) }, col.key))
34257
+ })]
34258
+ });
34259
+ }
34260
+ //#endregion
34261
+ //#region src/composites/key-value-list.tsx
34262
+ /**
34263
+ * A `<dl>` of label/value rows. Layout (including the L1 stacking) is owned by
34264
+ * `SettingRow`; this composite only supplies the description-list semantics.
34265
+ *
34266
+ * The rows used to be `flex items-center h-7` with a `w-1/3` term, so a label
34267
+ * could neither wrap nor stack: on a phone it took a third of the width and
34268
+ * the value took whatever was left.
34269
+ */
34270
+ function KeyValueList({ items, className }) {
34271
+ return /* @__PURE__ */ jsx("dl", {
34272
+ className: cn("flex flex-col", className),
34273
+ children: items.map((item) => /* @__PURE__ */ jsx(SettingRow, {
34274
+ elements: "description",
34275
+ label: item.key,
34276
+ children: item.value
34277
+ }, item.key))
34278
+ });
34279
+ }
34280
+ //#endregion
34281
+ //#region src/composites/section-card.tsx
34282
+ function SectionCard({ headingId, title, icon: Icon, actions, testId, children }) {
34283
+ return /* @__PURE__ */ jsxs("section", {
34284
+ "aria-labelledby": headingId,
34285
+ className: SECTION_CARD,
34286
+ "data-testid": testId,
34287
+ children: [/* @__PURE__ */ jsxs("header", {
34288
+ className: `${SECTION_HEADER} flex min-h-9 flex-wrap items-center gap-2`,
34289
+ children: [
34290
+ Icon !== void 0 && /* @__PURE__ */ jsx(Icon, {
34291
+ className: "h-3.5 w-3.5 shrink-0 text-foreground-subtle",
34292
+ "aria-hidden": true
34293
+ }),
34294
+ /* @__PURE__ */ jsx("h2", {
34295
+ id: headingId,
34296
+ className: `${TEXT_SECTION_LABEL} min-w-0 flex-1`,
34297
+ children: title
34298
+ }),
34299
+ actions
34300
+ ]
34301
+ }), children]
34302
+ });
34303
+ }
34304
+ //#endregion
34305
+ //#region src/composites/webrtc-diagnostics/ice-candidates.ts
34306
+ var CANDIDATE_TYPES = [
34307
+ "host",
34308
+ "srflx",
34309
+ "prflx",
34310
+ "relay"
34311
+ ];
34312
+ function intOrNull(token) {
34313
+ if (token === void 0 || !/^\d+$/.test(token)) return null;
34314
+ const n = Number(token);
34315
+ return Number.isSafeInteger(n) ? n : null;
34316
+ }
34317
+ function familyOf(address) {
34318
+ if (address.length === 0) return "unknown";
34319
+ if (address.toLowerCase().endsWith(".local")) return "mdns";
34320
+ if (address.includes(":")) return "ipv6";
34321
+ if (/^\d{1,3}(\.\d{1,3}){3}$/.test(address)) return "ipv4";
34322
+ return "unknown";
34323
+ }
34324
+ function ipv4Octets(address) {
34325
+ const parts = address.split(".");
34326
+ if (parts.length !== 4) return null;
34327
+ const octets = parts.map((p) => Number(p));
34328
+ return octets.every((o) => Number.isInteger(o) && o >= 0 && o <= 255) ? octets : null;
34329
+ }
34330
+ function ipv4Scope(address) {
34331
+ const o = ipv4Octets(address);
34332
+ if (o === null) return "unknown";
34333
+ const [a = -1, b = -1] = o;
34334
+ if (a === 127) return "loopback";
34335
+ if (a === 169 && b === 254) return "link-local";
34336
+ if (a === 10 || a === 192 && b === 168 || a === 172 && b >= 16 && b <= 31) return "lan";
34337
+ if (a === 100 && b >= 64 && b <= 127) return "tailscale";
34338
+ return "public";
34339
+ }
34340
+ function ipv6Scope(address) {
34341
+ const lower = address.toLowerCase();
34342
+ if (lower === "::1") return "loopback";
34343
+ if (/^fe[89ab]/.test(lower)) return "link-local";
34344
+ if (lower.startsWith("fd7a:115c:a1e0:")) return "tailscale";
34345
+ if (/^f[cd]/.test(lower)) return "lan";
34346
+ return "public";
34347
+ }
34348
+ function classifyAddressScope(address) {
34349
+ switch (familyOf(address)) {
34350
+ case "mdns": return "mdns";
34351
+ case "ipv4": return ipv4Scope(address);
34352
+ case "ipv6": return ipv6Scope(address);
34353
+ default: return "unknown";
34354
+ }
34355
+ }
34356
+ /** Parse one candidate attribute (`candidate:…`, with or without `a=`). */
34357
+ function parseIceCandidate(line) {
34358
+ const raw = line.trim().replace(/^a=/, "");
34359
+ if (!raw.startsWith("candidate:")) return null;
34360
+ const parts = raw.slice(10).split(/\s+/);
34361
+ const address = parts[4] ?? "";
34362
+ const typIdx = parts.indexOf("typ");
34363
+ const typeToken = typIdx >= 0 ? parts[typIdx + 1] : void 0;
34364
+ const type = CANDIDATE_TYPES.find((t) => t === typeToken) ?? "unknown";
34365
+ const raddrIdx = parts.indexOf("raddr");
34366
+ const rportIdx = parts.indexOf("rport");
34367
+ const protocol = parts[2]?.toLowerCase();
34368
+ return {
34369
+ type,
34370
+ protocol: protocol !== void 0 && protocol.length > 0 ? protocol : null,
34371
+ address: address.length > 0 ? address : null,
34372
+ port: intOrNull(parts[5]),
34373
+ relatedAddress: raddrIdx >= 0 ? parts[raddrIdx + 1] ?? null : null,
34374
+ relatedPort: rportIdx >= 0 ? intOrNull(parts[rportIdx + 1]) : null,
34375
+ family: familyOf(address),
34376
+ scope: classifyAddressScope(address),
34377
+ raw
34378
+ };
34379
+ }
34380
+ /** Every `a=candidate` line of an SDP, in order. */
34381
+ function candidateLinesFromSdp(sdp) {
34382
+ return sdp.split(/\r?\n/).map((l) => l.trim()).filter((l) => l.startsWith("a=candidate:"));
34383
+ }
34384
+ function candidateKey(c) {
34385
+ return `${c.type}|${c.protocol ?? "?"}|${c.address ?? "?"}|${String(c.port ?? "?")}`;
34386
+ }
34387
+ var PRIVATE_SCOPES = new Set([
34388
+ "loopback",
34389
+ "link-local",
34390
+ "lan",
34391
+ "tailscale",
34392
+ "mdns"
34393
+ ]);
34394
+ function emptyCounts() {
34395
+ return {
34396
+ host: 0,
34397
+ srflx: 0,
34398
+ prflx: 0,
34399
+ relay: 0,
34400
+ unknown: 0
34401
+ };
34402
+ }
34403
+ function countCandidateTypes(candidates) {
34404
+ const counts = emptyCounts();
34405
+ for (const c of candidates) counts[c.type] += 1;
34406
+ return counts;
34407
+ }
34408
+ function reachabilityFlag(answered, candidates) {
34409
+ if (!answered && candidates.length === 0) return "unknown";
34410
+ if (candidates.length === 0) return "none";
34411
+ if (candidates.some((c) => c.type === "srflx" || c.type === "relay" || c.type === "host" && c.scope === "public")) return "public-path";
34412
+ return candidates.every((c) => PRIVATE_SCOPES.has(c.scope)) ? "private-only" : "public-path";
34413
+ }
34414
+ /** The hub's offered candidates: answer SDP plus trickle, deduplicated. */
34415
+ function summarizeHubCandidates(input) {
34416
+ const seen = /* @__PURE__ */ new Set();
34417
+ const candidates = [];
34418
+ const add = (line) => {
34419
+ const c = parseIceCandidate(line);
34420
+ if (c === null) return false;
34421
+ const key = candidateKey(c);
34422
+ if (seen.has(key)) return false;
34423
+ seen.add(key);
34424
+ candidates.push(c);
34425
+ return true;
34426
+ };
34427
+ let fromSdp = 0;
34428
+ for (const line of candidateLinesFromSdp(input.sdpAnswer ?? "")) if (add(line)) fromSdp += 1;
34429
+ let fromTrickle = 0;
34430
+ for (const line of input.trickled) if (add(line)) fromTrickle += 1;
34431
+ return {
34432
+ candidates,
34433
+ fromSdp,
34434
+ fromTrickle,
34435
+ countByType: countCandidateTypes(candidates),
34436
+ hasSrflx: candidates.some((c) => c.type === "srflx"),
34437
+ hasRelay: candidates.some((c) => c.type === "relay"),
34438
+ hasPublicHost: candidates.some((c) => c.type === "host" && c.scope === "public"),
34439
+ flag: reachabilityFlag(input.sdpAnswer !== null, candidates),
34440
+ trickleDone: input.trickleDone
34441
+ };
34442
+ }
34443
+ //#endregion
34444
+ //#region src/composites/webrtc-diagnostics/endpoint-probe.ts
34445
+ /**
34446
+ * Browser-side probes behind "Test each endpoint" and the NAT mapping check.
34447
+ *
34448
+ * Everything runs in the operator's browser against real `RTCPeerConnection`s;
34449
+ * the only server round-trip is fetching the ICE server list.
34450
+ *
34451
+ * - `gatherCandidates` — one peer connection, a given server set: which
34452
+ * candidate types it produces, which server URL produced each (the ICE
34453
+ * event's `url`) and, for a relay, the transport to the TURN server
34454
+ * (`relayProtocol`: udp / tcp / tls).
34455
+ * - `relayLoopback` — two peer connections in this page, both forced to
34456
+ * `relay`: the ONLY way they connect is through the TURN server, so a
34457
+ * connect proves allocation and forwarding work, and the selected pair
34458
+ * gives the relay RTT and the local relay protocol from `getStats()`.
34459
+ * (A same-page loopback with policy `all` proves nothing — the two peers
34460
+ * connect host↔host — which is why it is not offered.)
34461
+ *
34462
+ * Credentials are attached to `turn:`/`turns:` entries only and never leave
34463
+ * this module: nothing here logs or returns them.
34464
+ */
34465
+ function toRtcIceServers(servers) {
34466
+ return servers.map((s) => {
34467
+ if (/^turns?:/i.test(s.url) && s.username !== void 0 && s.credential !== void 0) return {
34468
+ urls: s.url,
34469
+ username: s.username,
34470
+ credential: s.credential
34471
+ };
34472
+ return { urls: s.url };
34473
+ });
34474
+ }
34475
+ /** `RTCPeerConnectionIceEvent.url` — a real field missing from this lib.dom. */
34476
+ function iceEventUrl(e) {
34477
+ if ("url" in e && typeof e.url === "string" && e.url.length > 0) return e.url;
34478
+ return null;
34479
+ }
34480
+ /** `RTCIceCandidate.relayProtocol` — Chromium and WebKit report it; lib.dom does not type it. */
34481
+ function candidateRelayProtocol(c) {
34482
+ if ("relayProtocol" in c && typeof c.relayProtocol === "string" && c.relayProtocol.length > 0) return c.relayProtocol;
34483
+ return null;
34484
+ }
34485
+ /** One local candidate from an ICE event, or null for the end-of-candidates event. */
34486
+ function probedCandidateFromEvent(e, tMs) {
34487
+ const raw = e.candidate?.candidate;
34488
+ if (e.candidate === null || raw === void 0 || raw.length === 0) return null;
34489
+ const candidate = parseIceCandidate(raw);
34490
+ if (candidate === null) return null;
34491
+ return {
34492
+ candidate,
34493
+ url: iceEventUrl(e),
34494
+ relayProtocol: candidateRelayProtocol(e.candidate),
34495
+ tMs
34496
+ };
34497
+ }
34498
+ function errorText$1(err) {
34499
+ return err instanceof Error ? err.message : String(err);
34500
+ }
34501
+ async function gatherCandidates(servers, policy, timeoutMs = 8e3) {
34502
+ const start = performance.now();
34503
+ const candidates = [];
34504
+ const pc = new RTCPeerConnection({
34505
+ iceServers: toRtcIceServers(servers),
34506
+ iceTransportPolicy: policy
34507
+ });
34508
+ try {
34509
+ pc.createDataChannel("probe");
34510
+ const done = new Promise((resolve) => {
34511
+ const timer = setTimeout(() => resolve(true), timeoutMs);
34512
+ pc.addEventListener("icecandidate", (e) => {
34513
+ if (e.candidate === null) {
34514
+ clearTimeout(timer);
34515
+ resolve(false);
34516
+ return;
34517
+ }
34518
+ const probed = probedCandidateFromEvent(e, performance.now() - start);
34519
+ if (probed !== null) candidates.push(probed);
34520
+ });
34521
+ });
34522
+ await pc.setLocalDescription(await pc.createOffer());
34523
+ const timedOut = await done;
34524
+ return {
34525
+ candidates,
34526
+ durationMs: performance.now() - start,
34527
+ timedOut,
34528
+ error: null
34529
+ };
34530
+ } catch (err) {
34531
+ return {
34532
+ candidates,
34533
+ durationMs: performance.now() - start,
34534
+ timedOut: false,
34535
+ error: errorText$1(err)
34536
+ };
34537
+ } finally {
34538
+ pc.close();
34539
+ }
34540
+ }
34541
+ function selectedPairFacts(report) {
34542
+ const byId = /* @__PURE__ */ new Map();
34543
+ const pairs = [];
34544
+ const selected = { id: null };
34545
+ report.forEach((raw) => {
34546
+ const s = raw;
34547
+ if (s.id !== void 0) byId.set(s.id, s);
34548
+ if (s.type === "candidate-pair") pairs.push(s);
34549
+ if (s.type === "transport" && s.selectedCandidatePairId !== void 0) selected.id = s.selectedCandidatePairId;
34550
+ });
34551
+ const pair = pairs.find((p) => selected.id !== null && p.id === selected.id) ?? pairs.find((p) => p.selected === true) ?? pairs.find((p) => p.nominated === true && p.state === "succeeded") ?? null;
34552
+ if (pair === null) return {
34553
+ rttMs: null,
34554
+ relayProtocol: null
34555
+ };
34556
+ const local = pair.localCandidateId !== void 0 ? byId.get(pair.localCandidateId) : void 0;
34557
+ return {
34558
+ rttMs: typeof pair.currentRoundTripTime === "number" ? Math.round(pair.currentRoundTripTime * 1e3) : null,
34559
+ relayProtocol: typeof local?.relayProtocol === "string" ? local.relayProtocol : null
34560
+ };
34561
+ }
34562
+ async function relayLoopback(servers, timeoutMs = 1e4) {
34563
+ const start = performance.now();
34564
+ const config = {
34565
+ iceServers: toRtcIceServers(servers),
34566
+ iceTransportPolicy: "relay"
34567
+ };
34568
+ const pcA = new RTCPeerConnection(config);
34569
+ const pcB = new RTCPeerConnection(config);
34570
+ try {
34571
+ pcA.createDataChannel("probe");
34572
+ pcA.addEventListener("icecandidate", (e) => {
34573
+ if (e.candidate) pcB.addIceCandidate(e.candidate).catch(() => void 0);
34574
+ });
34575
+ pcB.addEventListener("icecandidate", (e) => {
34576
+ if (e.candidate) pcA.addIceCandidate(e.candidate).catch(() => void 0);
34577
+ });
34578
+ const connected = new Promise((resolve) => {
34579
+ const timer = setTimeout(() => resolve(false), timeoutMs);
34580
+ pcA.addEventListener("iceconnectionstatechange", () => {
34581
+ const st = pcA.iceConnectionState;
34582
+ if (st === "connected" || st === "completed") {
34583
+ clearTimeout(timer);
34584
+ resolve(true);
34585
+ } else if (st === "failed" || st === "closed") {
34586
+ clearTimeout(timer);
34587
+ resolve(false);
34588
+ }
34589
+ });
34590
+ });
34591
+ const offer = await pcA.createOffer();
34592
+ await pcA.setLocalDescription(offer);
34593
+ await pcB.setRemoteDescription(offer);
34594
+ const answer = await pcB.createAnswer();
34595
+ await pcB.setLocalDescription(answer);
34596
+ await pcA.setRemoteDescription(answer);
34597
+ const ok = await connected;
34598
+ const facts = ok ? selectedPairFacts(await pcA.getStats()) : {
34599
+ rttMs: null,
34600
+ relayProtocol: null
34601
+ };
34602
+ return {
34603
+ connected: ok,
34604
+ state: pcA.iceConnectionState,
34605
+ rttMs: facts.rttMs,
34606
+ relayProtocol: facts.relayProtocol,
34607
+ durationMs: performance.now() - start,
34608
+ error: null
34609
+ };
34610
+ } catch (err) {
34611
+ return {
34612
+ connected: false,
34613
+ state: pcA.iceConnectionState,
34614
+ rttMs: null,
34615
+ relayProtocol: null,
34616
+ durationMs: performance.now() - start,
34617
+ error: errorText$1(err)
34618
+ };
34619
+ } finally {
34620
+ pcA.close();
34621
+ pcB.close();
34622
+ }
34623
+ }
34624
+ //#endregion
34625
+ //#region src/composites/webrtc-diagnostics/nat-mapping.ts
34626
+ function isHiddenBase(o) {
34627
+ return o.relatedAddress === null || o.relatedAddress === "0.0.0.0" || o.relatedAddress === "::" || o.relatedPort === null || o.relatedPort === 0;
34628
+ }
34629
+ function baseKey(o) {
34630
+ return isHiddenBase(o) ? `public:${o.address}` : `base:${o.relatedAddress ?? "?"}:${String(o.relatedPort ?? "?")}`;
34631
+ }
34632
+ function unknown(reason, mappings = []) {
34633
+ return {
34634
+ kind: "unknown",
34635
+ confidence: "none",
34636
+ reason,
34637
+ mappings
34638
+ };
34639
+ }
34640
+ /**
34641
+ * The distinct STUN destinations (`stun:host:port`) among the given URLs —
34642
+ * the number the check needs to be at least two. TURN URLs are excluded:
34643
+ * this check is about plain STUN binding.
34644
+ */
34645
+ function distinctStunDestinations(urls) {
34646
+ const out = [];
34647
+ for (const url of urls) {
34648
+ const m = /^stuns?:([^?]+)/i.exec(url.trim());
34649
+ if (m === null) continue;
34650
+ const dest = `stun:${(m[1] ?? "").toLowerCase()}`;
34651
+ if (!out.includes(dest)) out.push(dest);
34652
+ }
34653
+ return out;
34654
+ }
34655
+ function compareSrflxMappings(observations, stunDestinationsQueried) {
34656
+ const udp = observations.filter((o) => o.protocol.toLowerCase() === "udp");
34657
+ if (stunDestinationsQueried < 2) return unknown("needs two STUN destinations to compare; only one was queried");
34658
+ if (udp.length === 0) return unknown("no server-reflexive candidate: STUN unreachable or blocked from this browser");
34659
+ const groups = /* @__PURE__ */ new Map();
34660
+ for (const o of udp) {
34661
+ const key = baseKey(o);
34662
+ groups.set(key, [...groups.get(key) ?? [], o]);
34663
+ }
34664
+ const mappings = [...new Set(udp.map((o) => `${o.address}:${String(o.port)}`))];
34665
+ for (const group of groups.values()) {
34666
+ const distinct = new Set(group.map((o) => `${o.address}:${String(o.port)}`));
34667
+ if (distinct.size > 1) return {
34668
+ kind: "endpoint-dependent",
34669
+ confidence: "confirmed",
34670
+ reason: `one local socket got ${String(distinct.size)} different public mappings — symmetric NAT: only a TURN relay reaches this browser`,
34671
+ mappings
34672
+ };
34673
+ }
34674
+ const confirmed = [...groups.values()].some((group) => new Set(group.map((o) => o.url).filter((u) => u !== null)).size >= 2);
34675
+ return {
34676
+ kind: "endpoint-independent",
34677
+ confidence: confirmed ? "confirmed" : "likely",
34678
+ reason: confirmed ? "two STUN destinations saw the same public mapping" : "one public mapping across the STUN destinations (the browser drops an identical second candidate, so the second answer cannot be told from no answer)",
34679
+ mappings
34680
+ };
34681
+ }
34682
+ //#endregion
34683
+ //#region src/composites/webrtc-diagnostics/endpoint-test.ts
34684
+ /**
34685
+ * "Test each endpoint" and the NAT mapping check — the orchestration around
34686
+ * the browser probes, with the row derivation kept pure so it is tested
34687
+ * without a browser.
34688
+ */
34689
+ /** Queried in addition to the configured STUN servers until two distinct destinations exist. */
34690
+ var FALLBACK_STUN_URLS = ["stun:stun.l.google.com:19302", "stun:stun1.l.google.com:19302"];
34691
+ function schemeOf(url) {
34692
+ const lower = url.toLowerCase();
34693
+ if (lower.startsWith("turns:")) return "turns";
34694
+ if (lower.startsWith("turn:")) return "turn";
34695
+ if (lower.startsWith("stun:") || lower.startsWith("stuns:")) return "stun";
34696
+ return "other";
34697
+ }
34698
+ function transportOf(url) {
34699
+ return /[?&]transport=([a-z]+)/i.exec(url)?.[1]?.toLowerCase() ?? null;
34700
+ }
34701
+ /** One row per URL: an entry's `urls` may be a string or a list. */
34702
+ function flattenIceServers(servers) {
34703
+ const out = [];
34704
+ for (const s of servers) {
34705
+ const urls = typeof s.urls === "string" ? [s.urls] : s.urls;
34706
+ for (const url of urls) {
34707
+ if (out.some((e) => e.id === url)) continue;
34708
+ out.push({
34709
+ id: url,
34710
+ url,
34711
+ ...s.username !== void 0 ? { username: s.username } : {},
34712
+ ...s.credential !== void 0 ? { credential: s.credential } : {},
34713
+ scheme: schemeOf(url),
34714
+ transport: transportOf(url),
34715
+ hasCredentials: s.credential !== void 0
34716
+ });
34717
+ }
34718
+ }
34719
+ return out;
34720
+ }
34721
+ function endpointRowFromProbe(endpoint, gather, loopback) {
34722
+ const srflx = gather.candidates.find((c) => c.candidate.type === "srflx");
34723
+ const relay = gather.candidates.find((c) => c.candidate.type === "relay");
34724
+ const mapped = srflx !== void 0 && srflx.candidate.address !== null && srflx.candidate.port !== null ? `${srflx.candidate.address}:${String(srflx.candidate.port)}` : null;
34725
+ return {
34726
+ id: endpoint.id,
34727
+ url: endpoint.url,
34728
+ scheme: endpoint.scheme,
34729
+ transport: endpoint.transport,
34730
+ srflx: mapped,
34731
+ relay: relay !== void 0,
34732
+ relayProtocol: loopback?.relayProtocol ?? relay?.relayProtocol ?? null,
34733
+ eventUrl: relay?.url ?? srflx?.url ?? null,
34734
+ relayConnected: loopback?.connected ?? null,
34735
+ rttMs: loopback?.rttMs ?? null,
34736
+ timedOut: gather.timedOut,
34737
+ error: gather.error ?? loopback?.error ?? null
34738
+ };
34739
+ }
34740
+ var GATHER_TIMEOUT_MS = 6e3;
34741
+ var LOOPBACK_TIMEOUT_MS = 8e3;
34742
+ function configOf(e) {
34743
+ return [{
34744
+ url: e.url,
34745
+ ...e.username !== void 0 ? { username: e.username } : {},
34746
+ ...e.credential !== void 0 ? { credential: e.credential } : {}
34747
+ }];
34748
+ }
34749
+ /** Gather against ONE endpoint; for a TURN endpoint, also prove the relay forwards. */
34750
+ async function testEndpoint(endpoint) {
34751
+ const cfg = configOf(endpoint);
34752
+ return endpointRowFromProbe(endpoint, await gatherCandidates(cfg, "all", GATHER_TIMEOUT_MS), endpoint.scheme === "turn" || endpoint.scheme === "turns" ? await relayLoopback(cfg, LOOPBACK_TIMEOUT_MS) : null);
34753
+ }
34754
+ /** The STUN destinations the NAT check queries: configured first, public fallbacks to reach two. */
34755
+ function natCheckDestinations(endpoints) {
34756
+ const out = [...distinctStunDestinations(endpoints.map((e) => e.url))];
34757
+ for (const url of distinctStunDestinations(FALLBACK_STUN_URLS)) {
34758
+ if (out.length >= 2) break;
34759
+ if (!out.includes(url)) out.push(url);
34760
+ }
34761
+ return out;
34762
+ }
34763
+ function srflxObservations(gather) {
34764
+ const out = [];
34765
+ for (const c of gather.candidates) {
34766
+ const p = c.candidate;
34767
+ if (p.type !== "srflx" || p.address === null || p.port === null || p.protocol === null) continue;
34768
+ out.push({
34769
+ address: p.address,
34770
+ port: p.port,
34771
+ protocol: p.protocol,
34772
+ relatedAddress: p.relatedAddress,
34773
+ relatedPort: p.relatedPort,
34774
+ url: c.url
34775
+ });
34776
+ }
34777
+ return out;
34778
+ }
34779
+ async function runNatCheck(endpoints) {
34780
+ const destinations = natCheckDestinations(endpoints);
34781
+ const gather = await gatherCandidates(destinations.map((url) => ({ url })), "all", GATHER_TIMEOUT_MS);
34782
+ return {
34783
+ destinations,
34784
+ verdict: compareSrflxMappings(srflxObservations(gather), destinations.length),
34785
+ error: gather.error
34786
+ };
34787
+ }
34788
+ //#endregion
34789
+ //#region src/composites/webrtc-diagnostics/format.ts
34790
+ /**
34791
+ * Rendering helpers for the WebRTC diagnostics: an unmeasured value is the
34792
+ * word "unknown", never a dash that reads as zero and never a 0 (D393).
34793
+ */
34794
+ var UNKNOWN_TEXT = "unknown";
34795
+ function formatMaybe(value, render) {
34796
+ return value === null ? UNKNOWN_TEXT : render(value);
34797
+ }
34798
+ var fmtMs = (v) => formatMaybe(v, (n) => `${String(Math.round(n))} ms`);
34799
+ var fmtCount = (v) => formatMaybe(v, (n) => n.toLocaleString());
34800
+ var fmtBytes = (v) => formatMaybe(v, (n) => {
34801
+ if (n < 1024) return `${String(n)} B`;
34802
+ if (n < 1024 * 1024) return `${(n / 1024).toFixed(1)} KiB`;
34803
+ return `${(n / (1024 * 1024)).toFixed(2)} MiB`;
34804
+ });
34805
+ var fmtPercent = (v) => formatMaybe(v, (n) => `${n.toFixed(1)} %`);
34806
+ var fmtText = (v) => formatMaybe(v, (s) => s);
34807
+ //#endregion
34808
+ //#region src/composites/webrtc-diagnostics/EndpointTestCard.tsx
34809
+ /**
34810
+ * "ICE servers" — the live ICE server list (`turnProvider.getTurnServers`, the
34811
+ * same union every viewer is handed) probed endpoint by endpoint from THIS
34812
+ * browser, plus the NAT mapping check.
34813
+ *
34814
+ * Owns no hub data beyond the list it is given through `loadServers`.
34815
+ * Credentials are passed to the probes and never rendered: a row shows `auth`.
34816
+ */
34817
+ var SCHEME_VARIANT = {
34818
+ stun: "info",
34819
+ turn: "warning",
34820
+ turns: "success",
34821
+ other: "default"
34822
+ };
34823
+ function errorText(err) {
34824
+ return err instanceof Error ? err.message : String(err);
34825
+ }
34826
+ function yesNo(value, yes, no) {
34827
+ if (value === null) return /* @__PURE__ */ jsx("span", {
34828
+ className: "text-foreground-subtle",
34829
+ children: UNKNOWN_TEXT
34830
+ });
34831
+ return /* @__PURE__ */ jsx("span", {
34832
+ className: value ? "text-success" : "text-danger",
34833
+ children: value ? yes : no
34834
+ });
34835
+ }
34836
+ var RESULT_COLUMNS = [
34837
+ {
34838
+ key: "endpoint",
34839
+ header: "Endpoint",
34840
+ nowrap: false,
34841
+ render: (r) => /* @__PURE__ */ jsx("span", {
34842
+ className: "break-all font-mono text-[11px]",
34843
+ children: r.url
34844
+ })
34845
+ },
34846
+ {
34847
+ key: "srflx",
34848
+ header: "Mapped (srflx)",
34849
+ render: (r) => /* @__PURE__ */ jsx("span", {
34850
+ className: "font-mono text-[11px]",
34851
+ children: r.srflx ?? "none"
34852
+ })
34853
+ },
34854
+ {
34855
+ key: "relay",
34856
+ header: "Relay",
34857
+ render: (r) => r.scheme === "stun" ? /* @__PURE__ */ jsx("span", {
34858
+ className: "text-foreground-subtle",
34859
+ children: "n/a"
34860
+ }) : yesNo(r.relay, "allocated", "none")
34861
+ },
34862
+ {
34863
+ key: "proto",
34864
+ header: "Relay protocol",
34865
+ render: (r) => r.scheme === "stun" ? "n/a" : fmtText(r.relayProtocol)
34866
+ },
34867
+ {
34868
+ key: "connect",
34869
+ header: "Relay connect",
34870
+ render: (r) => r.relayConnected === null ? /* @__PURE__ */ jsx("span", {
34871
+ className: "text-foreground-subtle",
34872
+ children: "n/a"
34873
+ }) : yesNo(r.relayConnected, "connected", "failed")
34874
+ },
34875
+ {
34876
+ key: "rtt",
34877
+ header: "RTT",
34878
+ align: "right",
34879
+ render: (r) => fmtMs(r.rttMs)
34880
+ },
34881
+ {
34882
+ key: "url",
34883
+ header: "Event url",
34884
+ nowrap: false,
34885
+ render: (r) => /* @__PURE__ */ jsx("span", {
34886
+ className: "break-all font-mono text-[10px]",
34887
+ children: fmtText(r.eventUrl)
34888
+ })
34889
+ },
34890
+ {
34891
+ key: "note",
34892
+ header: "Note",
34893
+ nowrap: false,
34894
+ render: (r) => /* @__PURE__ */ jsx("span", {
34895
+ className: TEXT_HINT,
34896
+ children: r.error ?? (r.timedOut ? "gathering timed out" : "")
34897
+ })
34898
+ }
34899
+ ];
34900
+ var NAT_LABEL = {
34901
+ "endpoint-independent": "Endpoint-independent mapping",
34902
+ "endpoint-dependent": "Symmetric NAT (endpoint-dependent)",
34903
+ unknown: "Unknown"
34904
+ };
34905
+ function NatResult({ result }) {
34906
+ const { verdict } = result;
34907
+ return /* @__PURE__ */ jsx("div", {
34908
+ className: SECTION_BODY,
34909
+ "data-testid": "nat-check-result",
34910
+ children: /* @__PURE__ */ jsx(KeyValueList, { items: [
34911
+ {
34912
+ key: "NAT mapping",
34913
+ value: /* @__PURE__ */ jsxs("span", {
34914
+ className: "flex flex-wrap items-center gap-1.5",
34915
+ children: [/* @__PURE__ */ jsx(Badge, {
34916
+ variant: verdict.kind === "endpoint-independent" ? "success" : verdict.kind === "endpoint-dependent" ? "danger" : "default",
34917
+ children: NAT_LABEL[verdict.kind]
34918
+ }), verdict.confidence !== "none" && /* @__PURE__ */ jsx("span", {
34919
+ className: "text-[10px] text-foreground-subtle",
34920
+ children: verdict.confidence
34921
+ })]
34922
+ })
34923
+ },
34924
+ {
34925
+ key: "Why",
34926
+ value: /* @__PURE__ */ jsx("span", {
34927
+ className: "text-xs",
34928
+ children: verdict.reason
34929
+ })
34930
+ },
34931
+ {
34932
+ key: "Mappings seen",
34933
+ value: /* @__PURE__ */ jsx("span", {
34934
+ className: "font-mono text-[11px]",
34935
+ children: verdict.mappings.length > 0 ? verdict.mappings.join(", ") : "none"
34936
+ })
34937
+ },
34938
+ {
34939
+ key: "STUN queried",
34940
+ value: /* @__PURE__ */ jsx("span", {
34941
+ className: "break-all font-mono text-[11px]",
34942
+ children: result.destinations.join(", ")
34943
+ })
34944
+ },
34945
+ ...result.error !== null ? [{
34946
+ key: "Error",
34947
+ value: result.error
34948
+ }] : []
34949
+ ] })
34950
+ });
34951
+ }
34952
+ /** The per-endpoint result table — one row per tested ICE URL. */
34953
+ function EndpointResultsCard({ rows }) {
34954
+ return /* @__PURE__ */ jsx(SectionCard, {
34955
+ headingId: "webrtc-diag-endpoint-results",
34956
+ title: "Per-endpoint results",
34957
+ icon: Play,
34958
+ children: /* @__PURE__ */ jsx(DataTable, {
34959
+ columns: RESULT_COLUMNS,
34960
+ rows,
34961
+ rowKey: (r) => r.id,
34962
+ bordered: false,
34963
+ minWidthPx: 760,
34964
+ mobileMode: "cards"
34965
+ })
34966
+ });
34967
+ }
34968
+ /** The NAT mapping verdict for this browser. */
34969
+ function NatResultCard({ result }) {
34970
+ return /* @__PURE__ */ jsx(SectionCard, {
34971
+ headingId: "webrtc-diag-nat",
34972
+ title: "NAT mapping (this browser)",
34973
+ icon: Route,
34974
+ children: /* @__PURE__ */ jsx(NatResult, { result })
34975
+ });
34976
+ }
34977
+ function EndpointRow({ endpoint, checked, onToggle }) {
34978
+ return /* @__PURE__ */ jsxs("label", {
34979
+ className: `${LIST_ROW} flex cursor-pointer items-center gap-2 hover:bg-surface-hover/40`,
34980
+ children: [
34981
+ /* @__PURE__ */ jsx(Checkbox, {
34982
+ checked,
34983
+ onChange: () => onToggle(endpoint.id)
34984
+ }),
34985
+ /* @__PURE__ */ jsx(Badge, {
34986
+ variant: SCHEME_VARIANT[endpoint.scheme],
34987
+ className: "shrink-0 uppercase text-[10px]",
34988
+ children: endpoint.scheme
34989
+ }),
34990
+ /* @__PURE__ */ jsx("span", {
34991
+ className: "min-w-0 flex-1 break-all font-mono text-[11px] text-foreground",
34992
+ children: endpoint.url
34993
+ }),
34994
+ endpoint.transport !== null && /* @__PURE__ */ jsx("span", {
34995
+ className: `text-[10px] text-foreground-subtle uppercase`,
34996
+ children: endpoint.transport
34997
+ }),
34998
+ endpoint.hasCredentials && /* @__PURE__ */ jsx("span", {
34999
+ className: `text-[10px] text-foreground-subtle text-success`,
35000
+ children: "auth"
35001
+ })
35002
+ ]
35003
+ });
35004
+ }
35005
+ function EndpointTestCard({ loadServers }) {
35006
+ const [endpoints, setEndpoints] = useState(null);
35007
+ const [loadError, setLoadError] = useState(null);
35008
+ const [loading, setLoading] = useState(false);
35009
+ const [enabled, setEnabled] = useState(/* @__PURE__ */ new Set());
35010
+ const [running, setRunning] = useState(null);
35011
+ const [rows, setRows] = useState([]);
35012
+ const [nat, setNat] = useState(null);
35013
+ const reload = useCallback(async () => {
35014
+ setLoading(true);
35015
+ setLoadError(null);
35016
+ try {
35017
+ const flat = flattenIceServers(await loadServers());
35018
+ setEndpoints(flat);
35019
+ setEnabled(new Set(flat.map((e) => e.id)));
35020
+ } catch (err) {
35021
+ setLoadError(errorText(err));
35022
+ } finally {
35023
+ setLoading(false);
35024
+ }
35025
+ }, [loadServers]);
35026
+ useEffect(() => {
35027
+ reload();
35028
+ }, [reload]);
35029
+ const selected = useMemo(() => (endpoints ?? []).filter((e) => enabled.has(e.id)), [endpoints, enabled]);
35030
+ const toggle = useCallback((id) => {
35031
+ setEnabled((prev) => {
35032
+ const next = new Set(prev);
35033
+ if (next.has(id)) next.delete(id);
35034
+ else next.add(id);
35035
+ return next;
35036
+ });
35037
+ }, []);
35038
+ const runEndpoints = useCallback(async () => {
35039
+ setRunning("endpoints");
35040
+ setRows([]);
35041
+ const out = [];
35042
+ for (const e of selected) {
35043
+ out.push(await testEndpoint(e));
35044
+ setRows([...out]);
35045
+ }
35046
+ setRunning(null);
35047
+ }, [selected]);
35048
+ const runNat = useCallback(async () => {
35049
+ setRunning("nat");
35050
+ setNat(null);
35051
+ try {
35052
+ setNat(await runNatCheck(endpoints ?? []));
35053
+ } finally {
35054
+ setRunning(null);
35055
+ }
35056
+ }, [endpoints]);
35057
+ const busy = running !== null;
35058
+ return /* @__PURE__ */ jsxs("div", {
35059
+ className: "space-y-3 sm:space-y-4",
35060
+ children: [
35061
+ /* @__PURE__ */ jsx(SectionCard, {
35062
+ headingId: "webrtc-diag-ice-servers",
35063
+ title: `ICE servers${endpoints !== null ? ` (${String(endpoints.length)})` : ""}`,
35064
+ icon: Network,
35065
+ testId: "webrtc-diag-ice-servers",
35066
+ actions: /* @__PURE__ */ jsxs("div", {
35067
+ className: "flex flex-wrap items-center gap-1.5",
35068
+ children: [
35069
+ /* @__PURE__ */ jsxs(Button, {
35070
+ variant: "ghost",
35071
+ onClick: () => void reload(),
35072
+ disabled: loading || busy,
35073
+ children: [loading ? /* @__PURE__ */ jsx(LoaderCircle, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ jsx(RefreshCw, { className: "h-3 w-3" }), "Reload"]
35074
+ }),
35075
+ /* @__PURE__ */ jsxs(Button, {
35076
+ variant: "outline",
35077
+ onClick: () => void runNat(),
35078
+ disabled: busy || endpoints === null,
35079
+ children: [running === "nat" ? /* @__PURE__ */ jsx(LoaderCircle, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ jsx(Route, { className: "h-3 w-3" }), "Check NAT"]
35080
+ }),
35081
+ /* @__PURE__ */ jsxs(Button, {
35082
+ onClick: () => void runEndpoints(),
35083
+ disabled: busy || selected.length === 0,
35084
+ children: [running === "endpoints" ? /* @__PURE__ */ jsx(LoaderCircle, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ jsx(Play, { className: "h-3 w-3" }), "Test each endpoint"]
35085
+ })
35086
+ ]
35087
+ }),
35088
+ children: /* @__PURE__ */ jsxs("div", {
35089
+ className: "divide-y divide-border/50",
35090
+ children: [
35091
+ loadError !== null && /* @__PURE__ */ jsxs("div", {
35092
+ className: `px-3 sm:px-4 py-1.5 sm:py-2 text-xs text-danger`,
35093
+ children: ["Failed to load ICE servers: ", loadError]
35094
+ }),
35095
+ loadError === null && endpoints === null && /* @__PURE__ */ jsx("div", {
35096
+ className: `px-3 sm:px-4 py-1.5 sm:py-2 text-[10px] text-foreground-subtle`,
35097
+ children: "Loading…"
35098
+ }),
35099
+ endpoints !== null && endpoints.length === 0 && /* @__PURE__ */ jsx("div", {
35100
+ className: `px-3 sm:px-4 py-1.5 sm:py-2 text-[10px] text-foreground-subtle`,
35101
+ children: "No ICE servers configured. Add a TURN provider under TURN Servers."
35102
+ }),
35103
+ (endpoints ?? []).map((e) => /* @__PURE__ */ jsx(EndpointRow, {
35104
+ endpoint: e,
35105
+ checked: enabled.has(e.id),
35106
+ onToggle: toggle
35107
+ }, e.id))
35108
+ ]
35109
+ })
35110
+ }),
35111
+ rows.length > 0 && /* @__PURE__ */ jsx(EndpointResultsCard, { rows }),
35112
+ nat !== null && /* @__PURE__ */ jsx(NatResultCard, { result: nat })
35113
+ ]
35114
+ });
35115
+ }
35116
+ //#endregion
35117
+ //#region src/hooks/turn-server-cache.ts
35118
+ /** Short enough that rotated credentials are picked up promptly. */
35119
+ var DEFAULT_FRESH_TTL_MS = 5 * 6e4;
35120
+ /** Half of the shortest provider credential lifetime in the fleet (24 h). */
35121
+ var DEFAULT_STALE_CAP_MS = 720 * 6e4;
35122
+ var DEFAULT_STORAGE_KEY = "camstack:turn-servers:v1";
35123
+ function defaultStorage() {
35124
+ const g = globalThis;
35125
+ try {
35126
+ return g.localStorage ?? null;
35127
+ } catch {
35128
+ return null;
35129
+ }
35130
+ }
35131
+ /** Type guard for a persisted entry — storage content is external data. */
35132
+ function isCacheEntry(value) {
35133
+ if (typeof value !== "object" || value === null) return false;
35134
+ const v = value;
35135
+ if (typeof v.fetchedAt !== "number" || !Array.isArray(v.servers)) return false;
35136
+ return v.servers.every((s) => {
35137
+ if (typeof s !== "object" || s === null) return false;
35138
+ const srv = s;
35139
+ if (!(typeof srv.urls === "string" || Array.isArray(srv.urls) && srv.urls.every((u) => typeof u === "string"))) return false;
35140
+ if (srv.username !== void 0 && typeof srv.username !== "string") return false;
35141
+ if (srv.credential !== void 0 && typeof srv.credential !== "string") return false;
35142
+ return true;
35143
+ });
35144
+ }
35145
+ var TurnServerCache = class {
35146
+ freshTtlMs;
35147
+ staleCapMs;
35148
+ storage;
35149
+ now;
35150
+ storageKey;
35151
+ /** Keyed on the caller's tRPC client object (stable per connected system). */
35152
+ memory = /* @__PURE__ */ new WeakMap();
35153
+ /** In-flight fetch per key — concurrent callers share one round trip. */
35154
+ inflight = /* @__PURE__ */ new WeakMap();
35155
+ constructor(options = {}) {
35156
+ this.freshTtlMs = options.freshTtlMs ?? DEFAULT_FRESH_TTL_MS;
35157
+ this.staleCapMs = options.staleCapMs ?? DEFAULT_STALE_CAP_MS;
35158
+ this.storage = "storage" in options ? options.storage ?? null : defaultStorage();
35159
+ this.now = options.now ?? (() => Date.now());
35160
+ this.storageKey = options.storageKey ?? DEFAULT_STORAGE_KEY;
35161
+ }
35162
+ /**
35163
+ * Resolve the ICE servers for `key`, fetching via `fetch` only when no
35164
+ * fresh-enough entry exists. Never rejects: a failed fetch resolves to the
35165
+ * stale entry when one exists, else `undefined`.
35166
+ */
35167
+ async getOrFetch(key, fetch) {
35168
+ const at = this.now();
35169
+ const entry = this.memory.get(key) ?? this.readStorage();
35170
+ if (entry) {
35171
+ const age = at - entry.fetchedAt;
35172
+ if (age < this.freshTtlMs) return entry.servers;
35173
+ if (age < this.staleCapMs) {
35174
+ this.startFetch(key, fetch, entry);
35175
+ return entry.servers;
35176
+ }
35177
+ }
35178
+ return this.startFetch(key, fetch, entry);
35179
+ }
35180
+ startFetch(key, fetch, stale) {
35181
+ const pending = this.inflight.get(key);
35182
+ if (pending) return pending;
35183
+ const run = (async () => {
35184
+ try {
35185
+ const servers = await fetch();
35186
+ if (servers.length > 0) {
35187
+ const entry = {
35188
+ servers,
35189
+ fetchedAt: this.now()
35190
+ };
35191
+ this.memory.set(key, entry);
35192
+ this.writeStorage(entry);
35193
+ }
35194
+ return servers;
35195
+ } catch {
35196
+ return stale?.servers;
35197
+ }
35198
+ })().finally(() => {
35199
+ this.inflight.delete(key);
35200
+ });
35201
+ this.inflight.set(key, run);
35202
+ return run;
35203
+ }
35204
+ readStorage() {
35205
+ if (!this.storage) return void 0;
35206
+ try {
35207
+ const raw = this.storage.getItem(this.storageKey);
35208
+ if (raw === null) return void 0;
35209
+ const parsed = JSON.parse(raw);
35210
+ return isCacheEntry(parsed) ? parsed : void 0;
35211
+ } catch {
35212
+ return;
35213
+ }
35214
+ }
35215
+ writeStorage(entry) {
35216
+ if (!this.storage) return;
35217
+ try {
35218
+ this.storage.setItem(this.storageKey, JSON.stringify(entry));
35219
+ } catch {}
35220
+ }
35221
+ };
35222
+ //#endregion
35223
+ //#region src/hooks/use-device-webrtc.ts
35224
+ /**
35225
+ * useDeviceWebrtc — WebRTC signaling hook for device-scoped streaming.
35226
+ *
35227
+ * Provides `createSession`, `sendAnswer`, `closeSession` callbacks and
35228
+ * a `streams` list (Adaptive + High/Mid/Low) for a given device.
35229
+ *
35230
+ * Works in both admin-ui (BackendClient.trpc) and addon pages
35231
+ * (AddonPageProps.trpc) — parametrized by a minimal tRPC proxy shape.
35232
+ */
35233
+ /**
35234
+ * Hook that provides WebRTC signaling callbacks and stream choices for a device.
35235
+ *
35236
+ * @param trpc - tRPC proxy (admin-ui BackendClient.trpc or addon page trpc)
35237
+ * @param deviceId - numeric device ID (null = disabled)
35238
+ * @param pollIntervalMs - how often to refresh profile slots (default: 5000)
35239
+ */
35240
+ /** Module-level TURN/STUN credential cache. Keyed on the caller's trpc client
35241
+ * object (stable per connected system — NOT on `trpc.turnProvider`, which is
35242
+ * a proxy minted fresh on every property access), so two admin tabs pointed
35243
+ * at different hubs never cross-serve credentials from the memory layer; the
35244
+ * storage layer is per-origin, and the page's origin IS the hub. Coalesces
35245
+ * concurrent fetches (the mount prefetch and the connect's own call used to
35246
+ * race into TWO round trips) and persists across page loads so a fresh embed
35247
+ * page — one per camera open on native — finds warm credentials instead of
35248
+ * re-paying the measured 0.2–3.6 s serialized fetch. See turn-server-cache.ts. */
35249
+ var turnServersCache = new TurnServerCache();
35250
+ function useDeviceWebrtc(trpc, deviceId, pollIntervalMs = 5e3) {
35251
+ const [remoteStreams, setRemoteStreams] = useState([]);
35252
+ useEffect(() => {
35253
+ if (deviceId === null) return;
35254
+ let cancelled = false;
35255
+ const fetch = () => {
35256
+ trpc.webrtcSession.listStreams.query({ deviceId }).then((rows) => {
35257
+ if (!cancelled) setRemoteStreams(rows);
35258
+ }).catch(() => {});
35259
+ };
35260
+ fetch();
35261
+ const iv = setInterval(fetch, pollIntervalMs);
35262
+ return () => {
35263
+ cancelled = true;
35264
+ clearInterval(iv);
35265
+ };
35266
+ }, [
35267
+ trpc,
35268
+ deviceId,
35269
+ pollIntervalMs
35270
+ ]);
35271
+ const [pipelineMetrics, setPipelineMetrics] = useState(null);
35272
+ useEffect(() => {
35273
+ if (deviceId === null) return;
35274
+ let cancelled = false;
35275
+ if (trpc.pipelineOrchestrator) trpc.pipelineOrchestrator.getCameraMetrics.query({ deviceId }).then((m) => {
35276
+ if (cancelled || !m) return;
35277
+ setPipelineMetrics({
35278
+ phase: m.phase,
35279
+ detectionFps: m.actualFps,
35280
+ avgInferenceMs: m.avgInferenceTimeMs,
35281
+ droppedFrames: m.droppedFrames
35282
+ });
35283
+ }).catch(() => {});
35284
+ return () => {
35285
+ cancelled = true;
35286
+ };
35287
+ }, [trpc, deviceId]);
35288
+ useLiveEvent("pipeline.camera-metrics-snapshot", (evt) => {
35289
+ if (deviceId === null) return;
35290
+ const payload = evt.data;
35291
+ if (payload.deviceId !== deviceId || !payload.metrics) return;
35292
+ setPipelineMetrics({
35293
+ phase: payload.metrics.phase,
35294
+ detectionFps: payload.metrics.actualFps,
35295
+ avgInferenceMs: payload.metrics.avgInferenceTimeMs,
35296
+ droppedFrames: payload.metrics.droppedFrames
35297
+ });
35298
+ });
35299
+ const { streams, hasWebrtc } = useMemo(() => {
35300
+ if (deviceId === null || remoteStreams.length === 0) return {
35301
+ streams: [],
35302
+ hasWebrtc: false
35303
+ };
35304
+ return {
35305
+ streams: remoteStreams.map((r) => ({
35306
+ id: r.id,
35307
+ label: r.label,
35308
+ target: r.target,
35309
+ status: r.status,
35310
+ inputFps: r.inputFps,
35311
+ decodeFps: r.decodeFps,
35312
+ bitrateKbps: r.bitrateKbps
35313
+ })),
35314
+ hasWebrtc: true
35315
+ };
35316
+ }, [deviceId, remoteStreams]);
35317
+ const getIceServers = useCallback(async () => {
35318
+ const provider = trpc.turnProvider;
35319
+ if (!provider) return void 0;
35320
+ return turnServersCache.getOrFetch(trpc, async () => {
35321
+ return (await provider.getTurnServers.query()).map((s) => {
35322
+ return {
35323
+ urls: typeof s.urls === "string" ? s.urls : [...s.urls],
35324
+ ...s.username !== void 0 ? { username: s.username } : {},
35325
+ ...s.credential !== void 0 ? { credential: s.credential } : {}
35326
+ };
35327
+ });
35328
+ });
35329
+ }, [trpc]);
35330
+ useEffect(() => {
35331
+ getIceServers();
35332
+ }, [getIceServers]);
35333
+ const createSession = useCallback(async (target, hints) => {
35334
+ if (deviceId === null) throw new Error("No device selected");
35335
+ const res = await trpc.webrtcSession.createSession.mutate({
35336
+ deviceId,
35337
+ target,
35338
+ hints
35339
+ });
35340
+ const iceServers = await getIceServers();
35341
+ return {
35342
+ sessionId: res.sessionId,
35343
+ sdpOffer: res.sdpOffer,
35344
+ ...iceServers ? { iceServers } : {}
35345
+ };
35346
+ }, [
35347
+ trpc,
35348
+ deviceId,
35349
+ getIceServers
35350
+ ]);
35351
+ const handleOffer = useCallback(async (target, sdpOffer, sessionId, hints) => {
35352
+ if (deviceId === null) throw new Error("No device selected");
35353
+ return trpc.webrtcSession.handleOffer.mutate({
35354
+ deviceId,
35355
+ target,
35356
+ sdpOffer,
35357
+ ...sessionId !== void 0 ? { sessionId } : {},
35358
+ ...hints !== void 0 ? { hints } : {}
35359
+ });
35360
+ }, [trpc, deviceId]);
35361
+ const sendAnswer = useCallback(async (sessionId, sdpAnswer) => {
35362
+ if (deviceId === null) throw new Error("No device selected");
35363
+ await trpc.webrtcSession.handleAnswer.mutate({
35364
+ deviceId,
35365
+ sessionId,
35366
+ sdpAnswer
35367
+ });
35368
+ }, [trpc, deviceId]);
35369
+ return {
35370
+ streams,
35371
+ hasWebrtc,
35372
+ pipelineMetrics,
35373
+ createSession,
35374
+ handleOffer,
35375
+ getIceServers,
35376
+ addIceCandidate: useCallback(async (sessionId, candidate) => {
35377
+ if (deviceId === null) return;
35378
+ await trpc.webrtcSession.addIceCandidate.mutate({
35379
+ deviceId,
35380
+ sessionId,
35381
+ candidate: candidate.candidate ?? "",
35382
+ sdpMid: candidate.sdpMid ?? null,
35383
+ sdpMLineIndex: candidate.sdpMLineIndex ?? null
35384
+ }).catch(() => {});
35385
+ }, [trpc, deviceId]),
35386
+ getIceCandidates: useCallback(async (sessionId) => {
35387
+ if (deviceId === null) return {
35388
+ candidates: [],
35389
+ done: true
35390
+ };
35391
+ return trpc.webrtcSession.getIceCandidates.query({
35392
+ deviceId,
35393
+ sessionId
35394
+ });
35395
+ }, [trpc, deviceId]),
35396
+ sendAnswer,
35397
+ closeSession: useCallback(async (sessionId) => {
35398
+ if (deviceId === null) return;
35399
+ await trpc.webrtcSession.closeSession.mutate({
35400
+ deviceId,
35401
+ sessionId
35402
+ }).catch(() => {});
35403
+ }, [trpc, deviceId]),
35404
+ getSessionState: useCallback(async (sessionId) => {
35405
+ if (deviceId === null) return { pendingRenegotiation: null };
35406
+ try {
35407
+ return await trpc.webrtcSession.getSessionState.query({
35408
+ deviceId,
35409
+ sessionId
35410
+ });
35411
+ } catch {
35412
+ return { pendingRenegotiation: null };
35413
+ }
35414
+ }, [trpc, deviceId]),
35415
+ getSessionDebug: useCallback(async (sessionId) => {
35416
+ if (deviceId === null) throw new Error("getSessionDebug: no device bound to this player");
35417
+ return trpc.webrtcSession.getSessionDebug.query({
35418
+ deviceId,
35419
+ sessionId
35420
+ });
35421
+ }, [trpc, deviceId]),
35422
+ applyDownlinkProbe: useCallback(async (sessionId, downlinkMbps) => {
35423
+ const mutate = trpc.webrtcSession.applyDownlinkProbe;
35424
+ if (deviceId === null || mutate === void 0) throw new Error("applyDownlinkProbe: not available for this player");
35425
+ return mutate.mutate({
35426
+ deviceId,
35427
+ sessionId,
35428
+ downlinkMbps
35429
+ });
35430
+ }, [trpc, deviceId])
35431
+ };
35432
+ }
35433
+ //#endregion
35434
+ //#region src/composites/webrtc-diagnostics/RunReport.tsx
35435
+ var VERDICT_VARIANT = {
35436
+ healthy: "success",
35437
+ "loss-keyframe": "warning",
35438
+ transport: "danger",
35439
+ "hub-dtls": "danger",
35440
+ "media-black-hole": "danger",
35441
+ "hub-not-sending": "danger",
35442
+ unknown: "default"
35443
+ };
35444
+ var FLAG_TEXT = {
35445
+ "public-path": "has a public path (srflx / relay / public host)",
35446
+ "private-only": "LAN/Tailscale only, no srflx/relay",
35447
+ none: "answered with no candidate",
35448
+ unknown: "no answer received"
35449
+ };
35450
+ function candidateText(c) {
35451
+ const where = c.address === null ? "unknown" : `${c.address}:${c.port === null ? "?" : String(c.port)}`;
35452
+ return `${c.type} ${c.protocol ?? "?"} ${where} · ${c.scope}`;
35453
+ }
35454
+ function typeCounts(counts) {
35455
+ const parts = Object.entries(counts).filter(([, n]) => n > 0).map(([t, n]) => `${String(n)} ${t}`);
35456
+ return parts.length > 0 ? parts.join(" · ") : "none";
35457
+ }
35458
+ function Group({ title, children }) {
35459
+ return /* @__PURE__ */ jsxs("div", {
35460
+ className: "space-y-0.5",
35461
+ children: [/* @__PURE__ */ jsx("div", {
35462
+ className: TEXT_SECTION_LABEL,
35463
+ children: title
35464
+ }), children]
35465
+ });
35466
+ }
35467
+ function RunReport({ report, title }) {
35468
+ const { hub, timeline, path, media, verdict, local } = report;
35469
+ return /* @__PURE__ */ jsxs("section", {
35470
+ className: SECTION_CARD,
35471
+ "data-testid": `webrtc-diag-run-${report.policy}`,
35472
+ children: [/* @__PURE__ */ jsxs("header", {
35473
+ className: `${SECTION_HEADER} flex flex-wrap items-center gap-2`,
35474
+ children: [/* @__PURE__ */ jsx("h3", {
35475
+ className: `${TEXT_SECTION_LABEL} min-w-0 flex-1`,
35476
+ children: title
35477
+ }), /* @__PURE__ */ jsx(Badge, {
35478
+ variant: VERDICT_VARIANT[verdict.layer],
35479
+ children: verdict.title
35480
+ })]
35481
+ }), /* @__PURE__ */ jsxs("div", {
35482
+ className: `${SECTION_BODY} space-y-3`,
35483
+ children: [
35484
+ /* @__PURE__ */ jsx("p", {
35485
+ className: "text-xs text-foreground",
35486
+ children: verdict.detail
35487
+ }),
35488
+ /* @__PURE__ */ jsxs(Group, {
35489
+ title: "Hub candidates",
35490
+ children: [/* @__PURE__ */ jsx(KeyValueList, { items: [{
35491
+ key: "Offered",
35492
+ value: /* @__PURE__ */ jsxs("span", {
35493
+ className: "flex flex-wrap items-center gap-1.5 text-xs",
35494
+ children: [typeCounts(hub.countByType), /* @__PURE__ */ jsx(Badge, {
35495
+ variant: hub.flag === "private-only" ? "warning" : hub.flag === "public-path" ? "success" : "default",
35496
+ children: FLAG_TEXT[hub.flag]
35497
+ })]
35498
+ })
35499
+ }, {
35500
+ key: "Source",
35501
+ value: `${String(hub.fromSdp)} in the answer SDP · ${String(hub.fromTrickle)} trickled${hub.trickleDone === true ? " · gathering done" : ""}`
35502
+ }] }), hub.candidates.length > 0 && /* @__PURE__ */ jsx("ul", {
35503
+ className: "mt-1 space-y-0.5 font-mono text-[10px] text-foreground-subtle",
35504
+ children: hub.candidates.map((c) => /* @__PURE__ */ jsx("li", {
35505
+ className: "break-all",
35506
+ children: candidateText(c)
35507
+ }, c.raw))
35508
+ })]
35509
+ }),
35510
+ /* @__PURE__ */ jsx(Group, {
35511
+ title: "Timeline",
35512
+ children: /* @__PURE__ */ jsx(KeyValueList, { items: [
35513
+ {
35514
+ key: "ICE connected",
35515
+ value: fmtMs(timeline.iceConnectedMs)
35516
+ },
35517
+ {
35518
+ key: "DTLS connected",
35519
+ value: fmtMs(timeline.dtlsConnectedMs)
35520
+ },
35521
+ {
35522
+ key: "First frame",
35523
+ value: fmtMs(timeline.firstFrameMs)
35524
+ },
35525
+ {
35526
+ key: "ICE · DTLS final",
35527
+ value: `${fmtText(timeline.iceFinalState)} · ${fmtText(timeline.dtlsFinalState)}`
35528
+ }
35529
+ ] })
35530
+ }),
35531
+ /* @__PURE__ */ jsx(Group, {
35532
+ title: "Path",
35533
+ children: /* @__PURE__ */ jsx(KeyValueList, { items: [
35534
+ {
35535
+ key: "Selected pair",
35536
+ value: path.pairType === null ? fmtText(null) : `${path.pairType} (local/remote)`
35537
+ },
35538
+ {
35539
+ key: "Protocol · RTT",
35540
+ value: `${fmtText(path.protocol)} · ${fmtMs(path.rttMs)}`
35541
+ },
35542
+ {
35543
+ key: "Browser offered",
35544
+ value: `${typeCounts(local.countByType)}${local.relayProtocols.length > 0 ? ` · relay over ${local.relayProtocols.join("/")}` : ""}`
35545
+ }
35546
+ ] })
35547
+ }),
35548
+ /* @__PURE__ */ jsx(Group, {
35549
+ title: "Media",
35550
+ children: /* @__PURE__ */ jsx(KeyValueList, { items: [
35551
+ {
35552
+ key: "Hub sent",
35553
+ value: `${fmtCount(media.serverPacketsSent)} RTP packets${media.servedTier !== null ? ` · ${media.servedTier}` : ""}${media.egressLeg !== null ? ` · ${media.egressLeg}` : ""}`
35554
+ },
35555
+ {
35556
+ key: "Browser got",
35557
+ value: `${fmtCount(media.clientPacketsReceived)} packets · ${fmtBytes(media.clientBytesReceived)}`
35558
+ },
35559
+ {
35560
+ key: "Frames decoded",
35561
+ value: fmtCount(media.framesDecoded)
35562
+ },
35563
+ {
35564
+ key: "Loss · freezes",
35565
+ value: `${fmtPercent(media.lossPercent)} · ${fmtCount(media.freezeCount)} (${fmtMs(media.totalFreezeMs)})`
35566
+ },
35567
+ {
35568
+ key: "PLI · NACK",
35569
+ value: `${fmtCount(media.pliCount)} · ${fmtCount(media.nackCount)}`
35570
+ }
35571
+ ] })
35572
+ }),
35573
+ (report.reconnects > 0 || report.errors.length > 0 || report.serverError !== null) && /* @__PURE__ */ jsxs("div", {
35574
+ className: "text-[10px] text-foreground-subtle",
35575
+ children: [
35576
+ report.reconnects > 0 && /* @__PURE__ */ jsxs("div", { children: ["Player reconnects: ", String(report.reconnects)] }),
35577
+ report.errors.map((e, i) => /* @__PURE__ */ jsxs("div", { children: ["Player error: ", e] }, `${String(i)}-${e}`)),
35578
+ report.serverError !== null && /* @__PURE__ */ jsxs("div", { children: ["Server debug: ", report.serverError] })
35579
+ ]
35580
+ }),
35581
+ /* @__PURE__ */ jsxs("div", {
35582
+ className: TEXT_HINT,
35583
+ children: [
35584
+ "Sessions:",
35585
+ " ",
35586
+ report.sessionIds.length > 0 ? report.sessionIds.map((s) => s.slice(0, 8)).join(", ") : "none",
35587
+ " ",
35588
+ "· ",
35589
+ String(Math.round(report.durationMs / 1e3)),
35590
+ " s"
35591
+ ]
35592
+ })
35593
+ ]
35594
+ })]
35595
+ });
35596
+ }
35597
+ function transportDetail(input) {
35598
+ const state = input.iceFinalState ?? "unknown";
35599
+ if (input.hubFlag === "unknown") return `ICE ${state}; the hub never answered the offer, so no hub candidate was seen`;
35600
+ if (input.hubFlag === "none") return `ICE ${state}; the hub answered but offered no candidate`;
35601
+ if (input.policy === "relay" && input.hubFlag === "private-only") return `ICE ${state}; this browser was limited to TURN relay candidates and the hub offered only LAN/Tailscale addresses (no srflx/relay) — a relayed client cannot reach it`;
35602
+ if (input.hubFlag === "private-only") return `ICE ${state}; the hub offered only LAN/Tailscale addresses (no srflx/relay) — reachable only from inside those networks`;
35603
+ return `ICE ${state}; no candidate pair between this browser and the hub succeeded`;
35604
+ }
35605
+ function verdict(layer, title, detail) {
35606
+ return {
35607
+ layer,
35608
+ title,
35609
+ detail
35610
+ };
35611
+ }
35612
+ function mediaVerdict(input) {
35613
+ const client = input.clientPacketsReceived;
35614
+ const sent = input.serverPacketsSent;
35615
+ if (client === null) return verdict("unknown", "Media unknown", "the browser reported no inbound video statistics");
35616
+ if (client === 0) {
35617
+ if (sent === null) return verdict("unknown", "Nothing received", "the browser received no packets and the hub's own count is unknown");
35618
+ if (sent > 0) return verdict("media-black-hole", "Media black-hole", `the hub sent ${String(sent)} RTP packets and this browser received none — media is lost between them after DTLS`);
35619
+ return verdict("hub-not-sending", "Hub not sending", "the session is connected but the hub sent no RTP — the source or the broker is not producing");
35620
+ }
35621
+ if (input.framesDecoded === null) return verdict("unknown", "Decode unknown", "packets arrive; the browser reported no decode count");
35622
+ if (input.framesDecoded === 0) return verdict("loss-keyframe", "Loss / keyframe size", "packets arrive but no frame decoded — a keyframe never completes over this path");
35623
+ const { pliCount: pli, freezeCount: freezes, lossPercent: loss } = input;
35624
+ const storm = pli !== null && pli >= 3 || freezes !== null && freezes > 0 || loss !== null && loss >= 2;
35625
+ const signals = [
35626
+ `${pli === null ? "unknown" : String(pli)} PLI`,
35627
+ `${freezes === null ? "unknown" : String(freezes)} freezes`,
35628
+ `${loss === null ? "unknown" : `${loss.toFixed(1)}%`} loss`
35629
+ ].join(", ");
35630
+ if (storm) return verdict("loss-keyframe", "Loss / keyframe size", `frames decode but the path is lossy: ${signals}`);
35631
+ if (pli === null && freezes === null && loss === null) return verdict("healthy", "Decoding", "frames decode; the browser reported no loss signal to judge");
35632
+ return verdict("healthy", "Healthy", `connected, receiving and decoding: ${signals}`);
35633
+ }
35634
+ function classifySessionVerdict(input) {
35635
+ if (!input.iceConnected) return verdict("transport", "Transport (ICE) failed", transportDetail(input));
35636
+ if (!input.dtlsConnected && input.dtlsFinalState !== null) return verdict("hub-dtls", "DTLS stuck (hub side)", `ICE connected but DTLS stayed ${input.dtlsFinalState} — the hub never completed the handshake`);
35637
+ return mediaVerdict(input);
35638
+ }
35639
+ //#endregion
35640
+ //#region src/composites/webrtc-diagnostics/session-run.ts
35641
+ function emptySessionRun(policy) {
35642
+ return {
35643
+ policy,
35644
+ sessionIds: [],
35645
+ sdpAnswer: null,
35646
+ trickled: [],
35647
+ trickleDone: null,
35648
+ local: [],
35649
+ ice: [],
35650
+ dtls: [],
35651
+ peer: [],
35652
+ firstFrameAt: null,
35653
+ lastStats: null,
35654
+ lastServer: null,
35655
+ maxServerPacketsSent: null,
35656
+ lastServerError: null,
35657
+ samples: 0,
35658
+ reconnects: 0,
35659
+ errors: []
35660
+ };
35661
+ }
35662
+ function mark(list, state, at) {
35663
+ return list.at(-1)?.state === state ? list : [...list, {
35664
+ state,
35665
+ at
35666
+ }];
35667
+ }
35668
+ function maxOrNull(a, b) {
35669
+ if (a === null) return b;
35670
+ if (b === null) return a;
35671
+ return Math.max(a, b);
35672
+ }
35673
+ function reduceSample(state, sample) {
35674
+ return {
35675
+ ...state,
35676
+ samples: state.samples + 1,
35677
+ lastStats: sample.stats ?? state.lastStats,
35678
+ lastServer: sample.server ?? state.lastServer,
35679
+ maxServerPacketsSent: maxOrNull(state.maxServerPacketsSent, sample.server?.rtpPacketsSent ?? null),
35680
+ lastServerError: sample.serverError,
35681
+ sessionIds: sample.sessionId !== null && !state.sessionIds.includes(sample.sessionId) ? [...state.sessionIds, sample.sessionId] : state.sessionIds
35682
+ };
35683
+ }
35684
+ function reduceSessionRun(state, event) {
35685
+ switch (event.kind) {
35686
+ case "offer-answered": return {
35687
+ ...state,
35688
+ sdpAnswer: state.sdpAnswer ?? event.sdpAnswer,
35689
+ sessionIds: state.sessionIds.includes(event.sessionId) ? state.sessionIds : [...state.sessionIds, event.sessionId]
35690
+ };
35691
+ case "hub-candidates": return {
35692
+ ...state,
35693
+ trickled: [...state.trickled, ...event.candidates.filter((c) => !state.trickled.includes(c))],
35694
+ trickleDone: event.done || state.trickleDone === true
35695
+ };
35696
+ case "local-candidate": {
35697
+ const candidate = parseIceCandidate(event.candidate);
35698
+ if (candidate === null) return state;
35699
+ return {
35700
+ ...state,
35701
+ local: [...state.local, {
35702
+ candidate,
35703
+ url: event.url,
35704
+ relayProtocol: event.relayProtocol
35705
+ }]
35706
+ };
35707
+ }
35708
+ case "ice-state": return {
35709
+ ...state,
35710
+ ice: mark(state.ice, event.state, event.at)
35711
+ };
35712
+ case "dtls-state": return {
35713
+ ...state,
35714
+ dtls: mark(state.dtls, event.state, event.at)
35715
+ };
35716
+ case "peer-state": return {
35717
+ ...state,
35718
+ peer: mark(state.peer, event.state, event.at)
35719
+ };
35720
+ case "first-frame": return {
35721
+ ...state,
35722
+ firstFrameAt: state.firstFrameAt ?? event.at
35723
+ };
35724
+ case "sample": return reduceSample(state, event.sample);
35725
+ case "reconnect": return {
35726
+ ...state,
35727
+ reconnects: state.reconnects + 1
35728
+ };
35729
+ case "error": return {
35730
+ ...state,
35731
+ errors: [...state.errors, event.message]
35732
+ };
35733
+ }
35734
+ }
35735
+ var CONNECTED_ICE = new Set(["connected", "completed"]);
35736
+ function firstAt(list, states) {
35737
+ return list.find((m) => states.has(m.state))?.at ?? null;
35738
+ }
35739
+ var CONNECTED = new Set(["connected"]);
35740
+ function timelineOf(state) {
35741
+ const dtlsAt = firstAt(state.dtls, CONNECTED) ?? firstAt(state.peer, CONNECTED);
35742
+ const dtlsFinal = state.dtls.at(-1)?.state ?? state.peer.at(-1)?.state ?? null;
35743
+ return {
35744
+ iceConnectedMs: firstAt(state.ice, CONNECTED_ICE),
35745
+ dtlsConnectedMs: dtlsAt,
35746
+ firstFrameMs: state.firstFrameAt,
35747
+ iceFinalState: state.ice.at(-1)?.state ?? null,
35748
+ dtlsFinalState: dtlsFinal
35749
+ };
35750
+ }
35751
+ function mediaOf(state) {
35752
+ const s = state.lastStats;
35753
+ const srv = state.lastServer;
35754
+ return {
35755
+ clientBytesReceived: s?.raw.bytesReceived ?? null,
35756
+ clientPacketsReceived: s?.packetsReceived ?? null,
35757
+ framesDecoded: s?.framesDecoded ?? null,
35758
+ serverPacketsSent: state.maxServerPacketsSent,
35759
+ serverAlive: srv?.alive ?? null,
35760
+ servedTier: srv?.servedTier ?? null,
35761
+ egressLeg: srv?.egressLeg ?? null,
35762
+ lossPercent: s?.lossPercent ?? null,
35763
+ freezeCount: s?.freezeCount ?? null,
35764
+ totalFreezeMs: s?.totalFreezeMs ?? null,
35765
+ pliCount: s?.pliCount ?? null,
35766
+ nackCount: s?.nackCount ?? null
35767
+ };
35768
+ }
35769
+ function localOf(state) {
35770
+ const unique = (xs) => [...new Set(xs.filter((x) => x !== null))];
35771
+ return {
35772
+ countByType: countCandidateTypes(state.local.map((l) => l.candidate)),
35773
+ relayProtocols: unique(state.local.filter((l) => l.candidate.type === "relay").map((l) => l.relayProtocol)),
35774
+ urls: unique(state.local.map((l) => l.url))
35775
+ };
35776
+ }
35777
+ function finalizeSessionRun(state, durationMs) {
35778
+ const hub = summarizeHubCandidates({
35779
+ sdpAnswer: state.sdpAnswer,
35780
+ trickled: state.trickled,
35781
+ trickleDone: state.trickleDone
35782
+ });
35783
+ const timeline = timelineOf(state);
35784
+ const media = mediaOf(state);
35785
+ const verdict = classifySessionVerdict({
35786
+ policy: state.policy,
35787
+ durationMs,
35788
+ iceConnected: timeline.iceConnectedMs !== null,
35789
+ iceFinalState: timeline.iceFinalState,
35790
+ dtlsConnected: timeline.dtlsConnectedMs !== null,
35791
+ dtlsFinalState: timeline.dtlsFinalState,
35792
+ hubFlag: hub.flag,
35793
+ clientPacketsReceived: media.clientPacketsReceived,
35794
+ framesDecoded: media.framesDecoded,
35795
+ serverPacketsSent: media.serverPacketsSent,
35796
+ pliCount: media.pliCount,
35797
+ freezeCount: media.freezeCount,
35798
+ lossPercent: media.lossPercent
35799
+ });
35800
+ return {
35801
+ policy: state.policy,
35802
+ durationMs,
35803
+ sessionIds: state.sessionIds,
35804
+ hub,
35805
+ local: localOf(state),
35806
+ timeline,
35807
+ path: {
35808
+ pairType: state.lastStats?.candidatePairType ?? null,
35809
+ protocol: state.lastStats?.candidateProtocol ?? null,
35810
+ rttMs: state.lastStats?.rttMs ?? null
35811
+ },
35812
+ media,
35813
+ reconnects: state.reconnects,
35814
+ errors: state.errors,
35815
+ serverError: state.lastServerError,
35816
+ verdict
35817
+ };
35818
+ }
35819
+ //#endregion
35820
+ //#region src/composites/webrtc-diagnostics/HubSessionTestCard.tsx
35821
+ /**
35822
+ * "Hub session test" — a real live session from THIS browser to the hub,
35823
+ * through the same `CameraStreamPlayer` + `useDeviceWebrtc` signaling every
35824
+ * viewer uses, run twice: browser ICE policy `all`, then `relay`.
35825
+ *
35826
+ * Nothing is simulated. The player's own client-offer path builds the offer,
35827
+ * trickles, polls the hub's candidates, and reports its 1 Hz
35828
+ * `StreamDebugSample` (the `webrtc-debug-stats` collector plus the server's
35829
+ * `getSessionDebug`). This card only LISTENS: it wraps the signaling callbacks
35830
+ * to see the hub's answer SDP and trickled candidates, and adds listeners to
35831
+ * each peer connection the player builds (`onPeerConnection`) for the ICE /
35832
+ * DTLS timeline and the browser's own candidates. The target is pinned (a low
35833
+ * or sub stream by default) so a large keyframe does not decide the verdict.
35834
+ */
35835
+ var HUB_SESSION_RUN_MS = 15e3;
35836
+ var POLICIES = ["all", "relay"];
35837
+ /** Between runs, so the first session is closed on the hub before the second opens. */
35838
+ var RUN_GAP_MS = 750;
35839
+ var PROGRESS_TICK_MS = 500;
35840
+ /** Pinned targets only, cheapest first: an adaptive target would climb mid-run. */
35841
+ function pinnedStreamChoices(streams) {
35842
+ const rank = (s) => {
35843
+ const t = s.target;
35844
+ if (t.kind === "profile") return t.profile === "low" ? 0 : t.profile === "mid" ? 2 : 3;
35845
+ if (t.kind === "cam-stream") return /sub|low|ext/i.test(t.camStreamId) ? 1 : 4;
35846
+ return 9;
35847
+ };
35848
+ return streams.filter((s) => s.target.kind !== "adaptive").toSorted((a, b) => rank(a) - rank(b));
35849
+ }
35850
+ var POLICY_LABEL = {
35851
+ all: "ICE policy all",
35852
+ relay: "ICE policy relay (TURN only)"
35853
+ };
35854
+ function HubSessionTestCard({ trpc, serverUrl, deviceId, cameraField, runMs = HUB_SESSION_RUN_MS }) {
35855
+ const webrtc = useDeviceWebrtc(trpc, deviceId);
35856
+ const choices = useMemo(() => pinnedStreamChoices(webrtc.streams), [webrtc.streams]);
35857
+ const [choiceId, setChoiceId] = useState(null);
35858
+ const choice = choices.find((c) => c.id === choiceId) ?? choices[0] ?? null;
35859
+ const [live, setLive] = useState(null);
35860
+ const [reports, setReports] = useState([]);
35861
+ const [elapsedMs, setElapsedMs] = useState(0);
35862
+ /** True from Run until the last policy reported or Stop — the gap between runs included. */
35863
+ const [active, setActive] = useState(false);
35864
+ const stateRef = useRef(emptySessionRun("all"));
35865
+ const t0Ref = useRef(0);
35866
+ const tokenRef = useRef(0);
35867
+ const gapTimerRef = useRef(null);
35868
+ const elapsed = useCallback(() => Math.round(performance.now() - t0Ref.current), []);
35869
+ /** Fold one observation into the CURRENT run; a late event from a closed run is dropped. */
35870
+ const record = useCallback((token, event) => {
35871
+ if (token !== tokenRef.current) return;
35872
+ stateRef.current = reduceSessionRun(stateRef.current, event);
35873
+ }, []);
35874
+ const stop = useCallback(() => {
35875
+ tokenRef.current += 1;
35876
+ if (gapTimerRef.current !== null) clearTimeout(gapTimerRef.current);
35877
+ gapTimerRef.current = null;
35878
+ setLive(null);
35879
+ setActive(false);
35880
+ }, []);
35881
+ const startRun = useCallback((index) => {
35882
+ const policy = POLICIES[index];
35883
+ if (policy === void 0) return;
35884
+ tokenRef.current += 1;
35885
+ stateRef.current = emptySessionRun(policy);
35886
+ t0Ref.current = performance.now();
35887
+ setElapsedMs(0);
35888
+ setLive({
35889
+ index,
35890
+ policy,
35891
+ token: tokenRef.current
35892
+ });
35893
+ }, []);
35894
+ useEffect(() => {
35895
+ if (live === null) return;
35896
+ const tick = setInterval(() => setElapsedMs(elapsed()), PROGRESS_TICK_MS);
35897
+ const done = setTimeout(() => {
35898
+ const report = finalizeSessionRun(stateRef.current, elapsed());
35899
+ setReports((prev) => [...prev, report]);
35900
+ tokenRef.current += 1;
35901
+ setLive(null);
35902
+ const next = live.index + 1;
35903
+ if (next < POLICIES.length) gapTimerRef.current = setTimeout(() => startRun(next), RUN_GAP_MS);
35904
+ else setActive(false);
35905
+ }, runMs);
35906
+ return () => {
35907
+ clearInterval(tick);
35908
+ clearTimeout(done);
35909
+ };
35910
+ }, [
35911
+ live,
35912
+ runMs,
35913
+ elapsed,
35914
+ startRun
35915
+ ]);
35916
+ useEffect(() => () => {
35917
+ tokenRef.current += 1;
35918
+ if (gapTimerRef.current !== null) clearTimeout(gapTimerRef.current);
35919
+ }, []);
35920
+ const start = useCallback(() => {
35921
+ setReports([]);
35922
+ setActive(true);
35923
+ startRun(0);
35924
+ }, [startRun]);
35925
+ const target = choice?.target ?? null;
35926
+ const token = live?.token ?? -1;
35927
+ const handleOffer = useCallback(async (sdpOffer, sessionId, hints) => {
35928
+ if (target === null) throw new Error("no stream selected");
35929
+ const res = await webrtc.handleOffer(target, sdpOffer, sessionId, hints);
35930
+ record(token, {
35931
+ kind: "offer-answered",
35932
+ at: elapsed(),
35933
+ sessionId: res.sessionId,
35934
+ sdpAnswer: res.sdpAnswer
35935
+ });
35936
+ return res;
35937
+ }, [
35938
+ target,
35939
+ webrtc,
35940
+ record,
35941
+ token,
35942
+ elapsed
35943
+ ]);
35944
+ const getIceCandidates = useCallback(async (sessionId) => {
35945
+ const res = await webrtc.getIceCandidates(sessionId);
35946
+ record(token, {
35947
+ kind: "hub-candidates",
35948
+ at: elapsed(),
35949
+ candidates: res.candidates.map((c) => c.candidate ?? "").filter((c) => c.length > 0),
35950
+ done: res.done
35951
+ });
35952
+ return res;
35953
+ }, [
35954
+ webrtc,
35955
+ record,
35956
+ token,
35957
+ elapsed
35958
+ ]);
35959
+ const onPeerConnection = useCallback((pc) => {
35960
+ const seen = /* @__PURE__ */ new WeakSet();
35961
+ pc.addEventListener("iceconnectionstatechange", () => record(token, {
35962
+ kind: "ice-state",
35963
+ at: elapsed(),
35964
+ state: pc.iceConnectionState
35965
+ }));
35966
+ pc.addEventListener("connectionstatechange", () => record(token, {
35967
+ kind: "peer-state",
35968
+ at: elapsed(),
35969
+ state: pc.connectionState
35970
+ }));
35971
+ pc.addEventListener("icecandidate", (e) => {
35972
+ const probed = probedCandidateFromEvent(e, elapsed());
35973
+ if (probed === null) return;
35974
+ record(token, {
35975
+ kind: "local-candidate",
35976
+ at: probed.tMs,
35977
+ candidate: probed.candidate.raw,
35978
+ url: probed.url,
35979
+ relayProtocol: probed.relayProtocol
35980
+ });
35981
+ });
35982
+ pc.addEventListener("track", (e) => {
35983
+ const transport = e.receiver.transport;
35984
+ if (transport === null || seen.has(transport)) return;
35985
+ seen.add(transport);
35986
+ record(token, {
35987
+ kind: "dtls-state",
35988
+ at: elapsed(),
35989
+ state: transport.state
35990
+ });
35991
+ transport.addEventListener("statechange", () => record(token, {
35992
+ kind: "dtls-state",
35993
+ at: elapsed(),
35994
+ state: transport.state
35995
+ }));
35996
+ });
35997
+ }, [
35998
+ record,
35999
+ token,
36000
+ elapsed
36001
+ ]);
36002
+ const onDebugStats = useCallback((sample) => record(token, {
36003
+ kind: "sample",
36004
+ at: elapsed(),
36005
+ sample
36006
+ }), [
36007
+ record,
36008
+ token,
36009
+ elapsed
36010
+ ]);
36011
+ const onConnectTiming = useCallback((timing) => {
36012
+ if (timing["firstFrameMs"] !== void 0) record(token, {
36013
+ kind: "first-frame",
36014
+ at: elapsed()
36015
+ });
36016
+ }, [
36017
+ record,
36018
+ token,
36019
+ elapsed
36020
+ ]);
36021
+ const progress = live === null ? null : Math.min(100, Math.round(elapsedMs / runMs * 100));
36022
+ return /* @__PURE__ */ jsxs(SectionCard, {
36023
+ headingId: "webrtc-diag-hub-session",
36024
+ title: "Hub session test",
36025
+ icon: Activity,
36026
+ testId: "webrtc-diag-hub-session",
36027
+ actions: !active ? /* @__PURE__ */ jsxs(Button, {
36028
+ onClick: start,
36029
+ disabled: !(deviceId !== null && choice !== null && !active),
36030
+ children: [
36031
+ /* @__PURE__ */ jsx(Play, { className: "h-3 w-3" }),
36032
+ "Run test (",
36033
+ String(Math.round(runMs * POLICIES.length / 1e3)),
36034
+ " s)"
36035
+ ]
36036
+ }) : /* @__PURE__ */ jsxs(Button, {
36037
+ variant: "outline",
36038
+ onClick: stop,
36039
+ children: [/* @__PURE__ */ jsx(Square, { className: "h-3 w-3" }), "Stop"]
36040
+ }),
36041
+ children: [
36042
+ /* @__PURE__ */ jsxs("div", {
36043
+ className: `${SECTION_BODY} space-y-3`,
36044
+ children: [
36045
+ /* @__PURE__ */ jsxs("div", {
36046
+ className: `grid grid-cols-1 sm:grid-cols-2 ${GRID_GAP}`,
36047
+ children: [cameraField, /* @__PURE__ */ jsxs("label", {
36048
+ className: "flex min-w-0 flex-col gap-1",
36049
+ children: [/* @__PURE__ */ jsx("span", {
36050
+ className: "text-[11px] text-foreground-subtle",
36051
+ children: "Stream (pinned)"
36052
+ }), /* @__PURE__ */ jsx(Select, {
36053
+ value: choice?.id ?? "",
36054
+ disabled: choices.length === 0 || active,
36055
+ onChange: (e) => setChoiceId(e.target.value),
36056
+ options: choices.length === 0 ? [{
36057
+ value: "",
36058
+ label: deviceId === null ? "Pick a camera first" : "No pinned stream"
36059
+ }] : choices.map((c) => ({
36060
+ value: c.id,
36061
+ label: c.label
36062
+ }))
36063
+ })]
36064
+ })]
36065
+ }),
36066
+ /* @__PURE__ */ jsx("p", {
36067
+ className: TEXT_HINT,
36068
+ children: "Opens a real live session from this browser twice — first with every candidate type, then TURN relay only — and reads both ends of it."
36069
+ }),
36070
+ live !== null && deviceId !== null && choice !== null && /* @__PURE__ */ jsxs("div", {
36071
+ className: `grid grid-cols-1 sm:grid-cols-[minmax(0,16rem)_1fr] gap-2 sm:gap-3 items-start`,
36072
+ children: [/* @__PURE__ */ jsx("div", {
36073
+ className: "aspect-video w-full overflow-hidden rounded-md border border-border bg-black",
36074
+ children: /* @__PURE__ */ jsx(CameraStreamPlayer, {
36075
+ serverUrl,
36076
+ streamKey: `diag-${choice.id}-${live.policy}`,
36077
+ autoPlay: true,
36078
+ muted: true,
36079
+ showControls: false,
36080
+ className: "h-full w-full",
36081
+ handleOffer,
36082
+ getIceServers: webrtc.getIceServers,
36083
+ addIceCandidate: webrtc.addIceCandidate,
36084
+ getIceCandidates,
36085
+ closeSession: webrtc.closeSession,
36086
+ getSessionDebug: webrtc.getSessionDebug,
36087
+ applyDownlinkProbe: webrtc.applyDownlinkProbe,
36088
+ iceTransportPolicy: live.policy,
36089
+ onPeerConnection,
36090
+ onDebugStats,
36091
+ onConnectTiming,
36092
+ onReconnectAttempt: () => record(token, {
36093
+ kind: "reconnect",
36094
+ at: elapsed()
36095
+ }),
36096
+ onError: (message) => record(token, {
36097
+ kind: "error",
36098
+ at: elapsed(),
36099
+ message
36100
+ })
36101
+ }, `${String(live.token)}-${live.policy}`)
36102
+ }), /* @__PURE__ */ jsxs("div", {
36103
+ className: "space-y-1.5",
36104
+ "data-testid": "webrtc-diag-progress",
36105
+ children: [
36106
+ /* @__PURE__ */ jsxs("div", {
36107
+ className: "flex items-center gap-2 text-xs text-foreground",
36108
+ children: [
36109
+ /* @__PURE__ */ jsx(LoaderCircle, { className: "h-3 w-3 animate-spin" }),
36110
+ "Run ",
36111
+ String(live.index + 1),
36112
+ " of ",
36113
+ String(POLICIES.length),
36114
+ " ·",
36115
+ " ",
36116
+ POLICY_LABEL[live.policy]
36117
+ ]
36118
+ }),
36119
+ /* @__PURE__ */ jsx("div", {
36120
+ className: "h-1.5 w-full overflow-hidden rounded bg-surface-hover",
36121
+ children: /* @__PURE__ */ jsx("div", {
36122
+ className: "h-full bg-primary transition-[width]",
36123
+ style: { width: `${String(progress ?? 0)}%` }
36124
+ })
36125
+ }),
36126
+ /* @__PURE__ */ jsxs("div", {
36127
+ className: "text-[10px] text-foreground-subtle",
36128
+ children: [
36129
+ String(Math.round(elapsedMs / 1e3)),
36130
+ " s of ",
36131
+ String(Math.round(runMs / 1e3)),
36132
+ " s"
36133
+ ]
36134
+ })
36135
+ ]
36136
+ })]
36137
+ })
36138
+ ]
36139
+ }),
36140
+ reports.length > 0 && /* @__PURE__ */ jsx("div", {
36141
+ className: `grid grid grid-cols-1 lg:grid-cols-2 gap-2 sm:gap-3 border-t border-border p-2 sm:p-3`,
36142
+ children: reports.map((r, i) => /* @__PURE__ */ jsx(RunReport, {
36143
+ report: r,
36144
+ title: `Run ${String(i + 1)} · ${POLICY_LABEL[r.policy]}`
36145
+ }, `${String(i)}-${r.policy}`))
36146
+ }),
36147
+ reports.length === 0 && !active && /* @__PURE__ */ jsx("div", {
36148
+ className: `px-3 sm:px-4 py-1.5 sm:py-2 border-t border-border text-[10px] text-foreground-subtle`,
36149
+ children: "No run yet."
36150
+ })
36151
+ ]
36152
+ });
36153
+ }
36154
+ //#endregion
36155
+ //#region src/composites/cap-settings/scene-monitor-copy.ts
36156
+ /** The lighting variants an operator is OFFERED. The resolver can also report
36157
+ * `night`, `dawn` and `dusk`; those are shown when present but never demanded,
36158
+ * because most installs only ever see day and IR. */
36159
+ var SCENE_CAPTURE_VARIANTS = ["day", "ir"];
36160
+ var VARIANT_LABEL = {
36161
+ day: "Daylight",
36162
+ ir: "Night (IR)",
36163
+ night: "Night",
36164
+ dawn: "Dawn",
36165
+ dusk: "Dusk"
36166
+ };
36167
+ function variantLabel(condition) {
36168
+ return VARIANT_LABEL[condition] ?? condition;
36169
+ }
34232
36170
  /**
34233
- * The toggle rule, and the only copy of it.
36171
+ * "Daylight ✓ · Night (IR) ✗ — optional; checks in night (ir) are skipped."
34234
36172
  *
34235
- * none → asc → desc → none, and a click on a DIFFERENT column starts that
34236
- * column fresh at `asc`. `sameColumn` says whether the clicked column is the
34237
- * one currently sorted; `currentDir` is its direction (`null` when nothing is
34238
- * sorted). Returns the next direction, or `null` for "unsorted".
36173
+ * Converts the silent cross-condition fallback this engine used to have into an
36174
+ * operator-visible fact. Without it, a scene with only a daylight reference
36175
+ * simply stops answering after sunset and nothing anywhere says why.
34239
36176
  *
34240
- * Split out from {@link nextTableSort} so the device list — whose sort state
34241
- * keys columns by `columnId`, not `columnKey` — can reuse the rule without a
34242
- * cast and without a second copy of it.
36177
+ * It used to end *"reports 'can't tell' in night (ir)"*, which was accurate and
36178
+ * read as a defect: the operator saw a ✗ and a complaint for a scene that was
36179
+ * configured exactly as they meant it. The missing half is now named as what it
36180
+ * is — the part you do not have to do — and the sentence says what actually
36181
+ * happens instead, which differs by the scene's own policy.
34243
36182
  */
34244
- function nextSortDirection(sameColumn, currentDir) {
34245
- if (!sameColumn || currentDir === null) return "asc";
34246
- return currentDir === "asc" ? "desc" : null;
36183
+ function coverageLine(monitor) {
36184
+ const covered = new Set(monitor.coveredConditions);
36185
+ const parts = SCENE_CAPTURE_VARIANTS.map((v) => `${variantLabel(v)} ${covered.has(v) ? "✓" : "✗"}`);
36186
+ const extra = [...covered].filter((c) => !SCENE_CAPTURE_VARIANTS.some((v) => v === c));
36187
+ for (const c of extra) parts.push(`${variantLabel(c)} ✓`);
36188
+ const missing = SCENE_CAPTURE_VARIANTS.filter((v) => !covered.has(v));
36189
+ if (missing.length === 0) return parts.join(" · ");
36190
+ if (covered.size === 0) return `${parts.join(" · ")} — nothing captured yet, so this scene is not watching.`;
36191
+ const names = missing.map((v) => variantLabel(v).toLowerCase()).join(" and ");
36192
+ return monitor.onUncoveredCondition === "judge-anyway" ? `${parts.join(" · ")} — ${names} judged against the references you do have.` : `${parts.join(" · ")} — optional; checks in ${names} are skipped.`;
34247
36193
  }
34248
36194
  /**
34249
- * Toggle a column's sort on header click: none → asc → desc → none.
34250
- * Clicking a DIFFERENT column starts it fresh at `asc`.
36195
+ * The calm sentence for a scene that is sitting the current light out — `null`
36196
+ * whenever it is checking normally.
36197
+ *
36198
+ * Separate from {@link statusLine} because it is not a verdict and must not
36199
+ * read like one. A paused scene has not failed, has not lost its flag, and
36200
+ * needs nothing from the operator; the only thing worth saying is which light
36201
+ * it is waiting out and that it will pick itself back up.
34251
36202
  */
34252
- function nextTableSort(current, columnKey) {
34253
- const dir = nextSortDirection(current !== null && current.columnKey === columnKey, current === null ? null : current.dir);
34254
- return dir === null ? null : {
34255
- columnKey,
34256
- dir
34257
- };
36203
+ function suspensionLine(monitor) {
36204
+ if (monitor.suspendedCondition === null) return null;
36205
+ const light = variantLabel(monitor.suspendedCondition).toLowerCase();
36206
+ return `Paused — nothing was captured in ${light}, so checks are on hold until the light changes back. Capture ${light} if you want it watched around the clock.`;
34258
36207
  }
36208
+ var UNAVAILABLE_SENTENCE = {
36209
+ "no-reference-for-condition": "can’t tell — nothing has been captured for this scene yet. Press “Capture daylight” to photograph what normal looks like.",
36210
+ "view-shifted": "can’t tell — the camera view has moved since the reference was captured. Re-capture it.",
36211
+ "no-vision-profile": "can’t tell — the vision model is unreachable, so the change is on hold.",
36212
+ "encoder-model-changed": "can’t tell — the embedding model changed, so the stored references are unreadable. Re-capture them.",
36213
+ "no-snapshot": "can’t tell — this camera did not return a frame."
36214
+ };
34259
36215
  /**
34260
- * Ascending comparison of two cell values.
34261
- *
34262
- * Numbers compare numerically and strings compare with `localeCompare` — a
34263
- * numeric column must never be ordered as text ("100" before "9"), and a text
34264
- * column must respect the locale's collation. A mixed column (one row a
34265
- * number, another a string) falls back to string comparison of both, which is
34266
- * the only total order available; it is not a shape any caller should build on
34267
- * purpose.
34268
- *
34269
- * `null` is NOT handled here — {@link sortRowsByColumn} pulls it out first,
34270
- * because its placement is direction-independent and a comparator that is
34271
- * multiplied by the direction factor cannot express that.
36216
+ * The one line under a scene's name. It answers, in order: can it judge, what
36217
+ * does it say, and how long has it said it.
34272
36218
  */
34273
- function compareValues(a, b) {
34274
- if (typeof a === "number" && typeof b === "number") return a - b;
34275
- return String(a).localeCompare(String(b));
36219
+ function statusLine(monitor, now) {
36220
+ if (monitor.states.length === 0) return "Not armed yet — capture the initial state to start watching.";
36221
+ if (monitor.verdict === "unknown") return monitor.unavailable !== null ? UNAVAILABLE_SENTENCE[monitor.unavailable] : "can’t tell right now.";
36222
+ const since = monitor.verdict === "diverged" ? monitor.divergedAt : monitor.armedAt;
36223
+ const held = since !== null ? ` for ${humanDuration(Math.max(0, now - since))}` : "";
36224
+ if (monitor.latched) return monitor.verdict === "diverged" ? `CHANGED${held} — press Reset when you have dealt with it.` : `Back to normal, but still flagged as changed${held}. Press Reset to clear it.`;
36225
+ const paused = suspensionLine(monitor);
36226
+ if (paused !== null) return paused;
36227
+ return monitor.verdict === "diverged" ? `CHANGED${held}` : `Normal${held}`;
34276
36228
  }
34277
- /**
34278
- * Return a NEW array of `rows` ordered by `sort`.
36229
+ /** The badge word. `latched` wins over `verdict`, because the latch is the
36230
+ * thing the operator asked to be told and it outlives the live state.
34279
36231
  *
34280
- * `valueOf` is the column's `sortValue` — it is called once per row per
34281
- * comparison, so it must be cheap (read a field, do not format a string).
34282
- * `sort === null` ⇒ a fresh shallow copy in the incoming order.
34283
- */
34284
- function sortRowsByColumn(rows, sort, valueOf) {
34285
- if (sort === null) return [...rows];
34286
- const factor = sort.dir === "asc" ? 1 : -1;
34287
- return rows.toSorted((a, b) => {
34288
- const av = valueOf(a);
34289
- const bv = valueOf(b);
34290
- if (av === null || bv === null) {
34291
- if (av === bv) return 0;
34292
- return av === null ? 1 : -1;
34293
- }
34294
- return factor * compareValues(av, bv);
34295
- });
36232
+ * A scene sitting out an uncovered light reads `Paused`, in the NEUTRAL tone —
36233
+ * never `alarm`, and never the `danger` variant the page maps that to. A
36234
+ * missing IR reference must not be able to paint a red badge on a scene that
36235
+ * is doing exactly what it was configured to do. */
36236
+ function badgeFor(monitor) {
36237
+ if (monitor.states.length === 0) return {
36238
+ text: "Not armed",
36239
+ tone: "unknown"
36240
+ };
36241
+ if (monitor.latched) return {
36242
+ text: "Changed",
36243
+ tone: "alarm"
36244
+ };
36245
+ if (monitor.suspendedCondition !== null) return {
36246
+ text: "Paused",
36247
+ tone: "unknown"
36248
+ };
36249
+ if (monitor.verdict === "unknown") return {
36250
+ text: "Can’t tell",
36251
+ tone: "unknown"
36252
+ };
36253
+ return monitor.verdict === "diverged" ? {
36254
+ text: "Changed",
36255
+ tone: "alarm"
36256
+ } : {
36257
+ text: "Normal",
36258
+ tone: "ok"
36259
+ };
34296
36260
  }
34297
- /** Derive the `<th>` `aria-sort` for `columnKey` from the table's sort state. */
34298
- function ariaSortForColumn(sort, columnKey) {
34299
- if (sort === null || sort.columnKey !== columnKey) return "none";
34300
- return sort.dir === "asc" ? "ascending" : "descending";
36261
+ /** A rect covering most of the frame is dominated by weather, sky and parked
36262
+ * cars: the bin is 2 % of the pixels and CLIP will not notice it leaving. The
36263
+ * failure is silent INSENSITIVITY, which is the worst kind — hence a warning
36264
+ * rather than a refusal. */
36265
+ var ROI_AREA_WARN_FRACTION = .4;
36266
+ function roiTooLarge(roi) {
36267
+ return roi.width * roi.height > ROI_AREA_WARN_FRACTION;
36268
+ }
36269
+ function humanDuration(ms) {
36270
+ const s = Math.floor(ms / 1e3);
36271
+ if (s < 60) return `${s}s`;
36272
+ const m = Math.floor(s / 60);
36273
+ if (m < 60) return `${m}m`;
36274
+ const h = Math.floor(m / 60);
36275
+ if (h < 48) return `${h}h`;
36276
+ return `${Math.floor(h / 24)}d`;
34301
36277
  }
34302
36278
  //#endregion
34303
- //#region src/composites/data-table.tsx
36279
+ //#region src/composites/code-block.tsx
36280
+ function CodeBlock({ children, maxHeight = 300, className }) {
36281
+ const [copied, setCopied] = useState(false);
36282
+ const handleCopy = useCallback(() => {
36283
+ navigator.clipboard.writeText(children).then(() => {
36284
+ setCopied(true);
36285
+ setTimeout(() => setCopied(false), 2e3);
36286
+ });
36287
+ }, [children]);
36288
+ return /* @__PURE__ */ jsxs("div", {
36289
+ className: cn("relative group", className),
36290
+ children: [/* @__PURE__ */ jsx(ScrollArea, {
36291
+ style: { maxHeight },
36292
+ children: /* @__PURE__ */ jsx("pre", {
36293
+ className: "font-mono text-xs bg-surface p-3 rounded-md border border-border-subtle",
36294
+ children: /* @__PURE__ */ jsx("code", { children })
36295
+ })
36296
+ }), /* @__PURE__ */ jsx("div", {
36297
+ className: "absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",
36298
+ children: /* @__PURE__ */ jsx(IconButton, {
36299
+ icon: copied ? Check : Copy,
36300
+ "aria-label": "Copy code",
36301
+ variant: "ghost",
36302
+ size: "sm",
36303
+ onClick: handleCopy
36304
+ })
36305
+ })]
36306
+ });
36307
+ }
36308
+ //#endregion
36309
+ //#region src/composites/confirm-action-button.tsx
34304
36310
  /**
34305
- * DataTable — shared responsive table for admin pages.
34306
- *
34307
- * Recipes baked in:
34308
- * - `overflow-x-auto` wrapper so narrow viewports don't clip the
34309
- * right edge (the rounded border survives the scroll).
34310
- * - `min-w-[Npx]` on the inner table so columns don't squash below
34311
- * readable width before the scroll kicks in.
34312
- * - `whitespace-nowrap` on headers — column titles never wrap to
34313
- * two lines (`AUTO-KILL` was the regression that triggered this).
34314
- * - Themed `bg-surface` + `border-border` so contrast works in both
34315
- * light and dark themes.
34316
- *
34317
- * Column model: caller supplies `columns: DataColumn<T>[]` and
34318
- * `rows: T[]`. Each column declares `header`, optional `align`,
34319
- * optional `nowrap`, and a `render(row) => ReactNode` that produces
34320
- * the cell content.
34321
- *
34322
- * <DataTable
34323
- * columns={[
34324
- * { key: 'username', header: 'Username', render: (u) => u.username },
34325
- * { key: 'role', header: 'Role', render: (u) => <RoleBadge .../> },
34326
- * { key: 'actions', header: '', align: 'right', render: (u) => <Actions .../> },
34327
- * ]}
34328
- * rows={users}
34329
- * minWidthPx={560}
34330
- * />
34331
- *
34332
- * If finer header markup is needed, pass `headerRender` instead of
34333
- * `header` (e.g. for a sortable click affordance).
34334
- *
34335
- * ── Narrow viewports ──────────────────────────────────────────────────────
34336
- * The table stays a table. The wrapper is `overflow-x-auto`, so a phone
34337
- * scrolls the columns sideways INSIDE the table — the page body never moves
34338
- * sideways, and the cells stay one line (`whitespace-nowrap`). That is the
34339
- * default (`mobileMode="scroll"`). Cards are opt-in via `mobileMode="cards"`;
34340
- * `auto` still applies the old column-count rule for a surface that wants it.
34341
- * See `resolveTableLayout`.
34342
- *
34343
- * ── Scrolling the BODY, not the page ──────────────────────────────────────
34344
- * `maxBodyHeight` caps the table and scrolls its rows INSIDE the container
34345
- * with the column header pinned. It is ONE prop, not two, because "this list
34346
- * scrolls internally" and "its header stays visible" are the same decision: a
34347
- * capped table whose header scrolls away is a list of unlabelled cells.
36311
+ * ConfirmActionButton — destructive-action button with a modal confirm.
34348
36312
  *
34349
- * Use it wherever the row count is open-ended (rules, targets, delivery
34350
- * history) so the page keeps its own header, filters and actions in view while
34351
- * the operator moves through the rows.
34352
- */
34353
- /**
34354
- * The default cap for an internally-scrolling table.
36313
+ * Two-step UX for any operation operators shouldn't trigger by accident:
36314
+ * reboot device, restart addon, regenerate token, etc. The trigger is a
36315
+ * normal Button that opens a Dialog; confirming runs the async action,
36316
+ * the trigger spinner-disables itself for the duration, and the dialog
36317
+ * closes on success. Errors surface inline at the dialog's bottom.
34355
36318
  *
34356
- * `60vh` leaves the page header, its filters and its actions on screen at
34357
- * every viewport while still showing ~10 rows — and it is a fraction, so it
34358
- * does not need a breakpoint of its own.
36319
+ * Generic on `TResult` so callers don't have to discard the return
36320
+ * value. Pass an `icon` to render it inside the trigger (e.g. RotateCw
36321
+ * for reboot, RefreshCw for restart).
34359
36322
  */
34360
- var TABLE_SCROLL_MAX_H = "max-h-[60vh]";
34361
- var ALIGN_CLASS = {
34362
- left: "text-left",
34363
- right: "text-right",
34364
- center: "text-center"
34365
- };
34366
- function DataTable({ columns, rows, rowKey, onRowClick, minWidthPx = 480, emptyMessage, className, bordered = true, rowClassName, mobileMode = "scroll", maxBodyHeight, defaultSort }) {
34367
- const isNarrow = useIsMobile();
34368
- const [sort, setSort] = useState(defaultSort ?? null);
34369
- const layout = resolveTableLayout({
34370
- mode: mobileMode,
34371
- columnCount: columns.length,
34372
- isNarrow
34373
- });
34374
- const scrolls = maxBodyHeight !== void 0;
34375
- const sortedColumn = useMemo(() => sort === null ? void 0 : columns.find((col) => col.key === sort.columnKey && col.sortValue !== void 0), [columns, sort]);
34376
- const sortValue = sortedColumn?.sortValue;
34377
- const displayRows = useMemo(() => sortValue === void 0 ? rows : sortRowsByColumn(rows, sort, sortValue), [
34378
- rows,
34379
- sort,
34380
- sortValue
34381
- ]);
34382
- const activeSort = sortedColumn === void 0 ? null : sort;
34383
- if (rows.length === 0 && emptyMessage) return /* @__PURE__ */ jsx("div", {
34384
- className: `rounded-lg ${bordered ? "border border-border" : ""} bg-surface px-3 py-4 text-xs text-foreground-subtle text-center ${className ?? ""}`,
34385
- children: emptyMessage
34386
- });
34387
- if (rows.length === 0) return null;
34388
- if (layout === "cards") return /* @__PURE__ */ jsx("div", {
34389
- className: `space-y-2 ${scrolls ? `${maxBodyHeight} overflow-y-auto` : ""} ${className ?? ""}`,
34390
- children: displayRows.map((row, rowIndex) => /* @__PURE__ */ jsx(DataTableCard, {
34391
- row,
34392
- rowIndex,
34393
- columns,
34394
- bordered,
34395
- onRowClick,
34396
- rowClassName
34397
- }, rowKey ? rowKey(row, rowIndex) : rowIndex))
34398
- });
34399
- return /* @__PURE__ */ jsx("div", {
34400
- className: [
34401
- "rounded-lg",
34402
- bordered ? "border border-border" : "",
34403
- "bg-surface overflow-x-auto",
34404
- scrolls ? `${maxBodyHeight} overflow-y-auto` : "",
34405
- className ?? ""
34406
- ].filter(Boolean).join(" "),
34407
- children: /* @__PURE__ */ jsxs("table", {
34408
- className: `w-full text-xs ${scrolls ? "border-separate border-spacing-0" : ""}`,
34409
- style: { minWidth: `${minWidthPx}px` },
34410
- children: [/* @__PURE__ */ jsx("thead", {
34411
- className: "bg-surface",
34412
- children: /* @__PURE__ */ jsx("tr", { children: columns.map((col) => {
34413
- const align = col.align ?? "left";
34414
- const nowrap = col.nowrap ?? true;
34415
- const sortable = col.sortValue !== void 0;
34416
- const isSorted = activeSort !== null && activeSort.columnKey === col.key;
34417
- return /* @__PURE__ */ jsx("th", {
34418
- "aria-sort": sortable ? ariaSortForColumn(activeSort, col.key) : void 0,
34419
- title: sortable ? void 0 : col.notSortableReason,
34420
- className: [
34421
- "px-3 py-2 text-foreground-subtle font-medium bg-surface border-b border-border",
34422
- scrolls ? "sticky top-0 z-10" : "",
34423
- ALIGN_CLASS[align],
34424
- nowrap ? "whitespace-nowrap" : "",
34425
- col.width ?? ""
34426
- ].filter(Boolean).join(" "),
34427
- children: sortable ? /* @__PURE__ */ jsx(SortHeaderButton, {
34428
- label: col.headerRender ? col.headerRender() : col.header,
34429
- active: isSorted,
34430
- dir: isSorted && activeSort !== null ? activeSort.dir : "asc",
34431
- onSort: () => setSort((prev) => nextTableSort(prev, col.key))
34432
- }) : col.headerRender ? col.headerRender() : col.header
34433
- }, col.key);
34434
- }) })
34435
- }), /* @__PURE__ */ jsx("tbody", { children: displayRows.map((row, rowIndex) => {
34436
- const key = rowKey ? rowKey(row, rowIndex) : rowIndex;
34437
- const extra = rowClassName?.(row, rowIndex) ?? "";
34438
- const interactive = onRowClick !== void 0;
34439
- return /* @__PURE__ */ jsx("tr", {
34440
- onClick: interactive ? () => onRowClick(row, rowIndex) : void 0,
34441
- className: [interactive ? "cursor-pointer hover:bg-primary/5" : "hover:bg-primary/5", extra].filter(Boolean).join(" "),
34442
- children: columns.map((col) => {
34443
- const align = col.align ?? "left";
34444
- const nowrap = col.nowrap ?? true;
34445
- return /* @__PURE__ */ jsx("td", {
34446
- className: [
34447
- "px-3 py-2 text-foreground border-b border-border",
34448
- ALIGN_CLASS[align],
34449
- nowrap ? "whitespace-nowrap" : ""
34450
- ].filter(Boolean).join(" "),
34451
- children: col.render(row, rowIndex)
34452
- }, col.key);
34453
- })
34454
- }, key);
34455
- }) })]
34456
- })
34457
- });
36323
+ function ConfirmActionButton({ label, icon: Icon, title = "Confirm action", description, confirmLabel, triggerVariant = "outline", confirmVariant = "danger", size = "sm", disabled, className, action, onSuccess }) {
36324
+ const [open, setOpen] = useState(false);
36325
+ const [running, setRunning] = useState(false);
36326
+ const [error, setError] = useState(null);
36327
+ const handleConfirm = async () => {
36328
+ setError(null);
36329
+ setRunning(true);
36330
+ try {
36331
+ const result = await action();
36332
+ onSuccess?.(result);
36333
+ setOpen(false);
36334
+ } catch (err) {
36335
+ setError(err instanceof Error ? err.message : String(err));
36336
+ } finally {
36337
+ setRunning(false);
36338
+ }
36339
+ };
36340
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs(Button, {
36341
+ type: "button",
36342
+ variant: triggerVariant,
36343
+ size,
36344
+ disabled,
36345
+ onClick: () => {
36346
+ setError(null);
36347
+ setOpen(true);
36348
+ },
36349
+ className,
36350
+ children: [Icon && /* @__PURE__ */ jsx(Icon, { className: "h-3.5 w-3.5" }), label]
36351
+ }), /* @__PURE__ */ jsx(Dialog, {
36352
+ open,
36353
+ onOpenChange: (next) => !running && setOpen(next),
36354
+ children: /* @__PURE__ */ jsxs(DialogContent, { children: [
36355
+ /* @__PURE__ */ jsxs(DialogHeader, { children: [/* @__PURE__ */ jsxs(DialogTitle, {
36356
+ className: "flex items-center gap-2",
36357
+ children: [/* @__PURE__ */ jsx(TriangleAlert, { className: "h-4 w-4 text-amber-400" }), title]
36358
+ }), typeof description === "string" ? /* @__PURE__ */ jsx(DialogDescription, { children: description }) : description] }),
36359
+ error && /* @__PURE__ */ jsx("div", {
36360
+ className: cn("mt-2 px-3 py-2 rounded border border-danger/40 bg-danger/10", "text-xs text-danger"),
36361
+ children: error
36362
+ }),
36363
+ /* @__PURE__ */ jsxs(DialogFooter, { children: [/* @__PURE__ */ jsx(Button, {
36364
+ type: "button",
36365
+ variant: "ghost",
36366
+ size,
36367
+ disabled: running,
36368
+ onClick: () => setOpen(false),
36369
+ children: "Cancel"
36370
+ }), /* @__PURE__ */ jsxs(Button, {
36371
+ type: "button",
36372
+ variant: confirmVariant,
36373
+ size,
36374
+ disabled: running,
36375
+ onClick: () => {
36376
+ handleConfirm();
36377
+ },
36378
+ children: [running && /* @__PURE__ */ jsx(LoaderCircle, { className: "h-3.5 w-3.5 animate-spin" }), confirmLabel ?? label]
36379
+ })] })
36380
+ ] })
36381
+ })] });
34458
36382
  }
36383
+ //#endregion
36384
+ //#region src/composites/copy-button.tsx
34459
36385
  /**
34460
- * One row as a card. Columns that carry a plain-text `header` become labelled
34461
- * `SettingRow`s — the label is the column title and the value gets the full
34462
- * card width. Columns with no text header (an actions column, a
34463
- * `headerRender`-only column) have no label to show, so they render as a
34464
- * full-width strip at the foot of the card.
36386
+ * `CopyButton` — a compact button that copies a string `value` to the
36387
+ * clipboard via `navigator.clipboard.writeText`, showing a brief
36388
+ * "copied" check state. Addon-agnostic; used wherever a secret / URL
36389
+ * needs a one-click copy affordance (export setup panels, etc.).
34465
36390
  */
34466
- function DataTableCard({ row, rowIndex, columns, bordered, onRowClick, rowClassName }) {
34467
- const labelled = columns.filter((col) => col.header !== void 0 && col.header !== "");
34468
- const unlabelled = columns.filter((col) => col.header === void 0 || col.header === "");
34469
- const interactive = onRowClick !== void 0;
34470
- const extra = rowClassName?.(row, rowIndex) ?? "";
34471
- return /* @__PURE__ */ jsxs("div", {
34472
- "data-data-table-card": "",
34473
- onClick: interactive ? () => onRowClick(row, rowIndex) : void 0,
34474
- className: [
34475
- "rounded-lg bg-surface px-3 py-1.5 divide-y divide-border-subtle",
34476
- bordered ? "border border-border" : "",
34477
- interactive ? "cursor-pointer hover:bg-primary/5" : "",
34478
- extra
34479
- ].filter(Boolean).join(" "),
34480
- children: [labelled.map((col) => /* @__PURE__ */ jsx(SettingRow, {
34481
- label: col.header,
34482
- children: col.render(row, rowIndex)
34483
- }, col.key)), unlabelled.length > 0 && /* @__PURE__ */ jsx("div", {
34484
- className: "flex flex-wrap items-center justify-end gap-2 py-1.5",
34485
- children: unlabelled.map((col) => /* @__PURE__ */ jsx("div", { children: col.render(row, rowIndex) }, col.key))
34486
- })]
36391
+ var COPIED_RESET_MS = 2e3;
36392
+ function CopyButton({ value, label, srLabel, className, disabled }) {
36393
+ const [copied, setCopied] = useState(false);
36394
+ const handleCopy = useCallback(() => {
36395
+ if (!value) return;
36396
+ navigator.clipboard.writeText(value).then(() => {
36397
+ setCopied(true);
36398
+ setTimeout(() => setCopied(false), COPIED_RESET_MS);
36399
+ });
36400
+ }, [value]);
36401
+ return /* @__PURE__ */ jsxs(Button, {
36402
+ size: "sm",
36403
+ variant: "ghost",
36404
+ type: "button",
36405
+ disabled: disabled || value.length === 0,
36406
+ onClick: handleCopy,
36407
+ className: cn(className),
36408
+ "aria-label": copied ? "Copied" : `Copy ${srLabel ?? label ?? "value"}`,
36409
+ children: [copied ? /* @__PURE__ */ jsx(Check, { className: "h-3.5 w-3.5 text-success" }) : /* @__PURE__ */ jsx(Copy, { className: "h-3.5 w-3.5" }), label ? /* @__PURE__ */ jsx("span", {
36410
+ className: "ml-1",
36411
+ children: copied ? "Copied" : label
36412
+ }) : null]
34487
36413
  });
34488
36414
  }
34489
36415
  //#endregion
@@ -54150,30 +56076,6 @@ function DoorbellRecentPanel({ history, limit = 5, latestIsFresh, className }) {
54150
56076
  });
54151
56077
  }
54152
56078
  //#endregion
54153
- //#region src/composites/section-card.tsx
54154
- function SectionCard({ headingId, title, icon: Icon, actions, testId, children }) {
54155
- return /* @__PURE__ */ jsxs("section", {
54156
- "aria-labelledby": headingId,
54157
- className: SECTION_CARD,
54158
- "data-testid": testId,
54159
- children: [/* @__PURE__ */ jsxs("header", {
54160
- className: `${SECTION_HEADER} flex min-h-9 flex-wrap items-center gap-2`,
54161
- children: [
54162
- Icon !== void 0 && /* @__PURE__ */ jsx(Icon, {
54163
- className: "h-3.5 w-3.5 shrink-0 text-foreground-subtle",
54164
- "aria-hidden": true
54165
- }),
54166
- /* @__PURE__ */ jsx("h2", {
54167
- id: headingId,
54168
- className: `${TEXT_SECTION_LABEL} min-w-0 flex-1`,
54169
- children: title
54170
- }),
54171
- actions
54172
- ]
54173
- }), children]
54174
- });
54175
- }
54176
- //#endregion
54177
56079
  //#region src/composites/filter-bar.tsx
54178
56080
  function FilterBar({ filters, values, onChange, className }) {
54179
56081
  const isMobile = useIsMobile();
@@ -54686,26 +56588,6 @@ function KebabMenu({ items, header, triggerClassName, title = "More actions" })
54686
56588
  });
54687
56589
  }
54688
56590
  //#endregion
54689
- //#region src/composites/key-value-list.tsx
54690
- /**
54691
- * A `<dl>` of label/value rows. Layout (including the L1 stacking) is owned by
54692
- * `SettingRow`; this composite only supplies the description-list semantics.
54693
- *
54694
- * The rows used to be `flex items-center h-7` with a `w-1/3` term, so a label
54695
- * could neither wrap nor stack: on a phone it took a third of the width and
54696
- * the value took whatever was left.
54697
- */
54698
- function KeyValueList({ items, className }) {
54699
- return /* @__PURE__ */ jsx("dl", {
54700
- className: cn("flex flex-col", className),
54701
- children: items.map((item) => /* @__PURE__ */ jsx(SettingRow, {
54702
- elements: "description",
54703
- label: item.key,
54704
- children: item.value
54705
- }, item.key))
54706
- });
54707
- }
54708
- //#endregion
54709
56591
  //#region src/composites/mount-addon-page.tsx
54710
56592
  /**
54711
56593
  * mountAddonPage — one-liner to mount an addon page in dev mode.
@@ -58855,323 +60737,6 @@ function useStationaryOverlay(trpc, deviceId) {
58855
60737
  return query.isError ? void 0 : query.data;
58856
60738
  }
58857
60739
  //#endregion
58858
- //#region src/hooks/turn-server-cache.ts
58859
- /** Short enough that rotated credentials are picked up promptly. */
58860
- var DEFAULT_FRESH_TTL_MS = 5 * 6e4;
58861
- /** Half of the shortest provider credential lifetime in the fleet (24 h). */
58862
- var DEFAULT_STALE_CAP_MS = 720 * 6e4;
58863
- var DEFAULT_STORAGE_KEY = "camstack:turn-servers:v1";
58864
- function defaultStorage() {
58865
- const g = globalThis;
58866
- try {
58867
- return g.localStorage ?? null;
58868
- } catch {
58869
- return null;
58870
- }
58871
- }
58872
- /** Type guard for a persisted entry — storage content is external data. */
58873
- function isCacheEntry(value) {
58874
- if (typeof value !== "object" || value === null) return false;
58875
- const v = value;
58876
- if (typeof v.fetchedAt !== "number" || !Array.isArray(v.servers)) return false;
58877
- return v.servers.every((s) => {
58878
- if (typeof s !== "object" || s === null) return false;
58879
- const srv = s;
58880
- if (!(typeof srv.urls === "string" || Array.isArray(srv.urls) && srv.urls.every((u) => typeof u === "string"))) return false;
58881
- if (srv.username !== void 0 && typeof srv.username !== "string") return false;
58882
- if (srv.credential !== void 0 && typeof srv.credential !== "string") return false;
58883
- return true;
58884
- });
58885
- }
58886
- var TurnServerCache = class {
58887
- freshTtlMs;
58888
- staleCapMs;
58889
- storage;
58890
- now;
58891
- storageKey;
58892
- /** Keyed on the caller's tRPC client object (stable per connected system). */
58893
- memory = /* @__PURE__ */ new WeakMap();
58894
- /** In-flight fetch per key — concurrent callers share one round trip. */
58895
- inflight = /* @__PURE__ */ new WeakMap();
58896
- constructor(options = {}) {
58897
- this.freshTtlMs = options.freshTtlMs ?? DEFAULT_FRESH_TTL_MS;
58898
- this.staleCapMs = options.staleCapMs ?? DEFAULT_STALE_CAP_MS;
58899
- this.storage = "storage" in options ? options.storage ?? null : defaultStorage();
58900
- this.now = options.now ?? (() => Date.now());
58901
- this.storageKey = options.storageKey ?? DEFAULT_STORAGE_KEY;
58902
- }
58903
- /**
58904
- * Resolve the ICE servers for `key`, fetching via `fetch` only when no
58905
- * fresh-enough entry exists. Never rejects: a failed fetch resolves to the
58906
- * stale entry when one exists, else `undefined`.
58907
- */
58908
- async getOrFetch(key, fetch) {
58909
- const at = this.now();
58910
- const entry = this.memory.get(key) ?? this.readStorage();
58911
- if (entry) {
58912
- const age = at - entry.fetchedAt;
58913
- if (age < this.freshTtlMs) return entry.servers;
58914
- if (age < this.staleCapMs) {
58915
- this.startFetch(key, fetch, entry);
58916
- return entry.servers;
58917
- }
58918
- }
58919
- return this.startFetch(key, fetch, entry);
58920
- }
58921
- startFetch(key, fetch, stale) {
58922
- const pending = this.inflight.get(key);
58923
- if (pending) return pending;
58924
- const run = (async () => {
58925
- try {
58926
- const servers = await fetch();
58927
- if (servers.length > 0) {
58928
- const entry = {
58929
- servers,
58930
- fetchedAt: this.now()
58931
- };
58932
- this.memory.set(key, entry);
58933
- this.writeStorage(entry);
58934
- }
58935
- return servers;
58936
- } catch {
58937
- return stale?.servers;
58938
- }
58939
- })().finally(() => {
58940
- this.inflight.delete(key);
58941
- });
58942
- this.inflight.set(key, run);
58943
- return run;
58944
- }
58945
- readStorage() {
58946
- if (!this.storage) return void 0;
58947
- try {
58948
- const raw = this.storage.getItem(this.storageKey);
58949
- if (raw === null) return void 0;
58950
- const parsed = JSON.parse(raw);
58951
- return isCacheEntry(parsed) ? parsed : void 0;
58952
- } catch {
58953
- return;
58954
- }
58955
- }
58956
- writeStorage(entry) {
58957
- if (!this.storage) return;
58958
- try {
58959
- this.storage.setItem(this.storageKey, JSON.stringify(entry));
58960
- } catch {}
58961
- }
58962
- };
58963
- //#endregion
58964
- //#region src/hooks/use-device-webrtc.ts
58965
- /**
58966
- * useDeviceWebrtc — WebRTC signaling hook for device-scoped streaming.
58967
- *
58968
- * Provides `createSession`, `sendAnswer`, `closeSession` callbacks and
58969
- * a `streams` list (Adaptive + High/Mid/Low) for a given device.
58970
- *
58971
- * Works in both admin-ui (BackendClient.trpc) and addon pages
58972
- * (AddonPageProps.trpc) — parametrized by a minimal tRPC proxy shape.
58973
- */
58974
- /**
58975
- * Hook that provides WebRTC signaling callbacks and stream choices for a device.
58976
- *
58977
- * @param trpc - tRPC proxy (admin-ui BackendClient.trpc or addon page trpc)
58978
- * @param deviceId - numeric device ID (null = disabled)
58979
- * @param pollIntervalMs - how often to refresh profile slots (default: 5000)
58980
- */
58981
- /** Module-level TURN/STUN credential cache. Keyed on the caller's trpc client
58982
- * object (stable per connected system — NOT on `trpc.turnProvider`, which is
58983
- * a proxy minted fresh on every property access), so two admin tabs pointed
58984
- * at different hubs never cross-serve credentials from the memory layer; the
58985
- * storage layer is per-origin, and the page's origin IS the hub. Coalesces
58986
- * concurrent fetches (the mount prefetch and the connect's own call used to
58987
- * race into TWO round trips) and persists across page loads so a fresh embed
58988
- * page — one per camera open on native — finds warm credentials instead of
58989
- * re-paying the measured 0.2–3.6 s serialized fetch. See turn-server-cache.ts. */
58990
- var turnServersCache = new TurnServerCache();
58991
- function useDeviceWebrtc(trpc, deviceId, pollIntervalMs = 5e3) {
58992
- const [remoteStreams, setRemoteStreams] = useState([]);
58993
- useEffect(() => {
58994
- if (deviceId === null) return;
58995
- let cancelled = false;
58996
- const fetch = () => {
58997
- trpc.webrtcSession.listStreams.query({ deviceId }).then((rows) => {
58998
- if (!cancelled) setRemoteStreams(rows);
58999
- }).catch(() => {});
59000
- };
59001
- fetch();
59002
- const iv = setInterval(fetch, pollIntervalMs);
59003
- return () => {
59004
- cancelled = true;
59005
- clearInterval(iv);
59006
- };
59007
- }, [
59008
- trpc,
59009
- deviceId,
59010
- pollIntervalMs
59011
- ]);
59012
- const [pipelineMetrics, setPipelineMetrics] = useState(null);
59013
- useEffect(() => {
59014
- if (deviceId === null) return;
59015
- let cancelled = false;
59016
- if (trpc.pipelineOrchestrator) trpc.pipelineOrchestrator.getCameraMetrics.query({ deviceId }).then((m) => {
59017
- if (cancelled || !m) return;
59018
- setPipelineMetrics({
59019
- phase: m.phase,
59020
- detectionFps: m.actualFps,
59021
- avgInferenceMs: m.avgInferenceTimeMs,
59022
- droppedFrames: m.droppedFrames
59023
- });
59024
- }).catch(() => {});
59025
- return () => {
59026
- cancelled = true;
59027
- };
59028
- }, [trpc, deviceId]);
59029
- useLiveEvent("pipeline.camera-metrics-snapshot", (evt) => {
59030
- if (deviceId === null) return;
59031
- const payload = evt.data;
59032
- if (payload.deviceId !== deviceId || !payload.metrics) return;
59033
- setPipelineMetrics({
59034
- phase: payload.metrics.phase,
59035
- detectionFps: payload.metrics.actualFps,
59036
- avgInferenceMs: payload.metrics.avgInferenceTimeMs,
59037
- droppedFrames: payload.metrics.droppedFrames
59038
- });
59039
- });
59040
- const { streams, hasWebrtc } = useMemo(() => {
59041
- if (deviceId === null || remoteStreams.length === 0) return {
59042
- streams: [],
59043
- hasWebrtc: false
59044
- };
59045
- return {
59046
- streams: remoteStreams.map((r) => ({
59047
- id: r.id,
59048
- label: r.label,
59049
- target: r.target,
59050
- status: r.status,
59051
- inputFps: r.inputFps,
59052
- decodeFps: r.decodeFps,
59053
- bitrateKbps: r.bitrateKbps
59054
- })),
59055
- hasWebrtc: true
59056
- };
59057
- }, [deviceId, remoteStreams]);
59058
- const getIceServers = useCallback(async () => {
59059
- const provider = trpc.turnProvider;
59060
- if (!provider) return void 0;
59061
- return turnServersCache.getOrFetch(trpc, async () => {
59062
- return (await provider.getTurnServers.query()).map((s) => {
59063
- return {
59064
- urls: typeof s.urls === "string" ? s.urls : [...s.urls],
59065
- ...s.username !== void 0 ? { username: s.username } : {},
59066
- ...s.credential !== void 0 ? { credential: s.credential } : {}
59067
- };
59068
- });
59069
- });
59070
- }, [trpc]);
59071
- useEffect(() => {
59072
- getIceServers();
59073
- }, [getIceServers]);
59074
- const createSession = useCallback(async (target, hints) => {
59075
- if (deviceId === null) throw new Error("No device selected");
59076
- const res = await trpc.webrtcSession.createSession.mutate({
59077
- deviceId,
59078
- target,
59079
- hints
59080
- });
59081
- const iceServers = await getIceServers();
59082
- return {
59083
- sessionId: res.sessionId,
59084
- sdpOffer: res.sdpOffer,
59085
- ...iceServers ? { iceServers } : {}
59086
- };
59087
- }, [
59088
- trpc,
59089
- deviceId,
59090
- getIceServers
59091
- ]);
59092
- const handleOffer = useCallback(async (target, sdpOffer, sessionId, hints) => {
59093
- if (deviceId === null) throw new Error("No device selected");
59094
- return trpc.webrtcSession.handleOffer.mutate({
59095
- deviceId,
59096
- target,
59097
- sdpOffer,
59098
- ...sessionId !== void 0 ? { sessionId } : {},
59099
- ...hints !== void 0 ? { hints } : {}
59100
- });
59101
- }, [trpc, deviceId]);
59102
- const sendAnswer = useCallback(async (sessionId, sdpAnswer) => {
59103
- if (deviceId === null) throw new Error("No device selected");
59104
- await trpc.webrtcSession.handleAnswer.mutate({
59105
- deviceId,
59106
- sessionId,
59107
- sdpAnswer
59108
- });
59109
- }, [trpc, deviceId]);
59110
- return {
59111
- streams,
59112
- hasWebrtc,
59113
- pipelineMetrics,
59114
- createSession,
59115
- handleOffer,
59116
- getIceServers,
59117
- addIceCandidate: useCallback(async (sessionId, candidate) => {
59118
- if (deviceId === null) return;
59119
- await trpc.webrtcSession.addIceCandidate.mutate({
59120
- deviceId,
59121
- sessionId,
59122
- candidate: candidate.candidate ?? "",
59123
- sdpMid: candidate.sdpMid ?? null,
59124
- sdpMLineIndex: candidate.sdpMLineIndex ?? null
59125
- }).catch(() => {});
59126
- }, [trpc, deviceId]),
59127
- getIceCandidates: useCallback(async (sessionId) => {
59128
- if (deviceId === null) return {
59129
- candidates: [],
59130
- done: true
59131
- };
59132
- return trpc.webrtcSession.getIceCandidates.query({
59133
- deviceId,
59134
- sessionId
59135
- });
59136
- }, [trpc, deviceId]),
59137
- sendAnswer,
59138
- closeSession: useCallback(async (sessionId) => {
59139
- if (deviceId === null) return;
59140
- await trpc.webrtcSession.closeSession.mutate({
59141
- deviceId,
59142
- sessionId
59143
- }).catch(() => {});
59144
- }, [trpc, deviceId]),
59145
- getSessionState: useCallback(async (sessionId) => {
59146
- if (deviceId === null) return { pendingRenegotiation: null };
59147
- try {
59148
- return await trpc.webrtcSession.getSessionState.query({
59149
- deviceId,
59150
- sessionId
59151
- });
59152
- } catch {
59153
- return { pendingRenegotiation: null };
59154
- }
59155
- }, [trpc, deviceId]),
59156
- getSessionDebug: useCallback(async (sessionId) => {
59157
- if (deviceId === null) throw new Error("getSessionDebug: no device bound to this player");
59158
- return trpc.webrtcSession.getSessionDebug.query({
59159
- deviceId,
59160
- sessionId
59161
- });
59162
- }, [trpc, deviceId]),
59163
- applyDownlinkProbe: useCallback(async (sessionId, downlinkMbps) => {
59164
- const mutate = trpc.webrtcSession.applyDownlinkProbe;
59165
- if (deviceId === null || mutate === void 0) throw new Error("applyDownlinkProbe: not available for this player");
59166
- return mutate.mutate({
59167
- deviceId,
59168
- sessionId,
59169
- downlinkMbps
59170
- });
59171
- }, [trpc, deviceId])
59172
- };
59173
- }
59174
- //#endregion
59175
60740
  //#region src/hooks/use-doorbell-events.ts
59176
60741
  /**
59177
60742
  * useDoorbellEvents — subscribe to doorbell.onPressed across the cluster.
@@ -59444,4 +61009,4 @@ var SceneMonitorEditor = lazy(() => import("./SceneMonitorEditor-vfWTm6qv.js").t
59444
61009
  /** Lazy-wrapped `PrivacyMaskSettings` — code-split off the main bundle. */
59445
61010
  var PrivacyMaskSettings = lazy(() => import("./PrivacyMaskSettings-DMkchqO1.js").then((m) => ({ default: m.PrivacyMaskSettings })));
59446
61011
  //#endregion
59447
- export { AddonGlobalSettingsForm, AdminLinkQuickAction, AgentStepEditor, AlarmHeroCard, AlarmInlineControl as AlarmPanelInlineControl, AppShell, ArcKnob, AudioClassificationList, AudioLevelWaveform, AudioWaveform, AutomationHeroCard, AutomationInlineControl, AutotrackSection, BTN_COMPACT, BTN_COMPACT_DANGER, BTN_COMPACT_PRIMARY, BTN_COMPACT_WARNING, Badge, BatteryBadge, BottomSheet, Breadcrumb, BrightnessPanel, Button, ButtonControl, ButtonHeroCard, CARD_MODE_MIN_COLUMNS, CENTER, CHIP_ACTIVE, CHIP_BASE, CHIP_INACTIVE, CLASS_COLORS, COLUMN_BREAKPOINT_CLASS, COLUMN_PRIORITY, COMMIT_DEDUPE_TOLERANCE_MS, COMMIT_DEDUPE_WINDOW_MS, CONTROL_CAP_NAMES, CONTROL_FILLS, CameraStreamPlayer, Card, Checkbox, ChildSectionAccordion, ClimatePanel, CodeBlock, CollapsibleCard, ConfigFormBuilder, FormField as ConfigFormField, ConfigNotificationTargetMultiSelectFieldView, ConfigNotificationTargetSelectFieldView, ConfigSchemaField, ConfirmActionButton, ConfirmDialogProvider, ConsumablesPanel, ContainerChildrenProvider, ContainerPrimaryHero, ControlColumn, ControlHeroCard, ControlInlineControl, ControlPanel, CopyButton, CoverHeroCard, CoverInlineControl, CoverPanel, CustomFieldRenderersProvider, DEFAULT_COLOR, DEVICE_COLUMNS, DEVICE_LIST_PAGE_SIZE_KEY, DEVICE_LIST_PAGE_SIZE_OPTIONS, DEVICE_PICKER_GROUP_STORAGE_KEY, DEVICE_ROLE_META, DEVICE_TYPE_CONTROL, DEVICE_TYPE_META, DISPLAY_ICON_REGISTRY, DataTable, DataTableFilterBar, DetectionCanvas, DetectionOverlay, DetectionResultTree, DevShell, DeviceActivityPanel, DeviceBatchToolbar, DeviceCard, DeviceContextProvider, DeviceExportPanel, DeviceFilterBar, DeviceGrid, DeviceItem, DeviceList, DeviceMultiSelectField, DevicePicker, DeviceQuickDetailProvider, DeviceSelectField, DeviceSelectorPicker, DeviceStepMatrix, DevicesFailedLine, DevicesLoadingLine, DevicesWidenWarning, Dialog, DialogBody, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DiscoveryPanel, DoorbellRecentPanel, Dropdown, DropdownContent, DropdownItem, DropdownTrigger, DummyHeroCard, DummyInline, EMPTY_DATA_TABLE_FILTER, EVENT_KIND_ICONS, EmptyState, ErrorBox, EventKindGlyph, EventStream, ExtensionsPanel, FILL, FLEET_LIST_GC_TIME_MS, FLEET_LIST_QUERY_KEY, FLEET_LIST_STALE_TIME_MS, FanHeroCard, FanInlineControl, FanPanel, FilterBar, FloatingEventStream, FloatingLogStream, FloatingPanel, FormField$1 as FormField, GRID_GAP, GRID_PAIRED, GRID_QUICK_STATS, GripTrack, GroupedModelSelector, HOST_WIDGETS, HlsVideo, HoverZoomImage, HumidifierHeroCard, HumidifierInlineControl, INPUT_COMPACT, INPUT_SHELL, IconAction, IconButton, IconPicker, ImageHeroCard, ImageInlineControl, ImageSelector, InferenceConfigSelector, Input, KebabMenu, KeyValueList, LIST_ROW, Label, LawnMowerHeroCard, LawnMowerInlineControl, LightHeroCard, LightInlineControl, LockHeroCard, LockInlineControl, LockPanel, LogStream, LoginForm, MODE_COLOR, MaskShapeCanvas, MediaPlayerHeroCard, MediaPlayerInlineControl, MediaPlayerPanel, MobileDrawer, ModelPicker, MotionZonesSettings, NAVIGATION_DRIVE_INTERVAL_MS, NavigationPanel, NetworkLinkBadge, NodeMultiSelectField, NodePicker, NodeSelectField, NotificationTargetSelectField, NotificationTargetsField, OPTION_SELECT_SEARCH_MIN_OPTIONS, OfflineBadge, OptionSelect, PHASE_CONFIG, PICKER_CHIP_LIMIT, PICKER_DEFAULT_GROUP_BY, PICKER_GROUP_BY_MODES, PICKER_GROUP_COLLAPSE_AT, PICKER_NONE_KEY, PICKER_NOUN_PLURAL, PICKER_NO_FILTERS, PICKER_PAGE_SIZE, PICKER_SEARCH_DEBOUNCE_MS, PICKER_WINDOW, PRIORITY, PTZOverlay, PageHeader, PhaseIcon, PipelineBuilder, PipelineRuntimeSelector, PipelineStep, PipelineTreeMatrix, PlaceholderChipField, PlayerOverlaysProvider, Popover, PopoverContent, PopoverRowAction, PopoverTrigger, PrimaryChildPicker, PrivacyMaskSettings, ProviderBadge, PtzPanel, QrCode, RECONNECT_POLICY, RECORDED_PLAYBACK_MODES, RIGHT, ROI_AREA_WARN_FRACTION, ROLE_DESCRIPTOR, RadialGauge, RecordedPlaybackProvider, RecordingPanel, ResponseLog, RoleDisplayDefaultsFromServer, RoleDisplayDefaultsProvider, SCENE_CAPTURE_VARIANTS, SECTION_BODY, SECTION_CARD, SECTION_HEADER, SETTING_ROW, SETTING_ROW_LABEL, SETTING_ROW_STACK_BREAKPOINT, SETTING_ROW_VALUE, SETTING_ROW_VALUE_TEXT, SNAPSHOT_MEDIA_PATH, SPLIT_PANEL_OUTER, SPLIT_PANEL_SIDE, STACK_GAP, STATE_COLOR, SceneMonitorEditor, ScopePicker, ScriptHeroCard, ScriptInlineControl, ScrollArea, SectionCard, Select, SelectedChip, SemanticBadge, SensorHeroCard, SensorInlineControl, SensorValueAtom, Separator, SettingRow, Sidebar, SidebarItem, Skeleton, SlideOverPanel, SlideToggle, SnapshotButton, SortHeaderButton, StatCard, StateValuesStream, StatusBadge, StepTimings, StepTreeMaster, Stepper, StreamBrokerSelector, StreamDebugOverlay, StreamPanel, Switch, SwitchHeroCard, SwitchInlineControl, SwitchPanel, SystemProvider, TABLE_SCROLL_MAX_H, TEXT_FIELD_LABEL, TEXT_HINT, TEXT_METRIC, TEXT_SECTION_LABEL, TEXT_VALUE, TIMEZONES, Tabs, TabsContent, TabsList, TabsTrigger, TapToggle, ThemeProvider, ThermostatHeroCard, ThermostatInlineControl, TimezoneSelector, Tooltip, TooltipContent, TooltipTrigger, UnitPicker, VacuumHeroCard, VacuumInlineControl, ValueReadout, ValveHeroCard, ValveInlineControl, VersionBadge, VodPlaybackProvider, WaterHeaterHeroCard, WaterHeaterInlineControl, WeatherHeroCard, WeatherInlineControl, WidgetMetricCard, WidgetPanel, WidgetRegistryProvider, WidgetSlot, ZoneEditingProvider, MicOff as a, agentColumnKey, allDeviceTypeFilterOptions, applyFleetQueryDefaults, applyPickerFilters, ariaSortForColumn, badgeFor, buildStepTreeFromSchema, EyeOff as c, catalogHasDraft, childEntityId, childListName, chipOverflow, classifyCapability, clearPickerGroup, cn, columnsForContext, containerChildToRef, countableDevices, coverHighlight, coverageLine, createSharedContext, createTheme, cursorFractionFor, darkColors, dataTableFacets, defaultTheme, deriveDeviceKind, deriveWebrtcDebugStats, describeDeviceSelector, deviceIntegrationResolver, deviceListStateOf, deviceMatchesFilter, deviceOptionLabel, deviceRoleMeta, deviceRoleMetaOf, deviceTypeLabel, deviceTypeMeta, deviceTypeMetaOf, devicesToOptions, draftFromQuery, emptyDevicesWidens, ensureMfHostInit, eventKindLabel, filterDataTableRows, filterDeviceOptions, filterOptions as filterOptionSelectOptions, filterPickerDevices, findTimezone, flattenPickerGrouping, flattenPickerRows, fleetViewOf, formatControlDateTime, formatLastSeen, formatNumeric, freezeVerdict, fuzzyMatch, getClassColor, getPhaseVisual, groupAgentColumns, groupChildrenByLayout, groupPickerDevices, groupPickerDevicesBy, hardwareLabel, hubOrigin, hubPath, hubUrl, hubWsUrl, humanDuration, humidifierTint, Mic as i, initialScrubState, insertAtSelection, isAbsentProvider, isDataTableFilterActive, isFieldVisible, isGroupExpanded, Camera as l, lawnMowerActivityMeta, lightColors, loadRemoteBundle, makeScrubBridge, metadataEntries, metadataString, mirror, mountAddonPage, mountPath, Square as n, nextReconnectAction, nextSort, nextSortDirection, nextTableSort, normalizeForSearch, ImageOff as o, offListSelections, openTopLayer, optionSearchText as optionSelectSearchText, orphanDeviceLabel, overrideEntityIdFromLink, pageRows, parentDetailOf, parsePickerGroupBy, parseRecordedServerMessage, partitionSelected as partitionOptionSelectSelected, partitionSuggested, pickerFacetFilterShown, pickerFacetKey, pickerFacetOptions, pickerFiltersActive, pickerGroupKey, pickerHiddenSelectedCount, pickerLocationKey, pickerQueryTokens, pickerRowFacts, pickerSearchText, pickerZoneFilterSuspended, providerIcons, RotateCcw as r, readStoredGroupBy, resetHubMountForTests, resetPickerFilters, resolveContainerPrimary, resolveControlAlign, resolveDeviceControl, resolveDeviceIntegration, resolveDisplayIcon, resolveEffectiveDefaultModel, resolveEffectiveStepModel, resolveEventKindIcon, resolveSearchable as resolveOptionSelectSearchable, resolveParentNames, resolvePrimaryChild, resolveSelectedDevices, resolveSensorDisplay, resolveStepDefaultModel, resolveTableLayout, roiTooLarge, rootSourceState, routerBasename, Grid2x2 as s, sameLocationSuggestions, scrubReducer, selectPickerGroup, selectedDeviceOptions, serializeRecordedCommand, shouldCommit, shouldEmit, shouldShowAddNewFooter, shouldShowUseQueryRow, shouldUseSingleNode, showsNoCamerasHint, sortRows, sortRowsByColumn, statusIcons, statusLine, stepHasModelForFormat, stepModelOptions, stripParentNamePrefix, Trash2 as t, tabForSelector, tankAlert, themeToCss, toStationaryOverlayBox, toggleDataTableFacet, togglePickerDevice, togglePickerKey, trpc, typeLabel, createLucideIcon as u, useAccessoriesGetStatus, useAccessoriesSetChildHidden, useAddonPagesListPages, useAddonSettingsGetDeviceSettings, useAddonSettingsGetGlobalSettings, useAddonSettingsGetIntegrationSettings, useAddonSettingsUpdateDeviceSettings, useAddonSettingsUpdateGlobalSettings, useAddonWidgetsListWidgets, useAddonsApplyAutoUpdateToAll, useAddonsCancelJob, useAddonsCustom, useAddonsForceRefresh, useAddonsGetAddonAutoUpdate, useAddonsGetAutoUpdateSettings, useAddonsGetJob, useAddonsGetLastRestart, useAddonsGetLogs, useAddonsGetVersions, useAddonsInstallFromWorkspace, useAddonsInstallPackage, useAddonsIsWorkspaceAvailable, useAddonsList, useAddonsListCapabilityProviders, useAddonsListFrameworkPackages, useAddonsListJobs, useAddonsListPackages, useAddonsListUpdates, useAddonsListWorkspacePackages, useAddonsOnAddonLogs, useAddonsReloadPackages, useAddonsRestartAddon, useAddonsRestartServer, useAddonsRetryLoad, useAddonsRollbackPackage, useAddonsSearchAvailable, useAddonsSetAddonAutoUpdate, useAddonsSetAutoUpdateSettings, useAddonsSetCapabilityProviderEnabled, useAddonsStartJob, useAddonsUninstallPackage, useAddonsUpdatePackage, useAirQualitySensorGetStatus, useAlarmPanelArm, useAlarmPanelDisarm, useAlarmPanelGetStatus, useAlarmPanelTrigger, useAlert, useAlertsDismiss, useAlertsEmit, useAlertsGetUnreadCount, useAlertsList, useAlertsMarkAllRead, useAlertsMarkRead, useAlertsUpdate, useAllWidgets, useAmbientLightSensorGetStatus, useAudioAnalysisApplyDeviceSettingsPatch, useAudioAnalysisGetDeviceLiveContribution, useAudioAnalysisGetDeviceSettingsContribution, useAudioAnalysisResolveDeviceSettings, useAudioAnalyzerAnalyseChunk, useAudioAnalyzerAttachDevice, useAudioAnalyzerClassify, useAudioAnalyzerDetachDevice, useAudioAnalyzerDispose, useAudioAnalyzerIsReady, useAudioAnalyzerReprobeAudioEngine, useAudioCodecCanHandle, useAudioCodecCloseSession, useAudioCodecCreateDecodeSession, useAudioCodecCreateEncodeSession, useAudioCodecFlushEncode, useAudioCodecListActiveSessions, useAudioCodecListSupportedCodecs, useAudioCodecPullEncoded, useAudioCodecPullPcm, useAudioCodecPushEncodedFrame, useAudioCodecPushPcm, useAudioMetricsGetCurrentSnapshot, useAudioMetricsGetHistory, useAutomationControlDisable, useAutomationControlEnable, useAutomationControlGetStatus, useAutomationControlTrigger, useBackupCancel, useBackupDelete, useBackupDeleteSchedule, useBackupGetEntries, useBackupList, useBackupListArchives, useBackupListDestinations, useBackupListLocations, useBackupListRuns, useBackupListSchedules, useBackupPreviewSchedule, useBackupRestore, useBackupTrigger, useBackupUpsertDestinationPolicy, useBackupUpsertSchedule, useBatteryGetStatus, useBatteryWakeForStream, useBinaryGetStatus, useBrightnessGetStatus, useBrightnessSetBrightness, useBrokerAdd, useBrokerGet, useBrokerGetBrokerConfig, useBrokerGetSettings, useBrokerGetSettingsSchema, useBrokerGetState, useBrokerGetStatus, useBrokerList, useBrokerListProviders, useBrokerPublish, useBrokerRemove, useBrokerSetSettings, useBrokerSubscribe, useBrokerTestConnection, useBrokerTestSettings, useBrokerUnsubscribe, useButtonPress, useCalendarsGetPreferences, useCalendarsListCalendars, useCalendarsListEvents, useCalendarsSetCalendarPreference, useCameraCredentialsGetCredentials, useCameraCredentialsGetStatus, useCameraGridLayoutApplyDeviceSettingsPatch, useCameraGridLayoutGetDeviceLiveContribution, useCameraGridLayoutGetDeviceSettingsContribution, useCameraGridLayoutGetLayout, useCameraGridLayoutSaveLayout, useCameraPipelineConfigApplyDeviceSettingsPatch, useCameraPipelineConfigGetDeviceLiveContribution, useCameraPipelineConfigGetDeviceSettingsContribution, useCameraStreamsGetBrokerStreams, useCameraStreamsGetCameraStreams, useCameraStreamsGetProfileRtspEntries, useCameraStreamsGetRtspEntries, useCameraStreamsPickStream, useCapabilityPresence, useCarbonMonoxideGetStatus, useClimateControlGetStatus, useClimateControlSetFanMode, useClimateControlSetMode, useClimateControlSetPreset, useClimateControlSetSwingHorizontal, useClimateControlSetSwingVertical, useClimateControlSetTarget, useClimateControlSetTargetHumidity, useClimateControlSetTargetRange, useClusterNodes, useClusterTopology, useColorGetStatus, useColorSetColor, useConfirm, useConnectionTestDescribeTest, useConnectionTestTestSettings, useConnectivityGetStatus, useConsumablesGetStatus, useConsumablesReset, useContactGetStatus, useContainerChildren, useControlGetStatus, useControlSetValue, useCoreBlocksCompile, useCoreBlocksCreate, useCoreBlocksCreateComposition, useCoreBlocksDelete, useCoreBlocksGet, useCoreBlocksGetBlockSettings, useCoreBlocksGetComposition, useCoreBlocksGetCustomization, useCoreBlocksGetTypeDefs, useCoreBlocksList, useCoreBlocksListComposableCaps, useCoreBlocksListCompositions, useCoreBlocksRestart, useCoreBlocksSetEnabled, useCoreBlocksUpdate, useCoreBlocksUpdateBlockSettings, useCoreBlocksUpdateComposition, useCoreBlocksValidateComposition, useCoverClose, useCoverGetStatus, useCoverOpen, useCoverSetPosition, useCoverSetTiltPosition, useCoverStop, useCustomFieldRenderer, useDataTableFilter, useDayNightGetOptions, useDayNightGetStatus, useDayNightSetSettings, useDebouncedString, useDecoderCreateSession, useDecoderDestroySession, useDecoderGetFrame, useDecoderGetInfo, useDecoderGetShmStats, useDecoderGetStats, useDecoderListActiveSessions, useDecoderOpenStream, useDecoderPullFrames, useDecoderPullHandles, useDecoderPushPacket, useDecoderReprobeHwaccel, useDecoderSupportsCodec, useDecoderUpdateConfig, useDetectionPipelineApplyDeviceSettingsPatch, useDetectionPipelineGetDeviceLiveContribution, useDetectionPipelineGetDeviceSettingsContribution, useDevShell, useDevice, useDeviceAdminLink, useDeviceAdminLinkGetAdminLink, useDeviceAdoptionAdopt, useDeviceAdoptionGetCandidate, useDeviceAdoptionGetStatus, useDeviceAdoptionListCandidateFilters, useDeviceAdoptionListCandidates, useDeviceAdoptionRefresh, useDeviceAdoptionRelease, useDeviceAdoptionResync, useDeviceAutotrack, useDeviceBattery, useDeviceCapSlice, useDeviceCapability, useDeviceDetections, useDeviceDiscoveryAdoptDevice, useDeviceDiscoveryGetStatus, useDeviceDiscoveryListDiscovered, useDeviceDiscoveryRefreshDiscovery, useDeviceDiscoveryReleaseDevice, useDeviceExportApplyDeviceSettingsPatch, useDeviceExportExposeDevice, useDeviceExportGetDeviceLiveContribution, useDeviceExportGetDeviceSettingsContribution, useDeviceExportGetStatus, useDeviceExportListExposedDevices, useDeviceExportListSupportedDeviceKinds, useDeviceExportUnexposeDevice, useDeviceExtensionListCandidates, useDeviceExtensionListSlots, useDeviceExtensionListSources, useDeviceExtensionSetSlot, useDeviceId, useDeviceListPageSize, useDeviceManagerAddLocation, useDeviceManagerAdoptDevice, useDeviceManagerAdoptionAdopt, useDeviceManagerAdoptionCancelJob, useDeviceManagerAdoptionListCandidateFilters, useDeviceManagerAdoptionListCandidates, useDeviceManagerAdoptionListJobs, useDeviceManagerAdoptionRefresh, useDeviceManagerAdoptionRelease, useDeviceManagerAdoptionResync, useDeviceManagerAdoptionStartJob, useDeviceManagerAllocateDeviceId, useDeviceManagerApplyInitialMeta, useDeviceManagerCreateDevice, useDeviceManagerDisable, useDeviceManagerDiscoverAllProviders, useDeviceManagerDiscoverDevices, useDeviceManagerDiscoverProvider, useDeviceManagerDiscoveryProviders, useDeviceManagerEnable, useDeviceManagerGetAllBindings, useDeviceManagerGetBindings, useDeviceManagerGetBindingsBatch, useDeviceManagerGetChildren, useDeviceManagerGetChildrenBatch, useDeviceManagerGetConfigSchema, useDeviceManagerGetCreationSchema, useDeviceManagerGetDevice, useDeviceManagerGetDeviceAggregate, useDeviceManagerGetDeviceLiveInfoAggregate, useDeviceManagerGetDeviceSettingsAggregate, useDeviceManagerGetDeviceStatusAggregate, useDeviceManagerGetDeviceStatusAggregateBatch, useDeviceManagerGetLinkedDevices, useDeviceManagerGetLinkedDevicesBatch, useDeviceManagerGetRoleDisplayDefaults, useDeviceManagerGetSettingsSchema, useDeviceManagerGetStreamProfileMap, useDeviceManagerGetStreamSources, useDeviceManagerGetWireableFields, useDeviceManagerGetWrapperActivation, useDeviceManagerListAll, useDeviceManagerListBindableCapsForDeviceType, useDeviceManagerListDeviceIdsByCaps, useDeviceManagerListLocationDescriptions, useDeviceManagerListLocationIcons, useDeviceManagerListLocations, useDeviceManagerListPersistedByAddon, useDeviceManagerListSiteZones, useDeviceManagerListWrappersForCap, useDeviceManagerLoadConfig, useDeviceManagerLoadMeta, useDeviceManagerLoadRuntimeState, useDeviceManagerMigrateDevice, useDeviceManagerPersistConfig, useDeviceManagerProbeStreams, useDeviceManagerProviderCreationType, useDeviceManagerProviderDiscoveryParamsSchema, useDeviceManagerRegisterDevice, useDeviceManagerRemove, useDeviceManagerRemoveByIntegration, useDeviceManagerRemoveDevice, useDeviceManagerRemoveLocation, useDeviceManagerRemoveSiteZone, useDeviceManagerRenameLocation, useDeviceManagerRenameSiteZone, useDeviceManagerRunDeviceAction, useDeviceManagerSetChildLayout, useDeviceManagerSetDisabled, useDeviceManagerSetDisplay, useDeviceManagerSetIntegrationId, useDeviceManagerSetLinkDeviceId, useDeviceManagerSetLocation, useDeviceManagerSetLocationDescription, useDeviceManagerSetLocationIcon, useDeviceManagerSetLocationZone, useDeviceManagerSetMetadata, useDeviceManagerSetName, useDeviceManagerSetPrimaryChildEntityId, useDeviceManagerSetRole, useDeviceManagerSetRoleDisplayDefaults, useDeviceManagerSetSiteZone, useDeviceManagerSetStreamProfileMap, useDeviceManagerSetType, useDeviceManagerSetWrapperActive, useDeviceManagerTestCreationField, useDeviceManagerTestField, useDeviceManagerUpdateConfig, useDeviceManagerUpdateDeviceField, useDeviceManagerUpdateDeviceFieldsBatch, useDeviceNetworkLink, useDeviceOpsGetConfigEntries, useDeviceOpsGetRawState, useDeviceOpsGetSettingsSchema, useDeviceOpsGetStreamSources, useDeviceOpsRemoveDevice, useDeviceOpsRunAction, useDeviceOpsSetConfig, useDeviceProviderAdoptDiscoveredDevice, useDeviceProviderCreateDevice, useDeviceProviderDiscoverDevices, useDeviceProviderGetChildCreationSchema, useDeviceProviderGetDevices, useDeviceProviderGetDiscoveryParamsSchema, useDeviceProviderGetManualCreationType, useDeviceProviderGetStatus, useDeviceProviderReloadDevice, useDeviceProviderStart, useDeviceProviderStop, useDeviceProviderSupportsDiscovery, useDeviceProviderSupportsManualCreation, useDeviceProviderTestCreationField, useDeviceProxy, useDeviceQuickDetailOpen, useDeviceSnapshot, useDeviceSnapshotImage, useDeviceState, useDeviceStateClaimFields, useDeviceStateGetAllSnapshots, useDeviceStateGetCapSlice, useDeviceStateGetNativeCapSlice, useDeviceStateGetSnapshot, useDeviceStateListClaims, useDeviceStatePatchOwnedFields, useDeviceStateReleaseClaim, useDeviceStateSetCapSlice, useDeviceStateSlice, useDeviceStatusGetStatus, useDeviceWebrtc, useDevices, useDoorbellEvents, useDoorbellGetStatus, useEnumSensorGetStatus, useEventEmitterGetStatus, useEventInvalidation, useEventStreamLatest, useEventStreamMap, useFaceGalleryAssignFace, useFaceGalleryAssignFaces, useFaceGalleryAuditIdentitySamples, useFaceGalleryCreateIdentity, useFaceGalleryDeleteFace, useFaceGalleryDeleteIdentity, useFaceGalleryGetFaceByTrack, useFaceGalleryGetFaceMedia, useFaceGalleryListIdentities, useFaceGalleryListIdentitySamples, useFaceGalleryListRecentFaces, useFaceGalleryRemoveSample, useFaceGalleryRenameIdentity, useFaceGallerySuggestFaceClusters, useFaceGalleryUnassignFace, useFaceGalleryUnassignFaces, useFanControlGetStatus, useFanControlSetDirection, useFanControlSetOscillating, useFanControlSetPercentage, useFanControlSetPreset, useFeatureProbeGetStatus, useFloodGetStatus, useGasGetStatus, useHumidifierGetStatus, useHumidifierSetMode, useHumidifierSetOn, useHumidifierSetTargetHumidity, useHumiditySensorGetStatus, useImageGetStatus, useImageSettingsGetOptions, useImageSettingsGetStatus, useImageSettingsSetSettings, useIntegrationsCreate, useIntegrationsDelete, useIntegrationsGet, useIntegrationsGetAvailableTypes, useIntegrationsGetByAddonId, useIntegrationsGetSettings, useIntegrationsList, useIntegrationsSetSettings, useIntegrationsTestConnection, useIntegrationsUpdate, useIntercomEndTalkSession, useIntercomGetStatus, useIntercomHandleAnswer, useIntercomPushTalkAudio, useIntercomStartSession, useIntercomStartTalkSession, useIntercomStopSession, useIsMidWidth, useIsMobile, useLawnMowerControlDock, useLawnMowerControlGetStatus, useLawnMowerControlPause, useLawnMowerControlStartMowing, useLiveBuffer, useLiveEvent, useLlmCancel, useLlmDeleteModel, useLlmDeleteProfile, useLlmGenerate, useLlmGenerateVision, useLlmGetDefaults, useLlmGetRuntimeStatus, useLlmGetUsage, useLlmInstallModel, useLlmListModelCatalog, useLlmListModels, useLlmListNodeModels, useLlmListProfileKinds, useLlmListProfiles, useLlmListRuntimeNodes, useLlmResolveModelRef, useLlmSetDefault, useLlmStartRuntime, useLlmStopRuntime, useLlmTestProfile, useLlmUpsertProfile, useLocalNetworkAddCustomAddress, useLocalNetworkDownloadCa, useLocalNetworkGetAddresses, useLocalNetworkGetAllowedAddresses, useLocalNetworkGetConnectionEndpoints, useLocalNetworkGetHubAddresses, useLocalNetworkGetNotificationEndpoint, useLocalNetworkGetPreferred, useLocalNetworkGetTlsStatus, useLocalNetworkGetViewerEndpoints, useLocalNetworkList, useLocalNetworkRegenerateCertificate, useLocalNetworkRemoveCustomAddress, useLocalNetworkResetAllowlistToBestMatch, useLocalNetworkRevertToGeneratedCertificate, useLocalNetworkSetAddressRole, useLocalNetworkSetAllowedAddresses, useLocalNetworkSetNotificationEndpoint, useLocalNetworkSetViewerEndpoints, useLocalNetworkUploadCertificate, useLockControlGetStatus, useLockControlLock, useLockControlOpen, useLockControlUnlock, useMediaPlayerGetStatus, useMediaPlayerNext, useMediaPlayerPause, useMediaPlayerPlay, useMediaPlayerPlayMedia, useMediaPlayerPrevious, useMediaPlayerSeek, useMediaPlayerSelectSource, useMediaPlayerSetMute, useMediaPlayerSetRepeat, useMediaPlayerSetShuffle, useMediaPlayerSetVolume, useMediaPlayerStop, useMeshNetworkGetStatus, useMeshNetworkJoin, useMeshNetworkLeave, useMeshNetworkListPeers, useMeshNetworkLogout, useMeshNetworkStartLogin, useMeshNetworkTestConnection, useMetricsProviderCollectSnapshot, useMetricsProviderGetAddonStats, useMetricsProviderGetCached, useMetricsProviderGetCpuTemperature, useMetricsProviderGetCurrent, useMetricsProviderGetDiskSpace, useMetricsProviderGetGpuInfo, useMetricsProviderGetLoadSeries, useMetricsProviderGetProcessStats, useMetricsProviderListAddonInstances, useMetricsProviderListNodeProcesses, useMotionDetectionAnalyze, useMotionDetectionApplyDeviceSettingsPatch, useMotionDetectionGetDeviceLiveContribution, useMotionDetectionGetDeviceSettingsContribution, useMotionDetectionRemoveCamera, useMotionDetectionReset, useMotionGetStatus, useMotionIsDetected, useMotionTriggerGetStatus, useMotionTriggerSetMotionTrigger, useMotionZonesGetOptions, useMotionZonesGetStatus, useMotionZonesSetZone, useMqttBrokerAddBroker, useMqttBrokerGetBrokerConfig, useMqttBrokerGetStatus, useMqttBrokerListBrokers, useMqttBrokerRemoveBroker, useMqttBrokerStartEmbeddedBroker, useMqttBrokerStopEmbeddedBroker, useMqttBrokerTestConnection, useNativeObjectDetectionGetOptions, useNativeObjectDetectionGetStatus, useNativeObjectDetectionSetEnabled, useNativeObjectDetectionSetSettings, useNavigation, useNavigationGetFeatures, useNavigationGetStatus, useNavigationGoToPoint, useNavigationListActions, useNavigationMove, useNavigationPlaySound, useNavigationRunAction, useNavigationSetLightLevel, useNavigationSetLightMode, useNavigationSetLightOn, useNavigationStop, useNetworkAccessGetEndpoint, useNetworkAccessGetStatus, useNetworkAccessListEndpoints, useNetworkAccessStart, useNetworkAccessStop, useNetworkLinkGetStatus, useNetworkQualityGetAllStats, useNetworkQualityGetDeviceStats, useNetworkQualityReportClientStats, useNodesClusterAddonStatus, useNodesDeployAddon, useNodesDirectory, useNodesExecuteQuery, useNodesGetCapUsageGraph, useNodesGetNodeAddons, useNodesRenameNode, useNodesRestartAddon, useNodesRestartNode, useNodesRestartProcess, useNodesSetProcessLogLevel, useNodesShutdownNode, useNodesTopology, useNodesUndeployAddon, useNotificationOutputDeleteTarget, useNotificationOutputDiscoverTargets, useNotificationOutputGetTarget, useNotificationOutputListTargetKinds, useNotificationOutputListTargets, useNotificationOutputProbeTargetConfig, useNotificationOutputSend, useNotificationOutputSetTargetEnabled, useNotificationOutputTestTarget, useNotificationOutputUpsertTarget, useNotificationRulesActivateAlarmProfile, useNotificationRulesCancelSnooze, useNotificationRulesCreateAlarmProfile, useNotificationRulesCreateRule, useNotificationRulesCreateSequence, useNotificationRulesCreateSnooze, useNotificationRulesDeleteAlarmProfile, useNotificationRulesDeleteRule, useNotificationRulesDeleteSequence, useNotificationRulesGetAlarmConfig, useNotificationRulesGetAlarmSensors, useNotificationRulesGetClipRetentionAsks, useNotificationRulesGetConditionCatalog, useNotificationRulesGetHistory, useNotificationRulesGetRule, useNotificationRulesGetRuleLastRuns, useNotificationRulesGetSequence, useNotificationRulesGetTemplateCatalog, useNotificationRulesListDeviceMutes, useNotificationRulesListRules, useNotificationRulesListSequences, useNotificationRulesListSnoozes, useNotificationRulesPreviewStateSummary, useNotificationRulesPreviewTemplate, useNotificationRulesRenameAlarmProfile, useNotificationRulesResolveArtifactUrl, useNotificationRulesSetAlarmConfig, useNotificationRulesSetDeviceMuted, useNotificationRulesSetRuleEnabled, useNotificationRulesTestRule, useNotificationRulesUpdateRule, useNotificationRulesUpdateSequence, useNotifierCancel, useNotifierGetStatus, useNotifierSend, useNumericSensorGetStatus, useOptimisticSlice, useOptionalSystem, useOptionalWidgetRegistry, useOsdGetStatus, useOsdManagerClearSlotBinding, useOsdManagerCopyDeviceConfiguration, useOsdManagerDeleteTemplate, useOsdManagerGetConditionSupport, useOsdManagerGetDeviceOsd, useOsdManagerGetSourceCatalog, useOsdManagerListTemplates, useOsdManagerPreviewSlot, useOsdManagerRenderDevice, useOsdManagerSetSlotBinding, useOsdManagerUpsertTemplate, useOsdSetOverlay, usePTZ, usePetFeederCallPet, usePetFeederCancelFeed, usePetFeederFeed, usePetFeederGetStatus, usePetFeederMarkFoodReplenished, usePetFeederPlaySound, usePetFeederResetDesiccant, usePetFeederSetChildLock, usePetFeederSetFeedSound, usePetFeederSetIndicatorLight, usePetFeederSetVolume, usePickerSiteZones, usePipelineAnalyticsApplyDeviceSettingsPatch, usePipelineAnalyticsCancelRelocateMedia, usePipelineAnalyticsCancelStorageMigrationMove, usePipelineAnalyticsClearTrackRelation, usePipelineAnalyticsClearTracks, usePipelineAnalyticsCompleteRetrainTrack, usePipelineAnalyticsCountRelocatableMedia, usePipelineAnalyticsCountUnstampedEventMedia, usePipelineAnalyticsDeleteDeviceEvents, usePipelineAnalyticsDeleteTracks, usePipelineAnalyticsDeselectRetrainFrame, usePipelineAnalyticsGetActiveTracks, usePipelineAnalyticsGetAudioEvents, usePipelineAnalyticsGetDeviceLiveContribution, usePipelineAnalyticsGetDeviceSettingsContribution, usePipelineAnalyticsGetEventDensity, usePipelineAnalyticsGetEventDensityBatch, usePipelineAnalyticsGetEventMedia, usePipelineAnalyticsGetEventMediaFootprintByKind, usePipelineAnalyticsGetEventStoreFootprint, usePipelineAnalyticsGetKeyEvents, usePipelineAnalyticsGetKeyEventsBatch, usePipelineAnalyticsGetMediaReclaimStatus, usePipelineAnalyticsGetMotionEvents, usePipelineAnalyticsGetObjectEmbeddingRebuildStatus, usePipelineAnalyticsGetObjectEvents, usePipelineAnalyticsGetRetrainExportUrl, usePipelineAnalyticsGetRetrainFrameImage, usePipelineAnalyticsGetSensorEvents, usePipelineAnalyticsGetStorageMigrationMoveStatus, usePipelineAnalyticsGetTrack, usePipelineAnalyticsGetTrackMedia, usePipelineAnalyticsGetTrainingExportSummary, usePipelineAnalyticsGetTrainingExportUrl, usePipelineAnalyticsListArchivedDebugNotes, usePipelineAnalyticsListBirthDecisions, usePipelineAnalyticsListEventKinds, usePipelineAnalyticsListEventKindsBatch, usePipelineAnalyticsListEventMedia, usePipelineAnalyticsListOpsLog, usePipelineAnalyticsListRecentTracks, usePipelineAnalyticsListRelocateMediaJobs, usePipelineAnalyticsListRetrainAnnotations, usePipelineAnalyticsListRetrainFrames, usePipelineAnalyticsListRetrainStaging, usePipelineAnalyticsListTrackMedia, usePipelineAnalyticsListTrackRelations, usePipelineAnalyticsListTracks, usePipelineAnalyticsOwnersWithMedia, usePipelineAnalyticsPauseForStorageMigration, usePipelineAnalyticsProposeRetrainAnnotations, usePipelineAnalyticsPruneEvents, usePipelineAnalyticsPruneEventsBefore, usePipelineAnalyticsPruneTracksBefore, usePipelineAnalyticsReadLongTermSeries, usePipelineAnalyticsRebuildObjectEmbeddings, usePipelineAnalyticsReclaimDebugMedia, usePipelineAnalyticsReconcileFromDisk, usePipelineAnalyticsRefreshStorageLocationsForMigration, usePipelineAnalyticsRelocateMedia, usePipelineAnalyticsRestageRetrainTrack, usePipelineAnalyticsResumeForStorageMigration, usePipelineAnalyticsSaveRetrainAnnotations, usePipelineAnalyticsSearchObjectEvents, usePipelineAnalyticsSelectRetrainFrames, usePipelineAnalyticsSetTrackFlags, usePipelineAnalyticsSetTrackPurity, usePipelineAnalyticsSetTrackRelation, usePipelineAnalyticsStartStorageMigrationMove, usePipelineAnalyticsWipeAllAnalytics, usePipelineAnalyticsWipeObjectEmbeddings, usePipelineExecutorCacheFrameInPool, usePipelineExecutorClearDeviceOverrides, usePipelineExecutorClearModelBoundDeviceOverrides, usePipelineExecutorDeleteModel, usePipelineExecutorDeleteTemplate, usePipelineExecutorDownloadModel, usePipelineExecutorGetAddonModels, usePipelineExecutorGetAudioCapabilities, usePipelineExecutorGetAvailableEngines, usePipelineExecutorGetCapabilities, usePipelineExecutorGetDefaultSteps, usePipelineExecutorGetDetectionConfigSchema, usePipelineExecutorGetEffectiveTuning, usePipelineExecutorGetEngineProvisioning, usePipelineExecutorGetGlobalPipelineConfig, usePipelineExecutorGetGlobalSteps, usePipelineExecutorGetInferenceDeviceHealth, usePipelineExecutorGetOrchestratorConfigSchema, usePipelineExecutorGetReferenceAudio, usePipelineExecutorGetReferenceAudioFiles, usePipelineExecutorGetReferenceImage, usePipelineExecutorGetSchema, usePipelineExecutorGetSelectedEngine, usePipelineExecutorGetVideoPipelineSteps, usePipelineExecutorInferCached, usePipelineExecutorKillEngine, usePipelineExecutorListLoadedEngines, usePipelineExecutorListReferenceImages, usePipelineExecutorListTemplates, usePipelineExecutorRearmInferenceDevice, usePipelineExecutorRunAudioTest, usePipelineExecutorRunPipeline, usePipelineExecutorRunPipelineBatch, usePipelineExecutorSaveTemplate, usePipelineExecutorSetVideoPipelineSteps, usePipelineExecutorSpinEngine, usePipelineExecutorUncacheFrame, usePipelineExecutorUpdateTemplate, usePipelineExecutorValidatePipeline, usePipelineOrchestratorApplyAutoTune, usePipelineOrchestratorApplyDeviceSettingsPatch, usePipelineOrchestratorAssignAudio, usePipelineOrchestratorAssignPipeline, usePipelineOrchestratorDeleteTemplate, usePipelineOrchestratorGetAgentLoad, usePipelineOrchestratorGetAgentSettings, usePipelineOrchestratorGetAudioAssignment, usePipelineOrchestratorGetAudioAssignments, usePipelineOrchestratorGetAudioNodeLoad, usePipelineOrchestratorGetCameraMetrics, usePipelineOrchestratorGetCameraSettings, usePipelineOrchestratorGetCameraStatus, usePipelineOrchestratorGetCameraStatuses, usePipelineOrchestratorGetCameraStepOverrides, usePipelineOrchestratorGetCameraSwitches, usePipelineOrchestratorGetCapabilityBindings, usePipelineOrchestratorGetClusterModelChoice, usePipelineOrchestratorGetDeviceLiveContribution, usePipelineOrchestratorGetDeviceSettingsContribution, usePipelineOrchestratorGetEffectiveShares, usePipelineOrchestratorGetGlobalMetrics, usePipelineOrchestratorGetIngestOwner, usePipelineOrchestratorGetNodeInferenceDevices, usePipelineOrchestratorGetPipelineAssignment, usePipelineOrchestratorGetPipelineAssignments, usePipelineOrchestratorGetPipelineDevicePin, usePipelineOrchestratorGetPlacementStats, usePipelineOrchestratorGetReconcileFromDiskStatus, usePipelineOrchestratorListAgentSettings, usePipelineOrchestratorListTemplates, usePipelineOrchestratorPauseForStorageMigration, usePipelineOrchestratorPlanAutoTune, usePipelineOrchestratorRebalance, usePipelineOrchestratorReconcileFromDisk, usePipelineOrchestratorRemoveAgentSettings, usePipelineOrchestratorRequestOccupancyLook, usePipelineOrchestratorResetNodePipelineDefaults, usePipelineOrchestratorResolvePipeline, usePipelineOrchestratorResumeForStorageMigration, usePipelineOrchestratorSaveTemplate, usePipelineOrchestratorSetAgentCapabilities, usePipelineOrchestratorSetAgentDecodeLimits, usePipelineOrchestratorSetAgentInferenceDevices, usePipelineOrchestratorSetAgentMaxCameras, usePipelineOrchestratorSetAgentReachableHost, usePipelineOrchestratorSetCameraPipelineForAgent, usePipelineOrchestratorSetCameraSensors, usePipelineOrchestratorSetCameraStepOverride, usePipelineOrchestratorSetCameraStepToggle, usePipelineOrchestratorSetCameraSwitch, usePipelineOrchestratorSetCapabilityBinding, usePipelineOrchestratorSetLoadBalancingShares, usePipelineOrchestratorSetPipelineDevicePin, usePipelineOrchestratorSetShareSource, usePipelineOrchestratorSuggestShares, usePipelineOrchestratorUnassignAudio, usePipelineOrchestratorUnassignPipeline, usePipelineOrchestratorUpdateTemplate, usePipelineRunnerAttachCamera, usePipelineRunnerDetachCamera, usePipelineRunnerGetAllCameraMetrics, usePipelineRunnerGetCameraMetrics, usePipelineRunnerGetLocalCameras, usePipelineRunnerGetLocalLoad, usePipelineRunnerGetLocalMetrics, usePipelineRunnerGetNativeCrop, usePipelineRunnerGetParkedTrackFrame, usePipelineRunnerParkTrackFrame, usePipelineRunnerReleaseParkedTrackFrames, usePipelineRunnerReportMotion, usePipelineRunnerRequestOccupancyBurst, usePipelineRunnerRunDetailSubtree, usePipelineRunnerRunStatelessStep, usePlateGalleryAssignPlate, usePlateGalleryAssignPlates, usePlateGalleryCorrectPlateText, usePlateGalleryCreateVehicle, usePlateGalleryDeletePlate, usePlateGalleryDeleteVehicle, usePlateGalleryGetPlateByTrack, usePlateGalleryGetPlateMedia, usePlateGalleryListPlates, usePlateGalleryListVehicleSamples, usePlateGalleryListVehicles, usePlateGalleryRemoveVehicleSample, usePlateGalleryRenameVehicle, usePlateGallerySearchPlates, usePlateGallerySuggestPlateClusters, usePlateGalleryUnassignPlate, usePlateGalleryUnassignPlates, usePlayerOverlayLayer, usePlayerOverlayLayers, usePlayerToolbarButton, usePlayerToolbarButtons, usePowerMeterGetStatus, usePresenceGetStatus, usePressureSensorGetStatus, usePrivacyMaskGetOptions, usePrivacyMaskGetStatus, usePrivacyMaskSetAudioEnabled, usePrivacyMaskSetMask, usePrompt, usePtzAutotrackGetSettings, usePtzAutotrackGetStatus, usePtzAutotrackSetEnabled, usePtzAutotrackSetSettings, usePtzCaptureHomeHere, usePtzContinuousMove, usePtzDeletePreset, usePtzGetHomePreset, usePtzGetHomeReturn, usePtzGetOptions, usePtzGetPosition, usePtzGetPresets, usePtzGetStatus, usePtzGoHome, usePtzGoToPreset, usePtzMove, usePtzSavePreset, usePtzSetAutofocus, usePtzSetHomePreset, usePtzSetHomeReturn, usePtzStop, useRebootReboot, useRecordedPlayback, useRecordingArchiveApplyDeviceSettingsPatch, useRecordingArchiveCancelRelocateJob, useRecordingArchiveCancelStorageMigrationMove, useRecordingArchiveDeleteFootprint, useRecordingArchiveGetAvailabilityBatch, useRecordingArchiveGetDaysWithRecordingsBatch, useRecordingArchiveGetDeviceConfig, useRecordingArchiveGetDeviceLiveContribution, useRecordingArchiveGetDeviceSettingsContribution, useRecordingArchiveGetPlacement, useRecordingArchiveGetRelocateResidue, useRecordingArchiveGetStatus, useRecordingArchiveGetStorageMigrationMoveStatus, useRecordingArchiveGetStorageUsage, useRecordingArchiveListOpsLog, useRecordingArchiveListRelocateJobs, useRecordingArchiveLocateSegment, useRecordingArchivePauseForStorageMigration, useRecordingArchivePlanStorageRebalance, useRecordingArchivePruneFootage, useRecordingArchiveReadGopBytes, useRecordingArchiveReadSegmentBytes, useRecordingArchiveReadWindowBytes, useRecordingArchiveReconcileLedgerAgainstDisk, useRecordingArchiveRefreshStorageLocationsForMigration, useRecordingArchiveRelocateFootage, useRecordingArchiveRenderClip, useRecordingArchiveRenderGif, useRecordingArchiveRescanStorage, useRecordingArchiveResumeForStorageMigration, useRecordingArchiveSetDeviceConfig, useRecordingArchiveSetDevicePlacement, useRecordingArchiveStartStorageMigrationMove, useRecordingArchiveStartStorageRebalance, useRecordingExportCancelExport, useRecordingExportCreateExport, useRecordingExportDeleteExport, useRecordingExportGetDownloadUrl, useRecordingExportGetExport, useRecordingExportListExports, useRecordingExportReadExportBytes, useRecordingGetAvailability, useRecordingGetDaysWithRecordings, useRecordingGetPlayback, useRecordingGetPlaybackOptions, useRecordingListSources, useRecordingOnboardGetOptions, useRecordingOnboardGetStatus, useRecordingOnboardSetSettings, useRecordingSignalGetStatus, useRemoteComponent, useRoleDisplayDefaults, useSceneMonitorCaptureReference, useSceneMonitorCreateScene, useSceneMonitorDeleteReference, useSceneMonitorDeleteScene, useSceneMonitorGetStatus, useSceneMonitorListScenes, useSceneMonitorListScenesBatch, useSceneMonitorRecheckNow, useSceneMonitorResetScene, useSceneMonitorUpdateScene, useScriptRunnerGetStatus, useScriptRunnerRun, useScriptRunnerStop, useScrubController, useServerManagementApplyServerUpdate, useServerManagementCheckServerUpdate, useServerManagementGetServerPackageStatus, useServerManagementRestartServer, useServerManagementRollbackServerUpdate, useSettingsStoreAggregate, useSettingsStoreCount, useSettingsStoreDeclareCollection, useSettingsStoreDelete, useSettingsStoreDeleteWhere, useSettingsStoreGet, useSettingsStoreHistogram, useSettingsStoreInsert, useSettingsStoreInsertMany, useSettingsStoreIsEmpty, useSettingsStoreQuery, useSettingsStoreSet, useSettingsStoreUpdate, useSettingsStoreUpdateWhere, useSettingsStoreUpsert, useSmokeGetStatus, useSnapshotApplyDeviceSettingsPatch, useSnapshotGetDebugState, useSnapshotGetDeviceLiveContribution, useSnapshotGetDeviceSettingsContribution, useSnapshotGetSnapshot, useSnapshotGetSnapshotLinks, useSnapshotGetSnapshotOverview, useSnapshotGetStatus, useSnapshotInvalidateCache, useStationaryOverlay, useStorageAbortUpload, useStorageBeginDownload, useStorageBeginUpload, useStorageDelete, useStorageDeleteLocation, useStorageEndDownload, useStorageExists, useStorageFinalizeUpload, useStorageGetAvailableSpace, useStorageList, useStorageListDrainProgress, useStorageListLocationDeclarations, useStorageListLocations, useStorageListProviders, useStorageMigrationCancel, useStorageMigrationCleanupCancel, useStorageMigrationCleanupStart, useStorageMigrationCleanupStatus, useStorageMigrationDrain, useStorageMigrationHistory, useStorageMigrationMovers, useStorageMigrationPlan, useStorageMigrationResidue, useStorageMigrationStart, useStorageMigrationStatus, useStorageRead, useStorageReadChunk, useStorageResolve, useStorageTestConfig, useStorageTestLocation, useStorageUpsertLocation, useStorageWrite, useStorageWriteChunk, useStoredGroupBy, useStreamBrokerAcquireEgressTranscode, useStreamBrokerApplyDeviceSettingsPatch, useStreamBrokerAssignProfile, useStreamBrokerFetchEventMedia, useStreamBrokerForgetDeviceHardware, useStreamBrokerGetAllRtspEntries, useStreamBrokerGetBrokerStats, useStreamBrokerGetDeviceAudioMute, useStreamBrokerGetDeviceLiveContribution, useStreamBrokerGetDeviceSettingsContribution, useStreamBrokerGetPreBufferInfo, useStreamBrokerGetRtspEntry, useStreamBrokerGetRtspPort, useStreamBrokerGetStreamUrl, useStreamBrokerGetStreamWithCodec, useStreamBrokerIsRtspEnabled, useStreamBrokerKillClient, useStreamBrokerListAllCameraStreams, useStreamBrokerListAllProfileSlots, useStreamBrokerListClients, useStreamBrokerProbeStream, useStreamBrokerProduceEventMedia, useStreamBrokerPublishCameraStream, useStreamBrokerPullAudioChunks, useStreamBrokerPullFrameHandles, useStreamBrokerRegenerateRtspToken, useStreamBrokerReleaseEgressTranscode, useStreamBrokerReleaseStreamWithCodec, useStreamBrokerRenderPreBufferClip, useStreamBrokerReportStreamSignal, useStreamBrokerRestartProfile, useStreamBrokerRetractCameraStream, useStreamBrokerSetDeviceAudioMute, useStreamBrokerSetPreBufferDuration, useStreamBrokerSetRtspEnabled, useStreamBrokerSubscribeAudioChunks, useStreamBrokerSubscribeFrames, useStreamBrokerUnassignProfile, useStreamBrokerUnsubscribeAudioChunks, useStreamBrokerUnsubscribeFrames, useStreamCatalogGetCatalog, useStreamParamsGetConfigSchema, useStreamParamsGetOptions, useStreamParamsGetStatus, useStreamParamsSetProfile, useStreamSignalsListSignals, useSwitchGetStatus, useSwitchSetState, useSystem, useSystemDetectSiteLocation, useSystemFeatureFlags, useSystemForceRetentionCleanup, useSystemGetFailureContributions, useSystemGetLoadContributions, useSystemGetLoggingSettings, useSystemGetRequestCensus, useSystemGetRetentionConfig, useSystemGetSiteLocation, useSystemHealth, useSystemInfo, useSystemMutation, useSystemNetworkAddresses, useSystemQuery, useSystemSetLoggingSettings, useSystemSetRetentionConfig, useSystemSetSiteLocation, useTamperGetStatus, useTemperatureSensorGetStatus, useTerminalSessionAdoptLegacyMonitor, useTerminalSessionClose, useTerminalSessionCreateInstance, useTerminalSessionDeleteInstance, useTerminalSessionListInstances, useTerminalSessionListLegacyCameras, useTerminalSessionListProfiles, useTerminalSessionListSessions, useTerminalSessionOpenSession, useTerminalSessionPullOutput, useTerminalSessionResize, useTerminalSessionSetInstanceEnabled, useTerminalSessionUpdateInstance, useTerminalSessionWriteInput, useThemeMode, useToastOnToast, useTurnProviderGetTurnServers, useUpdateGetStatus, useUpdateInstallUpdate, useUrlQueryParam, useUserManagementConfirmTotp, useUserManagementCreateApiKey, useUserManagementCreateScopedToken, useUserManagementCreateUser, useUserManagementDeleteUser, useUserManagementDisableTotp, useUserManagementGetTotpStatus, useUserManagementListApiKeys, useUserManagementListOauthSessions, useUserManagementListScopedTokens, useUserManagementListUsers, useUserManagementOauthExchangeCode, useUserManagementOauthIssueCode, useUserManagementOauthRefresh, useUserManagementOauthVerifyAccessToken, useUserManagementResetPassword, useUserManagementRevokeApiKey, useUserManagementRevokeOauthSession, useUserManagementRevokeScopedToken, useUserManagementSetUserScopes, useUserManagementSetupTotp, useUserManagementUpdateUser, useUserManagementValidateApiKey, useUserManagementValidateCredentials, useUserManagementValidateScopedToken, useUserManagementVerifyTotp, useVacuumControlGetStatus, useVacuumControlLocate, useVacuumControlPause, useVacuumControlReturnToBase, useVacuumControlSetFanSpeed, useVacuumControlStart, useVacuumControlStop, useValveClose, useValveGetStatus, useValveOpen, useValveSetPosition, useValveStop, useVibrationGetStatus, useVideoclipsDialClipStream, useVideoclipsGetClipPlayback, useVideoclipsGetPlaybackOptions, useVideoclipsListClips, useVideoclipsListSources, useVideoclipsOfferClipBytes, useVideoclipsReadClipBytes, useVodPlayback, useWaterHeaterGetStatus, useWaterHeaterSetAway, useWaterHeaterSetOperationMode, useWaterHeaterSetTargetTemp, useWeatherGetStatus, useWebrtcSessionAddIceCandidate, useWebrtcSessionApplyDownlinkProbe, useWebrtcSessionCloseSession, useWebrtcSessionCreateSession, useWebrtcSessionGetIceCandidates, useWebrtcSessionGetSessionDebug, useWebrtcSessionGetSessionState, useWebrtcSessionHandleAnswer, useWebrtcSessionHandleOffer, useWebrtcSessionHasAdaptiveBitrate, useWebrtcSessionListStreams, useWidget, useWidgetMetadata, useWidgetRegistry, useZoneAnalyticsGetCameraHistory, useZoneAnalyticsGetCurrentSnapshot, useZoneAnalyticsGetCurrentSnapshotBatch, useZoneAnalyticsGetUnzonedHistory, useZoneAnalyticsGetZoneHistory, useZoneEditing, useZoneRulesListRules, useZoneRulesSetRules, useZonesAddZone, useZonesListZones, useZonesRemoveZone, useZonesUpdateZone, vacuumStateMeta, validateScopes, valveStateMeta, variantLabel, waterHeaterPhase, waterHeaterTint, weatherConditionMeta, weatherTint, withResolvedParentDetail, writeStoredGroupBy };
61012
+ export { AddonGlobalSettingsForm, AdminLinkQuickAction, AgentStepEditor, AlarmHeroCard, AlarmInlineControl as AlarmPanelInlineControl, AppShell, ArcKnob, AudioClassificationList, AudioLevelWaveform, AudioWaveform, AutomationHeroCard, AutomationInlineControl, AutotrackSection, BTN_COMPACT, BTN_COMPACT_DANGER, BTN_COMPACT_PRIMARY, BTN_COMPACT_WARNING, Badge, BatteryBadge, BottomSheet, Breadcrumb, BrightnessPanel, Button, ButtonControl, ButtonHeroCard, CARD_MODE_MIN_COLUMNS, CENTER, CHIP_ACTIVE, CHIP_BASE, CHIP_INACTIVE, CLASS_COLORS, COLUMN_BREAKPOINT_CLASS, COLUMN_PRIORITY, COMMIT_DEDUPE_TOLERANCE_MS, COMMIT_DEDUPE_WINDOW_MS, CONTROL_CAP_NAMES, CONTROL_FILLS, CameraStreamPlayer, Card, Checkbox, ChildSectionAccordion, ClimatePanel, CodeBlock, CollapsibleCard, ConfigFormBuilder, FormField as ConfigFormField, ConfigNotificationTargetMultiSelectFieldView, ConfigNotificationTargetSelectFieldView, ConfigSchemaField, ConfirmActionButton, ConfirmDialogProvider, ConsumablesPanel, ContainerChildrenProvider, ContainerPrimaryHero, ControlColumn, ControlHeroCard, ControlInlineControl, ControlPanel, CopyButton, CoverHeroCard, CoverInlineControl, CoverPanel, CustomFieldRenderersProvider, DEFAULT_COLOR, DEVICE_COLUMNS, DEVICE_LIST_PAGE_SIZE_KEY, DEVICE_LIST_PAGE_SIZE_OPTIONS, DEVICE_PICKER_GROUP_STORAGE_KEY, DEVICE_ROLE_META, DEVICE_TYPE_CONTROL, DEVICE_TYPE_META, DISPLAY_ICON_REGISTRY, DataTable, DataTableFilterBar, DetectionCanvas, DetectionOverlay, DetectionResultTree, DevShell, DeviceActivityPanel, DeviceBatchToolbar, DeviceCard, DeviceContextProvider, DeviceExportPanel, DeviceFilterBar, DeviceGrid, DeviceItem, DeviceList, DeviceMultiSelectField, DevicePicker, DeviceQuickDetailProvider, DeviceSelectField, DeviceSelectorPicker, DeviceStepMatrix, DevicesFailedLine, DevicesLoadingLine, DevicesWidenWarning, Dialog, DialogBody, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DiscoveryPanel, DoorbellRecentPanel, Dropdown, DropdownContent, DropdownItem, DropdownTrigger, DummyHeroCard, DummyInline, EMPTY_DATA_TABLE_FILTER, EVENT_KIND_ICONS, EmptyState, EndpointResultsCard, EndpointTestCard, ErrorBox, EventKindGlyph, EventStream, ExtensionsPanel, FILL, FLEET_LIST_GC_TIME_MS, FLEET_LIST_QUERY_KEY, FLEET_LIST_STALE_TIME_MS, FanHeroCard, FanInlineControl, FanPanel, FilterBar, FloatingEventStream, FloatingLogStream, FloatingPanel, FormField$1 as FormField, GRID_GAP, GRID_PAIRED, GRID_QUICK_STATS, GripTrack, GroupedModelSelector, HOST_WIDGETS, HUB_SESSION_RUN_MS, HlsVideo, HoverZoomImage, HubSessionTestCard, HumidifierHeroCard, HumidifierInlineControl, INPUT_COMPACT, INPUT_SHELL, IconAction, IconButton, IconPicker, ImageHeroCard, ImageInlineControl, ImageSelector, InferenceConfigSelector, Input, KebabMenu, KeyValueList, LIST_ROW, Label, LawnMowerHeroCard, LawnMowerInlineControl, LightHeroCard, LightInlineControl, LockHeroCard, LockInlineControl, LockPanel, LogStream, LoginForm, MODE_COLOR, MaskShapeCanvas, MediaPlayerHeroCard, MediaPlayerInlineControl, MediaPlayerPanel, MobileDrawer, ModelPicker, MotionZonesSettings, NAVIGATION_DRIVE_INTERVAL_MS, NatResultCard, NavigationPanel, NetworkLinkBadge, NodeMultiSelectField, NodePicker, NodeSelectField, NotificationTargetSelectField, NotificationTargetsField, OPTION_SELECT_SEARCH_MIN_OPTIONS, OfflineBadge, OptionSelect, PHASE_CONFIG, PICKER_CHIP_LIMIT, PICKER_DEFAULT_GROUP_BY, PICKER_GROUP_BY_MODES, PICKER_GROUP_COLLAPSE_AT, PICKER_NONE_KEY, PICKER_NOUN_PLURAL, PICKER_NO_FILTERS, PICKER_PAGE_SIZE, PICKER_SEARCH_DEBOUNCE_MS, PICKER_WINDOW, PRIORITY, PTZOverlay, PageHeader, PhaseIcon, PipelineBuilder, PipelineRuntimeSelector, PipelineStep, PipelineTreeMatrix, PlaceholderChipField, PlayerOverlaysProvider, Popover, PopoverContent, PopoverRowAction, PopoverTrigger, PrimaryChildPicker, PrivacyMaskSettings, ProviderBadge, PtzPanel, QrCode, RECONNECT_POLICY, RECORDED_PLAYBACK_MODES, RIGHT, ROI_AREA_WARN_FRACTION, ROLE_DESCRIPTOR, RadialGauge, RecordedPlaybackProvider, RecordingPanel, ResponseLog, RoleDisplayDefaultsFromServer, RoleDisplayDefaultsProvider, RunReport, SCENE_CAPTURE_VARIANTS, SECTION_BODY, SECTION_CARD, SECTION_HEADER, SETTING_ROW, SETTING_ROW_LABEL, SETTING_ROW_STACK_BREAKPOINT, SETTING_ROW_VALUE, SETTING_ROW_VALUE_TEXT, SNAPSHOT_MEDIA_PATH, SPLIT_PANEL_OUTER, SPLIT_PANEL_SIDE, STACK_GAP, STATE_COLOR, SceneMonitorEditor, ScopePicker, ScriptHeroCard, ScriptInlineControl, ScrollArea, SectionCard, Select, SelectedChip, SemanticBadge, SensorHeroCard, SensorInlineControl, SensorValueAtom, Separator, SettingRow, Sidebar, SidebarItem, Skeleton, SlideOverPanel, SlideToggle, SnapshotButton, SortHeaderButton, StatCard, StateValuesStream, StatusBadge, StepTimings, StepTreeMaster, Stepper, StreamBrokerSelector, StreamDebugOverlay, StreamPanel, Switch, SwitchHeroCard, SwitchInlineControl, SwitchPanel, SystemProvider, TABLE_SCROLL_MAX_H, TEXT_FIELD_LABEL, TEXT_HINT, TEXT_METRIC, TEXT_SECTION_LABEL, TEXT_VALUE, TIMEZONES, Tabs, TabsContent, TabsList, TabsTrigger, TapToggle, ThemeProvider, ThermostatHeroCard, ThermostatInlineControl, TimezoneSelector, Tooltip, TooltipContent, TooltipTrigger, UnitPicker, VacuumHeroCard, VacuumInlineControl, ValueReadout, ValveHeroCard, ValveInlineControl, VersionBadge, VodPlaybackProvider, WaterHeaterHeroCard, WaterHeaterInlineControl, WeatherHeroCard, WeatherInlineControl, WidgetMetricCard, WidgetPanel, WidgetRegistryProvider, WidgetSlot, ZoneEditingProvider, MicOff as a, agentColumnKey, allDeviceTypeFilterOptions, applyFleetQueryDefaults, applyPickerFilters, ariaSortForColumn, badgeFor, buildPeerConnectionConfig, buildStepTreeFromSchema, EyeOff as c, catalogHasDraft, childEntityId, childListName, chipOverflow, classifyAddressScope, classifyCapability, classifySessionVerdict, clearPickerGroup, cn, columnsForContext, compareSrflxMappings, containerChildToRef, countableDevices, coverHighlight, coverageLine, createSharedContext, createTheme, cursorFractionFor, darkColors, dataTableFacets, defaultTheme, deriveDeviceKind, deriveWebrtcDebugStats, describeDeviceSelector, deviceIntegrationResolver, deviceListStateOf, deviceMatchesFilter, deviceOptionLabel, deviceRoleMeta, deviceRoleMetaOf, deviceTypeLabel, deviceTypeMeta, deviceTypeMetaOf, devicesToOptions, draftFromQuery, emptyDevicesWidens, emptySessionRun, ensureMfHostInit, eventKindLabel, filterDataTableRows, filterDeviceOptions, filterOptions as filterOptionSelectOptions, filterPickerDevices, finalizeSessionRun, findTimezone, flattenPickerGrouping, flattenPickerRows, fleetViewOf, formatControlDateTime, formatLastSeen, formatNumeric, freezeVerdict, fuzzyMatch, getClassColor, getPhaseVisual, groupAgentColumns, groupChildrenByLayout, groupPickerDevices, groupPickerDevicesBy, hardwareLabel, hubOrigin, hubPath, hubUrl, hubWsUrl, humanDuration, humidifierTint, Mic as i, initialScrubState, insertAtSelection, isAbsentProvider, isDataTableFilterActive, isFieldVisible, isGroupExpanded, Camera as l, lawnMowerActivityMeta, lightColors, loadRemoteBundle, makeScrubBridge, metadataEntries, metadataString, mirror, mountAddonPage, mountPath, Square as n, nextReconnectAction, nextSort, nextSortDirection, nextTableSort, normalizeForSearch, ImageOff as o, offListSelections, openTopLayer, optionSearchText as optionSelectSearchText, orphanDeviceLabel, overrideEntityIdFromLink, pageRows, parentDetailOf, parseIceCandidate, parsePickerGroupBy, parseRecordedServerMessage, partitionSelected as partitionOptionSelectSelected, partitionSuggested, pickerFacetFilterShown, pickerFacetKey, pickerFacetOptions, pickerFiltersActive, pickerGroupKey, pickerHiddenSelectedCount, pickerLocationKey, pickerQueryTokens, pickerRowFacts, pickerSearchText, pickerZoneFilterSuspended, pinnedStreamChoices, providerIcons, RotateCcw as r, readStoredGroupBy, reduceSessionRun, resetHubMountForTests, resetPickerFilters, resolveContainerPrimary, resolveControlAlign, resolveDeviceControl, resolveDeviceIntegration, resolveDisplayIcon, resolveEffectiveDefaultModel, resolveEffectiveStepModel, resolveEventKindIcon, resolveSearchable as resolveOptionSelectSearchable, resolveParentNames, resolvePrimaryChild, resolveSelectedDevices, resolveSensorDisplay, resolveStepDefaultModel, resolveTableLayout, roiTooLarge, rootSourceState, routerBasename, Grid2x2 as s, sameLocationSuggestions, scrubReducer, selectPickerGroup, selectedDeviceOptions, serializeRecordedCommand, shouldCommit, shouldEmit, shouldShowAddNewFooter, shouldShowUseQueryRow, shouldUseSingleNode, showsNoCamerasHint, sortRows, sortRowsByColumn, statusIcons, statusLine, stepHasModelForFormat, stepModelOptions, stripParentNamePrefix, summarizeHubCandidates, Trash2 as t, tabForSelector, tankAlert, themeToCss, toStationaryOverlayBox, toggleDataTableFacet, togglePickerDevice, togglePickerKey, trpc, typeLabel, createLucideIcon as u, useAccessoriesGetStatus, useAccessoriesSetChildHidden, useAddonPagesListPages, useAddonSettingsGetDeviceSettings, useAddonSettingsGetGlobalSettings, useAddonSettingsGetIntegrationSettings, useAddonSettingsUpdateDeviceSettings, useAddonSettingsUpdateGlobalSettings, useAddonWidgetsListWidgets, useAddonsApplyAutoUpdateToAll, useAddonsCancelJob, useAddonsCustom, useAddonsForceRefresh, useAddonsGetAddonAutoUpdate, useAddonsGetAutoUpdateSettings, useAddonsGetJob, useAddonsGetLastRestart, useAddonsGetLogs, useAddonsGetVersions, useAddonsInstallFromWorkspace, useAddonsInstallPackage, useAddonsIsWorkspaceAvailable, useAddonsList, useAddonsListCapabilityProviders, useAddonsListFrameworkPackages, useAddonsListJobs, useAddonsListPackages, useAddonsListUpdates, useAddonsListWorkspacePackages, useAddonsOnAddonLogs, useAddonsReloadPackages, useAddonsRestartAddon, useAddonsRestartServer, useAddonsRetryLoad, useAddonsRollbackPackage, useAddonsSearchAvailable, useAddonsSetAddonAutoUpdate, useAddonsSetAutoUpdateSettings, useAddonsSetCapabilityProviderEnabled, useAddonsStartJob, useAddonsUninstallPackage, useAddonsUpdatePackage, useAirQualitySensorGetStatus, useAlarmPanelArm, useAlarmPanelDisarm, useAlarmPanelGetStatus, useAlarmPanelTrigger, useAlert, useAlertsDismiss, useAlertsEmit, useAlertsGetUnreadCount, useAlertsList, useAlertsMarkAllRead, useAlertsMarkRead, useAlertsUpdate, useAllWidgets, useAmbientLightSensorGetStatus, useAudioAnalysisApplyDeviceSettingsPatch, useAudioAnalysisGetDeviceLiveContribution, useAudioAnalysisGetDeviceSettingsContribution, useAudioAnalysisResolveDeviceSettings, useAudioAnalyzerAnalyseChunk, useAudioAnalyzerAttachDevice, useAudioAnalyzerClassify, useAudioAnalyzerDetachDevice, useAudioAnalyzerDispose, useAudioAnalyzerIsReady, useAudioAnalyzerReprobeAudioEngine, useAudioCodecCanHandle, useAudioCodecCloseSession, useAudioCodecCreateDecodeSession, useAudioCodecCreateEncodeSession, useAudioCodecFlushEncode, useAudioCodecListActiveSessions, useAudioCodecListSupportedCodecs, useAudioCodecPullEncoded, useAudioCodecPullPcm, useAudioCodecPushEncodedFrame, useAudioCodecPushPcm, useAudioMetricsGetCurrentSnapshot, useAudioMetricsGetHistory, useAutomationControlDisable, useAutomationControlEnable, useAutomationControlGetStatus, useAutomationControlTrigger, useBackupCancel, useBackupDelete, useBackupDeleteSchedule, useBackupGetEntries, useBackupList, useBackupListArchives, useBackupListDestinations, useBackupListLocations, useBackupListRuns, useBackupListSchedules, useBackupPreviewSchedule, useBackupRestore, useBackupTrigger, useBackupUpsertDestinationPolicy, useBackupUpsertSchedule, useBatteryGetStatus, useBatteryWakeForStream, useBinaryGetStatus, useBrightnessGetStatus, useBrightnessSetBrightness, useBrokerAdd, useBrokerGet, useBrokerGetBrokerConfig, useBrokerGetSettings, useBrokerGetSettingsSchema, useBrokerGetState, useBrokerGetStatus, useBrokerList, useBrokerListProviders, useBrokerPublish, useBrokerRemove, useBrokerSetSettings, useBrokerSubscribe, useBrokerTestConnection, useBrokerTestSettings, useBrokerUnsubscribe, useButtonPress, useCalendarsGetPreferences, useCalendarsListCalendars, useCalendarsListEvents, useCalendarsSetCalendarPreference, useCameraCredentialsGetCredentials, useCameraCredentialsGetStatus, useCameraGridLayoutApplyDeviceSettingsPatch, useCameraGridLayoutGetDeviceLiveContribution, useCameraGridLayoutGetDeviceSettingsContribution, useCameraGridLayoutGetLayout, useCameraGridLayoutSaveLayout, useCameraPipelineConfigApplyDeviceSettingsPatch, useCameraPipelineConfigGetDeviceLiveContribution, useCameraPipelineConfigGetDeviceSettingsContribution, useCameraStreamsGetBrokerStreams, useCameraStreamsGetCameraStreams, useCameraStreamsGetProfileRtspEntries, useCameraStreamsGetRtspEntries, useCameraStreamsPickStream, useCapabilityPresence, useCarbonMonoxideGetStatus, useClimateControlGetStatus, useClimateControlSetFanMode, useClimateControlSetMode, useClimateControlSetPreset, useClimateControlSetSwingHorizontal, useClimateControlSetSwingVertical, useClimateControlSetTarget, useClimateControlSetTargetHumidity, useClimateControlSetTargetRange, useClusterNodes, useClusterTopology, useColorGetStatus, useColorSetColor, useConfirm, useConnectionTestDescribeTest, useConnectionTestTestSettings, useConnectivityGetStatus, useConsumablesGetStatus, useConsumablesReset, useContactGetStatus, useContainerChildren, useControlGetStatus, useControlSetValue, useCoreBlocksCompile, useCoreBlocksCreate, useCoreBlocksCreateComposition, useCoreBlocksDelete, useCoreBlocksGet, useCoreBlocksGetBlockSettings, useCoreBlocksGetComposition, useCoreBlocksGetCustomization, useCoreBlocksGetTypeDefs, useCoreBlocksList, useCoreBlocksListComposableCaps, useCoreBlocksListCompositions, useCoreBlocksRestart, useCoreBlocksSetEnabled, useCoreBlocksUpdate, useCoreBlocksUpdateBlockSettings, useCoreBlocksUpdateComposition, useCoreBlocksValidateComposition, useCoverClose, useCoverGetStatus, useCoverOpen, useCoverSetPosition, useCoverSetTiltPosition, useCoverStop, useCustomFieldRenderer, useDataTableFilter, useDayNightGetOptions, useDayNightGetStatus, useDayNightSetSettings, useDebouncedString, useDecoderCreateSession, useDecoderDestroySession, useDecoderGetFrame, useDecoderGetInfo, useDecoderGetShmStats, useDecoderGetStats, useDecoderListActiveSessions, useDecoderOpenStream, useDecoderPullFrames, useDecoderPullHandles, useDecoderPushPacket, useDecoderReprobeHwaccel, useDecoderSupportsCodec, useDecoderUpdateConfig, useDetectionPipelineApplyDeviceSettingsPatch, useDetectionPipelineGetDeviceLiveContribution, useDetectionPipelineGetDeviceSettingsContribution, useDevShell, useDevice, useDeviceAdminLink, useDeviceAdminLinkGetAdminLink, useDeviceAdoptionAdopt, useDeviceAdoptionGetCandidate, useDeviceAdoptionGetStatus, useDeviceAdoptionListCandidateFilters, useDeviceAdoptionListCandidates, useDeviceAdoptionRefresh, useDeviceAdoptionRelease, useDeviceAdoptionResync, useDeviceAutotrack, useDeviceBattery, useDeviceCapSlice, useDeviceCapability, useDeviceDetections, useDeviceDiscoveryAdoptDevice, useDeviceDiscoveryGetStatus, useDeviceDiscoveryListDiscovered, useDeviceDiscoveryRefreshDiscovery, useDeviceDiscoveryReleaseDevice, useDeviceExportApplyDeviceSettingsPatch, useDeviceExportExposeDevice, useDeviceExportGetDeviceLiveContribution, useDeviceExportGetDeviceSettingsContribution, useDeviceExportGetStatus, useDeviceExportListExposedDevices, useDeviceExportListSupportedDeviceKinds, useDeviceExportUnexposeDevice, useDeviceExtensionListCandidates, useDeviceExtensionListSlots, useDeviceExtensionListSources, useDeviceExtensionSetSlot, useDeviceId, useDeviceListPageSize, useDeviceManagerAddLocation, useDeviceManagerAdoptDevice, useDeviceManagerAdoptionAdopt, useDeviceManagerAdoptionCancelJob, useDeviceManagerAdoptionListCandidateFilters, useDeviceManagerAdoptionListCandidates, useDeviceManagerAdoptionListJobs, useDeviceManagerAdoptionRefresh, useDeviceManagerAdoptionRelease, useDeviceManagerAdoptionResync, useDeviceManagerAdoptionStartJob, useDeviceManagerAllocateDeviceId, useDeviceManagerApplyInitialMeta, useDeviceManagerCreateDevice, useDeviceManagerDisable, useDeviceManagerDiscoverAllProviders, useDeviceManagerDiscoverDevices, useDeviceManagerDiscoverProvider, useDeviceManagerDiscoveryProviders, useDeviceManagerEnable, useDeviceManagerGetAllBindings, useDeviceManagerGetBindings, useDeviceManagerGetBindingsBatch, useDeviceManagerGetChildren, useDeviceManagerGetChildrenBatch, useDeviceManagerGetConfigSchema, useDeviceManagerGetCreationSchema, useDeviceManagerGetDevice, useDeviceManagerGetDeviceAggregate, useDeviceManagerGetDeviceLiveInfoAggregate, useDeviceManagerGetDeviceSettingsAggregate, useDeviceManagerGetDeviceStatusAggregate, useDeviceManagerGetDeviceStatusAggregateBatch, useDeviceManagerGetLinkedDevices, useDeviceManagerGetLinkedDevicesBatch, useDeviceManagerGetRoleDisplayDefaults, useDeviceManagerGetSettingsSchema, useDeviceManagerGetStreamProfileMap, useDeviceManagerGetStreamSources, useDeviceManagerGetWireableFields, useDeviceManagerGetWrapperActivation, useDeviceManagerListAll, useDeviceManagerListBindableCapsForDeviceType, useDeviceManagerListDeviceIdsByCaps, useDeviceManagerListLocationDescriptions, useDeviceManagerListLocationIcons, useDeviceManagerListLocations, useDeviceManagerListPersistedByAddon, useDeviceManagerListSiteZones, useDeviceManagerListWrappersForCap, useDeviceManagerLoadConfig, useDeviceManagerLoadMeta, useDeviceManagerLoadRuntimeState, useDeviceManagerMigrateDevice, useDeviceManagerPersistConfig, useDeviceManagerProbeStreams, useDeviceManagerProviderCreationType, useDeviceManagerProviderDiscoveryParamsSchema, useDeviceManagerRegisterDevice, useDeviceManagerRemove, useDeviceManagerRemoveByIntegration, useDeviceManagerRemoveDevice, useDeviceManagerRemoveLocation, useDeviceManagerRemoveSiteZone, useDeviceManagerRenameLocation, useDeviceManagerRenameSiteZone, useDeviceManagerRunDeviceAction, useDeviceManagerSetChildLayout, useDeviceManagerSetDisabled, useDeviceManagerSetDisplay, useDeviceManagerSetIntegrationId, useDeviceManagerSetLinkDeviceId, useDeviceManagerSetLocation, useDeviceManagerSetLocationDescription, useDeviceManagerSetLocationIcon, useDeviceManagerSetLocationZone, useDeviceManagerSetMetadata, useDeviceManagerSetName, useDeviceManagerSetPrimaryChildEntityId, useDeviceManagerSetRole, useDeviceManagerSetRoleDisplayDefaults, useDeviceManagerSetSiteZone, useDeviceManagerSetStreamProfileMap, useDeviceManagerSetType, useDeviceManagerSetWrapperActive, useDeviceManagerTestCreationField, useDeviceManagerTestField, useDeviceManagerUpdateConfig, useDeviceManagerUpdateDeviceField, useDeviceManagerUpdateDeviceFieldsBatch, useDeviceNetworkLink, useDeviceOpsGetConfigEntries, useDeviceOpsGetRawState, useDeviceOpsGetSettingsSchema, useDeviceOpsGetStreamSources, useDeviceOpsRemoveDevice, useDeviceOpsRunAction, useDeviceOpsSetConfig, useDeviceProviderAdoptDiscoveredDevice, useDeviceProviderCreateDevice, useDeviceProviderDiscoverDevices, useDeviceProviderGetChildCreationSchema, useDeviceProviderGetDevices, useDeviceProviderGetDiscoveryParamsSchema, useDeviceProviderGetManualCreationType, useDeviceProviderGetStatus, useDeviceProviderReloadDevice, useDeviceProviderStart, useDeviceProviderStop, useDeviceProviderSupportsDiscovery, useDeviceProviderSupportsManualCreation, useDeviceProviderTestCreationField, useDeviceProxy, useDeviceQuickDetailOpen, useDeviceSnapshot, useDeviceSnapshotImage, useDeviceState, useDeviceStateClaimFields, useDeviceStateGetAllSnapshots, useDeviceStateGetCapSlice, useDeviceStateGetNativeCapSlice, useDeviceStateGetSnapshot, useDeviceStateListClaims, useDeviceStatePatchOwnedFields, useDeviceStateReleaseClaim, useDeviceStateSetCapSlice, useDeviceStateSlice, useDeviceStatusGetStatus, useDeviceWebrtc, useDevices, useDoorbellEvents, useDoorbellGetStatus, useEnumSensorGetStatus, useEventEmitterGetStatus, useEventInvalidation, useEventStreamLatest, useEventStreamMap, useFaceGalleryAssignFace, useFaceGalleryAssignFaces, useFaceGalleryAuditIdentitySamples, useFaceGalleryCreateIdentity, useFaceGalleryDeleteFace, useFaceGalleryDeleteIdentity, useFaceGalleryGetFaceByTrack, useFaceGalleryGetFaceMedia, useFaceGalleryListIdentities, useFaceGalleryListIdentitySamples, useFaceGalleryListRecentFaces, useFaceGalleryRemoveSample, useFaceGalleryRenameIdentity, useFaceGallerySuggestFaceClusters, useFaceGalleryUnassignFace, useFaceGalleryUnassignFaces, useFanControlGetStatus, useFanControlSetDirection, useFanControlSetOscillating, useFanControlSetPercentage, useFanControlSetPreset, useFeatureProbeGetStatus, useFloodGetStatus, useGasGetStatus, useHumidifierGetStatus, useHumidifierSetMode, useHumidifierSetOn, useHumidifierSetTargetHumidity, useHumiditySensorGetStatus, useImageGetStatus, useImageSettingsGetOptions, useImageSettingsGetStatus, useImageSettingsSetSettings, useIntegrationsCreate, useIntegrationsDelete, useIntegrationsGet, useIntegrationsGetAvailableTypes, useIntegrationsGetByAddonId, useIntegrationsGetSettings, useIntegrationsList, useIntegrationsSetSettings, useIntegrationsTestConnection, useIntegrationsUpdate, useIntercomEndTalkSession, useIntercomGetStatus, useIntercomHandleAnswer, useIntercomPushTalkAudio, useIntercomStartSession, useIntercomStartTalkSession, useIntercomStopSession, useIsMidWidth, useIsMobile, useLawnMowerControlDock, useLawnMowerControlGetStatus, useLawnMowerControlPause, useLawnMowerControlStartMowing, useLiveBuffer, useLiveEvent, useLlmCancel, useLlmDeleteModel, useLlmDeleteProfile, useLlmGenerate, useLlmGenerateVision, useLlmGetDefaults, useLlmGetRuntimeStatus, useLlmGetUsage, useLlmInstallModel, useLlmListModelCatalog, useLlmListModels, useLlmListNodeModels, useLlmListProfileKinds, useLlmListProfiles, useLlmListRuntimeNodes, useLlmResolveModelRef, useLlmSetDefault, useLlmStartRuntime, useLlmStopRuntime, useLlmTestProfile, useLlmUpsertProfile, useLocalNetworkAddCustomAddress, useLocalNetworkDownloadCa, useLocalNetworkGetAddresses, useLocalNetworkGetAllowedAddresses, useLocalNetworkGetConnectionEndpoints, useLocalNetworkGetHubAddresses, useLocalNetworkGetNotificationEndpoint, useLocalNetworkGetPreferred, useLocalNetworkGetTlsStatus, useLocalNetworkGetViewerEndpoints, useLocalNetworkList, useLocalNetworkRegenerateCertificate, useLocalNetworkRemoveCustomAddress, useLocalNetworkResetAllowlistToBestMatch, useLocalNetworkRevertToGeneratedCertificate, useLocalNetworkSetAddressRole, useLocalNetworkSetAllowedAddresses, useLocalNetworkSetNotificationEndpoint, useLocalNetworkSetViewerEndpoints, useLocalNetworkUploadCertificate, useLockControlGetStatus, useLockControlLock, useLockControlOpen, useLockControlUnlock, useMediaPlayerGetStatus, useMediaPlayerNext, useMediaPlayerPause, useMediaPlayerPlay, useMediaPlayerPlayMedia, useMediaPlayerPrevious, useMediaPlayerSeek, useMediaPlayerSelectSource, useMediaPlayerSetMute, useMediaPlayerSetRepeat, useMediaPlayerSetShuffle, useMediaPlayerSetVolume, useMediaPlayerStop, useMeshNetworkGetStatus, useMeshNetworkJoin, useMeshNetworkLeave, useMeshNetworkListPeers, useMeshNetworkLogout, useMeshNetworkStartLogin, useMeshNetworkTestConnection, useMetricsProviderCollectSnapshot, useMetricsProviderGetAddonStats, useMetricsProviderGetCached, useMetricsProviderGetCpuTemperature, useMetricsProviderGetCurrent, useMetricsProviderGetDiskSpace, useMetricsProviderGetGpuInfo, useMetricsProviderGetLoadSeries, useMetricsProviderGetProcessStats, useMetricsProviderListAddonInstances, useMetricsProviderListNodeProcesses, useMotionDetectionAnalyze, useMotionDetectionApplyDeviceSettingsPatch, useMotionDetectionGetDeviceLiveContribution, useMotionDetectionGetDeviceSettingsContribution, useMotionDetectionRemoveCamera, useMotionDetectionReset, useMotionGetStatus, useMotionIsDetected, useMotionTriggerGetStatus, useMotionTriggerSetMotionTrigger, useMotionZonesGetOptions, useMotionZonesGetStatus, useMotionZonesSetZone, useMqttBrokerAddBroker, useMqttBrokerGetBrokerConfig, useMqttBrokerGetStatus, useMqttBrokerListBrokers, useMqttBrokerRemoveBroker, useMqttBrokerStartEmbeddedBroker, useMqttBrokerStopEmbeddedBroker, useMqttBrokerTestConnection, useNativeObjectDetectionGetOptions, useNativeObjectDetectionGetStatus, useNativeObjectDetectionSetEnabled, useNativeObjectDetectionSetSettings, useNavigation, useNavigationGetFeatures, useNavigationGetStatus, useNavigationGoToPoint, useNavigationListActions, useNavigationMove, useNavigationPlaySound, useNavigationRunAction, useNavigationSetLightLevel, useNavigationSetLightMode, useNavigationSetLightOn, useNavigationStop, useNetworkAccessGetEndpoint, useNetworkAccessGetStatus, useNetworkAccessListEndpoints, useNetworkAccessStart, useNetworkAccessStop, useNetworkLinkGetStatus, useNetworkQualityGetAllStats, useNetworkQualityGetDeviceStats, useNetworkQualityReportClientStats, useNodesClusterAddonStatus, useNodesDeployAddon, useNodesDirectory, useNodesExecuteQuery, useNodesGetCapUsageGraph, useNodesGetNodeAddons, useNodesRenameNode, useNodesRestartAddon, useNodesRestartNode, useNodesRestartProcess, useNodesSetProcessLogLevel, useNodesShutdownNode, useNodesTopology, useNodesUndeployAddon, useNotificationOutputDeleteTarget, useNotificationOutputDiscoverTargets, useNotificationOutputGetTarget, useNotificationOutputListTargetKinds, useNotificationOutputListTargets, useNotificationOutputProbeTargetConfig, useNotificationOutputSend, useNotificationOutputSetTargetEnabled, useNotificationOutputTestTarget, useNotificationOutputUpsertTarget, useNotificationRulesActivateAlarmProfile, useNotificationRulesCancelSnooze, useNotificationRulesCreateAlarmProfile, useNotificationRulesCreateRule, useNotificationRulesCreateSequence, useNotificationRulesCreateSnooze, useNotificationRulesDeleteAlarmProfile, useNotificationRulesDeleteRule, useNotificationRulesDeleteSequence, useNotificationRulesGetAlarmConfig, useNotificationRulesGetAlarmSensors, useNotificationRulesGetClipRetentionAsks, useNotificationRulesGetConditionCatalog, useNotificationRulesGetHistory, useNotificationRulesGetRule, useNotificationRulesGetRuleLastRuns, useNotificationRulesGetSequence, useNotificationRulesGetTemplateCatalog, useNotificationRulesListDeviceMutes, useNotificationRulesListRules, useNotificationRulesListSequences, useNotificationRulesListSnoozes, useNotificationRulesPreviewStateSummary, useNotificationRulesPreviewTemplate, useNotificationRulesRenameAlarmProfile, useNotificationRulesResolveArtifactUrl, useNotificationRulesSetAlarmConfig, useNotificationRulesSetDeviceMuted, useNotificationRulesSetRuleEnabled, useNotificationRulesTestRule, useNotificationRulesUpdateRule, useNotificationRulesUpdateSequence, useNotifierCancel, useNotifierGetStatus, useNotifierSend, useNumericSensorGetStatus, useOptimisticSlice, useOptionalSystem, useOptionalWidgetRegistry, useOsdGetStatus, useOsdManagerClearSlotBinding, useOsdManagerCopyDeviceConfiguration, useOsdManagerDeleteTemplate, useOsdManagerGetConditionSupport, useOsdManagerGetDeviceOsd, useOsdManagerGetSourceCatalog, useOsdManagerListTemplates, useOsdManagerPreviewSlot, useOsdManagerRenderDevice, useOsdManagerSetSlotBinding, useOsdManagerUpsertTemplate, useOsdSetOverlay, usePTZ, usePetFeederCallPet, usePetFeederCancelFeed, usePetFeederFeed, usePetFeederGetStatus, usePetFeederMarkFoodReplenished, usePetFeederPlaySound, usePetFeederResetDesiccant, usePetFeederSetChildLock, usePetFeederSetFeedSound, usePetFeederSetIndicatorLight, usePetFeederSetVolume, usePickerSiteZones, usePipelineAnalyticsApplyDeviceSettingsPatch, usePipelineAnalyticsCancelRelocateMedia, usePipelineAnalyticsCancelStorageMigrationMove, usePipelineAnalyticsClearTrackRelation, usePipelineAnalyticsClearTracks, usePipelineAnalyticsCompleteRetrainTrack, usePipelineAnalyticsCountRelocatableMedia, usePipelineAnalyticsCountUnstampedEventMedia, usePipelineAnalyticsDeleteDeviceEvents, usePipelineAnalyticsDeleteTracks, usePipelineAnalyticsDeselectRetrainFrame, usePipelineAnalyticsGetActiveTracks, usePipelineAnalyticsGetAudioEvents, usePipelineAnalyticsGetDeviceLiveContribution, usePipelineAnalyticsGetDeviceSettingsContribution, usePipelineAnalyticsGetEventDensity, usePipelineAnalyticsGetEventDensityBatch, usePipelineAnalyticsGetEventMedia, usePipelineAnalyticsGetEventMediaFootprintByKind, usePipelineAnalyticsGetEventStoreFootprint, usePipelineAnalyticsGetKeyEvents, usePipelineAnalyticsGetKeyEventsBatch, usePipelineAnalyticsGetMediaReclaimStatus, usePipelineAnalyticsGetMotionEvents, usePipelineAnalyticsGetObjectEmbeddingRebuildStatus, usePipelineAnalyticsGetObjectEvents, usePipelineAnalyticsGetRetrainExportUrl, usePipelineAnalyticsGetRetrainFrameImage, usePipelineAnalyticsGetSensorEvents, usePipelineAnalyticsGetStorageMigrationMoveStatus, usePipelineAnalyticsGetTrack, usePipelineAnalyticsGetTrackMedia, usePipelineAnalyticsGetTrainingExportSummary, usePipelineAnalyticsGetTrainingExportUrl, usePipelineAnalyticsListArchivedDebugNotes, usePipelineAnalyticsListBirthDecisions, usePipelineAnalyticsListEventKinds, usePipelineAnalyticsListEventKindsBatch, usePipelineAnalyticsListEventMedia, usePipelineAnalyticsListOpsLog, usePipelineAnalyticsListRecentTracks, usePipelineAnalyticsListRelocateMediaJobs, usePipelineAnalyticsListRetrainAnnotations, usePipelineAnalyticsListRetrainFrames, usePipelineAnalyticsListRetrainStaging, usePipelineAnalyticsListTrackMedia, usePipelineAnalyticsListTrackRelations, usePipelineAnalyticsListTracks, usePipelineAnalyticsOwnersWithMedia, usePipelineAnalyticsPauseForStorageMigration, usePipelineAnalyticsProposeRetrainAnnotations, usePipelineAnalyticsPruneEvents, usePipelineAnalyticsPruneEventsBefore, usePipelineAnalyticsPruneTracksBefore, usePipelineAnalyticsReadLongTermSeries, usePipelineAnalyticsRebuildObjectEmbeddings, usePipelineAnalyticsReclaimDebugMedia, usePipelineAnalyticsReconcileFromDisk, usePipelineAnalyticsRefreshStorageLocationsForMigration, usePipelineAnalyticsRelocateMedia, usePipelineAnalyticsRestageRetrainTrack, usePipelineAnalyticsResumeForStorageMigration, usePipelineAnalyticsSaveRetrainAnnotations, usePipelineAnalyticsSearchObjectEvents, usePipelineAnalyticsSelectRetrainFrames, usePipelineAnalyticsSetTrackFlags, usePipelineAnalyticsSetTrackPurity, usePipelineAnalyticsSetTrackRelation, usePipelineAnalyticsStartStorageMigrationMove, usePipelineAnalyticsWipeAllAnalytics, usePipelineAnalyticsWipeObjectEmbeddings, usePipelineExecutorCacheFrameInPool, usePipelineExecutorClearDeviceOverrides, usePipelineExecutorClearModelBoundDeviceOverrides, usePipelineExecutorDeleteModel, usePipelineExecutorDeleteTemplate, usePipelineExecutorDownloadModel, usePipelineExecutorGetAddonModels, usePipelineExecutorGetAudioCapabilities, usePipelineExecutorGetAvailableEngines, usePipelineExecutorGetCapabilities, usePipelineExecutorGetDefaultSteps, usePipelineExecutorGetDetectionConfigSchema, usePipelineExecutorGetEffectiveTuning, usePipelineExecutorGetEngineProvisioning, usePipelineExecutorGetGlobalPipelineConfig, usePipelineExecutorGetGlobalSteps, usePipelineExecutorGetInferenceDeviceHealth, usePipelineExecutorGetOrchestratorConfigSchema, usePipelineExecutorGetReferenceAudio, usePipelineExecutorGetReferenceAudioFiles, usePipelineExecutorGetReferenceImage, usePipelineExecutorGetSchema, usePipelineExecutorGetSelectedEngine, usePipelineExecutorGetVideoPipelineSteps, usePipelineExecutorInferCached, usePipelineExecutorKillEngine, usePipelineExecutorListLoadedEngines, usePipelineExecutorListReferenceImages, usePipelineExecutorListTemplates, usePipelineExecutorRearmInferenceDevice, usePipelineExecutorRunAudioTest, usePipelineExecutorRunPipeline, usePipelineExecutorRunPipelineBatch, usePipelineExecutorSaveTemplate, usePipelineExecutorSetVideoPipelineSteps, usePipelineExecutorSpinEngine, usePipelineExecutorUncacheFrame, usePipelineExecutorUpdateTemplate, usePipelineExecutorValidatePipeline, usePipelineOrchestratorApplyAutoTune, usePipelineOrchestratorApplyDeviceSettingsPatch, usePipelineOrchestratorAssignAudio, usePipelineOrchestratorAssignPipeline, usePipelineOrchestratorDeleteTemplate, usePipelineOrchestratorGetAgentLoad, usePipelineOrchestratorGetAgentSettings, usePipelineOrchestratorGetAudioAssignment, usePipelineOrchestratorGetAudioAssignments, usePipelineOrchestratorGetAudioNodeLoad, usePipelineOrchestratorGetCameraMetrics, usePipelineOrchestratorGetCameraSettings, usePipelineOrchestratorGetCameraStatus, usePipelineOrchestratorGetCameraStatuses, usePipelineOrchestratorGetCameraStepOverrides, usePipelineOrchestratorGetCameraSwitches, usePipelineOrchestratorGetCapabilityBindings, usePipelineOrchestratorGetClusterModelChoice, usePipelineOrchestratorGetDeviceLiveContribution, usePipelineOrchestratorGetDeviceSettingsContribution, usePipelineOrchestratorGetEffectiveShares, usePipelineOrchestratorGetGlobalMetrics, usePipelineOrchestratorGetIngestOwner, usePipelineOrchestratorGetNodeInferenceDevices, usePipelineOrchestratorGetPipelineAssignment, usePipelineOrchestratorGetPipelineAssignments, usePipelineOrchestratorGetPipelineDevicePin, usePipelineOrchestratorGetPlacementStats, usePipelineOrchestratorGetReconcileFromDiskStatus, usePipelineOrchestratorListAgentSettings, usePipelineOrchestratorListTemplates, usePipelineOrchestratorPauseForStorageMigration, usePipelineOrchestratorPlanAutoTune, usePipelineOrchestratorRebalance, usePipelineOrchestratorReconcileFromDisk, usePipelineOrchestratorRemoveAgentSettings, usePipelineOrchestratorRequestOccupancyLook, usePipelineOrchestratorResetNodePipelineDefaults, usePipelineOrchestratorResolvePipeline, usePipelineOrchestratorResumeForStorageMigration, usePipelineOrchestratorSaveTemplate, usePipelineOrchestratorSetAgentCapabilities, usePipelineOrchestratorSetAgentDecodeLimits, usePipelineOrchestratorSetAgentInferenceDevices, usePipelineOrchestratorSetAgentMaxCameras, usePipelineOrchestratorSetAgentReachableHost, usePipelineOrchestratorSetCameraPipelineForAgent, usePipelineOrchestratorSetCameraSensors, usePipelineOrchestratorSetCameraStepOverride, usePipelineOrchestratorSetCameraStepSettings, usePipelineOrchestratorSetCameraStepToggle, usePipelineOrchestratorSetCameraSwitch, usePipelineOrchestratorSetCapabilityBinding, usePipelineOrchestratorSetLoadBalancingShares, usePipelineOrchestratorSetPipelineDevicePin, usePipelineOrchestratorSetShareSource, usePipelineOrchestratorSuggestShares, usePipelineOrchestratorUnassignAudio, usePipelineOrchestratorUnassignPipeline, usePipelineOrchestratorUpdateTemplate, usePipelineRunnerAttachCamera, usePipelineRunnerDetachCamera, usePipelineRunnerGetAllCameraMetrics, usePipelineRunnerGetCameraMetrics, usePipelineRunnerGetLocalCameras, usePipelineRunnerGetLocalLoad, usePipelineRunnerGetLocalMetrics, usePipelineRunnerGetNativeCrop, usePipelineRunnerGetParkedTrackFrame, usePipelineRunnerParkTrackFrame, usePipelineRunnerReleaseParkedTrackFrames, usePipelineRunnerReportMotion, usePipelineRunnerRequestOccupancyBurst, usePipelineRunnerRunDetailSubtree, usePipelineRunnerRunStatelessStep, usePlateGalleryAssignPlate, usePlateGalleryAssignPlates, usePlateGalleryCorrectPlateText, usePlateGalleryCreateVehicle, usePlateGalleryDeletePlate, usePlateGalleryDeleteVehicle, usePlateGalleryGetPlateByTrack, usePlateGalleryGetPlateMedia, usePlateGalleryListPlates, usePlateGalleryListVehicleSamples, usePlateGalleryListVehicles, usePlateGalleryRemoveVehicleSample, usePlateGalleryRenameVehicle, usePlateGallerySearchPlates, usePlateGallerySuggestPlateClusters, usePlateGalleryUnassignPlate, usePlateGalleryUnassignPlates, usePlayerOverlayLayer, usePlayerOverlayLayers, usePlayerToolbarButton, usePlayerToolbarButtons, usePowerMeterGetStatus, usePresenceGetStatus, usePressureSensorGetStatus, usePrivacyMaskGetOptions, usePrivacyMaskGetStatus, usePrivacyMaskSetAudioEnabled, usePrivacyMaskSetMask, usePrompt, usePtzAutotrackGetSettings, usePtzAutotrackGetStatus, usePtzAutotrackSetEnabled, usePtzAutotrackSetSettings, usePtzCaptureHomeHere, usePtzContinuousMove, usePtzDeletePreset, usePtzGetHomePreset, usePtzGetHomeReturn, usePtzGetOptions, usePtzGetPosition, usePtzGetPresets, usePtzGetStatus, usePtzGoHome, usePtzGoToPreset, usePtzMove, usePtzSavePreset, usePtzSetAutofocus, usePtzSetHomePreset, usePtzSetHomeReturn, usePtzStop, useRebootReboot, useRecordedPlayback, useRecordingArchiveApplyDeviceSettingsPatch, useRecordingArchiveCancelRelocateJob, useRecordingArchiveCancelStorageMigrationMove, useRecordingArchiveDeleteFootprint, useRecordingArchiveGetAvailabilityBatch, useRecordingArchiveGetDaysWithRecordingsBatch, useRecordingArchiveGetDeviceConfig, useRecordingArchiveGetDeviceLiveContribution, useRecordingArchiveGetDeviceSettingsContribution, useRecordingArchiveGetPlacement, useRecordingArchiveGetRelocateResidue, useRecordingArchiveGetStatus, useRecordingArchiveGetStorageMigrationMoveStatus, useRecordingArchiveGetStorageUsage, useRecordingArchiveListOpsLog, useRecordingArchiveListRelocateJobs, useRecordingArchiveLocateSegment, useRecordingArchivePauseForStorageMigration, useRecordingArchivePlanStorageRebalance, useRecordingArchivePruneFootage, useRecordingArchiveReadGopBytes, useRecordingArchiveReadSegmentBytes, useRecordingArchiveReadWindowBytes, useRecordingArchiveReconcileLedgerAgainstDisk, useRecordingArchiveRefreshStorageLocationsForMigration, useRecordingArchiveRelocateFootage, useRecordingArchiveRenderClip, useRecordingArchiveRenderGif, useRecordingArchiveRescanStorage, useRecordingArchiveResumeForStorageMigration, useRecordingArchiveSetDeviceConfig, useRecordingArchiveSetDevicePlacement, useRecordingArchiveStartStorageMigrationMove, useRecordingArchiveStartStorageRebalance, useRecordingExportCancelExport, useRecordingExportCreateExport, useRecordingExportDeleteExport, useRecordingExportGetDownloadUrl, useRecordingExportGetExport, useRecordingExportListExports, useRecordingExportReadExportBytes, useRecordingGetAvailability, useRecordingGetDaysWithRecordings, useRecordingGetPlayback, useRecordingGetPlaybackOptions, useRecordingListSources, useRecordingOnboardGetOptions, useRecordingOnboardGetStatus, useRecordingOnboardSetSettings, useRecordingSignalGetStatus, useRemoteComponent, useRoleDisplayDefaults, useSceneMonitorCaptureReference, useSceneMonitorCreateScene, useSceneMonitorDeleteReference, useSceneMonitorDeleteScene, useSceneMonitorGetStatus, useSceneMonitorListScenes, useSceneMonitorListScenesBatch, useSceneMonitorRecheckNow, useSceneMonitorResetScene, useSceneMonitorUpdateScene, useScriptRunnerGetStatus, useScriptRunnerRun, useScriptRunnerStop, useScrubController, useServerManagementApplyServerUpdate, useServerManagementCheckServerUpdate, useServerManagementGetServerPackageStatus, useServerManagementRestartServer, useServerManagementRollbackServerUpdate, useSettingsStoreAggregate, useSettingsStoreCount, useSettingsStoreDeclareCollection, useSettingsStoreDelete, useSettingsStoreDeleteWhere, useSettingsStoreGet, useSettingsStoreHistogram, useSettingsStoreInsert, useSettingsStoreInsertMany, useSettingsStoreIsEmpty, useSettingsStoreQuery, useSettingsStoreSet, useSettingsStoreUpdate, useSettingsStoreUpdateWhere, useSettingsStoreUpsert, useSmokeGetStatus, useSnapshotApplyDeviceSettingsPatch, useSnapshotGetDebugState, useSnapshotGetDeviceLiveContribution, useSnapshotGetDeviceSettingsContribution, useSnapshotGetSnapshot, useSnapshotGetSnapshotLinks, useSnapshotGetSnapshotOverview, useSnapshotGetStatus, useSnapshotInvalidateCache, useStationaryOverlay, useStorageAbortUpload, useStorageBeginDownload, useStorageBeginUpload, useStorageDelete, useStorageDeleteLocation, useStorageEndDownload, useStorageExists, useStorageFinalizeUpload, useStorageGetAvailableSpace, useStorageList, useStorageListDrainProgress, useStorageListLocationDeclarations, useStorageListLocations, useStorageListProviders, useStorageMigrationCancel, useStorageMigrationCleanupCancel, useStorageMigrationCleanupStart, useStorageMigrationCleanupStatus, useStorageMigrationDrain, useStorageMigrationHistory, useStorageMigrationMovers, useStorageMigrationPlan, useStorageMigrationResidue, useStorageMigrationStart, useStorageMigrationStatus, useStorageRead, useStorageReadChunk, useStorageResolve, useStorageTestConfig, useStorageTestLocation, useStorageUpsertLocation, useStorageWrite, useStorageWriteChunk, useStoredGroupBy, useStreamBrokerAcquireEgressTranscode, useStreamBrokerApplyDeviceSettingsPatch, useStreamBrokerAssignProfile, useStreamBrokerFetchEventMedia, useStreamBrokerForgetDeviceHardware, useStreamBrokerGetAllRtspEntries, useStreamBrokerGetBrokerStats, useStreamBrokerGetDeviceAudioMute, useStreamBrokerGetDeviceLiveContribution, useStreamBrokerGetDeviceSettingsContribution, useStreamBrokerGetPreBufferInfo, useStreamBrokerGetRtspEntry, useStreamBrokerGetRtspPort, useStreamBrokerGetStreamUrl, useStreamBrokerGetStreamWithCodec, useStreamBrokerIsRtspEnabled, useStreamBrokerKillClient, useStreamBrokerListAllCameraStreams, useStreamBrokerListAllProfileSlots, useStreamBrokerListClients, useStreamBrokerProbeStream, useStreamBrokerProduceEventMedia, useStreamBrokerPublishCameraStream, useStreamBrokerPullAudioChunks, useStreamBrokerPullFrameHandles, useStreamBrokerRegenerateRtspToken, useStreamBrokerReleaseEgressTranscode, useStreamBrokerReleaseStreamWithCodec, useStreamBrokerRenderPreBufferClip, useStreamBrokerReportStreamSignal, useStreamBrokerRestartProfile, useStreamBrokerRetractCameraStream, useStreamBrokerSetDeviceAudioMute, useStreamBrokerSetPreBufferDuration, useStreamBrokerSetRtspEnabled, useStreamBrokerSubscribeAudioChunks, useStreamBrokerSubscribeFrames, useStreamBrokerUnassignProfile, useStreamBrokerUnsubscribeAudioChunks, useStreamBrokerUnsubscribeFrames, useStreamCatalogGetCatalog, useStreamParamsGetConfigSchema, useStreamParamsGetOptions, useStreamParamsGetStatus, useStreamParamsSetProfile, useStreamSignalsListSignals, useSwitchGetStatus, useSwitchSetState, useSystem, useSystemDetectSiteLocation, useSystemFeatureFlags, useSystemForceRetentionCleanup, useSystemGetFailureContributions, useSystemGetLoadContributions, useSystemGetLoggingSettings, useSystemGetRequestCensus, useSystemGetRetentionConfig, useSystemGetSiteLocation, useSystemHealth, useSystemInfo, useSystemMutation, useSystemNetworkAddresses, useSystemQuery, useSystemSetLoggingSettings, useSystemSetRetentionConfig, useSystemSetSiteLocation, useTamperGetStatus, useTemperatureSensorGetStatus, useTerminalSessionAdoptLegacyMonitor, useTerminalSessionClose, useTerminalSessionCreateInstance, useTerminalSessionDeleteInstance, useTerminalSessionListInstances, useTerminalSessionListLegacyCameras, useTerminalSessionListProfiles, useTerminalSessionListSessions, useTerminalSessionOpenSession, useTerminalSessionPullOutput, useTerminalSessionResize, useTerminalSessionSetInstanceEnabled, useTerminalSessionUpdateInstance, useTerminalSessionWriteInput, useThemeMode, useToastOnToast, useTurnProviderGetTurnServers, useUpdateGetStatus, useUpdateInstallUpdate, useUrlQueryParam, useUserManagementConfirmTotp, useUserManagementCreateApiKey, useUserManagementCreateScopedToken, useUserManagementCreateUser, useUserManagementDeleteUser, useUserManagementDisableTotp, useUserManagementGetTotpStatus, useUserManagementListApiKeys, useUserManagementListOauthSessions, useUserManagementListScopedTokens, useUserManagementListUsers, useUserManagementOauthExchangeCode, useUserManagementOauthIssueCode, useUserManagementOauthRefresh, useUserManagementOauthVerifyAccessToken, useUserManagementResetPassword, useUserManagementRevokeApiKey, useUserManagementRevokeOauthSession, useUserManagementRevokeScopedToken, useUserManagementSetUserScopes, useUserManagementSetupTotp, useUserManagementUpdateUser, useUserManagementValidateApiKey, useUserManagementValidateCredentials, useUserManagementValidateScopedToken, useUserManagementVerifyTotp, useVacuumControlGetStatus, useVacuumControlLocate, useVacuumControlPause, useVacuumControlReturnToBase, useVacuumControlSetFanSpeed, useVacuumControlStart, useVacuumControlStop, useValveClose, useValveGetStatus, useValveOpen, useValveSetPosition, useValveStop, useVibrationGetStatus, useVideoclipsDialClipStream, useVideoclipsGetClipPlayback, useVideoclipsGetPlaybackOptions, useVideoclipsListClips, useVideoclipsListSources, useVideoclipsOfferClipBytes, useVideoclipsReadClipBytes, useVodPlayback, useWaterHeaterGetStatus, useWaterHeaterSetAway, useWaterHeaterSetOperationMode, useWaterHeaterSetTargetTemp, useWeatherGetStatus, useWebrtcSessionAddIceCandidate, useWebrtcSessionApplyDownlinkProbe, useWebrtcSessionCloseSession, useWebrtcSessionCreateSession, useWebrtcSessionGetIceCandidates, useWebrtcSessionGetSessionDebug, useWebrtcSessionGetSessionState, useWebrtcSessionHandleAnswer, useWebrtcSessionHandleOffer, useWebrtcSessionHasAdaptiveBitrate, useWebrtcSessionListStreams, useWidget, useWidgetMetadata, useWidgetRegistry, useZoneAnalyticsGetCameraHistory, useZoneAnalyticsGetCurrentSnapshot, useZoneAnalyticsGetCurrentSnapshotBatch, useZoneAnalyticsGetUnzonedHistory, useZoneAnalyticsGetZoneHistory, useZoneEditing, useZoneRulesListRules, useZoneRulesSetRules, useZonesAddZone, useZonesListZones, useZonesRemoveZone, useZonesUpdateZone, vacuumStateMeta, validateScopes, valveStateMeta, variantLabel, waterHeaterPhase, waterHeaterTint, weatherConditionMeta, weatherTint, withResolvedParentDetail, writeStoredGroupBy };