@camstack/addon-admin-ui 1.2.689 → 1.2.691

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/CHANGELOG.md +27 -2
  2. package/dist/assets/AccessSection-D8SFhAIG.js +1 -0
  3. package/dist/assets/Addons-4zb8WqsP.js +5 -0
  4. package/dist/assets/{AdminPage-BZ0d3KIi.js → AdminPage-Dr8PsIuX.js} +1 -1
  5. package/dist/assets/{AdminSectionedPage-CivTk-bE.js → AdminSectionedPage-C3NbPIMK.js} +1 -1
  6. package/dist/assets/{AiProfiles-tt4dx8wK.js → AiProfiles-09uEdzUc.js} +2 -2
  7. package/dist/assets/Archive-DDg3Te3v.js +1 -0
  8. package/dist/assets/BootstrapSettingsForm-EahE9xrT.js +1 -0
  9. package/dist/assets/Build-Dysn_dsI.js +40 -0
  10. package/dist/assets/{Calendars-DcanbjM1.js → Calendars-DqxqjWNj.js} +1 -1
  11. package/dist/assets/{CameraGrids-D0rLrR4c.js → CameraGrids-BaVLUgNc.js} +1 -1
  12. package/dist/assets/Cluster-DCb9pTRO.js +1 -0
  13. package/dist/assets/CompositionBlockEditor-Bo7NCArN.js +2 -0
  14. package/dist/assets/CompositionEditorPage-D9gqtKg_.js +1 -0
  15. package/dist/assets/Data-CCfGw4D3.js +2 -0
  16. package/dist/assets/DeviceDetail-DGaYflb1.js +1 -0
  17. package/dist/assets/{Devices-Dn8t45Xi.js → Devices-PRxhQLdr.js} +1 -1
  18. package/dist/assets/{EmbedDevicePage-BtrHGVT2.js → EmbedDevicePage-cBOLQorO.js} +1 -1
  19. package/dist/assets/{EmbedPlayerPage-Cpe5M1Q-.js → EmbedPlayerPage-DSZTQL2b.js} +1 -1
  20. package/dist/assets/History-BzHUR50W.js +1 -0
  21. package/dist/assets/Identity-BH_Psx-M.js +1 -0
  22. package/dist/assets/InstancesTable-BkkLy_BU.js +1 -0
  23. package/dist/assets/IntegrationDetail-Dh1zEIkB.js +1 -0
  24. package/dist/assets/{Integrations-BDNPovWf.js → Integrations-DziYFJDe.js} +2 -2
  25. package/dist/assets/Integrations-I8w-NmB5.js +1 -0
  26. package/dist/assets/Library-CrU752kO.js +1 -0
  27. package/dist/assets/Locations-Cz9dHdgC.js +3 -0
  28. package/dist/assets/Logs-D76tMs8T.js +1 -0
  29. package/dist/assets/{MaskShapeCanvas-CkL1-Z2p.js → MaskShapeCanvas-DhkgwuqU.js} +1 -1
  30. package/dist/assets/{MotionZonesSettings-CglI9jLC.js → MotionZonesSettings-ePEXl_eY.js} +1 -1
  31. package/dist/assets/MyAccess-DrN6K8e1.js +2 -0
  32. package/dist/assets/{Network-BRESDnEF.js → Network-CcBl6Bv3.js} +1 -1
  33. package/dist/assets/NewExportModal-DcAnxwF1.js +1 -0
  34. package/dist/assets/NodeAddonsSettingsPanel-BUnGcCpc.js +1 -0
  35. package/dist/assets/Notifications-DC_4_Px5.js +1 -0
  36. package/dist/assets/PanelContent-BD4VlG0k.js +2 -0
  37. package/dist/assets/Pipeline-C9c451F4.js +1 -0
  38. package/dist/assets/{PrivacyMaskSettings-Cfst7tBt.js → PrivacyMaskSettings-BKbsxTCz.js} +1 -1
  39. package/dist/assets/{SceneMonitorEditor-DPm4jF5N.js → SceneMonitorEditor-BsG_DspV.js} +1 -1
  40. package/dist/assets/SessionsList-CXVcORvl.js +2 -0
  41. package/dist/assets/{Showroom-Ca4Y5ZQK.js → Showroom-syizHLdc.js} +1 -1
  42. package/dist/assets/StorageLocationsTable-DX9GAr79.js +1 -0
  43. package/dist/assets/System-D_y9BjT7.js +1 -0
  44. package/dist/assets/TemplateEditorDialog-Dg33OIxl.js +1 -0
  45. package/dist/assets/{TerminalPanel-CGquUW8j.js → Terminal-DNCcPfaX.js} +5 -3
  46. package/dist/assets/{TrainingProviders-CPNjxb58.js → TrainingProviders-Kir4QyJ0.js} +1 -1
  47. package/dist/assets/{Viewer-CO1F-6xh.js → Viewer-CxhObjjY.js} +1 -1
  48. package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-D0G_tF_l.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-DrIBdeiK.js} +1 -1
  49. package/dist/assets/{action-draft-Bg11zRAj.js → action-draft-BaaZLiaa.js} +1 -1
  50. package/dist/assets/{ai-page.helpers-CB1jbKz_.js → ai-page.helpers-ByoISKAg.js} +1 -1
  51. package/dist/assets/{assignment-candidates-B6H3O80X.js → assignment-candidates-CfAyipS2.js} +1 -1
  52. package/dist/assets/{authed-media-xniEMsSm.js → authed-media-DHr41d8D.js} +1 -1
  53. package/dist/assets/{board-model-B2JiEhiD.js → board-model-COHOZu1s.js} +1 -1
  54. package/dist/assets/client-dUCYJcne.js +1120 -0
  55. package/dist/assets/{command-vocab-CnGweFaG.js → command-vocab-CopJIH2j.js} +1 -1
  56. package/dist/assets/device-detail-Bg2Ezyca.js +1 -0
  57. package/dist/assets/{device-integration-icon-BL4OR8Tu.js → device-integration-icon-C0zbgR36.js} +1 -1
  58. package/dist/assets/device-picker-model-QTALOVj9.js +1 -0
  59. package/dist/assets/{dist-b4Z4Rn9L.js → dist-BqygMNK3.js} +1 -1
  60. package/dist/assets/dist-DcdbWcG-.js +1120 -0
  61. package/dist/assets/{format-D-lO-1j1.js → format-DVtQDLvq.js} +1 -1
  62. package/dist/assets/{hostInit-DVaasUc0.js → hostInit-BTfD9BWB.js} +1 -1
  63. package/dist/assets/i18n-CtEN5OSf.js +1 -0
  64. package/dist/assets/icons-J91dUPcu.js +1 -0
  65. package/dist/assets/index-BuwKkAl-.js +6 -0
  66. package/dist/assets/index-pEaRJHY2.css +2 -0
  67. package/dist/assets/{linked-devices-model-Bz36XHKW.js → linked-devices-model-CmiXN3Md.js} +1 -1
  68. package/dist/assets/{mf-entry-bootstrap-0-a6b7ded2.js → mf-entry-bootstrap-0-8b23b2f2.js} +2 -2
  69. package/dist/assets/mount-QTALOVj9.js +1 -0
  70. package/dist/assets/{notification-rule-status-BprPUtT4.js → notification-rule-status-C6gd_uCT.js} +1 -1
  71. package/dist/assets/player-overlays-CMIUmcCR.js +1 -0
  72. package/dist/assets/remoteEntry-CYYrFOe1.js +1 -0
  73. package/dist/assets/scissors-DpiKUioV.js +1 -0
  74. package/dist/assets/settings-section-shape-DbQZZpNL.js +1 -0
  75. package/dist/assets/square-check-big-DAcFGNUN.js +1 -0
  76. package/dist/assets/src-CZCLpkMn.js +279 -0
  77. package/dist/assets/{sso-popup-CTYyuiaU.js → sso-popup-CH6-S_OR.js} +1 -1
  78. package/dist/assets/{step-inspector-model-BBqHZ2d-.js → step-inspector-model-BG1lVQcU.js} +1 -1
  79. package/dist/assets/terminal-Dgb4lrgM.js +1 -0
  80. package/dist/assets/{use-scenes-feed-Ci4MtEAr.js → use-scenes-feed-CWLyPlSj.js} +1 -1
  81. package/dist/assets/{useAdminDeviceRemoval-C2ITjRTs.js → useAdminDeviceRemoval-CK2_Fytr.js} +1 -1
  82. package/dist/assets/useEventInvalidation-QTALOVj9.js +1 -0
  83. package/dist/assets/{useNodeUrlSelection-Dfowz4k5.js → useNodeUrlSelection-piTRveNK.js} +1 -1
  84. package/dist/assets/user-x-DkWcmF99.js +1 -0
  85. package/dist/assets/variable-DTEpBbRf.js +1 -0
  86. package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-D4WQjLc3.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-ePjBjURL.js} +2 -2
  87. package/dist/index.html +10 -10
  88. package/dist/server/addon.js +317 -11
  89. package/package.json +2 -2
  90. package/dist/assets/Addons-DY29xpxZ.js +0 -5
  91. package/dist/assets/BootstrapSettingsForm-Cyk46Mh8.js +0 -1
  92. package/dist/assets/Build-CDp7r2o2.js +0 -42
  93. package/dist/assets/Cluster-Dr-johc0.js +0 -1
  94. package/dist/assets/CompositionBlockEditor-Dm8WVd7r.js +0 -2
  95. package/dist/assets/CompositionEditorPage-BQzbI-bs.js +0 -1
  96. package/dist/assets/Data-DLn1T8hw.js +0 -2
  97. package/dist/assets/DeviceDetail-BiT7xDfc.js +0 -2
  98. package/dist/assets/History-BbdiSj1c.js +0 -1
  99. package/dist/assets/Identity-C0GPwuiI.js +0 -1
  100. package/dist/assets/InstancesTable-j-4OK4zO.js +0 -1
  101. package/dist/assets/IntegrationDetail-jfy5nNNW.js +0 -1
  102. package/dist/assets/Integrations-beSlWUhd.js +0 -1
  103. package/dist/assets/Library-B2A58WTO.js +0 -1
  104. package/dist/assets/Locations-CisH18lP.js +0 -3
  105. package/dist/assets/Logs-D7jdjIJK.js +0 -1
  106. package/dist/assets/MyAccess-BaeZoW7T.js +0 -2
  107. package/dist/assets/NodeAddonsSettingsPanel-Cs-4A2nm.js +0 -2
  108. package/dist/assets/Notifications-BLIvNXbr.js +0 -1
  109. package/dist/assets/Pipeline-DQlV8HzY.js +0 -1
  110. package/dist/assets/Recordings-BoAz9UAs.js +0 -1
  111. package/dist/assets/ServerShell-CTyuWz03.js +0 -1
  112. package/dist/assets/SessionsList-CKIbxGRm.js +0 -2
  113. package/dist/assets/StorageLocationsTable-C4W7zsGI.js +0 -1
  114. package/dist/assets/System-JFcPuvVK.js +0 -1
  115. package/dist/assets/TemplateEditorDialog-BqcmsBtt.js +0 -1
  116. package/dist/assets/Terminal-DpsQgC9x.js +0 -3
  117. package/dist/assets/archive-ChKlYFY2.js +0 -1
  118. package/dist/assets/client-CuXMhtQa.js +0 -1120
  119. package/dist/assets/device-detail-DJ7UsGNh.js +0 -1
  120. package/dist/assets/device-picker-model-CmD_rtEB.js +0 -1
  121. package/dist/assets/dist-BIKSreSn.js +0 -1120
  122. package/dist/assets/i18n-BXCE99oN.js +0 -1
  123. package/dist/assets/icons-C8z46zRV.js +0 -1
  124. package/dist/assets/index-CJG5kQrR.css +0 -2
  125. package/dist/assets/index-DltGFPYA.js +0 -4
  126. package/dist/assets/mount-CmD_rtEB.js +0 -1
  127. package/dist/assets/player-overlays-6CqWKNYt.js +0 -1
  128. package/dist/assets/remoteEntry-DKzXIU3g.js +0 -1
  129. package/dist/assets/scissors-Bbq6WhOK.js +0 -1
  130. package/dist/assets/src-Ddt5cb2R.js +0 -279
  131. package/dist/assets/terminal-DU-tvcEm.js +0 -1
  132. package/dist/assets/use-stationary-objects-DK2HFw6V.js +0 -1
  133. package/dist/assets/useEventInvalidation-CmD_rtEB.js +0 -1
  134. package/dist/assets/user-x-BcmVBo8D.js +0 -1
  135. package/dist/assets/variable-Cq3v1-Kt.js +0 -1
  136. /package/dist/assets/{TerminalPanel-kHJ-D0s7.css → Terminal-kHJ-D0s7.css} +0 -0
