@esrf/daiquiri-lib 0.0.2-alpha.4 → 0.0.2-alpha.6

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.esm.js CHANGED
@@ -1,31 +1,31 @@
1
- import { jsxs as l, jsx as n, Fragment as S } from "react/jsx-runtime";
2
- import { map as E } from "lodash";
3
- import { Badge as C, ButtonGroup as _, Button as m, OverlayTrigger as F, Popover as v, Container as z, Row as L, Col as D, Form as N, InputGroup as p } from "react-bootstrap";
4
- import { forwardRef as H, useRef as M, useState as O, useEffect as k } from "react";
5
- import x from "classnames";
6
- import K from "debug";
7
- function Y(e) {
1
+ import { jsxs as s, jsx as n, Fragment as v } from "react/jsx-runtime";
2
+ import { map as C, each as fe } from "lodash";
3
+ import { Badge as D, ButtonGroup as re, Button as y, OverlayTrigger as V, Popover as b, Container as _, Row as q, Col as k, Form as N, InputGroup as x, Alert as E, Tab as me, Tabs as X } from "react-bootstrap";
4
+ import { forwardRef as pe, useRef as $, useState as A, useEffect as H, Component as ie, Fragment as we, Children as ge, isValidElement as ye, cloneElement as ve, Suspense as ee, useMemo as be } from "react";
5
+ import L from "classnames";
6
+ import Ne from "debug";
7
+ function Ce(e) {
8
8
  const {
9
9
  activeMessage: t = "Online",
10
10
  inactiveMessage: r = "Offline",
11
- message: a = "This device is"
11
+ message: i = "This device is"
12
12
  } = e;
13
13
  return /* @__PURE__ */ n(
14
14
  "div",
15
15
  {
16
16
  className: `dot-indicator small bg-${e.online ? "success" : "danger"}`,
17
- title: `${a} ${e.online ? t : r}`
17
+ title: `${i} ${e.online ? t : r}`
18
18
  }
19
19
  );
20
20
  }
21
21
  function I(e) {
22
22
  const { name: t, icon: r } = e;
23
- return /* @__PURE__ */ l("div", { className: "icon", title: t, children: [
23
+ return /* @__PURE__ */ s("div", { className: "icon", title: t, children: [
24
24
  /* @__PURE__ */ n("i", { className: `fa ${r}` }),
25
- /* @__PURE__ */ n(Y, { ...e })
25
+ /* @__PURE__ */ n(Ce, { ...e })
26
26
  ] });
27
27
  }
28
- function Z(e) {
28
+ function Oe(e) {
29
29
  const t = {
30
30
  24: "Y",
31
31
  21: "Z",
@@ -43,110 +43,110 @@ function Z(e) {
43
43
  "-18": "a",
44
44
  "-21": "z",
45
45
  "-24": "y"
46
- }, r = Math.log(e) / Math.log(1e3), a = !Number.isInteger(r), o = 3 * Math.ceil(r - (a ? 1 : 0)), i = o === 0 ? "" : t[o];
46
+ }, r = Math.log(e) / Math.log(1e3), i = !Number.isInteger(r), a = 3 * Math.ceil(r - (i ? 1 : 0)), o = a === 0 ? "" : t[a];
47
47
  return {
48
- scalar: e * 10 ** -o,
49
- prefix: i,
50
- multiplier: 10 ** -o
48
+ scalar: e * 10 ** -a,
49
+ prefix: o,
50
+ multiplier: 10 ** -a
51
51
  };
52
52
  }
53
- function J(e) {
53
+ function Se(e) {
54
54
  return e.charAt(0).toUpperCase() + e.slice(1);
55
55
  }
56
- function U(e) {
56
+ function ae(e) {
57
57
  if (e < 60)
58
58
  return `${Math.round(e)} sec`;
59
- const t = Math.round(e / 60), r = t % 60, a = Math.floor(t / 60);
60
- return a ? `${a} hr ${r} min` : `${r} min`;
59
+ const t = Math.round(e / 60), r = t % 60, i = Math.floor(t / 60);
60
+ return i ? `${i} hr ${r} min` : `${r} min`;
61
61
  }
62
- function Q(e) {
62
+ function Ee(e) {
63
63
  return e > 0 ? (662607004e-42 * 299792458 / (e * 1e-10) / 160218e-24 * 1e-3).toFixed(4) : 0;
64
64
  }
65
- function X(e, t) {
65
+ function xe(e, t) {
66
66
  return Number.parseFloat(e.toFixed(t));
67
67
  }
68
- const me = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
68
+ const St = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
69
69
  __proto__: null,
70
- formatEng: Z,
71
- round: X,
72
- toEnergy: Q,
73
- toHoursMins: U,
74
- ucfirst: J
70
+ formatEng: Oe,
71
+ round: xe,
72
+ toEnergy: Ee,
73
+ toHoursMins: ae,
74
+ ucfirst: Se
75
75
  }, Symbol.toStringTag, { value: "Module" }));
76
- function ee(e) {
76
+ function Me(e) {
77
77
  const { hardware: t } = e;
78
- function r(u) {
78
+ function r(d) {
79
79
  t.requestChange({
80
80
  function: "reset"
81
81
  });
82
82
  }
83
- const a = {
83
+ const i = {
84
84
  "Front End": "feitlk",
85
85
  Experimental: "expitlk",
86
86
  PSS: "pssitlk"
87
- }, o = {
87
+ }, a = {
88
88
  Current: `${t.properties.current.toFixed(1)} mA`,
89
89
  Mode: t.properties.mode,
90
- Refill: U(t.properties.refill),
90
+ Refill: ae(t.properties.refill),
91
91
  Message: /* @__PURE__ */ n("pre", { children: t.properties.message })
92
92
  };
93
- function i(u) {
94
- if (!(u in t.properties))
93
+ function o(d) {
94
+ if (!(d in t.properties))
95
95
  return "UNKNOWN";
96
- const d = t.properties[u];
97
- return !d || typeof d != "string" ? "UNKNOWN" : d;
96
+ const l = t.properties[d];
97
+ return !l || typeof l != "string" ? "UNKNOWN" : l;
98
98
  }
99
99
  return /* @__PURE__ */ n(
100
- F,
100
+ V,
101
101
  {
102
102
  trigger: "click",
103
103
  rootClose: !0,
104
- overlay: /* @__PURE__ */ l(v, { id: "popid", children: [
105
- /* @__PURE__ */ l(v.Header, { children: [
104
+ overlay: /* @__PURE__ */ s(b, { id: "popid", children: [
105
+ /* @__PURE__ */ s(b.Header, { children: [
106
106
  t.name,
107
107
  " Details"
108
108
  ] }),
109
- /* @__PURE__ */ l(v.Body, { children: [
109
+ /* @__PURE__ */ s(b.Body, { children: [
110
110
  /* @__PURE__ */ n("h6", { children: "Status" }),
111
111
  /* @__PURE__ */ n("pre", { children: t.properties.status }),
112
112
  /* @__PURE__ */ n("h6", { children: "Interlocks" }),
113
- /* @__PURE__ */ n(z, { children: E(a, (u, d) => /* @__PURE__ */ l(L, { children: [
114
- /* @__PURE__ */ l(D, { children: [
115
- d,
113
+ /* @__PURE__ */ n(_, { children: C(i, (d, l) => /* @__PURE__ */ s(q, { children: [
114
+ /* @__PURE__ */ s(k, { children: [
115
+ l,
116
116
  ":"
117
117
  ] }),
118
- /* @__PURE__ */ n(D, { children: /* @__PURE__ */ n(
119
- C,
118
+ /* @__PURE__ */ n(k, { children: /* @__PURE__ */ n(
119
+ D,
120
120
  {
121
- bg: i(u) === "ON" ? "success" : "danger",
122
- children: i(u)
121
+ bg: o(d) === "ON" ? "success" : "danger",
122
+ children: o(d)
123
123
  }
124
124
  ) })
125
- ] }, d)) }),
125
+ ] }, l)) }),
126
126
  /* @__PURE__ */ n("h6", { children: "Ring Status" }),
127
- /* @__PURE__ */ n(z, { children: E(o, (u, d) => /* @__PURE__ */ l(L, { children: [
128
- /* @__PURE__ */ l(D, { children: [
129
- d,
127
+ /* @__PURE__ */ n(_, { children: C(a, (d, l) => /* @__PURE__ */ s(q, { children: [
128
+ /* @__PURE__ */ s(k, { children: [
129
+ l,
130
130
  ":"
131
131
  ] }),
132
- /* @__PURE__ */ n(D, { children: u })
133
- ] }, d)) }),
134
- /* @__PURE__ */ n("div", { className: "d-grid gap-2", children: /* @__PURE__ */ n(m, { disabled: e.disabled, onClick: r, children: "Reset" }) })
132
+ /* @__PURE__ */ n(k, { children: d })
133
+ ] }, l)) }),
134
+ /* @__PURE__ */ n("div", { className: "d-grid gap-2", children: /* @__PURE__ */ n(y, { disabled: e.disabled, onClick: r, children: "Reset" }) })
135
135
  ] })
136
136
  ] }),
137
- children: /* @__PURE__ */ n(m, { className: "flex-grow-0", title: "Shutter Details", children: /* @__PURE__ */ n("i", { className: "fa fa-ellipsis-h" }) })
137
+ children: /* @__PURE__ */ n(y, { className: "flex-grow-0", title: "Shutter Details", children: /* @__PURE__ */ n("i", { className: "fa fa-ellipsis-h" }) })
138
138
  }
139
139
  );
140
140
  }
141
- function we(e) {
141
+ function Et(e) {
142
142
  const { hardware: t, options: r = {} } = e;
143
- function a(o) {
143
+ function i(a) {
144
144
  t.requestChange({
145
145
  function: t.properties.frontend === "FE open" ? "close" : "open"
146
146
  });
147
147
  }
148
- return /* @__PURE__ */ l("div", { className: "hw-component", children: [
149
- /* @__PURE__ */ l("div", { className: "hw-head", children: [
148
+ return /* @__PURE__ */ s("div", { className: "hw-component", children: [
149
+ /* @__PURE__ */ s("div", { className: "hw-head", children: [
150
150
  /* @__PURE__ */ n(
151
151
  I,
152
152
  {
@@ -157,54 +157,54 @@ function we(e) {
157
157
  ),
158
158
  /* @__PURE__ */ n("div", { className: "name", children: t.name }),
159
159
  /* @__PURE__ */ n(
160
- C,
160
+ D,
161
161
  {
162
162
  bg: t.properties.state === "OPEN" || t.properties.state === "RUNNING" ? "success" : "danger",
163
163
  children: t.properties.state
164
164
  }
165
165
  )
166
166
  ] }),
167
- /* @__PURE__ */ n("div", { className: "hw-content", children: /* @__PURE__ */ l(_, { className: "d-flex", children: [
167
+ /* @__PURE__ */ n("div", { className: "hw-content", children: /* @__PURE__ */ s(re, { className: "d-flex", children: [
168
168
  /* @__PURE__ */ n(
169
- m,
169
+ y,
170
170
  {
171
171
  variant: t.properties.frontend === "FE open" ? "danger" : "success",
172
- onClick: a,
172
+ onClick: i,
173
173
  disabled: e.disabled,
174
174
  children: t.properties.frontend === "FE open" ? "Close" : "Open"
175
175
  }
176
176
  ),
177
- /* @__PURE__ */ n(ee, { ...e })
177
+ /* @__PURE__ */ n(Me, { ...e })
178
178
  ] }) })
179
179
  ] });
180
180
  }
181
- function ge(e) {
181
+ function xt(e) {
182
182
  const { hardware: t, options: r = {} } = e;
183
- function a() {
184
- const o = r.property;
185
- if (o === void 0)
183
+ function i() {
184
+ const a = r.property;
185
+ if (a === void 0)
186
186
  return "property is not set";
187
- if (o === null)
187
+ if (a === null)
188
188
  return "property is null";
189
- let i = t;
190
- for (const u of o.split("/"))
191
- if (i = i[u], i === void 0)
192
- return `property '${o}' not found`;
193
- return `${i}`;
189
+ let o = t;
190
+ for (const d of a.split("/"))
191
+ if (o = o[d], o === void 0)
192
+ return `property '${a}' not found`;
193
+ return `${o}`;
194
194
  }
195
- return /* @__PURE__ */ n(S, { children: a() });
195
+ return /* @__PURE__ */ n(v, { children: i() });
196
196
  }
197
- function A(e) {
197
+ function Y(e) {
198
198
  const { headerMode: t, hardware: r } = e;
199
- function a() {
199
+ function i() {
200
200
  return r.alias ? r.alias : r.name ? r.name : r.id;
201
201
  }
202
- const o = a();
202
+ const a = i();
203
203
  switch (t) {
204
204
  case "front":
205
- return /* @__PURE__ */ n("div", { className: "hw-component", children: /* @__PURE__ */ l("div", { className: "hw-single", children: [
205
+ return /* @__PURE__ */ n("div", { className: "hw-component", children: /* @__PURE__ */ s("div", { className: "hw-single", children: [
206
206
  e.widgetIcon,
207
- /* @__PURE__ */ n("div", { className: "name", children: o }),
207
+ /* @__PURE__ */ n("div", { className: "name", children: a }),
208
208
  /* @__PURE__ */ n("div", { className: "d-inline-block", children: e.widgetContent })
209
209
  ] }) });
210
210
  case "none":
@@ -212,33 +212,33 @@ function A(e) {
212
212
  case "state":
213
213
  return e.widgetState;
214
214
  default:
215
- return /* @__PURE__ */ l("div", { className: "hw-component", children: [
216
- /* @__PURE__ */ l("div", { className: "hw-head", children: [
215
+ return /* @__PURE__ */ s("div", { className: "hw-component", children: [
216
+ /* @__PURE__ */ s("div", { className: "hw-head", children: [
217
217
  e.widgetIcon,
218
- /* @__PURE__ */ n("div", { className: "name", children: /* @__PURE__ */ n(N.Label, { htmlFor: r.id, children: o }) }),
218
+ /* @__PURE__ */ n("div", { className: "name", children: /* @__PURE__ */ n(N.Label, { htmlFor: r.id, children: a }) }),
219
219
  e.widgetState,
220
220
  e.hardware.errors && e.hardware.errors.length > 0 && /* @__PURE__ */ n(
221
- F,
221
+ V,
222
222
  {
223
223
  trigger: "click",
224
224
  placement: "bottom",
225
225
  rootClose: !0,
226
- overlay: /* @__PURE__ */ l(v, { id: e.hardware.id, style: { maxWidth: 500 }, children: [
227
- /* @__PURE__ */ n(v.Header, { children: "Device Errors" }),
228
- /* @__PURE__ */ l(v.Body, { children: [
226
+ overlay: /* @__PURE__ */ s(b, { id: e.hardware.id, style: { maxWidth: 500 }, children: [
227
+ /* @__PURE__ */ n(b.Header, { children: "Device Errors" }),
228
+ /* @__PURE__ */ s(b.Body, { children: [
229
229
  "There were errors with properties on this device:",
230
- /* @__PURE__ */ n("ul", { children: e.hardware.errors.map((i) => /* @__PURE__ */ l("li", { children: [
231
- i.property,
230
+ /* @__PURE__ */ n("ul", { children: e.hardware.errors.map((o) => /* @__PURE__ */ s("li", { children: [
231
+ o.property,
232
232
  ":",
233
- /* @__PURE__ */ l("span", { className: "stack-trace", children: [
234
- i.traceback,
233
+ /* @__PURE__ */ s("span", { className: "stack-trace", children: [
234
+ o.traceback,
235
235
  /* @__PURE__ */ n("br", {}),
236
- i.exception
236
+ o.exception
237
237
  ] })
238
238
  ] })) })
239
239
  ] })
240
240
  ] }),
241
- children: /* @__PURE__ */ n(m, { variant: "danger", size: "sm", children: /* @__PURE__ */ n("i", { className: "fa fa-exclamation-triangle" }) })
241
+ children: /* @__PURE__ */ n(y, { variant: "danger", size: "sm", children: /* @__PURE__ */ n("i", { className: "fa fa-exclamation-triangle" }) })
242
242
  }
243
243
  )
244
244
  ] }),
@@ -246,42 +246,42 @@ function A(e) {
246
246
  ] });
247
247
  }
248
248
  }
249
- function q(e) {
249
+ function W(e) {
250
250
  const t = {
251
251
  display: "inline-block",
252
252
  minWidth: ""
253
253
  };
254
- return e.minWidth && (t.minWidth = `${e.minWidth}em`), /* @__PURE__ */ n("div", { style: t, children: /* @__PURE__ */ n(C, { bg: e.variant, children: e.state }) });
254
+ return e.minWidth && (t.minWidth = `${e.minWidth}em`), /* @__PURE__ */ n("div", { style: t, children: /* @__PURE__ */ n(D, { bg: e.variant, children: e.state }) });
255
255
  }
256
- function W(e) {
256
+ function oe(e) {
257
257
  const { hardware: t } = e;
258
258
  function r() {
259
259
  if (!t.online)
260
260
  return "OFFLINE";
261
- let o = "UNKNOWN";
262
- return e.hardware.properties.state && ([o] = e.hardware.properties.state), o;
261
+ let a = "UNKNOWN";
262
+ return e.hardware.properties.state && ([a] = e.hardware.properties.state), a;
263
263
  }
264
- const a = r();
264
+ const i = r();
265
265
  return /* @__PURE__ */ n(
266
- q,
266
+ W,
267
267
  {
268
- state: a,
268
+ state: i,
269
269
  minWidth: 6,
270
- variant: a === "READY" ? "success" : "warning"
270
+ variant: i === "READY" ? "success" : "warning"
271
271
  }
272
272
  );
273
273
  }
274
- function B(e) {
274
+ function se(e) {
275
275
  const { hardware: t } = e;
276
276
  function r() {
277
277
  if (!t.online)
278
278
  return "OFFLINE";
279
- const i = t.properties.state;
280
- return e.useReadyState && (i === "OPEN" || i === "CLOSED") ? "READY" : i;
279
+ const o = t.properties.state;
280
+ return e.useReadyState && (o === "OPEN" || o === "CLOSED") ? "READY" : o;
281
281
  }
282
- const a = r();
283
- function o() {
284
- switch (a) {
282
+ const i = r();
283
+ function a() {
284
+ switch (i) {
285
285
  case "READY":
286
286
  return "success";
287
287
  case "OPEN":
@@ -300,36 +300,36 @@ function B(e) {
300
300
  return "fatal";
301
301
  }
302
302
  }
303
- return /* @__PURE__ */ n(q, { state: a, minWidth: 6, variant: o() });
303
+ return /* @__PURE__ */ n(W, { state: i, minWidth: 6, variant: a() });
304
304
  }
305
- const ve = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
305
+ const Mt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
306
306
  __proto__: null,
307
- HardwareState: q,
308
- MotorState: W,
309
- ShutterState: B
310
- }, Symbol.toStringTag, { value: "Module" })), te = H((e, t) => {
311
- const r = M(null), [a, o] = O(e.step), i = (h) => {
312
- const R = t;
307
+ HardwareState: W,
308
+ MotorState: oe,
309
+ ShutterState: se
310
+ }, Symbol.toStringTag, { value: "Module" })), Ae = pe((e, t) => {
311
+ const r = $(null), [i, a] = A(e.step), o = (g) => {
312
+ const z = t;
313
313
  if (r.current === null)
314
314
  return;
315
- let $ = Number.parseFloat(R.current.value);
316
- const P = Number.parseFloat(r.current.value);
317
- $ += h ? P : -P, R.current.value = `${$}`, e.onStep && e.onStep({
318
- target: R.current
315
+ let J = Number.parseFloat(z.current.value);
316
+ const Q = Number.parseFloat(r.current.value);
317
+ J += g ? Q : -Q, z.current.value = `${J}`, e.onStep && e.onStep({
318
+ target: z.current
319
319
  });
320
320
  }, {
321
- onStep: u,
322
- step: d,
323
- overlay: g,
324
- incIcon: w,
325
- decIcon: s,
326
- swapIncDec: c,
327
- onKeyDown: f,
328
- horizontalArrows: y,
329
- largeArrows: V,
330
- ...b
331
- } = e, T = (h) => {
332
- h.key === "ArrowUp" ? (h.preventDefault(), i(!0)) : h.key === "ArrowDown" ? (h.preventDefault(), i(!1)) : f && f(h);
321
+ onStep: d,
322
+ step: l,
323
+ overlay: h,
324
+ incIcon: u,
325
+ decIcon: c,
326
+ swapIncDec: f,
327
+ onKeyDown: m,
328
+ horizontalArrows: M,
329
+ largeArrows: K,
330
+ ...S
331
+ } = e, Z = (g) => {
332
+ g.key === "ArrowUp" ? (g.preventDefault(), o(!0)) : g.key === "ArrowDown" ? (g.preventDefault(), o(!1)) : m && m(g);
333
333
  };
334
334
  if (!e.step)
335
335
  return /* @__PURE__ */ n(
@@ -338,127 +338,127 @@ const ve = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
338
338
  ref: t,
339
339
  type: "number",
340
340
  step: "any",
341
- onKeyDown: T,
342
- ...b
341
+ onKeyDown: Z,
342
+ ...S
343
343
  }
344
344
  );
345
- const j = E(e.steps || [e.step], (h) => /* @__PURE__ */ n("option", { value: h, children: h }, h));
345
+ const he = C(e.steps || [e.step], (g) => /* @__PURE__ */ n("option", { value: g, children: g }, g));
346
346
  return /* @__PURE__ */ n(
347
347
  "div",
348
348
  {
349
- className: x("numeric-step", {
350
- "numeric-step-large": V,
351
- "numeric-step-horizontal": y
349
+ className: L("numeric-step", {
350
+ "numeric-step-large": K,
351
+ "numeric-step-horizontal": M
352
352
  }),
353
- children: /* @__PURE__ */ l(p, { children: [
353
+ children: /* @__PURE__ */ s(x, { children: [
354
354
  /* @__PURE__ */ n(
355
355
  N.Control,
356
356
  {
357
- onKeyDown: T,
357
+ onKeyDown: Z,
358
358
  ref: t,
359
359
  type: "number",
360
360
  step: "any",
361
- ...b
361
+ ...S
362
362
  }
363
363
  ),
364
- /* @__PURE__ */ l(S, { children: [
365
- g,
366
- !g && /* @__PURE__ */ l(p.Text, { className: "d-flex flex-column", children: [
364
+ /* @__PURE__ */ s(v, { children: [
365
+ h,
366
+ !h && /* @__PURE__ */ s(x.Text, { className: "d-flex flex-column", children: [
367
367
  /* @__PURE__ */ n(
368
368
  N.Control,
369
369
  {
370
370
  ref: r,
371
371
  as: "select",
372
372
  className: "step-size",
373
- defaultValue: a,
374
- onChange: (h) => o(Number.parseFloat(h.target.value)),
375
- children: j
373
+ defaultValue: i,
374
+ onChange: (g) => a(Number.parseFloat(g.target.value)),
375
+ children: he
376
376
  }
377
377
  ),
378
378
  e.unit && /* @__PURE__ */ n("div", { children: e.unit }),
379
- !w && !s && /* @__PURE__ */ l(S, { children: [
379
+ !u && !c && /* @__PURE__ */ s(v, { children: [
380
380
  /* @__PURE__ */ n(
381
- m,
381
+ y,
382
382
  {
383
383
  className: "step step-up",
384
384
  disabled: e.disabled,
385
- onClick: (h) => i(!0)
385
+ onClick: (g) => o(!0)
386
386
  }
387
387
  ),
388
388
  /* @__PURE__ */ n(
389
- m,
389
+ y,
390
390
  {
391
391
  className: "step step-down",
392
392
  disabled: e.disabled,
393
- onClick: (h) => i(!1)
393
+ onClick: (g) => o(!1)
394
394
  }
395
395
  )
396
396
  ] })
397
397
  ] }),
398
- s && c && /* @__PURE__ */ n(m, { disabled: e.disabled, onClick: (h) => i(!1), children: /* @__PURE__ */ n("i", { className: `fa fa-fw fa-${s}` }) }),
399
- w && /* @__PURE__ */ n(m, { disabled: e.disabled, onClick: (h) => i(!0), children: /* @__PURE__ */ n("i", { className: `fa fa-fw fa-${w}` }) }),
400
- s && !c && /* @__PURE__ */ n(m, { disabled: e.disabled, onClick: (h) => i(!1), children: /* @__PURE__ */ n("i", { className: `fa fa-fw fa-${s}` }) })
398
+ c && f && /* @__PURE__ */ n(y, { disabled: e.disabled, onClick: (g) => o(!1), children: /* @__PURE__ */ n("i", { className: `fa fa-fw fa-${c}` }) }),
399
+ u && /* @__PURE__ */ n(y, { disabled: e.disabled, onClick: (g) => o(!0), children: /* @__PURE__ */ n("i", { className: `fa fa-fw fa-${u}` }) }),
400
+ c && !f && /* @__PURE__ */ n(y, { disabled: e.disabled, onClick: (g) => o(!1), children: /* @__PURE__ */ n("i", { className: `fa fa-fw fa-${c}` }) })
401
401
  ] })
402
402
  ] })
403
403
  }
404
404
  );
405
- }), ne = te;
406
- function re(e) {
407
- const t = M(null), [r, a] = O(!1), [o, i] = O(!1);
408
- k(() => {
409
- t.current && (e.hardwareValue === null ? t.current.value = "" : t.current.value = e.hardwareValue.toString(), a(!1));
405
+ }), Ie = Ae;
406
+ function ke(e) {
407
+ const t = $(null), [r, i] = A(!1), [a, o] = A(!1);
408
+ H(() => {
409
+ t.current && (e.hardwareValue === null ? t.current.value = "" : t.current.value = e.hardwareValue.toString(), i(!1));
410
410
  }, [e.hardwareValue]);
411
- function u(c) {
412
- let f = c;
413
- e.precision !== void 0 && (f = Number.parseFloat(f).toFixed(e.precision)), t != null && t.current && (t.current.value = f);
411
+ function d(f) {
412
+ let m = f;
413
+ e.precision !== void 0 && (m = Number.parseFloat(m).toFixed(e.precision)), t != null && t.current && (t.current.value = m);
414
414
  }
415
- function d() {
415
+ function l() {
416
416
  r && setTimeout(() => {
417
- u(e.hardwareValue), a(!1);
417
+ d(e.hardwareValue), i(!1);
418
418
  }, 3e3);
419
419
  }
420
- function g(c) {
421
- e.hardwareValue !== null && (a(!0), t != null && t.current && (t.current.value = c.target.value), c.target.value === e.hardwareValue.toString() && a(!1));
420
+ function h(f) {
421
+ e.hardwareValue !== null && (i(!0), t != null && t.current && (t.current.value = f.target.value), f.target.value === e.hardwareValue.toString() && i(!1));
422
422
  }
423
- function w(c) {
424
- a(!1), e.onMoveRequested(c.target.value);
423
+ function u(f) {
424
+ i(!1), e.onMoveRequested(f.target.value);
425
425
  }
426
- function s(c) {
427
- switch (c.key) {
426
+ function c(f) {
427
+ switch (f.key) {
428
428
  case "Enter":
429
429
  {
430
- a(!1);
431
- const f = Number.parseFloat(c.target.value), y = e.onMoveRequested(f);
432
- y && y.catch(() => {
433
- i(!0), setTimeout(() => {
434
- u(e.hardwareValue), i(!1);
430
+ i(!1);
431
+ const m = Number.parseFloat(f.target.value), M = e.onMoveRequested(m);
432
+ M && M.catch(() => {
433
+ o(!0), setTimeout(() => {
434
+ d(e.hardwareValue), o(!1);
435
435
  }, 2e3);
436
436
  });
437
437
  }
438
- c.preventDefault(), c.stopPropagation();
438
+ f.preventDefault(), f.stopPropagation();
439
439
  break;
440
440
  case "Esc":
441
441
  case "Escape":
442
- r && (i(!1), a(!1), u(e.hardwareValue)), c.target.blur(), c.preventDefault(), c.stopPropagation();
442
+ r && (o(!1), i(!1), d(e.hardwareValue)), f.target.blur(), f.preventDefault(), f.stopPropagation();
443
443
  break;
444
444
  }
445
445
  }
446
446
  return /* @__PURE__ */ n(
447
- ne,
447
+ Ie,
448
448
  {
449
449
  id: e.id,
450
- className: x({
450
+ className: L({
451
451
  "form-control-edited": r,
452
- "form-control-error": o,
452
+ "form-control-error": a,
453
453
  "hw-moving": e.hardwareIsMoving
454
454
  }),
455
455
  type: e.readOnly ? "text" : "number",
456
456
  ref: t,
457
457
  precision: e.precision,
458
- onChange: g,
459
- onBlur: d,
460
- onStep: w,
461
- onKeyDown: s,
458
+ onChange: h,
459
+ onBlur: l,
460
+ onStep: u,
461
+ onKeyDown: c,
462
462
  disabled: e.hardwareIsDisabled || e.readOnly || !e.hardwareIsReady,
463
463
  step: e.step,
464
464
  steps: e.steps,
@@ -467,154 +467,154 @@ function re(e) {
467
467
  swapIncDec: e.swapIncDec,
468
468
  horizontalArrows: e.horizontalArrows,
469
469
  largeArrows: e.largeArrows,
470
- overlay: e.hardwareIsMoving && !e.hardwareIsDisabled ? /* @__PURE__ */ n(m, { variant: "danger", onClick: e.onAbortRequested, children: /* @__PURE__ */ n("i", { className: "fa fa-times" }) }) : null
470
+ overlay: e.hardwareIsMoving && !e.hardwareIsDisabled ? /* @__PURE__ */ n(y, { variant: "danger", onClick: e.onAbortRequested, children: /* @__PURE__ */ n("i", { className: "fa fa-times" }) }) : null
471
471
  }
472
472
  );
473
473
  }
474
- function G(e) {
475
- const t = M(null), [r, a] = O(!1), [o, i] = O(!1);
476
- function u(s) {
477
- return e.precision !== void 0 ? Number.parseFloat(s).toFixed(e.precision) : s;
474
+ function te(e) {
475
+ const t = $(null), [r, i] = A(!1), [a, o] = A(!1);
476
+ function d(c) {
477
+ return e.precision !== void 0 ? Number.parseFloat(c).toFixed(e.precision) : c;
478
478
  }
479
- k(() => {
480
- var s;
481
- t.current && (t.current.value = u((s = e.hardwareValue) == null ? void 0 : s.toString()), a(!1));
479
+ H(() => {
480
+ var c;
481
+ t.current && (t.current.value = d((c = e.hardwareValue) == null ? void 0 : c.toString()), i(!1));
482
482
  }, [e.hardwareValue, e.precision]);
483
- function d(s) {
484
- const c = u(s);
485
- t != null && t.current && (t.current.value = c);
483
+ function l(c) {
484
+ const f = d(c);
485
+ t != null && t.current && (t.current.value = f);
486
486
  }
487
- function g(s) {
488
- switch (s.key) {
487
+ function h(c) {
488
+ switch (c.key) {
489
489
  case "Enter": {
490
- a(!1);
491
- const c = Number.parseFloat(s.target.value), f = e.onMoveRequested(c);
492
- f && f.catch(() => {
493
- i(!0), setTimeout(() => {
494
- d(e.hardwareValue), i(!1);
490
+ i(!1);
491
+ const f = Number.parseFloat(c.target.value), m = e.onMoveRequested(f);
492
+ m && m.catch(() => {
493
+ o(!0), setTimeout(() => {
494
+ l(e.hardwareValue), o(!1);
495
495
  }, 2e3);
496
- }), s.preventDefault(), s.stopPropagation();
496
+ }), c.preventDefault(), c.stopPropagation();
497
497
  break;
498
498
  }
499
499
  case "Esc":
500
500
  case "Escape":
501
- r && (i(!1), a(!1), d(e.hardwareValue)), s.target.blur(), s.preventDefault(), s.stopPropagation();
501
+ r && (o(!1), i(!1), l(e.hardwareValue)), c.target.blur(), c.preventDefault(), c.stopPropagation();
502
502
  break;
503
503
  }
504
504
  }
505
- function w(s) {
506
- a(!0), s.target, t != null && t.current && (t.current.value = s.target.value), s.target.value === e.hardwareValue.toString() && a(!1);
505
+ function u(c) {
506
+ i(!0), c.target, t != null && t.current && (t.current.value = c.target.value), c.target.value === e.hardwareValue.toString() && i(!1);
507
507
  }
508
508
  return /* @__PURE__ */ n(
509
509
  N.Control,
510
510
  {
511
- className: x({
511
+ className: L({
512
512
  "form-control-edited": r,
513
- "form-control-error": o,
513
+ "form-control-error": a,
514
514
  "hw-moving": e.hardwareIsMoving
515
515
  }),
516
516
  type: "number",
517
517
  ref: t,
518
- onChange: w,
519
- onKeyDown: g,
518
+ onChange: u,
519
+ onKeyDown: h,
520
520
  disabled: e.readOnly || e.hardwareIsMoving || e.hardwareIsDisabled,
521
521
  step: e.step
522
522
  }
523
523
  );
524
524
  }
525
- function ae(e) {
526
- function t(o) {
525
+ function De(e) {
526
+ function t(a) {
527
527
  return e.hardware.requestChange({
528
528
  property: "velocity",
529
- value: o
529
+ value: a
530
530
  });
531
531
  }
532
- function r(o) {
532
+ function r(a) {
533
533
  return e.hardware.requestChange({
534
534
  property: "acceleration",
535
- value: o
535
+ value: a
536
536
  });
537
537
  }
538
- let a = "UNKNOWN";
539
- return e.hardware.properties.state && ([a] = e.hardware.properties.state), /* @__PURE__ */ n(
540
- F,
538
+ let i = "UNKNOWN";
539
+ return e.hardware.properties.state && ([i] = e.hardware.properties.state), /* @__PURE__ */ n(
540
+ V,
541
541
  {
542
542
  trigger: "click",
543
543
  rootClose: !0,
544
- overlay: /* @__PURE__ */ l(v, { id: "popid", children: [
545
- /* @__PURE__ */ l(v.Header, { children: [
544
+ overlay: /* @__PURE__ */ s(b, { id: "popid", children: [
545
+ /* @__PURE__ */ s(b.Header, { children: [
546
546
  e.hardware.name,
547
547
  " details"
548
548
  ] }),
549
- /* @__PURE__ */ l(v.Body, { children: [
550
- /* @__PURE__ */ l(N.Group, { children: [
549
+ /* @__PURE__ */ s(b.Body, { children: [
550
+ /* @__PURE__ */ s(N.Group, { children: [
551
551
  /* @__PURE__ */ n(N.Label, { children: "Velocity" }),
552
552
  /* @__PURE__ */ n(
553
- G,
553
+ te,
554
554
  {
555
555
  hardwareValue: e.hardware.properties.velocity,
556
556
  onMoveRequested: t,
557
557
  hardwareIsDisabled: e.disabled,
558
- hardwareIsReady: a === "READY",
559
- hardwareIsMoving: a === "MOVING",
558
+ hardwareIsReady: i === "READY",
559
+ hardwareIsMoving: i === "MOVING",
560
560
  readOnly: e.readOnly
561
561
  }
562
562
  )
563
563
  ] }),
564
- /* @__PURE__ */ l(N.Group, { children: [
564
+ /* @__PURE__ */ s(N.Group, { children: [
565
565
  /* @__PURE__ */ n(N.Label, { children: "Acceleration" }),
566
566
  /* @__PURE__ */ n(
567
- G,
567
+ te,
568
568
  {
569
569
  hardwareValue: e.hardware.properties.acceleration,
570
570
  onMoveRequested: r,
571
571
  hardwareIsDisabled: e.disabled,
572
- hardwareIsReady: a === "READY",
573
- hardwareIsMoving: a === "MOVING",
572
+ hardwareIsReady: i === "READY",
573
+ hardwareIsMoving: i === "MOVING",
574
574
  readOnly: e.readOnly
575
575
  }
576
576
  )
577
577
  ] })
578
578
  ] })
579
579
  ] }),
580
- children: /* @__PURE__ */ n(m, { children: /* @__PURE__ */ n("i", { className: "fa fa-ellipsis-h" }) })
580
+ children: /* @__PURE__ */ n(y, { children: /* @__PURE__ */ n("i", { className: "fa fa-ellipsis-h" }) })
581
581
  }
582
582
  );
583
583
  }
584
- function Ne(e) {
584
+ function At(e) {
585
585
  const { hardware: t, options: r = {} } = e;
586
- function a() {
586
+ function i() {
587
587
  t.requestChange({
588
588
  function: "stop"
589
589
  });
590
590
  }
591
- function o(w) {
591
+ function a(u) {
592
592
  return t.requestChange({
593
593
  property: "position",
594
- value: w,
594
+ value: u,
595
595
  function: "move"
596
596
  });
597
597
  }
598
- let i = "UNKNOWN";
599
- e.hardware.properties.state && ([i] = e.hardware.properties.state);
600
- const u = /* @__PURE__ */ n(I, { name: "Motor", icon: "fam-hardware-motor", online: t.online }), d = /* @__PURE__ */ n(W, { hardware: t }), g = e.options ? e.options.header : "top";
598
+ let o = "UNKNOWN";
599
+ e.hardware.properties.state && ([o] = e.hardware.properties.state);
600
+ const d = /* @__PURE__ */ n(I, { name: "Motor", icon: "fam-hardware-motor", online: t.online }), l = /* @__PURE__ */ n(oe, { hardware: t }), h = e.options ? e.options.header : "top";
601
601
  return /* @__PURE__ */ n(
602
- A,
602
+ Y,
603
603
  {
604
604
  hardware: t,
605
- widgetIcon: u,
606
- widgetState: d,
607
- widgetContent: /* @__PURE__ */ l(p, { children: [
605
+ widgetIcon: d,
606
+ widgetState: l,
607
+ widgetContent: /* @__PURE__ */ s(x, { children: [
608
608
  /* @__PURE__ */ n(
609
- re,
609
+ ke,
610
610
  {
611
611
  id: t.id,
612
612
  hardwareValue: t.properties.position,
613
613
  hardwareIsDisabled: e.disabled,
614
- hardwareIsReady: i === "READY",
615
- hardwareIsMoving: i === "MOVING",
616
- onMoveRequested: o,
617
- onAbortRequested: a,
614
+ hardwareIsReady: o === "READY",
615
+ hardwareIsMoving: o === "MOVING",
616
+ onMoveRequested: a,
617
+ onAbortRequested: i,
618
618
  precision: r.precision,
619
619
  readOnly: r.readOnly,
620
620
  step: r.step,
@@ -626,48 +626,48 @@ function Ne(e) {
626
626
  largeArrows: r.largearrows
627
627
  }
628
628
  ),
629
- t.properties.unit && /* @__PURE__ */ n(p.Text, { children: t.properties.unit }),
630
- i !== "MOVING" && r.extended && /* @__PURE__ */ n(
631
- ae,
629
+ t.properties.unit && /* @__PURE__ */ n(x.Text, { children: t.properties.unit }),
630
+ o !== "MOVING" && r.extended && /* @__PURE__ */ n(
631
+ De,
632
632
  {
633
633
  hardware: t,
634
634
  disabled: e.disabled,
635
635
  readOnly: r.readOnly
636
636
  }
637
637
  ),
638
- i === "MOVING" && !e.disabled && !r.step && /* @__PURE__ */ n(m, { variant: "danger", onClick: a, children: /* @__PURE__ */ n("i", { className: "fa fa-times" }) })
638
+ o === "MOVING" && !e.disabled && !r.step && /* @__PURE__ */ n(y, { variant: "danger", onClick: i, children: /* @__PURE__ */ n("i", { className: "fa fa-times" }) })
639
639
  ] }),
640
- headerMode: g
640
+ headerMode: h
641
641
  }
642
642
  );
643
643
  }
644
- function be(e) {
645
- const { hardware: t, options: r = {} } = e, a = M(null);
646
- k(() => {
647
- if (!a.current) {
644
+ function It(e) {
645
+ const { hardware: t, options: r = {} } = e, i = $(null);
646
+ H(() => {
647
+ if (!i.current) {
648
648
  console.error("selectionRef ref is unset");
649
649
  return;
650
650
  }
651
- a.current.value = t.properties.position;
651
+ i.current.value = t.properties.position;
652
652
  }, [t.properties.position]);
653
- function o(d) {
654
- if (console.debug("change", d), !a || !a.current) {
653
+ function a(l) {
654
+ if (console.debug("change", l), !i || !i.current) {
655
655
  console.error("selection ref is unset");
656
656
  return;
657
657
  }
658
658
  t.requestChange({
659
- value: a.current.value,
659
+ value: i.current.value,
660
660
  function: "move"
661
661
  });
662
662
  }
663
- function i(d) {
663
+ function o(l) {
664
664
  t.requestChange({
665
665
  function: "stop"
666
666
  });
667
667
  }
668
- const u = E(t.properties.positions, (d) => /* @__PURE__ */ n("option", { title: d.description, children: d.position }, d.position));
669
- return /* @__PURE__ */ l("div", { className: "hw-component", children: [
670
- /* @__PURE__ */ l("div", { className: "hw-head", children: [
668
+ const d = C(t.properties.positions, (l) => /* @__PURE__ */ n("option", { title: l.description, children: l.position }, l.position));
669
+ return /* @__PURE__ */ s("div", { className: "hw-component", children: [
670
+ /* @__PURE__ */ s("div", { className: "hw-head", children: [
671
671
  /* @__PURE__ */ n(
672
672
  I,
673
673
  {
@@ -678,42 +678,42 @@ function be(e) {
678
678
  ),
679
679
  /* @__PURE__ */ n("div", { className: "name", children: t.name }),
680
680
  /* @__PURE__ */ n(
681
- C,
681
+ D,
682
682
  {
683
683
  bg: t.properties.state === "READY" ? "success" : "warning",
684
684
  children: t.properties.state
685
685
  }
686
686
  )
687
687
  ] }),
688
- /* @__PURE__ */ n("div", { className: "hw-content", children: /* @__PURE__ */ l(p, { children: [
689
- /* @__PURE__ */ l(
688
+ /* @__PURE__ */ n("div", { className: "hw-content", children: /* @__PURE__ */ s(x, { children: [
689
+ /* @__PURE__ */ s(
690
690
  N.Control,
691
691
  {
692
692
  className: "custom-select",
693
693
  as: "select",
694
- ref: a,
694
+ ref: i,
695
695
  disabled: e.disabled,
696
696
  defaultValue: t.properties.position,
697
697
  children: [
698
698
  /* @__PURE__ */ n("option", { disabled: !0, children: "unknown" }),
699
- u
699
+ d
700
700
  ]
701
701
  }
702
702
  ),
703
- t.properties.state !== "MOVING" && /* @__PURE__ */ n(m, { onClick: o, disabled: e.disabled, children: "Move" }),
704
- t.properties.state === "MOVING" && !e.disabled && /* @__PURE__ */ n(m, { variant: "danger", onClick: i, children: /* @__PURE__ */ n("i", { className: "fa fa-times" }) })
703
+ t.properties.state !== "MOVING" && /* @__PURE__ */ n(y, { onClick: a, disabled: e.disabled, children: "Move" }),
704
+ t.properties.state === "MOVING" && !e.disabled && /* @__PURE__ */ n(y, { variant: "danger", onClick: o, children: /* @__PURE__ */ n("i", { className: "fa fa-times" }) })
705
705
  ] }) })
706
706
  ] });
707
707
  }
708
- const ie = K("daiquiri.components.hardware.NoObject");
709
- function pe(e) {
708
+ const $e = Ne("daiquiri.components.hardware.NoObject");
709
+ function kt(e) {
710
710
  if (e.options.emptyifnone)
711
- return ie(
711
+ return $e(
712
712
  'Component id:"%s" name:"%s" not displayed cause setup with emptyifnone.',
713
713
  e.id,
714
714
  e.name
715
- ), /* @__PURE__ */ n(S, {});
716
- const t = /* @__PURE__ */ n(I, { name: "NoObject", icon: "fam-hardware-any", online: !1 }), r = /* @__PURE__ */ n(S, {}), a = /* @__PURE__ */ n(S, { children: "Missing" }), o = e.options ? e.options.header : "top", i = {
715
+ ), /* @__PURE__ */ n(v, {});
716
+ const t = /* @__PURE__ */ n(I, { name: "NoObject", icon: "fam-hardware-any", online: !1 }), r = /* @__PURE__ */ n(v, {}), i = /* @__PURE__ */ n(v, { children: "Missing" }), a = e.options ? e.options.header : "top", o = {
717
717
  id: e.id,
718
718
  name: e.name ?? "",
719
719
  alias: null,
@@ -722,103 +722,103 @@ function pe(e) {
722
722
  type: ""
723
723
  };
724
724
  return /* @__PURE__ */ n(
725
- A,
725
+ Y,
726
726
  {
727
- hardware: i,
727
+ hardware: o,
728
728
  widgetIcon: t,
729
729
  widgetState: r,
730
- widgetContent: a,
731
- headerMode: o
730
+ widgetContent: i,
731
+ headerMode: a
732
732
  }
733
733
  );
734
734
  }
735
- function oe(e) {
735
+ function Fe(e) {
736
736
  const t = e.online ? "READY" : "OFFLINE";
737
- return /* @__PURE__ */ n(C, { bg: t === "READY" ? "success" : "warning", children: t });
737
+ return /* @__PURE__ */ n(D, { bg: t === "READY" ? "success" : "warning", children: t });
738
738
  }
739
- function ye(e) {
740
- const { hardware: t, options: r = {} } = e, a = /* @__PURE__ */ n(I, { name: "Optic", icon: "fa-cog", online: t.online }), o = /* @__PURE__ */ n(oe, { ...t });
741
- function i() {
742
- const s = r.property;
743
- if (s === void 0)
739
+ function Dt(e) {
740
+ const { hardware: t, options: r = {} } = e, i = /* @__PURE__ */ n(I, { name: "Optic", icon: "fa-cog", online: t.online }), a = /* @__PURE__ */ n(Fe, { ...t });
741
+ function o() {
742
+ const c = r.property;
743
+ if (c === void 0)
744
744
  return "property is not set";
745
- if (s === null)
745
+ if (c === null)
746
746
  return "property is null";
747
- let c = t;
748
- for (const f of s.split("/"))
749
- if (c = c[f], c === void 0)
750
- return `property '${s}' not found`;
751
- return `${c}`;
752
- }
753
- function u() {
754
- const s = r.unit;
755
- if (!s)
747
+ let f = t;
748
+ for (const m of c.split("/"))
749
+ if (f = f[m], f === void 0)
750
+ return `property '${c}' not found`;
751
+ return `${f}`;
752
+ }
753
+ function d() {
754
+ const c = r.unit;
755
+ if (!c)
756
756
  return null;
757
- if (!s.includes("properties"))
758
- return s;
759
- let c = e;
760
- for (const f of s.split("/"))
761
- if (c = c[f], c === void 0)
757
+ if (!c.includes("properties"))
758
+ return c;
759
+ let f = e;
760
+ for (const m of c.split("/"))
761
+ if (f = f[m], f === void 0)
762
762
  return null;
763
- return `${c}`;
763
+ return `${f}`;
764
764
  }
765
- const d = u(), g = /* @__PURE__ */ l(p, { children: [
766
- /* @__PURE__ */ n(N.Control, { value: i(), readOnly: !0 }),
767
- d && /* @__PURE__ */ n(p.Text, { children: d })
768
- ] }), w = e.options.header || "top";
765
+ const l = d(), h = /* @__PURE__ */ s(x, { children: [
766
+ /* @__PURE__ */ n(N.Control, { value: o(), readOnly: !0 }),
767
+ l && /* @__PURE__ */ n(x.Text, { children: l })
768
+ ] }), u = e.options.header || "top";
769
769
  return /* @__PURE__ */ n(
770
- A,
770
+ Y,
771
771
  {
772
772
  hardware: t,
773
- widgetIcon: a,
774
- widgetState: o,
775
- widgetContent: g,
776
- headerMode: w
773
+ widgetIcon: i,
774
+ widgetState: a,
775
+ widgetContent: h,
776
+ headerMode: u
777
777
  }
778
778
  );
779
779
  }
780
- function se(e) {
780
+ function Re(e) {
781
781
  const { hardware: t } = e, r = () => {
782
782
  t.requestChange({
783
783
  function: "reset"
784
784
  });
785
785
  };
786
786
  return /* @__PURE__ */ n(
787
- F,
787
+ V,
788
788
  {
789
789
  trigger: "click",
790
790
  rootClose: !0,
791
- overlay: /* @__PURE__ */ l(v, { id: "popid", children: [
792
- /* @__PURE__ */ l(v.Header, { children: [
791
+ overlay: /* @__PURE__ */ s(b, { id: "popid", children: [
792
+ /* @__PURE__ */ s(b.Header, { children: [
793
793
  t.name,
794
794
  " Details"
795
795
  ] }),
796
- /* @__PURE__ */ l(v.Body, { children: [
796
+ /* @__PURE__ */ s(b.Body, { children: [
797
797
  /* @__PURE__ */ n("h6", { children: "Status" }),
798
798
  /* @__PURE__ */ n("pre", { children: t.properties.status }),
799
- /* @__PURE__ */ n("div", { className: "d-grid gap-2", children: /* @__PURE__ */ n(m, { onClick: r, disabled: e.disabled, children: "Reset" }) })
799
+ /* @__PURE__ */ n("div", { className: "d-grid gap-2", children: /* @__PURE__ */ n(y, { onClick: r, disabled: e.disabled, children: "Reset" }) })
800
800
  ] })
801
801
  ] }),
802
- children: /* @__PURE__ */ n(m, { className: "flex-grow-0", title: "Shutter Details", children: /* @__PURE__ */ n("i", { className: "fa fa-ellipsis-h" }) })
802
+ children: /* @__PURE__ */ n(y, { className: "flex-grow-0", title: "Shutter Details", children: /* @__PURE__ */ n("i", { className: "fa fa-ellipsis-h" }) })
803
803
  }
804
804
  );
805
805
  }
806
- function Se(e) {
807
- const { hardware: t, options: r = {} } = e, a = /* @__PURE__ */ n(
806
+ function $t(e) {
807
+ const { hardware: t, options: r = {} } = e, i = /* @__PURE__ */ n(
808
808
  I,
809
809
  {
810
810
  name: "Shutter",
811
811
  icon: "fam-hardware-shutter",
812
812
  online: t.online
813
813
  }
814
- ), o = /* @__PURE__ */ n(B, { hardware: t });
815
- function i() {
814
+ ), a = /* @__PURE__ */ n(se, { hardware: t });
815
+ function o() {
816
816
  return t.properties ? t.properties.state : "UNKNOWN";
817
817
  }
818
- function u(b) {
819
- return b === "OPEN" ? ["Close", "close"] : b === "CLOSED" ? ["Open", "open"] : b === "DISABLED" || b === "STANDBY" || b === "FAULT" ? ["Closed", ""] : b === "MOVING" ? ["...", ""] : ["Unknown", ""];
818
+ function d(S) {
819
+ return S === "OPEN" ? ["Close", "close"] : S === "CLOSED" ? ["Open", "open"] : S === "DISABLED" || S === "STANDBY" || S === "FAULT" ? ["Closed", ""] : S === "MOVING" ? ["...", ""] : ["Unknown", ""];
820
820
  }
821
- const d = i(), [g, w] = u(d), c = {
821
+ const l = o(), [h, u] = d(l), f = {
822
822
  OPEN: "danger",
823
823
  CLOSED: "success",
824
824
  MOVING: "warning",
@@ -826,49 +826,58 @@ function Se(e) {
826
826
  STANDBY: "danger",
827
827
  FAULT: "fatal",
828
828
  UNKNOWN: "warning"
829
- }[d] || "danger";
830
- function f() {
829
+ }[l] || "danger";
830
+ function m() {
831
831
  t.requestChange({
832
- function: w
832
+ function: u
833
833
  });
834
834
  }
835
- const y = /* @__PURE__ */ l(_, { className: "d-flex flex-nowrap", children: [
835
+ const M = /* @__PURE__ */ s(re, { className: "d-flex flex-nowrap", children: [
836
836
  /* @__PURE__ */ n(
837
- m,
837
+ y,
838
838
  {
839
- variant: c,
840
- onClick: f,
841
- disabled: e.disabled || w === "",
842
- children: g
839
+ variant: f,
840
+ onClick: m,
841
+ disabled: e.disabled || u === "",
842
+ children: h
843
843
  }
844
844
  ),
845
- r.extended && /* @__PURE__ */ n(se, { ...e })
846
- ] }), V = e.options.header || "top";
845
+ r.extended && /* @__PURE__ */ n(Re, { ...e })
846
+ ] }), K = e.options.header || "top";
847
847
  return /* @__PURE__ */ n(
848
- A,
848
+ Y,
849
849
  {
850
850
  hardware: t,
851
- widgetIcon: a,
852
- widgetState: o,
853
- widgetContent: y,
854
- headerMode: V
851
+ widgetIcon: i,
852
+ widgetState: a,
853
+ widgetContent: M,
854
+ headerMode: K
855
855
  }
856
856
  );
857
857
  }
858
- function Oe(e) {
859
- const [t, r] = O({}), a = M(null);
860
- return k(() => {
861
- if (a.current) {
862
- const o = a.current;
858
+ class Ft extends ie {
859
+ constructor() {
860
+ super(...arguments), this.variants = {};
861
+ }
862
+ render() {
863
+ let t = this.variants.default;
864
+ return this.props.options.variant in this.variants && (t = this.variants[this.props.options.variant]), /* @__PURE__ */ n(t, { ...this.props });
865
+ }
866
+ }
867
+ function _e(e) {
868
+ const [t, r] = A({}), i = $(null);
869
+ return H(() => {
870
+ if (i.current) {
871
+ const a = i.current;
863
872
  r({
864
- width: o.clientWidth,
865
- height: o.clientHeight
873
+ width: a.clientWidth,
874
+ height: a.clientHeight
866
875
  });
867
876
  }
868
877
  }, []), /* @__PURE__ */ n(
869
878
  "div",
870
879
  {
871
- ref: a,
880
+ ref: i,
872
881
  style: { width: "100%", height: "100%" },
873
882
  className: e.className,
874
883
  children: t.width > 0 && /* @__PURE__ */ n(
@@ -886,28 +895,670 @@ function Oe(e) {
886
895
  }
887
896
  );
888
897
  }
889
- const Ie = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
898
+ const Rt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
890
899
  __proto__: null
891
- }, Symbol.toStringTag, { value: "Module" })), Ce = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
900
+ }, Symbol.toStringTag, { value: "Module" })), _t = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
901
+ __proto__: null
902
+ }, Symbol.toStringTag, { value: "Module" }));
903
+ function Te(e) {
904
+ return /* @__PURE__ */ n("div", { className: "panel-header", style: e.style, children: e.children });
905
+ }
906
+ function Pe(e) {
907
+ return /* @__PURE__ */ n("div", { className: "panel-contents", style: e.style, children: e.children });
908
+ }
909
+ function p(e) {
910
+ const t = e.scroll ? _e : we;
911
+ return /* @__PURE__ */ n("div", { className: `panel ${e.className ?? ""}`, style: e.style, children: /* @__PURE__ */ n(t, { children: e.children }) });
912
+ }
913
+ p.Header = Te;
914
+ p.Contents = Pe;
915
+ const R = {};
916
+ function Ve(e, t) {
917
+ R[e] = t;
918
+ }
919
+ function O(e, t, r = !0) {
920
+ if (!e)
921
+ return /* @__PURE__ */ n(v, {});
922
+ const { type: i } = e, a = i && i in R ? R[i] : R.component;
923
+ return /* @__PURE__ */ n(a, { yamlNode: e, panel: r }, t);
924
+ }
925
+ function He({
926
+ children: e,
927
+ key: t,
928
+ panel: r,
929
+ options: i
930
+ }) {
931
+ return r ? /* @__PURE__ */ n(p, { style: i.style, scroll: i.scroll, children: /* @__PURE__ */ n(p.Contents, { children: e }) }, t) : /* @__PURE__ */ n(v, { children: ge.map(
932
+ e,
933
+ (a) => ye(a) ? ve(a, { key: t, ...a.props }) : void 0
934
+ ) });
935
+ }
936
+ function le(e, t) {
937
+ const { _parentNode: r, _indexFromParent: i, ...a } = t;
938
+ if (e && Object.keys(a).length > 0)
939
+ throw new T(e, Object.keys(a));
940
+ }
941
+ class F extends Error {
942
+ constructor(t, r) {
943
+ super(t), this.yamlNode = r;
944
+ }
945
+ }
946
+ class T extends F {
947
+ constructor(t, r) {
948
+ super(`Unexpected keys: ${r.join(", ")}`, t), this.keys = r;
949
+ }
950
+ }
951
+ class P extends F {
952
+ constructor(t, r) {
953
+ super(`Keys ${r.join(", ")} are missing`, t), this.keys = r;
954
+ }
955
+ }
956
+ class w extends F {
957
+ constructor(t, r, i) {
958
+ super(`Key ${r} error: ${i}`, t), this.key = r, this.keyMessage = i;
959
+ }
960
+ }
961
+ function Le(e) {
962
+ let t = e;
963
+ for (; t._parentNode; )
964
+ t = t._parentNode;
965
+ return t;
966
+ }
967
+ function Ye(e) {
968
+ const t = [];
969
+ let r = e;
970
+ for (; r; )
971
+ t.push({
972
+ node: r,
973
+ indexFromParent: r._indexFromParent
974
+ }), r = r._parentNode;
975
+ return t.reverse(), t;
976
+ }
977
+ function ce(e, t = null, r = null) {
978
+ if (e._parentNode)
979
+ throw new Error(
980
+ "Attribute _parentNode was already defined by the yml layout."
981
+ );
982
+ const i = {
983
+ ...e,
984
+ _parentNode: t,
985
+ _indexFromParent: r
986
+ };
987
+ if (e.children) {
988
+ const a = [...e.children];
989
+ Object.freeze(a), i.children = a.map((o, d) => ce(o, i, d));
990
+ }
991
+ return Object.freeze(i), i;
992
+ }
993
+ function je(e) {
994
+ return /* @__PURE__ */ n(E, { variant: "danger", children: e.message });
995
+ }
996
+ function Ke(e) {
997
+ const { error: t } = e;
998
+ if (!(t instanceof F))
999
+ return /* @__PURE__ */ n(v, {});
1000
+ function r(o, d = 3) {
1001
+ const l = Ye(o.yamlNode), h = [];
1002
+ let u = "";
1003
+ for (let c = 1; c < l.length; c++) {
1004
+ const { node: f, indexFromParent: m } = l[c];
1005
+ h.push(`${u}children:`), u += " ".repeat(d), m === 1 ? h.push(`${u}- type: ...`) : (m ?? 0 > 1) && h.push(
1006
+ `${u}...`,
1007
+ `${u}...`,
1008
+ `${u}# children number ${m ?? 0 + 1}`
1009
+ ), h.push(`${u}- type: ${f.type}`), u += " ".repeat(2);
1010
+ }
1011
+ return o instanceof T ? o.keys.forEach((c) => {
1012
+ h.push(
1013
+ `${u}${c}: ... ${" ".repeat(
1014
+ 50 - u.length - c.length
1015
+ )}<-- unexpected key`
1016
+ );
1017
+ }) : o instanceof P ? o.keys.forEach((c) => {
1018
+ h.push(
1019
+ `${u}???: ${" ".repeat(
1020
+ 50 - u.length - c.length
1021
+ )}<-- key **${c}** is expected`
1022
+ );
1023
+ }) : o instanceof w && h.push(
1024
+ `${u}${o.key}: ${" ".repeat(
1025
+ 50 - u.length - o.key.length
1026
+ )}<-- ${o.keyMessage}`
1027
+ ), h.join(`
1028
+ `);
1029
+ }
1030
+ const a = Le(t.yamlNode).name;
1031
+ if (t instanceof T) {
1032
+ const o = t.keys.length === 1 ? "key" : "keys";
1033
+ return /* @__PURE__ */ s(E, { variant: "danger", children: [
1034
+ "Unexpected ",
1035
+ o,
1036
+ " ",
1037
+ t.keys.map((d, l) => /* @__PURE__ */ s(v, { children: [
1038
+ l !== 0 && ", ",
1039
+ /* @__PURE__ */ n("b", { children: d })
1040
+ ] })),
1041
+ " ",
1042
+ "from the layout name ",
1043
+ /* @__PURE__ */ n("b", { children: a }),
1044
+ ".",
1045
+ /* @__PURE__ */ n("br", {}),
1046
+ /* @__PURE__ */ n("pre", { className: "mt-3", children: r(t) }),
1047
+ /* @__PURE__ */ n("br", {})
1048
+ ] });
1049
+ }
1050
+ if (t instanceof P) {
1051
+ const o = t.keys.length === 1 ? "Key" : "Keys";
1052
+ return /* @__PURE__ */ s(E, { variant: "danger", children: [
1053
+ "Expected ",
1054
+ o,
1055
+ " ",
1056
+ t.keys.map((d, l) => /* @__PURE__ */ s(v, { children: [
1057
+ l !== 0 && ", ",
1058
+ /* @__PURE__ */ n("b", { children: d })
1059
+ ] })),
1060
+ " ",
1061
+ "from the layout name ",
1062
+ /* @__PURE__ */ n("b", { children: a }),
1063
+ ".",
1064
+ /* @__PURE__ */ n("br", {}),
1065
+ /* @__PURE__ */ n("pre", { className: "mt-3", children: r(t) }),
1066
+ /* @__PURE__ */ n("br", {})
1067
+ ] });
1068
+ }
1069
+ return t instanceof w ? /* @__PURE__ */ s(E, { variant: "danger", children: [
1070
+ "Error on key ",
1071
+ /* @__PURE__ */ n("b", { children: t.key }),
1072
+ " from the layout name ",
1073
+ /* @__PURE__ */ n("b", { children: a }),
1074
+ ".",
1075
+ /* @__PURE__ */ n("br", {}),
1076
+ /* @__PURE__ */ n("pre", { className: "mt-3", children: r(t) }),
1077
+ /* @__PURE__ */ n("br", {})
1078
+ ] }) : /* @__PURE__ */ n(je, { ...e });
1079
+ }
1080
+ const ne = {
1081
+ hasError: !1,
1082
+ message: "",
1083
+ error: void 0
1084
+ };
1085
+ class ze extends ie {
1086
+ constructor(t) {
1087
+ super(t), this.reload = () => {
1088
+ window.location.reload();
1089
+ }, this.state = ne;
1090
+ }
1091
+ static getDerivedStateFromError() {
1092
+ return { hasError: !0 };
1093
+ }
1094
+ componentDidCatch(t) {
1095
+ t instanceof F && this.setState({
1096
+ hasError: !0,
1097
+ message: t.message,
1098
+ error: t
1099
+ });
1100
+ }
1101
+ // https://github.com/bvaughn/react-error-boundary/blob/23a4d779744f3079dfe0960acaa4bdfd5dede87b/src/ErrorBoundary.ts#L53
1102
+ componentDidUpdate(t, r) {
1103
+ this.state.hasError && r.error !== void 0 && t.resetKey !== this.props.resetKey && this.setState(ne);
1104
+ }
1105
+ render() {
1106
+ return this.state.hasError ? /* @__PURE__ */ s(_, { className: "mt-2", children: [
1107
+ /* @__PURE__ */ n("h4", { children: "Something went wrong" }),
1108
+ /* @__PURE__ */ n(
1109
+ Ke,
1110
+ {
1111
+ message: this.state.message,
1112
+ error: this.state.error
1113
+ }
1114
+ ),
1115
+ /* @__PURE__ */ s("p", { children: [
1116
+ "This error has been logged. Please",
1117
+ " ",
1118
+ /* @__PURE__ */ s(y, { size: "sm", onClick: this.reload, children: [
1119
+ /* @__PURE__ */ n("i", { className: "fa fa-refresh" }),
1120
+ " Reload"
1121
+ ] }),
1122
+ " ",
1123
+ "the application"
1124
+ ] })
1125
+ ] }) : this.props.children;
1126
+ }
1127
+ }
1128
+ function qe(e, t, r) {
1129
+ if (e && r === void 0)
1130
+ throw new P(e, [t]);
1131
+ }
1132
+ function Ge(e, t, r) {
1133
+ if (typeof r != "string")
1134
+ throw new w(e, t, "A string is expected");
1135
+ }
1136
+ function Ue(e, t, r) {
1137
+ if (typeof r != "boolean")
1138
+ throw new w(e, t, "A boolean is expected");
1139
+ }
1140
+ function Be(e, t, r) {
1141
+ if (typeof r != "number")
1142
+ throw new w(e, t, "A number is expected");
1143
+ }
1144
+ function G(e, t, r) {
1145
+ if (r !== void 0 && typeof r != "boolean")
1146
+ throw new w(e, t, "An optional boolean is expected");
1147
+ }
1148
+ function de(e, t, r) {
1149
+ if (r !== void 0 && typeof r != "string")
1150
+ throw new w(e, t, "An optional string is expected");
1151
+ }
1152
+ function We(e, t, r) {
1153
+ if (!Array.isArray(r))
1154
+ throw new w(e, t, "A list of string is expected");
1155
+ r.forEach((i) => {
1156
+ if (typeof i != "string")
1157
+ throw new w(e, t, "A list of string is expected");
1158
+ });
1159
+ }
1160
+ function Ze(e, t, r) {
1161
+ if (r !== void 0 && typeof r != "string") {
1162
+ if (!Array.isArray(r))
1163
+ throw new w(
1164
+ e,
1165
+ t,
1166
+ "An optional string or list of string is expected"
1167
+ );
1168
+ r.forEach((i) => {
1169
+ if (typeof i != "string")
1170
+ throw new w(
1171
+ e,
1172
+ t,
1173
+ "An optional string or list of string is expected"
1174
+ );
1175
+ });
1176
+ }
1177
+ }
1178
+ function Je(e, t, r) {
1179
+ if (r !== void 0) {
1180
+ if (!Array.isArray(r))
1181
+ throw new w(e, t, "An optional list of string is expected");
1182
+ r.forEach((i) => {
1183
+ if (typeof i != "string")
1184
+ throw new w(
1185
+ e,
1186
+ t,
1187
+ "A optional list of string is expected"
1188
+ );
1189
+ });
1190
+ }
1191
+ }
1192
+ function ue(e, t, r) {
1193
+ if (r !== void 0 && typeof r != "number")
1194
+ throw new w(e, t, "An optional number is expected");
1195
+ }
1196
+ function Qe(e, t, r) {
1197
+ if (r !== void 0) {
1198
+ if (!Array.isArray(r))
1199
+ throw new w(
1200
+ e,
1201
+ t,
1202
+ "An optional list of numbers is expected"
1203
+ );
1204
+ r.forEach((i) => {
1205
+ if (typeof i != "number")
1206
+ throw new w(
1207
+ e,
1208
+ t,
1209
+ "An optional list of numbers is expected"
1210
+ );
1211
+ });
1212
+ }
1213
+ }
1214
+ function j(e, t) {
1215
+ const { _parentNode: r, _indexFromParent: i, ...a } = t;
1216
+ if (e && Object.keys(a).length > 0)
1217
+ throw new T(e, Object.keys(a));
1218
+ }
1219
+ function Xe(e, t, r) {
1220
+ if (r !== "last" && typeof r != "number")
1221
+ throw new w(e, t, '"last" or a number is expected');
1222
+ }
1223
+ function et(e, t, r) {
1224
+ if (r !== void 0 && r !== "h5web" && r !== "plotly")
1225
+ throw new w(e, t, '"h5web" or "plotly" string is expected');
1226
+ }
1227
+ const Tt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1228
+ __proto__: null,
1229
+ assertBoolean: Ue,
1230
+ assertDataCollectionId: Xe,
1231
+ assertKeyExpected: qe,
1232
+ assertNoUnknownKeys: j,
1233
+ assertNumber: Be,
1234
+ assertOptionalBackend: et,
1235
+ assertOptionalBoolean: G,
1236
+ assertOptionalNumber: ue,
1237
+ assertOptionalNumberList: Qe,
1238
+ assertOptionalString: de,
1239
+ assertOptionalStringList: Je,
1240
+ assertOptionalStringOrStringList: Ze,
1241
+ assertString: Ge,
1242
+ assertStringList: We
1243
+ }, Symbol.toStringTag, { value: "Module" }));
1244
+ function tt({ yamlNode: e, panel: t }) {
1245
+ const { type: r, style: i, children: a, ...o } = e;
1246
+ return j(e, o), /* @__PURE__ */ n(q, { className: "ymllayout-row gx-0", style: i, children: C(a, (d, l) => O(d, l, t)) });
1247
+ }
1248
+ function nt({ yamlNode: e, panel: t }) {
1249
+ const { type: r, style: i, xs: a, children: o, ...d } = e;
1250
+ return j(e, d), ue(e, "xs", a), /* @__PURE__ */ n(
1251
+ k,
1252
+ {
1253
+ className: L("yamymllayout-col", { col: !!a }),
1254
+ style: i,
1255
+ xs: a,
1256
+ children: C(e.children, (l, h) => O(l, h, t))
1257
+ }
1258
+ );
1259
+ }
1260
+ const U = {};
1261
+ function Pt(e, t) {
1262
+ U[e] = t;
1263
+ }
1264
+ function rt(e, t) {
1265
+ if (t === void 0)
1266
+ throw new P(e, ["id"]);
1267
+ if (typeof t.id != "string")
1268
+ throw new w(e, "id", "A string is expected");
1269
+ }
1270
+ function it(e, t, r) {
1271
+ if (r !== void 0) {
1272
+ if (!Array.isArray(r))
1273
+ throw new w(e, "ids", "A option list is expected");
1274
+ r.forEach((i, a) => {
1275
+ try {
1276
+ rt(e, i);
1277
+ } catch {
1278
+ throw new w(
1279
+ e,
1280
+ "ids",
1281
+ `The hardware description ${a} is wrong`
1282
+ );
1283
+ }
1284
+ });
1285
+ }
1286
+ }
1287
+ function at(e) {
1288
+ const {
1289
+ providers: t = {},
1290
+ yamlNode: r,
1291
+ ids: i,
1292
+ groupid: a,
1293
+ even: o,
1294
+ nowrap: d,
1295
+ ...l
1296
+ } = e;
1297
+ if (it(r, "ids", i), de(r, "groupid", a), G(r, "even", o), G(r, "nowrap", d), j(r, l), !U.HardwareGroup)
1298
+ return /* @__PURE__ */ n(E, { variant: "warning", children: "No `HardwareGroup` component registered" });
1299
+ const h = U.HardwareGroup;
1300
+ return /* @__PURE__ */ n(
1301
+ h,
1302
+ {
1303
+ providers: t,
1304
+ ids: i,
1305
+ groupid: a,
1306
+ nowrap: d || !1,
1307
+ even: o || !1
1308
+ }
1309
+ );
1310
+ }
1311
+ const B = {
1312
+ hardwaregroup: at
1313
+ };
1314
+ function Vt(e, t) {
1315
+ B[e] = t;
1316
+ }
1317
+ function ot(e) {
1318
+ const { yamlNode: t, panel: r } = e, { type: i, style: a, scroll: o, title: d, ...l } = t;
1319
+ if (!(i in B))
1320
+ return /* @__PURE__ */ n(p, { children: /* @__PURE__ */ n(p.Contents, { children: /* @__PURE__ */ s(E, { variant: "warning", children: [
1321
+ 'Unknown component "',
1322
+ i,
1323
+ '"'
1324
+ ] }) }) });
1325
+ const h = B[t.type];
1326
+ return r ? /* @__PURE__ */ n(p, { style: a, scroll: o, children: /* @__PURE__ */ s(ee, { fallback: /* @__PURE__ */ n("p", { children: "Loading..." }), children: [
1327
+ d && /* @__PURE__ */ n(p.Header, { children: d }),
1328
+ /* @__PURE__ */ n(p.Contents, { children: /* @__PURE__ */ n(h, { ...l, yamlNode: t }) })
1329
+ ] }) }) : /* @__PURE__ */ n(ee, { fallback: /* @__PURE__ */ n("p", { children: "Loading..." }), children: /* @__PURE__ */ n(h, { ...l, yamlNode: t }) });
1330
+ }
1331
+ function st({ yamlNode: e, panel: t }) {
1332
+ const r = e.options || {};
1333
+ return /* @__PURE__ */ n(_, { className: "ymllayout-container", ...r, children: C(e.children, (i, a) => O(i, a, t)) });
1334
+ }
1335
+ function lt(e) {
1336
+ const { yamlNode: t } = e, r = t.options || {}, i = {};
1337
+ return r.centerContent && (i.margin = "auto"), /* @__PURE__ */ s(p, { className: "ymllayout-panel", ...r, children: [
1338
+ t.title && /* @__PURE__ */ n(p.Header, { children: t.title }),
1339
+ /* @__PURE__ */ n(p.Contents, { style: i, children: C(
1340
+ t.children,
1341
+ (a, o) => O(a, o, !1)
1342
+ ) })
1343
+ ] });
1344
+ }
1345
+ const ct = () => Math.random().toString(36).slice(2, 15) + Math.random().toString(36).slice(2, 15);
1346
+ function dt({ yamlNode: e, panel: t }) {
1347
+ const r = [];
1348
+ return fe(e.children, (i, a) => {
1349
+ r.push(
1350
+ /* @__PURE__ */ n(me, { eventKey: ct(), title: i.title, children: O(i, 0, !1) }, a)
1351
+ );
1352
+ }), t ? /* @__PURE__ */ s(p, { className: "ymllayout-tabs", children: [
1353
+ e.title && /* @__PURE__ */ n(p.Header, { children: e.title }),
1354
+ /* @__PURE__ */ n(p.Contents, { children: /* @__PURE__ */ n(X, { mountOnEnter: !0, children: r }) })
1355
+ ] }) : /* @__PURE__ */ n(X, { children: r });
1356
+ }
1357
+ function ut(e) {
1358
+ const { node: t } = e, { type: r, title: i, ...a } = t;
1359
+ return le(t, a), /* @__PURE__ */ n("div", { style: { gridColumn: "1 / 3" }, children: /* @__PURE__ */ n("h3", { children: i }) });
1360
+ }
1361
+ function ht(e) {
1362
+ const { node: t, state: r, row: i } = e, { title: a } = t;
1363
+ function o() {
1364
+ if (t.id)
1365
+ return t.id;
1366
+ }
1367
+ function d() {
1368
+ if (a !== void 0)
1369
+ return a;
1370
+ if (t.type === "hardware") {
1371
+ const h = o(), u = {
1372
+ _parentNode: t._parentNode,
1373
+ _indexFromParent: t._indexFromParent,
1374
+ type: "hardware",
1375
+ id: h,
1376
+ variant: "name",
1377
+ emptyifnone: !0
1378
+ };
1379
+ return O(u, "a", !1);
1380
+ }
1381
+ return "";
1382
+ }
1383
+ const l = d();
1384
+ return /* @__PURE__ */ s(
1385
+ "div",
1386
+ {
1387
+ style: {
1388
+ textAlign: "center"
1389
+ },
1390
+ children: [
1391
+ /* @__PURE__ */ n(
1392
+ "h5",
1393
+ {
1394
+ style: {
1395
+ margin: "0px",
1396
+ whiteSpace: "nowrap"
1397
+ },
1398
+ children: l
1399
+ }
1400
+ ),
1401
+ r && /* @__PURE__ */ n("div", { style: { position: "relative", top: -5 }, children: r })
1402
+ ]
1403
+ }
1404
+ );
1405
+ }
1406
+ function ft(e) {
1407
+ const { node: t, row: r } = e, {
1408
+ titlealign: i,
1409
+ title: a,
1410
+ stateinheader: o = !1,
1411
+ variant: d,
1412
+ id: l,
1413
+ ...h
1414
+ } = t;
1415
+ let u, c;
1416
+ if (h.type === "hardware")
1417
+ if (u = {
1418
+ ...h,
1419
+ id: l,
1420
+ variant: d
1421
+ }, o) {
1422
+ const f = {
1423
+ ...h,
1424
+ id: l,
1425
+ variant: "state",
1426
+ emptyifnone: !0
1427
+ };
1428
+ c = O(f, "k", !1);
1429
+ } else
1430
+ c = null;
1431
+ else
1432
+ u = h, c = null;
1433
+ return /* @__PURE__ */ s(v, { children: [
1434
+ /* @__PURE__ */ n(
1435
+ "div",
1436
+ {
1437
+ style: {
1438
+ gridColumn: 1,
1439
+ alignSelf: i ?? "center"
1440
+ },
1441
+ children: /* @__PURE__ */ n(ht, { node: t, state: c, row: r })
1442
+ }
1443
+ ),
1444
+ /* @__PURE__ */ n("div", { style: { gridColumn: 2 }, children: O(u, "k", !1) })
1445
+ ] });
1446
+ }
1447
+ function mt(e) {
1448
+ const { yamlNode: t, panel: r } = e, { type: i, children: a, options: o = {}, title: d, ...l } = t;
1449
+ return le(t, l), /* @__PURE__ */ s(p, { className: "ymllayout-form", ...o, children: [
1450
+ t.title && /* @__PURE__ */ n(p.Header, { children: t.title }),
1451
+ /* @__PURE__ */ n(p.Contents, { children: /* @__PURE__ */ n(
1452
+ "div",
1453
+ {
1454
+ style: {
1455
+ display: "grid",
1456
+ gridTemplateColumns: "min-content auto"
1457
+ },
1458
+ children: C(a, (h, u) => h.type === "formheader" ? /* @__PURE__ */ n(
1459
+ ut,
1460
+ {
1461
+ node: h,
1462
+ row: u
1463
+ },
1464
+ u
1465
+ ) : /* @__PURE__ */ n(ft, { node: h, row: u }, u))
1466
+ }
1467
+ ) })
1468
+ ] });
1469
+ }
1470
+ function pt(e) {
1471
+ const { yamlNode: t, panel: r } = e;
1472
+ return /* @__PURE__ */ s(
1473
+ "div",
1474
+ {
1475
+ className: "ymllayout-grid",
1476
+ style: {
1477
+ gridTemplateColumns: t.columns,
1478
+ gridTemplateRows: t.rows
1479
+ },
1480
+ children: [
1481
+ C(t.children, (i, a) => {
1482
+ const { columnSpan: o = 1, rowSpan: d = 1, ...l } = i, h = o > 1 ? `span ${o}` : void 0, u = d > 1 ? `span ${d}` : void 0;
1483
+ return /* @__PURE__ */ n(
1484
+ "div",
1485
+ {
1486
+ className: "ymllayout-grid-cell",
1487
+ style: {
1488
+ gridColumn: h,
1489
+ gridRow: u
1490
+ },
1491
+ children: O(l, a, r)
1492
+ },
1493
+ a
1494
+ );
1495
+ }),
1496
+ " "
1497
+ ]
1498
+ }
1499
+ );
1500
+ }
1501
+ function wt({ yamlNode: e, panel: t }) {
1502
+ const r = e.options || {};
1503
+ return /* @__PURE__ */ n(He, { panel: t, options: r, children: /* @__PURE__ */ n("div", { children: e.label }) });
1504
+ }
1505
+ const gt = {
1506
+ row: tt,
1507
+ col: nt,
1508
+ container: st,
1509
+ component: ot,
1510
+ panel: lt,
1511
+ tabs: dt,
1512
+ form: mt,
1513
+ grid: pt,
1514
+ label: wt
1515
+ };
1516
+ Object.entries(gt).forEach(([e, t]) => {
1517
+ Ve(e, t);
1518
+ });
1519
+ function Ht(e) {
1520
+ var r;
1521
+ const t = be(() => ce(e.layout), [e.layout]);
1522
+ return t.error ? /* @__PURE__ */ n("div", { className: `${e.className ?? ""} ymllayout-main`, id: e.id, children: /* @__PURE__ */ s(p, { children: [
1523
+ /* @__PURE__ */ n(p.Header, { children: "Layout Error" }),
1524
+ /* @__PURE__ */ s(p.Contents, { children: [
1525
+ /* @__PURE__ */ s("p", { children: [
1526
+ "File: ",
1527
+ t.name
1528
+ ] }),
1529
+ /* @__PURE__ */ n(E, { variant: "warning", children: /* @__PURE__ */ n("pre", { className: "mb-0", children: t.error }) })
1530
+ ] })
1531
+ ] }) }) : /* @__PURE__ */ n("div", { className: `${e.className ?? ""} ymllayout-main`, id: e.id, children: /* @__PURE__ */ n(ze, { resetKey: t, children: (r = t.children) == null ? void 0 : r.map((i, a) => O(i, a)) }) });
1532
+ }
1533
+ const Lt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
892
1534
  __proto__: null
893
1535
  }, Symbol.toStringTag, { value: "Module" }));
894
1536
  export {
895
- me as Formatting,
896
- we as Frontend,
897
- Oe as FullSizer,
898
- G as HardwareInputNumber,
899
- re as HardwareNumericStep,
900
- Ce as HardwareSchema,
901
- ve as HardwareState,
902
- A as HardwareTemplate,
903
- Ie as HardwareTypes,
904
- ge as Info,
905
- Ne as MotorDefault,
906
- be as Multiposition,
907
- pe as NoObject,
908
- ne as NumericStep,
909
- ye as Property,
910
- Se as ShutterDefault,
911
- I as TypeIcon
1537
+ St as Formatting,
1538
+ Et as Frontend,
1539
+ _e as FullSizer,
1540
+ Lt as HWObject,
1541
+ te as HardwareInputNumber,
1542
+ ke as HardwareNumericStep,
1543
+ _t as HardwareSchema,
1544
+ Mt as HardwareState,
1545
+ Y as HardwareTemplate,
1546
+ Rt as HardwareTypes,
1547
+ Ft as HardwareVariant,
1548
+ xt as Info,
1549
+ w as KeyError,
1550
+ P as MissingKeysError,
1551
+ At as MotorDefault,
1552
+ It as Multiposition,
1553
+ kt as NoObject,
1554
+ Ie as NumericStep,
1555
+ Dt as Property,
1556
+ $t as ShutterDefault,
1557
+ I as TypeIcon,
1558
+ Ht as YAMLLayout,
1559
+ Tt as YamlAsserts,
1560
+ Pt as registerHardwareComponent,
1561
+ Vt as registerYamlComponent,
1562
+ Ve as registerYamlType
912
1563
  };
913
1564
  //# sourceMappingURL=index.esm.js.map