@nice2dev/ui-iot 1.1.6 β†’ 1.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,1311 +1,403 @@
1
- import { jsxs as a, jsx as e, Fragment as E } from "react/jsx-runtime";
2
- import { useState as h, useCallback as w, useContext as ie, createContext as b, memo as ce, useEffect as ne } from "react";
3
- const F = [
4
- { type: "device-list", label: "Device List", icon: "πŸ“‹" },
5
- { type: "device-status", label: "Device Status", icon: "🟒" },
6
- { type: "telemetry-chart", label: "Telemetry Chart", icon: "πŸ“ˆ" },
7
- { type: "gauge", label: "Gauge", icon: "⏱️" },
8
- { type: "map", label: "Device Map", icon: "πŸ—ΊοΈ" },
9
- { type: "alarms", label: "Alarms", icon: "🚨" },
10
- { type: "control-panel", label: "Control Panel", icon: "πŸŽ›οΈ" },
11
- { type: "topology", label: "Network Topology", icon: "πŸ”—" },
12
- { type: "kpi", label: "KPI Card", icon: "🎯" },
13
- { type: "camera-feed", label: "Camera Feed", icon: "πŸ“Ή" }
14
- ];
15
- function Ee({
16
- devices: r = [],
17
- widgets: i = [],
18
- alarms: c = [],
19
- onDeviceSelect: n,
20
- onWidgetChange: o,
21
- onCommand: d,
22
- onAlarmAcknowledge: t,
23
- fetchTelemetry: l,
24
- className: g = ""
25
- }) {
26
- const [m, C] = h(i), [N, v] = h(null), [u, _] = h("dashboard"), [H, P] = h(!1), [x, R] = h(""), y = w(
27
- (f) => {
28
- C((S) => {
29
- const T = f(S);
30
- return o == null || o(T), T;
31
- });
32
- },
33
- [o]
34
- ), k = w(
35
- (f) => {
36
- var T;
37
- const S = {
38
- id: crypto.randomUUID(),
39
- type: f,
40
- title: ((T = F.find((B) => B.type === f)) == null ? void 0 : T.label) || f,
41
- position: { x: 0, y: oe(m), width: 4, height: 3 },
42
- config: {}
43
- };
44
- y((B) => [...B, S]);
45
- },
46
- [m, y]
47
- ), L = w(
48
- (f) => {
49
- v(f), n == null || n(f);
50
- },
51
- [n]
52
- ), $ = w(
53
- (f) => {
54
- t == null || t(f);
55
- },
56
- [t]
57
- ), M = r.filter(
58
- (f) => !x || f.name.toLowerCase().includes(x.toLowerCase()) || f.type.toLowerCase().includes(x.toLowerCase())
59
- ), I = c.filter((f) => !f.cleared), z = I.filter(
60
- (f) => f.severity === "critical" || f.severity === "high"
61
- );
62
- return /* @__PURE__ */ a("div", { className: `nice-iot-dashboard ${g}`, children: [
63
- /* @__PURE__ */ a("header", { className: "nice-iot-dashboard__header", children: [
64
- /* @__PURE__ */ e("h1", { children: "IoT Dashboard" }),
65
- /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__stats", children: [
66
- /* @__PURE__ */ a("span", { className: "nice-iot-dashboard__stat", children: [
67
- /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__stat-icon", children: "πŸ“±" }),
68
- r.length,
69
- " Devices"
70
- ] }),
71
- /* @__PURE__ */ a("span", { className: "nice-iot-dashboard__stat nice-iot-dashboard__stat--online", children: [
72
- /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__stat-icon", children: "🟒" }),
73
- r.filter((f) => f.status === "online").length,
74
- " Online"
75
- ] }),
76
- /* @__PURE__ */ a("span", { className: "nice-iot-dashboard__stat nice-iot-dashboard__stat--offline", children: [
77
- /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__stat-icon", children: "⚫" }),
78
- r.filter((f) => f.status === "offline").length,
79
- " Offline"
80
- ] }),
81
- z.length > 0 && /* @__PURE__ */ a("span", { className: "nice-iot-dashboard__stat nice-iot-dashboard__stat--alarms", children: [
82
- /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__stat-icon", children: "🚨" }),
83
- z.length,
84
- " Alarms"
85
- ] })
86
- ] }),
87
- /* @__PURE__ */ a("nav", { className: "nice-iot-dashboard__nav", children: [
88
- /* @__PURE__ */ e(
89
- "button",
90
- {
91
- className: u === "dashboard" ? "active" : "",
92
- onClick: () => _("dashboard"),
93
- children: "Dashboard"
94
- }
95
- ),
96
- /* @__PURE__ */ e("button", { className: u === "devices" ? "active" : "", onClick: () => _("devices"), children: "Devices" }),
97
- /* @__PURE__ */ a("button", { className: u === "alarms" ? "active" : "", onClick: () => _("alarms"), children: [
98
- "Alarms ",
99
- I.length > 0 && `(${I.length})`
100
- ] })
101
- ] }),
102
- /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__actions", children: u === "dashboard" && /* @__PURE__ */ e("button", { onClick: () => P(!H), children: H ? "βœ“ Done" : "✏️ Edit" }) })
103
- ] }),
104
- u === "dashboard" && /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__main", children: [
105
- H && /* @__PURE__ */ a("aside", { className: "nice-iot-dashboard__palette", children: [
106
- /* @__PURE__ */ e("h4", { children: "Add Widget" }),
107
- F.map((f) => /* @__PURE__ */ a(
108
- "button",
109
- {
110
- className: "nice-iot-dashboard__palette-item",
111
- onClick: () => k(f.type),
112
- children: [
113
- /* @__PURE__ */ e("span", { children: f.icon }),
114
- /* @__PURE__ */ e("span", { children: f.label })
115
- ]
116
- },
117
- f.type
118
- ))
119
- ] }),
120
- /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__grid", children: [
121
- m.map((f) => /* @__PURE__ */ e(
122
- de,
123
- {
124
- widget: f,
125
- devices: r,
126
- alarms: c,
127
- isEditing: H,
128
- onCommand: d,
129
- onDelete: () => y((S) => S.filter((T) => T.id !== f.id))
130
- },
131
- f.id
132
- )),
133
- m.length === 0 && /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__empty", children: H ? "Add widgets from the palette" : "No widgets configured. Click Edit to add widgets." })
134
- ] })
135
- ] }),
136
- u === "devices" && /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__devices", children: [
137
- /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__devices-toolbar", children: /* @__PURE__ */ e(
138
- "input",
139
- {
140
- type: "search",
141
- placeholder: "Search devices...",
142
- value: x,
143
- onChange: (f) => R(f.target.value)
144
- }
145
- ) }),
146
- /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__device-grid", children: M.map((f) => /* @__PURE__ */ e(
147
- se,
148
- {
149
- device: f,
150
- isSelected: (N == null ? void 0 : N.id) === f.id,
151
- onSelect: () => L(f)
152
- },
153
- f.id
154
- )) }),
155
- N && /* @__PURE__ */ e(
156
- le,
157
- {
158
- device: N,
159
- onCommand: d,
160
- onClose: () => v(null)
161
- }
162
- )
163
- ] }),
164
- u === "alarms" && /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__alarms", children: /* @__PURE__ */ a("table", { className: "nice-iot-dashboard__alarm-table", children: [
165
- /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ a("tr", { children: [
166
- /* @__PURE__ */ e("th", { children: "Severity" }),
167
- /* @__PURE__ */ e("th", { children: "Device" }),
168
- /* @__PURE__ */ e("th", { children: "Message" }),
169
- /* @__PURE__ */ e("th", { children: "Time" }),
170
- /* @__PURE__ */ e("th", { children: "Status" }),
171
- /* @__PURE__ */ e("th", { children: "Actions" })
172
- ] }) }),
173
- /* @__PURE__ */ e("tbody", { children: I.length === 0 ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: 6, className: "nice-iot-dashboard__no-alarms", children: "No active alarms" }) }) : I.map((f) => {
174
- const S = r.find((T) => T.id === f.deviceId);
175
- return /* @__PURE__ */ a(
176
- "tr",
177
- {
178
- className: `nice-iot-dashboard__alarm-row nice-iot-dashboard__alarm-row--${f.severity}`,
179
- children: [
180
- /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
181
- "span",
182
- {
183
- className: `nice-iot-dashboard__severity nice-iot-dashboard__severity--${f.severity}`,
184
- children: f.severity
185
- }
186
- ) }),
187
- /* @__PURE__ */ e("td", { children: (S == null ? void 0 : S.name) || f.deviceId }),
188
- /* @__PURE__ */ e("td", { children: f.message }),
189
- /* @__PURE__ */ e("td", { children: f.timestamp.toLocaleString() }),
190
- /* @__PURE__ */ e("td", { children: f.acknowledged ? "Acknowledged" : "Active" }),
191
- /* @__PURE__ */ e("td", { children: !f.acknowledged && /* @__PURE__ */ e("button", { onClick: () => $(f.id), children: "Acknowledge" }) })
192
- ]
193
- },
194
- f.id
195
- );
196
- }) })
197
- ] }) })
198
- ] });
1
+ import { jsx as e, jsxs as r, Fragment as D } from "react/jsx-runtime";
2
+ import { useContext as B, createContext as b, memo as oe, useState as y, useEffect as te, useCallback as C } from "react";
3
+ const de = (a, i) => i, se = b(de), le = b("en");
4
+ function R() {
5
+ const a = B(se), i = B(le);
6
+ return { t: a, lang: i };
199
7
  }
