@davra/ui-core 1.0.0-alpha.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 (100) hide show
  1. package/README.md +183 -0
  2. package/dist/style.css +1 -0
  3. package/dist/types/components/ComponentA.vue.d.ts +12 -0
  4. package/dist/types/components/ComponentB.vue.d.ts +2 -0
  5. package/dist/types/components/index.d.ts +3 -0
  6. package/dist/types/constants/MyConstants.d.ts +1 -0
  7. package/dist/types/constants/index.d.ts +2 -0
  8. package/dist/types/index.d.ts +10 -0
  9. package/dist/types/services/davraApi.d.ts +5 -0
  10. package/dist/types/services/devicesCountersService.d.ts +10 -0
  11. package/dist/types/services/devicesCountersService.test.d.ts +1 -0
  12. package/dist/types/services/devicesService.d.ts +18 -0
  13. package/dist/types/services/devicesService.test.d.ts +1 -0
  14. package/dist/types/services/index.d.ts +10 -0
  15. package/dist/types/services/labelsService.d.ts +8 -0
  16. package/dist/types/services/labelsService.test.d.ts +1 -0
  17. package/dist/types/services/metricsCountersService.d.ts +5 -0
  18. package/dist/types/services/metricsCountersService.test.d.ts +1 -0
  19. package/dist/types/services/metricsService.d.ts +6 -0
  20. package/dist/types/services/metricsService.test.d.ts +1 -0
  21. package/dist/types/services/timeseriesService.d.ts +5 -0
  22. package/dist/types/services/timeseriesService.test.d.ts +1 -0
  23. package/dist/types/services/twinTypesService.d.ts +5 -0
  24. package/dist/types/services/twinTypesService.test.d.ts +1 -0
  25. package/dist/types/services/twinsCountersService.d.ts +6 -0
  26. package/dist/types/services/twinsCountersService.test.d.ts +1 -0
  27. package/dist/types/services/twinsService.d.ts +22 -0
  28. package/dist/types/services/twinsService.test.d.ts +1 -0
  29. package/dist/types/services/userSessionService.d.ts +12 -0
  30. package/dist/types/services/userSessionService.test.d.ts +1 -0
  31. package/dist/types/stores/alertMessages.d.ts +19 -0
  32. package/dist/types/stores/alertMessages.test.d.ts +1 -0
  33. package/dist/types/stores/devices.d.ts +42 -0
  34. package/dist/types/stores/devices.test.d.ts +1 -0
  35. package/dist/types/stores/index.d.ts +7 -0
  36. package/dist/types/stores/labels.d.ts +20 -0
  37. package/dist/types/stores/labels.test.d.ts +1 -0
  38. package/dist/types/stores/metrics.d.ts +39 -0
  39. package/dist/types/stores/metrics.test.d.ts +1 -0
  40. package/dist/types/stores/twinTypes.d.ts +27 -0
  41. package/dist/types/stores/twinTypes.test.d.ts +1 -0
  42. package/dist/types/stores/twins.d.ts +42 -0
  43. package/dist/types/stores/twins.test.d.ts +1 -0
  44. package/dist/types/stores/userSession.d.ts +24 -0
  45. package/dist/types/stores/userSession.test.d.ts +1 -0
  46. package/dist/types/types.d.ts +175 -0
  47. package/dist/types/utils/MyUtil.d.ts +5 -0
  48. package/dist/types/utils/index.d.ts +2 -0
  49. package/dist/ui-core.es.js +1982 -0
  50. package/package.json +46 -0
  51. package/src/assets/fonts/myfont.woff +0 -0
  52. package/src/assets/main.scss +17 -0
  53. package/src/auto-imports.d.ts +200 -0
  54. package/src/components/ComponentA.vue +13 -0
  55. package/src/components/ComponentB.vue +26 -0
  56. package/src/components/index.ts +7 -0
  57. package/src/constants/MyConstants.ts +1 -0
  58. package/src/constants/index.ts +5 -0
  59. package/src/env.d.ts +8 -0
  60. package/src/index.ts +23 -0
  61. package/src/services/davraApi.ts +18 -0
  62. package/src/services/devicesCountersService.test.ts +209 -0
  63. package/src/services/devicesCountersService.ts +117 -0
  64. package/src/services/devicesService.test.ts +207 -0
  65. package/src/services/devicesService.ts +110 -0
  66. package/src/services/index.ts +22 -0
  67. package/src/services/labelsService.test.ts +124 -0
  68. package/src/services/labelsService.ts +71 -0
  69. package/src/services/metricsCountersService.test.ts +44 -0
  70. package/src/services/metricsCountersService.ts +24 -0
  71. package/src/services/metricsService.test.ts +97 -0
  72. package/src/services/metricsService.ts +54 -0
  73. package/src/services/timeseriesService.test.ts +86 -0
  74. package/src/services/timeseriesService.ts +24 -0
  75. package/src/services/twinTypesService.test.ts +74 -0
  76. package/src/services/twinTypesService.ts +24 -0
  77. package/src/services/twinsCountersService.test.ts +72 -0
  78. package/src/services/twinsCountersService.ts +40 -0
  79. package/src/services/twinsService.test.ts +228 -0
  80. package/src/services/twinsService.ts +137 -0
  81. package/src/services/userSessionService.test.ts +74 -0
  82. package/src/services/userSessionService.ts +82 -0
  83. package/src/stores/alertMessages.test.ts +27 -0
  84. package/src/stores/alertMessages.ts +26 -0
  85. package/src/stores/devices.test.ts +149 -0
  86. package/src/stores/devices.ts +78 -0
  87. package/src/stores/index.ts +12 -0
  88. package/src/stores/labels.test.ts +72 -0
  89. package/src/stores/labels.ts +39 -0
  90. package/src/stores/metrics.test.ts +116 -0
  91. package/src/stores/metrics.ts +71 -0
  92. package/src/stores/twinTypes.test.ts +71 -0
  93. package/src/stores/twinTypes.ts +36 -0
  94. package/src/stores/twins.test.ts +148 -0
  95. package/src/stores/twins.ts +78 -0
  96. package/src/stores/userSession.test.ts +107 -0
  97. package/src/stores/userSession.ts +57 -0
  98. package/src/types.ts +173 -0
  99. package/src/utils/MyUtil.ts +7 -0
  100. package/src/utils/index.ts +5 -0
