@northern.tech/store 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (190) hide show
  1. package/dist/actions.js +183 -129
  2. package/dist/actions.js.map +1 -1
  3. package/dist/actions.mjs +13 -13
  4. package/dist/api/general-api.js +42 -55
  5. package/dist/api/general-api.js.map +1 -1
  6. package/dist/api/general-api.mjs +6 -6
  7. package/dist/api/users-api.js +44 -70
  8. package/dist/api/users-api.js.map +1 -1
  9. package/dist/api/users-api.mjs +7 -7
  10. package/dist/appSlice/constants.js +1 -39
  11. package/dist/appSlice/constants.js.map +1 -1
  12. package/dist/appSlice/constants.mjs +2 -2
  13. package/dist/appSlice/index.js +51 -68
  14. package/dist/appSlice/index.js.map +1 -1
  15. package/dist/appSlice/index.mjs +5 -5
  16. package/dist/appSlice/selectors.js +1 -43
  17. package/dist/appSlice/selectors.js.map +1 -1
  18. package/dist/appSlice/selectors.mjs +2 -2
  19. package/dist/appSlice/thunks.js +563 -544
  20. package/dist/appSlice/thunks.js.map +1 -1
  21. package/dist/appSlice/thunks.mjs +28 -28
  22. package/dist/auth.js +39 -55
  23. package/dist/auth.js.map +1 -1
  24. package/dist/auth.mjs +5 -5
  25. package/dist/{chunk-C2YZYTJ6.mjs → chunk-2Z3RFYW4.mjs} +2 -11
  26. package/dist/{chunk-C2YZYTJ6.mjs.map → chunk-2Z3RFYW4.mjs.map} +1 -1
  27. package/dist/{chunk-OWHFMKTA.mjs → chunk-3ORTTLIB.mjs} +19 -16
  28. package/dist/{chunk-OWHFMKTA.mjs.map → chunk-3ORTTLIB.mjs.map} +1 -1
  29. package/dist/{chunk-NCI6JV5R.mjs → chunk-4SDUITD4.mjs} +6 -12
  30. package/dist/{chunk-NCI6JV5R.mjs.map → chunk-4SDUITD4.mjs.map} +1 -1
  31. package/dist/{chunk-BOSBROA3.mjs → chunk-5VNQCCAQ.mjs} +2 -7
  32. package/dist/{chunk-BOSBROA3.mjs.map → chunk-5VNQCCAQ.mjs.map} +1 -1
  33. package/dist/{chunk-2P4VECEE.mjs → chunk-65YIOCCD.mjs} +6 -11
  34. package/dist/{chunk-2P4VECEE.mjs.map → chunk-65YIOCCD.mjs.map} +1 -1
  35. package/dist/{chunk-QG4PT5WK.mjs → chunk-6CSGHZ3E.mjs} +9 -21
  36. package/dist/{chunk-QG4PT5WK.mjs.map → chunk-6CSGHZ3E.mjs.map} +1 -1
  37. package/dist/{chunk-X65NMDPS.mjs → chunk-AZRVRNXT.mjs} +40 -30
  38. package/dist/{chunk-X65NMDPS.mjs.map → chunk-AZRVRNXT.mjs.map} +1 -1
  39. package/dist/{chunk-M4U5R7A4.mjs → chunk-B42NUKMZ.mjs} +2 -6
  40. package/dist/{chunk-M4U5R7A4.mjs.map → chunk-B42NUKMZ.mjs.map} +1 -1
  41. package/dist/{chunk-BWFTQHNM.mjs → chunk-CHUCIHMY.mjs} +3 -4
  42. package/dist/{chunk-BWFTQHNM.mjs.map → chunk-CHUCIHMY.mjs.map} +1 -1
  43. package/dist/{chunk-UPMSYTWW.mjs → chunk-DIZJVB6M.mjs} +306 -291
  44. package/dist/{chunk-UPMSYTWW.mjs.map → chunk-DIZJVB6M.mjs.map} +1 -1
  45. package/dist/chunk-H5UCKQWK.mjs +41 -0
  46. package/dist/{chunk-ENLZPHTQ.mjs.map → chunk-H5UCKQWK.mjs.map} +1 -1
  47. package/dist/{chunk-MQIKQKSW.mjs → chunk-IFWKT27G.mjs} +37 -33
  48. package/dist/{chunk-MQIKQKSW.mjs.map → chunk-IFWKT27G.mjs.map} +1 -1
  49. package/dist/{chunk-EM2HUGUY.mjs → chunk-JA27QXVB.mjs} +37 -28
  50. package/dist/{chunk-EM2HUGUY.mjs.map → chunk-JA27QXVB.mjs.map} +1 -1
  51. package/dist/{chunk-2HCZYULZ.mjs → chunk-K2NZL5V4.mjs} +3 -6
  52. package/dist/{chunk-2HCZYULZ.mjs.map → chunk-K2NZL5V4.mjs.map} +1 -1
  53. package/dist/{chunk-Y47SYXII.mjs → chunk-KJAZNKV2.mjs} +43 -52
  54. package/dist/{chunk-Y47SYXII.mjs.map → chunk-KJAZNKV2.mjs.map} +1 -1
  55. package/dist/{chunk-U6YTBIDT.mjs → chunk-KPPU6OWF.mjs} +27 -39
  56. package/dist/{chunk-U6YTBIDT.mjs.map → chunk-KPPU6OWF.mjs.map} +1 -1
  57. package/dist/{chunk-EFHEROXZ.mjs → chunk-KZSTW27Q.mjs} +30 -18
  58. package/dist/{chunk-EFHEROXZ.mjs.map → chunk-KZSTW27Q.mjs.map} +1 -1
  59. package/dist/chunk-LZOMFHX3.mjs +38 -0
  60. package/dist/{chunk-RWYS5MKN.mjs → chunk-NJNSCJEY.mjs} +22 -26
  61. package/dist/{chunk-RWYS5MKN.mjs.map → chunk-NJNSCJEY.mjs.map} +1 -1
  62. package/dist/{chunk-ZLRZO4EY.mjs → chunk-O6TYYKSD.mjs} +62 -60
  63. package/dist/chunk-O6TYYKSD.mjs.map +1 -0
  64. package/dist/{chunk-OGAMVFPS.mjs → chunk-QQBUNZHA.mjs} +2 -6
  65. package/dist/{chunk-OGAMVFPS.mjs.map → chunk-QQBUNZHA.mjs.map} +1 -1
  66. package/dist/{chunk-WS3YYLTJ.mjs → chunk-R7LXL3KJ.mjs} +14 -13
  67. package/dist/{chunk-WS3YYLTJ.mjs.map → chunk-R7LXL3KJ.mjs.map} +1 -1
  68. package/dist/{chunk-MJW4632R.mjs → chunk-WCUGLHYM.mjs} +16 -20
  69. package/dist/{chunk-MJW4632R.mjs.map → chunk-WCUGLHYM.mjs.map} +1 -1
  70. package/dist/chunk-WYHJFSMQ.mjs +25 -0
  71. package/dist/{chunk-L4HIW3KB.mjs.map → chunk-WYHJFSMQ.mjs.map} +1 -1
  72. package/dist/{chunk-XJNI62IP.mjs → chunk-XC5UXEIB.mjs} +4 -11
  73. package/dist/{chunk-XJNI62IP.mjs.map → chunk-XC5UXEIB.mjs.map} +1 -1
  74. package/dist/{chunk-4U4X4KAC.mjs → chunk-XD7INCM4.mjs} +11 -17
  75. package/dist/{chunk-4U4X4KAC.mjs.map → chunk-XD7INCM4.mjs.map} +1 -1
  76. package/dist/{chunk-ZZ6VIQ3U.mjs → chunk-ZE7R2XXE.mjs} +10 -12
  77. package/dist/{chunk-ZZ6VIQ3U.mjs.map → chunk-ZE7R2XXE.mjs.map} +1 -1
  78. package/dist/{chunk-4C6IY46N.mjs → chunk-ZK4W5T53.mjs} +7 -11
  79. package/dist/{chunk-4C6IY46N.mjs.map → chunk-ZK4W5T53.mjs.map} +1 -1
  80. package/dist/commonConstants.js +1 -35
  81. package/dist/commonConstants.js.map +1 -1
  82. package/dist/commonConstants.mjs +2 -2
  83. package/dist/commonSelectors.js +73 -135
  84. package/dist/commonSelectors.js.map +1 -1
  85. package/dist/commonSelectors.mjs +12 -12
  86. package/dist/constants.js +36 -153
  87. package/dist/constants.js.map +1 -1
  88. package/dist/constants.mjs +14 -14
  89. package/dist/deploymentsSlice/constants.js +34 -59
  90. package/dist/deploymentsSlice/constants.js.map +1 -1
  91. package/dist/deploymentsSlice/constants.mjs +4 -4
  92. package/dist/deploymentsSlice/index.js +68 -79
  93. package/dist/deploymentsSlice/index.js.map +1 -1
  94. package/dist/deploymentsSlice/index.mjs +5 -5
  95. package/dist/deploymentsSlice/selectors.js +35 -52
  96. package/dist/deploymentsSlice/selectors.js.map +1 -1
  97. package/dist/deploymentsSlice/selectors.mjs +5 -5
  98. package/dist/deploymentsSlice/thunks.js +563 -553
  99. package/dist/deploymentsSlice/thunks.js.map +1 -1
  100. package/dist/deploymentsSlice/thunks.mjs +28 -28
  101. package/dist/devicesSlice/constants.js +34 -58
  102. package/dist/devicesSlice/constants.js.map +1 -1
  103. package/dist/devicesSlice/constants.mjs +4 -4
  104. package/dist/devicesSlice/index.js +71 -81
  105. package/dist/devicesSlice/index.js.map +1 -1
  106. package/dist/devicesSlice/index.mjs +5 -5
  107. package/dist/devicesSlice/selectors.js +40 -89
  108. package/dist/devicesSlice/selectors.js.map +1 -1
  109. package/dist/devicesSlice/selectors.mjs +5 -5
  110. package/dist/devicesSlice/thunks.js +563 -589
  111. package/dist/devicesSlice/thunks.js.map +1 -1
  112. package/dist/devicesSlice/thunks.mjs +28 -28
  113. package/dist/monitorSlice/constants.js +34 -45
  114. package/dist/monitorSlice/constants.js.map +1 -1
  115. package/dist/monitorSlice/constants.mjs +4 -4
  116. package/dist/monitorSlice/index.js +41 -52
  117. package/dist/monitorSlice/index.js.map +1 -1
  118. package/dist/monitorSlice/index.mjs +5 -5
  119. package/dist/monitorSlice/selectors.js +0 -4
  120. package/dist/monitorSlice/selectors.mjs +1 -1
  121. package/dist/monitorSlice/thunks.js +249 -232
  122. package/dist/monitorSlice/thunks.js.map +1 -1
  123. package/dist/monitorSlice/thunks.mjs +25 -25
  124. package/dist/onboardingSlice/constants.js +0 -5
  125. package/dist/onboardingSlice/constants.mjs +1 -1
  126. package/dist/onboardingSlice/index.js +1 -22
  127. package/dist/onboardingSlice/index.js.map +1 -1
  128. package/dist/onboardingSlice/index.mjs +2 -2
  129. package/dist/onboardingSlice/selectors.js +0 -4
  130. package/dist/onboardingSlice/selectors.mjs +1 -1
  131. package/dist/onboardingSlice/thunks.js +563 -547
  132. package/dist/onboardingSlice/thunks.js.map +1 -1
  133. package/dist/onboardingSlice/thunks.mjs +28 -28
  134. package/dist/organizationSlice/constants.js +34 -56
  135. package/dist/organizationSlice/constants.js.map +1 -1
  136. package/dist/organizationSlice/constants.mjs +4 -4
  137. package/dist/organizationSlice/index.js +45 -53
  138. package/dist/organizationSlice/index.js.map +1 -1
  139. package/dist/organizationSlice/index.mjs +5 -5
  140. package/dist/organizationSlice/selectors.js +35 -61
  141. package/dist/organizationSlice/selectors.js.map +1 -1
  142. package/dist/organizationSlice/selectors.mjs +5 -5
  143. package/dist/organizationSlice/thunks.js +563 -572
  144. package/dist/organizationSlice/thunks.js.map +1 -1
  145. package/dist/organizationSlice/thunks.mjs +28 -28
  146. package/dist/releasesSlice/constants.js +0 -7
  147. package/dist/releasesSlice/constants.mjs +1 -1
  148. package/dist/releasesSlice/index.js +38 -64
  149. package/dist/releasesSlice/index.js.map +1 -1
  150. package/dist/releasesSlice/index.mjs +5 -5
  151. package/dist/releasesSlice/selectors.js +37 -57
  152. package/dist/releasesSlice/selectors.js.map +1 -1
  153. package/dist/releasesSlice/selectors.mjs +6 -6
  154. package/dist/releasesSlice/thunks.js +293 -281
  155. package/dist/releasesSlice/thunks.js.map +1 -1
  156. package/dist/releasesSlice/thunks.mjs +25 -25
  157. package/dist/selectors.js +73 -207
  158. package/dist/selectors.js.map +1 -1
  159. package/dist/selectors.mjs +43 -43
  160. package/dist/store.js +194 -151
  161. package/dist/store.js.map +1 -1
  162. package/dist/store.mjs +16 -16
  163. package/dist/storehooks.js +568 -547
  164. package/dist/storehooks.js.map +1 -1
  165. package/dist/storehooks.mjs +38 -41
  166. package/dist/storehooks.mjs.map +1 -1
  167. package/dist/thunks.js +563 -702
  168. package/dist/thunks.js.map +1 -1
  169. package/dist/thunks.mjs +28 -28
  170. package/dist/usersSlice/constants.js +36 -66
  171. package/dist/usersSlice/constants.js.map +1 -1
  172. package/dist/usersSlice/constants.mjs +4 -4
  173. package/dist/usersSlice/index.js +62 -71
  174. package/dist/usersSlice/index.js.map +1 -1
  175. package/dist/usersSlice/index.mjs +5 -5
  176. package/dist/usersSlice/selectors.js +41 -66
  177. package/dist/usersSlice/selectors.js.map +1 -1
  178. package/dist/usersSlice/selectors.mjs +6 -6
  179. package/dist/usersSlice/thunks.js +563 -576
  180. package/dist/usersSlice/thunks.js.map +1 -1
  181. package/dist/usersSlice/thunks.mjs +28 -28
  182. package/dist/utils.js +57 -93
  183. package/dist/utils.js.map +1 -1
  184. package/dist/utils.mjs +5 -5
  185. package/package.json +66 -1
  186. package/dist/chunk-ENLZPHTQ.mjs +0 -35
  187. package/dist/chunk-L4HIW3KB.mjs +0 -36
  188. package/dist/chunk-XWBD7VOK.mjs +0 -93
  189. package/dist/chunk-ZLRZO4EY.mjs.map +0 -1
  190. /package/dist/{chunk-XWBD7VOK.mjs.map → chunk-LZOMFHX3.mjs.map} +0 -0
package/dist/thunks.js CHANGED
@@ -1,40 +1,10 @@
1
1
  "use strict";
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
- var __defProps = Object.defineProperties;
5
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
7
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
6
  var __getProtoOf = Object.getPrototypeOf;
10
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
11
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
- var __spreadValues = (a, b) => {
14
- for (var prop in b || (b = {}))
15
- if (__hasOwnProp.call(b, prop))
16
- __defNormalProp(a, prop, b[prop]);
17
- if (__getOwnPropSymbols)
18
- for (var prop of __getOwnPropSymbols(b)) {
19
- if (__propIsEnum.call(b, prop))
20
- __defNormalProp(a, prop, b[prop]);
21
- }
22
- return a;
23
- };
24
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
25
- var __restKey = (key) => typeof key === "symbol" ? key : key + "";
26
- var __objRest = (source, exclude) => {
27
- var target = {};
28
- for (var prop in source)
29
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
30
- target[prop] = source[prop];
31
- if (source != null && __getOwnPropSymbols)
32
- for (var prop of __getOwnPropSymbols(source)) {
33
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
34
- target[prop] = source[prop];
35
- }
36
- return target;
37
- };
38
8
  var __commonJS = (cb, mod) => function __require() {
39
9
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
40
10
  };
@@ -59,33 +29,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
59
29
  mod
60
30
  ));
61
31
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
62
- var __async = (__this, __arguments, generator) => {
63
- return new Promise((resolve, reject) => {
64
- var fulfilled = (value) => {
65
- try {
66
- step(generator.next(value));
67
- } catch (e) {
68
- reject(e);
69
- }
70
- };
71
- var rejected = (value) => {
72
- try {
73
- step(generator.throw(value));
74
- } catch (e) {
75
- reject(e);
76
- }
77
- };
78
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
79
- step((generator = generator.apply(__this, __arguments)).next());
80
- });
81
- };
82
32
 
83
33
  // ../../node_modules/pluralize/pluralize.js