@@ -5943,7 +5943,7 @@ var ZodIssueCode = {
5943
5943
  var ZodFirstPartyTypeKind;
5944
5944
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5945
5945
  //#endregion
5946
- //#region ../types/dist/sleep-DnhxKL99.mjs
5946
+ //#region ../types/dist/sleep-Ch7Q7UtE.mjs
5947
5947
  /**
5948
5948
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5949
5949
  * window to float samples (D455).
@@ -9295,6 +9295,18 @@ var RuleFireOriginSchema = object({
9295
9295
  cameraId: number$1().int()
9296
9296
  })).optional()
9297
9297
  });
9298
+ /** WHO an exporter acts for: the ecosystem and the principal it reported, never invented. */
9299
+ var OnBehalfSchema = object({
9300
+ source: _enum([
9301
+ "homeassistant",
9302
+ "homekit",
9303
+ "alexa",
9304
+ "google",
9305
+ "matter"
9306
+ ]),
9307
+ principalId: string(),
9308
+ principalName: string().optional()
9309
+ });
9298
9310
  discriminatedUnion("kind", [
9299
9311
  object({
9300
9312
  kind: literal("action"),
@@ -9311,7 +9323,8 @@ discriminatedUnion("kind", [
9311
9323
  object({
9312
9324
  kind: literal("rule"),
9313
9325
  fire: RuleFireOriginSchema
9314
- })
9326
+ }),
9327
+ OnBehalfSchema.extend({ kind: literal("on-behalf") })
9315
9328
  ]);
9316
9329
  /**
9317
9330
  * One recorded device transition (D1022): a status field of a device went from
@@ -9347,7 +9360,9 @@ var TransitionActorSchema = discriminatedUnion("kind", [
9347
9360
  object({
9348
9361
  kind: literal("addon"),
9349
9362
  addonId: string(),
9350
- nodeId: string().optional()
9363
+ nodeId: string().optional(),
9364
+ /** The ecosystem principal an exporter relayed, when it reported one. */
9365
+ onBehalf: OnBehalfSchema.optional()
9351
9366
  }),
9352
9367
  object({
9353
9368
  kind: literal("action"),
@@ -12665,6 +12680,62 @@ var CAP_VOCABULARY_BY_NAME = {
12665
12680
  }],
12666
12681
  events: { onMotionTriggerChanged: { notOperatorFacing: "the `enabled` state trigger phrases both edges of this change" } }
12667
12682
  },
12683
+ "siren": {
12684
+ scope: "device",
12685
+ noun: {
12686
+ en: "Siren",
12687
+ it: "Sirena"
12688
+ },
12689
+ actions: [{
12690
+ id: "siren.trigger",
12691
+ method: "trigger",
12692
+ label: {
12693
+ en: "Sound the siren",
12694
+ it: "Fai suonare la sirena"
12695
+ },
12696
+ phrase: {
12697
+ en: "Sound {device}",
12698
+ it: "Fai suonare {device}"
12699
+ },
12700
+ icon: "siren",
12701
+ args: {}
12702
+ }, {
12703
+ id: "siren.stop",
12704
+ method: "stop",
12705
+ label: {
12706
+ en: "Silence the siren",
12707
+ it: "Zittisci la sirena"
12708
+ },
12709
+ phrase: {
12710
+ en: "Silence {device}",
12711
+ it: "Zittisci {device}"
12712
+ },
12713
+ icon: "siren",
12714
+ args: {},
12715
+ effect: {
12716
+ field: "active",
12717
+ value: false
12718
+ }
12719
+ }],
12720
+ state: [{
12721
+ kind: "boolean",
12722
+ field: "active",
12723
+ label: {
12724
+ en: "Siren sounding",
12725
+ it: "Sirena in funzione"
12726
+ },
12727
+ whenTrue: {
12728
+ en: "When {device} starts sounding",
12729
+ it: "Quando {device} inizia a suonare"
12730
+ },
12731
+ whenFalse: {
12732
+ en: "When {device} falls silent",
12733
+ it: "Quando {device} smette di suonare"
12734
+ },
12735
+ icon: "siren"
12736
+ }],
12737
+ events: { onSirenChanged: { notOperatorFacing: "the `active` state trigger phrases both edges of this change" } }
12738
+ },
12668
12739
  "vacuum-control": {
12669
12740
  scope: "device",
12670
12741
  noun: {
@@ -19080,6 +19151,7 @@ var CAP_NAMES = Object.freeze([
19080
19151
  "script-runner",
19081
19152
  "server-management",
19082
19153
  "settings-store",
19154
+ "siren",
19083
19155
  "smoke",
19084
19156
  "smtp-provider",
19085
19157
  "snapshot",
@@ -20804,6 +20876,24 @@ Object.freeze({
20804
20876
  "valueType": "string"
20805
20877
  }
20806
20878
  ],
20879
+ "siren": [
20880
+ {
20881
+ "path": "active",
20882
+ "valueType": "boolean"
20883
+ },
20884
+ {
20885
+ "path": "activeUntil",
20886
+ "valueType": "number"
20887
+ },
20888
+ {
20889
+ "path": "durationSeconds",
20890
+ "valueType": "number"
20891
+ },
20892
+ {
20893
+ "path": "lastTriggeredAt",
20894
+ "valueType": "number"
20895
+ }
20896
+ ],
20807
20897
  "smoke": [{
20808
20898
  "path": "detected",
20809
20899
  "valueType": "boolean"
@@ -74741,7 +74831,32 @@ var NcRuleInputSchema = object({
74741
74831
  * authored before this field meant. An editor turns it off by writing
74742
74832
  * `false`, so it needs no `clear` key.
74743
74833
  */
74744
- askVerdict: boolean().optional()
74834
+ askVerdict: boolean().optional(),
74835
+ /**
74836
+ * Operator tags (D1054), kept on the rule like a core block's. Absent = no
74837
+ * tags. `.optional()`, never `.default()`: a partial `updateRule` patch that
74838
+ * does not name `tags` keeps the stored ones (the store merges), and an
74839
+ * editor empties them by sending `[]` (the store drops an empty list).
74840
+ * Renamed or removed fleet-wide only through the `tags` cap, which writes
74841
+ * here with `setRuleTags`.
74842
+ */
74843
+ tags: TagsFieldSchema.optional()
74844
+ });
74845
+ /**
74846
+ * The rule kinds that carry tags (D1054) — each one its own store. Every kind
74847
+ * labels its rules the same way; this names which store a tag write goes to.
74848
+ */
74849
+ var NcTaggedRuleKindSchema = _enum([
74850
+ "event",
74851
+ "summary",
74852
+ "timelapse",
74853
+ "calendar-events"
74854
+ ]);
74855
+ /** One rule's tags, as the `tags` cap reads them across every kind. */
74856
+ var NcRuleTagsEntrySchema = object({
74857
+ kind: NcTaggedRuleKindSchema,
74858
+ ruleId: string(),
74859
+ tags: array(string())
74745
74860
  });
74746
74861
  /**
74747
74862
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -75758,6 +75873,16 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
75758
75873
  }), object({ success: literal(true) }), {
75759
75874
  kind: "mutation",
75760
75875
  auth: "admin"
75876
+ }), method(object({}), object({ rules: array(NcRuleTagsEntrySchema) }), {
75877
+ kind: "query",
75878
+ auth: "admin"
75879
+ }), method(object({
75880
+ kind: NcTaggedRuleKindSchema,
75881
+ ruleId: string(),
75882
+ tags: TagsFieldSchema
75883
+ }), object({ success: literal(true) }), {
75884
+ kind: "mutation",
75885
+ auth: "admin"
75761
75886
  }), method(object({}), NcClipRetentionPlanSchema, { auth: "admin" }), method(object({}), object({ mutedDeviceIds: array(number$1().int()).readonly() }), { auth: "admin" }), method(object({
75762
75887
  deviceId: number$1().int(),
75763
75888
  muted: boolean()
@@ -82543,6 +82668,101 @@ method(_void(), ServerPackageStatusSchema, { auth: "admin" }), method(_void(), S
82543
82668
  auth: "admin"
82544
82669
  }), NOT_A_DEVICE.CLUSTER;
82545
82670
  /**
82671
+ * Timed siren: trigger the siren for a duration and know until when it sounds.
82672
+ *
82673
+ * The plain on/off `switch` of a siren stays as it is (HomeKit / Alexa see a
82674
+ * switch); this cap adds the part a switch cannot say — HOW LONG, and the
82675
+ * moment the siren is expected to fall silent (`activeUntil`, epoch ms), so a
82676
+ * UI can show the activation with a countdown.
82677
+ *
82678
+ * The allowed durations are never hardcoded: `getOptions` answers what the
82679
+ * CAMERA reports (a discrete list or `{min,max,step}`), the default, and the
82680
+ * unit truth — a camera that counts plays rather than seconds says so, with the
82681
+ * seconds-per-play factor used to convert, and whether that factor was read
82682
+ * from the camera or is an estimate.
82683
+ */
82684
+ /** What the camera counts natively. */
82685
+ var SirenDurationUnit = {
82686
+ Seconds: "seconds",
82687
+ Plays: "plays"
82688
+ };
82689
+ /** Where the numbers of an options answer come from. */
82690
+ var SirenOptionsSource = {
82691
+ /** Read from the camera by this fetch. */
82692
+ Camera: "camera",
82693
+ /** The camera did not answer or does not advertise it; a documented fallback. */
82694
+ Fallback: "fallback"
82695
+ };
82696
+ var SirenDurationRangeSchema = object({
82697
+ min: number$1().positive(),
82698
+ max: number$1().positive(),
82699
+ step: number$1().positive()
82700
+ });
82701
+ var SirenOptionsSchema = object({
82702
+ /** Discrete durations in seconds the operator may pick; `null` when the camera gives a range. */
82703
+ allowedSeconds: array(number$1().positive()).nullable(),
82704
+ /** Continuous range in seconds; `null` when the camera gives a discrete list. */
82705
+ rangeSeconds: SirenDurationRangeSchema.nullable(),
82706
+ /** The camera's default duration, seconds. */
82707
+ defaultSeconds: number$1().positive(),
82708
+ /** What the camera counts natively. */
82709
+ unit: _enum([SirenDurationUnit.Seconds, SirenDurationUnit.Plays]),
82710
+ /** Seconds one play lasts, when `unit` is `plays`; `null` for a seconds camera. */
82711
+ secondsPerPlay: number$1().positive().nullable(),
82712
+ /** `camera` when the values were read from it, `fallback` when the camera could not say. */
82713
+ source: _enum([SirenOptionsSource.Camera, SirenOptionsSource.Fallback]),
82714
+ /** Ms epoch of the read that produced this answer. */
82715
+ fetchedAt: number$1()
82716
+ });
82717
+ var SirenStatusSchema = object({
82718
+ /** True while the siren is sounding by a timed trigger or switched on. */
82719
+ active: boolean(),
82720
+ /** Ms epoch the siren is expected to fall silent; `null` when not active or open-ended. */
82721
+ activeUntil: number$1().nullable(),
82722
+ /** Duration of the current / last activation, seconds; `null` when none yet. */
82723
+ durationSeconds: number$1().nullable(),
82724
+ /** Ms epoch of the last trigger (0 = never). */
82725
+ lastTriggeredAt: number$1()
82726
+ });
82727
+ SirenStatusSchema.extend({
82728
+ /** Ms epoch of the last successful camera read of the options (0 = never). */
82729
+ lastFetchedAt: number$1() });
82730
+ DeviceType.Siren, method(object({ deviceId: number$1().int().nonnegative() }), SirenOptionsSchema, {
82731
+ kind: "query",
82732
+ auth: "protected"
82733
+ }), method(object({
82734
+ deviceId: number$1().int().nonnegative(),
82735
+ durationSeconds: number$1().positive().optional()
82736
+ }), SirenStatusSchema, {
82737
+ kind: "mutation",
82738
+ auth: "protected",
82739
+ actions: [{
82740
+ id: "siren.trigger",
82741
+ label: t("Sound the siren", "Fai suonare la sirena"),
82742
+ phrase: t("Sound {device}", "Fai suonare {device}"),
82743
+ icon: "siren",
82744
+ args: {}
82745
+ }]
82746
+ }), method(object({ deviceId: number$1().int().nonnegative() }), SirenStatusSchema, {
82747
+ kind: "mutation",
82748
+ auth: "protected",
82749
+ actions: [{
82750
+ id: "siren.stop",
82751
+ label: t("Silence the siren", "Zittisci la sirena"),
82752
+ phrase: t("Silence {device}", "Zittisci {device}"),
82753
+ icon: "siren",
82754
+ effect: {
82755
+ field: "active",
82756
+ value: false
82757
+ },
82758
+ args: {}
82759
+ }]
82760
+ }), object({
82761
+ deviceId: number$1(),
82762
+ active: boolean(),
82763
+ activeUntil: number$1().nullable()
82764
+ });
82765
+ /**
82546
82766
  * Smoke alarm sensor — boolean "is smoke currently detected" with
82547
82767
  * timestamp of the last transition. Drives Home Assistant
82548
82768
  * `binary_sensor` entries with `device_class: smoke`.
@@ -84068,10 +84288,11 @@ method(_void(), SystemInfoSchema), method(_void(), HealthStatusSchema), method(_
84068
84288
  /**
84069
84289
  * tags — the registry of tag STYLES and the one place that renames or removes a
84070
84290
  * tag everywhere (D1054). A tag itself lives in the `tags` array of the record it
84071
- * labels (a core block, a scheduler, a template, an action, a device); only its
84291
+ * labels (a core block, a scheduler, a template, an action, a device, a
84292
+ * notification rule); only its
84072
84293
  * colour token and icon are registered here. Provided by the core-blocks builtin,
84073
- * the one place that knows every owner kind; devices are reached through
84074
- * `deviceManager` over `ctx.api`.
84294
+ * the one place that knows every owner kind; devices and notification rules
84295
+ * are reached through `deviceManager` / `notificationRules` over `ctx.api`.
84075
84296
  *
84076
84297
  * Tags compare trimmed and case-insensitively. `list` is the union of styled tags
84077
84298
  * and tags in use; a tag with no style answers a colour derived from its name and
@@ -84082,7 +84303,21 @@ var TagUsageCountsSchema = object({
84082
84303
  schedulers: number$1().int().nonnegative(),
84083
84304
  templates: number$1().int().nonnegative(),
84084
84305
  actions: number$1().int().nonnegative(),
84085
- devices: number$1().int().nonnegative()
84306
+ devices: number$1().int().nonnegative(),
84307
+ notificationRules: number$1().int().nonnegative()
84308
+ });
84309
+ /**
84310
+ * The counts `list` answers. An owner that could not be read (a forked addon
84311
+ * that is down, redeploying or not installed) is `null` — unknown, never `0`
84312
+ * (D393) — and `list` still answers with the other owners' tags.
84313
+ */
84314
+ var TagListCountsSchema = object({
84315
+ coreBlocks: number$1().int().nonnegative().nullable(),
84316
+ schedulers: number$1().int().nonnegative().nullable(),
84317
+ templates: number$1().int().nonnegative().nullable(),
84318
+ actions: number$1().int().nonnegative().nullable(),
84319
+ devices: number$1().int().nonnegative().nullable(),
84320
+ notificationRules: number$1().int().nonnegative().nullable()
84086
84321
  });
84087
84322
  var TagEntrySchema = object({
84088
84323
  name: TagNameSchema,
@@ -84090,7 +84325,8 @@ var TagEntrySchema = object({
84090
84325
  icon: IconKeySchema,
84091
84326
  /** `false` when the operator never chose a style: colour and icon are the derived defaults. */
84092
84327
  styled: boolean(),
84093
- counts: TagUsageCountsSchema
84328
+ /** Per owner kind; `null` = that owner could not be read on this call. */
84329
+ counts: TagListCountsSchema
84094
84330
  });
84095
84331
  method(object({}), array(TagEntrySchema), { auth: "protected" }), method(object({
84096
84332
  name: TagNameSchema,
@@ -84566,7 +84802,11 @@ var TerminalSessionInfoSchema = object({
84566
84802
  cols: number$1().int().positive(),
84567
84803
  rows: number$1().int().positive(),
84568
84804
  /** ms-epoch the session's pty was spawned. */
84569
- startedAt: number$1()
84805
+ startedAt: number$1(),
84806
+ /** User id of the admin who opened it; `unattributed` when the caller was not passed. */
84807
+ openedBy: string().optional(),
84808
+ /** ms-epoch of the last pty input or output — what the idle timeout measures. */
84809
+ lastActivityAt: number$1().optional()
84570
84810
  });
84571
84811
  /**
84572
84812
  * A profile the operator may open — a pre-declared, allowlisted program
@@ -95609,6 +95849,13 @@ Object.freeze({
95609
95849
  access: "view",
95610
95850
  role: "admin"
95611
95851
  },
95852
+ "notificationRules.listRuleTags": {
95853
+ capName: "notification-rules",
95854
+ capScope: "system",
95855
+ addonId: null,
95856
+ access: "view",
95857
+ role: "admin"
95858
+ },
95612
95859
  "notificationRules.listSnoozes": {
95613
95860
  capName: "notification-rules",
95614
95861
  capScope: "system",
@@ -95665,6 +95912,13 @@ Object.freeze({
95665
95912
  access: "create",
95666
95913
  role: "admin"
95667
95914
  },
95915
+ "notificationRules.setRuleTags": {
95916
+ capName: "notification-rules",
95917
+ capScope: "system",
95918
+ addonId: null,
95919
+ access: "create",
95920
+ role: "admin"
95921
+ },
95668
95922
  "notificationRules.testRule": {
95669
95923
  capName: "notification-rules",
95670
95924
  capScope: "system",
@@ -98626,6 +98880,34 @@ Object.freeze({
98626
98880
  access: "create",
98627
98881
  role: "admin"
98628
98882
  },
98883
+ "siren.getOptions": {
98884
+ capName: "siren",
98885
+ capScope: "device",
98886
+ addonId: null,
98887
+ access: "view",
98888
+ role: "viewer"
98889
+ },
98890
+ "siren.getStatus": {
98891
+ capName: "siren",
98892
+ capScope: "device",
98893
+ addonId: null,
98894
+ access: "view",
98895
+ role: "viewer"
98896
+ },
98897
+ "siren.stop": {
98898
+ capName: "siren",
98899
+ capScope: "device",
98900
+ addonId: null,
98901
+ access: "create",
98902
+ role: "viewer"
98903
+ },
98904
+ "siren.trigger": {
98905
+ capName: "siren",
98906
+ capScope: "device",
98907
+ addonId: null,
98908
+ access: "create",
98909
+ role: "viewer"
98910
+ },
98629
98911
  "smoke.getStatus": {
98630
98912
  capName: "smoke",
98631
98913
  capScope: "device",
@@ -103337,6 +103619,26 @@ Object.freeze({
103337
103619
  form: "single",
103338
103620
  optional: false
103339
103621
  }],
103622
+ "siren.getOptions": [{
103623
+ name: "deviceId",
103624
+ form: "single",
103625
+ optional: false
103626
+ }],
103627
+ "siren.getStatus": [{
103628
+ name: "deviceId",
103629
+ form: "single",
103630
+ optional: false
103631
+ }],
103632
+ "siren.stop": [{
103633
+ name: "deviceId",
103634
+ form: "single",
103635
+ optional: false
103636
+ }],
103637
+ "siren.trigger": [{
103638
+ name: "deviceId",
103639
+ form: "single",
103640
+ optional: false
103641
+ }],
103340
103642
  "smoke.getStatus": [{
103341
103643
  name: "deviceId",
103342
103644
  form: "single",
@@ -104965,6 +105267,8 @@ var TimelapseRuleInputSchema = object({
104965
105267
  /** Canonical notification priority ordinal (1..5); per-target overridable. */
104966
105268
  priority: PriorityField.default(3),
104967
105269
  /** Per-target settings keyed by target id (D1032) — absent = every target follows the rule. */
105270
+ /** Operator labels (D1054) — optional and NEVER defaulted: an absent key leaves the stored tags alone; `[]` clears them. Admin-only. */
105271
+ tags: TagsFieldSchema.optional(),
104968
105272
  targetOverrides: NcTargetOverridesSchema.optional()
104969
105273
  });
104970
105274
  object({
@@ -104983,6 +105287,8 @@ object({
104983
105287
  reportClasses: ReportClassesField.optional(),
104984
105288
  priority: PriorityField.optional(),
104985
105289
  /** Per-target settings keyed by target id (D1032) — absent = every target follows the rule. */
105290
+ /** Absent = keep the stored tags; `[]` clears them (D1054). Never defaulted. */
105291
+ tags: TagsFieldSchema.optional(),
104986
105292
  targetOverrides: NcTargetOverridesSchema.optional()
104987
105293
  });
104988
105294
  TimelapseRuleInputSchema.extend({
@@ -105236,7 +105542,7 @@ var AdminUIAddon = class extends BaseAddon {
105236
105542
  capability: adminUiCapability,
105237
105543
  provider: {
105238
105544
  getStaticDir: async () => ({ staticDir: resolveAdminUiDistDir() }),
105239
- getVersion: async () => ({ version: "1.2.689" })
105545
+ getVersion: async () => ({ version: "1.2.691" })
105240
105546
  }
105241
105547
  }];
105242
105548
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-admin-ui",
3
- "version": "1.2.689",
3
+ "version": "1.2.691",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Admin UI — Vite frontend build and server-side addon",
@@ -50,7 +50,7 @@
50
50
  }
51
51
  ],
52
52
  "requires": {
53
- "server": ">=1.2.889"
53
+ "server": ">=1.2.891"
54
54
  }
55
55
  },
56
56
  "scripts": {
@@ -1,5 +0,0 @@
1
- import{B as e,C as t,J as n,K as r,R as i,S as a,V as o,Y as s,et as c,o as l,x as u}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CEyXHAdg.js";import{$i as d,Bn as f,Gi as p,Gt as m,In as h,Li as g,Lr as _,Q as v,Tn as y,Tt as b,Vn as x,Yn as S,Zt as C,ct as ee,er as w,ft as te,hr as T,na as E,ot as ne,tn as D,xi as re}from"./player-overlays-6CqWKNYt.js";import{Xc as O}from"./client-CuXMhtQa.js";import{t as ie}from"./chevron-down-CBb-F8DT.js";import{i as k,u as A}from"./terminal-DU-tvcEm.js";import{$a as ae,Ga as oe,Gc as se,Hi as ce,Ja as le,Li as ue,Mp as de,Qa as j,Ri as fe,Ui as pe,Vi as me,Xa as he,Xf as M,Ya as N,Za as ge,ao as P,co as F,ct as _e,do as I,ei as L,eo as R,fr as ve,ho as ye,io as z,ip as be,kp as B,li as V,lo as xe,mo as H,ni as U,no as Se,oo as Ce,po as W,pr as we,qa as Te,ri as Ee,ro as De,ti as Oe,uo as ke,va as Ae,vt as G,zi as je,zl as Me}from"./src-Ddt5cb2R.js";import{t as K}from"./useTranslation-BJr-n0es.js";import"./mount-CmD_rtEB.js";import{gi as Ne,mi as Pe,ot as Fe,st as Ie,ui as Le}from"./index-DltGFPYA.js";import{t as q}from"./AdminPage-BZ0d3KIi.js";import{i as Re,r as ze,t as Be}from"./addon-kind-filter-CEGKkC1O.js";import{t as J}from"./NodeAddonsSettingsPanel-Cs-4A2nm.js";import{n as Y,r as Ve,t as He}from"./useNodeUrlSelection-Dfowz4k5.js";function Ue(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}}c();var We={queued:{icon:g,bg:`bg-muted text-foreground-subtle`,labelKey:`addons.addonRowBadge.queued`},updating:{icon:_,bg:`bg-primary/10 text-primary`,labelKey:`addons.addonRowBadge.updating`,spin:!0},"done-pending-restart":{icon:S,bg:`bg-amber-500/10 text-amber-700`,labelKey:`addons.addonRowBadge.pendingRestart`},done:{icon:E,bg:`bg-success/10 text-success`,labelKey:`addons.addonRowBadge.done`},failed:{icon:k,bg:`bg-danger/10 text-danger`,labelKey:`addons.addonRowBadge.failed`}};function X({item:e}){let{t:n}=K(),r=We[e.status],i=r.icon;return t(`span`,{className:`inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] rounded ${r.bg}`,title:e.error,children:[a(i,{className:`w-2.5 h-2.5 ${r.spin?`animate-spin`:``}`}),n(r.labelKey)]})}var Z=new Set([`completed`,`failed`,`partially-failed`,`cancelled`]),Ge=new Set([`done`,`failed`,`skipped`]);function Ke(e){return!Ge.has(e.phase)&&!Z.has(e.jobState)}function qe(e,t){let n=new Map,r=[...e].sort((e,t)=>e.createdAtMs-t.createdAtMs);for(let e of r){let r=Z.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 Je(){let{data:e}=De({activeOnly:!0},{refetchOnWindowFocus:!1,refetchInterval:e=>(e.state.data?.length??0)>0?3e3:!1}),{map:t}=de(O.AddonsJobProgress,e=>e.job.jobId);return r(()=>{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 qe([...n.values()],Date.now())},[e,t])}var Ye={queued:{icon:g,cls:`bg-muted text-foreground-subtle`,labelKey:`addons.jobProgress.queued`},fetching:{icon:_,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.fetching`,spin:!0},staged:{icon:_,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.staged`,spin:!0},validating:{icon:_,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.validating`,spin:!0},applying:{icon:_,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.applying`,spin:!0},restarting:{icon:_,cls:`bg-amber-500/10 text-amber-600 dark:text-amber-400`,labelKey:`addons.jobProgress.restarting`,spin:!0},applied:{icon:_,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.finalizing`,spin:!0},done:{icon:E,cls:`bg-success/10 text-success`,labelKey:`addons.jobProgress.updated`},failed:{icon:k,cls:`bg-danger/10 text-danger`,labelKey:`addons.jobProgress.failed`},skipped:{icon:y,cls:`bg-muted text-foreground-subtle`,labelKey:`addons.jobProgress.skipped`}};function Xe({progress:e}){let{t:n}=K(),r=Ye[e.phase],i=r.icon,o=e.error??`${e.packageName}: ${e.fromVersion??`?`} → ${e.toVersion}`;return t(`span`,{"data-testid":`addon-job-progress`,className:`inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] rounded shrink-0 ${r.cls}`,title:o,children:[a(i,{className:`w-2.5 h-2.5 ${r.spin?`animate-spin`:``}`}),n(r.labelKey),t(`span`,{className:`font-mono`,children:[`→ `,e.toVersion]})]})}function Ze(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 Qe(e){let t=e.version===null?``:` ${e.version}`,n=e.isOnline?``:` (offline: removed when it reconnects)`;return`- ${e.nodeName}${t}${n}`}function $e(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(Qe)];return n.length>0&&r.push(`Could not ask: ${n.join(`, `)} — not included.`),r.push(`This cannot be undone.`),r.join(`
2
- `)}function Q(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 et={uninstalled:`uninstalled`,"not-installed":`was not installed`,refused:`REFUSED`,failed:`FAILED`,"pending-reconnect":`offline — removed when it reconnects`};function tt(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)}: ${et[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 nt={},rt=3e4,it=`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 at({packageName:e,displayName:n,selectedNode:r,hideNodeAction:i,disabled:o}){let{t:s}=K(),c=l(),u=ee(),d=ne(),f=Se(nt,{staleTime:rt}),p=f.data?.installations??[],m=(f.data?.unreachable??[]).map(e=>e.nodeId),h=Ze(p,e),g=e=>h.find(t=>t.nodeId===e)?.nodeName??(e===r.id?r.name:e),_=H({onSettled:()=>{c.invalidateQueries({queryKey:[[`addons`]]}),c.invalidateQueries({queryKey:[[`addonPages`]]}),c.invalidateQueries({queryKey:[[`capabilities`]]}),c.invalidateQueries({queryKey:[[`nodes`]]})}}),v=async e=>{await d({title:e.success?s(`addons.addonUninstallControls.uninstalled`,`{{displayName}} uninstalled`,{displayName:n}):s(`addons.addonUninstallControls.notEveryNodeWasCleaned`,`{{displayName}}: not every node was cleaned`,{displayName:n}),message:tt(e,g),variant:e.success?`default`:`danger`})},y=async t=>{try{await v(await _.mutateAsync({packageName:e,...t}))}catch(e){await d({title:s(`addons.addonUninstallControls.uninstallFailed`,`Uninstall {{displayName}} failed`,{displayName:n}),message:e instanceof Error?e.message:String(e),variant:`danger`})}},b=async()=>{let e=h.filter(e=>e.nodeId!==r.id);await u({title:s(`addons.addonUninstallControls.uninstallFrom`,`Uninstall {{displayName}} from {{name}}?`,{displayName:n,name:r.name}),message:Q(n,r.name,e),confirmLabel:s(`addons.addonUninstallControls.uninstall`,`Uninstall`),variant:`danger`})&&await y(r.isHub?{}:{nodeId:r.id})},x=async()=>{let t=(await f.refetch()).data;if(t===void 0){await d({title:s(`addons.addonUninstallControls.cannotListTheNodes`,`Cannot list the nodes`),message:s(`addons.addonUninstallControls.theHubDidNotAnswer`,`The hub did not answer which nodes have this package — nothing was removed.`),variant:`danger`});return}let r=Ze(t.installations,e);await u({title:s(`addons.addonUninstallControls.uninstallEverywhere`,`Uninstall {{displayName}} everywhere?`,{displayName:n}),message:$e(n,r,t.unreachable.map(e=>e.nodeId)),confirmLabel:s(`addons.addonUninstallControls.uninstallFromNodeS`,`Uninstall from {{length}} node(s)`,{length:r.length}),variant:`danger`})&&await y({everywhere:!0})},S=_.isPending||o===!0;return t(`div`,{className:`flex items-center gap-1.5`,children:[i!==!0&&t(M,{variant:`unstyled`,type:`button`,onClick:e=>{e.stopPropagation(),b()},disabled:S,className:it,title:s(`addons.addonUninstallControls.uninstallFrom2`,`Uninstall from {{name}}`,{name:r.name}),children:[a(D,{className:`h-3 w-3`}),_.isPending?s(`addons.addonUninstallControls.removing`,`Removing...`):s(`addons.addonUninstallControls.uninstall`,`Uninstall`)]}),(h.length>1||i===!0||m.length>0)&&t(M,{variant:`unstyled`,type:`button`,onClick:e=>{e.stopPropagation(),x()},disabled:S,className:it,title:s(`addons.addonUninstallControls.uninstallFromEveryNodeThat`,`Uninstall from every node that has it`),children:[a(A,{className:`h-3 w-3`}),h.length>0?s(`addons.uninstallControls.everywhereCount`,{count:h.length}):s(`addons.uninstallControls.everywhere`)]})]})}function ot(e){return typeof e.deprecated==`string`&&e.deprecated.length>0}function st(e,t){return t?e:e.filter(e=>e.distTags.includes(`latest`)||!ot(e))}function ct(e){return e.length-st(e,!1).length}c();function lt({packageName:e,currentVersion:n,installSource:r,onInstall:i,onClose:o,onSelect:c,selectedVersion:l}){let{t:d}=K(),f=r===`upload`||r===`local`,[p,h]=s(!1),{data:g,isLoading:v,isError:y}=j({name:e}),x=g?st(g,p):[],S=g?ct(g):0;return t(`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:[t(`div`,{className:`flex items-center justify-between px-3 py-2 border-b border-border`,children:[a(`span`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle font-medium`,children:d(`addons.versionPicker.versions`,`Versions`)}),a(M,{variant:`unstyled`,type:`button`,onClick:o,className:`text-foreground-subtle hover:text-foreground`,children:a(b,{className:`h-3 w-3`})})]}),f&&t(`div`,{className:`flex items-start gap-2 px-3 py-2 border-b border-border bg-cyan-500/10 text-[10px]`,children:[a(m,{className:`h-3 w-3 mt-0.5 text-cyan-500 shrink-0`}),t(`div`,{className:`text-cyan-700 dark:text-cyan-200`,children:[a(`span`,{className:`font-semibold`,children:d(`addons.versionPicker.inPlace`,{kind:r===`upload`?d(`addons.versionPicker.uploadedCopy`,`Uploaded copy`):d(`addons.versionPicker.localCopy`,`Local copy`)})}),` `,a(Le,{i18nKey:`addons.versionPicker.reinstall`,values:{version:n},components:{mono:a(`span`,{className:`font-mono`})}})]})]}),v&&t(`div`,{className:`flex items-center justify-center gap-2 py-6 text-[10px] text-foreground-subtle`,children:[a(_,{className:`h-3.5 w-3.5 animate-spin`}),d(`addons.versionPicker.loadingVersions`,`Loading versions...`)]}),y&&a(`div`,{className:`px-3 py-4 text-center text-[10px] text-danger`,children:d(`addons.versionPicker.registryError`,`Could not load versions from the registry.`)}),x.length>0&&a(`div`,{className:`max-h-64 overflow-auto divide-y divide-border`,children:x.map(e=>{let r=e.version===n,o=c!==void 0&&e.version===l,s=/-(alpha|beta|rc|dev|canary|next)/i.test(e.version),f=t(u,{children:[a(`span`,{className:`font-mono flex-1 text-left ${r?`text-primary font-semibold`:s?`text-amber-400`:`text-foreground`}`,children:e.version}),r&&a(`span`,{className:`text-[9px] rounded-full px-1.5 py-0.5 font-medium bg-primary/10 text-primary`,children:d(`common.current`)}),e.distTags.map(e=>a(`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)),ot(e)&&a(`span`,{className:`text-[9px] text-red-400 line-through`,children:d(`common.deprecated`)}),a(`span`,{className:`text-[9px] text-foreground-subtle shrink-0`,children:new Date(e.publishedAt).toLocaleDateString()})]});return c?t(M,{variant:`unstyled`,type:`button`,"aria-label":d(`addons.versionPicker.select`,`Select {{version}}`,{version:e.version}),onClick:()=>c(e.version),className:`w-full flex items-center gap-2 px-3 py-2 text-[11px] ${o?`bg-primary/5`:`hover:bg-surface-hover`} transition-colors`,children:[f,o?a(E,{className:`h-3 w-3 text-primary shrink-0`}):a(`span`,{className:`w-3 shrink-0`})]},e.version):t(`div`,{className:`flex items-center gap-2 px-3 py-2 text-[11px] ${r?`bg-primary/5`:`hover:bg-surface-hover`} transition-colors`,children:[f,a(M,{variant:`unstyled`,type:`button`,onClick:()=>i(e.version),className:`shrink-0 rounded p-0.5 hover:bg-primary/20 text-foreground-subtle hover:text-primary transition-colors`,title:r?d(`addons.versionPicker.reInstallFromNpm`,`Re-install {{version}} from npm`,{version:e.version}):d(`addons.versionPicker.install`,`Install {{version}}`,{version:e.version}),children:a(re,{className:`h-3 w-3`})})]},e.version)})}),!v&&!y&&g&&g.length===0&&a(`div`,{className:`py-4 text-center text-[10px] text-foreground-subtle`,children:d(`addons.versionPicker.noVersionsFound`,`No versions found`)}),S>0&&a(M,{type:`button`,variant:`ghost`,size:`sm`,className:`h-auto w-full justify-start rounded-none border-t border-border px-3 py-2 text-left text-[10px] font-normal text-foreground-subtle`,onClick:()=>h(e=>!e),children:p?d(`addons.versionPicker.hideOlder`,`Hide older versions`):d(`addons.versionPicker.showOlder`,`Show older versions ({{count}})`,{count:S})})]})}c();var ut=`device-export`;function dt(e){return e.capabilities.some(e=>(typeof e==`string`?e:e.name)===ut)}function ft(e){return e!==`local`&&e!==`upload`}function pt({isBundle:e,installSource:n,addonId:r,iconPath:i,color:o}){let[c,l]=s(!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=r&&i?v(`/api/addon-assets/${r}/${i}`):null,p=!!f&&!c;return t(`div`,{className:`relative flex-shrink-0`,children:[a(`div`,{className:`h-8 w-8 rounded-md flex items-center justify-center ${u?``:d}`,style:u,children:p?a(`img`,{src:f,alt:r,className:`h-4 w-4`,onError:()=>l(!0)}):a(e?T:w,{className:`h-3.5 w-3.5`})}),n===`local`&&a(`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`}),ft(n)&&a(`span`,{className:`absolute -top-1 -left-1 w-4 h-4 rounded bg-[#cb3837] flex items-center justify-center -rotate-12 shadow-sm`,children:a(`svg`,{viewBox:`0 0 780 250`,className:`w-[11px] h-[11px]`,children:a(`path`,{fill:`#fff`,d:`M240 250h100V50h100v200h340V0H0v250z`})})}),n===`upload`&&a(`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:a(m,{className:`h-2.5 w-2.5 text-white`})})]})}function mt({version:e,availableUpdate:n,selectedVersion:r,isUpdating:i,installSource:o,disabled:s,onUpdate:c,onOpenPicker:l,children:u}){let{t:d}=K();if(i)return t(`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:[a(_,{className:`h-3 w-3 animate-spin`}),d(`addons.addonCard.updating`,`Updating…`)]});if(n){let i=r??n;return t(`div`,{className:`relative inline-flex items-center gap-1 shrink-0`,children:[c&&t(M,{variant:`unstyled`,type:`button`,onClick:e=>{e.stopPropagation(),c()},disabled:s,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:i}),children:[a(re,{className:`h-3 w-3`}),d(`addons.addonCard.update`,`Update`)]}),t(M,{variant:`unstyled`,type:`button`,onClick:e=>{e.stopPropagation(),l()},disabled:s,"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:i}),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:[a(`span`,{className:`font-normal opacity-70`,children:e}),a(`span`,{className:`font-normal opacity-70`,children:`→`}),i,a(ie,{className:`h-3 w-3`})]}),u]})}return t(`div`,{className:`relative inline-flex items-center gap-1 shrink-0`,children:[t(M,{variant:`unstyled`,type:`button`,onClick:e=>{e.stopPropagation(),l()},disabled:s,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`,o===`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,a(ie,{className:`h-3 w-3 opacity-50`})]}),u]})}function ht({addonId:e}){let t=l(),{data:n=`inherit`}=le({addonId:e}),r=ke({onSuccess:()=>{t.invalidateQueries({queryKey:[[`addons`,`getAddonAutoUpdate`]]})}});return a(`div`,{className:`flex rounded-lg border border-border overflow-hidden text-[10px] font-medium`,children:[`inherit`,`off`,`latest`,`beta`].map(t=>a(M,{variant:`unstyled`,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 gt={id:`hub`,name:`Hub`,isHub:!0};function _t({addon:e,clusterStatus:n,hideVersion:r,availableUpdate:i,blockedUpdate:c,onUpdateServer:f,onUpdate:p,isUpdating:m,jobProgress:g,bundle:_,bulkItem:v,disabledByBulk:y,isSystem:C,selectedNode:ee}){let{t:w}=K(),[te,E]=s(!1),[ne,D]=s(!1),[re,O]=s(null);o(()=>{O(null)},[i]);let A=re??i,[oe,se]=s(!1),[le,de]=s(!1),[j,he]=s(`logs`),N=l(),ge=Pe(),{manifest:P}=e,_e=!_&&!P.protected&&P.removable!==!1,I=!!_,L=_?.displayName??P.name,R=_?.packageName??P.packageName,ye=_?.version??P.packageVersion??P.version,z=_?.installSource??e.installSource,be=_?_.bundle?.description??_.addons[0]?.manifest.description:P.description,B=Ce({onSuccess:()=>{N.invalidateQueries({queryKey:[[`addons`]]})}}),V=ae({onSuccess:()=>{N.invalidateQueries({queryKey:[[`addons`]]}),N.invalidateQueries({queryKey:[[`addonPages`]]}),N.invalidateQueries({queryKey:[[`capabilities`]]}),N.invalidateQueries({queryKey:[[`integrations`]]})}}),xe=F({onSuccess:()=>{N.invalidateQueries({queryKey:[[`addons`]]}),N.invalidateQueries({queryKey:[[`alerts`]]})}}),H=e.health,U=H?.phase===`failed`&&!H.inGracePeriod,Se=U&&H?.nextRetryAt&&!H.retrying,W=Ue(e.process);return t(`div`,{className:`rounded-md border bg-surface overflow-hidden ${U?`border-red-500/50`:`border-border`}`,children:[U&&H&&t(`div`,{className:`bg-danger/10 border-b border-danger/30 px-3 py-2 flex items-start gap-2`,children:[a(k,{className:`h-4 w-4 text-danger shrink-0 mt-0.5`}),t(`div`,{className:`flex-1 min-w-0`,children:[a(`div`,{className:`text-xs font-semibold text-danger`,children:w(`addons.addonCard.failedToLoad`,{attempt:H.retryCount})}),a(`div`,{className:`text-[11px] text-foreground mt-0.5 break-words font-mono`,children:H.lastError?.message??w(`addons.addonCard.unknownError`,`Unknown error`)}),Se&&H.nextRetryAt&&a(`div`,{className:`text-[10px] text-foreground-subtle mt-1`,children:w(`addons.addonCard.autoRetryAt`,{time:new Date(H.nextRetryAt).toLocaleTimeString()})})]}),t(M,{variant:`unstyled`,type:`button`,disabled:xe.isPending||H.retrying,onClick:e=>{e.stopPropagation(),xe.mutate({packageName:R})},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:[a(S,{className:`h-3 w-3 ${xe.isPending||H.retrying?`animate-spin`:``}`}),w(`addons.addonCard.retryNow`,`Retry now`)]})]}),W!==null&&t(`div`,{className:`bg-danger/10 border-b border-danger/30 px-3 py-2 flex items-start gap-2`,children:[a(k,{className:`h-4 w-4 text-danger shrink-0 mt-0.5`}),t(`div`,{className:`flex-1 min-w-0`,children:[a(`div`,{className:`text-xs font-semibold text-danger`,children:w(`addons.addonCard.processProblem.${W.kind}`)}),W.reason!==void 0&&a(`div`,{className:`text-[11px] text-foreground mt-0.5 break-words font-mono`,children:W.reason})]})]}),t(`div`,{className:`flex items-start gap-2.5 px-3 py-2`,children:[a(pt,{isBundle:I||!!P.components&&P.components.length>1,installSource:z,addonId:I?_.addons[0]?.manifest.id:P.id,iconPath:I?_.bundle?.icon??_.addons[0]?.manifest.icon:P.icon,color:I?_.addons[0]?.manifest.color:P.color}),t(`div`,{className:`flex-1 min-w-0`,children:[t(`div`,{className:`flex items-start justify-between gap-2`,children:[a(`span`,{className:`text-xs font-semibold text-foreground truncate min-w-0`,children:L}),!r&&a(mt,{version:ye,availableUpdate:i,...A===void 0?{}:{selectedVersion:A},isUpdating:m,installSource:z,disabled:y,...p&&A!==void 0?{onUpdate:()=>p(A)}:{},onOpenPicker:()=>D(e=>!e),children:ne&&a(lt,{packageName:R,currentVersion:ye,...z?{installSource:z}:{},...i!==void 0&&A!==void 0?{selectedVersion:A,onSelect:e=>{O(e),D(!1)}}:{},onInstall:e=>{D(!1),V.mutate({packageName:R,version:e})},onClose:()=>D(!1)})})]}),t(`div`,{className:`flex flex-wrap items-center gap-x-1.5 gap-y-1 mt-0.5`,children:[R!==L&&a(`span`,{className:`text-[10px] text-foreground-subtle font-mono truncate max-w-full`,children:R}),I&&t(`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:[a(T,{className:`h-3 w-3`}),_.addons.length]}),C&&t(`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:[a(S,{className:`h-3 w-3`}),w(`addons.addonCard.system`,`System`)]}),v!=null&&a(X,{item:v}),c!==void 0&&a(Ae,{variant:`warning`,title:w(`addons.addonCard.updateHeldTitle`,{defaultValue:`{{latest}} is held until the server is {{required}} or newer`,latest:c.latestVersion,required:c.requiredServer}),children:w(`addons.addonCard.requiresServer`,{defaultValue:`requires server ≥ {{version}}`,version:c.requiredServer})}),c!==void 0&&f!==void 0&&a(M,{type:`button`,size:`sm`,variant:`secondary`,onClick:f,children:w(`clusterUpdate.updateServer`,`Update server`)}),g!=null&&a(Xe,{progress:g})]}),be&&a(`p`,{className:`text-[10px] text-foreground-subtle mt-1 line-clamp-1`,children:be}),!I&&e.process&&t(`div`,{className:`flex flex-wrap items-center gap-1.5 mt-1`,children:[a(`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&&t(`span`,{className:`text-[9px] font-mono text-foreground-subtle`,children:[`PID `,e.process.pid]}),a(`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`:W===null?`bg-gray-500/15 text-gray-400`:`bg-red-500/15 text-red-400`}`,children:e.process.state})]})]})]}),!I&&t(`div`,{className:`flex items-center gap-1 px-3 py-1 border-t border-border/50 bg-surface-hover/20`,children:[t(M,{variant:`unstyled`,type:`button`,onClick:e=>{e.stopPropagation(),B.mutate({addonId:P.id})},disabled:B.isPending||y,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:[a(S,{className:`h-3 w-3 ${B.isPending?`animate-spin`:``}`}),w(`addons.addonCard.restart`,`Restart`)]}),t(M,{variant:`unstyled`,type:`button`,onClick:e=>{e.stopPropagation(),se(e=>!e)},className:`inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[10px] font-medium border transition-colors ${oe?`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:[a(x,{className:`h-3 w-3`}),w(`addons.addonCard.logs`,`Logs`)]}),!I&&t(M,{variant:`unstyled`,type:`button`,onClick:e=>{e.stopPropagation(),de(!0)},className:`inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[10px] font-medium border transition-colors ${le?`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:[a(h,{className:`h-3 w-3`}),w(`addons.addonCard.settings`,`Settings`)]}),a(`div`,{className:`flex-1`}),_e&&a(at,{packageName:P.packageName,displayName:P.name,selectedNode:ee??gt,disabled:y})]}),n&&n.nodes.length>1&&!I&&t(`div`,{className:`border-t border-border px-3 py-1.5 bg-muted/10`,children:[a(`div`,{className:`text-[10px] font-medium text-foreground-subtle mb-1.5`,children:w(`addons.addonCard.clusterDeployment`,`Cluster Deployment`)}),a(`div`,{className:`space-y-1`,children:n.nodes.map(e=>t(`div`,{className:`flex items-center gap-2 text-[10px]`,children:[a(`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`}`}),a(`span`,{className:`font-medium text-foreground min-w-[60px]`,children:e.name}),a(`span`,{className:`font-mono text-foreground-subtle`,children:e.version}),!e.synced&&e.status!==`offline`&&a(`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`&&a(`span`,{className:`text-[9px] px-1 py-0.5 rounded bg-muted text-muted-foreground`,children:w(`common.offline`)}),e.synced&&e.status!==`offline`&&a(`span`,{className:`text-[9px] text-success`,children:w(`common.synced`)})]},e.nodeId))})]}),oe&&!I&&t(`div`,{className:`border-t border-border`,children:[t(`div`,{className:`flex items-center px-3 py-0.5 bg-surface-hover/20 border-b border-border/50`,children:[t(`div`,{className:`flex rounded border border-border overflow-hidden text-[9px]`,children:[a(M,{variant:`unstyled`,type:`button`,onClick:()=>he(`logs`),className:`px-2 py-0.5 transition-colors ${j===`logs`?`bg-primary/10 text-primary`:`text-foreground-subtle hover:bg-surface-hover`}`,children:w(`addons.addonCard.logs`,`Logs`)}),a(M,{variant:`unstyled`,type:`button`,onClick:()=>he(`events`),className:`px-2 py-0.5 border-l border-border transition-colors ${j===`events`?`bg-primary/10 text-primary`:`text-foreground-subtle hover:bg-surface-hover`}`,children:w(`addons.addonCard.events`,`Events`)})]}),a(`div`,{className:`flex-1`}),a(M,{variant:`unstyled`,type:`button`,onClick:e=>{e.stopPropagation(),se(!1)},className:`text-foreground-subtle hover:text-foreground`,children:a(b,{className:`h-3.5 w-3.5`})})]}),j===`logs`&&a(we,{addonId:P.id,maxHeight:`max-h-64`,showFilters:!1}),j===`events`&&a(ve,{addonId:P.id,category:`addon.*`,maxHeight:`max-h-64`})]}),I&&t(u,{children:[a(M,{variant:`unstyled`,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:a(te?d:ie,{className:`h-3.5 w-3.5 text-foreground-subtle`})}),te&&a(`div`,{className:`border-t border-border px-2.5 py-1.5 space-y-1.5`,children:_.addons.map(e=>a(_t,{addon:e,hideVersion:!0},e.manifest.id))})]}),le&&!I&&a(ue,{open:!0,onOpenChange:e=>!e&&de(!1),children:t(je,{width:`lg`,placement:`sheet-on-mobile`,scroll:`body`,children:[a(ce,{children:t(pe,{className:`flex items-center gap-2`,children:[a(h,{className:`h-4 w-4 text-primary`}),w(`addons.addonCard.settingsTitle`,{name:L})]})}),t(fe,{className:`space-y-4`,children:[a(`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.`)}),a(J,{nodeId:null,addonIds:[P.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.`)}),dt(P)&&t(`div`,{children:[a(`div`,{className:`text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2`,children:w(`addons.addonCard.deviceExport`,`Device export`)}),a(G,{addonId:P.id,onOpenDevice:e=>ge(`/devices/${e}`)})]}),ft(z)&&t(`div`,{children:[a(`div`,{className:`text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2`,children:w(`addons.addonCard.autoUpdate`,`Auto-Update`)}),a(ht,{addonId:P.id})]}),P.components&&P.components.length>0&&t(`div`,{children:[a(`div`,{className:`text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2`,children:w(`addons.addonCard.components`,{count:P.components.length})}),a(`div`,{className:`flex flex-wrap gap-1`,children:P.components.map(e=>a(`span`,{className:`text-[10px] rounded bg-background border border-border px-1.5 py-0.5 text-foreground-subtle font-mono`,children:e},e))})]})]}),a(me,{children:a(M,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>de(!1),children:w(`common.close`,`Close`)})})]})})]})}c();var vt=`.tgz,.tar.gz,.zip`;function yt({onUploadSuccess:e}){let{t:r}=K(),[o,c]=s(!1),l=n(null),d=i(async t=>{c(!0);let n=new FormData;n.append(`file`,t);let r=localStorage.getItem(`camstack_admin_token`)??``;try{(await(await fetch(v(`/api/addons/upload`),{method:`POST`,headers:{Authorization:`Bearer ${r}`},body:n})).json()).success&&e()}finally{c(!1)}},[e]);return t(u,{children:[a(V,{ref:l,accept:vt,onChange:i(e=>{let t=e.target.files?.[0];t&&d(t),e.target.value=``},[d]),className:`hidden`}),t(M,{variant:`unstyled`,type:`button`,onClick:()=>l.current?.click(),disabled:o,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:[o?a(_,{className:`w-3.5 h-3.5 animate-spin`}):a(m,{className:`w-3.5 h-3.5`}),o?r(`addons.addonUploadZone.uploading`,`Uploading...`):r(`addons.addonUploadZone.upload`,`Upload`)]})]})}var bt=/```[^\n]*\n([\s\S]*?)```/g;function xt(e){let t=[],n=0;for(let r of e.matchAll(bt)){let i=r.index??0;i>n&&t.push({kind:`text`,body:e.slice(n,i)}),t.push({kind:`code`,body:r[1]??``}),n=i+r[0].length}return n<e.length&&t.push({kind:`text`,body:e.slice(n)}),t}function St(e){let t=e.trim();return t.startsWith(`https://`)||t.startsWith(`http://`)?t:null}function Ct(e,t){let n=[],r=/(\*\*[^*]+\*\*|`[^`]+`|\[[^\]]+\]\([^)]+\))/g,i=0,o=0;for(let s of e.matchAll(r)){let r=s.index??0;r>i&&n.push(e.slice(i,r));let c=s[0],l=`${t}-${o}`;if(o+=1,c.startsWith(`**`))n.push(a(`strong`,{children:c.slice(2,-2)},l));else if(c.startsWith("`"))n.push(a(`code`,{className:`font-mono text-[0.9em]`,children:c.slice(1,-1)},l));else{let e=/^\[([^\]]+)\]\(([^)]+)\)$/.exec(c),t=e?.[1]??c,r=e?St(e[2]??``):null;n.push(r?a(`a`,{href:r,target:`_blank`,rel:`noreferrer noopener`,className:`text-primary underline`,children:t},l):a(`span`,{children:t},l))}i=r+c.length}return i<e.length&&n.push(e.slice(i)),n}function wt(e,t){let n=e.split(`
5
- `),r=[],i=[],o=[],s=0,c=()=>{if(i.length===0)return;let e=i.join(` `).trim();i=[],e.length!==0&&(r.push(a(`p`,{className:`mb-2 last:mb-0`,children:Ct(e,`${t}-p-${s}`)},`${t}-p-${s}`)),s+=1)},l=()=>{if(o.length===0)return;let e=o;o=[],r.push(a(`ul`,{className:`mb-2 list-disc pl-4 last:mb-0`,children:e.map((e,n)=>a(`li`,{children:Ct(e,`${t}-li-${s}-${n}`)},`${t}-li-${s}-${n}`))},`${t}-ul-${s}`)),s+=1};for(let e of n){let n=/^(#{1,3})\s+(.*)$/.exec(e),u=/^\s*[-*]\s+(.*)$/.exec(e);if(n){c(),l();let e=n[1]?.length??1,i=Ct(n[2]??``,`${t}-h-${s}`),o=e===1?`text-sm font-semibold mb-2`:`text-xs font-semibold mb-1.5 mt-2`;r.push(a(e===1?`h3`:`h4`,{className:o,children:i},`${t}-h-${s}`)),s+=1;continue}if(u){c(),o=[...o,u[1]??``];continue}if(e.trim().length===0){c(),l();continue}l(),i=[...i,e.trim()]}return c(),l(),r}function Tt({markdown:e}){return a(`div`,{className:`text-xs text-foreground leading-relaxed`,children:xt(e).map((e,t)=>e.kind===`code`?a(`pre`,{className:`mb-2 overflow-auto rounded-md bg-surface-hover p-2 font-mono text-[10px] last:mb-0`,children:e.body.replace(/\n$/,``)},`code-${t}`):a(`div`,{children:wt(e.body,`b${t}`)},`text-${t}`))})}c();function Et(e){return e.replace(/^@camstack\/(addon-)?/,``)}function Dt(e,t,n){let r=st(e,n);return r.some(e=>e.version===t)?r:[{version:t,distTags:[],deprecated:void 0},...r]}function Ot({pending:e,failed:n,body:r,missing:i}){let{t:o}=K();return e?t(`div`,{className:`flex items-center gap-2 py-6 text-xs text-foreground-subtle`,children:[a(_,{className:`h-3.5 w-3.5 animate-spin`}),o(`addons.installDialog.loadingDocument`,`Loading…`)]}):n||r===void 0?a(`p`,{className:`py-4 text-xs text-danger`,children:o(`addons.installDialog.couldNotLoadDocument`,`Could not load this file from the registry.`)}):r.status===`ok`&&r.markdown!==void 0?a(Tt,{markdown:r.markdown}):r.status===`error`?a(`p`,{className:`py-4 text-xs text-danger`,children:o(`addons.installDialog.documentError`,`Could not load this file. {{message}}`,{message:r.message??``})}):a(`p`,{className:`py-4 text-xs text-foreground-subtle`,children:i})}function kt({target:e,installing:n,installError:r,onClose:i,onInstall:o}){let{t:c}=K(),[l,u]=s(e.version),[d,f]=s(!1),p=j({name:e.name}),m=ge({name:e.name,version:l}),h=p.data??[],g=ct(h),v=Dt(h,l,d),y=m.data;return a(ue,{open:!0,onOpenChange:e=>!e&&i(),children:t(je,{width:`lg`,placement:`sheet-on-mobile`,scroll:`body`,children:[a(ce,{children:a(pe,{children:c(`addons.installDialog.title`,`Install {{name}}`,{name:Et(e.name)})})}),t(fe,{className:`space-y-3`,children:[a(`p`,{className:`font-mono text-[10px] text-foreground-subtle`,children:e.name}),e.description.length>0&&a(`p`,{className:`text-xs text-foreground`,children:e.description}),t(`div`,{className:`space-y-1.5`,children:[a(`span`,{className:`text-[10px] text-foreground-subtle`,children:c(`addons.installDialog.version`,`Version`)}),a(te,{"aria-label":c(`addons.installDialog.version`,`Version`),value:l,options:v.map(e=>({value:e.version,label:ot(e)?c(`addons.installDialog.deprecatedVersion`,`{{version}} (deprecated)`,{version:e.version}):e.version})),onChange:e=>u(e.target.value)}),p.isError&&a(`p`,{className:`text-[10px] text-danger`,children:c(`addons.versionPicker.registryError`,`Could not load versions from the registry.`)}),g>0&&a(M,{type:`button`,variant:`ghost`,size:`sm`,className:`h-auto justify-start px-0 text-[10px] font-normal text-foreground-subtle underline`,onClick:()=>f(e=>!e),children:d?c(`addons.versionPicker.hideOlder`,`Hide older versions`):c(`addons.versionPicker.showOlder`,`Show older versions ({{count}})`,{count:g})})]}),t(L,{defaultValue:`readme`,children:[t(U,{children:[a(Ee,{value:`readme`,children:c(`addons.installDialog.readme`,`README`)}),a(Ee,{value:`changelog`,children:c(`addons.installDialog.changelog`,`CHANGELOG`)})]}),a(Oe,{value:`readme`,children:a(`div`,{className:`max-h-80 overflow-auto rounded-md border border-border bg-background p-3`,children:a(Ot,{pending:m.isPending,failed:m.isError,body:y?.readme,missing:c(`addons.installDialog.missingReadme`,`This package has no README.`)})})}),a(Oe,{value:`changelog`,children:a(`div`,{className:`max-h-80 overflow-auto rounded-md border border-border bg-background p-3`,children:a(Ot,{pending:m.isPending,failed:m.isError,body:y?.changelog,missing:c(`addons.installDialog.missingChangelog`,`This package has no CHANGELOG.`)})})})]}),r!=null&&r.length>0&&a(`p`,{className:`text-xs text-danger`,children:r})]}),t(me,{children:[a(M,{type:`button`,variant:`outline`,size:`sm`,onClick:i,children:c(`common.cancel`,`Cancel`)}),a(M,{type:`button`,size:`sm`,disabled:n||l.length===0,onClick:()=>o(e.name,l),children:n?a(_,{className:`h-3.5 w-3.5 animate-spin`}):c(`addons.installDialog.install`,`Install`)})]})]})})}function At(e,t){let n=new Map;for(let r of e){if(r.isHub||r.onHub||Ie(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 jt({selectedNode:e}){let{t:n}=K(),{data:r}=Se(nt,{staleTime:rt});if(r===void 0)return null;let i=At(r.installations,e),o=r.unreachable.filter(t=>e.isHub||t.nodeId===e.id);return i.length===0&&o.length===0?null:t(`div`,{className:`rounded-lg border border-warning/30 bg-warning/5 px-3 py-2.5 space-y-2`,children:[t(`div`,{className:`flex items-center gap-2 text-[11px] font-semibold text-foreground`,children:[a(C,{className:`h-3.5 w-3.5 text-warning`}),e.isHub?n(`addons.nodeOnlyPackagesPanel.installedOnAgentsButNot`,`Installed on agents but not on the hub`):n(`addons.nodeOnlyPackagesPanel.installedOnButNotOn`,`Installed on {{name}} but not on the hub`,{name:e.name})]}),o.length>0&&a(`div`,{className:`text-[10px] text-foreground-subtle`,children:n(`addons.nodeOnlyPackagesPanel.unreachable`,{nodes:o.map(e=>e.nodeId).join(`, `)})}),i.map(n=>t(`div`,{className:`flex items-center justify-between gap-3 flex-wrap rounded-md border border-border bg-surface px-3 py-2`,children:[t(`div`,{className:`min-w-0`,children:[a(`div`,{className:`text-xs font-mono text-foreground break-all`,children:n.packageName}),a(`div`,{className:`text-[10px] text-foreground-subtle`,children:n.rows.map(e=>`${e.nodeName}${e.version===null?``:` ${e.version}`}${e.isOnline?``:` (offline)`}`).join(` · `)})]}),a(at,{packageName:n.packageName,displayName:n.packageName,selectedNode:e,hideNodeAction:e.isHub})]},n.packageName))]})}function Mt({addon:e,installing:n,onInstall:r}){let{t:i}=K();return t(`div`,{className:`flex items-center gap-3 px-3 py-2 hover:bg-surface-hover transition-colors`,children:[a(`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()}),t(`div`,{className:`flex-1 min-w-0`,children:[t(`div`,{className:`flex items-baseline gap-2 min-w-0`,children:[a(`span`,{className:`text-[11px] font-semibold break-words`,children:e.name.replace(/^@camstack\/(addon-)?/,``)}),t(`span`,{className:`text-[10px] text-foreground-subtle shrink-0`,children:[`v`,e.version]})]}),a(`div`,{className:`font-mono text-[9px] text-foreground-subtle/80 truncate`,children:e.name}),e.description&&a(`div`,{className:`text-[10px] text-foreground-subtle truncate`,children:e.description})]}),e.installed?a(Ae,{variant:`success`,icon:a(E,{className:`h-3 w-3`}),children:e.installedVersion??i(`system.capabilityCatalog.installed`,`Installed`)}):t(M,{size:`sm`,onClick:()=>r(e),disabled:n,className:`shrink-0`,children:[n?a(_,{className:`h-3 w-3 animate-spin`}):a(re,{className:`h-3 w-3`}),i(`system.capabilityCatalog.install`,`Install`)]})]})}function Nt({capability:e,installing:n,onInstall:r}){let{t:i}=K(),{data:o,isPending:s,isError:c}=xe({capability:e}),l;if(c)l=a(`div`,{className:`px-3 py-2 text-xs text-danger`,children:i(`system.capabilityCatalog.couldNotSearchTheNpm`,`Could not search the npm catalog right now. Try again in a moment.`)});else if(s||o===void 0)l=t(`div`,{className:`flex items-center gap-2 px-3 py-2 text-xs text-foreground-subtle`,children:[a(_,{className:`h-3 w-3 animate-spin`}),i(`system.capabilityCatalog.searchingTheNpmCatalog`,`Searching the npm catalog…`)]});else{let t=o.filter(e=>!e.installed);l=t.length===0?a(`div`,{className:`px-3 py-2 text-xs text-foreground-subtle`,children:o.length===0?i(`system.capabilityCatalog.noPublishedAddonDeclaresThe`,`No published addon declares the "{{capability}}" capability.`,{capability:e}):i(`system.capabilityCatalog.everyPublishedAddonThatDeclares`,`Every published addon that declares "{{capability}}" is already installed.`,{capability:e})}):a(`div`,{className:`divide-y divide-border`,children:t.map(e=>a(Mt,{addon:e,installing:n,onInstall:r},e.name))})}return t(`section`,{className:`rounded-md border border-border bg-surface overflow-hidden`,"aria-label":i(`system.capabilityCatalog.availableToInstall`,`Available to install`),children:[a(`h2`,{className:`px-3 py-1.5 text-[10px] uppercase tracking-wide text-foreground-subtle border-b border-border`,children:i(`system.capabilityCatalog.availableToInstall`,`Available to install`)}),l]})}c();function Pt(e){return e===`npm`||e===`dev`?e:null}var Ft=`rounded-full border border-primary bg-primary/10 px-2 py-0.5 text-[10px] text-foreground`,It=`rounded-full border border-border px-2 py-0.5 text-[10px] text-foreground-muted hover:bg-surface-hover`,Lt=[{seconds:900,label:`15m`},{seconds:3600,label:`1h`},{seconds:21600,label:`6h`},{seconds:43200,label:`12h`},{seconds:86400,label:`24h`}],Rt={id:`hub`,name:`Hub`,isHub:!0,isOnline:!0};function zt(e,t){let n=e??`hub-only`;return n===`any-node`?!0:n===`hub-only`?t:!t}function Bt(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 Ht(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 Ut({addons:c,clusterStatus:u,selectedNode:d,onRefresh:m,listPhase:h}){let{t:g}=K(),v=l(),[y,b]=s(``),[x,C]=s(!1),w=e(y),[T,E]=s(!1),ne=n(null);o(()=>{if(!T)return;let e=e=>{ne.current&&!ne.current.contains(e.target)&&E(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[T]);let{data:D}=z({nodeId:d.id}),O=r(()=>{let e=new Map;for(let t of D??[])t.blockedBy===void 0&&e.set(t.name,t.latestVersion);return e},[D]),ie=r(()=>{let e=new Map;for(let t of D??[]){let n=t.blockedBy?.find(e=>e.kind===`server-too-old`);n!==void 0&&e.set(t.name,{latestVersion:t.latestVersion,requiredServer:n.required})}return e},[D]),k=r(()=>(D??[]).filter(e=>!e.isSystem&&e.blockedBy===void 0).length,[D]),[A,ce]=s(()=>new Set),[le,ue]=s(()=>new Map),de=i(e=>{ce(t=>new Set(t).add(e))},[]),j=i(e=>{ce(t=>{if(!t.has(e))return t;let n=new Set(t);return n.delete(e),n})},[]),fe=i((e,t)=>{ue(n=>new Map(n).set(e,t))},[]),pe=i(e=>{ue(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),me=ye({onMutate:e=>{de(e.name),pe(e.name)},onSuccess:(e,t)=>{j(t.name);let n=e;if(n&&n.success===!1){fe(t.name,n.error??`Update failed (no error message returned by server)`);return}v.invalidateQueries({queryKey:[[`addons`]]}),v.invalidateQueries({queryKey:[[`addons`,`listUpdates`]]})},onError:(e,t)=>{j(t.name),fe(t.name,e instanceof Error?e.message:String(e))}}),ge=Je(),P=n(new Set);o(()=>{let e=new Set;for(let[t,n]of ge)Ke(n)&&e.add(t);let t=[...P.current].some(t=>!e.has(t));P.current=e,t&&(v.invalidateQueries({queryKey:[[`addons`]]}),v.invalidateQueries({queryKey:[[`addons`,`listUpdates`]]}))},[ge,v]);let{data:F}=N(void 0),_e=oe({onSuccess:()=>{v.invalidateQueries({queryKey:[[`addons`,`getAutoUpdateSettings`]]})}}),L=I({onSuccess:()=>{v.invalidateQueries({queryKey:[[`addons`,`getAutoUpdateSettings`]]})}}),{data:R,isFetching:ve}=xe({query:w||void 0},{enabled:T}),B=W(),{data:V}=he(void 0),H=V?.requestedAt,[U,Se]=s(null),[Ce,we]=s(!1);o(()=>{if(V?.kind===`framework-bulk-update`&&V.requestedAt!==U){Se(V.requestedAt),we(!0);let e=window.setTimeout(()=>we(!1),6e3);return()=>window.clearTimeout(e)}},[H,U,V]),ee();let Te=i(async()=>{let e=(D??[]).filter(e=>!e.isSystem&&e.blockedBy===void 0);if(e.length!==0){if(!d.isHub){for(let t of e)await me.mutateAsync({name:t.name,version:t.latestVersion,nodeId:d.id});return}await B.mutateAsync({kind:`update`,targets:e.map(e=>({name:e.name,version:e.latestVersion})),nodeIds:[d.id]})}},[D,d.id,d.isHub,B,me]),[Ee,De]=s(null),[Oe,ke]=s(null),Ae=e=>{ke(null),De(e)},G=ae({onSuccess:()=>{De(null),ke(null),v.invalidateQueries({queryKey:[[`addons`]]}),v.invalidateQueries({queryKey:[[`addonPages`]]}),v.invalidateQueries({queryKey:[[`capabilities`]]}),v.invalidateQueries({queryKey:[[`integrations`]]})},onError:e=>{ke(e instanceof Error?e.message:`Install failed`)}}),[je,Me]=s(`type`),[Pe,Ie]=s(()=>typeof window>`u`?`grouped`:window.localStorage.getItem(`camstack.addons.viewMode`)===`flat`?`flat`:`grouped`),Le=e=>{Ie(e),typeof window<`u`&&window.localStorage.setItem(`camstack.addons.viewMode`,e)},[q,J]=Ne(),Y=q.get(`capability`),He=q.get(`updatable`)===`1`,We=q.get(`error`)===`1`,X=Pt(q.get(`source`)),Z=Re(q.get(Be))===`integration`,{data:Ge}=se(void 0,{enabled:Z}),qe=r(()=>Ge===void 0?null:new Set(Ge.map(e=>e.addonId)),[Ge]),Ye=i(e=>{let t=new URLSearchParams(q);e?t.set(Be,`integration`):t.delete(Be),J(t,{replace:!0})},[q,J]),Xe=i(e=>{let t=new URLSearchParams(q);e?t.set(`updatable`,`1`):t.delete(`updatable`),J(t,{replace:!0})},[q,J]),Ze=i(e=>{let t=new URLSearchParams(q);e?t.set(`error`,`1`):t.delete(`error`),J(t,{replace:!0})},[q,J]),Qe=i(e=>{let t=new URLSearchParams(q);e===null?t.delete(`source`):t.set(`source`,e),J(t,{replace:!0})},[q,J]),$e=r(()=>c.filter(e=>Ue(e.process)!==null).length,[c]),Q=r(()=>{let e=c.filter(e=>!Fe(e.manifest.packageName));return d.isHub||(e=e.filter(e=>zt(e.placement,d.isHub))),Y&&(e=e.filter(e=>(e.manifest.capabilities??[]).some(e=>(typeof e==`string`?e:e.name)===Y))),Z&&(e=[...ze(e,qe)]),He&&(e=e.filter(e=>{let t=e.manifest.packageName;return t!==void 0&&O.has(t)})),X!==null&&(e=e.filter(e=>Bt(e.installSource)===X)),We&&(e=e.filter(e=>Ue(e.process)!==null)),e},[c,d.isHub,Y,He,X,We,Z,qe,O]),et=()=>{let e=new URLSearchParams(q);e.delete(`capability`),J(e,{replace:!0})},tt=Pe===`flat`?Q:Ht(Q),nt=r(()=>{let e=[...tt];switch(je){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},[tt,je]);return t(`div`,{className:`space-y-3`,children:[a(Ve,{open:x,onOpenChange:C}),[...le.entries()].map(([e,n])=>a(`div`,{className:`rounded-md border border-danger/30 bg-danger/5 px-2.5 py-1.5 text-[11px]`,children:t(`div`,{className:`flex items-start justify-between gap-3`,children:[t(`div`,{className:`space-y-0.5`,children:[a(`div`,{className:`font-medium text-danger`,children:g(`systemPage.addons.updateFailed`,{name:e})}),a(`div`,{className:`text-foreground-subtle font-mono`,children:n})]}),a(M,{variant:`unstyled`,type:`button`,onClick:()=>pe(e),className:`text-foreground-subtle hover:text-foreground text-[10px]`,children:g(`common.dismiss`)})]})},e)),t(`div`,{className:`flex items-center gap-x-2 gap-y-1.5 flex-wrap`,children:[t(`div`,{className:`flex items-center gap-1.5`,children:[a(`span`,{className:`text-[10px] text-foreground-subtle`,children:g(`admin.system.addons.sort`,`Sort:`)}),t(te,{wrapperClassName:`inline-block w-auto`,value:je,onChange:e=>Me(e.target.value),children:[a(`option`,{value:`type`,children:g(`admin.system.addons.bundlesFirst`,`Bundles first`)}),a(`option`,{value:`name`,children:g(`admin.system.addons.name`,`Name`)}),a(`option`,{value:`source`,children:g(`admin.system.addons.installSource`,`Install source`)})]})]}),t(`div`,{className:`flex items-center gap-1.5`,children:[a(`span`,{className:`text-[10px] text-foreground-subtle`,children:g(`admin.system.addons.view`,`View:`)}),a(`div`,{className:`flex rounded-md border border-border overflow-hidden text-[10px] font-medium`,children:[`grouped`,`flat`].map(e=>a(M,{variant:`unstyled`,type:`button`,onClick:()=>Le(e),className:`px-2 py-1 transition-colors capitalize ${Pe===e?`bg-primary/10 text-primary`:`bg-transparent text-foreground-subtle hover:bg-surface-hover`}`,title:e===`grouped`?g(`admin.system.addons.groupMultiAddonPackagesInto`,`Group multi-addon packages into a bundle card`):g(`admin.system.addons.showEveryAddonAsIts`,`Show every addon as its own card`),children:e},e))})]}),d.isHub&&t(`div`,{className:`flex items-center gap-1.5`,children:[a(S,{className:`h-3 w-3 text-foreground-subtle`}),a(`span`,{className:`text-[10px] text-foreground-subtle`,children:g(`admin.system.addons.autoUpdate`,`Auto-Update:`)}),a(`div`,{className:`flex rounded-md border border-border overflow-hidden text-[10px] font-medium`,children:[`off`,`latest`,`beta`].map(e=>a(M,{variant:`unstyled`,type:`button`,onClick:()=>_e.mutate({channel:e}),disabled:_e.isPending,className:`px-2 py-1 transition-colors capitalize ${F?.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&&t(`div`,{className:`flex items-center gap-1.5`,children:[a(`span`,{className:`text-[10px] text-foreground-subtle`,children:g(`admin.system.addons.checkEvery`,`Check every:`)}),a(te,{wrapperClassName:`inline-block w-auto`,className:`font-medium text-foreground-subtle`,value:F?.updateCheckIntervalSeconds??21600,disabled:L.isPending||F===void 0,onChange:e=>{F!==void 0&&L.mutate({channel:F.channel,updateCheckIntervalSeconds:Number(e.target.value)})},children:Lt.map(e=>a(`option`,{value:e.seconds,children:e.label},e.seconds))})]}),k>0&&t(M,{variant:`unstyled`,type:`button`,onClick:()=>void Te(),disabled:B.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:[B.isPending?a(_,{className:`w-3 h-3 animate-spin`}):a(re,{className:`w-3 h-3`}),B.isPending?g(`admin.system.addons.updating`,`Updating…`):g(`admin.system.addons.updateAll`,`Update All ({{nonSystemUpdateCount}})`,{nonSystemUpdateCount:k})]})]}),t(`div`,{className:`flex flex-wrap items-center gap-1.5`,role:`group`,"aria-label":g(`admin.system.addons.filterInstalledAddons`,`Filter installed addons`),children:[a(`span`,{className:`text-[10px] text-foreground-subtle`,children:g(`admin.system.addons.filter`,`Filter:`)}),[{id:`integrations`,label:g(`admin.system.addons.integrations`,`Integrations`),pressed:Z,toggle:()=>Ye(!Z)},{id:`updatable`,label:g(`admin.system.addons.updatable`,`Updatable`),pressed:He,toggle:()=>Xe(!He)},{id:`error`,label:g(`admin.system.addons.inError`,`In error ({{count}})`,{count:$e}),pressed:We,toggle:()=>Ze(!We)},{id:`npm`,label:`npm`,pressed:X===`npm`,toggle:()=>Qe(X===`npm`?null:`npm`)},{id:`dev`,label:g(`admin.system.addons.dev`,`Dev`),pressed:X===`dev`,toggle:()=>Qe(X===`dev`?null:`dev`)}].map(e=>a(M,{variant:`unstyled`,type:`button`,"aria-pressed":e.pressed,onClick:e.toggle,className:e.pressed?Ft:It,children:e.label},e.id))]}),t(`div`,{className:`flex flex-col gap-1.5 sm:flex-row sm:items-center sm:gap-2`,children:[t(`div`,{className:`relative flex-1 min-w-0 sm:min-w-[200px]`,ref:ne,children:[a(be,{type:`text`,searchHotkey:!0,value:y,onChange:e=>{b(e.target.value),E(!0)},onFocus:()=>E(!0),placeholder:g(`admin.system.addons.searchAddonsOnNpm`,`Search addons on npm...`),"aria-label":g(`admin.system.addons.searchAddonsOnNpm2`,`Search addons on npm`),disabled:B.isPending,leftSlot:a(f,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),rightSlot:ve?a(_,{className:`h-3 w-3 animate-spin`}):void 0}),T&&R&&R.length>0&&t(`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:[R.length>0&&a(`div`,{className:`px-3 py-1.5 text-[10px] uppercase tracking-wide text-foreground-subtle border-b border-border`,children:g(`systemPage.addons.npmResults`,{count:R.length})}),R&&R.length>0&&a(`div`,{className:`max-h-72 overflow-auto divide-y divide-border`,children:R.map(e=>a(Mt,{addon:e,installing:G.isPending,onInstall:e=>Ae({name:e.name,version:e.version,description:e.description})},e.name))})]})]}),a(yt,{onUploadSuccess:()=>{v.invalidateQueries({queryKey:[[`addons`]]}),m()}})]}),Y&&t(`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:[a(`span`,{className:`text-foreground-subtle`,children:g(`admin.system.addons.filteringByCapability`,`Filtering by capability:`)}),a(`span`,{className:`font-mono text-primary font-semibold`,children:Y}),a(M,{variant:`unstyled`,type:`button`,onClick:et,className:`ml-auto text-xs text-foreground-subtle hover:text-foreground underline`,children:g(`admin.system.addons.clear`,`Clear`)})]}),Y&&a(Nt,{capability:Y,installing:G.isPending,onInstall:e=>Ae({name:e.name,version:e.version,description:e.description})}),Y&&Q.length>0&&a(`h2`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:g(`admin.system.addons.installed`,`Installed`)}),Ce&&t(`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 max-w-sm pointer-events-auto`,children:[a(p,{className:`w-4 h-4 shrink-0 mt-0.5 text-green-400`}),t(`div`,{children:[a(`div`,{className:`text-[11px] font-semibold text-foreground`,children:g(`admin.system.addons.bulkUpdateCompleted`,`Bulk update completed`)}),a(`div`,{className:`text-[10px] text-foreground-subtle mt-0.5`,children:g(`admin.system.addons.systemPackagesUpdatedHubRestarted`,`System packages updated — hub restarted successfully.`)})]})]}),h===`pending`&&t(`div`,{className:`flex items-center gap-2 text-xs text-foreground-subtle`,children:[a(_,{className:`h-3 w-3 animate-spin`}),g(`admin.system.addons.loadingInstalled`,`Loading installed addons…`)]}),h===`error`&&a(`div`,{className:`text-xs text-danger`,children:g(`admin.system.addons.failedToLoadAddons`,`Failed to load addons`)}),h===`ready`&&Q.length===0&&a(`div`,{className:`text-xs text-foreground-subtle`,children:c.length===0?g(`admin.system.addons.noAddonsInstalled`,`No addons installed`):Y?g(`admin.system.addons.noInstalledAddonDeclaresThe`,`No installed addon declares the "{{capabilityFilter}}" capability. Any addon you can install appears under "Available to install" above.`,{capabilityFilter:Y}):g(`admin.system.addons.noAddonsCompatibleWithPlacement`,`No addons compatible with {{name}} (placement filter active)`,{name:d.name})}),a(`div`,{className:`space-y-1.5`,children:h===`ready`&&nt.map(e=>{let t=$(e)?e.bundle.packageName:e.manifest.packageName,n=O.get(t),r=ie.get(t),i=$(e)?e.representative:e,o=n?e=>me.mutate({name:t,version:e,nodeId:d.id}):void 0,s=ge.get(t)??null,c=s!==null&&Ke(s);return a(_t,{addon:i,clusterStatus:u?.[i.manifest.id],bundle:$(e)?e.bundle:void 0,availableUpdate:n,...r===void 0?{}:{blockedUpdate:r},...r===void 0?{}:{onUpdateServer:()=>C(!0)},isUpdating:A.has(t)||c,jobProgress:s,onUpdate:o,disabledByBulk:B.isPending,selectedNode:d},$(e)?t:e.manifest.id)})}),Ee!==null&&a(kt,{target:Ee,installing:G.isPending,installError:Oe,onClose:()=>De(null),onInstall:(e,t)=>G.mutate({packageName:e,version:t})})]})}function Wt(){let{t:e}=K(),r=l(),{data:i}=Me(void 0),{nodes:s}=B(),{selection:c,selectNode:u,requestedNodeId:d}=He(s.length>0?s:[Rt]),f=c.node??Rt,p=f.id,m=s.length>0?c.staleNodeId:null,{data:h,isLoading:g,isError:_}=R({nodeId:p}),v=Te(),y=P(),b=v.isPending||y.isPending,x=async()=>{await v.mutateAsync({nodeId:p}),await y.mutateAsync(),r.invalidateQueries({queryKey:[[`addons`]]})},C=n(v);C.current=v;let ee=n(d??`hub`);o(()=>{C.current.mutate({nodeId:ee.current})},[]);let w=(h??[]).map(Vt).filter(e=>e!==null);return t(q,{children:[t(`div`,{className:`flex items-center justify-between gap-2 flex-wrap`,children:[a(_e,{selectedNodeId:p,onSelect:u}),t(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[!g&&!_&&a(`span`,{className:`text-[10px] rounded-full bg-primary/10 text-primary px-2 py-0.5 font-medium`,children:e(`systemPage.addons.installedCount`,{count:w.length})}),t(M,{variant:`unstyled`,type:`button`,onClick:()=>void x(),disabled:b,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:[a(S,{className:`w-3 h-3 ${b?`animate-spin`:``}`}),e(`admin.system.addons.checkForUpdates`,`Check for updates`)]})]})]}),a(Y,{staleNodeId:m,shownNodeName:f.name}),a(jt,{selectedNode:f}),a(Ut,{addons:w,clusterStatus:i,selectedNode:f,onRefresh:()=>void x(),listPhase:g?`pending`:_?`error`:`ready`})]})}export{Wt as AddonsPage};
@@ -1 +0,0 @@
1
- import{C as e,K as t,R as n,S as r,Y as i,et as a}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CEyXHAdg.js";import{t as o}from"./useTranslation-BJr-n0es.js";import{N as s,Nt as c,P as l,v as u,y as d}from"./index-DltGFPYA.js";import{n as f}from"./NodeAddonsSettingsPanel-Cs-4A2nm.js";a();function p(e,t){if(e.type===`group`){for(let n of e.fields)p(n,t);return}if(e.type===`sub-tabs`){for(let n of e.tabs)for(let e of n.fields)p(e,t);return}`value`in e&&(t[e.key]=e.value)}function m(e){let t={};for(let n of e.sections)for(let e of n.fields)p(e,t);return t}var h=`system-config-auth`;function g({sectionIds:e,omitSectionIds:n,hideSectionChrome:i,emptyMessage:a}){let o=u(),s=t(()=>{if(o.data===void 0)return null;let t=o.data.sections.filter(t=>!(e!==void 0&&!e.includes(t.id)||n?.includes(t.id)===!0||e===void 0&&t.id===`system-config-auth`));return{...o.data,sections:f(t,{...i===!0?{hideSectionChrome:i}:{}})}},[o.data,e,n,i]);return o.isPending?null:s===null||o.isError?r(`p`,{className:`text-sm text-foreground-muted`,children:a}):s.sections.length===0?null:r(_,{schema:s})}function _({schema:a}){let{t:u}=o(),f=d(),[p,h]=i(null),g=t(()=>m(a),[a]),_=n(async e=>{h(null);try{await f.mutateAsync({patch:e})}catch(e){throw h(e instanceof Error&&e.message.length>0?e.message:u(`system.bootstrapForm.saveFailed`,`Could not save`)),e}},[f,u]),v=l({schema:a,serverValues:g,onImmediateSave:e=>void _(e).catch(()=>void 0),onDeferredSave:_});return e(`div`,{className:`flex flex-col gap-3`,children:[p!==null&&r(`div`,{role:`alert`,className:`rounded-md border border-danger/40 bg-danger/10 px-3 py-2 text-xs text-danger`,children:p}),r(c,{schema:a,values:v.values,onChange:v.handleChange,disabled:f.isPending}),r(s,{pendingCount:v.pendingKeys.length,onSave:()=>v.handleSave(v.pendingKeys),onDiscard:()=>v.handleDiscard(v.pendingKeys),saving:f.isPending})]})}export{h as n,g as t};