@@ -0,0 +1,1982 @@
1
+ import { defineComponent as Se, openBlock as T, createElementBlock as x, createTextVNode as je, toDisplayString as q, createElementVNode as A, mergeProps as I, resolveComponent as Le, resolveDirective as ke, withDirectives as Fe, renderSlot as X, normalizeClass as le, createBlock as Ve, createCommentVNode as ue, ref as v, createVNode as de, unref as pe, pushScopeId as Be, popScopeId as We, hasInjectionContext as Me, inject as He, getCurrentInstance as qe, watch as ze, reactive as Ye, markRaw as k, effectScope as Je, isRef as $, isReactive as Y, toRef as H, toRaw as Ae, nextTick as fe, computed as D, getCurrentScope as Xe, onScopeDispose as Ge, toRefs as he } from "vue";
2
+ import Ze from "axios";
3
+ const Qe = /* @__PURE__ */ A("span", {
4
+ class: "icon-heart",
5
+ style: { color: "tomato" }
6
+ }, null, -1), Ke = /* @__PURE__ */ Se({
7
+ __name: "ComponentA",
8
+ props: {
9
+ msg: {}
10
+ },
11
+ setup(e) {
12
+ return (t, n) => (T(), x("div", null, [
13
+ je(" Hello " + q(t.msg) + "! ", 1),
14
+ Qe
15
+ ]));
16
+ }
17
+ });
18
+ var S = {
19
+ innerWidth(e) {
20
+ if (e) {
21
+ let t = e.offsetWidth, n = getComputedStyle(e);
22
+ return t += parseFloat(n.paddingLeft) + parseFloat(n.paddingRight), t;
23
+ }
24
+ return 0;
25
+ },
26
+ width(e) {
27
+ if (e) {
28
+ let t = e.offsetWidth, n = getComputedStyle(e);
29
+ return t -= parseFloat(n.paddingLeft) + parseFloat(n.paddingRight), t;
30
+ }
31
+ return 0;
32
+ },
33
+ getWindowScrollTop() {
34
+ let e = document.documentElement;
35
+ return (window.pageYOffset || e.scrollTop) - (e.clientTop || 0);
36
+ },
37
+ getWindowScrollLeft() {
38
+ let e = document.documentElement;
39
+ return (window.pageXOffset || e.scrollLeft) - (e.clientLeft || 0);
40
+ },
41
+ getOuterWidth(e, t) {
42
+ if (e) {
43
+ let n = e.offsetWidth;
44
+ if (t) {
45
+ let s = getComputedStyle(e);
46
+ n += parseFloat(s.marginLeft) + parseFloat(s.marginRight);
47
+ }
48
+ return n;
49
+ }
50
+ return 0;
51
+ },
52
+ getOuterHeight(e, t) {
53
+ if (e) {
54
+ let n = e.offsetHeight;
55
+ if (t) {
56
+ let s = getComputedStyle(e);
57
+ n += parseFloat(s.marginTop) + parseFloat(s.marginBottom);
58
+ }
59
+ return n;
60
+ }
61
+ return 0;
62
+ },
63
+ getClientHeight(e, t) {
64
+ if (e) {
65
+ let n = e.clientHeight;
66
+ if (t) {
67
+ let s = getComputedStyle(e);
68
+ n += parseFloat(s.marginTop) + parseFloat(s.marginBottom);
69
+ }
70
+ return n;
71
+ }
72
+ return 0;
73
+ },
74
+ getViewport() {
75
+ let e = window, t = document, n = t.documentElement, s = t.getElementsByTagName("body")[0], o = e.innerWidth || n.clientWidth || s.clientWidth, r = e.innerHeight || n.clientHeight || s.clientHeight;
76
+ return { width: o, height: r };
77
+ },
78
+ getOffset(e) {
79
+ if (e) {
80
+ let t = e.getBoundingClientRect();
81
+ return {
82
+ top: t.top + (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0),
83
+ left: t.left + (window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0)
84
+ };
85
+ }
86
+ return {
87
+ top: "auto",
88
+ left: "auto"
89
+ };
90
+ },
91
+ index(e) {
92
+ if (e) {
93
+ let t = e.parentNode.childNodes, n = 0;
94
+ for (let s = 0; s < t.length; s++) {
95
+ if (t[s] === e)
96
+ return n;
97
+ t[s].nodeType === 1 && n++;
98
+ }
99
+ }
100
+ return -1;
101
+ },
102
+ addMultipleClasses(e, t) {
103
+ if (e && t)
104
+ if (e.classList) {
105
+ let n = t.split(" ");
106
+ for (let s = 0; s < n.length; s++)
107
+ e.classList.add(n[s]);
108
+ } else {
109
+ let n = t.split(" ");
110
+ for (let s = 0; s < n.length; s++)
111
+ e.className += " " + n[s];
112
+ }
113
+ },
114
+ addClass(e, t) {
115
+ e && t && (e.classList ? e.classList.add(t) : e.className += " " + t);
116
+ },
117
+ removeClass(e, t) {
118
+ e && t && (e.classList ? e.classList.remove(t) : e.className = e.className.replace(new RegExp("(^|\\b)" + t.split(" ").join("|") + "(\\b|$)", "gi"), " "));
119
+ },
120
+ hasClass(e, t) {
121
+ return e ? e.classList ? e.classList.contains(t) : new RegExp("(^| )" + t + "( |$)", "gi").test(e.className) : !1;
122
+ },
123
+ find(e, t) {
124
+ return this.isElement(e) ? e.querySelectorAll(t) : [];
125
+ },
126
+ findSingle(e, t) {
127
+ return this.isElement(e) ? e.querySelector(t) : null;
128
+ },
129
+ getHeight(e) {
130
+ if (e) {
131
+ let t = e.offsetHeight, n = getComputedStyle(e);
132
+ return t -= parseFloat(n.paddingTop) + parseFloat(n.paddingBottom) + parseFloat(n.borderTopWidth) + parseFloat(n.borderBottomWidth), t;
133
+ }
134
+ return 0;
135
+ },
136
+ getWidth(e) {
137
+ if (e) {
138
+ let t = e.offsetWidth, n = getComputedStyle(e);
139
+ return t -= parseFloat(n.paddingLeft) + parseFloat(n.paddingRight) + parseFloat(n.borderLeftWidth) + parseFloat(n.borderRightWidth), t;
140
+ }
141
+ return 0;
142
+ },
143
+ absolutePosition(e, t) {
144
+ if (e) {
145
+ let n = e.offsetParent ? { width: e.offsetWidth, height: e.offsetHeight } : this.getHiddenElementDimensions(e), s = n.height, o = n.width, r = t.offsetHeight, a = t.offsetWidth, i = t.getBoundingClientRect(), c = this.getWindowScrollTop(), d = this.getWindowScrollLeft(), y = this.getViewport(), h, m;
146
+ i.top + r + s > y.height ? (h = i.top + c - s, e.style.transformOrigin = "bottom", h < 0 && (h = c)) : (h = r + i.top + c, e.style.transformOrigin = "top"), i.left + o > y.width ? m = Math.max(0, i.left + d + a - o) : m = i.left + d, e.style.top = h + "px", e.style.left = m + "px";
147
+ }
148
+ },
149
+ relativePosition(e, t) {
150
+ if (e) {
151
+ let n = e.offsetParent ? { width: e.offsetWidth, height: e.offsetHeight } : this.getHiddenElementDimensions(e);
152
+ const s = t.offsetHeight, o = t.getBoundingClientRect(), r = this.getViewport();
153
+ let a, i;
154
+ o.top + s + n.height > r.height ? (a = -1 * n.height, e.style.transformOrigin = "bottom", o.top + a < 0 && (a = -1 * o.top)) : (a = s, e.style.transformOrigin = "top"), n.width > r.width ? i = o.left * -1 : o.left + n.width > r.width ? i = (o.left + n.width - r.width) * -1 : i = 0, e.style.top = a + "px", e.style.left = i + "px";
155
+ }
156
+ },
157
+ getParents(e, t = []) {
158
+ return e.parentNode === null ? t : this.getParents(e.parentNode, t.concat([e.parentNode]));
159
+ },
160
+ getScrollableParents(e) {
161
+ let t = [];
162
+ if (e) {
163
+ let n = this.getParents(e);
164
+ const s = /(auto|scroll)/, o = (r) => {
165
+ let a = window.getComputedStyle(r, null);
166
+ return s.test(a.getPropertyValue("overflow")) || s.test(a.getPropertyValue("overflowX")) || s.test(a.getPropertyValue("overflowY"));
167
+ };
168
+ for (let r of n) {
169
+ let a = r.nodeType === 1 && r.dataset.scrollselectors;
170
+ if (a) {
171
+ let i = a.split(",");
172
+ for (let c of i) {
173
+ let d = this.findSingle(r, c);
174
+ d && o(d) && t.push(d);
175
+ }
176
+ }
177
+ r.nodeType !== 9 && o(r) && t.push(r);
178
+ }
179
+ }
180
+ return t;
181
+ },
182
+ getHiddenElementOuterHeight(e) {
183
+ if (e) {
184
+ e.style.visibility = "hidden", e.style.display = "block";
185
+ let t = e.offsetHeight;
186
+ return e.style.display = "none", e.style.visibility = "visible", t;
187
+ }
188
+ return 0;
189
+ },
190
+ getHiddenElementOuterWidth(e) {
191
+ if (e) {
192
+ e.style.visibility = "hidden", e.style.display = "block";
193
+ let t = e.offsetWidth;
194
+ return e.style.display = "none", e.style.visibility = "visible", t;
195
+ }
196
+ return 0;
197
+ },
198
+ getHiddenElementDimensions(e) {
199
+ if (e) {
200
+ let t = {};
201
+ return e.style.visibility = "hidden", e.style.display = "block", t.width = e.offsetWidth, t.height = e.offsetHeight, e.style.display = "none", e.style.visibility = "visible", t;
202
+ }
203
+ return 0;
204
+ },
205
+ fadeIn(e, t) {
206
+ if (e) {
207
+ e.style.opacity = 0;
208
+ let n = +/* @__PURE__ */ new Date(), s = 0, o = function() {
209
+ s = +e.style.opacity + ((/* @__PURE__ */ new Date()).getTime() - n) / t, e.style.opacity = s, n = +/* @__PURE__ */ new Date(), +s < 1 && (window.requestAnimationFrame && requestAnimationFrame(o) || setTimeout(o, 16));
210
+ };
211
+ o();
212
+ }
213
+ },
214
+ fadeOut(e, t) {
215
+ if (e) {
216
+ let n = 1, s = 50, o = t, r = s / o, a = setInterval(() => {
217
+ n -= r, n <= 0 && (n = 0, clearInterval(a)), e.style.opacity = n;
218
+ }, s);
219
+ }
220
+ },
221
+ getUserAgent() {
222
+ return navigator.userAgent;
223
+ },
224
+ appendChild(e, t) {
225
+ if (this.isElement(t))
226
+ t.appendChild(e);
227
+ else if (t.el && t.elElement)
228
+ t.elElement.appendChild(e);
229
+ else
230
+ throw new Error("Cannot append " + t + " to " + e);
231
+ },
232
+ isElement(e) {
233
+ return typeof HTMLElement == "object" ? e instanceof HTMLElement : e && typeof e == "object" && e !== null && e.nodeType === 1 && typeof e.nodeName == "string";
234
+ },
235
+ scrollInView(e, t) {
236
+ let n = getComputedStyle(e).getPropertyValue("borderTopWidth"), s = n ? parseFloat(n) : 0, o = getComputedStyle(e).getPropertyValue("paddingTop"), r = o ? parseFloat(o) : 0, a = e.getBoundingClientRect(), c = t.getBoundingClientRect().top + document.body.scrollTop - (a.top + document.body.scrollTop) - s - r, d = e.scrollTop, y = e.clientHeight, h = this.getOuterHeight(t);
237
+ c < 0 ? e.scrollTop = d + c : c + h > y && (e.scrollTop = d + c - y + h);
238
+ },
239
+ clearSelection() {
240
+ if (window.getSelection)
241
+ window.getSelection().empty ? window.getSelection().empty() : window.getSelection().removeAllRanges && window.getSelection().rangeCount > 0 && window.getSelection().getRangeAt(0).getClientRects().length > 0 && window.getSelection().removeAllRanges();
242
+ else if (document.selection && document.selection.empty)
243
+ try {
244
+ document.selection.empty();
245
+ } catch {
246
+ }
247
+ },
248
+ getSelection() {
249
+ return window.getSelection ? window.getSelection().toString() : document.getSelection ? document.getSelection().toString() : document.selection ? document.selection.createRange().text : null;
250
+ },
251
+ calculateScrollbarWidth() {
252
+ if (this.calculatedScrollbarWidth != null)
253
+ return this.calculatedScrollbarWidth;
254
+ let e = document.createElement("div");
255
+ e.className = "p-scrollbar-measure", document.body.appendChild(e);
256
+ let t = e.offsetWidth - e.clientWidth;
257
+ return document.body.removeChild(e), this.calculatedScrollbarWidth = t, t;
258
+ },
259
+ getBrowser() {
260
+ if (!this.browser) {
261
+ let e = this.resolveUserAgent();
262
+ this.browser = {}, e.browser && (this.browser[e.browser] = !0, this.browser.version = e.version), this.browser.chrome ? this.browser.webkit = !0 : this.browser.webkit && (this.browser.safari = !0);
263
+ }
264
+ return this.browser;
265
+ },
266
+ resolveUserAgent() {
267
+ let e = navigator.userAgent.toLowerCase(), t = /(chrome)[ ]([\w.]+)/.exec(e) || /(webkit)[ ]([\w.]+)/.exec(e) || /(opera)(?:.*version|)[ ]([\w.]+)/.exec(e) || /(msie) ([\w.]+)/.exec(e) || e.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e) || [];
268
+ return {
269
+ browser: t[1] || "",
270
+ version: t[2] || "0"
271
+ };
272
+ },
273
+ isVisible(e) {
274
+ return e && e.offsetParent != null;
275
+ },
276
+ invokeElementMethod(e, t, n) {
277
+ e[t].apply(e, n);
278
+ },
279
+ isExist(e) {
280
+ return !!(e !== null && typeof e < "u" && e.nodeName && e.parentNode);
281
+ },
282
+ isClient() {
283
+ return !!(typeof window < "u" && window.document && window.document.createElement);
284
+ },
285
+ focus(e, t) {
286
+ e && document.activeElement !== e && e.focus(t);
287
+ },
288
+ isFocusableElement(e, t = "") {
289
+ return this.isElement(e) ? e.matches(`button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
290
+ [href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
291
+ input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
292
+ select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
293
+ textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
294
+ [tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
295
+ [contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t}`) : !1;
296
+ },
297
+ getFocusableElements(e, t = "") {
298
+ let n = this.find(
299
+ e,
300
+ `button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
301
+ [href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
302
+ input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
303
+ select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
304
+ textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
305
+ [tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
306
+ [contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t}`
307
+ ), s = [];
308
+ for (let o of n)
309
+ getComputedStyle(o).display != "none" && getComputedStyle(o).visibility != "hidden" && s.push(o);
310
+ return s;
311
+ },
312
+ getFirstFocusableElement(e, t) {
313
+ const n = this.getFocusableElements(e, t);
314
+ return n.length > 0 ? n[0] : null;
315
+ },
316
+ getLastFocusableElement(e, t) {
317
+ const n = this.getFocusableElements(e, t);
318
+ return n.length > 0 ? n[n.length - 1] : null;
319
+ },
320
+ getNextFocusableElement(e, t, n) {
321
+ const s = this.getFocusableElements(e, n), o = s.length > 0 ? s.findIndex((a) => a === t) : -1, r = o > -1 && s.length >= o + 1 ? o + 1 : -1;
322
+ return r > -1 ? s[r] : null;
323
+ },
324
+ isClickable(e) {
325
+ if (e) {
326
+ const t = e.nodeName, n = e.parentElement && e.parentElement.nodeName;
327
+ return t === "INPUT" || t === "TEXTAREA" || t === "BUTTON" || t === "A" || n === "INPUT" || n === "TEXTAREA" || n === "BUTTON" || n === "A" || !!e.closest(".p-button, .p-checkbox, .p-radiobutton");
328
+ }
329
+ return !1;
330
+ },
331
+ applyStyle(e, t) {
332
+ if (typeof t == "string")
333
+ e.style.cssText = t;
334
+ else
335
+ for (let n in t)
336
+ e.style[n] = t[n];
337
+ },
338
+ isIOS() {
339
+ return /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
340
+ },
341
+ isAndroid() {
342
+ return /(android)/i.test(navigator.userAgent);
343
+ },
344
+ isTouchDevice() {
345
+ return "ontouchstart" in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;
346
+ },
347
+ exportCSV(e, t) {
348
+ let n = new Blob([e], {
349
+ type: "application/csv;charset=utf-8;"
350
+ });
351
+ if (window.navigator.msSaveOrOpenBlob)
352
+ navigator.msSaveOrOpenBlob(n, t + ".csv");
353
+ else {
354
+ let s = document.createElement("a");
355
+ s.download !== void 0 ? (s.setAttribute("href", URL.createObjectURL(n)), s.setAttribute("download", t + ".csv"), s.style.display = "none", document.body.appendChild(s), s.click(), document.body.removeChild(s)) : (e = "data:text/csv;charset=utf-8," + e, window.open(encodeURI(e)));
356
+ }
357
+ }
358
+ }, R = {
359
+ equals(e, t, n) {
360
+ return n ? this.resolveFieldData(e, n) === this.resolveFieldData(t, n) : this.deepEquals(e, t);
361
+ },
362
+ deepEquals(e, t) {
363
+ if (e === t)
364
+ return !0;
365
+ if (e && t && typeof e == "object" && typeof t == "object") {
366
+ var n = Array.isArray(e), s = Array.isArray(t), o, r, a;
367
+ if (n && s) {
368
+ if (r = e.length, r != t.length)
369
+ return !1;
370
+ for (o = r; o-- !== 0; )
371
+ if (!this.deepEquals(e[o], t[o]))
372
+ return !1;
373
+ return !0;
374
+ }
375
+ if (n != s)
376
+ return !1;
377
+ var i = e instanceof Date, c = t instanceof Date;
378
+ if (i != c)
379
+ return !1;
380
+ if (i && c)
381
+ return e.getTime() == t.getTime();
382
+ var d = e instanceof RegExp, y = t instanceof RegExp;
383
+ if (d != y)
384
+ return !1;
385
+ if (d && y)
386
+ return e.toString() == t.toString();
387
+ var h = Object.keys(e);
388
+ if (r = h.length, r !== Object.keys(t).length)
389
+ return !1;
390
+ for (o = r; o-- !== 0; )
391
+ if (!Object.prototype.hasOwnProperty.call(t, h[o]))
392
+ return !1;
393
+ for (o = r; o-- !== 0; )
394
+ if (a = h[o], !this.deepEquals(e[a], t[a]))
395
+ return !1;
396
+ return !0;
397
+ }
398
+ return e !== e && t !== t;
399
+ },
400
+ resolveFieldData(e, t) {
401
+ if (e && Object.keys(e).length && t) {
402
+ if (this.isFunction(t))
403
+ return t(e);
404
+ if (t.indexOf(".") === -1)
405
+ return e[t];
406
+ {
407
+ let o = t.split("."), r = e;
408
+ for (var n = 0, s = o.length; n < s; ++n) {
409
+ if (r == null)
410
+ return null;
411
+ r = r[o[n]];
412
+ }
413
+ return r;
414
+ }
415
+ } else
416
+ return null;
417
+ },
418
+ isFunction(e) {
419
+ return !!(e && e.constructor && e.call && e.apply);
420
+ },
421
+ getItemValue(e, ...t) {
422
+ return this.isFunction(e) ? e(...t) : e;
423
+ },
424
+ filter(e, t, n) {
425
+ var s = [];
426
+ if (e) {
427
+ for (let o of e)
428
+ for (let r of t)
429
+ if (String(this.resolveFieldData(o, r)).toLowerCase().indexOf(n.toLowerCase()) > -1) {
430
+ s.push(o);
431
+ break;
432
+ }
433
+ }
434
+ return s;
435
+ },
436
+ reorderArray(e, t, n) {
437
+ e && t !== n && (n >= e.length && (n %= e.length, t %= e.length), e.splice(n, 0, e.splice(t, 1)[0]));
438
+ },
439
+ findIndexInList(e, t) {
440
+ let n = -1;
441
+ if (t) {
442
+ for (let s = 0; s < t.length; s++)
443
+ if (t[s] === e) {
444
+ n = s;
445
+ break;
446
+ }
447
+ }
448
+ return n;
449
+ },
450
+ contains(e, t) {
451
+ if (e != null && t && t.length) {
452
+ for (let n of t)
453
+ if (this.equals(e, n))
454
+ return !0;
455
+ }
456
+ return !1;
457
+ },
458
+ insertIntoOrderedArray(e, t, n, s) {
459
+ if (n.length > 0) {
460
+ let o = !1;
461
+ for (let r = 0; r < n.length; r++)
462
+ if (this.findIndexInList(n[r], s) > t) {
463
+ n.splice(r, 0, e), o = !0;
464
+ break;
465
+ }
466
+ o || n.push(e);
467
+ } else
468
+ n.push(e);
469
+ },
470
+ removeAccents(e) {
471
+ return e && e.search(/[\xC0-\xFF]/g) > -1 && (e = e.replace(/[\xC0-\xC5]/g, "A").replace(/[\xC6]/g, "AE").replace(/[\xC7]/g, "C").replace(/[\xC8-\xCB]/g, "E").replace(/[\xCC-\xCF]/g, "I").replace(/[\xD0]/g, "D").replace(/[\xD1]/g, "N").replace(/[\xD2-\xD6\xD8]/g, "O").replace(/[\xD9-\xDC]/g, "U").replace(/[\xDD]/g, "Y").replace(/[\xDE]/g, "P").replace(/[\xE0-\xE5]/g, "a").replace(/[\xE6]/g, "ae").replace(/[\xE7]/g, "c").replace(/[\xE8-\xEB]/g, "e").replace(/[\xEC-\xEF]/g, "i").replace(/[\xF1]/g, "n").replace(/[\xF2-\xF6\xF8]/g, "o").replace(/[\xF9-\xFC]/g, "u").replace(/[\xFE]/g, "p").replace(/[\xFD\xFF]/g, "y")), e;
472
+ },
473
+ getVNodeProp(e, t) {
474
+ let n = e.props;
475
+ if (n) {
476
+ let s = t.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(), o = Object.prototype.hasOwnProperty.call(n, s) ? s : t;
477
+ return e.type.props[t].type === Boolean && n[o] === "" ? !0 : n[o];
478
+ }
479
+ return null;
480
+ },
481
+ convertToFlatCase(e) {
482
+ return this.isNotEmpty(e) ? e.replace(/(-|_)/g, "").toLowerCase() : e;
483
+ },
484
+ isEmpty(e) {
485
+ return e == null || e === "" || Array.isArray(e) && e.length === 0 || !(e instanceof Date) && typeof e == "object" && Object.keys(e).length === 0;
486
+ },
487
+ isNotEmpty(e) {
488
+ return !this.isEmpty(e);
489
+ },
490
+ isPrintableCharacter(e = "") {
491
+ return this.isNotEmpty(e) && e.length === 1 && e.match(/\S| /);
492
+ },
493
+ /**
494
+ * Firefox-v103 does not currently support the "findLast" method. It is stated that this method will be supported with Firefox-v104.
495
+ * https://caniuse.com/mdn-javascript_builtins_array_findlast
496
+ */
497
+ findLast(e, t) {
498
+ let n;
499
+ if (this.isNotEmpty(e))
500
+ try {
501
+ n = e.findLast(t);
502
+ } catch {
503
+ n = [...e].reverse().find(t);
504
+ }
505
+ return n;
506
+ },
507
+ /**
508
+ * Firefox-v103 does not currently support the "findLastIndex" method. It is stated that this method will be supported with Firefox-v104.
509
+ * https://caniuse.com/mdn-javascript_builtins_array_findlastindex
510
+ */
511
+ findLastIndex(e, t) {
512
+ let n = -1;
513
+ if (this.isNotEmpty(e))
514
+ try {
515
+ n = e.findLastIndex(t);
516
+ } catch {
517
+ n = e.lastIndexOf([...e].reverse().find(t));
518
+ }
519
+ return n;
520
+ }
521
+ }, et = {
522
+ name: "BaseComponent",
523
+ props: {
524
+ pt: {
525
+ type: Object,
526
+ default: void 0
527
+ }
528
+ },
529
+ methods: {
530
+ getOption(e = {}, t = "") {
531
+ const n = R.convertToFlatCase(t);
532
+ return e[Object.keys(e).find((s) => R.convertToFlatCase(s) === n) || ""];
533
+ },
534
+ getPTValue(e = {}, t = "", n = {}) {
535
+ const s = R.getItemValue(this.getOption(e, t), n), o = R.getItemValue(this.getOption(this.defaultPT, t), n);
536
+ return I(s, o);
537
+ },
538
+ ptm(e = "", t = {}) {
539
+ return this.getPTValue(this.pt, e, { props: this.$props, state: this.$data, ...t });
540
+ },
541
+ ptmo(e = {}, t = "", n = {}) {
542
+ return this.getPTValue(e, t, n);
543
+ }
544
+ },
545
+ computed: {
546
+ defaultPT() {
547
+ return R.getItemValue(this.getOption(this.$primevue.config.pt, this.$.type.name), this.defaultsParams);
548
+ },
549
+ defaultsParams() {
550
+ return { instance: this.$ };
551
+ }
552
+ }
553
+ }, tt = {
554
+ name: "BaseIcon",
555
+ props: {
556
+ label: {
557
+ type: String,
558
+ default: void 0
559
+ },
560
+ spin: {
561
+ type: Boolean,
562
+ default: !1
563
+ }
564
+ },
565
+ methods: {
566
+ pti() {
567
+ const e = R.isEmpty(this.label);
568
+ return {
569
+ class: [
570
+ "p-icon",
571
+ {
572
+ "p-icon-spin": this.spin
573
+ }
574
+ ],
575
+ role: e ? void 0 : "img",
576
+ "aria-label": e ? void 0 : this.label,
577
+ "aria-hidden": e
578
+ };
579
+ }
580
+ }
581
+ };
582
+ function nt(e, t) {
583
+ t === void 0 && (t = {});
584
+ var n = t.insertAt;
585
+ if (!(!e || typeof document > "u")) {
586
+ var s = document.head || document.getElementsByTagName("head")[0], o = document.createElement("style");
587
+ o.type = "text/css", n === "top" && s.firstChild ? s.insertBefore(o, s.firstChild) : s.appendChild(o), o.styleSheet ? o.styleSheet.cssText = e : o.appendChild(document.createTextNode(e));
588
+ }
589
+ }
590
+ var st = `
591
+ .p-icon {
592
+ display: inline-block;
593
+ }
594
+ .p-icon-spin {
595
+ -webkit-animation: p-icon-spin 2s infinite linear;
596
+ animation: p-icon-spin 2s infinite linear;
597
+ }
598
+ @-webkit-keyframes p-icon-spin {
599
+ 0% {
600
+ -webkit-transform: rotate(0deg);
601
+ transform: rotate(0deg);
602
+ }
603
+ 100% {
604
+ -webkit-transform: rotate(359deg);
605
+ transform: rotate(359deg);
606
+ }
607
+ }
608
+ @keyframes p-icon-spin {
609
+ 0% {
610
+ -webkit-transform: rotate(0deg);
611
+ transform: rotate(0deg);
612
+ }
613
+ 100% {
614
+ -webkit-transform: rotate(359deg);
615
+ transform: rotate(359deg);
616
+ }
617
+ }
618
+ `;
619
+ nt(st);
620
+ var _e = {
621
+ name: "SpinnerIcon",
622
+ extends: tt
623
+ };
624
+ const ot = /* @__PURE__ */ A("g", { "clip-path": "url(#clip0_417_21408)" }, [
625
+ /* @__PURE__ */ A("path", {
626
+ d: "M6.99701 14C5.85441 13.999 4.72939 13.7186 3.72012 13.1832C2.71084 12.6478 1.84795 11.8737 1.20673 10.9284C0.565504 9.98305 0.165424 8.89526 0.041387 7.75989C-0.0826496 6.62453 0.073125 5.47607 0.495122 4.4147C0.917119 3.35333 1.59252 2.4113 2.46241 1.67077C3.33229 0.930247 4.37024 0.413729 5.4857 0.166275C6.60117 -0.0811796 7.76026 -0.0520535 8.86188 0.251112C9.9635 0.554278 10.9742 1.12227 11.8057 1.90555C11.915 2.01493 11.9764 2.16319 11.9764 2.31778C11.9764 2.47236 11.915 2.62062 11.8057 2.73C11.7521 2.78503 11.688 2.82877 11.6171 2.85864C11.5463 2.8885 11.4702 2.90389 11.3933 2.90389C11.3165 2.90389 11.2404 2.8885 11.1695 2.85864C11.0987 2.82877 11.0346 2.78503 10.9809 2.73C9.9998 1.81273 8.73246 1.26138 7.39226 1.16876C6.05206 1.07615 4.72086 1.44794 3.62279 2.22152C2.52471 2.99511 1.72683 4.12325 1.36345 5.41602C1.00008 6.70879 1.09342 8.08723 1.62775 9.31926C2.16209 10.5513 3.10478 11.5617 4.29713 12.1803C5.48947 12.7989 6.85865 12.988 8.17414 12.7157C9.48963 12.4435 10.6711 11.7264 11.5196 10.6854C12.3681 9.64432 12.8319 8.34282 12.8328 7C12.8328 6.84529 12.8943 6.69692 13.0038 6.58752C13.1132 6.47812 13.2616 6.41667 13.4164 6.41667C13.5712 6.41667 13.7196 6.47812 13.8291 6.58752C13.9385 6.69692 14 6.84529 14 7C14 8.85651 13.2622 10.637 11.9489 11.9497C10.6356 13.2625 8.85432 14 6.99701 14Z",
627
+ fill: "currentColor"
628
+ })
629
+ ], -1), rt = /* @__PURE__ */ A("defs", null, [
630
+ /* @__PURE__ */ A("clipPath", { id: "clip0_417_21408" }, [
631
+ /* @__PURE__ */ A("rect", {
632
+ width: "14",
633
+ height: "14",
634
+ fill: "white"
635
+ })
636
+ ])
637
+ ], -1), it = [
638
+ ot,
639
+ rt
640
+ ];
641
+ function at(e, t, n, s, o, r) {
642
+ return T(), x("svg", I({
643
+ width: "14",
644
+ height: "14",
645
+ viewBox: "0 0 14 14",
646
+ fill: "none",
647
+ xmlns: "http://www.w3.org/2000/svg"
648
+ }, e.pti()), it, 16);
649
+ }
650
+ _e.render = at;
651
+ let ee;
652
+ function ct(e) {
653
+ e.addEventListener("mousedown", Ie);
654
+ }
655
+ function lt(e) {
656
+ e.removeEventListener("mousedown", Ie);
657
+ }
658
+ function ut(e) {
659
+ let t = document.createElement("span");
660
+ t.className = "p-ink", t.setAttribute("role", "presentation"), t.setAttribute("aria-hidden", "true"), e.appendChild(t), t.addEventListener("animationend", Te);
661
+ }
662
+ function dt(e) {
663
+ let t = De(e);
664
+ t && (lt(e), t.removeEventListener("animationend", Te), t.remove());
665
+ }
666
+ function Ie(e) {
667
+ let t = e.currentTarget, n = De(t);
668
+ if (!n || getComputedStyle(n, null).display === "none")
669
+ return;
670
+ if (S.removeClass(n, "p-ink-active"), !S.getHeight(n) && !S.getWidth(n)) {
671
+ let a = Math.max(S.getOuterWidth(t), S.getOuterHeight(t));
672
+ n.style.height = a + "px", n.style.width = a + "px";
673
+ }
674
+ let s = S.getOffset(t), o = e.pageX - s.left + document.body.scrollTop - S.getWidth(n) / 2, r = e.pageY - s.top + document.body.scrollLeft - S.getHeight(n) / 2;
675
+ n.style.top = r + "px", n.style.left = o + "px", S.addClass(n, "p-ink-active"), ee = setTimeout(() => {
676
+ n && S.removeClass(n, "p-ink-active");
677
+ }, 401);
678
+ }
679
+ function Te(e) {
680
+ ee && clearTimeout(ee), S.removeClass(e.currentTarget, "p-ink-active");
681
+ }
682
+ function De(e) {
683
+ for (let t = 0; t < e.children.length; t++)
684
+ if (typeof e.children[t].className == "string" && e.children[t].className.indexOf("p-ink") !== -1)
685
+ return e.children[t];
686
+ return null;
687
+ }
688
+ const pt = {
689
+ mounted(e, t) {
690
+ t.instance.$primevue && t.instance.$primevue.config && t.instance.$primevue.config.ripple && (ut(e), ct(e));
691
+ },
692
+ unmounted(e) {
693
+ dt(e);
694
+ }
695
+ };
696
+ var te = {
697
+ name: "Button",
698
+ extends: et,
699
+ props: {
700
+ label: {
701
+ type: String,
702
+ default: null
703
+ },
704
+ icon: {
705
+ type: String,
706
+ default: null
707
+ },
708
+ iconPos: {
709
+ type: String,
710
+ default: "left"
711
+ },
712
+ iconClass: {
713
+ type: String,
714
+ default: null
715
+ },
716
+ badge: {
717
+ type: String,
718
+ default: null
719
+ },
720
+ badgeClass: {
721
+ type: String,
722
+ default: null
723
+ },
724
+ loading: {
725
+ type: Boolean,
726
+ default: !1
727
+ },
728
+ loadingIcon: {
729
+ type: String,
730
+ default: void 0
731
+ },
732
+ link: {
733
+ type: Boolean,
734
+ default: !1
735
+ },
736
+ severity: {
737
+ type: String,
738
+ default: null
739
+ },
740
+ raised: {
741
+ type: Boolean,
742
+ default: !1
743
+ },
744
+ rounded: {
745
+ type: Boolean,
746
+ default: !1
747
+ },
748
+ text: {
749
+ type: Boolean,
750
+ default: !1
751
+ },
752
+ outlined: {
753
+ type: Boolean,
754
+ default: !1
755
+ },
756
+ size: {
757
+ type: String,
758
+ default: null
759
+ },
760
+ plain: {
761
+ type: Boolean,
762
+ default: !1
763
+ }
764
+ },
765
+ computed: {
766
+ buttonClass() {
767
+ return [
768
+ "p-button p-component",
769
+ {
770
+ "p-button-icon-only": this.hasIcon && !this.label,
771
+ "p-button-vertical": (this.iconPos === "top" || this.iconPos === "bottom") && this.label,
772
+ "p-disabled": this.$attrs.disabled || this.loading,
773
+ "p-button-loading": this.loading,
774
+ "p-button-loading-label-only": this.loading && !this.hasIcon && this.label,
775
+ "p-button-link": this.link,
776
+ [`p-button-${this.severity}`]: this.severity,
777
+ "p-button-raised": this.raised,
778
+ "p-button-rounded": this.rounded,
779
+ "p-button-text": this.text,
780
+ "p-button-outlined": this.outlined,
781
+ "p-button-sm": this.size === "small",
782
+ "p-button-lg": this.size === "large",
783
+ "p-button-plain": this.plain
784
+ }
785
+ ];
786
+ },
787
+ iconStyleClass() {
788
+ return [
789
+ "p-button-icon",
790
+ this.iconClass,
791
+ {
792
+ "p-button-icon-left": this.iconPos === "left" && this.label,
793
+ "p-button-icon-right": this.iconPos === "right" && this.label,
794
+ "p-button-icon-top": this.iconPos === "top" && this.label,
795
+ "p-button-icon-bottom": this.iconPos === "bottom" && this.label
796
+ }
797
+ ];
798
+ },
799
+ loadingIconStyleClass() {
800
+ return ["p-button-loading-icon pi-spin", this.iconStyleClass];
801
+ },
802
+ badgeStyleClass() {
803
+ return [
804
+ "p-badge p-component",
805
+ this.badgeClass,
806
+ {
807
+ "p-badge-no-gutter": this.badge && String(this.badge).length === 1
808
+ }
809
+ ];
810
+ },
811
+ disabled() {
812
+ return this.$attrs.disabled || this.loading;
813
+ },
814
+ defaultAriaLabel() {
815
+ return this.label ? this.label + (this.badge ? " " + this.badge : "") : this.$attrs["aria-label"];
816
+ },
817
+ hasIcon() {
818
+ return this.icon || this.$slots.icon;
819
+ }
820
+ },
821
+ components: {
822
+ SpinnerIcon: _e
823
+ },
824
+ directives: {
825
+ ripple: pt
826
+ }
827
+ };
828
+ const ft = ["aria-label", "disabled"];
829
+ function ht(e, t, n, s, o, r) {
830
+ const a = Le("SpinnerIcon"), i = ke("ripple");
831
+ return Fe((T(), x("button", I({
832
+ class: r.buttonClass,
833
+ type: "button",
834
+ "aria-label": r.defaultAriaLabel,
835
+ disabled: r.disabled
836
+ }, e.ptm("root")), [
837
+ X(e.$slots, "default", {}, () => [
838
+ n.loading ? X(e.$slots, "loadingicon", {
839
+ key: 0,
840
+ class: le(r.loadingIconStyleClass)
841
+ }, () => [
842
+ n.loadingIcon ? (T(), x("span", I({
843
+ key: 0,
844
+ class: [r.loadingIconStyleClass, n.loadingIcon]
845
+ }, e.ptm("loadingIcon")), null, 16)) : (T(), Ve(a, I({
846
+ key: 1,
847
+ class: r.loadingIconStyleClass,
848
+ spin: ""
849
+ }, e.ptm("loadingIcon")), null, 16, ["class"]))
850
+ ]) : X(e.$slots, "icon", {
851
+ key: 1,
852
+ class: le(r.iconStyleClass)
853
+ }, () => [
854
+ n.icon ? (T(), x("span", I({
855
+ key: 0,
856
+ class: [r.iconStyleClass, n.icon]
857
+ }, e.ptm("icon")), null, 16)) : ue("", !0)
858
+ ]),
859
+ A("span", I({ class: "p-button-label" }, e.ptm("label")), q(n.label || " "), 17),
860
+ n.badge ? (T(), x("span", I({
861
+ key: 2,
862
+ class: r.badgeStyleClass
863
+ }, e.ptm("badge")), q(n.badge), 17)) : ue("", !0)
864
+ ])
865
+ ], 16, ft)), [
866
+ [i]
867
+ ]);
868
+ }
869
+ te.render = ht;
870
+ const gt = (e) => (Be("data-v-31c691d5"), e = e(), We(), e), yt = { class: "flex align-content-center flex-wrap counter" }, mt = /* @__PURE__ */ gt(() => /* @__PURE__ */ A("label", { class: "flex align-items-center justify-content-center" }, "Counter:", -1)), vt = { class: "flex align-items-center justify-content-center count" }, wt = /* @__PURE__ */ Se({
871
+ __name: "ComponentB",
872
+ setup(e) {
873
+ const t = v(0);
874
+ return (n, s) => (T(), x("div", yt, [
875
+ mt,
876
+ de(pe(te), {
877
+ icon: "pi pi-plus",
878
+ class: "p-button-sm flex align-items-center justify-content-center",
879
+ onClick: s[0] || (s[0] = (o) => t.value++)
880
+ }),
881
+ A("span", vt, q(t.value), 1),
882
+ de(pe(te), {
883
+ icon: "pi pi-minus",
884
+ class: "p-button-sm flex align-items-center justify-content-center",
885
+ onClick: s[1] || (s[1] = (o) => t.value--)
886
+ })
887
+ ]));
888
+ }
889
+ });
890
+ const bt = (e, t) => {
891
+ const n = e.__vccOpts || e;
892
+ for (const [s, o] of t)
893
+ n[s] = o;
894
+ return n;
895
+ }, Et = /* @__PURE__ */ bt(wt, [["__scopeId", "data-v-31c691d5"]]), ge = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
896
+ __proto__: null,
897
+ ComponentA: Ke,
898
+ ComponentB: Et
899
+ }, Symbol.toStringTag, { value: "Module" }));
900
+ const Ct = 100, pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
901
+ __proto__: null,
902
+ MAGIC_NUM: Ct
903
+ }, Symbol.toStringTag, { value: "Module" }));
904
+ function St(e, t) {
905
+ return e + t;
906
+ }
907
+ const fn = {
908
+ add: St
909
+ }, ye = {
910
+ baseURL: ""
911
+ }, f = (e = "") => Ze.create({
912
+ ...ye,
913
+ baseURL: e || ye.baseURL
914
+ }), At = async () => {
915
+ try {
916
+ const { data: e } = await f().get(
917
+ "/user",
918
+ {
919
+ headers: {
920
+ Accept: "application/json"
921
+ }
922
+ }
923
+ );
924
+ return e;
925
+ } catch (e) {
926
+ throw e;
927
+ }
928
+ }, xe = [
929
+ { Action: "devices.ACCESS" },
930
+ { Action: "devices.CREATE_DEVICE" },
931
+ { Action: "devicetypes.CREATE_DEVICE_TYPE" },
932
+ { Action: "devices.DELETE" },
933
+ { Action: "metrics.ACCESS" },
934
+ { Action: "metrics.CREATE_METRIC" },
935
+ { Action: "users.ACCESS" },
936
+ { Action: "users.CREATE_USER" },
937
+ { Action: "applications.ACCESS" },
938
+ { Action: "applications.CREATE_APPLICATION" },
939
+ { Action: "rulesengine.ACCESS" },
940
+ { Action: "rulesengine.CREATE_RULE" },
941
+ { Action: "microservices.ACCESS" },
942
+ { Action: "microservices.CREATE_MICROSERVICE" },
943
+ { Action: "componenttoolkit.ACCESS" },
944
+ { Action: "componenttoolkit.CREATE_WIDGET" },
945
+ { Action: "authorization.roles.ACCESS" },
946
+ { Action: "authorization.roles.CREATE_ROLE" },
947
+ { Action: "jobs.ACCESS" },
948
+ { Action: "jobs.CREATE_JOB" },
949
+ { Action: "files.ACCESS" },
950
+ { Action: "files.CREATE_FILE" },
951
+ { Action: "auditlogs.ACCESS" },
952
+ { Action: "twintypes.ACCESS" },
953
+ { Action: "twintypes.CREATE_TWINTYPE" },
954
+ { Action: "twins.ACCESS" },
955
+ { Action: "twins.CREATE_TWIN" },
956
+ { Action: "features.ACCESS" },
957
+ { Action: "features.CREATE_FEATURE" },
958
+ { Action: "oauthclients.ACCESS" },
959
+ { Action: "oauthclients.CREATE" },
960
+ { Action: "digitalSignatures.ACCESS" },
961
+ { Action: "digitalSignatures.CREATE_DIGITAL_SIGNATURE" },
962
+ { Action: "dashboards.ACCESS" },
963
+ { Action: "dashboards.CREATE_DASHBOARD" },
964
+ { Action: "integrations.ACCESS" }
965
+ ], _t = async (e = []) => {
966
+ try {
967
+ const { data: t } = await f().post(
968
+ "/api/v1/authorization/policy/check",
969
+ e.length ? e : xe,
970
+ {
971
+ headers: {
972
+ Accept: "application/json"
973
+ }
974
+ }
975
+ );
976
+ return t;
977
+ } catch {
978
+ return [];
979
+ }
980
+ }, me = {
981
+ getUser: At,
982
+ getUserPermissions: _t,
983
+ permissionList: xe
984
+ }, It = async (e) => {
985
+ const t = [];
986
+ e && t.push(e);
987
+ try {
988
+ const { data: n } = await f().get(
989
+ `/api/v1/iotdata/devices/counters/metrics?${t.join("&")}`,
990
+ {
991
+ headers: {
992
+ Accept: "application/json"
993
+ }
994
+ }
995
+ );
996
+ return n;
997
+ } catch {
998
+ throw new Error("Devices Counters API Error");
999
+ }
1000
+ }, Tt = async (e) => {
1001
+ try {
1002
+ const { data: t } = await f().get(
1003
+ `/api/v1/iotdata/devices/counters/metrics?arrayUUIDs=${e.join(",")}`,
1004
+ {
1005
+ headers: {
1006
+ Accept: "application/json"
1007
+ }
1008
+ }
1009
+ );
1010
+ return t;
1011
+ } catch {
1012
+ throw new Error("Devices Counters API Error");
1013
+ }
1014
+ }, Dt = async (e) => {
1015
+ try {
1016
+ const { data: t } = await f().get(
1017
+ `/api/v1/iotdata/devices/counters/metrics/${e}`,
1018
+ {
1019
+ headers: {
1020
+ Accept: "application/json"
1021
+ }
1022
+ }
1023
+ );
1024
+ return t;
1025
+ } catch {
1026
+ throw new Error("Devices Counters API Error");
1027
+ }
1028
+ }, xt = async (e) => {
1029
+ try {
1030
+ const { data: t } = await f().get(
1031
+ `/api/v1/iotdata/devices/counters/${e}`,
1032
+ {
1033
+ headers: {
1034
+ Accept: "application/json"
1035
+ }
1036
+ }
1037
+ );
1038
+ return t;
1039
+ } catch {
1040
+ throw new Error("Devices Counters API Error");
1041
+ }
1042
+ }, Pt = async (e) => {
1043
+ try {
1044
+ const { data: t } = await f().get(
1045
+ `/api/v1/iotdata/devices/counters/latest/${e}`,
1046
+ {
1047
+ headers: {
1048
+ Accept: "application/json"
1049
+ }
1050
+ }
1051
+ );
1052
+ return t[0];
1053
+ } catch {
1054
+ throw new Error("Devices Counters API Error");
1055
+ }
1056
+ }, Ot = async (e) => {
1057
+ try {
1058
+ const { data: t } = await f().get(
1059
+ `/api/v1/iotdata/devices/counters/latest?arrayUUIDs=${e.join(",")}`,
1060
+ {
1061
+ headers: {
1062
+ Accept: "application/json"
1063
+ }
1064
+ }
1065
+ );
1066
+ return t;
1067
+ } catch {
1068
+ throw new Error("Devices Counters API Error");
1069
+ }
1070
+ }, hn = {
1071
+ getDevicesCountersMetric: It,
1072
+ getDevicesCountersMetricByUUID: Dt,
1073
+ getDevicesCountersMetricByUUIDs: Tt,
1074
+ getDevicesCountersByUUID: xt,
1075
+ getDevicesCountersLatestByUUID: Pt,
1076
+ getDevicesCountersLatestByUUIDs: Ot
1077
+ }, Nt = async (e) => {
1078
+ try {
1079
+ const { data: t } = await f().get(
1080
+ `/api/v1/iotdata/twins/counters/${e}`,
1081
+ {
1082
+ headers: {
1083
+ Accept: "application/json"
1084
+ }
1085
+ }
1086
+ );
1087
+ return t;
1088
+ } catch {
1089
+ throw new Error("Twins Counters API Error");
1090
+ }
1091
+ }, Ut = async (e) => {
1092
+ try {
1093
+ const { data: t } = await f().get(
1094
+ `/api/v1/iotdata/twins/counters/latest/${e}`,
1095
+ {
1096
+ headers: {
1097
+ Accept: "application/json"
1098
+ }
1099
+ }
1100
+ );
1101
+ return t;
1102
+ } catch {
1103
+ throw new Error("Twins Counters API Error");
1104
+ }
1105
+ }, gn = {
1106
+ getTwinsCountersLatestByUUID: Ut,
1107
+ getTwinsCountersByUUID: Nt
1108
+ }, Rt = async (e, t, n, s) => {
1109
+ const o = [];
1110
+ o.push(`start=${e || 0}`), t && o.push(`limit=${t}`), n && o.push(`sort=${n}`), s && o.push(s);
1111
+ try {
1112
+ const { data: r } = await f().get(
1113
+ `/api/v1/devices?${o.join("&")}`,
1114
+ {
1115
+ headers: {
1116
+ Accept: "application/json"
1117
+ }
1118
+ }
1119
+ );
1120
+ return r;
1121
+ } catch {
1122
+ throw new Error("Devices API Error");
1123
+ }
1124
+ }, $t = async (e) => {
1125
+ try {
1126
+ const { data: t } = await f().post(
1127
+ "/api/v1/devices/query",
1128
+ e,
1129
+ {
1130
+ headers: {
1131
+ Accept: "application/json"
1132
+ }
1133
+ }
1134
+ );
1135
+ return t;
1136
+ } catch {
1137
+ throw new Error("Devices API Error");
1138
+ }
1139
+ }, jt = async (e) => {
1140
+ try {
1141
+ const { data: t } = await f().get(
1142
+ `/api/v1/devices/${e}`,
1143
+ {
1144
+ headers: {
1145
+ Accept: "application/json"
1146
+ }
1147
+ }
1148
+ );
1149
+ return t.records[0];
1150
+ } catch {
1151
+ throw new Error("Devices API Error");
1152
+ }
1153
+ }, Lt = async (e) => {
1154
+ try {
1155
+ const { data: t } = await f().get(
1156
+ `/api/v1/devices?arrayUUIDs=${e.join(",")}`,
1157
+ {
1158
+ headers: {
1159
+ Accept: "application/json"
1160
+ }
1161
+ }
1162
+ );
1163
+ return t;
1164
+ } catch {
1165
+ throw new Error("Devices API Error");
1166
+ }
1167
+ }, kt = async (e) => {
1168
+ try {
1169
+ const { data: t } = await f().get(
1170
+ `/api/v1/devices/attachments/${e}`,
1171
+ {
1172
+ headers: {
1173
+ Accept: "application/json"
1174
+ }
1175
+ }
1176
+ );
1177
+ return t;
1178
+ } catch {
1179
+ throw new Error("Devices API Error");
1180
+ }
1181
+ }, G = {
1182
+ getDevices: Rt,
1183
+ queryDevices: $t,
1184
+ getDeviceByUUID: jt,
1185
+ getDeviceByUUIDs: Lt,
1186
+ getDeviceAttachements: kt
1187
+ }, Ft = async (e = 0, t = 1e3, n, s) => {
1188
+ const o = [];
1189
+ o.push(`start=${e || 0}`), t && o.push(`limit=${t}`), n && o.push(`sort=${n}`), s && o.push(s);
1190
+ try {
1191
+ const { data: r, headers: a } = await f().get(
1192
+ `/api/v1/twins?${o.join("&")}`,
1193
+ {
1194
+ headers: {
1195
+ Accept: "application/json"
1196
+ }
1197
+ }
1198
+ );
1199
+ return { totalRecords: parseInt(a["com-davra-total-results"]), records: r };
1200
+ } catch {
1201
+ throw new Error("Twins API Error");
1202
+ }
1203
+ }, Vt = async (e) => {
1204
+ try {
1205
+ const { data: t, headers: n } = await f().post(
1206
+ "/api/v1/twins/query",
1207
+ e,
1208
+ {
1209
+ headers: {
1210
+ Accept: "application/json"
1211
+ }
1212
+ }
1213
+ );
1214
+ return { totalRecords: parseInt(n["com-davra-total-results"]), records: t };
1215
+ } catch {
1216
+ throw new Error("Twins API Error");
1217
+ }
1218
+ }, Bt = async (e) => {
1219
+ try {
1220
+ const { data: t, headers: n } = await f().get(
1221
+ `/api/v1/twins?arrayUUIDs=${e.join(",")}`,
1222
+ {
1223
+ headers: {
1224
+ Accept: "application/json"
1225
+ }
1226
+ }
1227
+ );
1228
+ return { totalRecords: parseInt(n["com-davra-total-results"]), records: t };
1229
+ } catch {
1230
+ throw new Error("Twins API Error");
1231
+ }
1232
+ }, Wt = async (e, t = 0, n = 1e3, s, o) => {
1233
+ const r = [`digitalTwinTypeName=${e}`, `limit=${n}`, `start=${t}`];
1234
+ s && r.push(`sort=${s}`), o && r.push(`name=~${o}`);
1235
+ try {
1236
+ const { data: a, headers: i } = await f().get(
1237
+ `/api/v1/twins/?${r.join("&")}`,
1238
+ {
1239
+ headers: {
1240
+ Accept: "application/json"
1241
+ }
1242
+ }
1243
+ );
1244
+ return { totalRecords: parseInt(i["com-davra-total-results"]), records: a };
1245
+ } catch {
1246
+ throw new Error("Twins API Error");
1247
+ }
1248
+ }, Mt = async (e) => {
1249
+ try {
1250
+ const { data: t } = await f().get(
1251
+ `/api/v1/twins/${e}`,
1252
+ {
1253
+ headers: {
1254
+ Accept: "application/json"
1255
+ }
1256
+ }
1257
+ );
1258
+ return t;
1259
+ } catch {
1260
+ throw new Error("Twins API Error");
1261
+ }
1262
+ }, Ht = async (e) => {
1263
+ try {
1264
+ const { data: t } = await f().get(
1265
+ `/api/v1/twins/${e}/attachments`,
1266
+ {
1267
+ headers: {
1268
+ Accept: "application/json"
1269
+ }
1270
+ }
1271
+ );
1272
+ return t;
1273
+ } catch {
1274
+ throw new Error("Twins API Error");
1275
+ }
1276
+ }, Z = {
1277
+ getTwins: Ft,
1278
+ getTwinsByTypeName: Wt,
1279
+ getTwinByUUID: Mt,
1280
+ getTwinByUUIDs: Bt,
1281
+ getTwinAttachements: Ht,
1282
+ queryTwins: Vt
1283
+ }, qt = async (e) => {
1284
+ try {
1285
+ const { data: t } = await f().post(
1286
+ "/api/v2/timeseriesdata",
1287
+ e,
1288
+ {
1289
+ headers: {
1290
+ Accept: "application/json"
1291
+ }
1292
+ }
1293
+ );
1294
+ return t;
1295
+ } catch {
1296
+ throw new Error("Timeseries Error");
1297
+ }
1298
+ }, yn = {
1299
+ queryTimeseries: qt
1300
+ }, zt = async () => {
1301
+ try {
1302
+ const { data: e } = await f().get(
1303
+ "/api/v1/tags/keys",
1304
+ {
1305
+ headers: {
1306
+ Accept: "application/json"
1307
+ }
1308
+ }
1309
+ );
1310
+ return e || [];
1311
+ } catch {
1312
+ return [];
1313
+ }
1314
+ }, Yt = async (e) => {
1315
+ try {
1316
+ const { data: t } = await f().get(
1317
+ `/api/v1/tags/values/${e}`,
1318
+ {
1319
+ headers: {
1320
+ Accept: "application/json"
1321
+ }
1322
+ }
1323
+ );
1324
+ return t || [];
1325
+ } catch {
1326
+ return [];
1327
+ }
1328
+ }, Jt = async (e, t) => {
1329
+ const n = { ...e };
1330
+ Object.entries(n).forEach(([s, o]) => {
1331
+ t && t.includes(s) && delete n[s], (!o || /[^a-zA-Z_0-9\-+]/g.test(o)) && delete n[s];
1332
+ });
1333
+ try {
1334
+ return await f().post(
1335
+ "/api/v1/tags",
1336
+ n,
1337
+ {
1338
+ headers: {
1339
+ Accept: "application/json"
1340
+ }
1341
+ }
1342
+ ), !0;
1343
+ } catch {
1344
+ return !1;
1345
+ }
1346
+ }, ve = {
1347
+ getLabels: zt,
1348
+ createLabel: Jt,
1349
+ getValuesByKey: Yt
1350
+ }, Xt = async () => {
1351
+ var e, t, n, s, o, r, a;
1352
+ try {
1353
+ const { data: i } = await f().get(
1354
+ "/api/v1/iotdata/meta-data/metrics",
1355
+ {
1356
+ headers: {
1357
+ Accept: "application/json"
1358
+ }
1359
+ }
1360
+ );
1361
+ return i.fields;
1362
+ } catch (i) {
1363
+ const c = typeof ((t = (e = i == null ? void 0 : i.response) == null ? void 0 : e.data) == null ? void 0 : t.message) == "string" ? (s = (n = i == null ? void 0 : i.response) == null ? void 0 : n.data) == null ? void 0 : s.message : typeof ((o = i == null ? void 0 : i.response) == null ? void 0 : o.data) == "string" ? (r = i == null ? void 0 : i.response) == null ? void 0 : r.data : "";
1364
+ throw new Error(`API Error ${(a = i == null ? void 0 : i.response) == null ? void 0 : a.status} ${c}`);
1365
+ }
1366
+ }, Gt = async (e) => {
1367
+ var t, n, s, o, r, a, i;
1368
+ try {
1369
+ const { data: c } = await f().post(
1370
+ "/api/v1/iotdata/meta-data",
1371
+ {
1372
+ name: e.name,
1373
+ label: e.label,
1374
+ units: e.units,
1375
+ description: e.description,
1376
+ semantics: e.semantics || "metric",
1377
+ labels: e.labels
1378
+ },
1379
+ {
1380
+ headers: {
1381
+ Accept: "application/json"
1382
+ }
1383
+ }
1384
+ );
1385
+ return c;
1386
+ } catch (c) {
1387
+ const d = typeof ((n = (t = c == null ? void 0 : c.response) == null ? void 0 : t.data) == null ? void 0 : n.message) == "string" ? (o = (s = c == null ? void 0 : c.response) == null ? void 0 : s.data) == null ? void 0 : o.message : typeof ((r = c == null ? void 0 : c.response) == null ? void 0 : r.data) == "string" ? (a = c == null ? void 0 : c.response) == null ? void 0 : a.data : "";
1388
+ throw new Error(`API Error ${(i = c == null ? void 0 : c.response) == null ? void 0 : i.status} ${d}`);
1389
+ }
1390
+ }, we = {
1391
+ getMetrics: Xt,
1392
+ postMetric: Gt
1393
+ };
1394
+ var Zt = !1;
1395
+ function W(e, t, n) {
1396
+ return Array.isArray(e) ? (e.length = Math.max(e.length, t), e.splice(t, 1, n), n) : (e[t] = n, n);
1397
+ }
1398
+ function Q(e, t) {
1399
+ if (Array.isArray(e)) {
1400
+ e.splice(t, 1);
1401
+ return;
1402
+ }
1403
+ delete e[t];
1404
+ }
1405
+ /*!
1406
+ * pinia v2.1.7
1407
+ * (c) 2023 Eduardo San Martin Morote
1408
+ * @license MIT
1409
+ */
1410
+ let F;
1411
+ const z = (e) => F = e, Qt = process.env.NODE_ENV !== "production" ? Symbol("pinia") : (
1412
+ /* istanbul ignore next */
1413
+ Symbol()
1414
+ );
1415
+ function P(e) {
1416
+ return e && typeof e == "object" && Object.prototype.toString.call(e) === "[object Object]" && typeof e.toJSON != "function";
1417
+ }
1418
+ var V;
1419
+ (function(e) {
1420
+ e.direct = "direct", e.patchObject = "patch object", e.patchFunction = "patch function";
1421
+ })(V || (V = {}));
1422
+ const oe = typeof window < "u", K = (process.env.NODE_ENV !== "production" || !1) && process.env.NODE_ENV !== "test" && oe;
1423
+ function Pe(e, t) {
1424
+ for (const n in t) {
1425
+ const s = t[n];
1426
+ if (!(n in e))
1427
+ continue;
1428
+ const o = e[n];
1429
+ P(o) && P(s) && !$(s) && !Y(s) ? e[n] = Pe(o, s) : e[n] = s;
1430
+ }
1431
+ return e;
1432
+ }
1433
+ const Oe = () => {
1434
+ };
1435
+ function be(e, t, n, s = Oe) {
1436
+ e.push(t);
1437
+ const o = () => {
1438
+ const r = e.indexOf(t);
1439
+ r > -1 && (e.splice(r, 1), s());
1440
+ };
1441
+ return !n && Xe() && Ge(o), o;
1442
+ }
1443
+ function U(e, ...t) {
1444
+ e.slice().forEach((n) => {
1445
+ n(...t);
1446
+ });
1447
+ }
1448
+ const Kt = (e) => e();
1449
+ function ne(e, t) {
1450
+ e instanceof Map && t instanceof Map && t.forEach((n, s) => e.set(s, n)), e instanceof Set && t instanceof Set && t.forEach(e.add, e);
1451
+ for (const n in t) {
1452
+ if (!t.hasOwnProperty(n))
1453
+ continue;
1454
+ const s = t[n], o = e[n];
1455
+ P(o) && P(s) && e.hasOwnProperty(n) && !$(s) && !Y(s) ? e[n] = ne(o, s) : e[n] = s;
1456
+ }
1457
+ return e;
1458
+ }
1459
+ const en = process.env.NODE_ENV !== "production" ? Symbol("pinia:skipHydration") : (
1460
+ /* istanbul ignore next */
1461
+ Symbol()
1462
+ );
1463
+ function tn(e) {
1464
+ return !P(e) || !e.hasOwnProperty(en);
1465
+ }
1466
+ const { assign: C } = Object;
1467
+ function Ee(e) {
1468
+ return !!($(e) && e.effect);
1469
+ }
1470
+ function Ce(e, t, n, s) {
1471
+ const { state: o, actions: r, getters: a } = t, i = n.state.value[e];
1472
+ let c;
1473
+ function d() {
1474
+ !i && (process.env.NODE_ENV === "production" || !s) && (n.state.value[e] = o ? o() : {});
1475
+ const y = process.env.NODE_ENV !== "production" && s ? (
1476
+ // use ref() to unwrap refs inside state TODO: check if this is still necessary
1477
+ he(v(o ? o() : {}).value)
1478
+ ) : he(n.state.value[e]);
1479
+ return C(y, r, Object.keys(a || {}).reduce((h, m) => (process.env.NODE_ENV !== "production" && m in y && console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${m}" in store "${e}".`), h[m] = k(D(() => {
1480
+ z(n);
1481
+ const b = n._s.get(e);
1482
+ return a[m].call(b, b);
1483
+ })), h), {}));
1484
+ }
1485
+ return c = se(e, d, t, n, s, !0), c;
1486
+ }
1487
+ function se(e, t, n = {}, s, o, r) {
1488
+ let a;
1489
+ const i = C({ actions: {} }, n);
1490
+ if (process.env.NODE_ENV !== "production" && !s._e.active)
1491
+ throw new Error("Pinia destroyed");
1492
+ const c = {
1493
+ deep: !0
1494
+ // flush: 'post',
1495
+ };
1496
+ process.env.NODE_ENV !== "production" && !Zt && (c.onTrigger = (u) => {
1497
+ d ? b = u : d == !1 && !p._hotUpdating && (Array.isArray(b) ? b.push(u) : console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug."));
1498
+ });
1499
+ let d, y, h = [], m = [], b;
1500
+ const N = s.state.value[e];
1501
+ !r && !N && (process.env.NODE_ENV === "production" || !o) && (s.state.value[e] = {});
1502
+ const J = v({});
1503
+ let re;
1504
+ function ie(u) {
1505
+ let l;
1506
+ d = y = !1, process.env.NODE_ENV !== "production" && (b = []), typeof u == "function" ? (u(s.state.value[e]), l = {
1507
+ type: V.patchFunction,
1508
+ storeId: e,
1509
+ events: b
1510
+ }) : (ne(s.state.value[e], u), l = {
1511
+ type: V.patchObject,
1512
+ payload: u,
1513
+ storeId: e,
1514
+ events: b
1515
+ });
1516
+ const g = re = Symbol();
1517
+ fe().then(() => {
1518
+ re === g && (d = !0);
1519
+ }), y = !0, U(h, l, s.state.value[e]);
1520
+ }
1521
+ const Ne = r ? function() {
1522
+ const { state: l } = n, g = l ? l() : {};
1523
+ this.$patch((w) => {
1524
+ C(w, g);
1525
+ });
1526
+ } : (
1527
+ /* istanbul ignore next */
1528
+ process.env.NODE_ENV !== "production" ? () => {
1529
+ throw new Error(`🍍: Store "${e}" is built using the setup syntax and does not implement $reset().`);
1530
+ } : Oe
1531
+ );
1532
+ function Ue() {
1533
+ a.stop(), h = [], m = [], s._s.delete(e);
1534
+ }
1535
+ function ae(u, l) {
1536
+ return function() {
1537
+ z(s);
1538
+ const g = Array.from(arguments), w = [], j = [];
1539
+ function Re(E) {
1540
+ w.push(E);
1541
+ }
1542
+ function $e(E) {
1543
+ j.push(E);
1544
+ }
1545
+ U(m, {
1546
+ args: g,
1547
+ name: u,
1548
+ store: p,
1549
+ after: Re,
1550
+ onError: $e
1551
+ });
1552
+ let L;
1553
+ try {
1554
+ L = l.apply(this && this.$id === e ? this : p, g);
1555
+ } catch (E) {
1556
+ throw U(j, E), E;
1557
+ }
1558
+ return L instanceof Promise ? L.then((E) => (U(w, E), E)).catch((E) => (U(j, E), Promise.reject(E))) : (U(w, L), L);
1559
+ };
1560
+ }
1561
+ const B = /* @__PURE__ */ k({
1562
+ actions: {},
1563
+ getters: {},
1564
+ state: [],
1565
+ hotState: J
1566
+ }), ce = {
1567
+ _p: s,
1568
+ // _s: scope,
1569
+ $id: e,
1570
+ $onAction: be.bind(null, m),
1571
+ $patch: ie,
1572
+ $reset: Ne,
1573
+ $subscribe(u, l = {}) {
1574
+ const g = be(h, u, l.detached, () => w()), w = a.run(() => ze(() => s.state.value[e], (j) => {
1575
+ (l.flush === "sync" ? y : d) && u({
1576
+ storeId: e,
1577
+ type: V.direct,
1578
+ events: b
1579
+ }, j);
1580
+ }, C({}, c, l)));
1581
+ return g;
1582
+ },
1583
+ $dispose: Ue
1584
+ }, p = Ye(process.env.NODE_ENV !== "production" || K ? C(
1585
+ {
1586
+ _hmrPayload: B,
1587
+ _customProperties: k(/* @__PURE__ */ new Set())
1588
+ // devtools custom properties
1589
+ },
1590
+ ce
1591
+ // must be added later
1592
+ // setupStore
1593
+ ) : ce);
1594
+ s._s.set(e, p);
1595
+ const _ = (s._a && s._a.runWithContext || Kt)(() => s._e.run(() => (a = Je()).run(t)));
1596
+ for (const u in _) {
1597
+ const l = _[u];
1598
+ if ($(l) && !Ee(l) || Y(l))
1599
+ process.env.NODE_ENV !== "production" && o ? W(J.value, u, H(_, u)) : r || (N && tn(l) && ($(l) ? l.value = N[u] : ne(l, N[u])), s.state.value[e][u] = l), process.env.NODE_ENV !== "production" && B.state.push(u);
1600
+ else if (typeof l == "function") {
1601
+ const g = process.env.NODE_ENV !== "production" && o ? l : ae(u, l);
1602
+ _[u] = g, process.env.NODE_ENV !== "production" && (B.actions[u] = l), i.actions[u] = l;
1603
+ } else
1604
+ process.env.NODE_ENV !== "production" && Ee(l) && (B.getters[u] = r ? (
1605
+ // @ts-expect-error
1606
+ n.getters[u]
1607
+ ) : l, oe && (_._getters || // @ts-expect-error: same
1608
+ (_._getters = k([]))).push(u));
1609
+ }
1610
+ if (C(p, _), C(Ae(p), _), Object.defineProperty(p, "$state", {
1611
+ get: () => process.env.NODE_ENV !== "production" && o ? J.value : s.state.value[e],
1612
+ set: (u) => {
1613
+ if (process.env.NODE_ENV !== "production" && o)
1614
+ throw new Error("cannot set hotState");
1615
+ ie((l) => {
1616
+ C(l, u);
1617
+ });
1618
+ }
1619
+ }), process.env.NODE_ENV !== "production" && (p._hotUpdate = k((u) => {
1620
+ p._hotUpdating = !0, u._hmrPayload.state.forEach((l) => {
1621
+ if (l in p.$state) {
1622
+ const g = u.$state[l], w = p.$state[l];
1623
+ typeof g == "object" && P(g) && P(w) ? Pe(g, w) : u.$state[l] = w;
1624
+ }
1625
+ W(p, l, H(u.$state, l));
1626
+ }), Object.keys(p.$state).forEach((l) => {
1627
+ l in u.$state || Q(p, l);
1628
+ }), d = !1, y = !1, s.state.value[e] = H(u._hmrPayload, "hotState"), y = !0, fe().then(() => {
1629
+ d = !0;
1630
+ });
1631
+ for (const l in u._hmrPayload.actions) {
1632
+ const g = u[l];
1633
+ W(p, l, ae(l, g));
1634
+ }
1635
+ for (const l in u._hmrPayload.getters) {
1636
+ const g = u._hmrPayload.getters[l], w = r ? (
1637
+ // special handling of options api
1638
+ D(() => (z(s), g.call(p, p)))
1639
+ ) : g;
1640
+ W(p, l, w);
1641
+ }
1642
+ Object.keys(p._hmrPayload.getters).forEach((l) => {
1643
+ l in u._hmrPayload.getters || Q(p, l);
1644
+ }), Object.keys(p._hmrPayload.actions).forEach((l) => {
1645
+ l in u._hmrPayload.actions || Q(p, l);
1646
+ }), p._hmrPayload = u._hmrPayload, p._getters = u._getters, p._hotUpdating = !1;
1647
+ })), K) {
1648
+ const u = {
1649
+ writable: !0,
1650
+ configurable: !0,
1651
+ // avoid warning on devtools trying to display this property
1652
+ enumerable: !1
1653
+ };
1654
+ ["_p", "_hmrPayload", "_getters", "_customProperties"].forEach((l) => {
1655
+ Object.defineProperty(p, l, C({ value: p[l] }, u));
1656
+ });
1657
+ }
1658
+ return s._p.forEach((u) => {
1659
+ if (K) {
1660
+ const l = a.run(() => u({
1661
+ store: p,
1662
+ app: s._a,
1663
+ pinia: s,
1664
+ options: i
1665
+ }));
1666
+ Object.keys(l || {}).forEach((g) => p._customProperties.add(g)), C(p, l);
1667
+ } else
1668
+ C(p, a.run(() => u({
1669
+ store: p,
1670
+ app: s._a,
1671
+ pinia: s,
1672
+ options: i
1673
+ })));
1674
+ }), process.env.NODE_ENV !== "production" && p.$state && typeof p.$state == "object" && typeof p.$state.constructor == "function" && !p.$state.constructor.toString().includes("[native code]") && console.warn(`[🍍]: The "state" must be a plain object. It cannot be
1675
+ state: () => new MyClass()
1676
+ Found in store "${p.$id}".`), N && r && n.hydrate && n.hydrate(p.$state, N), d = !0, y = !0, p;
1677
+ }
1678
+ function O(e, t, n) {
1679
+ let s, o;
1680
+ const r = typeof t == "function";
1681
+ if (typeof e == "string")
1682
+ s = e, o = r ? n : t;
1683
+ else if (o = e, s = e.id, process.env.NODE_ENV !== "production" && typeof s != "string")
1684
+ throw new Error('[🍍]: "defineStore()" must be passed a store id as its first argument.');
1685
+ function a(i, c) {
1686
+ const d = Me();
1687
+ if (i = // in test mode, ignore the argument provided as we can always retrieve a
1688
+ // pinia instance with getActivePinia()
1689
+ (process.env.NODE_ENV === "test" && F && F._testing ? null : i) || (d ? He(Qt, null) : null), i && z(i), process.env.NODE_ENV !== "production" && !F)
1690
+ throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
1691
+ See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
1692
+ This will fail in production.`);
1693
+ i = F, i._s.has(s) || (r ? se(s, t, o, i) : Ce(s, o, i), process.env.NODE_ENV !== "production" && (a._pinia = i));
1694
+ const y = i._s.get(s);
1695
+ if (process.env.NODE_ENV !== "production" && c) {
1696
+ const h = "__hot:" + s, m = r ? se(h, t, o, i, !0) : Ce(h, C({}, o), i, !0);
1697
+ c._hotUpdate(m), delete i.state.value[h], i._s.delete(h);
1698
+ }
1699
+ if (process.env.NODE_ENV !== "production" && oe) {
1700
+ const h = qe();
1701
+ if (h && h.proxy && // avoid adding stores that are just built for hot module replacement
1702
+ !c) {
1703
+ const m = h.proxy, b = "_pStores" in m ? m._pStores : m._pStores = {};
1704
+ b[s] = y;
1705
+ }
1706
+ }
1707
+ return y;
1708
+ }
1709
+ return a.$id = s, a;
1710
+ }
1711
+ function nn(e) {
1712
+ {
1713
+ e = Ae(e);
1714
+ const t = {};
1715
+ for (const n in e) {
1716
+ const s = e[n];
1717
+ ($(s) || Y(s)) && (t[n] = // ---
1718
+ H(e, n));
1719
+ }
1720
+ return t;
1721
+ }
1722
+ }
1723
+ const M = O("alertMessages", () => {
1724
+ const e = v(!1), t = v(""), n = v(""), s = v(5e3);
1725
+ return {
1726
+ snackbar: e,
1727
+ snackbarText: t,
1728
+ snackbarSeverity: n,
1729
+ snackbarTimeout: s,
1730
+ setSnackbarMessage: (r = "", a = "", i = 5e3) => {
1731
+ t.value = r, n.value = a, s.value = i, e.value = !0;
1732
+ }
1733
+ };
1734
+ }), mn = O("userSession", () => {
1735
+ const e = v(JSON.parse(localStorage.getItem("user") || "null")), t = v(JSON.parse(localStorage.getItem("user-permissions") || "[]")), n = D(() => {
1736
+ var a;
1737
+ return ((a = e.value) == null ? void 0 : a.name) || "no user";
1738
+ }), s = D(() => (a) => {
1739
+ var i, c;
1740
+ return a ? ((c = (i = t.value) == null ? void 0 : i.find((d) => d.Action === a)) == null ? void 0 : c.Allowed) || !1 : !0;
1741
+ }), o = async () => {
1742
+ var a, i;
1743
+ try {
1744
+ const c = await me.getUser();
1745
+ if (e.value = c, (a = e.value) != null && a.UUID) {
1746
+ const d = await me.getUserPermissions();
1747
+ t.value = d, localStorage.setItem("user", JSON.stringify(e.value)), localStorage.setItem("user-permissions", JSON.stringify(t.value));
1748
+ }
1749
+ } catch (c) {
1750
+ ((i = c.response) == null ? void 0 : i.status) === 401 && (window.location.href = "/ui/login.html");
1751
+ }
1752
+ }, r = () => {
1753
+ e.value = null, t.value = [], localStorage.removeItem("user"), localStorage.removeItem("user-permission"), window.location.href = "/ui/logout";
1754
+ };
1755
+ return o(), { user: e, pullUser: o, userName: n, userPermissions: t, getPermission: s, logout: r };
1756
+ }), vn = O("devices", () => {
1757
+ const e = v({});
1758
+ return {
1759
+ pullDevicesByUUIDs: async (o, r = !1) => {
1760
+ r && o.forEach((a) => {
1761
+ delete e.value[a];
1762
+ });
1763
+ try {
1764
+ const a = await G.getDeviceByUUIDs(o);
1765
+ return a.records.forEach((i) => {
1766
+ e.value[i.UUID] = i;
1767
+ }), a;
1768
+ } catch {
1769
+ return {
1770
+ totalRecords: 0,
1771
+ records: []
1772
+ };
1773
+ }
1774
+ },
1775
+ pullDevices: async (o, r, a, i) => {
1776
+ try {
1777
+ const c = await G.getDevices(o, r, a, i);
1778
+ return c.records.forEach((d) => {
1779
+ e.value[d.UUID] = d;
1780
+ }), c;
1781
+ } catch {
1782
+ return {
1783
+ totalRecords: 0,
1784
+ records: []
1785
+ };
1786
+ }
1787
+ },
1788
+ devicesCollection: e,
1789
+ getDeviceFromUUID: async (o, r) => {
1790
+ const a = e.value[o];
1791
+ if (a)
1792
+ return a;
1793
+ if (r)
1794
+ return null;
1795
+ try {
1796
+ const i = await G.getDeviceByUUID(o);
1797
+ if (i)
1798
+ return e.value[i.UUID] = i, i;
1799
+ } catch {
1800
+ return null;
1801
+ }
1802
+ }
1803
+ };
1804
+ }), wn = O("twins", () => {
1805
+ const e = v({});
1806
+ return {
1807
+ pullTwinsByUUIDs: async (o, r = !1) => {
1808
+ r && o.forEach((a) => {
1809
+ delete e.value[a];
1810
+ });
1811
+ try {
1812
+ const a = await Z.getTwinByUUIDs(o);
1813
+ return a.records.forEach((i) => {
1814
+ e.value[i.UUID] = i;
1815
+ }), a;
1816
+ } catch {
1817
+ return {
1818
+ totalRecords: 0,
1819
+ records: []
1820
+ };
1821
+ }
1822
+ },
1823
+ pullTwins: async (o, r, a, i) => {
1824
+ try {
1825
+ const c = await Z.getTwins(o, r, a, i);
1826
+ return c.records.forEach((d) => {
1827
+ e.value[d.UUID] = d;
1828
+ }), c;
1829
+ } catch {
1830
+ return {
1831
+ totalRecords: 0,
1832
+ records: []
1833
+ };
1834
+ }
1835
+ },
1836
+ twinsCollection: e,
1837
+ getTwinFromUUID: async (o, r) => {
1838
+ const a = e.value[o];
1839
+ if (a)
1840
+ return a;
1841
+ if (r)
1842
+ return null;
1843
+ try {
1844
+ const i = await Z.getTwinByUUID(o);
1845
+ if (i)
1846
+ return e.value[i.UUID] = i, i;
1847
+ } catch {
1848
+ return null;
1849
+ }
1850
+ }
1851
+ };
1852
+ }), sn = async () => {
1853
+ try {
1854
+ const { data: e } = await f().get(
1855
+ "/api/v1/twintypes",
1856
+ {
1857
+ headers: {
1858
+ Accept: "application/json"
1859
+ }
1860
+ }
1861
+ );
1862
+ return Object.values(e) || [];
1863
+ } catch {
1864
+ return [];
1865
+ }
1866
+ }, on = {
1867
+ getTwinTypes: sn
1868
+ }, rn = O("twinTypes", () => {
1869
+ const e = v([]), t = D(() => e.value.map((o) => o.name)), n = D(() => e.value.map((o) => ({ value: o.UUID, label: o.name }))), s = async () => {
1870
+ try {
1871
+ const o = await on.getTwinTypes();
1872
+ e.value = o;
1873
+ } catch {
1874
+ }
1875
+ };
1876
+ return s(), {
1877
+ twinTypes: e,
1878
+ pullTwinTypes: s,
1879
+ twinTypeNames: t,
1880
+ twinTypeSelectArray: n
1881
+ };
1882
+ }), bn = O("labels", () => {
1883
+ const e = v([]), t = async () => {
1884
+ try {
1885
+ const s = await ve.getLabels();
1886
+ e.value = s;
1887
+ } catch {
1888
+ }
1889
+ }, n = async (s) => {
1890
+ const { twinTypeNames: o } = nn(rn());
1891
+ try {
1892
+ await ve.createLabel(s, o.value), await t();
1893
+ } catch {
1894
+ }
1895
+ };
1896
+ return t(), {
1897
+ labels: e,
1898
+ pullLabels: t,
1899
+ updateLabels: n
1900
+ };
1901
+ }), an = async () => {
1902
+ try {
1903
+ const { data: e } = await f().get(
1904
+ "/api/v1/iotdata/metrics/counters",
1905
+ {
1906
+ headers: {
1907
+ Accept: "application/json"
1908
+ }
1909
+ }
1910
+ );
1911
+ return e;
1912
+ } catch {
1913
+ throw new Error("Metric Counter API Error");
1914
+ }
1915
+ }, cn = {
1916
+ getMetricsCounters: an
1917
+ }, En = O("metrics", () => {
1918
+ const e = v([]), t = v([]), n = D(() => (i) => {
1919
+ var c;
1920
+ return (c = t.value) == null ? void 0 : c.find((d) => d.name === i);
1921
+ }), s = D(() => e.value.map((i) => ({ title: `${i.label} ${i.name}`, label: i.label, value: i.name }))), o = async (i) => {
1922
+ if (!(i && e.value.length))
1923
+ try {
1924
+ const c = await we.getMetrics();
1925
+ e.value = c;
1926
+ } catch (c) {
1927
+ M().setSnackbarMessage(c, "error");
1928
+ }
1929
+ }, r = async () => {
1930
+ try {
1931
+ const i = await cn.getMetricsCounters();
1932
+ t.value = i;
1933
+ } catch (i) {
1934
+ M().setSnackbarMessage(i, "error");
1935
+ }
1936
+ }, a = async (i) => {
1937
+ let c = !1;
1938
+ try {
1939
+ await we.postMetric(i), c = !0, M().setSnackbarMessage(`Metric ${i.name} successfully saved`, "success");
1940
+ } catch (d) {
1941
+ M().setSnackbarMessage(d, "error");
1942
+ }
1943
+ return await o(), await r(), c;
1944
+ };
1945
+ return o(), {
1946
+ metrics: e,
1947
+ metricsCounters: t,
1948
+ pullMetrics: o,
1949
+ pullMetricsCounters: r,
1950
+ getMetricCounter: n,
1951
+ saveMetric: a,
1952
+ metricsArr: s
1953
+ };
1954
+ });
1955
+ function Cn(e) {
1956
+ for (const t in ge)
1957
+ e.component(t, ge[t]);
1958
+ }
1959
+ export {
1960
+ Ke as ComponentA,
1961
+ Et as ComponentB,
1962
+ f as DavraApiClient,
1963
+ ye as DavraApiConfig,
1964
+ hn as DevicesCountersService,
1965
+ G as DevicesService,
1966
+ ve as LabelService,
1967
+ we as MetricsService,
1968
+ pn as MyConstants,
1969
+ fn as MyUtil,
1970
+ yn as TimeseriesService,
1971
+ gn as TwinsCountersService,
1972
+ Z as TwinsService,
1973
+ me as UserSessionService,
1974
+ Cn as install,
1975
+ M as useAlertMessagesStore,
1976
+ vn as useDevicesStore,
1977
+ bn as useLabelsStore,
1978
+ En as useMetricsStore,
1979
+ rn as useTwinTypesStore,
1980
+ wn as useTwinsStore,
1981
+ mn as useUserSessionStore
1982
+ };