@camstack/addon-admin-ui 1.2.450 → 1.2.452
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/assets/{AddonAssetIcon-BGxd6ilu.js → AddonAssetIcon-oAD7HtOX.js} +1 -1
- package/dist/assets/Addons-CrYWbUTm.js +4 -0
- package/dist/assets/{AdminPage-gZharu2-.js → AdminPage-zTp0nTe3.js} +1 -1
- package/dist/assets/{AdminSectionedPage-CKmQWtnO.js → AdminSectionedPage-BJn9Df5z.js} +1 -1
- package/dist/assets/AiProfiles-DxIrm9et.js +3 -0
- package/dist/assets/{BrokerForm-BUU2aljG.js → BrokerForm-ZRNTZhIC.js} +1 -1
- package/dist/assets/Build-B9eaG5VJ.js +40 -0
- package/dist/assets/{Calendars-pLdvoebA.js → Calendars-CN2Uhrr5.js} +1 -1
- package/dist/assets/{Cluster-nUM0tTs6.js → Cluster-BVH4REKi.js} +1 -1
- package/dist/assets/{ClusterStepModel-BXpn99Wd.js → ClusterStepModel-yDdJgqvR.js} +1 -1
- package/dist/assets/CompositionEditor-rMOoN5F5.js +1 -0
- package/dist/assets/{CompositionEditorPage-DwdqpFZ9.js → CompositionEditorPage-BcSVmFyA.js} +1 -1
- package/dist/assets/Data-Dnv7ZfVU.js +2 -0
- package/dist/assets/DeviceDetail-BS5RiGba.js +2 -0
- package/dist/assets/{DeviceDoActionFields-DFNupfG8.js → DeviceDoActionFields-HRtr_KQg.js} +1 -1
- package/dist/assets/{Devices-Bkec33BX.js → Devices-Bk161POt.js} +1 -1
- package/dist/assets/{EmbedPlayerPage-CRsoykJ7.js → EmbedPlayerPage-BgVIezZy.js} +1 -1
- package/dist/assets/History-FSdRNye9.js +1 -0
- package/dist/assets/Identity-C5B6BRyt.js +1 -0
- package/dist/assets/IntegrationDetail-SiZK5uRr.js +1 -0
- package/dist/assets/{IntegrationHub-D_ZUAgeb.js → IntegrationHub-DHPnaPMA.js} +1 -1
- package/dist/assets/Integrations-BkA1KEAY.js +1 -0
- package/dist/assets/{Integrations-B_MXQtrn.js → Integrations-TxhwCTGP.js} +1 -1
- package/dist/assets/{Library-N_802koQ.js → Library-B9pCHVnZ.js} +1 -1
- package/dist/assets/Locations-DW1r5qeE.js +3 -0
- package/dist/assets/{Logs-ByNW2yvM.js → Logs-C2BtNaAN.js} +1 -1
- package/dist/assets/{MaskShapeCanvas-D7B1a_d6.js → MaskShapeCanvas-CmVqJpmm.js} +1 -1
- package/dist/assets/{MotionZonesSettings-Dv0SmFTj.js → MotionZonesSettings-Cc9tuHmU.js} +1 -1
- package/dist/assets/{MyAccess-C3UVOueX.js → MyAccess-C66AWIxq.js} +1 -1
- package/dist/assets/{Network-B4TpXUUe.js → Network-C9aktmZ0.js} +1 -1
- package/dist/assets/{NodeAddonsSettingsPanel-ClIL1TnJ.js → NodeAddonsSettingsPanel-BoUIpXuk.js} +1 -1
- package/dist/assets/Notifications-WCuwxXPI.js +1 -0
- package/dist/assets/{PrivacyMaskSettings-ChKQKD1z.js → PrivacyMaskSettings-CbTGMxxg.js} +1 -1
- package/dist/assets/Recordings-VqcEhUuW.js +1 -0
- package/dist/assets/{ScanNetworkModal-XqC8kMEg.js → ScanNetworkModal-DjUqTV95.js} +1 -1
- package/dist/assets/{SceneMonitorEditor-Dc0QrZZd.js → SceneMonitorEditor-DgEzjukw.js} +1 -1
- package/dist/assets/SessionsList-D20NZop0.js +2 -0
- package/dist/assets/{Showroom-BR04OT2Z.js → Showroom-By5Alv0c.js} +1 -1
- package/dist/assets/{System-Dv1WsKbX.js → System-gRnT7E7Q.js} +1 -1
- package/dist/assets/{Terminal-D7AG_HF7.js → Terminal-BOEgbYdP.js} +1 -1
- package/dist/assets/{Viewer-CA7ipcpQ.js → Viewer-l-gmBOag.js} +1 -1
- package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-DNL8mQaR.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-B0S-_aNb.js} +1 -1
- package/dist/assets/{addon-icons-context-DgMXpJSf.js → addon-icons-context-By6Bm4dX.js} +1 -1
- package/dist/assets/{archive-CnyG155u.js → archive-CvBthkSB.js} +1 -1
- package/dist/assets/{authed-media-BU8Ekrqu.js → authed-media-o-FqDLbM.js} +1 -1
- package/dist/assets/{bell-off-BCgckLrg.js → bell-off-CCvUR5bf.js} +1 -1
- package/dist/assets/{board-model-BEF98n5Q.js → board-model-5X7MvWDr.js} +1 -1
- package/dist/assets/{boxes-uA3JVB9e.js → boxes-DavjA3V9.js} +1 -1
- package/dist/assets/circle-slash-DRfwudv-.js +1 -0
- package/dist/assets/client-BXQKDTPp.js +358 -0
- package/dist/assets/{cloud-upload-C1akQpc4.js → cloud-upload-C578qLMo.js} +1 -1
- package/dist/assets/crop-DQvSi9nJ.js +1 -0
- package/dist/assets/{device-integration-icon-0fiyiloN.js → device-integration-icon-DTjMxRNo.js} +1 -1
- package/dist/assets/device-picker-model-BSSsMgr9.js +1 -0
- package/dist/assets/{dist-DICOq93r.js → dist-DSzxTTFP.js} +1 -1
- package/dist/assets/dist-OkV6Go5s.js +358 -0
- package/dist/assets/{eraser-C_0A9Hjb.js → eraser-Bl0TnhZD.js} +1 -1
- package/dist/assets/{hard-drive-download-B-DH1PV-.js → hard-drive-download-UeIlWgu6.js} +1 -1
- package/dist/assets/{hostInit-BMMYr0tg.js → hostInit-CLS9MdiJ.js} +1 -1
- package/dist/assets/i18n-DY7WWkr4.js +1 -0
- package/dist/assets/{icons-DprpVmeV.js → icons-BhEG_9gQ.js} +1 -1
- package/dist/assets/{index-Cwd2LIJa.js → index-3cHe507L.js} +3 -3
- package/dist/assets/{key-CL8Jmw2S.js → key-B984Bc2m.js} +1 -1
- package/dist/assets/{key-round-C-Aw6TmA.js → key-round-CLUCf0cS.js} +1 -1
- package/dist/assets/{layers-DSNZIEzf.js → layers-ClpK9rfN.js} +1 -1
- package/dist/assets/{linked-devices-model-Jfuscb-L.js → linked-devices-model-CbMqjEVT.js} +1 -1
- package/dist/assets/{list-ordered-C1bZw0BL.js → list-ordered-CNNBtODg.js} +1 -1
- package/dist/assets/{location-owned-usage-A-O0t_Gp.js → location-owned-usage-BOBNcPTd.js} +1 -1
- package/dist/assets/{log-in-Ce7WBmUI.js → log-in-B0mVo25m.js} +1 -1
- package/dist/assets/{memory-stick-DRGsvLsv.js → memory-stick-C2MHfvSi.js} +1 -1
- package/dist/assets/{message-square-plus-Cjk8neRy.js → message-square-plus-B8ozbbSm.js} +1 -1
- package/dist/assets/{mf-entry-bootstrap-0-66a16834.js → mf-entry-bootstrap-0-4e5a0dd7.js} +2 -2
- package/dist/assets/{mic-off-CraNg8N9.js → mic-off-BDRWnndC.js} +1 -1
- package/dist/assets/{monitor-off-CgatD4nF.js → monitor-off-AiaGZyF4.js} +1 -1
- package/dist/assets/{monitor-smartphone-Ct9M1imf.js → monitor-smartphone-LZNwDWQS.js} +1 -1
- package/dist/assets/mount-BSSsMgr9.js +1 -0
- package/dist/assets/notification-schedule-field-DVnPcnI2.js +1 -0
- package/dist/assets/{player-overlays-B32sNiuW.js → player-overlays-BqM7cQxx.js} +1 -1
- package/dist/assets/{recycle-YQKD8v3i.js → recycle-CzMG7f6v.js} +1 -1
- package/dist/assets/remoteEntry-DIfLCm9V.js +1 -0
- package/dist/assets/{scan-eye-DkWYA8Qn.js → scan-eye-DV8G0O69.js} +1 -1
- package/dist/assets/{scissors-d-Q62-mJ.js → scissors-CXyYzi3_.js} +1 -1
- package/dist/assets/{search-x-Dh-cGhc7.js → search-x-D8hftA1U.js} +1 -1
- package/dist/assets/{send-CUvOOMzH.js → send-kdp5RlxT.js} +1 -1
- package/dist/assets/{settings-2-DOLBKbT-.js → settings-2-KSeFExfQ.js} +1 -1
- package/dist/assets/{speaker-GR-Ncblv.js → speaker-UjYWgc-l.js} +1 -1
- package/dist/assets/src-BGCK3zCb.js +67 -0
- package/dist/assets/{timer-reset-BSlB8Uty.js → timer-reset-BFiLVvIL.js} +1 -1
- package/dist/assets/{ungroup-DlVR3lck.js → ungroup-ZMQs0G6z.js} +1 -1
- package/dist/assets/{unlink-CNQUhGTn.js → unlink-pzv8jDBR.js} +1 -1
- package/dist/assets/{usb-Bek6n_7R.js → usb-DwKyPwkP.js} +1 -1
- package/dist/assets/{use-scenes-feed-B5lkOh6K.js → use-scenes-feed-DBhnjGJG.js} +1 -1
- package/dist/assets/{use-stationary-objects-DcNBr8az.js → use-stationary-objects-D2Hh0fkb.js} +1 -1
- package/dist/assets/useEventInvalidation-BSSsMgr9.js +1 -0
- package/dist/assets/{useNodeUrlSelection-B_2G0aCz.js → useNodeUrlSelection-Bk5QjgEc.js} +1 -1
- package/dist/assets/user-round-pGZtSaR6.js +1 -0
- package/dist/assets/{user-x-B4ynO2HW.js → user-x-B3X1pnMb.js} +1 -1
- package/dist/assets/{video-JAYMKNkG.js → video-B8eQiZoX.js} +1 -1
- package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-CtfHjgyV.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-DMzkBEt2.js} +2 -2
- package/dist/index.html +10 -10
- package/dist/server/addon.js +238 -62
- package/package.json +1 -1
- package/dist/assets/Addons-mfE0p6y4.js +0 -4
- package/dist/assets/AiProfiles-WzO8Mbp9.js +0 -3
- package/dist/assets/Build-gisiJOdI.js +0 -40
- package/dist/assets/CompositionEditor-B770POCv.js +0 -1
- package/dist/assets/Data-BcGxQTEl.js +0 -2
- package/dist/assets/DeviceDetail-MkF3jlfb.js +0 -2
- package/dist/assets/History-BMFlfHM1.js +0 -1
- package/dist/assets/Identity-D74hFuTL.js +0 -1
- package/dist/assets/IntegrationDetail-C9IZGb42.js +0 -1
- package/dist/assets/Integrations-Bgoh_y4o.js +0 -1
- package/dist/assets/Locations-g7yPFR-6.js +0 -3
- package/dist/assets/Notifications-tZY6d_g7.js +0 -1
- package/dist/assets/Recordings-bP0LvGaA.js +0 -1
- package/dist/assets/SessionsList-a4aqqlT4.js +0 -2
- package/dist/assets/circle-slash-CXSKoFJ3.js +0 -1
- package/dist/assets/client-CBY2Ai10.js +0 -358
- package/dist/assets/crop-CZVwalbq.js +0 -1
- package/dist/assets/device-picker-model-Ddb9lQrU.js +0 -1
- package/dist/assets/dist-ucVPOol3.js +0 -358
- package/dist/assets/i18n-DBncQ6jl.js +0 -1
- package/dist/assets/mount-Ddb9lQrU.js +0 -1
- package/dist/assets/notification-schedule-field-ByXlUo9C.js +0 -1
- package/dist/assets/remoteEntry-BcXI2cRC.js +0 -1
- package/dist/assets/src-DJjQpGxf.js +0 -67
- package/dist/assets/useEventInvalidation-Ddb9lQrU.js +0 -1
- package/dist/assets/user-round-CtzL736C.js +0 -1
package/dist/server/addon.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import { fileURLToPath } from "node:url";
|
|
3
|
-
//#region ../types/dist/event-category-
|
|
3
|
+
//#region ../types/dist/event-category-BfJwUd2S.mjs
|
|
4
4
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
5
5
|
EventCategory["SystemBoot"] = "system.boot";
|
|
6
6
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -317,6 +317,15 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
317
317
|
*/
|
|
318
318
|
EventCategory["PipelineDetectionBlind"] = "pipeline.detection-blind";
|
|
319
319
|
/**
|
|
320
|
+
* A camera's motion source has fired constantly with no subject for an hour
|
|
321
|
+
* (motion duty or session count over the bar, zero detections) — it is not
|
|
322
|
+
* blind, its motion zones or sensitivity want tuning (D907). Paired with
|
|
323
|
+
* {@link PipelineMotionCalm}.
|
|
324
|
+
*/
|
|
325
|
+
EventCategory["PipelineMotionNoisy"] = "pipeline.motion-noisy";
|
|
326
|
+
/** The recovery edge of {@link PipelineMotionNoisy}: the motion fell back, or a detection arrived. */
|
|
327
|
+
EventCategory["PipelineMotionCalm"] = "pipeline.motion-calm";
|
|
328
|
+
/**
|
|
320
329
|
* Per-camera pipeline config was mutated by the orchestrator
|
|
321
330
|
* (3-level settings change via `setAgentAddonDefaults` /
|
|
322
331
|
* `setCameraStepToggle` / `setCameraPipelineForAgent` or a
|
|
@@ -688,6 +697,14 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
688
697
|
EventCategory["BackupRestored"] = "backup.restored";
|
|
689
698
|
EventCategory["NotificationDispatched"] = "notification.dispatched";
|
|
690
699
|
EventCategory["NotificationFailed"] = "notification.failed";
|
|
700
|
+
/**
|
|
701
|
+
* A notification rule that cannot work (D905): its stored row does not load,
|
|
702
|
+
* or it still names a device / delivery target the prune CONFIRMED deleted.
|
|
703
|
+
* One edge per rule per distinct set of reasons; never on an unanswered read.
|
|
704
|
+
*/
|
|
705
|
+
EventCategory["NotificationRuleBroken"] = "notification.rule-broken";
|
|
706
|
+
/** The clear of {@link NotificationRuleBroken}: the rule loads and names nothing deleted. */
|
|
707
|
+
EventCategory["NotificationRuleRepaired"] = "notification.rule-repaired";
|
|
691
708
|
EventCategory["DeviceUpdated"] = "device.updated";
|
|
692
709
|
/**
|
|
693
710
|
* Transport-level connectivity. Emitted by the device driver when
|
|
@@ -5415,7 +5432,7 @@ var ZodIssueCode = {
|
|
|
5415
5432
|
var ZodFirstPartyTypeKind;
|
|
5416
5433
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5417
5434
|
//#endregion
|
|
5418
|
-
//#region ../types/dist/sleep-
|
|
5435
|
+
//#region ../types/dist/sleep-DJFUfKvA.mjs
|
|
5419
5436
|
/**
|
|
5420
5437
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5421
5438
|
* window to float samples (D455).
|
|
@@ -7877,7 +7894,7 @@ var EntryDescriptorSchema = object({
|
|
|
7877
7894
|
/** JSON Schema of the entry body; `secret: true` marks a password field. */
|
|
7878
7895
|
fields: record(string(), unknown())
|
|
7879
7896
|
}).strict();
|
|
7880
|
-
/** What crosses the wire
|
|
7897
|
+
/** What crosses the wire from an addon: JSON only, no Zod. An unknown key is refused. */
|
|
7881
7898
|
var RecordKindDeclarationSchema = object({
|
|
7882
7899
|
database: _enum(RECORD_DATABASES).default("settings"),
|
|
7883
7900
|
class: _enum(RECORD_CLASSES),
|
|
@@ -7896,14 +7913,6 @@ var RecordKindDeclarationSchema = object({
|
|
|
7896
7913
|
secretPaths: array(string().min(1)).default([]),
|
|
7897
7914
|
/** The id key of each array that carries a secret (`{ headers: 'name' }`). */
|
|
7898
7915
|
secretArrayKeys: record(string(), string()).default({}),
|
|
7899
|
-
/**
|
|
7900
|
-
* RETIRED (D900): the legacy table a kind adopted from during the records
|
|
7901
|
-
* migration. Nothing declares it any more and nothing reads it; the schema
|
|
7902
|
-
* still ACCEPTS it because the catalog rows the migration wrote carry it
|
|
7903
|
-
* (an orphaned kind is never redeclared) and an addon built before the
|
|
7904
|
-
* removal still sends it. Never set it.
|
|
7905
|
-
*/
|
|
7906
|
-
adoptsFrom: string().min(1).optional(),
|
|
7907
7916
|
/** Kinds that must agree through `transact` sit in one file under one family name. */
|
|
7908
7917
|
transactFamily: string().min(1).optional(),
|
|
7909
7918
|
entry: EntryDescriptorSchema.optional()
|
|
@@ -12585,17 +12594,6 @@ object({
|
|
|
12585
12594
|
createdAt: number(),
|
|
12586
12595
|
updatedAt: number()
|
|
12587
12596
|
});
|
|
12588
|
-
object({
|
|
12589
|
-
id: string(),
|
|
12590
|
-
label: string(),
|
|
12591
|
-
isAdmin: boolean().default(false),
|
|
12592
|
-
allowedProviders: AllowedProviderSchema,
|
|
12593
|
-
allowedDevices: AllowedDevicesSchema,
|
|
12594
|
-
tokenHash: string(),
|
|
12595
|
-
tokenPrefix: string(),
|
|
12596
|
-
createdAt: number(),
|
|
12597
|
-
lastUsedAt: number().optional()
|
|
12598
|
-
});
|
|
12599
12597
|
object({
|
|
12600
12598
|
id: string(),
|
|
12601
12599
|
userId: string(),
|
|
@@ -16471,16 +16469,36 @@ var RecordKindStateSchema = _enum([
|
|
|
16471
16469
|
var DeclareKindResultSchema = object({
|
|
16472
16470
|
kindId: number().int(),
|
|
16473
16471
|
state: RecordKindStateSchema,
|
|
16474
|
-
createdIndexes: array(string())
|
|
16475
|
-
/**
|
|
16476
|
-
* RETIRED (D900): always `null`. It carried the records-migration boot guard;
|
|
16477
|
-
* it stays on the wire, null, because an addon built before the removal reads
|
|
16478
|
-
* an ABSENT field as "adoption pending" and refuses to start.
|
|
16479
|
-
*/
|
|
16480
|
-
adoptionPending: _null()
|
|
16472
|
+
createdIndexes: array(string())
|
|
16481
16473
|
});
|
|
16482
16474
|
/** Keychain refs a write released (the old marker is gone from the row): the owner deletes the values. */
|
|
16483
16475
|
var SecretRefsList = array(string());
|
|
16476
|
+
/**
|
|
16477
|
+
* One op of a `transact`: the single-row writes, each on a kind of the caller.
|
|
16478
|
+
* All ops of one call share ONE database file and ONE `transactFamily`.
|
|
16479
|
+
*/
|
|
16480
|
+
var RecordTransactOpSchema = discriminatedUnion("op", [
|
|
16481
|
+
object({
|
|
16482
|
+
op: literal("put"),
|
|
16483
|
+
kind: RecordKindNameSchema,
|
|
16484
|
+
record: RecordInputSchema,
|
|
16485
|
+
ifRev: number().int().min(0).optional()
|
|
16486
|
+
}),
|
|
16487
|
+
object({
|
|
16488
|
+
op: literal("patch"),
|
|
16489
|
+
kind: RecordKindNameSchema,
|
|
16490
|
+
id: RecordIdSchema,
|
|
16491
|
+
data: RecordBodySchema,
|
|
16492
|
+
at: number().int().nullable().optional(),
|
|
16493
|
+
expiresAt: number().int().nullable().optional(),
|
|
16494
|
+
ifRev: number().int().min(1).optional()
|
|
16495
|
+
}),
|
|
16496
|
+
object({
|
|
16497
|
+
op: literal("delete"),
|
|
16498
|
+
kind: RecordKindNameSchema,
|
|
16499
|
+
id: RecordIdSchema
|
|
16500
|
+
})
|
|
16501
|
+
]);
|
|
16484
16502
|
var RecordSecretRefsSchema = record(string(), record(string(), string()));
|
|
16485
16503
|
method(object({ kinds: record(RecordKindNameSchema, RecordKindDeclarationSchema) }), object({ kinds: record(string(), DeclareKindResultSchema) }), {
|
|
16486
16504
|
kind: "mutation",
|
|
@@ -16587,6 +16605,16 @@ method(object({ kinds: record(RecordKindNameSchema, RecordKindDeclarationSchema)
|
|
|
16587
16605
|
}), {
|
|
16588
16606
|
kind: "mutation",
|
|
16589
16607
|
auth: "admin"
|
|
16608
|
+
}), method(object({ ops: array(RecordTransactOpSchema).min(1).max(RECORD_BATCH_MAX) }), object({
|
|
16609
|
+
results: array(object({
|
|
16610
|
+
rev: number().int().nullable(),
|
|
16611
|
+
deleted: boolean()
|
|
16612
|
+
})),
|
|
16613
|
+
releasedRefs: SecretRefsList,
|
|
16614
|
+
secretRefs: SecretRefsList
|
|
16615
|
+
}), {
|
|
16616
|
+
kind: "mutation",
|
|
16617
|
+
auth: "admin"
|
|
16590
16618
|
}), method(object({
|
|
16591
16619
|
deviceId: number().int(),
|
|
16592
16620
|
kinds: array(RecordKindNameSchema).optional()
|
|
@@ -41945,9 +41973,13 @@ var NcSystemEventKindSchema = _enum([
|
|
|
41945
41973
|
"node-updating",
|
|
41946
41974
|
"node-inference-unavailable",
|
|
41947
41975
|
"detection-blind",
|
|
41976
|
+
"motion-noisy",
|
|
41977
|
+
"motion-calm",
|
|
41948
41978
|
"recording-stalled",
|
|
41949
41979
|
"recording-healthy",
|
|
41950
41980
|
"recording-degraded",
|
|
41981
|
+
"device-attention-required",
|
|
41982
|
+
"device-attention-resolved",
|
|
41951
41983
|
"storage-location-low",
|
|
41952
41984
|
"storage-location-critical",
|
|
41953
41985
|
"storage-location-ok",
|
|
@@ -41971,6 +42003,8 @@ var NcSystemEventKindSchema = _enum([
|
|
|
41971
42003
|
"alert-critical",
|
|
41972
42004
|
"alert-error",
|
|
41973
42005
|
"alert-critical-resolved",
|
|
42006
|
+
"rule-broken",
|
|
42007
|
+
"rule-repaired",
|
|
41974
42008
|
"camera-online",
|
|
41975
42009
|
"camera-offline",
|
|
41976
42010
|
"camera-disabled",
|
|
@@ -54402,6 +54436,16 @@ object({
|
|
|
54402
54436
|
powerState: string().nullable(),
|
|
54403
54437
|
saltLevel: DishwasherConsumableLevelSchema.nullable(),
|
|
54404
54438
|
rinseAidLevel: DishwasherConsumableLevelSchema.nullable(),
|
|
54439
|
+
/**
|
|
54440
|
+
* True while the appliance asks for its filter to be cleaned (smart-filter, filter-system or
|
|
54441
|
+
* combined care-and-filter reminder raised); false when every such reminder reads clear; null
|
|
54442
|
+
* when none is reported. A cleared reminder is not an unknown one.
|
|
54443
|
+
*/
|
|
54444
|
+
filterCleaningDue: boolean().nullable(),
|
|
54445
|
+
/** True while the machine-care (descaling / cleaning-program) reminder is raised; false when clear; null when not reported. */
|
|
54446
|
+
machineCareDue: boolean().nullable(),
|
|
54447
|
+
/** Program runs left before the machine-care reminder is due; null when the appliance does not say. */
|
|
54448
|
+
machineCareRemainingRuns: number().int().nonnegative().nullable(),
|
|
54405
54449
|
/** Option states: null when the appliance does not expose the option or has not said. */
|
|
54406
54450
|
halfLoad: boolean().nullable(),
|
|
54407
54451
|
hygienePlus: boolean().nullable(),
|
|
@@ -61019,16 +61063,6 @@ var UpdateUserInputSchema = object({
|
|
|
61019
61063
|
allowedDevices: record(string(), union([array(string()), literal("*")])).optional(),
|
|
61020
61064
|
scopes: array(TokenScopeSchema).optional()
|
|
61021
61065
|
});
|
|
61022
|
-
var ApiKeySummarySchema = object({
|
|
61023
|
-
id: string(),
|
|
61024
|
-
label: string(),
|
|
61025
|
-
isAdmin: boolean().default(false),
|
|
61026
|
-
allowedProviders: union([array(string()), literal("*")]).optional(),
|
|
61027
|
-
allowedDevices: record(string(), union([array(string()), literal("*")])).optional(),
|
|
61028
|
-
tokenPrefix: string(),
|
|
61029
|
-
createdAt: number(),
|
|
61030
|
-
lastUsedAt: number().optional()
|
|
61031
|
-
});
|
|
61032
61066
|
var OauthSessionSummarySchema = object({
|
|
61033
61067
|
id: string(),
|
|
61034
61068
|
userId: string(),
|
|
@@ -61050,8 +61084,7 @@ var TotpStatusSchema = object({
|
|
|
61050
61084
|
confirmedAt: number().nullable()
|
|
61051
61085
|
});
|
|
61052
61086
|
/**
|
|
61053
|
-
* user-management — singleton capability for user accounts
|
|
61054
|
-
* legacy API-key rows.
|
|
61087
|
+
* user-management — singleton capability for user accounts.
|
|
61055
61088
|
*
|
|
61056
61089
|
* v2 model: every method gated by `auth: 'admin'`. Admin-only delegation
|
|
61057
61090
|
* — the subset check on `setUserScopes` is moot
|
|
@@ -61107,10 +61140,6 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
|
|
|
61107
61140
|
}), UserSummarySchema.extend({ passwordHash: string() }).nullable(), {
|
|
61108
61141
|
kind: "mutation",
|
|
61109
61142
|
access: "view"
|
|
61110
|
-
}), method(_void(), array(ApiKeySummarySchema), { auth: "admin" }), method(object({ id: string() }), object({ success: literal(true) }), {
|
|
61111
|
-
kind: "mutation",
|
|
61112
|
-
auth: "admin",
|
|
61113
|
-
access: "delete"
|
|
61114
61143
|
}), method(object({ userId: string() }), TotpSetupResultSchema, {
|
|
61115
61144
|
kind: "mutation",
|
|
61116
61145
|
auth: "admin",
|
|
@@ -68623,6 +68652,12 @@ Object.freeze({
|
|
|
68623
68652
|
addonId: null,
|
|
68624
68653
|
access: "view"
|
|
68625
68654
|
},
|
|
68655
|
+
"records.transact": {
|
|
68656
|
+
capName: "records",
|
|
68657
|
+
capScope: "system",
|
|
68658
|
+
addonId: null,
|
|
68659
|
+
access: "create"
|
|
68660
|
+
},
|
|
68626
68661
|
"sceneMonitor.captureReference": {
|
|
68627
68662
|
capName: "scene-monitor",
|
|
68628
68663
|
capScope: "device",
|
|
@@ -69955,12 +69990,6 @@ Object.freeze({
|
|
|
69955
69990
|
addonId: null,
|
|
69956
69991
|
access: "view"
|
|
69957
69992
|
},
|
|
69958
|
-
"userManagement.listApiKeys": {
|
|
69959
|
-
capName: "user-management",
|
|
69960
|
-
capScope: "system",
|
|
69961
|
-
addonId: null,
|
|
69962
|
-
access: "view"
|
|
69963
|
-
},
|
|
69964
69993
|
"userManagement.listExternalIdentities": {
|
|
69965
69994
|
capName: "user-management",
|
|
69966
69995
|
capScope: "system",
|
|
@@ -70015,12 +70044,6 @@ Object.freeze({
|
|
|
70015
70044
|
addonId: null,
|
|
70016
70045
|
access: "create"
|
|
70017
70046
|
},
|
|
70018
|
-
"userManagement.revokeApiKey": {
|
|
70019
|
-
capName: "user-management",
|
|
70020
|
-
capScope: "system",
|
|
70021
|
-
addonId: null,
|
|
70022
|
-
access: "delete"
|
|
70023
|
-
},
|
|
70024
70047
|
"userManagement.revokeOauthSession": {
|
|
70025
70048
|
capName: "user-management",
|
|
70026
70049
|
capScope: "system",
|
|
@@ -73385,9 +73408,13 @@ new Map(Object.entries({
|
|
|
73385
73408
|
"stream-online": "device-events",
|
|
73386
73409
|
"stream-offline": "device-events",
|
|
73387
73410
|
"detection-blind": "device-events",
|
|
73411
|
+
"motion-noisy": "device-events",
|
|
73412
|
+
"motion-calm": "device-events",
|
|
73388
73413
|
"recording-stalled": "device-events",
|
|
73389
73414
|
"recording-healthy": "device-events",
|
|
73390
73415
|
"recording-degraded": "device-events",
|
|
73416
|
+
"device-attention-required": "device-events",
|
|
73417
|
+
"device-attention-resolved": "device-events",
|
|
73391
73418
|
"node-online": "system",
|
|
73392
73419
|
"node-offline": "system",
|
|
73393
73420
|
"node-restarting": "system",
|
|
@@ -73404,6 +73431,8 @@ new Map(Object.entries({
|
|
|
73404
73431
|
"alert-critical": "system",
|
|
73405
73432
|
"alert-error": "system",
|
|
73406
73433
|
"alert-critical-resolved": "system",
|
|
73434
|
+
"rule-broken": "system",
|
|
73435
|
+
"rule-repaired": "system",
|
|
73407
73436
|
"storage-location-low": "system",
|
|
73408
73437
|
"storage-location-critical": "system",
|
|
73409
73438
|
"storage-location-ok": "system",
|
|
@@ -73468,6 +73497,12 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
|
|
|
73468
73497
|
label: "Detecting nothing",
|
|
73469
73498
|
kinds: ["detection-blind"]
|
|
73470
73499
|
},
|
|
73500
|
+
{
|
|
73501
|
+
id: "motion-noise",
|
|
73502
|
+
family: "device-events",
|
|
73503
|
+
label: "Motion without a subject",
|
|
73504
|
+
kinds: ["motion-noisy", "motion-calm"]
|
|
73505
|
+
},
|
|
73471
73506
|
{
|
|
73472
73507
|
id: "recording",
|
|
73473
73508
|
family: "device-events",
|
|
@@ -73478,6 +73513,12 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
|
|
|
73478
73513
|
"recording-degraded"
|
|
73479
73514
|
]
|
|
73480
73515
|
},
|
|
73516
|
+
{
|
|
73517
|
+
id: "device-attention",
|
|
73518
|
+
family: "device-events",
|
|
73519
|
+
label: "Needs attention",
|
|
73520
|
+
kinds: ["device-attention-required", "device-attention-resolved"]
|
|
73521
|
+
},
|
|
73481
73522
|
{
|
|
73482
73523
|
id: "nodes",
|
|
73483
73524
|
family: "system",
|
|
@@ -73538,6 +73579,12 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
|
|
|
73538
73579
|
"alert-critical-resolved"
|
|
73539
73580
|
]
|
|
73540
73581
|
},
|
|
73582
|
+
{
|
|
73583
|
+
id: "rule-health",
|
|
73584
|
+
family: "system",
|
|
73585
|
+
label: "Notification rules",
|
|
73586
|
+
kinds: ["rule-broken", "rule-repaired"]
|
|
73587
|
+
},
|
|
73541
73588
|
{
|
|
73542
73589
|
id: "alarm",
|
|
73543
73590
|
family: "alarm",
|
|
@@ -73611,6 +73658,7 @@ var ALERT_EPISODE = [
|
|
|
73611
73658
|
"alert-error",
|
|
73612
73659
|
"alert-critical-resolved"
|
|
73613
73660
|
];
|
|
73661
|
+
var DEVICE_ATTENTION = ["device-attention-required", "device-attention-resolved"];
|
|
73614
73662
|
var UPDATES = [
|
|
73615
73663
|
"addon-update-available",
|
|
73616
73664
|
"server-update-available",
|
|
@@ -73640,9 +73688,12 @@ var DEVICE_EVENTS = [
|
|
|
73640
73688
|
"stream-online",
|
|
73641
73689
|
"stream-offline",
|
|
73642
73690
|
"detection-blind",
|
|
73691
|
+
"motion-noisy",
|
|
73692
|
+
"motion-calm",
|
|
73643
73693
|
"recording-stalled",
|
|
73644
73694
|
"recording-healthy",
|
|
73645
73695
|
"recording-degraded",
|
|
73696
|
+
...DEVICE_ATTENTION,
|
|
73646
73697
|
...ALARM
|
|
73647
73698
|
];
|
|
73648
73699
|
/** Every kind a summary may speak about — the two summarisable families. */
|
|
@@ -73810,7 +73861,13 @@ var STATE_SUMMARY_VARS = [
|
|
|
73810
73861
|
[...RULE_TEXT],
|
|
73811
73862
|
[...RULE_TEXT],
|
|
73812
73863
|
[...RULE_TEXT],
|
|
73813
|
-
|
|
73864
|
+
[...RULE_TEXT],
|
|
73865
|
+
[...RULE_TEXT],
|
|
73866
|
+
([...RULE_TEXT], [...DEVICE_ATTENTION, ...ALERT_EPISODE]),
|
|
73867
|
+
[...RULE_TEXT],
|
|
73868
|
+
[...RULE_TEXT],
|
|
73869
|
+
[...RULE_TEXT],
|
|
73870
|
+
[...RULE_TEXT],
|
|
73814
73871
|
[...RULE_TEXT],
|
|
73815
73872
|
[...RULE_TEXT],
|
|
73816
73873
|
[...RULE_TEXT],
|
|
@@ -73828,11 +73885,11 @@ var STATE_SUMMARY_VARS = [
|
|
|
73828
73885
|
[...RULE_TEXT],
|
|
73829
73886
|
[...RULE_TEXT],
|
|
73830
73887
|
[...RULE_TEXT],
|
|
73888
|
+
([...RULE_TEXT], [...DEVICE_ATTENTION, ...ALERT_EPISODE]),
|
|
73831
73889
|
([...RULE_TEXT], [...ALERT_EPISODE]),
|
|
73890
|
+
([...RULE_TEXT], [...DEVICE_ATTENTION, ...ALERT_EPISODE]),
|
|
73832
73891
|
([...RULE_TEXT], [...ALERT_EPISODE]),
|
|
73833
|
-
([...RULE_TEXT], [...ALERT_EPISODE]),
|
|
73834
|
-
([...RULE_TEXT], [...ALERT_EPISODE]),
|
|
73835
|
-
([...RULE_TEXT], [...ALERT_EPISODE]),
|
|
73892
|
+
([...RULE_TEXT], [...DEVICE_ATTENTION, ...ALERT_EPISODE]),
|
|
73836
73893
|
[...RULE_TEXT],
|
|
73837
73894
|
[...RULE_TEXT],
|
|
73838
73895
|
[...RULE_TEXT],
|
|
@@ -73853,6 +73910,125 @@ var STATE_SUMMARY_VARS = [
|
|
|
73853
73910
|
[...RULE_TEXT],
|
|
73854
73911
|
...STATE_SUMMARY_VARS
|
|
73855
73912
|
];
|
|
73913
|
+
new Map([
|
|
73914
|
+
{
|
|
73915
|
+
id: "device-connectivity",
|
|
73916
|
+
family: "device-events",
|
|
73917
|
+
label: "Device connectivity (offline / back online)",
|
|
73918
|
+
bad: ["device-offline"],
|
|
73919
|
+
recovery: ["device-online"],
|
|
73920
|
+
snapshotLabel: "Devices offline now",
|
|
73921
|
+
snapshotSection: "device-state"
|
|
73922
|
+
},
|
|
73923
|
+
{
|
|
73924
|
+
id: "device-switch",
|
|
73925
|
+
family: "device-events",
|
|
73926
|
+
label: "Device switched off / back on",
|
|
73927
|
+
bad: ["device-disabled"],
|
|
73928
|
+
recovery: ["device-enabled"],
|
|
73929
|
+
snapshotLabel: "Devices switched off now",
|
|
73930
|
+
snapshotSection: "device-state"
|
|
73931
|
+
},
|
|
73932
|
+
{
|
|
73933
|
+
id: "stream-connectivity",
|
|
73934
|
+
family: "device-events",
|
|
73935
|
+
label: "Stream connectivity (offline / back online)",
|
|
73936
|
+
bad: ["stream-offline"],
|
|
73937
|
+
recovery: ["stream-online"],
|
|
73938
|
+
snapshotLabel: "Streams offline now",
|
|
73939
|
+
snapshotSection: "streams"
|
|
73940
|
+
},
|
|
73941
|
+
{
|
|
73942
|
+
id: "battery",
|
|
73943
|
+
family: "device-events",
|
|
73944
|
+
label: "Battery (low / back to normal)",
|
|
73945
|
+
bad: ["device-battery-low"],
|
|
73946
|
+
recovery: ["device-battery-normal"],
|
|
73947
|
+
snapshotLabel: "Batteries low now",
|
|
73948
|
+
snapshotSection: "battery"
|
|
73949
|
+
},
|
|
73950
|
+
{
|
|
73951
|
+
id: "consumables",
|
|
73952
|
+
family: "device-events",
|
|
73953
|
+
label: "Consumables (low / replaced)",
|
|
73954
|
+
bad: ["device-consumable-low"],
|
|
73955
|
+
recovery: ["device-consumable-normal"],
|
|
73956
|
+
snapshotLabel: "Consumables low now",
|
|
73957
|
+
snapshotSection: "consumables"
|
|
73958
|
+
},
|
|
73959
|
+
{
|
|
73960
|
+
id: "tanks",
|
|
73961
|
+
family: "device-events",
|
|
73962
|
+
label: "Tanks (low or full / back to normal)",
|
|
73963
|
+
bad: ["device-tank-low", "device-tank-full"],
|
|
73964
|
+
recovery: ["device-tank-normal"],
|
|
73965
|
+
snapshotLabel: "Tanks low or full now",
|
|
73966
|
+
snapshotSection: "tanks"
|
|
73967
|
+
},
|
|
73968
|
+
{
|
|
73969
|
+
id: "motion-noise",
|
|
73970
|
+
family: "device-events",
|
|
73971
|
+
label: "Motion without a subject (constant / calm again)",
|
|
73972
|
+
bad: ["motion-noisy"],
|
|
73973
|
+
recovery: ["motion-calm"],
|
|
73974
|
+
snapshotLabel: "Cameras with constant motion now",
|
|
73975
|
+
snapshotSection: null
|
|
73976
|
+
},
|
|
73977
|
+
{
|
|
73978
|
+
id: "recording-health",
|
|
73979
|
+
family: "device-events",
|
|
73980
|
+
label: "Recording health (stalled or degraded / recording again)",
|
|
73981
|
+
bad: ["recording-stalled", "recording-degraded"],
|
|
73982
|
+
recovery: ["recording-healthy"],
|
|
73983
|
+
snapshotLabel: "Recordings stalled now",
|
|
73984
|
+
snapshotSection: null
|
|
73985
|
+
},
|
|
73986
|
+
{
|
|
73987
|
+
id: "device-attention",
|
|
73988
|
+
family: "device-events",
|
|
73989
|
+
label: "Device needs attention (raised / resolved)",
|
|
73990
|
+
bad: ["device-attention-required"],
|
|
73991
|
+
recovery: ["device-attention-resolved"],
|
|
73992
|
+
snapshotLabel: "Devices needing attention now",
|
|
73993
|
+
snapshotSection: null
|
|
73994
|
+
},
|
|
73995
|
+
{
|
|
73996
|
+
id: "node-connectivity",
|
|
73997
|
+
family: "system",
|
|
73998
|
+
label: "Node connectivity (offline / back online)",
|
|
73999
|
+
bad: ["node-offline"],
|
|
74000
|
+
recovery: ["node-online"],
|
|
74001
|
+
snapshotLabel: "Nodes offline now",
|
|
74002
|
+
snapshotSection: "nodes"
|
|
74003
|
+
},
|
|
74004
|
+
{
|
|
74005
|
+
id: "storage-space",
|
|
74006
|
+
family: "system",
|
|
74007
|
+
label: "Storage space (low or critical / ok again)",
|
|
74008
|
+
bad: ["storage-location-low", "storage-location-critical"],
|
|
74009
|
+
recovery: ["storage-location-ok"],
|
|
74010
|
+
snapshotLabel: "Storage locations low now",
|
|
74011
|
+
snapshotSection: null
|
|
74012
|
+
},
|
|
74013
|
+
{
|
|
74014
|
+
id: "critical-alerts",
|
|
74015
|
+
family: "system",
|
|
74016
|
+
label: "Critical alerts (raised / resolved)",
|
|
74017
|
+
bad: ["alert-critical"],
|
|
74018
|
+
recovery: ["alert-critical-resolved"],
|
|
74019
|
+
snapshotLabel: "Critical alerts open now",
|
|
74020
|
+
snapshotSection: null
|
|
74021
|
+
},
|
|
74022
|
+
{
|
|
74023
|
+
id: "rule-health",
|
|
74024
|
+
family: "system",
|
|
74025
|
+
label: "Rule health (broken / repaired)",
|
|
74026
|
+
bad: ["rule-broken"],
|
|
74027
|
+
recovery: ["rule-repaired"],
|
|
74028
|
+
snapshotLabel: "Notification rules broken now",
|
|
74029
|
+
snapshotSection: null
|
|
74030
|
+
}
|
|
74031
|
+
].flatMap((spec) => [...spec.bad, ...spec.recovery].map((kind) => [kind, spec])));
|
|
73856
74032
|
new Set([
|
|
73857
74033
|
"disarmed",
|
|
73858
74034
|
"armed_home",
|
|
@@ -74391,7 +74567,7 @@ var AdminUIAddon = class extends BaseAddon {
|
|
|
74391
74567
|
capability: adminUiCapability,
|
|
74392
74568
|
provider: {
|
|
74393
74569
|
getStaticDir: async () => ({ staticDir: resolveAdminUiDistDir() }),
|
|
74394
|
-
getVersion: async () => ({ version: "1.2.
|
|
74570
|
+
getVersion: async () => ({ version: "1.2.452" })
|
|
74395
74571
|
}
|
|
74396
74572
|
}];
|
|
74397
74573
|
}
|
package/package.json
CHANGED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{$ as e,B as t,G as n,J as r,L as i,S as a,b as o,o as s,q as c,x as l,z as u}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CEHpkaJP.js";import{Ci as d,Gr as f,It as p,Nt as m,Ot as h,Q as g,Rn as _,Si as v,Tn as y,bn as b,dt as x,fn as S,kn as C,mi as w,oi as T,or as E,pn as D,tn as ee,un as te,yi as ne}from"./player-overlays-B32sNiuW.js";import{Ji as re}from"./client-CBY2Ai10.js";import{i as ie,l as ae}from"./video-JAYMKNkG.js";import{$n as oe,Ar as O,Ms as se,Mu as ce,Qn as le,Qr as k,Rr as A,Tt as ue,Xt as de,Xu as j,Zt as M,_i as fe,ai as pe,bi as N,ci as P,di as F,ei as I,er as L,fi as R,gi as me,hi as z,hr as he,ht as B,ii as ge,ir as _e,kr as V,li as H,mi as ve,ni as U,nr as ye,oi as W,qu as G,ri as be,rr as xe,ti as K,ui as Se,xi as Ce,yi as q}from"./src-DJjQpGxf.js";import{t as J}from"./useTranslation-D3Is_4B6.js";import"./mount-Ddb9lQrU.js";import{Z as Y,et as X,nt as we}from"./index-Cwd2LIJa.js";import{t as Z}from"./AdminPage-gZharu2-.js";import{t as Te}from"./NodeAddonsSettingsPanel-ClIL1TnJ.js";import{n as Q,t as Ee}from"./useNodeUrlSelection-B_2G0aCz.js";function De(e){if(e===void 0)return null;switch(e.state){case`failed`:case`refused`:case`missing`:case`crashed`:return{kind:e.state,...e.reason===void 0?{}:{reason:e.reason}};default:return null}}e();var Oe={queued:{icon:T,bg:`bg-muted text-foreground-subtle`,labelKey:`addons.addonRowBadge.queued`},updating:{icon:E,bg:`bg-primary/10 text-primary`,labelKey:`addons.addonRowBadge.updating`,spin:!0},"done-pending-restart":{icon:b,bg:`bg-amber-500/10 text-amber-700`,labelKey:`addons.addonRowBadge.pendingRestart`},done:{icon:d,bg:`bg-success/10 text-success`,labelKey:`addons.addonRowBadge.done`},failed:{icon:ie,bg:`bg-danger/10 text-danger`,labelKey:`addons.addonRowBadge.failed`}};function ke({item:e}){let{t}=J(),n=Oe[e.status],r=n.icon;return a(`span`,{className:`inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] rounded ${n.bg}`,title:e.error,children:[l(r,{className:`w-2.5 h-2.5 ${n.spin?`animate-spin`:``}`}),t(n.labelKey)]})}var Ae=new Set([`completed`,`failed`,`partially-failed`,`cancelled`]),je=new Set([`done`,`failed`,`skipped`]);function Me(e){return!je.has(e.phase)&&!Ae.has(e.jobState)}function Ne(e,t){let n=new Map,r=[...e].sort((e,t)=>e.createdAtMs-t.createdAtMs);for(let e of r){let r=Ae.has(e.state);for(let i of e.tasks)r&&i.finishedAtMs!==null&&t-i.finishedAtMs>6e4||n.set(i.packageName,{jobId:e.jobId,packageName:i.packageName,phase:i.phase,fromVersion:i.fromVersion,toVersion:i.toVersion,error:i.error,jobState:e.state,finishedAtMs:i.finishedAtMs})}return n}function Pe(){let{data:e}=H({activeOnly:!0},{refetchOnWindowFocus:!1,refetchInterval:e=>(e.state.data?.length??0)>0?3e3:!1}),{map:t}=j(re.AddonsJobProgress,e=>e.job.jobId);return n(()=>{let n=new Map;for(let t of e??[])n.set(t.jobId,t);for(let[e,r]of t)n.set(e,r.job);return Ne([...n.values()],Date.now())},[e,t])}var Fe={queued:{icon:T,cls:`bg-muted text-foreground-subtle`,labelKey:`addons.jobProgress.queued`},fetching:{icon:E,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.fetching`,spin:!0},staged:{icon:E,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.staged`,spin:!0},validating:{icon:E,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.validating`,spin:!0},applying:{icon:E,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.applying`,spin:!0},restarting:{icon:E,cls:`bg-amber-500/10 text-amber-600 dark:text-amber-400`,labelKey:`addons.jobProgress.restarting`,spin:!0},applied:{icon:E,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.finalizing`,spin:!0},done:{icon:d,cls:`bg-success/10 text-success`,labelKey:`addons.jobProgress.updated`},failed:{icon:ie,cls:`bg-danger/10 text-danger`,labelKey:`addons.jobProgress.failed`},skipped:{icon:ee,cls:`bg-muted text-foreground-subtle`,labelKey:`addons.jobProgress.skipped`}};function Ie({progress:e}){let{t}=J(),n=Fe[e.phase],r=n.icon,i=e.error??`${e.packageName}: ${e.fromVersion??`?`} → ${e.toVersion}`;return a(`span`,{"data-testid":`addon-job-progress`,className:`inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] rounded shrink-0 ${n.cls}`,title:i,children:[l(r,{className:`w-2.5 h-2.5 ${n.spin?`animate-spin`:``}`}),t(n.labelKey),a(`span`,{className:`font-mono`,children:[`→ `,e.toVersion]})]})}function Le(e,t){return e.filter(e=>e.packageName===t).slice().sort((e,t)=>e.isHub===t.isHub?e.nodeName.localeCompare(t.nodeName):e.isHub?-1:1)}function Re(e){let t=e.version===null?``:` ${e.version}`,n=e.isOnline?``:` (offline: removed when it reconnects)`;return`- ${e.nodeName}${t}${n}`}function ze(e,t,n){let r=[`${e} will be uninstalled from ${t.length} node(s). Its runners stop, its capabilities are deregistered and its code is deleted:`,...t.map(Re)];return n.length>0&&r.push(`Could not ask: ${n.join(`, `)} — not included.`),r.push(`This cannot be undone.`),r.join(`
|
|
2
|
-
`)}function Be(e,t,n){let r=[`${e} will be uninstalled from ${t}: its runners stop and its code is deleted.`];return n.length>0&&r.push(`It stays installed on: ${n.map(e=>e.nodeName).join(`, `)}. Use "Everywhere" to remove it from every node.`),r.push(`This cannot be undone.`),r.join(`
|
|
3
|
-
`)}var Ve={uninstalled:`uninstalled`,"not-installed":`was not installed`,refused:`REFUSED`,failed:`FAILED`,"pending-reconnect":`offline — removed when it reconnects`};function He(e,t){let n=[];for(let r of e.results){let e=r.runnersStopped.length>0?` (stopped ${r.runnersStopped.join(`, `)})`:``;n.push(`${t(r.nodeId)}: ${Ve[r.outcome]}${e}`),r.error!==void 0&&n.push(` ${r.error}`);for(let e of r.warnings)n.push(` ${e}`)}return n.join(`
|
|
4
|
-
`)}var Ue={},We=3e4,Ge=`inline-flex items-center gap-1 rounded-md px-2 py-1 text-[10px] font-medium border border-border text-foreground-subtle hover:text-red-400 hover:border-red-500/30 hover:bg-red-500/10 disabled:opacity-50 transition-colors`;function Ke({packageName:e,displayName:t,selectedNode:n,hideNodeAction:r,disabled:i}){let{t:o}=J(),c=s(),u=O(),d=V(),f=P(Ue,{staleTime:We}),m=f.data?.installations??[],h=(f.data?.unreachable??[]).map(e=>e.nodeId),g=Le(m,e),_=e=>g.find(t=>t.nodeId===e)?.nodeName??(e===n.id?n.name:e),v=N({onSettled:()=>{c.invalidateQueries({queryKey:[[`addons`]]}),c.invalidateQueries({queryKey:[[`addonPages`]]}),c.invalidateQueries({queryKey:[[`capabilities`]]}),c.invalidateQueries({queryKey:[[`nodes`]]})}}),y=async e=>{await d({title:e.success?o(`addons.addonUninstallControls.uninstalled`,`{{displayName}} uninstalled`,{displayName:t}):o(`addons.addonUninstallControls.notEveryNodeWasCleaned`,`{{displayName}}: not every node was cleaned`,{displayName:t}),message:He(e,_),variant:e.success?`default`:`danger`})},b=async n=>{try{await y(await v.mutateAsync({packageName:e,...n}))}catch(e){await d({title:o(`addons.addonUninstallControls.uninstallFailed`,`Uninstall {{displayName}} failed`,{displayName:t}),message:e instanceof Error?e.message:String(e),variant:`danger`})}},x=async()=>{let e=g.filter(e=>e.nodeId!==n.id);await u({title:o(`addons.addonUninstallControls.uninstallFrom`,`Uninstall {{displayName}} from {{name}}?`,{displayName:t,name:n.name}),message:Be(t,n.name,e),confirmLabel:o(`addons.addonUninstallControls.uninstall`,`Uninstall`),variant:`danger`})&&await b(n.isHub?{}:{nodeId:n.id})},S=async()=>{let n=(await f.refetch()).data;if(n===void 0){await d({title:o(`addons.addonUninstallControls.cannotListTheNodes`,`Cannot list the nodes`),message:o(`addons.addonUninstallControls.theHubDidNotAnswer`,`The hub did not answer which nodes have this package — nothing was removed.`),variant:`danger`});return}let r=Le(n.installations,e);await u({title:o(`addons.addonUninstallControls.uninstallEverywhere`,`Uninstall {{displayName}} everywhere?`,{displayName:t}),message:ze(t,r,n.unreachable.map(e=>e.nodeId)),confirmLabel:o(`addons.addonUninstallControls.uninstallFromNodeS`,`Uninstall from {{length}} node(s)`,{length:r.length}),variant:`danger`})&&await b({everywhere:!0})},C=v.isPending||i===!0;return a(`div`,{className:`flex items-center gap-1.5`,children:[r!==!0&&a(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),x()},disabled:C,className:Ge,title:o(`addons.addonUninstallControls.uninstallFrom2`,`Uninstall from {{name}}`,{name:n.name}),children:[l(p,{className:`h-3 w-3`}),v.isPending?o(`addons.addonUninstallControls.removing`,`Removing...`):o(`addons.addonUninstallControls.uninstall`,`Uninstall`)]}),(g.length>1||r===!0||h.length>0)&&a(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),S()},disabled:C,className:Ge,title:o(`addons.addonUninstallControls.uninstallFromEveryNodeThat`,`Uninstall from every node that has it`),children:[l(ae,{className:`h-3 w-3`}),g.length>0?o(`addons.uninstallControls.everywhereCount`,{count:g.length}):o(`addons.uninstallControls.everywhere`)]})]})}function qe({packageName:e,currentVersion:t,installSource:n,onInstall:r,onClose:i,onSelect:s,selectedVersion:c}){let{t:u}=J(),p=n===`upload`||n===`local`,{data:m,isLoading:g}=ge({name:e});return a(`div`,{className:`fixed z-50 w-72 rounded-lg border border-border bg-surface shadow-xl overflow-hidden`,style:{top:`auto`,bottom:`auto`},ref:e=>{if(!e)return;let t=e.parentElement?.getBoundingClientRect();if(!t)return;let n=window.innerHeight-t.bottom,r=t.top;n<280&&r>n?(e.style.bottom=`${window.innerHeight-t.top+4}px`,e.style.top=`auto`):(e.style.top=`${t.bottom+4}px`,e.style.bottom=`auto`),e.style.right=`${window.innerWidth-t.right}px`},onClick:e=>e.stopPropagation(),children:[a(`div`,{className:`flex items-center justify-between px-3 py-2 border-b border-border`,children:[l(`span`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle font-medium`,children:u(`addons.versionPicker.versions`,`Versions`)}),l(`button`,{type:`button`,onClick:i,className:`text-foreground-subtle hover:text-foreground`,children:l(x,{className:`h-3 w-3`})})]}),p&&a(`div`,{className:`flex items-start gap-2 px-3 py-2 border-b border-border bg-cyan-500/10 text-[10px]`,children:[l(h,{className:`h-3 w-3 mt-0.5 text-cyan-500 shrink-0`}),a(`div`,{className:`text-cyan-700 dark:text-cyan-200`,children:[l(`span`,{className:`font-semibold`,children:u(`addons.versionPicker.inPlace`,{kind:n===`upload`?u(`addons.versionPicker.uploadedCopy`,`Uploaded copy`):u(`addons.versionPicker.localCopy`,`Local copy`)})}),` `,l(Y,{i18nKey:`addons.versionPicker.reinstall`,values:{version:t},components:{mono:l(`span`,{className:`font-mono`})}})]})]}),g&&a(`div`,{className:`flex items-center justify-center gap-2 py-6 text-[10px] text-foreground-subtle`,children:[l(E,{className:`h-3.5 w-3.5 animate-spin`}),u(`addons.versionPicker.loadingVersions`,`Loading versions...`)]}),m&&l(`div`,{className:`max-h-64 overflow-auto divide-y divide-border`,children:m.map(e=>{let n=e.version===t,i=s!==void 0&&e.version===c,p=/-(alpha|beta|rc|dev|canary|next)/i.test(e.version),m=a(o,{children:[l(`span`,{className:`font-mono flex-1 text-left ${n?`text-primary font-semibold`:p?`text-amber-400`:`text-foreground`}`,children:e.version}),n&&l(`span`,{className:`text-[9px] rounded-full px-1.5 py-0.5 font-medium bg-primary/10 text-primary`,children:u(`common.current`)}),e.distTags.map(e=>l(`span`,{className:`text-[9px] rounded-full px-1.5 py-0.5 font-medium ${e===`latest`?`bg-emerald-500/15 text-emerald-400`:e===`beta`?`bg-amber-500/15 text-amber-400`:`bg-gray-500/15 text-gray-400`}`,children:e},e)),e.deprecated&&l(`span`,{className:`text-[9px] text-red-400 line-through`,children:u(`common.deprecated`)}),l(`span`,{className:`text-[9px] text-foreground-subtle shrink-0`,children:new Date(e.publishedAt).toLocaleDateString()})]});return s?a(`button`,{type:`button`,"aria-label":u(`addons.versionPicker.select`,`Select {{version}}`,{version:e.version}),onClick:()=>s(e.version),className:`w-full flex items-center gap-2 px-3 py-2 text-[11px] ${i?`bg-primary/5`:`hover:bg-surface-hover`} transition-colors`,children:[m,i?l(d,{className:`h-3 w-3 text-primary shrink-0`}):l(`span`,{className:`w-3 shrink-0`})]},e.version):a(`div`,{className:`flex items-center gap-2 px-3 py-2 text-[11px] ${n?`bg-primary/5`:`hover:bg-surface-hover`} transition-colors`,children:[m,l(`button`,{type:`button`,onClick:()=>r(e.version),className:`shrink-0 rounded p-0.5 hover:bg-primary/20 text-foreground-subtle hover:text-primary transition-colors`,title:n?u(`addons.versionPicker.reInstallFromNpm`,`Re-install {{version}} from npm`,{version:e.version}):u(`addons.versionPicker.install`,`Install {{version}}`,{version:e.version}),children:l(f,{className:`h-3 w-3`})})]},e.version)})}),m&&m.length===0&&l(`div`,{className:`py-4 text-center text-[10px] text-foreground-subtle`,children:u(`addons.versionPicker.noVersionsFound`,`No versions found`)})]})}e();var Je=`device-export`;function Ye(e){return e.capabilities.some(e=>(typeof e==`string`?e:e.name)===Je)}function Xe(e){return e!==`local`&&e!==`upload`}function Ze({isBundle:e,installSource:t,addonId:n,iconPath:i,color:o}){let[s,c]=r(!1),u=o?{backgroundColor:`${o.startsWith(`#`)?o:`#${o}`}26`}:void 0,d=e?`bg-indigo-500/20 text-indigo-700 dark:text-indigo-300`:`bg-purple-500/20 text-purple-700 dark:text-purple-300`,f=n&&i?g(`/api/addon-assets/${n}/${i}`):null,p=!!f&&!s;return a(`div`,{className:`relative flex-shrink-0`,children:[l(`div`,{className:`h-8 w-8 rounded-md flex items-center justify-center ${u?``:d}`,style:u,children:p?l(`img`,{src:f,alt:n,className:`h-4 w-4`,onError:()=>c(!0)}):l(e?_:y,{className:`h-3.5 w-3.5`})}),t===`local`&&l(`span`,{className:`absolute -top-1.5 -left-1.5 text-[7px] font-bold leading-none bg-orange-500 text-white px-1 py-0.5 rounded -rotate-12 shadow-sm`,children:`DEV`}),Xe(t)&&l(`span`,{className:`absolute -top-1 -left-1 w-4 h-4 rounded bg-[#cb3837] flex items-center justify-center -rotate-12 shadow-sm`,children:l(`svg`,{viewBox:`0 0 780 250`,className:`w-[11px] h-[11px]`,children:l(`path`,{fill:`#fff`,d:`M240 250h100V50h100v200h340V0H0v250z`})})}),t===`upload`&&l(`span`,{className:`absolute -top-1.5 -left-1.5 flex items-center justify-center h-4 w-4 rounded bg-cyan-500 -rotate-12 shadow-sm`,children:l(h,{className:`h-2.5 w-2.5 text-white`})})]})}function Qe({version:e,availableUpdate:t,selectedVersion:n,isUpdating:r,installSource:i,disabled:o,onUpdate:s,onOpenPicker:c,children:u}){let{t:d}=J();if(r)return a(`span`,{className:`inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[10px] font-medium border border-blue-500/30 bg-blue-500/10 text-blue-400 shrink-0`,children:[l(E,{className:`h-3 w-3 animate-spin`}),d(`addons.addonCard.updating`,`Updating…`)]});if(t){let r=n??t;return a(`div`,{className:`relative inline-flex items-center gap-1 shrink-0`,children:[s&&a(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),s()},disabled:o,className:`inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[10px] font-semibold border border-blue-500/30 bg-blue-500/10 text-blue-400 hover:bg-blue-500/20 disabled:opacity-50 disabled:cursor-not-allowed transition-colors`,title:d(`addons.addonCard.updateTo`,`Update to {{target}}`,{target:r}),children:[l(f,{className:`h-3 w-3`}),d(`addons.addonCard.update`,`Update`)]}),a(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),c()},disabled:o,"aria-label":d(`addons.addonCard.selectVersionToInstall`,`Select version to install`),title:d(`addons.addonCard.installedUpdateAvailableSelectedTap`,`Installed {{version}} — update available. Selected {{target}}; tap to choose another version.`,{version:e,target:r}),className:`inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[10px] font-bold font-mono border border-amber-500/40 bg-amber-500/15 text-amber-500 hover:bg-amber-500/25 animate-pulse disabled:opacity-50 disabled:cursor-not-allowed transition-colors`,children:[l(`span`,{className:`font-normal opacity-70`,children:e}),l(`span`,{className:`font-normal opacity-70`,children:`→`}),r,l(v,{className:`h-3 w-3`})]}),u]})}return a(`div`,{className:`relative inline-flex items-center gap-1 shrink-0`,children:[a(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),c()},disabled:o,className:[`inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[10px] font-bold font-mono border transition-colors disabled:opacity-50 disabled:cursor-not-allowed`,i===`local`?`border-orange-500/30 bg-orange-500/10 text-orange-400 hover:bg-orange-500/20`:`border-emerald-500/30 bg-emerald-500/10 text-emerald-400 hover:bg-emerald-500/20`].join(` `),title:d(`addons.addonCard.versionTapToViewAll`,`Version {{version}} — tap to view all versions`,{version:e}),children:[e,l(v,{className:`h-3 w-3 opacity-50`})]}),u]})}function $e({addonId:e}){let t=s(),{data:n=`inherit`}=K({addonId:e}),r=me({onSuccess:()=>{t.invalidateQueries({queryKey:[[`addons`,`getAddonAutoUpdate`]]})}});return l(`div`,{className:`flex rounded-lg border border-border overflow-hidden text-[10px] font-medium`,children:[`inherit`,`off`,`latest`,`beta`].map(t=>l(`button`,{type:`button`,onClick:n=>{n.stopPropagation(),r.mutate({addonId:e,channel:t})},disabled:r.isPending,className:`px-2.5 py-1 transition-colors capitalize ${n===t?t===`inherit`?`bg-gray-700/50 text-gray-700 dark:text-gray-300`:t===`off`?`bg-gray-700 text-gray-700 dark:text-gray-300`:t===`latest`?`bg-blue-500/20 text-blue-400`:`bg-amber-500/20 text-amber-400`:`bg-transparent text-foreground-subtle hover:bg-surface-hover`} ${t===`inherit`?``:`border-l border-border`}`,children:t},t))})}var et={id:`hub`,name:`Hub`,isHub:!0};function tt({addon:e,agents:n=[],clusterStatus:i,hideVersion:c,availableUpdate:u,onUpdate:d,isUpdating:f,jobProgress:p,bundle:m,bulkItem:h,disabledByBulk:g,isSystem:y,selectedNode:S}){let{t:w}=J(),[T,E]=r(!1),[ee,re]=r(!1),[ae,O]=r(!1),[se,ce]=r(null);t(()=>{ce(null)},[u]);let k=se??u,[A,j]=r(!1),[fe,N]=r(!1),[P,F]=r(`logs`),I=s(),me=X(),{manifest:z}=e,B=e.installedOn??[],ge=!m&&!z.protected&&z.removable!==!1,V=!!m,H=m?.displayName??z.name,U=m?.packageName??z.packageName,W=m?.version??z.packageVersion??z.version,G=m?.installSource??e.installSource,be=m?m.bundle?.description??m.addons[0]?.manifest.description:z.description,K=R({onSuccess:()=>{I.invalidateQueries({queryKey:[[`addons`]]})}}),Se=pe({onSuccess:()=>{I.invalidateQueries({queryKey:[[`addons`]]}),I.invalidateQueries({queryKey:[[`addonPages`]]}),I.invalidateQueries({queryKey:[[`capabilities`]]}),I.invalidateQueries({queryKey:[[`integrations`]]})}}),Ce=ve({onSuccess:()=>{I.invalidateQueries({queryKey:[[`addons`]]}),I.invalidateQueries({queryKey:[[`alerts`]]})}}),q=e.health,Y=q?.phase===`failed`&&!q.inGracePeriod,we=Y&&q?.nextRetryAt&&!q.retrying,Z=De(e.process);return a(`div`,{className:`rounded-md border bg-surface overflow-hidden ${Y?`border-red-500/50`:`border-border`}`,children:[Y&&q&&a(`div`,{className:`bg-danger/10 border-b border-danger/30 px-3 py-2 flex items-start gap-2`,children:[l(ie,{className:`h-4 w-4 text-danger shrink-0 mt-0.5`}),a(`div`,{className:`flex-1 min-w-0`,children:[l(`div`,{className:`text-xs font-semibold text-danger`,children:w(`addons.addonCard.failedToLoad`,{attempt:q.retryCount})}),l(`div`,{className:`text-[11px] text-foreground mt-0.5 break-words font-mono`,children:q.lastError?.message??w(`addons.addonCard.unknownError`,`Unknown error`)}),we&&q.nextRetryAt&&l(`div`,{className:`text-[10px] text-foreground-subtle mt-1`,children:w(`addons.addonCard.autoRetryAt`,{time:new Date(q.nextRetryAt).toLocaleTimeString()})})]}),a(`button`,{type:`button`,disabled:Ce.isPending||q.retrying,onClick:e=>{e.stopPropagation(),Ce.mutate({packageName:U})},className:`inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-[11px] font-semibold border border-red-400/40 bg-red-400/10 text-red-700 dark:text-red-300 hover:bg-red-400/20 disabled:opacity-50 disabled:cursor-not-allowed transition-colors shrink-0`,title:w(`addons.addonCard.resetRetryCounterAndForce`,`Reset retry counter and force immediate reload`),children:[l(b,{className:`h-3 w-3 ${Ce.isPending||q.retrying?`animate-spin`:``}`}),w(`addons.addonCard.retryNow`,`Retry now`)]})]}),Z!==null&&a(`div`,{className:`bg-danger/10 border-b border-danger/30 px-3 py-2 flex items-start gap-2`,children:[l(ie,{className:`h-4 w-4 text-danger shrink-0 mt-0.5`}),a(`div`,{className:`flex-1 min-w-0`,children:[l(`div`,{className:`text-xs font-semibold text-danger`,children:w(`addons.addonCard.processProblem.${Z.kind}`)}),Z.reason!==void 0&&l(`div`,{className:`text-[11px] text-foreground mt-0.5 break-words font-mono`,children:Z.reason})]})]}),a(`div`,{className:`flex items-start gap-2.5 px-3 py-2`,children:[l(Ze,{isBundle:V||!!z.components&&z.components.length>1,installSource:G,addonId:V?m.addons[0]?.manifest.id:z.id,iconPath:V?m.bundle?.icon??m.addons[0]?.manifest.icon:z.icon,color:V?m.addons[0]?.manifest.color:z.color}),a(`div`,{className:`flex-1 min-w-0`,children:[a(`div`,{className:`flex items-start justify-between gap-2`,children:[l(`span`,{className:`text-xs font-semibold text-foreground truncate min-w-0`,children:H}),!c&&l(Qe,{version:W,availableUpdate:u,...k===void 0?{}:{selectedVersion:k},isUpdating:f,installSource:G,disabled:g,...d&&k!==void 0?{onUpdate:()=>d(k)}:{},onOpenPicker:()=>O(e=>!e),children:ae&&l(qe,{packageName:U,currentVersion:W,...G?{installSource:G}:{},...u!==void 0&&k!==void 0?{selectedVersion:k,onSelect:e=>{ce(e),O(!1)}}:{},onInstall:e=>{O(!1),Se.mutate({packageName:U,version:e})},onClose:()=>O(!1)})})]}),a(`div`,{className:`flex flex-wrap items-center gap-x-1.5 gap-y-1 mt-0.5`,children:[U!==H&&l(`span`,{className:`text-[10px] text-foreground-subtle font-mono truncate max-w-full`,children:U}),V&&a(`span`,{className:`text-[10px] rounded-full bg-primary/10 text-primary px-2 py-0.5 font-medium shrink-0 inline-flex items-center gap-1`,children:[l(_,{className:`h-3 w-3`}),m.addons.length]}),y&&a(`span`,{className:`text-[10px] rounded-full bg-amber-500/15 text-amber-700 dark:text-amber-300 px-2 py-0.5 font-medium shrink-0 inline-flex items-center gap-1`,title:w(`addons.addonCard.systemPackageUpdatingRestartsThe`,`System package — updating restarts the hub`),children:[l(b,{className:`h-3 w-3`}),w(`addons.addonCard.system`,`System`)]}),h!=null&&l(ke,{item:h}),p!=null&&l(Ie,{progress:p})]}),be&&l(`p`,{className:`text-[10px] text-foreground-subtle mt-1 line-clamp-1`,children:be}),!V&&e.process&&a(`div`,{className:`flex flex-wrap items-center gap-1.5 mt-1`,children:[l(`span`,{className:`text-[9px] rounded-full px-1.5 py-0.5 font-medium ${e.process.mode===`forked`?`bg-blue-500/15 text-blue-400`:`bg-gray-500/15 text-gray-400`}`,children:e.process.mode===`forked`?w(`addons.addonCard.forked`):w(`addons.addonCard.inProcess`)}),e.process.pid!=null&&a(`span`,{className:`text-[9px] font-mono text-foreground-subtle`,children:[`PID `,e.process.pid]}),l(`span`,{className:`text-[9px] rounded-full px-1.5 py-0.5 font-medium ${e.process.state===`running`?`bg-emerald-500/15 text-emerald-400`:Z===null?`bg-gray-500/15 text-gray-400`:`bg-red-500/15 text-red-400`}`,children:e.process.state})]})]})]}),!V&&a(`div`,{className:`flex items-center gap-1 px-3 py-1 border-t border-border/50 bg-surface-hover/20`,children:[a(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),K.mutate({addonId:z.id})},disabled:K.isPending||g,className:`inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[10px] font-medium border border-border text-foreground-subtle hover:text-blue-400 hover:border-blue-500/30 hover:bg-blue-500/10 disabled:opacity-50 transition-colors`,children:[l(b,{className:`h-3 w-3 ${K.isPending?`animate-spin`:``}`}),w(`addons.addonCard.restart`,`Restart`)]}),a(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),j(e=>!e)},className:`inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[10px] font-medium border transition-colors ${A?`border-primary/30 bg-primary/10 text-primary`:`border-border text-foreground-subtle hover:text-foreground hover:border-primary/30 hover:bg-primary/10`}`,children:[l(D,{className:`h-3 w-3`}),w(`addons.addonCard.logs`,`Logs`)]}),!V&&a(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),N(!0)},className:`inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[10px] font-medium border transition-colors ${fe?`border-primary/30 bg-primary/10 text-primary`:`border-border text-foreground-subtle hover:text-foreground hover:border-primary/30 hover:bg-primary/10`}`,children:[l(te,{className:`h-3 w-3`}),w(`addons.addonCard.settings`,`Settings`)]}),l(`div`,{className:`flex-1`}),ge&&l(Ke,{packageName:z.packageName,displayName:z.name,selectedNode:S??et,disabled:g})]}),i&&i.nodes.length>1&&!V&&a(`div`,{className:`border-t border-border px-3 py-1.5 bg-muted/10`,children:[l(`div`,{className:`text-[10px] font-medium text-foreground-subtle mb-1.5`,children:w(`addons.addonCard.clusterDeployment`,`Cluster Deployment`)}),l(`div`,{className:`space-y-1`,children:i.nodes.map(e=>a(`div`,{className:`flex items-center gap-2 text-[10px]`,children:[l(`div`,{className:`h-1.5 w-1.5 rounded-full shrink-0 ${e.status===`offline`?`bg-muted-foreground/30`:e.synced?`bg-success`:`bg-amber-500`}`}),l(`span`,{className:`font-medium text-foreground min-w-[60px]`,children:e.name}),l(`span`,{className:`font-mono text-foreground-subtle`,children:e.version}),!e.synced&&e.status!==`offline`&&l(`span`,{className:`text-[9px] px-1 py-0.5 rounded bg-amber-500/10 text-amber-400 border border-amber-500/20`,children:w(`addons.addonCard.outdated`)}),e.status===`offline`&&l(`span`,{className:`text-[9px] px-1 py-0.5 rounded bg-muted text-muted-foreground`,children:w(`common.offline`)}),e.synced&&e.status!==`offline`&&l(`span`,{className:`text-[9px] text-success`,children:w(`common.synced`)})]},e.nodeId))})]}),A&&!V&&a(`div`,{className:`border-t border-border`,children:[a(`div`,{className:`flex items-center px-3 py-0.5 bg-surface-hover/20 border-b border-border/50`,children:[a(`div`,{className:`flex rounded border border-border overflow-hidden text-[9px]`,children:[l(`button`,{type:`button`,onClick:()=>F(`logs`),className:`px-2 py-0.5 transition-colors ${P===`logs`?`bg-primary/10 text-primary`:`text-foreground-subtle hover:bg-surface-hover`}`,children:w(`addons.addonCard.logs`,`Logs`)}),l(`button`,{type:`button`,onClick:()=>F(`events`),className:`px-2 py-0.5 border-l border-border transition-colors ${P===`events`?`bg-primary/10 text-primary`:`text-foreground-subtle hover:bg-surface-hover`}`,children:w(`addons.addonCard.events`,`Events`)})]}),l(`div`,{className:`flex-1`}),l(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),j(!1)},className:`text-foreground-subtle hover:text-foreground`,children:l(x,{className:`h-3.5 w-3.5`})})]}),P===`logs`&&l(M,{addonId:z.id,maxHeight:`max-h-64`,showFilters:!1}),P===`events`&&l(de,{addonId:z.id,category:`addon.*`,maxHeight:`max-h-64`})]}),V&&a(o,{children:[l(`button`,{type:`button`,onClick:()=>E(e=>!e),className:`w-full flex items-center justify-center border-t border-border py-1 hover:bg-surface-hover/50 transition-colors`,children:l(T?ne:v,{className:`h-3.5 w-3.5 text-foreground-subtle`})}),T&&l(`div`,{className:`border-t border-border px-2.5 py-1.5 space-y-1.5`,children:m.addons.map(e=>l(tt,{addon:e,agents:n,hideVersion:!0},e.manifest.id))})]}),fe&&!V&&l(le,{open:!0,onOpenChange:e=>!e&&N(!1),children:a(L,{width:`lg`,placement:`sheet-on-mobile`,scroll:`body`,children:[l(xe,{children:a(_e,{className:`flex items-center gap-2`,children:[l(te,{className:`h-4 w-4 text-primary`}),w(`addons.addonCard.settingsTitle`,{name:H})]})}),a(oe,{className:`space-y-4`,children:[l(`div`,{className:`text-[10px] text-foreground-subtle mb-2`,children:w(`addons.addonCard.clusterWideSettingsOneValue`,`Cluster-wide settings — one value for every node. Per-node settings live under Cluster → the node → Settings.`)}),l(Te,{nodeId:null,addonIds:[z.id],level:`global`,fieldScope:`cluster`,emptyMessage:w(`addons.addonCard.thisAddonExposesNoCluster`,`This addon exposes no cluster-wide settings. Anything it can configure is per-node — open it from Cluster → the node → Settings.`)}),Ye(z)&&a(`div`,{children:[l(`div`,{className:`text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2`,children:w(`addons.addonCard.deviceExport`,`Device export`)}),l(ue,{addonId:z.id,onOpenDevice:e=>me(`/devices/${e}`)})]}),Xe(G)&&a(`div`,{children:[l(`div`,{className:`text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2`,children:w(`addons.addonCard.autoUpdate`,`Auto-Update`)}),l($e,{addonId:z.id})]}),z.components&&z.components.length>0&&a(`div`,{children:[l(`div`,{className:`text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2`,children:w(`addons.addonCard.components`,{count:z.components.length})}),l(`div`,{className:`flex flex-wrap gap-1`,children:z.components.map(e=>l(`span`,{className:`text-[10px] rounded bg-background border border-border px-1.5 py-0.5 text-foreground-subtle font-mono`,children:e},e))})]}),n.length>=2&&a(`div`,{children:[l(`div`,{className:`text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2`,children:w(`addons.addonCard.installedOn`,`Installed on`)}),a(`div`,{className:`flex items-center gap-1.5 flex-wrap`,children:[B.length===0&&l(`span`,{className:`text-[10px] text-foreground-subtle`,children:w(`addons.addonCard.hubLocal`,`Hub (local)`)}),B.map(e=>l(`span`,{className:`rounded-full bg-surface-hover border border-border px-2 py-0.5 text-[10px] text-foreground-subtle`,children:e},e)),a(`div`,{className:`relative`,children:[a(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),re(e=>!e)},className:`inline-flex items-center gap-1 rounded-full border border-dashed border-border px-2 py-0.5 text-[10px] text-foreground-subtle hover:text-foreground hover:border-primary transition-colors`,title:w(`addons.addonCard.installOnMoreAgents`,`Install on more agents`),children:[l(C,{className:`h-3 w-3`}),w(`addons.addonCard.addAgent`,`Add agent`)]}),ee&&a(`div`,{className:`absolute left-0 top-full mt-1 z-10 min-w-[160px] rounded-md border border-border bg-surface shadow-lg overflow-hidden`,children:[n.filter(e=>!e.isHub&&!B.includes(e.name)).map(e=>l(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),re(!1)},className:`w-full text-left px-3 py-1.5 text-[10px] text-foreground hover:bg-surface-hover transition-colors`,children:e.name},e.id)),n.filter(e=>!e.isHub&&!B.includes(e.name)).length===0&&l(`div`,{className:`px-3 py-1.5 text-[10px] text-foreground-subtle`,children:w(`addons.addonCard.noAvailableAgents`,`No available agents`)})]})]})]})]})]}),l(ye,{children:l(he,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>N(!1),children:w(`common.close`,`Close`)})})]})})]})}e();var nt=`.tgz,.tar.gz,.zip`;function rt({onUploadSuccess:e}){let{t}=J(),[n,s]=r(!1),u=c(null),d=i(async t=>{s(!0);let n=new FormData;n.append(`file`,t);let r=localStorage.getItem(`camstack_admin_token`)??``;try{(await(await fetch(g(`/api/addons/upload`),{method:`POST`,headers:{Authorization:`Bearer ${r}`},body:n})).json()).success&&e()}finally{s(!1)}},[e]);return a(o,{children:[l(`input`,{ref:u,type:`file`,accept:nt,onChange:i(e=>{let t=e.target.files?.[0];t&&d(t),e.target.value=``},[d]),className:`hidden`}),a(`button`,{type:`button`,onClick:()=>u.current?.click(),disabled:n,className:`flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-md bg-surface hover:bg-surface-hover border border-border disabled:opacity-50 transition-colors`,children:[n?l(E,{className:`w-3.5 h-3.5 animate-spin`}):l(h,{className:`w-3.5 h-3.5`}),n?t(`addons.addonUploadZone.uploading`,`Uploading...`):t(`addons.addonUploadZone.upload`,`Upload`)]})]})}var it=new Set([`@camstack/system`,`@camstack/types`,`@camstack/sdk`,`@camstack/ui-library`,`@camstack/addon-agent-ui`]);function at(e,t){let n=new Map;for(let r of e){if(r.isHub||r.onHub||it.has(r.packageName)||!t.isHub&&r.nodeId!==t.id)continue;let e=n.get(r.packageName)??[];e.push(r),n.set(r.packageName,e)}return[...n].map(([e,t])=>({packageName:e,rows:t})).sort((e,t)=>e.packageName.localeCompare(t.packageName))}function ot({selectedNode:e}){let{t}=J(),{data:n}=P(Ue,{staleTime:We});if(n===void 0)return null;let r=at(n.installations,e),i=n.unreachable.filter(t=>e.isHub||t.nodeId===e.id);return r.length===0&&i.length===0?null:a(`div`,{className:`rounded-lg border border-warning/30 bg-warning/5 px-3 py-2.5 space-y-2`,children:[a(`div`,{className:`flex items-center gap-2 text-[11px] font-semibold text-foreground`,children:[l(m,{className:`h-3.5 w-3.5 text-warning`}),e.isHub?t(`addons.nodeOnlyPackagesPanel.installedOnAgentsButNot`,`Installed on agents but not on the hub`):t(`addons.nodeOnlyPackagesPanel.installedOnButNotOn`,`Installed on {{name}} but not on the hub`,{name:e.name})]}),i.length>0&&l(`div`,{className:`text-[10px] text-foreground-subtle`,children:t(`addons.nodeOnlyPackagesPanel.unreachable`,{nodes:i.map(e=>e.nodeId).join(`, `)})}),r.map(t=>a(`div`,{className:`flex items-center justify-between gap-3 flex-wrap rounded-md border border-border bg-surface px-3 py-2`,children:[a(`div`,{className:`min-w-0`,children:[l(`div`,{className:`text-xs font-mono text-foreground break-all`,children:t.packageName}),l(`div`,{className:`text-[10px] text-foreground-subtle`,children:t.rows.map(e=>`${e.nodeName}${e.version===null?``:` ${e.version}`}${e.isOnline?``:` (offline)`}`).join(` · `)})]}),l(Ke,{packageName:t.packageName,displayName:t.packageName,selectedNode:e,hideNodeAction:e.isHub})]},t.packageName))]})}function st({addon:e,installing:t,onInstall:n}){let{t:r}=J();return a(`div`,{className:`flex items-center gap-3 px-3 py-2 hover:bg-surface-hover transition-colors`,children:[l(`div`,{className:`w-6 h-6 rounded-md bg-primary/10 flex items-center justify-center text-primary text-[9px] font-bold shrink-0`,children:e.name.replace(`@camstack/addon-`,``).charAt(0).toUpperCase()}),a(`div`,{className:`flex-1 min-w-0`,children:[a(`div`,{className:`flex items-baseline gap-2 min-w-0`,children:[l(`span`,{className:`text-[11px] font-semibold break-words`,children:e.name.replace(/^@camstack\/(addon-)?/,``)}),a(`span`,{className:`text-[10px] text-foreground-subtle shrink-0`,children:[`v`,e.version]})]}),l(`div`,{className:`font-mono text-[9px] text-foreground-subtle/80 truncate`,children:e.name}),e.description&&l(`div`,{className:`text-[10px] text-foreground-subtle truncate`,children:e.description})]}),e.installed?l(A,{variant:`success`,icon:l(d,{className:`h-3 w-3`}),children:e.installedVersion??r(`system.capabilityCatalog.installed`,`Installed`)}):a(he,{size:`sm`,onClick:()=>n(e.name),disabled:t,className:`shrink-0`,children:[t?l(E,{className:`h-3 w-3 animate-spin`}):l(f,{className:`h-3 w-3`}),r(`system.capabilityCatalog.install`,`Install`)]})]})}function ct({capability:e,installing:t,onInstall:n}){let{t:r}=J(),{data:i,isPending:o,isError:s}=z({capability:e}),c;if(s)c=l(`div`,{className:`px-3 py-2 text-xs text-danger`,children:r(`system.capabilityCatalog.couldNotSearchTheNpm`,`Could not search the npm catalog right now. Try again in a moment.`)});else if(o||i===void 0)c=a(`div`,{className:`flex items-center gap-2 px-3 py-2 text-xs text-foreground-subtle`,children:[l(E,{className:`h-3 w-3 animate-spin`}),r(`system.capabilityCatalog.searchingTheNpmCatalog`,`Searching the npm catalog…`)]});else{let a=i.filter(e=>!e.installed);c=a.length===0?l(`div`,{className:`px-3 py-2 text-xs text-foreground-subtle`,children:i.length===0?r(`system.capabilityCatalog.noPublishedAddonDeclaresThe`,`No published addon declares the "{{capability}}" capability.`,{capability:e}):r(`system.capabilityCatalog.everyPublishedAddonThatDeclares`,`Every published addon that declares "{{capability}}" is already installed.`,{capability:e})}):l(`div`,{className:`divide-y divide-border`,children:a.map(e=>l(st,{addon:e,installing:t,onInstall:n},e.name))})}return a(`section`,{className:`rounded-md border border-border bg-surface overflow-hidden`,"aria-label":r(`system.capabilityCatalog.availableToInstall`,`Available to install`),children:[l(`h2`,{className:`px-3 py-1.5 text-[10px] uppercase tracking-wide text-foreground-subtle border-b border-border`,children:r(`system.capabilityCatalog.availableToInstall`,`Available to install`)}),c]})}e();function lt(e){return e===`npm`||e===`dev`?e:null}var ut=`rounded-full border border-primary bg-primary/10 px-2 py-0.5 text-[10px] text-foreground`,dt=`rounded-full border border-border px-2 py-0.5 text-[10px] text-foreground-muted hover:bg-surface-hover`,ft=[{seconds:900,label:`15m`},{seconds:3600,label:`1h`},{seconds:21600,label:`6h`},{seconds:43200,label:`12h`},{seconds:86400,label:`24h`}],pt=new Set([`@camstack/system`,`@camstack/types`,`@camstack/sdk`,`@camstack/shm-ring`,`@camstack/ui-library`]);function mt(e){return e!==void 0&&pt.has(e)}var ht={id:`hub`,name:`Hub`,isHub:!0,isOnline:!0};function gt(e,t){let n=e??`hub-only`;return n===`any-node`?!0:n===`hub-only`?t:!t}function _t(e){return e===`local`?`dev`:`npm`}function vt(e){let t=e;if(!t?.manifest)return null;let n={...t.manifest,name:t.manifest.name??t.manifest.id,version:t.manifest.version??`0.0.0`,capabilities:t.manifest.capabilities??[]},r=t.process,i=r?{pid:r.pid,mode:r.mode===`forked`?`forked`:`in-process`,state:r.state??`unknown`,...r.reason===void 0?{}:{reason:r.reason}}:void 0,a=t.health,o=t.declaration?.execution,s=t.manifest.execution,c=o?.placement??s?.placement;return{manifest:n,enabled:!0,source:t.source,installSource:t.installSource,installedOn:[],...i?{process:i}:{},hasBackup:t.hasBackup,...a?{health:a}:{},...c?{placement:c}:{}}}function yt(e){let t=new Map,n=[];for(let r of e){let e=r.manifest.packageName;if(!e){n.push(r);continue}let i=t.get(e);if(i)i.addons.push(r);else{let n=r.manifest.bundle,i={packageName:e,displayName:n?.displayName??r.manifest.packageDisplayName??r.manifest.name,version:r.manifest.packageVersion,addons:[r],...r.installSource===void 0?{}:{installSource:r.installSource},...n===void 0?{}:{bundle:n}};t.set(e,i)}}let r=[];for(let e of t.values())e.bundle!==void 0||e.addons.length>=2?r.push({bundle:e,representative:e.addons[0]}):r.push(e.addons[0]);return r.push(...n),r}function $(e){return`bundle`in e}function bt({addons:e,clusterStatus:o,selectedNode:d,onRefresh:p,isRefreshing:m}){let{t:h}=J(),g=s(),[_,v]=r(``),y=u(_),[x,C]=r(!1),T=c(null);t(()=>{if(!x)return;let e=e=>{T.current&&!T.current.contains(e.target)&&C(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[x]);let{data:D}=Se({nodeId:d.id}),ee=n(()=>{let e=new Map;for(let t of D??[])e.set(t.name,t.latestVersion);return e},[D]),te=n(()=>(D??[]).filter(e=>!e.isSystem).length,[D]),[ne,re]=r(()=>new Set),[ie,ae]=r(()=>new Map),oe=i(e=>{re(t=>new Set(t).add(e))},[]),se=i(e=>{re(t=>{if(!t.has(e))return t;let n=new Set(t);return n.delete(e),n})},[]),le=i((e,t)=>{ae(n=>new Map(n).set(e,t))},[]),A=i(e=>{ae(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),ue=Ce({onMutate:e=>{oe(e.name),A(e.name)},onSuccess:(e,t)=>{se(t.name);let n=e;if(n&&n.success===!1){le(t.name,n.error??`Update failed (no error message returned by server)`);return}g.invalidateQueries({queryKey:[[`addons`]]}),g.invalidateQueries({queryKey:[[`addons`,`listUpdates`]]})},onError:(e,t)=>{se(t.name),le(t.name,e instanceof Error?e.message:String(e))}}),de=Pe(),j=c(new Set);t(()=>{let e=new Set;for(let[t,n]of de)Me(n)&&e.add(t);let t=[...j.current].some(t=>!e.has(t));j.current=e,t&&(g.invalidateQueries({queryKey:[[`addons`]]}),g.invalidateQueries({queryKey:[[`addons`,`listUpdates`]]}))},[de,g]);let{data:M}=U(void 0),N=k({onSuccess:()=>{g.invalidateQueries({queryKey:[[`addons`,`getAutoUpdateSettings`]]})}}),P=fe({onSuccess:()=>{g.invalidateQueries({queryKey:[[`addons`,`getAutoUpdateSettings`]]})}}),{data:F,isFetching:I}=z({query:y||void 0},{enabled:x}),L=q(),{data:R}=be(void 0),me=R?.requestedAt,[he,B]=r(null),[ge,_e]=r(!1);t(()=>{if(R?.kind===`framework-bulk-update`&&R.requestedAt!==he){B(R.requestedAt),_e(!0);let e=window.setTimeout(()=>_e(!1),6e3);return()=>window.clearTimeout(e)}},[me,he,R]),O();let V=i(async()=>{let e=(D??[]).filter(e=>!e.isSystem);if(e.length!==0){if(!d.isHub){for(let t of e)await ue.mutateAsync({name:t.name,version:t.latestVersion,nodeId:d.id});return}await L.mutateAsync({kind:`update`,targets:e.map(e=>({name:e.name,version:e.latestVersion})),nodeIds:[d.id]})}},[D,d.id,d.isHub,L,ue]),H=pe({onSuccess:()=>{g.invalidateQueries({queryKey:[[`addons`]]}),g.invalidateQueries({queryKey:[[`addonPages`]]}),g.invalidateQueries({queryKey:[[`capabilities`]]}),g.invalidateQueries({queryKey:[[`integrations`]]})}}),[ve,ye]=r(`type`),[W,G]=r(()=>typeof window>`u`?`grouped`:window.localStorage.getItem(`camstack.addons.viewMode`)===`flat`?`flat`:`grouped`),xe=e=>{G(e),typeof window<`u`&&window.localStorage.setItem(`camstack.addons.viewMode`,e)},[K,Y]=we(),X=K.get(`capability`),Z=K.get(`updatable`)===`1`,Te=K.get(`error`)===`1`,Q=lt(K.get(`source`)),Ee=i(e=>{let t=new URLSearchParams(K);e?t.set(`updatable`,`1`):t.delete(`updatable`),Y(t,{replace:!0})},[K,Y]),Oe=i(e=>{let t=new URLSearchParams(K);e?t.set(`error`,`1`):t.delete(`error`),Y(t,{replace:!0})},[K,Y]),ke=i(e=>{let t=new URLSearchParams(K);e===null?t.delete(`source`):t.set(`source`,e),Y(t,{replace:!0})},[K,Y]),Ae=n(()=>e.filter(e=>De(e.process)!==null).length,[e]),je=n(()=>{let t=e.filter(e=>!mt(e.manifest.packageName));return d.isHub||(t=t.filter(e=>gt(e.placement,d.isHub))),X&&(t=t.filter(e=>(e.manifest.capabilities??[]).some(e=>(typeof e==`string`?e:e.name)===X))),Z&&(t=t.filter(e=>{let t=e.manifest.packageName;return t!==void 0&&ee.has(t)})),Q!==null&&(t=t.filter(e=>_t(e.installSource)===Q)),Te&&(t=t.filter(e=>De(e.process)!==null)),t},[e,d.isHub,X,Z,Q,Te,ee]),Ne=()=>{let e=new URLSearchParams(K);e.delete(`capability`),Y(e,{replace:!0})},Fe=W===`flat`?je:yt(je),Ie=n(()=>{let e=[...Fe];switch(ve){case`type`:e.sort((e,t)=>{let n=+!$(e),r=+!$(t);if(n!==r)return n-r;let i=$(e)?e.bundle.displayName:e.manifest.name,a=$(t)?t.bundle.displayName:t.manifest.name;return i.localeCompare(a)});break;case`name`:e.sort((e,t)=>{let n=$(e)?e.bundle.displayName:e.manifest.name,r=$(t)?t.bundle.displayName:t.manifest.name;return n.localeCompare(r)});break;case`source`:e.sort((e,t)=>{let n=$(e)?e.bundle.installSource??``:e.installSource??``,r=$(t)?t.bundle.installSource??``:t.installSource??``;return n.localeCompare(r)});break}return e},[Fe,ve]);return a(`div`,{className:`space-y-3`,children:[[...ie.entries()].map(([e,t])=>l(`div`,{className:`rounded-md border border-danger/30 bg-danger/5 px-2.5 py-1.5 text-[11px]`,children:a(`div`,{className:`flex items-start justify-between gap-3`,children:[a(`div`,{className:`space-y-0.5`,children:[l(`div`,{className:`font-medium text-danger`,children:h(`systemPage.addons.updateFailed`,{name:e})}),l(`div`,{className:`text-foreground-subtle font-mono`,children:t})]}),l(`button`,{type:`button`,onClick:()=>A(e),className:`text-foreground-subtle hover:text-foreground text-[10px]`,children:h(`common.dismiss`)})]})},e)),a(`div`,{className:`flex items-center gap-x-2 gap-y-1.5 flex-wrap`,children:[a(`div`,{className:`flex items-center gap-1.5`,children:[l(`span`,{className:`text-[10px] text-foreground-subtle`,children:h(`admin.system.addons.sort`,`Sort:`)}),a(`select`,{value:ve,onChange:e=>ye(e.target.value),className:`rounded-md border border-border bg-surface px-2 py-1 text-[11px] text-foreground focus:outline-none focus:border-primary/50`,children:[l(`option`,{value:`type`,children:h(`admin.system.addons.bundlesFirst`,`Bundles first`)}),l(`option`,{value:`name`,children:h(`admin.system.addons.name`,`Name`)}),l(`option`,{value:`source`,children:h(`admin.system.addons.installSource`,`Install source`)})]})]}),a(`div`,{className:`flex items-center gap-1.5`,children:[l(`span`,{className:`text-[10px] text-foreground-subtle`,children:h(`admin.system.addons.view`,`View:`)}),l(`div`,{className:`flex rounded-md border border-border overflow-hidden text-[10px] font-medium`,children:[`grouped`,`flat`].map(e=>l(`button`,{type:`button`,onClick:()=>xe(e),className:`px-2 py-1 transition-colors capitalize ${W===e?`bg-primary/10 text-primary`:`bg-transparent text-foreground-subtle hover:bg-surface-hover`}`,title:e===`grouped`?h(`admin.system.addons.groupMultiAddonPackagesInto`,`Group multi-addon packages into a bundle card`):h(`admin.system.addons.showEveryAddonAsIts`,`Show every addon as its own card`),children:e},e))})]}),d.isHub&&a(`div`,{className:`flex items-center gap-1.5`,children:[l(b,{className:`h-3 w-3 text-foreground-subtle`}),l(`span`,{className:`text-[10px] text-foreground-subtle`,children:h(`admin.system.addons.autoUpdate`,`Auto-Update:`)}),l(`div`,{className:`flex rounded-md border border-border overflow-hidden text-[10px] font-medium`,children:[`off`,`latest`,`beta`].map(e=>l(`button`,{type:`button`,onClick:()=>N.mutate({channel:e}),disabled:N.isPending,className:`px-2 py-1 transition-colors capitalize ${M?.channel===e?e===`off`?`bg-gray-700 text-gray-200`:e===`latest`?`bg-blue-500/20 text-blue-400`:`bg-amber-500/20 text-amber-400`:`bg-transparent text-foreground-subtle hover:bg-surface-hover`} ${e===`off`?``:`border-l border-border`}`,children:e},e))})]}),d.isHub&&a(`div`,{className:`flex items-center gap-1.5`,children:[l(`span`,{className:`text-[10px] text-foreground-subtle`,children:h(`admin.system.addons.checkEvery`,`Check every:`)}),l(`select`,{className:`rounded-md border border-border bg-transparent px-1.5 py-1 text-[10px] font-medium text-foreground-subtle`,value:M?.updateCheckIntervalSeconds??21600,disabled:P.isPending||M===void 0,onChange:e=>{M!==void 0&&P.mutate({channel:M.channel,updateCheckIntervalSeconds:Number(e.target.value)})},children:ft.map(e=>l(`option`,{value:e.seconds,children:e.label},e.seconds))})]}),te>0&&a(`button`,{type:`button`,onClick:()=>void V(),disabled:L.isPending,className:`flex items-center gap-1 px-2 py-1 text-[11px] rounded-md bg-blue-500/10 text-blue-400 hover:bg-blue-500/20 border border-blue-500/30 disabled:opacity-50 transition-colors font-medium`,children:[L.isPending?l(E,{className:`w-3 h-3 animate-spin`}):l(f,{className:`w-3 h-3`}),L.isPending?h(`admin.system.addons.updating`,`Updating…`):h(`admin.system.addons.updateAll`,`Update All ({{nonSystemUpdateCount}})`,{nonSystemUpdateCount:te})]}),a(`button`,{type:`button`,onClick:p,disabled:m||L.isPending,className:`flex items-center gap-1 px-2 py-1 text-[11px] rounded-md bg-surface hover:bg-surface-hover border border-border disabled:opacity-50 transition-colors`,children:[l(b,{className:`w-3 h-3 ${m?`animate-spin`:``}`}),h(`common.refresh`,`Refresh`)]})]}),a(`div`,{className:`flex flex-wrap items-center gap-1.5`,role:`group`,"aria-label":h(`admin.system.addons.filterInstalledAddons`,`Filter installed addons`),children:[l(`span`,{className:`text-[10px] text-foreground-subtle`,children:h(`admin.system.addons.filter`,`Filter:`)}),[{id:`updatable`,label:h(`admin.system.addons.updatable`,`Updatable`),pressed:Z,toggle:()=>Ee(!Z)},{id:`error`,label:h(`admin.system.addons.inError`,`In error ({{count}})`,{count:Ae}),pressed:Te,toggle:()=>Oe(!Te)},{id:`npm`,label:`npm`,pressed:Q===`npm`,toggle:()=>ke(Q===`npm`?null:`npm`)},{id:`dev`,label:h(`admin.system.addons.dev`,`Dev`),pressed:Q===`dev`,toggle:()=>ke(Q===`dev`?null:`dev`)}].map(e=>l(`button`,{type:`button`,"aria-pressed":e.pressed,onClick:e.toggle,className:e.pressed?ut:dt,children:e.label},e.id))]}),a(`div`,{className:`flex flex-col gap-1.5 sm:flex-row sm:items-center sm:gap-2`,children:[a(`div`,{className:`relative flex-1 min-w-0 sm:min-w-[200px]`,ref:T,children:[l(ce,{type:`text`,value:_,onChange:e=>{v(e.target.value),C(!0)},onFocus:()=>C(!0),placeholder:h(`admin.system.addons.searchAddonsOnNpm`,`Search addons on npm...`),"aria-label":h(`admin.system.addons.searchAddonsOnNpm2`,`Search addons on npm`),disabled:L.isPending,leftSlot:l(S,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),rightSlot:I?l(E,{className:`h-3 w-3 animate-spin`}):void 0}),x&&F&&F.length>0&&a(`div`,{className:`absolute left-0 right-0 top-full mt-1 z-40 rounded-md border border-border bg-surface shadow-xl overflow-hidden`,children:[F.length>0&&l(`div`,{className:`px-3 py-1.5 text-[10px] uppercase tracking-wide text-foreground-subtle border-b border-border`,children:h(`systemPage.addons.npmResults`,{count:F.length})}),F&&F.length>0&&l(`div`,{className:`max-h-72 overflow-auto divide-y divide-border`,children:F.map(e=>l(st,{addon:e,installing:H.isPending,onInstall:e=>H.mutate({packageName:e})},e.name))})]})]}),l(rt,{onUploadSuccess:()=>{g.invalidateQueries({queryKey:[[`addons`]]}),p()}})]}),X&&a(`div`,{className:`flex items-center gap-2 px-2.5 py-1.5 rounded-md bg-primary/10 border border-primary/30 text-xs`,children:[l(`span`,{className:`text-foreground-subtle`,children:h(`admin.system.addons.filteringByCapability`,`Filtering by capability:`)}),l(`span`,{className:`font-mono text-primary font-semibold`,children:X}),l(`button`,{type:`button`,onClick:Ne,className:`ml-auto text-xs text-foreground-subtle hover:text-foreground underline`,children:h(`admin.system.addons.clear`,`Clear`)})]}),X&&l(ct,{capability:X,installing:H.isPending,onInstall:e=>H.mutate({packageName:e})}),X&&je.length>0&&l(`h2`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:h(`admin.system.addons.installed`,`Installed`)}),ge&&a(`div`,{className:`fixed top-[calc(env(safe-area-inset-top)+1rem)] right-[calc(env(safe-area-inset-right)+1rem)] z-50 flex items-start gap-2 px-3 py-2.5 rounded-md border border-green-500/30 bg-green-500/10 shadow-lg backdrop-blur-sm max-w-sm pointer-events-auto`,children:[l(w,{className:`w-4 h-4 shrink-0 mt-0.5 text-green-400`}),a(`div`,{children:[l(`div`,{className:`text-[11px] font-semibold text-foreground`,children:h(`admin.system.addons.bulkUpdateCompleted`,`Bulk update completed`)}),l(`div`,{className:`text-[10px] text-foreground-subtle mt-0.5`,children:h(`admin.system.addons.systemPackagesUpdatedHubRestarted`,`System packages updated — hub restarted successfully.`)})]})]}),je.length===0&&l(`div`,{className:`text-xs text-foreground-subtle`,children:e.length===0?h(`admin.system.addons.noAddonsInstalled`,`No addons installed`):X?h(`admin.system.addons.noInstalledAddonDeclaresThe`,`No installed addon declares the "{{capabilityFilter}}" capability. Any addon you can install appears under "Available to install" above.`,{capabilityFilter:X}):h(`admin.system.addons.noAddonsCompatibleWithPlacement`,`No addons compatible with {{name}} (placement filter active)`,{name:d.name})}),l(`div`,{className:`space-y-1.5`,children:Ie.map(e=>{let t=$(e)?e.bundle.packageName:e.manifest.packageName,n=ee.get(t),r=$(e)?e.representative:e,i=n?e=>ue.mutate({name:t,version:e,nodeId:d.id}):void 0,a=de.get(t)??null,s=a!==null&&Me(a);return l(tt,{addon:r,clusterStatus:o?.[r.manifest.id],bundle:$(e)?e.bundle:void 0,availableUpdate:n,isUpdating:ne.has(t)||s,jobProgress:a,onUpdate:i,disabledByBulk:L.isPending,selectedNode:d},$(e)?t:e.manifest.id)})})]})}function xt(){let{t:e}=J(),n=s(),{data:r}=se(void 0),{nodes:i}=G(),{selection:o,selectNode:u,requestedNodeId:d}=Ee(i.length>0?i:[ht]),f=o.node??ht,p=f.id,m=i.length>0?o.staleNodeId:null,{data:h,isLoading:g,isError:_}=W({nodeId:p}),v=I(),y=F(),x=v.isPending||y.isPending,S=async()=>{await v.mutateAsync({nodeId:p}),await y.mutateAsync(),n.invalidateQueries({queryKey:[[`addons`]]})},C=c(v);C.current=v;let w=c(d??`hub`);t(()=>{C.current.mutate({nodeId:w.current})},[]);let T=(h??[]).map(vt).filter(e=>e!==null);return a(Z,{children:[a(`div`,{className:`flex items-center justify-between gap-2 flex-wrap`,children:[l(B,{selectedNodeId:p,onSelect:u}),a(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[!g&&!_&&l(`span`,{className:`text-[10px] rounded-full bg-primary/10 text-primary px-2 py-0.5 font-medium`,children:e(`systemPage.addons.installedCount`,{count:T.length})}),a(`button`,{type:`button`,onClick:()=>void S(),disabled:x,className:`inline-flex items-center gap-1 px-2 py-1 text-[11px] rounded-md bg-surface hover:bg-surface-hover border border-border disabled:opacity-50 transition-colors`,title:e(`admin.system.addons.reFetchAddonsCheckNpm`,`Re-fetch addons + check npm for new versions`),children:[l(b,{className:`w-3 h-3 ${x?`animate-spin`:``}`}),e(`admin.system.addons.checkForUpdates`,`Check for updates`)]})]})]}),l(Q,{staleNodeId:m,shownNodeName:f.name}),l(ot,{selectedNode:f}),g&&l(`div`,{className:`text-xs text-foreground-subtle animate-pulse`,children:e(`common.loading`,`Loading…`)}),_&&l(`div`,{className:`text-xs text-danger`,children:e(`admin.system.addons.failedToLoadAddons`,`Failed to load addons`)}),!g&&!_&&l(bt,{addons:T,clusterStatus:r,selectedNode:f,onRefresh:()=>void S(),isRefreshing:x})]})}export{xt as AddonsPage};
|