84
34
  var require_pluralize = __commonJS({
85
- "../../node_modules/pluralize/pluralize.js"(exports2, module2) {
35
+ "../../node_modules/pluralize/pluralize.js"(exports, module2) {
86
36
  "use strict";
87
37
  (function(root, pluralize2) {
88
- if (typeof require === "function" && typeof exports2 === "object" && typeof module2 === "object") {
38
+ if (typeof require === "function" && typeof exports === "object" && typeof module2 === "object") {
89
39
  module2.exports = pluralize2();
90
40
  } else if (typeof define === "function" && define.amd) {
91
41
  define(function() {
@@ -94,7 +44,7 @@ var require_pluralize = __commonJS({
94
44
  } else {
95
45
  root.pluralize = pluralize2();
96
46
  }
97
- })(exports2, function() {
47
+ })(exports, function() {
98
48
  var pluralRules = [];
99
49
  var singularRules = [];
100
50
  var uncountables = {};
@@ -628,7 +578,7 @@ var chartTypes = {
628
578
  };
629
579
  var emptyChartSelection = { software: "", group: "", chartType: chartTypes.bar.key, attribute: "artifact_name" };
630
580
  var defaultReportType = "distribution";
631
- var defaultReports = [__spreadProps(__spreadValues({}, emptyChartSelection), { group: null, attribute: "artifact_name", type: defaultReportType })];
581
+ var defaultReports = [{ ...emptyChartSelection, group: null, attribute: "artifact_name", type: defaultReportType }];
632
582
  var locations = {};
633
583
  var PLANS = {
634
584
  os: {
@@ -961,7 +911,7 @@ var emptyRole = Object.freeze({
961
911
  name: void 0,
962
912
  description: "",
963
913
  permissions: [],
964
- uiPermissions: Object.freeze(__spreadValues({}, emptyUiPermissions))
914
+ uiPermissions: Object.freeze({ ...emptyUiPermissions })
965
915
  });
966
916
 
967
917
  // src/deploymentsSlice/constants.ts
@@ -990,11 +940,12 @@ var deploymentStatesToSubstates = {
990
940
  pending: [deploymentSubstates.pending],
991
941
  successes: [deploymentSubstates.success, deploymentSubstates.alreadyInstalled, deploymentSubstates.noartifact]
992
942
  };
993
- var deploymentStatesToSubstatesWithSkipped = __spreadProps(__spreadValues({}, deploymentStatesToSubstates), {
943
+ var deploymentStatesToSubstatesWithSkipped = {
944
+ ...deploymentStatesToSubstates,
994
945
  failures: [deploymentSubstates.failure],
995
946
  skipped: [deploymentSubstates.aborted, deploymentSubstates.noartifact, deploymentSubstates.alreadyInstalled, deploymentSubstates.decommissioned],
996
947
  successes: [deploymentSubstates.success]
997
- });
948
+ };
998
949
  var installationSubstatesMap = {
999
950
  download: {
1000
951
  title: "download",
@@ -1039,8 +990,8 @@ var DEPLOYMENT_STATES = {
1039
990
  var listDefaultsByState = {
1040
991
  [DEPLOYMENT_STATES.inprogress]: { page: 1, perPage: 10 },
1041
992
  [DEPLOYMENT_STATES.pending]: { page: 1, perPage: 10 },
1042
- [DEPLOYMENT_STATES.scheduled]: __spreadValues({}, DEVICE_LIST_DEFAULTS),
1043
- [DEPLOYMENT_STATES.finished]: __spreadValues({}, DEVICE_LIST_DEFAULTS),
993
+ [DEPLOYMENT_STATES.scheduled]: { ...DEVICE_LIST_DEFAULTS },
994
+ [DEPLOYMENT_STATES.finished]: { ...DEVICE_LIST_DEFAULTS },
1044
995
  sort: { direction: SORTING_OPTIONS.desc }
1045
996
  };
1046
997
  var DEFAULT_PENDING_INPROGRESS_COUNT = 10;
@@ -1415,7 +1366,7 @@ var uiPermissionsByArea = {
1415
1366
  }
1416
1367
  };
1417
1368
  var permissionMapper = (permission) => permission.value;
1418
- var itemUiPermissionsReducer = (accu, { item, uiPermissions }) => item ? __spreadProps(__spreadValues({}, accu), { [item]: uiPermissions }) : accu;
1369
+ var itemUiPermissionsReducer = (accu, { item, uiPermissions }) => item ? { ...accu, [item]: uiPermissions } : accu;
1419
1370
  var rolesById = Object.freeze({
1420
1371
  [staticRolesByName.admin]: {
1421
1372
  name: "Admin",
@@ -1423,54 +1374,59 @@ var rolesById = Object.freeze({
1423
1374
  description: "Full access",
1424
1375
  permissions: [],
1425
1376
  // permissions refers to the values returned from the backend
1426
- uiPermissions: __spreadProps(__spreadValues({}, emptyUiPermissions), {
1377
+ uiPermissions: {
1378
+ ...emptyUiPermissions,
1427
1379
  auditlog: uiPermissionsByArea.auditlog.uiPermissions.map(permissionMapper),
1428
1380
  deployments: uiPermissionsByArea.deployments.uiPermissions.map(permissionMapper),
1429
1381
  groups: { [ALL_DEVICES]: uiPermissionsByArea.groups.uiPermissions.map(permissionMapper) },
1430
1382
  releases: { [ALL_RELEASES]: uiPermissionsByArea.releases.uiPermissions.map(permissionMapper) },
1431
1383
  userManagement: uiPermissionsByArea.userManagement.uiPermissions.map(permissionMapper)
1432
- })
1384
+ }
1433
1385
  },
1434
1386
  [staticRolesByName.readOnly]: {
1435
1387
  name: "Read Access",
1436
1388
  value: staticRolesByName.readOnly,
1437
1389
  description: "",
1438
1390
  permissions: [],
1439
- uiPermissions: __spreadProps(__spreadValues({}, emptyUiPermissions), {
1391
+ uiPermissions: {
1392
+ ...emptyUiPermissions,
1440
1393
  deployments: [uiPermissionsById.read.value],
1441
1394
  groups: { [ALL_DEVICES]: [uiPermissionsById.read.value] },
1442
1395
  releases: { [ALL_RELEASES]: [uiPermissionsById.read.value] },
1443
1396
  userManagement: [uiPermissionsById.read.value]
1444
- })
1397
+ }
1445
1398
  },
1446
1399
  [staticRolesByName.ci]: {
1447
1400
  name: "Releases Manager",
1448
1401
  value: staticRolesByName.ci,
1449
1402
  description: "",
1450
1403
  permissions: [],
1451
- uiPermissions: __spreadProps(__spreadValues({}, emptyUiPermissions), {
1404
+ uiPermissions: {
1405
+ ...emptyUiPermissions,
1452
1406
  releases: { [ALL_RELEASES]: uiPermissionsByArea.releases.uiPermissions.map(permissionMapper) }
1453
- })
1407
+ }
1454
1408
  },
1455
1409
  [staticRolesByName.deploymentsManager]: {
1456
1410
  name: "Deployments Manager",
1457
1411
  value: staticRolesByName.deploymentsManager,
1458
1412
  description: "",
1459
1413
  permissions: [],
1460
- uiPermissions: __spreadProps(__spreadValues({}, emptyUiPermissions), {
1414
+ uiPermissions: {
1415
+ ...emptyUiPermissions,
1461
1416
  deployments: uiPermissionsByArea.deployments.uiPermissions.map(permissionMapper),
1462
1417
  groups: { [ALL_DEVICES]: [uiPermissionsById.deploy.value, uiPermissionsById.read.value] },
1463
1418
  releases: { [ALL_RELEASES]: [uiPermissionsById.read.value] }
1464
- })
1419
+ }
1465
1420
  },
1466
1421
  [staticRolesByName.terminalAccess]: {
1467
1422
  name: "Troubleshooting",
1468
1423
  value: staticRolesByName.terminalAccess,
1469
1424
  description: "Access to the troubleshooting features: Remote Terminal, File Transfer, Port Forwarding",
1470
1425
  permissions: [],
1471
- uiPermissions: __spreadProps(__spreadValues({}, emptyUiPermissions), {
1426
+ uiPermissions: {
1427
+ ...emptyUiPermissions,
1472
1428
  groups: { [ALL_DEVICES]: [uiPermissionsById.connect.value] }
1473
- })
1429
+ }
1474
1430
  }
1475
1431
  });
1476
1432
  var serviceProviderRolesById = {
@@ -1479,22 +1435,24 @@ var serviceProviderRolesById = {
1479
1435
  value: staticRolesByName.admin,
1480
1436
  description: "Full access",
1481
1437
  permissions: [],
1482
- uiPermissions: __spreadProps(__spreadValues({}, emptyUiPermissions), {
1438
+ uiPermissions: {
1439
+ ...emptyUiPermissions,
1483
1440
  auditlog: uiPermissionsByArea.auditlog.uiPermissions.map(permissionMapper),
1484
1441
  userManagement: uiPermissionsByArea.userManagement.uiPermissions.map(permissionMapper),
1485
1442
  tenantManagement: uiPermissionsByArea.tenantManagement.uiPermissions.map(permissionMapper)
1486
- })
1443
+ }
1487
1444
  },
1488
1445
  readOnly: {
1489
1446
  name: "Read access",
1490
1447
  value: staticRolesByName.admin,
1491
1448
  description: "This role can see all linked organizations but cannot make any changes",
1492
1449
  permissions: [],
1493
- uiPermissions: __spreadProps(__spreadValues({}, emptyUiPermissions), {
1450
+ uiPermissions: {
1451
+ ...emptyUiPermissions,
1494
1452
  auditlog: [uiPermissionsById.read.value],
1495
1453
  userManagement: [uiPermissionsById.read.value],
1496
1454
  tenantManagement: [uiPermissionsById.read.value]
1497
- })
1455
+ }
1498
1456
  }
1499
1457
  };
1500
1458
  var defaultPermissionSets = {
@@ -1507,7 +1465,9 @@ var defaultPermissionSets = {
1507
1465
  },
1508
1466
  [permissionSetIds.SuperUser]: {
1509
1467
  name: permissionSetIds.SuperUser,
1510
- result: __spreadValues({}, rolesById[staticRolesByName.admin].uiPermissions)
1468
+ result: {
1469
+ ...rolesById[staticRolesByName.admin].uiPermissions
1470
+ }
1511
1471
  },
1512
1472
  [permissionSetIds.ManageUsers]: {
1513
1473
  name: permissionSetIds.ManageUsers,
@@ -1592,11 +1552,12 @@ var defaultPermissionSets = {
1592
1552
  };
1593
1553
  var USER_LOGOUT = "USER_LOGOUT";
1594
1554
  var OWN_USER_ID = "me";
1595
- var rolesByName = __spreadProps(__spreadValues({}, staticRolesByName), {
1555
+ var rolesByName = {
1556
+ ...staticRolesByName,
1596
1557
  deploymentCreation: { action: "CREATE_DEPLOYMENT", object: { type: "DEVICE_GROUP", value: void 0 } },
1597
1558
  groupAccess: { action: "VIEW_DEVICE", object: { type: "DEVICE_GROUP", value: void 0 } },
1598
1559
  userManagement: { action: "http", object: { type: "any", value: `${useradmApiUrlv1}/.*` } }
1599
- });
1560
+ };
1600
1561
  var twoFAStates = {
1601
1562
  enabled: "enabled",
1602
1563
  disabled: "disabled",
@@ -1614,18 +1575,17 @@ var cookies = new import_universal_cookie.default();
1614
1575
  var emptySession = Object.freeze({ token: "", exiresAt: void 0 });
1615
1576
  var tokenCache = "";
1616
1577
  var getSessionInfo = () => {
1617
- var _a, _b2;
1618
- let sessionInfo = __spreadValues({}, emptySession);
1578
+ let sessionInfo = { ...emptySession };
1619
1579
  try {
1620
- sessionInfo = JSON.parse((_a = window.localStorage.getItem("JWT")) != null ? _a : "");
1621
- } catch (e) {
1580
+ sessionInfo = JSON.parse(window.localStorage.getItem("JWT") ?? "");
1581
+ } catch {
1622
1582
  }
1623
1583
  if (sessionInfo.expiresAt && new Date(sessionInfo.expiresAt) < /* @__PURE__ */ new Date()) {
1624
1584
  cleanUp();
1625
- return __spreadValues({}, emptySession);
1585
+ return { ...emptySession };
1626
1586
  }
1627
1587
  if (!sessionInfo.token) {
1628
- let jwtTokenFromCookie = (_b2 = cookies.get("JWT", { doNotParse: true })) != null ? _b2 : "";
1588
+ let jwtTokenFromCookie = cookies.get("JWT", { doNotParse: true }) ?? "";
1629
1589
  if (jwtTokenFromCookie) {
1630
1590
  setSessionInfo({ token: jwtTokenFromCookie, undefined: void 0 });
1631
1591
  sessionInfo.token = jwtTokenFromCookie;
@@ -1653,8 +1613,7 @@ var maxSessionAge = 900;
1653
1613
 
1654
1614
  // src/api/general-api.ts
1655
1615
  var unauthorizedRedirect = (error) => {
1656
- var _a;
1657
- if (!(0, import_axios.isCancel)(error) && ((_a = error.response) == null ? void 0 : _a.status) === 401 && getToken()) {
1616
+ if (!(0, import_axios.isCancel)(error) && error.response?.status === 401 && getToken()) {
1658
1617
  cleanUp();
1659
1618
  window.location.replace("/ui/");
1660
1619
  }
@@ -1664,7 +1623,7 @@ var commonRequestConfig = { timeout: TIMEOUTS.refreshDefault, headers: { "Conten
1664
1623
  var authenticatedRequest = import_axios.default.create(commonRequestConfig);
1665
1624
  authenticatedRequest.interceptors.response.use((res) => res, unauthorizedRedirect);
1666
1625
  authenticatedRequest.interceptors.request.use(
1667
- (config) => __spreadProps(__spreadValues({}, config), { headers: __spreadProps(__spreadValues({}, config.headers), { Authorization: `Bearer ${getToken()}` }) }),
1626
+ (config) => ({ ...config, headers: { ...config.headers, Authorization: `Bearer ${getToken()}` } }),
1668
1627
  (error) => Promise.reject(error)
1669
1628
  );
1670
1629
  var Api = {
@@ -1672,7 +1631,7 @@ var Api = {
1672
1631
  delete: (url, data) => authenticatedRequest.request({ method: "delete", url, data }),
1673
1632
  patch: authenticatedRequest.patch,
1674
1633
  post: authenticatedRequest.post,
1675
- postUnauthorized: (url, data, config = {}) => import_axios.default.post(url, data, __spreadValues(__spreadValues({}, commonRequestConfig), config)),
1634
+ postUnauthorized: (url, data, config = {}) => import_axios.default.post(url, data, { ...commonRequestConfig, ...config }),
1676
1635
  put: authenticatedRequest.put,
1677
1636
  upload: (url, formData, progress2, cancelSignal) => authenticatedRequest.post(url, formData, {
1678
1637
  headers: { "Content-Type": "multipart/form-data" },
@@ -1703,10 +1662,7 @@ var getSearchState = (state) => state.app.searchState;
1703
1662
  var getSearchedDevices = (0, import_toolkit.createSelector)([getSearchState], ({ deviceIds }) => deviceIds);
1704
1663
  var getVersionInformation = (0, import_toolkit.createSelector)(
1705
1664
  [getFullVersionInformation, getFeatures],
1706
- (_a, { isHosted }) => {
1707
- var _b2 = _a, { Integration } = _b2, remainder = __objRest(_b2, ["Integration"]);
1708
- return isHosted && Integration !== "next" ? remainder : __spreadProps(__spreadValues({}, remainder), { Integration });
1709
- }
1665
+ ({ Integration, ...remainder }, { isHosted }) => isHosted && Integration !== "next" ? remainder : { ...remainder, Integration }
1710
1666
  );
1711
1667
  var getIsPreview = (0, import_toolkit.createSelector)([getFullVersionInformation], ({ Integration }) => (0, import_helpers.versionCompare)(Integration, "next") > -1);
1712
1668
 
@@ -1723,8 +1679,7 @@ var getDeploymentsSelectionState = (state) => state.deployments.selectionState;
1723
1679
  var getMappedDeploymentSelection = (0, import_toolkit2.createSelector)(
1724
1680
  [getDeploymentsSelectionState, (_, deploymentsState) => deploymentsState, getDeploymentsById],
1725
1681
  (selectionState, deploymentsState, deploymentsById) => {
1726
- var _a;
1727
- const { selection = [] } = (_a = selectionState[deploymentsState]) != null ? _a : {};
1682
+ const { selection = [] } = selectionState[deploymentsState] ?? {};
1728
1683
  return selection.reduce((accu, id) => {
1729
1684
  if (deploymentsById[id]) {
1730
1685
  accu.push(deploymentsById[id]);
@@ -1768,7 +1723,8 @@ var getListedDevices = (state) => state.devices.deviceList.deviceIds;
1768
1723
  var getFilteringAttributes = (state) => state.devices.filteringAttributes;
1769
1724
  var getDeviceFilters = (state) => state.devices.filters || [];
1770
1725
  var getFilteringAttributesFromConfig = (state) => state.devices.filteringAttributesConfig.attributes;
1771
- var getSortedFilteringAttributes = (0, import_toolkit3.createSelector)([getFilteringAttributes], (filteringAttributes) => __spreadProps(__spreadValues({}, filteringAttributes), {
1726
+ var getSortedFilteringAttributes = (0, import_toolkit3.createSelector)([getFilteringAttributes], (filteringAttributes) => ({
1727
+ ...filteringAttributes,
1772
1728
  identityAttributes: [...filteringAttributes.identityAttributes, "id"]
1773
1729
  }));
1774
1730
  var getDeviceLimit = (state) => state.devices.limit;
@@ -1796,10 +1752,7 @@ var getDeviceCountsByStatus = (0, import_toolkit3.createSelector)(
1796
1752
  return accu;
1797
1753
  }, {})
1798
1754
  );
1799
- var getDeviceById = (0, import_toolkit3.createSelector)([getDevicesById, (_, deviceId) => deviceId], (devicesById, deviceId = "") => {
1800
- var _a;
1801
- return (_a = devicesById[deviceId]) != null ? _a : {};
1802
- });
1755
+ var getDeviceById = (0, import_toolkit3.createSelector)([getDevicesById, (_, deviceId) => deviceId], (devicesById, deviceId = "") => devicesById[deviceId] ?? {});
1803
1756
  var getSelectedGroupInfo = (0, import_toolkit3.createSelector)(
1804
1757
  [getAcceptedDevices, getGroupsById, getSelectedGroup],
1805
1758
  ({ total: acceptedDeviceTotal }, groupsById, selectedGroup) => {
@@ -1816,17 +1769,13 @@ var getLimitMaxed = (0, import_toolkit3.createSelector)(
1816
1769
  [getAcceptedDevices, getDeviceLimit],
1817
1770
  ({ total: acceptedDevices = 0 }, deviceLimit) => Boolean(deviceLimit && deviceLimit <= acceptedDevices)
1818
1771
  );
1819
- var _b;
1820
- var getGroupsByIdWithoutUngrouped = (0, import_toolkit3.createSelector)([getGroupsById], (_a) => {
1821
- var _c = _a, { [_b = UNGROUPED_GROUP.id]: ungrouped } = _c, groups = __objRest(_c, [__restKey(_b)]);
1822
- return groups;
1823
- });
1772
+ var getGroupsByIdWithoutUngrouped = (0, import_toolkit3.createSelector)([getGroupsById], ({ [UNGROUPED_GROUP.id]: ungrouped, ...groups }) => groups);
1824
1773
  var getGroups = (0, import_toolkit3.createSelector)([getGroupsById], (groupsById) => {
1825
1774
  const groupNames = Object.keys(groupsById).sort();
1826
1775
  const groupedGroups = Object.entries(groupsById).sort((a, b) => a[0].localeCompare(b[0])).reduce(
1827
1776
  (accu, [groupname, group]) => {
1828
1777
  const name = groupname === UNGROUPED_GROUP.id ? UNGROUPED_GROUP.name : groupname;
1829
- const groupItem = __spreadProps(__spreadValues({}, group), { groupId: name, name: groupname });
1778
+ const groupItem = { ...group, groupId: name, name: groupname };
1830
1779
  if (group.filters.length > 0) {
1831
1780
  if (groupname !== UNGROUPED_GROUP.id) {
1832
1781
  accu.dynamic.push(groupItem);
@@ -1840,7 +1789,7 @@ var getGroups = (0, import_toolkit3.createSelector)([getGroupsById], (groupsById
1840
1789
  },
1841
1790
  { dynamic: [], static: [], ungrouped: [] }
1842
1791
  );
1843
- return __spreadValues({ groupNames }, groupedGroups);
1792
+ return { groupNames, ...groupedGroups };
1844
1793
  });
1845
1794
  var getAttributesList = (0, import_toolkit3.createSelector)(
1846
1795
  [getFilteringAttributes, getFilteringAttributesFromConfig],
@@ -1880,10 +1829,7 @@ var getWebhookEvents = (state) => state.organization.webhooks.events;
1880
1829
  var getWebhookEventTotal = (state) => state.organization.webhooks.eventTotal;
1881
1830
  var getDeviceTwinIntegrations = (0, import_toolkit4.createSelector)(
1882
1831
  [getExternalIntegrations],
1883
- (integrations) => integrations.filter((integration) => {
1884
- var _a;
1885
- return integration.id && ((_a = EXTERNAL_PROVIDER[integration.provider]) == null ? void 0 : _a.deviceTwin);
1886
- })
1832
+ (integrations) => integrations.filter((integration) => integration.id && EXTERNAL_PROVIDER[integration.provider]?.deviceTwin)
1887
1833
  );
1888
1834
  var getIsServiceProvider = (state) => state.organization.organization.service_provider;
1889
1835
  var getWebhooks = (0, import_toolkit4.createSelector)(
@@ -1917,15 +1863,12 @@ var filterProcessors = {
1917
1863
  var filterAliases = {
1918
1864
  $nexists: { alias: DEVICE_FILTERING_OPTIONS.$exists.key, value: false }
1919
1865
  };
1920
- var mapFiltersToTerms = (filters) => filters.map((filter) => {
1921
- var _a;
1922
- return {
1923
- scope: filter.scope,
1924
- attribute: filter.key,
1925
- type: ((_a = filterAliases[filter.operator]) == null ? void 0 : _a.alias) || filter.operator,
1926
- value: filterProcessors.hasOwnProperty(filter.operator) ? filterProcessors[filter.operator](filter.value) : filter.value
1927
- };
1928
- });
1866
+ var mapFiltersToTerms = (filters) => filters.map((filter) => ({
1867
+ scope: filter.scope,
1868
+ attribute: filter.key,
1869
+ type: filterAliases[filter.operator]?.alias || filter.operator,
1870
+ value: filterProcessors.hasOwnProperty(filter.operator) ? filterProcessors[filter.operator](filter.value) : filter.value
1871
+ }));
1929
1872
  var mapTermsToFilters = (terms) => terms.map((term) => {
1930
1873
  const aliasedFilter = Object.entries(filterAliases).find(
1931
1874
  (aliasDefinition) => aliasDefinition[1].alias === term.type && aliasDefinition[1].value === term.value
@@ -1935,14 +1878,13 @@ var mapTermsToFilters = (terms) => terms.map((term) => {
1935
1878
  });
1936
1879
  var convertIssueOptionsToFilters = (issuesSelection, filtersState = {}) => issuesSelection.map((item) => {
1937
1880
  if (typeof DEVICE_ISSUE_OPTIONS[item].filterRule.value === "function") {
1938
- return __spreadProps(__spreadValues({}, DEVICE_ISSUE_OPTIONS[item].filterRule), { value: DEVICE_ISSUE_OPTIONS[item].filterRule.value(filtersState) });
1881
+ return { ...DEVICE_ISSUE_OPTIONS[item].filterRule, value: DEVICE_ISSUE_OPTIONS[item].filterRule.value(filtersState) };
1939
1882
  }
1940
1883
  return DEVICE_ISSUE_OPTIONS[item].filterRule;
1941
1884
  });
1942
1885
  var convertDeviceListStateToFilters = ({ filters = [], group, groups = { byId: {} }, offlineThreshold, selectedIssues = [], status }) => {
1943
- var _a;
1944
1886
  let applicableFilters = [...filters];
1945
- if (typeof group === "string" && !(((_a = groups.byId[group]) == null ? void 0 : _a.filters) || applicableFilters).length) {
1887
+ if (typeof group === "string" && !(groups.byId[group]?.filters || applicableFilters).length) {
1946
1888
  applicableFilters.push({ key: "group", value: group, operator: DEVICE_FILTERING_OPTIONS.$eq.key, scope: "system" });
1947
1889
  }
1948
1890
  const nonMonitorFilters = applicableFilters.filter(
@@ -1963,12 +1905,12 @@ var filtersFilter = (item, index, array) => {
1963
1905
  var listItemMapper = (byId, ids, { defaultObject = {}, cutOffSize = DEVICE_LIST_MAXIMUM_LENGTH }) => {
1964
1906
  return ids.slice(0, cutOffSize).reduce((accu, id) => {
1965
1907
  if (id && byId[id]) {
1966
- accu.push(__spreadValues(__spreadValues({}, defaultObject), byId[id]));
1908
+ accu.push({ ...defaultObject, ...byId[id] });
1967
1909
  }
1968
1910
  return accu;
1969
1911
  }, []);
1970
1912
  };
1971
- var mergePermissions = (existingPermissions = __spreadValues({}, emptyUiPermissions), addedPermissions) => Object.entries(existingPermissions).reduce(
1913
+ var mergePermissions = (existingPermissions = { ...emptyUiPermissions }, addedPermissions) => Object.entries(existingPermissions).reduce(
1972
1914
  (accu, [key, value]) => {
1973
1915
  let values;
1974
1916
  if (!accu[key]) {
@@ -1978,12 +1920,12 @@ var mergePermissions = (existingPermissions = __spreadValues({}, emptyUiPermissi
1978
1920
  if (Array.isArray(value)) {
1979
1921
  values = [...value, ...accu[key]].filter(import_helpers3.duplicateFilter);
1980
1922
  } else {
1981
- values = mergePermissions(accu[key], __spreadValues({}, value));
1923
+ values = mergePermissions(accu[key], { ...value });
1982
1924
  }
1983
1925
  accu[key] = values;
1984
1926
  return accu;
1985
1927
  },
1986
- __spreadValues({}, addedPermissions)
1928
+ { ...addedPermissions }
1987
1929
  );
1988
1930
  var mapUserRolesToUiPermissions = (userRoles, roles) => userRoles.reduce(
1989
1931
  (accu, roleId) => {
@@ -1992,20 +1934,17 @@ var mapUserRolesToUiPermissions = (userRoles, roles) => userRoles.reduce(
1992
1934
  }
1993
1935
  return mergePermissions(accu, roles[roleId].uiPermissions);
1994
1936
  },
1995
- __spreadValues({}, emptyUiPermissions)
1937
+ { ...emptyUiPermissions }
1996
1938
  );
1997
1939
  var progress = ({ loaded, total }) => {
1998
1940
  let uploadProgress4 = loaded / total * 100;
1999
1941
  return uploadProgress4 = uploadProgress4 < 50 ? Math.ceil(uploadProgress4) : Math.round(uploadProgress4);
2000
1942
  };
2001
- var extractErrorMessage = (err, fallback = "") => {
2002
- var _a, _b2, _c, _d, _e;
2003
- return ((_c = (_b2 = (_a = err.response) == null ? void 0 : _a.data) == null ? void 0 : _b2.error) == null ? void 0 : _c.message) || ((_e = (_d = err.response) == null ? void 0 : _d.data) == null ? void 0 : _e.error) || err.error || err.message || fallback;
2004
- };
1943
+ var extractErrorMessage = (err, fallback = "") => err.response?.data?.error?.message || err.response?.data?.error || err.error || err.message || fallback;
2005
1944
  var preformatWithRequestID = (res, failMsg) => {
2006
1945
  if (failMsg.length > 100) failMsg = `${failMsg.substring(0, 220)}...`;
2007
1946
  try {
2008
- if ((res == null ? void 0 : res.data) && Object.keys(res.data).includes("request_id")) {
1947
+ if (res?.data && Object.keys(res.data).includes("request_id")) {
2009
1948
  let shortRequestUUID = res.data["request_id"].substring(0, 8);
2010
1949
  return `${failMsg} [Request ID: ${shortRequestUUID}]`;
2011
1950
  }
@@ -2020,9 +1959,10 @@ var mapDeviceAttributes = (attributes = []) => attributes.reduce(
2020
1959
  if (!(attribute.value && attribute.name) && attribute.scope === ATTRIBUTE_SCOPES.inventory) {
2021
1960
  return accu;
2022
1961
  }
2023
- accu[attribute.scope || ATTRIBUTE_SCOPES.inventory] = __spreadProps(__spreadValues({}, accu[attribute.scope || ATTRIBUTE_SCOPES.inventory]), {
1962
+ accu[attribute.scope || ATTRIBUTE_SCOPES.inventory] = {
1963
+ ...accu[attribute.scope || ATTRIBUTE_SCOPES.inventory],
2024
1964
  [attribute.name]: attribute.value
2025
- });
1965
+ };
2026
1966
  if (attribute.name === "device_type" && attribute.scope === ATTRIBUTE_SCOPES.inventory) {
2027
1967
  accu.inventory.device_type = [].concat(attribute.value);
2028
1968
  }
@@ -2041,15 +1981,12 @@ var getReleaseListState = (state) => state.releases.releasesList;
2041
1981
  var getListedReleases = (state) => state.releases.releasesList.releaseIds;
2042
1982
  var getReleaseMappingDefaults = () => ({});
2043
1983
  var getReleasesList = (0, import_toolkit5.createSelector)([getReleasesById, getListedReleases, getReleaseMappingDefaults], listItemMapper);
2044
- var getReleaseTagsById = (0, import_toolkit5.createSelector)([getReleaseTags], (releaseTags) => releaseTags.reduce((accu, key) => __spreadProps(__spreadValues({}, accu), { [key]: key }), {}));
1984
+ var getReleaseTagsById = (0, import_toolkit5.createSelector)([getReleaseTags], (releaseTags) => releaseTags.reduce((accu, key) => ({ ...accu, [key]: key }), {}));
2045
1985
  var getHasReleases = (0, import_toolkit5.createSelector)(
2046
1986
  [getReleaseListState, getReleasesById],
2047
1987
  ({ searchTotal, total }, byId) => !!(Object.keys(byId).length || total || searchTotal)
2048
1988
  );
2049
- var getSelectedRelease = (0, import_toolkit5.createSelector)([getReleasesById, getSelectedReleaseId], (byId, id) => {
2050
- var _a;
2051
- return (_a = byId[id]) != null ? _a : {};
2052
- });
1989
+ var getSelectedRelease = (0, import_toolkit5.createSelector)([getReleasesById, getSelectedReleaseId], (byId, id) => byId[id] ?? {});
2053
1990
 
2054
1991
  // src/usersSlice/selectors.ts
2055
1992
  var import_toolkit6 = require("@reduxjs/toolkit");
@@ -2058,10 +1995,7 @@ var getTooltipsById = (state) => state.users.tooltips.byId;
2058
1995
  var getGlobalSettings = (state) => state.users.globalSettings;
2059
1996
  var getCurrentUserId = (state) => state.users.currentUser;
2060
1997
  var getUsersById = (state) => state.users.byId;
2061
- var getCurrentUser = (0, import_toolkit6.createSelector)([getUsersById, getCurrentUserId], (usersById, userId) => {
2062
- var _a;
2063
- return (_a = usersById[userId]) != null ? _a : {};
2064
- });
1998
+ var getCurrentUser = (0, import_toolkit6.createSelector)([getUsersById, getCurrentUserId], (usersById, userId) => usersById[userId] ?? {});
2065
1999
  var getUserSettings = (state) => state.users.userSettings;
2066
2000
  var getIsDarkMode = (0, import_toolkit6.createSelector)([getUserSettings], ({ mode }) => isDarkMode(mode));
2067
2001
  var getShowHelptips = (0, import_toolkit6.createSelector)(
@@ -2072,22 +2006,22 @@ var getTooltipsState = (0, import_toolkit6.createSelector)(
2072
2006
  [getTooltipsById, getUserSettings],
2073
2007
  (byId, { tooltips = {} }) => Object.entries(byId).reduce(
2074
2008
  (accu, [id, value]) => {
2075
- accu[id] = __spreadValues(__spreadValues({}, accu[id]), value);
2009
+ accu[id] = { ...accu[id], ...value };
2076
2010
  return accu;
2077
2011
  },
2078
- __spreadValues({}, tooltips)
2012
+ { ...tooltips }
2079
2013
  )
2080
2014
  );
2081
2015
  var getHas2FA = (0, import_toolkit6.createSelector)(
2082
2016
  [getCurrentUser],
2083
2017
  (currentUser) => currentUser.hasOwnProperty("tfa_status") && currentUser.tfa_status === twoFAStates.enabled
2084
2018
  );
2085
- var getIdAttribute = (0, import_toolkit6.createSelector)([getGlobalSettings], ({ id_attribute = __spreadValues({}, defaultIdAttribute) }) => id_attribute);
2019
+ var getIdAttribute = (0, import_toolkit6.createSelector)([getGlobalSettings], ({ id_attribute = { ...defaultIdAttribute } }) => id_attribute);
2086
2020
  var getOfflineThresholdSettings = (0, import_toolkit6.createSelector)([getGlobalSettings], ({ offlineThreshold }) => ({
2087
- interval: (offlineThreshold == null ? void 0 : offlineThreshold.interval) || DEVICE_ONLINE_CUTOFF.interval,
2088
- intervalUnit: (offlineThreshold == null ? void 0 : offlineThreshold.intervalUnit) || DEVICE_ONLINE_CUTOFF.intervalName
2021
+ interval: offlineThreshold?.interval || DEVICE_ONLINE_CUTOFF.interval,
2022
+ intervalUnit: offlineThreshold?.intervalUnit || DEVICE_ONLINE_CUTOFF.intervalName
2089
2023
  }));
2090
- var getRolesList = (0, import_toolkit6.createSelector)([getRolesById], (rolesById2) => Object.entries(rolesById2).map(([id, role]) => __spreadValues({ id }, role)));
2024
+ var getRolesList = (0, import_toolkit6.createSelector)([getRolesById], (rolesById2) => Object.entries(rolesById2).map(([id, role]) => ({ id, ...role })));
2091
2025
  var getCurrentSession = (state) => state.users.currentSession;
2092
2026
 
2093
2027
  // src/commonSelectors.ts
@@ -2106,8 +2040,7 @@ var getSearchEndpoint = (0, import_toolkit7.createSelector)(
2106
2040
  var getUserRoles = (0, import_toolkit7.createSelector)(
2107
2041
  [getCurrentUser, getRolesById, getIsEnterprise, getFeatures, getOrganization],
2108
2042
  (currentUser, rolesById2, isEnterprise, { isHosted, hasMultitenancy }, { plan = PLANS.os.id }) => {
2109
- var _a;
2110
- const isAdmin = ((_a = currentUser.roles) == null ? void 0 : _a.length) ? currentUser.roles.some((role) => role === rolesByName.admin) : !(hasMultitenancy || isEnterprise || isHosted && plan !== PLANS.os.id);
2043
+ const isAdmin = currentUser.roles?.length ? currentUser.roles.some((role) => role === rolesByName.admin) : !(hasMultitenancy || isEnterprise || isHosted && plan !== PLANS.os.id);
2111
2044
  const uiPermissions = isAdmin ? mapUserRolesToUiPermissions([rolesByName.admin], rolesById2) : mapUserRolesToUiPermissions(currentUser.roles || [], rolesById2);
2112
2045
  return { isAdmin, uiPermissions };
2113
2046
  }
@@ -2176,10 +2109,11 @@ var getFilterAttributes = (0, import_toolkit7.createSelector)(
2176
2109
  const deviceNameAttribute = { key: "name", value: "Name", scope: ATTRIBUTE_SCOPES.tags, category: ATTRIBUTE_SCOPES.tags, priority: 1 };
2177
2110
  const deviceIdAttribute = { key: "id", value: "Device ID", scope: ATTRIBUTE_SCOPES.identity, category: ATTRIBUTE_SCOPES.identity, priority: 1 };
2178
2111
  const checkInAttribute = { key: "check_in_time", value: "Latest activity", scope: ATTRIBUTE_SCOPES.system, category: ATTRIBUTE_SCOPES.system, priority: 4 };
2179
- const updateAttribute = __spreadProps(__spreadValues({}, checkInAttribute), { key: "updated_ts", value: "Last inventory update" });
2112
+ const updateAttribute = { ...checkInAttribute, key: "updated_ts", value: "Last inventory update" };
2180
2113
  const firstRequestAttribute = { key: "created_ts", value: "First request", scope: ATTRIBUTE_SCOPES.system, category: ATTRIBUTE_SCOPES.system, priority: 4 };
2181
2114
  const attributes = [
2182
- ...previousFilters.map((item) => __spreadProps(__spreadValues({}, item), {
2115
+ ...previousFilters.map((item) => ({
2116
+ ...item,
2183
2117
  value: deviceIdAttribute.key === item.key ? deviceIdAttribute.value : item.key,
2184
2118
  category: "recently used",
2185
2119
  priority: 0
@@ -2197,14 +2131,13 @@ var getFilterAttributes = (0, import_toolkit7.createSelector)(
2197
2131
  return (0, import_helpers4.attributeDuplicateFilter)(attributes, "key");
2198
2132
  }
2199
2133
  );
2200
- var getOnboardingState = (0, import_toolkit7.createSelector)([getOnboarding, getUserSettings], (_a, { onboarding = {} }) => {
2201
- var _b2 = _a, { complete, progress: progress2, showTips } = _b2, remainder = __objRest(_b2, ["complete", "progress", "showTips"]);
2202
- return __spreadProps(__spreadValues(__spreadValues({}, remainder), onboarding), {
2203
- complete: onboarding.complete || complete,
2204
- progress: Object.keys(onboardingSteps).findIndex((step) => step === progress2) > Object.keys(onboardingSteps).findIndex((step) => step === onboarding.progress) ? progress2 : onboarding.progress,
2205
- showTips: !onboarding.showTips ? onboarding.showTips : showTips
2206
- });
2207
- });
2134
+ var getOnboardingState = (0, import_toolkit7.createSelector)([getOnboarding, getUserSettings], ({ complete, progress: progress2, showTips, ...remainder }, { onboarding = {} }) => ({
2135
+ ...remainder,
2136
+ ...onboarding,
2137
+ complete: onboarding.complete || complete,
2138
+ progress: Object.keys(onboardingSteps).findIndex((step) => step === progress2) > Object.keys(onboardingSteps).findIndex((step) => step === onboarding.progress) ? progress2 : onboarding.progress,
2139
+ showTips: !onboarding.showTips ? onboarding.showTips : showTips
2140
+ }));
2208
2141
  var getDemoDeviceAddress = (0, import_toolkit7.createSelector)([getDevicesById, getOnboarding], (devicesById, { approach, demoArtifactPort }) => {
2209
2142
  const demoDeviceAddress = `http://${(0, import_helpers4.getDemoDeviceAddress)(Object.values(devicesById), approach)}`;
2210
2143
  return demoArtifactPort ? `${demoDeviceAddress}:${demoArtifactPort}` : demoDeviceAddress;
@@ -2225,12 +2158,11 @@ var getDeploymentRelease = (0, import_toolkit7.createSelector)(
2225
2158
  var getSelectedDeploymentData = (0, import_toolkit7.createSelector)(
2226
2159
  [getDeploymentsById, getDeploymentsSelectionState, getDevicesById, getSelectedDeploymentDeviceIds],
2227
2160
  (deploymentsById, { selectedId }, devicesById, selectedDeviceIds) => {
2228
- var _a;
2229
- const deployment = (_a = deploymentsById[selectedId]) != null ? _a : {};
2161
+ const deployment = deploymentsById[selectedId] ?? {};
2230
2162
  const { devices = {} } = deployment;
2231
2163
  return {
2232
2164
  deployment,
2233
- selectedDevices: selectedDeviceIds.map((deviceId) => __spreadValues(__spreadValues({}, devicesById[deviceId]), devices[deviceId]))
2165
+ selectedDevices: selectedDeviceIds.map((deviceId) => ({ ...devicesById[deviceId], ...devices[deviceId] }))
2234
2166
  };
2235
2167
  }
2236
2168
  );
@@ -2245,8 +2177,7 @@ var getAvailableIssueOptionsByType = (0, import_toolkit7.createSelector)(
2245
2177
  }, {})
2246
2178
  );
2247
2179
  var getGroupNames = (0, import_toolkit7.createSelector)([getGroupsById, getUserRoles, (_, options = {}) => options], (groupsById, { uiPermissions }, { staticOnly }) => {
2248
- var _a;
2249
- const _b2 = groupsById, { [_a = UNGROUPED_GROUP.id]: ungrouped } = _b2, groups = __objRest(_b2, [__restKey(_a)]);
2180
+ const { [UNGROUPED_GROUP.id]: ungrouped, ...groups } = groupsById;
2250
2181
  if (staticOnly) {
2251
2182
  return Object.keys(uiPermissions.groups).sort();
2252
2183
  }
@@ -2280,9 +2211,9 @@ var getAuditlogDevice = (0, import_toolkit7.createSelector)([getAuditLogEntry, g
2280
2211
  if (auditlogEvent) {
2281
2212
  const { object = {} } = auditlogEvent;
2282
2213
  const { device = {}, id, type } = object;
2283
- auditlogDevice = type === "device" ? __spreadValues({ id }, device) : auditlogDevice;
2214
+ auditlogDevice = type === "device" ? { id, ...device } : auditlogDevice;
2284
2215
  }
2285
- return __spreadValues(__spreadValues({}, auditlogDevice), devicesById[auditlogDevice.id]);
2216
+ return { ...auditlogDevice, ...devicesById[auditlogDevice.id] };
2286
2217
  });
2287
2218
  var getRelevantRoles = (0, import_toolkit7.createSelector)([getOrganization, getRolesList], ({ service_provider }, roles) => {
2288
2219
  if (service_provider) {
@@ -2381,7 +2312,10 @@ var appSlice = (0, import_toolkit8.createSlice)({
2381
2312
  initialState,
2382
2313
  reducers: {
2383
2314
  setFeatures: (state, action) => {
2384
- state.features = __spreadValues(__spreadValues({}, state.features), action.payload);
2315
+ state.features = {
2316
+ ...state.features,
2317
+ ...action.payload
2318
+ };
2385
2319
  },
2386
2320
  setSnackbar: (state, { payload }) => {
2387
2321
  let { message, autoHideDuration, action, children, onClick, onClose } = payload;
@@ -2406,7 +2340,10 @@ var appSlice = (0, import_toolkit8.createSlice)({
2406
2340
  state.hostedAnnouncement = action.payload;
2407
2341
  },
2408
2342
  setSearchState: (state, action) => {
2409
- state.searchState = __spreadValues(__spreadValues({}, state.searchState), action.payload);
2343
+ state.searchState = {
2344
+ ...state.searchState,
2345
+ ...action.payload
2346
+ };
2410
2347
  },
2411
2348
  setOfflineThreshold: (state, action) => {
2412
2349
  state.offlineThreshold = action.payload;
@@ -2417,20 +2354,23 @@ var appSlice = (0, import_toolkit8.createSlice)({
2417
2354
  },
2418
2355
  uploadProgress: (state, action) => {
2419
2356
  const { id, progress: progress2 } = action.payload;
2420
- state.uploadsById[id] = __spreadProps(__spreadValues({}, state.uploadsById[id]), {
2357
+ state.uploadsById[id] = {
2358
+ ...state.uploadsById[id],
2421
2359
  progress: progress2
2422
- });
2360
+ };
2423
2361
  },
2424
2362
  cleanUpUpload: (state, action) => {
2425
- var _a;
2426
- const _b2 = state.uploadsById, { [_a = action.payload]: current } = _b2, remainder = __objRest(_b2, [__restKey(_a)]);
2363
+ const { [action.payload]: current, ...remainder } = state.uploadsById;
2427
2364
  state.uploadsById = remainder;
2428
2365
  },
2429
2366
  setVersionInformation: (state, action) => {
2430
- state.versionInformation = __spreadValues(__spreadValues({}, state.versionInformation), action.payload);
2367
+ state.versionInformation = {
2368
+ ...state.versionInformation,
2369
+ ...action.payload
2370
+ };
2431
2371
  },
2432
2372
  setEnvironmentData: (state, action) => {
2433
- return __spreadValues(__spreadValues({}, state), action.payload);
2373
+ return { ...state, ...action.payload };
2434
2374
  }
2435
2375
  }
2436
2376
  });
@@ -2448,17 +2388,16 @@ var dateFunctionMap = {
2448
2388
  setDays: "setDate"
2449
2389
  };
2450
2390
  var setOfflineThreshold = (0, import_toolkit9.createAsyncThunk)(`${sliceName}/setOfflineThreshold`, (_, { dispatch, getState }) => {
2451
- var _a, _b2;
2452
2391
  const { interval, intervalUnit } = getOfflineThresholdSettings(getState());
2453
2392
  const today = /* @__PURE__ */ new Date();
2454
2393
  const intervalName = `${intervalUnit.charAt(0).toUpperCase()}${intervalUnit.substring(1)}`;
2455
- const setter = (_a = dateFunctionMap[`set${intervalName}`]) != null ? _a : `set${intervalName}`;
2456
- const getter = (_b2 = dateFunctionMap[`get${intervalName}`]) != null ? _b2 : `get${intervalName}`;
2394
+ const setter = dateFunctionMap[`set${intervalName}`] ?? `set${intervalName}`;
2395
+ const getter = dateFunctionMap[`get${intervalName}`] ?? `get${intervalName}`;
2457
2396
  today[setter](today[getter]() - interval);
2458
2397
  let value;
2459
2398
  try {
2460
2399
  value = today.toISOString();
2461
- } catch (e) {
2400
+ } catch {
2462
2401
  return Promise.resolve(dispatch(actions.setSnackbar("There was an error saving the offline threshold, please check your settings.")));
2463
2402
  }
2464
2403
  return Promise.resolve(dispatch(actions.setOfflineThreshold(value)));
@@ -2499,37 +2438,43 @@ var getLatestReleaseInfo = (0, import_toolkit9.createAsyncThunk)(`${sliceName}/g
2499
2438
  accu.latestRepos[item.name] = getComparisonCompatibleVersion(item.version);
2500
2439
  return accu;
2501
2440
  },
2502
- { latestVersions: __spreadValues({}, getState().app.versionInformation), latestRepos: {} }
2441
+ { latestVersions: { ...getState().app.versionInformation }, latestRepos: {} }
2503
2442
  );
2504
2443
  const info = deductSaasState(latestRelease, guiTags, saas);
2505
2444
  return Promise.resolve(
2506
2445
  dispatch(
2507
- actions.setVersionInformation(__spreadProps(__spreadValues({}, latestVersions), {
2446
+ actions.setVersionInformation({
2447
+ ...latestVersions,
2508
2448
  backend: info,
2509
2449
  GUI: info,
2510
2450
  latestRelease: {
2511
2451
  releaseDate: latestRelease.release_date,
2512
2452
  repos: latestRepos
2513
2453
  }
2514
- }))
2454
+ })
2515
2455
  )
2516
2456
  );
2517
2457
  });
2518
2458
  });
2519
2459
  var setSearchState = (0, import_toolkit9.createAsyncThunk)(`${sliceName}/setSearchState`, (searchState, { dispatch, getState }) => {
2520
2460
  const currentState = getSearchState(getState());
2521
- let nextState = __spreadProps(__spreadValues(__spreadValues({}, currentState), searchState), {
2522
- sort: __spreadValues(__spreadValues({}, currentState.sort), searchState.sort)
2523
- });
2461
+ let nextState = {
2462
+ ...currentState,
2463
+ ...searchState,
2464
+ sort: {
2465
+ ...currentState.sort,
2466
+ ...searchState.sort
2467
+ }
2468
+ };
2524
2469
  let tasks = [];
2525
- const _a = currentState, { isSearching: currentSearching, deviceIds: currentDevices, searchTotal: currentTotal } = _a, currentRequestState = __objRest(_a, ["isSearching", "deviceIds", "searchTotal"]);
2526
- const _b2 = nextState, { isSearching: nextSearching, deviceIds: nextDevices, searchTotal: nextTotal } = _b2, nextRequestState = __objRest(_b2, ["isSearching", "deviceIds", "searchTotal"]);
2470
+ const { isSearching: currentSearching, deviceIds: currentDevices, searchTotal: currentTotal, ...currentRequestState } = currentState;
2471
+ const { isSearching: nextSearching, deviceIds: nextDevices, searchTotal: nextTotal, ...nextRequestState } = nextState;
2527
2472
  if (nextRequestState.searchTerm && !(0, import_helpers5.deepCompare)(currentRequestState, nextRequestState)) {
2528
2473
  nextState.isSearching = true;
2529
2474
  tasks.push(
2530
2475
  dispatch(searchDevices(nextState)).unwrap().then((results) => {
2531
2476
  const searchResult = results[results.length - 1];
2532
- return dispatch(actions.setSearchState(__spreadProps(__spreadValues({}, searchResult), { isSearching: false })));
2477
+ return dispatch(actions.setSearchState({ ...searchResult, isSearching: false }));
2533
2478
  }).catch(() => dispatch(actions.setSearchState({ isSearching: false, searchTotal: 0 })))
2534
2479
  );
2535
2480
  }
@@ -2562,7 +2507,7 @@ var initialState2 = {
2562
2507
  sourceWindow: -1
2563
2508
  },
2564
2509
  binaryDeltaLimits: {
2565
- timeout: __spreadProps(__spreadValues({}, limitDefault), { default: 60, max: 3600, min: 60 }),
2510
+ timeout: { ...limitDefault, default: 60, max: 3600, min: 60 },
2566
2511
  sourceWindow: limitDefault,
2567
2512
  inputWindow: limitDefault,
2568
2513
  duplicatesWindow: limitDefault,
@@ -2572,10 +2517,10 @@ var initialState2 = {
2572
2517
  deploymentDeviceLimit: 5e3,
2573
2518
  selectedDeviceIds: [],
2574
2519
  selectionState: {
2575
- finished: __spreadProps(__spreadValues({}, DEVICE_LIST_DEFAULTS), { endDate: void 0, search: "", selection: [], startDate: void 0, total: 0, type: "" }),
2576
- inprogress: __spreadProps(__spreadValues({}, DEVICE_LIST_DEFAULTS), { perPage: DEFAULT_PENDING_INPROGRESS_COUNT, selection: [] }),
2577
- pending: __spreadProps(__spreadValues({}, DEVICE_LIST_DEFAULTS), { perPage: DEFAULT_PENDING_INPROGRESS_COUNT, selection: [] }),
2578
- scheduled: __spreadProps(__spreadValues({}, DEVICE_LIST_DEFAULTS), { selection: [] }),
2520
+ finished: { ...DEVICE_LIST_DEFAULTS, endDate: void 0, search: "", selection: [], startDate: void 0, total: 0, type: "" },
2521
+ inprogress: { ...DEVICE_LIST_DEFAULTS, perPage: DEFAULT_PENDING_INPROGRESS_COUNT, selection: [] },
2522
+ pending: { ...DEVICE_LIST_DEFAULTS, perPage: DEFAULT_PENDING_INPROGRESS_COUNT, selection: [] },
2523
+ scheduled: { ...DEVICE_LIST_DEFAULTS, selection: [] },
2579
2524
  general: {
2580
2525
  state: DEPLOYMENT_ROUTES.active.key,
2581
2526
  showCreationDialog: false,
@@ -2591,40 +2536,55 @@ var deploymentsSlice = (0, import_toolkit10.createSlice)({
2591
2536
  initialState: initialState2,
2592
2537
  reducers: {
2593
2538
  createdDeployment: (state, action) => {
2594
- state.byId[action.payload.id] = __spreadValues(__spreadValues({}, deploymentPrototype), action.payload);
2539
+ state.byId[action.payload.id] = {
2540
+ ...deploymentPrototype,
2541
+ ...action.payload
2542
+ };
2595
2543
  state.byStatus[DEPLOYMENT_STATES.pending].total = state.byStatus[DEPLOYMENT_STATES.pending].total + 1;
2596
2544
  state.byStatus[DEPLOYMENT_STATES.pending].deploymentIds = [...state.byStatus.pending.deploymentIds, action.payload.id];
2597
2545
  state.selectionState[DEPLOYMENT_STATES.pending].selection = [action.payload.id, ...state.selectionState[DEPLOYMENT_STATES.pending].selection], state.selectionState[DEPLOYMENT_STATES.pending].total = state.selectionState[DEPLOYMENT_STATES.pending].total + 1;
2598
2546
  },
2599
2547
  removedDeployment: (state, action) => {
2600
- var _a;
2601
- const _b2 = state.byId, { [_a = action.payload]: removedDeployment } = _b2, remainder = __objRest(_b2, [__restKey(_a)]);
2548
+ const { [action.payload]: removedDeployment, ...remainder } = state.byId;
2602
2549
  state.byId = remainder;
2603
2550
  },
2604
2551
  receivedDeployment: (state, action) => {
2605
- state.byId[action.payload.id] = __spreadValues(__spreadValues({}, state.byId[action.payload.id] || {}), action.payload);
2552
+ state.byId[action.payload.id] = {
2553
+ ...state.byId[action.payload.id] || {},
2554
+ ...action.payload
2555
+ };
2606
2556
  },
2607
2557
  receivedDeploymentDeviceLog: (state, action) => {
2608
2558
  const { id, deviceId, log } = action.payload;
2609
- const deployment = __spreadValues(__spreadValues({}, deploymentPrototype), state.byId[id]);
2610
- state.byId[id] = __spreadProps(__spreadValues({}, deployment), {
2611
- devices: __spreadProps(__spreadValues({}, deployment.devices), {
2612
- [deviceId]: __spreadProps(__spreadValues({}, deployment.devices[deviceId]), {
2559
+ const deployment = {
2560
+ ...deploymentPrototype,
2561
+ ...state.byId[id]
2562
+ };
2563
+ state.byId[id] = {
2564
+ ...deployment,
2565
+ devices: {
2566
+ ...deployment.devices,
2567
+ [deviceId]: {
2568
+ ...deployment.devices[deviceId],
2613
2569
  log
2614
- })
2615
- })
2616
- });
2570
+ }
2571
+ }
2572
+ };
2617
2573
  },
2618
2574
  receivedDeploymentDevices: (state, action) => {
2619
2575
  const { id, devices, selectedDeviceIds, totalDeviceCount } = action.payload;
2620
- state.byId[id] = __spreadProps(__spreadValues({}, state.byId[id]), {
2576
+ state.byId[id] = {
2577
+ ...state.byId[id],
2621
2578
  devices,
2622
2579
  totalDeviceCount
2623
- });
2580
+ };
2624
2581
  state.selectedDeviceIds = selectedDeviceIds;
2625
2582
  },
2626
2583
  receivedDeployments: (state, action) => {
2627
- state.byId = __spreadValues(__spreadValues({}, state.byId), action.payload);
2584
+ state.byId = {
2585
+ ...state.byId,
2586
+ ...action.payload
2587
+ };
2628
2588
  },
2629
2589
  receivedDeploymentsForStatus: (state, action) => {
2630
2590
  const { status, deploymentIds, total } = action.payload;
@@ -2666,9 +2626,9 @@ var initialState3 = {
2666
2626
  [DEVICE_STATES.preauth]: { deviceIds: [], total: 0 },
2667
2627
  [DEVICE_STATES.rejected]: { deviceIds: [], total: 0 }
2668
2628
  },
2669
- deviceList: __spreadProps(__spreadValues({
2670
- deviceIds: []
2671
- }, DEVICE_LIST_DEFAULTS), {
2629
+ deviceList: {
2630
+ deviceIds: [],
2631
+ ...DEVICE_LIST_DEFAULTS,
2672
2632
  selectedAttributes: [],
2673
2633
  selectedIssues: [],
2674
2634
  selection: [],
@@ -2679,7 +2639,7 @@ var initialState3 = {
2679
2639
  },
2680
2640
  state: DEVICE_STATES.accepted,
2681
2641
  total: 0
2682
- }),
2642
+ },
2683
2643
  filters: [
2684
2644
  // { key: 'device_type', value: 'raspberry', operator: '$eq', scope: 'inventory' }
2685
2645
  ],
@@ -2714,49 +2674,59 @@ var devicesSlice = (0, import_toolkit11.createSlice)({
2714
2674
  },
2715
2675
  addToGroup: (state, action) => {
2716
2676
  const { group, deviceIds } = action.payload;
2717
- const maybeExistingGroup = __spreadValues({
2677
+ const maybeExistingGroup = {
2718
2678
  filters: [],
2719
- deviceIds: []
2720
- }, state.groups.byId[group]);
2721
- state.groups.byId[group] = __spreadProps(__spreadValues({}, maybeExistingGroup), {
2679
+ deviceIds: [],
2680
+ ...state.groups.byId[group]
2681
+ };
2682
+ state.groups.byId[group] = {
2683
+ ...maybeExistingGroup,
2722
2684
  deviceIds: [...maybeExistingGroup.deviceIds, ...deviceIds].filter(import_helpers6.duplicateFilter),
2723
2685
  total: (maybeExistingGroup.total || 0) + 1
2724
- });
2686
+ };
2725
2687
  },
2726
2688
  removeFromGroup: (state, action) => {
2727
2689
  const { group, deviceIds: removedIds } = action.payload;
2728
- const _a = state.groups.byId[group] || {}, { deviceIds = [], total = 0 } = _a, maybeExistingGroup = __objRest(_a, ["deviceIds", "total"]);
2729
- const changedGroup = __spreadProps(__spreadValues({}, maybeExistingGroup), {
2690
+ const { deviceIds = [], total = 0, ...maybeExistingGroup } = state.groups.byId[group] || {};
2691
+ const changedGroup = {
2692
+ ...maybeExistingGroup,
2730
2693
  deviceIds: deviceIds.filter((id) => !removedIds.includes(id)),
2731
2694
  total: Math.max(total - removedIds.length, 0)
2732
- });
2695
+ };
2733
2696
  if (changedGroup.total || changedGroup.deviceIds.length) {
2734
2697
  state.groups.byId[group] = changedGroup;
2735
2698
  return;
2736
2699
  } else if (state.groups.selectedGroup === group) {
2737
2700
  state.groups.selectedGroup = void 0;
2738
2701
  }
2739
- const _b2 = state.groups.byId, { [group]: removal } = _b2, remainingById = __objRest(_b2, [__restKey(group)]);
2702
+ const { [group]: removal, ...remainingById } = state.groups.byId;
2740
2703
  state.groups.byId = remainingById;
2741
2704
  },
2742
2705
  addGroup: (state, action) => {
2743
2706
  const { groupName, group } = action.payload;
2744
- state.groups.byId[groupName] = __spreadValues(__spreadValues({}, state.groups.byId[groupName]), group);
2707
+ state.groups.byId[groupName] = {
2708
+ ...state.groups.byId[groupName],
2709
+ ...group
2710
+ };
2745
2711
  },
2746
2712
  selectGroup: (state, { payload: group }) => {
2747
2713
  state.deviceList.deviceIds = state.groups.byId[group] && state.groups.byId[group].deviceIds.length > 0 ? state.groups.byId[group].deviceIds : [];
2748
2714
  state.groups.selectedGroup = group;
2749
2715
  },
2750
2716
  removeGroup: (state, action) => {
2751
- var _a;
2752
- const _b2 = state.groups.byId, { [_a = action.payload]: removal } = _b2, remainingById = __objRest(_b2, [__restKey(_a)]);
2717
+ const { [action.payload]: removal, ...remainingById } = state.groups.byId;
2753
2718
  state.groups.byId = remainingById;
2754
2719
  state.groups.selectedGroup = state.groups.selectedGroup === action.payload ? void 0 : state.groups.selectedGroup;
2755
2720
  },
2756
2721
  setDeviceListState: (state, action) => {
2757
- state.deviceList = __spreadProps(__spreadValues(__spreadValues({}, state.deviceList), action.payload), {
2758
- sort: __spreadValues(__spreadValues({}, state.deviceList.sort), action.payload.sort)
2759
- });
2722
+ state.deviceList = {
2723
+ ...state.deviceList,
2724
+ ...action.payload,
2725
+ sort: {
2726
+ ...state.deviceList.sort,
2727
+ ...action.payload.sort
2728
+ }
2729
+ };
2760
2730
  },
2761
2731
  setFilterAttributes: (state, action) => {
2762
2732
  state.filteringAttributes = action.payload;
@@ -2765,7 +2735,10 @@ var devicesSlice = (0, import_toolkit11.createSlice)({
2765
2735
  state.filteringAttributesConfig = action.payload;
2766
2736
  },
2767
2737
  receivedDevices: (state, action) => {
2768
- state.byId = __spreadValues(__spreadValues({}, state.byId), action.payload);
2738
+ state.byId = {
2739
+ ...state.byId,
2740
+ ...action.payload
2741
+ };
2769
2742
  },
2770
2743
  setDeviceFilters: (state, action) => {
2771
2744
  if ((0, import_helpers6.deepCompare)(action.payload, state.filters)) {
@@ -2796,7 +2769,10 @@ var devicesSlice = (0, import_toolkit11.createSlice)({
2796
2769
  state.limit = action.payload;
2797
2770
  },
2798
2771
  receivedDevice: (state, action) => {
2799
- state.byId[action.payload.id] = __spreadValues(__spreadValues({}, state.byId[action.payload.id]), action.payload);
2772
+ state.byId[action.payload.id] = {
2773
+ ...state.byId[action.payload.id],
2774
+ ...action.payload
2775
+ };
2800
2776
  },
2801
2777
  maybeUpdateDevicesByStatus: (state, action) => {
2802
2778
  const { deviceId, authId } = action.payload;
@@ -2817,15 +2793,17 @@ var import_toolkit12 = require("@reduxjs/toolkit");
2817
2793
  var sliceName4 = "monitor";
2818
2794
  var initialState4 = {
2819
2795
  alerts: {
2820
- alertList: __spreadProps(__spreadValues({}, DEVICE_LIST_DEFAULTS), { total: 0 }),
2796
+ alertList: { ...DEVICE_LIST_DEFAULTS, total: 0 },
2821
2797
  byDeviceId: {}
2822
2798
  },
2823
2799
  issueCounts: {
2824
- byType: Object.values(DEVICE_ISSUE_OPTIONS).reduce((accu, { key }) => __spreadProps(__spreadValues({}, accu), { [key]: { filtered: 0, total: 0 } }), {})
2800
+ byType: Object.values(DEVICE_ISSUE_OPTIONS).reduce((accu, { key }) => ({ ...accu, [key]: { filtered: 0, total: 0 } }), {})
2825
2801
  },
2826
2802
  settings: {
2827
2803
  global: {
2828
- channels: __spreadValues({}, Object.keys(alertChannels).reduce((accu, item) => __spreadProps(__spreadValues({}, accu), { [item]: { enabled: true } }), {}))
2804
+ channels: {
2805
+ ...Object.keys(alertChannels).reduce((accu, item) => ({ ...accu, [item]: { enabled: true } }), {})
2806
+ }
2829
2807
  }
2830
2808
  }
2831
2809
  };
@@ -2843,14 +2821,14 @@ var monitorSlice = (0, import_toolkit12.createSlice)({
2843
2821
  },
2844
2822
  receiveLatestDeviceAlerts: (state, action) => {
2845
2823
  const { deviceId, alerts } = action.payload;
2846
- state.alerts.byDeviceId[deviceId] = __spreadProps(__spreadValues({}, state.alerts.byDeviceId[deviceId]), { latest: alerts });
2824
+ state.alerts.byDeviceId[deviceId] = { ...state.alerts.byDeviceId[deviceId], latest: alerts };
2847
2825
  },
2848
2826
  receiveDeviceIssueCounts: (state, action) => {
2849
2827
  const { issueType, counts } = action.payload;
2850
2828
  state.issueCounts.byType[issueType] = counts;
2851
2829
  },
2852
2830
  setAlertListState: (state, action) => {
2853
- state.alerts.alertList = __spreadValues(__spreadValues({}, state.alerts.alertList), action.payload);
2831
+ state.alerts.alertList = { ...state.alerts.alertList, ...action.payload };
2854
2832
  }
2855
2833
  }
2856
2834
  });
@@ -2874,7 +2852,7 @@ var onboardingSlice = (0, import_toolkit13.createSlice)({
2874
2852
  initialState: initialState5,
2875
2853
  reducers: {
2876
2854
  setOnboardingState: (state, action) => {
2877
- return __spreadValues(__spreadValues({}, state), action.payload);
2855
+ return { ...state, ...action.payload };
2878
2856
  },
2879
2857
  setDemoArtifactPort: (state, action) => {
2880
2858
  state.demoArtifactPort = action.payload;
@@ -2912,7 +2890,8 @@ var initialState6 = {
2912
2890
  brand: ""
2913
2891
  },
2914
2892
  intentId: null,
2915
- tenantList: __spreadProps(__spreadValues({}, TENANT_LIST_DEFAULT), {
2893
+ tenantList: {
2894
+ ...TENANT_LIST_DEFAULT,
2916
2895
  total: 0,
2917
2896
  tenants: [],
2918
2897
  selectedTenant: null,
@@ -2920,13 +2899,14 @@ var initialState6 = {
2920
2899
  direction: SORTING_OPTIONS.desc,
2921
2900
  key: "name"
2922
2901
  }
2923
- }),
2902
+ },
2924
2903
  organization: {
2925
2904
  // id, name, status, tenant_token, plan
2926
2905
  },
2927
2906
  auditlog: {
2928
2907
  events: [],
2929
- selectionState: __spreadProps(__spreadValues({}, DEVICE_LIST_DEFAULTS), {
2908
+ selectionState: {
2909
+ ...DEVICE_LIST_DEFAULTS,
2930
2910
  detail: void 0,
2931
2911
  endDate: void 0,
2932
2912
  selectedIssue: void 0,
@@ -2935,7 +2915,7 @@ var initialState6 = {
2935
2915
  total: 0,
2936
2916
  type: void 0,
2937
2917
  user: void 0
2938
- })
2918
+ }
2939
2919
  },
2940
2920
  externalDeviceIntegrations: [
2941
2921
  // { <connection_string|x509|...>, id, provider }
@@ -2958,7 +2938,10 @@ var organizationSlice = (0, import_toolkit14.createSlice)({
2958
2938
  state.auditlog.selectionState.total = total;
2959
2939
  },
2960
2940
  setAuditLogState: (state, action) => {
2961
- state.auditlog.selectionState = __spreadValues(__spreadValues({}, state.auditlog.selectionState), action.payload);
2941
+ state.auditlog.selectionState = {
2942
+ ...state.auditlog.selectionState,
2943
+ ...action.payload
2944
+ };
2962
2945
  },
2963
2946
  receiveCurrentCard: (state, action) => {
2964
2947
  state.card = action.payload;
@@ -2967,7 +2950,7 @@ var organizationSlice = (0, import_toolkit14.createSlice)({
2967
2950
  state.intentId = action.payload;
2968
2951
  },
2969
2952
  setOrganization: (state, action) => {
2970
- state.organization = __spreadValues(__spreadValues({}, state.organization), action.payload);
2953
+ state.organization = { ...state.organization, ...action.payload };
2971
2954
  },
2972
2955
  setTenantListState: (state, action) => {
2973
2956
  state.tenantList = action.payload;
@@ -3030,7 +3013,8 @@ var initialState7 = {
3030
3013
  }
3031
3014
  */
3032
3015
  },
3033
- releasesList: __spreadProps(__spreadValues({}, DEVICE_LIST_DEFAULTS), {
3016
+ releasesList: {
3017
+ ...DEVICE_LIST_DEFAULTS,
3034
3018
  searchedIds: [],
3035
3019
  releaseIds: [],
3036
3020
  selection: [],
@@ -3044,7 +3028,7 @@ var initialState7 = {
3044
3028
  selectedTags: [],
3045
3029
  total: 0,
3046
3030
  type: ""
3047
- }),
3031
+ },
3048
3032
  tags: [],
3049
3033
  updateTypes: [],
3050
3034
  /*
@@ -3070,8 +3054,7 @@ var releaseSlice = (0, import_toolkit15.createSlice)({
3070
3054
  state.updateTypes = action.payload;
3071
3055
  },
3072
3056
  removeRelease: (state, action) => {
3073
- var _a;
3074
- const _b2 = state.byId, { [_a = action.payload]: toBeRemoved } = _b2, byId = __objRest(_b2, [__restKey(_a)]);
3057
+ const { [action.payload]: toBeRemoved, ...byId } = state.byId;
3075
3058
  state.byId = byId;
3076
3059
  state.selectedRelease = action.payload === state.selectedRelease ? null : state.selectedRelease;
3077
3060
  },
@@ -3104,8 +3087,12 @@ var initialState8 = {
3104
3087
  previousPhases: [],
3105
3088
  retries: 0
3106
3089
  },
3107
- permissionSetsById: __spreadValues({}, defaultPermissionSets),
3108
- rolesById: __spreadValues({}, rolesById),
3090
+ permissionSetsById: {
3091
+ ...defaultPermissionSets
3092
+ },
3093
+ rolesById: {
3094
+ ...rolesById
3095
+ },
3109
3096
  settingsInitialized: false,
3110
3097
  showConnectDeviceDialog: false,
3111
3098
  showFeedbackDialog: false,
@@ -3145,13 +3132,15 @@ var usersSlice = (0, import_toolkit16.createSlice)({
3145
3132
  state.byId[0] = action.payload;
3146
3133
  },
3147
3134
  removedUser: (state, action) => {
3148
- var _a;
3149
- const _b2 = state.byId, { [_a = action.payload]: removedUser } = _b2, byId = __objRest(_b2, [__restKey(_a)]);
3135
+ const { [action.payload]: removedUser, ...byId } = state.byId;
3150
3136
  state.byId = byId;
3151
3137
  state.currentUser = state.currentUser === action.payload ? null : state.currentUser;
3152
3138
  },
3153
3139
  updatedUser: (state, action) => {
3154
- state.byId[action.payload.id] = __spreadValues(__spreadValues({}, state.byId[action.payload.id]), action.payload);
3140
+ state.byId[action.payload.id] = {
3141
+ ...state.byId[action.payload.id],
3142
+ ...action.payload
3143
+ };
3155
3144
  },
3156
3145
  receivedPermissionSets: (state, action) => {
3157
3146
  state.permissionSetsById = action.payload;
@@ -3160,11 +3149,13 @@ var usersSlice = (0, import_toolkit16.createSlice)({
3160
3149
  state.rolesById = action.payload;
3161
3150
  },
3162
3151
  createdRole: (state, action) => {
3163
- state.rolesById[action.payload.name] = __spreadValues(__spreadValues({}, state.rolesById[action.payload.name]), action.payload);
3152
+ state.rolesById[action.payload.name] = {
3153
+ ...state.rolesById[action.payload.name],
3154
+ ...action.payload
3155
+ };
3164
3156
  },
3165
3157
  removedRole: (state, action) => {
3166
- var _a;
3167
- const _b2 = state.rolesById, { [_a = action.payload]: toBeRemoved } = _b2, rolesById2 = __objRest(_b2, [__restKey(_a)]);
3158
+ const { [action.payload]: toBeRemoved, ...rolesById2 } = state.rolesById;
3168
3159
  state.rolesById = rolesById2;
3169
3160
  },
3170
3161
  setCustomColumns: (state, action) => {
@@ -3172,18 +3163,27 @@ var usersSlice = (0, import_toolkit16.createSlice)({
3172
3163
  },
3173
3164
  setGlobalSettings: (state, action) => {
3174
3165
  state.settingsInitialized = true;
3175
- state.globalSettings = __spreadValues(__spreadValues({}, state.globalSettings), action.payload);
3166
+ state.globalSettings = {
3167
+ ...state.globalSettings,
3168
+ ...action.payload
3169
+ };
3176
3170
  },
3177
3171
  setUserSettings: (state, action) => {
3178
3172
  state.userSettingsInitialized = true;
3179
- state.userSettings = __spreadValues(__spreadValues({}, state.userSettings), action.payload);
3173
+ state.userSettings = {
3174
+ ...state.userSettings,
3175
+ ...action.payload
3176
+ };
3180
3177
  },
3181
3178
  setTooltipState: (state, action) => {
3182
3179
  const { id, readState = READ_STATES.read } = action.payload;
3183
3180
  state.tooltips.byId[id].readState = readState;
3184
3181
  },
3185
3182
  setTooltipsState: (state, action) => {
3186
- state.tooltips.byId = __spreadValues(__spreadValues({}, state.tooltips.byId), action.payload);
3183
+ state.tooltips.byId = {
3184
+ ...state.tooltips.byId,
3185
+ ...action.payload
3186
+ };
3187
3187
  },
3188
3188
  setShowFeedbackDialog: (state, action) => {
3189
3189
  state.showFeedbackDialog = action.payload;
@@ -3200,7 +3200,16 @@ var actions8 = usersSlice.actions;
3200
3200
  var usersSlice_default = usersSlice.reducer;
3201
3201
 
3202
3202
  // src/actions.ts
3203
- var actions_default = __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, actions), actions2), actions3), actions4), actions5), actions6), actions7), actions8);
3203
+ var actions_default = {
3204
+ ...actions,
3205
+ ...actions2,
3206
+ ...actions3,
3207
+ ...actions4,
3208
+ ...actions5,
3209
+ ...actions6,
3210
+ ...actions7,
3211
+ ...actions8
3212
+ };
3204
3213
 
3205
3214
  // src/store.ts
3206
3215
  var import_toolkit17 = require("@reduxjs/toolkit");
@@ -3235,8 +3244,9 @@ var sessionReducer = (state, action) => {
3235
3244
  return rootReducer(state, action);
3236
3245
  };
3237
3246
  var getConfiguredStore = (options = {}) => {
3238
- const _a = options, { preloadedState = {} } = _a, config = __objRest(_a, ["preloadedState"]);
3239
- return (0, import_toolkit17.configureStore)(__spreadProps(__spreadValues({}, config), {
3247
+ const { preloadedState = {}, ...config } = options;
3248
+ return (0, import_toolkit17.configureStore)({
3249
+ ...config,
3240
3250
  preloadedState,
3241
3251
  reducer: sessionReducer,
3242
3252
  middleware: (getDefaultMiddleware) => getDefaultMiddleware({
@@ -3249,7 +3259,7 @@ var getConfiguredStore = (options = {}) => {
3249
3259
  ignoredPaths: ["app.uploadsById", "app.snackbar", "organization.externalDeviceIntegrations"]
3250
3260
  }
3251
3261
  })
3252
- }));
3262
+ });
3253
3263
  };
3254
3264
  var store = getConfiguredStore({
3255
3265
  preloadedState: {}
@@ -3264,13 +3274,15 @@ var { page: defaultPage, perPage: defaultPerPage } = DEVICE_LIST_DEFAULTS;
3264
3274
  var deriveDeploymentGroup = ({ filter = {}, group, groups = [], name }) => group || groups.length === 1 && !(0, import_isUUID.default)(name) ? groups[0] : filter.name;
3265
3275
  var transformDeployments = (deployments, deploymentsById) => deployments.sort(import_helpers7.startTimeSort).reduce(
3266
3276
  (accu, item) => {
3267
- var _a, _b2;
3268
- const filter = (_a = item.filter) != null ? _a : {};
3269
- let deployment = __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, deploymentPrototype), deploymentsById[item.id]), item), {
3270
- filter: item.filter ? __spreadProps(__spreadValues({}, filter), { name: (_b2 = filter.name) != null ? _b2 : filter.id, filters: mapTermsToFilters(filter.terms) }) : void 0,
3277
+ const filter = item.filter ?? {};
3278
+ let deployment = {
3279
+ ...deploymentPrototype,
3280
+ ...deploymentsById[item.id],
3281
+ ...item,
3282
+ filter: item.filter ? { ...filter, name: filter.name ?? filter.id, filters: mapTermsToFilters(filter.terms) } : void 0,
3271
3283
  name: decodeURIComponent(item.name)
3272
- });
3273
- deployment = __spreadProps(__spreadValues({}, deployment), { group: deriveDeploymentGroup(deployment) });
3284
+ };
3285
+ deployment = { ...deployment, group: deriveDeploymentGroup(deployment) };
3274
3286
  accu.deployments[item.id] = deployment;
3275
3287
  accu.deploymentIds.push(item.id);
3276
3288
  return accu;
@@ -3324,11 +3336,12 @@ var createDeployment = (0, import_toolkit18.createAsyncThunk)(`${sliceName2}/cre
3324
3336
  return request.catch((err) => commonErrorHandler(err, "Error creating deployment.", dispatch)).then((data) => {
3325
3337
  const lastslashindex = data.headers.location.lastIndexOf("/");
3326
3338
  const deploymentId = data.headers.location.substring(lastslashindex + 1);
3327
- const deployment = __spreadProps(__spreadValues({}, newDeployment), {
3339
+ const deployment = {
3340
+ ...newDeployment,
3328
3341
  id: deploymentId,
3329
3342
  devices: newDeployment.devices ? newDeployment.devices.map((id) => ({ id, status: "pending" })) : [],
3330
3343
  statistics: { status: {} }
3331
- });
3344
+ };
3332
3345
  let tasks = [
3333
3346
  dispatch(actions2.createdDeployment(deployment)),
3334
3347
  dispatch(getSingleDeployment(deploymentId)),
@@ -3471,14 +3484,23 @@ var updateDeploymentControlMap = (0, import_toolkit18.createAsyncThunk)(
3471
3484
  ({ deploymentId, updateControlMap }, { dispatch }) => general_api_default.patch(`${deploymentsApiUrl}/deployments/${deploymentId}`, { update_control_map: updateControlMap }).catch((err) => commonErrorHandler(err, "There was an error while updating the deployment status:", dispatch)).then(() => Promise.resolve(dispatch(getSingleDeployment(deploymentId))))
3472
3485
  );
3473
3486
  var setDeploymentsState = (0, import_toolkit18.createAsyncThunk)(`${sliceName2}/setDeploymentsState`, (selection, { dispatch, getState }) => {
3474
- const _a = selection, { page, perPage } = _a, selectionState = __objRest(_a, ["page", "perPage"]);
3487
+ const { page, perPage, ...selectionState } = selection;
3475
3488
  const currentState = getState().deployments.selectionState;
3476
- let nextState = __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, currentState), selectionState), Object.keys(DEPLOYMENT_STATES).reduce((accu, item) => {
3477
- accu[item] = __spreadValues(__spreadValues({}, currentState[item]), selectionState[item]);
3478
- return accu;
3479
- }, {})), {
3480
- general: __spreadValues(__spreadValues({}, currentState.general), selectionState.general)
3481
- });
3489
+ let nextState = {
3490
+ ...currentState,
3491
+ ...selectionState,
3492
+ ...Object.keys(DEPLOYMENT_STATES).reduce((accu, item) => {
3493
+ accu[item] = {
3494
+ ...currentState[item],
3495
+ ...selectionState[item]
3496
+ };
3497
+ return accu;
3498
+ }, {}),
3499
+ general: {
3500
+ ...currentState.general,
3501
+ ...selectionState.general
3502
+ }
3503
+ };
3482
3504
  let tasks = [dispatch(actions2.setDeploymentsState(nextState))];
3483
3505
  if (nextState.selectedId && currentState.selectedId !== nextState.selectedId) {
3484
3506
  tasks.push(dispatch(getSingleDeployment(nextState.selectedId)));
@@ -3508,15 +3530,20 @@ var getDeploymentsConfig = (0, import_toolkit18.createAsyncThunk)(
3508
3530
  const { binary_delta = {}, binary_delta_limits = {} } = delta;
3509
3531
  const { xdelta_args = {}, timeout: timeoutConfig = oldConfig.binaryDelta.timeout } = binary_delta;
3510
3532
  const { xdelta_args_limits = {}, timeout: timeoutLimit = oldConfig.binaryDeltaLimits.timeout } = binary_delta_limits;
3511
- const config = __spreadProps(__spreadValues({}, oldConfig), {
3533
+ const config = {
3534
+ ...oldConfig,
3512
3535
  hasDelta: Boolean(delta.enabled),
3513
- binaryDelta: __spreadValues(__spreadProps(__spreadValues({}, oldConfig.binaryDelta), {
3514
- timeout: timeoutConfig
3515
- }), mapExternalDeltaConfig(xdelta_args)),
3516
- binaryDeltaLimits: __spreadValues(__spreadProps(__spreadValues({}, oldConfig.binaryDeltaLimits), {
3517
- timeout: timeoutLimit
3518
- }), mapExternalDeltaConfig(xdelta_args_limits))
3519
- });
3536
+ binaryDelta: {
3537
+ ...oldConfig.binaryDelta,
3538
+ timeout: timeoutConfig,
3539
+ ...mapExternalDeltaConfig(xdelta_args)
3540
+ },
3541
+ binaryDeltaLimits: {
3542
+ ...oldConfig.binaryDeltaLimits,
3543
+ timeout: timeoutLimit,
3544
+ ...mapExternalDeltaConfig(xdelta_args_limits)
3545
+ }
3546
+ };
3520
3547
  return Promise.resolve(dispatch(actions2.setDeploymentsConfig(config)));
3521
3548
  })
3522
3549
  );
@@ -3526,7 +3553,7 @@ var deepClean = (source) => Object.entries(source).reduce((accu, [key, value]) =
3526
3553
  if (cleanedValue === void 0 || typeof cleanedValue === "object" && (0, import_helpers7.isEmpty)(cleanedValue)) {
3527
3554
  return accu;
3528
3555
  }
3529
- accu = __spreadProps(__spreadValues({}, accu != null ? accu : {}), { [key]: cleanedValue });
3556
+ accu = { ...accu ?? {}, [key]: cleanedValue };
3530
3557
  }
3531
3558
  return accu;
3532
3559
  }, void 0);
@@ -3546,9 +3573,13 @@ var saveDeltaDeploymentsConfig = (0, import_toolkit18.createAsyncThunk)(`${slice
3546
3573
  }
3547
3574
  return general_api_default.put(`${deploymentsApiUrl}/config/binary_delta`, result).catch((err) => commonErrorHandler(err, "There was a problem storing your delta artifact generation configuration.", dispatch)).then(() => {
3548
3575
  const oldConfig = getState().deployments.config;
3549
- const newConfig = __spreadProps(__spreadValues({}, oldConfig), {
3550
- binaryDelta: __spreadValues(__spreadValues({}, oldConfig.binaryDelta), config)
3551
- });
3576
+ const newConfig = {
3577
+ ...oldConfig,
3578
+ binaryDelta: {
3579
+ ...oldConfig.binaryDelta,
3580
+ ...config
3581
+ }
3582
+ };
3552
3583
  return Promise.all([dispatch(actions2.setDeploymentsConfig(newConfig)), dispatch(setSnackbar2("Settings saved successfully"))]);
3553
3584
  });
3554
3585
  });
@@ -3561,19 +3592,20 @@ var import_toolkit19 = require("@reduxjs/toolkit");
3561
3592
  var import_axios2 = require("axios");
3562
3593
  var import_pluralize = __toESM(require_pluralize());
3563
3594
 
3564
- // ../../node_modules/uuid/dist/esm-node/rng.js
3565
- var import_crypto = __toESM(require("crypto"));
3566
- var rnds8Pool = new Uint8Array(256);
3567
- var poolPtr = rnds8Pool.length;
3595
+ // ../../node_modules/uuid/dist/esm-browser/rng.js
3596
+ var getRandomValues;
3597
+ var rnds8 = new Uint8Array(16);
3568
3598
  function rng() {
3569
- if (poolPtr > rnds8Pool.length - 16) {
3570
- import_crypto.default.randomFillSync(rnds8Pool);
3571
- poolPtr = 0;
3599
+ if (!getRandomValues) {
3600
+ getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
3601
+ if (!getRandomValues) {
3602
+ throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
3603
+ }
3572
3604
  }
3573
- return rnds8Pool.slice(poolPtr, poolPtr += 16);
3605
+ return getRandomValues(rnds8);
3574
3606
  }
3575
3607
 
3576
- // ../../node_modules/uuid/dist/esm-node/stringify.js
3608
+ // ../../node_modules/uuid/dist/esm-browser/stringify.js
3577
3609
  var byteToHex = [];
3578
3610
  for (let i = 0; i < 256; ++i) {
3579
3611
  byteToHex.push((i + 256).toString(16).slice(1));
@@ -3582,13 +3614,13 @@ function unsafeStringify(arr, offset = 0) {
3582
3614
  return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
3583
3615
  }
3584
3616
 
3585
- // ../../node_modules/uuid/dist/esm-node/native.js
3586
- var import_crypto2 = __toESM(require("crypto"));
3617
+ // ../../node_modules/uuid/dist/esm-browser/native.js
3618
+ var randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
3587
3619
  var native_default = {
3588
- randomUUID: import_crypto2.default.randomUUID
3620
+ randomUUID
3589
3621
  };
3590
3622
 
3591
- // ../../node_modules/uuid/dist/esm-node/v4.js
3623
+ // ../../node_modules/uuid/dist/esm-browser/v4.js
3592
3624
  function v4(options, buf, offset) {
3593
3625
  if (native_default.randomUUID && !buf && !options) {
3594
3626
  return native_default.randomUUID();
@@ -3630,14 +3662,13 @@ var getGroups2 = (0, import_toolkit19.createAsyncThunk)(
3630
3662
  (_, { dispatch, getState }) => general_api_default.get(`${inventoryApiUrl}/groups`).then((res) => {
3631
3663
  const state = getGroupsById(getState());
3632
3664
  const dynamicGroups = Object.entries(state).reduce((accu, [id, group]) => {
3633
- var _a;
3634
- if (group.id || ((_a = group.filters) == null ? void 0 : _a.length) && id !== UNGROUPED_GROUP.id) {
3665
+ if (group.id || group.filters?.length && id !== UNGROUPED_GROUP.id) {
3635
3666
  accu[id] = group;
3636
3667
  }
3637
3668
  return accu;
3638
3669
  }, {});
3639
3670
  const groups = res.data.reduce((accu, group) => {
3640
- accu[group] = __spreadValues({ deviceIds: [], filters: [], total: 0 }, state[group]);
3671
+ accu[group] = { deviceIds: [], filters: [], total: 0, ...state[group] };
3641
3672
  return accu;
3642
3673
  }, dynamicGroups);
3643
3674
  const filters = [{ key: "group", value: res.data, operator: DEVICE_FILTERING_OPTIONS.$nin.key, scope: "system" }];
@@ -3695,7 +3726,7 @@ var addStaticGroup = (0, import_toolkit19.createAsyncThunk)(
3695
3726
  () => Promise.resolve(
3696
3727
  dispatch(
3697
3728
  actions3.addGroup({
3698
- group: __spreadValues({ deviceIds: [], total: 0, filters: [] }, getState().devices.groups.byId[group]),
3729
+ group: { deviceIds: [], total: 0, filters: [], ...getState().devices.groups.byId[group] },
3699
3730
  groupName: group
3700
3731
  })
3701
3732
  )
@@ -3723,20 +3754,19 @@ var getDynamicGroups = (0, import_toolkit19.createAsyncThunk)(
3723
3754
  (_, { dispatch, getState }) => general_api_default.get(`${inventoryApiUrlV2}/filters?per_page=${MAX_PAGE_SIZE}`).then(({ data: filters }) => {
3724
3755
  const state = getGroupsById(getState());
3725
3756
  const staticGroups = Object.entries(state).reduce((accu, [id, group]) => {
3726
- var _a;
3727
- if (!(group.id || ((_a = group.filters) == null ? void 0 : _a.length))) {
3757
+ if (!(group.id || group.filters?.length)) {
3728
3758
  accu[id] = group;
3729
3759
  }
3730
3760
  return accu;
3731
3761
  }, {});
3732
3762
  const groups = (filters || []).reduce((accu, filter) => {
3733
- accu[filter.name] = __spreadProps(__spreadValues({
3763
+ accu[filter.name] = {
3734
3764
  deviceIds: [],
3735
- total: 0
3736
- }, state[filter.name]), {
3765
+ total: 0,
3766
+ ...state[filter.name],
3737
3767
  id: filter.id,
3738
3768
  filters: mapTermsToFilters(filter.terms)
3739
- });
3769
+ };
3740
3770
  return accu;
3741
3771
  }, staticGroups);
3742
3772
  return Promise.resolve(dispatch(actions3.receivedGroups(groups)));
@@ -3776,10 +3806,9 @@ var removeDynamicGroup = (0, import_toolkit19.createAsyncThunk)(`${sliceName3}/r
3776
3806
  );
3777
3807
  });
3778
3808
  var getGroupFilters = (group, groupsState, filters = []) => {
3779
- var _a;
3780
3809
  const groupName = group === UNGROUPED_GROUP.id || group === UNGROUPED_GROUP.name ? UNGROUPED_GROUP.id : group;
3781
3810
  const selectedGroup = groupsState.byId[groupName];
3782
- const groupFilterLength = ((_a = selectedGroup == null ? void 0 : selectedGroup.filters) == null ? void 0 : _a.length) || 0;
3811
+ const groupFilterLength = selectedGroup?.filters?.length || 0;
3783
3812
  const cleanedFilters = groupFilterLength ? [...filters, ...selectedGroup.filters].filter(filtersFilter) : filters;
3784
3813
  return { cleanedFilters, groupName, selectedGroup, groupFilterLength };
3785
3814
  };
@@ -3802,7 +3831,6 @@ var selectGroup = (0, import_toolkit19.createAsyncThunk)(`${sliceName3}/selectGr
3802
3831
  var getEarliestTs = (dateA = "", dateB = "") => !dateA || !dateB ? dateA || dateB : dateA < dateB ? dateA : dateB;
3803
3832
  var reduceReceivedDevices = (devices, ids, state, status) => devices.reduce(
3804
3833
  (accu, device) => {
3805
- var _a, _b2, _c;
3806
3834
  const stateDevice = getDeviceById(state, device.id);
3807
3835
  const {
3808
3836
  attributes: storedAttributes = {},
@@ -3812,29 +3840,29 @@ var reduceReceivedDevices = (devices, ids, state, status) => devices.reduce(
3812
3840
  group: storedGroup
3813
3841
  } = stateDevice;
3814
3842
  const { identity, inventory, monitor, system = {}, tags } = mapDeviceAttributes(device.attributes);
3815
- device.tags = __spreadValues(__spreadValues({}, storedTags), tags);
3816
- device.group = (_a = system.group) != null ? _a : storedGroup;
3817
- device.monitor = __spreadValues(__spreadValues({}, storedMonitor), monitor);
3818
- device.identity_data = __spreadValues(__spreadValues(__spreadValues({}, storedIdentity), identity), device.identity_data ? device.identity_data : {});
3843
+ device.tags = { ...storedTags, ...tags };
3844
+ device.group = system.group ?? storedGroup;
3845
+ device.monitor = { ...storedMonitor, ...monitor };
3846
+ device.identity_data = { ...storedIdentity, ...identity, ...device.identity_data ? device.identity_data : {} };
3819
3847
  device.status = status ? status : device.status || identity.status;
3820
- device.check_in_time_rounded = (_b2 = system.check_in_time) != null ? _b2 : stateDevice.check_in_time_rounded;
3821
- device.check_in_time_exact = (_c = device.check_in_time) != null ? _c : stateDevice.check_in_time_exact;
3848
+ device.check_in_time_rounded = system.check_in_time ?? stateDevice.check_in_time_rounded;
3849
+ device.check_in_time_exact = device.check_in_time ?? stateDevice.check_in_time_exact;
3822
3850
  device.created_ts = getEarliestTs(getEarliestTs(system.created_ts, device.created_ts), stateDevice.created_ts);
3823
3851
  device.updated_ts = device.attributes ? device.updated_ts : stateDevice.updated_ts;
3824
3852
  device.isNew = new Date(device.created_ts) > new Date(state.app.newThreshold);
3825
3853
  device.isOffline = new Date(device.check_in_time_rounded) < new Date(state.app.offlineThreshold) || device.check_in_time_rounded === void 0;
3826
- device.attributes = device.attributes ? __spreadValues(__spreadValues({}, storedAttributes), inventory) : storedAttributes;
3827
- accu.devicesById[device.id] = __spreadValues(__spreadValues({}, stateDevice), device);
3854
+ device.attributes = device.attributes ? { ...storedAttributes, ...inventory } : storedAttributes;
3855
+ accu.devicesById[device.id] = { ...stateDevice, ...device };
3828
3856
  accu.ids.push(device.id);
3829
3857
  return accu;
3830
3858
  },
3831
3859
  { ids, devicesById: {} }
3832
3860
  );
3833
3861
  var getGroupDevices = (0, import_toolkit19.createAsyncThunk)(`${sliceName3}/getGroupDevices`, (options, { dispatch, getState }) => {
3834
- const _a = options, { group, shouldIncludeAllStates } = _a, remainder = __objRest(_a, ["group", "shouldIncludeAllStates"]);
3862
+ const { group, shouldIncludeAllStates, ...remainder } = options;
3835
3863
  const { cleanedFilters: filterSelection } = getGroupFilters(group, getState().devices.groups);
3836
3864
  return Promise.resolve(
3837
- dispatch(getDevicesByStatus2(__spreadProps(__spreadValues({}, remainder), { filterSelection, group, status: shouldIncludeAllStates ? void 0 : DEVICE_STATES.accepted })))
3865
+ dispatch(getDevicesByStatus2({ ...remainder, filterSelection, group, status: shouldIncludeAllStates ? void 0 : DEVICE_STATES.accepted }))
3838
3866
  ).unwrap().then((results) => {
3839
3867
  if (!group) {
3840
3868
  return Promise.resolve();
@@ -3848,7 +3876,7 @@ var getGroupDevices = (0, import_toolkit19.createAsyncThunk)(`${sliceName3}/getG
3848
3876
  dispatch(
3849
3877
  actions3.addGroup({
3850
3878
  group: {
3851
- deviceIds: deviceAccu.ids.length === total || deviceAccu.ids.length > (stateGroup == null ? void 0 : stateGroup.deviceIds) ? deviceAccu.ids : stateGroup.deviceIds,
3879
+ deviceIds: deviceAccu.ids.length === total || deviceAccu.ids.length > stateGroup?.deviceIds ? deviceAccu.ids : stateGroup.deviceIds,
3852
3880
  total
3853
3881
  },
3854
3882
  groupName: group
@@ -3997,27 +4025,26 @@ var getDeviceLimit2 = (0, import_toolkit19.createAsyncThunk)(
3997
4025
  );
3998
4026
  var setDeviceListState = (0, import_toolkit19.createAsyncThunk)(
3999
4027
  `${sliceName3}/setDeviceListState`,
4000
- (_a, { dispatch, getState }) => {
4001
- var _b2 = _a, { shouldSelectDevices = true, forceRefresh, fetchAuth = true } = _b2, selectionState = __objRest(_b2, ["shouldSelectDevices", "forceRefresh", "fetchAuth"]);
4002
- var _c;
4028
+ ({ shouldSelectDevices = true, forceRefresh, fetchAuth = true, ...selectionState }, { dispatch, getState }) => {
4003
4029
  const currentState = getDeviceListState(getState());
4004
4030
  const refreshTrigger = forceRefresh ? !currentState.refreshTrigger : selectionState.refreshTrigger;
4005
- let nextState = __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, currentState), {
4031
+ let nextState = {
4032
+ ...currentState,
4006
4033
  setOnly: false,
4007
- refreshTrigger
4008
- }), selectionState), {
4009
- sort: __spreadValues(__spreadValues({}, currentState.sort), selectionState.sort)
4010
- });
4034
+ refreshTrigger,
4035
+ ...selectionState,
4036
+ sort: { ...currentState.sort, ...selectionState.sort }
4037
+ };
4011
4038
  let tasks = [];
4012
- const _a2 = currentState, { isLoading: currentLoading, deviceIds: currentDevices, selection: currentSelection } = _a2, currentRequestState = __objRest(_a2, ["isLoading", "deviceIds", "selection"]);
4013
- const _b3 = nextState, { isLoading: nextLoading, deviceIds: nextDevices, selection: nextSelection } = _b3, nextRequestState = __objRest(_b3, ["isLoading", "deviceIds", "selection"]);
4039
+ const { isLoading: currentLoading, deviceIds: currentDevices, selection: currentSelection, ...currentRequestState } = currentState;
4040
+ const { isLoading: nextLoading, deviceIds: nextDevices, selection: nextSelection, ...nextRequestState } = nextState;
4014
4041
  if (!nextState.setOnly && !(0, import_helpers8.deepCompare)(currentRequestState, nextRequestState)) {
4015
- const { direction: sortDown = SORTING_OPTIONS.desc, key: sortCol, scope: sortScope } = (_c = nextState.sort) != null ? _c : {};
4042
+ const { direction: sortDown = SORTING_OPTIONS.desc, key: sortCol, scope: sortScope } = nextState.sort ?? {};
4016
4043
  const sortBy = sortCol ? [{ attribute: sortCol, order: sortDown, scope: sortScope }] : void 0;
4017
4044
  const applicableSelectedState = nextState.state === ALL_DEVICE_STATES ? void 0 : nextState.state;
4018
4045
  nextState.isLoading = true;
4019
4046
  tasks.push(
4020
- dispatch(getDevicesByStatus2(__spreadProps(__spreadValues({}, nextState), { status: applicableSelectedState, sortOptions: sortBy, fetchAuth }))).unwrap().then((results) => {
4047
+ dispatch(getDevicesByStatus2({ ...nextState, status: applicableSelectedState, sortOptions: sortBy, fetchAuth })).unwrap().then((results) => {
4021
4048
  const { deviceAccu, total } = results[results.length - 1];
4022
4049
  const devicesState = shouldSelectDevices ? { deviceIds: deviceAccu.ids, total, isLoading: false } : { isLoading: false };
4023
4050
  return Promise.resolve(dispatch(actions3.setDeviceListState(devicesState)));
@@ -4042,8 +4069,8 @@ var getDevicesByStatus2 = (0, import_toolkit19.createAsyncThunk)(`${sliceName3}/
4042
4069
  } = options;
4043
4070
  const state = getState();
4044
4071
  const { applicableFilters, filterTerms } = convertDeviceListStateToFilters({
4045
- filters: filterSelection != null ? filterSelection : getDeviceFilters(state),
4046
- group: group != null ? group : getSelectedGroup(state),
4072
+ filters: filterSelection ?? getDeviceFilters(state),
4073
+ group: group ?? getSelectedGroup(state),
4047
4074
  groups: state.devices.groups,
4048
4075
  offlineThreshold: state.app.offlineThreshold,
4049
4076
  selectedIssues,
@@ -4104,7 +4131,7 @@ var getAllDevicesByStatus = (0, import_toolkit19.createAsyncThunk)(`${sliceName3
4104
4131
  });
4105
4132
  var searchDevices = (0, import_toolkit19.createAsyncThunk)(`${sliceName3}/searchDevices`, (passedOptions = {}, { dispatch, getState }) => {
4106
4133
  const state = getState();
4107
- let options = __spreadValues(__spreadValues({}, state.app.searchState), passedOptions);
4134
+ let options = { ...state.app.searchState, ...passedOptions };
4108
4135
  const { page = defaultPage2, searchTerm, sortOptions = [] } = options;
4109
4136
  const { columnSelection = [] } = getUserSettings(state);
4110
4137
  const selectedAttributes = columnSelection.map((column) => ({ attribute: column.key, scope: column.scope }));
@@ -4239,8 +4266,7 @@ var getSessionDetails = (0, import_toolkit19.createAsyncThunk)(`${sliceName3}/ge
4239
4266
  ({ data: auditLogEntries }) => {
4240
4267
  const { start, end } = auditLogEntries.reduce(
4241
4268
  (accu, item) => {
4242
- var _a, _b2;
4243
- if ((_b2 = (_a = item.meta) == null ? void 0 : _a.session_id) == null ? void 0 : _b2.includes(sessionId)) {
4269
+ if (item.meta?.session_id?.includes(sessionId)) {
4244
4270
  accu.start = new Date(item.action.startsWith("open") ? item.time : accu.start);
4245
4271
  accu.end = new Date(item.action.startsWith("close") ? item.time : accu.end);
4246
4272
  }
@@ -4347,8 +4373,7 @@ var decommissionDevice = (0, import_toolkit19.createAsyncThunk)(
4347
4373
  var getDeviceConfig = (0, import_toolkit19.createAsyncThunk)(
4348
4374
  `${sliceName3}/getDeviceConfig`,
4349
4375
  (deviceId, { dispatch }) => general_api_default.get(`${deviceConfig}/${deviceId}`).then(({ data }) => Promise.all([dispatch(actions3.receivedDevice({ id: deviceId, config: data })), Promise.resolve(data)])).catch((err) => {
4350
- var _a, _b2;
4351
- if (((_b2 = (_a = err.response) == null ? void 0 : _a.data) == null ? void 0 : _b2.error.status_code) !== 404) {
4376
+ if (err.response?.data?.error.status_code !== 404) {
4352
4377
  return commonErrorHandler(err, `There was an error retrieving the configuration for device ${deviceId}.`, dispatch, commonErrorFallback);
4353
4378
  }
4354
4379
  })
@@ -4360,15 +4385,14 @@ var setDeviceConfig = (0, import_toolkit19.createAsyncThunk)(
4360
4385
  var applyDeviceConfig = (0, import_toolkit19.createAsyncThunk)(
4361
4386
  `${sliceName3}/applyDeviceConfig`,
4362
4387
  ({ deviceId, configDeploymentConfiguration, isDefault, config }, { dispatch, getState }) => general_api_default.post(`${deviceConfig}/${deviceId}/deploy`, configDeploymentConfiguration).catch((err) => commonErrorHandler(err, `There was an error deploying the configuration to device ${deviceId}.`, dispatch, commonErrorFallback)).then(({ data }) => {
4363
- var _a;
4364
4388
  const device = getDeviceById(getState(), deviceId);
4365
4389
  const { canManageUsers } = getUserCapabilities(getState());
4366
4390
  let tasks = [
4367
- dispatch(actions3.receivedDevice(__spreadProps(__spreadValues({}, device), { config: __spreadProps(__spreadValues({}, device.config), { deployment_id: data.deployment_id }) }))),
4391
+ dispatch(actions3.receivedDevice({ ...device, config: { ...device.config, deployment_id: data.deployment_id } })),
4368
4392
  new Promise((resolve) => setTimeout(() => resolve(dispatch(getSingleDeployment(data.deployment_id))), TIMEOUTS.oneSecond))
4369
4393
  ];
4370
4394
  if (isDefault && canManageUsers) {
4371
- const { previous } = (_a = getGlobalSettings(getState()).defaultDeviceConfig) != null ? _a : {};
4395
+ const { previous } = getGlobalSettings(getState()).defaultDeviceConfig ?? {};
4372
4396
  tasks.push(dispatch(saveGlobalSettings({ defaultDeviceConfig: { current: config, previous } })));
4373
4397
  }
4374
4398
  return Promise.all(tasks);
@@ -4384,21 +4408,21 @@ var setDeviceTags = (0, import_toolkit19.createAsyncThunk)(
4384
4408
  `${inventoryApiUrl}/devices/${deviceId}/tags`,
4385
4409
  Object.entries(tags).map(([name, value]) => ({ name, value })),
4386
4410
  { headers }
4387
- ).catch((err) => commonErrorHandler(err, `There was an error setting tags for device ${deviceId}.`, dispatch, "Please check your connection.")).then(() => Promise.all([dispatch(actions3.receivedDevice(__spreadProps(__spreadValues({}, device), { id: deviceId, tags }))), dispatch(setSnackbar3("Device name changed"))]));
4411
+ ).catch((err) => commonErrorHandler(err, `There was an error setting tags for device ${deviceId}.`, dispatch, "Please check your connection.")).then(() => Promise.all([dispatch(actions3.receivedDevice({ ...device, id: deviceId, tags })), dispatch(setSnackbar3("Device name changed"))]));
4388
4412
  })
4389
4413
  )
4390
4414
  );
4391
4415
  var getDeviceTwin = (0, import_toolkit19.createAsyncThunk)(`${sliceName3}/getDeviceTwin`, ({ deviceId, integration }, { dispatch, getState }) => {
4392
4416
  let providerResult = {};
4393
4417
  return general_api_default.get(`${iotManagerBaseURL}/devices/${deviceId}/state`).then(({ data }) => {
4394
- providerResult = __spreadProps(__spreadValues({}, data), { twinError: "" });
4418
+ providerResult = { ...data, twinError: "" };
4395
4419
  }).catch((err) => {
4396
4420
  providerResult = {
4397
4421
  twinError: `There was an error getting the ${EXTERNAL_PROVIDER[integration.provider].twinTitle.toLowerCase()} for device ${deviceId}. ${err}`
4398
4422
  };
4399
4423
  }).finally(() => {
4400
4424
  const device = getDeviceById(getState(), deviceId);
4401
- Promise.resolve(dispatch(actions3.receivedDevice(__spreadProps(__spreadValues({}, device), { twinsByIntegration: __spreadValues(__spreadValues({}, device.twinsByIntegration), providerResult) }))));
4425
+ Promise.resolve(dispatch(actions3.receivedDevice({ ...device, twinsByIntegration: { ...device.twinsByIntegration, ...providerResult } })));
4402
4426
  });
4403
4427
  });
4404
4428
  var setDeviceTwin = (0, import_toolkit19.createAsyncThunk)(
@@ -4414,7 +4438,7 @@ var setDeviceTwin = (0, import_toolkit19.createAsyncThunk)(
4414
4438
  const { twinsByIntegration = {} } = device;
4415
4439
  const { [integration.id]: currentState = {} } = twinsByIntegration;
4416
4440
  return Promise.resolve(
4417
- dispatch(actions3.receivedDevice(__spreadProps(__spreadValues({}, device), { twinsByIntegration: __spreadProps(__spreadValues({}, twinsByIntegration), { [integration.id]: __spreadProps(__spreadValues({}, currentState), { desired: settings }) }) })))
4441
+ dispatch(actions3.receivedDevice({ ...device, twinsByIntegration: { ...twinsByIntegration, [integration.id]: { ...currentState, desired: settings } } }))
4418
4442
  );
4419
4443
  })
4420
4444
  );
@@ -4435,8 +4459,8 @@ var getSystemDevices = (0, import_toolkit19.createAsyncThunk)(`${sliceName3}/get
4435
4459
  const { attributes: deviceAttributes = {} } = getDeviceById(state, id);
4436
4460
  const { mender_gateway_system_id = "" } = deviceAttributes;
4437
4461
  const filters = [
4438
- __spreadProps(__spreadValues({}, emptyFilter), { key: "mender_is_gateway", operator: DEVICE_FILTERING_OPTIONS.$ne.key, value: "true", scope: "inventory" }),
4439
- __spreadProps(__spreadValues({}, emptyFilter), { key: "mender_gateway_system_id", value: mender_gateway_system_id, scope: "inventory" })
4462
+ { ...emptyFilter, key: "mender_is_gateway", operator: DEVICE_FILTERING_OPTIONS.$ne.key, value: "true", scope: "inventory" },
4463
+ { ...emptyFilter, key: "mender_gateway_system_id", value: mender_gateway_system_id, scope: "inventory" }
4440
4464
  ];
4441
4465
  const { attributes, filterTerms } = prepareSearchArguments({ filters, state });
4442
4466
  return general_api_default.post(getSearchEndpoint(getState()), {
@@ -4448,11 +4472,12 @@ var getSystemDevices = (0, import_toolkit19.createAsyncThunk)(`${sliceName3}/get
4448
4472
  }).catch((err) => commonErrorHandler(err, `There was an error getting system devices device ${id}.`, dispatch, "Please check your connection.")).then(({ data, headers }) => {
4449
4473
  const state2 = getState();
4450
4474
  const { devicesById, ids } = reduceReceivedDevices(data, [], state2);
4451
- const device = __spreadProps(__spreadValues({}, getDeviceById(state2, id)), {
4475
+ const device = {
4476
+ ...getDeviceById(state2, id),
4452
4477
  systemDeviceIds: ids,
4453
4478
  systemDeviceTotal: Number(headers[headerNames.total])
4454
- });
4455
- return Promise.resolve(dispatch(actions3.receivedDevices(__spreadProps(__spreadValues({}, devicesById), { [id]: device }))));
4479
+ };
4480
+ return Promise.resolve(dispatch(actions3.receivedDevices({ ...devicesById, [id]: device })));
4456
4481
  });
4457
4482
  });
4458
4483
  var getGatewayDevices = (0, import_toolkit19.createAsyncThunk)(`${sliceName3}/getGatewayDevices`, (deviceId, { dispatch, getState }) => {
@@ -4460,9 +4485,9 @@ var getGatewayDevices = (0, import_toolkit19.createAsyncThunk)(`${sliceName3}/ge
4460
4485
  const { attributes = {} } = getDeviceById(state, deviceId);
4461
4486
  const { mender_gateway_system_id = "" } = attributes;
4462
4487
  const filters = [
4463
- __spreadProps(__spreadValues({}, emptyFilter), { key: "id", operator: DEVICE_FILTERING_OPTIONS.$ne.key, value: deviceId, scope: "identity" }),
4464
- __spreadProps(__spreadValues({}, emptyFilter), { key: "mender_is_gateway", value: "true", scope: "inventory" }),
4465
- __spreadProps(__spreadValues({}, emptyFilter), { key: "mender_gateway_system_id", value: mender_gateway_system_id, scope: "inventory" })
4488
+ { ...emptyFilter, key: "id", operator: DEVICE_FILTERING_OPTIONS.$ne.key, value: deviceId, scope: "identity" },
4489
+ { ...emptyFilter, key: "mender_is_gateway", value: "true", scope: "inventory" },
4490
+ { ...emptyFilter, key: "mender_gateway_system_id", value: mender_gateway_system_id, scope: "inventory" }
4466
4491
  ];
4467
4492
  const { attributes: attributeSelection, filterTerms } = prepareSearchArguments({ filters, state });
4468
4493
  return general_api_default.post(getSearchEndpoint(getState()), {
@@ -4509,7 +4534,7 @@ var { page: defaultPage3, perPage: defaultPerPage3 } = DEVICE_LIST_DEFAULTS;
4509
4534
  var cutoffLength = 75;
4510
4535
  var ellipsis = "...";
4511
4536
  var longTextTrimmer = (text) => text.length >= cutoffLength + ellipsis.length ? `${text.substring(0, cutoffLength + ellipsis.length)}${ellipsis}` : text;
4512
- var sanitizeDeviceAlerts = (alerts) => alerts.map((alert) => __spreadProps(__spreadValues({}, alert), { fullName: alert.name, name: longTextTrimmer(alert.name) }));
4537
+ var sanitizeDeviceAlerts = (alerts) => alerts.map((alert) => ({ ...alert, fullName: alert.name, name: longTextTrimmer(alert.name) }));
4513
4538
  var getDeviceAlerts = (0, import_toolkit20.createAsyncThunk)(`${sliceName4}/getDeviceAlerts`, ({ id, config = {} }, { dispatch }) => {
4514
4539
  const { page = defaultPage3, perPage = defaultPerPage3, issuedBefore, issuedAfter, sortAscending = false } = config;
4515
4540
  const issued_after = issuedAfter ? `&issued_after=${issuedAfter}` : "";
@@ -4527,14 +4552,15 @@ var getLatestDeviceAlerts = (0, import_toolkit20.createAsyncThunk)(`${sliceName4
4527
4552
  });
4528
4553
  var getIssueCountsByType2 = (0, import_toolkit20.createAsyncThunk)(`${sliceName4}/getIssueCountsByType`, ({ type, options = {} }, { dispatch, getState }) => {
4529
4554
  const state = getState();
4530
- const _a = options, { filters = getDeviceFilters(state), group, status } = _a, remainder = __objRest(_a, ["filters", "group", "status"]);
4531
- const { applicableFilters: nonMonitorFilters, filterTerms } = convertDeviceListStateToFilters(__spreadProps(__spreadValues({}, remainder), {
4555
+ const { filters = getDeviceFilters(state), group, status, ...remainder } = options;
4556
+ const { applicableFilters: nonMonitorFilters, filterTerms } = convertDeviceListStateToFilters({
4557
+ ...remainder,
4532
4558
  filters,
4533
4559
  group,
4534
4560
  offlineThreshold: state.app.offlineThreshold,
4535
4561
  selectedIssues: [type],
4536
4562
  status
4537
- }));
4563
+ });
4538
4564
  return general_api_default.post(getSearchEndpoint(getState()), {
4539
4565
  page: 1,
4540
4566
  per_page: 1,
@@ -4586,21 +4612,21 @@ var determineProgress = (acceptedDevices, pendingDevices, releases, pastDeployme
4586
4612
  return steps[progress2];
4587
4613
  };
4588
4614
  var deductOnboardingState = ({ devicesById, devicesByStatus, onboardingState, pastDeployments, releases, userCapabilities, userId }) => {
4589
- var _a;
4590
4615
  const { canDeploy, canManageDevices, canReadDeployments, canReadDevices, canReadReleases, canUploadReleases } = userCapabilities;
4591
4616
  const userCookie = cookies3.get(`${userId}-onboarded`);
4592
4617
  const acceptedDevices = devicesByStatus[DEVICE_STATES.accepted].deviceIds;
4593
4618
  const pendingDevices = devicesByStatus[DEVICE_STATES.pending].deviceIds;
4594
- let deviceType = (_a = onboardingState.deviceType) != null ? _a : [];
4619
+ let deviceType = onboardingState.deviceType ?? [];
4595
4620
  deviceType = !deviceType.length && acceptedDevices.length && devicesById[acceptedDevices[0]].hasOwnProperty("attributes") ? devicesById[acceptedDevices[0]].attributes.device_type : deviceType;
4596
4621
  const progress2 = applyOnboardingFallbacks(onboardingState.progress || determineProgress(acceptedDevices, pendingDevices, releases, pastDeployments));
4597
- return __spreadProps(__spreadValues({}, onboardingState), {
4622
+ return {
4623
+ ...onboardingState,
4598
4624
  complete: !!(Boolean(userCookie) || onboardingState.complete || acceptedDevices.length > 1 && pendingDevices.length > 0 && releases.length > 1 && pastDeployments.length > 1 || acceptedDevices.length >= 1 && releases.length >= 2 && pastDeployments.length > 2 || acceptedDevices.length >= 1 && pendingDevices.length > 0 && releases.length >= 2 && pastDeployments.length >= 2 || orderedOnboardingSteps.findIndex((step) => step === progress2) >= orderedOnboardingSteps.length - 1 || onboardingState.disable || ![canDeploy, canManageDevices, canReadDeployments, canReadDevices, canReadReleases, canUploadReleases].every((i) => i)),
4599
4625
  showTips: onboardingState.showTips != null ? onboardingState.showTips : true,
4600
4626
  deviceType,
4601
4627
  approach: onboardingState.approach || (deviceType.some((type) => type.startsWith("qemu")) ? "virtual" : "physical"),
4602
4628
  progress: progress2
4603
- });
4629
+ };
4604
4630
  };
4605
4631
  var getOnboardingState2 = (0, import_toolkit21.createAsyncThunk)(`${sliceName5}/getOnboardingState`, (_, { dispatch, getState }) => {
4606
4632
  const state = getState();
@@ -4658,7 +4684,7 @@ var advanceOnboarding = (0, import_toolkit21.createAsyncThunk)(`${sliceName5}/ad
4658
4684
  return;
4659
4685
  }
4660
4686
  const madeProgress = steps[stepIndex + 1];
4661
- const state = __spreadProps(__spreadValues({}, getOnboardingState(getState())), { progress: madeProgress });
4687
+ const state = { ...getOnboardingState(getState()), progress: madeProgress };
4662
4688
  state.complete = stepIndex + 1 >= steps.findIndex((step) => step === onboardingSteps.DEPLOYMENTS_PAST_COMPLETED_FAILURE) ? true : state.complete;
4663
4689
  return Promise.all([dispatch(actions5.setOnboardingProgress(madeProgress)), dispatch(saveUserSettings({ onboarding: state }))]);
4664
4690
  });
@@ -4741,8 +4767,8 @@ var completeUpgrade = (0, import_toolkit22.createAsyncThunk)(
4741
4767
  ({ tenantId, plan }, { dispatch }) => general_api_default.post(`${tenantadmApiUrlv2}/tenants/${tenantId}/upgrade/complete`, { plan }).catch((err) => commonErrorHandler(err, `There was an error upgrading your account:`, dispatch)).then(() => Promise.resolve(dispatch(getUserOrganization())))
4742
4768
  );
4743
4769
  var prepareAuditlogQuery = ({ startDate, endDate, user: userFilter, type, detail: detailFilter, sort = {} }) => {
4744
- const userId = (userFilter == null ? void 0 : userFilter.id) || userFilter;
4745
- const detail = (detailFilter == null ? void 0 : detailFilter.id) || detailFilter;
4770
+ const userId = userFilter?.id || userFilter;
4771
+ const detail = detailFilter?.id || detailFilter;
4746
4772
  const createdAfter = startDate ? `&created_after=${Math.round(Date.parse(startDate) / 1e3)}` : "";
4747
4773
  const createdBefore = endDate ? `&created_before=${Math.round(Date.parse(endDate) / 1e3)}` : "";
4748
4774
  const typeSearch = type ? `&object_type=${type.value}`.toLowerCase() : "";
@@ -4769,12 +4795,14 @@ var getAuditLogsCsvLink = (0, import_toolkit22.createAsyncThunk)(
4769
4795
  );
4770
4796
  var setAuditlogsState = (0, import_toolkit22.createAsyncThunk)(`${sliceName6}/setAuditlogsState`, (selectionState, { dispatch, getState }) => {
4771
4797
  const currentState = getAuditlogState(getState());
4772
- let nextState = __spreadProps(__spreadValues(__spreadValues({}, currentState), selectionState), {
4773
- sort: __spreadValues(__spreadValues({}, currentState.sort), selectionState.sort)
4774
- });
4798
+ let nextState = {
4799
+ ...currentState,
4800
+ ...selectionState,
4801
+ sort: { ...currentState.sort, ...selectionState.sort }
4802
+ };
4775
4803
  let tasks = [];
4776
- const _a = currentState, { isLoading: currentLoading, selectedIssue: currentIssue } = _a, currentRequestState = __objRest(_a, ["isLoading", "selectedIssue"]);
4777
- const _b2 = nextState, { isLoading: selectionLoading, selectedIssue: selectionIssue } = _b2, selectionRequestState = __objRest(_b2, ["isLoading", "selectedIssue"]);
4804
+ const { isLoading: currentLoading, selectedIssue: currentIssue, ...currentRequestState } = currentState;
4805
+ const { isLoading: selectionLoading, selectedIssue: selectionIssue, ...selectionRequestState } = nextState;
4778
4806
  if (!(0, import_helpers10.deepCompare)(currentRequestState, selectionRequestState)) {
4779
4807
  nextState.isLoading = true;
4780
4808
  tasks.push(dispatch(getAuditLogs(nextState)).finally(() => dispatch(actions6.setAuditLogState({ isLoading: false }))));
@@ -4786,27 +4814,30 @@ var tenantDataDivergedMessage = "The system detected there is a change in your p
4786
4814
  var addTenant = (0, import_toolkit22.createAsyncThunk)(`${sliceName6}/createTenant`, (selectionState, { dispatch }) => {
4787
4815
  return general_api_default.post(`${tenantadmApiUrlv2}/tenants`, selectionState).then(() => Promise.all([dispatch(getTenants()), dispatch(setSnackbar4("Tenant was created successfully."))])).catch((err) => commonErrorHandler(err, "There was an error creating tenant", dispatch, commonErrorFallback));
4788
4816
  });
4789
- var tenantListRetrieval = (config) => __async(void 0, null, function* () {
4817
+ var tenantListRetrieval = async (config) => {
4790
4818
  const { page, perPage } = config;
4791
4819
  const params = new URLSearchParams({ page, per_page: perPage }).toString();
4792
- const tenantList = yield general_api_default.get(`${tenantadmApiUrlv2}/tenants?${params}`);
4820
+ const tenantList = await general_api_default.get(`${tenantadmApiUrlv2}/tenants?${params}`);
4793
4821
  const totalCount = tenantList.headers[headerNames.total] || TENANT_LIST_DEFAULT.perPage;
4794
4822
  return [tenantList.data, Number(totalCount)];
4795
- });
4796
- var getTenants = (0, import_toolkit22.createAsyncThunk)(`${sliceName6}/getTenants`, (_0, _1) => __async(void 0, [_0, _1], function* (_, { dispatch, getState }) {
4823
+ };
4824
+ var getTenants = (0, import_toolkit22.createAsyncThunk)(`${sliceName6}/getTenants`, async (_, { dispatch, getState }) => {
4797
4825
  const currentState = getTenantsList(getState());
4798
- const [tenants, pageCount] = yield tenantListRetrieval(currentState);
4799
- dispatch(actions6.setTenantListState(__spreadProps(__spreadValues({}, currentState), { total: pageCount, tenants })));
4800
- }));
4801
- var setTenantsListState = (0, import_toolkit22.createAsyncThunk)(`${sliceName6}/setTenantsListState`, (_0, _1) => __async(void 0, [_0, _1], function* (selectionState, { dispatch, getState }) {
4826
+ const [tenants, pageCount] = await tenantListRetrieval(currentState);
4827
+ dispatch(actions6.setTenantListState({ ...currentState, total: pageCount, tenants }));
4828
+ });
4829
+ var setTenantsListState = (0, import_toolkit22.createAsyncThunk)(`${sliceName6}/setTenantsListState`, async (selectionState, { dispatch, getState }) => {
4802
4830
  const currentState = getTenantsList(getState());
4803
- const nextState = __spreadValues(__spreadValues({}, currentState), selectionState);
4831
+ const nextState = {
4832
+ ...currentState,
4833
+ ...selectionState
4834
+ };
4804
4835
  if (!(0, import_helpers10.deepCompare)(currentState, selectionState)) {
4805
- const [tenants, pageCount] = yield tenantListRetrieval(nextState);
4806
- return dispatch(actions6.setTenantListState(__spreadProps(__spreadValues({}, nextState), { tenants, total: pageCount })));
4836
+ const [tenants, pageCount] = await tenantListRetrieval(nextState);
4837
+ return dispatch(actions6.setTenantListState({ ...nextState, tenants, total: pageCount }));
4807
4838
  }
4808
- return dispatch(actions6.setTenantListState(__spreadValues({}, nextState)));
4809
- }));
4839
+ return dispatch(actions6.setTenantListState({ ...nextState }));
4840
+ });
4810
4841
  var editTenantDeviceLimit = (0, import_toolkit22.createAsyncThunk)(`${sliceName6}/editDeviceLimit`, ({ newLimit, id, name }, { dispatch }) => {
4811
4842
  return general_api_default.put(`${tenantadmApiUrlv2}/tenants/${id}/child`, { device_limit: newLimit, name }).catch((err) => commonErrorHandler(err, `Device Limit cannot be changed`, dispatch)).then(() => {
4812
4843
  const tasks = [Promise.resolve(dispatch(setSnackbar4("Device Limit was changed successfully")))];
@@ -4849,10 +4880,7 @@ var downloadLicenseReport = (0, import_toolkit22.createAsyncThunk)(
4849
4880
  );
4850
4881
  var createIntegration = (0, import_toolkit22.createAsyncThunk)(
4851
4882
  `${sliceName6}/createIntegration`,
4852
- (_a, { dispatch }) => {
4853
- var _b2 = _a, { id } = _b2, integration = __objRest(_b2, ["id"]);
4854
- return general_api_default.post(`${iotManagerBaseURL}/integrations`, integration).catch((err) => commonErrorHandler(err, "There was an error creating the integration", dispatch, commonErrorFallback)).then(() => Promise.all([dispatch(setSnackbar4("The integration was set up successfully")), dispatch(getIntegrations())]));
4855
- }
4883
+ ({ id, ...integration }, { dispatch }) => general_api_default.post(`${iotManagerBaseURL}/integrations`, integration).catch((err) => commonErrorHandler(err, "There was an error creating the integration", dispatch, commonErrorFallback)).then(() => Promise.all([dispatch(setSnackbar4("The integration was set up successfully")), dispatch(getIntegrations())]))
4856
4884
  );
4857
4885
  var changeIntegration = (0, import_toolkit22.createAsyncThunk)(
4858
4886
  `${sliceName6}/changeIntegration`,
@@ -4873,9 +4901,8 @@ var getIntegrations = (0, import_toolkit22.createAsyncThunk)(
4873
4901
  (_, { dispatch, getState }) => general_api_default.get(`${iotManagerBaseURL}/integrations`).catch((err) => commonErrorHandler(err, "There was an error retrieving the integration", dispatch, commonErrorFallback)).then(({ data }) => {
4874
4902
  const existingIntegrations = getState().organization.externalDeviceIntegrations;
4875
4903
  const integrations = data.reduce((accu, item) => {
4876
- var _a;
4877
- const existingIntegration = (_a = existingIntegrations.find((integration2) => item.id === integration2.id)) != null ? _a : {};
4878
- const integration = __spreadValues(__spreadValues({}, existingIntegration), item);
4904
+ const existingIntegration = existingIntegrations.find((integration2) => item.id === integration2.id) ?? {};
4905
+ const integration = { ...existingIntegration, ...item };
4879
4906
  accu.push(integration);
4880
4907
  return accu;
4881
4908
  }, []);
@@ -4927,7 +4954,7 @@ var getSsoConfigById = (0, import_toolkit22.createAsyncThunk)(
4927
4954
  `${sliceName6}/getSsoConfigById`,
4928
4955
  (config, { dispatch }) => general_api_default.get(`${ssoIdpApiUrlv1}/${config.id}`).catch((err) => dispatch(ssoConfigActionErrorHandler(err, "read"))).then(({ data, headers }) => {
4929
4956
  const sso = Object.values(SSO_TYPES).find(({ contentType }) => contentType === headers["content-type"]);
4930
- return sso ? Promise.resolve(__spreadProps(__spreadValues({}, config), { config: data, type: sso.id })) : Promise.reject("Unsupported SSO config content type.");
4957
+ return sso ? Promise.resolve({ ...config, config: data, type: sso.id }) : Promise.reject("Unsupported SSO config content type.");
4931
4958
  })
4932
4959
  );
4933
4960
  var getSsoConfigs = (0, import_toolkit22.createAsyncThunk)(
@@ -4946,20 +4973,21 @@ var { setSnackbar: setSnackbar5, initUpload: initUpload2, uploadProgress: upload
4946
4973
  var { page: defaultPage5, perPage: defaultPerPage5 } = DEVICE_LIST_DEFAULTS;
4947
4974
  var sortingDefaults = { direction: SORTING_OPTIONS.desc, key: "modified" };
4948
4975
  var flattenRelease = (release, stateRelease) => {
4949
- var _a;
4950
- const updatedArtifacts = ((_a = release.artifacts) == null ? void 0 : _a.sort((0, import_helpers11.customSort)(1, "modified"))) || [];
4976
+ const updatedArtifacts = release.artifacts?.sort((0, import_helpers11.customSort)(1, "modified")) || [];
4951
4977
  const { artifacts, deviceTypes, modified } = updatedArtifacts.reduce(
4952
4978
  (accu, item) => {
4953
- var _a2;
4954
4979
  accu.deviceTypes.push(...item.device_types_compatible);
4955
- const stateArtifact = ((_a2 = stateRelease.artifacts) == null ? void 0 : _a2.find((releaseArtifact) => releaseArtifact.id === item.id)) || {};
4980
+ const stateArtifact = stateRelease.artifacts?.find((releaseArtifact) => releaseArtifact.id === item.id) || {};
4956
4981
  accu.modified = accu.modified ? accu.modified : item.modified;
4957
- accu.artifacts.push(__spreadValues(__spreadValues({}, stateArtifact), item));
4982
+ accu.artifacts.push({
4983
+ ...stateArtifact,
4984
+ ...item
4985
+ });
4958
4986
  return accu;
4959
4987
  },
4960
4988
  { artifacts: [], deviceTypes: [], modified: void 0 }
4961
4989
  );
4962
- return __spreadProps(__spreadValues(__spreadValues({}, stateRelease), release), { artifacts, device_types_compatible: deviceTypes.filter(import_helpers11.duplicateFilter), modified });
4990
+ return { ...stateRelease, ...release, artifacts, device_types_compatible: deviceTypes.filter(import_helpers11.duplicateFilter), modified };
4963
4991
  };
4964
4992
  var reduceReceivedReleases = (releases, stateReleasesById) => releases.reduce((accu, release) => {
4965
4993
  const stateRelease = stateReleasesById[release.name] || {};
@@ -4977,17 +5005,16 @@ var findArtifactIndexInRelease = (releases, id) => Object.values(releases).reduc
4977
5005
  { release: null, index: -1 }
4978
5006
  );
4979
5007
  var getArtifactInstallCount = (0, import_toolkit23.createAsyncThunk)(`${sliceName7}/getArtifactInstallCount`, (id, { dispatch, getState }) => {
4980
- var _a;
4981
5008
  let { release, index } = findArtifactIndexInRelease(getReleasesById(getState()), id);
4982
5009
  if (!release || index === -1) {
4983
5010
  return;
4984
5011
  }
4985
5012
  const releaseArtifacts = [...release.artifacts];
4986
5013
  const artifact = releaseArtifacts[index];
4987
- const { key, name, version } = (_a = (0, import_helpers11.extractSoftwareItem)(artifact.artifact_provides)) != null ? _a : {};
5014
+ const { key, name, version } = (0, import_helpers11.extractSoftwareItem)(artifact.artifact_provides) ?? {};
4988
5015
  const attribute = `${key}${name ? `.${name}` : ""}.version`;
4989
5016
  const { filterTerms } = convertDeviceListStateToFilters({
4990
- filters: [__spreadProps(__spreadValues({}, emptyFilter), { key: attribute, value: version, scope: "inventory" })]
5017
+ filters: [{ ...emptyFilter, key: attribute, value: version, scope: "inventory" }]
4991
5018
  });
4992
5019
  return general_api_default.post(getSearchEndpoint(getState()), {
4993
5020
  page: 1,
@@ -5001,10 +5028,11 @@ var getArtifactInstallCount = (0, import_toolkit23.createAsyncThunk)(`${sliceNam
5001
5028
  }
5002
5029
  const installCount = Number(headers[headerNames.total]);
5003
5030
  const releaseArtifacts2 = [...release2.artifacts];
5004
- releaseArtifacts2[index2] = __spreadProps(__spreadValues({}, releaseArtifacts2[index2]), { installCount });
5005
- release2 = __spreadProps(__spreadValues({}, release2), {
5031
+ releaseArtifacts2[index2] = { ...releaseArtifacts2[index2], installCount };
5032
+ release2 = {
5033
+ ...release2,
5006
5034
  artifacts: releaseArtifacts2
5007
- });
5035
+ };
5008
5036
  return dispatch(actions7.receiveRelease(release2));
5009
5037
  });
5010
5038
  });
@@ -5016,12 +5044,14 @@ var getArtifactUrl = (0, import_toolkit23.createAsyncThunk)(
5016
5044
  return dispatch(getReleases());
5017
5045
  }
5018
5046
  const releaseArtifacts = [...release.artifacts];
5019
- releaseArtifacts[index] = __spreadProps(__spreadValues({}, releaseArtifacts[index]), {
5047
+ releaseArtifacts[index] = {
5048
+ ...releaseArtifacts[index],
5020
5049
  url: response.data.uri
5021
- });
5022
- release = __spreadProps(__spreadValues({}, release), {
5050
+ };
5051
+ release = {
5052
+ ...release,
5023
5053
  artifacts: releaseArtifacts
5024
- });
5054
+ };
5025
5055
  return dispatch(actions7.receiveRelease(release));
5026
5056
  })
5027
5057
  );
@@ -5146,12 +5176,14 @@ var selectRelease = (0, import_toolkit23.createAsyncThunk)(`${sliceName7}/select
5146
5176
  });
5147
5177
  var setReleasesListState = (0, import_toolkit23.createAsyncThunk)(`${sliceName7}/setReleasesListState`, (selectionState, { dispatch, getState }) => {
5148
5178
  const currentState = getState().releases.releasesList;
5149
- let nextState = __spreadProps(__spreadValues(__spreadValues({}, currentState), selectionState), {
5150
- sort: __spreadValues(__spreadValues({}, currentState.sort), selectionState.sort)
5151
- });
5179
+ let nextState = {
5180
+ ...currentState,
5181
+ ...selectionState,
5182
+ sort: { ...currentState.sort, ...selectionState.sort }
5183
+ };
5152
5184
  let tasks = [];
5153
- const _a = currentState, { isLoading: currentLoading } = _a, currentRequestState = __objRest(_a, ["isLoading"]);
5154
- const _b2 = nextState, { isLoading: selectionLoading } = _b2, selectionRequestState = __objRest(_b2, ["isLoading"]);
5185
+ const { isLoading: currentLoading, ...currentRequestState } = currentState;
5186
+ const { isLoading: selectionLoading, ...selectionRequestState } = nextState;
5155
5187
  if (!(0, import_helpers11.deepCompare)(currentRequestState, selectionRequestState)) {
5156
5188
  nextState.isLoading = true;
5157
5189
  tasks.push(dispatch(getReleases(nextState)).finally(() => dispatch(setReleasesListState({ isLoading: false }))));
@@ -5170,29 +5202,30 @@ var releaseListRetrieval = (config) => {
5170
5202
  );
5171
5203
  };
5172
5204
  var deductSearchState = (receivedReleases, config, total, state) => {
5173
- let releaseListState = __spreadValues({}, state.releasesList);
5205
+ let releaseListState = { ...state.releasesList };
5174
5206
  const { searchTerm, searchOnly, sort = {}, selectedTags = [], type } = config;
5175
5207
  const flattenedReleases = Object.values(receivedReleases).sort((0, import_helpers11.customSort)(sort.direction === SORTING_OPTIONS.desc, sort.key));
5176
5208
  const releaseIds = flattenedReleases.map((item) => item.name);
5177
5209
  const isFiltering = !!(selectedTags.length || type || searchTerm);
5178
5210
  if (searchOnly) {
5179
- releaseListState = __spreadProps(__spreadValues({}, releaseListState), { searchedIds: releaseIds });
5211
+ releaseListState = { ...releaseListState, searchedIds: releaseIds };
5180
5212
  } else {
5181
- releaseListState = __spreadProps(__spreadValues({}, releaseListState), {
5213
+ releaseListState = {
5214
+ ...releaseListState,
5182
5215
  releaseIds,
5183
5216
  searchTotal: isFiltering ? total : state.releasesList.searchTotal,
5184
5217
  total: !isFiltering ? total : state.releasesList.total
5185
- });
5218
+ };
5186
5219
  }
5187
5220
  return releaseListState;
5188
5221
  };
5189
5222
  var getReleases = (0, import_toolkit23.createAsyncThunk)(`${sliceName7}/getReleases`, (passedConfig = {}, { dispatch, getState }) => {
5190
- const config = __spreadValues(__spreadValues({}, getState().releases.releasesList), passedConfig);
5223
+ const config = { ...getState().releases.releasesList, ...passedConfig };
5191
5224
  return releaseListRetrieval(config).then(({ data: receivedReleases = [], headers = {} }) => {
5192
5225
  const total = headers[headerNames.total] ? Number(headers[headerNames.total]) : 0;
5193
5226
  const state = getState().releases;
5194
5227
  const flatReleases = reduceReceivedReleases(receivedReleases, state.byId);
5195
- const combinedReleases = __spreadValues(__spreadValues({}, state.byId), flatReleases);
5228
+ const combinedReleases = { ...state.byId, ...flatReleases };
5196
5229
  let tasks = [dispatch(actions7.receiveReleases(combinedReleases))];
5197
5230
  const releaseListState = deductSearchState(receivedReleases, config, total, state);
5198
5231
  tasks.push(dispatch(actions7.setReleaseListState(releaseListState)));
@@ -5213,7 +5246,7 @@ var updateReleaseInfo = (0, import_toolkit23.createAsyncThunk)(
5213
5246
  `${sliceName7}/updateReleaseInfo`,
5214
5247
  ({ name, info }, { dispatch, getState }) => general_api_default.patch(`${deploymentsApiUrlV2}/deployments/releases/${name}`, info).catch((err) => commonErrorHandler(err, `Release details couldn't be updated.`, dispatch)).then(() => {
5215
5248
  return Promise.all([
5216
- dispatch(actions7.receiveRelease(__spreadProps(__spreadValues(__spreadValues({}, getReleasesById(getState())[name]), info), { name }))),
5249
+ dispatch(actions7.receiveRelease({ ...getReleasesById(getState())[name], ...info, name })),
5217
5250
  dispatch(setSnackbar5("Release details were updated successfully.", TIMEOUTS.fiveSeconds, ""))
5218
5251
  ]);
5219
5252
  })
@@ -5222,7 +5255,7 @@ var setReleaseTags = (0, import_toolkit23.createAsyncThunk)(
5222
5255
  `${sliceName7}/setReleaseTags`,
5223
5256
  ({ name, tags = [] }, { dispatch, getState }) => general_api_default.put(`${deploymentsApiUrlV2}/deployments/releases/${name}/tags`, tags).catch((err) => commonErrorHandler(err, `Release tags couldn't be set.`, dispatch)).then(() => {
5224
5257
  return Promise.all([
5225
- dispatch(actions7.receiveRelease(__spreadProps(__spreadValues({}, getReleasesById(getState())[name]), { name, tags }))),
5258
+ dispatch(actions7.receiveRelease({ ...getReleasesById(getState())[name], name, tags })),
5226
5259
  dispatch(setSnackbar5("Release tags were set successfully.", TIMEOUTS.fiveSeconds, ""))
5227
5260
  ]);
5228
5261
  })
@@ -5239,19 +5272,13 @@ var getUpdateTypes = (0, import_toolkit23.createAsyncThunk)(
5239
5272
  // src/api/users-api.ts
5240
5273
  var import_axios4 = __toESM(require("axios"));
5241
5274
  var Api2 = {
5242
- postLogin: (url, _a) => {
5243
- var _b2 = _a, { email: username, password } = _b2, body = __objRest(_b2, ["email", "password"]);
5244
- return import_axios4.default.post(url, body, __spreadProps(__spreadValues({}, commonRequestConfig), { auth: { username, password } })).then((res) => {
5245
- var _a2;
5246
- return { text: res.data, code: res.status, contentType: (_a2 = res.headers) == null ? void 0 : _a2["content-type"] };
5247
- });
5248
- },
5275
+ postLogin: (url, { email: username, password, ...body }) => import_axios4.default.post(url, body, { ...commonRequestConfig, auth: { username, password } }).then((res) => ({ text: res.data, code: res.status, contentType: res.headers?.["content-type"] })),
5249
5276
  putVerifyTFA: (url, userData) => {
5250
5277
  let body = {};
5251
5278
  if (userData.hasOwnProperty("token2fa")) {
5252
5279
  body = { token2fa: userData.token2fa };
5253
5280
  }
5254
- return import_axios4.default.put(url, body, __spreadProps(__spreadValues({}, commonRequestConfig), { headers: __spreadProps(__spreadValues({}, commonRequestConfig.headers), { Authorization: `Bearer ${getToken()}` }) }));
5281
+ return import_axios4.default.put(url, body, { ...commonRequestConfig, headers: { ...commonRequestConfig.headers, Authorization: `Bearer ${getToken()}` } });
5255
5282
  }
5256
5283
  };
5257
5284
  var users_api_default = Api2;
@@ -5279,43 +5306,40 @@ var handleLoginError = (err, { token2fa: has2FA, password }, rejectWithValue) =>
5279
5306
  };
5280
5307
  var loginUser = (0, import_toolkit24.createAsyncThunk)(
5281
5308
  `${sliceName8}/loginUser`,
5282
- (_a, { dispatch, rejectWithValue }) => {
5283
- var _b2 = _a, { stayLoggedIn } = _b2, userData = __objRest(_b2, ["stayLoggedIn"]);
5284
- return users_api_default.postLogin(`${useradmApiUrlv1}/auth/login`, __spreadProps(__spreadValues({}, userData), { no_expiry: stayLoggedIn })).catch((err) => {
5285
- cleanUp();
5286
- return Promise.reject(dispatch(handleLoginError(err, userData, rejectWithValue)));
5287
- }).then(({ text: response, contentType }) => {
5288
- if (contentType.includes(APPLICATION_JSON_CONTENT_TYPE)) {
5289
- const { id, kind } = response;
5290
- const type = kind.split("/")[1];
5291
- const ssoLoginUrl = SSO_TYPES[type].getStartUrl(id);
5292
- window.location.replace(ssoLoginUrl);
5293
- return;
5294
- }
5295
- const token = response;
5296
- if (contentType !== APPLICATION_JWT_CONTENT_TYPE || !token) {
5297
- return;
5298
- }
5299
- let now = /* @__PURE__ */ new Date();
5300
- now.setSeconds(now.getSeconds() + maxSessionAge);
5301
- const expiresAt = stayLoggedIn ? void 0 : now.toISOString();
5302
- setSessionInfo({ token, expiresAt });
5303
- cookies5.remove("JWT", { path: "/" });
5304
- return (
5305
- // @ts-ignore
5306
- Promise.resolve(dispatch(getUser(OWN_USER_ID))).unwrap().catch((e) => {
5307
- cleanUp();
5308
- return Promise.reject(dispatch(setSnackbar6(extractErrorMessage(e))));
5309
- }).then(() => {
5310
- window.sessionStorage.removeItem("pendings-redirect");
5311
- if (window.location.pathname !== "/ui/") {
5312
- window.location.replace("/ui/");
5313
- }
5314
- return Promise.resolve(dispatch(actions8.successfullyLoggedIn({ expiresAt, token })));
5315
- })
5316
- );
5317
- });
5318
- }
5309
+ ({ stayLoggedIn, ...userData }, { dispatch, rejectWithValue }) => users_api_default.postLogin(`${useradmApiUrlv1}/auth/login`, { ...userData, no_expiry: stayLoggedIn }).catch((err) => {
5310
+ cleanUp();
5311
+ return Promise.reject(dispatch(handleLoginError(err, userData, rejectWithValue)));
5312
+ }).then(({ text: response, contentType }) => {
5313
+ if (contentType.includes(APPLICATION_JSON_CONTENT_TYPE)) {
5314
+ const { id, kind } = response;
5315
+ const type = kind.split("/")[1];
5316
+ const ssoLoginUrl = SSO_TYPES[type].getStartUrl(id);
5317
+ window.location.replace(ssoLoginUrl);
5318
+ return;
5319
+ }
5320
+ const token = response;
5321
+ if (contentType !== APPLICATION_JWT_CONTENT_TYPE || !token) {
5322
+ return;
5323
+ }
5324
+ let now = /* @__PURE__ */ new Date();
5325
+ now.setSeconds(now.getSeconds() + maxSessionAge);
5326
+ const expiresAt = stayLoggedIn ? void 0 : now.toISOString();
5327
+ setSessionInfo({ token, expiresAt });
5328
+ cookies5.remove("JWT", { path: "/" });
5329
+ return (
5330
+ // @ts-ignore
5331
+ Promise.resolve(dispatch(getUser(OWN_USER_ID))).unwrap().catch((e) => {
5332
+ cleanUp();
5333
+ return Promise.reject(dispatch(setSnackbar6(extractErrorMessage(e))));
5334
+ }).then(() => {
5335
+ window.sessionStorage.removeItem("pendings-redirect");
5336
+ if (window.location.pathname !== "/ui/") {
5337
+ window.location.replace("/ui/");
5338
+ }
5339
+ return Promise.resolve(dispatch(actions8.successfullyLoggedIn({ expiresAt, token })));
5340
+ })
5341
+ );
5342
+ })
5319
5343
  );
5320
5344
  var logoutUser = (0, import_toolkit24.createAsyncThunk)(`${sliceName8}/logoutUser`, (_, { dispatch, getState }) => {
5321
5345
  if (Object.keys(getState().app.uploadsById).length) {
@@ -5332,7 +5356,7 @@ var switchUserOrganization = (0, import_toolkit24.createAsyncThunk)(`${sliceName
5332
5356
  return Promise.reject();
5333
5357
  }
5334
5358
  return general_api_default.get(`${useradmApiUrlv1}/users/tenants/${tenantId}/token`).then(({ data: token }) => {
5335
- setSessionInfo(__spreadProps(__spreadValues({}, getSessionInfo()), { token }));
5359
+ setSessionInfo({ ...getSessionInfo(), token });
5336
5360
  window.location.reload();
5337
5361
  });
5338
5362
  });
@@ -5395,13 +5419,13 @@ var getUser = (0, import_toolkit24.createAsyncThunk)(
5395
5419
  );
5396
5420
  var initializeSelf = (0, import_toolkit24.createAsyncThunk)(`${sliceName8}/initializeSelf`, (_, { dispatch }) => dispatch(getUser(OWN_USER_ID)));
5397
5421
  var updateUserColumnSettings = (0, import_toolkit24.createAsyncThunk)(`${sliceName8}/updateUserColumnSettings`, ({ columns, currentUserId }, { dispatch, getState }) => {
5398
- const userId = currentUserId != null ? currentUserId : getCurrentUser(getState()).id;
5422
+ const userId = currentUserId ?? getCurrentUser(getState()).id;
5399
5423
  const storageKey = `${userId}-column-widths`;
5400
5424
  let customColumns = [];
5401
5425
  if (!columns) {
5402
5426
  try {
5403
5427
  customColumns = JSON.parse(window.localStorage.getItem(storageKey)) || customColumns;
5404
- } catch (e) {
5428
+ } catch {
5405
5429
  }
5406
5430
  } else {
5407
5431
  customColumns = columns;
@@ -5430,10 +5454,7 @@ var userActions = {
5430
5454
  var userActionErrorHandler = (err, type, dispatch) => commonErrorHandler(err, `There was an error ${userActions[type].errorMessage} the user.`, dispatch);
5431
5455
  var createUser = (0, import_toolkit24.createAsyncThunk)(
5432
5456
  `${sliceName8}/createUser`,
5433
- (_a, { dispatch }) => {
5434
- var _b2 = _a, { shouldResetPassword } = _b2, userData = __objRest(_b2, ["shouldResetPassword"]);
5435
- return general_api_default.post(`${useradmApiUrlv1}/users`, __spreadProps(__spreadValues({}, userData), { send_reset_password: shouldResetPassword })).then(() => Promise.all([dispatch(actions8.createdUser(userData)), dispatch(getUserList()), dispatch(setSnackbar6(userActions.create.successMessage))])).catch((err) => userActionErrorHandler(err, "create", dispatch));
5436
- }
5457
+ ({ shouldResetPassword, ...userData }, { dispatch }) => general_api_default.post(`${useradmApiUrlv1}/users`, { ...userData, send_reset_password: shouldResetPassword }).then(() => Promise.all([dispatch(actions8.createdUser(userData)), dispatch(getUserList()), dispatch(setSnackbar6(userActions.create.successMessage))])).catch((err) => userActionErrorHandler(err, "create", dispatch))
5437
5458
  );
5438
5459
  var removeUser = (0, import_toolkit24.createAsyncThunk)(
5439
5460
  `${sliceName8}/removeUser`,
@@ -5444,15 +5465,12 @@ var removeUser = (0, import_toolkit24.createAsyncThunk)(
5444
5465
  );
5445
5466
  var editUser = (0, import_toolkit24.createAsyncThunk)(
5446
5467
  `${sliceName8}/editUser`,
5447
- (_a, { dispatch, getState }) => {
5448
- var _b2 = _a, { id } = _b2, userData = __objRest(_b2, ["id"]);
5449
- return general_api_default.put(`${useradmApiUrlv1}/users/${id}`, userData).then(
5450
- () => Promise.all([
5451
- dispatch(actions8.updatedUser(__spreadProps(__spreadValues({}, userData), { id: id === OWN_USER_ID ? getCurrentUser(getState()).id : id }))),
5452
- dispatch(setSnackbar6(userActions.edit.successMessage))
5453
- ])
5454
- );
5455
- }
5468
+ ({ id, ...userData }, { dispatch, getState }) => general_api_default.put(`${useradmApiUrlv1}/users/${id}`, userData).then(
5469
+ () => Promise.all([
5470
+ dispatch(actions8.updatedUser({ ...userData, id: id === OWN_USER_ID ? getCurrentUser(getState()).id : id })),
5471
+ dispatch(setSnackbar6(userActions.edit.successMessage))
5472
+ ])
5473
+ )
5456
5474
  );
5457
5475
  var addUserToCurrentTenant = (0, import_toolkit24.createAsyncThunk)(`${sliceName8}/addUserToTenant`, (userId, { dispatch, getState }) => {
5458
5476
  const { id } = getOrganization(getState());
@@ -5487,7 +5505,7 @@ var mapHttpPermission = (permission) => Object.entries(uiPermissionsByArea).redu
5487
5505
  }
5488
5506
  return accu;
5489
5507
  },
5490
- __spreadValues({}, emptyUiPermissions)
5508
+ { ...emptyUiPermissions }
5491
5509
  );
5492
5510
  var permissionActionTypes = {
5493
5511
  any: mapHttpPermission,
@@ -5510,20 +5528,21 @@ var combinePermissions = (existingPermissions, additionalPermissions = {}) => Ob
5510
5528
  }, existingPermissions);
5511
5529
  var tryParseCustomPermission = (permission) => {
5512
5530
  const uiPermissions = permissionActionTypes[permission.action](permission.object);
5513
- const result = mergePermissions(__spreadValues({}, emptyUiPermissions), uiPermissions);
5531
+ const result = mergePermissions({ ...emptyUiPermissions }, uiPermissions);
5514
5532
  return { isCustom: true, permission, result };
5515
5533
  };
5516
5534
  var customPermissionHandler = (accu, permission) => {
5517
5535
  let processor = tryParseCustomPermission(permission);
5518
- return __spreadProps(__spreadValues({}, accu), {
5536
+ return {
5537
+ ...accu,
5519
5538
  isCustom: accu.isCustom || processor.isCustom,
5520
5539
  uiPermissions: mergePermissions(accu.uiPermissions, processor.result)
5521
- });
5540
+ };
5522
5541
  };
5523
5542
  var mapPermissionSet = (permissionSetName, names, scope, existingGroupsPermissions = {}) => {
5524
5543
  const permission = Object.values(uiPermissionsById).find((permission2) => permission2.permissionSets[scope] === permissionSetName).value;
5525
5544
  const scopedPermissions = names.reduce((accu, name) => combinePermissions(accu, { [name]: [permission] }), existingGroupsPermissions);
5526
- return Object.entries(scopedPermissions).reduce((accu, [key, permissions]) => __spreadProps(__spreadValues({}, accu), { [key]: deriveImpliedAreaPermissions(scope, permissions) }), {});
5545
+ return Object.entries(scopedPermissions).reduce((accu, [key, permissions]) => ({ ...accu, [key]: deriveImpliedAreaPermissions(scope, permissions) }), {});
5527
5546
  };
5528
5547
  var isEmptyPermissionSet = (permissionSet) => !Object.values(permissionSet).reduce((accu, permissions) => {
5529
5548
  if (Array.isArray(permissions)) {
@@ -5538,60 +5557,59 @@ var parseRolePermissions = ({ permission_sets_with_scope = [], permissions = []
5538
5557
  if (!processor) {
5539
5558
  return accu;
5540
5559
  }
5541
- const scope = Object.keys(scopedPermissionAreas).find((scope2) => {
5542
- var _a;
5543
- return uiPermissionsByArea[scope2].scope === ((_a = permissionSet.scope) == null ? void 0 : _a.type);
5544
- });
5560
+ const scope = Object.keys(scopedPermissionAreas).find((scope2) => uiPermissionsByArea[scope2].scope === permissionSet.scope?.type);
5545
5561
  if (scope) {
5546
5562
  const result = mapPermissionSet(permissionSet.name, permissionSet.scope.value, scope, accu.uiPermissions[scope]);
5547
- return __spreadProps(__spreadValues({}, accu), { uiPermissions: __spreadProps(__spreadValues({}, accu.uiPermissions), { [scope]: result }) });
5563
+ return { ...accu, uiPermissions: { ...accu.uiPermissions, [scope]: result } };
5548
5564
  } else if (isEmptyPermissionSet(processor.result)) {
5549
5565
  return processor.permissions.reduce(customPermissionHandler, accu);
5550
5566
  }
5551
- return __spreadProps(__spreadValues({}, accu), {
5567
+ return {
5568
+ ...accu,
5552
5569
  isCustom: accu.isCustom || processor.isCustom,
5553
5570
  uiPermissions: mergePermissions(accu.uiPermissions, processor.result)
5554
- });
5571
+ };
5555
5572
  },
5556
- { isCustom: false, uiPermissions: __spreadProps(__spreadValues({}, emptyUiPermissions), { groups: {}, releases: {} }) }
5573
+ { isCustom: false, uiPermissions: { ...emptyUiPermissions, groups: {}, releases: {} } }
5557
5574
  );
5558
5575
  return permissions.reduce(customPermissionHandler, preliminaryResult);
5559
5576
  };
5560
5577
  var normalizeRbacRoles = (roles, rolesById2, permissionSets) => roles.reduce(
5561
5578
  (accu, role) => {
5562
- var _a;
5563
5579
  let normalizedPermissions;
5564
5580
  let isCustom = false;
5565
5581
  if (rolesById2[role.name]) {
5566
- normalizedPermissions = __spreadProps(__spreadValues({}, rolesById2[role.name].uiPermissions), {
5567
- groups: __spreadValues({}, rolesById2[role.name].uiPermissions.groups),
5568
- releases: __spreadValues({}, rolesById2[role.name].uiPermissions.releases)
5569
- });
5582
+ normalizedPermissions = {
5583
+ ...rolesById2[role.name].uiPermissions,
5584
+ groups: { ...rolesById2[role.name].uiPermissions.groups },
5585
+ releases: { ...rolesById2[role.name].uiPermissions.releases }
5586
+ };
5570
5587
  } else {
5571
5588
  const result = parseRolePermissions(role, permissionSets);
5572
5589
  normalizedPermissions = result.uiPermissions;
5573
5590
  isCustom = result.isCustom;
5574
5591
  }
5575
- const roleState = (_a = accu[role.name]) != null ? _a : __spreadValues({}, emptyRole);
5576
- accu[role.name] = __spreadProps(__spreadValues(__spreadValues({}, roleState), role), {
5592
+ const roleState = accu[role.name] ?? { ...emptyRole };
5593
+ accu[role.name] = {
5594
+ ...roleState,
5595
+ ...role,
5577
5596
  description: roleState.description ? roleState.description : role.description,
5578
5597
  editable: !rolesById[role.name] && !isCustom && (typeof roleState.editable !== "undefined" ? roleState.editable : true),
5579
5598
  isCustom,
5580
5599
  name: roleState.name ? roleState.name : role.name,
5581
5600
  uiPermissions: normalizedPermissions
5582
- });
5601
+ };
5583
5602
  return accu;
5584
5603
  },
5585
- __spreadValues({}, rolesById2)
5604
+ { ...rolesById2 }
5586
5605
  );
5587
5606
  var getPermissionSets = (0, import_toolkit24.createAsyncThunk)(
5588
5607
  `${sliceName8}/getPermissionSets`,
5589
5608
  (_, { dispatch, getState }) => general_api_default.get(`${useradmApiUrlv2}/permission_sets?per_page=500`).then(({ data }) => {
5590
5609
  const permissionSets = data.reduce(
5591
5610
  (accu, permissionSet) => {
5592
- var _a, _b2;
5593
- const permissionSetState = (_a = accu[permissionSet.name]) != null ? _a : {};
5594
- let permissionSetObject = __spreadValues(__spreadValues({}, permissionSetState), permissionSet);
5611
+ const permissionSetState = accu[permissionSet.name] ?? {};
5612
+ let permissionSetObject = { ...permissionSetState, ...permissionSet };
5595
5613
  permissionSetObject.result = Object.values(uiPermissionsById).reduce(
5596
5614
  (accu2, item) => Object.entries(item.permissionSets).reduce((collector, [area, permissionSet2]) => {
5597
5615
  if (scopedPermissionAreas[area]) {
@@ -5602,11 +5620,10 @@ var getPermissionSets = (0, import_toolkit24.createAsyncThunk)(
5602
5620
  }
5603
5621
  return collector;
5604
5622
  }, accu2),
5605
- __spreadValues(__spreadValues({}, emptyUiPermissions), (_b2 = permissionSetObject.result) != null ? _b2 : {})
5623
+ { ...emptyUiPermissions, ...permissionSetObject.result ?? {} }
5606
5624
  );
5607
5625
  const scopes = Object.values(scopedPermissionAreas).reduce((accu2, { key, scopeType }) => {
5608
- var _a2, _b3;
5609
- if (((_a2 = permissionSetObject.supported_scope_types) == null ? void 0 : _a2.includes(key)) || ((_b3 = permissionSetObject.supported_scope_types) == null ? void 0 : _b3.includes(scopeType))) {
5626
+ if (permissionSetObject.supported_scope_types?.includes(key) || permissionSetObject.supported_scope_types?.includes(scopeType)) {
5610
5627
  accu2.push(key);
5611
5628
  }
5612
5629
  return accu2;
@@ -5619,7 +5636,7 @@ var getPermissionSets = (0, import_toolkit24.createAsyncThunk)(
5619
5636
  return accu;
5620
5637
  },
5621
5638
  // @ts-ignore
5622
- __spreadValues({}, getState().users.permissionSetsById)
5639
+ { ...getState().users.permissionSetsById }
5623
5640
  );
5624
5641
  return Promise.all([dispatch(actions8.receivedPermissionSets(permissionSets)), permissionSets]);
5625
5642
  }).catch(() => console.log("Permission set retrieval failed - likely accessing a non-RBAC backend"))
@@ -5652,28 +5669,27 @@ var transformAreaRoleDataToScopedPermissionsSets = (area, areaPermissions, exces
5652
5669
  const skipPermissions = scopedPermissionAreas.releases.key === area && item !== ALL_RELEASES ? [uiPermissionsById.upload.value] : [];
5653
5670
  const impliedPermissions = deriveImpliedAreaPermissions(area, uiPermissions, skipPermissions);
5654
5671
  accu = impliedPermissions.reduce((itemPermissionAccu, impliedPermission) => {
5655
- var _a;
5656
- const permissionSetState = (_a = itemPermissionAccu[uiPermissionsById[impliedPermission].permissionSets[area]]) != null ? _a : {
5672
+ const permissionSetState = itemPermissionAccu[uiPermissionsById[impliedPermission].permissionSets[area]] ?? {
5657
5673
  type: uiPermissionsByArea[area].scope,
5658
5674
  value: []
5659
5675
  };
5660
- itemPermissionAccu[uiPermissionsById[impliedPermission].permissionSets[area]] = __spreadProps(__spreadValues({}, permissionSetState), {
5676
+ itemPermissionAccu[uiPermissionsById[impliedPermission].permissionSets[area]] = {
5677
+ ...permissionSetState,
5661
5678
  value: [...permissionSetState.value, item]
5662
- });
5679
+ };
5663
5680
  return itemPermissionAccu;
5664
5681
  }, accu);
5665
5682
  return accu;
5666
5683
  }, {});
5667
- return Object.entries(permissionSetObject).map((_a) => {
5668
- var [name, _b2] = _a, _c = _b2, { value } = _c, scope = __objRest(_c, ["value"]);
5684
+ return Object.entries(permissionSetObject).map(([name, { value, ...scope }]) => {
5669
5685
  if (value.includes(excessiveAccessSelector)) {
5670
5686
  return { name };
5671
5687
  }
5672
- return { name, scope: __spreadProps(__spreadValues({}, scope), { value: value.filter(import_helpers12.duplicateFilter) }) };
5688
+ return { name, scope: { ...scope, value: value.filter(import_helpers12.duplicateFilter) } };
5673
5689
  });
5674
5690
  };
5675
5691
  var transformRoleDataToRole = (roleData, roleState = {}) => {
5676
- const role = __spreadValues(__spreadValues({}, roleState), roleData);
5692
+ const role = { ...roleState, ...roleData };
5677
5693
  const { description = "", name, uiPermissions = emptyUiPermissions } = role;
5678
5694
  const { maybeUiPermissions, remainderKeys } = Object.entries(emptyUiPermissions).reduce(
5679
5695
  (accu, [key, emptyPermissions]) => {
@@ -5709,12 +5725,17 @@ var transformRoleDataToRole = (roleData, roleState = {}) => {
5709
5725
  }, []);
5710
5726
  return {
5711
5727
  permissionSetsWithScope: [...permissionSetsWithScope, ...scopedPermissionSets],
5712
- role: __spreadProps(__spreadValues({}, emptyRole), {
5728
+ role: {
5729
+ ...emptyRole,
5713
5730
  name,
5714
5731
  // @ts-ignore
5715
5732
  description: description ? description : roleState.description,
5716
- uiPermissions: __spreadValues(__spreadValues(__spreadValues({}, emptyUiPermissions), roleUiPermissions), maybeUiPermissions)
5717
- })
5733
+ uiPermissions: {
5734
+ ...emptyUiPermissions,
5735
+ ...roleUiPermissions,
5736
+ ...maybeUiPermissions
5737
+ }
5738
+ }
5718
5739
  };
5719
5740
  };
5720
5741
  var roleActions = {
@@ -5765,13 +5786,12 @@ var getGlobalSettings2 = (0, import_toolkit24.createAsyncThunk)(
5765
5786
  var saveGlobalSettings = (0, import_toolkit24.createAsyncThunk)(
5766
5787
  `${sliceName8}/saveGlobalSettings`,
5767
5788
  // @ts-ignore
5768
- (_a, { dispatch, getState }) => {
5769
- var _b2 = _a, { beOptimistic = false, notify = false } = _b2, settings = __objRest(_b2, ["beOptimistic", "notify"]);
5789
+ ({ beOptimistic = false, notify = false, ...settings }, { dispatch, getState }) => {
5770
5790
  if (!window.sessionStorage.getItem(settingsKeys.initialized) && !beOptimistic) {
5771
5791
  return;
5772
5792
  }
5773
5793
  return dispatch(getGlobalSettings2()).unwrap().then((result) => {
5774
- let updatedSettings = __spreadValues(__spreadValues({}, getState().users.globalSettings), settings);
5794
+ let updatedSettings = { ...getState().users.globalSettings, ...settings };
5775
5795
  if (getCurrentUser(getState()).verified) {
5776
5796
  updatedSettings["2fa"] = twoFAStates.enabled;
5777
5797
  } else {
@@ -5809,10 +5829,17 @@ var saveUserSettings = (0, import_toolkit24.createAsyncThunk)(`${sliceName8}/sav
5809
5829
  const userSettings = getUserSettings(getState());
5810
5830
  const onboardingState = getOnboardingState(getState());
5811
5831
  const tooltipState = getTooltipsState(getState());
5812
- const updatedSettings = __spreadProps(__spreadValues(__spreadValues({}, userSettings), settings), {
5813
- onboarding: __spreadValues(__spreadValues({}, onboardingState), settings.onboarding),
5832
+ const updatedSettings = {
5833
+ ...userSettings,
5834
+ // @ts-ignore
5835
+ ...settings,
5836
+ onboarding: {
5837
+ ...onboardingState,
5838
+ // @ts-ignore
5839
+ ...settings.onboarding
5840
+ },
5814
5841
  tooltips: tooltipState
5815
- });
5842
+ };
5816
5843
  const headers = result[result.length - 1] ? { "If-Match": result[result.length - 1] } : {};
5817
5844
  return Promise.all([
5818
5845
  Promise.resolve(dispatch(actions8.setUserSettings(updatedSettings))),
@@ -5838,9 +5865,10 @@ var getTokens = (0, import_toolkit24.createAsyncThunk)(
5838
5865
  `${sliceName8}/getTokens`,
5839
5866
  (_, { dispatch, getState }) => general_api_default.get(`${useradmApiUrlv1}/settings/tokens`).then(({ data: tokens }) => {
5840
5867
  const user = getCurrentUser(getState());
5841
- const updatedUser = __spreadProps(__spreadValues({}, user), {
5868
+ const updatedUser = {
5869
+ ...user,
5842
5870
  tokens
5843
- });
5871
+ };
5844
5872
  return Promise.resolve(dispatch(actions8.updatedUser(updatedUser)));
5845
5873
  })
5846
5874
  );
@@ -5856,8 +5884,7 @@ var revokeToken = (0, import_toolkit24.createAsyncThunk)(
5856
5884
  general_api_default.delete(`${useradmApiUrlv1}/settings/tokens/${token.id}`).then(() => Promise.resolve(dispatch(getTokens())))
5857
5885
  )
5858
5886
  );
5859
- var setTooltipReadState = (0, import_toolkit24.createAsyncThunk)(`${sliceName8}/setTooltipReadState`, (_a, { dispatch }) => {
5860
- var _b2 = _a, { persist } = _b2, remainder = __objRest(_b2, ["persist"]);
5887
+ var setTooltipReadState = (0, import_toolkit24.createAsyncThunk)(`${sliceName8}/setTooltipReadState`, ({ persist, ...remainder }, { dispatch }) => {
5861
5888
  let tasks = [dispatch(actions8.setTooltipState(remainder))];
5862
5889
  if (persist) {
5863
5890
  tasks.push(dispatch(saveUserSettings()));
@@ -5865,14 +5892,13 @@ var setTooltipReadState = (0, import_toolkit24.createAsyncThunk)(`${sliceName8}/
5865
5892
  return Promise.all(tasks);
5866
5893
  });
5867
5894
  var setAllTooltipsReadState = (0, import_toolkit24.createAsyncThunk)(`${sliceName8}/toggleHelptips`, ({ readState = READ_STATES.read, tooltips }, { dispatch }) => {
5868
- const updatedTips = tooltips.reduce((accu, id) => __spreadProps(__spreadValues({}, accu), { [id]: { readState } }), {});
5895
+ const updatedTips = tooltips.reduce((accu, id) => ({ ...accu, [id]: { readState } }), {});
5869
5896
  return Promise.resolve(dispatch(actions8.setTooltipsState(updatedTips))).then(() => dispatch(saveUserSettings()));
5870
5897
  });
5871
5898
  var submitFeedback = (0, import_toolkit24.createAsyncThunk)(
5872
5899
  `${sliceName8}/submitFeedback`,
5873
5900
  // @ts-ignore
5874
- (_a, { dispatch }) => {
5875
- var _b2 = _a, { satisfaction, feedback } = _b2, meta = __objRest(_b2, ["satisfaction", "feedback"]);
5901
+ ({ satisfaction, feedback, ...meta }, { dispatch }) => {
5876
5902
  return general_api_default.post(`${tenantadmApiUrlv2}/contact/support`, {
5877
5903
  subject: "feedback submission",
5878
5904
  body: JSON.stringify({ feedback, satisfaction, meta })
@@ -5883,169 +5909,4 @@ var submitFeedback = (0, import_toolkit24.createAsyncThunk)(
5883
5909
  });
5884
5910
  }
5885
5911
  );
5886
- // Annotate the CommonJS export names for ESM import in node:
5887
- 0 && (module.exports = {
5888
- abortDeployment,
5889
- addDevicesToGroup,
5890
- addDynamicGroup,
5891
- addStaticGroup,
5892
- addTenant,
5893
- addUserToCurrentTenant,
5894
- advanceOnboarding,
5895
- applyDeviceConfig,
5896
- applyOnboardingFallbacks,
5897
- cancelFileUpload,
5898
- cancelRequest,
5899
- cancelUpgrade,
5900
- changeIntegration,
5901
- changeNotificationSetting,
5902
- changeSsoConfig,
5903
- completeUpgrade,
5904
- confirmCardUpdate,
5905
- createArtifact,
5906
- createDeployment,
5907
- createIntegration,
5908
- createOrganizationTrial,
5909
- createRole,
5910
- createUser,
5911
- decommissionDevice,
5912
- deleteAuthset,
5913
- deleteIntegration,
5914
- deleteSsoConfig,
5915
- deriveDeploymentGroup,
5916
- deriveInactiveDevices,
5917
- deriveReportsData,
5918
- deviceFileUpload,
5919
- disableUser2fa,
5920
- downloadLicenseReport,
5921
- editArtifact,
5922
- editRole,
5923
- editTenantDeviceLimit,
5924
- editUser,
5925
- enableUser2fa,
5926
- ensureVersionString,
5927
- generateToken,
5928
- get2FAQRCode,
5929
- getAllDeviceCounts,
5930
- getAllDevicesByStatus,
5931
- getAllDynamicGroupDevices,
5932
- getAllGroupDevices,
5933
- getArtifactInstallCount,
5934
- getArtifactUrl,
5935
- getAuditLogs,
5936
- getAuditLogsCsvLink,
5937
- getCurrentCard,
5938
- getDeploymentDevices,
5939
- getDeploymentsByStatus,
5940
- getDeploymentsConfig,
5941
- getDeviceAlerts,
5942
- getDeviceAttributes,
5943
- getDeviceAuth,
5944
- getDeviceById,
5945
- getDeviceConfig,
5946
- getDeviceConnect,
5947
- getDeviceCount,
5948
- getDeviceDeployments,
5949
- getDeviceFileDownloadLink,
5950
- getDeviceInfo,
5951
- getDeviceLimit,
5952
- getDeviceLog,
5953
- getDeviceMonitorConfig,
5954
- getDeviceTwin,
5955
- getDevicesByStatus,
5956
- getDevicesInBounds,
5957
- getDevicesWithAuth,
5958
- getDynamicGroups,
5959
- getExistingReleaseTags,
5960
- getGatewayDevices,
5961
- getGlobalSettings,
5962
- getGroupDevices,
5963
- getGroups,
5964
- getIntegrations,
5965
- getIssueCountsByType,
5966
- getLatestDeviceAlerts,
5967
- getLatestReleaseInfo,
5968
- getOnboardingState,
5969
- getPermissionSets,
5970
- getRelease,
5971
- getReleases,
5972
- getReportingLimits,
5973
- getReportsData,
5974
- getReportsDataWithoutBackendSupport,
5975
- getRoles,
5976
- getSessionDetails,
5977
- getSingleDeployment,
5978
- getSsoConfigById,
5979
- getSsoConfigs,
5980
- getSystemDevices,
5981
- getTargetLocation,
5982
- getTenants,
5983
- getTokens,
5984
- getUpdateTypes,
5985
- getUser,
5986
- getUserList,
5987
- getUserOrganization,
5988
- getUserSettings,
5989
- getWebhookEvents,
5990
- initializeSelf,
5991
- loginUser,
5992
- logoutUser,
5993
- normalizeRbacRoles,
5994
- passwordResetComplete,
5995
- passwordResetStart,
5996
- preauthDevice,
5997
- removeArtifact,
5998
- removeDevicesFromGroup,
5999
- removeDynamicGroup,
6000
- removeRelease,
6001
- removeRole,
6002
- removeStaticGroup,
6003
- removeTenant,
6004
- removeUser,
6005
- requestPlanChange,
6006
- resetDeviceDeployments,
6007
- revokeToken,
6008
- saveDeltaDeploymentsConfig,
6009
- saveGlobalSettings,
6010
- saveUserSettings,
6011
- searchDevices,
6012
- selectGroup,
6013
- selectRelease,
6014
- sendSupportMessage,
6015
- setAllTooltipsReadState,
6016
- setAuditlogsState,
6017
- setDeploymentsState,
6018
- setDeviceConfig,
6019
- setDeviceListState,
6020
- setDeviceTags,
6021
- setDeviceTwin,
6022
- setFirstLoginAfterSignup,
6023
- setHideAnnouncement,
6024
- setOfflineThreshold,
6025
- setOnboardingApproach,
6026
- setOnboardingCanceled,
6027
- setOnboardingComplete,
6028
- setOnboardingDeviceType,
6029
- setReleaseTags,
6030
- setReleasesListState,
6031
- setSearchState,
6032
- setTenantsListState,
6033
- setTooltipReadState,
6034
- startCardUpdate,
6035
- startUpgrade,
6036
- storeSsoConfig,
6037
- submitFeedback,
6038
- switchUserOrganization,
6039
- tenantDataDivergedMessage,
6040
- updateDeploymentControlMap,
6041
- updateDeviceAuth,
6042
- updateDevicesAuth,
6043
- updateDynamicGroup,
6044
- updateReleaseInfo,
6045
- updateUserColumnSettings,
6046
- uploadArtifact,
6047
- verify2FA,
6048
- verifyEmailComplete,
6049
- verifyEmailStart
6050
- });
6051
5912
  //# sourceMappingURL=thunks.js.map