200
- function oe(r) {
201
- return r.length === 0 ? 0 : Math.max(...r.map((i) => i.position.y + i.position.height));
202
- }
203
- function A(r) {
204
- switch (r) {
205
- case "online":
206
- return "var(--nice-success, #28a745)";
207
- case "offline":
208
- return "var(--nice-text-secondary, #6c757d)";
209
- case "warning":
210
- return "var(--nice-warning, #ffc107)";
211
- case "error":
212
- return "var(--nice-danger, #dc3545)";
213
- case "maintenance":
214
- return "var(--nice-info, #17a2b8)";
215
- default:
216
- return "var(--nice-text-secondary, #6c757d)";
8
+ b({
9
+ dir: "ltr",
10
+ isRTL: !1,
11
+ flip: (a) => a,
12
+ value: (a) => a.ltr
13
+ });
14
+ b(null);
15
+ b(null);
16
+ const fe = {
17
+ radius: "md",
18
+ shadow: "md",
19
+ fill: "solid",
20
+ buttonStyle: "flat",
21
+ inputStyle: "bordered",
22
+ cardStyle: "elevated",
23
+ badgeStyle: "solid",
24
+ tabStyle: "underline",
25
+ toggleStyle: "default",
26
+ tooltipStyle: "dark",
27
+ modalStyle: "default",
28
+ tableStyle: "default",
29
+ menuStyle: "default",
30
+ animation: "normal",
31
+ density: "normal"
32
+ };
33
+ b({
34
+ displayStyle: "default",
35
+ variantConfig: fe,
36
+ setDisplayStyle: () => {
217
37
  }
218
- }
219
- function de({
220
- widget: r,
221
- devices: i,
222
- alarms: c,
223
- isEditing: n,
224
- onCommand: o,
225
- onDelete: d
38
+ });
39
+ const me = {
40
+ // Navigation
41
+ "chevron-down": "M6 9l6 6 6-6",
42
+ "chevron-up": "M18 15l-6-6-6 6",
43
+ "chevron-left": "M15 18l-6-6 6-6",
44
+ "chevron-right": "M9 6l6 6-6 6",
45
+ "arrow-left": "M19 12H5m0 0l7 7m-7-7l7-7",
46
+ "arrow-right": "M5 12h14m0 0l-7-7m7 7l-7 7",
47
+ "arrow-up": "M12 19V5m0 0l-7 7m7-7l7 7",
48
+ "arrow-down": "M12 5v14m0 0l7-7m-7 7l-7-7",
49
+ // Actions
50
+ close: "M18 6L6 18M6 6l12 12",
51
+ plus: "M12 5v14m-7-7h14",
52
+ minus: "M5 12h14",
53
+ check: "M5 13l4 4L19 7",
54
+ edit: "M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7M18.5 2.5a2.121 2.121 0 113 3L12 15l-4 1 1-4 9.5-9.5z",
55
+ trash: "M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16",
56
+ copy: "M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z",
57
+ download: "M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4",
58
+ upload: "M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12",
59
+ refresh: "M4 4v5h5M20 20v-5h-5M20.49 9A9 9 0 005.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 013.51 15",
60
+ // UI
61
+ search: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z",
62
+ filter: "M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z",
63
+ "sort-asc": "M3 4h13M3 8h9m-9 4h6m4 0l4-4m0 0l4 4m-4-4v12",
64
+ "sort-desc": "M3 4h13M3 8h9m-9 4h9m5-4v12m0 0l-4-4m4 4l4-4",
65
+ // Neutral "sortable" indicator: a small up-chevron over a down-chevron.
66
+ sort: "M6 10l6-6 6 6M6 14l6 6 6-6",
67
+ menu: "M4 6h16M4 12h16M4 18h16",
68
+ "more-vertical": "M12 5v.01M12 12v.01M12 19v.01",
69
+ "more-horizontal": "M5 12h.01M12 12h.01M19 12h.01",
70
+ settings: "M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z",
71
+ eye: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z M15 12a3 3 0 11-6 0 3 3 0 016 0z",
72
+ "eye-off": "M17.94 17.94A10.07 10.07 0 0112 20c-7 0-11-8-11-8a18.45 18.45 0 015.06-5.94M9.9 4.24A9.12 9.12 0 0112 4c7 0 11 8 11 8a18.5 18.5 0 01-2.16 3.19m-6.72-1.07a3 3 0 11-4.24-4.24 M1 1l22 22",
73
+ lock: "M19 11H5a2 2 0 00-2 2v7a2 2 0 002 2h14a2 2 0 002-2v-7a2 2 0 00-2-2zm-3-4a4 4 0 10-8 0v4h8V7z",
74
+ // Status
75
+ info: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",
76
+ warning: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z",
77
+ error: "M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z",
78
+ success: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",
79
+ help: "M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",
80
+ // Content
81
+ calendar: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z",
82
+ clock: "M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z",
83
+ file: "M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z",
84
+ folder: "M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z",
85
+ image: "M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z",
86
+ link: "M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1",
87
+ mail: "M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z",
88
+ phone: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z",
89
+ user: "M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z",
90
+ users: "M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z",
91
+ home: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6",
92
+ star: "M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z",
93
+ heart: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z",
94
+ bell: "M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9",
95
+ grip: "M4 6h2m4 0h2m4 0h2M4 12h2m4 0h2m4 0h2M4 18h2m4 0h2m4 0h2",
96
+ hash: "M4 9h16M4 15h16M10 3L8 21M16 3l-2 18",
97
+ list: "M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01",
98
+ circle: "M12 21a9 9 0 100-18 9 9 0 000 18z",
99
+ // UI component / element types (palettes, builders)
100
+ box: "M21 8a2 2 0 00-1-1.73l-7-4a2 2 0 00-2 0l-7 4A2 2 0 003 8v8a2 2 0 001 1.73l7 4a2 2 0 002 0l7-4A2 2 0 0021 16V8z M3.27 6.96L12 12.01l8.73-5.05 M12 22.08V12",
101
+ tabs: "M3 9h18v10H3z M7 9V5h6v4",
102
+ columns: "M4 4h7v16H4z M13 4h7v16h-7z",
103
+ grid: "M3 3h7v7H3z M14 3h7v7h-7z M14 14h7v7h-7z M3 14h7v7H3z",
104
+ table: "M3 5h18v14H3z M3 10h18M3 15h18M9 5v14M15 5v14",
105
+ heading: "M6 4v16M18 4v16M6 12h12",
106
+ type: "M4 7V4h16v3M9 20h6M12 4v16",
107
+ "align-left": "M3 6h18M3 12h12M3 18h15",
108
+ input: "M4 9h16a1 1 0 011 1v4a1 1 0 01-1 1H4a1 1 0 01-1-1v-4a1 1 0 011-1z M7 12h5",
109
+ button: "M5 9h14a2 2 0 012 2v2a2 2 0 01-2 2H5a2 2 0 01-2-2v-2a2 2 0 012-2z",
110
+ select: "M4 6h16a1 1 0 011 1v10a1 1 0 01-1 1H4a1 1 0 01-1-1V7a1 1 0 011-1z M15 11l-3 3-3-3",
111
+ "check-square": "M9 11l3 3L22 4 M21 12v7a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h11",
112
+ video: "M23 7l-7 5 7 5V7z M16 5H3a2 2 0 00-2 2v10a2 2 0 002 2h13a2 2 0 002-2V7a2 2 0 00-2-2z",
113
+ card: "M3 5h18a1 1 0 011 1v12a1 1 0 01-1 1H3a1 1 0 01-1-1V6a1 1 0 011-1z M3 10h18",
114
+ // App / infra / media concepts
115
+ "bar-chart": "M6 20v-6M12 20V4M18 20v-10",
116
+ "line-chart": "M3 3v18h18 M7 15l4-4 3 3 5-6",
117
+ "area-chart": "M3 3v18h18 M7 17v-3l4-4 3 3 5-6v10z",
118
+ "pie-chart": "M21.21 15.89A10 10 0 118 2.83 M22 12A10 10 0 0012 2v10z",
119
+ "donut-chart": "M12 3a9 9 0 100 18 9 9 0 000-18z M12 8a4 4 0 100 8 4 4 0 000-8z",
120
+ "scatter-chart": "M3 3v18h18 M8 16h.01 M11 11h.01 M15 14h.01 M18 8h.01",
121
+ "bars-vertical": "M6 5v14M12 5v14M18 5v14",
122
+ globe: "M12 3a9 9 0 100 18 9 9 0 000-18z M3 12h18 M12 3a14 14 0 010 18 M12 3a14 14 0 000 18",
123
+ monitor: "M3 4h18a1 1 0 011 1v11a1 1 0 01-1 1H3a1 1 0 01-1-1V5a1 1 0 011-1z M8 21h8 M12 17v4",
124
+ camera: "M23 19a2 2 0 01-2 2H3a2 2 0 01-2-2V8a2 2 0 012-2h3l2-3h6l2 3h3a2 2 0 012 2z M12 17a4 4 0 100-8 4 4 0 000 8z",
125
+ plug: "M9 2v5 M15 2v5 M7 7h10v3a5 5 0 01-10 0V7z M12 15v7",
126
+ save: "M19 21H5a2 2 0 01-2-2V5a2 2 0 012-2h11l5 5v11a2 2 0 01-2 2z M17 21v-8H7v8 M7 3v5h8",
127
+ tag: "M20.59 13.41l-7.17 7.17a2 2 0 01-2.83 0L2 12V2h10l8.59 8.59a2 2 0 010 2.82z M7 7h.01",
128
+ palette: "M12 2a10 10 0 000 20 2 2 0 002-2c0-.5-.2-1-.5-1.3a2 2 0 01-.5-1.2 2 2 0 012-2H17a5 5 0 005-5c0-5-4.5-9-10-9z M6.5 11.5h.01 M9.5 7.5h.01 M14.5 7.5h.01",
129
+ book: "M4 19.5A2.5 2.5 0 016.5 17H20 M6.5 2H20v20H6.5A2.5 2.5 0 014 19.5v-15A2.5 2.5 0 016.5 2z",
130
+ cloud: "M18 10h-1.26A8 8 0 109 20h9a5 5 0 000-10z",
131
+ target: "M12 3a9 9 0 100 18 9 9 0 000-18z M12 7a5 5 0 100 10 5 5 0 000-10z M12 11a1 1 0 100 2 1 1 0 000-2z",
132
+ message: "M21 11.5a8.5 8.5 0 01-8.5 8.5 8.4 8.4 0 01-3.8-.9L3 21l1.9-5.7a8.4 8.4 0 01-.9-3.8A8.5 8.5 0 0112.5 3 8.5 8.5 0 0121 11.5z",
133
+ flask: "M9 2h6 M10 2v6.5L4.5 19a1 1 0 00.9 1.5h13.2a1 1 0 00.9-1.5L14 8.5V2 M7 15h10",
134
+ rocket: "M12 15l-3-3a22 22 0 012-3.95A12.88 12.88 0 0122 2c0 2.72-.78 7.5-6 11a22 22 0 01-3.95 2z M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0 M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5 M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 00-2.91-.09z",
135
+ music: "M9 18V5l12-2v13 M9 18a3 3 0 11-6 0 3 3 0 016 0z M21 16a3 3 0 11-6 0 3 3 0 016 0z",
136
+ wifi: "M5 12.55a11 11 0 0114 0 M8.5 16.11a6 6 0 017 0 M12 20h.01 M2 8.82a15 15 0 0120 0",
137
+ database: "M12 8c4.97 0 9-1.34 9-3s-4.03-3-9-3-9 1.34-9 3 4.03 3 9 3z M21 5v6c0 1.66-4.03 3-9 3s-9-1.34-9-3V5 M21 11v6c0 1.66-4.03 3-9 3s-9-1.34-9-3v-6",
138
+ slash: "M12 3a9 9 0 100 18 9 9 0 000-18z M5.6 5.6l12.8 12.8",
139
+ puzzle: "M19.4 13.6a1.6 1.6 0 10.2-3.2H19V7a2 2 0 00-2-2h-3.4v-.4a1.6 1.6 0 10-3.2 0V5H7a2 2 0 00-2 2v3.4h.4a1.6 1.6 0 100 3.2H5V17a2 2 0 002 2h3.4v.4a1.6 1.6 0 103.2 0V19H17a2 2 0 002-2v-3.4z",
140
+ dollar: "M12 1v22 M17 5H9.5a3.5 3.5 0 000 7h5a3.5 3.5 0 010 7H6",
141
+ printer: "M6 9V2h12v7 M6 18H4a2 2 0 01-2-2v-5a2 2 0 012-2h16a2 2 0 012 2v5a2 2 0 01-2 2h-2 M6 14h12v8H6z",
142
+ scale: "M12 3v18 M5 21h14 M5 7l7-2 7 2 M2 13a3 3 0 006 0L5 7zm14 0a3 3 0 006 0L19 7z",
143
+ accessibility: "M12 3a9 9 0 100 18 9 9 0 000-18z M12 9a1.5 1.5 0 100-3 1.5 1.5 0 000 3z M7.5 10.5l4.5 1 4.5-1 M12 11.5v3.5l-2 3.5 M12 15l2 3.5",
144
+ window: "M3 4h18a1 1 0 011 1v14a1 1 0 01-1 1H3a1 1 0 01-1-1V5a1 1 0 011-1z M2 9h20 M6 6.5h.01 M9 6.5h.01",
145
+ "map-pin": "M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0118 0z M12 13a3 3 0 100-6 3 3 0 000 6z",
146
+ cursor: "M5 3l14 7-6 2-2 6-6-15z",
147
+ shuffle: "M16 3h5v5 M4 20L21 3 M21 16v5h-5 M15 15l6 6 M4 4l5 5",
148
+ lightbulb: "M9 18h6 M10 22h4 M12 2a7 7 0 00-4 12.7c.6.5 1 1.3 1 2.1V18h6v-1.2c0-.8.4-1.6 1-2.1A7 7 0 0012 2z",
149
+ server: "M3 4h18a1 1 0 011 1v4a1 1 0 01-1 1H3a1 1 0 01-1-1V5a1 1 0 011-1z M3 14h18a1 1 0 011 1v4a1 1 0 01-1 1H3a1 1 0 01-1-1v-4a1 1 0 011-1z M7 7h.01 M7 17h.01",
150
+ terminal: "M4 17l6-6-6-6 M12 19h8",
151
+ "git-branch": "M6 3v12 M18 9a3 3 0 100-6 3 3 0 000 6z M6 21a3 3 0 100-6 3 3 0 000 6z M18 9a9 9 0 01-9 9",
152
+ send: "M22 2L11 13 M22 2l-7 20-4-9-9-4 20-7z",
153
+ // Media
154
+ play: "M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z M21 12a9 9 0 11-18 0 9 9 0 0118 0z",
155
+ pause: "M10 9v6m4-6v6m7-3a9 9 0 11-18 0 9 9 0 0118 0z",
156
+ stop: "M21 12a9 9 0 11-18 0 9 9 0 0118 0z M9 10a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-4z",
157
+ mic: "M12 1a3 3 0 00-3 3v8a3 3 0 006 0V4a3 3 0 00-3-3zM19 10v2a7 7 0 01-14 0v-2M12 19v4M8 23h8",
158
+ volume: "M11 5L6 9H2v6h4l5 4V5z M15.54 8.46a5 5 0 010 7.07 M19.07 4.93a10 10 0 010 14.14",
159
+ "volume-off": "M11 5L6 9H2v6h4l5 4V5z M23 9l-6 6 M17 9l6 6",
160
+ "skip-back": "M19 20L9 12l10-8v16z M5 19V5",
161
+ // Toggle
162
+ expand: "M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4",
163
+ collapse: "M9 9V5m0 4H5m4 0L4 4m11 5h4m-4 0V5m0 4l5-5M9 15v4m0-4H5m4 0l-5 5m15-5h-4m4 0v4m0-4l-5 5",
164
+ "external-link": "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14",
165
+ // Extended set (entities, gamification, status)
166
+ briefcase: "M20 7H4a2 2 0 00-2 2v9a2 2 0 002 2h16a2 2 0 002-2V9a2 2 0 00-2-2zM16 7V5a2 2 0 00-2-2h-4a2 2 0 00-2 2v2M2 12h20",
167
+ building: "M4 22V4a2 2 0 012-2h12a2 2 0 012 2v18M4 22h16M9 22v-4h6v4M9 6h.01M15 6h.01M9 10h.01M15 10h.01M9 14h.01M15 14h.01",
168
+ medal: "M15.477 12.89L17 22l-5-3-5 3 1.523-9.11M12 15a6 6 0 100-12 6 6 0 000 12z",
169
+ clipboard: "M9 2h6a1 1 0 011 1v1a1 1 0 01-1 1H9a1 1 0 01-1-1V3a1 1 0 011-1zM16 4h2a2 2 0 012 2v14a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2h2",
170
+ "skip-forward": "M5 4l10 8-10 8V4zM19 5v14",
171
+ "at-sign": "M12 16a4 4 0 100-8 4 4 0 000 8zM16 12v1.5a2.5 2.5 0 005 0V12a9 9 0 10-3.5 7.14",
172
+ gift: "M20 12v10H4V12M2 7h20v5H2zM12 22V7M12 7H7.5a2.5 2.5 0 010-5C11 2 12 7 12 7zM12 7h4.5a2.5 2.5 0 000-5C13 2 12 7 12 7z",
173
+ archive: "M21 8v13H3V8M1 3h22v5H1zM10 12h4",
174
+ reply: "M9 17l-5-5 5-5M4 12h11a4 4 0 014 4v2",
175
+ forward: "M15 17l5-5-5-5M20 12H9a4 4 0 00-4 4v2",
176
+ paperclip: "M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48",
177
+ zap: "M13 2L3 14h9l-1 8 10-12h-9l1-8z",
178
+ // Graphics / drawing tools (vector / pixel / photo / game editors)
179
+ square: "M4 4h16v16H4z",
180
+ triangle: "M12 4L3 20h18z",
181
+ hexagon: "M7.5 3h9l4.5 9-4.5 9h-9L3 12z",
182
+ diamond: "M12 2l10 10-10 10L2 12z",
183
+ line: "M5 19L19 5",
184
+ pen: "M12 19l7-7 3 3-7 7-3-3z M18 13l-1.5-7.5L2 2l3.5 14.5L13 18l5-5z M11 11a2 2 0 100-4 2 2 0 000 4z",
185
+ brush: "M9.06 11.9l8.07-8.06a2.85 2.85 0 114.03 4.03l-8.06 8.08 M7.07 14.94c-1.66 0-3 1.35-3 3.02 0 1.33-2.5 1.52-2 2.02 1.08 1.1 2.49 2.02 4 2.02 2.2 0 4-1.8 4-4.04a3.01 3.01 0 00-3-3.02z",
186
+ droplet: "M12 2.69l5.66 5.66a8 8 0 11-11.31 0z",
187
+ bucket: "M5 8h14l-1.5 11a2 2 0 01-2 1.8H8.5a2 2 0 01-2-1.8L5 8z M5 8l2-4h10l2 4",
188
+ scissors: "M6 9a3 3 0 100-6 3 3 0 000 6z M6 21a3 3 0 100-6 3 3 0 000 6z M20 4L8.12 15.88 M14.47 14.48L20 20 M8.12 8.12L12 12",
189
+ layers: "M12 2l9 5-9 5-9-5 9-5z M3 12l9 5 9-5 M3 17l9 5 9-5",
190
+ crop: "M6 2v14a2 2 0 002 2h14 M2 6h14a2 2 0 012 2v14",
191
+ eyedropper: "M2 22l1-1h3l9-9 M3 21v-3l9-9 M15 6l3.5-3.5a2.12 2.12 0 013 3L18 9l-3-3z",
192
+ ruler: "M21.3 8.7l-6-6a1 1 0 00-1.4 0L2.7 13.9a1 1 0 000 1.4l6 6a1 1 0 001.4 0L21.3 10.1a1 1 0 000-1.4z M7.5 10.5l2 2 M11 7l2 2 M14.5 3.5l2 2",
193
+ wand: "M15 4V2 M15 16v-2 M8 9h2 M20 9h2 M3 21l9-9 M12.2 6.2L11 5 M17.8 6.2L19 5 M17.8 11.8L19 13",
194
+ move: "M5 9l-3 3 3 3 M9 5l3-3 3 3 M15 19l-3 3-3-3 M19 9l3 3-3 3 M2 12h20 M12 2v20",
195
+ gamepad: "M6 12h4 M8 10v4 M15 13h.01 M18 11h.01 M2 12a4 4 0 014-4h12a4 4 0 014 4l-1.5 6a2 2 0 01-2 1.5H5.5a2 2 0 01-2-1.5L2 12z",
196
+ eraser: "M7 21l-4.3-4.3a1 1 0 010-1.4l9.6-9.6a2 2 0 012.8 0l4.6 4.6a2 2 0 010 2.8L13 21H7z M22 21H7 M5 12l5 5",
197
+ // Buildings / interior / fixtures (spatial / floor-plan / smart-home / real-estate editors)
198
+ thermometer: "M14 14.76V3.5a2.5 2.5 0 00-5 0v11.26a4.5 4.5 0 105 0z",
199
+ door: "M18 20V5a1 1 0 00-1-1H7a1 1 0 00-1 1v15 M3 20h18 M13 11.5h.01",
200
+ stairs: "M3 20h3v-3h3v-3h3v-3h3v-3h3",
201
+ elevator: "M5 3h14a1 1 0 011 1v16a1 1 0 01-1 1H5a1 1 0 01-1-1V4a1 1 0 011-1z M9.5 9L12 6.5 14.5 9 M9.5 15l2.5 2.5 2.5-2.5",
202
+ bed: "M2 4v16 M2 8h18a2 2 0 012 2v10 M22 17H2 M6 8v4 M2 12h4",
203
+ sofa: "M3 9V7a2 2 0 012-2h14a2 2 0 012 2v2 M21 9a2 2 0 00-2 2v3H5v-3a2 2 0 00-2-2 2 2 0 00-2 2v4a1 1 0 001 1h18a1 1 0 001-1v-4a2 2 0 00-2-2 M5 18v2 M19 18v2",
204
+ chair: "M6 11V5a2 2 0 012-2h8a2 2 0 012 2v6 M5 11h14 M6 11l-1 8h14l-1-8 M6 19v2 M18 19v2",
205
+ utensils: "M3 2v7a2 2 0 002 2 2 2 0 002-2V2 M5 2v20 M21 2v9c0 1-1 1.8-2 1.8h-1V20 M18 2v9",
206
+ mountain: "M8 3l4 8 5-5 5 15H2L8 3z",
207
+ tree: "M12 2L7 11h10L12 2z M9 11l3 5 3-5 M12 16v6",
208
+ sun: "M12 17a5 5 0 100-10 5 5 0 000 10z M12 1v2 M12 21v2 M4.22 4.22l1.42 1.42 M18.36 18.36l1.42 1.42 M1 12h2 M21 12h2 M4.22 19.78l1.42-1.42 M18.36 5.64l1.42-1.42",
209
+ moon: "M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z",
210
+ // Rich-text editing (NiceHtmlEditor toolbar, document editors)
211
+ "list-ordered": "M10 6h11M10 12h11M10 18h11M4 6h1v4M4 10h2M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",
212
+ unlink: "M18.84 12.25l1.72-1.71a5 5 0 0 0-7.07-7.07L11 5.78M3 3l18 18M9 15l3-3M14 11l3 3M14 21l-1.72-1.72a5 5 0 0 1-7.07-7.07L7 10.49",
213
+ code: "M16 18l6-6-6-6M8 6l-6 6 6 6",
214
+ quote: "M3 21c3-3 3-9 0-12M21 21c-3-3-3-9 0-12M9 7h6v6H9zM15 7h6v6h-6z",
215
+ indent: "M3 8l4 4-4 4M7 6h14M7 12h14M3 18h18",
216
+ outdent: "M7 8l-4 4 4 4M21 6H3M21 12H7M21 18H3",
217
+ "align-center": "M3 6h18M6 12h12M3 18h18",
218
+ "align-right": "M3 6h18M9 12h12M3 18h18",
219
+ "align-justify": "M3 6h18M3 12h18M3 18h18",
220
+ "align-top": "M4 4h16M9 8v12M15 8v7",
221
+ "align-middle": "M4 12h16M9 5v14M15 8v8",
222
+ "align-bottom": "M4 20h16M9 4v12M15 9v7",
223
+ "distribute-h": "M4 4v16M20 4v16M10 7h4v10h-4z",
224
+ "distribute-v": "M4 4h16M4 20h16M7 10h10v4H7z",
225
+ parallelogram: "M7 5h14l-4 14H3z",
226
+ barcode: "M4 5v14M6.5 5v14M10 5v14M13 5v14M15.5 5v14M19 5v14M20.5 5v14",
227
+ "qr-code": "M4 4h6v6H4z M14 4h6v6h-6z M4 14h6v6H4z M14 14h2v2h-2z M18 14h2v2h-2z M14 18h2v2h-2z M18 18h2v2h-2z",
228
+ smile: "M12 22a10 10 0 1 1 0-20 10 10 0 0 1 0 20zM8 14s1.5 2 4 2 4-2 4-2M9 9h.01M15 9h.01",
229
+ undo: "M9 14L4 9l5-5M4 9h10.5a5.5 5.5 0 010 11H11",
230
+ redo: "M15 14l5-5-5-5M20 9H9.5a5.5 5.5 0 000 11H13",
231
+ unlock: "M19 11H5a2 2 0 00-2 2v7a2 2 0 002 2h14a2 2 0 002-2v-7a2 2 0 00-2-2z M7 11V7a5 5 0 019.9-1",
232
+ keyboard: "M4 6h16a2 2 0 012 2v8a2 2 0 01-2 2H4a2 2 0 01-2-2V8a2 2 0 012-2z M6 10h.01 M10 10h.01 M14 10h.01 M18 10h.01 M8 14h8",
233
+ "page-break": "M6 3v5h12V3 M6 21v-5h12v5 M2 12h3 M8 12h3 M13 12h3 M19 12h3",
234
+ shield: "M12 2l8 3v6c0 5-3.4 9.4-8 11-4.6-1.6-8-6-8-11V5z",
235
+ repeat: "M17 2l4 4-4 4 M3 11V9a4 4 0 014-4h14 M7 22l-4-4 4-4 M21 13v2a4 4 0 01-4 4H3"
236
+ }, he = {
237
+ xs: 12,
238
+ sm: 16,
239
+ md: 20,
240
+ lg: 24,
241
+ xl: 32
242
+ }, pe = b({});
243
+ function ye({
244
+ path: a,
245
+ size: i,
246
+ className: c,
247
+ style: n,
248
+ color: o,
249
+ title: t,
250
+ onClick: d
226
251
  }) {
227
- const t = F.find((l) => l.type === r.type);
228
- return /* @__PURE__ */ a(
229
- "div",
252
+ return /* @__PURE__ */ r(
253
+ "svg",
230
254
  {
231
- className: `nice-iot-dashboard__widget nice-iot-dashboard__widget--${r.type}`,
232
- style: {
233
- gridColumn: `span ${r.position.width}`,
234
- gridRow: `span ${r.position.height}`
235
- },
255
+ xmlns: "http://www.w3.org/2000/svg",
256
+ width: i,
257
+ height: i,
258
+ viewBox: "0 0 24 24",
259
+ fill: "none",
260
+ stroke: o || "currentColor",
261
+ strokeWidth: 2,
262
+ strokeLinecap: "round",
263
+ strokeLinejoin: "round",
264
+ className: `nice-icon ${c || ""}`,
265
+ style: n,
266
+ role: t ? "img" : "presentation",
267
+ "aria-label": t,
268
+ "aria-hidden": !t,
269
+ onClick: d,
236
270
  children: [
237
- /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__widget-header", children: [
238
- /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__widget-icon", children: t == null ? void 0 : t.icon }),
239
- /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__widget-title", children: r.title }),
240
- n && /* @__PURE__ */ e("button", { className: "nice-iot-dashboard__widget-delete", onClick: d, children: "Γ—" })
241
- ] }),
242
- /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__widget-content", children: /* @__PURE__ */ e(te, { widget: r, devices: i, alarms: c, onCommand: o }) })
271
+ t && /* @__PURE__ */ e("title", { children: t }),
272
+ /* @__PURE__ */ e("path", { d: a })
243
273
  ]
244
274
  }
245
275
  );
246
276
  }
247
- function te({
248
- widget: r,
249
- devices: i,
250
- alarms: c,
251
- onCommand: n
252
- }) {
253
- switch (r.type) {
254
- case "device-list":
255
- return /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__device-list", children: i.slice(0, 10).map((o) => /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__device-list-item", children: [
256
- /* @__PURE__ */ e(
257
- "span",
258
- {
259
- className: "nice-iot-dashboard__device-status",
260
- style: { background: A(o.status) }
261
- }
262
- ),
263
- /* @__PURE__ */ e("span", { children: o.name }),
264
- /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__device-type", children: o.type })
265
- ] }, o.id)) });
266
- case "device-status":
267
- return /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__status-grid", children: ["online", "offline", "warning", "error"].map((o) => {
268
- const d = i.filter((t) => t.status === o).length;
269
- return /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__status-card", children: [
270
- /* @__PURE__ */ e(
271
- "span",
272
- {
273
- className: "nice-iot-dashboard__status-indicator",
274
- style: { background: A(o) }
275
- }
276
- ),
277
- /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__status-count", children: d }),
278
- /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__status-label", children: o })
279
- ] }, o);
280
- }) });
281
- case "telemetry-chart":
282
- return /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__chart-placeholder", children: [
283
- /* @__PURE__ */ e("span", { children: "πŸ“ˆ" }),
284
- /* @__PURE__ */ e("span", { children: "Telemetry Chart" }),
285
- /* @__PURE__ */ e("small", { children: "Configure device and capability" })
286
- ] });
287
- case "gauge":
288
- return /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__gauge", children: /* @__PURE__ */ a("svg", { viewBox: "0 0 100 60", children: [
289
- /* @__PURE__ */ e("path", { d: "M 10 55 A 40 40 0 0 1 90 55", fill: "none", stroke: "var(--nice-border, #e0e0e0)", strokeWidth: "8" }),
290
- /* @__PURE__ */ e(
291
- "path",
292
- {
293
- d: "M 10 55 A 40 40 0 0 1 90 55",
294
- fill: "none",
295
- stroke: "var(--nice-primary, #0066cc)",
296
- strokeWidth: "8",
297
- strokeDasharray: "63 126"
298
- }
299
- ),
300
- /* @__PURE__ */ e("text", { x: "50", y: "50", textAnchor: "middle", fontSize: "14", fontWeight: "bold", children: "50%" })
301
- ] }) });
302
- case "map":
303
- return /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__map-placeholder", children: [
304
- /* @__PURE__ */ e("span", { children: "πŸ—ΊοΈ" }),
305
- /* @__PURE__ */ e("span", { children: "Device Map" }),
306
- /* @__PURE__ */ a("small", { children: [
307
- i.filter((o) => o.location).length,
308
- " devices with location"
309
- ] })
310
- ] });
311
- case "alarms": {
312
- const o = c.filter((d) => !d.cleared).slice(0, 5);
313
- return /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__alarm-list", children: o.length === 0 ? /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__alarm-empty", children: "No active alarms" }) : o.map((d) => /* @__PURE__ */ a(
314
- "div",
315
- {
316
- className: `nice-iot-dashboard__alarm-item nice-iot-dashboard__alarm-item--${d.severity}`,
317
- children: [
318
- /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__alarm-severity", children: d.severity }),
319
- /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__alarm-message", children: d.message })
320
- ]
321
- },
322
- d.id
323
- )) });
324
- }
325
- case "control-panel":
326
- return /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__control-placeholder", children: [
327
- /* @__PURE__ */ e("span", { children: "πŸŽ›οΈ" }),
328
- /* @__PURE__ */ e("span", { children: "Control Panel" }),
329
- /* @__PURE__ */ e("small", { children: "Configure device controls" })
330
- ] });
331
- case "kpi":
332
- return /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__kpi", children: [
333
- /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__kpi-value", children: i.length }),
334
- /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__kpi-label", children: "Total Devices" })
335
- ] });
336
- default:
337
- return /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__widget-placeholder", children: r.type });
277
+ const u = ({
278
+ name: a,
279
+ size: i = "md",
280
+ className: c,
281
+ style: n,
282
+ color: o,
283
+ title: t,
284
+ onClick: d
285
+ }) => {
286
+ const { resolver: l } = B(pe), g = typeof i == "number" ? i : he[i];
287
+ if (l) {
288
+ const _ = l(a, g);
289
+ if (_)
290
+ return /* @__PURE__ */ e("span", { className: `nice-icon-wrap ${c || ""}`, style: n, onClick: d, children: _ });
338
291
  }
339
- }
340
- function se({ device: r, isSelected: i, onSelect: c }) {
341
- return /* @__PURE__ */ a(
342
- "div",
292
+ const m = me[a];
293
+ return m ? /* @__PURE__ */ e(
294
+ ye,
343
295
  {
344
- className: `nice-iot-dashboard__device-card ${i ? "nice-iot-dashboard__device-card--selected" : ""}`,
345
- onClick: c,
346
- children: [
347
- /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__device-card-header", children: [
348
- /* @__PURE__ */ e(
349
- "span",
350
- {
351
- className: "nice-iot-dashboard__device-status",
352
- style: { background: A(r.status) }
353
- }
354
- ),
355
- /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__device-name", children: r.name })
356
- ] }),
357
- /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__device-card-body", children: [
358
- /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__device-info", children: [
359
- /* @__PURE__ */ a("span", { children: [
360
- "Type: ",
361
- r.type
362
- ] }),
363
- /* @__PURE__ */ a("span", { children: [
364
- "Protocol: ",
365
- r.protocol
366
- ] })
367
- ] }),
368
- r.lastSeen && /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__device-lastseen", children: [
369
- "Last seen: ",
370
- r.lastSeen.toLocaleString()
371
- ] }),
372
- /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__device-capabilities", children: [
373
- r.capabilities.slice(0, 3).map((n) => /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__capability-badge", children: n.name }, n.id)),
374
- r.capabilities.length > 3 && /* @__PURE__ */ a("span", { className: "nice-iot-dashboard__capability-more", children: [
375
- "+",
376
- r.capabilities.length - 3
377
- ] })
378
- ] })
379
- ] })
380
- ]
296
+ path: m,
297
+ size: g,
298
+ className: c,
299
+ style: n,
300
+ color: o,
301
+ title: t,
302
+ onClick: d
381
303
  }
