@sonata-innovations/fiber-fbre 3.3.0 → 3.4.0

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.
@@ -1,12 +1,12 @@
1
- import { jsx as a, jsxs as w, Fragment as ie } from "react/jsx-runtime";
2
- import { createContext as bt, useContext as Ye, useMemo as De, useState as O, useRef as M, useEffect as K, useCallback as H, useLayoutEffect as qt } from "react";
3
- import { useStore as le, createStore as Wt } from "zustand";
4
- import { DISPLAY_ONLY_TYPES as Sn, getValidationConfig as oe, normalizeOptions as Dn } from "@sonata-innovations/fiber-types";
5
- import { validateValue as En, isHiddenByCondition as se, extractFormulaReferences as Gt, topologicalSortCalculations as Jt, evaluateFormula as ye, evaluateConditionConfig as Tn, formatCalculationResult as vt, REF_REGEX as Xt, convertMarkupToHTML as Qt } from "@sonata-innovations/fiber-shared";
6
- import { createPortal as In } from "react-dom";
7
- const Zt = /* @__PURE__ */ new Map(), F = (e, t) => {
8
- Zt.set(e, t);
9
- }, en = (e) => Zt.get(e), Ue = (e) => Sn.has(e), Ln = (e, t) => {
1
+ import { jsx as a, jsxs as w, Fragment as ue } from "react/jsx-runtime";
2
+ import { createContext as vt, useContext as Ge, useMemo as Te, useState as M, useRef as O, useEffect as K, useCallback as H, useLayoutEffect as zt } from "react";
3
+ import { useStore as de, createStore as Yt } from "zustand";
4
+ import { DISPLAY_ONLY_TYPES as Dn, getValidationConfig as ae, normalizeOptions as En } from "@sonata-innovations/fiber-types";
5
+ import { validateValue as Tn, isHiddenByCondition as ie, extractFormulaReferences as qt, topologicalSortCalculations as Wt, evaluateFormula as we, evaluateConditionConfig as In, formatCalculationResult as gt, REF_REGEX as Gt, convertMarkupToHTML as Jt } from "@sonata-innovations/fiber-shared";
6
+ import { createPortal as Ln } from "react-dom";
7
+ const Xt = /* @__PURE__ */ new Map(), F = (e, t) => {
8
+ Xt.set(e, t);
9
+ }, Qt = (e) => Xt.get(e), He = (e) => Dn.has(e), Rn = (e, t) => {
10
10
  var r, s, o, l;
11
11
  if (t.includes(":")) {
12
12
  const n = t.split(":"), i = e.components[n[0]];
@@ -14,22 +14,22 @@ const Zt = /* @__PURE__ */ new Map(), F = (e, t) => {
14
14
  }
15
15
  return (l = e.components[t]) == null ? void 0 : l.value;
16
16
  }, ee = (e, t) => {
17
- const r = oe(e);
18
- return !r || !r.rules || r.rules.length === 0 ? [] : En(
17
+ const r = ae(e);
18
+ return !r || !r.rules || r.rules.length === 0 ? [] : Tn(
19
19
  e.value,
20
20
  r,
21
- t ? (s) => Ln(t, s) : void 0
21
+ t ? (s) => Rn(t, s) : void 0
22
22
  );
23
- }, Rn = (e) => {
24
- const t = oe(e);
23
+ }, Mn = (e) => {
24
+ const t = ae(e);
25
25
  return !t || !t.rules ? !1 : t.rules.some((r) => r.type === "required");
26
- }, ae = (e) => {
26
+ }, le = (e) => {
27
27
  var s;
28
28
  const t = { ...e };
29
29
  if ("options" in t.properties && Array.isArray(t.properties.options) && (t.properties = {
30
30
  ...t.properties,
31
- options: Dn(t.properties.options)
32
- }), e.type === "computed" ? (t.value = null, t.valid = !0) : !Ue(e.type) && e.type !== "group" && e.type !== "repeater" && (t.value = null, t.valid = !Rn(e)), (e.type === "checkbox" || e.type === "dropDownMulti") && (t.value = []), ["yesNo", "radio", "cardSelect", "dropDown"].includes(e.type)) {
31
+ options: En(t.properties.options)
32
+ }), e.type === "computed" ? (t.value = null, t.valid = !0) : !He(e.type) && e.type !== "group" && e.type !== "repeater" && (t.value = null, t.valid = !Mn(e)), (e.type === "checkbox" || e.type === "dropDownMulti") && (t.value = []), ["yesNo", "radio", "cardSelect", "dropDown"].includes(e.type)) {
33
33
  const o = e.properties ?? {}, l = o.defaultValue;
34
34
  if (e.type === "yesNo")
35
35
  (l === "yes" || l === "no") && (t.value = l, t.valid = !0);
@@ -39,7 +39,7 @@ const Zt = /* @__PURE__ */ new Map(), F = (e, t) => {
39
39
  }
40
40
  }
41
41
  return e.type === "toggleSwitch" && (t.value = !1), e.type === "colorPicker" && ((s = e.properties) != null && s.defaultValue) && (t.value = e.properties.defaultValue), e.type === "slider" && (t.value = "initValue" in e.properties ? e.properties.initValue : "min" in e.properties ? e.properties.min : 0), t;
42
- }, Ne = (e, t, r) => {
42
+ }, Se = (e, t, r) => {
43
43
  var s;
44
44
  for (const o of r.rules)
45
45
  if (o.type === "matchesField" && ((s = o.params) != null && s.field)) {
@@ -49,14 +49,14 @@ const Zt = /* @__PURE__ */ new Map(), F = (e, t) => {
49
49
  config: r
50
50
  });
51
51
  }
52
- }, tn = (e, t) => {
52
+ }, Zt = (e, t) => {
53
53
  var r, s;
54
54
  if (t.includes(":")) {
55
55
  const o = t.split(":"), l = e[o[0]];
56
56
  return (s = (r = l == null ? void 0 : l.addedComponents) == null ? void 0 : r[parseInt(o[1])]) == null ? void 0 : s[parseInt(o[2])];
57
57
  }
58
58
  return e[t];
59
- }, ct = (e, t, r) => {
59
+ }, dt = (e, t, r) => {
60
60
  const s = {
61
61
  components: e.components,
62
62
  groupComponentMap: e.groupComponentMap
@@ -68,14 +68,14 @@ const Zt = /* @__PURE__ */ new Map(), F = (e, t) => {
68
68
  }, n = e.validationsByDependency[t];
69
69
  if (n)
70
70
  for (const i of n) {
71
- const d = tn(e.components, i.target);
71
+ const d = Zt(e.components, i.target);
72
72
  if (d) {
73
73
  const c = ee(d, s);
74
74
  d.valid = c.length === 0, l[i.target] = c;
75
75
  }
76
76
  }
77
77
  return l;
78
- }, me = (e, t) => {
78
+ }, be = (e, t) => {
79
79
  const r = e.screens[t];
80
80
  return r ? !r.components.some((o) => {
81
81
  var i;
@@ -85,28 +85,28 @@ const Zt = /* @__PURE__ */ new Map(), F = (e, t) => {
85
85
  return (i = l.addedComponents) == null ? void 0 : i.some(
86
86
  (d) => d.some((c) => {
87
87
  const u = c.conditions && "when" in c.conditions ? c.conditions : void 0;
88
- return u && se(u, e.conditionResults[c.uuid]) ? !1 : !c.valid;
88
+ return u && ie(u, e.conditionResults[c.uuid]) ? !1 : !c.valid;
89
89
  })
90
90
  );
91
91
  const n = l.conditions && "when" in l.conditions ? l.conditions : void 0;
92
- return se(n, e.conditionResults[l.uuid]) ? !1 : l && "valid" in l && !l.valid;
92
+ return ie(n, e.conditionResults[l.uuid]) ? !1 : l && "valid" in l && !l.valid;
93
93
  }) : !0;
94
94
  };
95
- function Mn(e) {
95
+ function On(e) {
96
96
  const t = {};
97
97
  for (const r of e) {
98
- const s = Gt(r.formula);
98
+ const s = qt(r.formula);
99
99
  for (const o of s)
100
100
  t[o] || (t[o] = []), t[o].includes(r.uuid) || t[o].push(r.uuid);
101
101
  }
102
102
  return t;
103
103
  }
104
- function nn(e, t) {
104
+ function en(e, t) {
105
105
  return {
106
106
  resolveValue: (r) => {
107
107
  if (r in t)
108
108
  return t[r];
109
- const s = he(e, r);
109
+ const s = ve(e, r);
110
110
  if (!s) return null;
111
111
  const o = s.value;
112
112
  if (o == null || o === "") return null;
@@ -114,7 +114,7 @@ function nn(e, t) {
114
114
  return isNaN(l) ? null : l;
115
115
  },
116
116
  resolveOptionMetadata: (r, s) => {
117
- const o = he(e, r);
117
+ const o = ve(e, r);
118
118
  if (!o) return null;
119
119
  const l = o.value;
120
120
  if (!l) return null;
@@ -150,15 +150,15 @@ function nn(e, t) {
150
150
  }
151
151
  };
152
152
  }
153
- function dt(e) {
153
+ function ut(e) {
154
154
  const t = e.calculations ?? [];
155
155
  if (t.length === 0) return {};
156
- const r = Jt(t), s = {}, o = nn(e, s);
156
+ const r = Wt(t), s = {}, o = en(e, s);
157
157
  for (const l of r)
158
- s[l.uuid] = ye(l.formula, o);
158
+ s[l.uuid] = we(l.formula, o);
159
159
  return s;
160
160
  }
161
- function nt(e, t) {
161
+ function ot(e, t) {
162
162
  const r = e.calculationsByDependency, s = e.calculations ?? [];
163
163
  if (s.length === 0 || !r) return null;
164
164
  const o = /* @__PURE__ */ new Set(), l = [t];
@@ -169,20 +169,20 @@ function nt(e, t) {
169
169
  o.has(m) || (o.add(m), l.push(m));
170
170
  }
171
171
  if (o.size === 0) return null;
172
- const n = Jt(s), i = { ...e.calculationResults }, d = nn(e, i);
172
+ const n = Wt(s), i = { ...e.calculationResults }, d = en(e, i);
173
173
  let c = !1;
174
174
  for (const u of n)
175
175
  if (o.has(u.uuid)) {
176
- const p = ye(u.formula, d);
176
+ const p = we(u.formula, d);
177
177
  i[u.uuid] !== p && (i[u.uuid] = p, c = !0);
178
178
  }
179
179
  return c ? i : null;
180
180
  }
181
- function On(e) {
181
+ function Vn(e) {
182
182
  const t = {}, r = (s) => {
183
183
  var l;
184
184
  if (s.type !== "computed" || !((l = s.properties) != null && l.formula)) return;
185
- const o = Gt(s.properties.formula);
185
+ const o = qt(s.properties.formula);
186
186
  for (const n of o)
187
187
  t[n] || (t[n] = []), t[n].includes(s.uuid) || t[n].push(s.uuid);
188
188
  };
@@ -192,7 +192,7 @@ function On(e) {
192
192
  r(o);
193
193
  return t;
194
194
  }
195
- function rn(e, t, r, s) {
195
+ function tn(e, t, r, s) {
196
196
  var d, c;
197
197
  const o = e.components[r], l = ((d = o == null ? void 0 : o.components) == null ? void 0 : d.map((u) => u.uuid)) ?? [], n = (c = o == null ? void 0 : o.addedComponents) == null ? void 0 : c[s], i = /* @__PURE__ */ new Map();
198
198
  if (n)
@@ -211,7 +211,7 @@ function rn(e, t, r, s) {
211
211
  const b = Number(y);
212
212
  return isNaN(b) ? null : b;
213
213
  }
214
- const m = he(e, u);
214
+ const m = ve(e, u);
215
215
  if (!m) return null;
216
216
  const f = m.value;
217
217
  if (f == null || f === "") return null;
@@ -219,7 +219,7 @@ function rn(e, t, r, s) {
219
219
  return isNaN(v) ? null : v;
220
220
  },
221
221
  resolveOptionMetadata: (u, p) => {
222
- const f = i.get(u) ?? he(e, u);
222
+ const f = i.get(u) ?? ve(e, u);
223
223
  if (!f) return null;
224
224
  const v = f.value;
225
225
  if (!v) return null;
@@ -255,12 +255,12 @@ function rn(e, t, r, s) {
255
255
  }
256
256
  };
257
257
  }
258
- function Fe(e, t) {
258
+ function Ke(e, t) {
259
259
  return {
260
260
  resolveValue: (r) => {
261
261
  if (r in t)
262
262
  return t[r];
263
- const s = he(e, r);
263
+ const s = ve(e, r);
264
264
  if (!s) return null;
265
265
  const o = s.value;
266
266
  if (o == null || o === "") return null;
@@ -268,7 +268,7 @@ function Fe(e, t) {
268
268
  return isNaN(l) ? null : l;
269
269
  },
270
270
  resolveOptionMetadata: (r, s) => {
271
- const o = he(e, r);
271
+ const o = ve(e, r);
272
272
  if (!o) return null;
273
273
  const l = o.value;
274
274
  if (!l) return null;
@@ -304,12 +304,12 @@ function Fe(e, t) {
304
304
  }
305
305
  };
306
306
  }
307
- function ut(e) {
307
+ function pt(e) {
308
308
  var r, s;
309
309
  const t = e.calculationResults ?? {};
310
310
  for (const o of Object.values(e.components))
311
311
  if (o.type === "computed" && ((r = o.properties) != null && r.formula)) {
312
- const l = Fe(e, t), n = ye(o.properties.formula, l);
312
+ const l = Ke(e, t), n = we(o.properties.formula, l);
313
313
  o.value = n;
314
314
  }
315
315
  for (const o of Object.values(e.components))
@@ -319,13 +319,13 @@ function ut(e) {
319
319
  for (let i = 0; i < n.length; i++) {
320
320
  const d = n[i], c = o.components[i];
321
321
  if ((c == null ? void 0 : c.type) === "computed" && ((s = c.properties) != null && s.formula)) {
322
- const u = o.type === "repeater" ? rn(e, t, o.uuid, l) : Fe(e, t), p = ye(c.properties.formula, u);
322
+ const u = o.type === "repeater" ? tn(e, t, o.uuid, l) : Ke(e, t), p = we(c.properties.formula, u);
323
323
  d.value = p;
324
324
  }
325
325
  }
326
326
  }
327
327
  }
328
- function Vn(e, t) {
328
+ function $n(e, t) {
329
329
  var n, i;
330
330
  const r = e.computedByDependency;
331
331
  if (!r) return !1;
@@ -336,7 +336,7 @@ function Vn(e, t) {
336
336
  for (const d of s) {
337
337
  const c = e.components[d];
338
338
  if (c && c.type === "computed" && ((n = c.properties) != null && n.formula)) {
339
- const u = Fe(e, o), p = ye(c.properties.formula, u);
339
+ const u = Ke(e, o), p = we(c.properties.formula, u);
340
340
  c.value !== p && (e.components[d] = { ...c, value: p }, l = !0);
341
341
  continue;
342
342
  }
@@ -349,19 +349,19 @@ function Vn(e, t) {
349
349
  for (let f = 0; f < u.addedComponents.length; f++) {
350
350
  const v = u.addedComponents[f][p];
351
351
  if (!v) continue;
352
- const y = u.type === "repeater" ? rn(e, o, u.uuid, f) : Fe(e, o), b = ye(m.properties.formula, y);
352
+ const y = u.type === "repeater" ? tn(e, o, u.uuid, f) : Ke(e, o), b = we(m.properties.formula, y);
353
353
  v.value !== b && (u.addedComponents[f][p] = { ...v, value: b }, l = !0);
354
354
  }
355
355
  }
356
356
  }
357
357
  return l;
358
358
  }
359
- const Be = (e, t) => {
359
+ const Fe = (e, t) => {
360
360
  for (const r of e.screenOrder)
361
361
  if (e.screens[r].components.some((o) => o.uuid === t))
362
362
  return r;
363
363
  return null;
364
- }, $n = (e, t) => {
364
+ }, An = (e, t) => {
365
365
  if (!t.includes(":")) return null;
366
366
  const r = t.split(":");
367
367
  if (r.length !== 3) return null;
@@ -369,12 +369,12 @@ const Be = (e, t) => {
369
369
  if (!l || l.type !== "repeater" || !l.components) return null;
370
370
  const n = l.components[o];
371
371
  return (n == null ? void 0 : n.uuid) ?? null;
372
- }, Vt = (e, t, r, s, o) => {
373
- const l = t(), n = l.groupComponentMap[r] ?? r, i = pt(e, t, n), d = ct(
372
+ }, Ot = (e, t, r, s, o) => {
373
+ const l = t(), n = l.groupComponentMap[r] ?? r, i = ft(e, t, n), d = dt(
374
374
  l,
375
375
  r,
376
376
  s
377
- ), c = Be(l, o), u = {
377
+ ), c = Fe(l, o), u = {
378
378
  components: { ...l.components },
379
379
  validationErrors: d
380
380
  };
@@ -382,28 +382,28 @@ const Be = (e, t) => {
382
382
  const b = { ...l, ...u };
383
383
  u.screenValidity = {
384
384
  ...l.screenValidity,
385
- [c]: me(b, c)
385
+ [c]: be(b, c)
386
386
  };
387
387
  }
388
- const p = { ...l, ...u }, m = r.includes(":") ? $n(p, r) : null, f = [], v = (b) => {
389
- if (Vn(p, b)) {
388
+ const p = { ...l, ...u }, m = r.includes(":") ? An(p, r) : null, f = [], v = (b) => {
389
+ if ($n(p, b)) {
390
390
  const C = p.computedByDependency[b] ?? [];
391
391
  for (const x of C)
392
392
  f.includes(x) || (f.push(x), v(x));
393
393
  }
394
394
  };
395
395
  v(n), m && m !== n && v(m);
396
- let y = nt(p, n);
396
+ let y = ot(p, n);
397
397
  if (m && m !== n) {
398
- const b = y ? { ...p, calculationResults: y } : p, C = nt(b, m);
398
+ const b = y ? { ...p, calculationResults: y } : p, C = ot(b, m);
399
399
  C && (y = C);
400
400
  }
401
401
  for (const b of f) {
402
- const C = y ? { ...p, calculationResults: y } : p, x = nt(C, b);
402
+ const C = y ? { ...p, calculationResults: y } : p, x = ot(C, b);
403
403
  x && (y = x);
404
404
  }
405
405
  y && (u.calculationResults = y), e(u);
406
- }, An = (e, t) => ({
406
+ }, Bn = (e, t) => ({
407
407
  updateComponentValue: (r, s) => {
408
408
  var n, i;
409
409
  const o = t();
@@ -412,7 +412,7 @@ const Be = (e, t) => {
412
412
  if (!((i = (n = m == null ? void 0 : m.addedComponents) == null ? void 0 : n[u]) != null && i[p])) return;
413
413
  const f = m.addedComponents[u][p].value !== s;
414
414
  if (m.addedComponents[u][p] = { ...m.addedComponents[u][p], value: s }, f) {
415
- Vt(
415
+ Ot(
416
416
  e,
417
417
  t,
418
418
  r,
@@ -434,7 +434,7 @@ const Be = (e, t) => {
434
434
  e({ selectionTick: t().selectionTick + 1 });
435
435
  return;
436
436
  }
437
- l.value = s, Vt(e, t, r, l, r);
437
+ l.value = s, Ot(e, t, r, l, r);
438
438
  }
439
439
  },
440
440
  addGroupIteration: (r) => {
@@ -443,12 +443,12 @@ const Be = (e, t) => {
443
443
  return;
444
444
  o.addedComponents || (o.addedComponents = []);
445
445
  const l = { ...s.conditionsByDependency }, n = o.components.map((c, u) => {
446
- const p = ae(c);
446
+ const p = le(c);
447
447
  if (p.uuid = [r, o.addedComponents.length, u].join(
448
448
  ":"
449
449
  ), s.groupComponentMap[p.uuid] = c.uuid, p.conditions && Object.keys(p.conditions).length > 0) {
450
450
  const f = "when" in p.conditions ? p.conditions : null;
451
- f && (p.conditions = f, pe(
451
+ f && (p.conditions = f, me(
452
452
  l,
453
453
  p.uuid,
454
454
  f,
@@ -459,8 +459,8 @@ const Be = (e, t) => {
459
459
  return p.valid = m.length === 0, p;
460
460
  });
461
461
  o.addedComponents.push(n);
462
- const i = Be(s, r), d = { ...s.screenValidity };
463
- return i && (d[i] = me(
462
+ const i = Fe(s, r), d = { ...s.screenValidity };
463
+ return i && (d[i] = be(
464
464
  {
465
465
  ...s
466
466
  },
@@ -478,14 +478,14 @@ const Be = (e, t) => {
478
478
  return;
479
479
  o.addedComponents || (o.addedComponents = []);
480
480
  const l = { ...s.conditionsByDependency }, n = o.components.map((p, m) => {
481
- const f = ae(p);
481
+ const f = le(p);
482
482
  if (f.uuid = [
483
483
  r,
484
484
  o.addedComponents.length,
485
485
  m
486
486
  ].join(":"), f.conditions && Object.keys(f.conditions).length > 0) {
487
487
  const y = "when" in f.conditions ? f.conditions : null;
488
- y && (f.conditions = y, pe(
488
+ y && (f.conditions = y, me(
489
489
  l,
490
490
  f.uuid,
491
491
  y,
@@ -496,8 +496,8 @@ const Be = (e, t) => {
496
496
  return f.valid = v.length === 0, f;
497
497
  });
498
498
  o.addedComponents.push(n);
499
- const i = Be(s, r), d = { ...s.screenValidity };
500
- i && (d[i] = me(
499
+ const i = Fe(s, r), d = { ...s.screenValidity };
500
+ i && (d[i] = be(
501
501
  {
502
502
  ...s
503
503
  },
@@ -507,8 +507,8 @@ const Be = (e, t) => {
507
507
  ...s,
508
508
  components: { ...s.components }
509
509
  };
510
- ut(c);
511
- const u = dt(c);
510
+ pt(c);
511
+ const u = ut(c);
512
512
  return e({
513
513
  components: { ...s.components },
514
514
  conditionsByDependency: l,
@@ -534,16 +534,16 @@ const Be = (e, t) => {
534
534
  }
535
535
  for (let b = s; b < l.addedComponents.length; b++)
536
536
  l.addedComponents[b].forEach((C, x) => {
537
- const N = C.uuid, E = [r, b, x].join(":");
538
- if (N !== E) {
539
- C.uuid = E, N in u && (u[E] = u[N], delete u[N]), N in c && (c[E] = c[N], delete c[N]);
540
- for (const S of Object.values(c))
541
- for (const D of S)
542
- D.target === N && (D.target = E);
537
+ const N = C.uuid, S = [r, b, x].join(":");
538
+ if (N !== S) {
539
+ C.uuid = S, N in u && (u[S] = u[N], delete u[N]), N in c && (c[S] = c[N], delete c[N]);
540
+ for (const E of Object.values(c))
541
+ for (const D of E)
542
+ D.target === N && (D.target = S);
543
543
  }
544
544
  });
545
- const p = Be(o, r), m = { ...o.screenValidity };
546
- p && (m[p] = me(
545
+ const p = Fe(o, r), m = { ...o.screenValidity };
546
+ p && (m[p] = be(
547
547
  {
548
548
  ...o
549
549
  },
@@ -553,8 +553,8 @@ const Be = (e, t) => {
553
553
  ...o,
554
554
  components: { ...o.components }
555
555
  };
556
- ut(f);
557
- const v = dt(f);
556
+ pt(f);
557
+ const v = ut(f);
558
558
  e({
559
559
  components: { ...o.components },
560
560
  conditionsByDependency: c,
@@ -563,44 +563,54 @@ const Be = (e, t) => {
563
563
  calculationResults: v
564
564
  });
565
565
  }
566
- }), he = (e, t) => tn(e.components, t), pe = (e, t, r, s) => {
566
+ }), ve = (e, t) => Zt(e.components, t), me = (e, t, r, s) => {
567
567
  const o = /* @__PURE__ */ new Set();
568
568
  for (const n of r.when.rules)
569
569
  o.add(n.source);
570
570
  const l = { target: t, type: s, config: r };
571
571
  for (const n of o)
572
572
  e[n] || (e[n] = []), e[n].push(l);
573
- }, Bn = (e, t) => {
573
+ }, Pn = (e, t) => {
574
574
  var r, s;
575
- return t.includes(":") ? (r = he(e, t)) == null ? void 0 : r.value : (s = e.components[t]) == null ? void 0 : s.value;
576
- }, qe = (e, t) => Tn(t, (r, s) => (s == null ? void 0 : s.sourceType) === "context" ? e.externalContext[s.source] : Bn(e, r)), pt = (e, t, r) => {
575
+ return t.includes(":") ? (r = ve(e, t)) == null ? void 0 : r.value : (s = e.components[t]) == null ? void 0 : s.value;
576
+ }, Je = (e, t) => In(t, (r, s) => (s == null ? void 0 : s.sourceType) === "context" ? e.externalContext[s.source] : Pn(e, r)), ft = (e, t, r) => {
577
577
  const s = t(), o = s.conditionsByDependency[r];
578
578
  if (!o || o.length === 0) return null;
579
579
  let l = !1;
580
580
  const n = { ...s.conditionResults };
581
581
  for (const i of o) {
582
- const d = qe(s, i.config);
582
+ const d = Je(s, i.config);
583
583
  n[i.target] !== d && (n[i.target] = d, l = !0);
584
584
  }
585
585
  return l ? n : null;
586
- }, Pn = (e) => {
586
+ }, Un = (e) => {
587
587
  const t = {}, r = /* @__PURE__ */ new Set();
588
588
  for (const s of Object.values(e.conditionsByDependency))
589
589
  for (const o of s)
590
- r.has(o.target) || (r.add(o.target), t[o.target] = qe(e, o.config));
590
+ r.has(o.target) || (r.add(o.target), t[o.target] = Je(e, o.config));
591
591
  return t;
592
- }, rt = (e) => {
593
- if (!e || Ue(e.type)) return null;
592
+ }, Fn = (e) => {
593
+ if (!e || He(e.type)) return null;
594
594
  const t = "label" in e.properties ? e.properties.label : "", r = {
595
595
  uuid: e.uuid,
596
596
  type: e.type,
597
597
  value: e.value
598
598
  };
599
599
  return t && (r.label = t), r;
600
- }, $t = (e) => {
600
+ }, nn = (e) => {
601
601
  if (e.conditions && "when" in e.conditions)
602
602
  return e.conditions;
603
- }, Un = (e) => {
603
+ }, rn = (e, t) => {
604
+ const r = Fn(e);
605
+ return r ? ((e.type === "group" || e.type === "repeater") && e.addedComponents && (r.components = e.addedComponents.map(
606
+ (s) => s.filter(
607
+ (o) => !ie(
608
+ nn(o),
609
+ t.conditionResults[o.uuid]
610
+ )
611
+ ).map((o) => rn(o, t)).filter((o) => o !== null)
612
+ )), r) : null;
613
+ }, jn = (e) => {
604
614
  const t = {
605
615
  uuid: e.flowUUID,
606
616
  metadata: e.metadata,
@@ -609,7 +619,7 @@ const Be = (e, t) => {
609
619
  const l = e.screens[o];
610
620
  if (!l) return !1;
611
621
  const n = l.conditions && "when" in l.conditions ? l.conditions : void 0;
612
- return se(n, e.conditionResults[o]);
622
+ return ie(n, e.conditionResults[o]);
613
623
  };
614
624
  t.screens = e.screenOrder.filter((o) => !r(o)).map((o) => {
615
625
  const l = e.screens[o], n = {
@@ -617,25 +627,8 @@ const Be = (e, t) => {
617
627
  components: l.components.map((i) => {
618
628
  const d = e.components[i.uuid];
619
629
  if (!d) return null;
620
- const c = $t(d);
621
- if (se(c, e.conditionResults[i.uuid]))
622
- return null;
623
- if ((d.type === "group" || d.type === "repeater") && d.addedComponents) {
624
- const u = rt(d);
625
- return u ? {
626
- ...u,
627
- components: d.addedComponents.map(
628
- (p) => p.filter((m) => {
629
- const f = $t(m);
630
- return !se(
631
- f,
632
- e.conditionResults[m.uuid]
633
- );
634
- }).map((m) => rt(m)).filter((m) => m !== null)
635
- )
636
- } : null;
637
- }
638
- return rt(d);
630
+ const c = nn(d);
631
+ return ie(c, e.conditionResults[i.uuid]) ? null : rn(d, e);
639
632
  }).filter((i) => i !== null)
640
633
  };
641
634
  return l.label && (n.label = l.label), n;
@@ -649,7 +642,7 @@ const Be = (e, t) => {
649
642
  label: l.label,
650
643
  value: n
651
644
  };
652
- return n !== null && (i.formattedValue = vt(
645
+ return n !== null && (i.formattedValue = gt(
653
646
  n,
654
647
  l.format,
655
648
  l.decimalPlaces,
@@ -658,21 +651,21 @@ const Be = (e, t) => {
658
651
  });
659
652
  }
660
653
  return t;
661
- }, We = bt(
654
+ }, Ie = vt(
662
655
  null
663
656
  );
664
657
  function U(e) {
665
- const t = Ye(We);
658
+ const t = Ge(Ie);
666
659
  if (!t)
667
660
  throw new Error("useFBREStore must be used within an FBRE provider");
668
- return le(t, e);
661
+ return de(t, e);
669
662
  }
670
- const Ge = () => {
671
- const e = Ye(We);
663
+ const Xe = () => {
664
+ const e = Ge(Ie);
672
665
  if (!e)
673
666
  throw new Error("useFBREStoreApi must be used within an FBRE provider");
674
667
  return e;
675
- }, Le = (e) => !e || Object.keys(e).length === 0 ? null : "when" in e ? e : null, Fn = [], jn = () => Wt((e, t) => ({
668
+ }, Oe = (e) => !e || Object.keys(e).length === 0 ? null : "when" in e ? e : null, Hn = [], Kn = () => Yt((e, t) => ({
676
669
  // Identity
677
670
  flowUUID: "",
678
671
  metadata: {},
@@ -704,54 +697,54 @@ const Ge = () => {
704
697
  loadFlow: (r, s, o) => {
705
698
  const l = {}, n = [], i = {}, d = {}, c = {}, u = {}, p = {}, m = {}, f = {};
706
699
  r.screens.forEach((D) => {
707
- const T = Le(D.conditions), R = T ? { ...D, conditions: T } : { ...D };
708
- l[D.uuid] = R, n.push(D.uuid), T && pe(
700
+ const T = Oe(D.conditions), R = T ? { ...D, conditions: T } : { ...D };
701
+ l[D.uuid] = R, n.push(D.uuid), T && me(
709
702
  u,
710
703
  D.uuid,
711
704
  T,
712
705
  "screen"
713
706
  ), D.components.forEach((g) => {
714
- const h = Le(g.conditions), _ = ae(g);
715
- h && (_.conditions = h), i[g.uuid] = _, h && pe(
707
+ const h = Oe(g.conditions), _ = le(g);
708
+ h && (_.conditions = h), i[g.uuid] = _, h && me(
716
709
  u,
717
710
  g.uuid,
718
711
  h,
719
712
  "component"
720
713
  );
721
- const k = oe(_);
722
- if (k && Ne(
714
+ const k = ae(_);
715
+ if (k && Se(
723
716
  p,
724
717
  g.uuid,
725
718
  k
726
719
  ), (g.type === "group" || g.type === "repeater") && g.components) {
727
- const $ = i[g.uuid];
728
- $.addedComponents || ($.addedComponents = []);
729
- const B = g.type === "repeater" ? g.properties.initialData : void 0, V = g.type === "repeater" ? g.properties.minIterations : void 0, P = B ? B.length : g.type === "repeater" && V && V > 1 ? V : 1;
730
- for (let j = 0; j < P; j++) {
731
- const J = g.components.map((Z, ue) => {
732
- const L = ae(Z);
733
- L.uuid = [
720
+ const V = i[g.uuid];
721
+ V.addedComponents || (V.addedComponents = []);
722
+ const P = g.type === "repeater" ? g.properties.initialData : void 0, $ = g.type === "repeater" ? g.properties.minIterations : void 0, B = P ? P.length : g.type === "repeater" && $ && $ > 1 ? $ : 1;
723
+ for (let j = 0; j < B; j++) {
724
+ const Z = g.components.map((X, ne) => {
725
+ const G = le(X);
726
+ G.uuid = [
734
727
  g.uuid,
735
- $.addedComponents.length,
736
- ue
737
- ].join(":"), B && B[j] && Z.uuid in B[j] && (L.value = B[j][Z.uuid]), g.type === "group" && (d[L.uuid] = Z.uuid), j === 0 && (c[Z.uuid] = L.uuid);
738
- const W = Le(L.conditions);
739
- W && (L.conditions = W, pe(
728
+ V.addedComponents.length,
729
+ ne
730
+ ].join(":"), P && P[j] && X.uuid in P[j] && (G.value = P[j][X.uuid]), g.type === "group" && (d[G.uuid] = X.uuid), j === 0 && (c[X.uuid] = G.uuid);
731
+ const ce = Oe(G.conditions);
732
+ ce && (G.conditions = ce, me(
740
733
  u,
741
- L.uuid,
742
- W,
734
+ G.uuid,
735
+ ce,
743
736
  "component"
744
737
  ));
745
- const X = oe(L);
746
- X && Ne(
738
+ const L = ae(G);
739
+ L && Se(
747
740
  p,
748
- L.uuid,
749
- X
741
+ G.uuid,
742
+ L
750
743
  );
751
- const Q = ee(L);
752
- return L.valid = Q.length === 0, Q.length > 0 && (m[L.uuid] = Q), L;
744
+ const q = ee(G);
745
+ return G.valid = q.length === 0, q.length > 0 && (m[G.uuid] = q), G;
753
746
  });
754
- $.addedComponents.push(J);
747
+ V.addedComponents.push(Z);
755
748
  }
756
749
  }
757
750
  });
@@ -767,44 +760,44 @@ const Ge = () => {
767
760
  );
768
761
  for (let I = 0; I < _; I++)
769
762
  if (k != null && k.components) {
770
- const $ = k.components.map(
771
- (B, V) => {
772
- const P = ae(B);
773
- P.uuid = [
763
+ const V = k.components.map(
764
+ (P, $) => {
765
+ const B = le(P);
766
+ B.uuid = [
774
767
  g.uuid,
775
768
  g.addedComponents.length,
776
- V
777
- ].join(":"), g.type === "group" && (d[P.uuid] = B.uuid), c[B.uuid] || (c[B.uuid] = P.uuid);
778
- const j = Le(
779
- P.conditions
769
+ $
770
+ ].join(":"), g.type === "group" && (d[B.uuid] = P.uuid), c[P.uuid] || (c[P.uuid] = B.uuid);
771
+ const j = Oe(
772
+ B.conditions
780
773
  );
781
- j && (P.conditions = j, pe(
774
+ j && (B.conditions = j, me(
782
775
  u,
783
- P.uuid,
776
+ B.uuid,
784
777
  j,
785
778
  "component"
786
779
  ));
787
- const J = oe(P);
788
- J && Ne(
780
+ const Z = ae(B);
781
+ Z && Se(
789
782
  p,
790
- P.uuid,
791
- J
783
+ B.uuid,
784
+ Z
792
785
  );
793
- const Z = ee(P);
794
- return P.valid = Z.length === 0, Z.length > 0 && (m[P.uuid] = Z), P;
786
+ const X = ee(B);
787
+ return B.valid = X.length === 0, X.length > 0 && (m[B.uuid] = X), B;
795
788
  }
796
789
  );
797
- g.addedComponents.push($);
790
+ g.addedComponents.push(V);
798
791
  }
799
792
  }
800
793
  R.components.forEach((h) => {
801
794
  h.forEach((_) => {
802
795
  for (const k of g.addedComponents) {
803
- const I = k.find(($) => $.uuid === _.uuid);
796
+ const I = k.find((V) => V.uuid === _.uuid);
804
797
  if (I) {
805
798
  I.value = _.value;
806
- const $ = ee(I);
807
- I.valid = $.length === 0, m[I.uuid] = $;
799
+ const V = ee(I);
800
+ I.valid = V.length === 0, m[I.uuid] = V;
808
801
  break;
809
802
  }
810
803
  }
@@ -819,7 +812,7 @@ const Ge = () => {
819
812
  });
820
813
  for (const D of Object.keys(i)) {
821
814
  const T = i[D];
822
- if (!(T.type === "group" || T.type === "repeater") && oe(T) && !(D in m)) {
815
+ if (!(T.type === "group" || T.type === "repeater") && ae(T) && !(D in m)) {
823
816
  const R = ee(T);
824
817
  T.valid = R.length === 0, R.length > 0 && (m[D] = R);
825
818
  }
@@ -836,21 +829,21 @@ const Ge = () => {
836
829
  conditionResults: {},
837
830
  validationErrors: m,
838
831
  validationsByDependency: p
839
- }, y = Pn(v);
832
+ }, y = Un(v);
840
833
  v.conditionResults = y, n.forEach((D) => {
841
- f[D] = me(v, D);
834
+ f[D] = be(v, D);
842
835
  });
843
- const b = On(i), C = {
836
+ const b = Vn(i), C = {
844
837
  ...v,
845
838
  computedByDependency: b,
846
839
  calculationResults: {},
847
840
  screenValidity: f
848
841
  };
849
- ut(C);
850
- const x = r.calculations ?? [], N = Mn(x), E = {
842
+ pt(C);
843
+ const x = r.calculations ?? [], N = On(x), S = {
851
844
  ...C,
852
845
  calculations: x
853
- }, S = dt(E);
846
+ }, E = ut(S);
854
847
  e({
855
848
  flowUUID: r.uuid,
856
849
  metadata: r.metadata,
@@ -867,7 +860,7 @@ const Ge = () => {
867
860
  validationErrors: m,
868
861
  validationsByDependency: p,
869
862
  calculations: x,
870
- calculationResults: S,
863
+ calculationResults: E,
871
864
  calculationsByDependency: N,
872
865
  computedByDependency: b
873
866
  });
@@ -888,20 +881,20 @@ const Ge = () => {
888
881
  for (const p of u) {
889
882
  if (d.has(p.target)) continue;
890
883
  d.add(p.target);
891
- const m = { ...s, externalContext: r }, f = qe(m, p.config);
884
+ const m = { ...s, externalContext: r }, f = Je(m, p.config);
892
885
  n[p.target] !== f && (n[p.target] = f, i = !0);
893
886
  }
894
887
  }
895
888
  if (i) {
896
889
  const c = { ...s, conditionResults: n }, u = {};
897
890
  for (const p of s.screenOrder)
898
- u[p] = me(c, p);
891
+ u[p] = be(c, p);
899
892
  e({ externalContext: r, conditionResults: n, screenValidity: u });
900
893
  } else
901
894
  e({ externalContext: r });
902
895
  },
903
- ...An(e, t),
904
- getFlowData: () => Un(t()),
896
+ ...Bn(e, t),
897
+ getFlowData: () => jn(t()),
905
898
  getScreenByIndex: (r) => {
906
899
  const s = t();
907
900
  return r < 0 || r >= s.screenOrder.length ? null : s.screens[s.screenOrder[r]];
@@ -910,35 +903,35 @@ const Ge = () => {
910
903
  const s = t();
911
904
  return r < 0 || r >= s.screenOrder.length ? !0 : s.screenValidity[s.screenOrder[r]] ?? !0;
912
905
  },
913
- getValidationErrors: (r) => t().validationErrors[r] ?? Fn,
906
+ getValidationErrors: (r) => t().validationErrors[r] ?? Hn,
914
907
  evaluateFlowValidation: () => {
915
908
  const r = t(), s = {};
916
909
  let o = !0;
917
910
  return r.screenOrder.forEach((l) => {
918
- const n = me(r, l);
911
+ const n = be(r, l);
919
912
  s[l] = n, n || (o = !1);
920
913
  }), e({ screenValidity: s }), o;
921
914
  },
922
- getMaxScreenCount: () => t().screenOrder.length - 1,
915
+ getMaxScreenIndex: () => t().screenOrder.length - 1,
923
916
  getCalculationResult: (r) => t().calculationResults[r] ?? null
924
- })), Hn = ({ uuid: e }) => {
917
+ })), zn = ({ uuid: e }) => {
925
918
  var i;
926
919
  const t = U((d) => d.components[e]), r = U((d) => d.conditionResults[e]);
927
920
  if (!t) return null;
928
921
  const s = t.conditions && "when" in t.conditions ? t.conditions : void 0;
929
- if (se(s, r)) return null;
930
- const o = en(t.type);
922
+ if (ie(s, r)) return null;
923
+ const o = Qt(t.type);
931
924
  if (!o)
932
925
  return console.warn(`FBRE: No renderer for component type "${t.type}"`), null;
933
926
  const l = (i = t.properties) == null ? void 0 : i.width, n = l && l !== "full" ? `fbre-component fbre-width-${l}` : "fbre-component";
934
927
  return /* @__PURE__ */ a("div", { className: n, "data-uuid": e, children: /* @__PURE__ */ a(o, { uuid: e }) });
935
- }, ft = ({ screenIndex: e }) => {
928
+ }, mt = ({ screenIndex: e }) => {
936
929
  const t = U((r) => {
937
930
  const s = r.screenOrder[e];
938
931
  return s ? r.screens[s] : null;
939
932
  });
940
- return t ? /* @__PURE__ */ a("div", { className: "fbre-screen", children: t.components.map((r) => /* @__PURE__ */ a(Hn, { uuid: r.uuid }, r.uuid)) }) : null;
941
- }, ne = ({ size: e = 14 }) => /* @__PURE__ */ a(
933
+ return t ? /* @__PURE__ */ a("div", { className: "fbre-screen", children: t.components.map((r) => /* @__PURE__ */ a(zn, { uuid: r.uuid }, r.uuid)) }) : null;
934
+ }, oe = ({ size: e = 14 }) => /* @__PURE__ */ a(
942
935
  "svg",
943
936
  {
944
937
  width: e,
@@ -951,7 +944,7 @@ const Ge = () => {
951
944
  strokeLinejoin: "round",
952
945
  children: /* @__PURE__ */ a("polyline", { points: "4,12 9.5,17.5 20,7" })
953
946
  }
954
- ), _e = ({ size: e = 14 }) => /* @__PURE__ */ w(
947
+ ), Ce = ({ size: e = 14 }) => /* @__PURE__ */ w(
955
948
  "svg",
956
949
  {
957
950
  width: e,
@@ -967,7 +960,7 @@ const Ge = () => {
967
960
  /* @__PURE__ */ a("line", { x1: "11", y1: "1", x2: "11", y2: "4" })
968
961
  ]
969
962
  }
970
- ), mt = ({ size: e = 14 }) => /* @__PURE__ */ w(
963
+ ), ht = ({ size: e = 14 }) => /* @__PURE__ */ w(
971
964
  "svg",
972
965
  {
973
966
  width: e,
@@ -982,7 +975,7 @@ const Ge = () => {
982
975
  /* @__PURE__ */ a("line", { x1: "8", y1: "8", x2: "11", y2: "10" })
983
976
  ]
984
977
  }
985
- ), Ee = ({ size: e = 12 }) => /* @__PURE__ */ a("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ a("path", { d: "M7 10l5 5 5-5z" }) }), Kn = ({ size: e = 18 }) => /* @__PURE__ */ a("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ a("path", { d: "M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z" }) }), zn = ({ size: e = 18 }) => /* @__PURE__ */ a("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ a("path", { d: "M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z" }) }), Yn = ({ size: e = 16 }) => /* @__PURE__ */ a("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ a("path", { d: "M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z" }) }), qn = ({ size: e = 16 }) => /* @__PURE__ */ a("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ a("path", { d: "M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z" }) }), Wn = ({ size: e = 20 }) => /* @__PURE__ */ a("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ a("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z" }) }), gt = ({ size: e = 28 }) => /* @__PURE__ */ a("svg", { viewBox: "0 0 24 24", width: e, height: e, children: /* @__PURE__ */ a("path", { d: "M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z" }) }), Gn = ({ size: e = 16 }) => /* @__PURE__ */ a("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ a("path", { d: "M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z" }) }), Jn = ({ size: e = 18 }) => /* @__PURE__ */ w(
978
+ ), Le = ({ size: e = 12 }) => /* @__PURE__ */ a("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ a("path", { d: "M7 10l5 5 5-5z" }) }), Yn = ({ size: e = 18 }) => /* @__PURE__ */ a("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ a("path", { d: "M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z" }) }), qn = ({ size: e = 18 }) => /* @__PURE__ */ a("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ a("path", { d: "M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z" }) }), Wn = ({ size: e = 16 }) => /* @__PURE__ */ a("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ a("path", { d: "M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z" }) }), Gn = ({ size: e = 16 }) => /* @__PURE__ */ a("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ a("path", { d: "M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z" }) }), Jn = ({ size: e = 20 }) => /* @__PURE__ */ a("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ a("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z" }) }), yt = ({ size: e = 28 }) => /* @__PURE__ */ a("svg", { viewBox: "0 0 24 24", width: e, height: e, children: /* @__PURE__ */ a("path", { d: "M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z" }) }), Xn = ({ size: e = 16 }) => /* @__PURE__ */ a("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ a("path", { d: "M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z" }) }), Qn = ({ size: e = 18 }) => /* @__PURE__ */ w(
986
979
  "svg",
987
980
  {
988
981
  width: e,
@@ -999,7 +992,7 @@ const Ge = () => {
999
992
  /* @__PURE__ */ a("line", { x1: "12", y1: "8", x2: "12.01", y2: "8" })
1000
993
  ]
1001
994
  }
1002
- ), Xn = ({ size: e = 18 }) => /* @__PURE__ */ w(
995
+ ), Zn = ({ size: e = 18 }) => /* @__PURE__ */ w(
1003
996
  "svg",
1004
997
  {
1005
998
  width: e,
@@ -1015,7 +1008,7 @@ const Ge = () => {
1015
1008
  /* @__PURE__ */ a("polyline", { points: "9,12 11.5,14.5 16,9.5" })
1016
1009
  ]
1017
1010
  }
1018
- ), Qn = ({ size: e = 18 }) => /* @__PURE__ */ w(
1011
+ ), er = ({ size: e = 18 }) => /* @__PURE__ */ w(
1019
1012
  "svg",
1020
1013
  {
1021
1014
  width: e,
@@ -1032,7 +1025,7 @@ const Ge = () => {
1032
1025
  /* @__PURE__ */ a("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
1033
1026
  ]
1034
1027
  }
1035
- ), Zn = ({ size: e = 16 }) => /* @__PURE__ */ w(
1028
+ ), tr = ({ size: e = 16 }) => /* @__PURE__ */ w(
1036
1029
  "svg",
1037
1030
  {
1038
1031
  width: e,
@@ -1048,7 +1041,7 @@ const Ge = () => {
1048
1041
  /* @__PURE__ */ a("path", { d: "M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2" })
1049
1042
  ]
1050
1043
  }
1051
- ), er = ({ size: e = 18 }) => /* @__PURE__ */ w(
1044
+ ), nr = ({ size: e = 18 }) => /* @__PURE__ */ w(
1052
1045
  "svg",
1053
1046
  {
1054
1047
  width: e,
@@ -1065,7 +1058,7 @@ const Ge = () => {
1065
1058
  /* @__PURE__ */ a("path", { d: "M12 2a7 7 0 00-4 12.7V17h8v-2.3A7 7 0 0012 2z" })
1066
1059
  ]
1067
1060
  }
1068
- ), tr = ({ size: e = 18 }) => /* @__PURE__ */ w(
1061
+ ), rr = ({ size: e = 18 }) => /* @__PURE__ */ w(
1069
1062
  "svg",
1070
1063
  {
1071
1064
  width: e,
@@ -1081,7 +1074,7 @@ const Ge = () => {
1081
1074
  /* @__PURE__ */ a("path", { d: "M11.6 16.8a3 3 0 11-5.8-1.6" })
1082
1075
  ]
1083
1076
  }
1084
- ), nr = ({ size: e = 18 }) => /* @__PURE__ */ w(
1077
+ ), or = ({ size: e = 18 }) => /* @__PURE__ */ w(
1085
1078
  "svg",
1086
1079
  {
1087
1080
  width: e,
@@ -1097,7 +1090,7 @@ const Ge = () => {
1097
1090
  /* @__PURE__ */ a("path", { d: "M13.73 21a2 2 0 01-3.46 0" })
1098
1091
  ]
1099
1092
  }
1100
- ), rr = ({ size: e = 18 }) => /* @__PURE__ */ a(
1093
+ ), sr = ({ size: e = 18 }) => /* @__PURE__ */ a(
1101
1094
  "svg",
1102
1095
  {
1103
1096
  width: e,
@@ -1110,7 +1103,7 @@ const Ge = () => {
1110
1103
  strokeLinejoin: "round",
1111
1104
  children: /* @__PURE__ */ a("path", { d: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" })
1112
1105
  }
1113
- ), or = ({ size: e = 18 }) => /* @__PURE__ */ w(
1106
+ ), ar = ({ size: e = 18 }) => /* @__PURE__ */ w(
1114
1107
  "svg",
1115
1108
  {
1116
1109
  width: e,
@@ -1139,7 +1132,7 @@ const Ge = () => {
1139
1132
  strokeLinejoin: "round",
1140
1133
  children: /* @__PURE__ */ a("path", { d: "M20.84 4.61a5.5 5.5 0 00-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 00-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 000-7.78z" })
1141
1134
  }
1142
- ), sr = ({ size: e = 18 }) => /* @__PURE__ */ w(
1135
+ ), lr = ({ size: e = 18 }) => /* @__PURE__ */ w(
1143
1136
  "svg",
1144
1137
  {
1145
1138
  width: e,
@@ -1155,7 +1148,7 @@ const Ge = () => {
1155
1148
  /* @__PURE__ */ a("line", { x1: "4", y1: "22", x2: "4", y2: "15" })
1156
1149
  ]
1157
1150
  }
1158
- ), ar = ({ size: e = 18 }) => /* @__PURE__ */ a(
1151
+ ), ir = ({ size: e = 18 }) => /* @__PURE__ */ a(
1159
1152
  "svg",
1160
1153
  {
1161
1154
  width: e,
@@ -1168,7 +1161,7 @@ const Ge = () => {
1168
1161
  strokeLinejoin: "round",
1169
1162
  children: /* @__PURE__ */ a("path", { d: "M19 21l-7-5-7 5V5a2 2 0 012-2h10a2 2 0 012 2z" })
1170
1163
  }
1171
- ), lr = ({ size: e = 18 }) => /* @__PURE__ */ a(
1164
+ ), cr = ({ size: e = 18 }) => /* @__PURE__ */ a(
1172
1165
  "svg",
1173
1166
  {
1174
1167
  width: e,
@@ -1181,7 +1174,7 @@ const Ge = () => {
1181
1174
  strokeLinejoin: "round",
1182
1175
  children: /* @__PURE__ */ a("polygon", { points: "13,2 3,14 12,14 11,22 21,10 12,10 13,2" })
1183
1176
  }
1184
- ), ir = ({ size: e = 18 }) => /* @__PURE__ */ w(
1177
+ ), dr = ({ size: e = 18 }) => /* @__PURE__ */ w(
1185
1178
  "svg",
1186
1179
  {
1187
1180
  width: e,
@@ -1197,7 +1190,7 @@ const Ge = () => {
1197
1190
  /* @__PURE__ */ a("path", { d: "M16.5 3.5a2.121 2.121 0 013 3L7 19l-4 1 1-4L16.5 3.5z" })
1198
1191
  ]
1199
1192
  }
1200
- ), cr = ({ size: e = 18 }) => /* @__PURE__ */ w(
1193
+ ), ur = ({ size: e = 18 }) => /* @__PURE__ */ w(
1201
1194
  "svg",
1202
1195
  {
1203
1196
  width: e,
@@ -1214,7 +1207,7 @@ const Ge = () => {
1214
1207
  /* @__PURE__ */ a("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
1215
1208
  ]
1216
1209
  }
1217
- ), dr = ({ size: e = 18 }) => /* @__PURE__ */ w(
1210
+ ), pr = ({ size: e = 18 }) => /* @__PURE__ */ w(
1218
1211
  "svg",
1219
1212
  {
1220
1213
  width: e,
@@ -1230,7 +1223,7 @@ const Ge = () => {
1230
1223
  /* @__PURE__ */ a("path", { d: "M7 22H4a2 2 0 01-2-2v-7a2 2 0 012-2h3" })
1231
1224
  ]
1232
1225
  }
1233
- ), ur = ({ size: e = 18 }) => /* @__PURE__ */ a(
1226
+ ), fr = ({ size: e = 18 }) => /* @__PURE__ */ a(
1234
1227
  "svg",
1235
1228
  {
1236
1229
  width: e,
@@ -1243,7 +1236,7 @@ const Ge = () => {
1243
1236
  strokeLinejoin: "round",
1244
1237
  children: /* @__PURE__ */ a("circle", { cx: "12", cy: "12", r: "10" })
1245
1238
  }
1246
- ), pr = ({ size: e = 18 }) => /* @__PURE__ */ a(
1239
+ ), mr = ({ size: e = 18 }) => /* @__PURE__ */ a(
1247
1240
  "svg",
1248
1241
  {
1249
1242
  width: e,
@@ -1256,29 +1249,29 @@ const Ge = () => {
1256
1249
  strokeLinejoin: "round",
1257
1250
  children: /* @__PURE__ */ a("rect", { x: "12", y: "1", width: "15.56", height: "15.56", rx: "2", transform: "rotate(45 12 1)" })
1258
1251
  }
1259
- ), ot = {
1260
- info: Jn,
1261
- check: Xn,
1262
- warning: Qn,
1263
- question: cr,
1264
- lightbulb: er,
1265
- megaphone: tr,
1266
- bell: nr,
1267
- shield: rr,
1268
- lock: or,
1252
+ ), st = {
1253
+ info: Qn,
1254
+ check: Zn,
1255
+ warning: er,
1256
+ question: ur,
1257
+ lightbulb: nr,
1258
+ megaphone: rr,
1259
+ bell: or,
1260
+ shield: sr,
1261
+ lock: ar,
1269
1262
  heart: on,
1270
- flag: sr,
1271
- bookmark: ar,
1272
- zap: lr,
1273
- pencil: ir,
1274
- star: gt
1275
- }, fr = {
1276
- star: gt,
1263
+ flag: lr,
1264
+ bookmark: ir,
1265
+ zap: cr,
1266
+ pencil: dr,
1267
+ star: yt
1268
+ }, hr = {
1269
+ star: yt,
1277
1270
  heart: on,
1278
- thumbsUp: dr,
1279
- circle: ur,
1280
- diamond: pr
1281
- }, Re = ({
1271
+ thumbsUp: pr,
1272
+ circle: fr,
1273
+ diamond: mr
1274
+ }, Ve = ({
1282
1275
  position: e,
1283
1276
  screenIndex: t,
1284
1277
  maxScreenIndex: r,
@@ -1304,7 +1297,7 @@ const Ge = () => {
1304
1297
  disabled: t === 0 && !n || v,
1305
1298
  onClick: m,
1306
1299
  children: [
1307
- /* @__PURE__ */ a(Yn, {}),
1300
+ /* @__PURE__ */ a(Wn, {}),
1308
1301
  c || "Back"
1309
1302
  ]
1310
1303
  }
@@ -1321,7 +1314,7 @@ const Ge = () => {
1321
1314
  },
1322
1315
  children: [
1323
1316
  d || (l ? n ? "Complete" : "Review" : "Complete"),
1324
- v ? /* @__PURE__ */ a("span", { className: "fbre-btn__spinner" }) : /* @__PURE__ */ a(ne, { size: 16 })
1317
+ v ? /* @__PURE__ */ a("span", { className: "fbre-btn__spinner" }) : /* @__PURE__ */ a(oe, { size: 16 })
1325
1318
  ]
1326
1319
  }
1327
1320
  ) : /* @__PURE__ */ w(
@@ -1335,14 +1328,14 @@ const Ge = () => {
1335
1328
  },
1336
1329
  children: [
1337
1330
  d || b,
1338
- v ? /* @__PURE__ */ a("span", { className: "fbre-btn__spinner" }) : y ? /* @__PURE__ */ a(ne, { size: 16 }) : /* @__PURE__ */ a(qn, {})
1331
+ v ? /* @__PURE__ */ a("span", { className: "fbre-btn__spinner" }) : y ? /* @__PURE__ */ a(oe, { size: 16 }) : /* @__PURE__ */ a(Gn, {})
1339
1332
  ]
1340
1333
  }
1341
1334
  );
1342
- }, mr = ({ current: e, total: t, stepperStyle: r }) => {
1335
+ }, br = ({ current: e, total: t, stepperStyle: r }) => {
1343
1336
  if (t <= 1) return null;
1344
1337
  const s = t > 1 ? e / (t - 1) * 100 : 100, l = !!r && r !== "default" || t <= 6;
1345
- return /* @__PURE__ */ w(ie, { children: [
1338
+ return /* @__PURE__ */ w(ue, { children: [
1346
1339
  l && /* @__PURE__ */ a("div", { className: "fbre-stepper fbre-stepper--dots", children: Array.from({ length: t }, (n, i) => /* @__PURE__ */ a(
1347
1340
  "div",
1348
1341
  {
@@ -1372,14 +1365,14 @@ const Ge = () => {
1372
1365
  }
1373
1366
  ) })
1374
1367
  ] });
1375
- }, hr = ({ current: e, total: t }) => t <= 1 ? null : /* @__PURE__ */ w("div", { className: "fbre-stepper-text", children: [
1368
+ }, vr = ({ current: e, total: t }) => t <= 1 ? null : /* @__PURE__ */ w("div", { className: "fbre-stepper-text", children: [
1376
1369
  "Step ",
1377
1370
  e + 1,
1378
1371
  " of ",
1379
1372
  t
1380
- ] }), br = (e) => {
1373
+ ] }), gr = (e) => {
1381
1374
  const t = e.controlsLayout ?? "default", s = e.showStepper !== !1 && (e.stepperStyle ?? "default") !== "text" && e.maxScreenIndex > 0, o = e.screenIndex > 0 || e.summaryActive, l = o ? 2 : 1, n = s ? /* @__PURE__ */ a(
1382
- mr,
1375
+ br,
1383
1376
  {
1384
1377
  current: e.screenIndex,
1385
1378
  total: e.maxScreenIndex + 1,
@@ -1393,9 +1386,9 @@ const Ge = () => {
1393
1386
  "data-button-count": l,
1394
1387
  "data-solo": !o && !s ? "true" : void 0,
1395
1388
  children: [
1396
- o ? /* @__PURE__ */ a(Re, { position: "back", ...e }) : /* @__PURE__ */ a("div", {}),
1389
+ o ? /* @__PURE__ */ a(Ve, { position: "back", ...e }) : /* @__PURE__ */ a("div", {}),
1397
1390
  n ?? /* @__PURE__ */ a("div", {}),
1398
- /* @__PURE__ */ a(Re, { position: "next", ...e })
1391
+ /* @__PURE__ */ a(Ve, { position: "next", ...e })
1399
1392
  ]
1400
1393
  }
1401
1394
  ) : /* @__PURE__ */ w(
@@ -1406,8 +1399,8 @@ const Ge = () => {
1406
1399
  children: [
1407
1400
  n && /* @__PURE__ */ a("div", { className: "fbre-controls__stepper", children: n }),
1408
1401
  /* @__PURE__ */ w("div", { className: "fbre-controls__row", children: [
1409
- o && /* @__PURE__ */ a(Re, { position: "back", ...e }),
1410
- /* @__PURE__ */ a(Re, { position: "next", ...e })
1402
+ o && /* @__PURE__ */ a(Ve, { position: "back", ...e }),
1403
+ /* @__PURE__ */ a(Ve, { position: "next", ...e })
1411
1404
  ] })
1412
1405
  ]
1413
1406
  }
@@ -1470,17 +1463,17 @@ const Ge = () => {
1470
1463
  ]
1471
1464
  }
1472
1465
  );
1473
- }, st = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;"), we = (e, t) => {
1474
- const r = e.replace(Xt, (s, o) => {
1466
+ }, at = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;"), xe = (e, t) => {
1467
+ const r = e.replace(Gt, (s, o) => {
1475
1468
  const l = t.resolveCalculation(o);
1476
- if (l !== null) return st(l);
1469
+ if (l !== null) return at(l);
1477
1470
  const n = t.resolveComponentValue(o);
1478
- if (n !== null) return st(n);
1471
+ if (n !== null) return at(n);
1479
1472
  const i = t.resolveContext(o);
1480
- return i !== null ? st(i) : "";
1473
+ return i !== null ? at(i) : "";
1481
1474
  });
1482
- return Qt(r);
1483
- }, be = (e, t) => e.replace(Xt, (r, s) => {
1475
+ return Jt(r);
1476
+ }, ge = (e, t) => e.replace(Gt, (r, s) => {
1484
1477
  const o = t.resolveCalculation(s);
1485
1478
  if (o !== null) return o;
1486
1479
  const l = t.resolveComponentValue(s);
@@ -1488,9 +1481,9 @@ const Ge = () => {
1488
1481
  const n = t.resolveContext(s);
1489
1482
  return n !== null ? n : "";
1490
1483
  });
1491
- function ve() {
1484
+ function ye() {
1492
1485
  const e = U((l) => l.components), t = U((l) => l.templateComponentMap), r = U((l) => l.calculations), s = U((l) => l.calculationResults), o = U((l) => l.externalContext);
1493
- return De(() => {
1486
+ return Te(() => {
1494
1487
  const l = new Map(r.map((i) => [i.uuid, i])), n = (i) => {
1495
1488
  var m, f;
1496
1489
  const d = e[i];
@@ -1511,7 +1504,7 @@ function ve() {
1511
1504
  const d = l.get(i);
1512
1505
  if (!d) return null;
1513
1506
  const c = s[i] ?? null;
1514
- return vt(
1507
+ return gt(
1515
1508
  c,
1516
1509
  d.format,
1517
1510
  d.decimalPlaces,
@@ -1531,8 +1524,8 @@ function ve() {
1531
1524
  o
1532
1525
  ]);
1533
1526
  }
1534
- const vr = ({ screen: e, showToggle: t }) => {
1535
- const r = ve(), [s, o] = O(!0);
1527
+ const yr = ({ screen: e, showToggle: t }) => {
1528
+ const r = ye(), [s, o] = M(!0);
1536
1529
  return /* @__PURE__ */ w("div", { children: [
1537
1530
  /* @__PURE__ */ w(
1538
1531
  "div",
@@ -1540,12 +1533,12 @@ const vr = ({ screen: e, showToggle: t }) => {
1540
1533
  className: "fbre-summary__screen-header",
1541
1534
  onClick: () => t && o(!s),
1542
1535
  children: [
1543
- e.label && /* @__PURE__ */ a("span", { className: "fbre-summary__screen-label", children: be(e.label, r) }),
1536
+ e.label && /* @__PURE__ */ a("span", { className: "fbre-summary__screen-label", children: ge(e.label, r) }),
1544
1537
  t && /* @__PURE__ */ a(
1545
1538
  "span",
1546
1539
  {
1547
1540
  className: `fbre-summary__screen-toggle${s ? "" : " collapsed"}`,
1548
- children: /* @__PURE__ */ a(Ee, { size: 20 })
1541
+ children: /* @__PURE__ */ a(Le, { size: 20 })
1549
1542
  }
1550
1543
  )
1551
1544
  ]
@@ -1559,15 +1552,15 @@ const vr = ({ screen: e, showToggle: t }) => {
1559
1552
  }
1560
1553
  )
1561
1554
  ] });
1562
- }, At = () => {
1563
- const e = Ge(), t = U((o) => o.components), r = De(
1555
+ }, Vt = () => {
1556
+ const e = Xe(), t = U((o) => o.components), r = Te(
1564
1557
  () => e.getState().getFlowData(),
1565
1558
  [e, t]
1566
1559
  ), s = r.screens.length;
1567
1560
  return /* @__PURE__ */ w("div", { className: "fbre-summary", children: [
1568
1561
  /* @__PURE__ */ a("h2", { className: "fbre-summary__title", children: "Review" }),
1569
1562
  /* @__PURE__ */ a("div", { className: "fbre-summary__body", children: r.screens.map((o) => /* @__PURE__ */ a(
1570
- vr,
1563
+ yr,
1571
1564
  {
1572
1565
  screen: o,
1573
1566
  showToggle: s > 1
@@ -1575,18 +1568,18 @@ const vr = ({ screen: e, showToggle: t }) => {
1575
1568
  o.uuid
1576
1569
  )) })
1577
1570
  ] });
1578
- }, gr = ({
1571
+ }, an = ({
1579
1572
  title: e,
1580
1573
  body: t
1581
1574
  }) => {
1582
- const r = ve();
1575
+ const r = ye();
1583
1576
  return /* @__PURE__ */ w("div", { className: "fbre-confirmation", children: [
1584
1577
  e && /* @__PURE__ */ a(
1585
1578
  "h2",
1586
1579
  {
1587
1580
  className: "fbre-confirmation__title",
1588
1581
  dangerouslySetInnerHTML: {
1589
- __html: we(e, r)
1582
+ __html: xe(e, r)
1590
1583
  }
1591
1584
  }
1592
1585
  ),
@@ -1595,55 +1588,55 @@ const vr = ({ screen: e, showToggle: t }) => {
1595
1588
  {
1596
1589
  className: "fbre-confirmation__body",
1597
1590
  dangerouslySetInnerHTML: {
1598
- __html: we(t, r)
1591
+ __html: xe(t, r)
1599
1592
  }
1600
1593
  }
1601
1594
  )
1602
1595
  ] });
1603
- }, an = (e, t, r) => t ? !se(t, r[e]) : !0, je = (e, t) => {
1596
+ }, ln = (e, t, r) => t ? !ie(t, r[e]) : !0, ze = (e, t) => {
1604
1597
  const r = e.screenOrder.length - 1;
1605
1598
  let s = t + 1;
1606
1599
  for (; s <= r; ) {
1607
1600
  const o = e.screenOrder[s], l = e.screens[o], n = l != null && l.conditions && "when" in l.conditions ? l.conditions : void 0;
1608
- if (an(o, n, e.conditionResults)) return s;
1601
+ if (ln(o, n, e.conditionResults)) return s;
1609
1602
  s++;
1610
1603
  }
1611
1604
  return null;
1612
- }, yr = (e, t) => {
1605
+ }, _r = (e, t) => {
1613
1606
  let r = t - 1;
1614
1607
  for (; r >= 0; ) {
1615
1608
  const s = e.screenOrder[r], o = e.screens[s], l = o != null && o.conditions && "when" in o.conditions ? o.conditions : void 0;
1616
- if (an(s, l, e.conditionResults)) return r;
1609
+ if (ln(s, l, e.conditionResults)) return r;
1617
1610
  r--;
1618
1611
  }
1619
1612
  return 0;
1620
1613
  };
1621
- function G(e, t, r) {
1614
+ function J(e, t, r) {
1622
1615
  return `color-mix(in srgb, ${e} ${t}%, ${r})`;
1623
1616
  }
1624
- const te = "var(--fbre-bg)", Me = "var(--fbre-text)";
1625
- function ln(e) {
1617
+ const te = "var(--fbre-bg)", $e = "var(--fbre-text)";
1618
+ function cn(e) {
1626
1619
  const t = {};
1627
1620
  if (!e) return t;
1628
1621
  if (e.color) {
1629
1622
  const r = "var(--fbre-theme-color)";
1630
- t["--fbre-theme-color"] = e.color, t["--fbre-theme-light"] = G(r, 14, te), t["--fbre-theme-dark"] = G(r, 82, "#000");
1623
+ t["--fbre-theme-color"] = e.color, t["--fbre-theme-light"] = J(r, 14, te), t["--fbre-theme-dark"] = J(r, 82, "#000");
1631
1624
  }
1632
1625
  if (e.background && (t["--fbre-bg"] = e.background), e.surface) {
1633
1626
  const r = "var(--fbre-surface)";
1634
- t["--fbre-surface"] = e.surface, t["--fbre-surface-hover"] = G(r, 96, Me), t["--fbre-surface-subtle"] = G(r, 90, Me), t["--fbre-surface-alt"] = G(r, 82, Me), t["--fbre-control-surface"] = r, t["--fbre-input-bg"] = r, t["--fbre-input-bg-focus"] = G(r, 60, te);
1627
+ t["--fbre-surface"] = e.surface, t["--fbre-surface-hover"] = J(r, 96, $e), t["--fbre-surface-subtle"] = J(r, 90, $e), t["--fbre-surface-alt"] = J(r, 82, $e), t["--fbre-control-surface"] = r, t["--fbre-input-bg"] = r, t["--fbre-input-bg-focus"] = J(r, 60, te);
1635
1628
  }
1636
1629
  if (e.text) {
1637
1630
  const r = "var(--fbre-text)";
1638
- t["--fbre-text"] = e.text, t["--fbre-text-secondary"] = G(r, 64, te), t["--fbre-label"] = G(r, 64, te), t["--fbre-text-placeholder"] = G(r, 42, te), t["--fbre-text-disabled"] = G(r, 34, te);
1631
+ t["--fbre-text"] = e.text, t["--fbre-text-secondary"] = J(r, 64, te), t["--fbre-label"] = J(r, 64, te), t["--fbre-text-placeholder"] = J(r, 42, te), t["--fbre-text-disabled"] = J(r, 34, te);
1639
1632
  }
1640
1633
  if (e.border) {
1641
1634
  const r = "var(--fbre-border)";
1642
- t["--fbre-border"] = e.border, t["--fbre-border-hover"] = G(r, 70, Me), t["--fbre-border-light"] = G(r, 60, te), t["--fbre-border-subtle"] = G(r, 35, te);
1635
+ t["--fbre-border"] = e.border, t["--fbre-border-hover"] = J(r, 70, $e), t["--fbre-border-light"] = J(r, 60, te), t["--fbre-border-subtle"] = J(r, 35, te);
1643
1636
  }
1644
- return e.radius && (t["--fbre-radius"] = e.radius), e.fontFamily && (t["--fbre-font"] = e.fontFamily), e.error && (t["--fbre-error"] = e.error, t["--fbre-error-light"] = G("var(--fbre-error)", 14, te)), e.success && (t["--fbre-success"] = e.success, t["--fbre-success-bg"] = G("var(--fbre-success)", 14, te), t["--fbre-success-border"] = G("var(--fbre-success)", 40, te)), e.warning && (t["--fbre-warning"] = e.warning, t["--fbre-warning-bg"] = G("var(--fbre-warning)", 14, te), t["--fbre-warning-border"] = G("var(--fbre-warning)", 40, te)), t;
1637
+ return e.radius && (t["--fbre-radius"] = e.radius), e.fontFamily && (t["--fbre-font"] = e.fontFamily), e.error && (t["--fbre-error"] = e.error, t["--fbre-error-light"] = J("var(--fbre-error)", 14, te)), e.success && (t["--fbre-success"] = e.success, t["--fbre-success-bg"] = J("var(--fbre-success)", 14, te), t["--fbre-success-border"] = J("var(--fbre-success)", 40, te)), e.warning && (t["--fbre-warning"] = e.warning, t["--fbre-warning-bg"] = J("var(--fbre-warning)", 14, te), t["--fbre-warning-border"] = J("var(--fbre-warning)", 40, te)), t;
1645
1638
  }
1646
- const _r = /* @__PURE__ */ new Set([
1639
+ const wr = /* @__PURE__ */ new Set([
1647
1640
  "text",
1648
1641
  "header",
1649
1642
  "callout",
@@ -1651,7 +1644,7 @@ const _r = /* @__PURE__ */ new Set([
1651
1644
  "table",
1652
1645
  "computed"
1653
1646
  ]);
1654
- function cn(e, t) {
1647
+ function dn(e, t) {
1655
1648
  const r = e.screenOrder[t];
1656
1649
  if (!r) return 0;
1657
1650
  const s = e.screens[r];
@@ -1659,39 +1652,39 @@ function cn(e, t) {
1659
1652
  let o = 0;
1660
1653
  for (const l of s.components) {
1661
1654
  const n = e.components[l.uuid];
1662
- if (!n || _r.has(n.type)) continue;
1655
+ if (!n || wr.has(n.type)) continue;
1663
1656
  const i = n.conditions && "when" in n.conditions ? n.conditions : void 0;
1664
- se(i, e.conditionResults[l.uuid]) || (o += 1);
1657
+ ie(i, e.conditionResults[l.uuid]) || (o += 1);
1665
1658
  }
1666
1659
  return o;
1667
1660
  }
1668
- const yt = /* @__PURE__ */ new Set([
1661
+ const _t = /* @__PURE__ */ new Set([
1669
1662
  "radio",
1670
1663
  "yesNo",
1671
1664
  "cardSelect",
1672
1665
  "dropDown"
1673
- ]), wr = 500;
1674
- function dn(e, t, r) {
1675
- const s = Ge(), o = M(null), l = M(""), n = M(0);
1666
+ ]), Cr = 500;
1667
+ function un(e, t, r) {
1668
+ const s = Xe(), o = O(null), l = O(""), n = O(0);
1676
1669
  K(() => {
1677
1670
  if (!e) return;
1678
- const i = s.getState(), d = Bt(i, t);
1679
- d && (l.current = Pt(i.components, d)), n.current = i.selectionTick;
1671
+ const i = s.getState(), d = $t(i, t);
1672
+ d && (l.current = At(i.components, d)), n.current = i.selectionTick;
1680
1673
  }, [e, t, s]), K(() => {
1681
1674
  if (!e) return;
1682
1675
  const i = s.subscribe((d) => {
1683
- const c = Bt(d, t);
1676
+ const c = $t(d, t);
1684
1677
  if (!c) return;
1685
1678
  const u = d.selectionTick, p = u !== n.current;
1686
1679
  p && (n.current = u);
1687
- const m = Pt(d.components, c);
1680
+ const m = At(d.components, c);
1688
1681
  if (m === l.current && !p) return;
1689
1682
  const f = l.current;
1690
- if (l.current = m, !(m !== f ? Cr(d.components, c, f) : p && xr(d.components, c)) || je(d, t) === null) return;
1683
+ if (l.current = m, !(m !== f ? xr(d.components, c, f) : p && Nr(d.components, c)) || ze(d, t) === null) return;
1691
1684
  const b = d.screenOrder[t];
1692
- b && d.screenValidity[b] === !1 || cn(d, t) === 1 && (o.current && clearTimeout(o.current), o.current = setTimeout(() => {
1685
+ b && d.screenValidity[b] === !1 || dn(d, t) === 1 && (o.current && clearTimeout(o.current), o.current = setTimeout(() => {
1693
1686
  o.current = null, r();
1694
- }, wr));
1687
+ }, Cr));
1695
1688
  });
1696
1689
  return () => {
1697
1690
  i(), o.current && (clearTimeout(o.current), o.current = null);
@@ -1700,21 +1693,21 @@ function dn(e, t, r) {
1700
1693
  o.current && (clearTimeout(o.current), o.current = null);
1701
1694
  }, [t]);
1702
1695
  }
1703
- function Bt(e, t) {
1696
+ function $t(e, t) {
1704
1697
  const r = e.screenOrder[t];
1705
1698
  if (!r) return null;
1706
1699
  const s = e.screens[r];
1707
1700
  return s ? s.components.map((o) => o.uuid) : null;
1708
1701
  }
1709
- function Pt(e, t) {
1702
+ function At(e, t) {
1710
1703
  const r = [];
1711
1704
  for (const s of t) {
1712
1705
  const o = e[s];
1713
- !o || !yt.has(o.type) || r.push(`${s}=${JSON.stringify(o.value ?? null)}`);
1706
+ !o || !_t.has(o.type) || r.push(`${s}=${JSON.stringify(o.value ?? null)}`);
1714
1707
  }
1715
1708
  return r.join("|");
1716
1709
  }
1717
- function Cr(e, t, r) {
1710
+ function xr(e, t, r) {
1718
1711
  const s = /* @__PURE__ */ new Map();
1719
1712
  for (const o of r.split("|")) {
1720
1713
  const l = o.indexOf("=");
@@ -1722,22 +1715,22 @@ function Cr(e, t, r) {
1722
1715
  }
1723
1716
  for (const o of t) {
1724
1717
  const l = e[o];
1725
- if (!l || !yt.has(l.type)) continue;
1718
+ if (!l || !_t.has(l.type)) continue;
1726
1719
  const n = JSON.stringify(l.value ?? null), i = s.get(o) ?? "null";
1727
1720
  if (n !== i && n !== "null") return !0;
1728
1721
  }
1729
1722
  return !1;
1730
1723
  }
1731
- function xr(e, t) {
1724
+ function Nr(e, t) {
1732
1725
  for (const r of t) {
1733
1726
  const s = e[r];
1734
- if (!(!s || !yt.has(s.type)) && s.value !== null && s.value !== void 0)
1727
+ if (!(!s || !_t.has(s.type)) && s.value !== null && s.value !== void 0)
1735
1728
  return !0;
1736
1729
  }
1737
1730
  return !1;
1738
1731
  }
1739
- function un(e, t, r) {
1740
- const s = Ge();
1732
+ function pn(e, t, r) {
1733
+ const s = Xe();
1741
1734
  K(() => {
1742
1735
  if (!e) return;
1743
1736
  const o = (l) => {
@@ -1745,15 +1738,15 @@ function un(e, t, r) {
1745
1738
  const n = l.target;
1746
1739
  if (n.tagName !== "INPUT" || !n.closest(".fbre-container")) return;
1747
1740
  const i = s.getState();
1748
- if (je(i, t) === null) return;
1741
+ if (ze(i, t) === null) return;
1749
1742
  const c = i.screenOrder[t];
1750
- c && i.screenValidity[c] === !1 || cn(i, t) === 1 && (l.preventDefault(), r());
1743
+ c && i.screenValidity[c] === !1 || dn(i, t) === 1 && (l.preventDefault(), r());
1751
1744
  };
1752
1745
  return document.addEventListener("keydown", o), () => document.removeEventListener("keydown", o);
1753
1746
  }, [e, t, r, s]);
1754
1747
  }
1755
- const pn = bt(null), Ut = [], z = (e) => {
1756
- const t = Ye(pn), r = U((i) => {
1748
+ const fn = vt(null), Bt = [], z = (e) => {
1749
+ const t = Ge(fn), r = U((i) => {
1757
1750
  var d;
1758
1751
  return (d = i.components[e]) == null ? void 0 : d.value;
1759
1752
  }), s = U((i) => {
@@ -1763,13 +1756,13 @@ const pn = bt(null), Ut = [], z = (e) => {
1763
1756
  var d;
1764
1757
  return (d = i.components[e]) == null ? void 0 : d.valid;
1765
1758
  }), l = U(
1766
- (i) => i.validationErrors[e] ?? Ut
1759
+ (i) => i.validationErrors[e] ?? Bt
1767
1760
  ), n = U((i) => i.updateComponentValue);
1768
1761
  return t ? {
1769
1762
  value: t.value,
1770
1763
  properties: t.properties,
1771
1764
  valid: t.valid,
1772
- validationErrors: Ut,
1765
+ validationErrors: Bt,
1773
1766
  updateValue: n
1774
1767
  } : {
1775
1768
  value: r,
@@ -1778,72 +1771,72 @@ const pn = bt(null), Ut = [], z = (e) => {
1778
1771
  validationErrors: l,
1779
1772
  updateValue: n
1780
1773
  };
1781
- }, Ce = (e, t) => z(e), Nr = ({ uuid: e }) => {
1782
- const { properties: t } = Ce(e), r = ve(), s = t == null ? void 0 : t.value;
1774
+ }, Ne = (e, t) => z(e), kr = ({ uuid: e }) => {
1775
+ const { properties: t } = Ne(e), r = ye(), s = t == null ? void 0 : t.value;
1783
1776
  if (!s) return null;
1784
- const o = be(s, r);
1777
+ const o = ge(s, r);
1785
1778
  return /* @__PURE__ */ a("h2", { className: "fbre-header", children: o });
1786
1779
  };
1787
- F("header", Nr);
1788
- const kr = ({ uuid: e }) => {
1789
- const { properties: t } = Ce(e), r = ve(), s = t == null ? void 0 : t.value;
1780
+ F("header", kr);
1781
+ const Sr = ({ uuid: e }) => {
1782
+ const { properties: t } = Ne(e), r = ye(), s = t == null ? void 0 : t.value;
1790
1783
  return s == null ? null : /* @__PURE__ */ a(
1791
1784
  "div",
1792
1785
  {
1793
1786
  className: "fbre-text",
1794
1787
  dangerouslySetInnerHTML: {
1795
- __html: we(s, r)
1788
+ __html: xe(s, r)
1796
1789
  }
1797
1790
  }
1798
1791
  );
1799
1792
  };
1800
- F("text", kr);
1801
- const Sr = ({ uuid: e }) => {
1802
- const { properties: t } = Ce(e), r = (t == null ? void 0 : t.textAlign) ?? "center";
1803
- return /* @__PURE__ */ a("div", { className: `fbre-divider${r === "left" ? " fbre-divider--left" : r === "right" ? " fbre-divider--right" : ""}`, children: t != null && t.value ? /* @__PURE__ */ w(ie, { children: [
1793
+ F("text", Sr);
1794
+ const Dr = ({ uuid: e }) => {
1795
+ const { properties: t } = Ne(e), r = (t == null ? void 0 : t.textAlign) ?? "center";
1796
+ return /* @__PURE__ */ a("div", { className: `fbre-divider${r === "left" ? " fbre-divider--left" : r === "right" ? " fbre-divider--right" : ""}`, children: t != null && t.value ? /* @__PURE__ */ w(ue, { children: [
1804
1797
  /* @__PURE__ */ a("div", { className: "fbre-divider__line" }),
1805
1798
  /* @__PURE__ */ a("span", { className: "fbre-divider__label", children: t.value }),
1806
1799
  /* @__PURE__ */ a("div", { className: "fbre-divider__line" })
1807
1800
  ] }) : /* @__PURE__ */ a("div", { className: "fbre-divider__line" }) });
1808
1801
  };
1809
- F("divider", Sr);
1810
- const Dr = {
1802
+ F("divider", Dr);
1803
+ const Er = {
1811
1804
  info: "info",
1812
1805
  success: "check",
1813
1806
  warning: "warning",
1814
1807
  neutral: void 0
1815
- }, Er = ({ uuid: e }) => {
1816
- const { properties: t } = Ce(e), r = ve(), s = t == null ? void 0 : t.value, o = t == null ? void 0 : t.title, l = (t == null ? void 0 : t.variant) ?? "info", n = t == null ? void 0 : t.icon;
1808
+ }, Tr = ({ uuid: e }) => {
1809
+ const { properties: t } = Ne(e), r = ye(), s = t == null ? void 0 : t.value, o = t == null ? void 0 : t.title, l = (t == null ? void 0 : t.variant) ?? "info", n = t == null ? void 0 : t.icon;
1817
1810
  if (!s && !o) return null;
1818
1811
  let i;
1819
1812
  if (n === "none")
1820
1813
  i = void 0;
1821
- else if (n && ot[n])
1822
- i = ot[n];
1814
+ else if (n && st[n])
1815
+ i = st[n];
1823
1816
  else {
1824
- const c = Dr[l];
1825
- i = c ? ot[c] : void 0;
1817
+ const c = Er[l];
1818
+ i = c ? st[c] : void 0;
1826
1819
  }
1827
1820
  const d = `fbre-callout fbre-callout--${l}`;
1828
1821
  return /* @__PURE__ */ w("div", { className: d, children: [
1829
1822
  i && /* @__PURE__ */ a("span", { className: "fbre-callout__icon", children: /* @__PURE__ */ a(i, {}) }),
1830
1823
  /* @__PURE__ */ w("div", { className: "fbre-callout__content", children: [
1831
- o && /* @__PURE__ */ a("div", { className: "fbre-callout__title", children: be(o, r) }),
1824
+ o && /* @__PURE__ */ a("div", { className: "fbre-callout__title", children: ge(o, r) }),
1832
1825
  s && /* @__PURE__ */ a(
1833
1826
  "div",
1834
1827
  {
1835
1828
  className: "fbre-callout__body",
1836
1829
  dangerouslySetInnerHTML: {
1837
- __html: we(s, r)
1830
+ __html: xe(s, r)
1838
1831
  }
1839
1832
  }
1840
1833
  )
1841
1834
  ] })
1842
1835
  ] });
1843
1836
  };
1844
- F("callout", Er);
1845
- const Tr = ({ uuid: e }) => {
1846
- const { properties: t } = Ce(e), r = t == null ? void 0 : t.label, s = t == null ? void 0 : t.columns, o = t == null ? void 0 : t.rows, l = t == null ? void 0 : t.highlightColumn, n = l ? l - 1 : -1;
1837
+ F("callout", Tr);
1838
+ const Ir = ({ uuid: e }) => {
1839
+ const { properties: t } = Ne(e), r = t == null ? void 0 : t.label, s = t == null ? void 0 : t.columns, o = t == null ? void 0 : t.rows, l = t == null ? void 0 : t.highlightColumn, n = l ? l - 1 : -1;
1847
1840
  return !s || !o || s.length === 0 ? null : /* @__PURE__ */ w("div", { className: "fbre-table", children: [
1848
1841
  r && /* @__PURE__ */ a("div", { className: "fbre-table__label", children: r }),
1849
1842
  /* @__PURE__ */ w("table", { children: [
@@ -1872,9 +1865,9 @@ const Tr = ({ uuid: e }) => {
1872
1865
  ] })
1873
1866
  ] });
1874
1867
  };
1875
- F("table", Tr);
1876
- const Ir = ({ uuid: e }) => {
1877
- const { properties: t, value: r } = Ce(e), s = t == null ? void 0 : t.label, o = (t == null ? void 0 : t.showLabel) !== !1, l = t == null ? void 0 : t.detail, n = t == null ? void 0 : t.format, i = t == null ? void 0 : t.decimalPlaces, d = t == null ? void 0 : t.currencySymbol, c = vt(
1868
+ F("table", Ir);
1869
+ const Lr = ({ uuid: e }) => {
1870
+ const { properties: t, value: r } = Ne(e), s = t == null ? void 0 : t.label, o = (t == null ? void 0 : t.showLabel) !== !1, l = t == null ? void 0 : t.detail, n = t == null ? void 0 : t.format, i = t == null ? void 0 : t.decimalPlaces, d = t == null ? void 0 : t.currencySymbol, c = gt(
1878
1871
  typeof r == "number" ? r : null,
1879
1872
  n,
1880
1873
  i,
@@ -1886,10 +1879,10 @@ const Ir = ({ uuid: e }) => {
1886
1879
  l && /* @__PURE__ */ a("div", { className: "fbre-computed__detail", children: l })
1887
1880
  ] });
1888
1881
  };
1889
- F("computed", Ir);
1890
- const fn = ({ text: e }) => {
1882
+ F("computed", Lr);
1883
+ const mn = ({ text: e }) => {
1891
1884
  var d;
1892
- const [t, r] = O(!1), s = M(null), o = M(null), [l, n] = O(null), i = H(() => {
1885
+ const [t, r] = M(!1), s = O(null), o = O(null), [l, n] = M(null), i = H(() => {
1893
1886
  if (!s.current) return;
1894
1887
  const c = s.current.getBoundingClientRect();
1895
1888
  n({
@@ -1907,7 +1900,7 @@ const fn = ({ text: e }) => {
1907
1900
  return document.addEventListener("mousedown", c), window.addEventListener("scroll", u, !0), window.addEventListener("resize", u), () => {
1908
1901
  document.removeEventListener("mousedown", c), window.removeEventListener("scroll", u, !0), window.removeEventListener("resize", u);
1909
1902
  };
1910
- }, [t, i]), /* @__PURE__ */ w(ie, { children: [
1903
+ }, [t, i]), /* @__PURE__ */ w(ue, { children: [
1911
1904
  /* @__PURE__ */ a(
1912
1905
  "button",
1913
1906
  {
@@ -1916,10 +1909,10 @@ const fn = ({ text: e }) => {
1916
1909
  className: "fbre-tooltip-trigger",
1917
1910
  onClick: () => r(!t),
1918
1911
  "aria-label": "Help",
1919
- children: /* @__PURE__ */ a(Wn, {})
1912
+ children: /* @__PURE__ */ a(Jn, {})
1920
1913
  }
1921
1914
  ),
1922
- t && l && In(
1915
+ t && l && Ln(
1923
1916
  /* @__PURE__ */ a(
1924
1917
  "div",
1925
1918
  {
@@ -1929,7 +1922,7 @@ const fn = ({ text: e }) => {
1929
1922
  children: /* @__PURE__ */ a(
1930
1923
  "span",
1931
1924
  {
1932
- dangerouslySetInnerHTML: { __html: Qt(e) }
1925
+ dangerouslySetInnerHTML: { __html: Jt(e) }
1933
1926
  }
1934
1927
  )
1935
1928
  }
@@ -1937,7 +1930,7 @@ const fn = ({ text: e }) => {
1937
1930
  ((d = s.current) == null ? void 0 : d.closest(".fbre-container")) ?? document.body
1938
1931
  )
1939
1932
  ] });
1940
- }, q = ({
1933
+ }, W = ({
1941
1934
  label: e,
1942
1935
  detail: t,
1943
1936
  showLabel: r,
@@ -1950,7 +1943,7 @@ const fn = ({ text: e }) => {
1950
1943
  errorMessages: c,
1951
1944
  children: u
1952
1945
  }) => {
1953
- const p = ve(), [m, f] = O(!1);
1946
+ const p = ye(), [m, f] = M(!1);
1954
1947
  K(() => {
1955
1948
  i !== void 0 && f(i);
1956
1949
  }, [i]);
@@ -1965,18 +1958,18 @@ const fn = ({ text: e }) => {
1965
1958
  {
1966
1959
  className: "fbre-field__prompt",
1967
1960
  dangerouslySetInnerHTML: {
1968
- __html: we(t, p)
1961
+ __html: xe(t, p)
1969
1962
  }
1970
1963
  }
1971
1964
  ),
1972
1965
  /* @__PURE__ */ w("div", { style: { display: "flex", alignItems: "flex-start" }, children: [
1973
1966
  /* @__PURE__ */ w("div", { style: { flex: 1 }, children: [
1974
1967
  e && (!t || t.length === 0 || r) && /* @__PURE__ */ w("label", { className: "fbre-field__label", htmlFor: n, children: [
1975
- be(e, p),
1968
+ ge(e, p),
1976
1969
  s && /* @__PURE__ */ a("span", { className: "required", children: "*" })
1977
1970
  ] }),
1978
1971
  u({ focused: m, setFocused: f }),
1979
- o && /* @__PURE__ */ a("div", { className: "fbre-field__helper", children: be(o, p) }),
1972
+ o && /* @__PURE__ */ a("div", { className: "fbre-field__helper", children: ge(o, p) }),
1980
1973
  (() => {
1981
1974
  const y = c == null ? void 0 : c.filter((b) => b);
1982
1975
  return d && y && y.length > 0 && /* @__PURE__ */ w("div", { className: "fbre-field__errors", children: [
@@ -1989,21 +1982,21 @@ const fn = ({ text: e }) => {
1989
1982
  ] });
1990
1983
  })()
1991
1984
  ] }),
1992
- l && /* @__PURE__ */ a(fn, { text: l })
1985
+ l && /* @__PURE__ */ a(mn, { text: l })
1993
1986
  ] })
1994
1987
  ] });
1995
- }, Lr = ({ uuid: e }) => {
1988
+ }, Rr = ({ uuid: e }) => {
1996
1989
  const {
1997
1990
  value: t,
1998
1991
  properties: r,
1999
1992
  valid: s,
2000
1993
  validationErrors: o,
2001
1994
  updateValue: l
2002
- } = z(e), n = r, i = M(null), [d, c] = O(!1);
1995
+ } = z(e), n = r, i = O(null), [d, c] = M(!1);
2003
1996
  if (!n) return null;
2004
1997
  const u = t != null && s === !1, p = n.inputType === "password", m = p && d ? "text" : n.inputType ?? "text", f = `fbre-input-${e}`;
2005
1998
  return /* @__PURE__ */ a(
2006
- q,
1999
+ W,
2007
2000
  {
2008
2001
  label: n.label,
2009
2002
  detail: n.detail,
@@ -2040,15 +2033,15 @@ const fn = ({ text: e }) => {
2040
2033
  className: "fbre-field__password-toggle",
2041
2034
  onClick: () => c(!d),
2042
2035
  tabIndex: -1,
2043
- children: d ? /* @__PURE__ */ a(Kn, {}) : /* @__PURE__ */ a(zn, {})
2036
+ children: d ? /* @__PURE__ */ a(Yn, {}) : /* @__PURE__ */ a(qn, {})
2044
2037
  }
2045
2038
  )
2046
2039
  ] })
2047
2040
  }
2048
2041
  );
2049
2042
  };
2050
- F("inputText", Lr);
2051
- const Rr = ({ uuid: e }) => {
2043
+ F("inputText", Rr);
2044
+ const Mr = ({ uuid: e }) => {
2052
2045
  const {
2053
2046
  value: t,
2054
2047
  properties: r,
@@ -2059,7 +2052,7 @@ const Rr = ({ uuid: e }) => {
2059
2052
  if (!n) return null;
2060
2053
  const i = t != null && s === !1, d = `fbre-input-${e}`;
2061
2054
  return /* @__PURE__ */ a(
2062
- q,
2055
+ W,
2063
2056
  {
2064
2057
  label: n.label,
2065
2058
  detail: n.detail,
@@ -2088,15 +2081,15 @@ const Rr = ({ uuid: e }) => {
2088
2081
  }
2089
2082
  );
2090
2083
  };
2091
- F("inputTextArea", Rr);
2092
- const Mr = ({ uuid: e }) => {
2084
+ F("inputTextArea", Mr);
2085
+ const Or = ({ uuid: e }) => {
2093
2086
  const {
2094
2087
  value: t,
2095
2088
  properties: r,
2096
2089
  valid: s,
2097
2090
  validationErrors: o,
2098
2091
  updateValue: l
2099
- } = z(e), n = r, [i, d] = O(t ?? "");
2092
+ } = z(e), n = r, [i, d] = M(t ?? "");
2100
2093
  if (!n) return null;
2101
2094
  const c = t != null && s === !1, u = n.decimalPlaces, p = `fbre-input-${e}`, m = (v) => {
2102
2095
  if (v === "") return v;
@@ -2128,7 +2121,7 @@ const Mr = ({ uuid: e }) => {
2128
2121
  N !== String(i) && (d(N), l(e, N));
2129
2122
  };
2130
2123
  return /* @__PURE__ */ a(
2131
- q,
2124
+ W,
2132
2125
  {
2133
2126
  label: n.label,
2134
2127
  detail: n.detail,
@@ -2168,7 +2161,7 @@ const Mr = ({ uuid: e }) => {
2168
2161
  b !== v.target.value && (v.target.value = b, l(e, b));
2169
2162
  };
2170
2163
  return /* @__PURE__ */ a(
2171
- q,
2164
+ W,
2172
2165
  {
2173
2166
  label: n.label,
2174
2167
  detail: n.detail,
@@ -2202,8 +2195,8 @@ const Mr = ({ uuid: e }) => {
2202
2195
  }
2203
2196
  );
2204
2197
  };
2205
- F("inputNumber", Mr);
2206
- function Je(e, t, r) {
2198
+ F("inputNumber", Or);
2199
+ function Qe(e, t, r) {
2207
2200
  K(() => {
2208
2201
  if (!t) return;
2209
2202
  const s = (o) => {
@@ -2212,7 +2205,7 @@ function Je(e, t, r) {
2212
2205
  return document.addEventListener("mousedown", s), () => document.removeEventListener("mousedown", s);
2213
2206
  }, [t, e, r]);
2214
2207
  }
2215
- function mn(e) {
2208
+ function hn(e) {
2216
2209
  let t = e.parentElement;
2217
2210
  for (; t; ) {
2218
2211
  const { overflow: r, overflowY: s } = getComputedStyle(t);
@@ -2222,52 +2215,52 @@ function mn(e) {
2222
2215
  }
2223
2216
  return document.documentElement;
2224
2217
  }
2225
- function Ft(e, t) {
2226
- const r = mn(e), s = r === document.documentElement ? { top: 0, bottom: window.innerHeight } : r.getBoundingClientRect(), o = e.getBoundingClientRect(), l = s.bottom - o.bottom, n = o.top - s.top;
2218
+ function Pt(e, t) {
2219
+ const r = hn(e), s = r === document.documentElement ? { top: 0, bottom: window.innerHeight } : r.getBoundingClientRect(), o = e.getBoundingClientRect(), l = s.bottom - o.bottom, n = o.top - s.top;
2227
2220
  return l < t && n > l;
2228
2221
  }
2229
- function Xe(e, t, r = 300) {
2230
- const [s, o] = O(!1);
2231
- return qt(() => {
2222
+ function Ze(e, t, r = 300) {
2223
+ const [s, o] = M(!1);
2224
+ return zt(() => {
2232
2225
  if (!t || !e.current) {
2233
2226
  o(!1);
2234
2227
  return;
2235
2228
  }
2236
2229
  const l = e.current.offsetParent;
2237
- l && o(Ft(l, r));
2230
+ l && o(Pt(l, r));
2238
2231
  }, [t, r]), K(() => {
2239
2232
  if (!t || !e.current) return;
2240
2233
  const l = () => {
2241
2234
  var i;
2242
2235
  const n = (i = e.current) == null ? void 0 : i.offsetParent;
2243
- n && o(Ft(n, r));
2236
+ n && o(Pt(n, r));
2244
2237
  };
2245
2238
  return window.addEventListener("scroll", l, !0), window.addEventListener("resize", l), () => {
2246
2239
  window.removeEventListener("scroll", l, !0), window.removeEventListener("resize", l);
2247
2240
  };
2248
2241
  }, [t, r]), s;
2249
2242
  }
2250
- const Or = ({ uuid: e }) => {
2243
+ const Vr = ({ uuid: e }) => {
2251
2244
  const {
2252
2245
  value: t,
2253
2246
  properties: r,
2254
2247
  valid: s,
2255
2248
  validationErrors: o,
2256
2249
  updateValue: l
2257
- } = z(e), n = r, [i, d] = O(!1), [c, u] = O(-1), p = M(null), m = M(null), f = M(null), v = M([]);
2258
- Je(
2250
+ } = z(e), n = r, [i, d] = M(!1), [c, u] = M(-1), p = O(null), m = O(null), f = O(null), v = O([]);
2251
+ Qe(
2259
2252
  p,
2260
2253
  i,
2261
2254
  H(() => d(!1), [])
2262
2255
  );
2263
- const y = Xe(f, i, 200);
2256
+ const y = Ze(f, i, 200);
2264
2257
  if (K(() => {
2265
2258
  var h;
2266
2259
  i && c >= 0 && ((h = v.current[c]) == null || h.focus());
2267
2260
  }, [i, c]), !n) return null;
2268
2261
  const b = n.readOnly === !0, C = n.options, x = t != null && s === !1, N = C.findIndex(
2269
2262
  (h) => h.value.toString() === (t == null ? void 0 : t.toString())
2270
- ), E = N >= 0 ? C[N] : void 0, S = () => {
2263
+ ), S = N >= 0 ? C[N] : void 0, E = () => {
2271
2264
  b || (u(N >= 0 ? N : 0), d(!0));
2272
2265
  }, D = (h) => {
2273
2266
  var _;
@@ -2275,7 +2268,7 @@ const Or = ({ uuid: e }) => {
2275
2268
  }, T = (h) => {
2276
2269
  l(e, C[h].value), D(!0);
2277
2270
  }, R = (h) => {
2278
- b || (h.key === "ArrowDown" || h.key === "ArrowUp" || h.key === "Enter" || h.key === " " ? (h.preventDefault(), S()) : h.key === "Escape" && i && (h.preventDefault(), D(!1)));
2271
+ b || (h.key === "ArrowDown" || h.key === "ArrowUp" || h.key === "Enter" || h.key === " " ? (h.preventDefault(), E()) : h.key === "Escape" && i && (h.preventDefault(), D(!1)));
2279
2272
  }, g = (h) => {
2280
2273
  switch (h.key) {
2281
2274
  case "ArrowDown":
@@ -2303,7 +2296,7 @@ const Or = ({ uuid: e }) => {
2303
2296
  }
2304
2297
  };
2305
2298
  return /* @__PURE__ */ a(
2306
- q,
2299
+ W,
2307
2300
  {
2308
2301
  label: n.label,
2309
2302
  detail: n.detail,
@@ -2324,11 +2317,11 @@ const Or = ({ uuid: e }) => {
2324
2317
  disabled: b,
2325
2318
  "aria-haspopup": "listbox",
2326
2319
  "aria-expanded": i,
2327
- onClick: () => i ? D(!1) : S(),
2320
+ onClick: () => i ? D(!1) : E(),
2328
2321
  onKeyDown: R,
2329
2322
  children: [
2330
- E ? /* @__PURE__ */ a("span", { className: "fbre-dropdown__selected-text", children: E.label }) : /* @__PURE__ */ a("span", { className: "fbre-dropdown__placeholder", children: "Select..." }),
2331
- /* @__PURE__ */ a("span", { className: `fbre-dropdown__arrow${i ? " open" : ""}`, children: /* @__PURE__ */ a(Ee, {}) })
2323
+ S ? /* @__PURE__ */ a("span", { className: "fbre-dropdown__selected-text", children: S.label }) : /* @__PURE__ */ a("span", { className: "fbre-dropdown__placeholder", children: "Select..." }),
2324
+ /* @__PURE__ */ a("span", { className: `fbre-dropdown__arrow${i ? " open" : ""}`, children: /* @__PURE__ */ a(Le, {}) })
2332
2325
  ]
2333
2326
  }
2334
2327
  ),
@@ -2355,7 +2348,7 @@ const Or = ({ uuid: e }) => {
2355
2348
  onClick: () => T(_),
2356
2349
  children: [
2357
2350
  /* @__PURE__ */ a("span", { children: h.label }),
2358
- k && /* @__PURE__ */ a("span", { className: "fbre-dropdown__option-check", children: /* @__PURE__ */ a(ne, {}) })
2351
+ k && /* @__PURE__ */ a("span", { className: "fbre-dropdown__option-check", children: /* @__PURE__ */ a(oe, {}) })
2359
2352
  ]
2360
2353
  },
2361
2354
  `${e}-${_}`
@@ -2367,29 +2360,29 @@ const Or = ({ uuid: e }) => {
2367
2360
  }
2368
2361
  );
2369
2362
  };
2370
- F("dropDown", Or);
2371
- const Vr = ({ uuid: e }) => {
2363
+ F("dropDown", Vr);
2364
+ const $r = ({ uuid: e }) => {
2372
2365
  const {
2373
2366
  value: t,
2374
2367
  properties: r,
2375
2368
  valid: s,
2376
2369
  validationErrors: o,
2377
2370
  updateValue: l
2378
- } = z(e), n = r, [i, d] = O(!1), [c, u] = O(-1), p = M(null), m = M(null), f = M(null), v = M([]);
2379
- Je(
2371
+ } = z(e), n = r, [i, d] = M(!1), [c, u] = M(-1), p = O(null), m = O(null), f = O(null), v = O([]);
2372
+ Qe(
2380
2373
  p,
2381
2374
  i,
2382
2375
  H(() => d(!1), [])
2383
2376
  );
2384
- const y = Xe(f, i, 200);
2377
+ const y = Ze(f, i, 200);
2385
2378
  if (K(() => {
2386
2379
  var h;
2387
2380
  i && c >= 0 && ((h = v.current[c]) == null || h.focus());
2388
2381
  }, [i, c]), !n) return null;
2389
- const b = n.readOnly === !0, C = n.options, x = t ?? [], N = t != null && s === !1, E = (h) => {
2382
+ const b = n.readOnly === !0, C = n.options, x = t ?? [], N = t != null && s === !1, S = (h) => {
2390
2383
  const _ = h.toString(), k = x.includes(_) ? x.filter((I) => I !== _) : [...x, _];
2391
2384
  l(e, k);
2392
- }, S = (h, _) => {
2385
+ }, E = (h, _) => {
2393
2386
  _.stopPropagation(), l(
2394
2387
  e,
2395
2388
  x.filter((k) => k !== h)
@@ -2417,7 +2410,7 @@ const Vr = ({ uuid: e }) => {
2417
2410
  break;
2418
2411
  case "Enter":
2419
2412
  case " ":
2420
- h.preventDefault(), c >= 0 && E(C[c].value);
2413
+ h.preventDefault(), c >= 0 && S(C[c].value);
2421
2414
  break;
2422
2415
  case "Escape":
2423
2416
  h.preventDefault(), T(!0);
@@ -2428,7 +2421,7 @@ const Vr = ({ uuid: e }) => {
2428
2421
  }
2429
2422
  };
2430
2423
  return /* @__PURE__ */ a(
2431
- q,
2424
+ W,
2432
2425
  {
2433
2426
  label: n.label,
2434
2427
  detail: n.detail,
@@ -2462,13 +2455,13 @@ const Vr = ({ uuid: e }) => {
2462
2455
  type: "button",
2463
2456
  className: "fbre-dropdown__tag-remove",
2464
2457
  "aria-label": `Remove ${(_ == null ? void 0 : _.label) ?? h}`,
2465
- onClick: (k) => S(h, k),
2458
+ onClick: (k) => E(h, k),
2466
2459
  children: "×"
2467
2460
  }
2468
2461
  )
2469
2462
  ] }, h);
2470
2463
  }) }) : /* @__PURE__ */ a("span", { className: "fbre-dropdown__placeholder", children: "Select..." }),
2471
- /* @__PURE__ */ a("span", { className: `fbre-dropdown__arrow${i ? " open" : ""}`, children: /* @__PURE__ */ a(Ee, {}) })
2464
+ /* @__PURE__ */ a("span", { className: `fbre-dropdown__arrow${i ? " open" : ""}`, children: /* @__PURE__ */ a(Le, {}) })
2472
2465
  ]
2473
2466
  }
2474
2467
  ),
@@ -2493,14 +2486,14 @@ const Vr = ({ uuid: e }) => {
2493
2486
  "aria-selected": k,
2494
2487
  tabIndex: i && _ === c ? 0 : -1,
2495
2488
  className: "fbre-dropdown__option",
2496
- onClick: () => E(h.value),
2489
+ onClick: () => S(h.value),
2497
2490
  children: [
2498
2491
  /* @__PURE__ */ a(
2499
2492
  "span",
2500
2493
  {
2501
2494
  className: "fbre-option-item__box fbre-option-item__box--checkbox",
2502
2495
  style: { width: 16, height: 16 },
2503
- children: k && /* @__PURE__ */ a(ne, { size: 12 })
2496
+ children: k && /* @__PURE__ */ a(oe, { size: 12 })
2504
2497
  }
2505
2498
  ),
2506
2499
  /* @__PURE__ */ a("span", { children: h.label })
@@ -2515,8 +2508,8 @@ const Vr = ({ uuid: e }) => {
2515
2508
  }
2516
2509
  );
2517
2510
  };
2518
- F("dropDownMulti", Vr);
2519
- const hn = ({
2511
+ F("dropDownMulti", $r);
2512
+ const bn = ({
2520
2513
  label: e,
2521
2514
  detail: t,
2522
2515
  showLabel: r,
@@ -2527,25 +2520,25 @@ const hn = ({
2527
2520
  errorMessages: i,
2528
2521
  children: d
2529
2522
  }) => {
2530
- const c = ve(), u = ["fbre-option-group", n && "fbre-option-group--error"].filter(Boolean).join(" ");
2523
+ const c = ye(), u = ["fbre-option-group", n && "fbre-option-group--error"].filter(Boolean).join(" ");
2531
2524
  return /* @__PURE__ */ w("div", { className: u, children: [
2532
2525
  t && /* @__PURE__ */ a(
2533
2526
  "div",
2534
2527
  {
2535
2528
  className: "fbre-field__prompt",
2536
2529
  dangerouslySetInnerHTML: {
2537
- __html: we(t, c)
2530
+ __html: xe(t, c)
2538
2531
  }
2539
2532
  }
2540
2533
  ),
2541
2534
  /* @__PURE__ */ w("div", { style: { display: "flex", alignItems: "flex-start" }, children: [
2542
2535
  /* @__PURE__ */ w("div", { style: { flex: 1 }, children: [
2543
2536
  r !== !1 && (!t || t.length === 0) && /* @__PURE__ */ w("div", { className: "fbre-option-group__label", children: [
2544
- be(e, c),
2537
+ ge(e, c),
2545
2538
  s && /* @__PURE__ */ a("span", { className: "required", children: "*" })
2546
2539
  ] }),
2547
2540
  /* @__PURE__ */ a("div", { className: "fbre-option-group__items", children: d }),
2548
- o && /* @__PURE__ */ a("div", { className: "fbre-option-group__helper", children: be(o, c) }),
2541
+ o && /* @__PURE__ */ a("div", { className: "fbre-option-group__helper", children: ge(o, c) }),
2549
2542
  (() => {
2550
2543
  const p = i == null ? void 0 : i.filter((m) => m);
2551
2544
  return n && p && p.length > 0 && /* @__PURE__ */ w("div", { className: "fbre-field__errors", children: [
@@ -2558,10 +2551,10 @@ const hn = ({
2558
2551
  ] });
2559
2552
  })()
2560
2553
  ] }),
2561
- l && /* @__PURE__ */ a(fn, { text: l })
2554
+ l && /* @__PURE__ */ a(mn, { text: l })
2562
2555
  ] })
2563
2556
  ] });
2564
- }, $r = ({ uuid: e }) => {
2557
+ }, Ar = ({ uuid: e }) => {
2565
2558
  const {
2566
2559
  value: t,
2567
2560
  properties: r,
@@ -2575,7 +2568,7 @@ const hn = ({
2575
2568
  l(e, f);
2576
2569
  };
2577
2570
  return /* @__PURE__ */ a(
2578
- hn,
2571
+ bn,
2579
2572
  {
2580
2573
  label: n.label,
2581
2574
  detail: n.detail,
@@ -2597,15 +2590,15 @@ const hn = ({
2597
2590
  onChange: () => u(p.value)
2598
2591
  }
2599
2592
  ),
2600
- /* @__PURE__ */ a("span", { className: "fbre-option-item__box fbre-option-item__box--checkbox", children: /* @__PURE__ */ a(ne, {}) }),
2593
+ /* @__PURE__ */ a("span", { className: "fbre-option-item__box fbre-option-item__box--checkbox", children: /* @__PURE__ */ a(oe, {}) }),
2601
2594
  /* @__PURE__ */ a("span", { className: "fbre-option-item__text", children: p.label })
2602
2595
  ] }, `${e}-${m}`);
2603
2596
  })
2604
2597
  }
2605
2598
  );
2606
2599
  };
2607
- F("checkbox", $r);
2608
- const Ar = ({ uuid: e }) => {
2600
+ F("checkbox", Ar);
2601
+ const Br = ({ uuid: e }) => {
2609
2602
  const {
2610
2603
  value: t,
2611
2604
  properties: r,
@@ -2621,7 +2614,7 @@ const Ar = ({ uuid: e }) => {
2621
2614
  if (!n) return null;
2622
2615
  const d = n.readOnly === !0, c = t, u = t != null && s === !1;
2623
2616
  return /* @__PURE__ */ a(
2624
- hn,
2617
+ bn,
2625
2618
  {
2626
2619
  label: n.label,
2627
2620
  detail: n.detail,
@@ -2652,7 +2645,7 @@ const Ar = ({ uuid: e }) => {
2652
2645
  onChange: (v) => l(e, v.target.value)
2653
2646
  }
2654
2647
  ),
2655
- /* @__PURE__ */ a("span", { className: "fbre-option-item__box fbre-option-item__box--radio", children: i ? /* @__PURE__ */ a(ne, {}) : /* @__PURE__ */ a(
2648
+ /* @__PURE__ */ a("span", { className: "fbre-option-item__box fbre-option-item__box--radio", children: i ? /* @__PURE__ */ a(oe, {}) : /* @__PURE__ */ a(
2656
2649
  "svg",
2657
2650
  {
2658
2651
  width: "10",
@@ -2671,8 +2664,8 @@ const Ar = ({ uuid: e }) => {
2671
2664
  }
2672
2665
  );
2673
2666
  };
2674
- F("radio", Ar);
2675
- const Br = ({ uuid: e }) => {
2667
+ F("radio", Br);
2668
+ const Pr = ({ uuid: e }) => {
2676
2669
  const {
2677
2670
  value: t,
2678
2671
  properties: r,
@@ -2718,46 +2711,46 @@ const Br = ({ uuid: e }) => {
2718
2711
  }
2719
2712
  );
2720
2713
  };
2721
- F("cardSelect", Br);
2722
- const Pr = ({ uuid: e }) => {
2714
+ F("cardSelect", Pr);
2715
+ const Ur = ({ uuid: e }) => {
2723
2716
  const {
2724
2717
  value: t,
2725
2718
  properties: r,
2726
2719
  valid: s,
2727
2720
  validationErrors: o,
2728
2721
  updateValue: l
2729
- } = z(e), n = t, i = r, [d, c] = O(null);
2722
+ } = z(e), n = t, i = r, [d, c] = M(null);
2730
2723
  if (!i) return null;
2731
- const u = i.max ?? 5, p = i.precision ?? 1, m = d ?? n ?? 0, f = n != null && s === !1, v = i.icon && fr[i.icon] || gt, y = (S, D) => {
2732
- const T = D && p <= 0.5 ? S + 0.5 : S + 1;
2724
+ const u = i.max ?? 5, p = i.precision ?? 1, m = d ?? n ?? 0, f = n != null && s === !1, v = i.icon && hr[i.icon] || yt, y = (E, D) => {
2725
+ const T = D && p <= 0.5 ? E + 0.5 : E + 1;
2733
2726
  l(e, T);
2734
- }, b = (S, D) => {
2735
- const T = D.currentTarget.getBoundingClientRect(), g = D.clientX - T.left < T.width / 2 && p <= 0.5 ? S + 0.5 : S + 1;
2727
+ }, b = (E, D) => {
2728
+ const T = D.currentTarget.getBoundingClientRect(), g = D.clientX - T.left < T.width / 2 && p <= 0.5 ? E + 0.5 : E + 1;
2736
2729
  c(g);
2737
2730
  }, C = [];
2738
- for (let S = 0; S < u; S++) {
2739
- const D = m >= S + 1, T = !D && m >= S + 0.5, R = `fbre-rating__star${D ? " fbre-rating__star--full" : T ? " fbre-rating__star--half" : ""}`;
2731
+ for (let E = 0; E < u; E++) {
2732
+ const D = m >= E + 1, T = !D && m >= E + 0.5, R = `fbre-rating__star${D ? " fbre-rating__star--full" : T ? " fbre-rating__star--half" : ""}`;
2740
2733
  C.push(
2741
2734
  /* @__PURE__ */ a(
2742
2735
  "div",
2743
2736
  {
2744
2737
  className: R,
2745
- onMouseMove: (g) => b(S, g),
2738
+ onMouseMove: (g) => b(E, g),
2746
2739
  onMouseLeave: () => c(null),
2747
2740
  onClick: (g) => {
2748
2741
  const h = g.currentTarget.getBoundingClientRect(), _ = g.clientX - h.left < h.width / 2;
2749
- y(S, _);
2742
+ y(E, _);
2750
2743
  },
2751
2744
  children: /* @__PURE__ */ a(v, {})
2752
2745
  },
2753
- S
2746
+ E
2754
2747
  )
2755
2748
  );
2756
2749
  }
2757
- const x = p <= 0.5 ? 0.5 : 1, N = (S) => Math.max(0, Math.min(u, S)), E = (S) => {
2750
+ const x = p <= 0.5 ? 0.5 : 1, N = (E) => Math.max(0, Math.min(u, E)), S = (E) => {
2758
2751
  const D = n ?? 0;
2759
2752
  let T = null;
2760
- switch (S.key) {
2753
+ switch (E.key) {
2761
2754
  case "ArrowRight":
2762
2755
  case "ArrowUp":
2763
2756
  T = N(D + x);
@@ -2773,10 +2766,10 @@ const Pr = ({ uuid: e }) => {
2773
2766
  T = u;
2774
2767
  break;
2775
2768
  }
2776
- T !== null && (S.preventDefault(), l(e, T));
2769
+ T !== null && (E.preventDefault(), l(e, T));
2777
2770
  };
2778
2771
  return /* @__PURE__ */ a(
2779
- q,
2772
+ W,
2780
2773
  {
2781
2774
  label: i.label,
2782
2775
  detail: i.detail,
@@ -2796,7 +2789,7 @@ const Pr = ({ uuid: e }) => {
2796
2789
  "aria-valuemin": 0,
2797
2790
  "aria-valuemax": u,
2798
2791
  "aria-valuenow": n ?? 0,
2799
- onKeyDown: E,
2792
+ onKeyDown: S,
2800
2793
  children: C
2801
2794
  }
2802
2795
  ),
@@ -2809,8 +2802,8 @@ const Pr = ({ uuid: e }) => {
2809
2802
  }
2810
2803
  );
2811
2804
  };
2812
- F("rating", Pr);
2813
- const Ur = ({ uuid: e }) => {
2805
+ F("rating", Ur);
2806
+ const Fr = ({ uuid: e }) => {
2814
2807
  const {
2815
2808
  value: t,
2816
2809
  properties: r,
@@ -2821,7 +2814,7 @@ const Ur = ({ uuid: e }) => {
2821
2814
  if (!i) return null;
2822
2815
  const d = i.readOnly === !0, c = i.min ?? 0, u = i.max ?? 100, p = i.steps ?? 1, m = (n - c) / (u - c) * 100, f = s === !1;
2823
2816
  return /* @__PURE__ */ a(
2824
- q,
2817
+ W,
2825
2818
  {
2826
2819
  label: i.label,
2827
2820
  detail: i.detail,
@@ -2856,8 +2849,8 @@ const Ur = ({ uuid: e }) => {
2856
2849
  }
2857
2850
  );
2858
2851
  };
2859
- F("slider", Ur);
2860
- const Fr = ({ uuid: e }) => {
2852
+ F("slider", Fr);
2853
+ const jr = ({ uuid: e }) => {
2861
2854
  const {
2862
2855
  value: t,
2863
2856
  properties: r,
@@ -2868,7 +2861,7 @@ const Fr = ({ uuid: e }) => {
2868
2861
  if (!n) return null;
2869
2862
  const i = s === !1;
2870
2863
  return /* @__PURE__ */ a(
2871
- q,
2864
+ W,
2872
2865
  {
2873
2866
  detail: n.detail,
2874
2867
  helperText: n.helperText,
@@ -2889,44 +2882,44 @@ const Fr = ({ uuid: e }) => {
2889
2882
  }
2890
2883
  );
2891
2884
  };
2892
- F("toggleSwitch", Fr);
2893
- const ke = /* @__PURE__ */ new Map(), Po = (e, t) => {
2894
- ke.has(e) || ke.set(e, /* @__PURE__ */ new Set()), ke.get(e).add(t);
2895
- }, Uo = (e, t) => {
2885
+ F("toggleSwitch", jr);
2886
+ const De = /* @__PURE__ */ new Map(), Uo = (e, t) => {
2887
+ De.has(e) || De.set(e, /* @__PURE__ */ new Set()), De.get(e).add(t);
2888
+ }, Fo = (e, t) => {
2896
2889
  var r;
2897
- (r = ke.get(e)) == null || r.delete(t);
2898
- }, jt = (e, t, r) => {
2890
+ (r = De.get(e)) == null || r.delete(t);
2891
+ }, Ut = (e, t, r) => {
2899
2892
  var s;
2900
- (s = ke.get(e)) == null || s.forEach((o) => {
2893
+ (s = De.get(e)) == null || s.forEach((o) => {
2901
2894
  o(t, r);
2902
2895
  });
2903
- }, bn = bt(null);
2904
- function jr() {
2905
- return Ye(bn);
2896
+ }, vn = vt(null);
2897
+ function Hr() {
2898
+ return Ge(vn);
2906
2899
  }
2907
- class He extends Error {
2900
+ class Ye extends Error {
2908
2901
  constructor(t, r, s, o) {
2909
2902
  super(t), this.name = "ApiError", this.status = r, this.code = s, this.validationErrors = o;
2910
2903
  }
2911
2904
  }
2912
- class Hr extends He {
2905
+ class Kr extends Ye {
2913
2906
  constructor(t, r) {
2914
2907
  super(`Request timed out after ${r}ms: ${t}`, 0, "TIMEOUT"), this.name = "TimeoutError";
2915
2908
  }
2916
2909
  }
2917
- const Kr = /* @__PURE__ */ new Set([502, 503, 504]), Oe = 2, zr = [500, 1500];
2918
- function Yr(e) {
2910
+ const zr = /* @__PURE__ */ new Set([502, 503, 504]), Ae = 2, Yr = [500, 1500];
2911
+ function qr(e) {
2919
2912
  return new Promise((t) => setTimeout(t, e));
2920
2913
  }
2921
- async function de(e, t, r = {}) {
2914
+ async function fe(e, t, r = {}) {
2922
2915
  const o = `${e.apiEndpoint || ""}${t}`, l = e.timeout ?? 3e4, n = {
2923
2916
  ...r.body ? { "Content-Type": "application/json" } : {},
2924
2917
  ...r.headers
2925
2918
  };
2926
2919
  e.apiKey && (n.Authorization = `Bearer ${e.apiKey}`);
2927
2920
  let i;
2928
- for (let d = 0; d <= Oe; d++) {
2929
- d > 0 && await Yr(zr[d - 1]);
2921
+ for (let d = 0; d <= Ae; d++) {
2922
+ d > 0 && await qr(Yr[d - 1]);
2930
2923
  try {
2931
2924
  const c = new AbortController(), u = setTimeout(() => c.abort(), l);
2932
2925
  let p;
@@ -2940,13 +2933,13 @@ async function de(e, t, r = {}) {
2940
2933
  clearTimeout(u);
2941
2934
  }
2942
2935
  if (!p.ok) {
2943
- const m = await p.json().catch(() => ({})), f = new He(
2936
+ const m = await p.json().catch(() => ({})), f = new Ye(
2944
2937
  m.error || `HTTP ${p.status}`,
2945
2938
  p.status,
2946
2939
  m.code,
2947
2940
  m.validationErrors
2948
2941
  );
2949
- if (d < Oe && Kr.has(p.status) && f.code !== "INTEGRATION_HOOK_FAILED") {
2942
+ if (d < Ae && zr.has(p.status) && f.code !== "INTEGRATION_HOOK_FAILED") {
2950
2943
  i = f;
2951
2944
  continue;
2952
2945
  }
@@ -2954,17 +2947,17 @@ async function de(e, t, r = {}) {
2954
2947
  }
2955
2948
  return p.json();
2956
2949
  } catch (c) {
2957
- if (c instanceof He)
2950
+ if (c instanceof Ye)
2958
2951
  throw c;
2959
2952
  if (c instanceof DOMException && c.name === "AbortError") {
2960
- const u = new Hr(o, l);
2961
- if (d < Oe) {
2953
+ const u = new Kr(o, l);
2954
+ if (d < Ae) {
2962
2955
  i = u;
2963
2956
  continue;
2964
2957
  }
2965
2958
  throw u;
2966
2959
  }
2967
- if (c instanceof TypeError && d < Oe) {
2960
+ if (c instanceof TypeError && d < Ae) {
2968
2961
  i = c;
2969
2962
  continue;
2970
2963
  }
@@ -2973,11 +2966,11 @@ async function de(e, t, r = {}) {
2973
2966
  }
2974
2967
  throw i;
2975
2968
  }
2976
- async function qr(e, t) {
2977
- return de(e, `/api/v1/public/flows/${t}`);
2969
+ async function Wr(e, t) {
2970
+ return fe(e, `/api/v1/public/flows/${t}`);
2978
2971
  }
2979
- async function Wr(e, t, r, s, o, l) {
2980
- return de(
2972
+ async function Gr(e, t, r, s, o, l) {
2973
+ return fe(
2981
2974
  e,
2982
2975
  `/api/v1/public/flows/${t}/files/presign`,
2983
2976
  {
@@ -2986,22 +2979,22 @@ async function Wr(e, t, r, s, o, l) {
2986
2979
  }
2987
2980
  );
2988
2981
  }
2989
- async function Gr(e, t, r) {
2990
- return de(
2982
+ async function Jr(e, t, r) {
2983
+ return fe(
2991
2984
  e,
2992
2985
  `/api/v1/public/flows/${t}/files/${r}/confirm`,
2993
2986
  { method: "POST" }
2994
2987
  );
2995
2988
  }
2996
- async function Jr(e, t, r) {
2989
+ async function Xr(e, t, r) {
2997
2990
  const s = { flowId: t };
2998
- return r && Object.keys(r).length > 0 && (s.context = r), de(e, "/api/v1/public/sessions", {
2991
+ return r && Object.keys(r).length > 0 && (s.context = r), fe(e, "/api/v1/public/sessions", {
2999
2992
  method: "POST",
3000
2993
  body: JSON.stringify(s)
3001
2994
  });
3002
2995
  }
3003
- async function Xr(e, t, r) {
3004
- return de(
2996
+ async function Qr(e, t, r) {
2997
+ return fe(
3005
2998
  e,
3006
2999
  `/api/v1/public/sessions/${t}/next`,
3007
3000
  {
@@ -3010,8 +3003,8 @@ async function Xr(e, t, r) {
3010
3003
  }
3011
3004
  );
3012
3005
  }
3013
- async function Qr(e, t, r) {
3014
- return de(
3006
+ async function Zr(e, t, r) {
3007
+ return fe(
3015
3008
  e,
3016
3009
  `/api/v1/public/sessions/${t}/prev`,
3017
3010
  {
@@ -3020,8 +3013,8 @@ async function Qr(e, t, r) {
3020
3013
  }
3021
3014
  );
3022
3015
  }
3023
- async function Zr(e, t, r) {
3024
- return de(
3016
+ async function eo(e, t, r) {
3017
+ return fe(
3025
3018
  e,
3026
3019
  `/api/v1/public/sessions/${t}/complete`,
3027
3020
  {
@@ -3030,20 +3023,20 @@ async function Zr(e, t, r) {
3030
3023
  }
3031
3024
  );
3032
3025
  }
3033
- async function eo(e, t) {
3034
- return de(
3026
+ async function to(e, t) {
3027
+ return fe(
3035
3028
  e,
3036
3029
  `/api/v1/public/sessions/${t}`
3037
3030
  );
3038
3031
  }
3039
- const to = ({ uuid: e }) => {
3032
+ const no = ({ uuid: e }) => {
3040
3033
  const {
3041
3034
  value: t,
3042
3035
  properties: r,
3043
3036
  valid: s,
3044
3037
  validationErrors: o,
3045
3038
  updateValue: l
3046
- } = z(e), n = r, [i, d] = O(!1), [c, u] = O(!1), p = M(null), m = jr();
3039
+ } = z(e), n = r, [i, d] = M(!1), [c, u] = M(!1), p = O(null), m = Hr();
3047
3040
  if (!n) return null;
3048
3041
  const f = t != null && s === !1, v = async (y) => {
3049
3042
  if (y.preventDefault(), !y.target.files) return;
@@ -3056,7 +3049,7 @@ const to = ({ uuid: e }) => {
3056
3049
  if (d(!1), m) {
3057
3050
  u(!0);
3058
3051
  try {
3059
- const { fileId: x, uploadUrl: N } = await Wr(
3052
+ const { fileId: x, uploadUrl: N } = await Gr(
3060
3053
  m.config,
3061
3054
  m.flowId,
3062
3055
  b.name,
@@ -3068,15 +3061,15 @@ const to = ({ uuid: e }) => {
3068
3061
  method: "PUT",
3069
3062
  headers: { "Content-Type": b.type },
3070
3063
  body: b
3071
- }), await Gr(m.config, m.flowId, x);
3072
- const E = {
3064
+ }), await Jr(m.config, m.flowId, x);
3065
+ const S = {
3073
3066
  mode: "s3",
3074
3067
  fileId: x,
3075
3068
  name: b.name,
3076
3069
  type: b.type,
3077
3070
  size: b.size
3078
3071
  };
3079
- l(e, E), jt("file-upload", e, E);
3072
+ l(e, S), Ut("file-upload", e, S);
3080
3073
  } catch (x) {
3081
3074
  console.error("File upload failed:", x), d(!0), setTimeout(() => d(!1), 5e3);
3082
3075
  } finally {
@@ -3092,12 +3085,12 @@ const to = ({ uuid: e }) => {
3092
3085
  size: b.size,
3093
3086
  lastModified: b.lastModified,
3094
3087
  data: C.result
3095
- };
3096
- "lastModifiedDate" in b && (x.lastModifiedDate = b.lastModifiedDate), l(e, x), jt("file-upload", e, x);
3088
+ }, N = b.lastModifiedDate;
3089
+ N instanceof Date && !Number.isNaN(N.getTime()) ? x.lastModifiedDate = N.toISOString() : typeof N == "string" && (x.lastModifiedDate = N), l(e, x), Ut("file-upload", e, x);
3097
3090
  }), C.readAsDataURL(b);
3098
3091
  };
3099
3092
  return /* @__PURE__ */ a(
3100
- q,
3093
+ W,
3101
3094
  {
3102
3095
  label: n.label,
3103
3096
  detail: n.detail,
@@ -3112,11 +3105,11 @@ const to = ({ uuid: e }) => {
3112
3105
  "label",
3113
3106
  {
3114
3107
  className: `fbre-file__btn${c ? " fbre-file__btn--uploading" : ""}`,
3115
- children: c ? /* @__PURE__ */ w(ie, { children: [
3108
+ children: c ? /* @__PURE__ */ w(ue, { children: [
3116
3109
  /* @__PURE__ */ a("div", { className: "fbre-spinner fbre-spinner--sm" }),
3117
3110
  "Uploading..."
3118
- ] }) : /* @__PURE__ */ w(ie, { children: [
3119
- /* @__PURE__ */ a(Gn, {}),
3111
+ ] }) : /* @__PURE__ */ w(ue, { children: [
3112
+ /* @__PURE__ */ a(Xn, {}),
3120
3113
  "Upload file",
3121
3114
  /* @__PURE__ */ a(
3122
3115
  "input",
@@ -3149,8 +3142,8 @@ const to = ({ uuid: e }) => {
3149
3142
  }
3150
3143
  );
3151
3144
  };
3152
- F("fileUpload", to);
3153
- const no = ({ uuid: e }) => {
3145
+ F("fileUpload", no);
3146
+ const ro = ({ uuid: e }) => {
3154
3147
  const {
3155
3148
  value: t,
3156
3149
  properties: r,
@@ -3161,7 +3154,7 @@ const no = ({ uuid: e }) => {
3161
3154
  if (!n) return null;
3162
3155
  const i = t != null && s === !1, d = n.labelYes ?? "Yes", c = n.labelNo ?? "No";
3163
3156
  return /* @__PURE__ */ a(
3164
- q,
3157
+ W,
3165
3158
  {
3166
3159
  label: n.label,
3167
3160
  detail: n.detail,
@@ -3194,8 +3187,8 @@ const no = ({ uuid: e }) => {
3194
3187
  }
3195
3188
  );
3196
3189
  };
3197
- F("yesNo", no);
3198
- const ro = ({ uuid: e }) => {
3190
+ F("yesNo", ro);
3191
+ const oo = ({ uuid: e }) => {
3199
3192
  const {
3200
3193
  value: t,
3201
3194
  properties: r,
@@ -3206,7 +3199,7 @@ const ro = ({ uuid: e }) => {
3206
3199
  if (!n) return null;
3207
3200
  const i = s === !1, d = t === !0;
3208
3201
  return /* @__PURE__ */ a(
3209
- q,
3202
+ W,
3210
3203
  {
3211
3204
  detail: n.detail,
3212
3205
  helperText: n.helperText,
@@ -3229,79 +3222,79 @@ const ro = ({ uuid: e }) => {
3229
3222
  }
3230
3223
  );
3231
3224
  };
3232
- F("confirm", ro);
3233
- const Ht = (e) => {
3225
+ F("confirm", oo);
3226
+ const Ft = (e) => {
3234
3227
  const { h: t, s: r, b: s } = e, o = r / 100, l = s / 100, n = l * o, i = n * (1 - Math.abs(t / 60 % 2 - 1)), d = l - n;
3235
3228
  let c = 0, u = 0, p = 0;
3236
3229
  t < 60 ? (c = n, u = i, p = 0) : t < 120 ? (c = i, u = n, p = 0) : t < 180 ? (c = 0, u = n, p = i) : t < 240 ? (c = 0, u = i, p = n) : t < 300 ? (c = i, u = 0, p = n) : (c = n, u = 0, p = i);
3237
3230
  const m = (f) => Math.round((f + d) * 255).toString(16).padStart(2, "0");
3238
3231
  return `#${m(c)}${m(u)}${m(p)}`;
3239
- }, Ve = (e) => {
3232
+ }, Be = (e) => {
3240
3233
  const t = e.replace("#", ""), r = parseInt(t.substring(0, 2), 16) / 255, s = parseInt(t.substring(2, 4), 16) / 255, o = parseInt(t.substring(4, 6), 16) / 255, l = Math.max(r, s, o), n = Math.min(r, s, o), i = l - n;
3241
3234
  let d = 0;
3242
3235
  i !== 0 && (l === r ? d = 60 * ((s - o) / i % 6) : l === s ? d = 60 * ((o - r) / i + 2) : d = 60 * ((r - s) / i + 4)), d < 0 && (d += 360);
3243
3236
  const c = l === 0 ? 0 : i / l * 100, u = l * 100;
3244
3237
  return { h: d, s: c, b: u };
3245
- }, at = (e) => /^#[0-9a-fA-F]{6}$/.test(e), oo = ({ uuid: e }) => {
3238
+ }, lt = (e) => /^#[0-9a-fA-F]{6}$/.test(e), so = ({ uuid: e }) => {
3246
3239
  const {
3247
3240
  value: t,
3248
3241
  properties: r,
3249
3242
  valid: s,
3250
3243
  validationErrors: o,
3251
3244
  updateValue: l
3252
- } = z(e), n = r, [i, d] = O(!1), c = M(null), u = M(null), p = M(null), m = M(null), f = M(null), [v, y] = O(""), b = typeof t == "string" && at(t) ? t : "#1976d2", [C, x] = O(() => Ve(b));
3253
- Je(
3245
+ } = z(e), n = r, [i, d] = M(!1), c = O(null), u = O(null), p = O(null), m = O(null), f = O(null), [v, y] = M(""), b = typeof t == "string" && lt(t) ? t : "#1976d2", [C, x] = M(() => Be(b));
3246
+ Qe(
3254
3247
  c,
3255
3248
  i,
3256
3249
  H(() => d(!1), [])
3257
3250
  );
3258
- const N = Xe(p, i, 320);
3251
+ const N = Ze(p, i, 320);
3259
3252
  if (K(() => {
3260
- typeof t == "string" && at(t) && (y(t), x(Ve(t)));
3253
+ typeof t == "string" && lt(t) && (y(t), x(Be(t)));
3261
3254
  }, [t]), !n) return null;
3262
- const E = t != null && s === !1, S = (h) => {
3255
+ const S = t != null && s === !1, E = (h) => {
3263
3256
  x(h);
3264
- const _ = Ht(h);
3257
+ const _ = Ft(h);
3265
3258
  y(_), l(e, _);
3266
3259
  }, D = (h) => {
3267
3260
  h.preventDefault();
3268
- const _ = ($, B) => {
3269
- const V = m.current.getBoundingClientRect(), P = Math.max(
3261
+ const _ = (V, P) => {
3262
+ const $ = m.current.getBoundingClientRect(), B = Math.max(
3270
3263
  0,
3271
- Math.min(100, ($ - V.left) / V.width * 100)
3264
+ Math.min(100, (V - $.left) / $.width * 100)
3272
3265
  ), j = Math.max(
3273
3266
  0,
3274
- Math.min(100, (1 - (B - V.top) / V.height) * 100)
3267
+ Math.min(100, (1 - (P - $.top) / $.height) * 100)
3275
3268
  );
3276
- S({ ...C, s: P, b: j });
3269
+ E({ ...C, s: B, b: j });
3277
3270
  };
3278
3271
  _(h.clientX, h.clientY);
3279
- const k = ($) => _($.clientX, $.clientY), I = () => {
3272
+ const k = (V) => _(V.clientX, V.clientY), I = () => {
3280
3273
  document.removeEventListener("mousemove", k), document.removeEventListener("mouseup", I);
3281
3274
  };
3282
3275
  document.addEventListener("mousemove", k), document.addEventListener("mouseup", I);
3283
3276
  }, T = (h) => {
3284
3277
  h.preventDefault();
3285
- const _ = ($) => {
3286
- const B = f.current.getBoundingClientRect(), V = Math.max(
3278
+ const _ = (V) => {
3279
+ const P = f.current.getBoundingClientRect(), $ = Math.max(
3287
3280
  0,
3288
- Math.min(360, ($ - B.left) / B.width * 360)
3281
+ Math.min(360, (V - P.left) / P.width * 360)
3289
3282
  );
3290
- S({ ...C, h: V });
3283
+ E({ ...C, h: $ });
3291
3284
  };
3292
3285
  _(h.clientX);
3293
- const k = ($) => _($.clientX), I = () => {
3286
+ const k = (V) => _(V.clientX), I = () => {
3294
3287
  document.removeEventListener("mousemove", k), document.removeEventListener("mouseup", I);
3295
3288
  };
3296
3289
  document.addEventListener("mousemove", k), document.addEventListener("mouseup", I);
3297
3290
  }, R = (h) => {
3298
- if (y(h), at(h)) {
3299
- const _ = Ve(h);
3291
+ if (y(h), lt(h)) {
3292
+ const _ = Be(h);
3300
3293
  x(_), l(e, h.toLowerCase());
3301
3294
  }
3302
- }, g = Ht({ h: C.h, s: 100, b: 100 });
3295
+ }, g = Ft({ h: C.h, s: 100, b: 100 });
3303
3296
  return /* @__PURE__ */ a(
3304
- q,
3297
+ W,
3305
3298
  {
3306
3299
  label: n.label,
3307
3300
  detail: n.detail,
@@ -3309,8 +3302,8 @@ const Ht = (e) => {
3309
3302
  helperText: n.helperText,
3310
3303
  tooltip: n.tooltip,
3311
3304
  externalFocused: i,
3312
- error: E,
3313
- errorMessages: E ? o : void 0,
3305
+ error: S,
3306
+ errorMessages: S ? o : void 0,
3314
3307
  children: () => /* @__PURE__ */ w("div", { className: "fbre-colorpicker", ref: c, children: [
3315
3308
  /* @__PURE__ */ w(
3316
3309
  "button",
@@ -3403,7 +3396,7 @@ const Ht = (e) => {
3403
3396
  style: { background: h },
3404
3397
  onClick: () => {
3405
3398
  const k = h.toLowerCase();
3406
- y(k), x(Ve(k)), l(e, k);
3399
+ y(k), x(Be(k)), l(e, k);
3407
3400
  }
3408
3401
  },
3409
3402
  _
@@ -3415,17 +3408,17 @@ const Ht = (e) => {
3415
3408
  }
3416
3409
  );
3417
3410
  };
3418
- F("colorPicker", oo);
3419
- const so = ({ uuid: e }) => {
3411
+ F("colorPicker", so);
3412
+ const ao = ({ uuid: e }) => {
3420
3413
  const {
3421
3414
  value: t,
3422
3415
  properties: r,
3423
3416
  valid: s,
3424
3417
  validationErrors: o,
3425
3418
  updateValue: l
3426
- } = z(e), n = r, i = (n == null ? void 0 : n.mode) ?? "draw", [d, c] = O(
3419
+ } = z(e), n = r, i = (n == null ? void 0 : n.mode) ?? "draw", [d, c] = M(
3427
3420
  i === "type" ? "type" : "draw"
3428
- ), u = M(null), p = M(null), m = M(!1), f = M(null), v = M(!1), y = t != null && s === !1, b = H(() => {
3421
+ ), u = O(null), p = O(null), m = O(!1), f = O(null), v = O(!1), y = t != null && s === !1, b = H(() => {
3429
3422
  const g = u.current, h = p.current;
3430
3423
  if (!g || !h) return;
3431
3424
  const _ = h.getBoundingClientRect(), k = window.devicePixelRatio || 1;
@@ -3455,14 +3448,14 @@ const so = ({ uuid: e }) => {
3455
3448
  h && (h.setPointerCapture(g.pointerId), m.current = !0, f.current = C(g.nativeEvent), v.current = !0);
3456
3449
  },
3457
3450
  []
3458
- ), E = H(
3451
+ ), S = H(
3459
3452
  (g) => {
3460
3453
  if (!m.current || !f.current) return;
3461
3454
  const h = C(g.nativeEvent);
3462
3455
  x(f.current, h), f.current = h;
3463
3456
  },
3464
3457
  [x]
3465
- ), S = H(() => {
3458
+ ), E = H(() => {
3466
3459
  if (!m.current) return;
3467
3460
  m.current = !1, f.current = null;
3468
3461
  const g = u.current;
@@ -3484,7 +3477,7 @@ const so = ({ uuid: e }) => {
3484
3477
  c(g), l(e, null), v.current = !1;
3485
3478
  };
3486
3479
  return n ? /* @__PURE__ */ a(
3487
- q,
3480
+ W,
3488
3481
  {
3489
3482
  label: n.label ?? "Signature",
3490
3483
  detail: n.detail,
@@ -3522,9 +3515,9 @@ const so = ({ uuid: e }) => {
3522
3515
  ref: u,
3523
3516
  className: "fbre-signature__canvas",
3524
3517
  onPointerDown: N,
3525
- onPointerMove: E,
3526
- onPointerUp: S,
3527
- onPointerLeave: S
3518
+ onPointerMove: S,
3519
+ onPointerUp: E,
3520
+ onPointerLeave: E
3528
3521
  }
3529
3522
  ),
3530
3523
  /* @__PURE__ */ a(
@@ -3554,39 +3547,39 @@ const so = ({ uuid: e }) => {
3554
3547
  }
3555
3548
  ) : null;
3556
3549
  };
3557
- F("signature", so);
3558
- function Kt(e) {
3550
+ F("signature", ao);
3551
+ function jt(e) {
3559
3552
  const t = e.offsetParent;
3560
3553
  if (!t) return 0;
3561
- const r = mn(t), s = r === document.documentElement ? { left: 0, right: window.innerWidth } : r.getBoundingClientRect(), o = t.getBoundingClientRect(), l = e.offsetWidth, n = o.left + l;
3554
+ const r = hn(t), s = r === document.documentElement ? { left: 0, right: window.innerWidth } : r.getBoundingClientRect(), o = t.getBoundingClientRect(), l = e.offsetWidth, n = o.left + l;
3562
3555
  if (n <= s.right - 8) return 0;
3563
3556
  let i = -(n - s.right + 8);
3564
3557
  return o.left + i < s.left + 8 && (i = s.left + 8 - o.left), i;
3565
3558
  }
3566
- const xe = ({
3559
+ const ke = ({
3567
3560
  open: e,
3568
3561
  onClose: t,
3569
3562
  children: r,
3570
3563
  estimatedHeight: s = 300,
3571
3564
  triggerRef: o
3572
3565
  }) => {
3573
- const l = M(null);
3574
- Je(
3566
+ const l = O(null);
3567
+ Qe(
3575
3568
  l,
3576
3569
  e,
3577
3570
  H(() => t(), [t])
3578
3571
  );
3579
- const n = Xe(l, e, s), [i, d] = O(0);
3580
- if (qt(() => {
3572
+ const n = Ze(l, e, s), [i, d] = M(0);
3573
+ if (zt(() => {
3581
3574
  if (!e || !l.current) {
3582
3575
  d(0);
3583
3576
  return;
3584
3577
  }
3585
- d(Kt(l.current));
3578
+ d(jt(l.current));
3586
3579
  }, [e]), K(() => {
3587
3580
  if (!e || !l.current) return;
3588
3581
  const p = () => {
3589
- l.current && d(Kt(l.current));
3582
+ l.current && d(jt(l.current));
3590
3583
  };
3591
3584
  return window.addEventListener("scroll", p, !0), window.addEventListener("resize", p), () => {
3592
3585
  window.removeEventListener("scroll", p, !0), window.removeEventListener("resize", p);
@@ -3607,41 +3600,41 @@ const xe = ({
3607
3600
  children: r
3608
3601
  }
3609
3602
  );
3610
- }, Pe = (e, t) => new Date(e, t + 1, 0).getDate(), ao = (e, t) => new Date(e, t, 1).getDay(), fe = (e, t, r) => `${e}-${String(t + 1).padStart(2, "0")}-${String(r).padStart(2, "0")}`, lo = (e) => {
3603
+ }, je = (e, t) => new Date(e, t + 1, 0).getDate(), lo = (e, t) => new Date(e, t, 1).getDay(), he = (e, t, r) => `${e}-${String(t + 1).padStart(2, "0")}-${String(r).padStart(2, "0")}`, io = (e) => {
3611
3604
  const t = e.split("-");
3612
3605
  if (t.length !== 3) return null;
3613
3606
  const r = parseInt(t[0], 10), s = parseInt(t[1], 10) - 1, o = parseInt(t[2], 10);
3614
3607
  return isNaN(r) || isNaN(s) || isNaN(o) ? null : { year: r, month: s, day: o };
3615
- }, Ke = (e, t) => {
3616
- const r = lo(e);
3608
+ }, qe = (e, t) => {
3609
+ const r = io(e);
3617
3610
  if (!r) return e;
3618
3611
  const s = String(r.month + 1).padStart(2, "0"), o = String(r.day).padStart(2, "0"), l = String(r.year);
3619
3612
  return t === "DD/MM/YYYY" ? `${o}/${s}/${l}` : t === "YYYY-MM-DD" ? `${l}-${s}-${o}` : `${s}/${o}/${l}`;
3620
- }, ze = (e) => {
3613
+ }, We = (e) => {
3621
3614
  const t = e.split(":");
3622
3615
  if (t.length !== 2) return e;
3623
3616
  let r = parseInt(t[0], 10);
3624
3617
  const s = t[1], o = r >= 12 ? "PM" : "AM";
3625
3618
  return r === 0 ? r = 12 : r > 12 && (r -= 12), `${r}:${s} ${o}`;
3626
- }, ht = (e, t) => {
3619
+ }, bt = (e, t) => {
3627
3620
  const r = e.indexOf("T");
3628
3621
  if (r === -1) return e;
3629
3622
  const s = e.substring(0, r), o = e.substring(r + 1);
3630
- return `${Ke(s, t)} ${ze(o)}`;
3631
- }, io = (e, t, r) => {
3623
+ return `${qe(s, t)} ${We(o)}`;
3624
+ }, co = (e, t, r) => {
3632
3625
  let s = e;
3633
3626
  return r === "AM" && s === 12 ? s = 0 : r === "PM" && s !== 12 && (s += 12), `${String(s).padStart(2, "0")}:${String(t).padStart(2, "0")}`;
3634
- }, co = (e) => {
3627
+ }, uo = (e) => {
3635
3628
  const t = e.split(":");
3636
3629
  let r = parseInt(t[0], 10);
3637
3630
  const s = parseInt(t[1], 10), o = r >= 12 ? "PM" : "AM";
3638
3631
  return r === 0 ? r = 12 : r > 12 && (r -= 12), { hour: r, minute: s, ampm: o };
3639
- }, uo = (e, t, r) => e >= t && e <= r, ce = (e) => {
3632
+ }, po = (e, t, r) => e >= t && e <= r, pe = (e) => {
3640
3633
  if (!e) return;
3641
3634
  if (!e.startsWith("today")) return e;
3642
3635
  const t = e === "today" ? 0 : parseInt(e.slice(5), 10), r = /* @__PURE__ */ new Date();
3643
- return r.setDate(r.getDate() + (isNaN(t) ? 0 : t)), fe(r.getFullYear(), r.getMonth(), r.getDate());
3644
- }, po = [
3636
+ return r.setDate(r.getDate() + (isNaN(t) ? 0 : t)), he(r.getFullYear(), r.getMonth(), r.getDate());
3637
+ }, fo = [
3645
3638
  "January",
3646
3639
  "February",
3647
3640
  "March",
@@ -3654,21 +3647,21 @@ const xe = ({
3654
3647
  "October",
3655
3648
  "November",
3656
3649
  "December"
3657
- ], fo = (e) => po[e], mo = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], Se = (e) => [
3650
+ ], mo = (e) => fo[e], ho = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], Ee = (e) => [
3658
3651
  parseInt(e.substring(0, 4), 10),
3659
3652
  parseInt(e.substring(5, 7), 10) - 1,
3660
3653
  parseInt(e.substring(8, 10), 10)
3661
- ], ge = (e, t) => {
3662
- const [r, s, o] = Se(e), l = new Date(r, s, o + t);
3663
- return fe(l.getFullYear(), l.getMonth(), l.getDate());
3664
- }, $e = (e, t) => {
3665
- let [r, s, o] = Se(e);
3654
+ ], _e = (e, t) => {
3655
+ const [r, s, o] = Ee(e), l = new Date(r, s, o + t);
3656
+ return he(l.getFullYear(), l.getMonth(), l.getDate());
3657
+ }, Pe = (e, t) => {
3658
+ let [r, s, o] = Ee(e);
3666
3659
  for (s += t; s < 0; )
3667
3660
  s += 12, r--;
3668
3661
  for (; s > 11; )
3669
3662
  s -= 12, r++;
3670
- return fe(r, s, Math.min(o, Pe(r, s)));
3671
- }, Qe = ({
3663
+ return he(r, s, Math.min(o, je(r, s)));
3664
+ }, et = ({
3672
3665
  selectedDate: e,
3673
3666
  min: t,
3674
3667
  max: r,
@@ -3677,65 +3670,65 @@ const xe = ({
3677
3670
  rangeEnd: l,
3678
3671
  rangeHover: n
3679
3672
  }) => {
3680
- const i = /* @__PURE__ */ new Date(), d = fe(
3673
+ const i = /* @__PURE__ */ new Date(), d = he(
3681
3674
  i.getFullYear(),
3682
3675
  i.getMonth(),
3683
3676
  i.getDate()
3684
- ), [c, u] = O(e || d), p = M({}), m = M(!1);
3677
+ ), [c, u] = M(e || d), p = O({}), m = O(!1);
3685
3678
  K(() => {
3686
3679
  var _;
3687
3680
  m.current && ((_ = p.current[c]) == null || _.focus(), m.current = !1);
3688
3681
  }, [c]);
3689
3682
  const f = (_) => {
3690
3683
  m.current = !0, u(_);
3691
- }, [v, y] = Se(c), b = () => u($e(c, -1)), C = () => u($e(c, 1)), x = (_) => {
3684
+ }, [v, y] = Ee(c), b = () => u(Pe(c, -1)), C = () => u(Pe(c, 1)), x = (_) => {
3692
3685
  let k = null;
3693
3686
  switch (_.key) {
3694
3687
  case "ArrowLeft":
3695
- k = ge(c, -1);
3688
+ k = _e(c, -1);
3696
3689
  break;
3697
3690
  case "ArrowRight":
3698
- k = ge(c, 1);
3691
+ k = _e(c, 1);
3699
3692
  break;
3700
3693
  case "ArrowUp":
3701
- k = ge(c, -7);
3694
+ k = _e(c, -7);
3702
3695
  break;
3703
3696
  case "ArrowDown":
3704
- k = ge(c, 7);
3697
+ k = _e(c, 7);
3705
3698
  break;
3706
3699
  case "Home": {
3707
- const [I, $, B] = Se(c);
3708
- k = ge(c, -new Date(I, $, B).getDay());
3700
+ const [I, V, P] = Ee(c);
3701
+ k = _e(c, -new Date(I, V, P).getDay());
3709
3702
  break;
3710
3703
  }
3711
3704
  case "End": {
3712
- const [I, $, B] = Se(c);
3713
- k = ge(c, 6 - new Date(I, $, B).getDay());
3705
+ const [I, V, P] = Ee(c);
3706
+ k = _e(c, 6 - new Date(I, V, P).getDay());
3714
3707
  break;
3715
3708
  }
3716
3709
  case "PageUp":
3717
- k = $e(c, -1);
3710
+ k = Pe(c, -1);
3718
3711
  break;
3719
3712
  case "PageDown":
3720
- k = $e(c, 1);
3713
+ k = Pe(c, 1);
3721
3714
  break;
3722
3715
  }
3723
3716
  k && (_.preventDefault(), f(k));
3724
- }, N = Pe(v, y), E = ao(v, y), S = [], D = y === 0 ? Pe(v - 1, 11) : Pe(v, y - 1);
3725
- for (let _ = E - 1; _ >= 0; _--) {
3726
- const k = D - _, I = y === 0 ? 11 : y - 1, $ = y === 0 ? v - 1 : v;
3727
- S.push({ day: k, iso: fe($, I, k), outside: !0 });
3717
+ }, N = je(v, y), S = lo(v, y), E = [], D = y === 0 ? je(v - 1, 11) : je(v, y - 1);
3718
+ for (let _ = S - 1; _ >= 0; _--) {
3719
+ const k = D - _, I = y === 0 ? 11 : y - 1, V = y === 0 ? v - 1 : v;
3720
+ E.push({ day: k, iso: he(V, I, k), outside: !0 });
3728
3721
  }
3729
3722
  for (let _ = 1; _ <= N; _++)
3730
- S.push({
3723
+ E.push({
3731
3724
  day: _,
3732
- iso: fe(v, y, _),
3725
+ iso: he(v, y, _),
3733
3726
  outside: !1
3734
3727
  });
3735
- const T = 42 - S.length;
3728
+ const T = 42 - E.length;
3736
3729
  for (let _ = 1; _ <= T; _++) {
3737
3730
  const k = y === 11 ? 0 : y + 1, I = y === 11 ? v + 1 : v;
3738
- S.push({ day: _, iso: fe(I, k, _), outside: !0 });
3731
+ E.push({ day: _, iso: he(I, k, _), outside: !0 });
3739
3732
  }
3740
3733
  const R = n ?? l, g = o && R && o <= R ? o : R, h = o && R && o <= R ? R : o;
3741
3734
  return /* @__PURE__ */ w("div", { className: "fbre-calendar", children: [
@@ -3751,7 +3744,7 @@ const xe = ({
3751
3744
  }
3752
3745
  ),
3753
3746
  /* @__PURE__ */ w("span", { className: "fbre-calendar__nav-title", children: [
3754
- fo(y),
3747
+ mo(y),
3755
3748
  " ",
3756
3749
  v
3757
3750
  ] }),
@@ -3766,38 +3759,38 @@ const xe = ({
3766
3759
  }
3767
3760
  )
3768
3761
  ] }),
3769
- /* @__PURE__ */ a("div", { className: "fbre-calendar__weekdays", children: mo.map((_) => /* @__PURE__ */ a("div", { className: "fbre-calendar__weekday", children: _ }, _)) }),
3762
+ /* @__PURE__ */ a("div", { className: "fbre-calendar__weekdays", children: ho.map((_) => /* @__PURE__ */ a("div", { className: "fbre-calendar__weekday", children: _ }, _)) }),
3770
3763
  /* @__PURE__ */ a(
3771
3764
  "div",
3772
3765
  {
3773
3766
  className: "fbre-calendar__grid",
3774
3767
  role: "grid",
3775
3768
  onKeyDown: x,
3776
- children: S.map((_, k) => {
3777
- const I = _.iso === e, $ = _.iso === d, B = t && _.iso < t || r && _.iso > r, V = g && h && uo(_.iso, g, h), P = _.iso === g, j = _.iso === h, J = [
3769
+ children: E.map((_, k) => {
3770
+ const I = _.iso === e, V = _.iso === d, P = t && _.iso < t || r && _.iso > r, $ = g && h && po(_.iso, g, h), B = _.iso === g, j = _.iso === h, Z = [
3778
3771
  "fbre-calendar__day",
3779
3772
  _.outside && "fbre-calendar__day--outside",
3780
3773
  I && "fbre-calendar__day--selected",
3781
- $ && "fbre-calendar__day--today",
3782
- B && "fbre-calendar__day--disabled",
3783
- V && "fbre-calendar__day--range",
3784
- P && "fbre-calendar__day--range-start",
3774
+ V && "fbre-calendar__day--today",
3775
+ P && "fbre-calendar__day--disabled",
3776
+ $ && "fbre-calendar__day--range",
3777
+ B && "fbre-calendar__day--range-start",
3785
3778
  j && "fbre-calendar__day--range-end"
3786
3779
  ].filter(Boolean).join(" ");
3787
3780
  return /* @__PURE__ */ a(
3788
3781
  "button",
3789
3782
  {
3790
3783
  type: "button",
3791
- ref: (Z) => {
3792
- p.current[_.iso] = Z;
3784
+ ref: (X) => {
3785
+ p.current[_.iso] = X;
3793
3786
  },
3794
- className: J,
3787
+ className: Z,
3795
3788
  role: "gridcell",
3796
3789
  "aria-selected": I || void 0,
3797
- "aria-current": $ ? "date" : void 0,
3798
- "aria-disabled": B ? !0 : void 0,
3790
+ "aria-current": V ? "date" : void 0,
3791
+ "aria-disabled": P ? !0 : void 0,
3799
3792
  tabIndex: !_.outside && _.iso === c ? 0 : -1,
3800
- onClick: () => !_.outside && !B && s(_.iso),
3793
+ onClick: () => !_.outside && !P && s(_.iso),
3801
3794
  children: _.day
3802
3795
  },
3803
3796
  k
@@ -3806,18 +3799,18 @@ const xe = ({
3806
3799
  }
3807
3800
  )
3808
3801
  ] });
3809
- }, ho = ({ uuid: e }) => {
3802
+ }, bo = ({ uuid: e }) => {
3810
3803
  const {
3811
3804
  value: t,
3812
3805
  properties: r,
3813
3806
  valid: s,
3814
3807
  validationErrors: o,
3815
3808
  updateValue: l
3816
- } = z(e), n = r, [i, d] = O(!1), c = M(null);
3809
+ } = z(e), n = r, [i, d] = M(!1), c = O(null);
3817
3810
  if (!n) return null;
3818
3811
  const u = n.readOnly === !0, p = t != null && s === !1, m = typeof t == "string" ? t : "";
3819
3812
  return /* @__PURE__ */ a(
3820
- q,
3813
+ W,
3821
3814
  {
3822
3815
  label: n.label,
3823
3816
  detail: n.detail,
@@ -3842,17 +3835,17 @@ const xe = ({
3842
3835
  f.key === "Escape" && i && (f.preventDefault(), d(!1));
3843
3836
  },
3844
3837
  children: [
3845
- m ? /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-text", children: Ke(m, n.dateFormat) }) : /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-placeholder", children: n.placeholder ?? "Select date..." }),
3846
- /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-icon", children: /* @__PURE__ */ a(_e, {}) })
3838
+ m ? /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-text", children: qe(m, n.dateFormat) }) : /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-placeholder", children: n.placeholder ?? "Select date..." }),
3839
+ /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-icon", children: /* @__PURE__ */ a(Ce, {}) })
3847
3840
  ]
3848
3841
  }
3849
3842
  ),
3850
- /* @__PURE__ */ a(xe, { open: i, onClose: () => d(!1), triggerRef: c, children: /* @__PURE__ */ a(
3851
- Qe,
3843
+ /* @__PURE__ */ a(ke, { open: i, onClose: () => d(!1), triggerRef: c, children: /* @__PURE__ */ a(
3844
+ et,
3852
3845
  {
3853
3846
  selectedDate: m,
3854
- min: ce(n.min),
3855
- max: ce(n.max),
3847
+ min: pe(n.min),
3848
+ max: pe(n.max),
3856
3849
  onSelect: (f) => {
3857
3850
  l(e, f), d(!1);
3858
3851
  }
@@ -3862,50 +3855,50 @@ const xe = ({
3862
3855
  }
3863
3856
  );
3864
3857
  };
3865
- F("date", ho);
3866
- const zt = (e) => {
3858
+ F("date", bo);
3859
+ const Ht = (e) => {
3867
3860
  if (!e) return null;
3868
3861
  const t = e.split(":");
3869
3862
  if (t.length !== 2) return null;
3870
3863
  const r = parseInt(t[0], 10), s = parseInt(t[1], 10);
3871
3864
  return isNaN(r) || isNaN(s) ? null : r * 60 + s;
3872
- }, lt = (e, t) => t === "AM" && e === 12 ? 0 : t === "PM" && e !== 12 ? e + 12 : e, Ze = ({
3865
+ }, it = (e, t) => t === "AM" && e === 12 ? 0 : t === "PM" && e !== 12 ? e + 12 : e, tt = ({
3873
3866
  value: e,
3874
3867
  min: t,
3875
3868
  max: r,
3876
3869
  step: s = 15,
3877
3870
  onChange: o
3878
3871
  }) => {
3879
- const l = M(null), n = M(null), i = e ? co(e) : { hour: 12, minute: 0, ampm: "AM" }, {
3872
+ const l = O(null), n = O(null), i = e ? uo(e) : { hour: 12, minute: 0, ampm: "AM" }, {
3880
3873
  hour: d,
3881
3874
  minute: c,
3882
3875
  ampm: u
3883
3876
  } = i, p = Array.from({ length: 12 }, (g, h) => h + 1), m = [];
3884
3877
  for (let g = 0; g < 60; g += s)
3885
3878
  m.push(g);
3886
- const f = ["AM", "PM"], v = De(() => zt(t), [t]), y = De(() => zt(r), [r]), b = v !== null || y !== null, C = (g, h) => {
3879
+ const f = ["AM", "PM"], v = Te(() => Ht(t), [t]), y = Te(() => Ht(r), [r]), b = v !== null || y !== null, C = (g, h) => {
3887
3880
  const _ = g * 60 + h;
3888
3881
  return !(v !== null && _ < v || y !== null && _ > y);
3889
3882
  }, x = (g, h) => {
3890
3883
  if (!b) return !1;
3891
- const _ = lt(g, h);
3884
+ const _ = it(g, h);
3892
3885
  for (let k = 0; k < 60; k += s)
3893
3886
  if (C(_, k)) return !1;
3894
3887
  return !0;
3895
3888
  }, N = (g) => {
3896
3889
  if (!b) return !1;
3897
- const h = lt(d, u);
3890
+ const h = it(d, u);
3898
3891
  return !C(h, g);
3899
- }, E = (g) => {
3892
+ }, S = (g) => {
3900
3893
  if (!b) return !1;
3901
3894
  for (const h of p) {
3902
- const _ = lt(h, g);
3895
+ const _ = it(h, g);
3903
3896
  for (let k = 0; k < 60; k += s)
3904
3897
  if (C(_, k)) return !1;
3905
3898
  }
3906
3899
  return !0;
3907
- }, S = (g, h, _) => {
3908
- o(io(g, h, _));
3900
+ }, E = (g, h, _) => {
3901
+ o(co(g, h, _));
3909
3902
  };
3910
3903
  K(() => {
3911
3904
  const g = (h) => {
@@ -3933,9 +3926,9 @@ const zt = (e) => {
3933
3926
  const k = Array.from(
3934
3927
  _.querySelectorAll(".fbre-time-selector__cell")
3935
3928
  ), I = g.key === "ArrowDown" ? 1 : -1;
3936
- for (let $ = k.indexOf(h) + I; $ >= 0 && $ < k.length; $ += I)
3937
- if (k[$].getAttribute("aria-disabled") !== "true") {
3938
- k[$].focus();
3929
+ for (let V = k.indexOf(h) + I; V >= 0 && V < k.length; V += I)
3930
+ if (k[V].getAttribute("aria-disabled") !== "true") {
3931
+ k[V].focus();
3939
3932
  break;
3940
3933
  }
3941
3934
  };
@@ -3960,7 +3953,7 @@ const zt = (e) => {
3960
3953
  "aria-disabled": h ? !0 : void 0,
3961
3954
  "aria-pressed": g === d,
3962
3955
  tabIndex: g === d ? 0 : -1,
3963
- onClick: () => !h && S(g, c, u),
3956
+ onClick: () => !h && E(g, c, u),
3964
3957
  children: g
3965
3958
  },
3966
3959
  g
@@ -3988,7 +3981,7 @@ const zt = (e) => {
3988
3981
  "aria-disabled": h ? !0 : void 0,
3989
3982
  "aria-pressed": g === c,
3990
3983
  tabIndex: g === T ? 0 : -1,
3991
- onClick: () => !h && S(d, g, u),
3984
+ onClick: () => !h && E(d, g, u),
3992
3985
  children: String(g).padStart(2, "0")
3993
3986
  },
3994
3987
  g
@@ -4002,7 +3995,7 @@ const zt = (e) => {
4002
3995
  className: "fbre-time-selector__column fbre-time-selector__column--ampm",
4003
3996
  onKeyDown: R,
4004
3997
  children: f.map((g) => {
4005
- const h = E(g);
3998
+ const h = S(g);
4006
3999
  return /* @__PURE__ */ a(
4007
4000
  "button",
4008
4001
  {
@@ -4015,7 +4008,7 @@ const zt = (e) => {
4015
4008
  "aria-disabled": h ? !0 : void 0,
4016
4009
  "aria-pressed": g === u,
4017
4010
  tabIndex: g === u ? 0 : -1,
4018
- onClick: () => !h && S(d, c, g),
4011
+ onClick: () => !h && E(d, c, g),
4019
4012
  children: g
4020
4013
  },
4021
4014
  g
@@ -4024,18 +4017,18 @@ const zt = (e) => {
4024
4017
  }
4025
4018
  )
4026
4019
  ] });
4027
- }, bo = ({ uuid: e }) => {
4020
+ }, vo = ({ uuid: e }) => {
4028
4021
  const {
4029
4022
  value: t,
4030
4023
  properties: r,
4031
4024
  valid: s,
4032
4025
  validationErrors: o,
4033
4026
  updateValue: l
4034
- } = z(e), n = r, [i, d] = O(!1), c = M(null);
4027
+ } = z(e), n = r, [i, d] = M(!1), c = O(null);
4035
4028
  if (!n) return null;
4036
4029
  const u = n.readOnly === !0, p = t != null && s === !1, m = typeof t == "string" ? t : "";
4037
4030
  return /* @__PURE__ */ a(
4038
- q,
4031
+ W,
4039
4032
  {
4040
4033
  label: n.label,
4041
4034
  detail: n.detail,
@@ -4060,12 +4053,12 @@ const zt = (e) => {
4060
4053
  f.key === "Escape" && i && (f.preventDefault(), d(!1));
4061
4054
  },
4062
4055
  children: [
4063
- m ? /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-text", children: ze(m) }) : /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-placeholder", children: n.placeholder ?? "Select time..." }),
4064
- /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-icon", children: /* @__PURE__ */ a(mt, {}) })
4056
+ m ? /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-text", children: We(m) }) : /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-placeholder", children: n.placeholder ?? "Select time..." }),
4057
+ /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-icon", children: /* @__PURE__ */ a(ht, {}) })
4065
4058
  ]
4066
4059
  }
4067
4060
  ),
4068
- /* @__PURE__ */ w(xe, { open: i, onClose: () => d(!1), triggerRef: c, children: [
4061
+ /* @__PURE__ */ w(ke, { open: i, onClose: () => d(!1), triggerRef: c, children: [
4069
4062
  /* @__PURE__ */ w("div", { className: "fbre-picker-phase-header", children: [
4070
4063
  /* @__PURE__ */ a("span", { className: "fbre-picker-phase-header__label", children: "Select Time" }),
4071
4064
  /* @__PURE__ */ a(
@@ -4074,12 +4067,12 @@ const zt = (e) => {
4074
4067
  type: "button",
4075
4068
  className: "fbre-picker-phase-header__confirm",
4076
4069
  onClick: () => d(!1),
4077
- children: /* @__PURE__ */ a(ne, { size: 12 })
4070
+ children: /* @__PURE__ */ a(oe, { size: 12 })
4078
4071
  }
4079
4072
  )
4080
4073
  ] }),
4081
4074
  /* @__PURE__ */ a(
4082
- Ze,
4075
+ tt,
4083
4076
  {
4084
4077
  value: m || void 0,
4085
4078
  step: n.step,
@@ -4095,34 +4088,34 @@ const zt = (e) => {
4095
4088
  }
4096
4089
  );
4097
4090
  };
4098
- F("time", bo);
4099
- const vo = ({ uuid: e }) => {
4091
+ F("time", vo);
4092
+ const go = ({ uuid: e }) => {
4100
4093
  const {
4101
4094
  value: t,
4102
4095
  properties: r,
4103
4096
  valid: s,
4104
4097
  validationErrors: o,
4105
4098
  updateValue: l
4106
- } = z(e), n = r, [i, d] = O(!1), [c, u] = O("date"), p = M(null);
4099
+ } = z(e), n = r, [i, d] = M(!1), [c, u] = M("date"), p = O(null);
4107
4100
  if (!n) return null;
4108
4101
  const m = n.readOnly === !0, f = t != null && s === !1, v = typeof t == "string" ? t : "", y = v.indexOf("T"), b = y !== -1 ? v.substring(0, y) : "", C = y !== -1 ? v.substring(y + 1) : "", x = () => {
4109
4102
  u(b ? "time" : "date"), d(!0);
4110
4103
  }, N = () => {
4111
4104
  d(!1), u("date");
4112
- }, E = (g) => {
4113
- l(e, `${g}T${C || "12:00"}`), u("time");
4114
4105
  }, S = (g) => {
4106
+ l(e, `${g}T${C || "12:00"}`), u("time");
4107
+ }, E = (g) => {
4115
4108
  const h = b || (/* @__PURE__ */ new Date()).toISOString().substring(0, 10);
4116
4109
  l(e, `${h}T${g}`);
4117
4110
  }, D = () => {
4118
4111
  u("date");
4119
- }, T = ce(
4112
+ }, T = pe(
4120
4113
  n.min && n.min.includes("T") ? n.min.split("T")[0] : n.min
4121
- ), R = ce(
4114
+ ), R = pe(
4122
4115
  n.max && n.max.includes("T") ? n.max.split("T")[0] : n.max
4123
4116
  );
4124
4117
  return /* @__PURE__ */ a(
4125
- q,
4118
+ W,
4126
4119
  {
4127
4120
  label: n.label,
4128
4121
  detail: n.detail,
@@ -4147,20 +4140,20 @@ const vo = ({ uuid: e }) => {
4147
4140
  g.key === "Escape" && i && (g.preventDefault(), N());
4148
4141
  },
4149
4142
  children: [
4150
- v ? /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-text", children: ht(v, n.dateFormat) }) : /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-placeholder", children: n.placeholder ?? "Select date & time..." }),
4151
- /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-icon", children: /* @__PURE__ */ a(_e, {}) })
4143
+ v ? /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-text", children: bt(v, n.dateFormat) }) : /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-placeholder", children: n.placeholder ?? "Select date & time..." }),
4144
+ /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-icon", children: /* @__PURE__ */ a(Ce, {}) })
4152
4145
  ]
4153
4146
  }
4154
4147
  ),
4155
- /* @__PURE__ */ a(xe, { open: i, onClose: N, triggerRef: p, children: c === "date" ? /* @__PURE__ */ a(
4156
- Qe,
4148
+ /* @__PURE__ */ a(ke, { open: i, onClose: N, triggerRef: p, children: c === "date" ? /* @__PURE__ */ a(
4149
+ et,
4157
4150
  {
4158
4151
  selectedDate: b,
4159
4152
  min: T,
4160
4153
  max: R,
4161
- onSelect: E
4154
+ onSelect: S
4162
4155
  }
4163
- ) : /* @__PURE__ */ w(ie, { children: [
4156
+ ) : /* @__PURE__ */ w(ue, { children: [
4164
4157
  /* @__PURE__ */ w("div", { className: "fbre-picker-phase-header", children: [
4165
4158
  /* @__PURE__ */ a(
4166
4159
  "button",
@@ -4178,18 +4171,18 @@ const vo = ({ uuid: e }) => {
4178
4171
  type: "button",
4179
4172
  className: "fbre-picker-phase-header__confirm",
4180
4173
  onClick: N,
4181
- children: /* @__PURE__ */ a(ne, { size: 12 })
4174
+ children: /* @__PURE__ */ a(oe, { size: 12 })
4182
4175
  }
4183
4176
  )
4184
4177
  ] }),
4185
4178
  /* @__PURE__ */ a(
4186
- Ze,
4179
+ tt,
4187
4180
  {
4188
4181
  value: C || void 0,
4189
4182
  step: n.step,
4190
4183
  min: n.minTime,
4191
4184
  max: n.maxTime,
4192
- onChange: S
4185
+ onChange: E
4193
4186
  }
4194
4187
  )
4195
4188
  ] }) })
@@ -4197,31 +4190,31 @@ const vo = ({ uuid: e }) => {
4197
4190
  }
4198
4191
  );
4199
4192
  };
4200
- F("dateTime", vo);
4201
- const go = ({ uuid: e }) => {
4193
+ F("dateTime", go);
4194
+ const yo = ({ uuid: e }) => {
4202
4195
  const {
4203
4196
  value: t,
4204
4197
  properties: r,
4205
4198
  valid: s,
4206
4199
  validationErrors: o,
4207
4200
  updateValue: l
4208
- } = z(e), n = r, [i, d] = O(null), [c, u] = O(), p = M(null), m = M(null);
4201
+ } = z(e), n = r, [i, d] = M(null), [c, u] = M(), p = O(null), m = O(null);
4209
4202
  if (!n) return null;
4210
4203
  const f = t != null && s === !1, v = t && typeof t == "object" && "start" in t ? t : null, y = (v == null ? void 0 : v.start) ?? "", b = (v == null ? void 0 : v.end) ?? "", C = (N) => {
4211
4204
  if (i === "start") {
4212
- const E = b && N > b ? "" : b;
4213
- l(e, { start: N, end: E }), d(E ? null : "end");
4205
+ const S = b && N > b ? "" : b;
4206
+ l(e, { start: N, end: S }), d(S ? null : "end");
4214
4207
  } else if (i === "end") {
4215
- const E = y && N < y ? N : y, S = N < E ? E : N;
4208
+ const S = y && N < y ? N : y, E = N < S ? S : N;
4216
4209
  l(e, {
4217
- start: E || N,
4218
- end: E ? S : ""
4219
- }), E && S && d(null);
4210
+ start: S || N,
4211
+ end: S ? E : ""
4212
+ }), S && E && d(null);
4220
4213
  }
4221
4214
  u(void 0);
4222
4215
  }, x = i !== null;
4223
4216
  return /* @__PURE__ */ a(
4224
- q,
4217
+ W,
4225
4218
  {
4226
4219
  label: n.label,
4227
4220
  detail: n.detail,
@@ -4246,8 +4239,8 @@ const go = ({ uuid: e }) => {
4246
4239
  N.key === "Escape" && x && (N.preventDefault(), d(null), u(void 0));
4247
4240
  },
4248
4241
  children: [
4249
- y ? /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-text", children: Ke(y, n.dateFormat) }) : /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-placeholder", children: n.placeholderStart ?? "Start date" }),
4250
- /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-icon", children: /* @__PURE__ */ a(_e, { size: 12 }) })
4242
+ y ? /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-text", children: qe(y, n.dateFormat) }) : /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-placeholder", children: n.placeholderStart ?? "Start date" }),
4243
+ /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-icon", children: /* @__PURE__ */ a(Ce, { size: 12 }) })
4251
4244
  ]
4252
4245
  }
4253
4246
  ) }),
@@ -4265,14 +4258,14 @@ const go = ({ uuid: e }) => {
4265
4258
  N.key === "Escape" && x && (N.preventDefault(), d(null), u(void 0));
4266
4259
  },
4267
4260
  children: [
4268
- b ? /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-text", children: Ke(b, n.dateFormat) }) : /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-placeholder", children: n.placeholderEnd ?? "End date" }),
4269
- /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-icon", children: /* @__PURE__ */ a(_e, { size: 12 }) })
4261
+ b ? /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-text", children: qe(b, n.dateFormat) }) : /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-placeholder", children: n.placeholderEnd ?? "End date" }),
4262
+ /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-icon", children: /* @__PURE__ */ a(Ce, { size: 12 }) })
4270
4263
  ]
4271
4264
  }
4272
4265
  ) })
4273
4266
  ] }),
4274
4267
  /* @__PURE__ */ a(
4275
- xe,
4268
+ ke,
4276
4269
  {
4277
4270
  open: x,
4278
4271
  triggerRef: i === "start" ? p : m,
@@ -4280,11 +4273,11 @@ const go = ({ uuid: e }) => {
4280
4273
  d(null), u(void 0);
4281
4274
  },
4282
4275
  children: /* @__PURE__ */ a(
4283
- Qe,
4276
+ et,
4284
4277
  {
4285
4278
  selectedDate: i === "start" ? y : b,
4286
- min: ce(n.min),
4287
- max: ce(n.max),
4279
+ min: pe(n.min),
4280
+ max: pe(n.max),
4288
4281
  onSelect: C,
4289
4282
  rangeStart: y,
4290
4283
  rangeEnd: b,
@@ -4297,15 +4290,15 @@ const go = ({ uuid: e }) => {
4297
4290
  }
4298
4291
  );
4299
4292
  };
4300
- F("dateRange", go);
4301
- const yo = ({ uuid: e }) => {
4293
+ F("dateRange", yo);
4294
+ const _o = ({ uuid: e }) => {
4302
4295
  const {
4303
4296
  value: t,
4304
4297
  properties: r,
4305
4298
  valid: s,
4306
4299
  validationErrors: o,
4307
4300
  updateValue: l
4308
- } = z(e), n = r, [i, d] = O(null), c = M(null), u = M(null);
4301
+ } = z(e), n = r, [i, d] = M(null), c = O(null), u = O(null);
4309
4302
  if (!n) return null;
4310
4303
  const p = t != null && s === !1, m = t && typeof t == "object" && "start" in t ? t : null, f = (m == null ? void 0 : m.start) ?? "", v = (m == null ? void 0 : m.end) ?? "", y = (x) => {
4311
4304
  if (i === "start") {
@@ -4319,7 +4312,7 @@ const yo = ({ uuid: e }) => {
4319
4312
  d(null);
4320
4313
  }, C = i !== null;
4321
4314
  return /* @__PURE__ */ a(
4322
- q,
4315
+ W,
4323
4316
  {
4324
4317
  label: n.label,
4325
4318
  detail: n.detail,
@@ -4344,8 +4337,8 @@ const yo = ({ uuid: e }) => {
4344
4337
  x.key === "Escape" && C && (x.preventDefault(), b());
4345
4338
  },
4346
4339
  children: [
4347
- f ? /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-text", children: ze(f) }) : /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-placeholder", children: n.placeholderStart ?? "Start time" }),
4348
- /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-icon", children: /* @__PURE__ */ a(mt, { size: 12 }) })
4340
+ f ? /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-text", children: We(f) }) : /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-placeholder", children: n.placeholderStart ?? "Start time" }),
4341
+ /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-icon", children: /* @__PURE__ */ a(ht, { size: 12 }) })
4349
4342
  ]
4350
4343
  }
4351
4344
  ) }),
@@ -4363,14 +4356,14 @@ const yo = ({ uuid: e }) => {
4363
4356
  x.key === "Escape" && C && (x.preventDefault(), b());
4364
4357
  },
4365
4358
  children: [
4366
- v ? /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-text", children: ze(v) }) : /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-placeholder", children: n.placeholderEnd ?? "End time" }),
4367
- /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-icon", children: /* @__PURE__ */ a(mt, { size: 12 }) })
4359
+ v ? /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-text", children: We(v) }) : /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-placeholder", children: n.placeholderEnd ?? "End time" }),
4360
+ /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-icon", children: /* @__PURE__ */ a(ht, { size: 12 }) })
4368
4361
  ]
4369
4362
  }
4370
4363
  ) })
4371
4364
  ] }),
4372
4365
  /* @__PURE__ */ w(
4373
- xe,
4366
+ ke,
4374
4367
  {
4375
4368
  open: C,
4376
4369
  triggerRef: i === "start" ? c : u,
@@ -4384,12 +4377,12 @@ const yo = ({ uuid: e }) => {
4384
4377
  type: "button",
4385
4378
  className: "fbre-picker-phase-header__confirm",
4386
4379
  onClick: b,
4387
- children: /* @__PURE__ */ a(ne, { size: 12 })
4380
+ children: /* @__PURE__ */ a(oe, { size: 12 })
4388
4381
  }
4389
4382
  )
4390
4383
  ] }),
4391
4384
  /* @__PURE__ */ a(
4392
- Ze,
4385
+ tt,
4393
4386
  {
4394
4387
  value: i === "start" ? f || void 0 : v || void 0,
4395
4388
  step: n.step,
@@ -4405,40 +4398,40 @@ const yo = ({ uuid: e }) => {
4405
4398
  }
4406
4399
  );
4407
4400
  };
4408
- F("timeRange", yo);
4409
- const _o = ({ uuid: e }) => {
4410
- var $, B;
4401
+ F("timeRange", _o);
4402
+ const wo = ({ uuid: e }) => {
4403
+ var V, P;
4411
4404
  const {
4412
4405
  value: t,
4413
4406
  properties: r,
4414
4407
  valid: s,
4415
4408
  validationErrors: o,
4416
4409
  updateValue: l
4417
- } = z(e), n = r, [i, d] = O(null), [c, u] = O("date"), p = M(null), m = M(null);
4410
+ } = z(e), n = r, [i, d] = M(null), [c, u] = M("date"), p = O(null), m = O(null);
4418
4411
  if (!n) return null;
4419
- const f = t != null && s === !1, v = t && typeof t == "object" && "start" in t ? t : null, y = (v == null ? void 0 : v.start) ?? "", b = (v == null ? void 0 : v.end) ?? "", C = (V) => {
4420
- const P = V.indexOf("T");
4421
- return P !== -1 ? { date: V.substring(0, P), time: V.substring(P + 1) } : { date: "", time: "12:00" };
4422
- }, x = y ? C(y) : { date: "", time: "12:00" }, N = b ? C(b) : { date: "", time: "12:00" }, E = i === "start" ? x : N, S = (V, P) => {
4423
- const j = V && P && P < V ? "" : P;
4424
- l(e, { start: V, end: j });
4425
- }, D = (V) => {
4426
- u((V === "start" ? x : N).date ? "time" : "date"), d(V);
4412
+ const f = t != null && s === !1, v = t && typeof t == "object" && "start" in t ? t : null, y = (v == null ? void 0 : v.start) ?? "", b = (v == null ? void 0 : v.end) ?? "", C = ($) => {
4413
+ const B = $.indexOf("T");
4414
+ return B !== -1 ? { date: $.substring(0, B), time: $.substring(B + 1) } : { date: "", time: "12:00" };
4415
+ }, x = y ? C(y) : { date: "", time: "12:00" }, N = b ? C(b) : { date: "", time: "12:00" }, S = i === "start" ? x : N, E = ($, B) => {
4416
+ const j = $ && B && B < $ ? "" : B;
4417
+ l(e, { start: $, end: j });
4418
+ }, D = ($) => {
4419
+ u(($ === "start" ? x : N).date ? "time" : "date"), d($);
4427
4420
  }, T = () => {
4428
4421
  d(null), u("date");
4429
- }, R = (V) => {
4430
- const P = E.time || "12:00", j = `${V}T${P}`;
4431
- i === "start" ? S(j, b) : S(y, j), u("time");
4432
- }, g = (V) => {
4433
- const P = E.date;
4434
- if (!P) return;
4435
- const j = `${P}T${V}`;
4436
- i === "start" ? S(j, b) : S(y, j);
4422
+ }, R = ($) => {
4423
+ const B = S.time || "12:00", j = `${$}T${B}`;
4424
+ i === "start" ? E(j, b) : E(y, j), u("time");
4425
+ }, g = ($) => {
4426
+ const B = S.date;
4427
+ if (!B) return;
4428
+ const j = `${B}T${$}`;
4429
+ i === "start" ? E(j, b) : E(y, j);
4437
4430
  }, h = () => {
4438
4431
  u("date");
4439
- }, _ = i !== null, k = ce(($ = n.min) == null ? void 0 : $.split("T")[0]), I = ce((B = n.max) == null ? void 0 : B.split("T")[0]);
4432
+ }, _ = i !== null, k = pe((V = n.min) == null ? void 0 : V.split("T")[0]), I = pe((P = n.max) == null ? void 0 : P.split("T")[0]);
4440
4433
  return /* @__PURE__ */ a(
4441
- q,
4434
+ W,
4442
4435
  {
4443
4436
  label: n.label,
4444
4437
  detail: n.detail,
@@ -4459,12 +4452,12 @@ const _o = ({ uuid: e }) => {
4459
4452
  "aria-haspopup": "dialog",
4460
4453
  "aria-expanded": i === "start",
4461
4454
  onClick: () => D("start"),
4462
- onKeyDown: (V) => {
4463
- V.key === "Escape" && _ && (V.preventDefault(), T());
4455
+ onKeyDown: ($) => {
4456
+ $.key === "Escape" && _ && ($.preventDefault(), T());
4464
4457
  },
4465
4458
  children: [
4466
- y ? /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-text", children: ht(y, n.dateFormat) }) : /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-placeholder", children: n.placeholderStart ?? "Start" }),
4467
- /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-icon", children: /* @__PURE__ */ a(_e, { size: 12 }) })
4459
+ y ? /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-text", children: bt(y, n.dateFormat) }) : /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-placeholder", children: n.placeholderStart ?? "Start" }),
4460
+ /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-icon", children: /* @__PURE__ */ a(Ce, { size: 12 }) })
4468
4461
  ]
4469
4462
  }
4470
4463
  ) }),
@@ -4478,31 +4471,31 @@ const _o = ({ uuid: e }) => {
4478
4471
  "aria-haspopup": "dialog",
4479
4472
  "aria-expanded": i === "end",
4480
4473
  onClick: () => D("end"),
4481
- onKeyDown: (V) => {
4482
- V.key === "Escape" && _ && (V.preventDefault(), T());
4474
+ onKeyDown: ($) => {
4475
+ $.key === "Escape" && _ && ($.preventDefault(), T());
4483
4476
  },
4484
4477
  children: [
4485
- b ? /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-text", children: ht(b, n.dateFormat) }) : /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-placeholder", children: n.placeholderEnd ?? "End" }),
4486
- /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-icon", children: /* @__PURE__ */ a(_e, { size: 12 }) })
4478
+ b ? /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-text", children: bt(b, n.dateFormat) }) : /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-placeholder", children: n.placeholderEnd ?? "End" }),
4479
+ /* @__PURE__ */ a("span", { className: "fbre-datetime__trigger-icon", children: /* @__PURE__ */ a(Ce, { size: 12 }) })
4487
4480
  ]
4488
4481
  }
4489
4482
  ) })
4490
4483
  ] }),
4491
4484
  /* @__PURE__ */ a(
4492
- xe,
4485
+ ke,
4493
4486
  {
4494
4487
  open: _,
4495
4488
  triggerRef: i === "start" ? p : m,
4496
4489
  onClose: T,
4497
4490
  children: c === "date" ? /* @__PURE__ */ a(
4498
- Qe,
4491
+ et,
4499
4492
  {
4500
- selectedDate: E.date,
4493
+ selectedDate: S.date,
4501
4494
  min: k,
4502
4495
  max: I,
4503
4496
  onSelect: R
4504
4497
  }
4505
- ) : /* @__PURE__ */ w(ie, { children: [
4498
+ ) : /* @__PURE__ */ w(ue, { children: [
4506
4499
  /* @__PURE__ */ w("div", { className: "fbre-picker-phase-header", children: [
4507
4500
  /* @__PURE__ */ a(
4508
4501
  "button",
@@ -4520,14 +4513,14 @@ const _o = ({ uuid: e }) => {
4520
4513
  type: "button",
4521
4514
  className: "fbre-picker-phase-header__confirm",
4522
4515
  onClick: T,
4523
- children: /* @__PURE__ */ a(ne, { size: 12 })
4516
+ children: /* @__PURE__ */ a(oe, { size: 12 })
4524
4517
  }
4525
4518
  )
4526
4519
  ] }),
4527
4520
  /* @__PURE__ */ a(
4528
- Ze,
4521
+ tt,
4529
4522
  {
4530
- value: E.time || void 0,
4523
+ value: S.time || void 0,
4531
4524
  step: n.step,
4532
4525
  min: n.minTime,
4533
4526
  max: n.maxTime,
@@ -4541,8 +4534,8 @@ const _o = ({ uuid: e }) => {
4541
4534
  }
4542
4535
  );
4543
4536
  };
4544
- F("dateTimeRange", _o);
4545
- const vn = ({ uuid: e }) => {
4537
+ F("dateTimeRange", wo);
4538
+ const gn = ({ uuid: e }) => {
4546
4539
  var u;
4547
4540
  const t = e.split(":")[0], r = parseInt(e.split(":")[1]), s = parseInt(e.split(":")[2]), o = U(
4548
4541
  (p) => {
@@ -4552,12 +4545,12 @@ const vn = ({ uuid: e }) => {
4552
4545
  ), l = U((p) => p.conditionResults[e]);
4553
4546
  if (!o) return null;
4554
4547
  const n = o.conditions && "when" in o.conditions ? o.conditions : void 0;
4555
- if (se(n, l)) return null;
4556
- const i = en(o.type);
4548
+ if (ie(n, l)) return null;
4549
+ const i = Qt(o.type);
4557
4550
  if (!i) return null;
4558
4551
  const d = (u = o.properties) == null ? void 0 : u.width, c = d && d !== "full" ? `fbre-component fbre-width-${d}` : "fbre-component";
4559
- return /* @__PURE__ */ a("div", { className: c, children: /* @__PURE__ */ a(pn.Provider, { value: o, children: /* @__PURE__ */ a(i, { uuid: e }) }) });
4560
- }, wo = ({ uuid: e }) => {
4552
+ return /* @__PURE__ */ a("div", { className: c, children: /* @__PURE__ */ a(fn.Provider, { value: o, children: /* @__PURE__ */ a(i, { uuid: e }) }) });
4553
+ }, Co = ({ uuid: e }) => {
4561
4554
  const t = U(
4562
4555
  (i) => {
4563
4556
  var d;
@@ -4568,7 +4561,7 @@ const vn = ({ uuid: e }) => {
4568
4561
  var d;
4569
4562
  return (d = i.components[e]) == null ? void 0 : d.addedComponents;
4570
4563
  }
4571
- ), [s, o] = O(!0);
4564
+ ), [s, o] = M(!0);
4572
4565
  if (!t) return null;
4573
4566
  const l = r ?? [], n = [
4574
4567
  "fbre-group",
@@ -4585,12 +4578,12 @@ const vn = ({ uuid: e }) => {
4585
4578
  className: `fbre-group__collapse-btn${s ? "" : " collapsed"}`,
4586
4579
  onClick: () => o(!s),
4587
4580
  "aria-label": "Toggle group",
4588
- children: /* @__PURE__ */ a(Ee, { size: 20 })
4581
+ children: /* @__PURE__ */ a(Le, { size: 20 })
4589
4582
  }
4590
4583
  )
4591
4584
  ] }),
4592
4585
  /* @__PURE__ */ a("div", { className: `fbre-group__body${s ? "" : " collapsed"}`, children: /* @__PURE__ */ a("div", { className: "fbre-group__content", children: i.map((c) => /* @__PURE__ */ a(
4593
- vn,
4586
+ gn,
4594
4587
  {
4595
4588
  uuid: c.uuid
4596
4589
  },
@@ -4598,8 +4591,8 @@ const vn = ({ uuid: e }) => {
4598
4591
  )) }) })
4599
4592
  ] }, `${e}-${d}`)) });
4600
4593
  };
4601
- F("group", wo);
4602
- const Co = ({ uuid: e }) => {
4594
+ F("group", Co);
4595
+ const xo = ({ uuid: e }) => {
4603
4596
  const t = U(
4604
4597
  (f) => {
4605
4598
  var v;
@@ -4612,7 +4605,7 @@ const Co = ({ uuid: e }) => {
4612
4605
  }
4613
4606
  ), s = U((f) => f.addRepeaterIteration), o = U(
4614
4607
  (f) => f.removeRepeaterIteration
4615
- ), [l, n] = O(
4608
+ ), [l, n] = M(
4616
4609
  /* @__PURE__ */ new Set([0])
4617
4610
  );
4618
4611
  if (!t) return null;
@@ -4655,7 +4648,7 @@ const Co = ({ uuid: e }) => {
4655
4648
  onClick: () => u(v),
4656
4649
  title: "Remove",
4657
4650
  "aria-label": "Remove iteration",
4658
- children: /* @__PURE__ */ a(Zn, { size: 14 })
4651
+ children: /* @__PURE__ */ a(tr, { size: 14 })
4659
4652
  }
4660
4653
  ),
4661
4654
  t.collapsible && /* @__PURE__ */ a(
@@ -4665,7 +4658,7 @@ const Co = ({ uuid: e }) => {
4665
4658
  className: `fbre-group__collapse-btn${y ? "" : " collapsed"}`,
4666
4659
  onClick: () => p(v),
4667
4660
  "aria-label": "Toggle repeater",
4668
- children: /* @__PURE__ */ a(Ee, { size: 20 })
4661
+ children: /* @__PURE__ */ a(Le, { size: 20 })
4669
4662
  }
4670
4663
  )
4671
4664
  ] }),
@@ -4674,7 +4667,7 @@ const Co = ({ uuid: e }) => {
4674
4667
  {
4675
4668
  className: `fbre-group__body${!y && t.collapsible ? " collapsed" : ""}`,
4676
4669
  children: /* @__PURE__ */ a("div", { className: "fbre-group__content", children: f.map((b) => /* @__PURE__ */ a(
4677
- vn,
4670
+ gn,
4678
4671
  {
4679
4672
  uuid: b.uuid
4680
4673
  },
@@ -4695,8 +4688,8 @@ const Co = ({ uuid: e }) => {
4695
4688
  )
4696
4689
  ] });
4697
4690
  };
4698
- F("repeater", Co);
4699
- const Yt = (e) => e && typeof e == "object" && ("title" in e || "body" in e) ? e : null, xo = {
4691
+ F("repeater", xo);
4692
+ const Kt = (e) => e && typeof e == "object" && ("title" in e || "body" in e) ? e : null, No = {
4700
4693
  clean: "dots",
4701
4694
  outlined: "dots",
4702
4695
  "refined-clean": "pill",
@@ -4707,18 +4700,18 @@ const Yt = (e) => e && typeof e == "object" && ("title" in e || "body" in e) ? e
4707
4700
  "stacked-cards": "dots",
4708
4701
  "soft-float": "glow",
4709
4702
  "bold-statement": "bar"
4710
- }, No = ({
4703
+ }, ko = ({
4711
4704
  screenIndex: e,
4712
4705
  onFlowComplete: t,
4713
4706
  onScreenChange: r
4714
4707
  }) => {
4715
- var kt, St, Dt, Et, Tt, It, Lt, Rt, Mt, Ot;
4716
- const s = U((A) => A.config), o = U((A) => A.screenOrder.length), l = U((A) => Object.keys(A.components).length > 0), n = Ge(), i = Math.max(
4708
+ var Nt, kt, St, Dt, Et, Tt, It, Lt, Rt, Mt;
4709
+ const s = U((A) => A.config), o = U((A) => A.screenOrder.length), l = U((A) => Object.keys(A.components).length > 0), n = Xe(), i = Math.max(
4717
4710
  0,
4718
4711
  Math.min(e, o - 1)
4719
- ), [d, c] = O(i), [u, p] = O(
4712
+ ), [d, c] = M(i), [u, p] = M(
4720
4713
  !!(s != null && s.summary && e >= o)
4721
- ), m = ((kt = s == null ? void 0 : s.navigation) == null ? void 0 : kt.transition) ?? "none", f = m !== "none", [v, y] = O(null), [b, C] = O(!1), [x, N] = O("forward"), [E, S] = O(!1), D = M(null), T = M(null), R = M(!1), g = H((A) => {
4714
+ ), m = ((Nt = s == null ? void 0 : s.navigation) == null ? void 0 : Nt.transition) ?? "none", f = m !== "none", [v, y] = M(null), [b, C] = M(!1), [x, N] = M("forward"), [S, E] = M(!1), D = O(null), T = O(null), R = O(!1), g = H((A) => {
4722
4715
  A && (A.inert = !0);
4723
4716
  }, []);
4724
4717
  K(() => {
@@ -4730,8 +4723,8 @@ const Yt = (e) => e && typeof e == "object" && ("title" in e || "body" in e) ? e
4730
4723
  R.current = !0;
4731
4724
  return;
4732
4725
  }
4733
- E || (A = T.current) == null || A.focus({ preventScroll: !0 });
4734
- }, [d, u, E]);
4726
+ S || (A = T.current) == null || A.focus({ preventScroll: !0 });
4727
+ }, [d, u, S]);
4735
4728
  const h = U((A) => A.screenOrder[d]), _ = U(
4736
4729
  (A) => {
4737
4730
  var Y;
@@ -4744,143 +4737,143 @@ const Yt = (e) => e && typeof e == "object" && ("title" in e || "body" in e) ? e
4744
4737
  var Y;
4745
4738
  return h ? (Y = A.screens[h]) == null ? void 0 : Y.nextButtonLabel : void 0;
4746
4739
  }
4747
- ), $ = U(
4740
+ ), V = U(
4748
4741
  (A) => {
4749
4742
  var Y;
4750
4743
  return h ? (Y = A.screens[h]) == null ? void 0 : Y.backButtonLabel : void 0;
4751
4744
  }
4752
- ), B = H(
4745
+ ), P = H(
4753
4746
  (A) => {
4754
4747
  r && r(A, n.getState().getFlowData());
4755
4748
  },
4756
4749
  [r, n]
4757
- ), V = H(
4750
+ ), $ = H(
4758
4751
  (A) => {
4759
- y(d), C(u), N(A), S(!0), D.current && (D.current.scrollTop = 0);
4752
+ y(d), C(u), N(A), E(!0), D.current && (D.current.scrollTop = 0);
4760
4753
  },
4761
4754
  [d, u]
4762
- ), P = H(() => {
4763
- S(!1), y(null);
4755
+ ), B = H(() => {
4756
+ E(!1), y(null);
4764
4757
  }, []), j = H(() => {
4765
- if (!E)
4758
+ if (!S)
4766
4759
  if (u)
4767
- f && V("back"), p(!1), B(d);
4760
+ f && $("back"), p(!1), P(d);
4768
4761
  else {
4769
- const A = n.getState(), Y = yr(A, d);
4770
- Y !== d && (f && V("back"), c(Y), B(Y));
4762
+ const A = n.getState(), Y = _r(A, d);
4763
+ Y !== d && (f && $("back"), c(Y), P(Y));
4771
4764
  }
4772
4765
  }, [
4773
- E,
4766
+ S,
4774
4767
  u,
4775
4768
  d,
4776
4769
  f,
4777
- V,
4778
- B,
4770
+ $,
4771
+ P,
4779
4772
  n
4780
- ]), J = H(() => {
4781
- if (E) return;
4782
- const A = n.getState(), Y = je(A, d);
4783
- Y !== null ? (f && V("forward"), c(Y), B(Y)) : s != null && s.summary && (f && V("forward"), p(!0), B(d + 1));
4773
+ ]), Z = H(() => {
4774
+ if (S) return;
4775
+ const A = n.getState(), Y = ze(A, d);
4776
+ Y !== null ? (f && $("forward"), c(Y), P(Y)) : s != null && s.summary && (f && $("forward"), p(!0), P(d + 1));
4784
4777
  }, [
4785
- E,
4778
+ S,
4786
4779
  d,
4787
4780
  s,
4788
4781
  f,
4789
- V,
4790
- B,
4782
+ $,
4783
+ P,
4791
4784
  n
4792
- ]), [Z, ue] = O(!1), [L, W] = O(null), [X, Q] = O(!1), [_t, wt] = O(null), yn = H(() => {
4793
- W(null);
4785
+ ]), [X, ne] = M(!1), [G, ce] = M(null), [L, q] = M(!1), [Q, re] = M(null), _n = H(() => {
4786
+ ce(null);
4794
4787
  const A = t(n.getState().getFlowData());
4795
- A && typeof A.then == "function" ? (ue(!0), A.then((Y) => {
4796
- ue(!1), wt(Yt(Y)), Q(!0);
4788
+ A && typeof A.then == "function" ? (ne(!0), A.then((Y) => {
4789
+ ne(!1), re(Kt(Y)), q(!0);
4797
4790
  }).catch((Y) => {
4798
- ue(!1), W(Y instanceof Error ? Y.message : String(Y));
4799
- })) : (wt(
4800
- Yt(A)
4801
- ), Q(!0));
4802
- }, [t, n]), _n = U((A) => je(A, d) === null), wn = ((St = s == null ? void 0 : s.theme) == null ? void 0 : St.colorScheme) ?? "light", et = ((s == null ? void 0 : s.mode) ?? "standard") === "conversational";
4803
- dn(
4804
- et && !u,
4791
+ ne(!1), ce(Y instanceof Error ? Y.message : String(Y));
4792
+ })) : (re(
4793
+ Kt(A)
4794
+ ), q(!0));
4795
+ }, [t, n]), wn = U((A) => ze(A, d) === null), Cn = ((kt = s == null ? void 0 : s.theme) == null ? void 0 : kt.colorScheme) ?? "light", nt = ((s == null ? void 0 : s.mode) ?? "standard") === "conversational";
4796
+ un(
4797
+ nt && !u,
4805
4798
  d,
4806
- J
4807
- ), un(
4808
- et && !u,
4799
+ Z
4800
+ ), pn(
4801
+ nt && !u,
4809
4802
  d,
4810
- J
4803
+ Z
4811
4804
  );
4812
- const Ct = ((Dt = s == null ? void 0 : s.theme) == null ? void 0 : Dt.style) ?? "clean", xt = ((Et = s == null ? void 0 : s.controls) == null ? void 0 : Et.stepperStyle) ?? "default", tt = xt === "default" ? xo[Ct] ?? "dots" : xt, Cn = ((Tt = s == null ? void 0 : s.controls) == null ? void 0 : Tt.showStepper) !== !1 && tt === "text", Nt = ln(s == null ? void 0 : s.theme), Te = s == null ? void 0 : s.confirmation, re = _t ?? Te ?? null, xn = _t ? !0 : (Te == null ? void 0 : Te.show) !== !1, Ie = X && !!re && xn && !!(re.title || re.body), Nn = () => b ? /* @__PURE__ */ a(At, {}) : v !== null ? /* @__PURE__ */ a(ft, { screenIndex: v }) : null, kn = E ? "fbre-screen-wrapper fbre-screen-wrapper--transitioning" : "fbre-screen-wrapper";
4805
+ const wt = ((St = s == null ? void 0 : s.theme) == null ? void 0 : St.style) ?? "clean", Ct = ((Dt = s == null ? void 0 : s.controls) == null ? void 0 : Dt.stepperStyle) ?? "default", rt = Ct === "default" ? No[wt] ?? "dots" : Ct, xn = ((Et = s == null ? void 0 : s.controls) == null ? void 0 : Et.showStepper) !== !1 && rt === "text", xt = cn(s == null ? void 0 : s.theme), Re = s == null ? void 0 : s.confirmation, se = Q ?? Re ?? null, Nn = Q ? !0 : (Re == null ? void 0 : Re.show) !== !1, Me = L && !!se && Nn && !!(se.title || se.body), kn = () => b ? /* @__PURE__ */ a(Vt, {}) : v !== null ? /* @__PURE__ */ a(mt, { screenIndex: v }) : null, Sn = S ? "fbre-screen-wrapper fbre-screen-wrapper--transitioning" : "fbre-screen-wrapper";
4813
4806
  return /* @__PURE__ */ w(
4814
4807
  "div",
4815
4808
  {
4816
4809
  className: "fbre-container",
4817
- "data-style": Ct,
4818
- "data-mode": wn,
4819
- "data-form-mode": et ? "conversational" : void 0,
4820
- "data-stepper": tt !== "text" ? tt : void 0,
4810
+ "data-style": wt,
4811
+ "data-mode": Cn,
4812
+ "data-form-mode": nt ? "conversational" : void 0,
4813
+ "data-stepper": rt !== "text" ? rt : void 0,
4821
4814
  "data-transition": f ? m : void 0,
4822
- style: Object.keys(Nt).length > 0 ? Nt : void 0,
4815
+ style: Object.keys(xt).length > 0 ? xt : void 0,
4823
4816
  children: [
4824
- Cn && !Ie && /* @__PURE__ */ a(hr, { current: d, total: o }),
4825
- /* @__PURE__ */ w("div", { className: kn, ref: D, children: [
4826
- E && /* @__PURE__ */ a(
4817
+ xn && !Me && /* @__PURE__ */ a(vr, { current: d, total: o }),
4818
+ /* @__PURE__ */ w("div", { className: Sn, ref: D, children: [
4819
+ S && /* @__PURE__ */ a(
4827
4820
  "div",
4828
4821
  {
4829
4822
  ref: g,
4830
4823
  className: "fbre-screen-slot fbre-screen--exiting",
4831
4824
  "data-direction": x,
4832
- onAnimationEnd: P,
4833
- children: Nn()
4825
+ onAnimationEnd: B,
4826
+ children: kn()
4834
4827
  }
4835
4828
  ),
4836
4829
  /* @__PURE__ */ a(
4837
4830
  "div",
4838
4831
  {
4839
4832
  ref: T,
4840
- className: E ? "fbre-screen-slot fbre-screen--entering" : "fbre-screen-slot",
4841
- "data-direction": E ? x : void 0,
4833
+ className: S ? "fbre-screen-slot fbre-screen--entering" : "fbre-screen-slot",
4834
+ "data-direction": S ? x : void 0,
4842
4835
  tabIndex: -1,
4843
4836
  role: "group",
4844
- "aria-label": Ie ? "Confirmation" : u ? "Summary" : _ ?? `Step ${d + 1} of ${o}`,
4845
- children: Ie ? /* @__PURE__ */ a(
4846
- gr,
4837
+ "aria-label": Me ? "Confirmation" : u ? "Summary" : _ ?? `Step ${d + 1} of ${o}`,
4838
+ children: Me ? /* @__PURE__ */ a(
4839
+ an,
4847
4840
  {
4848
- title: re == null ? void 0 : re.title,
4849
- body: re == null ? void 0 : re.body
4841
+ title: se == null ? void 0 : se.title,
4842
+ body: se == null ? void 0 : se.body
4850
4843
  }
4851
- ) : /* @__PURE__ */ w(ie, { children: [
4852
- !u && /* @__PURE__ */ a(ft, { screenIndex: d }),
4853
- u && /* @__PURE__ */ a(At, {})
4844
+ ) : /* @__PURE__ */ w(ue, { children: [
4845
+ !u && /* @__PURE__ */ a(mt, { screenIndex: d }),
4846
+ u && /* @__PURE__ */ a(Vt, {})
4854
4847
  ] })
4855
4848
  }
4856
4849
  )
4857
4850
  ] }),
4858
- L && /* @__PURE__ */ a("div", { className: "fbre-completion-error", children: L }),
4859
- ((It = s == null ? void 0 : s.controls) == null ? void 0 : It.show) !== !1 && l && !Ie && /* @__PURE__ */ a(
4860
- br,
4851
+ G && /* @__PURE__ */ a("div", { className: "fbre-completion-error", children: G }),
4852
+ ((Tt = s == null ? void 0 : s.controls) == null ? void 0 : Tt.show) !== !1 && l && !Me && /* @__PURE__ */ a(
4853
+ gr,
4861
4854
  {
4862
4855
  screenIndex: d,
4863
4856
  maxScreenIndex: o - 1,
4864
- allowInvalidTransition: (Lt = s == null ? void 0 : s.navigation) == null ? void 0 : Lt.allowInvalidTransition,
4857
+ allowInvalidTransition: (It = s == null ? void 0 : s.navigation) == null ? void 0 : It.allowInvalidTransition,
4865
4858
  screenValidity: k,
4866
4859
  summaryEnabled: (s == null ? void 0 : s.summary) ?? !1,
4867
4860
  summaryActive: u,
4868
- atMaxScreen: _n,
4861
+ atMaxScreen: wn,
4869
4862
  nextButtonLabel: I,
4870
- backButtonLabel: $,
4871
- completionLoading: Z,
4872
- showStepper: (Rt = s == null ? void 0 : s.controls) == null ? void 0 : Rt.showStepper,
4873
- stepperStyle: (Mt = s == null ? void 0 : s.controls) == null ? void 0 : Mt.stepperStyle,
4874
- controlsLayout: (Ot = s == null ? void 0 : s.controls) == null ? void 0 : Ot.layout,
4875
- nextScreen: J,
4863
+ backButtonLabel: V,
4864
+ completionLoading: X,
4865
+ showStepper: (Lt = s == null ? void 0 : s.controls) == null ? void 0 : Lt.showStepper,
4866
+ stepperStyle: (Rt = s == null ? void 0 : s.controls) == null ? void 0 : Rt.stepperStyle,
4867
+ controlsLayout: (Mt = s == null ? void 0 : s.controls) == null ? void 0 : Mt.layout,
4868
+ nextScreen: Z,
4876
4869
  prevScreen: j,
4877
- onFlowComplete: yn
4870
+ onFlowComplete: _n
4878
4871
  }
4879
4872
  )
4880
4873
  ]
4881
4874
  }
4882
4875
  );
4883
- }, ko = [], So = () => Wt((e, t) => ({
4876
+ }, So = [], Do = () => Yt((e, t) => ({
4884
4877
  // Identity (minimal — server drives the flow)
4885
4878
  flowUUID: "",
4886
4879
  metadata: {},
@@ -4940,7 +4933,7 @@ const Yt = (e) => e && typeof e == "object" && ("title" in e || "body" in e) ? e
4940
4933
  const u = r.split(":"), p = u[0], m = parseInt(u[1]), f = parseInt(u[2]), v = o.components[p];
4941
4934
  if (!((c = (d = v == null ? void 0 : v.addedComponents) == null ? void 0 : d[m]) != null && c[f])) return;
4942
4935
  v.addedComponents[m][f] = { ...v.addedComponents[m][f], value: s };
4943
- const y = o.groupComponentMap[r] ?? r, b = pt(e, t, y), C = ct(
4936
+ const y = o.groupComponentMap[r] ?? r, b = ft(e, t, y), C = dt(
4944
4937
  o,
4945
4938
  r,
4946
4939
  v.addedComponents[m][f]
@@ -4963,7 +4956,7 @@ const Yt = (e) => e && typeof e == "object" && ("title" in e || "body" in e) ? e
4963
4956
  return;
4964
4957
  }
4965
4958
  l.value = s;
4966
- const n = pt(e, t, r), i = ct(
4959
+ const n = ft(e, t, r), i = dt(
4967
4960
  o,
4968
4961
  r,
4969
4962
  l
@@ -4980,7 +4973,7 @@ const Yt = (e) => e && typeof e == "object" && ("title" in e || "body" in e) ? e
4980
4973
  return;
4981
4974
  o.addedComponents || (o.addedComponents = []);
4982
4975
  const l = o.components.map((n, i) => {
4983
- const d = ae(n);
4976
+ const d = le(n);
4984
4977
  d.uuid = [r, o.addedComponents.length, i].join(
4985
4978
  ":"
4986
4979
  ), s.groupComponentMap[d.uuid] = n.uuid;
@@ -4998,7 +4991,7 @@ const Yt = (e) => e && typeof e == "object" && ("title" in e || "body" in e) ? e
4998
4991
  return;
4999
4992
  o.addedComponents || (o.addedComponents = []);
5000
4993
  const l = o.components.map((n, i) => {
5001
- const d = ae(n);
4994
+ const d = le(n);
5002
4995
  d.uuid = [
5003
4996
  r,
5004
4997
  o.addedComponents.length,
@@ -5033,7 +5026,7 @@ const Yt = (e) => e && typeof e == "object" && ("title" in e || "body" in e) ? e
5033
5026
  const o = s.screenOrder[0];
5034
5027
  return o ? s.screenValidity[o] ?? !0 : !0;
5035
5028
  },
5036
- getValidationErrors: (r) => t().validationErrors[r] ?? ko,
5029
+ getValidationErrors: (r) => t().validationErrors[r] ?? So,
5037
5030
  evaluateFlowValidation: () => {
5038
5031
  const r = t(), s = r.screenOrder[0];
5039
5032
  if (!s) return !0;
@@ -5077,27 +5070,27 @@ const Yt = (e) => e && typeof e == "object" && ("title" in e || "body" in e) ? e
5077
5070
  screenValidity: d
5078
5071
  }), l;
5079
5072
  },
5080
- getMaxScreenCount: () => 0,
5073
+ getMaxScreenIndex: () => 0,
5081
5074
  getCalculationResult: (r) => t().calculationResults[r] ?? null
5082
- })), Ae = (e, t) => {
5075
+ })), Ue = (e, t) => {
5083
5076
  const r = {}, s = {}, o = {}, l = {}, n = {}, i = {}, d = t.screen.uuid;
5084
5077
  for (const b of t.screen.components) {
5085
- const C = ae(b);
5078
+ const C = le(b);
5086
5079
  if (r[C.uuid] = C, (C.type === "group" || C.type === "repeater") && b.components) {
5087
5080
  C.addedComponents || (C.addedComponents = []);
5088
- const N = b.components.map((E, S) => {
5089
- const D = ae(E);
5090
- D.uuid = [C.uuid, 0, S].join(":"), C.type === "group" && (s[D.uuid] = E.uuid), o[E.uuid] = D.uuid;
5091
- const T = oe(D);
5092
- return T && T.rules && T.rules.length > 0 && Ne(n, D.uuid, T), D;
5081
+ const N = b.components.map((S, E) => {
5082
+ const D = le(S);
5083
+ D.uuid = [C.uuid, 0, E].join(":"), C.type === "group" && (s[D.uuid] = S.uuid), o[S.uuid] = D.uuid;
5084
+ const T = ae(D);
5085
+ return T && T.rules && T.rules.length > 0 && Se(n, D.uuid, T), D;
5093
5086
  });
5094
5087
  C.addedComponents.push(N);
5095
5088
  }
5096
- const x = oe(C);
5097
- x && x.rules && x.rules.length > 0 && Ne(n, C.uuid, x);
5089
+ const x = ae(C);
5090
+ x && x.rules && x.rules.length > 0 && Se(n, C.uuid, x);
5098
5091
  }
5099
5092
  for (const { targetUUID: b, config: C } of t.conditions)
5100
- pe(l, b, C, b === d ? "screen" : "component");
5093
+ me(l, b, C, b === d ? "screen" : "component");
5101
5094
  if (t.previousData)
5102
5095
  for (const b of t.previousData) {
5103
5096
  const C = r[b.uuid];
@@ -5109,13 +5102,13 @@ const Yt = (e) => e && typeof e == "object" && ("title" in e || "body" in e) ? e
5109
5102
  if (C.type === "group" || C.type === "repeater") {
5110
5103
  if (C.addedComponents)
5111
5104
  for (const N of C.addedComponents)
5112
- for (const E of N) {
5113
- const S = ee(E, c);
5114
- E.valid = S.length === 0, S.length > 0 && (i[E.uuid] = S);
5105
+ for (const S of N) {
5106
+ const E = ee(S, c);
5107
+ S.valid = E.length === 0, E.length > 0 && (i[S.uuid] = E);
5115
5108
  }
5116
5109
  continue;
5117
5110
  }
5118
- if (!oe(C)) continue;
5111
+ if (!ae(C)) continue;
5119
5112
  const x = ee(C, c);
5120
5113
  C.valid = x.length === 0, x.length > 0 && (i[b] = x);
5121
5114
  }
@@ -5124,7 +5117,7 @@ const Yt = (e) => e && typeof e == "object" && ("title" in e || "body" in e) ? e
5124
5117
  }, m = /* @__PURE__ */ new Set();
5125
5118
  for (const b of Object.values(l))
5126
5119
  for (const C of b)
5127
- m.has(C.target) || (m.add(C.target), u[C.target] = qe(
5120
+ m.has(C.target) || (m.add(C.target), u[C.target] = Je(
5128
5121
  p,
5129
5122
  C.config
5130
5123
  ));
@@ -5185,7 +5178,7 @@ const Yt = (e) => e && typeof e == "object" && ("title" in e || "body" in e) ? e
5185
5178
  // Config
5186
5179
  config: t.config ?? {}
5187
5180
  });
5188
- }, it = (e) => {
5181
+ }, ct = (e) => {
5189
5182
  const t = e.getState(), r = t.screenOrder[0];
5190
5183
  if (!r) return [];
5191
5184
  const s = t.screens[r];
@@ -5193,14 +5186,14 @@ const Yt = (e) => e && typeof e == "object" && ("title" in e || "body" in e) ? e
5193
5186
  const o = [];
5194
5187
  for (const l of s.components) {
5195
5188
  const n = t.components[l.uuid];
5196
- if (!n || Ue(n.type)) continue;
5189
+ if (!n || He(n.type)) continue;
5197
5190
  const i = {
5198
5191
  uuid: n.uuid,
5199
5192
  type: n.type,
5200
5193
  value: n.value
5201
5194
  };
5202
5195
  "label" in n.properties && typeof n.properties.label == "string" && (i.label = n.properties.label), (n.type === "group" || n.type === "repeater") && n.addedComponents && (i.components = n.addedComponents.map(
5203
- (d) => d.filter((c) => !Ue(c.type)).map((c) => ({
5196
+ (d) => d.filter((c) => !He(c.type)).map((c) => ({
5204
5197
  uuid: c.uuid,
5205
5198
  type: c.type,
5206
5199
  value: c.value
@@ -5208,7 +5201,7 @@ const Yt = (e) => e && typeof e == "object" && ("title" in e || "body" in e) ? e
5208
5201
  )), o.push(i);
5209
5202
  }
5210
5203
  return o;
5211
- }, Do = 6e4, Eo = ({
5204
+ }, Eo = 6e4, To = ({
5212
5205
  sessionEndpoint: e,
5213
5206
  flowId: t,
5214
5207
  apiKey: r,
@@ -5218,39 +5211,39 @@ const Yt = (e) => e && typeof e == "object" && ("title" in e || "body" in e) ? e
5218
5211
  onFlowComplete: n,
5219
5212
  onScreenChange: i
5220
5213
  }) => {
5221
- const d = M(null);
5222
- d.current || (d.current = So());
5223
- const c = d.current, u = le(c, (L) => L.loading), p = le(c, (L) => L.error), m = le(c, (L) => L.navigation), f = le(c, (L) => L.config), v = le(c, (L) => {
5224
- var W;
5225
- return (W = L.config) == null ? void 0 : W.mode;
5226
- }), y = le(c, (L) => L.screenOrder), b = le(c, (L) => L.screens), [C, x] = O(""), N = M(null), E = M(Date.now()), S = De(
5214
+ const d = O(null);
5215
+ d.current || (d.current = Do());
5216
+ const c = d.current, u = de(c, (L) => L.loading), p = de(c, (L) => L.error), m = de(c, (L) => L.navigation), f = de(c, (L) => L.config), v = de(c, (L) => {
5217
+ var q;
5218
+ return (q = L.config) == null ? void 0 : q.mode;
5219
+ }), y = de(c, (L) => L.screenOrder), b = de(c, (L) => L.screens), [C, x] = M(!1), [N, S] = M(""), E = O(null), D = O(Date.now()), T = Te(
5227
5220
  () => ({ apiEndpoint: e, apiKey: r }),
5228
5221
  [e, r]
5229
- ), D = H((L) => {
5230
- x(L), N.current && clearTimeout(N.current), N.current = setTimeout(() => x(""), 8e3);
5231
- }, []), T = H(() => {
5232
- x(""), N.current && (clearTimeout(N.current), N.current = null);
5233
- }, []), R = H(async () => {
5222
+ ), R = H((L) => {
5223
+ S(L), E.current && clearTimeout(E.current), E.current = setTimeout(() => S(""), 8e3);
5224
+ }, []), g = H(() => {
5225
+ S(""), E.current && (clearTimeout(E.current), E.current = null);
5226
+ }, []), h = H(async () => {
5234
5227
  c.setState({ loading: !0, error: "" });
5235
5228
  try {
5236
- const L = await Jr(S, t, l);
5237
- Ae(c, L);
5229
+ const L = await Xr(T, t, l);
5230
+ Ue(c, L);
5238
5231
  } catch (L) {
5239
5232
  c.setState({ loading: !1, error: L.message });
5240
5233
  }
5241
5234
  }, [t, e, r, l]);
5242
5235
  K(() => {
5243
- R();
5244
- }, [R]), K(() => {
5236
+ h();
5237
+ }, [h]), K(() => {
5245
5238
  const L = async () => {
5246
5239
  if (document.visibilityState !== "visible") return;
5247
- const W = c.getState();
5248
- if (!(!W.sessionId || Date.now() - E.current < Do))
5240
+ const q = c.getState();
5241
+ if (!(!q.sessionId || Date.now() - D.current < Eo))
5249
5242
  try {
5250
- const Q = await eo(S, W.sessionId);
5251
- Ae(c, Q);
5252
- } catch (Q) {
5253
- Q instanceof He && Q.status === 404 && c.setState({
5243
+ const re = await to(T, q.sessionId);
5244
+ Ue(c, re);
5245
+ } catch (re) {
5246
+ re instanceof Ye && re.status === 404 && c.setState({
5254
5247
  loading: !1,
5255
5248
  error: "Session expired. Please start over.",
5256
5249
  screenOrder: [],
@@ -5260,92 +5253,115 @@ const Yt = (e) => e && typeof e == "object" && ("title" in e || "body" in e) ? e
5260
5253
  };
5261
5254
  return document.addEventListener("visibilitychange", L), () => document.removeEventListener("visibilitychange", L);
5262
5255
  }, [e, r]);
5263
- const g = H(async () => {
5256
+ const _ = H(async () => {
5264
5257
  const L = c.getState();
5265
5258
  if (!(L.loading || !L.evaluateFlowValidation())) {
5266
- c.setState({ loading: !0 }), c.getState().clearError(), T();
5259
+ c.setState({ loading: !0 }), c.getState().clearError(), g();
5267
5260
  try {
5268
- const X = it(c), Q = await Xr(S, L.sessionId, X);
5269
- Ae(c, Q), E.current = Date.now(), i == null || i(Q.navigation.screenNumber);
5270
- } catch (X) {
5271
- c.setState({ loading: !1 }), D(X.message);
5261
+ const Q = ct(c), re = await Qr(T, L.sessionId, Q);
5262
+ Ue(c, re), D.current = Date.now(), i == null || i(re.navigation.screenNumber);
5263
+ } catch (Q) {
5264
+ c.setState({ loading: !1 }), R(Q.message);
5272
5265
  }
5273
5266
  }
5274
- }, [S, c, i, D, T]), h = H(async () => {
5267
+ }, [T, c, i, R, g]), k = H(async () => {
5275
5268
  const L = c.getState();
5276
5269
  if (!L.loading) {
5277
- c.setState({ loading: !0 }), c.getState().clearError(), T();
5270
+ c.setState({ loading: !0 }), c.getState().clearError(), g();
5278
5271
  try {
5279
- const W = it(c), X = await Qr(S, L.sessionId, W);
5280
- Ae(c, X), E.current = Date.now(), i == null || i(X.navigation.screenNumber);
5281
- } catch (W) {
5282
- c.setState({ loading: !1 }), D(W.message);
5272
+ const q = ct(c), Q = await Zr(T, L.sessionId, q);
5273
+ Ue(c, Q), D.current = Date.now(), i == null || i(Q.navigation.screenNumber);
5274
+ } catch (q) {
5275
+ c.setState({ loading: !1 }), R(q.message);
5283
5276
  }
5284
5277
  }
5285
- }, [S, c, i, D, T]), _ = H(async () => {
5278
+ }, [T, c, i, R, g]), I = H(async () => {
5286
5279
  const L = c.getState();
5287
5280
  if (!(L.loading || !L.evaluateFlowValidation())) {
5288
- c.setState({ loading: !0 }), c.getState().clearError(), T();
5281
+ c.setState({ loading: !0 }), c.getState().clearError(), g();
5289
5282
  try {
5290
- const X = it(c), Q = await Zr(S, L.sessionId, X);
5291
- E.current = Date.now(), n(Q);
5292
- } catch (X) {
5293
- c.setState({ loading: !1 }), D(X.message);
5283
+ const Q = ct(c), re = await eo(T, L.sessionId, Q);
5284
+ D.current = Date.now(), c.setState({ loading: !1 }), x(!0), n(re);
5285
+ } catch (Q) {
5286
+ c.setState({ loading: !1 }), R(Q.message);
5294
5287
  }
5295
5288
  }
5296
- }, [S, c, n, D, T]), k = { ...f == null ? void 0 : f.theme, ...o }, $ = (s ?? v ?? "standard") === "conversational", B = $ && !m.isLastScreen;
5297
- dn(B, 0, g), un(B, 0, g);
5298
- const V = k.colorScheme ?? "light", P = ln(k), j = y[0], J = j ? b[j] : void 0, Z = J == null ? void 0 : J.nextButtonLabel, ue = J == null ? void 0 : J.backButtonLabel;
5299
- return u && y.length === 0 ? /* @__PURE__ */ a("div", { className: "fbre-container", children: /* @__PURE__ */ w("div", { className: "fbre-remote-loading", children: [
5300
- /* @__PURE__ */ a("div", { className: "fbre-spinner" }),
5301
- /* @__PURE__ */ a("p", { children: "Loading form..." })
5302
- ] }) }) : p && y.length === 0 ? /* @__PURE__ */ a("div", { className: "fbre-container", children: /* @__PURE__ */ w("div", { className: "fbre-remote-error", children: [
5303
- /* @__PURE__ */ a("p", { children: "Failed to load form" }),
5304
- /* @__PURE__ */ a("p", { className: "fbre-remote-error__detail", children: p }),
5305
- /* @__PURE__ */ a(
5306
- "button",
5289
+ }, [T, c, n, R, g]), V = { ...f == null ? void 0 : f.theme, ...o }, $ = (s ?? v ?? "standard") === "conversational", B = $ && !m.isLastScreen;
5290
+ un(B, 0, _), pn(B, 0, _);
5291
+ const j = V.colorScheme ?? "light", Z = cn(V), X = y[0], ne = X ? b[X] : void 0, G = ne == null ? void 0 : ne.nextButtonLabel, ce = ne == null ? void 0 : ne.backButtonLabel;
5292
+ if (u && y.length === 0)
5293
+ return /* @__PURE__ */ a("div", { className: "fbre-container", children: /* @__PURE__ */ w("div", { className: "fbre-remote-loading", children: [
5294
+ /* @__PURE__ */ a("div", { className: "fbre-spinner" }),
5295
+ /* @__PURE__ */ a("p", { children: "Loading form..." })
5296
+ ] }) });
5297
+ if (p && y.length === 0)
5298
+ return /* @__PURE__ */ a("div", { className: "fbre-container", children: /* @__PURE__ */ w("div", { className: "fbre-remote-error", children: [
5299
+ /* @__PURE__ */ a("p", { children: "Failed to load form" }),
5300
+ /* @__PURE__ */ a("p", { className: "fbre-remote-error__detail", children: p }),
5301
+ /* @__PURE__ */ a(
5302
+ "button",
5303
+ {
5304
+ type: "button",
5305
+ className: "fbre-btn fbre-btn--next",
5306
+ onClick: h,
5307
+ style: { marginTop: 12 },
5308
+ children: "Retry"
5309
+ }
5310
+ )
5311
+ ] }) });
5312
+ if (C) {
5313
+ const L = f == null ? void 0 : f.confirmation, q = (L == null ? void 0 : L.show) !== !1 && (L != null && L.title) ? L.title : "Thank you", Q = (L == null ? void 0 : L.show) !== !1 ? L == null ? void 0 : L.body : void 0;
5314
+ return /* @__PURE__ */ a(
5315
+ Ie.Provider,
5307
5316
  {
5308
- type: "button",
5309
- className: "fbre-btn fbre-btn--next",
5310
- onClick: R,
5311
- style: { marginTop: 12 },
5312
- children: "Retry"
5317
+ value: c,
5318
+ children: /* @__PURE__ */ a(
5319
+ "div",
5320
+ {
5321
+ className: "fbre-container",
5322
+ "data-style": V.style ?? "clean",
5323
+ "data-mode": j,
5324
+ style: Object.keys(Z).length > 0 ? Z : void 0,
5325
+ children: /* @__PURE__ */ a("div", { className: "fbre-screen-wrapper", children: /* @__PURE__ */ a(an, { title: q, body: Q }) })
5326
+ }
5327
+ )
5313
5328
  }
5314
- )
5315
- ] }) }) : y.length === 0 ? null : /* @__PURE__ */ a(
5316
- We.Provider,
5329
+ );
5330
+ }
5331
+ return y.length === 0 ? null : /* @__PURE__ */ a(
5332
+ Ie.Provider,
5317
5333
  {
5318
5334
  value: c,
5319
5335
  children: /* @__PURE__ */ w(
5320
5336
  "div",
5321
5337
  {
5322
5338
  className: "fbre-container",
5323
- "data-style": k.style ?? "clean",
5324
- "data-mode": V,
5339
+ "data-style": V.style ?? "clean",
5340
+ "data-mode": j,
5325
5341
  "data-form-mode": $ ? "conversational" : void 0,
5326
- style: Object.keys(P).length > 0 ? P : void 0,
5342
+ style: Object.keys(Z).length > 0 ? Z : void 0,
5327
5343
  children: [
5328
- /* @__PURE__ */ a("div", { className: "fbre-screen-wrapper", children: /* @__PURE__ */ a(ft, { screenIndex: 0 }) }),
5344
+ /* @__PURE__ */ a("div", { className: "fbre-screen-wrapper", children: /* @__PURE__ */ a(mt, { screenIndex: 0 }) }),
5329
5345
  /* @__PURE__ */ a(
5330
- To,
5346
+ Io,
5331
5347
  {
5332
5348
  navigation: m,
5333
5349
  loading: u,
5334
- onPrev: h,
5335
- onNext: g,
5336
- onComplete: _,
5337
- nextButtonLabel: Z,
5338
- backButtonLabel: ue
5350
+ onPrev: k,
5351
+ onNext: _,
5352
+ onComplete: I,
5353
+ nextButtonLabel: G,
5354
+ backButtonLabel: ce
5339
5355
  }
5340
5356
  ),
5341
- /* @__PURE__ */ w("div", { className: `fbre-toast${C ? " visible" : ""}`, children: [
5342
- /* @__PURE__ */ a("span", { children: C }),
5357
+ /* @__PURE__ */ w("div", { className: `fbre-toast${N ? " visible" : ""}`, children: [
5358
+ /* @__PURE__ */ a("span", { children: N }),
5343
5359
  /* @__PURE__ */ a(
5344
5360
  "button",
5345
5361
  {
5346
5362
  type: "button",
5347
5363
  className: "fbre-toast__close",
5348
- onClick: T,
5364
+ onClick: g,
5349
5365
  "aria-label": "Dismiss",
5350
5366
  children: "×"
5351
5367
  }
@@ -5356,7 +5372,7 @@ const Yt = (e) => e && typeof e == "object" && ("title" in e || "body" in e) ? e
5356
5372
  )
5357
5373
  }
5358
5374
  );
5359
- }, To = ({
5375
+ }, Io = ({
5360
5376
  navigation: e,
5361
5377
  loading: t,
5362
5378
  onPrev: r,
@@ -5400,7 +5416,7 @@ const Yt = (e) => e && typeof e == "object" && ("title" in e || "body" in e) ? e
5400
5416
  }
5401
5417
  ) })
5402
5418
  ] });
5403
- function Io(e, t, r, s, o) {
5419
+ function Lo(e, t, r, s, o) {
5404
5420
  return !t && !r && !s && !o ? e : {
5405
5421
  ...e,
5406
5422
  ...o && { mode: o },
@@ -5409,7 +5425,7 @@ function Io(e, t, r, s, o) {
5409
5425
  ...s && { controls: { ...e.controls, ...s } }
5410
5426
  };
5411
5427
  }
5412
- const gn = ({
5428
+ const yn = ({
5413
5429
  flow: e,
5414
5430
  data: t,
5415
5431
  mode: r,
@@ -5421,33 +5437,31 @@ const gn = ({
5421
5437
  storeRef: d,
5422
5438
  onFlowComplete: c,
5423
5439
  onScreenChange: u,
5424
- onScreenValidationChange: p,
5425
- apiCtx: m
5440
+ apiCtx: p
5426
5441
  }) => {
5427
- const f = M(null);
5428
- f.current || (f.current = jn(), f.current.getState().loadFlow(e, t, i)), d && (d.current = f.current), K(() => {
5429
- f.current && f.current.getState().loadFlow(e, t, i);
5442
+ const m = O(null);
5443
+ m.current || (m.current = Kn(), m.current.getState().loadFlow(e, t, i)), d && (d.current = m.current), K(() => {
5444
+ m.current && m.current.getState().loadFlow(e, t, i);
5430
5445
  }, [e.uuid]), K(() => {
5431
- if (f.current) {
5432
- const b = f.current.getState(), C = Io(b.config, s, o, l, r);
5433
- C !== b.config && f.current.setState({ config: C });
5446
+ if (m.current) {
5447
+ const y = m.current.getState(), b = Lo(y.config, s, o, l, r);
5448
+ b !== y.config && m.current.setState({ config: b });
5434
5449
  }
5435
5450
  }, [r, s, o, l]);
5436
- const v = i ? JSON.stringify(i) : "";
5451
+ const f = i ? JSON.stringify(i) : "";
5437
5452
  K(() => {
5438
- f.current && i && f.current.getState().updateContext(i);
5439
- }, [v]);
5440
- const y = /* @__PURE__ */ a(We.Provider, { value: f.current, children: /* @__PURE__ */ a(
5441
- No,
5453
+ m.current && i && m.current.getState().updateContext(i);
5454
+ }, [f]);
5455
+ const v = /* @__PURE__ */ a(Ie.Provider, { value: m.current, children: /* @__PURE__ */ a(
5456
+ ko,
5442
5457
  {
5443
5458
  screenIndex: n ?? 0,
5444
5459
  onFlowComplete: c,
5445
- onScreenChange: u,
5446
- onScreenValidationChange: p
5460
+ onScreenChange: u
5447
5461
  }
5448
5462
  ) });
5449
- return m ? /* @__PURE__ */ a(bn.Provider, { value: m, children: y }) : y;
5450
- }, Lo = ({
5463
+ return p ? /* @__PURE__ */ a(vn.Provider, { value: p, children: v }) : v;
5464
+ }, Ro = ({
5451
5465
  flowId: e,
5452
5466
  apiEndpoint: t,
5453
5467
  apiKey: r,
@@ -5460,31 +5474,30 @@ const gn = ({
5460
5474
  context: c,
5461
5475
  storeRef: u,
5462
5476
  onFlowComplete: p,
5463
- onScreenChange: m,
5464
- onScreenValidationChange: f
5477
+ onScreenChange: m
5465
5478
  }) => {
5466
- const [v, y] = O(null), [b, C] = O(""), [x, N] = O(null);
5479
+ const [f, v] = M(null), [y, b] = M(""), [C, x] = M(null);
5467
5480
  return K(() => {
5468
- y(null), C("");
5469
- const E = { apiEndpoint: t, apiKey: r };
5470
- qr(E, e).then((S) => {
5471
- y(S.data), N({
5472
- config: E,
5481
+ v(null), b("");
5482
+ const N = { apiEndpoint: t, apiKey: r };
5483
+ Wr(N, e).then((S) => {
5484
+ v(S.data), x({
5485
+ config: N,
5473
5486
  flowId: S.id,
5474
5487
  flowVersionId: S.versionId,
5475
5488
  tenantId: S.tenantId
5476
5489
  });
5477
- }).catch((S) => C(S.message));
5478
- }, [e, t, r]), b ? /* @__PURE__ */ a("div", { className: "fbre-container", children: /* @__PURE__ */ w("div", { className: "fbre-remote-error", children: [
5490
+ }).catch((S) => b(S.message));
5491
+ }, [e, t, r]), y ? /* @__PURE__ */ a("div", { className: "fbre-container", children: /* @__PURE__ */ w("div", { className: "fbre-remote-error", children: [
5479
5492
  /* @__PURE__ */ a("p", { children: "Failed to load form" }),
5480
- /* @__PURE__ */ a("p", { className: "fbre-remote-error__detail", children: b })
5481
- ] }) }) : !v || !x ? /* @__PURE__ */ a("div", { className: "fbre-container", children: /* @__PURE__ */ w("div", { className: "fbre-remote-loading", children: [
5493
+ /* @__PURE__ */ a("p", { className: "fbre-remote-error__detail", children: y })
5494
+ ] }) }) : !f || !C ? /* @__PURE__ */ a("div", { className: "fbre-container", children: /* @__PURE__ */ w("div", { className: "fbre-remote-loading", children: [
5482
5495
  /* @__PURE__ */ a("div", { className: "fbre-spinner" }),
5483
5496
  /* @__PURE__ */ a("p", { children: "Loading form..." })
5484
5497
  ] }) }) : /* @__PURE__ */ a(
5485
- gn,
5498
+ yn,
5486
5499
  {
5487
- flow: v,
5500
+ flow: f,
5488
5501
  data: s,
5489
5502
  mode: o,
5490
5503
  theme: l,
@@ -5495,18 +5508,17 @@ const gn = ({
5495
5508
  storeRef: u,
5496
5509
  onFlowComplete: p,
5497
5510
  onScreenChange: m,
5498
- onScreenValidationChange: f,
5499
- apiCtx: x
5511
+ apiCtx: C
5500
5512
  }
5501
5513
  );
5502
- }, Fo = (e) => "sessionEndpoint" in e ? /* @__PURE__ */ a(Eo, { ...e }) : "flowId" in e && e.flowId ? /* @__PURE__ */ a(Lo, { ...e }) : /* @__PURE__ */ a(gn, { ...e });
5514
+ }, jo = (e) => "sessionEndpoint" in e ? /* @__PURE__ */ a(To, { ...e }) : "flowId" in e && e.flowId ? /* @__PURE__ */ a(Ro, { ...e }) : /* @__PURE__ */ a(yn, { ...e });
5503
5515
  export {
5504
- He as ApiError,
5505
- Fo as FBRE,
5506
- Hr as TimeoutError,
5507
- Po as addFBREEventListener,
5508
- Uo as removeFBREEventListener,
5509
- jr as useFBREApi,
5516
+ Ye as ApiError,
5517
+ jo as FBRE,
5518
+ Kr as TimeoutError,
5519
+ Uo as addFBREEventListener,
5520
+ Fo as removeFBREEventListener,
5521
+ Hr as useFBREApi,
5510
5522
  U as useFBREStore,
5511
- Ge as useFBREStoreApi
5523
+ Xe as useFBREStoreApi
5512
5524
  };