@camstack/addon-admin-ui 1.2.442 → 1.2.444
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AddonAssetIcon-BccuV0q0.js → AddonAssetIcon-Bu6mMt1C.js} +1 -1
- package/dist/assets/Addons-COIVGqm1.js +4 -0
- package/dist/assets/AdminPage-CQo22qlS.js +1 -0
- package/dist/assets/AdminSectionedPage-B-vU2e0-.js +1 -0
- package/dist/assets/AiProfiles-CU2eppU9.js +3 -0
- package/dist/assets/{BrokerForm-DzQNeSxm.js → BrokerForm-F3TuyGuz.js} +1 -1
- package/dist/assets/Build-kD_UpwAf.js +40 -0
- package/dist/assets/{Calendars-Cla89sbi.js → Calendars-BIK8tWWW.js} +1 -1
- package/dist/assets/Cluster-_ehM-rcf.js +1 -0
- package/dist/assets/ClusterStepModel-_rs8hojC.js +1 -0
- package/dist/assets/CompositionEditor-CAVyLS8E.js +1 -0
- package/dist/assets/{CompositionEditorPage-BgQSiVo8.js → CompositionEditorPage-LHnmpaBG.js} +1 -1
- package/dist/assets/Data-CjKZYFLT.js +2 -0
- package/dist/assets/DeviceDetail-Bg0CFoFt.js +2 -0
- package/dist/assets/{DeviceDoActionFields-BjVWVHu7.js → DeviceDoActionFields-oa5LfgEc.js} +1 -1
- package/dist/assets/{Devices-D9zuTHOW.js → Devices-poYGMM17.js} +1 -1
- package/dist/assets/{EmbedPlayerPage-MXUvBkWX.js → EmbedPlayerPage-DHUkmfpi.js} +1 -1
- package/dist/assets/History-BemofISk.js +1 -0
- package/dist/assets/Identity-i5HDvKSk.js +1 -0
- package/dist/assets/IntegrationDetail-DhTGMtwY.js +1 -0
- package/dist/assets/IntegrationHub-yEjjqm-b.js +1 -0
- package/dist/assets/Integrations-Bx1K8v1_.js +1 -0
- package/dist/assets/Integrations-DM18WhBS.js +1 -0
- package/dist/assets/Library-BlINo2aE.js +1 -0
- package/dist/assets/Locations-ClflpavL.js +3 -0
- package/dist/assets/{Logs-CVR97TYT.js → Logs-DCYNwky1.js} +1 -1
- package/dist/assets/{MaskShapeCanvas-DEZFJVo5.js → MaskShapeCanvas-CLIOU75o.js} +1 -1
- package/dist/assets/{MotionZonesSettings-Bwo-3iRG.js → MotionZonesSettings-CnE1SA-E.js} +1 -1
- package/dist/assets/MyAccess-CfC5QQ3s.js +2 -0
- package/dist/assets/{Network-CNhaeFmn.js → Network-BQ4JNadZ.js} +1 -1
- package/dist/assets/{NodeAddonsSettingsPanel-CRyxRlRb.js → NodeAddonsSettingsPanel-Cxa0ELmc.js} +1 -1
- package/dist/assets/Notifications-CZCz5f4V.js +1 -0
- package/dist/assets/{PrivacyMaskSettings-cDl1Qu_T.js → PrivacyMaskSettings-D9OU-0Bn.js} +1 -1
- package/dist/assets/Recordings-D2V7gQg4.js +1 -0
- package/dist/assets/{ScanNetworkModal-C5RUKriq.js → ScanNetworkModal-qXvq-PVn.js} +1 -1
- package/dist/assets/{SceneMonitorEditor-BmaWm_DT.js → SceneMonitorEditor-Z1tONQgv.js} +1 -1
- package/dist/assets/SessionsList-DRTHtQFG.js +2 -0
- package/dist/assets/Showroom-DsWM4R62.js +1 -0
- package/dist/assets/System-BO2ViXLt.js +1 -0
- package/dist/assets/{Terminal-BdKedDZS.js → Terminal-DSlfvSeb.js} +3 -3
- package/dist/assets/{Viewer-LdYt8Q3H.js → Viewer-B9E-i-aL.js} +1 -1
- package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-DId7Mdzp.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-Bxpb3Ns6.js} +1 -1
- package/dist/assets/{addon-icons-context-BNhm5nij.js → addon-icons-context-HpTz6tFr.js} +1 -1
- package/dist/assets/{archive-Dj3rQasM.js → archive-BhX0MX1x.js} +1 -1
- package/dist/assets/{authed-media-CRKmATDJ.js → authed-media-ajJETyPB.js} +1 -1
- package/dist/assets/{bell-off-BxB4ohQe.js → bell-off-2A9pKMoS.js} +1 -1
- package/dist/assets/{board-model-Bx9i2Ikh.js → board-model-BVOHJW-k.js} +1 -1
- package/dist/assets/{boxes-Cyb74Sc2.js → boxes-DKovb6Yx.js} +1 -1
- package/dist/assets/circle-slash-ioY3pbkD.js +1 -0
- package/dist/assets/client-BOc9ypnl.js +358 -0
- package/dist/assets/{cloud-upload-STkEa8On.js → cloud-upload-CsCUf2VU.js} +1 -1
- package/dist/assets/crop-BbAQnCUc.js +1 -0
- package/dist/assets/{device-integration-icon-NmvFHcoT.js → device-integration-icon-CkT2sHMd.js} +1 -1
- package/dist/assets/device-picker-model-CQpRlaca.js +1 -0
- package/dist/assets/{dist-CboU_aT5.js → dist-Cj5HXsk2.js} +1 -1
- package/dist/assets/dist-Dw33BAaG.js +358 -0
- package/dist/assets/{eraser-MfKJ-xHy.js → eraser-CNEtQPIU.js} +1 -1
- package/dist/assets/{hard-drive-download-DNMTqY2h.js → hard-drive-download-CwMKGnle.js} +1 -1
- package/dist/assets/{hostInit-LP6ARUYA.js → hostInit-CDGHjPjp.js} +1 -1
- package/dist/assets/i18n-DzruZdmx.js +1 -0
- package/dist/assets/icons-CDiKrupg.js +1 -0
- package/dist/assets/index-CcCgJ28N.css +2 -0
- package/dist/assets/index-DzDx8M2g.js +4 -0
- package/dist/assets/{key-LDVs0Hda.js → key-BX-E7v5U.js} +1 -1
- package/dist/assets/{key-round-ufq1OhZE.js → key-round-B4PhAHaZ.js} +1 -1
- package/dist/assets/{layers-DMR3HPTk.js → layers-NfjCHzhF.js} +1 -1
- package/dist/assets/{linked-devices-model-BhIH5Kho.js → linked-devices-model-C2Gvr2Rq.js} +1 -1
- package/dist/assets/{list-ordered-iFgP3FdK.js → list-ordered-BU_60EAm.js} +1 -1
- package/dist/assets/{location-owned-usage-ChRB3Z7a.js → location-owned-usage-Dive37hg.js} +1 -1
- package/dist/assets/{log-in-4wTdM9C2.js → log-in-R8rfmtnj.js} +1 -1
- package/dist/assets/{memory-stick-BVZbZTDE.js → memory-stick-C-FtHTf2.js} +1 -1
- package/dist/assets/{message-square-plus-DTEXt10L.js → message-square-plus-CTNIdqDb.js} +1 -1
- package/dist/assets/{mf-entry-bootstrap-0-6f3bb22b.js → mf-entry-bootstrap-0-adac5fea.js} +2 -2
- package/dist/assets/{mic-off-BOvuLxyG.js → mic-off-DbMF1Y3I.js} +1 -1
- package/dist/assets/{monitor-off-BJJUHiNu.js → monitor-off-CKeLNGdf.js} +1 -1
- package/dist/assets/{monitor-smartphone-BaRjkvN9.js → monitor-smartphone-DkSAqU6y.js} +1 -1
- package/dist/assets/mount-CQpRlaca.js +1 -0
- package/dist/assets/notification-schedule-field-BxKX0BnZ.js +1 -0
- package/dist/assets/player-overlays-CAMZYPzW.js +1 -0
- package/dist/assets/{recycle-CjrRLz-b.js → recycle-coHHb6k6.js} +1 -1
- package/dist/assets/remoteEntry-BM1N_mRj.js +1 -0
- package/dist/assets/{scan-eye-D35EojCj.js → scan-eye-C4uwlmDz.js} +1 -1
- package/dist/assets/{scissors-DreuVKed.js → scissors-D7cwr443.js} +1 -1
- package/dist/assets/{search-x-DQHP4OCR.js → search-x-Bslo2FkO.js} +1 -1
- package/dist/assets/{send-Dta9lxhX.js → send-BlcnRlFD.js} +1 -1
- package/dist/assets/{settings-2-DPZ8CKFD.js → settings-2-BWuIEodd.js} +1 -1
- package/dist/assets/{speaker-D95jrOt6.js → speaker-BzFTvxeb.js} +1 -1
- package/dist/assets/src-K7pIMCyE.js +67 -0
- package/dist/assets/{timer-reset-EEmenpu7.js → timer-reset-pzWKM4kj.js} +1 -1
- package/dist/assets/uPlot.esm-B6hGABOr.js +10 -0
- package/dist/assets/{ungroup-Db4urNO1.js → ungroup-COyVBHW5.js} +1 -1
- package/dist/assets/{unlink-6J-SREPz.js → unlink-CK2LhAFN.js} +1 -1
- package/dist/assets/{usb-UiuX4lHP.js → usb-D8FdL_8F.js} +1 -1
- package/dist/assets/{use-scenes-feed-xAvk3mdK.js → use-scenes-feed-BHhoT9GM.js} +1 -1
- package/dist/assets/{use-stationary-objects-BSuACN9l.js → use-stationary-objects-BEzZKgd5.js} +1 -1
- package/dist/assets/useEventInvalidation-CQpRlaca.js +1 -0
- package/dist/assets/{useNodeUrlSelection-itsA69-a.js → useNodeUrlSelection-1qoQDGNg.js} +1 -1
- package/dist/assets/user-round-DvukaL-O.js +1 -0
- package/dist/assets/{user-x-BiLr1XcR.js → user-x-6Zpsyjh-.js} +1 -1
- package/dist/assets/{video-DSVienqW.js → video-CBDxZVQI.js} +1 -1
- package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-BzdoZPn9.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-qIFS5MFb.js} +2 -2
- package/dist/index.html +11 -11
- package/dist/server/addon.js +272 -25
- package/package.json +1 -1
- package/dist/assets/Addons-kSQ_LfKG.js +0 -4
- package/dist/assets/AdminPage-C_5SnDIL.js +0 -1
- package/dist/assets/AdminSectionedPage-9KWXxykK.js +0 -1
- package/dist/assets/AiProfiles-jgiZ-hEI.js +0 -3
- package/dist/assets/Build-DCeob-yZ.js +0 -40
- package/dist/assets/Cluster-eTZjguTx.js +0 -1
- package/dist/assets/ClusterStepModel-8aoPvS-k.js +0 -1
- package/dist/assets/CompositionEditor-CJR7m-qo.js +0 -1
- package/dist/assets/Data-xUdBOATt.js +0 -2
- package/dist/assets/DeviceDetail-BxgqCzrO.js +0 -2
- package/dist/assets/Identity-0TfWSUca.js +0 -1
- package/dist/assets/IntegrationDetail-e-6OvQx9.js +0 -1
- package/dist/assets/IntegrationHub-CA9MM1oL.js +0 -1
- package/dist/assets/Integrations-BbsiTLtO.js +0 -1
- package/dist/assets/Integrations-BdrRZHfb.js +0 -1
- package/dist/assets/Library-B9_Scpen.js +0 -1
- package/dist/assets/Locations-DdCSAAsc.js +0 -3
- package/dist/assets/MyAccess-oZ9l9GBy.js +0 -2
- package/dist/assets/Notifications-2cTCf7lp.js +0 -1
- package/dist/assets/Recordings-DycF_b6H.js +0 -1
- package/dist/assets/SessionsList-Cu3ZE31w.js +0 -2
- package/dist/assets/Showroom-ndc_ZezE.js +0 -1
- package/dist/assets/System-C_RpKyaA.js +0 -1
- package/dist/assets/circle-slash-CJ8sDXES.js +0 -1
- package/dist/assets/client-CqoBi3ym.js +0 -358
- package/dist/assets/crop-Cvf_bPJF.js +0 -1
- package/dist/assets/device-picker-model-2g0u_pQE.js +0 -1
- package/dist/assets/dist-yylqec5a.js +0 -358
- package/dist/assets/history-ohLSkO2A.js +0 -1
- package/dist/assets/i18n-Bldp2nug.js +0 -1
- package/dist/assets/icons-Bft8hsua.js +0 -1
- package/dist/assets/index-CN7xsFJi.css +0 -2
- package/dist/assets/index-WxoBkjSL.js +0 -4
- package/dist/assets/mount-2g0u_pQE.js +0 -1
- package/dist/assets/notification-schedule-field-BHhbg0a-.js +0 -1
- package/dist/assets/player-overlays-CpALjVtS.js +0 -1
- package/dist/assets/remoteEntry-CgICLtvC.js +0 -1
- package/dist/assets/src-CsHgYIi2.js +0 -67
- package/dist/assets/useEventInvalidation-2g0u_pQE.js +0 -1
- package/dist/assets/user-round-t1eXjuPz.js +0 -1
package/dist/index.html
CHANGED
|
@@ -117,19 +117,19 @@
|
|
|
117
117
|
})
|
|
118
118
|
})()
|
|
119
119
|
</script>
|
|
120
|
-
<script type="module" crossorigin src="./assets/mf-entry-bootstrap-0-
|
|
120
|
+
<script type="module" crossorigin src="./assets/mf-entry-bootstrap-0-adac5fea.js"></script>
|
|
121
121
|
<link rel="modulepreload" crossorigin href="./assets/__vite-browser-external-BlMfPwfH.js">
|
|
122
|
-
<link rel="modulepreload" crossorigin href="./assets/client-
|
|
123
|
-
<link rel="modulepreload" crossorigin href="./assets/player-overlays-
|
|
124
|
-
<link rel="modulepreload" crossorigin href="./assets/src-
|
|
122
|
+
<link rel="modulepreload" crossorigin href="./assets/client-BOc9ypnl.js">
|
|
123
|
+
<link rel="modulepreload" crossorigin href="./assets/player-overlays-CAMZYPzW.js">
|
|
124
|
+
<link rel="modulepreload" crossorigin href="./assets/src-K7pIMCyE.js">
|
|
125
125
|
<link rel="modulepreload" crossorigin href="./assets/useTranslation-D3Is_4B6.js">
|
|
126
|
-
<link rel="modulepreload" crossorigin href="./assets/i18n-
|
|
127
|
-
<link rel="modulepreload" crossorigin href="./assets/video-
|
|
128
|
-
<link rel="modulepreload" crossorigin href="./assets/mount-
|
|
129
|
-
<link rel="modulepreload" crossorigin href="./assets/addon-icons-context-
|
|
130
|
-
<link rel="modulepreload" crossorigin href="./assets/notification-schedule-field-
|
|
131
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
132
|
-
<link rel="modulepreload" crossorigin href="./assets/hostInit-
|
|
126
|
+
<link rel="modulepreload" crossorigin href="./assets/i18n-DzruZdmx.js">
|
|
127
|
+
<link rel="modulepreload" crossorigin href="./assets/video-CBDxZVQI.js">
|
|
128
|
+
<link rel="modulepreload" crossorigin href="./assets/mount-CQpRlaca.js">
|
|
129
|
+
<link rel="modulepreload" crossorigin href="./assets/addon-icons-context-HpTz6tFr.js">
|
|
130
|
+
<link rel="modulepreload" crossorigin href="./assets/notification-schedule-field-BxKX0BnZ.js">
|
|
131
|
+
<link rel="stylesheet" crossorigin href="./assets/index-CcCgJ28N.css">
|
|
132
|
+
<link rel="modulepreload" crossorigin href="./assets/hostInit-CDGHjPjp.js"><link rel="modulepreload" crossorigin href="./assets/index-DzDx8M2g.js"><link rel="modulepreload" crossorigin href="./assets/remoteEntry-BM1N_mRj.js"><link rel="modulepreload" crossorigin href="./assets/_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-Bxpb3Ns6.js"><link rel="modulepreload" crossorigin href="./assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CEHpkaJP.js"><link rel="modulepreload" crossorigin href="./assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_client__loadShare__.js-8kv6pj9W.js"><link rel="modulepreload" crossorigin href="./assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.js-DdJYWyu3.js"><link rel="modulepreload" crossorigin href="./assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.js-DPkvGqVU.js"><link rel="modulepreload" crossorigin href="./assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-Cb2QlpvS.js"></head>
|
|
133
133
|
<body>
|
|
134
134
|
<div id="root"></div>
|
|
135
135
|
<!-- Lock the app shell at 1x zoom. iOS Safari ignores `user-scalable=no`
|
package/dist/server/addon.js
CHANGED
|
@@ -5415,7 +5415,7 @@ var ZodIssueCode = {
|
|
|
5415
5415
|
var ZodFirstPartyTypeKind;
|
|
5416
5416
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5417
5417
|
//#endregion
|
|
5418
|
-
//#region ../types/dist/sleep-
|
|
5418
|
+
//#region ../types/dist/sleep-BSuCCFjf.mjs
|
|
5419
5419
|
/**
|
|
5420
5420
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5421
5421
|
* window to float samples (D455).
|
|
@@ -16826,7 +16826,19 @@ var DeviceHistorySubjectSchema = discriminatedUnion("kind", [object({
|
|
|
16826
16826
|
kind: literal("node"),
|
|
16827
16827
|
nodeId: string().min(1)
|
|
16828
16828
|
})]);
|
|
16829
|
+
/**
|
|
16830
|
+
* `enum` stores a STATE as the ordinal of its value in the series' value list
|
|
16831
|
+
* (`DeviceHistorySeriesInfo.values`, append-only, so an ordinal never changes
|
|
16832
|
+
* meaning); a rollup keeps the time spent in each state (`states`).
|
|
16833
|
+
*/
|
|
16829
16834
|
var DeviceHistoryKindSchema = _enum([
|
|
16835
|
+
"gauge",
|
|
16836
|
+
"counter",
|
|
16837
|
+
"boolean",
|
|
16838
|
+
"enum"
|
|
16839
|
+
]);
|
|
16840
|
+
/** What a PRODUCER may declare. `enum` is cap-only: its value list is the cap field's. */
|
|
16841
|
+
var DeviceHistoryProducerKindSchema = _enum([
|
|
16830
16842
|
"gauge",
|
|
16831
16843
|
"counter",
|
|
16832
16844
|
"boolean"
|
|
@@ -16863,7 +16875,13 @@ var SeriesInfoSchema = object({
|
|
|
16863
16875
|
/** `null` is unknown (a `unitFrom` series whose device does not state a unit right now), never a guess. */
|
|
16864
16876
|
unit: string().nullable(),
|
|
16865
16877
|
displayName: string(),
|
|
16866
|
-
source: _enum([
|
|
16878
|
+
source: _enum([
|
|
16879
|
+
"cap",
|
|
16880
|
+
"addon",
|
|
16881
|
+
"derived"
|
|
16882
|
+
]),
|
|
16883
|
+
/** `enum`: the value of each ordinal (index = ordinal); `null` for every other kind. */
|
|
16884
|
+
values: array(string()).readonly().nullable(),
|
|
16867
16885
|
firstTs: number(),
|
|
16868
16886
|
lastTs: number()
|
|
16869
16887
|
});
|
|
@@ -16877,17 +16895,31 @@ var QueryPointSchema = object({
|
|
|
16877
16895
|
twMean: number().nullable(),
|
|
16878
16896
|
min: number(),
|
|
16879
16897
|
max: number(),
|
|
16880
|
-
/** `null` is unknown, never zero (D393). */
|
|
16881
|
-
last: number().nullable()
|
|
16898
|
+
/** `null` is unknown, never zero (D393). For an `enum` series: the ordinal of {@link state}. */
|
|
16899
|
+
last: number().nullable(),
|
|
16900
|
+
/**
|
|
16901
|
+
* The increase over the point: a `counter`'s growth since the previous point
|
|
16902
|
+
* or bucket (a drop is a reset, counted from zero), and for
|
|
16903
|
+
* {@link DEVICE_HISTORY_ENERGY_KEY} the kWh used in the bucket. `null` for
|
|
16904
|
+
* every other kind, and when it cannot be known.
|
|
16905
|
+
*/
|
|
16906
|
+
delta: number().nullable(),
|
|
16907
|
+
/** `enum`: the state in force at the end of the point (the name of `last`); `null` otherwise. */
|
|
16908
|
+
state: string().nullable(),
|
|
16909
|
+
/** `enum` rollup: milliseconds spent in each state inside the bucket; `null` for raw points and other kinds. */
|
|
16910
|
+
states: record(string(), number()).nullable()
|
|
16882
16911
|
});
|
|
16883
16912
|
var QuerySeriesSchema = object({
|
|
16884
16913
|
scope: string(),
|
|
16885
16914
|
/** The last point STRICTLY BEFORE `from` in the chosen tier, so a step chart can start at the held value. */
|
|
16886
16915
|
before: object({
|
|
16887
16916
|
t: number(),
|
|
16888
|
-
value: number().nullable()
|
|
16917
|
+
value: number().nullable(),
|
|
16918
|
+
state: string().nullable()
|
|
16889
16919
|
}).nullable(),
|
|
16890
|
-
points: array(QueryPointSchema).readonly()
|
|
16920
|
+
points: array(QueryPointSchema).readonly(),
|
|
16921
|
+
/** A derived key: the stored key its points were computed from; `null` for a stored series. */
|
|
16922
|
+
derivedFrom: string().nullable()
|
|
16891
16923
|
});
|
|
16892
16924
|
/** The window part of a query, shared by the device and node forms. */
|
|
16893
16925
|
var QueryWindowShape = {
|
|
@@ -16903,6 +16935,23 @@ var QueryResultSchema = object({
|
|
|
16903
16935
|
series: array(QuerySeriesSchema).readonly(),
|
|
16904
16936
|
truncated: boolean()
|
|
16905
16937
|
});
|
|
16938
|
+
/** One read of a batch: a device's key or a node's key (exactly one subject). */
|
|
16939
|
+
var QueryManyItemSchema = union([object({
|
|
16940
|
+
deviceId: number().int(),
|
|
16941
|
+
key: string(),
|
|
16942
|
+
scope: string().optional()
|
|
16943
|
+
}), object({
|
|
16944
|
+
forNodeId: string().min(1),
|
|
16945
|
+
key: string(),
|
|
16946
|
+
scope: string().optional()
|
|
16947
|
+
})]);
|
|
16948
|
+
var QueryManyEntrySchema = discriminatedUnion("ok", [object({
|
|
16949
|
+
ok: literal(true),
|
|
16950
|
+
result: QueryResultSchema
|
|
16951
|
+
}), object({
|
|
16952
|
+
ok: literal(false),
|
|
16953
|
+
error: string()
|
|
16954
|
+
})]);
|
|
16906
16955
|
var TierStatusSchema = object({
|
|
16907
16956
|
tier: DeviceHistoryResolutionSchema,
|
|
16908
16957
|
/** `null` until the first background count answered. */
|
|
@@ -16958,16 +17007,22 @@ var DeviceHistoryStatusSchema = object({
|
|
|
16958
17007
|
lastRefreshAt: number().nullable()
|
|
16959
17008
|
})
|
|
16960
17009
|
});
|
|
16961
|
-
method(object({ deviceId: number().int() }), array(SeriesInfoSchema).readonly()), method(object({
|
|
17010
|
+
method(object({ deviceId: number().int() }), array(SeriesInfoSchema).readonly()), method(object({ forNodeId: string().min(1) }), array(SeriesInfoSchema).readonly(), { auth: "admin" }), method(object({
|
|
16962
17011
|
deviceId: number().int(),
|
|
16963
17012
|
...QueryWindowShape
|
|
16964
17013
|
}), QueryResultSchema), method(object({
|
|
16965
|
-
|
|
17014
|
+
forNodeId: string().min(1),
|
|
16966
17015
|
...QueryWindowShape
|
|
16967
17016
|
}), QueryResultSchema, { auth: "admin" }), method(object({
|
|
17017
|
+
items: array(QueryManyItemSchema).min(1).max(24),
|
|
17018
|
+
from: QueryWindowShape.from,
|
|
17019
|
+
to: QueryWindowShape.to,
|
|
17020
|
+
resolution: QueryWindowShape.resolution,
|
|
17021
|
+
maxPoints: QueryWindowShape.maxPoints
|
|
17022
|
+
}), object({ results: array(QueryManyEntrySchema).readonly() }), { auth: "admin" }), method(object({
|
|
16968
17023
|
name: string().regex(/^[a-z0-9-]+$/),
|
|
16969
17024
|
subjectKind: _enum(["device", "node"]),
|
|
16970
|
-
kind:
|
|
17025
|
+
kind: DeviceHistoryProducerKindSchema,
|
|
16971
17026
|
unit: string().optional(),
|
|
16972
17027
|
displayName: string().min(1),
|
|
16973
17028
|
ingest: _enum(["points", "buckets"])
|
|
@@ -39984,14 +40039,106 @@ var LogEntrySchema = object({
|
|
|
39984
40039
|
meta: record(string(), unknown()).optional(),
|
|
39985
40040
|
tags: record(string(), string()).optional()
|
|
39986
40041
|
});
|
|
39987
|
-
|
|
39988
|
-
|
|
40042
|
+
/**
|
|
40043
|
+
* A history READ against one destination (D898).
|
|
40044
|
+
*
|
|
40045
|
+
* Every filter is applied by the PROVIDER, before the limit — a filter the
|
|
40046
|
+
* browser applied after the limit is what made a rare device's lines
|
|
40047
|
+
* unreachable behind a busy one's. `before` / `after` are cursors the provider
|
|
40048
|
+
* minted (opaque to everyone else): a file position for the rotated files, a
|
|
40049
|
+
* nanosecond timestamp for Loki.
|
|
40050
|
+
*
|
|
40051
|
+
* A read is BOUNDED by `budgetMs`: a filter that matches nothing on a 30-day
|
|
40052
|
+
* store answers `done: false` with the cursor it reached and the bytes it
|
|
40053
|
+
* scanned, and the caller decides whether to go on. That is what makes a long
|
|
40054
|
+
* scan show progress and stop when asked — `cancelRead` ends the slice in
|
|
40055
|
+
* flight, and not asking for the next slice ends the scan.
|
|
40056
|
+
*/
|
|
40057
|
+
var LogReadQuerySchema = object({
|
|
40058
|
+
/** Correlates `cancelRead`. Caller-chosen, unique per in-flight read. */
|
|
40059
|
+
requestId: string().min(1).max(64).optional(),
|
|
40060
|
+
/** The device the line is about (`tags.deviceId`, numeric). */
|
|
40061
|
+
deviceId: number().int().optional(),
|
|
40062
|
+
/**
|
|
40063
|
+
* The emitting addon — bare manifest id; `@<version>` / `::<sub>` suffixes
|
|
40064
|
+
* match. Not `addonId`: a cap router reads that name as "which provider".
|
|
40065
|
+
*/
|
|
40066
|
+
fromAddonId: string().min(1).max(200).optional(),
|
|
40067
|
+
/**
|
|
40068
|
+
* The emitting node: matches the agent that emitted the line, the node
|
|
40069
|
+
* itself, or a worker under it (`<agent>/<runner>`) — the `agentId`
|
|
40070
|
+
* semantics of `matchesLogTags`. Not `nodeId`: a cap router reads that
|
|
40071
|
+
* name as "which node's provider".
|
|
40072
|
+
*/
|
|
40073
|
+
fromNodeId: string().min(1).max(200).optional(),
|
|
40074
|
+
/** Any other tag, exact match (AND). */
|
|
40075
|
+
tags: record(string(), union([string(), number()])).optional(),
|
|
40076
|
+
/** Severity FLOOR: this level and above. */
|
|
39989
40077
|
level: LogLevelSchema.optional(),
|
|
39990
|
-
|
|
39991
|
-
|
|
39992
|
-
|
|
39993
|
-
|
|
39994
|
-
|
|
40078
|
+
/** Case-insensitive substring over message, scope, tag values and meta values. */
|
|
40079
|
+
text: string().min(1).max(200).optional(),
|
|
40080
|
+
/** Epoch ms, inclusive. */
|
|
40081
|
+
since: number().optional(),
|
|
40082
|
+
/** Epoch ms, inclusive. */
|
|
40083
|
+
until: number().optional(),
|
|
40084
|
+
/** Older than this cursor (exclusive). Absent with `after` absent ⇒ from the newest. */
|
|
40085
|
+
before: string().min(1).max(1024).optional(),
|
|
40086
|
+
/** Newer than this cursor (exclusive). */
|
|
40087
|
+
after: string().min(1).max(1024).optional(),
|
|
40088
|
+
limit: number().int().min(1).max(1e3).optional(),
|
|
40089
|
+
/** Wall-clock bound of this slice. The provider caps it. */
|
|
40090
|
+
budgetMs: number().int().min(50).max(1e4).optional()
|
|
40091
|
+
});
|
|
40092
|
+
var LogReadResultSchema = object({
|
|
40093
|
+
/** Newest first. */
|
|
40094
|
+
entries: array(object({
|
|
40095
|
+
/** `<bootId>.<seq>` minted by the emitting LogManager — the dedupe key. */
|
|
40096
|
+
id: string().optional(),
|
|
40097
|
+
/** Epoch ms. */
|
|
40098
|
+
timestamp: number(),
|
|
40099
|
+
level: LogLevelSchema,
|
|
40100
|
+
scope: string().optional(),
|
|
40101
|
+
message: string(),
|
|
40102
|
+
tags: record(string(), union([string(), number()])).optional(),
|
|
40103
|
+
meta: record(string(), unknown()).optional()
|
|
40104
|
+
})),
|
|
40105
|
+
/** Pass as `before` for the next older page; null when nothing older exists. */
|
|
40106
|
+
nextBefore: string().nullable(),
|
|
40107
|
+
/** Pass as `after` to read what arrived since; null when unknown. */
|
|
40108
|
+
nextAfter: string().nullable(),
|
|
40109
|
+
/** Bytes this slice read (files) or received (remote). Progress, not a promise. */
|
|
40110
|
+
scannedBytes: number().int().nonnegative(),
|
|
40111
|
+
/**
|
|
40112
|
+
* True when the scan in this direction reached the end of the store.
|
|
40113
|
+
* False with fewer than `limit` entries means the budget ran out first —
|
|
40114
|
+
* call again with `nextBefore` to go on.
|
|
40115
|
+
*/
|
|
40116
|
+
done: boolean(),
|
|
40117
|
+
/** True when `cancelRead` ended this slice early. */
|
|
40118
|
+
cancelled: boolean().optional()
|
|
40119
|
+
});
|
|
40120
|
+
var LogReadCapabilitiesSchema = object({
|
|
40121
|
+
/** False ⇒ this destination only ships lines (console, forwarder, an unconfigured Loki). */
|
|
40122
|
+
readable: boolean(),
|
|
40123
|
+
/** Why not, when `readable` is false — rendered next to the source. */
|
|
40124
|
+
reason: string().nullable(),
|
|
40125
|
+
/** Filters the provider applies itself. A false one is applied by nobody. */
|
|
40126
|
+
filters: object({
|
|
40127
|
+
deviceId: boolean(),
|
|
40128
|
+
addonId: boolean(),
|
|
40129
|
+
nodeId: boolean(),
|
|
40130
|
+
tags: boolean(),
|
|
40131
|
+
level: boolean(),
|
|
40132
|
+
text: boolean(),
|
|
40133
|
+
timeRange: boolean()
|
|
40134
|
+
}),
|
|
40135
|
+
/** How far back the store reaches, when the provider knows (days). */
|
|
40136
|
+
retentionDays: number().nullable()
|
|
40137
|
+
});
|
|
40138
|
+
method(LogEntrySchema, _void(), { kind: "mutation" }), optionalMethod(_void(), LogReadCapabilitiesSchema, { auth: "admin" }), optionalMethod(LogReadQuerySchema, LogReadResultSchema, { auth: "admin" }), optionalMethod(object({ requestId: string().min(1).max(64) }), object({ cancelled: boolean() }), {
|
|
40139
|
+
kind: "mutation",
|
|
40140
|
+
auth: "admin"
|
|
40141
|
+
});
|
|
39995
40142
|
/**
|
|
39996
40143
|
* `login-method` — collection cap through which auth addons contribute
|
|
39997
40144
|
* their pre-auth login surfaces to the login page. This is the SINGLE,
|
|
@@ -42547,6 +42694,33 @@ var NcRuleTargetSchema = object({
|
|
|
42547
42694
|
params: record(string(), unknown()).optional()
|
|
42548
42695
|
});
|
|
42549
42696
|
/**
|
|
42697
|
+
* WHAT THE NOTIFICATION'S PICTURE IS (D897) — the ONE media choice of a rule.
|
|
42698
|
+
*
|
|
42699
|
+
* Every mode starts from the same CLEAN source frame of the trigger moment
|
|
42700
|
+
* (keyFrame → sceneFrame → lastSceneFrame, narrowed to the trigger instant and
|
|
42701
|
+
* to the zone that fired the rule) and renders it once at send time:
|
|
42702
|
+
* - `scene-boxes` — the whole scene, the subject outlined thick in the accent
|
|
42703
|
+
* colour and every OTHER track visible at that instant outlined thin, each
|
|
42704
|
+
* labelled with class and confidence ("dog 87%").
|
|
42705
|
+
* - `crop` — the subject cut out of that frame around its box at that instant.
|
|
42706
|
+
* - `clean` — the whole scene with nothing drawn on it.
|
|
42707
|
+
* - `none` — no picture.
|
|
42708
|
+
*
|
|
42709
|
+
* A mode that cannot be honoured (no box at that instant, a photograph with no
|
|
42710
|
+
* tracked subject) ships `clean` and names the reason in the log, per camera.
|
|
42711
|
+
* It replaces the `attach` × `frame` × `zoneCrop` triple, which let one rule
|
|
42712
|
+
* ship a crop on one event and a boxed scene on the next depending on which
|
|
42713
|
+
* stored kind had landed.
|
|
42714
|
+
*/
|
|
42715
|
+
var NcMediaImageSchema = _enum([
|
|
42716
|
+
"scene-boxes",
|
|
42717
|
+
"crop",
|
|
42718
|
+
"clean",
|
|
42719
|
+
"none"
|
|
42720
|
+
]);
|
|
42721
|
+
/**
|
|
42722
|
+
* @deprecated Read only by `normalizeNcMediaPolicy` (D897) — see {@link NcMediaImageSchema}.
|
|
42723
|
+
*
|
|
42550
42724
|
* Media attachment policy (P1 still-image subset).
|
|
42551
42725
|
* - `best` — the best AVAILABLE subject image at dispatch time (D-3).
|
|
42552
42726
|
* - `best-matching` — the media that explains WHY the rule fired: a rule
|
|
@@ -42560,6 +42734,8 @@ var NcRuleTargetSchema = object({
|
|
|
42560
42734
|
* - `none` — no attachment.
|
|
42561
42735
|
*/
|
|
42562
42736
|
/**
|
|
42737
|
+
* @deprecated Read only by `normalizeNcMediaPolicy` (D897) — see {@link NcMediaImageSchema}.
|
|
42738
|
+
*
|
|
42563
42739
|
* WHAT THE PICTURE SHOWS — chosen explicitly, because the implicit ladders
|
|
42564
42740
|
* conflate it with the selection strategy and betray the request: asking for
|
|
42565
42741
|
* the clean scene frame on an object-event owner used to start at
|
|
@@ -42588,16 +42764,29 @@ var NcMediaFrameSchema = _enum([
|
|
|
42588
42764
|
*/
|
|
42589
42765
|
var NcLinkedCameraModeSchema = _enum(["mosaic", "each"]);
|
|
42590
42766
|
var NcMediaPolicySchema = object({
|
|
42767
|
+
/**
|
|
42768
|
+
* The picture — see {@link NcMediaImageSchema}. Absent on a rule nobody has
|
|
42769
|
+
* saved since D897: `normalizeNcMediaPolicy` derives it from the legacy
|
|
42770
|
+
* triple below, at load and at every write, and the store keeps only this.
|
|
42771
|
+
*/
|
|
42772
|
+
image: NcMediaImageSchema.optional(),
|
|
42773
|
+
/**
|
|
42774
|
+
* Draw the zone that FIRED the rule on the picture (`scene-boxes` / `clean`;
|
|
42775
|
+
* a `crop` never shows it). Valid only on a rule whose trigger is a zone —
|
|
42776
|
+
* `conditions.zones` or an occupancy zone — and refused on save otherwise.
|
|
42777
|
+
* Replaces `zoneCrop`.
|
|
42778
|
+
*/
|
|
42779
|
+
showTriggerZone: boolean().optional(),
|
|
42780
|
+
/** @deprecated D897 — accepted from an editor that predates `image`, folded into it on save. */
|
|
42591
42781
|
attach: _enum([
|
|
42592
42782
|
"best",
|
|
42593
42783
|
"best-matching",
|
|
42594
42784
|
"keyFrame",
|
|
42595
42785
|
"none"
|
|
42596
|
-
]).
|
|
42597
|
-
/**
|
|
42786
|
+
]).optional(),
|
|
42787
|
+
/** @deprecated D897 — accepted from an editor that predates `image`, folded into it on save. */
|
|
42598
42788
|
frame: NcMediaFrameSchema.optional(),
|
|
42599
|
-
/**
|
|
42600
|
-
* "show me the ZONE", not the whole scene or the subject crop. */
|
|
42789
|
+
/** @deprecated D897 — folded into `image: 'clean'` + `showTriggerZone` on save. */
|
|
42601
42790
|
zoneCrop: boolean().optional(),
|
|
42602
42791
|
/**
|
|
42603
42792
|
* Also attach a short GIF cut from the stream broker's clip ring around the
|
|
@@ -42769,7 +42958,9 @@ var NcRuleInputSchema = object({
|
|
|
42769
42958
|
* targets.
|
|
42770
42959
|
*/
|
|
42771
42960
|
targetUsers: array(string()).optional(),
|
|
42772
|
-
|
|
42961
|
+
/** Absent = the kind's default picture (`resolveNcMediaImage`): the subject crop for a
|
|
42962
|
+
* detection, the clean scene for a sensor or a sound. Set explicitly on save (D897). */
|
|
42963
|
+
media: NcMediaPolicySchema.default({}),
|
|
42773
42964
|
throttle: NcThrottleSchema.default({
|
|
42774
42965
|
cooldownSec: 60,
|
|
42775
42966
|
scope: "rule-device"
|
|
@@ -43706,13 +43897,37 @@ var NcAlarmModeOpeningsSchema = object({
|
|
|
43706
43897
|
/** Covered devices whose state could not be read (D49): neither open nor closed. */
|
|
43707
43898
|
unknown: array(number().int())
|
|
43708
43899
|
});
|
|
43900
|
+
/**
|
|
43901
|
+
* One alarm INPUT — a (rule, device) pair — the operator bypassed until the
|
|
43902
|
+
* next disarm ("Bypass this input until disarm" on a trigger notification, or
|
|
43903
|
+
* `nc.bypassAlarmInput`). Reported so an armed alarm with a silenced input
|
|
43904
|
+
* never looks fully armed (D62: off must never look like broken).
|
|
43905
|
+
*/
|
|
43906
|
+
var NcAlarmInputBypassViewSchema = object({
|
|
43907
|
+
ruleId: string(),
|
|
43908
|
+
/** The rule's current name (its frozen name when the rule is gone). */
|
|
43909
|
+
ruleName: string(),
|
|
43910
|
+
/** The input: the sensor of the match, else its camera. */
|
|
43911
|
+
deviceId: number().int(),
|
|
43912
|
+
/** The input's current name. */
|
|
43913
|
+
name: string(),
|
|
43914
|
+
/** When it was bypassed (ms epoch). */
|
|
43915
|
+
since: number(),
|
|
43916
|
+
/** Triggers from this input dropped since. */
|
|
43917
|
+
dropped: number().int().min(0)
|
|
43918
|
+
});
|
|
43709
43919
|
var NcAlarmLiveSchema = object({
|
|
43710
43920
|
state: AlarmStateSchema,
|
|
43711
43921
|
/** The mode being armed into (exit delay) or held; null when disarmed. */
|
|
43712
43922
|
targetMode: AlarmArmModeSchema.nullable(),
|
|
43713
43923
|
availableModes: array(AlarmArmModeSchema),
|
|
43714
43924
|
openings: array(NcAlarmModeOpeningsSchema),
|
|
43715
|
-
exclusions: array(NcAlarmExclusionViewSchema)
|
|
43925
|
+
exclusions: array(NcAlarmExclusionViewSchema),
|
|
43926
|
+
/**
|
|
43927
|
+
* Inputs bypassed for the rest of this arm session; cleared on disarm.
|
|
43928
|
+
* Defaulted so an older hub answer still parses (as "none known").
|
|
43929
|
+
*/
|
|
43930
|
+
bypassedInputs: array(NcAlarmInputBypassViewSchema).default([])
|
|
43716
43931
|
});
|
|
43717
43932
|
var NcAlarmConfigSchema = object({
|
|
43718
43933
|
/**
|
|
@@ -57609,9 +57824,24 @@ var NpuInfoSchema = object({
|
|
|
57609
57824
|
name: string().optional(),
|
|
57610
57825
|
generation: _enum(["xdna1", "xdna2"]).optional()
|
|
57611
57826
|
});
|
|
57827
|
+
var CoralBusSchema = _enum(["usb", "pci"]);
|
|
57612
57828
|
var CoralInfoSchema = object({
|
|
57613
57829
|
type: literal("coral-edgetpu"),
|
|
57614
|
-
bus
|
|
57830
|
+
/** Legacy single-bus report (older nodes) — read via `coralUsableUnits`. */
|
|
57831
|
+
bus: string().optional(),
|
|
57832
|
+
/** Legacy USB unit count (older nodes) — read via `coralUsableUnits`. */
|
|
57833
|
+
count: number().int().nonnegative().optional(),
|
|
57834
|
+
/** Usable units per bus — each one is its own `edgetpu:<bus>[:N]` device. */
|
|
57835
|
+
units: array(object({
|
|
57836
|
+
bus: CoralBusSchema,
|
|
57837
|
+
count: number().int().nonnegative()
|
|
57838
|
+
})).readonly().optional(),
|
|
57839
|
+
/** Present-but-unusable units, each with its typed reason (never "absent"). */
|
|
57840
|
+
unavailable: array(object({
|
|
57841
|
+
bus: CoralBusSchema,
|
|
57842
|
+
count: number().int().nonnegative(),
|
|
57843
|
+
reason: _enum(["driver-missing", "device-not-accessible"])
|
|
57844
|
+
})).readonly().optional()
|
|
57615
57845
|
});
|
|
57616
57846
|
var HardwareInfoSchema = object({
|
|
57617
57847
|
platform: HardwarePlatformSchema,
|
|
@@ -65351,7 +65581,19 @@ Object.freeze({
|
|
|
65351
65581
|
addonId: null,
|
|
65352
65582
|
access: "view"
|
|
65353
65583
|
},
|
|
65354
|
-
"logDestination.
|
|
65584
|
+
"logDestination.cancelRead": {
|
|
65585
|
+
capName: "log-destination",
|
|
65586
|
+
capScope: "system",
|
|
65587
|
+
addonId: null,
|
|
65588
|
+
access: "create"
|
|
65589
|
+
},
|
|
65590
|
+
"logDestination.describeRead": {
|
|
65591
|
+
capName: "log-destination",
|
|
65592
|
+
capScope: "system",
|
|
65593
|
+
addonId: null,
|
|
65594
|
+
access: "view"
|
|
65595
|
+
},
|
|
65596
|
+
"logDestination.read": {
|
|
65355
65597
|
capName: "log-destination",
|
|
65356
65598
|
capScope: "system",
|
|
65357
65599
|
addonId: null,
|
|
@@ -71358,6 +71600,11 @@ Object.freeze({
|
|
|
71358
71600
|
form: "single",
|
|
71359
71601
|
optional: false
|
|
71360
71602
|
}],
|
|
71603
|
+
"logDestination.read": [{
|
|
71604
|
+
name: "deviceId",
|
|
71605
|
+
form: "single",
|
|
71606
|
+
optional: true
|
|
71607
|
+
}],
|
|
71361
71608
|
"mediaPlayer.getStatus": [{
|
|
71362
71609
|
name: "deviceId",
|
|
71363
71610
|
form: "single",
|
|
@@ -74180,7 +74427,7 @@ var AdminUIAddon = class extends BaseAddon {
|
|
|
74180
74427
|
capability: adminUiCapability,
|
|
74181
74428
|
provider: {
|
|
74182
74429
|
getStaticDir: async () => ({ staticDir: resolveAdminUiDistDir() }),
|
|
74183
|
-
getVersion: async () => ({ version: "1.2.
|
|
74430
|
+
getVersion: async () => ({ version: "1.2.444" })
|
|
74184
74431
|
}
|
|
74185
74432
|
}];
|
|
74186
74433
|
}
|
package/package.json
CHANGED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{$ as e,B as t,G as n,J as r,L as i,S as a,b as o,o as s,q as c,x as l,z as u}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CEHpkaJP.js";import{It as d,Nt as f,Ot as p,Q as m,Rn as h,Si as g,Tn as _,Wr as v,ai as y,bn as b,dt as x,fn as S,kn as C,or as w,pi as ee,pn as te,tn as T,un as E,vi as ne,xi as re}from"./player-overlays-CpALjVtS.js";import{ji as D}from"./client-CqoBi3ym.js";import{i as ie,l as ae}from"./video-DSVienqW.js";import{$n as O,An as oe,Ar as se,Br as k,Dr as A,Dt as ce,Er as le,Fr as j,G as M,Gr as ue,Ir as N,Mn as de,Mr as P,Nn as F,Nr as fe,On as I,Or as L,Ot as pe,Pn as me,Pr as he,Rr as ge,Sr as R,Tr as z,Un as _e,Ur as ve,Vr as B,Wr as V,_u as H,bu as U,cr as W,er as ye,kn as be,kr as xe,ns as G,nu as Se,tt as Ce,wr as K,zr as q}from"./src-CsHgYIi2.js";import{t as J}from"./useTranslation-D3Is_4B6.js";import"./mount-2g0u_pQE.js";import{Z as Y,et as X,nt as we}from"./index-WxoBkjSL.js";import{t as Z}from"./AdminPage-C_5SnDIL.js";import{t as Te}from"./NodeAddonsSettingsPanel-CRyxRlRb.js";import{n as Q,t as Ee}from"./useNodeUrlSelection-itsA69-a.js";function De(e){if(e===void 0)return null;switch(e.state){case`failed`:case`refused`:case`missing`:case`crashed`:return{kind:e.state,...e.reason===void 0?{}:{reason:e.reason}};default:return null}}e();var Oe={queued:{icon:y,bg:`bg-muted text-foreground-subtle`,labelKey:`addons.addonRowBadge.queued`},updating:{icon:w,bg:`bg-primary/10 text-primary`,labelKey:`addons.addonRowBadge.updating`,spin:!0},"done-pending-restart":{icon:b,bg:`bg-amber-500/10 text-amber-700`,labelKey:`addons.addonRowBadge.pendingRestart`},done:{icon:g,bg:`bg-success/10 text-success`,labelKey:`addons.addonRowBadge.done`},failed:{icon:ie,bg:`bg-danger/10 text-danger`,labelKey:`addons.addonRowBadge.failed`}};function ke({item:e}){let{t}=J(),n=Oe[e.status],r=n.icon;return a(`span`,{className:`inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] rounded ${n.bg}`,title:e.error,children:[l(r,{className:`w-2.5 h-2.5 ${n.spin?`animate-spin`:``}`}),t(n.labelKey)]})}var Ae=new Set([`completed`,`failed`,`partially-failed`,`cancelled`]),je=new Set([`done`,`failed`,`skipped`]);function Me(e){return!je.has(e.phase)&&!Ae.has(e.jobState)}function Ne(e,t){let n=new Map,r=[...e].sort((e,t)=>e.createdAtMs-t.createdAtMs);for(let e of r){let r=Ae.has(e.state);for(let i of e.tasks)r&&i.finishedAtMs!==null&&t-i.finishedAtMs>6e4||n.set(i.packageName,{jobId:e.jobId,packageName:i.packageName,phase:i.phase,fromVersion:i.fromVersion,toVersion:i.toVersion,error:i.error,jobState:e.state,finishedAtMs:i.finishedAtMs})}return n}function Pe(){let{data:e}=fe({activeOnly:!0},{refetchOnWindowFocus:!1,refetchInterval:e=>(e.state.data?.length??0)>0?3e3:!1}),{map:t}=U(D.AddonsJobProgress,e=>e.job.jobId);return n(()=>{let n=new Map;for(let t of e??[])n.set(t.jobId,t);for(let[e,r]of t)n.set(e,r.job);return Ne([...n.values()],Date.now())},[e,t])}var Fe={queued:{icon:y,cls:`bg-muted text-foreground-subtle`,labelKey:`addons.jobProgress.queued`},fetching:{icon:w,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.fetching`,spin:!0},staged:{icon:w,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.staged`,spin:!0},validating:{icon:w,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.validating`,spin:!0},applying:{icon:w,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.applying`,spin:!0},restarting:{icon:w,cls:`bg-amber-500/10 text-amber-600 dark:text-amber-400`,labelKey:`addons.jobProgress.restarting`,spin:!0},applied:{icon:w,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:ie,cls:`bg-danger/10 text-danger`,labelKey:`addons.jobProgress.failed`},skipped:{icon:T,cls:`bg-muted text-foreground-subtle`,labelKey:`addons.jobProgress.skipped`}};function Ie({progress:e}){let{t}=J(),n=Fe[e.phase],r=n.icon,i=e.error??`${e.packageName}: ${e.fromVersion??`?`} → ${e.toVersion}`;return a(`span`,{"data-testid":`addon-job-progress`,className:`inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] rounded shrink-0 ${n.cls}`,title:i,children:[l(r,{className:`w-2.5 h-2.5 ${n.spin?`animate-spin`:``}`}),t(n.labelKey),a(`span`,{className:`font-mono`,children:[`→ `,e.toVersion]})]})}function Le(e,t){return e.filter(e=>e.packageName===t).slice().sort((e,t)=>e.isHub===t.isHub?e.nodeName.localeCompare(t.nodeName):e.isHub?-1:1)}function Re(e){let t=e.version===null?``:` ${e.version}`,n=e.isOnline?``:` (offline: removed when it reconnects)`;return`- ${e.nodeName}${t}${n}`}function ze(e,t,n){let r=[`${e} will be uninstalled from ${t.length} node(s). Its runners stop, its capabilities are deregistered and its code is deleted:`,...t.map(Re)];return n.length>0&&r.push(`Could not ask: ${n.join(`, `)} — not included.`),r.push(`This cannot be undone.`),r.join(`
|
|
2
|
-
`)}function Be(e,t,n){let r=[`${e} will be uninstalled from ${t}: its runners stop and its code is deleted.`];return n.length>0&&r.push(`It stays installed on: ${n.map(e=>e.nodeName).join(`, `)}. Use "Everywhere" to remove it from every node.`),r.push(`This cannot be undone.`),r.join(`
|
|
3
|
-
`)}var Ve={uninstalled:`uninstalled`,"not-installed":`was not installed`,refused:`REFUSED`,failed:`FAILED`,"pending-reconnect":`offline — removed when it reconnects`};function He(e,t){let n=[];for(let r of e.results){let e=r.runnersStopped.length>0?` (stopped ${r.runnersStopped.join(`, `)})`:``;n.push(`${t(r.nodeId)}: ${Ve[r.outcome]}${e}`),r.error!==void 0&&n.push(` ${r.error}`);for(let e of r.warnings)n.push(` ${e}`)}return n.join(`
|
|
4
|
-
`)}var Ue={},We=3e4,Ge=`inline-flex items-center gap-1 rounded-md px-2 py-1 text-[10px] font-medium border border-border text-foreground-subtle hover:text-red-400 hover:border-red-500/30 hover:bg-red-500/10 disabled:opacity-50 transition-colors`;function Ke({packageName:e,displayName:t,selectedNode:n,hideNodeAction:r,disabled:i}){let{t:o}=J(),c=s(),u=ye(),f=O(),p=P(Ue,{staleTime:We}),m=p.data?.installations??[],h=(p.data?.unreachable??[]).map(e=>e.nodeId),g=Le(m,e),_=e=>g.find(t=>t.nodeId===e)?.nodeName??(e===n.id?n.name:e),v=V({onSettled:()=>{c.invalidateQueries({queryKey:[[`addons`]]}),c.invalidateQueries({queryKey:[[`addonPages`]]}),c.invalidateQueries({queryKey:[[`capabilities`]]}),c.invalidateQueries({queryKey:[[`nodes`]]})}}),y=async e=>{await f({title:e.success?o(`addons.addonUninstallControls.uninstalled`,`{{displayName}} uninstalled`,{displayName:t}):o(`addons.addonUninstallControls.notEveryNodeWasCleaned`,`{{displayName}}: not every node was cleaned`,{displayName:t}),message:He(e,_),variant:e.success?`default`:`danger`})},b=async n=>{try{await y(await v.mutateAsync({packageName:e,...n}))}catch(e){await f({title:o(`addons.addonUninstallControls.uninstallFailed`,`Uninstall {{displayName}} failed`,{displayName:t}),message:e instanceof Error?e.message:String(e),variant:`danger`})}},x=async()=>{let e=g.filter(e=>e.nodeId!==n.id);await u({title:o(`addons.addonUninstallControls.uninstallFrom`,`Uninstall {{displayName}} from {{name}}?`,{displayName:t,name:n.name}),message:Be(t,n.name,e),confirmLabel:o(`addons.addonUninstallControls.uninstall`,`Uninstall`),variant:`danger`})&&await b(n.isHub?{}:{nodeId:n.id})},S=async()=>{let n=(await p.refetch()).data;if(n===void 0){await f({title:o(`addons.addonUninstallControls.cannotListTheNodes`,`Cannot list the nodes`),message:o(`addons.addonUninstallControls.theHubDidNotAnswer`,`The hub did not answer which nodes have this package — nothing was removed.`),variant:`danger`});return}let r=Le(n.installations,e);await u({title:o(`addons.addonUninstallControls.uninstallEverywhere`,`Uninstall {{displayName}} everywhere?`,{displayName:t}),message:ze(t,r,n.unreachable.map(e=>e.nodeId)),confirmLabel:o(`addons.addonUninstallControls.uninstallFromNodeS`,`Uninstall from {{length}} node(s)`,{length:r.length}),variant:`danger`})&&await b({everywhere:!0})},C=v.isPending||i===!0;return a(`div`,{className:`flex items-center gap-1.5`,children:[r!==!0&&a(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),x()},disabled:C,className:Ge,title:o(`addons.addonUninstallControls.uninstallFrom2`,`Uninstall from {{name}}`,{name:n.name}),children:[l(d,{className:`h-3 w-3`}),v.isPending?o(`addons.addonUninstallControls.removing`,`Removing...`):o(`addons.addonUninstallControls.uninstall`,`Uninstall`)]}),(g.length>1||r===!0||h.length>0)&&a(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),S()},disabled:C,className:Ge,title:o(`addons.addonUninstallControls.uninstallFromEveryNodeThat`,`Uninstall from every node that has it`),children:[l(ae,{className:`h-3 w-3`}),g.length>0?o(`addons.uninstallControls.everywhereCount`,{count:g.length}):o(`addons.uninstallControls.everywhere`)]})]})}function qe({packageName:e,currentVersion:t,installSource:n,onInstall:r,onClose:i,onSelect:s,selectedVersion:c}){let{t:u}=J(),d=n===`upload`||n===`local`,{data:f,isLoading:m}=L({name:e});return a(`div`,{className:`fixed z-50 w-72 rounded-lg border border-border bg-surface shadow-xl overflow-hidden`,style:{top:`auto`,bottom:`auto`},ref:e=>{if(!e)return;let t=e.parentElement?.getBoundingClientRect();if(!t)return;let n=window.innerHeight-t.bottom,r=t.top;n<280&&r>n?(e.style.bottom=`${window.innerHeight-t.top+4}px`,e.style.top=`auto`):(e.style.top=`${t.bottom+4}px`,e.style.bottom=`auto`),e.style.right=`${window.innerWidth-t.right}px`},onClick:e=>e.stopPropagation(),children:[a(`div`,{className:`flex items-center justify-between px-3 py-2 border-b border-border`,children:[l(`span`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle font-medium`,children:u(`addons.versionPicker.versions`,`Versions`)}),l(`button`,{type:`button`,onClick:i,className:`text-foreground-subtle hover:text-foreground`,children:l(x,{className:`h-3 w-3`})})]}),d&&a(`div`,{className:`flex items-start gap-2 px-3 py-2 border-b border-border bg-cyan-500/10 text-[10px]`,children:[l(p,{className:`h-3 w-3 mt-0.5 text-cyan-500 shrink-0`}),a(`div`,{className:`text-cyan-700 dark:text-cyan-200`,children:[l(`span`,{className:`font-semibold`,children:u(`addons.versionPicker.inPlace`,{kind:n===`upload`?u(`addons.versionPicker.uploadedCopy`,`Uploaded copy`):u(`addons.versionPicker.localCopy`,`Local copy`)})}),` `,l(Y,{i18nKey:`addons.versionPicker.reinstall`,values:{version:t},components:{mono:l(`span`,{className:`font-mono`})}})]})]}),m&&a(`div`,{className:`flex items-center justify-center gap-2 py-6 text-[10px] text-foreground-subtle`,children:[l(w,{className:`h-3.5 w-3.5 animate-spin`}),u(`addons.versionPicker.loadingVersions`,`Loading versions...`)]}),f&&l(`div`,{className:`max-h-64 overflow-auto divide-y divide-border`,children:f.map(e=>{let n=e.version===t,i=s!==void 0&&e.version===c,d=/-(alpha|beta|rc|dev|canary|next)/i.test(e.version),f=a(o,{children:[l(`span`,{className:`font-mono flex-1 text-left ${n?`text-primary font-semibold`:d?`text-amber-400`:`text-foreground`}`,children:e.version}),n&&l(`span`,{className:`text-[9px] rounded-full px-1.5 py-0.5 font-medium bg-primary/10 text-primary`,children:u(`common.current`)}),e.distTags.map(e=>l(`span`,{className:`text-[9px] rounded-full px-1.5 py-0.5 font-medium ${e===`latest`?`bg-emerald-500/15 text-emerald-400`:e===`beta`?`bg-amber-500/15 text-amber-400`:`bg-gray-500/15 text-gray-400`}`,children:e},e)),e.deprecated&&l(`span`,{className:`text-[9px] text-red-400 line-through`,children:u(`common.deprecated`)}),l(`span`,{className:`text-[9px] text-foreground-subtle shrink-0`,children:new Date(e.publishedAt).toLocaleDateString()})]});return s?a(`button`,{type:`button`,"aria-label":u(`addons.versionPicker.select`,`Select {{version}}`,{version:e.version}),onClick:()=>s(e.version),className:`w-full flex items-center gap-2 px-3 py-2 text-[11px] ${i?`bg-primary/5`:`hover:bg-surface-hover`} transition-colors`,children:[f,i?l(g,{className:`h-3 w-3 text-primary shrink-0`}):l(`span`,{className:`w-3 shrink-0`})]},e.version):a(`div`,{className:`flex items-center gap-2 px-3 py-2 text-[11px] ${n?`bg-primary/5`:`hover:bg-surface-hover`} transition-colors`,children:[f,l(`button`,{type:`button`,onClick:()=>r(e.version),className:`shrink-0 rounded p-0.5 hover:bg-primary/20 text-foreground-subtle hover:text-primary transition-colors`,title:n?u(`addons.versionPicker.reInstallFromNpm`,`Re-install {{version}} from npm`,{version:e.version}):u(`addons.versionPicker.install`,`Install {{version}}`,{version:e.version}),children:l(v,{className:`h-3 w-3`})})]},e.version)})}),f&&f.length===0&&l(`div`,{className:`py-4 text-center text-[10px] text-foreground-subtle`,children:u(`addons.versionPicker.noVersionsFound`,`No versions found`)})]})}e();var Je=`device-export`;function Ye(e){return e.capabilities.some(e=>(typeof e==`string`?e:e.name)===Je)}function Xe(e){return e!==`local`&&e!==`upload`}function Ze({isBundle:e,installSource:t,addonId:n,iconPath:i,color:o}){let[s,c]=r(!1),u=o?{backgroundColor:`${o.startsWith(`#`)?o:`#${o}`}26`}:void 0,d=e?`bg-indigo-500/20 text-indigo-700 dark:text-indigo-300`:`bg-purple-500/20 text-purple-700 dark:text-purple-300`,f=n&&i?m(`/api/addon-assets/${n}/${i}`):null,g=!!f&&!s;return a(`div`,{className:`relative flex-shrink-0`,children:[l(`div`,{className:`h-8 w-8 rounded-md flex items-center justify-center ${u?``:d}`,style:u,children:g?l(`img`,{src:f,alt:n,className:`h-4 w-4`,onError:()=>c(!0)}):l(e?h:_,{className:`h-3.5 w-3.5`})}),t===`local`&&l(`span`,{className:`absolute -top-1.5 -left-1.5 text-[7px] font-bold leading-none bg-orange-500 text-white px-1 py-0.5 rounded -rotate-12 shadow-sm`,children:`DEV`}),Xe(t)&&l(`span`,{className:`absolute -top-1 -left-1 w-4 h-4 rounded bg-[#cb3837] flex items-center justify-center -rotate-12 shadow-sm`,children:l(`svg`,{viewBox:`0 0 780 250`,className:`w-[11px] h-[11px]`,children:l(`path`,{fill:`#fff`,d:`M240 250h100V50h100v200h340V0H0v250z`})})}),t===`upload`&&l(`span`,{className:`absolute -top-1.5 -left-1.5 flex items-center justify-center h-4 w-4 rounded bg-cyan-500 -rotate-12 shadow-sm`,children:l(p,{className:`h-2.5 w-2.5 text-white`})})]})}function Qe({version:e,availableUpdate:t,selectedVersion:n,isUpdating:r,installSource:i,disabled:o,onUpdate:s,onOpenPicker:c,children:u}){let{t:d}=J();if(r)return a(`span`,{className:`inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[10px] font-medium border border-blue-500/30 bg-blue-500/10 text-blue-400 shrink-0`,children:[l(w,{className:`h-3 w-3 animate-spin`}),d(`addons.addonCard.updating`,`Updating…`)]});if(t){let r=n??t;return a(`div`,{className:`relative inline-flex items-center gap-1 shrink-0`,children:[s&&a(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),s()},disabled:o,className:`inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[10px] font-semibold border border-blue-500/30 bg-blue-500/10 text-blue-400 hover:bg-blue-500/20 disabled:opacity-50 disabled:cursor-not-allowed transition-colors`,title:d(`addons.addonCard.updateTo`,`Update to {{target}}`,{target:r}),children:[l(v,{className:`h-3 w-3`}),d(`addons.addonCard.update`,`Update`)]}),a(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),c()},disabled:o,"aria-label":d(`addons.addonCard.selectVersionToInstall`,`Select version to install`),title:d(`addons.addonCard.installedUpdateAvailableSelectedTap`,`Installed {{version}} — update available. Selected {{target}}; tap to choose another version.`,{version:e,target:r}),className:`inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[10px] font-bold font-mono border border-amber-500/40 bg-amber-500/15 text-amber-500 hover:bg-amber-500/25 animate-pulse disabled:opacity-50 disabled:cursor-not-allowed transition-colors`,children:[l(`span`,{className:`font-normal opacity-70`,children:e}),l(`span`,{className:`font-normal opacity-70`,children:`→`}),r,l(re,{className:`h-3 w-3`})]}),u]})}return a(`div`,{className:`relative inline-flex items-center gap-1 shrink-0`,children:[a(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),c()},disabled:o,className:[`inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[10px] font-bold font-mono border transition-colors disabled:opacity-50 disabled:cursor-not-allowed`,i===`local`?`border-orange-500/30 bg-orange-500/10 text-orange-400 hover:bg-orange-500/20`:`border-emerald-500/30 bg-emerald-500/10 text-emerald-400 hover:bg-emerald-500/20`].join(` `),title:d(`addons.addonCard.versionTapToViewAll`,`Version {{version}} — tap to view all versions`,{version:e}),children:[e,l(re,{className:`h-3 w-3 opacity-50`})]}),u]})}function $e({addonId:e}){let t=s(),{data:n=`inherit`}=z({addonId:e}),r=k({onSuccess:()=>{t.invalidateQueries({queryKey:[[`addons`,`getAddonAutoUpdate`]]})}});return l(`div`,{className:`flex rounded-lg border border-border overflow-hidden text-[10px] font-medium`,children:[`inherit`,`off`,`latest`,`beta`].map(t=>l(`button`,{type:`button`,onClick:n=>{n.stopPropagation(),r.mutate({addonId:e,channel:t})},disabled:r.isPending,className:`px-2.5 py-1 transition-colors capitalize ${n===t?t===`inherit`?`bg-gray-700/50 text-gray-700 dark:text-gray-300`:t===`off`?`bg-gray-700 text-gray-700 dark:text-gray-300`:t===`latest`?`bg-blue-500/20 text-blue-400`:`bg-amber-500/20 text-amber-400`:`bg-transparent text-foreground-subtle hover:bg-surface-hover`} ${t===`inherit`?``:`border-l border-border`}`,children:t},t))})}var et={id:`hub`,name:`Hub`,isHub:!0};function tt({addon:e,agents:n=[],clusterStatus:i,hideVersion:c,availableUpdate:u,onUpdate:d,isUpdating:f,jobProgress:p,bundle:m,bulkItem:g,disabledByBulk:_,isSystem:v,selectedNode:y}){let{t:S}=J(),[w,ee]=r(!1),[T,D]=r(!1),[ae,O]=r(!1),[se,k]=r(null);t(()=>{k(null)},[u]);let A=se??u,[le,j]=r(!1),[M,ue]=r(!1),[P,fe]=r(`logs`),L=s(),he=X(),{manifest:R}=e,z=e.installedOn??[],ve=!m&&!R.protected&&R.removable!==!1,B=!!m,V=m?.displayName??R.name,H=m?.packageName??R.packageName,U=m?.version??R.packageVersion??R.version,W=m?.installSource??e.installSource,ye=m?m.bundle?.description??m.addons[0]?.manifest.description:R.description,G=N({onSuccess:()=>{L.invalidateQueries({queryKey:[[`addons`]]})}}),Se=xe({onSuccess:()=>{L.invalidateQueries({queryKey:[[`addons`]]}),L.invalidateQueries({queryKey:[[`addonPages`]]}),L.invalidateQueries({queryKey:[[`capabilities`]]}),L.invalidateQueries({queryKey:[[`integrations`]]})}}),K=ge({onSuccess:()=>{L.invalidateQueries({queryKey:[[`addons`]]}),L.invalidateQueries({queryKey:[[`alerts`]]})}}),q=e.health,Y=q?.phase===`failed`&&!q.inGracePeriod,we=Y&&q?.nextRetryAt&&!q.retrying,Z=De(e.process);return a(`div`,{className:`rounded-md border bg-surface overflow-hidden ${Y?`border-red-500/50`:`border-border`}`,children:[Y&&q&&a(`div`,{className:`bg-danger/10 border-b border-danger/30 px-3 py-2 flex items-start gap-2`,children:[l(ie,{className:`h-4 w-4 text-danger shrink-0 mt-0.5`}),a(`div`,{className:`flex-1 min-w-0`,children:[l(`div`,{className:`text-xs font-semibold text-danger`,children:S(`addons.addonCard.failedToLoad`,{attempt:q.retryCount})}),l(`div`,{className:`text-[11px] text-foreground mt-0.5 break-words font-mono`,children:q.lastError?.message??S(`addons.addonCard.unknownError`,`Unknown error`)}),we&&q.nextRetryAt&&l(`div`,{className:`text-[10px] text-foreground-subtle mt-1`,children:S(`addons.addonCard.autoRetryAt`,{time:new Date(q.nextRetryAt).toLocaleTimeString()})})]}),a(`button`,{type:`button`,disabled:K.isPending||q.retrying,onClick:e=>{e.stopPropagation(),K.mutate({packageName:H})},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:S(`addons.addonCard.resetRetryCounterAndForce`,`Reset retry counter and force immediate reload`),children:[l(b,{className:`h-3 w-3 ${K.isPending||q.retrying?`animate-spin`:``}`}),S(`addons.addonCard.retryNow`,`Retry now`)]})]}),Z!==null&&a(`div`,{className:`bg-danger/10 border-b border-danger/30 px-3 py-2 flex items-start gap-2`,children:[l(ie,{className:`h-4 w-4 text-danger shrink-0 mt-0.5`}),a(`div`,{className:`flex-1 min-w-0`,children:[l(`div`,{className:`text-xs font-semibold text-danger`,children:S(`addons.addonCard.processProblem.${Z.kind}`)}),Z.reason!==void 0&&l(`div`,{className:`text-[11px] text-foreground mt-0.5 break-words font-mono`,children:Z.reason})]})]}),a(`div`,{className:`flex items-start gap-2.5 px-3 py-2`,children:[l(Ze,{isBundle:B||!!R.components&&R.components.length>1,installSource:W,addonId:B?m.addons[0]?.manifest.id:R.id,iconPath:B?m.bundle?.icon??m.addons[0]?.manifest.icon:R.icon,color:B?m.addons[0]?.manifest.color:R.color}),a(`div`,{className:`flex-1 min-w-0`,children:[a(`div`,{className:`flex items-start justify-between gap-2`,children:[l(`span`,{className:`text-xs font-semibold text-foreground truncate min-w-0`,children:V}),!c&&l(Qe,{version:U,availableUpdate:u,...A===void 0?{}:{selectedVersion:A},isUpdating:f,installSource:W,disabled:_,...d&&A!==void 0?{onUpdate:()=>d(A)}:{},onOpenPicker:()=>O(e=>!e),children:ae&&l(qe,{packageName:H,currentVersion:U,...W?{installSource:W}:{},...u!==void 0&&A!==void 0?{selectedVersion:A,onSelect:e=>{k(e),O(!1)}}:{},onInstall:e=>{O(!1),Se.mutate({packageName:H,version:e})},onClose:()=>O(!1)})})]}),a(`div`,{className:`flex flex-wrap items-center gap-x-1.5 gap-y-1 mt-0.5`,children:[H!==V&&l(`span`,{className:`text-[10px] text-foreground-subtle font-mono truncate max-w-full`,children:H}),B&&a(`span`,{className:`text-[10px] rounded-full bg-primary/10 text-primary px-2 py-0.5 font-medium shrink-0 inline-flex items-center gap-1`,children:[l(h,{className:`h-3 w-3`}),m.addons.length]}),v&&a(`span`,{className:`text-[10px] rounded-full bg-amber-500/15 text-amber-700 dark:text-amber-300 px-2 py-0.5 font-medium shrink-0 inline-flex items-center gap-1`,title:S(`addons.addonCard.systemPackageUpdatingRestartsThe`,`System package — updating restarts the hub`),children:[l(b,{className:`h-3 w-3`}),S(`addons.addonCard.system`,`System`)]}),g!=null&&l(ke,{item:g}),p!=null&&l(Ie,{progress:p})]}),ye&&l(`p`,{className:`text-[10px] text-foreground-subtle mt-1 line-clamp-1`,children:ye}),!B&&e.process&&a(`div`,{className:`flex flex-wrap items-center gap-1.5 mt-1`,children:[l(`span`,{className:`text-[9px] rounded-full px-1.5 py-0.5 font-medium ${e.process.mode===`forked`?`bg-blue-500/15 text-blue-400`:`bg-gray-500/15 text-gray-400`}`,children:e.process.mode===`forked`?S(`addons.addonCard.forked`):S(`addons.addonCard.inProcess`)}),e.process.pid!=null&&a(`span`,{className:`text-[9px] font-mono text-foreground-subtle`,children:[`PID `,e.process.pid]}),l(`span`,{className:`text-[9px] rounded-full px-1.5 py-0.5 font-medium ${e.process.state===`running`?`bg-emerald-500/15 text-emerald-400`:Z===null?`bg-gray-500/15 text-gray-400`:`bg-red-500/15 text-red-400`}`,children:e.process.state})]})]})]}),!B&&a(`div`,{className:`flex items-center gap-1 px-3 py-1 border-t border-border/50 bg-surface-hover/20`,children:[a(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),G.mutate({addonId:R.id})},disabled:G.isPending||_,className:`inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[10px] font-medium border border-border text-foreground-subtle hover:text-blue-400 hover:border-blue-500/30 hover:bg-blue-500/10 disabled:opacity-50 transition-colors`,children:[l(b,{className:`h-3 w-3 ${G.isPending?`animate-spin`:``}`}),S(`addons.addonCard.restart`,`Restart`)]}),a(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),j(e=>!e)},className:`inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[10px] font-medium border transition-colors ${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:[l(te,{className:`h-3 w-3`}),S(`addons.addonCard.logs`,`Logs`)]}),!B&&a(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),ue(!0)},className:`inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[10px] font-medium border transition-colors ${M?`border-primary/30 bg-primary/10 text-primary`:`border-border text-foreground-subtle hover:text-foreground hover:border-primary/30 hover:bg-primary/10`}`,children:[l(E,{className:`h-3 w-3`}),S(`addons.addonCard.settings`,`Settings`)]}),l(`div`,{className:`flex-1`}),ve&&l(Ke,{packageName:R.packageName,displayName:R.name,selectedNode:y??et,disabled:_})]}),i&&i.nodes.length>1&&!B&&a(`div`,{className:`border-t border-border px-3 py-1.5 bg-muted/10`,children:[l(`div`,{className:`text-[10px] font-medium text-foreground-subtle mb-1.5`,children:S(`addons.addonCard.clusterDeployment`,`Cluster Deployment`)}),l(`div`,{className:`space-y-1`,children:i.nodes.map(e=>a(`div`,{className:`flex items-center gap-2 text-[10px]`,children:[l(`div`,{className:`h-1.5 w-1.5 rounded-full shrink-0 ${e.status===`offline`?`bg-muted-foreground/30`:e.synced?`bg-success`:`bg-amber-500`}`}),l(`span`,{className:`font-medium text-foreground min-w-[60px]`,children:e.name}),l(`span`,{className:`font-mono text-foreground-subtle`,children:e.version}),!e.synced&&e.status!==`offline`&&l(`span`,{className:`text-[9px] px-1 py-0.5 rounded bg-amber-500/10 text-amber-400 border border-amber-500/20`,children:S(`addons.addonCard.outdated`)}),e.status===`offline`&&l(`span`,{className:`text-[9px] px-1 py-0.5 rounded bg-muted text-muted-foreground`,children:S(`common.offline`)}),e.synced&&e.status!==`offline`&&l(`span`,{className:`text-[9px] text-success`,children:S(`common.synced`)})]},e.nodeId))})]}),le&&!B&&a(`div`,{className:`border-t border-border`,children:[a(`div`,{className:`flex items-center px-3 py-0.5 bg-surface-hover/20 border-b border-border/50`,children:[a(`div`,{className:`flex rounded border border-border overflow-hidden text-[9px]`,children:[l(`button`,{type:`button`,onClick:()=>fe(`logs`),className:`px-2 py-0.5 transition-colors ${P===`logs`?`bg-primary/10 text-primary`:`text-foreground-subtle hover:bg-surface-hover`}`,children:S(`addons.addonCard.logs`,`Logs`)}),l(`button`,{type:`button`,onClick:()=>fe(`events`),className:`px-2 py-0.5 border-l border-border transition-colors ${P===`events`?`bg-primary/10 text-primary`:`text-foreground-subtle hover:bg-surface-hover`}`,children:S(`addons.addonCard.events`,`Events`)})]}),l(`div`,{className:`flex-1`}),l(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),j(!1)},className:`text-foreground-subtle hover:text-foreground`,children:l(x,{className:`h-3.5 w-3.5`})})]}),P===`logs`&&l(pe,{addonId:R.id,maxHeight:`max-h-64`,showFilters:!1}),P===`events`&&l(ce,{addonId:R.id,category:`addon.*`,maxHeight:`max-h-64`})]}),B&&a(o,{children:[l(`button`,{type:`button`,onClick:()=>ee(e=>!e),className:`w-full flex items-center justify-center border-t border-border py-1 hover:bg-surface-hover/50 transition-colors`,children:l(w?ne:re,{className:`h-3.5 w-3.5 text-foreground-subtle`})}),w&&l(`div`,{className:`border-t border-border px-2.5 py-1.5 space-y-1.5`,children:m.addons.map(e=>l(tt,{addon:e,agents:n,hideVersion:!0},e.manifest.id))})]}),M&&!B&&l(I,{open:!0,onOpenChange:e=>!e&&ue(!1),children:a(oe,{width:`lg`,placement:`sheet-on-mobile`,scroll:`body`,children:[l(F,{children:a(me,{className:`flex items-center gap-2`,children:[l(E,{className:`h-4 w-4 text-primary`}),S(`addons.addonCard.settingsTitle`,{name:V})]})}),a(be,{className:`space-y-4`,children:[l(`div`,{className:`text-[10px] text-foreground-subtle mb-2`,children:S(`addons.addonCard.clusterWideSettingsOneValue`,`Cluster-wide settings — one value for every node. Per-node settings live under Cluster → the node → Settings.`)}),l(Te,{nodeId:null,addonIds:[R.id],level:`global`,fieldScope:`cluster`,emptyMessage:S(`addons.addonCard.thisAddonExposesNoCluster`,`This addon exposes no cluster-wide settings. Anything it can configure is per-node — open it from Cluster → the node → Settings.`)}),Ye(R)&&a(`div`,{children:[l(`div`,{className:`text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2`,children:S(`addons.addonCard.deviceExport`,`Device export`)}),l(Ce,{addonId:R.id,onOpenDevice:e=>he(`/devices/${e}`)})]}),Xe(W)&&a(`div`,{children:[l(`div`,{className:`text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2`,children:S(`addons.addonCard.autoUpdate`,`Auto-Update`)}),l($e,{addonId:R.id})]}),R.components&&R.components.length>0&&a(`div`,{children:[l(`div`,{className:`text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2`,children:S(`addons.addonCard.components`,{count:R.components.length})}),l(`div`,{className:`flex flex-wrap gap-1`,children:R.components.map(e=>l(`span`,{className:`text-[10px] rounded bg-background border border-border px-1.5 py-0.5 text-foreground-subtle font-mono`,children:e},e))})]}),n.length>=2&&a(`div`,{children:[l(`div`,{className:`text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2`,children:S(`addons.addonCard.installedOn`,`Installed on`)}),a(`div`,{className:`flex items-center gap-1.5 flex-wrap`,children:[z.length===0&&l(`span`,{className:`text-[10px] text-foreground-subtle`,children:S(`addons.addonCard.hubLocal`,`Hub (local)`)}),z.map(e=>l(`span`,{className:`rounded-full bg-surface-hover border border-border px-2 py-0.5 text-[10px] text-foreground-subtle`,children:e},e)),a(`div`,{className:`relative`,children:[a(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),D(e=>!e)},className:`inline-flex items-center gap-1 rounded-full border border-dashed border-border px-2 py-0.5 text-[10px] text-foreground-subtle hover:text-foreground hover:border-primary transition-colors`,title:S(`addons.addonCard.installOnMoreAgents`,`Install on more agents`),children:[l(C,{className:`h-3 w-3`}),S(`addons.addonCard.addAgent`,`Add agent`)]}),T&&a(`div`,{className:`absolute left-0 top-full mt-1 z-10 min-w-[160px] rounded-md border border-border bg-surface shadow-lg overflow-hidden`,children:[n.filter(e=>!e.isHub&&!z.includes(e.name)).map(e=>l(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),D(!1)},className:`w-full text-left px-3 py-1.5 text-[10px] text-foreground hover:bg-surface-hover transition-colors`,children:e.name},e.id)),n.filter(e=>!e.isHub&&!z.includes(e.name)).length===0&&l(`div`,{className:`px-3 py-1.5 text-[10px] text-foreground-subtle`,children:S(`addons.addonCard.noAvailableAgents`,`No available agents`)})]})]})]})]})]}),l(de,{children:l(_e,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>ue(!1),children:S(`common.close`,`Close`)})})]})})]})}e();var nt=`.tgz,.tar.gz,.zip`;function rt({onUploadSuccess:e}){let{t}=J(),[n,s]=r(!1),u=c(null),d=i(async t=>{s(!0);let n=new FormData;n.append(`file`,t);let r=localStorage.getItem(`camstack_admin_token`)??``;try{(await(await fetch(m(`/api/addons/upload`),{method:`POST`,headers:{Authorization:`Bearer ${r}`},body:n})).json()).success&&e()}finally{s(!1)}},[e]);return a(o,{children:[l(`input`,{ref:u,type:`file`,accept:nt,onChange:i(e=>{let t=e.target.files?.[0];t&&d(t),e.target.value=``},[d]),className:`hidden`}),a(`button`,{type:`button`,onClick:()=>u.current?.click(),disabled:n,className:`flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-md bg-surface hover:bg-surface-hover border border-border disabled:opacity-50 transition-colors`,children:[n?l(w,{className:`w-3.5 h-3.5 animate-spin`}):l(p,{className:`w-3.5 h-3.5`}),n?t(`addons.addonUploadZone.uploading`,`Uploading...`):t(`addons.addonUploadZone.upload`,`Upload`)]})]})}var it=new Set([`@camstack/system`,`@camstack/types`,`@camstack/sdk`,`@camstack/ui-library`,`@camstack/addon-agent-ui`]);function at(e,t){let n=new Map;for(let r of e){if(r.isHub||r.onHub||it.has(r.packageName)||!t.isHub&&r.nodeId!==t.id)continue;let e=n.get(r.packageName)??[];e.push(r),n.set(r.packageName,e)}return[...n].map(([e,t])=>({packageName:e,rows:t})).sort((e,t)=>e.packageName.localeCompare(t.packageName))}function ot({selectedNode:e}){let{t}=J(),{data:n}=P(Ue,{staleTime:We});if(n===void 0)return null;let r=at(n.installations,e),i=n.unreachable.filter(t=>e.isHub||t.nodeId===e.id);return r.length===0&&i.length===0?null:a(`div`,{className:`rounded-lg border border-warning/30 bg-warning/5 px-3 py-2.5 space-y-2`,children:[a(`div`,{className:`flex items-center gap-2 text-[11px] font-semibold text-foreground`,children:[l(f,{className:`h-3.5 w-3.5 text-warning`}),e.isHub?t(`addons.nodeOnlyPackagesPanel.installedOnAgentsButNot`,`Installed on agents but not on the hub`):t(`addons.nodeOnlyPackagesPanel.installedOnButNotOn`,`Installed on {{name}} but not on the hub`,{name:e.name})]}),i.length>0&&l(`div`,{className:`text-[10px] text-foreground-subtle`,children:t(`addons.nodeOnlyPackagesPanel.unreachable`,{nodes:i.map(e=>e.nodeId).join(`, `)})}),r.map(t=>a(`div`,{className:`flex items-center justify-between gap-3 flex-wrap rounded-md border border-border bg-surface px-3 py-2`,children:[a(`div`,{className:`min-w-0`,children:[l(`div`,{className:`text-xs font-mono text-foreground break-all`,children:t.packageName}),l(`div`,{className:`text-[10px] text-foreground-subtle`,children:t.rows.map(e=>`${e.nodeName}${e.version===null?``:` ${e.version}`}${e.isOnline?``:` (offline)`}`).join(` · `)})]}),l(Ke,{packageName:t.packageName,displayName:t.packageName,selectedNode:e,hideNodeAction:e.isHub})]},t.packageName))]})}function st({addon:e,installing:t,onInstall:n}){let{t:r}=J();return a(`div`,{className:`flex items-center gap-3 px-3 py-2 hover:bg-surface-hover transition-colors`,children:[l(`div`,{className:`w-6 h-6 rounded-md bg-primary/10 flex items-center justify-center text-primary text-[9px] font-bold shrink-0`,children:e.name.replace(`@camstack/addon-`,``).charAt(0).toUpperCase()}),a(`div`,{className:`flex-1 min-w-0`,children:[a(`div`,{className:`flex items-baseline gap-2 min-w-0`,children:[l(`span`,{className:`text-[11px] font-semibold break-words`,children:e.name.replace(/^@camstack\/(addon-)?/,``)}),a(`span`,{className:`text-[10px] text-foreground-subtle shrink-0`,children:[`v`,e.version]})]}),l(`div`,{className:`font-mono text-[9px] text-foreground-subtle/80 truncate`,children:e.name}),e.description&&l(`div`,{className:`text-[10px] text-foreground-subtle truncate`,children:e.description})]}),e.installed?l(W,{variant:`success`,icon:l(g,{className:`h-3 w-3`}),children:e.installedVersion??r(`system.capabilityCatalog.installed`,`Installed`)}):a(_e,{size:`sm`,onClick:()=>n(e.name),disabled:t,className:`shrink-0`,children:[t?l(w,{className:`h-3 w-3 animate-spin`}):l(v,{className:`h-3 w-3`}),r(`system.capabilityCatalog.install`,`Install`)]})]})}function ct({capability:e,installing:t,onInstall:n}){let{t:r}=J(),{data:i,isPending:o,isError:s}=q({capability:e}),c;if(s)c=l(`div`,{className:`px-3 py-2 text-xs text-danger`,children:r(`system.capabilityCatalog.couldNotSearchTheNpm`,`Could not search the npm catalog right now. Try again in a moment.`)});else if(o||i===void 0)c=a(`div`,{className:`flex items-center gap-2 px-3 py-2 text-xs text-foreground-subtle`,children:[l(w,{className:`h-3 w-3 animate-spin`}),r(`system.capabilityCatalog.searchingTheNpmCatalog`,`Searching the npm catalog…`)]});else{let a=i.filter(e=>!e.installed);c=a.length===0?l(`div`,{className:`px-3 py-2 text-xs text-foreground-subtle`,children:i.length===0?r(`system.capabilityCatalog.noPublishedAddonDeclaresThe`,`No published addon declares the "{{capability}}" capability.`,{capability:e}):r(`system.capabilityCatalog.everyPublishedAddonThatDeclares`,`Every published addon that declares "{{capability}}" is already installed.`,{capability:e})}):l(`div`,{className:`divide-y divide-border`,children:a.map(e=>l(st,{addon:e,installing:t,onInstall:n},e.name))})}return a(`section`,{className:`rounded-md border border-border bg-surface overflow-hidden`,"aria-label":r(`system.capabilityCatalog.availableToInstall`,`Available to install`),children:[l(`h2`,{className:`px-3 py-1.5 text-[10px] uppercase tracking-wide text-foreground-subtle border-b border-border`,children:r(`system.capabilityCatalog.availableToInstall`,`Available to install`)}),c]})}e();function lt(e){return e===`npm`||e===`dev`?e:null}var ut=`rounded-full border border-primary bg-primary/10 px-2 py-0.5 text-[10px] text-foreground`,dt=`rounded-full border border-border px-2 py-0.5 text-[10px] text-foreground-muted hover:bg-surface-hover`,ft=[{seconds:900,label:`15m`},{seconds:3600,label:`1h`},{seconds:21600,label:`6h`},{seconds:43200,label:`12h`},{seconds:86400,label:`24h`}],pt=new Set([`@camstack/system`,`@camstack/types`,`@camstack/sdk`,`@camstack/shm-ring`,`@camstack/ui-library`]);function mt(e){return e!==void 0&&pt.has(e)}var ht={id:`hub`,name:`Hub`,isHub:!0,isOnline:!0};function gt(e,t){let n=e??`hub-only`;return n===`any-node`?!0:n===`hub-only`?t:!t}function _t(e){return e===`local`?`dev`:`npm`}function vt(e){let t=e;if(!t?.manifest)return null;let n={...t.manifest,name:t.manifest.name??t.manifest.id,version:t.manifest.version??`0.0.0`,capabilities:t.manifest.capabilities??[]},r=t.process,i=r?{pid:r.pid,mode:r.mode===`forked`?`forked`:`in-process`,state:r.state??`unknown`,...r.reason===void 0?{}:{reason:r.reason}}:void 0,a=t.health,o=t.declaration?.execution,s=t.manifest.execution,c=o?.placement??s?.placement;return{manifest:n,enabled:!0,source:t.source,installSource:t.installSource,installedOn:[],...i?{process:i}:{},hasBackup:t.hasBackup,...a?{health:a}:{},...c?{placement:c}:{}}}function yt(e){let t=new Map,n=[];for(let r of e){let e=r.manifest.packageName;if(!e){n.push(r);continue}let i=t.get(e);if(i)i.addons.push(r);else{let n=r.manifest.bundle,i={packageName:e,displayName:n?.displayName??r.manifest.packageDisplayName??r.manifest.name,version:r.manifest.packageVersion,addons:[r],...r.installSource===void 0?{}:{installSource:r.installSource},...n===void 0?{}:{bundle:n}};t.set(e,i)}}let r=[];for(let e of t.values())e.bundle!==void 0||e.addons.length>=2?r.push({bundle:e,representative:e.addons[0]}):r.push(e.addons[0]);return r.push(...n),r}function $(e){return`bundle`in e}function bt({addons:e,clusterStatus:o,selectedNode:d,onRefresh:f,isRefreshing:p}){let{t:m}=J(),h=s(),[g,_]=r(``),y=u(g),[x,C]=r(!1),te=c(null);t(()=>{if(!x)return;let e=e=>{te.current&&!te.current.contains(e.target)&&C(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[x]);let{data:T}=he({nodeId:d.id}),E=n(()=>{let e=new Map;for(let t of T??[])e.set(t.name,t.latestVersion);return e},[T]),ne=n(()=>(T??[]).filter(e=>!e.isSystem).length,[T]),[re,D]=r(()=>new Set),[ie,ae]=r(()=>new Map),O=i(e=>{D(t=>new Set(t).add(e))},[]),oe=i(e=>{D(t=>{if(!t.has(e))return t;let n=new Set(t);return n.delete(e),n})},[]),se=i((e,t)=>{ae(n=>new Map(n).set(e,t))},[]),k=i(e=>{ae(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),ce=ue({onMutate:e=>{O(e.name),k(e.name)},onSuccess:(e,t)=>{oe(t.name);let n=e;if(n&&n.success===!1){se(t.name,n.error??`Update failed (no error message returned by server)`);return}h.invalidateQueries({queryKey:[[`addons`]]}),h.invalidateQueries({queryKey:[[`addons`,`listUpdates`]]})},onError:(e,t)=>{oe(t.name),se(t.name,e instanceof Error?e.message:String(e))}}),j=Pe(),M=c(new Set);t(()=>{let e=new Set;for(let[t,n]of j)Me(n)&&e.add(t);let t=[...M.current].some(t=>!e.has(t));M.current=e,t&&(h.invalidateQueries({queryKey:[[`addons`]]}),h.invalidateQueries({queryKey:[[`addons`,`listUpdates`]]}))},[j,h]);let{data:N}=le(void 0),de=R({onSuccess:()=>{h.invalidateQueries({queryKey:[[`addons`,`getAutoUpdateSettings`]]})}}),P=B({onSuccess:()=>{h.invalidateQueries({queryKey:[[`addons`,`getAutoUpdateSettings`]]})}}),{data:F,isFetching:fe}=q({query:y||void 0},{enabled:x}),I=ve(),{data:L}=A(void 0),pe=L?.requestedAt,[me,ge]=r(null),[z,_e]=r(!1);t(()=>{if(L?.kind===`framework-bulk-update`&&L.requestedAt!==me){ge(L.requestedAt),_e(!0);let e=window.setTimeout(()=>_e(!1),6e3);return()=>window.clearTimeout(e)}},[pe,me,L]),ye();let V=i(async()=>{let e=(T??[]).filter(e=>!e.isSystem);if(e.length!==0){if(!d.isHub){for(let t of e)await ce.mutateAsync({name:t.name,version:t.latestVersion,nodeId:d.id});return}await I.mutateAsync({kind:`update`,targets:e.map(e=>({name:e.name,version:e.latestVersion})),nodeIds:[d.id]})}},[T,d.id,d.isHub,I,ce]),H=xe({onSuccess:()=>{h.invalidateQueries({queryKey:[[`addons`]]}),h.invalidateQueries({queryKey:[[`addonPages`]]}),h.invalidateQueries({queryKey:[[`capabilities`]]}),h.invalidateQueries({queryKey:[[`integrations`]]})}}),[U,W]=r(`type`),[be,G]=r(()=>typeof window>`u`?`grouped`:window.localStorage.getItem(`camstack.addons.viewMode`)===`flat`?`flat`:`grouped`),Ce=e=>{G(e),typeof window<`u`&&window.localStorage.setItem(`camstack.addons.viewMode`,e)},[K,Y]=we(),X=K.get(`capability`),Z=K.get(`updatable`)===`1`,Te=K.get(`error`)===`1`,Q=lt(K.get(`source`)),Ee=i(e=>{let t=new URLSearchParams(K);e?t.set(`updatable`,`1`):t.delete(`updatable`),Y(t,{replace:!0})},[K,Y]),Oe=i(e=>{let t=new URLSearchParams(K);e?t.set(`error`,`1`):t.delete(`error`),Y(t,{replace:!0})},[K,Y]),ke=i(e=>{let t=new URLSearchParams(K);e===null?t.delete(`source`):t.set(`source`,e),Y(t,{replace:!0})},[K,Y]),Ae=n(()=>e.filter(e=>De(e.process)!==null).length,[e]),je=n(()=>{let t=e.filter(e=>!mt(e.manifest.packageName));return d.isHub||(t=t.filter(e=>gt(e.placement,d.isHub))),X&&(t=t.filter(e=>(e.manifest.capabilities??[]).some(e=>(typeof e==`string`?e:e.name)===X))),Z&&(t=t.filter(e=>{let t=e.manifest.packageName;return t!==void 0&&E.has(t)})),Q!==null&&(t=t.filter(e=>_t(e.installSource)===Q)),Te&&(t=t.filter(e=>De(e.process)!==null)),t},[e,d.isHub,X,Z,Q,Te,E]),Ne=()=>{let e=new URLSearchParams(K);e.delete(`capability`),Y(e,{replace:!0})},Fe=be===`flat`?je:yt(je),Ie=n(()=>{let e=[...Fe];switch(U){case`type`:e.sort((e,t)=>{let n=+!$(e),r=+!$(t);if(n!==r)return n-r;let i=$(e)?e.bundle.displayName:e.manifest.name,a=$(t)?t.bundle.displayName:t.manifest.name;return i.localeCompare(a)});break;case`name`:e.sort((e,t)=>{let n=$(e)?e.bundle.displayName:e.manifest.name,r=$(t)?t.bundle.displayName:t.manifest.name;return n.localeCompare(r)});break;case`source`:e.sort((e,t)=>{let n=$(e)?e.bundle.installSource??``:e.installSource??``,r=$(t)?t.bundle.installSource??``:t.installSource??``;return n.localeCompare(r)});break}return e},[Fe,U]);return a(`div`,{className:`space-y-3`,children:[[...ie.entries()].map(([e,t])=>l(`div`,{className:`rounded-md border border-danger/30 bg-danger/5 px-2.5 py-1.5 text-[11px]`,children:a(`div`,{className:`flex items-start justify-between gap-3`,children:[a(`div`,{className:`space-y-0.5`,children:[l(`div`,{className:`font-medium text-danger`,children:m(`systemPage.addons.updateFailed`,{name:e})}),l(`div`,{className:`text-foreground-subtle font-mono`,children:t})]}),l(`button`,{type:`button`,onClick:()=>k(e),className:`text-foreground-subtle hover:text-foreground text-[10px]`,children:m(`common.dismiss`)})]})},e)),a(`div`,{className:`flex items-center gap-x-2 gap-y-1.5 flex-wrap`,children:[a(`div`,{className:`flex items-center gap-1.5`,children:[l(`span`,{className:`text-[10px] text-foreground-subtle`,children:m(`admin.system.addons.sort`,`Sort:`)}),a(`select`,{value:U,onChange:e=>W(e.target.value),className:`rounded-md border border-border bg-surface px-2 py-1 text-[11px] text-foreground focus:outline-none focus:border-primary/50`,children:[l(`option`,{value:`type`,children:m(`admin.system.addons.bundlesFirst`,`Bundles first`)}),l(`option`,{value:`name`,children:m(`admin.system.addons.name`,`Name`)}),l(`option`,{value:`source`,children:m(`admin.system.addons.installSource`,`Install source`)})]})]}),a(`div`,{className:`flex items-center gap-1.5`,children:[l(`span`,{className:`text-[10px] text-foreground-subtle`,children:m(`admin.system.addons.view`,`View:`)}),l(`div`,{className:`flex rounded-md border border-border overflow-hidden text-[10px] font-medium`,children:[`grouped`,`flat`].map(e=>l(`button`,{type:`button`,onClick:()=>Ce(e),className:`px-2 py-1 transition-colors capitalize ${be===e?`bg-primary/10 text-primary`:`bg-transparent text-foreground-subtle hover:bg-surface-hover`}`,title:e===`grouped`?m(`admin.system.addons.groupMultiAddonPackagesInto`,`Group multi-addon packages into a bundle card`):m(`admin.system.addons.showEveryAddonAsIts`,`Show every addon as its own card`),children:e},e))})]}),d.isHub&&a(`div`,{className:`flex items-center gap-1.5`,children:[l(b,{className:`h-3 w-3 text-foreground-subtle`}),l(`span`,{className:`text-[10px] text-foreground-subtle`,children:m(`admin.system.addons.autoUpdate`,`Auto-Update:`)}),l(`div`,{className:`flex rounded-md border border-border overflow-hidden text-[10px] font-medium`,children:[`off`,`latest`,`beta`].map(e=>l(`button`,{type:`button`,onClick:()=>de.mutate({channel:e}),disabled:de.isPending,className:`px-2 py-1 transition-colors capitalize ${N?.channel===e?e===`off`?`bg-gray-700 text-gray-200`:e===`latest`?`bg-blue-500/20 text-blue-400`:`bg-amber-500/20 text-amber-400`:`bg-transparent text-foreground-subtle hover:bg-surface-hover`} ${e===`off`?``:`border-l border-border`}`,children:e},e))})]}),d.isHub&&a(`div`,{className:`flex items-center gap-1.5`,children:[l(`span`,{className:`text-[10px] text-foreground-subtle`,children:m(`admin.system.addons.checkEvery`,`Check every:`)}),l(`select`,{className:`rounded-md border border-border bg-transparent px-1.5 py-1 text-[10px] font-medium text-foreground-subtle`,value:N?.updateCheckIntervalSeconds??21600,disabled:P.isPending||N===void 0,onChange:e=>{N!==void 0&&P.mutate({channel:N.channel,updateCheckIntervalSeconds:Number(e.target.value)})},children:ft.map(e=>l(`option`,{value:e.seconds,children:e.label},e.seconds))})]}),ne>0&&a(`button`,{type:`button`,onClick:()=>void V(),disabled:I.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:[I.isPending?l(w,{className:`w-3 h-3 animate-spin`}):l(v,{className:`w-3 h-3`}),I.isPending?m(`admin.system.addons.updating`,`Updating…`):m(`admin.system.addons.updateAll`,`Update All ({{nonSystemUpdateCount}})`,{nonSystemUpdateCount:ne})]}),a(`button`,{type:`button`,onClick:f,disabled:p||I.isPending,className:`flex items-center gap-1 px-2 py-1 text-[11px] rounded-md bg-surface hover:bg-surface-hover border border-border disabled:opacity-50 transition-colors`,children:[l(b,{className:`w-3 h-3 ${p?`animate-spin`:``}`}),m(`common.refresh`,`Refresh`)]})]}),a(`div`,{className:`flex flex-wrap items-center gap-1.5`,role:`group`,"aria-label":m(`admin.system.addons.filterInstalledAddons`,`Filter installed addons`),children:[l(`span`,{className:`text-[10px] text-foreground-subtle`,children:m(`admin.system.addons.filter`,`Filter:`)}),[{id:`updatable`,label:m(`admin.system.addons.updatable`,`Updatable`),pressed:Z,toggle:()=>Ee(!Z)},{id:`error`,label:m(`admin.system.addons.inError`,`In error ({{count}})`,{count:Ae}),pressed:Te,toggle:()=>Oe(!Te)},{id:`npm`,label:`npm`,pressed:Q===`npm`,toggle:()=>ke(Q===`npm`?null:`npm`)},{id:`dev`,label:m(`admin.system.addons.dev`,`Dev`),pressed:Q===`dev`,toggle:()=>ke(Q===`dev`?null:`dev`)}].map(e=>l(`button`,{type:`button`,"aria-pressed":e.pressed,onClick:e.toggle,className:e.pressed?ut:dt,children:e.label},e.id))]}),a(`div`,{className:`flex flex-col gap-1.5 sm:flex-row sm:items-center sm:gap-2`,children:[a(`div`,{className:`relative flex-1 min-w-0 sm:min-w-[200px]`,ref:te,children:[l(Se,{type:`text`,value:g,onChange:e=>{_(e.target.value),C(!0)},onFocus:()=>C(!0),placeholder:m(`admin.system.addons.searchAddonsOnNpm`,`Search addons on npm...`),"aria-label":m(`admin.system.addons.searchAddonsOnNpm2`,`Search addons on npm`),disabled:I.isPending,leftSlot:l(S,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),rightSlot:fe?l(w,{className:`h-3 w-3 animate-spin`}):void 0}),x&&F&&F.length>0&&a(`div`,{className:`absolute left-0 right-0 top-full mt-1 z-40 rounded-md border border-border bg-surface shadow-xl overflow-hidden`,children:[F.length>0&&l(`div`,{className:`px-3 py-1.5 text-[10px] uppercase tracking-wide text-foreground-subtle border-b border-border`,children:m(`systemPage.addons.npmResults`,{count:F.length})}),F&&F.length>0&&l(`div`,{className:`max-h-72 overflow-auto divide-y divide-border`,children:F.map(e=>l(st,{addon:e,installing:H.isPending,onInstall:e=>H.mutate({packageName:e})},e.name))})]})]}),l(rt,{onUploadSuccess:()=>{h.invalidateQueries({queryKey:[[`addons`]]}),f()}})]}),X&&a(`div`,{className:`flex items-center gap-2 px-2.5 py-1.5 rounded-md bg-primary/10 border border-primary/30 text-xs`,children:[l(`span`,{className:`text-foreground-subtle`,children:m(`admin.system.addons.filteringByCapability`,`Filtering by capability:`)}),l(`span`,{className:`font-mono text-primary font-semibold`,children:X}),l(`button`,{type:`button`,onClick:Ne,className:`ml-auto text-xs text-foreground-subtle hover:text-foreground underline`,children:m(`admin.system.addons.clear`,`Clear`)})]}),X&&l(ct,{capability:X,installing:H.isPending,onInstall:e=>H.mutate({packageName:e})}),X&&je.length>0&&l(`h2`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:m(`admin.system.addons.installed`,`Installed`)}),z&&a(`div`,{className:`fixed top-[calc(env(safe-area-inset-top)+1rem)] right-[calc(env(safe-area-inset-right)+1rem)] z-50 flex items-start gap-2 px-3 py-2.5 rounded-md border border-green-500/30 bg-green-500/10 shadow-lg backdrop-blur-sm max-w-sm pointer-events-auto`,children:[l(ee,{className:`w-4 h-4 shrink-0 mt-0.5 text-green-400`}),a(`div`,{children:[l(`div`,{className:`text-[11px] font-semibold text-foreground`,children:m(`admin.system.addons.bulkUpdateCompleted`,`Bulk update completed`)}),l(`div`,{className:`text-[10px] text-foreground-subtle mt-0.5`,children:m(`admin.system.addons.systemPackagesUpdatedHubRestarted`,`System packages updated — hub restarted successfully.`)})]})]}),je.length===0&&l(`div`,{className:`text-xs text-foreground-subtle`,children:e.length===0?m(`admin.system.addons.noAddonsInstalled`,`No addons installed`):X?m(`admin.system.addons.noInstalledAddonDeclaresThe`,`No installed addon declares the "{{capabilityFilter}}" capability. Any addon you can install appears under "Available to install" above.`,{capabilityFilter:X}):m(`admin.system.addons.noAddonsCompatibleWithPlacement`,`No addons compatible with {{name}} (placement filter active)`,{name:d.name})}),l(`div`,{className:`space-y-1.5`,children:Ie.map(e=>{let t=$(e)?e.bundle.packageName:e.manifest.packageName,n=E.get(t),r=$(e)?e.representative:e,i=n?e=>ce.mutate({name:t,version:e,nodeId:d.id}):void 0,a=j.get(t)??null,s=a!==null&&Me(a);return l(tt,{addon:r,clusterStatus:o?.[r.manifest.id],bundle:$(e)?e.bundle:void 0,availableUpdate:n,isUpdating:re.has(t)||s,jobProgress:a,onUpdate:i,disabledByBulk:I.isPending,selectedNode:d},$(e)?t:e.manifest.id)})})]})}function xt(){let{t:e}=J(),n=s(),{data:r}=G(void 0),{nodes:i}=H(),{selection:o,selectNode:u,requestedNodeId:d}=Ee(i.length>0?i:[ht]),f=o.node??ht,p=f.id,m=i.length>0?o.staleNodeId:null,{data:h,isLoading:g,isError:_}=se({nodeId:p}),v=K(),y=j(),x=v.isPending||y.isPending,S=async()=>{await v.mutateAsync({nodeId:p}),await y.mutateAsync(),n.invalidateQueries({queryKey:[[`addons`]]})},C=c(v);C.current=v;let w=c(d??`hub`);t(()=>{C.current.mutate({nodeId:w.current})},[]);let ee=(h??[]).map(vt).filter(e=>e!==null);return a(Z,{children:[a(`div`,{className:`flex items-center justify-between gap-2 flex-wrap`,children:[l(M,{selectedNodeId:p,onSelect:u}),a(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[!g&&!_&&l(`span`,{className:`text-[10px] rounded-full bg-primary/10 text-primary px-2 py-0.5 font-medium`,children:e(`systemPage.addons.installedCount`,{count:ee.length})}),a(`button`,{type:`button`,onClick:()=>void S(),disabled:x,className:`inline-flex items-center gap-1 px-2 py-1 text-[11px] rounded-md bg-surface hover:bg-surface-hover border border-border disabled:opacity-50 transition-colors`,title:e(`admin.system.addons.reFetchAddonsCheckNpm`,`Re-fetch addons + check npm for new versions`),children:[l(b,{className:`w-3 h-3 ${x?`animate-spin`:``}`}),e(`admin.system.addons.checkForUpdates`,`Check for updates`)]})]})]}),l(Q,{staleNodeId:m,shownNodeName:f.name}),l(ot,{selectedNode:f}),g&&l(`div`,{className:`text-xs text-foreground-subtle animate-pulse`,children:e(`common.loading`,`Loading…`)}),_&&l(`div`,{className:`text-xs text-danger`,children:e(`admin.system.addons.failedToLoadAddons`,`Failed to load addons`)}),!g&&!_&&l(bt,{addons:ee,clusterStatus:r,selectedNode:f,onRefresh:()=>void S(),isRefreshing:x})]})}export{xt as AddonsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as e,x as t}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CEHpkaJP.js";import{W as n}from"./src-CsHgYIi2.js";function r({icon:r,title:i,subtitle:a,actions:o,nav:s,embedded:c=!1,children:l}){return c?t(e,{children:l}):t(n,{icon:r,title:i,subtitle:a,actions:o,nav:s,children:l})}export{r as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$ as e,L as t,x as n}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CEHpkaJP.js";import{H as r}from"./src-CsHgYIi2.js";import{nt as i}from"./index-WxoBkjSL.js";e();function a({paramName:e=`tab`,defaultSection:a,sections:o,...s}){let[c,l]=i(),u=a??o[0]?.id??``,d=c.get(e),f=o.some(e=>e.id===d)?d??u:u,p=t((t,n)=>{l(r=>{let i=new URLSearchParams(r);for(let e of n)i.delete(e);return i.set(e,t),i},{replace:!0})},[e,l]);return n(r,{...s,paramName:e,defaultSection:a,sections:o,activeSection:f,onSectionChange:p})}export{a as t};
|