382
- );
383
- }
384
- function le({
385
- device: r,
386
- onCommand: i,
387
- onClose: c
388
- }) {
389
- return /* @__PURE__ */ a("aside", { className: "nice-iot-dashboard__device-detail", children: [
390
- /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__device-detail-header", children: [
391
- /* @__PURE__ */ e("h3", { children: r.name }),
392
- /* @__PURE__ */ e("button", { onClick: c, children: "Γ—" })
393
- ] }),
394
- /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__device-detail-content", children: [
395
- /* @__PURE__ */ a("section", { children: [
396
- /* @__PURE__ */ e("h4", { children: "Status" }),
397
- /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__detail-row", children: [
398
- /* @__PURE__ */ e("span", { children: "Status:" }),
399
- /* @__PURE__ */ e(
400
- "span",
401
- {
402
- className: "nice-iot-dashboard__status-badge",
403
- style: { background: A(r.status) },
404
- children: r.status
405
- }
406
- )
407
- ] }),
408
- r.lastSeen && /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__detail-row", children: [
409
- /* @__PURE__ */ e("span", { children: "Last Seen:" }),
410
- /* @__PURE__ */ e("span", { children: r.lastSeen.toLocaleString() })
411
- ] })
412
- ] }),
413
- /* @__PURE__ */ a("section", { children: [
414
- /* @__PURE__ */ e("h4", { children: "Connection" }),
415
- /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__detail-row", children: [
416
- /* @__PURE__ */ e("span", { children: "Protocol:" }),
417
- /* @__PURE__ */ e("span", { children: r.protocol })
418
- ] }),
419
- r.connectionInfo.host && /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__detail-row", children: [
420
- /* @__PURE__ */ e("span", { children: "Host:" }),
421
- /* @__PURE__ */ a("span", { children: [
422
- r.connectionInfo.host,
423
- ":",
424
- r.connectionInfo.port
425
- ] })
426
- ] })
427
- ] }),
428
- r.metadata && /* @__PURE__ */ a("section", { children: [
429
- /* @__PURE__ */ e("h4", { children: "Metadata" }),
430
- r.metadata.manufacturer && /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__detail-row", children: [
431
- /* @__PURE__ */ e("span", { children: "Manufacturer:" }),
432
- /* @__PURE__ */ e("span", { children: r.metadata.manufacturer })
433
- ] }),
434
- r.metadata.model && /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__detail-row", children: [
435
- /* @__PURE__ */ e("span", { children: "Model:" }),
436
- /* @__PURE__ */ e("span", { children: r.metadata.model })
437
- ] })
438
- ] }),
439
- /* @__PURE__ */ a("section", { children: [
440
- /* @__PURE__ */ e("h4", { children: "Capabilities" }),
441
- /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__capabilities-list", children: r.capabilities.map((n) => /* @__PURE__ */ a("div", { className: "nice-iot-dashboard__capability-item", children: [
442
- /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__capability-name", children: n.name }),
443
- /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__capability-type", children: n.type }),
444
- n.writable && i && /* @__PURE__ */ e(
445
- "button",
446
- {
447
- className: "nice-iot-dashboard__capability-control",
448
- onClick: () => i(r.id, n.id, !0),
449
- children: "Control"
450
- }
451
- )
452
- ] }, n.id)) })
453
- ] })
454
- ] })
455
- ] });
456
- }
457
- const fe = [
458
- { name: "MQTT Broker", image: "eclipse-mosquitto:latest" },
459
- { name: "Node-RED", image: "nodered/node-red:latest" },
460
- { name: "InfluxDB", image: "influxdb:latest" },
461
- { name: "Grafana", image: "grafana/grafana:latest" },
462
- { name: "Telegraf", image: "telegraf:latest" },
463
- { name: "Protocol Adapter", image: "nice2dev/protocol-adapter:latest" }
464
- ];
465
- function Ue({
466
- nodes: r = [],
467
- modules: i = [],
468
- onNodeSelect: c,
469
- onModuleDeploy: n,
470
- onModuleAction: o,
471
- onNodeSync: d,
472
- className: t = ""
473
- }) {
474
- const [l, g] = h(null), [m, C] = h("nodes"), [N, v] = h(!1), [u, _] = h({
475
- name: "",
476
- image: "",
477
- status: "pending"
478
- }), H = w(
479
- (y) => {
480
- g(y), c == null || c(y);
304
+ ) : null;
305
+ };
306
+ b({
307
+ direction: "ltr",
308
+ isRTL: !1,
309
+ flip: (a) => a,
310
+ flipStyle: (a, i) => ({ [a]: i })
311
+ });
312
+ b({
313
+ permissions: {},
314
+ getAccessMode: () => "full"
315
+ });
316
+ b(null);
317
+ b(null);
318
+ const Y = {
319
+ space1: "4px",
320
+ space2: "8px",
321
+ space3: "12px",
322
+ space4: "16px",
323
+ space5: "20px",
324
+ space6: "24px",
325
+ space8: "32px"
326
+ }, Z = {
327
+ fontFamily: "'Inter', system-ui, -apple-system, sans-serif",
328
+ fontSizeXs: "0.75rem",
329
+ fontSizeSm: "0.8125rem",
330
+ fontSizeMd: "0.875rem",
331
+ fontSizeLg: "1rem",
332
+ fontSizeXl: "1.125rem",
333
+ fontWeightNormal: 400,
334
+ fontWeightMedium: 500,
335
+ fontWeightSemibold: 600,
336
+ fontWeightBold: 700,
337
+ lineHeight: 1.5
338
+ }, ee = { fast: "120ms ease", normal: "200ms ease", slow: "300ms ease" }, ae = (a) => ({
339
+ color: a,
340
+ radiusSm: "4px",
341
+ radiusMd: "6px",
342
+ radiusLg: "8px",
343
+ radiusXl: "12px",
344
+ radiusFull: "9999px"
345
+ }), ue = {
346
+ sm: "0 1px 2px rgba(0,0,0,0.05)",
347
+ md: "0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",
348
+ lg: "0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",
349
+ xl: "0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)"
350
+ }, ve = {
351
+ sm: "0 1px 2px rgba(0,0,0,0.3)",
352
+ md: "0 4px 6px -1px rgba(0,0,0,0.4)",
353
+ lg: "0 10px 15px -3px rgba(0,0,0,0.4)",
354
+ xl: "0 20px 25px -5px rgba(0,0,0,0.4)"
355
+ };
356
+ function s(a, i, c, n, o) {
357
+ return {
358
+ name: a,
359
+ darkMode: "light",
360
+ colors: {
361
+ ...i,
362
+ surface: i.surface ?? c.primary,
363
+ surfaceHover: i.surfaceHover ?? c.secondary
481
364
  },
482
- [c]
483
- ), P = w(async () => {
484
- !l || !u.name || !u.image || (await (n == null ? void 0 : n(l.id, u)), v(!1), _({ name: "", image: "", status: "pending" }));
485
- }, [l, u, n]), x = w(
486
- async (y, k) => {
487
- l && await (o == null ? void 0 : o(l.id, y, k));
365
+ backgrounds: {
366
+ ...c,
367
+ elevated: c.elevated ?? c.primary,
368
+ inset: c.inset ?? c.tertiary,
369
+ canvas: c.canvas ?? c.primary
488
370
  },
489
- [l, o]
490
- ), R = w(async () => {
491
- l && await (d == null ? void 0 : d(l.id));
492
- }, [l, d]);
493
- return /* @__PURE__ */ a("div", { className: `nice-edge-manager ${t}`, children: [
494
- /* @__PURE__ */ a("header", { className: "nice-edge-manager__header", children: [
495
- /* @__PURE__ */ e("h1", { children: "Edge Manager" }),
496
- /* @__PURE__ */ a("nav", { className: "nice-edge-manager__nav", children: [
497
- /* @__PURE__ */ a("button", { className: m === "nodes" ? "active" : "", onClick: () => C("nodes"), children: [
498
- "Nodes (",
499
- r.length,
500
- ")"
501
- ] }),
502
- /* @__PURE__ */ e("button", { className: m === "modules" ? "active" : "", onClick: () => C("modules"), children: "Modules" })
503
- ] })
504
- ] }),
505
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__main", children: [
506
- m === "nodes" && /* @__PURE__ */ e("div", { className: "nice-edge-manager__nodes", children: /* @__PURE__ */ a("div", { className: "nice-edge-manager__node-grid", children: [
507
- r.map((y) => /* @__PURE__ */ e(
508
- pe,
509
- {
510
- node: y,
511
- isSelected: (l == null ? void 0 : l.id) === y.id,
512
- onSelect: () => H(y)
513
- },
514
- y.id
515
- )),
516
- r.length === 0 && /* @__PURE__ */ e("div", { className: "nice-edge-manager__empty", children: "No edge nodes configured" })
517
- ] }) }),
518
- m === "modules" && l && /* @__PURE__ */ a("div", { className: "nice-edge-manager__modules", children: [
519
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__modules-header", children: [
520
- /* @__PURE__ */ a("h3", { children: [
521
- "Modules on ",
522
- l.name
523
- ] }),
524
- /* @__PURE__ */ e(
525
- "button",
526
- {
527
- className: "nice-edge-manager__deploy-btn",
528
- onClick: () => v(!0),
529
- children: "+ Deploy Module"
530
- }
531
- )
532
- ] }),
533
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__module-grid", children: [
534
- l.deployedModules.map((y) => /* @__PURE__ */ e(
535
- ye,
536
- {
537
- module: y,
538
- onAction: (k) => x(y.id, k)
539
- },
540
- y.id
541
- )),
542
- l.deployedModules.length === 0 && /* @__PURE__ */ e("div", { className: "nice-edge-manager__empty", children: "No modules deployed on this node" })
543
- ] })
544
- ] }),
545
- m === "modules" && !l && /* @__PURE__ */ e("div", { className: "nice-edge-manager__no-selection", children: "Select a node from the Nodes tab to manage modules" }),
546
- l && /* @__PURE__ */ e(
547
- he,
548
- {
549
- node: l,
550
- onSync: R,
551
- onClose: () => g(null)
552
- }
553
- )
554
- ] }),
555
- N && /* @__PURE__ */ e(
556
- ue,
557
- {
558
- config: u,
559
- templates: fe,
560
- onChange: _,
561
- onDeploy: P,
562
- onClose: () => v(!1)
563
- }
564
- )
565
- ] });
566
- }
567
- function J(r) {
568
- switch (r) {
569
- case "running":
570
- return "var(--nice-success, #28a745)";
571
- case "stopped":
572
- return "var(--nice-text-secondary, #6c757d)";
573
- case "updating":
574
- return "var(--nice-warning, #ffc107)";
575
- case "error":
576
- return "var(--nice-danger, #dc3545)";
577
- case "unreachable":
578
- return "var(--nice-text-secondary, #868e96)";
579
- default:
580
- return "var(--nice-text-secondary, #6c757d)";
581
- }
582
- }
583
- function W(r) {
584
- return r < 1024 ? `${r} B` : r < 1024 * 1024 ? `${(r / 1024).toFixed(1)} KB` : r < 1024 * 1024 * 1024 ? `${(r / 1024 / 1024).toFixed(1)} MB` : `${(r / 1024 / 1024 / 1024).toFixed(2)} GB`;
585
- }
586
- function me(r) {
587
- const i = Math.floor(r / 86400), c = Math.floor(r % 86400 / 3600), n = Math.floor(r % 3600 / 60);
588
- return i > 0 ? `${i}d ${c}h` : c > 0 ? `${c}h ${n}m` : `${n}m`;
589
- }
590
- function pe({ node: r, isSelected: i, onSelect: c }) {
591
- return /* @__PURE__ */ a(
592
- "div",
593
- {
594
- className: `nice-edge-manager__node-card ${i ? "nice-edge-manager__node-card--selected" : ""}`,
595
- onClick: c,
596
- children: [
597
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__node-header", children: [
598
- /* @__PURE__ */ e(
599
- "span",
600
- {
601
- className: "nice-edge-manager__node-status",
602
- style: { background: J(r.status) }
603
- }
604
- ),
605
- /* @__PURE__ */ e("span", { className: "nice-edge-manager__node-name", children: r.name }),
606
- /* @__PURE__ */ e("span", { className: "nice-edge-manager__node-type", children: r.type })
607
- ] }),
608
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__node-body", children: [
609
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__node-info", children: [
610
- /* @__PURE__ */ a("span", { children: [
611
- "πŸ–₯️ ",
612
- r.hardware.cpu
613
- ] }),
614
- /* @__PURE__ */ a("span", { children: [
615
- "πŸ’Ύ ",
616
- (r.hardware.memoryMB / 1024).toFixed(1),
617
- " GB"
618
- ] })
619
- ] }),
620
- /* @__PURE__ */ e("div", { className: "nice-edge-manager__node-metrics", children: r.metrics && /* @__PURE__ */ a(E, { children: [
621
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__metric", children: [
622
- /* @__PURE__ */ e("span", { className: "nice-edge-manager__metric-label", children: "CPU" }),
623
- /* @__PURE__ */ e("div", { className: "nice-edge-manager__metric-bar", children: /* @__PURE__ */ e(
624
- "div",
625
- {
626
- className: "nice-edge-manager__metric-fill",
627
- style: { width: `${r.metrics.cpuUsage}%` }
628
- }
629
- ) }),
630
- /* @__PURE__ */ a("span", { className: "nice-edge-manager__metric-value", children: [
631
- r.metrics.cpuUsage.toFixed(0),
632
- "%"
633
- ] })
634
- ] }),
635
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__metric", children: [
636
- /* @__PURE__ */ e("span", { className: "nice-edge-manager__metric-label", children: "MEM" }),
637
- /* @__PURE__ */ e("div", { className: "nice-edge-manager__metric-bar", children: /* @__PURE__ */ e(
638
- "div",
639
- {
640
- className: "nice-edge-manager__metric-fill",
641
- style: { width: `${r.metrics.memoryUsage}%` }
642
- }
643
- ) }),
644
- /* @__PURE__ */ a("span", { className: "nice-edge-manager__metric-value", children: [
645
- r.metrics.memoryUsage.toFixed(0),
646
- "%"
647
- ] })
648
- ] })
649
- ] }) }),
650
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__node-modules", children: [
651
- r.deployedModules.length,
652
- " modules deployed"
653
- ] })
654
- ] })
655
- ]
656
- }
657
- );
371
+ text: { ...n, inverse: n.inverse ?? "#ffffff" },
372
+ borders: ae(o),
373
+ shadows: ue,
374
+ spacing: Y,
375
+ typography: Z,
376
+ transitions: ee
377
+ };
658
378
  }
