@camstack/addon-admin-ui 1.2.610 → 1.2.612
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/CHANGELOG.md +15 -1
- package/dist/assets/Addons-bLyyfPW8.js +5 -0
- package/dist/assets/{AdminPage-TQfWsIdl.js → AdminPage-BDf9Opoy.js} +1 -1
- package/dist/assets/{AdminSectionedPage-C-Sp15FZ.js → AdminSectionedPage-BmPvAqN7.js} +1 -1
- package/dist/assets/{AiProfiles-76h_TlLL.js → AiProfiles-BfNvmipQ.js} +2 -2
- package/dist/assets/Authentication-Dy0SHbd2.js +1 -0
- package/dist/assets/Build-BcH_7pwR.js +39 -0
- package/dist/assets/{Calendars-Dek6lYax.js → Calendars-DoeogWGU.js} +1 -1
- package/dist/assets/{CameraGrids-T4pHG6q5.js → CameraGrids-CnUTfSUE.js} +1 -1
- package/dist/assets/{Cluster-ChvHyJVl.js → Cluster-DVj6ha6i.js} +1 -1
- package/dist/assets/CompositionBlockEditor-BO_kgKkI.js +2 -0
- package/dist/assets/{CompositionEditorPage-DNMtUON1.js → CompositionEditorPage-LCwsUZ4f.js} +1 -1
- package/dist/assets/{Data-BRoEVppU.js → Data-NFKLyrCk.js} +2 -2
- package/dist/assets/DeviceDetail-BhmWmLwE.js +2 -0
- package/dist/assets/{DeviceDoActionFields-Bw1Fouyk.js → DeviceDoActionFields-DqV_M6Iu.js} +1 -1
- package/dist/assets/{Devices-DmMoxyfb.js → Devices-l-BMaVFL.js} +1 -1
- package/dist/assets/{EditTemplateButton-CywFwPHo.js → EditTemplateButton-DUmDJ_PP.js} +1 -1
- package/dist/assets/{EmbedPlayerPage-CmqHixWJ.js → EmbedPlayerPage-CHJVGA-n.js} +1 -1
- package/dist/assets/History-oBCvkV_U.js +1 -0
- package/dist/assets/Identity-CJMkgDxp.js +1 -0
- package/dist/assets/{InstancesTable-FjdeKpTU.js → InstancesTable-BH2vXD8R.js} +1 -1
- package/dist/assets/IntegrationDetail-B0AUm-eZ.js +1 -0
- package/dist/assets/{IntegrationHub-CCRQOfas.js → IntegrationHub-BZaf7Xp-.js} +1 -1
- package/dist/assets/Integrations-CgFg299t.js +1 -0
- package/dist/assets/Integrations-d8N4FXjr.js +2 -0
- package/dist/assets/Library-DzJWpF7K.js +1 -0
- package/dist/assets/Locations-CHKWsC1d.js +3 -0
- package/dist/assets/{Logs-DkyTj2fX.js → Logs-B6KKBrGz.js} +1 -1
- package/dist/assets/{MaskShapeCanvas-IwWIrUk1.js → MaskShapeCanvas-Coqh7ZAZ.js} +1 -1
- package/dist/assets/{MotionZonesSettings-Cl2atAb3.js → MotionZonesSettings-D8Up7iKD.js} +1 -1
- package/dist/assets/MyAccess-C-R5Stsw.js +2 -0
- package/dist/assets/Network-Cc2X15Su.js +1 -0
- package/dist/assets/NodeAddonsSettingsPanel-CXn8yKXe.js +1 -0
- package/dist/assets/Notifications-BLtlZ3dV.js +1 -0
- package/dist/assets/{Pipeline-Db9hTfvU.js → Pipeline-Ctp5y2_Z.js} +1 -1
- package/dist/assets/{PrivacyMaskSettings-AAkpSAVp.js → PrivacyMaskSettings-CrLvx5OI.js} +1 -1
- package/dist/assets/Recordings-CxW89KIJ.js +1 -0
- package/dist/assets/{ScanSubnetEditor-BNJSHNhZ.js → ScanSubnetEditor-C0ALYVVB.js} +1 -1
- package/dist/assets/{SceneMonitorEditor-Cc1gcu2Q.js → SceneMonitorEditor-Cj_tpjAu.js} +1 -1
- package/dist/assets/{SessionsList-C7_pLhlj.js → SessionsList-H-2dF_Md.js} +2 -2
- package/dist/assets/{Showroom-50tNNEJy.js → Showroom-CFex73aB.js} +1 -1
- package/dist/assets/{StorageLocationsTable-CUKUl-r4.js → StorageLocationsTable-CRPO_x78.js} +1 -1
- package/dist/assets/{System-CTgYsDSj.js → System-CLI6ldIT.js} +1 -1
- package/dist/assets/{Templates-C0EZ5ath.js → Templates-B8Xn41Xh.js} +1 -1
- package/dist/assets/{Terminal-Dy-oi1D7.js → Terminal-BrvnJRYM.js} +3 -3
- package/dist/assets/{TrainingProviders-C5Iqm6rs.js → TrainingProviders-Bd9FY5Lm.js} +1 -1
- package/dist/assets/{Viewer-C3m_dwEd.js → Viewer-BlB9X2aZ.js} +1 -1
- package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-BYAWcskr.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-4XjE2MYL.js} +1 -1
- package/dist/assets/{addon-icons-context-BwQEO879.js → addon-icons-context-C7mmffib.js} +1 -1
- package/dist/assets/{ai-page.helpers-DGXwQprW.js → ai-page.helpers-DdhWucEq.js} +1 -1
- package/dist/assets/{archive-D6cC_FzU.js → archive-DzMV-MQ7.js} +1 -1
- package/dist/assets/{assignment-candidates-COhz1sU6.js → assignment-candidates-TxS_FDly.js} +1 -1
- package/dist/assets/{authed-media-BB_fTARR.js → authed-media-CuyG2Xe5.js} +1 -1
- package/dist/assets/{bell-off-DW6SdJiW.js → bell-off-BkL2sbOT.js} +1 -1
- package/dist/assets/{board-model-B8l9njz1.js → board-model-CtzCCjoE.js} +1 -1
- package/dist/assets/{boxes-TY92pmL8.js → boxes-WzjSt9KR.js} +1 -1
- package/dist/assets/{calendar-clock-awcDXwmA.js → calendar-clock-CiigPTa7.js} +1 -1
- package/dist/assets/circle-slash-DeT0lQT9.js +1 -0
- package/dist/assets/client-7mJHkAfP.js +809 -0
- package/dist/assets/create-composition-Bn8QvpgP.js +2 -0
- package/dist/assets/crop-Bv52GH7A.js +1 -0
- package/dist/assets/{database-zap-BOyGS2Mw.js → database-zap-BpJQpvp9.js} +1 -1
- package/dist/assets/{device-integration-icon-DD03zp5X.js → device-integration-icon-akX-IAVD.js} +1 -1
- package/dist/assets/device-picker-model-CdDziZ_d.js +1 -0
- package/dist/assets/dist-AlAGbGRL.js +809 -0
- package/dist/assets/{dist-CCtrnp2n.js → dist-wc45z_09.js} +1 -1
- package/dist/assets/{eraser-pdT0dQfU.js → eraser-CytZTQ9R.js} +1 -1
- package/dist/assets/{file-up-CKQP4aNd.js → file-up-mjuEl4Hh.js} +1 -1
- package/dist/assets/{format-C6537Q4C.js → format-BsOPQm9n.js} +1 -1
- package/dist/assets/{grip-vertical-CG0ZJugp.js → grip-vertical-BA9yDDHc.js} +1 -1
- package/dist/assets/{hard-drive-download-DOHV5Bd5.js → hard-drive-download-C8miMN0x.js} +1 -1
- package/dist/assets/{hostInit-BsFrL2Hf.js → hostInit-hPLmauq_.js} +1 -1
- package/dist/assets/i18n-C6fCBciG.js +1 -0
- package/dist/assets/{icons-D8UIu3sD.js → icons-DPwTvNyz.js} +1 -1
- package/dist/assets/{index-B5JUA6GN.js → index-T-ynaYP2.js} +3 -3
- package/dist/assets/{key-DjzFeOdY.js → key-5VFDH3_t.js} +1 -1
- package/dist/assets/{key-square-B56nI7zn.js → key-square-d6cnWPKN.js} +1 -1
- package/dist/assets/{layers-Ca7GS53F.js → layers-CqSf_POp.js} +1 -1
- package/dist/assets/{link-2-off-Du8Urbdy.js → link-2-off-CwyYDqUc.js} +1 -1
- package/dist/assets/linked-devices-model-D4s96ysR.js +1 -0
- package/dist/assets/{list-ordered-mMwdp0ZK.js → list-ordered-B4xxb40d.js} +1 -1
- package/dist/assets/{memory-stick-DOE_IdHU.js → memory-stick-CsiTWpnZ.js} +1 -1
- package/dist/assets/{message-square-plus-CIFSHLN_.js → message-square-plus-BbZBTulR.js} +1 -1
- package/dist/assets/{mf-entry-bootstrap-0-53e5b236.js → mf-entry-bootstrap-0-1cde0931.js} +2 -2
- package/dist/assets/{mic-off-B3VyeLBb.js → mic-off-D9kJWaqt.js} +1 -1
- package/dist/assets/{monitor-off-CxVuHFKc.js → monitor-off-CEbyDLoa.js} +1 -1
- package/dist/assets/{monitor-smartphone-BY5USNY0.js → monitor-smartphone-CAHPlmnr.js} +1 -1
- package/dist/assets/mount-CdDziZ_d.js +1 -0
- package/dist/assets/{notification-rule-status-Epq-1UHH.js → notification-rule-status-DORi1LR8.js} +1 -1
- package/dist/assets/{player-overlays-CATQyQ4F.js → player-overlays-Bpd2v5wW.js} +1 -1
- package/dist/assets/remoteEntry-BWTMtFtm.js +1 -0
- package/dist/assets/{ruler-B1kFAWFQ.js → ruler-B-sEZN1H.js} +1 -1
- package/dist/assets/{scan-eye-N0-Ys_Ky.js → scan-eye-B3r6APC5.js} +1 -1
- package/dist/assets/{scissors-vS1vNFdB.js → scissors-BiYBihUK.js} +1 -1
- package/dist/assets/{search-x-C3ydK90I.js → search-x-CYdh40Ap.js} +1 -1
- package/dist/assets/{send-BgRjj7lW.js → send-Di7DCisT.js} +1 -1
- package/dist/assets/{settings-2-D5RL9k4c.js → settings-2-CjHK9WDP.js} +1 -1
- package/dist/assets/{shapes-OA7O-srE.js → shapes-D5uS109k.js} +1 -1
- package/dist/assets/{sigma-BruF2jUs.js → sigma-GWtGgPtC.js} +1 -1
- package/dist/assets/{speaker-C1_rli9I.js → speaker-B_q2_Ad8.js} +1 -1
- package/dist/assets/src-Bz2fC5vp.js +100 -0
- package/dist/assets/{sso-popup-CzdB5jm4.js → sso-popup-CQV5EFHP.js} +1 -1
- package/dist/assets/{step-inspector-model---6MDM_X.js → step-inspector-model-Xv5ESODU.js} +1 -1
- package/dist/assets/{table-2-BLYpLdPR.js → table-2-Qa0dXjjd.js} +1 -1
- package/dist/assets/{timer-reset-BuYNGxew.js → timer-reset-DEC113sw.js} +1 -1
- package/dist/assets/{unlink-DunbvAGa.js → unlink-ABBdRmSs.js} +1 -1
- package/dist/assets/{usb-DLy934kH.js → usb-BEon_Msf.js} +1 -1
- package/dist/assets/{use-device-bound-caps-AsPNiCAs.js → use-device-bound-caps-CoyFOy7D.js} +1 -1
- package/dist/assets/{use-scenes-feed-CCt-pfFx.js → use-scenes-feed-Da1x4jS2.js} +1 -1
- package/dist/assets/{use-stationary-objects-DCghXJMZ.js → use-stationary-objects-BI131pff.js} +1 -1
- package/dist/assets/{useAdminDeviceRemoval-DkbwUbqi.js → useAdminDeviceRemoval-bMH7V_0w.js} +1 -1
- package/dist/assets/useEventInvalidation-CdDziZ_d.js +1 -0
- package/dist/assets/useInvalidateAddonSettings-CyofQfBo.js +1 -0
- package/dist/assets/{useNodeUrlSelection-LyLE5Mzl.js → useNodeUrlSelection-BOYaf1tT.js} +1 -1
- package/dist/assets/user-round-DfIG3klY.js +1 -0
- package/dist/assets/{user-x-CZ51m8nh.js → user-x-CqSpuMv_.js} +1 -1
- package/dist/assets/{variable-DkAg-mZC.js → variable-CSn8RqGr.js} +1 -1
- package/dist/assets/{video-Au7ufp69.js → video-Bu7dcaU4.js} +1 -1
- package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-C2yXHCKA.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-CV7tH0RH.js} +2 -2
- package/dist/index.html +10 -10
- package/dist/server/addon.js +102 -10
- package/package.json +2 -2
- package/dist/assets/Addons-EJqMDTNi.js +0 -5
- package/dist/assets/Authentication-DZ3LIfF4.js +0 -1
- package/dist/assets/Build-Cw5reaqN.js +0 -39
- package/dist/assets/CompositionBlockEditor-eCVeE5hf.js +0 -2
- package/dist/assets/DeviceDetail-Di2x5kWl.js +0 -2
- package/dist/assets/History-DP4YRoPu.js +0 -1
- package/dist/assets/Identity-BawXql-S.js +0 -1
- package/dist/assets/IntegrationDetail-uJpoaFxb.js +0 -1
- package/dist/assets/Integrations-CKuGcRVg.js +0 -2
- package/dist/assets/Integrations-C_Y4uSbR.js +0 -1
- package/dist/assets/Library-AkTuXuVH.js +0 -1
- package/dist/assets/Locations-vkxzxyNK.js +0 -3
- package/dist/assets/MyAccess-OxWuTXp3.js +0 -2
- package/dist/assets/Network-Bbfx627C.js +0 -1
- package/dist/assets/NodeAddonsSettingsPanel-DLOzyrXN.js +0 -1
- package/dist/assets/Notifications-XSgF7BJG.js +0 -1
- package/dist/assets/Recordings-DCAqnPqo.js +0 -1
- package/dist/assets/circle-slash-Bg_ao9-J.js +0 -1
- package/dist/assets/client-SlkZY5Jo.js +0 -809
- package/dist/assets/create-composition-J79Ys0Gw.js +0 -2
- package/dist/assets/crop-XrG1VTds.js +0 -1
- package/dist/assets/device-picker-model-D_UMfR6-.js +0 -1
- package/dist/assets/dist-DaCNKJWn.js +0 -809
- package/dist/assets/i18n-CPzNqU40.js +0 -1
- package/dist/assets/linked-devices-model-CVJNLYnw.js +0 -1
- package/dist/assets/mount-D_UMfR6-.js +0 -1
- package/dist/assets/remoteEntry-9JxY3iRA.js +0 -1
- package/dist/assets/src-Bo0PxLi8.js +0 -100
- package/dist/assets/useEventInvalidation-D_UMfR6-.js +0 -1
- package/dist/assets/user-round-DZR_is5s.js +0 -1
package/dist/server/addon.js
CHANGED
|
@@ -5866,7 +5866,7 @@ var ZodIssueCode = {
|
|
|
5866
5866
|
var ZodFirstPartyTypeKind;
|
|
5867
5867
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5868
5868
|
//#endregion
|
|
5869
|
-
//#region ../types/dist/sleep-
|
|
5869
|
+
//#region ../types/dist/sleep-D4UJY10i.mjs
|
|
5870
5870
|
/**
|
|
5871
5871
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5872
5872
|
* window to float samples (D455).
|
|
@@ -8240,6 +8240,19 @@ var BaseAddon = class {
|
|
|
8240
8240
|
const overlay = await this.scopedSettingsOverlay(scope, cap, nodeId);
|
|
8241
8241
|
return hydrateSchema(schema, overlay ? await this.overlayKeepingMarkers(stored, overlay) : stored, { inlineSecretsAsViews: true });
|
|
8242
8242
|
}
|
|
8243
|
+
/**
|
|
8244
|
+
* The scoped schemas this addon serves: one entry per loaded (capability, scope), capabilities
|
|
8245
|
+
* in declaration order, scopes in {@link SCOPED_SETTINGS_SCOPES} order. `[]` when it declares
|
|
8246
|
+
* nothing.
|
|
8247
|
+
*/
|
|
8248
|
+
async listScopedSettings() {
|
|
8249
|
+
await this.loadScopedSchemas();
|
|
8250
|
+
return [...this._scopedByCap].flatMap(([cap, entries]) => entries.map((entry) => ({
|
|
8251
|
+
cap,
|
|
8252
|
+
scope: entry.scope,
|
|
8253
|
+
sectionIds: entry.schema.sections.map((section) => section.id)
|
|
8254
|
+
})));
|
|
8255
|
+
}
|
|
8243
8256
|
/** The OPERATOR's write of declared keys of one scope (D787 secret semantics). */
|
|
8244
8257
|
async updateScopedSettings(scope, cap, patch, nodeId) {
|
|
8245
8258
|
this._operatorWriteDepth++;
|
|
@@ -11710,13 +11723,25 @@ Object.freeze({
|
|
|
11710
11723
|
"path": "temperature",
|
|
11711
11724
|
"valueType": "number"
|
|
11712
11725
|
}],
|
|
11713
|
-
"timed-run": [
|
|
11714
|
-
|
|
11715
|
-
|
|
11716
|
-
|
|
11717
|
-
|
|
11718
|
-
|
|
11719
|
-
|
|
11726
|
+
"timed-run": [
|
|
11727
|
+
{
|
|
11728
|
+
"path": "activeUntil",
|
|
11729
|
+
"valueType": "number"
|
|
11730
|
+
},
|
|
11731
|
+
{
|
|
11732
|
+
"path": "requestedBy",
|
|
11733
|
+
"valueType": "string"
|
|
11734
|
+
},
|
|
11735
|
+
{
|
|
11736
|
+
"path": "quickRun.duration",
|
|
11737
|
+
"valueType": "number"
|
|
11738
|
+
},
|
|
11739
|
+
{
|
|
11740
|
+
"path": "quickRun.unit",
|
|
11741
|
+
"valueType": "enum",
|
|
11742
|
+
"enumValues": ["s", "min"]
|
|
11743
|
+
}
|
|
11744
|
+
],
|
|
11720
11745
|
"update": [
|
|
11721
11746
|
{
|
|
11722
11747
|
"path": "currentVersion",
|
|
@@ -44089,6 +44114,12 @@ var SettingsSchemaWithValuesSchema = object({
|
|
|
44089
44114
|
var SettingsPatchSchema = record(string(), unknown());
|
|
44090
44115
|
/** The scope of a scoped-settings call (D986): where the capability declared the values. */
|
|
44091
44116
|
var ScopedSettingsScopeSchema = _enum(SCOPED_SETTINGS_SCOPES);
|
|
44117
|
+
/** One scoped schema an addon serves: its capability, scope and section ids. */
|
|
44118
|
+
var ScopedSettingsDeclarationSchema = object({
|
|
44119
|
+
cap: string(),
|
|
44120
|
+
scope: ScopedSettingsScopeSchema,
|
|
44121
|
+
sectionIds: array(string())
|
|
44122
|
+
});
|
|
44092
44123
|
/** Standard success response for update operations. */
|
|
44093
44124
|
var SettingsUpdateResultSchema = object({ success: literal(true) });
|
|
44094
44125
|
method(object({
|
|
@@ -44109,6 +44140,9 @@ method(object({
|
|
|
44109
44140
|
scope: ScopedSettingsScopeSchema,
|
|
44110
44141
|
nodeId: string().optional()
|
|
44111
44142
|
}), SettingsSchemaWithValuesSchema.nullable()), method(object({
|
|
44143
|
+
addonId: string(),
|
|
44144
|
+
nodeId: string().optional()
|
|
44145
|
+
}), array(ScopedSettingsDeclarationSchema).nullable()), method(object({
|
|
44112
44146
|
addonId: string(),
|
|
44113
44147
|
cap: string(),
|
|
44114
44148
|
scope: ScopedSettingsScopeSchema,
|
|
@@ -73212,6 +73246,11 @@ var TimedRunUnitSchema = _enum(["s", "min"]);
|
|
|
73212
73246
|
_enum(["switch", "pet-fountain"]);
|
|
73213
73247
|
DeviceType.Heater, DeviceType.PetFountain;
|
|
73214
73248
|
DeviceType.Heater, DeviceType.PetFountain;
|
|
73249
|
+
/** One duration, as the one-tap run asks for it. */
|
|
73250
|
+
var TimedRunQuickRunSchema = object({
|
|
73251
|
+
duration: number().positive().finite(),
|
|
73252
|
+
unit: TimedRunUnitSchema
|
|
73253
|
+
});
|
|
73215
73254
|
/** Why a request was not carried out. Typed, so a caller can say it in words. */
|
|
73216
73255
|
var TimedRunRefusalSchema = _enum([
|
|
73217
73256
|
"unsupported-device",
|
|
@@ -73232,9 +73271,30 @@ object({
|
|
|
73232
73271
|
activeUntil: number().nullable(),
|
|
73233
73272
|
/** Who asked for the run (a user id or an addon id); `null` when nothing is armed or it did not say. */
|
|
73234
73273
|
requestedBy: string().nullable(),
|
|
73274
|
+
/**
|
|
73275
|
+
* The one-tap run of THIS device: what a "Run" button on any surface starts. `null` when
|
|
73276
|
+
* the device is gone or its type has no timed run; a status from before this field
|
|
73277
|
+
* existed has none, and a surface falls back to the type's default.
|
|
73278
|
+
*/
|
|
73279
|
+
quickRun: TimedRunQuickRunSchema.nullable(),
|
|
73235
73280
|
lastFetchedAt: number()
|
|
73236
73281
|
});
|
|
73237
|
-
|
|
73282
|
+
/** What the settings form needs: the unit, the bounds and the type's default. */
|
|
73283
|
+
var TimedRunOptionsSchema = object({
|
|
73284
|
+
unit: TimedRunUnitSchema,
|
|
73285
|
+
/** The longest run, in `unit`. */
|
|
73286
|
+
maxDuration: number(),
|
|
73287
|
+
defaultDuration: number()
|
|
73288
|
+
});
|
|
73289
|
+
/** The one-tap run duration, in the type's unit; `null` returns to the type's default. */
|
|
73290
|
+
var TimedRunSettingsPatchSchema = object({ quickRunDuration: number().positive().finite().nullable().optional() });
|
|
73291
|
+
method(object({ deviceId: number().int() }), TimedRunOptionsSchema), method(object({
|
|
73292
|
+
deviceId: number().int(),
|
|
73293
|
+
settings: TimedRunSettingsPatchSchema
|
|
73294
|
+
}), _void(), {
|
|
73295
|
+
kind: "mutation",
|
|
73296
|
+
auth: "admin"
|
|
73297
|
+
}), method(object({
|
|
73238
73298
|
deviceId: number().int(),
|
|
73239
73299
|
duration: number().positive().finite(),
|
|
73240
73300
|
unit: TimedRunUnitSchema
|
|
@@ -75968,6 +76028,13 @@ Object.freeze({
|
|
|
75968
76028
|
access: "view",
|
|
75969
76029
|
role: "admin"
|
|
75970
76030
|
},
|
|
76031
|
+
"addonSettings.listScopedSettings": {
|
|
76032
|
+
capName: "addon-settings",
|
|
76033
|
+
capScope: "system",
|
|
76034
|
+
addonId: null,
|
|
76035
|
+
access: "view",
|
|
76036
|
+
role: "admin"
|
|
76037
|
+
},
|
|
75971
76038
|
"addonSettings.readScopedValues": {
|
|
75972
76039
|
capName: "addon-settings",
|
|
75973
76040
|
capScope: "system",
|
|
@@ -84949,6 +85016,13 @@ Object.freeze({
|
|
|
84949
85016
|
access: "create",
|
|
84950
85017
|
role: "viewer"
|
|
84951
85018
|
},
|
|
85019
|
+
"timedRun.getOptions": {
|
|
85020
|
+
capName: "timed-run",
|
|
85021
|
+
capScope: "device",
|
|
85022
|
+
addonId: null,
|
|
85023
|
+
access: "view",
|
|
85024
|
+
role: "viewer"
|
|
85025
|
+
},
|
|
84952
85026
|
"timedRun.getStatus": {
|
|
84953
85027
|
capName: "timed-run",
|
|
84954
85028
|
capScope: "device",
|
|
@@ -84963,6 +85037,13 @@ Object.freeze({
|
|
|
84963
85037
|
access: "create",
|
|
84964
85038
|
role: "viewer"
|
|
84965
85039
|
},
|
|
85040
|
+
"timedRun.setSettings": {
|
|
85041
|
+
capName: "timed-run",
|
|
85042
|
+
capScope: "device",
|
|
85043
|
+
addonId: null,
|
|
85044
|
+
access: "create",
|
|
85045
|
+
role: "admin"
|
|
85046
|
+
},
|
|
84966
85047
|
"toast.onToast": {
|
|
84967
85048
|
capName: "toast",
|
|
84968
85049
|
capScope: "system",
|
|
@@ -88640,6 +88721,11 @@ Object.freeze({
|
|
|
88640
88721
|
form: "single",
|
|
88641
88722
|
optional: false
|
|
88642
88723
|
}],
|
|
88724
|
+
"timedRun.getOptions": [{
|
|
88725
|
+
name: "deviceId",
|
|
88726
|
+
form: "single",
|
|
88727
|
+
optional: false
|
|
88728
|
+
}],
|
|
88643
88729
|
"timedRun.getStatus": [{
|
|
88644
88730
|
name: "deviceId",
|
|
88645
88731
|
form: "single",
|
|
@@ -88650,6 +88736,11 @@ Object.freeze({
|
|
|
88650
88736
|
form: "single",
|
|
88651
88737
|
optional: false
|
|
88652
88738
|
}],
|
|
88739
|
+
"timedRun.setSettings": [{
|
|
88740
|
+
name: "deviceId",
|
|
88741
|
+
form: "single",
|
|
88742
|
+
optional: false
|
|
88743
|
+
}],
|
|
88653
88744
|
"update.getStatus": [{
|
|
88654
88745
|
name: "deviceId",
|
|
88655
88746
|
form: "single",
|
|
@@ -89512,6 +89603,7 @@ var STATE_SUMMARY_VARS = [
|
|
|
89512
89603
|
[...RULE_TEXT],
|
|
89513
89604
|
[...RULE_TEXT],
|
|
89514
89605
|
[...RULE_TEXT],
|
|
89606
|
+
[...RULE_TEXT],
|
|
89515
89607
|
[...RULE_BODY_ONLY],
|
|
89516
89608
|
[...RULE_TEXT],
|
|
89517
89609
|
([...RULE_TEXT], [...DEVICE_EVENTS]),
|
|
@@ -90250,7 +90342,7 @@ var AdminUIAddon = class extends BaseAddon {
|
|
|
90250
90342
|
capability: adminUiCapability,
|
|
90251
90343
|
provider: {
|
|
90252
90344
|
getStaticDir: async () => ({ staticDir: resolveAdminUiDistDir() }),
|
|
90253
|
-
getVersion: async () => ({ version: "1.2.
|
|
90345
|
+
getVersion: async () => ({ version: "1.2.612" })
|
|
90254
90346
|
}
|
|
90255
90347
|
}];
|
|
90256
90348
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-admin-ui",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.612",
|
|
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.
|
|
53
|
+
"server": ">=1.2.803"
|
|
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{$n as d,Bn as f,Fn as p,Ii as m,Kt as h,Li as g,Ni as _,Oi as v,Q as y,Rt as b,Sn as x,Tn as S,Ut as C,ai as w,bi as T,bt as ee,ct as te,fn as ne,ot as re,ut as E,wn as ie,xr as D}from"./player-overlays-CATQyQ4F.js";import{hs as O}from"./client-SlkZY5Jo.js";import{a as k,p as ae}from"./video-Au7ufp69.js";import{Br as oe,Ei as se,Fr as ce,Ir as le,Mf as A,Pr as ue,Qi as de,Rr as fe,Sa as pe,Uc as j,Vt as M,Zs as me,_a as N,_n as he,aa as P,ar as F,ba as ge,da as I,ea as L,er as R,fa as _e,ga as z,gn as ve,ha as ye,ia as be,jt as B,kf as xe,la as V,na as H,nr as U,oa as Se,of as Ce,pa as we,ra as W,rr as Te,sa as Ee,ta as De,tr as Oe,ua as ke,va as Ae,vi as G,xa as je,zr as Me}from"./src-Bo0PxLi8.js";import{t as K}from"./useTranslation-BJr-n0es.js";import"./mount-D_UMfR6-.js";import{Br as Ne,Pr as Pe,Rr as q}from"./index-B5JUA6GN.js";import{t as J}from"./AdminPage-TQfWsIdl.js";import{i as Fe,r as Ie,t as Le}from"./addon-kind-filter-CEGKkC1O.js";import{t as Y}from"./NodeAddonsSettingsPanel-DLOzyrXN.js";import{t as Re}from"./framework-packages-DoBKjjer.js";import{n as ze,t as X}from"./useNodeUrlSelection-LyLE5Mzl.js";function Be(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 Z={queued:{icon:T,bg:`bg-muted text-foreground-subtle`,labelKey:`addons.addonRowBadge.queued`},updating:{icon:D,bg:`bg-primary/10 text-primary`,labelKey:`addons.addonRowBadge.updating`,spin:!0},"done-pending-restart":{icon:p,bg:`bg-amber-500/10 text-amber-700`,labelKey:`addons.addonRowBadge.pendingRestart`},done:{icon:g,bg:`bg-success/10 text-success`,labelKey:`addons.addonRowBadge.done`},failed:{icon:k,bg:`bg-danger/10 text-danger`,labelKey:`addons.addonRowBadge.failed`}};function Q({item:e}){let{t:n}=K(),r=Z[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 Ve=new Set([`completed`,`failed`,`partially-failed`,`cancelled`]),He=new Set([`done`,`failed`,`skipped`]);function Ue(e){return!He.has(e.phase)&&!Ve.has(e.jobState)}function We(e,t){let n=new Map,r=[...e].sort((e,t)=>e.createdAtMs-t.createdAtMs);for(let e of r){let r=Ve.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 Ge(){let{data:e}=ke({activeOnly:!0},{refetchOnWindowFocus:!1,refetchInterval:e=>(e.state.data?.length??0)>0?3e3:!1}),{map:t}=A(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 We([...n.values()],Date.now())},[e,t])}var Ke={queued:{icon:T,cls:`bg-muted text-foreground-subtle`,labelKey:`addons.jobProgress.queued`},fetching:{icon:D,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.fetching`,spin:!0},staged:{icon:D,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.staged`,spin:!0},validating:{icon:D,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.validating`,spin:!0},applying:{icon:D,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.applying`,spin:!0},restarting:{icon:D,cls:`bg-amber-500/10 text-amber-600 dark:text-amber-400`,labelKey:`addons.jobProgress.restarting`,spin:!0},applied:{icon:D,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.finalizing`,spin:!0},done:{icon:g,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:ne,cls:`bg-muted text-foreground-subtle`,labelKey:`addons.jobProgress.skipped`}};function qe({progress:e}){let{t:n}=K(),r=Ke[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 Je(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 Ye(e){let t=e.version===null?``:` ${e.version}`,n=e.isOnline?``:` (offline: removed when it reconnects)`;return`- ${e.nodeName}${t}${n}`}function Xe(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(Ye)];return n.length>0&&r.push(`Could not ask: ${n.join(`, `)} — not included.`),r.push(`This cannot be undone.`),r.join(`
|
|
2
|
-
`)}function Ze(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 Qe={uninstalled:`uninstalled`,"not-installed":`was not installed`,refused:`REFUSED`,failed:`FAILED`,"pending-reconnect":`offline — removed when it reconnects`};function $e(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)}: ${Qe[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 et={},tt=3e4,nt=`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 rt({packageName:e,displayName:n,selectedNode:r,hideNodeAction:i,disabled:o}){let{t:s}=K(),c=l(),u=te(),d=re(),f=V(et,{staleTime:tt}),p=f.data?.installations??[],m=(f.data?.unreachable??[]).map(e=>e.nodeId),g=Je(p,e),_=e=>g.find(t=>t.nodeId===e)?.nodeName??(e===r.id?r.name:e),v=je({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?s(`addons.addonUninstallControls.uninstalled`,`{{displayName}} uninstalled`,{displayName:n}):s(`addons.addonUninstallControls.notEveryNodeWasCleaned`,`{{displayName}}: not every node was cleaned`,{displayName:n}),message:$e(e,_),variant:e.success?`default`:`danger`})},b=async t=>{try{await y(await v.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`})}},x=async()=>{let e=g.filter(e=>e.nodeId!==r.id);await u({title:s(`addons.addonUninstallControls.uninstallFrom`,`Uninstall {{displayName}} from {{name}}?`,{displayName:n,name:r.name}),message:Ze(n,r.name,e),confirmLabel:s(`addons.addonUninstallControls.uninstall`,`Uninstall`),variant:`danger`})&&await b(r.isHub?{}:{nodeId:r.id})},S=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=Je(t.installations,e);await u({title:s(`addons.addonUninstallControls.uninstallEverywhere`,`Uninstall {{displayName}} everywhere?`,{displayName:n}),message:Xe(n,r,t.unreachable.map(e=>e.nodeId)),confirmLabel:s(`addons.addonUninstallControls.uninstallFromNodeS`,`Uninstall from {{length}} node(s)`,{length:r.length}),variant:`danger`})&&await b({everywhere:!0})},C=v.isPending||o===!0;return t(`div`,{className:`flex items-center gap-1.5`,children:[i!==!0&&t(G,{variant:`unstyled`,type:`button`,onClick:e=>{e.stopPropagation(),x()},disabled:C,className:nt,title:s(`addons.addonUninstallControls.uninstallFrom2`,`Uninstall from {{name}}`,{name:r.name}),children:[a(h,{className:`h-3 w-3`}),v.isPending?s(`addons.addonUninstallControls.removing`,`Removing...`):s(`addons.addonUninstallControls.uninstall`,`Uninstall`)]}),(g.length>1||i===!0||m.length>0)&&t(G,{variant:`unstyled`,type:`button`,onClick:e=>{e.stopPropagation(),S()},disabled:C,className:nt,title:s(`addons.addonUninstallControls.uninstallFromEveryNodeThat`,`Uninstall from every node that has it`),children:[a(ae,{className:`h-3 w-3`}),g.length>0?s(`addons.uninstallControls.everywhereCount`,{count:g.length}):s(`addons.uninstallControls.everywhere`)]})]})}function it(e){return typeof e.deprecated==`string`&&e.deprecated.length>0}function at(e,t){return t?e:e.filter(e=>e.distTags.includes(`latest`)||!it(e))}function ot(e){return e.length-at(e,!1).length}c();function st({packageName:e,currentVersion:n,installSource:r,onInstall:i,onClose:o,onSelect:c,selectedVersion:l}){let{t:d}=K(),f=r===`upload`||r===`local`,[p,m]=s(!1),{data:h,isLoading:_,isError:v}=P({name:e}),y=h?at(h,p):[],x=h?ot(h):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(G,{variant:`unstyled`,type:`button`,onClick:o,className:`text-foreground-subtle hover:text-foreground`,children:a(ee,{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(b,{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(Pe,{i18nKey:`addons.versionPicker.reinstall`,values:{version:n},components:{mono:a(`span`,{className:`font-mono`})}})]})]}),_&&t(`div`,{className:`flex items-center justify-center gap-2 py-6 text-[10px] text-foreground-subtle`,children:[a(D,{className:`h-3.5 w-3.5 animate-spin`}),d(`addons.versionPicker.loadingVersions`,`Loading versions...`)]}),v&&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.`)}),y.length>0&&a(`div`,{className:`max-h-64 overflow-auto divide-y divide-border`,children:y.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)),it(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(G,{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(g,{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(G,{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(w,{className:`h-3 w-3`})})]},e.version)})}),!_&&!v&&h&&h.length===0&&a(`div`,{className:`py-4 text-center text-[10px] text-foreground-subtle`,children:d(`addons.versionPicker.noVersionsFound`,`No versions found`)}),x>0&&a(G,{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:()=>m(e=>!e),children:p?d(`addons.versionPicker.hideOlder`,`Hide older versions`):d(`addons.versionPicker.showOlder`,`Show older versions ({{count}})`,{count:x})})]})}c();var ct=`device-export`;function lt(e){return e.capabilities.some(e=>(typeof e==`string`?e:e.name)===ct)}function ut(e){return e!==`local`&&e!==`upload`}function dt({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,p=e?`bg-indigo-500/20 text-indigo-700 dark:text-indigo-300`:`bg-purple-500/20 text-purple-700 dark:text-purple-300`,m=r&&i?y(`/api/addon-assets/${r}/${i}`):null,h=!!m&&!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?``:p}`,style:u,children:h?a(`img`,{src:m,alt:r,className:`h-4 w-4`,onError:()=>l(!0)}):a(e?d:f,{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`}),ut(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(b,{className:`h-2.5 w-2.5 text-white`})})]})}function ft({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(D,{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(G,{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(w,{className:`h-3 w-3`}),d(`addons.addonCard.update`,`Update`)]}),t(G,{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(m,{className:`h-3 w-3`})]}),u]})}return t(`div`,{className:`relative inline-flex items-center gap-1 shrink-0`,children:[t(G,{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(m,{className:`h-3 w-3 opacity-50`})]}),u]})}function pt({addonId:e}){let t=l(),{data:n=`inherit`}=De({addonId:e}),r=N({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(G,{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 mt={id:`hub`,name:`Hub`,isHub:!0};function ht({addon:e,clusterStatus:n,hideVersion:r,availableUpdate:i,blockedUpdate:c,onUpdate:f,isUpdating:h,jobProgress:g,bundle:v,bulkItem:y,disabledByBulk:b,isSystem:C,selectedNode:w}){let{t:T}=K(),[te,ne]=s(!1),[re,E]=s(!1),[ie,D]=s(null);o(()=>{D(null)},[i]);let O=ie??i,[ae,A]=s(!1),[de,pe]=s(!1),[j,me]=s(`logs`),N=l(),P=q(),{manifest:F}=e,ge=!v&&!F.protected&&F.removable!==!1,I=!!v,L=v?.displayName??F.name,R=v?.packageName??F.packageName,_e=v?.version??F.packageVersion??F.version,z=v?.installSource??e.installSource,be=v?v.bundle?.description??v.addons[0]?.manifest.description:F.description,B=we({onSuccess:()=>{N.invalidateQueries({queryKey:[[`addons`]]})}}),xe=Se({onSuccess:()=>{N.invalidateQueries({queryKey:[[`addons`]]}),N.invalidateQueries({queryKey:[[`addonPages`]]}),N.invalidateQueries({queryKey:[[`capabilities`]]}),N.invalidateQueries({queryKey:[[`integrations`]]})}}),V=ye({onSuccess:()=>{N.invalidateQueries({queryKey:[[`addons`]]}),N.invalidateQueries({queryKey:[[`alerts`]]})}}),H=e.health,U=H?.phase===`failed`&&!H.inGracePeriod,Ce=U&&H?.nextRetryAt&&!H.retrying,W=Be(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:T(`addons.addonCard.failedToLoad`,{attempt:H.retryCount})}),a(`div`,{className:`text-[11px] text-foreground mt-0.5 break-words font-mono`,children:H.lastError?.message??T(`addons.addonCard.unknownError`,`Unknown error`)}),Ce&&H.nextRetryAt&&a(`div`,{className:`text-[10px] text-foreground-subtle mt-1`,children:T(`addons.addonCard.autoRetryAt`,{time:new Date(H.nextRetryAt).toLocaleTimeString()})})]}),t(G,{variant:`unstyled`,type:`button`,disabled:V.isPending||H.retrying,onClick:e=>{e.stopPropagation(),V.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:T(`addons.addonCard.resetRetryCounterAndForce`,`Reset retry counter and force immediate reload`),children:[a(p,{className:`h-3 w-3 ${V.isPending||H.retrying?`animate-spin`:``}`}),T(`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:T(`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(dt,{isBundle:I||!!F.components&&F.components.length>1,installSource:z,addonId:I?v.addons[0]?.manifest.id:F.id,iconPath:I?v.bundle?.icon??v.addons[0]?.manifest.icon:F.icon,color:I?v.addons[0]?.manifest.color:F.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(ft,{version:_e,availableUpdate:i,...O===void 0?{}:{selectedVersion:O},isUpdating:h,installSource:z,disabled:b,...f&&O!==void 0?{onUpdate:()=>f(O)}:{},onOpenPicker:()=>E(e=>!e),children:re&&a(st,{packageName:R,currentVersion:_e,...z?{installSource:z}:{},...i!==void 0&&O!==void 0?{selectedVersion:O,onSelect:e=>{D(e),E(!1)}}:{},onInstall:e=>{E(!1),xe.mutate({packageName:R,version:e})},onClose:()=>E(!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(d,{className:`h-3 w-3`}),v.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:T(`addons.addonCard.systemPackageUpdatingRestartsThe`,`System package — updating restarts the hub`),children:[a(p,{className:`h-3 w-3`}),T(`addons.addonCard.system`,`System`)]}),y!=null&&a(Q,{item:y}),c!==void 0&&a(se,{variant:`warning`,title:T(`addons.addonCard.updateHeldTitle`,{defaultValue:`{{latest}} is held until the server is {{required}} or newer`,latest:c.latestVersion,required:c.requiredServer}),children:T(`addons.addonCard.requiresServer`,{defaultValue:`requires server ≥ {{version}}`,version:c.requiredServer})}),g!=null&&a(qe,{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`?T(`addons.addonCard.forked`):T(`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(G,{variant:`unstyled`,type:`button`,onClick:e=>{e.stopPropagation(),B.mutate({addonId:F.id})},disabled:B.isPending||b,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(p,{className:`h-3 w-3 ${B.isPending?`animate-spin`:``}`}),T(`addons.addonCard.restart`,`Restart`)]}),t(G,{variant:`unstyled`,type:`button`,onClick:e=>{e.stopPropagation(),A(e=>!e)},className:`inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[10px] font-medium border transition-colors ${ae?`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(S,{className:`h-3 w-3`}),T(`addons.addonCard.logs`,`Logs`)]}),!I&&t(G,{variant:`unstyled`,type:`button`,onClick:e=>{e.stopPropagation(),pe(!0)},className:`inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[10px] font-medium border transition-colors ${de?`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`}),T(`addons.addonCard.settings`,`Settings`)]}),a(`div`,{className:`flex-1`}),ge&&a(rt,{packageName:F.packageName,displayName:F.name,selectedNode:w??mt,disabled:b})]}),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:T(`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:T(`addons.addonCard.outdated`)}),e.status===`offline`&&a(`span`,{className:`text-[9px] px-1 py-0.5 rounded bg-muted text-muted-foreground`,children:T(`common.offline`)}),e.synced&&e.status!==`offline`&&a(`span`,{className:`text-[9px] text-success`,children:T(`common.synced`)})]},e.nodeId))})]}),ae&&!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(G,{variant:`unstyled`,type:`button`,onClick:()=>me(`logs`),className:`px-2 py-0.5 transition-colors ${j===`logs`?`bg-primary/10 text-primary`:`text-foreground-subtle hover:bg-surface-hover`}`,children:T(`addons.addonCard.logs`,`Logs`)}),a(G,{variant:`unstyled`,type:`button`,onClick:()=>me(`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:T(`addons.addonCard.events`,`Events`)})]}),a(`div`,{className:`flex-1`}),a(G,{variant:`unstyled`,type:`button`,onClick:e=>{e.stopPropagation(),A(!1)},className:`text-foreground-subtle hover:text-foreground`,children:a(ee,{className:`h-3.5 w-3.5`})})]}),j===`logs`&&a(he,{addonId:F.id,maxHeight:`max-h-64`,showFilters:!1}),j===`events`&&a(ve,{addonId:F.id,category:`addon.*`,maxHeight:`max-h-64`})]}),I&&t(u,{children:[a(G,{variant:`unstyled`,type:`button`,onClick:()=>ne(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?_:m,{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:v.addons.map(e=>a(ht,{addon:e,hideVersion:!0},e.manifest.id))})]}),de&&!I&&a(ue,{open:!0,onOpenChange:e=>!e&&pe(!1),children:t(le,{width:`lg`,placement:`sheet-on-mobile`,scroll:`body`,children:[a(Me,{children:t(oe,{className:`flex items-center gap-2`,children:[a(x,{className:`h-4 w-4 text-primary`}),T(`addons.addonCard.settingsTitle`,{name:L})]})}),t(ce,{className:`space-y-4`,children:[a(`div`,{className:`text-[10px] text-foreground-subtle mb-2`,children:T(`addons.addonCard.clusterWideSettingsOneValue`,`Cluster-wide settings — one value for every node. Per-node settings live under Cluster → the node → Settings.`)}),a(Y,{nodeId:null,addonIds:[F.id],level:`global`,fieldScope:`cluster`,emptyMessage:T(`addons.addonCard.thisAddonExposesNoCluster`,`This addon exposes no cluster-wide settings. Anything it can configure is per-node — open it from Cluster → the node → Settings.`)}),lt(F)&&t(`div`,{children:[a(`div`,{className:`text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2`,children:T(`addons.addonCard.deviceExport`,`Device export`)}),a(M,{addonId:F.id,onOpenDevice:e=>P(`/devices/${e}`)})]}),ut(z)&&t(`div`,{children:[a(`div`,{className:`text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2`,children:T(`addons.addonCard.autoUpdate`,`Auto-Update`)}),a(pt,{addonId:F.id})]}),F.components&&F.components.length>0&&t(`div`,{children:[a(`div`,{className:`text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2`,children:T(`addons.addonCard.components`,{count:F.components.length})}),a(`div`,{className:`flex flex-wrap gap-1`,children:F.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(fe,{children:a(G,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>pe(!1),children:T(`common.close`,`Close`)})})]})})]})}c();var gt=`.tgz,.tar.gz,.zip`;function _t({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(y(`/api/addons/upload`),{method:`POST`,headers:{Authorization:`Bearer ${r}`},body:n})).json()).success&&e()}finally{c(!1)}},[e]);return t(u,{children:[a(F,{ref:l,accept:gt,onChange:i(e=>{let t=e.target.files?.[0];t&&d(t),e.target.value=``},[d]),className:`hidden`}),t(G,{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(D,{className:`w-3.5 h-3.5 animate-spin`}):a(b,{className:`w-3.5 h-3.5`}),o?r(`addons.addonUploadZone.uploading`,`Uploading...`):r(`addons.addonUploadZone.upload`,`Upload`)]})]})}var vt=/```[^\n]*\n([\s\S]*?)```/g;function yt(e){let t=[],n=0;for(let r of e.matchAll(vt)){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 bt(e){let t=e.trim();return t.startsWith(`https://`)||t.startsWith(`http://`)?t:null}function xt(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?bt(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 St(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:xt(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:xt(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=xt(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 Ct({markdown:e}){return a(`div`,{className:`text-xs text-foreground leading-relaxed`,children:yt(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:St(e.body,`b${t}`)},`text-${t}`))})}c();function wt(e){return e.replace(/^@camstack\/(addon-)?/,``)}function Tt(e,t,n){let r=at(e,n);return r.some(e=>e.version===t)?r:[{version:t,distTags:[],deprecated:void 0},...r]}function Et({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(D,{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(Ct,{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 Dt({target:e,installing:n,installError:r,onClose:i,onInstall:o}){let{t:c}=K(),[l,u]=s(e.version),[d,f]=s(!1),p=P({name:e.name}),m=be({name:e.name,version:l}),h=p.data??[],g=ot(h),_=Tt(h,l,d),v=m.data;return a(ue,{open:!0,onOpenChange:e=>!e&&i(),children:t(le,{width:`lg`,placement:`sheet-on-mobile`,scroll:`body`,children:[a(Me,{children:a(oe,{children:c(`addons.installDialog.title`,`Install {{name}}`,{name:wt(e.name)})})}),t(ce,{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(E,{"aria-label":c(`addons.installDialog.version`,`Version`),value:l,options:_.map(e=>({value:e.version,label:it(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(G,{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(R,{defaultValue:`readme`,children:[t(U,{children:[a(Te,{value:`readme`,children:c(`addons.installDialog.readme`,`README`)}),a(Te,{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(Et,{pending:m.isPending,failed:m.isError,body:v?.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(Et,{pending:m.isPending,failed:m.isError,body:v?.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(fe,{children:[a(G,{type:`button`,variant:`outline`,size:`sm`,onClick:i,children:c(`common.cancel`,`Cancel`)}),a(G,{type:`button`,size:`sm`,disabled:n||l.length===0,onClick:()=>o(e.name,l),children:n?a(D,{className:`h-3.5 w-3.5 animate-spin`}):c(`addons.installDialog.install`,`Install`)})]})]})})}var Ot=new Set([`@camstack/server`,`@camstack/types`,`@camstack/sdk`,`@camstack/ui-library`,`@camstack/addon-agent-ui`]);function kt(e,t){let n=new Map;for(let r of e){if(r.isHub||r.onHub||Ot.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 At({selectedNode:e}){let{t:n}=K(),{data:r}=V(et,{staleTime:tt});if(r===void 0)return null;let i=kt(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(rt,{packageName:n.packageName,displayName:n.packageName,selectedNode:e,hideNodeAction:e.isHub})]},n.packageName))]})}function jt({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(se,{variant:`success`,icon:a(g,{className:`h-3 w-3`}),children:e.installedVersion??i(`system.capabilityCatalog.installed`,`Installed`)}):t(G,{size:`sm`,onClick:()=>r(e),disabled:n,className:`shrink-0`,children:[n?a(D,{className:`h-3 w-3 animate-spin`}):a(w,{className:`h-3 w-3`}),i(`system.capabilityCatalog.install`,`Install`)]})]})}function Mt({capability:e,installing:n,onInstall:r}){let{t:i}=K(),{data:o,isPending:s,isError:c}=z({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(D,{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(jt,{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 Nt(e){return e===`npm`||e===`dev`?e:null}var Pt=`rounded-full border border-primary bg-primary/10 px-2 py-0.5 text-[10px] text-foreground`,Ft=`rounded-full border border-border px-2 py-0.5 text-[10px] text-foreground-muted hover:bg-surface-hover`,It=[{seconds:900,label:`15m`},{seconds:3600,label:`1h`},{seconds:21600,label:`6h`},{seconds:43200,label:`12h`},{seconds:86400,label:`24h`}],Lt={id:`hub`,name:`Hub`,isHub:!0,isOnline:!0};function Rt(e,t){let n=e??`hub-only`;return n===`any-node`?!0:n===`hub-only`?t:!t}function zt(e){return e===`local`?`dev`:`npm`}function Bt(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 Vt(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 Ht({addons:c,clusterStatus:u,selectedNode:d,onRefresh:f,listPhase:m}){let{t:h}=K(),g=l(),[_,y]=s(``),b=e(_),[x,S]=s(!1),C=n(null);o(()=>{if(!x)return;let e=e=>{C.current&&!C.current.contains(e.target)&&S(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[x]);let{data:T}=I({nodeId:d.id}),ee=r(()=>{let e=new Map;for(let t of T??[])t.blockedBy===void 0&&e.set(t.name,t.latestVersion);return e},[T]),ne=r(()=>{let e=new Map;for(let t of T??[]){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},[T]),re=r(()=>(T??[]).filter(e=>!e.isSystem&&e.blockedBy===void 0).length,[T]),[O,k]=s(()=>new Set),[ae,oe]=s(()=>new Map),se=i(e=>{k(t=>new Set(t).add(e))},[]),ce=i(e=>{k(t=>{if(!t.has(e))return t;let n=new Set(t);return n.delete(e),n})},[]),le=i((e,t)=>{oe(n=>new Map(n).set(e,t))},[]),A=i(e=>{oe(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),ue=pe({onMutate:e=>{se(e.name),A(e.name)},onSuccess:(e,t)=>{ce(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)=>{ce(t.name),le(t.name,e instanceof Error?e.message:String(e))}}),fe=Ge(),j=n(new Set);o(()=>{let e=new Set;for(let[t,n]of fe)Ue(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`]]}))},[fe,g]);let{data:M}=H(void 0),N=de({onSuccess:()=>{g.invalidateQueries({queryKey:[[`addons`,`getAutoUpdateSettings`]]})}}),he=Ae({onSuccess:()=>{g.invalidateQueries({queryKey:[[`addons`,`getAutoUpdateSettings`]]})}}),{data:P,isFetching:F}=z({query:b||void 0},{enabled:x}),L=ge(),{data:R}=W(void 0),_e=R?.requestedAt,[ve,ye]=s(null),[be,B]=s(!1);o(()=>{if(R?.kind===`framework-bulk-update`&&R.requestedAt!==ve){ye(R.requestedAt),B(!0);let e=window.setTimeout(()=>B(!1),6e3);return()=>window.clearTimeout(e)}},[_e,ve,R]),te();let xe=i(async()=>{let e=(T??[]).filter(e=>!e.isSystem&&e.blockedBy===void 0);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]})}},[T,d.id,d.isHub,L,ue]),[V,U]=s(null),[we,Te]=s(null),Ee=e=>{Te(null),U(e)},De=Se({onSuccess:()=>{U(null),Te(null),g.invalidateQueries({queryKey:[[`addons`]]}),g.invalidateQueries({queryKey:[[`addonPages`]]}),g.invalidateQueries({queryKey:[[`capabilities`]]}),g.invalidateQueries({queryKey:[[`integrations`]]})},onError:e=>{Te(e instanceof Error?e.message:`Install failed`)}}),[Oe,ke]=s(`type`),[je,Me]=s(()=>typeof window>`u`?`grouped`:window.localStorage.getItem(`camstack.addons.viewMode`)===`flat`?`flat`:`grouped`),Pe=e=>{Me(e),typeof window<`u`&&window.localStorage.setItem(`camstack.addons.viewMode`,e)},[q,J]=Ne(),Y=q.get(`capability`),ze=q.get(`updatable`)===`1`,X=q.get(`error`)===`1`,Z=Nt(q.get(`source`)),Q=Fe(q.get(Le))===`integration`,{data:Ve}=me(void 0,{enabled:Q}),He=r(()=>Ve===void 0?null:new Set(Ve.map(e=>e.addonId)),[Ve]),We=i(e=>{let t=new URLSearchParams(q);e?t.set(Le,`integration`):t.delete(Le),J(t,{replace:!0})},[q,J]),Ke=i(e=>{let t=new URLSearchParams(q);e?t.set(`updatable`,`1`):t.delete(`updatable`),J(t,{replace:!0})},[q,J]),qe=i(e=>{let t=new URLSearchParams(q);e?t.set(`error`,`1`):t.delete(`error`),J(t,{replace:!0})},[q,J]),Je=i(e=>{let t=new URLSearchParams(q);e===null?t.delete(`source`):t.set(`source`,e),J(t,{replace:!0})},[q,J]),Ye=r(()=>c.filter(e=>Be(e.process)!==null).length,[c]),Xe=r(()=>{let e=c.filter(e=>!Re(e.manifest.packageName));return d.isHub||(e=e.filter(e=>Rt(e.placement,d.isHub))),Y&&(e=e.filter(e=>(e.manifest.capabilities??[]).some(e=>(typeof e==`string`?e:e.name)===Y))),Q&&(e=[...Ie(e,He)]),ze&&(e=e.filter(e=>{let t=e.manifest.packageName;return t!==void 0&&ee.has(t)})),Z!==null&&(e=e.filter(e=>zt(e.installSource)===Z)),X&&(e=e.filter(e=>Be(e.process)!==null)),e},[c,d.isHub,Y,ze,Z,X,Q,He,ee]),Ze=()=>{let e=new URLSearchParams(q);e.delete(`capability`),J(e,{replace:!0})},Qe=je===`flat`?Xe:Vt(Xe),$e=r(()=>{let e=[...Qe];switch(Oe){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},[Qe,Oe]);return t(`div`,{className:`space-y-3`,children:[[...ae.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:h(`systemPage.addons.updateFailed`,{name:e})}),a(`div`,{className:`text-foreground-subtle font-mono`,children:n})]}),a(G,{variant:`unstyled`,type:`button`,onClick:()=>A(e),className:`text-foreground-subtle hover:text-foreground text-[10px]`,children:h(`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:h(`admin.system.addons.sort`,`Sort:`)}),t(E,{wrapperClassName:`inline-block w-auto`,value:Oe,onChange:e=>ke(e.target.value),children:[a(`option`,{value:`type`,children:h(`admin.system.addons.bundlesFirst`,`Bundles first`)}),a(`option`,{value:`name`,children:h(`admin.system.addons.name`,`Name`)}),a(`option`,{value:`source`,children:h(`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:h(`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(G,{variant:`unstyled`,type:`button`,onClick:()=>Pe(e),className:`px-2 py-1 transition-colors capitalize ${je===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&&t(`div`,{className:`flex items-center gap-1.5`,children:[a(p,{className:`h-3 w-3 text-foreground-subtle`}),a(`span`,{className:`text-[10px] text-foreground-subtle`,children:h(`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(G,{variant:`unstyled`,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&&t(`div`,{className:`flex items-center gap-1.5`,children:[a(`span`,{className:`text-[10px] text-foreground-subtle`,children:h(`admin.system.addons.checkEvery`,`Check every:`)}),a(E,{wrapperClassName:`inline-block w-auto`,className:`font-medium text-foreground-subtle`,value:M?.updateCheckIntervalSeconds??21600,disabled:he.isPending||M===void 0,onChange:e=>{M!==void 0&&he.mutate({channel:M.channel,updateCheckIntervalSeconds:Number(e.target.value)})},children:It.map(e=>a(`option`,{value:e.seconds,children:e.label},e.seconds))})]}),re>0&&t(G,{variant:`unstyled`,type:`button`,onClick:()=>void xe(),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?a(D,{className:`w-3 h-3 animate-spin`}):a(w,{className:`w-3 h-3`}),L.isPending?h(`admin.system.addons.updating`,`Updating…`):h(`admin.system.addons.updateAll`,`Update All ({{nonSystemUpdateCount}})`,{nonSystemUpdateCount:re})]})]}),t(`div`,{className:`flex flex-wrap items-center gap-1.5`,role:`group`,"aria-label":h(`admin.system.addons.filterInstalledAddons`,`Filter installed addons`),children:[a(`span`,{className:`text-[10px] text-foreground-subtle`,children:h(`admin.system.addons.filter`,`Filter:`)}),[{id:`integrations`,label:h(`admin.system.addons.integrations`,`Integrations`),pressed:Q,toggle:()=>We(!Q)},{id:`updatable`,label:h(`admin.system.addons.updatable`,`Updatable`),pressed:ze,toggle:()=>Ke(!ze)},{id:`error`,label:h(`admin.system.addons.inError`,`In error ({{count}})`,{count:Ye}),pressed:X,toggle:()=>qe(!X)},{id:`npm`,label:`npm`,pressed:Z===`npm`,toggle:()=>Je(Z===`npm`?null:`npm`)},{id:`dev`,label:h(`admin.system.addons.dev`,`Dev`),pressed:Z===`dev`,toggle:()=>Je(Z===`dev`?null:`dev`)}].map(e=>a(G,{variant:`unstyled`,type:`button`,"aria-pressed":e.pressed,onClick:e.toggle,className:e.pressed?Pt:Ft,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:C,children:[a(Ce,{type:`text`,searchHotkey:!0,value:_,onChange:e=>{y(e.target.value),S(!0)},onFocus:()=>S(!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:a(ie,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),rightSlot:F?a(D,{className:`h-3 w-3 animate-spin`}):void 0}),x&&P&&P.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:[P.length>0&&a(`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:P.length})}),P&&P.length>0&&a(`div`,{className:`max-h-72 overflow-auto divide-y divide-border`,children:P.map(e=>a(jt,{addon:e,installing:De.isPending,onInstall:e=>Ee({name:e.name,version:e.version,description:e.description})},e.name))})]})]}),a(_t,{onUploadSuccess:()=>{g.invalidateQueries({queryKey:[[`addons`]]}),f()}})]}),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:h(`admin.system.addons.filteringByCapability`,`Filtering by capability:`)}),a(`span`,{className:`font-mono text-primary font-semibold`,children:Y}),a(G,{variant:`unstyled`,type:`button`,onClick:Ze,className:`ml-auto text-xs text-foreground-subtle hover:text-foreground underline`,children:h(`admin.system.addons.clear`,`Clear`)})]}),Y&&a(Mt,{capability:Y,installing:De.isPending,onInstall:e=>Ee({name:e.name,version:e.version,description:e.description})}),Y&&Xe.length>0&&a(`h2`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:h(`admin.system.addons.installed`,`Installed`)}),be&&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(v,{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:h(`admin.system.addons.bulkUpdateCompleted`,`Bulk update completed`)}),a(`div`,{className:`text-[10px] text-foreground-subtle mt-0.5`,children:h(`admin.system.addons.systemPackagesUpdatedHubRestarted`,`System packages updated — hub restarted successfully.`)})]})]}),m===`pending`&&t(`div`,{className:`flex items-center gap-2 text-xs text-foreground-subtle`,children:[a(D,{className:`h-3 w-3 animate-spin`}),h(`admin.system.addons.loadingInstalled`,`Loading installed addons…`)]}),m===`error`&&a(`div`,{className:`text-xs text-danger`,children:h(`admin.system.addons.failedToLoadAddons`,`Failed to load addons`)}),m===`ready`&&Xe.length===0&&a(`div`,{className:`text-xs text-foreground-subtle`,children:c.length===0?h(`admin.system.addons.noAddonsInstalled`,`No addons installed`):Y?h(`admin.system.addons.noInstalledAddonDeclaresThe`,`No installed addon declares the "{{capabilityFilter}}" capability. Any addon you can install appears under "Available to install" above.`,{capabilityFilter:Y}):h(`admin.system.addons.noAddonsCompatibleWithPlacement`,`No addons compatible with {{name}} (placement filter active)`,{name:d.name})}),a(`div`,{className:`space-y-1.5`,children:m===`ready`&&$e.map(e=>{let t=$(e)?e.bundle.packageName:e.manifest.packageName,n=ee.get(t),r=ne.get(t),i=$(e)?e.representative:e,o=n?e=>ue.mutate({name:t,version:e,nodeId:d.id}):void 0,s=fe.get(t)??null,c=s!==null&&Ue(s);return a(ht,{addon:i,clusterStatus:u?.[i.manifest.id],bundle:$(e)?e.bundle:void 0,availableUpdate:n,...r===void 0?{}:{blockedUpdate:r},isUpdating:O.has(t)||c,jobProgress:s,onUpdate:o,disabledByBulk:L.isPending,selectedNode:d},$(e)?t:e.manifest.id)})}),V!==null&&a(Dt,{target:V,installing:De.isPending,installError:we,onClose:()=>U(null),onInstall:(e,t)=>De.mutate({packageName:e,version:t})})]})}function Ut(){let{t:e}=K(),r=l(),{data:i}=j(void 0),{nodes:s}=xe(),{selection:c,selectNode:u,requestedNodeId:d}=X(s.length>0?s:[Lt]),f=c.node??Lt,m=f.id,h=s.length>0?c.staleNodeId:null,{data:g,isLoading:_,isError:v}=Ee({nodeId:m}),y=L(),b=_e(),x=y.isPending||b.isPending,S=async()=>{await y.mutateAsync({nodeId:m}),await b.mutateAsync(),r.invalidateQueries({queryKey:[[`addons`]]})},C=n(y);C.current=y;let w=n(d??`hub`);o(()=>{C.current.mutate({nodeId:w.current})},[]);let T=(g??[]).map(Bt).filter(e=>e!==null);return t(J,{children:[t(`div`,{className:`flex items-center justify-between gap-2 flex-wrap`,children:[a(B,{selectedNodeId:m,onSelect:u}),t(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[!_&&!v&&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:T.length})}),t(G,{variant:`unstyled`,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:[a(p,{className:`w-3 h-3 ${x?`animate-spin`:``}`}),e(`admin.system.addons.checkForUpdates`,`Check for updates`)]})]})]}),a(ze,{staleNodeId:h,shownNodeName:f.name}),a(At,{selectedNode:f}),a(Ht,{addons:T,clusterStatus:i,selectedNode:f,onRefresh:()=>void S(),listPhase:_?`pending`:v?`error`:`ready`})]})}export{Ut 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{D as o,kr as s,un as c,yn as l}from"./player-overlays-CATQyQ4F.js";import{n as u,t as d}from"./key-square-B56nI7zn.js";import{p as f}from"./video-Au7ufp69.js";import{Ei as p,In as m,ca as h,sa as g}from"./src-Bo0PxLi8.js";import{t as _}from"./useTranslation-BJr-n0es.js";import{F as v,Fr as y,P as b,Pr as x,X as S,_ as C,ot as w,ut as T,v as E}from"./index-B5JUA6GN.js";import{n as D,t as O}from"./NodeAddonsSettingsPanel-DLOzyrXN.js";import{f as k,t as A}from"./InstancesTable-FjdeKpTU.js";import{n as j,t as M}from"./IntegrationHub-CCRQOfas.js";a();function N(e,t){if(e.type===`group`){for(let n of e.fields)N(n,t);return}if(e.type===`sub-tabs`){for(let n of e.tabs)for(let e of n.fields)N(e,t);return}`value`in e&&(t[e.key]=e.value)}function P(e){let t={};for(let n of e.sections)for(let e of n.fields)N(e,t);return t}function F({sectionIds:e,omitSectionIds:n,hideSectionChrome:i,emptyMessage:a}){let o=C(),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)??!1));return{...o.data,sections:D(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(I,{schema:s})}function I({schema:a}){let{t:o}=_(),s=E(),[c,l]=i(null),u=t(()=>P(a),[a]),d=n(async e=>{l(null);try{await s.mutateAsync({patch:e})}catch(e){throw l(e instanceof Error&&e.message.length>0?e.message:o(`system.bootstrapForm.saveFailed`,`Could not save`)),e}},[s,o]),f=v({schema:a,serverValues:u,onImmediateSave:e=>void d(e).catch(()=>void 0),onDeferredSave:d});return e(`div`,{className:`flex flex-col gap-3`,children:[c!==null&&r(`div`,{role:`alert`,className:`rounded-md border border-danger/40 bg-danger/10 px-3 py-2 text-xs text-danger`,children:c}),r(T,{schema:a,values:f.values,onChange:f.handleChange,disabled:s.isPending}),r(b,{pendingCount:f.pendingKeys.length,onSave:()=>f.handleSave(f.pendingKeys),onDiscard:()=>f.handleDiscard(f.pendingKeys),saving:s.isPending})]})}function L(e){return e?{state:`ok`,stateLabel:`enabled`}:{state:`off`,stateLabel:`disabled`}}a();var R=3e4,z=[{capName:`auth-provider`,stageBadge:null},{capName:`user-passkeys`,stageBadge:`Second factor`}],B={titleKey:`system.authentication.sectionTitle`,subtitleKey:`system.authentication.sectionSubtitle`,emptyTitleKey:`system.authentication.sectionEmptyTitle`,emptyDescriptionKey:`system.authentication.sectionEmptyDescription`,installLabelKey:`system.authentication.sectionInstall`};function V(e){return e===`local-auth`?{headline:`Username + password (local).`,icon:d,bullets:[`Users live in the hub’s SQLite database — no IdP roundtrip.`,`TOTP / 2FA is self-enrolled: each user enables it from their own profile page (My access → Two-factor authentication).`,`Scoped tokens, admin tokens and sessions are managed from Identity → Tokens & sessions.`],setupSteps:[`A fresh hub has one account, admin / changeme — the first sign-in asks for a new password. Add users from Users → New user.`,`Hand out either passwords or scoped tokens — both validate through this provider.`]}:e.startsWith(`auth-oidc`)?{headline:`OpenID Connect (Google, Microsoft, Okta, Keycloak, …).`,icon:f,bullets:[`Three-leg redirect flow with PKCE S256 + nonce.`,`id_token is signature-verified against the IdP’s JWKS — no implicit trust.`,`Explicit linking only: an IdP account signs in only the CamStack user who linked it from their profile (My access → Linked sign-in accounts). No auto-created users, no email matching.`,`The linked user’s role, scopes and two-factor authentication apply.`],setupSteps:[`Register a web app at your IdP and copy the client_id + client_secret.`,"Choose a stable instance id (slug). Set the IdP redirect URI to `https://<this-hub>/addon/auth-oidc/<id>/callback`.",`In Sign-in connections below, Add connection — enter the id, issuer, and credentials; Save.`,`Each user then links their IdP account from My access → Linked sign-in accounts.`]}:e.startsWith(`auth-saml`)?{headline:`SAML 2.0 — enterprise SSO (Azure AD, Okta, OneLogin).`,icon:f,bullets:[`Heavier handshake than OIDC — exchange metadata XML with your IdP.`,`Group → role mapping via SAML assertions.`]}:e.startsWith(`auth-webauthn`)||e.startsWith(`auth-passkey`)?{headline:`Passkeys / WebAuthn — passwordless second factor.`,icon:c,bullets:[`Enroll a YubiKey, Touch ID, or platform passkey per user.`,`Resistant to phishing — the browser binds the credential to your hub origin.`]}:e.startsWith(`auth-totp`)?{headline:`TOTP — second factor.`,icon:c,bullets:[`Time-based codes from an authenticator app (RFC 6238).`,`Compatible with Google Authenticator, Aegis, 1Password, Bitwarden, etc.`]}:{headline:`Authentication provider.`,icon:l,bullets:[`Generic authentication provider. No additional hints registered.`]}}function H(){let{t:n}=_(),i=h({capName:z[0].capName},{refetchInterval:R}),a=h({capName:z[1].capName},{refetchInterval:R}),o=g(void 0,{refetchInterval:R}),s=t(()=>w(o.data??[]),[o.data]),c=t(()=>{let e=[],t=[i.data??[],a.data??[]];for(let[n,r]of z.entries())for(let i of t[n]??[])e.push({addonId:i.addonId,displayName:s.get(i.addonId)??i.addonId,isActive:i.isActive,capName:r.capName,stageBadge:r.stageBadge});return e},[i.data,a.data,s]),u=[{id:`authentication`,label:n(`system.authentication.authenticationProviders`,`Authentication providers`),install:{capability:z[0].capName,label:n(B.installLabelKey)},entries:c.map(e=>({id:e.addonId,name:e.displayName,fallbackIcon:l,...L(e.isActive),render:()=>r(j,{addonId:e.addonId,displayName:e.displayName,capName:e.capName,isActive:e.isActive,badges:e.stageBadge===null?null:r(p,{variant:`info`,className:k,children:e.stageBadge}),panels:[{id:`about`,title:n(`system.authentication.about`,`About`),icon:V(e.addonId).icon,content:r(q,{addonId:e.addonId})}]})}))}];return e(`div`,{className:`space-y-3 sm:space-y-4`,children:[r(M,{embedded:!0,icon:l,title:n(B.titleKey),subtitle:n(B.subtitleKey),groups:u,isLoading:i.isLoading||a.isLoading,emptyTitle:n(B.emptyTitleKey),emptyDescription:n(B.emptyDescriptionKey)}),r(A,{functionCap:`login-method`,icon:f,title:n(`system.authentication.connectionsTitle`,`Sign-in connections`),subtitle:n(`system.authentication.connectionsSubtitle`,`Identity providers that sign users in. Each connection has its own id, which cannot be changed later.`),emptyTitle:n(`system.authentication.connectionsEmptyTitle`,`No sign-in connections`),emptyDescription:n(`system.authentication.connectionsEmptyDescription`,`Add a connection to let users sign in through an identity provider.`),addLabel:n(`system.authentication.addConnection`,`Add connection`),typedId:()=>({pattern:S})}),r(W,{}),r(K,{})]})}var U=`system-config-auth`;function W(){let{t:e}=_();return r(m,{headingId:`authentication-policy`,title:e(`system.authentication.policyTitle`,`Sign-in policy`),icon:l,children:r(`div`,{className:o,children:r(F,{sectionIds:[U],hideSectionChrome:!0,emptyMessage:e(`system.authentication.policyUnavailable`,`Not available — the addon that owns these settings did not answer.`)})})})}var G=`webauthn`;function K(){let{t:e}=_();return r(m,{headingId:`authentication-passkey-rp`,title:e(`system.authentication.passkeyRpTitle`,`Passkey relying party`),icon:c,children:r(`div`,{className:o,children:r(O,{nodeId:`hub`,addonIds:[`auth-webauthn`],level:`global`,sectionIds:[G],hideSectionChrome:!0,emptyMessage:e(`system.authentication.passkeyRpUnavailable`,`Not available — the addon that owns these settings did not answer.`)})})})}function q({addonId:t}){let{t:n}=_(),i=V(t),a=i.icon;return e(`div`,{className:`space-y-3 rounded-lg border border-border bg-surface p-2 sm:p-4`,children:[e(`div`,{className:`flex items-start gap-2.5`,children:[r(a,{className:`h-4 w-4 mt-0.5 text-primary shrink-0`}),r(`div`,{className:`text-xs text-foreground font-medium`,children:i.headline})]}),r(`ul`,{className:`text-xs text-foreground-subtle space-y-1.5 pl-6 list-disc`,children:i.bullets.map((e,t)=>r(`li`,{children:e},t))}),i.setupSteps&&i.setupSteps.length>0&&e(`div`,{className:`rounded-md border border-border bg-surface-hover/40 px-3 py-2.5 space-y-1.5`,children:[e(`div`,{className:`flex items-center gap-1.5 text-[10px] font-semibold text-foreground-subtle uppercase tracking-wide`,children:[r(u,{className:`h-3 w-3`}),n(`system.authentication.setupSteps`,`Setup steps`)]}),r(`ol`,{className:`text-xs text-foreground space-y-0.5 pl-4 list-decimal`,children:i.setupSteps.map((e,t)=>r(`li`,{children:e},t))})]}),t===`local-auth`&&e(`div`,{className:`rounded-md border border-info/30 bg-info/5 px-3 py-2 flex items-start gap-2 text-[11px] text-foreground`,children:[r(s,{className:`h-3.5 w-3.5 mt-0.5 text-info shrink-0`}),r(`span`,{children:r(x,{i18nKey:`system.authentication.totpNote`,components:{access:r(y,{to:`/system/my-access?tab=sign-in`,className:`underline text-primary`}),users:r(y,{to:`/system/identity?tab=users`,className:`underline text-primary`})}})})]})]})}export{F as i,H as n,G as r,U as t};
|