@hievilmath/browser-formidavim 1.4.9 → 1.4.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/README.md +6 -0
  2. package/index.js +28 -28
  3. package/index.mjs +95 -93
  4. package/package.json +1 -1
package/index.mjs CHANGED
@@ -2,7 +2,7 @@ var D6 = Object.defineProperty;
2
2
  var M6 = (e, o, i) => o in e ? D6(e, o, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[o] = i;
3
3
  var v0 = (e, o, i) => M6(e, typeof o != "symbol" ? o + "" : o, i);
4
4
  import * as Se from "react";
5
- import Qs, { useState as an, useEffect as _n, useRef as mf, useCallback as io, forwardRef as L6, useContext as _6, useMemo as I6 } from "react";
5
+ import Qs, { useState as an, useEffect as Mn, useRef as mf, useCallback as io, forwardRef as L6, useContext as _6, useMemo as I6 } from "react";
6
6
  import { Link as XC } from "react-router-dom";
7
7
  import Ie, { css as Bt, ThemeProvider as F6 } from "styled-components";
8
8
  import { useDispatch as V6, useSelector as y0, Provider as j6 } from "react-redux";
@@ -413,7 +413,7 @@ function B6() {
413
413
  });
414
414
  }
415
415
  }
416
- function Mn(ne, Ge) {
416
+ function Ln(ne, Ge) {
417
417
  {
418
418
  var rt = function() {
419
419
  at || (at = !0, W("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", Ge));
@@ -466,7 +466,7 @@ function B6() {
466
466
  }
467
467
  if (en || Tr) {
468
468
  var lr = typeof ne == "function" ? ne.displayName || ne.name || "Unknown" : ne;
469
- en && On(Jt, lr), Tr && Mn(Jt, lr);
469
+ en && On(Jt, lr), Tr && Ln(Jt, lr);
470
470
  }
471
471
  return $n(ne, en, Tr, $t, Mt, Rn.current, Jt);
472
472
  }
@@ -4659,7 +4659,7 @@ const x5 = {
4659
4659
  const { getFlowValue: o, setFlowAndPatientValue: i, getFlowError: s } = Gr(), [c, p] = an({}), d = e.props, v = (d == null ? void 0 : d.options) || [], b = [], S = o(d.propertyId), T = s(d.propertyId), w = !!T && T !== "Required";
4660
4660
  d.propertyId || b.push("Error");
4661
4661
  const R = (d == null ? void 0 : d.required) === "true";
4662
- _n(() => {
4662
+ Mn(() => {
4663
4663
  }, [S]);
4664
4664
  const k = (G) => {
4665
4665
  const { value: W } = G.target;
@@ -4994,12 +4994,12 @@ const z5 = Ie.div`
4994
4994
  return (s < 0 || s === 0 && o.getDate() < e.getDate()) && i--, i;
4995
4995
  }, Q5 = ({ formComponent: e }) => {
4996
4996
  const o = e.props, { propertyId: i, label: s = "Label", minDate: c, maxDate: p, minAge: d } = o || {}, { getFlowValue: v, setFlowAndPatientValue: b, getFlowError: S, setFlowError: T } = Gr(), w = v(o.propertyId), R = S(o.propertyId), k = !!R && R !== "Required";
4997
- _n(() => {
4997
+ Mn(() => {
4998
4998
  if (d && w) {
4999
4999
  const G = new Date(w);
5000
5000
  S0(G) && (oC(G) < d ? T(i, `Must be over ${d}`) : T(i, ""));
5001
5001
  }
5002
- }, [d, w, i, T]), _n(() => {
5002
+ }, [d, w, i, T]), Mn(() => {
5003
5003
  if (d && w) {
5004
5004
  const G = new Date(w);
5005
5005
  S0(G) && (oC(G) < d ? T(i, `Must be over ${d}`) : T(i, ""));
@@ -5144,7 +5144,7 @@ const z5 = Ie.div`
5144
5144
  );
5145
5145
  }, J5 = ({ formComponent: e }) => {
5146
5146
  const o = e.props, { propertyId: i, label: s = "Input Label", required: c, lastPrescribedDose: p, concentration: d } = o || {}, { getFlowValue: v, setFlowAndPatientValue: b, getFlowError: S, setFlowError: T } = Gr(), w = mf(null), R = mf(!1), M = ((N) => N ? typeof N == "number" ? N : parseFloat(String(N).replace(" mg", "")) || 0 : 0)(v(i)), P = parseFloat((d == null ? void 0 : d.split(" ")[0]) || "0"), U = 100;
5147
- _n(() => {
5147
+ Mn(() => {
5148
5148
  !R.current && p && (!M && p && b(i, p + " mg"), R.current = !0);
5149
5149
  }, [p]);
5150
5150
  const G = (N) => P === 0 ? 0 : Math.round(N / P * 100), W = (N) => P === 0 ? 0 : N / 100 * P, A = G(M), F = (N) => {
@@ -10247,11 +10247,11 @@ const pv = (e) => {
10247
10247
  W(!1), N.current = !1;
10248
10248
  }
10249
10249
  }, [z, R]);
10250
- _n(() => {
10250
+ Mn(() => {
10251
10251
  U(M);
10252
- }, [M]), _n(() => {
10252
+ }, [M]), Mn(() => {
10253
10253
  s && (!M || M === "") ? (w(p, "Required"), R(!0)) : M && !pp(M).valid ? (w(p, "Please enter a valid email address"), R(!0)) : M && pp(M).valid && (w(p, null), G && R(!0));
10254
- }, [M, s, p, w, R, G]), _n(() => {
10254
+ }, [M, s, p, w, R, G]), Mn(() => {
10255
10255
  const ie = setTimeout(() => {
10256
10256
  M && pp(M).valid ? X(M) : (F(null), R(!1));
10257
10257
  }, 500);
@@ -10310,11 +10310,11 @@ const pv = (e) => {
10310
10310
  const B = /[a-z]/.test(Ee), Y = /[A-Z]/.test(Ee), Oe = /\d/.test(Ee), He = /[^A-Za-z0-9]/.test(Ee);
10311
10311
  return B && Y && Oe && He;
10312
10312
  }, de = (Ee, B) => Ee === B;
10313
- _n(() => {
10313
+ Mn(() => {
10314
10314
  V(P);
10315
- }, [P]), _n(() => {
10315
+ }, [P]), Mn(() => {
10316
10316
  b && Ce(U);
10317
- }, [U, b]), _n(() => {
10317
+ }, [U, b]), Mn(() => {
10318
10318
  const Ee = ie(we), B = b ? de(we, ye) : !0;
10319
10319
  i && (!we || we === "") ? (R(c, "Required"), k(!0)) : we && !Ee ? (R(c, `Password must be at least ${v} characters with lowercase, uppercase, number, and special character`), k(!0)) : b && we && ye && !B ? (R(b, "Passwords do not match"), k(!0)) : we && Ee && (!b || B) && (R(c, null), b && R(b, null), k(!1));
10320
10320
  }, [we, ye, i, c, b, R, k, v]);
@@ -10502,11 +10502,11 @@ const pv = (e) => {
10502
10502
  const Pe = pe === "", Re = ue(pe);
10503
10503
  !Pe && !Re ? (T(p, "Please enter a valid phone number"), R(p, null)) : Re ? (T(p, null), b(p, pe)) : (T(p, null), R(p, null));
10504
10504
  };
10505
- _n(() => {
10505
+ Mn(() => {
10506
10506
  P(k);
10507
- }, [k]), _n(() => {
10507
+ }, [k]), Mn(() => {
10508
10508
  s && (!k || k === "") ? (T(p, "Required"), w(!0)) : k && k.length > 0 && !ue(k) ? (T(p, "Please enter a valid phone number"), w(!0)) : k && ue(k) && (T(p, null), U && w(!0));
10509
- }, [k, s, p, T, w, U]), _n(() => {
10509
+ }, [k, s, p, T, w, U]), Mn(() => {
10510
10510
  const de = setTimeout(() => {
10511
10511
  k && ue(k) ? z(k) : (A(null), w(!1));
10512
10512
  }, 500);
@@ -15971,15 +15971,15 @@ function V4() {
15971
15971
  }
15972
15972
  function d(at, nt, Be) {
15973
15973
  for (var fn = Be; fn > 0; ) {
15974
- var On = fn - 1 >>> 1, Mn = at[On];
15975
- if (b(Mn, nt) > 0)
15976
- at[On] = nt, at[fn] = Mn, fn = On;
15974
+ var On = fn - 1 >>> 1, Ln = at[On];
15975
+ if (b(Ln, nt) > 0)
15976
+ at[On] = nt, at[fn] = Ln, fn = On;
15977
15977
  else
15978
15978
  return;
15979
15979
  }
15980
15980
  }
15981
15981
  function v(at, nt, Be) {
15982
- for (var fn = Be, On = at.length, Mn = On >>> 1; fn < Mn; ) {
15982
+ for (var fn = Be, On = at.length, Ln = On >>> 1; fn < Ln; ) {
15983
15983
  var $n = (fn + 1) * 2 - 1, In = at[$n], Ye = $n + 1, j = at[Ye];
15984
15984
  if (b(In, nt) < 0)
15985
15985
  Ye < On && b(j, In) < 0 ? (at[fn] = j, at[Ye] = nt, fn = Ye) : (at[fn] = In, at[$n] = nt, fn = $n);
@@ -16046,8 +16046,8 @@ function V4() {
16046
16046
  var fn = Ce.callback;
16047
16047
  if (typeof fn == "function") {
16048
16048
  Ce.callback = null, ie = Ce.priorityLevel;
16049
- var On = Ce.expirationTime <= Be, Mn = fn(On);
16050
- Be = e.unstable_now(), typeof Mn == "function" ? Ce.callback = Mn : Ce === c(we) && p(we), oe(Be);
16049
+ var On = Ce.expirationTime <= Be, Ln = fn(On);
16050
+ Be = e.unstable_now(), typeof Ln == "function" ? Ce.callback = Ln : Ce === c(we) && p(we), oe(Be);
16051
16051
  } else
16052
16052
  p(we);
16053
16053
  Ce = c(we);
@@ -16111,8 +16111,8 @@ function V4() {
16111
16111
  function We(at, nt, Be) {
16112
16112
  var fn = e.unstable_now(), On;
16113
16113
  if (typeof Be == "object" && Be !== null) {
16114
- var Mn = Be.delay;
16115
- typeof Mn == "number" && Mn > 0 ? On = fn + Mn : On = fn;
16114
+ var Ln = Be.delay;
16115
+ typeof Ln == "number" && Ln > 0 ? On = fn + Ln : On = fn;
16116
16116
  } else
16117
16117
  On = fn;
16118
16118
  var $n;
@@ -16727,10 +16727,10 @@ function j4() {
16727
16727
  f === "float" && (f = "cssFloat"), m ? r.setProperty(f, x) : r[f] = x;
16728
16728
  }
16729
16729
  }
16730
- var Mn = oe({ menuitem: !0 }, { area: !0, base: !0, br: !0, col: !0, embed: !0, hr: !0, img: !0, input: !0, keygen: !0, link: !0, meta: !0, param: !0, source: !0, track: !0, wbr: !0 });
16730
+ var Ln = oe({ menuitem: !0 }, { area: !0, base: !0, br: !0, col: !0, embed: !0, hr: !0, img: !0, input: !0, keygen: !0, link: !0, meta: !0, param: !0, source: !0, track: !0, wbr: !0 });
16731
16731
  function $n(r, a) {
16732
16732
  if (a) {
16733
- if (Mn[r] && (a.children != null || a.dangerouslySetInnerHTML != null)) throw Error(i(137, r));
16733
+ if (Ln[r] && (a.children != null || a.dangerouslySetInnerHTML != null)) throw Error(i(137, r));
16734
16734
  if (a.dangerouslySetInnerHTML != null) {
16735
16735
  if (a.children != null) throw Error(i(60));
16736
16736
  if (typeof a.dangerouslySetInnerHTML != "object" || !("__html" in a.dangerouslySetInnerHTML)) throw Error(i(61));
@@ -16951,7 +16951,7 @@ function j4() {
16951
16951
  function fo(r) {
16952
16952
  return r >>>= 0, r === 0 ? 32 : 31 - ($o(r) / ji | 0) | 0;
16953
16953
  }
16954
- var eo = 64, Ln = 4194304;
16954
+ var eo = 64, _n = 4194304;
16955
16955
  function Or(r) {
16956
16956
  switch (r & -r) {
16957
16957
  case 1:
@@ -20874,7 +20874,7 @@ Error generating stack: ` + E.message + `
20874
20874
  m !== null && m.delete(a), a = Ur(), r.pingedLanes |= r.suspendedLanes & f, Qr === r && (go & f) === f && (Pr === 4 || Pr === 3 && (go & 130023424) === go && 500 > Xt() - Dh ? tl(r, 0) : Rd |= f), ca(r, a);
20875
20875
  }
20876
20876
  function ky(r, a) {
20877
- a === 0 && ((r.mode & 1) === 0 ? a = 1 : (a = Ln, Ln <<= 1, (Ln & 130023424) === 0 && (Ln = 4194304)));
20877
+ a === 0 && ((r.mode & 1) === 0 ? a = 1 : (a = _n, _n <<= 1, (_n & 130023424) === 0 && (_n = 4194304)));
20878
20878
  var f = Ur();
20879
20879
  r = Ca(r, a), r !== null && (Zo(r, a, f), ca(r, f));
20880
20880
  }
@@ -21488,7 +21488,7 @@ function U4() {
21488
21488
  function On(t) {
21489
21489
  return ee.call(fn, t) ? !0 : ee.call(Be, t) ? !1 : nt.test(t) ? (fn[t] = !0, !0) : (Be[t] = !0, d("Invalid attribute name: `%s`", t), !1);
21490
21490
  }
21491
- function Mn(t, n, l) {
21491
+ function Ln(t, n, l) {
21492
21492
  return n !== null ? n.type === it : l ? !1 : t.length > 2 && (t[0] === "o" || t[0] === "O") && (t[1] === "n" || t[1] === "N");
21493
21493
  }
21494
21494
  function $n(t, n, l, u) {
@@ -21943,7 +21943,7 @@ function U4() {
21943
21943
  }
21944
21944
  function Ot(t, n, l, u) {
21945
21945
  var h = Ye(n);
21946
- if (!Mn(n, h, u)) {
21946
+ if (!Ln(n, h, u)) {
21947
21947
  if (In(n, l, h, u) && (l = null), u || h === null) {
21948
21948
  if (On(n)) {
21949
21949
  var g = n;
@@ -22040,7 +22040,7 @@ function U4() {
22040
22040
  }
22041
22041
  }
22042
22042
  var fo = i.ReactCurrentDispatcher, eo;
22043
- function Ln(t, n, l) {
22043
+ function _n(t, n, l) {
22044
22044
  {
22045
22045
  if (eo === void 0)
22046
22046
  try {
@@ -22126,7 +22126,7 @@ function U4() {
22126
22126
  } finally {
22127
22127
  Or = !1, fo.current = g, ji(), Error.prepareStackTrace = h;
22128
22128
  }
22129
- var he = t ? t.displayName || t.name : "", De = he ? Ln(he) : "";
22129
+ var he = t ? t.displayName || t.name : "", De = he ? _n(he) : "";
22130
22130
  return typeof t == "function" && mi.set(t, De), De;
22131
22131
  }
22132
22132
  function Ui(t, n, l) {
@@ -22145,12 +22145,12 @@ function U4() {
22145
22145
  if (typeof t == "function")
22146
22146
  return vl(t, yl(t));
22147
22147
  if (typeof t == "string")
22148
- return Ln(t);
22148
+ return _n(t);
22149
22149
  switch (t) {
22150
22150
  case rt:
22151
- return Ln("Suspense");
22151
+ return _n("Suspense");
22152
22152
  case Mt:
22153
- return Ln("SuspenseList");
22153
+ return _n("SuspenseList");
22154
22154
  }
22155
22155
  if (typeof t == "object")
22156
22156
  switch (t.$$typeof) {
@@ -22171,13 +22171,13 @@ function U4() {
22171
22171
  function kb(t) {
22172
22172
  switch (t._debugOwner && t._debugOwner.type, t._debugSource, t.tag) {
22173
22173
  case k:
22174
- return Ln(t.type);
22174
+ return _n(t.type);
22175
22175
  case ue:
22176
- return Ln("Lazy");
22176
+ return _n("Lazy");
22177
22177
  case N:
22178
- return Ln("Suspense");
22178
+ return _n("Suspense");
22179
22179
  case ye:
22180
- return Ln("SuspenseList");
22180
+ return _n("SuspenseList");
22181
22181
  case b:
22182
22182
  case T:
22183
22183
  case X:
@@ -26535,7 +26535,7 @@ Check the render method of \`` + t + "`." : "";
26535
26535
  }
26536
26536
  } else if (O && !Ee)
26537
26537
  D.delete(_e.toLowerCase()), bt = Et(t, _e, Ve), Ve !== bt && Qh(_e, bt, Ve);
26538
- else if (!Mn(_e, jt, O) && !In(_e, Ve, jt, O)) {
26538
+ else if (!Ln(_e, jt, O) && !In(_e, Ve, jt, O)) {
26539
26539
  var je = !1;
26540
26540
  if (jt !== null)
26541
26541
  D.delete(jt.attributeName), bt = tt(t, _e, Ve, jt);
@@ -41670,14 +41670,14 @@ const FV = (e) => {
41670
41670
  }, On = {
41671
41671
  ...G.MenuListProps,
41672
41672
  ...(In = G.slotProps) == null ? void 0 : In.list
41673
- }, Mn = Q3();
41673
+ }, Ln = Q3();
41674
41674
  return /* @__PURE__ */ L.jsxs(Se.Fragment, {
41675
41675
  children: [/* @__PURE__ */ L.jsx(MV, {
41676
41676
  as: "div",
41677
41677
  ref: xe,
41678
41678
  tabIndex: ir,
41679
41679
  role: "combobox",
41680
- "aria-controls": yt ? Mn : void 0,
41680
+ "aria-controls": yt ? Ln : void 0,
41681
41681
  "aria-disabled": w ? "true" : void 0,
41682
41682
  "aria-expanded": yt ? "true" : "false",
41683
41683
  "aria-haspopup": "listbox",
@@ -41741,7 +41741,7 @@ const FV = (e) => {
41741
41741
  role: "listbox",
41742
41742
  "aria-multiselectable": W ? "true" : void 0,
41743
41743
  disableListWrap: !0,
41744
- id: Mn,
41744
+ id: Ln,
41745
41745
  ...On
41746
41746
  },
41747
41747
  paper: {
@@ -42708,22 +42708,22 @@ const YV = sn(Rb)(({ theme: e }) => ({
42708
42708
  })), (xe = Re.current[p - 1]) == null || xe.focus();
42709
42709
  }
42710
42710
  };
42711
- return _n(() => {
42711
+ return Mn(() => {
42712
42712
  if (V > 0) {
42713
42713
  const Z = setTimeout(() => ye((re) => re - 1), 1e3);
42714
42714
  return () => clearTimeout(Z);
42715
42715
  }
42716
- }, [V]), _n(() => {
42716
+ }, [V]), Mn(() => {
42717
42717
  if (Ce > 0) {
42718
42718
  const Z = setTimeout(() => ie((re) => re - 1), 1e3);
42719
42719
  return () => clearTimeout(Z);
42720
42720
  }
42721
- }, [Ce]), _n(() => {
42721
+ }, [Ce]), Mn(() => {
42722
42722
  if (de > 0) {
42723
42723
  const Z = setTimeout(() => ge((re) => re - 1), 1e3);
42724
42724
  return () => clearTimeout(Z);
42725
42725
  }
42726
- }, [de]), _n(() => {
42726
+ }, [de]), Mn(() => {
42727
42727
  const Z = !!(v && v.length === p || typeof R == "string" && R.length === p), re = ce || oe, K = !!(oe && !ce), xe = K ? "email" : "sms";
42728
42728
  re && !ue && !U && !Z && (async () => {
42729
42729
  if (!(K && de > 0) && !(!K && V > 0))
@@ -42734,12 +42734,12 @@ const YV = sn(Rb)(({ theme: e }) => ({
42734
42734
  N("Failed to send OTP. Please try again.");
42735
42735
  }
42736
42736
  })();
42737
- }, [ce, oe, ue, U, V, de, v, p, R]), _n(() => {
42737
+ }, [ce, oe, ue, U, V, de, v, p, R]), Mn(() => {
42738
42738
  w(d ? !U : !1);
42739
- }, [U, d, w]), _n(() => {
42739
+ }, [U, d, w]), Mn(() => {
42740
42740
  const Z = v && v.length === p ? v : typeof R == "string" && R.length === p ? R : "";
42741
42741
  Z && Z.length === p && (P(Z.split("")), G(!0));
42742
- }, [v, p, R]), _n(() => {
42742
+ }, [v, p, R]), Mn(() => {
42743
42743
  Re.current[0] && !U && Re.current[0].focus();
42744
42744
  }, [U]), M.join("").length, /* @__PURE__ */ L.jsxs(YV, { children: [
42745
42745
  /* @__PURE__ */ L.jsx(Sw, { variant: "h6", gutterBottom: !0, children: c }),
@@ -43006,12 +43006,12 @@ const ej = Ie.div`
43006
43006
  };
43007
43007
  console.log("Parsed address:", ce), R(ce), v(s, ce), U(!1), M([]);
43008
43008
  };
43009
- _n(() => {
43009
+ Mn(() => {
43010
43010
  const ie = (de) => {
43011
43011
  de.target.closest(".address-autofill-container") || U(!1);
43012
43012
  };
43013
43013
  return document.addEventListener("click", ie), () => document.removeEventListener("click", ie);
43014
- }, []), _n(() => {
43014
+ }, []), Mn(() => {
43015
43015
  console.log("Suggestions state changed:", {
43016
43016
  showSuggestions: P,
43017
43017
  suggestionsCount: k.length,
@@ -43116,11 +43116,11 @@ const ej = Ie.div`
43116
43116
  ] });
43117
43117
  }, ij = ({ formComponent: e, formidavimHost: o }) => {
43118
43118
  const i = e.props, { propertyId: s, label: c = "Hidden Field", jsonataExpression: p } = i || {}, { getFlowValue: d, setFlowAndPatientValue: v, getFlowError: b, setFlowError: S, setDisableSubmitValue: T, setFlowValue: w } = Gr(), R = Tp(d(s)), [k, M] = an("");
43119
- _n(() => {
43119
+ Mn(() => {
43120
43120
  M(R);
43121
- }, [R]), _n(() => {
43121
+ }, [R]), Mn(() => {
43122
43122
  R || w(s, ""), T(!1);
43123
- }, [s, w, T]), _n(() => {
43123
+ }, [s, w, T]), Mn(() => {
43124
43124
  console.log("Hidden component - jsonataExpression (evaluated value):", p), console.log("Hidden component - propertyId:", s), p != null ? (w(s, String(p)), S(s, null), T(!1), console.log("Hidden component - stored evaluated value:", p)) : (console.log("Hidden component - no value, setting default"), w(s, ""), S(s, null), T(!1));
43125
43125
  }, [p, s, w, S, T]);
43126
43126
  const U = !!b(s);
@@ -43411,9 +43411,9 @@ const Nj = Ie.div`
43411
43411
  );
43412
43412
  }, _j = ({ formComponent: e }) => {
43413
43413
  const o = e.props, { getFlowValue: i, setFlowAndPatientValue: s, getFlowError: c } = Gr(), [p, d] = an(!1), [v, b] = an(!1), [S, T] = an(!1), w = mf(null), R = i(o.propertyId), k = c(o.propertyId), M = !!k && k !== "Required";
43414
- _n(() => {
43414
+ Mn(() => {
43415
43415
  T(!!R);
43416
- }, [R]), _n(() => {
43416
+ }, [R]), Mn(() => {
43417
43417
  const F = w.current;
43418
43418
  if (!F) return;
43419
43419
  const N = () => {
@@ -44415,11 +44415,11 @@ function Hj() {
44415
44415
  "YXMxWwdD".split("").forEach((Ye) => vn(it[Ye]));
44416
44416
  const Rn = !pn(161) && pn(130), ar = pn(84), ir = !ar && pn(72);
44417
44417
  un = 0, "PHhmsf".split("").forEach((Ye) => vn(it[Ye]));
44418
- const nt = !pn(23) && pn(47), On = (Rn ? "YD" : ar ? "XxwF" : ir ? "XWF" : "YMD") + (nt ? "Phmsf" : "Hmsf"), Mn = this.environment.timestamp;
44418
+ const nt = !pn(23) && pn(47), On = (Rn ? "YD" : ar ? "XxwF" : ir ? "XWF" : "YMD") + (nt ? "Phmsf" : "Hmsf"), Ln = this.environment.timestamp;
44419
44419
  let $n = !1, In = !1;
44420
44420
  if (On.split("").forEach((Ye) => {
44421
44421
  if (typeof it[Ye] > "u")
44422
- $n ? (it[Ye] = "MDd".indexOf(Ye) !== -1 ? 1 : 0, In = !0) : it[Ye] = ce(Mn, Ye);
44422
+ $n ? (it[Ye] = "MDd".indexOf(Ye) !== -1 ? 1 : 0, In = !0) : it[Ye] = ce(Ln, Ye);
44423
44423
  else if ($n = !0, In)
44424
44424
  throw {
44425
44425
  code: "D3136"
@@ -44839,12 +44839,12 @@ function Hj() {
44839
44839
  };
44840
44840
  var zt = function(Ht) {
44841
44841
  var Hn = function() {
44842
- for (var Ln, Or = 0; Or < Ht.length; Or++)
44843
- if (Ln = Ht.charAt(Or), Ot.indexOf(Ln) !== -1 && Ln !== le["exponent-separator"])
44842
+ for (var _n, Or = 0; Or < Ht.length; Or++)
44843
+ if (_n = Ht.charAt(Or), Ot.indexOf(_n) !== -1 && _n !== le["exponent-separator"])
44844
44844
  return Ht.substring(0, Or);
44845
44845
  }(), xr = function() {
44846
- for (var Ln, Or = Ht.length - 1; Or >= 0; Or--)
44847
- if (Ln = Ht.charAt(Or), Ot.indexOf(Ln) !== -1 && Ln !== le["exponent-separator"])
44846
+ for (var _n, Or = Ht.length - 1; Or >= 0; Or--)
44847
+ if (_n = Ht.charAt(Or), Ot.indexOf(_n) !== -1 && _n !== le["exponent-separator"])
44848
44848
  return Ht.substring(Or + 1);
44849
44849
  }(), gn = Ht.substring(Hn.length, Ht.length - xr.length), co, Rr, $o, ji, fo = Ht.indexOf(le["exponent-separator"], Hn.length);
44850
44850
  fo === -1 || fo > Ht.length - xr.length ? (co = gn, Rr = void 0) : (co = gn.substring(0, fo), Rr = gn.substring(fo + 1));
@@ -44871,19 +44871,19 @@ function Hj() {
44871
44871
  }
44872
44872
  }
44873
44873
  Rr || (Hn = "D3085");
44874
- var ji = Ht.activePart.split("").map(function(Ln) {
44875
- return Ot.indexOf(Ln) === -1 ? "p" : "a";
44874
+ var ji = Ht.activePart.split("").map(function(_n) {
44875
+ return Ot.indexOf(_n) === -1 ? "p" : "a";
44876
44876
  }).join("");
44877
44877
  ji.indexOf("p") !== -1 && (Hn = "D3086"), co !== -1 ? (gn.charAt(co - 1) === le["grouping-separator"] || gn.charAt(co + 1) === le["grouping-separator"]) && (Hn = "D3087") : Ht.integerPart.charAt(Ht.integerPart.length - 1) === le["grouping-separator"] && (Hn = "D3088"), gn.indexOf(le["grouping-separator"] + le["grouping-separator"]) !== -1 && (Hn = "D3089");
44878
44878
  var fo = Ht.integerPart.indexOf(le.digit);
44879
- fo !== -1 && Ht.integerPart.substring(0, fo).split("").filter(function(Ln) {
44880
- return Le.indexOf(Ln) > -1;
44881
- }).length > 0 && (Hn = "D3090"), fo = Ht.fractionalPart.lastIndexOf(le.digit), fo !== -1 && Ht.fractionalPart.substring(fo).split("").filter(function(Ln) {
44882
- return Le.indexOf(Ln) > -1;
44879
+ fo !== -1 && Ht.integerPart.substring(0, fo).split("").filter(function(_n) {
44880
+ return Le.indexOf(_n) > -1;
44881
+ }).length > 0 && (Hn = "D3090"), fo = Ht.fractionalPart.lastIndexOf(le.digit), fo !== -1 && Ht.fractionalPart.substring(fo).split("").filter(function(_n) {
44882
+ return Le.indexOf(_n) > -1;
44883
44883
  }).length > 0 && (Hn = "D3091");
44884
44884
  var eo = typeof Ht.exponentPart == "string";
44885
- if (eo && Ht.exponentPart.length > 0 && (gn.indexOf(le.percent) !== -1 || gn.indexOf(le["per-mille"]) !== -1) && (Hn = "D3092"), eo && (Ht.exponentPart.length === 0 || Ht.exponentPart.split("").filter(function(Ln) {
44886
- return Le.indexOf(Ln) === -1;
44885
+ if (eo && Ht.exponentPart.length > 0 && (gn.indexOf(le.percent) !== -1 || gn.indexOf(le["per-mille"]) !== -1) && (Hn = "D3092"), eo && (Ht.exponentPart.length === 0 || Ht.exponentPart.split("").filter(function(_n) {
44886
+ return Le.indexOf(_n) === -1;
44887
44887
  }).length > 0) && (Hn = "D3093"), Hn)
44888
44888
  throw {
44889
44889
  code: Hn,
@@ -44911,10 +44911,10 @@ function Hj() {
44911
44911
  return Le.indexOf(Wr) !== -1;
44912
44912
  }).length, ji = $o, fo = Ht.fractionalPart.split(""), eo = fo.filter(function(Wr) {
44913
44913
  return Le.indexOf(Wr) !== -1;
44914
- }).length, Ln = fo.filter(function(Wr) {
44914
+ }).length, _n = fo.filter(function(Wr) {
44915
44915
  return Le.indexOf(Wr) !== -1 || Wr === le.digit;
44916
44916
  }).length, Or = typeof Ht.exponentPart == "string";
44917
- $o === 0 && Ln === 0 && (Or ? (eo = 1, Ln = 1) : $o = 1), Or && $o === 0 && Ht.integerPart.indexOf(le.digit) !== -1 && ($o = 1), $o === 0 && eo === 0 && (eo = 1);
44917
+ $o === 0 && _n === 0 && (Or ? (eo = 1, _n = 1) : $o = 1), Or && $o === 0 && Ht.integerPart.indexOf(le.digit) !== -1 && ($o = 1), $o === 0 && eo === 0 && (eo = 1);
44918
44918
  var mi = 0;
44919
44919
  return Or && (mi = Ht.exponentPart.split("").filter(function(Wr) {
44920
44920
  return Le.indexOf(Wr) !== -1;
@@ -44926,7 +44926,7 @@ function Hj() {
44926
44926
  prefix: Ht.prefix,
44927
44927
  fractionalPartGroupingPositions: Rr,
44928
44928
  minimumFactionalPartSize: eo,
44929
- maximumFactionalPartSize: Ln,
44929
+ maximumFactionalPartSize: _n,
44930
44930
  minimumExponentSize: mi,
44931
44931
  suffix: Ht.suffix,
44932
44932
  picture: Ht.subpicture
@@ -45234,7 +45234,7 @@ function Hj() {
45234
45234
  }
45235
45235
  return q;
45236
45236
  }
45237
- function Mn($) {
45237
+ function Ln($) {
45238
45238
  throw {
45239
45239
  code: "D3137",
45240
45240
  stack: new Error().stack,
@@ -45364,7 +45364,7 @@ function Hj() {
45364
45364
  merge: Be,
45365
45365
  reverse: fn,
45366
45366
  each: On,
45367
- error: Mn,
45367
+ error: Ln,
45368
45368
  assert: $n,
45369
45369
  type: In,
45370
45370
  sort: Ye,
@@ -45383,7 +45383,7 @@ function Hj() {
45383
45383
  }).call(this, typeof iO < "u" ? iO : typeof self < "u" ? self : typeof window < "u" ? window : {});
45384
45384
  }, { "./utils": 6 }], 3: [function(i, s, c) {
45385
45385
  var p = i("./datetime"), d = i("./functions"), v = i("./utils"), b = i("./parser"), S = i("./signature"), T = function() {
45386
- var w = v.isNumeric, R = v.isArrayOfStrings, k = v.isArrayOfNumbers, M = v.createSequence, P = v.isSequence, U = v.isFunction, G = v.isLambda, W = v.isIterable, A = v.isPromise, F = v.getFunctionArity, N = v.isDeepEqual, z = Mn(null);
45386
+ var w = v.isNumeric, R = v.isArrayOfStrings, k = v.isArrayOfNumbers, M = v.createSequence, P = v.isSequence, U = v.isFunction, G = v.isLambda, W = v.isIterable, A = v.isPromise, F = v.getFunctionArity, N = v.isDeepEqual, z = Ln(null);
45387
45387
  async function X(j, J, ae) {
45388
45388
  var $, I = ae.lookup(Symbol.for("jsonata.__evaluate_entry"));
45389
45389
  switch (I && await I(j, J, ae), j.type) {
@@ -45469,7 +45469,7 @@ function Hj() {
45469
45469
  return j.keepSingletonArray && (Array.isArray(I) && I.cons && !I.sequence && (I = M(I)), I.keepSingleton = !0), j.hasOwnProperty("group") && (I = await re(j.group, q ? fe : I, ae)), I;
45470
45470
  }
45471
45471
  function we(j, J) {
45472
- var ae = Mn(j);
45472
+ var ae = Ln(j);
45473
45473
  for (const $ in J)
45474
45474
  ae.bind($, J[$]);
45475
45475
  return ae;
@@ -45868,7 +45868,7 @@ function Hj() {
45868
45868
  return d.boolean(I) ? $ = await X(j.then, J, ae) : typeof j.else < "u" && ($ = await X(j.else, J, ae)), $;
45869
45869
  }
45870
45870
  async function be(j, J, ae) {
45871
- for (var $, I = Mn(ae), q = 0; q < j.expressions.length; q++)
45871
+ for (var $, I = Ln(ae), q = 0; q < j.expressions.length; q++)
45872
45872
  $ = await X(j.expressions[q], J, I);
45873
45873
  return $;
45874
45874
  }
@@ -46137,13 +46137,13 @@ function Hj() {
46137
46137
  return $;
46138
46138
  }
46139
46139
  async function Rn(j, J) {
46140
- var ae, $ = Mn(j.environment);
46140
+ var ae, $ = Ln(j.environment);
46141
46141
  return j.arguments.forEach(function(I, q) {
46142
46142
  $.bind(I.value, J[q]);
46143
46143
  }), typeof j.body == "function" ? ae = await at(j.body, $) : ae = await X(j.body, j.input, $), ae;
46144
46144
  }
46145
46145
  function ar(j, J) {
46146
- var ae = Mn(j.environment), $ = [];
46146
+ var ae = Ln(j.environment), $ = [];
46147
46147
  j.arguments.forEach(function(q, fe) {
46148
46148
  var le = J[fe];
46149
46149
  le && le.type === "operator" && le.value === "?" ? $.push(q) : ae.bind(q.value, le);
@@ -46217,7 +46217,7 @@ function Hj() {
46217
46217
  if (!(typeof j > "u"))
46218
46218
  return JSON.parse(d.string(j));
46219
46219
  }
46220
- function Mn(j) {
46220
+ function Ln(j) {
46221
46221
  var J = {};
46222
46222
  const ae = {
46223
46223
  bind: function(I, q) {
@@ -46360,7 +46360,7 @@ function Hj() {
46360
46360
  } catch (fe) {
46361
46361
  throw In(fe), fe;
46362
46362
  }
46363
- var I = Mn(z), q = /* @__PURE__ */ new Date();
46363
+ var I = Ln(z), q = /* @__PURE__ */ new Date();
46364
46364
  return I.bind("now", Be(function(fe, le) {
46365
46365
  return p.fromMillis(q.getTime(), fe, le);
46366
46366
  }, "<s?s?:s>")), I.bind("millis", Be(function() {
@@ -46376,7 +46376,7 @@ function Hj() {
46376
46376
  }
46377
46377
  if (typeof le < "u") {
46378
46378
  var Et;
46379
- Et = Mn(I);
46379
+ Et = Ln(I);
46380
46380
  for (var Ot in le)
46381
46381
  Et.bind(Ot, le[Ot]);
46382
46382
  } else
@@ -47522,7 +47522,9 @@ const zA = /* @__PURE__ */ KC(Gj), Wj = async (e, o, i) => {
47522
47522
  }
47523
47523
  return ge;
47524
47524
  };
47525
- _n(() => {
47525
+ Mn(() => {
47526
+ S(0);
47527
+ }, [e.slug]), Mn(() => {
47526
47528
  const de = async () => {
47527
47529
  var pe;
47528
47530
  if (!e.flowForms) {
@@ -47541,7 +47543,7 @@ const zA = /* @__PURE__ */ KC(Gj), Wj = async (e, o, i) => {
47541
47543
  w(ge), k(!1);
47542
47544
  };
47543
47545
  k(!0), de();
47544
- }, [e.flowForms, M]), _n(() => {
47546
+ }, [e.flowForms, M]), Mn(() => {
47545
47547
  if (!R && T.length > 0 && b < T.length) {
47546
47548
  const de = T[b], ge = (de == null ? void 0 : de.evaluatedFormComponents) || [], pe = q$(ge, P, A);
47547
47549
  G(!pe);
@@ -47680,13 +47682,13 @@ const zA = /* @__PURE__ */ KC(Gj), Wj = async (e, o, i) => {
47680
47682
  }
47681
47683
  }
47682
47684
  };
47683
- _n(() => {
47685
+ Mn(() => {
47684
47686
  (async () => {
47685
47687
  P(!0), e && T(e), await W(e, !0), G(!0), P(!1);
47686
47688
  })();
47687
47689
  }, [e, o]);
47688
47690
  const A = w();
47689
- return _n(() => {
47691
+ return Mn(() => {
47690
47692
  U && A && W(A);
47691
47693
  }, [A, o, U]), M || !R ? /* @__PURE__ */ L.jsx("div", { children: "Processing form..." }) : /* @__PURE__ */ L.jsx(
47692
47694
  Xj,
@@ -47862,7 +47864,7 @@ const lU = ({ formComponent: e, isPreview: o, boundary: i, isVisible: s = !0, fo
47862
47864
  `, cU = ({ children: e, $bgColor: o }) => /* @__PURE__ */ L.jsx(wp, { $overflow: "visible", $position: "static", $xSmall: !0, id: "MainFlowContainer", $bgColor: o || "white", $bRad: "0px", $marginBottom: "80px", $marginBottomMd: "0px", children: /* @__PURE__ */ L.jsx(uU, { onSubmit: (i) => i.preventDefault(), children: e }) }), fU = ({ dataFetcher: e = () => {
47863
47865
  }, children: o, configFetcher: i, isPreview: s = !1, onSubmit: c = () => Promise.resolve(), formidavimHost: p, version: d, flowName: v = "", onNextStep: b, onPrevStep: S, onFlowInit: T, onConfigFetchError: w, shouldRedirect: R, onFormidavimFallback: k }) => {
47864
47866
  const M = pv(p), [P, U] = an({ config: null, data: null }), [G, W] = an(!0);
47865
- return _n(() => {
47867
+ return Mn(() => {
47866
47868
  (i ? i() : M.flowControllerGetBySlug(v, d).then(({ data: F }) => F)).then(async (F) => {
47867
47869
  const N = e ? await e("flow") : null;
47868
47870
  U({ config: F, data: N }), T && T(F), W(!1);
@@ -47884,10 +47886,10 @@ const lU = ({ formComponent: e, isPreview: o, boundary: i, isVisible: s = !0, fo
47884
47886
  ) }) : (k && k(), /* @__PURE__ */ L.jsx(L.Fragment, { children: o }));
47885
47887
  }, SU = ({ dataFetcher: e = () => Promise.resolve(null), children: o, configFetcher: i, pipelineFetcher: s, isPreview: c = !1, onSubmit: p = () => Promise.resolve(), formidavimHost: d, version: v, flowName: b = "", onNextStep: S, onPrevStep: T, onFlowInit: w, onPipelineInit: R, onNoFlowsAvailable: k, onConfigFetchError: M, onFormidavimFallback: P }) => {
47886
47888
  const U = pv(d), [G, W] = an({ config: null, data: null }), [A, F] = an(0), [N, z] = an([]), [X, ue] = an(!0), [we, V] = an(!1);
47887
- _n(() => {
47889
+ Mn(() => {
47888
47890
  (s ? s() : U.pipelineControllerGetBySlug(b, v).then(({ data: pe }) => pe)).then(async (pe) => {
47889
47891
  const Pe = e ? await e("pipeline") : null;
47890
- if (W({ config: pe, data: Pe }), console.log(Pe), pe != null && pe.pipelineFlows && (await ye(pe.pipelineFlows, Pe)).length === 0) {
47892
+ if (W({ config: pe, data: Pe }), pe != null && pe.pipelineFlows && (await ye(pe.pipelineFlows, Pe)).length === 0) {
47891
47893
  k && k();
47892
47894
  return;
47893
47895
  }
@@ -47903,7 +47905,7 @@ const lU = ({ formComponent: e, isPreview: o, boundary: i, isVisible: s = !0, fo
47903
47905
  return (Y = pe == null ? void 0 : pe.data) == null ? void 0 : Y[B];
47904
47906
  }, ce = () => pe, oe = (B, Y) => {
47905
47907
  var He;
47906
- const Oe = (He = pe == null ? void 0 : pe.data) == null ? void 0 : He.flowSubmissions;
47908
+ const Oe = (He = pe == null ? void 0 : pe.data) == null ? void 0 : He.flow_submissions;
47907
47909
  return !(!Oe || !Oe[B]);
47908
47910
  };
47909
47911
  for (const B of ge)
@@ -47912,7 +47914,7 @@ const lU = ({ formComponent: e, isPreview: o, boundary: i, isVisible: s = !0, fo
47912
47914
  Re,
47913
47915
  ce
47914
47916
  ) || Pe.push(B);
47915
- return z(Pe), Pe;
47917
+ return console.log(Pe), z(Pe), Pe;
47916
47918
  };
47917
47919
  if (X)
47918
47920
  return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hievilmath/browser-formidavim",
3
- "version": "1.4.9",
3
+ "version": "1.4.10",
4
4
  "main": "./index.js",
5
5
  "module": "./index.mjs",
6
6
  "typings": "./index.d.ts",