659
- function ye({ module: r, onAction: i }) {
660
- return /* @__PURE__ */ a("div", { className: "nice-edge-manager__module-card", children: [
661
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__module-header", children: [
662
- /* @__PURE__ */ e(
663
- "span",
664
- {
665
- className: "nice-edge-manager__module-status",
666
- style: { background: {
667
- running: "var(--nice-success, #28a745)",
668
- stopped: "var(--nice-text-secondary, #6c757d)",
669
- error: "var(--nice-danger, #dc3545)",
670
- pending: "var(--nice-warning, #ffc107)"
671
- }[r.status] || "var(--nice-text-secondary, #6c757d)" }
672
- }
673
- ),
674
- /* @__PURE__ */ e("span", { className: "nice-edge-manager__module-name", children: r.name }),
675
- /* @__PURE__ */ a("span", { className: "nice-edge-manager__module-version", children: [
676
- "v",
677
- r.version
678
- ] })
679
- ] }),
680
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__module-body", children: [
681
- /* @__PURE__ */ e("div", { className: "nice-edge-manager__module-image", children: r.image }),
682
- r.resources && /* @__PURE__ */ a("div", { className: "nice-edge-manager__module-resources", children: [
683
- r.resources.cpuLimit && /* @__PURE__ */ a("span", { children: [
684
- "CPU: ",
685
- r.resources.cpuLimit
686
- ] }),
687
- r.resources.memoryLimitMB && /* @__PURE__ */ a("span", { children: [
688
- "RAM: ",
689
- r.resources.memoryLimitMB,
690
- " MB"
691
- ] })
692
- ] }),
693
- r.ports && r.ports.length > 0 && /* @__PURE__ */ a("div", { className: "nice-edge-manager__module-ports", children: [
694
- "Ports: ",
695
- r.ports.map((n) => `${n.host}:${n.container}`).join(", ")
696
- ] })
697
- ] }),
698
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__module-actions", children: [
699
- r.status === "running" && /* @__PURE__ */ a(E, { children: [
700
- /* @__PURE__ */ e("button", { onClick: () => i("stop"), children: "Stop" }),
701
- /* @__PURE__ */ e("button", { onClick: () => i("restart"), children: "Restart" })
702
- ] }),
703
- r.status === "stopped" && /* @__PURE__ */ e("button", { onClick: () => i("start"), children: "Start" }),
704
- /* @__PURE__ */ e("button", { className: "nice-edge-manager__module-remove", onClick: () => i("remove"), children: "Remove" })
705
- ] })
706
- ] });
707
- }
708
- function he({ node: r, onSync: i, onClose: c }) {
709
- return /* @__PURE__ */ a("aside", { className: "nice-edge-manager__detail", children: [
710
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__detail-header", children: [
711
- /* @__PURE__ */ e("h3", { children: r.name }),
712
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__detail-actions", children: [
713
- /* @__PURE__ */ e("button", { onClick: i, children: "πŸ”„ Sync" }),
714
- /* @__PURE__ */ e("button", { onClick: c, children: "Γ—" })
715
- ] })
716
- ] }),
717
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__detail-content", children: [
718
- /* @__PURE__ */ a("section", { children: [
719
- /* @__PURE__ */ e("h4", { children: "Status" }),
720
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__detail-row", children: [
721
- /* @__PURE__ */ e("span", { children: "Status:" }),
722
- /* @__PURE__ */ e(
723
- "span",
724
- {
725
- className: "nice-edge-manager__status-badge",
726
- style: { background: J(r.status) },
727
- children: r.status
728
- }
729
- )
730
- ] }),
731
- r.metrics && /* @__PURE__ */ a("div", { className: "nice-edge-manager__detail-row", children: [
732
- /* @__PURE__ */ e("span", { children: "Uptime:" }),
733
- /* @__PURE__ */ e("span", { children: me(r.metrics.uptime) })
734
- ] })
735
- ] }),
736
- /* @__PURE__ */ a("section", { children: [
737
- /* @__PURE__ */ e("h4", { children: "Hardware" }),
738
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__detail-row", children: [
739
- /* @__PURE__ */ e("span", { children: "CPU:" }),
740
- /* @__PURE__ */ a("span", { children: [
741
- r.hardware.cpu,
742
- " (",
743
- r.hardware.cores,
744
- " cores)"
745
- ] })
746
- ] }),
747
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__detail-row", children: [
748
- /* @__PURE__ */ e("span", { children: "Memory:" }),
749
- /* @__PURE__ */ a("span", { children: [
750
- (r.hardware.memoryMB / 1024).toFixed(1),
751
- " GB"
752
- ] })
753
- ] }),
754
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__detail-row", children: [
755
- /* @__PURE__ */ e("span", { children: "Storage:" }),
756
- /* @__PURE__ */ a("span", { children: [
757
- (r.hardware.storageMB / 1024).toFixed(1),
758
- " GB"
759
- ] })
760
- ] }),
761
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__detail-row", children: [
762
- /* @__PURE__ */ e("span", { children: "Architecture:" }),
763
- /* @__PURE__ */ e("span", { children: r.hardware.architecture })
764
- ] })
765
- ] }),
766
- /* @__PURE__ */ a("section", { children: [
767
- /* @__PURE__ */ e("h4", { children: "Software" }),
768
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__detail-row", children: [
769
- /* @__PURE__ */ e("span", { children: "OS:" }),
770
- /* @__PURE__ */ a("span", { children: [
771
- r.software.os,
772
- " ",
773
- r.software.osVersion
774
- ] })
775
- ] }),
776
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__detail-row", children: [
777
- /* @__PURE__ */ e("span", { children: "Runtime:" }),
778
- /* @__PURE__ */ a("span", { children: [
779
- r.software.runtime,
780
- " ",
781
- r.software.runtimeVersion
782
- ] })
783
- ] }),
784
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__detail-row", children: [
785
- /* @__PURE__ */ e("span", { children: "Agent:" }),
786
- /* @__PURE__ */ a("span", { children: [
787
- r.software.agent,
788
- " v",
789
- r.software.agentVersion
790
- ] })
791
- ] })
792
- ] }),
793
- /* @__PURE__ */ a("section", { children: [
794
- /* @__PURE__ */ e("h4", { children: "Connectivity" }),
795
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__detail-row", children: [
796
- /* @__PURE__ */ e("span", { children: "Cloud:" }),
797
- /* @__PURE__ */ e("span", { children: r.connectivity.cloudConnected ? "βœ“ Connected" : "βœ— Disconnected" })
798
- ] }),
799
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__detail-row", children: [
800
- /* @__PURE__ */ e("span", { children: "Network:" }),
801
- /* @__PURE__ */ e("span", { children: r.connectivity.localNetwork })
802
- ] }),
803
- r.connectivity.publicIP && /* @__PURE__ */ a("div", { className: "nice-edge-manager__detail-row", children: [
804
- /* @__PURE__ */ e("span", { children: "Public IP:" }),
805
- /* @__PURE__ */ e("span", { children: r.connectivity.publicIP })
806
- ] }),
807
- r.connectivity.lastSync && /* @__PURE__ */ a("div", { className: "nice-edge-manager__detail-row", children: [
808
- /* @__PURE__ */ e("span", { children: "Last Sync:" }),
809
- /* @__PURE__ */ e("span", { children: r.connectivity.lastSync.toLocaleString() })
810
- ] })
811
- ] }),
812
- r.metrics && /* @__PURE__ */ a("section", { children: [
813
- /* @__PURE__ */ e("h4", { children: "Resource Usage" }),
814
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__resource-chart", children: [
815
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__resource-item", children: [
816
- /* @__PURE__ */ e("span", { children: "CPU" }),
817
- /* @__PURE__ */ e("div", { className: "nice-edge-manager__resource-bar", children: /* @__PURE__ */ e(
818
- "div",
819
- {
820
- className: "nice-edge-manager__resource-fill",
821
- style: { width: `${r.metrics.cpuUsage}%` }
822
- }
823
- ) }),
824
- /* @__PURE__ */ a("span", { children: [
825
- r.metrics.cpuUsage.toFixed(1),
826
- "%"
827
- ] })
828
- ] }),
829
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__resource-item", children: [
830
- /* @__PURE__ */ e("span", { children: "Memory" }),
831
- /* @__PURE__ */ e("div", { className: "nice-edge-manager__resource-bar", children: /* @__PURE__ */ e(
832
- "div",
833
- {
834
- className: "nice-edge-manager__resource-fill",
835
- style: { width: `${r.metrics.memoryUsage}%` }
836
- }
837
- ) }),
838
- /* @__PURE__ */ a("span", { children: [
839
- r.metrics.memoryUsage.toFixed(1),
840
- "%"
841
- ] })
842
- ] }),
843
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__resource-item", children: [
844
- /* @__PURE__ */ e("span", { children: "Disk" }),
845
- /* @__PURE__ */ e("div", { className: "nice-edge-manager__resource-bar", children: /* @__PURE__ */ e(
846
- "div",
847
- {
848
- className: "nice-edge-manager__resource-fill",
849
- style: { width: `${r.metrics.diskUsage}%` }
850
- }
851
- ) }),
852
- /* @__PURE__ */ a("span", { children: [
853
- r.metrics.diskUsage.toFixed(1),
854
- "%"
855
- ] })
856
- ] })
857
- ] }),
858
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__network-stats", children: [
859
- /* @__PURE__ */ a("span", { children: [
860
- "↓ ",
861
- W(r.metrics.networkIn)
862
- ] }),
863
- /* @__PURE__ */ a("span", { children: [
864
- "↑ ",
865
- W(r.metrics.networkOut)
866
- ] })
867
- ] })
868
- ] })
869
- ] })
870
- ] });
871
- }
872
- function ue({
873
- config: r,
874
- templates: i,
875
- onChange: c,
876
- onDeploy: n,
877
- onClose: o
878
- }) {
879
- return /* @__PURE__ */ e("div", { className: "nice-edge-manager__dialog-overlay", children: /* @__PURE__ */ a("div", { className: "nice-edge-manager__dialog", children: [
880
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__dialog-header", children: [
881
- /* @__PURE__ */ e("h3", { children: "Deploy Module" }),
882
- /* @__PURE__ */ e("button", { onClick: o, children: "Γ—" })
883
- ] }),
884
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__dialog-content", children: [
885
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__field", children: [
886
- /* @__PURE__ */ e("label", { children: "Template (optional)" }),
887
- /* @__PURE__ */ a(
888
- "select",
889
- {
890
- value: "",
891
- onChange: (d) => {
892
- const t = i.find((l) => l.image === d.target.value);
893
- t && c({
894
- ...r,
895
- name: t.name,
896
- image: t.image
897
- });
898
- },
899
- children: [
900
- /* @__PURE__ */ e("option", { value: "", children: "Select a template..." }),
901
- i.map((d) => /* @__PURE__ */ e("option", { value: d.image, children: d.name }, d.image))
902
- ]
903
- }
904
- )
905
- ] }),
906
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__field", children: [
907
- /* @__PURE__ */ e("label", { children: "Module Name" }),
908
- /* @__PURE__ */ e(
909
- "input",
910
- {
911
- type: "text",
912
- value: r.name || "",
913
- onChange: (d) => c({ ...r, name: d.target.value }),
914
- placeholder: "e.g., my-module"
915
- }
916
- )
917
- ] }),
918
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__field", children: [
919
- /* @__PURE__ */ e("label", { children: "Container Image" }),
920
- /* @__PURE__ */ e(
921
- "input",
922
- {
923
- type: "text",
924
- value: r.image || "",
925
- onChange: (d) => c({ ...r, image: d.target.value }),
926
- placeholder: "e.g., nginx:latest"
927
- }
928
- )
929
- ] }),
930
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__field", children: [
931
- /* @__PURE__ */ e("label", { children: "Version" }),
932
- /* @__PURE__ */ e(
933
- "input",
934
- {
935
- type: "text",
936
- value: r.version || "1.0.0",
937
- onChange: (d) => c({ ...r, version: d.target.value })
938
- }
939
- )
940
- ] })
941
- ] }),
942
- /* @__PURE__ */ a("div", { className: "nice-edge-manager__dialog-footer", children: [
943
- /* @__PURE__ */ e("button", { onClick: o, children: "Cancel" }),
944
- /* @__PURE__ */ e("button", { className: "nice-edge-manager__deploy-confirm", onClick: n, children: "Deploy" })
945
- ] })
946
- ] }) });
947
- }
948
- const be = (r, i) => i, ve = b(be);
949
- function U() {
950
- return { t: ie(ve) };
951
- }
952
- b({
953
- dir: "ltr",
954
- isRTL: !1,
955
- flip: (r) => r,
956
- value: (r) => r.ltr
957
- });
958
- b(null);
959
- b(null);
960
- const ge = {
961
- radius: "md",
962
- shadow: "md",
963
- fill: "solid",
964
- buttonStyle: "flat",
965
- inputStyle: "bordered",
966
- cardStyle: "elevated",
967
- badgeStyle: "solid",
968
- tabStyle: "underline",
969
- toggleStyle: "default",
970
- tooltipStyle: "dark",
971
- modalStyle: "default",
972
- tableStyle: "default",
973
- menuStyle: "default",
974
- animation: "normal",
975
- density: "normal"
976
- };
977
- b({
978
- displayStyle: "default",
979
- variantConfig: ge,
980
- setDisplayStyle: () => {
981
- }
982
- });
983
- b({});
984
- b({
985
- direction: "ltr",
986
- isRTL: !1,
987
- flip: (r) => r,
988
- flipStyle: (r, i) => ({ [r]: i })
989
- });
990
- b({
991
- permissions: {},
992
- getAccessMode: () => "full"
993
- });
994
- b(null);
995
- const _e = process.env.NODE_ENV === "development";
996
- let K = {
997
- enabled: _e,
998
- slowRenderThreshold: 16
999
- };
1000
- const X = [], O = /* @__PURE__ */ new Map(), Y = /* @__PURE__ */ new Map();
1001
- function Ne() {
1002
- X.length = 0, O.clear(), Y.clear();
1003
- }
1004
- function we(r) {
1005
- const i = K.slowRenderThreshold;
1006
- return X.filter((c) => c.actualDuration > i);
1007
- }
1008
- function D(r) {
1009
- return r < 1 ? `${(r * 1e3).toFixed(0)}ΞΌs` : r < 1e3 ? `${r.toFixed(2)}ms` : `${(r / 1e3).toFixed(2)}s`;
1010
- }
1011
- function Ce() {
1012
- const r = Array.from(O.values()), i = we(), c = r.reduce((d, t) => d + t.renderCount, 0), n = r.length > 0 ? r.reduce((d, t) => d + t.avgRenderTime, 0) / r.length : 0, o = Array.from(Y.values());
1013
- return { stats: r, slowRenders: i, totalRenders: c, avgRenderTime: n, marks: o };
1014
- }
1015
- function xe() {
1016
- const r = Ce();
1017
- console.group(
1018
- "%c[Nice2Dev Performance Report]",
1019
- "color: var(--nice-info, #6366f1); font-weight: bold; font-size: 14px"
1020
- ), console.log(`Total renders: ${r.totalRenders}`), console.log(`Average render time: ${D(r.avgRenderTime)}`), console.log(`Slow renders: ${r.slowRenders.length}`), console.group("Component Stats"), console.table(
1021
- r.stats.sort((i, c) => c.totalRenderTime - i.totalRenderTime).map((i) => ({
1022
- Name: i.componentName,
1023
- Renders: i.renderCount,
1024
- "Avg Time": D(i.avgRenderTime),
1025
- "Max Time": D(i.maxRenderTime),
1026
- "Total Time": D(i.totalRenderTime),
1027
- "Slow Renders": i.slowRenderCount
1028
- }))
1029
- ), console.groupEnd(), r.slowRenders.length > 0 && (console.group("Slow Renders (last 10)"), console.table(
1030
- r.slowRenders.slice(-10).map((i) => ({
1031
- Component: i.componentName,
1032
- Phase: i.phase,
1033
- Duration: D(i.actualDuration),
1034
- Time: new Date(i.timestamp).toLocaleTimeString()
1035
- }))
1036
- ), console.groupEnd()), r.marks.length > 0 && (console.group("Custom Marks"), console.table(
1037
- r.marks.filter((i) => i.duration).map((i) => ({
1038
- Name: i.name,
1039
- Duration: D(i.duration)
1040
- }))
1041
- ), console.groupEnd()), console.groupEnd();
1042
- }
1043
- const ke = ce(
1044
- ({ position: r = "bottom-right", defaultCollapsed: i = !0 }) => {
1045
- const [c, n] = h(i), [o, d] = h([]), [t, l] = h({ used: 0, total: 0 });
1046
- if (ne(() => {
1047
- const m = () => {
1048
- const N = Array.from(O.values());
1049
- d(N.sort((u, _) => _.totalRenderTime - u.totalRenderTime).slice(0, 10));
1050
- const v = window.performance;
1051
- v.memory && l({
1052
- used: v.memory.usedJSHeapSize / 1024 / 1024,
1053
- total: v.memory.totalJSHeapSize / 1024 / 1024
1054
- });
1055
- };
1056
- m();
1057
- const C = setInterval(m, 2e3);
1058
- return () => clearInterval(C);
1059
- }, []), !K.enabled)
1060
- return null;
1061
- const g = {
1062
- position: "fixed",
1063
- zIndex: 99999,
1064
- ...r.includes("top") ? { top: 8 } : { bottom: 8 },
1065
- ...r.includes("left") ? { left: 8 } : { right: 8 }
1066
- };
1067
- return /* @__PURE__ */ a(
1068
- "div",
1069
- {
1070
- style: {
1071
- ...g,
1072
- background: "var(--nice-overlay-85, rgba(0, 0, 0, 0.85))",
1073
- color: "var(--bg-primary, #fff)",
1074
- borderRadius: 8,
1075
- fontSize: 11,
1076
- fontFamily: "Monaco, Consolas, monospace",
1077
- padding: c ? "4px 8px" : 8,
1078
- maxWidth: c ? "auto" : 300,
1079
- maxHeight: c ? "auto" : 400,
1080
- overflow: "auto"
1081
- },
1082
- children: [
1083
- /* @__PURE__ */ a(
1084
- "div",
1085
- {
1086
- style: { cursor: "pointer", display: "flex", alignItems: "center", gap: 8 },
1087
- onClick: () => n((m) => !m),
1088
- children: [
1089
- /* @__PURE__ */ e("span", { style: { color: "var(--color-success, #22c55e)" }, children: "●" }),
1090
- /* @__PURE__ */ e("span", { children: "Profiler" }),
1091
- t.used > 0 && /* @__PURE__ */ a(
1092
- "span",
1093
- {
1094
- style: {
1095
- color: t.used > 100 ? "var(--color-warning, #f59e0b)" : "var(--text-muted, #64748b)"
1096
- },
1097
- children: [
1098
- t.used.toFixed(0),
1099
- "MB"
1100
- ]
1101
- }
1102
- ),
1103
- /* @__PURE__ */ e("span", { style: { marginLeft: "auto", opacity: 0.5 }, children: c ? "β–Ό" : "β–²" })
1104
- ]
1105
- }
1106
- ),
1107
- !c && /* @__PURE__ */ a("div", { style: { marginTop: 8 }, children: [
1108
- /* @__PURE__ */ e(
1109
- "div",
1110
- {
1111
- style: {
1112
- borderBottom: "1px solid var(--border-color, #333)",
1113
- paddingBottom: 4,
1114
- marginBottom: 8
1115
- },
1116
- children: /* @__PURE__ */ e("strong", { children: "Top Components" })
1117
- }
1118
- ),
1119
- o.map((m) => /* @__PURE__ */ a("div", { style: { marginBottom: 4, display: "flex", gap: 8 }, children: [
1120
- /* @__PURE__ */ e("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis" }, children: m.componentName }),
1121
- /* @__PURE__ */ e(
1122
- "span",
1123
- {
1124
- style: {
1125
- color: m.avgRenderTime > 16 ? "var(--color-warning, #f59e0b)" : "var(--color-success, #22c55e)"
1126
- },
1127
- children: D(m.avgRenderTime)
1128
- }
1129
- ),
1130
- /* @__PURE__ */ a(
1131
- "span",
1132
- {
1133
- style: { color: "var(--text-muted, #64748b)", minWidth: 30, textAlign: "right" },
1134
- children: [
1135
- "x",
1136
- m.renderCount
1137
- ]
1138
- }
1139
- )
1140
- ] }, m.componentName)),
1141
- /* @__PURE__ */ a("div", { style: { marginTop: 8, display: "flex", gap: 8 }, children: [
1142
- /* @__PURE__ */ e(
1143
- "button",
1144
- {
1145
- onClick: xe,
1146
- style: {
1147
- flex: 1,
1148
- padding: "4px 8px",
1149
- background: "var(--bg-tertiary, #333)",
1150
- border: "none",
1151
- borderRadius: 4,
1152
- color: "var(--bg-primary, #fff)",
1153
- cursor: "pointer",
1154
- fontSize: 10
1155
- },
1156
- children: "Print Report"
1157
- }
1158
- ),
1159
- /* @__PURE__ */ e(
1160
- "button",
1161
- {
1162
- onClick: Ne,
1163
- style: {
1164
- flex: 1,
1165
- padding: "4px 8px",
1166
- background: "var(--bg-tertiary, #333)",
1167
- border: "none",
1168
- borderRadius: 4,
1169
- color: "var(--bg-primary, #fff)",
1170
- cursor: "pointer",
1171
- fontSize: 10
1172
- },
1173
- children: "Clear"
1174
- }
1175
- )
1176
- ] })
1177
- ] })
1178
- ]
1179
- }
1180
- );
1181
- }
1182
- );
1183
- ke.displayName = "ProfilerOverlay";
1184
- process.env.NODE_ENV;
1185
- b(null);
1186
- b({
1187
- enabled: !0,
1188
- active: !1,
1189
- run: () => {
1190
- }
1191
- });
1192
- const q = "nice-tutorial-button-styles";
1193
- if (typeof document < "u" && !document.getElementById(q)) {
1194
- const r = document.createElement("style");
1195
- r.id = q, r.textContent = `
1196
- .nice-tutorial-button {
1197
- display: inline-flex;
1198
- align-items: center;
1199
- justify-content: center;
1200
- border: 1px solid var(--nice-border, #cbd5e1);
1201
- background: var(--nice-bg, #fff);
1202
- color: var(--nice-text-secondary, #475569);
1203
- border-radius: var(--nice-radius-full, 9999px);
1204
- cursor: help;
1205
- font-weight: 700;
1206
- line-height: 1;
1207
- padding: 0;
1208
- transition: background var(--nice-transition, 200ms ease), color var(--nice-transition, 200ms ease), border-color var(--nice-transition, 200ms ease);
1209
- }
1210
- .nice-tutorial-button:hover {
1211
- background: var(--nice-primary, #2563eb);
1212
- border-color: var(--nice-primary, #2563eb);
1213
- color: var(--nice-text-inverse, #fff);
1214
- }
1215
- .nice-tutorial-button:focus-visible {
1216
- outline: none;
1217
- box-shadow: 0 0 0 2px var(--nice-bg, #fff), 0 0 0 4px var(--nice-primary, #2563eb);
1218
- }
1219
- .nice-tutorial-button--sm { width: 16px; height: 16px; font-size: 11px; }
1220
- .nice-tutorial-button--md { width: 20px; height: 20px; font-size: 12px; }
1221
- `, document.head.appendChild(r);
1222
- }
1223
- b(null);
1224
- b(null);
1225
- b(null);
1226
- const Z = {
1227
- space1: "4px",
1228
- space2: "8px",
1229
- space3: "12px",
1230
- space4: "16px",
1231
- space5: "20px",
1232
- space6: "24px",
1233
- space8: "32px"
1234
- }, ee = {
1235
- fontFamily: "'Inter', system-ui, -apple-system, sans-serif",
1236
- fontSizeXs: "0.75rem",
1237
- fontSizeSm: "0.8125rem",
1238
- fontSizeMd: "0.875rem",
1239
- fontSizeLg: "1rem",
1240
- fontSizeXl: "1.125rem",
1241
- fontWeightNormal: 400,
1242
- fontWeightMedium: 500,
1243
- fontWeightSemibold: 600,
1244
- fontWeightBold: 700,
1245
- lineHeight: 1.5
1246
- }, re = { fast: "120ms ease", normal: "200ms ease", slow: "300ms ease" }, ae = (r) => ({
1247
- color: r,
1248
- radiusSm: "4px",
1249
- radiusMd: "6px",
1250
- radiusLg: "8px",
1251
- radiusXl: "12px",
1252
- radiusFull: "9999px"
1253
- }), He = {
1254
- sm: "0 1px 2px rgba(0,0,0,0.05)",
1255
- md: "0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",
1256
- lg: "0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",
1257
- xl: "0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)"
1258
- }, Se = {
1259
- sm: "0 1px 2px rgba(0,0,0,0.3)",
1260
- md: "0 4px 6px -1px rgba(0,0,0,0.4)",
1261
- lg: "0 10px 15px -3px rgba(0,0,0,0.4)",
1262
- xl: "0 20px 25px -5px rgba(0,0,0,0.4)"
1263
- };
1264
- function s(r, i, c, n, o) {
1265
- return {
1266
- name: r,
1267
- darkMode: "light",
1268
- colors: {
1269
- ...i,
1270
- surface: i.surface ?? c.primary,
1271
- surfaceHover: i.surfaceHover ?? c.secondary
1272
- },
1273
- backgrounds: {
1274
- ...c,
1275
- elevated: c.elevated ?? c.primary,
1276
- inset: c.inset ?? c.tertiary,
1277
- canvas: c.canvas ?? c.primary
1278
- },
1279
- text: { ...n, inverse: n.inverse ?? "#ffffff" },
1280
- borders: ae(o),
1281
- shadows: He,
1282
- spacing: Z,
1283
- typography: ee,
1284
- transitions: re
1285
- };
1286
- }
1287
- function p(r, i, c, n, o) {
1288
- return {
1289
- name: r,
1290
- darkMode: "dark",
1291
- colors: {
1292
- ...i,
1293
- surface: i.surface ?? c.secondary,
1294
- surfaceHover: i.surfaceHover ?? c.tertiary
1295
- },
1296
- backgrounds: {
1297
- ...c,
1298
- elevated: c.elevated ?? c.secondary,
1299
- inset: c.inset ?? c.primary,
1300
- canvas: c.canvas ?? c.primary
1301
- },
1302
- text: { ...n, inverse: n.inverse ?? "#0f172a" },
1303
- borders: ae(o),
1304
- shadows: Se,
1305
- spacing: Z,
1306
- typography: ee,
1307
- transitions: re
1308
- };
379
+ function h(a, i, c, n, o) {
380
+ return {
381
+ name: a,
382
+ darkMode: "dark",
383
+ colors: {
384
+ ...i,
385
+ surface: i.surface ?? c.secondary,
386
+ surfaceHover: i.surfaceHover ?? c.tertiary
387
+ },
388
+ backgrounds: {
389
+ ...c,
390
+ elevated: c.elevated ?? c.secondary,
391
+ inset: c.inset ?? c.primary,
392
+ canvas: c.canvas ?? c.primary
393
+ },
394
+ text: { ...n, inverse: n.inverse ?? "#0f172a" },
395
+ borders: ae(o),
396
+ shadows: ve,
397
+ spacing: Y,
398
+ typography: Z,
399
+ transitions: ee
400
+ };
1309
401
  }
1310
402
  s(
1311
403
  "Slate",
@@ -1615,7 +707,7 @@ s(
1615
707
  { primary: "#431407", secondary: "#9a3412", muted: "#fb923c" },
1616
708
  "#fdba74"
1617
709
  );
1618
- p(
710
+ h(
1619
711
  "Midnight",
1620
712
  {
1621
713
  primary: "#818cf8",
@@ -1629,7 +721,7 @@ p(
1629
721
  { primary: "#f1f5f9", secondary: "#94a3b8", muted: "#475569" },
1630
722
  "#1e293b"
1631
723
  );
1632
- p(
724
+ h(
1633
725
  "Obsidian",
1634
726
  {
1635
727
  primary: "#a78bfa",
@@ -1643,7 +735,7 @@ p(
1643
735
  { primary: "#fafafa", secondary: "#a1a1aa", muted: "#52525b" },
1644
736
  "#3f3f46"
1645
737
  );
1646
- p(
738
+ h(
1647
739
  "Eclipse",
1648
740
  {
1649
741
  primary: "#c084fc",
@@ -1657,7 +749,7 @@ p(
1657
749
  { primary: "#f5f3ff", secondary: "#a78bfa", muted: "#6d5eac" },
1658
750
  "#3b3266"
1659
751
  );
1660
- p(
752
+ h(
1661
753
  "Onyx",
1662
754
  {
1663
755
  primary: "#60a5fa",
@@ -1671,7 +763,7 @@ p(
1671
763
  { primary: "#ffffff", secondary: "#a3a3a3", muted: "#525252" },
1672
764
  "#262626"
1673
765
  );
1674
- p(
766
+ h(
1675
767
  "Carbon",
1676
768
  {
1677
769
  primary: "#38bdf8",
@@ -1685,7 +777,7 @@ p(
1685
777
  { primary: "#f4f4f4", secondary: "#c6c6c6", muted: "#6f6f6f" },
1686
778
  "#525252"
1687
779
  );
1688
- p(
780
+ h(
1689
781
  "Cosmos",
1690
782
  {
1691
783
  primary: "#6366f1",
@@ -1699,7 +791,7 @@ p(
1699
791
  { primary: "#e5e7eb", secondary: "#9ca3af", muted: "#4b5563" },
1700
792
  "#374151"
1701
793
  );
1702
- p(
794
+ h(
1703
795
  "Nebula",
1704
796
  {
1705
797
  primary: "#e879f9",
@@ -1713,7 +805,7 @@ p(
1713
805
  { primary: "#fae8ff", secondary: "#d8b4fe", muted: "#7c3aed" },
1714
806
  "#581c87"
1715
807
  );
1716
- p(
808
+ h(
1717
809
  "Abyss",
1718
810
  {
1719
811
  primary: "#22d3ee",
@@ -1727,7 +819,7 @@ p(
1727
819
  { primary: "#e0f2fe", secondary: "#7dd3fc", muted: "#0369a1" },
1728
820
  "#075985"
1729
821
  );
1730
- p(
822
+ h(
1731
823
  "Shadow",
1732
824
  {
1733
825
  primary: "#a3a3a3",
@@ -1741,7 +833,7 @@ p(
1741
833
  { primary: "#e5e5e5", secondary: "#a3a3a3", muted: "#525252" },
1742
834
  "#404040"
1743
835
  );
1744
- p(
836
+ h(
1745
837
  "Emerald Dark",
1746
838
  {
1747
839
  primary: "#34d399",
@@ -2133,7 +1225,7 @@ s(
2133
1225
  { primary: "#2e3440", secondary: "#3b4252", muted: "#4c566a" },
2134
1226
  "#d8dee9"
2135
1227
  );
2136
- p(
1228
+ h(
2137
1229
  "Dracula",
2138
1230
  {
2139
1231
  primary: "#bd93f9",
@@ -2161,7 +1253,7 @@ s(
2161
1253
  { primary: "#073642", secondary: "#586e75", muted: "#93a1a1" },
2162
1254
  "#eee8d5"
2163
1255
  );
2164
- p(
1256
+ h(
2165
1257
  "Solarized Dark",
2166
1258
  {
2167
1259
  primary: "#268bd2",
@@ -2175,7 +1267,7 @@ p(
2175
1267
  { primary: "#eee8d5", secondary: "#93a1a1", muted: "#586e75" },
2176
1268
  "#073642"
2177
1269
  );
2178
- p(
1270
+ h(
2179
1271
  "Monokai",
2180
1272
  {
2181
1273
  primary: "#66d9ef",
@@ -2189,7 +1281,7 @@ p(
2189
1281
  { primary: "#f8f8f2", secondary: "#cfcfc2", muted: "#75715e" },
2190
1282
  "#3e3d32"
2191
1283
  );
2192
- p(
1284
+ h(
2193
1285
  "One Dark",
2194
1286
  {
2195
1287
  primary: "#61afef",
@@ -2203,7 +1295,7 @@ p(
2203
1295
  { primary: "#abb2bf", secondary: "#828997", muted: "#545862" },
2204
1296
  "#3e4452"
2205
1297
  );
2206
- p(
1298
+ h(
2207
1299
  "Synthwave",
2208
1300
  {
2209
1301
  primary: "#ff7edb",
@@ -2231,7 +1323,7 @@ s(
2231
1323
  { primary: "#4a1a4e", secondary: "#7b3f7d", muted: "#c080c0" },
2232
1324
  "#d8a8e8"
2233
1325
  );
2234
- p(
1326
+ h(
2235
1327
  "Terminal Green",
2236
1328
  {
2237
1329
  primary: "#00ff41",
@@ -2273,7 +1365,7 @@ s(
2273
1365
  { primary: "#3e2723", secondary: "#5d4037", muted: "#a1887f" },
2274
1366
  "#bcaaa4"
2275
1367
  );
2276
- p(
1368
+ h(
2277
1369
  "Cyberpunk",
2278
1370
  {
2279
1371
  primary: "#00f0ff",
@@ -2287,7 +1379,7 @@ p(
2287
1379
  { primary: "#e0fbfc", secondary: "#80d4dd", muted: "#3a6b72" },
2288
1380
  "#1c3a44"
2289
1381
  );
2290
- p(
1382
+ h(
2291
1383
  "Neon",
2292
1384
  {
2293
1385
  primary: "#ff00ff",
@@ -2301,7 +1393,7 @@ p(
2301
1393
  { primary: "#ffffff", secondary: "#cccccc", muted: "#666666" },
2302
1394
  "#333333"
2303
1395
  );
2304
- p(
1396
+ h(
2305
1397
  "Retrowave",
2306
1398
  {
2307
1399
  primary: "#f77fbe",
@@ -2329,7 +1421,7 @@ s(
2329
1421
  { primary: "#3b0a0a", secondary: "#7f1d1d", muted: "#dc6868" },
2330
1422
  "#e8a0a0"
2331
1423
  );
2332
- p(
1424
+ h(
2333
1425
  "Halloween",
2334
1426
  {
2335
1427
  primary: "#ff6600",
@@ -2539,7 +1631,7 @@ s(
2539
1631
  { primary: "#2b1a0e", secondary: "#5c3d1e", muted: "#a08060" },
2540
1632
  "#d4b896"
2541
1633
  );
2542
- p(
1634
+ h(
2543
1635
  "High Contrast Dark",
2544
1636
  {
2545
1637
  primary: "#ffff00",
@@ -2595,7 +1687,7 @@ s(
2595
1687
  { primary: "#0a0a0a", secondary: "#404040", muted: "#a3a3a3" },
2596
1688
  "#e5e5e5"
2597
1689
  );
2598
- p(
1690
+ h(
2599
1691
  "Warm Dark",
2600
1692
  {
2601
1693
  primary: "#f59e0b",
@@ -2609,7 +1701,7 @@ p(
2609
1701
  { primary: "#fafaf9", secondary: "#d6d3d1", muted: "#78716c" },
2610
1702
  "#57534e"
2611
1703
  );
2612
- p(
1704
+ h(
2613
1705
  "Soft Dark",
2614
1706
  {
2615
1707
  primary: "#a78bfa",
@@ -2651,9 +1743,1228 @@ s(
2651
1743
  { primary: "#3b0a0a", secondary: "#7f1d1d", muted: "#dc6868" },
2652
1744
  "#e8a0a0"
2653
1745
  );
1746
+ const be = process.env.NODE_ENV === "development";
1747
+ let re = {
1748
+ enabled: be,
1749
+ slowRenderThreshold: 16
1750
+ };
1751
+ const ie = [], O = /* @__PURE__ */ new Map(), ce = /* @__PURE__ */ new Map();
1752
+ function ge() {
1753
+ ie.length = 0, O.clear(), ce.clear();
1754
+ }
1755
+ function Me(a) {
1756
+ const i = re.slowRenderThreshold;
1757
+ return ie.filter((c) => c.actualDuration > i);
1758
+ }
1759
+ function V(a) {
1760
+ return a < 1 ? `${(a * 1e3).toFixed(0)}ΞΌs` : a < 1e3 ? `${a.toFixed(2)}ms` : `${(a / 1e3).toFixed(2)}s`;
1761
+ }
1762
+ function _e() {
1763
+ const a = Array.from(O.values()), i = Me(), c = a.reduce((t, d) => t + d.renderCount, 0), n = a.length > 0 ? a.reduce((t, d) => t + d.avgRenderTime, 0) / a.length : 0, o = Array.from(ce.values());
1764
+ return { stats: a, slowRenders: i, totalRenders: c, avgRenderTime: n, marks: o };
1765
+ }
1766
+ function Ne() {
1767
+ const a = _e();
1768
+ console.group(
1769
+ "%c[Nice2Dev Performance Report]",
1770
+ "color: var(--nice-info, #6366f1); font-weight: bold; font-size: 14px"
1771
+ ), console.log(`Total renders: ${a.totalRenders}`), console.log(`Average render time: ${V(a.avgRenderTime)}`), console.log(`Slow renders: ${a.slowRenders.length}`), console.group("Component Stats"), console.table(
1772
+ a.stats.sort((i, c) => c.totalRenderTime - i.totalRenderTime).map((i) => ({
1773
+ Name: i.componentName,
1774
+ Renders: i.renderCount,
1775
+ "Avg Time": V(i.avgRenderTime),
1776
+ "Max Time": V(i.maxRenderTime),
1777
+ "Total Time": V(i.totalRenderTime),
1778
+ "Slow Renders": i.slowRenderCount
1779
+ }))
1780
+ ), console.groupEnd(), a.slowRenders.length > 0 && (console.group("Slow Renders (last 10)"), console.table(
1781
+ a.slowRenders.slice(-10).map((i) => ({
1782
+ Component: i.componentName,
1783
+ Phase: i.phase,
1784
+ Duration: V(i.actualDuration),
1785
+ Time: new Date(i.timestamp).toLocaleTimeString()
1786
+ }))
1787
+ ), console.groupEnd()), a.marks.length > 0 && (console.group("Custom Marks"), console.table(
1788
+ a.marks.filter((i) => i.duration).map((i) => ({
1789
+ Name: i.name,
1790
+ Duration: V(i.duration)
1791
+ }))
1792
+ ), console.groupEnd()), console.groupEnd();
1793
+ }
1794
+ const we = oe(
1795
+ ({ position: a = "bottom-right", defaultCollapsed: i = !0 }) => {
1796
+ const [c, n] = y(i), [o, t] = y([]), [d, l] = y({ used: 0, total: 0 });
1797
+ if (te(() => {
1798
+ const m = () => {
1799
+ const w = Array.from(O.values());
1800
+ t(w.sort((v, N) => N.totalRenderTime - v.totalRenderTime).slice(0, 10));
1801
+ const M = window.performance;
1802
+ M.memory && l({
1803
+ used: M.memory.usedJSHeapSize / 1024 / 1024,
1804
+ total: M.memory.totalJSHeapSize / 1024 / 1024
1805
+ });
1806
+ };
1807
+ m();
1808
+ const _ = setInterval(m, 2e3);
1809
+ return () => clearInterval(_);
1810
+ }, []), !re.enabled)
1811
+ return null;
1812
+ const g = {
1813
+ position: "fixed",
1814
+ zIndex: 99999,
1815
+ ...a.includes("top") ? { top: 8 } : { bottom: 8 },
1816
+ ...a.includes("left") ? { left: 8 } : { right: 8 }
1817
+ };
1818
+ return /* @__PURE__ */ r(
1819
+ "div",
1820
+ {
1821
+ style: {
1822
+ ...g,
1823
+ background: "var(--nice-overlay-85, rgba(0, 0, 0, 0.85))",
1824
+ color: "var(--nice-text-on-primary, #fff)",
1825
+ borderRadius: 8,
1826
+ fontSize: 11,
1827
+ fontFamily: "Monaco, Consolas, monospace",
1828
+ padding: c ? "4px 8px" : 8,
1829
+ maxWidth: c ? "auto" : 300,
1830
+ maxHeight: c ? "auto" : 400,
1831
+ overflow: "auto"
1832
+ },
1833
+ children: [
1834
+ /* @__PURE__ */ r(
1835
+ "div",
1836
+ {
1837
+ style: { cursor: "pointer", display: "flex", alignItems: "center", gap: 8 },
1838
+ onClick: () => n((m) => !m),
1839
+ children: [
1840
+ /* @__PURE__ */ e(
1841
+ "span",
1842
+ {
1843
+ "aria-hidden": "true",
1844
+ style: {
1845
+ width: 8,
1846
+ height: 8,
1847
+ borderRadius: "50%",
1848
+ background: "var(--nice-color-success, #22c55e)"
1849
+ }
1850
+ }
1851
+ ),
1852
+ /* @__PURE__ */ e("span", { children: "Profiler" }),
1853
+ d.used > 0 && /* @__PURE__ */ r(
1854
+ "span",
1855
+ {
1856
+ style: {
1857
+ color: d.used > 100 ? "var(--nice-color-warning, #f59e0b)" : "var(--nice-text-muted, #64748b)"
1858
+ },
1859
+ children: [
1860
+ d.used.toFixed(0),
1861
+ "MB"
1862
+ ]
1863
+ }
1864
+ ),
1865
+ /* @__PURE__ */ e("span", { style: { marginLeft: "auto", opacity: 0.5, display: "inline-flex" }, children: /* @__PURE__ */ e(u, { name: c ? "chevron-down" : "chevron-up", size: 12 }) })
1866
+ ]
1867
+ }
1868
+ ),
1869
+ !c && /* @__PURE__ */ r("div", { style: { marginTop: 8 }, children: [
1870
+ /* @__PURE__ */ e(
1871
+ "div",
1872
+ {
1873
+ style: {
1874
+ borderBottom: "1px solid var(--nice-border-color, #333)",
1875
+ paddingBottom: 4,
1876
+ marginBottom: 8
1877
+ },
1878
+ children: /* @__PURE__ */ e("strong", { children: "Top Components" })
1879
+ }
1880
+ ),
1881
+ o.map((m) => /* @__PURE__ */ r("div", { style: { marginBottom: 4, display: "flex", gap: 8 }, children: [
1882
+ /* @__PURE__ */ e("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis" }, children: m.componentName }),
1883
+ /* @__PURE__ */ e(
1884
+ "span",
1885
+ {
1886
+ style: {
1887
+ color: m.avgRenderTime > 16 ? "var(--nice-color-warning, #f59e0b)" : "var(--nice-color-success, #22c55e)"
1888
+ },
1889
+ children: V(m.avgRenderTime)
1890
+ }
1891
+ ),
1892
+ /* @__PURE__ */ r(
1893
+ "span",
1894
+ {
1895
+ style: {
1896
+ color: "var(--nice-text-muted, #64748b)",
1897
+ minWidth: 30,
1898
+ textAlign: "right"
1899
+ },
1900
+ children: [
1901
+ "x",
1902
+ m.renderCount
1903
+ ]
1904
+ }
1905
+ )
1906
+ ] }, m.componentName)),
1907
+ /* @__PURE__ */ r("div", { style: { marginTop: 8, display: "flex", gap: 8 }, children: [
1908
+ /* @__PURE__ */ e(
1909
+ "button",
1910
+ {
1911
+ onClick: Ne,
1912
+ style: {
1913
+ flex: 1,
1914
+ padding: "4px 8px",
1915
+ background: "var(--nice-bg-tertiary, #333)",
1916
+ border: "none",
1917
+ borderRadius: 4,
1918
+ color: "var(--nice-text-primary, #fff)",
1919
+ cursor: "pointer",
1920
+ fontSize: 10
1921
+ },
1922
+ children: "Print Report"
1923
+ }
1924
+ ),
1925
+ /* @__PURE__ */ e(
1926
+ "button",
1927
+ {
1928
+ onClick: ge,
1929
+ style: {
1930
+ flex: 1,
1931
+ padding: "4px 8px",
1932
+ background: "var(--nice-bg-tertiary, #333)",
1933
+ border: "none",
1934
+ borderRadius: 4,
1935
+ color: "var(--nice-text-primary, #fff)",
1936
+ cursor: "pointer",
1937
+ fontSize: 10
1938
+ },
1939
+ children: "Clear"
1940
+ }
1941
+ )
1942
+ ] })
1943
+ ] })
1944
+ ]
1945
+ }
1946
+ );
1947
+ }
1948
+ );
1949
+ we.displayName = "ProfilerOverlay";
1950
+ process.env.NODE_ENV;
1951
+ b(null);
1952
+ b({
1953
+ enabled: !0,
1954
+ active: !1,
1955
+ run: () => {
1956
+ }
1957
+ });
1958
+ const W = "nice-tutorial-button-styles";
1959
+ if (typeof document < "u" && !document.getElementById(W)) {
1960
+ const a = document.createElement("style");
1961
+ a.id = W, a.textContent = `
1962
+ .nice-tutorial-button {
1963
+ display: inline-flex;
1964
+ align-items: center;
1965
+ justify-content: center;
1966
+ border: 1px solid var(--nice-border, #cbd5e1);
1967
+ background: var(--nice-bg, #fff);
1968
+ color: var(--nice-text-secondary, #475569);
1969
+ border-radius: var(--nice-radius-full, 9999px);
1970
+ cursor: help;
1971
+ font-weight: 700;
1972
+ line-height: 1;
1973
+ padding: 0;
1974
+ transition: background var(--nice-transition, 200ms ease), color var(--nice-transition, 200ms ease), border-color var(--nice-transition, 200ms ease);
1975
+ }
1976
+ .nice-tutorial-button:hover {
1977
+ background: var(--nice-primary, #2563eb);
1978
+ border-color: var(--nice-primary, #2563eb);
1979
+ color: var(--nice-text-inverse, #fff);
1980
+ }
1981
+ .nice-tutorial-button:focus-visible {
1982
+ outline: none;
1983
+ box-shadow: 0 0 0 2px var(--nice-bg, #fff), 0 0 0 4px var(--nice-primary, #2563eb);
1984
+ }
1985
+ .nice-tutorial-button--sm { width: 16px; height: 16px; font-size: 11px; }
1986
+ .nice-tutorial-button--md { width: 20px; height: 20px; font-size: 12px; }
1987
+ `, document.head.appendChild(a);
1988
+ }
1989
+ b(null);
1990
+ b(null);
2654
1991
  b(null);
2655
1992
  b(null);
2656
1993
  const G = {
1994
+ display: "inline-block",
1995
+ width: 10,
1996
+ height: 10,
1997
+ borderRadius: "50%",
1998
+ background: "currentColor"
1999
+ }, F = [
2000
+ { type: "device-list", label: "Device List", icon: "list" },
2001
+ { type: "device-status", label: "Device Status", icon: "success" },
2002
+ { type: "telemetry-chart", label: "Telemetry Chart", icon: "bar-chart" },
2003
+ { type: "gauge", label: "Gauge", icon: "clock" },
2004
+ { type: "map", label: "Device Map", icon: "map-pin" },
2005
+ { type: "alarms", label: "Alarms", icon: "bell" },
2006
+ { type: "control-panel", label: "Control Panel", icon: "settings" },
2007
+ { type: "topology", label: "Network Topology", icon: "link" },
2008
+ { type: "kpi", label: "KPI Card", icon: "target" },
2009
+ { type: "camera-feed", label: "Camera Feed", icon: "video" }
2010
+ ];
2011
+ function Be({
2012
+ devices: a = [],
2013
+ widgets: i = [],
2014
+ alarms: c = [],
2015
+ onDeviceSelect: n,
2016
+ onWidgetChange: o,
2017
+ onCommand: t,
2018
+ onAlarmAcknowledge: d,
2019
+ fetchTelemetry: l,
2020
+ className: g = ""
2021
+ }) {
2022
+ const [m, _] = y(i), [w, M] = y(null), [v, N] = y("dashboard"), [H, L] = y(!1), [z, A] = y(""), p = C(
2023
+ (f) => {
2024
+ _((x) => {
2025
+ const S = f(x);
2026
+ return o == null || o(S), S;
2027
+ });
2028
+ },
2029
+ [o]
2030
+ ), k = C(
2031
+ (f) => {
2032
+ var S;
2033
+ const x = {
2034
+ id: crypto.randomUUID(),
2035
+ type: f,
2036
+ title: ((S = F.find(($) => $.type === f)) == null ? void 0 : S.label) || f,
2037
+ position: { x: 0, y: Ce(m), width: 4, height: 3 },
2038
+ config: {}
2039
+ };
2040
+ p(($) => [...$, x]);
2041
+ },
2042
+ [m, p]
2043
+ ), E = C(
2044
+ (f) => {
2045
+ M(f), n == null || n(f);
2046
+ },
2047
+ [n]
2048
+ ), U = C(
2049
+ (f) => {
2050
+ d == null || d(f);
2051
+ },
2052
+ [d]
2053
+ ), T = a.filter(
2054
+ (f) => !z || f.name.toLowerCase().includes(z.toLowerCase()) || f.type.toLowerCase().includes(z.toLowerCase())
2055
+ ), P = c.filter((f) => !f.cleared), q = P.filter(
2056
+ (f) => f.severity === "critical" || f.severity === "high"
2057
+ );
2058
+ return /* @__PURE__ */ r("div", { className: `nice-iot-dashboard ${g}`, children: [
2059
+ /* @__PURE__ */ r("header", { className: "nice-iot-dashboard__header", children: [
2060
+ /* @__PURE__ */ e("h1", { children: "IoT Dashboard" }),
2061
+ /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__stats", children: [
2062
+ /* @__PURE__ */ r("span", { className: "nice-iot-dashboard__stat", children: [
2063
+ /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__stat-icon", children: /* @__PURE__ */ e(u, { name: "wifi", size: 14 }) }),
2064
+ a.length,
2065
+ " Devices"
2066
+ ] }),
2067
+ /* @__PURE__ */ r("span", { className: "nice-iot-dashboard__stat nice-iot-dashboard__stat--online", children: [
2068
+ /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__stat-icon", style: G }),
2069
+ a.filter((f) => f.status === "online").length,
2070
+ " Online"
2071
+ ] }),
2072
+ /* @__PURE__ */ r("span", { className: "nice-iot-dashboard__stat nice-iot-dashboard__stat--offline", children: [
2073
+ /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__stat-icon", style: G }),
2074
+ a.filter((f) => f.status === "offline").length,
2075
+ " Offline"
2076
+ ] }),
2077
+ q.length > 0 && /* @__PURE__ */ r("span", { className: "nice-iot-dashboard__stat nice-iot-dashboard__stat--alarms", children: [
2078
+ /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__stat-icon", children: /* @__PURE__ */ e(u, { name: "bell", size: 14 }) }),
2079
+ q.length,
2080
+ " Alarms"
2081
+ ] })
2082
+ ] }),
2083
+ /* @__PURE__ */ r("nav", { className: "nice-iot-dashboard__nav", children: [
2084
+ /* @__PURE__ */ e(
2085
+ "button",
2086
+ {
2087
+ className: v === "dashboard" ? "active" : "",
2088
+ onClick: () => N("dashboard"),
2089
+ children: "Dashboard"
2090
+ }
2091
+ ),
2092
+ /* @__PURE__ */ e("button", { className: v === "devices" ? "active" : "", onClick: () => N("devices"), children: "Devices" }),
2093
+ /* @__PURE__ */ r("button", { className: v === "alarms" ? "active" : "", onClick: () => N("alarms"), children: [
2094
+ "Alarms ",
2095
+ P.length > 0 && `(${P.length})`
2096
+ ] })
2097
+ ] }),
2098
+ /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__actions", children: v === "dashboard" && /* @__PURE__ */ r("button", { onClick: () => L(!H), children: [
2099
+ /* @__PURE__ */ e(u, { name: H ? "check" : "edit", size: 14 }),
2100
+ " ",
2101
+ H ? "Done" : "Edit"
2102
+ ] }) })
2103
+ ] }),
2104
+ v === "dashboard" && /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__main", children: [
2105
+ H && /* @__PURE__ */ r("aside", { className: "nice-iot-dashboard__palette", children: [
2106
+ /* @__PURE__ */ e("h4", { children: "Add Widget" }),
2107
+ F.map((f) => /* @__PURE__ */ r(
2108
+ "button",
2109
+ {
2110
+ className: "nice-iot-dashboard__palette-item",
2111
+ onClick: () => k(f.type),
2112
+ children: [
2113
+ /* @__PURE__ */ e(u, { name: f.icon, size: 16 }),
2114
+ /* @__PURE__ */ e("span", { children: f.label })
2115
+ ]
2116
+ },
2117
+ f.type
2118
+ ))
2119
+ ] }),
2120
+ /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__grid", children: [
2121
+ m.map((f) => /* @__PURE__ */ e(
2122
+ He,
2123
+ {
2124
+ widget: f,
2125
+ devices: a,
2126
+ alarms: c,
2127
+ isEditing: H,
2128
+ onCommand: t,
2129
+ onDelete: () => p((x) => x.filter((S) => S.id !== f.id))
2130
+ },
2131
+ f.id
2132
+ )),
2133
+ m.length === 0 && /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__empty", children: H ? "Add widgets from the palette" : "No widgets configured. Click Edit to add widgets." })
2134
+ ] })
2135
+ ] }),
2136
+ v === "devices" && /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__devices", children: [
2137
+ /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__devices-toolbar", children: /* @__PURE__ */ e(
2138
+ "input",
2139
+ {
2140
+ type: "search",
2141
+ placeholder: "Search devices...",
2142
+ value: z,
2143
+ onChange: (f) => A(f.target.value)
2144
+ }
2145
+ ) }),
2146
+ /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__device-grid", children: T.map((f) => /* @__PURE__ */ e(
2147
+ ke,
2148
+ {
2149
+ device: f,
2150
+ isSelected: (w == null ? void 0 : w.id) === f.id,
2151
+ onSelect: () => E(f)
2152
+ },
2153
+ f.id
2154
+ )) }),
2155
+ w && /* @__PURE__ */ e(
2156
+ xe,
2157
+ {
2158
+ device: w,
2159
+ onCommand: t,
2160
+ onClose: () => M(null)
2161
+ }
2162
+ )
2163
+ ] }),
2164
+ v === "alarms" && /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__alarms", children: /* @__PURE__ */ r("table", { className: "nice-iot-dashboard__alarm-table", children: [
2165
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ r("tr", { children: [
2166
+ /* @__PURE__ */ e("th", { children: "Severity" }),
2167
+ /* @__PURE__ */ e("th", { children: "Device" }),
2168
+ /* @__PURE__ */ e("th", { children: "Message" }),
2169
+ /* @__PURE__ */ e("th", { children: "Time" }),
2170
+ /* @__PURE__ */ e("th", { children: "Status" }),
2171
+ /* @__PURE__ */ e("th", { children: "Actions" })
2172
+ ] }) }),
2173
+ /* @__PURE__ */ e("tbody", { children: P.length === 0 ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: 6, className: "nice-iot-dashboard__no-alarms", children: "No active alarms" }) }) : P.map((f) => {
2174
+ const x = a.find((S) => S.id === f.deviceId);
2175
+ return /* @__PURE__ */ r(
2176
+ "tr",
2177
+ {
2178
+ className: `nice-iot-dashboard__alarm-row nice-iot-dashboard__alarm-row--${f.severity}`,
2179
+ children: [
2180
+ /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
2181
+ "span",
2182
+ {
2183
+ className: `nice-iot-dashboard__severity nice-iot-dashboard__severity--${f.severity}`,
2184
+ children: f.severity
2185
+ }
2186
+ ) }),
2187
+ /* @__PURE__ */ e("td", { children: (x == null ? void 0 : x.name) || f.deviceId }),
2188
+ /* @__PURE__ */ e("td", { children: f.message }),
2189
+ /* @__PURE__ */ e("td", { children: f.timestamp.toLocaleString() }),
2190
+ /* @__PURE__ */ e("td", { children: f.acknowledged ? "Acknowledged" : "Active" }),
2191
+ /* @__PURE__ */ e("td", { children: !f.acknowledged && /* @__PURE__ */ e("button", { onClick: () => U(f.id), children: "Acknowledge" }) })
2192
+ ]
2193
+ },
2194
+ f.id
2195
+ );
2196
+ }) })
2197
+ ] }) })
2198
+ ] });
2199
+ }
2200
+ function Ce(a) {
2201
+ return a.length === 0 ? 0 : Math.max(...a.map((i) => i.position.y + i.position.height));
2202
+ }
2203
+ function I(a) {
2204
+ switch (a) {
2205
+ case "online":
2206
+ return "var(--nice-success, #28a745)";
2207
+ case "offline":
2208
+ return "var(--nice-text-secondary, #6c757d)";
2209
+ case "warning":
2210
+ return "var(--nice-warning, #ffc107)";
2211
+ case "error":
2212
+ return "var(--nice-danger, #dc3545)";
2213
+ case "maintenance":
2214
+ return "var(--nice-info, #17a2b8)";
2215
+ default:
2216
+ return "var(--nice-text-secondary, #6c757d)";
2217
+ }
2218
+ }
2219
+ function He({
2220
+ widget: a,
2221
+ devices: i,
2222
+ alarms: c,
2223
+ isEditing: n,
2224
+ onCommand: o,
2225
+ onDelete: t
2226
+ }) {
2227
+ const d = F.find((l) => l.type === a.type);
2228
+ return /* @__PURE__ */ r(
2229
+ "div",
2230
+ {
2231
+ className: `nice-iot-dashboard__widget nice-iot-dashboard__widget--${a.type}`,
2232
+ style: {
2233
+ gridColumn: `span ${a.position.width}`,
2234
+ gridRow: `span ${a.position.height}`
2235
+ },
2236
+ children: [
2237
+ /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__widget-header", children: [
2238
+ /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__widget-icon", children: /* @__PURE__ */ e(u, { name: (d == null ? void 0 : d.icon) ?? "box", size: 14 }) }),
2239
+ /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__widget-title", children: a.title }),
2240
+ n && /* @__PURE__ */ e("button", { className: "nice-iot-dashboard__widget-delete", onClick: t, children: "Γ—" })
2241
+ ] }),
2242
+ /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__widget-content", children: /* @__PURE__ */ e(ze, { widget: a, devices: i, alarms: c, onCommand: o }) })
2243
+ ]
2244
+ }
2245
+ );
2246
+ }
2247
+ function ze({
2248
+ widget: a,
2249
+ devices: i,
2250
+ alarms: c,
2251
+ onCommand: n
2252
+ }) {
2253
+ switch (a.type) {
2254
+ case "device-list":
2255
+ return /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__device-list", children: i.slice(0, 10).map((o) => /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__device-list-item", children: [
2256
+ /* @__PURE__ */ e(
2257
+ "span",
2258
+ {
2259
+ className: "nice-iot-dashboard__device-status",
2260
+ style: { background: I(o.status) }
2261
+ }
2262
+ ),
2263
+ /* @__PURE__ */ e("span", { children: o.name }),
2264
+ /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__device-type", children: o.type })
2265
+ ] }, o.id)) });
2266
+ case "device-status":
2267
+ return /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__status-grid", children: ["online", "offline", "warning", "error"].map((o) => {
2268
+ const t = i.filter((d) => d.status === o).length;
2269
+ return /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__status-card", children: [
2270
+ /* @__PURE__ */ e(
2271
+ "span",
2272
+ {
2273
+ className: "nice-iot-dashboard__status-indicator",
2274
+ style: { background: I(o) }
2275
+ }
2276
+ ),
2277
+ /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__status-count", children: t }),
2278
+ /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__status-label", children: o })
2279
+ ] }, o);
2280
+ }) });
2281
+ case "telemetry-chart":
2282
+ return /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__chart-placeholder", children: [
2283
+ /* @__PURE__ */ e(u, { name: "bar-chart", size: 32 }),
2284
+ /* @__PURE__ */ e("span", { children: "Telemetry Chart" }),
2285
+ /* @__PURE__ */ e("small", { children: "Configure device and capability" })
2286
+ ] });
2287
+ case "gauge":
2288
+ return /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__gauge", children: /* @__PURE__ */ r("svg", { viewBox: "0 0 100 60", children: [
2289
+ /* @__PURE__ */ e(
2290
+ "path",
2291
+ {
2292
+ d: "M 10 55 A 40 40 0 0 1 90 55",
2293
+ fill: "none",
2294
+ stroke: "var(--nice-border, #e0e0e0)",
2295
+ strokeWidth: "8"
2296
+ }
2297
+ ),
2298
+ /* @__PURE__ */ e(
2299
+ "path",
2300
+ {
2301
+ d: "M 10 55 A 40 40 0 0 1 90 55",
2302
+ fill: "none",
2303
+ stroke: "var(--nice-primary, #0066cc)",
2304
+ strokeWidth: "8",
2305
+ strokeDasharray: "63 126"
2306
+ }
2307
+ ),
2308
+ /* @__PURE__ */ e("text", { x: "50", y: "50", textAnchor: "middle", fontSize: "14", fontWeight: "bold", children: "50%" })
2309
+ ] }) });
2310
+ case "map":
2311
+ return /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__map-placeholder", children: [
2312
+ /* @__PURE__ */ e(u, { name: "map-pin", size: 32 }),
2313
+ /* @__PURE__ */ e("span", { children: "Device Map" }),
2314
+ /* @__PURE__ */ r("small", { children: [
2315
+ i.filter((o) => o.location).length,
2316
+ " devices with location"
2317
+ ] })
2318
+ ] });
2319
+ case "alarms": {
2320
+ const o = c.filter((t) => !t.cleared).slice(0, 5);
2321
+ return /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__alarm-list", children: o.length === 0 ? /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__alarm-empty", children: "No active alarms" }) : o.map((t) => /* @__PURE__ */ r(
2322
+ "div",
2323
+ {
2324
+ className: `nice-iot-dashboard__alarm-item nice-iot-dashboard__alarm-item--${t.severity}`,
2325
+ children: [
2326
+ /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__alarm-severity", children: t.severity }),
2327
+ /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__alarm-message", children: t.message })
2328
+ ]
2329
+ },
2330
+ t.id
2331
+ )) });
2332
+ }
2333
+ case "control-panel":
2334
+ return /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__control-placeholder", children: [
2335
+ /* @__PURE__ */ e(u, { name: "settings", size: 32 }),
2336
+ /* @__PURE__ */ e("span", { children: "Control Panel" }),
2337
+ /* @__PURE__ */ e("small", { children: "Configure device controls" })
2338
+ ] });
2339
+ case "kpi":
2340
+ return /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__kpi", children: [
2341
+ /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__kpi-value", children: i.length }),
2342
+ /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__kpi-label", children: "Total Devices" })
2343
+ ] });
2344
+ default:
2345
+ return /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__widget-placeholder", children: a.type });
2346
+ }
2347
+ }
2348
+ function ke({ device: a, isSelected: i, onSelect: c }) {
2349
+ return /* @__PURE__ */ r(
2350
+ "div",
2351
+ {
2352
+ className: `nice-iot-dashboard__device-card ${i ? "nice-iot-dashboard__device-card--selected" : ""}`,
2353
+ onClick: c,
2354
+ children: [
2355
+ /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__device-card-header", children: [
2356
+ /* @__PURE__ */ e(
2357
+ "span",
2358
+ {
2359
+ className: "nice-iot-dashboard__device-status",
2360
+ style: { background: I(a.status) }
2361
+ }
2362
+ ),
2363
+ /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__device-name", children: a.name })
2364
+ ] }),
2365
+ /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__device-card-body", children: [
2366
+ /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__device-info", children: [
2367
+ /* @__PURE__ */ r("span", { children: [
2368
+ "Type: ",
2369
+ a.type
2370
+ ] }),
2371
+ /* @__PURE__ */ r("span", { children: [
2372
+ "Protocol: ",
2373
+ a.protocol
2374
+ ] })
2375
+ ] }),
2376
+ a.lastSeen && /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__device-lastseen", children: [
2377
+ "Last seen: ",
2378
+ a.lastSeen.toLocaleString()
2379
+ ] }),
2380
+ /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__device-capabilities", children: [
2381
+ a.capabilities.slice(0, 3).map((n) => /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__capability-badge", children: n.name }, n.id)),
2382
+ a.capabilities.length > 3 && /* @__PURE__ */ r("span", { className: "nice-iot-dashboard__capability-more", children: [
2383
+ "+",
2384
+ a.capabilities.length - 3
2385
+ ] })
2386
+ ] })
2387
+ ] })
2388
+ ]
2389
+ }
2390
+ );
2391
+ }
2392
+ function xe({
2393
+ device: a,
2394
+ onCommand: i,
2395
+ onClose: c
2396
+ }) {
2397
+ return /* @__PURE__ */ r("aside", { className: "nice-iot-dashboard__device-detail", children: [
2398
+ /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__device-detail-header", children: [
2399
+ /* @__PURE__ */ e("h3", { children: a.name }),
2400
+ /* @__PURE__ */ e("button", { onClick: c, children: "Γ—" })
2401
+ ] }),
2402
+ /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__device-detail-content", children: [
2403
+ /* @__PURE__ */ r("section", { children: [
2404
+ /* @__PURE__ */ e("h4", { children: "Status" }),
2405
+ /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__detail-row", children: [
2406
+ /* @__PURE__ */ e("span", { children: "Status:" }),
2407
+ /* @__PURE__ */ e(
2408
+ "span",
2409
+ {
2410
+ className: "nice-iot-dashboard__status-badge",
2411
+ style: { background: I(a.status) },
2412
+ children: a.status
2413
+ }
2414
+ )
2415
+ ] }),
2416
+ a.lastSeen && /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__detail-row", children: [
2417
+ /* @__PURE__ */ e("span", { children: "Last Seen:" }),
2418
+ /* @__PURE__ */ e("span", { children: a.lastSeen.toLocaleString() })
2419
+ ] })
2420
+ ] }),
2421
+ /* @__PURE__ */ r("section", { children: [
2422
+ /* @__PURE__ */ e("h4", { children: "Connection" }),
2423
+ /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__detail-row", children: [
2424
+ /* @__PURE__ */ e("span", { children: "Protocol:" }),
2425
+ /* @__PURE__ */ e("span", { children: a.protocol })
2426
+ ] }),
2427
+ a.connectionInfo.host && /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__detail-row", children: [
2428
+ /* @__PURE__ */ e("span", { children: "Host:" }),
2429
+ /* @__PURE__ */ r("span", { children: [
2430
+ a.connectionInfo.host,
2431
+ ":",
2432
+ a.connectionInfo.port
2433
+ ] })
2434
+ ] })
2435
+ ] }),
2436
+ a.metadata && /* @__PURE__ */ r("section", { children: [
2437
+ /* @__PURE__ */ e("h4", { children: "Metadata" }),
2438
+ a.metadata.manufacturer && /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__detail-row", children: [
2439
+ /* @__PURE__ */ e("span", { children: "Manufacturer:" }),
2440
+ /* @__PURE__ */ e("span", { children: a.metadata.manufacturer })
2441
+ ] }),
2442
+ a.metadata.model && /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__detail-row", children: [
2443
+ /* @__PURE__ */ e("span", { children: "Model:" }),
2444
+ /* @__PURE__ */ e("span", { children: a.metadata.model })
2445
+ ] })
2446
+ ] }),
2447
+ /* @__PURE__ */ r("section", { children: [
2448
+ /* @__PURE__ */ e("h4", { children: "Capabilities" }),
2449
+ /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__capabilities-list", children: a.capabilities.map((n) => /* @__PURE__ */ r("div", { className: "nice-iot-dashboard__capability-item", children: [
2450
+ /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__capability-name", children: n.name }),
2451
+ /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__capability-type", children: n.type }),
2452
+ n.writable && i && /* @__PURE__ */ e(
2453
+ "button",
2454
+ {
2455
+ className: "nice-iot-dashboard__capability-control",
2456
+ onClick: () => i(a.id, n.id, !0),
2457
+ children: "Control"
2458
+ }
2459
+ )
2460
+ ] }, n.id)) })
2461
+ ] })
2462
+ ] })
2463
+ ] });
2464
+ }
2465
+ const Se = [
2466
+ { name: "MQTT Broker", image: "eclipse-mosquitto:latest" },
2467
+ { name: "Node-RED", image: "nodered/node-red:latest" },
2468
+ { name: "InfluxDB", image: "influxdb:latest" },
2469
+ { name: "Grafana", image: "grafana/grafana:latest" },
2470
+ { name: "Telegraf", image: "telegraf:latest" },
2471
+ { name: "Protocol Adapter", image: "nice2dev/protocol-adapter:latest" }
2472
+ ];
2473
+ function Fe({
2474
+ nodes: a = [],
2475
+ modules: i = [],
2476
+ onNodeSelect: c,
2477
+ onModuleDeploy: n,
2478
+ onModuleAction: o,
2479
+ onNodeSync: t,
2480
+ className: d = ""
2481
+ }) {
2482
+ const [l, g] = y(null), [m, _] = y("nodes"), [w, M] = y(!1), [v, N] = y({
2483
+ name: "",
2484
+ image: "",
2485
+ status: "pending"
2486
+ }), H = C(
2487
+ (p) => {
2488
+ g(p), c == null || c(p);
2489
+ },
2490
+ [c]
2491
+ ), L = C(async () => {
2492
+ !l || !v.name || !v.image || (await (n == null ? void 0 : n(l.id, v)), M(!1), N({ name: "", image: "", status: "pending" }));
2493
+ }, [l, v, n]), z = C(
2494
+ async (p, k) => {
2495
+ l && await (o == null ? void 0 : o(l.id, p, k));
2496
+ },
2497
+ [l, o]
2498
+ ), A = C(async () => {
2499
+ l && await (t == null ? void 0 : t(l.id));
2500
+ }, [l, t]);
2501
+ return /* @__PURE__ */ r("div", { className: `nice-edge-manager ${d}`, children: [
2502
+ /* @__PURE__ */ r("header", { className: "nice-edge-manager__header", children: [
2503
+ /* @__PURE__ */ e("h1", { children: "Edge Manager" }),
2504
+ /* @__PURE__ */ r("nav", { className: "nice-edge-manager__nav", children: [
2505
+ /* @__PURE__ */ r("button", { className: m === "nodes" ? "active" : "", onClick: () => _("nodes"), children: [
2506
+ "Nodes (",
2507
+ a.length,
2508
+ ")"
2509
+ ] }),
2510
+ /* @__PURE__ */ e("button", { className: m === "modules" ? "active" : "", onClick: () => _("modules"), children: "Modules" })
2511
+ ] })
2512
+ ] }),
2513
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__main", children: [
2514
+ m === "nodes" && /* @__PURE__ */ e("div", { className: "nice-edge-manager__nodes", children: /* @__PURE__ */ r("div", { className: "nice-edge-manager__node-grid", children: [
2515
+ a.map((p) => /* @__PURE__ */ e(
2516
+ Te,
2517
+ {
2518
+ node: p,
2519
+ isSelected: (l == null ? void 0 : l.id) === p.id,
2520
+ onSelect: () => H(p)
2521
+ },
2522
+ p.id
2523
+ )),
2524
+ a.length === 0 && /* @__PURE__ */ e("div", { className: "nice-edge-manager__empty", children: "No edge nodes configured" })
2525
+ ] }) }),
2526
+ m === "modules" && l && /* @__PURE__ */ r("div", { className: "nice-edge-manager__modules", children: [
2527
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__modules-header", children: [
2528
+ /* @__PURE__ */ r("h3", { children: [
2529
+ "Modules on ",
2530
+ l.name
2531
+ ] }),
2532
+ /* @__PURE__ */ e(
2533
+ "button",
2534
+ {
2535
+ className: "nice-edge-manager__deploy-btn",
2536
+ onClick: () => M(!0),
2537
+ children: "+ Deploy Module"
2538
+ }
2539
+ )
2540
+ ] }),
2541
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__module-grid", children: [
2542
+ l.deployedModules.map((p) => /* @__PURE__ */ e(
2543
+ Ve,
2544
+ {
2545
+ module: p,
2546
+ onAction: (k) => z(p.id, k)
2547
+ },
2548
+ p.id
2549
+ )),
2550
+ l.deployedModules.length === 0 && /* @__PURE__ */ e("div", { className: "nice-edge-manager__empty", children: "No modules deployed on this node" })
2551
+ ] })
2552
+ ] }),
2553
+ m === "modules" && !l && /* @__PURE__ */ e("div", { className: "nice-edge-manager__no-selection", children: "Select a node from the Nodes tab to manage modules" }),
2554
+ l && /* @__PURE__ */ e(
2555
+ Ae,
2556
+ {
2557
+ node: l,
2558
+ onSync: A,
2559
+ onClose: () => g(null)
2560
+ }
2561
+ )
2562
+ ] }),
2563
+ w && /* @__PURE__ */ e(
2564
+ De,
2565
+ {
2566
+ config: v,
2567
+ templates: Se,
2568
+ onChange: N,
2569
+ onDeploy: L,
2570
+ onClose: () => M(!1)
2571
+ }
2572
+ )
2573
+ ] });
2574
+ }
2575
+ function ne(a) {
2576
+ switch (a) {
2577
+ case "running":
2578
+ return "var(--nice-success, #28a745)";
2579
+ case "stopped":
2580
+ return "var(--nice-text-secondary, #6c757d)";
2581
+ case "updating":
2582
+ return "var(--nice-warning, #ffc107)";
2583
+ case "error":
2584
+ return "var(--nice-danger, #dc3545)";
2585
+ case "unreachable":
2586
+ return "var(--nice-text-secondary, #868e96)";
2587
+ default:
2588
+ return "var(--nice-text-secondary, #6c757d)";
2589
+ }
2590
+ }
2591
+ function j(a) {
2592
+ return a < 1024 ? `${a} B` : a < 1024 * 1024 ? `${(a / 1024).toFixed(1)} KB` : a < 1024 * 1024 * 1024 ? `${(a / 1024 / 1024).toFixed(1)} MB` : `${(a / 1024 / 1024 / 1024).toFixed(2)} GB`;
2593
+ }
2594
+ function Le(a) {
2595
+ const i = Math.floor(a / 86400), c = Math.floor(a % 86400 / 3600), n = Math.floor(a % 3600 / 60);
2596
+ return i > 0 ? `${i}d ${c}h` : c > 0 ? `${c}h ${n}m` : `${n}m`;
2597
+ }
2598
+ function Te({ node: a, isSelected: i, onSelect: c }) {
2599
+ return /* @__PURE__ */ r(
2600
+ "div",
2601
+ {
2602
+ className: `nice-edge-manager__node-card ${i ? "nice-edge-manager__node-card--selected" : ""}`,
2603
+ onClick: c,
2604
+ children: [
2605
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__node-header", children: [
2606
+ /* @__PURE__ */ e(
2607
+ "span",
2608
+ {
2609
+ className: "nice-edge-manager__node-status",
2610
+ style: { background: ne(a.status) }
2611
+ }
2612
+ ),
2613
+ /* @__PURE__ */ e("span", { className: "nice-edge-manager__node-name", children: a.name }),
2614
+ /* @__PURE__ */ e("span", { className: "nice-edge-manager__node-type", children: a.type })
2615
+ ] }),
2616
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__node-body", children: [
2617
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__node-info", children: [
2618
+ /* @__PURE__ */ r("span", { children: [
2619
+ /* @__PURE__ */ e(u, { name: "server", size: 12 }),
2620
+ " ",
2621
+ a.hardware.cpu
2622
+ ] }),
2623
+ /* @__PURE__ */ r("span", { children: [
2624
+ /* @__PURE__ */ e(u, { name: "database", size: 12 }),
2625
+ " ",
2626
+ (a.hardware.memoryMB / 1024).toFixed(1),
2627
+ " GB"
2628
+ ] })
2629
+ ] }),
2630
+ /* @__PURE__ */ e("div", { className: "nice-edge-manager__node-metrics", children: a.metrics && /* @__PURE__ */ r(D, { children: [
2631
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__metric", children: [
2632
+ /* @__PURE__ */ e("span", { className: "nice-edge-manager__metric-label", children: "CPU" }),
2633
+ /* @__PURE__ */ e("div", { className: "nice-edge-manager__metric-bar", children: /* @__PURE__ */ e(
2634
+ "div",
2635
+ {
2636
+ className: "nice-edge-manager__metric-fill",
2637
+ style: { width: `${a.metrics.cpuUsage}%` }
2638
+ }
2639
+ ) }),
2640
+ /* @__PURE__ */ r("span", { className: "nice-edge-manager__metric-value", children: [
2641
+ a.metrics.cpuUsage.toFixed(0),
2642
+ "%"
2643
+ ] })
2644
+ ] }),
2645
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__metric", children: [
2646
+ /* @__PURE__ */ e("span", { className: "nice-edge-manager__metric-label", children: "MEM" }),
2647
+ /* @__PURE__ */ e("div", { className: "nice-edge-manager__metric-bar", children: /* @__PURE__ */ e(
2648
+ "div",
2649
+ {
2650
+ className: "nice-edge-manager__metric-fill",
2651
+ style: { width: `${a.metrics.memoryUsage}%` }
2652
+ }
2653
+ ) }),
2654
+ /* @__PURE__ */ r("span", { className: "nice-edge-manager__metric-value", children: [
2655
+ a.metrics.memoryUsage.toFixed(0),
2656
+ "%"
2657
+ ] })
2658
+ ] })
2659
+ ] }) }),
2660
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__node-modules", children: [
2661
+ a.deployedModules.length,
2662
+ " modules deployed"
2663
+ ] })
2664
+ ] })
2665
+ ]
2666
+ }
2667
+ );
2668
+ }
2669
+ function Ve({ module: a, onAction: i }) {
2670
+ return /* @__PURE__ */ r("div", { className: "nice-edge-manager__module-card", children: [
2671
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__module-header", children: [
2672
+ /* @__PURE__ */ e(
2673
+ "span",
2674
+ {
2675
+ className: "nice-edge-manager__module-status",
2676
+ style: {
2677
+ background: {
2678
+ running: "var(--nice-success, #28a745)",
2679
+ stopped: "var(--nice-text-secondary, #6c757d)",
2680
+ error: "var(--nice-danger, #dc3545)",
2681
+ pending: "var(--nice-warning, #ffc107)"
2682
+ }[a.status] || "var(--nice-bg-tertiary, #6c757d)"
2683
+ }
2684
+ }
2685
+ ),
2686
+ /* @__PURE__ */ e("span", { className: "nice-edge-manager__module-name", children: a.name }),
2687
+ /* @__PURE__ */ r("span", { className: "nice-edge-manager__module-version", children: [
2688
+ "v",
2689
+ a.version
2690
+ ] })
2691
+ ] }),
2692
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__module-body", children: [
2693
+ /* @__PURE__ */ e("div", { className: "nice-edge-manager__module-image", children: a.image }),
2694
+ a.resources && /* @__PURE__ */ r("div", { className: "nice-edge-manager__module-resources", children: [
2695
+ a.resources.cpuLimit && /* @__PURE__ */ r("span", { children: [
2696
+ "CPU: ",
2697
+ a.resources.cpuLimit
2698
+ ] }),
2699
+ a.resources.memoryLimitMB && /* @__PURE__ */ r("span", { children: [
2700
+ "RAM: ",
2701
+ a.resources.memoryLimitMB,
2702
+ " MB"
2703
+ ] })
2704
+ ] }),
2705
+ a.ports && a.ports.length > 0 && /* @__PURE__ */ r("div", { className: "nice-edge-manager__module-ports", children: [
2706
+ "Ports: ",
2707
+ a.ports.map((n) => `${n.host}:${n.container}`).join(", ")
2708
+ ] })
2709
+ ] }),
2710
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__module-actions", children: [
2711
+ a.status === "running" && /* @__PURE__ */ r(D, { children: [
2712
+ /* @__PURE__ */ e("button", { onClick: () => i("stop"), children: "Stop" }),
2713
+ /* @__PURE__ */ e("button", { onClick: () => i("restart"), children: "Restart" })
2714
+ ] }),
2715
+ a.status === "stopped" && /* @__PURE__ */ e("button", { onClick: () => i("start"), children: "Start" }),
2716
+ /* @__PURE__ */ e("button", { className: "nice-edge-manager__module-remove", onClick: () => i("remove"), children: "Remove" })
2717
+ ] })
2718
+ ] });
2719
+ }
2720
+ function Ae({ node: a, onSync: i, onClose: c }) {
2721
+ return /* @__PURE__ */ r("aside", { className: "nice-edge-manager__detail", children: [
2722
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-header", children: [
2723
+ /* @__PURE__ */ e("h3", { children: a.name }),
2724
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-actions", children: [
2725
+ /* @__PURE__ */ r("button", { onClick: i, children: [
2726
+ /* @__PURE__ */ e(u, { name: "refresh", size: 14 }),
2727
+ " Sync"
2728
+ ] }),
2729
+ /* @__PURE__ */ e("button", { onClick: c, "aria-label": "Close", children: /* @__PURE__ */ e(u, { name: "close", size: 14 }) })
2730
+ ] })
2731
+ ] }),
2732
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-content", children: [
2733
+ /* @__PURE__ */ r("section", { children: [
2734
+ /* @__PURE__ */ e("h4", { children: "Status" }),
2735
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-row", children: [
2736
+ /* @__PURE__ */ e("span", { children: "Status:" }),
2737
+ /* @__PURE__ */ e(
2738
+ "span",
2739
+ {
2740
+ className: "nice-edge-manager__status-badge",
2741
+ style: { background: ne(a.status) },
2742
+ children: a.status
2743
+ }
2744
+ )
2745
+ ] }),
2746
+ a.metrics && /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-row", children: [
2747
+ /* @__PURE__ */ e("span", { children: "Uptime:" }),
2748
+ /* @__PURE__ */ e("span", { children: Le(a.metrics.uptime) })
2749
+ ] })
2750
+ ] }),
2751
+ /* @__PURE__ */ r("section", { children: [
2752
+ /* @__PURE__ */ e("h4", { children: "Hardware" }),
2753
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-row", children: [
2754
+ /* @__PURE__ */ e("span", { children: "CPU:" }),
2755
+ /* @__PURE__ */ r("span", { children: [
2756
+ a.hardware.cpu,
2757
+ " (",
2758
+ a.hardware.cores,
2759
+ " cores)"
2760
+ ] })
2761
+ ] }),
2762
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-row", children: [
2763
+ /* @__PURE__ */ e("span", { children: "Memory:" }),
2764
+ /* @__PURE__ */ r("span", { children: [
2765
+ (a.hardware.memoryMB / 1024).toFixed(1),
2766
+ " GB"
2767
+ ] })
2768
+ ] }),
2769
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-row", children: [
2770
+ /* @__PURE__ */ e("span", { children: "Storage:" }),
2771
+ /* @__PURE__ */ r("span", { children: [
2772
+ (a.hardware.storageMB / 1024).toFixed(1),
2773
+ " GB"
2774
+ ] })
2775
+ ] }),
2776
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-row", children: [
2777
+ /* @__PURE__ */ e("span", { children: "Architecture:" }),
2778
+ /* @__PURE__ */ e("span", { children: a.hardware.architecture })
2779
+ ] })
2780
+ ] }),
2781
+ /* @__PURE__ */ r("section", { children: [
2782
+ /* @__PURE__ */ e("h4", { children: "Software" }),
2783
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-row", children: [
2784
+ /* @__PURE__ */ e("span", { children: "OS:" }),
2785
+ /* @__PURE__ */ r("span", { children: [
2786
+ a.software.os,
2787
+ " ",
2788
+ a.software.osVersion
2789
+ ] })
2790
+ ] }),
2791
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-row", children: [
2792
+ /* @__PURE__ */ e("span", { children: "Runtime:" }),
2793
+ /* @__PURE__ */ r("span", { children: [
2794
+ a.software.runtime,
2795
+ " ",
2796
+ a.software.runtimeVersion
2797
+ ] })
2798
+ ] }),
2799
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-row", children: [
2800
+ /* @__PURE__ */ e("span", { children: "Agent:" }),
2801
+ /* @__PURE__ */ r("span", { children: [
2802
+ a.software.agent,
2803
+ " v",
2804
+ a.software.agentVersion
2805
+ ] })
2806
+ ] })
2807
+ ] }),
2808
+ /* @__PURE__ */ r("section", { children: [
2809
+ /* @__PURE__ */ e("h4", { children: "Connectivity" }),
2810
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-row", children: [
2811
+ /* @__PURE__ */ e("span", { children: "Cloud:" }),
2812
+ /* @__PURE__ */ r("span", { children: [
2813
+ /* @__PURE__ */ e(u, { name: a.connectivity.cloudConnected ? "check" : "close", size: 12 }),
2814
+ " ",
2815
+ a.connectivity.cloudConnected ? "Connected" : "Disconnected"
2816
+ ] })
2817
+ ] }),
2818
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-row", children: [
2819
+ /* @__PURE__ */ e("span", { children: "Network:" }),
2820
+ /* @__PURE__ */ e("span", { children: a.connectivity.localNetwork })
2821
+ ] }),
2822
+ a.connectivity.publicIP && /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-row", children: [
2823
+ /* @__PURE__ */ e("span", { children: "Public IP:" }),
2824
+ /* @__PURE__ */ e("span", { children: a.connectivity.publicIP })
2825
+ ] }),
2826
+ a.connectivity.lastSync && /* @__PURE__ */ r("div", { className: "nice-edge-manager__detail-row", children: [
2827
+ /* @__PURE__ */ e("span", { children: "Last Sync:" }),
2828
+ /* @__PURE__ */ e("span", { children: a.connectivity.lastSync.toLocaleString() })
2829
+ ] })
2830
+ ] }),
2831
+ a.metrics && /* @__PURE__ */ r("section", { children: [
2832
+ /* @__PURE__ */ e("h4", { children: "Resource Usage" }),
2833
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__resource-chart", children: [
2834
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__resource-item", children: [
2835
+ /* @__PURE__ */ e("span", { children: "CPU" }),
2836
+ /* @__PURE__ */ e("div", { className: "nice-edge-manager__resource-bar", children: /* @__PURE__ */ e(
2837
+ "div",
2838
+ {
2839
+ className: "nice-edge-manager__resource-fill",
2840
+ style: { width: `${a.metrics.cpuUsage}%` }
2841
+ }
2842
+ ) }),
2843
+ /* @__PURE__ */ r("span", { children: [
2844
+ a.metrics.cpuUsage.toFixed(1),
2845
+ "%"
2846
+ ] })
2847
+ ] }),
2848
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__resource-item", children: [
2849
+ /* @__PURE__ */ e("span", { children: "Memory" }),
2850
+ /* @__PURE__ */ e("div", { className: "nice-edge-manager__resource-bar", children: /* @__PURE__ */ e(
2851
+ "div",
2852
+ {
2853
+ className: "nice-edge-manager__resource-fill",
2854
+ style: { width: `${a.metrics.memoryUsage}%` }
2855
+ }
2856
+ ) }),
2857
+ /* @__PURE__ */ r("span", { children: [
2858
+ a.metrics.memoryUsage.toFixed(1),
2859
+ "%"
2860
+ ] })
2861
+ ] }),
2862
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__resource-item", children: [
2863
+ /* @__PURE__ */ e("span", { children: "Disk" }),
2864
+ /* @__PURE__ */ e("div", { className: "nice-edge-manager__resource-bar", children: /* @__PURE__ */ e(
2865
+ "div",
2866
+ {
2867
+ className: "nice-edge-manager__resource-fill",
2868
+ style: { width: `${a.metrics.diskUsage}%` }
2869
+ }
2870
+ ) }),
2871
+ /* @__PURE__ */ r("span", { children: [
2872
+ a.metrics.diskUsage.toFixed(1),
2873
+ "%"
2874
+ ] })
2875
+ ] })
2876
+ ] }),
2877
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__network-stats", children: [
2878
+ /* @__PURE__ */ r("span", { children: [
2879
+ "↓ ",
2880
+ j(a.metrics.networkIn)
2881
+ ] }),
2882
+ /* @__PURE__ */ r("span", { children: [
2883
+ "↑ ",
2884
+ j(a.metrics.networkOut)
2885
+ ] })
2886
+ ] })
2887
+ ] })
2888
+ ] })
2889
+ ] });
2890
+ }
2891
+ function De({
2892
+ config: a,
2893
+ templates: i,
2894
+ onChange: c,
2895
+ onDeploy: n,
2896
+ onClose: o
2897
+ }) {
2898
+ return /* @__PURE__ */ e("div", { className: "nice-edge-manager__dialog-overlay", children: /* @__PURE__ */ r("div", { className: "nice-edge-manager__dialog", children: [
2899
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__dialog-header", children: [
2900
+ /* @__PURE__ */ e("h3", { children: "Deploy Module" }),
2901
+ /* @__PURE__ */ e("button", { onClick: o, "aria-label": "Close", children: /* @__PURE__ */ e(u, { name: "close", size: 14 }) })
2902
+ ] }),
2903
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__dialog-content", children: [
2904
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__field", children: [
2905
+ /* @__PURE__ */ e("label", { children: "Template (optional)" }),
2906
+ /* @__PURE__ */ r(
2907
+ "select",
2908
+ {
2909
+ value: "",
2910
+ onChange: (t) => {
2911
+ const d = i.find((l) => l.image === t.target.value);
2912
+ d && c({
2913
+ ...a,
2914
+ name: d.name,
2915
+ image: d.image
2916
+ });
2917
+ },
2918
+ children: [
2919
+ /* @__PURE__ */ e("option", { value: "", children: "Select a template..." }),
2920
+ i.map((t) => /* @__PURE__ */ e("option", { value: t.image, children: t.name }, t.image))
2921
+ ]
2922
+ }
2923
+ )
2924
+ ] }),
2925
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__field", children: [
2926
+ /* @__PURE__ */ e("label", { children: "Module Name" }),
2927
+ /* @__PURE__ */ e(
2928
+ "input",
2929
+ {
2930
+ type: "text",
2931
+ value: a.name || "",
2932
+ onChange: (t) => c({ ...a, name: t.target.value }),
2933
+ placeholder: "e.g., my-module"
2934
+ }
2935
+ )
2936
+ ] }),
2937
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__field", children: [
2938
+ /* @__PURE__ */ e("label", { children: "Container Image" }),
2939
+ /* @__PURE__ */ e(
2940
+ "input",
2941
+ {
2942
+ type: "text",
2943
+ value: a.image || "",
2944
+ onChange: (t) => c({ ...a, image: t.target.value }),
2945
+ placeholder: "e.g., nginx:latest"
2946
+ }
2947
+ )
2948
+ ] }),
2949
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__field", children: [
2950
+ /* @__PURE__ */ e("label", { children: "Version" }),
2951
+ /* @__PURE__ */ e(
2952
+ "input",
2953
+ {
2954
+ type: "text",
2955
+ value: a.version || "1.0.0",
2956
+ onChange: (t) => c({ ...a, version: t.target.value })
2957
+ }
2958
+ )
2959
+ ] })
2960
+ ] }),
2961
+ /* @__PURE__ */ r("div", { className: "nice-edge-manager__dialog-footer", children: [
2962
+ /* @__PURE__ */ e("button", { onClick: o, children: "Cancel" }),
2963
+ /* @__PURE__ */ e("button", { className: "nice-edge-manager__deploy-confirm", onClick: n, children: "Deploy" })
2964
+ ] })
2965
+ ] }) });
2966
+ }
2967
+ const Q = {
2657
2968
  broker: "localhost",
2658
2969
  port: 1883,
2659
2970
  clientId: `nice2dev-${Date.now()}`,
@@ -2661,238 +2972,244 @@ const G = {
2661
2972
  keepAlive: 60,
2662
2973
  cleanSession: !0,
2663
2974
  topics: []
2664
- }, V = {
2975
+ }, J = {
2665
2976
  host: "localhost",
2666
2977
  port: 5683,
2667
2978
  useDTLS: !1,
2668
2979
  resources: []
2669
- }, Q = {
2980
+ }, K = {
2670
2981
  type: "tcp",
2671
2982
  host: "localhost",
2672
2983
  port: 502,
2673
2984
  slaveId: 1,
2674
2985
  timeout: 1e3,
2675
2986
  registers: []
2676
- }, j = {
2987
+ }, X = {
2677
2988
  endpointUrl: "opc.tcp://localhost:4840",
2678
2989
  securityMode: "None",
2679
2990
  authentication: "anonymous",
2680
2991
  applicationName: "Nice2Dev IoT Client",
2681
2992
  nodes: []
2682
2993
  };
2683
- function Ae({
2684
- protocol: r = "mqtt",
2994
+ function Oe({
2995
+ protocol: a = "mqtt",
2685
2996
  config: i,
2686
2997
  onSave: c,
2687
2998
  onTest: n,
2688
2999
  className: o = ""
2689
3000
  }) {
2690
- const { t: d } = U(), [t, l] = h(r), [g, m] = h(
2691
- (i == null ? void 0 : i.type) === "mqtt" ? { ...G, ...i.config } : G
2692
- ), [C, N] = h(
2693
- (i == null ? void 0 : i.type) === "coap" ? { ...V, ...i.config } : V
2694
- ), [v, u] = h(
2695
- (i == null ? void 0 : i.type) === "modbus" ? { ...Q, ...i.config } : Q
2696
- ), [_, H] = h(
2697
- (i == null ? void 0 : i.type) === "opcua" ? { ...j, ...i.config } : j
2698
- ), [P, x] = h(null), [R, y] = h(!1), k = w(() => {
2699
- switch (t) {
3001
+ const { t } = R(), [d, l] = y(a), [g, m] = y(
3002
+ (i == null ? void 0 : i.type) === "mqtt" ? { ...Q, ...i.config } : Q
3003
+ ), [_, w] = y(
3004
+ (i == null ? void 0 : i.type) === "coap" ? { ...J, ...i.config } : J
3005
+ ), [M, v] = y(
3006
+ (i == null ? void 0 : i.type) === "modbus" ? { ...K, ...i.config } : K
3007
+ ), [N, H] = y(
3008
+ (i == null ? void 0 : i.type) === "opcua" ? { ...X, ...i.config } : X
3009
+ ), [L, z] = y(null), [A, p] = y(!1), k = C(() => {
3010
+ switch (d) {
2700
3011
  case "mqtt":
2701
3012
  return g;
2702
3013
  case "coap":
2703
- return C;
3014
+ return _;
2704
3015
  case "modbus-tcp":
2705
3016
  case "modbus-rtu":
2706
- return v;
3017
+ return M;
2707
3018
  case "opcua":
2708
- return _;
3019
+ return N;
2709
3020
  default:
2710
3021
  return g;
2711
3022
  }
2712
- }, [t, g, C, v, _]), L = w(() => {
3023
+ }, [d, g, _, M, N]), E = C(() => {
2713
3024
  c == null || c(k());
2714
- }, [k, c]), $ = w(async () => {
3025
+ }, [k, c]), U = C(async () => {
2715
3026
  if (n) {
2716
- y(!0), x(null);
3027
+ p(!0), z(null);
2717
3028
  try {
2718
- const M = await n(k());
2719
- x(M);
2720
- } catch (M) {
2721
- x({ success: !1, message: String(M) });
3029
+ const T = await n(k());
3030
+ z(T);
3031
+ } catch (T) {
3032
+ z({ success: !1, message: String(T) });
2722
3033
  } finally {
2723
- y(!1);
3034
+ p(!1);
2724
3035
  }
2725
3036
  }
2726
3037
  }, [k, n]);
2727
- return /* @__PURE__ */ a("div", { className: `nice-protocol-config ${o}`, children: [
2728
- /* @__PURE__ */ a("header", { className: "nice-protocol-config__header", children: [
2729
- /* @__PURE__ */ e("h2", { children: d("protocolConfig.title", "Protocol Configuration") }),
2730
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__protocol-selector", children: [
3038
+ return /* @__PURE__ */ r("div", { className: `nice-protocol-config ${o}`, children: [
3039
+ /* @__PURE__ */ r("header", { className: "nice-protocol-config__header", children: [
3040
+ /* @__PURE__ */ e("h2", { children: t("protocolConfig.title", "Protocol Configuration") }),
3041
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__protocol-selector", children: [
2731
3042
  /* @__PURE__ */ e("label", { children: "Protocol:" }),
2732
- /* @__PURE__ */ a("select", { value: t, onChange: (M) => l(M.target.value), children: [
2733
- /* @__PURE__ */ e("option", { value: "mqtt", children: d("protocolConfig.mqtt", "MQTT") }),
2734
- /* @__PURE__ */ e("option", { value: "coap", children: d("protocolConfig.coap", "CoAP") }),
2735
- /* @__PURE__ */ e("option", { value: "modbus-tcp", children: d("protocolConfig.modbusTcp", "Modbus TCP") }),
2736
- /* @__PURE__ */ e("option", { value: "modbus-rtu", children: d("protocolConfig.modbusRtu", "Modbus RTU") }),
2737
- /* @__PURE__ */ e("option", { value: "opcua", children: d("protocolConfig.opcUa", "OPC-UA") })
3043
+ /* @__PURE__ */ r("select", { value: d, onChange: (T) => l(T.target.value), children: [
3044
+ /* @__PURE__ */ e("option", { value: "mqtt", children: t("protocolConfig.mqtt", "MQTT") }),
3045
+ /* @__PURE__ */ e("option", { value: "coap", children: t("protocolConfig.coap", "CoAP") }),
3046
+ /* @__PURE__ */ e("option", { value: "modbus-tcp", children: t("protocolConfig.modbusTcp", "Modbus TCP") }),
3047
+ /* @__PURE__ */ e("option", { value: "modbus-rtu", children: t("protocolConfig.modbusRtu", "Modbus RTU") }),
3048
+ /* @__PURE__ */ e("option", { value: "opcua", children: t("protocolConfig.opcUa", "OPC-UA") })
2738
3049
  ] })
2739
3050
  ] })
2740
3051
  ] }),
2741
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__content", children: [
2742
- t === "mqtt" && /* @__PURE__ */ e(Te, { config: g, onChange: m }),
2743
- t === "coap" && /* @__PURE__ */ e(Pe, { config: C, onChange: N }),
2744
- (t === "modbus-tcp" || t === "modbus-rtu") && /* @__PURE__ */ e(
2745
- Me,
3052
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__content", children: [
3053
+ d === "mqtt" && /* @__PURE__ */ e(Pe, { config: g, onChange: m }),
3054
+ d === "coap" && /* @__PURE__ */ e(Re, { config: _, onChange: w }),
3055
+ (d === "modbus-tcp" || d === "modbus-rtu") && /* @__PURE__ */ e(
3056
+ Ie,
2746
3057
  {
2747
- config: v,
2748
- type: t === "modbus-rtu" ? "rtu" : "tcp",
2749
- onChange: u
3058
+ config: M,
3059
+ type: d === "modbus-rtu" ? "rtu" : "tcp",
3060
+ onChange: v
2750
3061
  }
2751
3062
  ),
2752
- t === "opcua" && /* @__PURE__ */ e(De, { config: _, onChange: H })
3063
+ d === "opcua" && /* @__PURE__ */ e(Ee, { config: N, onChange: H })
2753
3064
  ] }),
2754
- P && /* @__PURE__ */ a(
3065
+ L && /* @__PURE__ */ r(
2755
3066
  "div",
2756
3067
  {
2757
- className: `nice-protocol-config__test-result nice-protocol-config__test-result--${P.success ? "success" : "error"}`,
3068
+ className: `nice-protocol-config__test-result nice-protocol-config__test-result--${L.success ? "success" : "error"}`,
2758
3069
  children: [
2759
- P.success ? "βœ“" : "βœ—",
3070
+ /* @__PURE__ */ e(u, { name: L.success ? "check" : "close", size: 14 }),
2760
3071
  " ",
2761
- P.message
3072
+ L.message
2762
3073
  ]
2763
3074
  }
2764
3075
  ),
2765
- /* @__PURE__ */ a("footer", { className: "nice-protocol-config__footer", children: [
3076
+ /* @__PURE__ */ r("footer", { className: "nice-protocol-config__footer", children: [
2766
3077
  /* @__PURE__ */ e(
2767
3078
  "button",
2768
3079
  {
2769
3080
  className: "nice-protocol-config__test-btn",
2770
- onClick: $,
2771
- disabled: R || !n,
2772
- children: R ? "Testing..." : "πŸ”Œ Test Connection"
3081
+ onClick: U,
3082
+ disabled: A || !n,
3083
+ children: A ? "Testing..." : /* @__PURE__ */ r(D, { children: [
3084
+ /* @__PURE__ */ e(u, { name: "plug", size: 14 }),
3085
+ " Test Connection"
3086
+ ] })
2773
3087
  }
2774
3088
  ),
2775
- /* @__PURE__ */ e("button", { className: "nice-protocol-config__save-btn", onClick: L, children: "πŸ’Ύ Save" })
3089
+ /* @__PURE__ */ r("button", { className: "nice-protocol-config__save-btn", onClick: E, children: [
3090
+ /* @__PURE__ */ e(u, { name: "save", size: 14 }),
3091
+ " Save"
3092
+ ] })
2776
3093
  ] })
2777
3094
  ] });
2778
3095
  }
2779
- function Te({ config: r, onChange: i }) {
2780
- const { t: c } = U();
2781
- return /* @__PURE__ */ a("div", { className: "nice-protocol-config__section", children: [
3096
+ function Pe({ config: a, onChange: i }) {
3097
+ const { t: c } = R();
3098
+ return /* @__PURE__ */ r("div", { className: "nice-protocol-config__section", children: [
2782
3099
  /* @__PURE__ */ e("h3", { children: c("protocolConfig.mqttConfiguration", "MQTT Configuration") }),
2783
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__grid", children: [
2784
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3100
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__grid", children: [
3101
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
2785
3102
  /* @__PURE__ */ e("label", { children: c("protocolConfig.broker", "Broker") }),
2786
3103
  /* @__PURE__ */ e(
2787
3104
  "input",
2788
3105
  {
2789
3106
  type: "text",
2790
- value: r.broker,
2791
- onChange: (n) => i({ ...r, broker: n.target.value }),
3107
+ value: a.broker,
3108
+ onChange: (n) => i({ ...a, broker: n.target.value }),
2792
3109
  placeholder: "localhost"
2793
3110
  }
2794
3111
  )
2795
3112
  ] }),
2796
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3113
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
2797
3114
  /* @__PURE__ */ e("label", { children: c("protocolConfig.port", "Port") }),
2798
3115
  /* @__PURE__ */ e(
2799
3116
  "input",
2800
3117
  {
2801
3118
  type: "number",
2802
- value: r.port,
2803
- onChange: (n) => i({ ...r, port: parseInt(n.target.value, 10) || 1883 })
3119
+ value: a.port,
3120
+ onChange: (n) => i({ ...a, port: parseInt(n.target.value, 10) || 1883 })
2804
3121
  }
2805
3122
  )
2806
3123
  ] }),
2807
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3124
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
2808
3125
  /* @__PURE__ */ e("label", { children: c("protocolConfig.clientId", "Client ID") }),
2809
3126
  /* @__PURE__ */ e(
2810
3127
  "input",
2811
3128
  {
2812
3129
  type: "text",
2813
- value: r.clientId,
2814
- onChange: (n) => i({ ...r, clientId: n.target.value })
3130
+ value: a.clientId,
3131
+ onChange: (n) => i({ ...a, clientId: n.target.value })
2815
3132
  }
2816
3133
  )
2817
3134
  ] }),
2818
- /* @__PURE__ */ e("div", { className: "nice-protocol-config__field", children: /* @__PURE__ */ a("label", { children: [
3135
+ /* @__PURE__ */ e("div", { className: "nice-protocol-config__field", children: /* @__PURE__ */ r("label", { children: [
2819
3136
  /* @__PURE__ */ e(
2820
3137
  "input",
2821
3138
  {
2822
3139
  type: "checkbox",
2823
- checked: r.useTLS,
2824
- onChange: (n) => i({ ...r, useTLS: n.target.checked })
3140
+ checked: a.useTLS,
3141
+ onChange: (n) => i({ ...a, useTLS: n.target.checked })
2825
3142
  }
2826
3143
  ),
2827
3144
  c("protocolConfig.useTls", "Use TLS")
2828
3145
  ] }) }),
2829
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3146
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
2830
3147
  /* @__PURE__ */ e("label", { children: c("protocolConfig.username", "Username") }),
2831
3148
  /* @__PURE__ */ e(
2832
3149
  "input",
2833
3150
  {
2834
3151
  type: "text",
2835
- value: r.username || "",
2836
- onChange: (n) => i({ ...r, username: n.target.value })
3152
+ value: a.username || "",
3153
+ onChange: (n) => i({ ...a, username: n.target.value })
2837
3154
  }
2838
3155
  )
2839
3156
  ] }),
2840
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3157
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
2841
3158
  /* @__PURE__ */ e("label", { children: c("protocolConfig.password", "Password") }),
2842
3159
  /* @__PURE__ */ e(
2843
3160
  "input",
2844
3161
  {
2845
3162
  type: "password",
2846
- value: r.password || "",
2847
- onChange: (n) => i({ ...r, password: n.target.value })
3163
+ value: a.password || "",
3164
+ onChange: (n) => i({ ...a, password: n.target.value })
2848
3165
  }
2849
3166
  )
2850
3167
  ] }),
2851
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3168
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
2852
3169
  /* @__PURE__ */ e("label", { children: "Keep Alive (seconds)" }),
2853
3170
  /* @__PURE__ */ e(
2854
3171
  "input",
2855
3172
  {
2856
3173
  type: "number",
2857
- value: r.keepAlive,
2858
- onChange: (n) => i({ ...r, keepAlive: parseInt(n.target.value, 10) || 60 })
3174
+ value: a.keepAlive,
3175
+ onChange: (n) => i({ ...a, keepAlive: parseInt(n.target.value, 10) || 60 })
2859
3176
  }
2860
3177
  )
2861
3178
  ] }),
2862
- /* @__PURE__ */ e("div", { className: "nice-protocol-config__field", children: /* @__PURE__ */ a("label", { children: [
3179
+ /* @__PURE__ */ e("div", { className: "nice-protocol-config__field", children: /* @__PURE__ */ r("label", { children: [
2863
3180
  /* @__PURE__ */ e(
2864
3181
  "input",
2865
3182
  {
2866
3183
  type: "checkbox",
2867
- checked: r.cleanSession,
2868
- onChange: (n) => i({ ...r, cleanSession: n.target.checked })
3184
+ checked: a.cleanSession,
3185
+ onChange: (n) => i({ ...a, cleanSession: n.target.checked })
2869
3186
  }
2870
3187
  ),
2871
3188
  c("protocolConfig.cleanSession", "Clean Session")
2872
3189
  ] }) })
2873
3190
  ] }),
2874
3191
  /* @__PURE__ */ e("h4", { children: c("protocolConfig.topics", "Topics") }),
2875
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__topics", children: [
2876
- r.topics.map((n, o) => /* @__PURE__ */ a("div", { className: "nice-protocol-config__topic-row", children: [
3192
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__topics", children: [
3193
+ a.topics.map((n, o) => /* @__PURE__ */ r("div", { className: "nice-protocol-config__topic-row", children: [
2877
3194
  /* @__PURE__ */ e(
2878
3195
  "input",
2879
3196
  {
2880
3197
  type: "text",
2881
3198
  value: n.pattern,
2882
- onChange: (d) => {
2883
- const t = [...r.topics];
2884
- t[o] = { ...t[o], pattern: d.target.value }, i({ ...r, topics: t });
3199
+ onChange: (t) => {
3200
+ const d = [...a.topics];
3201
+ d[o] = { ...d[o], pattern: t.target.value }, i({ ...a, topics: d });
2885
3202
  },
2886
3203
  placeholder: c("protocolConfig.topicPatternPlaceholder", "e.g., sensors/+/data")
2887
3204
  }
2888
3205
  ),
2889
- /* @__PURE__ */ a(
3206
+ /* @__PURE__ */ r(
2890
3207
  "select",
2891
3208
  {
2892
3209
  value: n.qos,
2893
- onChange: (d) => {
2894
- const t = [...r.topics];
2895
- t[o] = { ...t[o], qos: parseInt(d.target.value, 10) }, i({ ...r, topics: t });
3210
+ onChange: (t) => {
3211
+ const d = [...a.topics];
3212
+ d[o] = { ...d[o], qos: parseInt(t.target.value, 10) }, i({ ...a, topics: d });
2896
3213
  },
2897
3214
  children: [
2898
3215
  /* @__PURE__ */ e("option", { value: 0, children: c("protocolConfig.qos0", "QoS 0") }),
@@ -2901,16 +3218,16 @@ function Te({ config: r, onChange: i }) {
2901
3218
  ]
2902
3219
  }
2903
3220
  ),
2904
- /* @__PURE__ */ a(
3221
+ /* @__PURE__ */ r(
2905
3222
  "select",
2906
3223
  {
2907
3224
  value: n.direction,
2908
- onChange: (d) => {
2909
- const t = [...r.topics];
2910
- t[o] = {
2911
- ...t[o],
2912
- direction: d.target.value
2913
- }, i({ ...r, topics: t });
3225
+ onChange: (t) => {
3226
+ const d = [...a.topics];
3227
+ d[o] = {
3228
+ ...d[o],
3229
+ direction: t.target.value
3230
+ }, i({ ...a, topics: d });
2914
3231
  },
2915
3232
  children: [
2916
3233
  /* @__PURE__ */ e("option", { value: "subscribe", children: c("protocolConfig.subscribe", "Subscribe") }),
@@ -2923,8 +3240,8 @@ function Te({ config: r, onChange: i }) {
2923
3240
  "button",
2924
3241
  {
2925
3242
  onClick: () => {
2926
- const d = r.topics.filter((t, l) => l !== o);
2927
- i({ ...r, topics: d });
3243
+ const t = a.topics.filter((d, l) => l !== o);
3244
+ i({ ...a, topics: t });
2928
3245
  },
2929
3246
  children: "Γ—"
2930
3247
  }
@@ -2935,9 +3252,9 @@ function Te({ config: r, onChange: i }) {
2935
3252
  {
2936
3253
  onClick: () => {
2937
3254
  i({
2938
- ...r,
3255
+ ...a,
2939
3256
  topics: [
2940
- ...r.topics,
3257
+ ...a.topics,
2941
3258
  { pattern: "", qos: 0, direction: "subscribe", payloadFormat: "json" }
2942
3259
  ]
2943
3260
  });
@@ -2948,67 +3265,67 @@ function Te({ config: r, onChange: i }) {
2948
3265
  ] })
2949
3266
  ] });
2950
3267
  }
2951
- function Pe({ config: r, onChange: i }) {
2952
- const { t: c } = U();
2953
- return /* @__PURE__ */ a("div", { className: "nice-protocol-config__section", children: [
3268
+ function Re({ config: a, onChange: i }) {
3269
+ const { t: c } = R();
3270
+ return /* @__PURE__ */ r("div", { className: "nice-protocol-config__section", children: [
2954
3271
  /* @__PURE__ */ e("h3", { children: c("protocolConfig.coapConfiguration", "CoAP Configuration") }),
2955
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__grid", children: [
2956
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3272
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__grid", children: [
3273
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
2957
3274
  /* @__PURE__ */ e("label", { children: c("protocolConfig.host", "Host") }),
2958
3275
  /* @__PURE__ */ e(
2959
3276
  "input",
2960
3277
  {
2961
3278
  type: "text",
2962
- value: r.host,
2963
- onChange: (n) => i({ ...r, host: n.target.value })
3279
+ value: a.host,
3280
+ onChange: (n) => i({ ...a, host: n.target.value })
2964
3281
  }
2965
3282
  )
2966
3283
  ] }),
2967
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3284
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
2968
3285
  /* @__PURE__ */ e("label", { children: c("protocolConfig.port", "Port") }),
2969
3286
  /* @__PURE__ */ e(
2970
3287
  "input",
2971
3288
  {
2972
3289
  type: "number",
2973
- value: r.port,
2974
- onChange: (n) => i({ ...r, port: parseInt(n.target.value, 10) || 5683 })
3290
+ value: a.port,
3291
+ onChange: (n) => i({ ...a, port: parseInt(n.target.value, 10) || 5683 })
2975
3292
  }
2976
3293
  )
2977
3294
  ] }),
2978
- /* @__PURE__ */ e("div", { className: "nice-protocol-config__field", children: /* @__PURE__ */ a("label", { children: [
3295
+ /* @__PURE__ */ e("div", { className: "nice-protocol-config__field", children: /* @__PURE__ */ r("label", { children: [
2979
3296
  /* @__PURE__ */ e(
2980
3297
  "input",
2981
3298
  {
2982
3299
  type: "checkbox",
2983
- checked: r.useDTLS,
2984
- onChange: (n) => i({ ...r, useDTLS: n.target.checked })
3300
+ checked: a.useDTLS,
3301
+ onChange: (n) => i({ ...a, useDTLS: n.target.checked })
2985
3302
  }
2986
3303
  ),
2987
3304
  c("protocolConfig.useDtls", "Use DTLS")
2988
3305
  ] }) }),
2989
- /* @__PURE__ */ e("div", { className: "nice-protocol-config__field", children: /* @__PURE__ */ a("label", { children: [
3306
+ /* @__PURE__ */ e("div", { className: "nice-protocol-config__field", children: /* @__PURE__ */ r("label", { children: [
2990
3307
  /* @__PURE__ */ e(
2991
3308
  "input",
2992
3309
  {
2993
3310
  type: "checkbox",
2994
- checked: r.observe || !1,
2995
- onChange: (n) => i({ ...r, observe: n.target.checked })
3311
+ checked: a.observe || !1,
3312
+ onChange: (n) => i({ ...a, observe: n.target.checked })
2996
3313
  }
2997
3314
  ),
2998
3315
  c("protocolConfig.enableObserve", "Enable Observe")
2999
3316
  ] }) })
3000
3317
  ] }),
3001
3318
  /* @__PURE__ */ e("h4", { children: c("protocolConfig.resources", "Resources") }),
3002
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__resources", children: [
3003
- r.resources.map((n, o) => /* @__PURE__ */ a("div", { className: "nice-protocol-config__resource-row", children: [
3319
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__resources", children: [
3320
+ a.resources.map((n, o) => /* @__PURE__ */ r("div", { className: "nice-protocol-config__resource-row", children: [
3004
3321
  /* @__PURE__ */ e(
3005
3322
  "input",
3006
3323
  {
3007
3324
  type: "text",
3008
3325
  value: n.path,
3009
- onChange: (d) => {
3010
- const t = [...r.resources];
3011
- t[o] = { ...t[o], path: d.target.value }, i({ ...r, resources: t });
3326
+ onChange: (t) => {
3327
+ const d = [...a.resources];
3328
+ d[o] = { ...d[o], path: t.target.value }, i({ ...a, resources: d });
3012
3329
  },
3013
3330
  placeholder: "/sensors/temperature"
3014
3331
  }
@@ -3017,8 +3334,8 @@ function Pe({ config: r, onChange: i }) {
3017
3334
  "button",
3018
3335
  {
3019
3336
  onClick: () => {
3020
- const d = r.resources.filter((t, l) => l !== o);
3021
- i({ ...r, resources: d });
3337
+ const t = a.resources.filter((d, l) => l !== o);
3338
+ i({ ...a, resources: t });
3022
3339
  },
3023
3340
  children: "Γ—"
3024
3341
  }
@@ -3029,9 +3346,9 @@ function Pe({ config: r, onChange: i }) {
3029
3346
  {
3030
3347
  onClick: () => {
3031
3348
  i({
3032
- ...r,
3349
+ ...a,
3033
3350
  resources: [
3034
- ...r.resources,
3351
+ ...a.resources,
3035
3352
  { path: "", methods: ["GET"], mediaType: "application/json", observable: !1 }
3036
3353
  ]
3037
3354
  });
@@ -3042,63 +3359,63 @@ function Pe({ config: r, onChange: i }) {
3042
3359
  ] })
3043
3360
  ] });
3044
3361
  }
3045
- function Me({
3046
- config: r,
3362
+ function Ie({
3363
+ config: a,
3047
3364
  type: i,
3048
3365
  onChange: c
3049
3366
  }) {
3050
- const { t: n } = U();
3051
- return /* @__PURE__ */ a("div", { className: "nice-protocol-config__section", children: [
3052
- /* @__PURE__ */ a("h3", { children: [
3367
+ const { t: n } = R();
3368
+ return /* @__PURE__ */ r("div", { className: "nice-protocol-config__section", children: [
3369
+ /* @__PURE__ */ r("h3", { children: [
3053
3370
  "Modbus ",
3054
3371
  i.toUpperCase(),
3055
3372
  " Configuration"
3056
3373
  ] }),
3057
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__grid", children: [
3058
- i === "tcp" && /* @__PURE__ */ a(E, { children: [
3059
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3374
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__grid", children: [
3375
+ i === "tcp" && /* @__PURE__ */ r(D, { children: [
3376
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
3060
3377
  /* @__PURE__ */ e("label", { children: n("protocolConfig.host", "Host") }),
3061
3378
  /* @__PURE__ */ e(
3062
3379
  "input",
3063
3380
  {
3064
3381
  type: "text",
3065
- value: r.host || "",
3066
- onChange: (o) => c({ ...r, host: o.target.value })
3382
+ value: a.host || "",
3383
+ onChange: (o) => c({ ...a, host: o.target.value })
3067
3384
  }
3068
3385
  )
3069
3386
  ] }),
3070
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3387
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
3071
3388
  /* @__PURE__ */ e("label", { children: n("protocolConfig.port", "Port") }),
3072
3389
  /* @__PURE__ */ e(
3073
3390
  "input",
3074
3391
  {
3075
3392
  type: "number",
3076
- value: r.port || 502,
3077
- onChange: (o) => c({ ...r, port: parseInt(o.target.value, 10) || 502 })
3393
+ value: a.port || 502,
3394
+ onChange: (o) => c({ ...a, port: parseInt(o.target.value, 10) || 502 })
3078
3395
  }
3079
3396
  )
3080
3397
  ] })
3081
3398
  ] }),
3082
- i === "rtu" && /* @__PURE__ */ a(E, { children: [
3083
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3399
+ i === "rtu" && /* @__PURE__ */ r(D, { children: [
3400
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
3084
3401
  /* @__PURE__ */ e("label", { children: n("protocolConfig.serialPort", "Serial Port") }),
3085
3402
  /* @__PURE__ */ e(
3086
3403
  "input",
3087
3404
  {
3088
3405
  type: "text",
3089
- value: r.serialPort || "",
3090
- onChange: (o) => c({ ...r, serialPort: o.target.value }),
3406
+ value: a.serialPort || "",
3407
+ onChange: (o) => c({ ...a, serialPort: o.target.value }),
3091
3408
  placeholder: n("protocolConfig.serialPortPlaceholder", "COM1 or /dev/ttyUSB0")
3092
3409
  }
3093
3410
  )
3094
3411
  ] }),
3095
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3412
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
3096
3413
  /* @__PURE__ */ e("label", { children: n("protocolConfig.baudRate", "Baud Rate") }),
3097
- /* @__PURE__ */ a(
3414
+ /* @__PURE__ */ r(
3098
3415
  "select",
3099
3416
  {
3100
- value: r.baudRate || 9600,
3101
- onChange: (o) => c({ ...r, baudRate: parseInt(o.target.value, 10) }),
3417
+ value: a.baudRate || 9600,
3418
+ onChange: (o) => c({ ...a, baudRate: parseInt(o.target.value, 10) }),
3102
3419
  children: [
3103
3420
  /* @__PURE__ */ e("option", { value: 9600, children: "9600" }),
3104
3421
  /* @__PURE__ */ e("option", { value: 19200, children: "19200" }),
@@ -3109,13 +3426,13 @@ function Me({
3109
3426
  }
3110
3427
  )
3111
3428
  ] }),
3112
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3429
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
3113
3430
  /* @__PURE__ */ e("label", { children: n("protocolConfig.parity", "Parity") }),
3114
- /* @__PURE__ */ a(
3431
+ /* @__PURE__ */ r(
3115
3432
  "select",
3116
3433
  {
3117
- value: r.parity || "none",
3118
- onChange: (o) => c({ ...r, parity: o.target.value }),
3434
+ value: a.parity || "none",
3435
+ onChange: (o) => c({ ...a, parity: o.target.value }),
3119
3436
  children: [
3120
3437
  /* @__PURE__ */ e("option", { value: "none", children: n("protocolConfig.none", "None") }),
3121
3438
  /* @__PURE__ */ e("option", { value: "even", children: n("protocolConfig.even", "Even") }),
@@ -3125,34 +3442,34 @@ function Me({
3125
3442
  )
3126
3443
  ] })
3127
3444
  ] }),
3128
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3445
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
3129
3446
  /* @__PURE__ */ e("label", { children: n("protocolConfig.slaveId", "Slave ID") }),
3130
3447
  /* @__PURE__ */ e(
3131
3448
  "input",
3132
3449
  {
3133
3450
  type: "number",
3134
- value: r.slaveId,
3135
- onChange: (o) => c({ ...r, slaveId: parseInt(o.target.value, 10) || 1 }),
3451
+ value: a.slaveId,
3452
+ onChange: (o) => c({ ...a, slaveId: parseInt(o.target.value, 10) || 1 }),
3136
3453
  min: 1,
3137
3454
  max: 247
3138
3455
  }
3139
3456
  )
3140
3457
  ] }),
3141
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3458
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
3142
3459
  /* @__PURE__ */ e("label", { children: "Timeout (ms)" }),
3143
3460
  /* @__PURE__ */ e(
3144
3461
  "input",
3145
3462
  {
3146
3463
  type: "number",
3147
- value: r.timeout,
3148
- onChange: (o) => c({ ...r, timeout: parseInt(o.target.value, 10) || 1e3 })
3464
+ value: a.timeout,
3465
+ onChange: (o) => c({ ...a, timeout: parseInt(o.target.value, 10) || 1e3 })
3149
3466
  }
3150
3467
  )
3151
3468
  ] })
3152
3469
  ] }),
3153
3470
  /* @__PURE__ */ e("h4", { children: n("protocolConfig.registers", "Registers") }),
3154
- /* @__PURE__ */ a("table", { className: "nice-protocol-config__registers-table", children: [
3155
- /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ a("tr", { children: [
3471
+ /* @__PURE__ */ r("table", { className: "nice-protocol-config__registers-table", children: [
3472
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ r("tr", { children: [
3156
3473
  /* @__PURE__ */ e("th", { children: n("protocolConfig.name", "Name") }),
3157
3474
  /* @__PURE__ */ e("th", { children: n("protocolConfig.address", "Address") }),
3158
3475
  /* @__PURE__ */ e("th", { children: n("protocolConfig.type", "Type") }),
@@ -3160,15 +3477,15 @@ function Me({
3160
3477
  /* @__PURE__ */ e("th", { children: "R/W" }),
3161
3478
  /* @__PURE__ */ e("th", {})
3162
3479
  ] }) }),
3163
- /* @__PURE__ */ e("tbody", { children: r.registers.map((o, d) => /* @__PURE__ */ a("tr", { children: [
3480
+ /* @__PURE__ */ e("tbody", { children: a.registers.map((o, t) => /* @__PURE__ */ r("tr", { children: [
3164
3481
  /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
3165
3482
  "input",
3166
3483
  {
3167
3484
  type: "text",
3168
3485
  value: o.name,
3169
- onChange: (t) => {
3170
- const l = [...r.registers];
3171
- l[d] = { ...l[d], name: t.target.value }, c({ ...r, registers: l });
3486
+ onChange: (d) => {
3487
+ const l = [...a.registers];
3488
+ l[t] = { ...l[t], name: d.target.value }, c({ ...a, registers: l });
3172
3489
  }
3173
3490
  }
3174
3491
  ) }),
@@ -3177,25 +3494,25 @@ function Me({
3177
3494
  {
3178
3495
  type: "number",
3179
3496
  value: o.address,
3180
- onChange: (t) => {
3181
- const l = [...r.registers];
3182
- l[d] = {
3183
- ...l[d],
3184
- address: parseInt(t.target.value, 10) || 0
3185
- }, c({ ...r, registers: l });
3497
+ onChange: (d) => {
3498
+ const l = [...a.registers];
3499
+ l[t] = {
3500
+ ...l[t],
3501
+ address: parseInt(d.target.value, 10) || 0
3502
+ }, c({ ...a, registers: l });
3186
3503
  }
3187
3504
  }
3188
3505
  ) }),
3189
- /* @__PURE__ */ e("td", { children: /* @__PURE__ */ a(
3506
+ /* @__PURE__ */ e("td", { children: /* @__PURE__ */ r(
3190
3507
  "select",
3191
3508
  {
3192
3509
  value: o.type,
3193
- onChange: (t) => {
3194
- const l = [...r.registers];
3195
- l[d] = {
3196
- ...l[d],
3197
- type: t.target.value
3198
- }, c({ ...r, registers: l });
3510
+ onChange: (d) => {
3511
+ const l = [...a.registers];
3512
+ l[t] = {
3513
+ ...l[t],
3514
+ type: d.target.value
3515
+ }, c({ ...a, registers: l });
3199
3516
  },
3200
3517
  children: [
3201
3518
  /* @__PURE__ */ e("option", { value: "coil", children: n("protocolConfig.coil", "Coil") }),
@@ -3205,16 +3522,16 @@ function Me({
3205
3522
  ]
3206
3523
  }
3207
3524
  ) }),
3208
- /* @__PURE__ */ e("td", { children: /* @__PURE__ */ a(
3525
+ /* @__PURE__ */ e("td", { children: /* @__PURE__ */ r(
3209
3526
  "select",
3210
3527
  {
3211
3528
  value: o.dataType,
3212
- onChange: (t) => {
3213
- const l = [...r.registers];
3214
- l[d] = {
3215
- ...l[d],
3216
- dataType: t.target.value
3217
- }, c({ ...r, registers: l });
3529
+ onChange: (d) => {
3530
+ const l = [...a.registers];
3531
+ l[t] = {
3532
+ ...l[t],
3533
+ dataType: d.target.value
3534
+ }, c({ ...a, registers: l });
3218
3535
  },
3219
3536
  children: [
3220
3537
  /* @__PURE__ */ e("option", { value: "bool", children: n("protocolConfig.bool", "Bool") }),
@@ -3226,15 +3543,15 @@ function Me({
3226
3543
  ]
3227
3544
  }
3228
3545
  ) }),
3229
- /* @__PURE__ */ a("td", { children: [
3546
+ /* @__PURE__ */ r("td", { children: [
3230
3547
  /* @__PURE__ */ e(
3231
3548
  "input",
3232
3549
  {
3233
3550
  type: "checkbox",
3234
3551
  checked: o.readable,
3235
- onChange: (t) => {
3236
- const l = [...r.registers];
3237
- l[d] = { ...l[d], readable: t.target.checked }, c({ ...r, registers: l });
3552
+ onChange: (d) => {
3553
+ const l = [...a.registers];
3554
+ l[t] = { ...l[t], readable: d.target.checked }, c({ ...a, registers: l });
3238
3555
  },
3239
3556
  title: n("protocolConfig.readable", "Readable")
3240
3557
  }
@@ -3244,9 +3561,9 @@ function Me({
3244
3561
  {
3245
3562
  type: "checkbox",
3246
3563
  checked: o.writable,
3247
- onChange: (t) => {
3248
- const l = [...r.registers];
3249
- l[d] = { ...l[d], writable: t.target.checked }, c({ ...r, registers: l });
3564
+ onChange: (d) => {
3565
+ const l = [...a.registers];
3566
+ l[t] = { ...l[t], writable: d.target.checked }, c({ ...a, registers: l });
3250
3567
  },
3251
3568
  title: n("protocolConfig.writable", "Writable")
3252
3569
  }
@@ -3256,22 +3573,22 @@ function Me({
3256
3573
  "button",
3257
3574
  {
3258
3575
  onClick: () => {
3259
- const t = r.registers.filter((l, g) => g !== d);
3260
- c({ ...r, registers: t });
3576
+ const d = a.registers.filter((l, g) => g !== t);
3577
+ c({ ...a, registers: d });
3261
3578
  },
3262
3579
  children: "Γ—"
3263
3580
  }
3264
3581
  ) })
3265
- ] }, d)) })
3582
+ ] }, t)) })
3266
3583
  ] }),
3267
3584
  /* @__PURE__ */ e(
3268
3585
  "button",
3269
3586
  {
3270
3587
  onClick: () => {
3271
3588
  c({
3272
- ...r,
3589
+ ...a,
3273
3590
  registers: [
3274
- ...r.registers,
3591
+ ...a.registers,
3275
3592
  {
3276
3593
  name: "",
3277
3594
  address: 0,
@@ -3288,31 +3605,31 @@ function Me({
3288
3605
  )
3289
3606
  ] });
3290
3607
  }
3291
- function De({ config: r, onChange: i }) {
3292
- const { t: c } = U();
3293
- return /* @__PURE__ */ a("div", { className: "nice-protocol-config__section", children: [
3608
+ function Ee({ config: a, onChange: i }) {
3609
+ const { t: c } = R();
3610
+ return /* @__PURE__ */ r("div", { className: "nice-protocol-config__section", children: [
3294
3611
  /* @__PURE__ */ e("h3", { children: c("protocolConfig.opcUaConfiguration", "OPC-UA Configuration") }),
3295
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__grid", children: [
3296
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field nice-protocol-config__field--full", children: [
3612
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__grid", children: [
3613
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field nice-protocol-config__field--full", children: [
3297
3614
  /* @__PURE__ */ e("label", { children: c("protocolConfig.endpointUrl", "Endpoint URL") }),
3298
3615
  /* @__PURE__ */ e(
3299
3616
  "input",
3300
3617
  {
3301
3618
  type: "text",
3302
- value: r.endpointUrl,
3303
- onChange: (n) => i({ ...r, endpointUrl: n.target.value }),
3619
+ value: a.endpointUrl,
3620
+ onChange: (n) => i({ ...a, endpointUrl: n.target.value }),
3304
3621
  placeholder: c("protocolConfig.endpointUrlPlaceholder", "opc.tcp://localhost:4840")
3305
3622
  }
3306
3623
  )
3307
3624
  ] }),
3308
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3625
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
3309
3626
  /* @__PURE__ */ e("label", { children: c("protocolConfig.securityMode", "Security Mode") }),
3310
- /* @__PURE__ */ a(
3627
+ /* @__PURE__ */ r(
3311
3628
  "select",
3312
3629
  {
3313
- value: r.securityMode,
3630
+ value: a.securityMode,
3314
3631
  onChange: (n) => i({
3315
- ...r,
3632
+ ...a,
3316
3633
  securityMode: n.target.value
3317
3634
  }),
3318
3635
  children: [
@@ -3323,14 +3640,14 @@ function De({ config: r, onChange: i }) {
3323
3640
  }
3324
3641
  )
3325
3642
  ] }),
3326
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3643
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
3327
3644
  /* @__PURE__ */ e("label", { children: c("protocolConfig.authentication", "Authentication") }),
3328
- /* @__PURE__ */ a(
3645
+ /* @__PURE__ */ r(
3329
3646
  "select",
3330
3647
  {
3331
- value: r.authentication,
3648
+ value: a.authentication,
3332
3649
  onChange: (n) => i({
3333
- ...r,
3650
+ ...a,
3334
3651
  authentication: n.target.value
3335
3652
  }),
3336
3653
  children: [
@@ -3341,53 +3658,53 @@ function De({ config: r, onChange: i }) {
3341
3658
  }
3342
3659
  )
3343
3660
  ] }),
3344
- r.authentication === "username" && /* @__PURE__ */ a(E, { children: [
3345
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3661
+ a.authentication === "username" && /* @__PURE__ */ r(D, { children: [
3662
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
3346
3663
  /* @__PURE__ */ e("label", { children: c("protocolConfig.username", "Username") }),
3347
3664
  /* @__PURE__ */ e(
3348
3665
  "input",
3349
3666
  {
3350
3667
  type: "text",
3351
- value: r.username || "",
3352
- onChange: (n) => i({ ...r, username: n.target.value })
3668
+ value: a.username || "",
3669
+ onChange: (n) => i({ ...a, username: n.target.value })
3353
3670
  }
3354
3671
  )
3355
3672
  ] }),
3356
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field", children: [
3673
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field", children: [
3357
3674
  /* @__PURE__ */ e("label", { children: c("protocolConfig.password", "Password") }),
3358
3675
  /* @__PURE__ */ e(
3359
3676
  "input",
3360
3677
  {
3361
3678
  type: "password",
3362
- value: r.password || "",
3363
- onChange: (n) => i({ ...r, password: n.target.value })
3679
+ value: a.password || "",
3680
+ onChange: (n) => i({ ...a, password: n.target.value })
3364
3681
  }
3365
3682
  )
3366
3683
  ] })
3367
3684
  ] }),
3368
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__field nice-protocol-config__field--full", children: [
3685
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__field nice-protocol-config__field--full", children: [
3369
3686
  /* @__PURE__ */ e("label", { children: c("protocolConfig.applicationName", "Application Name") }),
3370
3687
  /* @__PURE__ */ e(
3371
3688
  "input",
3372
3689
  {
3373
3690
  type: "text",
3374
- value: r.applicationName,
3375
- onChange: (n) => i({ ...r, applicationName: n.target.value })
3691
+ value: a.applicationName,
3692
+ onChange: (n) => i({ ...a, applicationName: n.target.value })
3376
3693
  }
3377
3694
  )
3378
3695
  ] })
3379
3696
  ] }),
3380
3697
  /* @__PURE__ */ e("h4", { children: c("protocolConfig.nodes", "Nodes") }),
3381
- /* @__PURE__ */ a("div", { className: "nice-protocol-config__nodes", children: [
3382
- r.nodes.map((n, o) => /* @__PURE__ */ a("div", { className: "nice-protocol-config__node-row", children: [
3698
+ /* @__PURE__ */ r("div", { className: "nice-protocol-config__nodes", children: [
3699
+ a.nodes.map((n, o) => /* @__PURE__ */ r("div", { className: "nice-protocol-config__node-row", children: [
3383
3700
  /* @__PURE__ */ e(
3384
3701
  "input",
3385
3702
  {
3386
3703
  type: "text",
3387
3704
  value: n.nodeId,
3388
- onChange: (d) => {
3389
- const t = [...r.nodes];
3390
- t[o] = { ...t[o], nodeId: d.target.value }, i({ ...r, nodes: t });
3705
+ onChange: (t) => {
3706
+ const d = [...a.nodes];
3707
+ d[o] = { ...d[o], nodeId: t.target.value }, i({ ...a, nodes: d });
3391
3708
  },
3392
3709
  placeholder: c("protocolConfig.nodeIdPlaceholder", "ns=2;s=Temperature")
3393
3710
  }
@@ -3397,9 +3714,9 @@ function De({ config: r, onChange: i }) {
3397
3714
  {
3398
3715
  type: "text",
3399
3716
  value: n.displayName,
3400
- onChange: (d) => {
3401
- const t = [...r.nodes];
3402
- t[o] = { ...t[o], displayName: d.target.value }, i({ ...r, nodes: t });
3717
+ onChange: (t) => {
3718
+ const d = [...a.nodes];
3719
+ d[o] = { ...d[o], displayName: t.target.value }, i({ ...a, nodes: d });
3403
3720
  },
3404
3721
  placeholder: c("protocolConfig.displayNamePlaceholder", "Display Name")
3405
3722
  }
@@ -3408,8 +3725,8 @@ function De({ config: r, onChange: i }) {
3408
3725
  "button",
3409
3726
  {
3410
3727
  onClick: () => {
3411
- const d = r.nodes.filter((t, l) => l !== o);
3412
- i({ ...r, nodes: d });
3728
+ const t = a.nodes.filter((d, l) => l !== o);
3729
+ i({ ...a, nodes: t });
3413
3730
  },
3414
3731
  children: "Γ—"
3415
3732
  }
@@ -3420,9 +3737,9 @@ function De({ config: r, onChange: i }) {
3420
3737
  {
3421
3738
  onClick: () => {
3422
3739
  i({
3423
- ...r,
3740
+ ...a,
3424
3741
  nodes: [
3425
- ...r.nodes,
3742
+ ...a.nodes,
3426
3743
  { nodeId: "", displayName: "", dataType: "Double", read: !0 }
3427
3744
  ]
3428
3745
  });
@@ -3434,7 +3751,7 @@ function De({ config: r, onChange: i }) {
3434
3751
  ] });
3435
3752
  }
3436
3753
  export {
3437
- Ue as NiceEdgeManager,
3438
- Ee as NiceIoTDashboard,
3439
- Ae as NiceProtocolConfig
3754
+ Fe as NiceEdgeManager,
3755
+ Be as NiceIoTDashboard,
3756
+ Oe as NiceProtocolConfig
3440
3757
  };