@nemme/js-sdk 1.0.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +25 -3
  3. package/dist/chunks/{chunk-CZZ4p3Yf.js → chunk-DWNI8pZO.js} +1 -1
  4. package/dist/chunks/{client-D6k2IoC6.js → client-CKvtSbpa.js} +13 -7
  5. package/dist/chunks/{client-D6k2IoC6.js.map → client-CKvtSbpa.js.map} +1 -1
  6. package/dist/chunks/{client-BYPXJmEU.js → client-Db2ZE5y9.js} +2 -2
  7. package/dist/chunks/{client-BYPXJmEU.js.map → client-Db2ZE5y9.js.map} +1 -1
  8. package/dist/chunks/{config-C6VpkZGH.js → config-DCrsd6gZ.js} +1 -1
  9. package/dist/chunks/{config-C6VpkZGH.js.map → config-DCrsd6gZ.js.map} +1 -1
  10. package/dist/chunks/{config-BnABfG_n.js → config-hiNBGctX.js} +2 -2
  11. package/dist/chunks/{config-BnABfG_n.js.map → config-hiNBGctX.js.map} +1 -1
  12. package/dist/chunks/form-manager-BG1qr31N.js +12 -0
  13. package/dist/chunks/form-manager-BG1qr31N.js.map +1 -0
  14. package/dist/chunks/{form-manager-BqtPAs-A.js → form-manager-Dit5tdsl.js} +112 -104
  15. package/dist/chunks/form-manager-Dit5tdsl.js.map +1 -0
  16. package/dist/client.d.ts +6 -1
  17. package/dist/forms.cjs +1 -1
  18. package/dist/forms.esm.js +1 -1
  19. package/dist/index.cjs +1 -1
  20. package/dist/index.cjs.map +1 -1
  21. package/dist/index.esm.js +1 -1
  22. package/dist/index.esm.js.map +1 -1
  23. package/dist/js-sdk.css +2 -1
  24. package/dist/nemme-sdk.umd.js +7 -7
  25. package/dist/nemme-sdk.umd.js.map +1 -1
  26. package/dist/react.cjs +1 -1
  27. package/dist/react.cjs.map +1 -1
  28. package/dist/react.esm.js +1 -1
  29. package/dist/react.esm.js.map +1 -1
  30. package/dist/utils/safe-url.d.ts +1 -0
  31. package/package.json +16 -15
  32. package/dist/chunks/form-manager-3PwpV6gK.js +0 -12
  33. package/dist/chunks/form-manager-3PwpV6gK.js.map +0 -1
  34. package/dist/chunks/form-manager-BqtPAs-A.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { t as e } from "./config-C6VpkZGH.js";
1
+ import { t as e } from "./config-DCrsd6gZ.js";
2
2
  import * as t from "react";
3
3
  import n, { createContext as r, createElement as i, forwardRef as a, useCallback as o, useContext as s, useEffect as c, useMemo as l, useRef as u, useState as d, useSyncExternalStore as f } from "react";
4
4
  import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
@@ -257,10 +257,10 @@ function ue() {
257
257
  return t.get = (r, i) => (n?.revoke?.(), i === le ? e : (e.push(i), n = Proxy.revocable(r, t), n.proxy)), Proxy.revocable(Object.create(null), t).proxy;
258
258
  }
259
259
  function L(e, t) {
260
- let { [le]: n } = e(ue()), r = t?.keySeparator ?? ".", i = t?.nsSeparator ?? ":";
260
+ let { [le]: n } = e(ue()), r = t?.keySeparator ?? ".", i = t?.nsSeparator ?? ":", a = t?.enableSelector === "strict";
261
261
  if (n.length > 1 && i) {
262
- let e = t?.ns, a = Array.isArray(e) ? e : null;
263
- if (a && a.length > 1 && a.slice(1).includes(n[0])) return `${n[0]}${i}${n.slice(1).join(r)}`;
262
+ let e = t?.ns, o = a ? Array.isArray(e) ? e : e ? [e] : null : Array.isArray(e) ? e : null;
263
+ if (o && (a ? o : o.length > 1 ? o.slice(1) : []).includes(n[0])) return `${n[0]}${i}${n.slice(1).join(r)}`;
264
264
  }
265
265
  return n.join(r);
266
266
  }
@@ -938,6 +938,7 @@ var de = (e) => !y(e) && typeof e != "boolean" && typeof e != "number", fe = cla
938
938
  nsSeparator: ":",
939
939
  pluralSeparator: "_",
940
940
  contextSeparator: "_",
941
+ enableSelector: !1,
941
942
  partialBundledLanguages: !1,
942
943
  saveMissing: !1,
943
944
  updateMissing: !1,
@@ -1443,7 +1444,7 @@ var $e = ({ step: e, form: t, formState: n, onDismiss: r, onNextStep: i, onPrevi
1443
1444
  })(e);
1444
1445
  if (c.type === "start") {
1445
1446
  let { title: e, description: a, image: o, includeOptOut: l, customStartButton: u, startButtonText: d, customOptOutButton: f, optOutButtonText: p } = c.transition;
1446
- return /* @__PURE__ */ m(qn, {
1447
+ return /* @__PURE__ */ m(Jn, {
1447
1448
  title: e,
1448
1449
  description: a,
1449
1450
  icon: t.icon,
@@ -1456,7 +1457,7 @@ var $e = ({ step: e, form: t, formState: n, onDismiss: r, onNextStep: i, onPrevi
1456
1457
  }
1457
1458
  if (c.type === "end") {
1458
1459
  let { title: e, description: n, image: r, customEndButton: a, endButtonText: o, customEndButtonLink: l, endButtonLink: u } = c.transition;
1459
- return /* @__PURE__ */ m(Kn, {
1460
+ return /* @__PURE__ */ m(qn, {
1460
1461
  title: e,
1461
1462
  description: n,
1462
1463
  icon: t.icon,
@@ -5666,24 +5667,24 @@ var K = On, q = ({ variant: e = "primary", size: t = "medium", text: n, iconBefo
5666
5667
  case "medium": return "text-[15px] leading-[16px] -tracking-0,1";
5667
5668
  }
5668
5669
  }, Nn = {
5669
- Di1: "text-[72px] font-bold leading-[90px] -tracking-2,5",
5670
- Di2: "text-[60px] font-bold leading-[72px] -tracking-2,0",
5671
- Di3: "text-[48px] font-bold leading-[60px] -tracking-1,5",
5672
- T1: "text-[40px] font-bold leading-[48px] -tracking-1,5",
5673
- T2: "text-[32px] font-bold leading-[40px] -tracking-1",
5674
- T3: "text-[24px] font-bold leading-[32px] -tracking-0,5",
5675
- H1: "text-[24px] font-bold leading-[32px] -tracking-0,5",
5676
- H2: "text-[20px] font-bold leading-[24px]",
5677
- H3: "text-[15px] font-bold leading-[20px]",
5678
- H4: "text-[13px] font-bold leading-[16px]",
5679
- B1B: "text-[15px] font-bold leading-[24px] -tracking-0,1",
5680
- B1: "text-[15px] leading-[24px] -tracking-0,1",
5681
- B1Button: "text-[15px] leading-[16px] -tracking-0,1",
5682
- B2: "text-[13px] leading-[20px]",
5683
- B2Button: "text-[13px] leading-[16px]",
5684
- D1B: "text-[12px] font-bold leading-[16px]",
5685
- D1: "text-[12px] leading-[16px]",
5686
- M: "text-[10px] leading-[16px]"
5670
+ Di1: "text-[72px] font-medium leading-[90px] -tracking-2,5",
5671
+ Di2: "text-[60px] font-medium leading-[72px] -tracking-2,0",
5672
+ Di3: "text-[48px] font-medium leading-[60px] -tracking-1,5",
5673
+ T1: "text-[40px] font-medium leading-[48px] -tracking-1,5",
5674
+ T2: "text-[32px] font-medium leading-[40px] -tracking-1",
5675
+ T3: "text-[24px] font-medium leading-[32px] -tracking-0,5",
5676
+ H1: "text-[24px] font-medium leading-[32px] -tracking-0,5",
5677
+ H2: "text-[20px] font-medium leading-[24px]",
5678
+ H3: "text-[15px] font-medium leading-[20px]",
5679
+ H4: "text-[13px] font-medium leading-[16px]",
5680
+ B1B: "text-[15px] font-semibold leading-[24px] -tracking-0,1",
5681
+ B1: "text-[15px] font-regular leading-[24px] -tracking-0,1",
5682
+ B1Button: "text-[15px] font-regular leading-[16px] -tracking-0,1",
5683
+ B2: "text-[13px] font-regular leading-[20px]",
5684
+ B2Button: "text-[13px] font-regular leading-[16px]",
5685
+ D1B: "text-[12px] font-semibold leading-[16px]",
5686
+ D1: "text-[12px] font-regular leading-[16px]",
5687
+ M: "text-[10px] font-regular leading-[16px]"
5687
5688
  }, J = ({ children: e, className: t, variant: n = "B1", significance: r = "primary", as: i }) => {
5688
5689
  let a = i ?? Pn[n], o = Nn[n];
5689
5690
  return /* @__PURE__ */ m(a, {
@@ -5803,8 +5804,8 @@ var Y = {
5803
5804
  transparent: "#00000000",
5804
5805
  grey: {
5805
5806
  0: "#FFFFFF",
5806
- 5: "#FBFBFD",
5807
- 10: "#F2F2F7",
5807
+ 5: "#F9F9FA",
5808
+ 10: "#F2F2F5",
5808
5809
  50: "#E5E5EA",
5809
5810
  75: "#DEDEE1",
5810
5811
  100: "#D1D1D6",
@@ -5972,7 +5973,7 @@ var Y = {
5972
5973
  950: "#00000080"
5973
5974
  }
5974
5975
  };
5975
- Y.grey[5], Y.grey[990], Y.grey[10], Y.grey[950], Y.grey[50], Y.grey[900], Y.grey[50], Y.grey[990], Y.grey[5], Y.grey[950], Y.grey[10], Y.grey[900], Y.grey[10], Y.grey[900], Y.grey[50], Y.grey[900], Y.grey[100], Y.grey[800], Y["opacity-grey"][600], Y["opacity-grey"][300], Y["opacity-grey"][600], Y["opacity-grey"][300], Y["opacity-grey"][700], Y["opacity-grey"][200], Y["opacity-grey"][950], Y["opacity-grey"][990], Y.grey[1e3], Y.grey[0], Y.grey[500], Y.grey[400], Y.grey[400], Y.grey[500], Y.grey[400], Y.grey[400], Y.grey[0], Y.grey[1e3], Y.grey[100], Y.grey[700], Y["strong-blue"][600], Y["strong-blue"][300], Y["strong-blue"][400], Y["strong-blue"][500], Y["strong-blue"][600], Y["strong-blue"][600], Y["strong-blue"][50], Y["strong-blue"][950], Y["strong-blue"][950], Y["strong-blue"][50], Y.grey[100], Y.grey[700], Y.grey[1e3], Y.grey[0], Y.grey[900], Y.grey[100], Y.grey[0], Y.grey[1e3], Y.grey[100], Y.grey[700], Y["opacity-grey"][600], Y["opacity-grey"][300], Y["opacity-grey"][700], Y["opacity-grey"][200], Y["opacity-grey"][600], Y["opacity-grey"][300], Y["banana-yellow"][400], Y["banana-yellow"][400], Y["banana-yellow"][100], Y["banana-yellow"][100], Y["banana-yellow"][50], Y["banana-yellow"][50], Y["banana-yellow"][5], Y["banana-yellow"][5], Y["banana-yellow"][800], Y["banana-yellow"][400], Y["bright-coral"][400], Y["bright-coral"][400], Y["bright-coral"][100], Y["bright-coral"][100], Y["bright-coral"][50], Y["bright-coral"][50], Y["bright-coral"][5], Y["bright-coral"][5], Y["bright-coral"][600], Y["bright-coral"][400], Y["minty-blue"][400], Y["minty-blue"][400], Y["minty-blue"][100], Y["minty-blue"][100], Y["minty-blue"][50], Y["minty-blue"][50], Y["minty-blue"][5], Y["minty-blue"][5], Y["minty-blue"][800], Y["minty-blue"][400], Y.grey[300], Y.grey[600], Y.grey[50], Y.grey[900], Y.grey[100], Y.grey[800], Y.grey[100], Y.grey[700], Y.grey[10], Y.grey[900], Y.grey[5], Y.grey[990], Y.grey[0], Y.grey[1e3], Y.green[10], Y.green[800], Y.green[400], Y.green[300], Y.green[600], Y.green[75], Y.green[800], Y.green[10], Y.yellow[10], Y.yellow[800], Y.yellow[400], Y.yellow[300], Y.yellow[600], Y.yellow[75], Y.yellow[800], Y.yellow[10], Y.red[10], Y.red[800], Y.red[400], Y.red[300], Y.red[600], Y.red[75], Y.red[800], Y.red[10], Y.grey[0], Y.grey[1e3], Y.grey[10], Y.grey[950], Y.grey[100], Y.grey[900], Y.grey[300], Y.grey[800], Y.grey[400], Y.grey[700], Y.grey[600], Y.grey[600], Y.grey[700], Y.grey[400], Y.grey[800], Y.grey[300], Y.grey[900], Y.grey[100], Y.grey[950], Y.grey[10], Y.grey[1e3], Y.grey[0], Y.red[400], Y.red[300], Y.red[600], Y.red[100], Y.orange[400], Y.orange[300], Y.orange[600], Y.orange[100], Y.yellow[400], Y.yellow[300], Y.yellow[600], Y.yellow[100], Y.green[400], Y.green[300], Y.green[600], Y.green[100], Y.mint[400], Y.mint[300], Y.mint[600], Y.mint[100], Y.teal[400], Y.teal[300], Y.teal[600], Y.teal[100], Y.cyan[400], Y.cyan[300], Y.cyan[600], Y.cyan[100], Y.blue[400], Y.blue[300], Y.blue[600], Y.blue[100], Y.indigo[400], Y.indigo[300], Y.indigo[600], Y.indigo[100], Y.purple[400], Y.purple[300], Y.purple[600], Y.purple[100], Y.pink[400], Y.pink[300], Y.pink[600], Y.pink[100], Y.brown[400], Y.brown[300], Y.brown[600], Y.brown[100];
5976
+ Y.grey[0], Y.grey[990], Y.grey[10], Y.grey[950], Y.grey[50], Y.grey[900], Y.grey[10], Y.grey[990], Y.grey[0], Y.grey[950], Y.grey[10], Y.grey[900], Y.grey[10], Y.grey[900], Y.grey[50], Y.grey[900], Y.grey[100], Y.grey[800], Y["opacity-grey"][600], Y["opacity-grey"][300], Y["opacity-grey"][600], Y["opacity-grey"][300], Y["opacity-grey"][700], Y["opacity-grey"][200], Y["opacity-grey"][950], Y["opacity-grey"][990], Y.grey[1e3], Y.grey[0], Y.grey[500], Y.grey[400], Y.grey[400], Y.grey[500], Y.grey[400], Y.grey[400], Y.grey[0], Y.grey[1e3], Y.grey[100], Y.grey[700], Y["strong-blue"][600], Y["strong-blue"][300], Y["strong-blue"][400], Y["strong-blue"][500], Y["strong-blue"][600], Y["strong-blue"][600], Y["strong-blue"][50], Y["strong-blue"][950], Y["strong-blue"][950], Y["strong-blue"][50], Y.grey[100], Y.grey[700], Y.grey[1e3], Y.grey[0], Y.grey[900], Y.grey[100], Y.grey[0], Y.grey[1e3], Y.grey[100], Y.grey[700], Y["opacity-grey"][600], Y["opacity-grey"][300], Y["opacity-grey"][700], Y["opacity-grey"][200], Y["opacity-grey"][600], Y["opacity-grey"][300], Y["banana-yellow"][400], Y["banana-yellow"][400], Y["banana-yellow"][100], Y["banana-yellow"][100], Y["banana-yellow"][50], Y["banana-yellow"][50], Y["banana-yellow"][5], Y["banana-yellow"][5], Y["banana-yellow"][800], Y["banana-yellow"][400], Y["bright-coral"][400], Y["bright-coral"][400], Y["bright-coral"][100], Y["bright-coral"][100], Y["bright-coral"][50], Y["bright-coral"][50], Y["bright-coral"][5], Y["bright-coral"][5], Y["bright-coral"][600], Y["bright-coral"][400], Y["minty-blue"][400], Y["minty-blue"][400], Y["minty-blue"][100], Y["minty-blue"][100], Y["minty-blue"][50], Y["minty-blue"][50], Y["minty-blue"][5], Y["minty-blue"][5], Y["minty-blue"][800], Y["minty-blue"][400], Y.grey[300], Y.grey[600], Y.grey[50], Y.grey[900], Y.grey[100], Y.grey[800], Y.grey[100], Y.grey[700], Y.grey[10], Y.grey[900], Y.grey[5], Y.grey[990], Y.grey[0], Y.grey[1e3], Y.green[10], Y.green[800], Y.green[400], Y.green[300], Y.green[600], Y.green[75], Y.green[800], Y.green[10], Y.yellow[10], Y.yellow[800], Y.yellow[400], Y.yellow[300], Y.yellow[600], Y.yellow[75], Y.yellow[800], Y.yellow[10], Y.red[10], Y.red[800], Y.red[400], Y.red[300], Y.red[600], Y.red[75], Y.red[800], Y.red[10], Y.grey[0], Y.grey[1e3], Y.grey[10], Y.grey[950], Y.grey[100], Y.grey[900], Y.grey[300], Y.grey[800], Y.grey[400], Y.grey[700], Y.grey[600], Y.grey[600], Y.grey[700], Y.grey[400], Y.grey[800], Y.grey[300], Y.grey[900], Y.grey[100], Y.grey[950], Y.grey[10], Y.grey[1e3], Y.grey[0], Y.red[400], Y.red[300], Y.red[600], Y.red[100], Y.orange[400], Y.orange[300], Y.orange[600], Y.orange[100], Y.yellow[400], Y.yellow[300], Y.yellow[600], Y.yellow[100], Y.green[400], Y.green[300], Y.green[600], Y.green[100], Y.mint[400], Y.mint[300], Y.mint[600], Y.mint[100], Y.teal[400], Y.teal[300], Y.teal[600], Y.teal[100], Y.cyan[400], Y.cyan[300], Y.cyan[600], Y.cyan[100], Y.blue[400], Y.blue[300], Y.blue[600], Y.blue[100], Y.indigo[400], Y.indigo[300], Y.indigo[600], Y.indigo[100], Y.purple[400], Y.purple[300], Y.purple[600], Y.purple[100], Y.pink[400], Y.pink[300], Y.pink[600], Y.pink[100], Y.brown[400], Y.brown[300], Y.brown[600], Y.brown[100];
5976
5977
  //#endregion
5977
5978
  //#region src/forms/question-wrapper.tsx
5978
5979
  var Vn = ({ title: e, icon: t, description: n, image: r, children: i, onPrevious: a, onNext: o, onQuit: s, isValid: c, hasPreviousStep: l, hasNextStep: u }) => {
@@ -6146,7 +6147,14 @@ var Vn = ({ title: e, icon: t, description: n, image: r, children: i, onPrevious
6146
6147
  })]
6147
6148
  })
6148
6149
  });
6149
- }, Gn = ({ title: e, icon: t, description: n, image: r, children: i, wrapperClassName: a }) => /* @__PURE__ */ h("div", {
6150
+ }, Gn = (e) => {
6151
+ try {
6152
+ let { protocol: t } = new URL(e);
6153
+ return t === "http:" || t === "https:";
6154
+ } catch {
6155
+ return !1;
6156
+ }
6157
+ }, Kn = ({ title: e, icon: t, description: n, image: r, children: i, wrapperClassName: a }) => /* @__PURE__ */ h("div", {
6150
6158
  className: K("grid mx-4 my-8 rounded-xl border", "grid-cols-1 p-4 pt-10", "md:p-8 md:gap-16 md:max-w-[960px] md:min-w-[660px]", r ? "md:grid-cols-2" : "md:grid-cols-1", "border-separator-opaque-light dark:border-separator-opaque-dark material-ultra-thick", a),
6151
6159
  children: [/* @__PURE__ */ h("div", {
6152
6160
  className: "flex flex-col justify-between gap-6 md:gap-8 order-2 md:order-1",
@@ -6178,7 +6186,7 @@ var Vn = ({ title: e, icon: t, description: n, image: r, children: i, onPrevious
6178
6186
  })
6179
6187
  })
6180
6188
  })]
6181
- }), Kn = ({ title: e, icon: t, description: n, image: r, quitText: i, onQuit: a, externalLink: o }) => /* @__PURE__ */ h(Gn, {
6189
+ }), qn = ({ title: e, icon: t, description: n, image: r, quitText: i, onQuit: a, externalLink: o }) => /* @__PURE__ */ h(Kn, {
6182
6190
  title: e,
6183
6191
  icon: t,
6184
6192
  description: n,
@@ -6190,7 +6198,7 @@ var Vn = ({ title: e, icon: t, description: n, image: r, children: i, onPrevious
6190
6198
  text: i,
6191
6199
  iconAfter: /* @__PURE__ */ m(ft, {}),
6192
6200
  onClick: () => {
6193
- window.open(o, "_blank"), a();
6201
+ o && Gn(o) && window.open(o, "_blank", "noopener,noreferrer"), a();
6194
6202
  }
6195
6203
  }) : /* @__PURE__ */ m(q, {
6196
6204
  variant: "secondary",
@@ -6205,7 +6213,7 @@ var Vn = ({ title: e, icon: t, description: n, image: r, children: i, onPrevious
6205
6213
  iconAfter: /* @__PURE__ */ m(xt, {}),
6206
6214
  "aria-label": "quit"
6207
6215
  })]
6208
- }), qn = ({ title: e, icon: t, description: n, image: r, quitText: i, onQuit: a, startText: o, onStart: s }) => /* @__PURE__ */ h(Gn, {
6216
+ }), Jn = ({ title: e, icon: t, description: n, image: r, quitText: i, onQuit: a, startText: o, onStart: s }) => /* @__PURE__ */ h(Kn, {
6209
6217
  title: e,
6210
6218
  icon: t,
6211
6219
  description: n,
@@ -6230,16 +6238,16 @@ var Vn = ({ title: e, icon: t, description: n, image: r, children: i, onPrevious
6230
6238
  iconAfter: /* @__PURE__ */ m(xt, {}),
6231
6239
  "aria-label": "quit"
6232
6240
  })]
6233
- }), Jn = {};
6234
- function Yn() {
6235
- return Jn;
6241
+ }), Yn = {};
6242
+ function Xn() {
6243
+ return Yn;
6236
6244
  }
6237
- function Xn(e) {
6238
- Jn = e;
6245
+ function Zn(e) {
6246
+ Yn = e;
6239
6247
  }
6240
6248
  //#endregion
6241
6249
  //#region ../node_modules/date-fns/locale/en-US/_lib/formatDistance.js
6242
- var Zn = {
6250
+ var Qn = {
6243
6251
  lessThanXSeconds: {
6244
6252
  one: "less than a second",
6245
6253
  other: "less than {{count}} seconds"
@@ -6301,13 +6309,13 @@ var Zn = {
6301
6309
  one: "almost 1 year",
6302
6310
  other: "almost {{count}} years"
6303
6311
  }
6304
- }, Qn = (e, t, n) => {
6305
- let r, i = Zn[e];
6312
+ }, $n = (e, t, n) => {
6313
+ let r, i = Qn[e];
6306
6314
  return r = typeof i == "string" ? i : t === 1 ? i.one : i.other.replace("{{count}}", t.toString()), n?.addSuffix ? n.comparison && n.comparison > 0 ? "in " + r : r + " ago" : r;
6307
6315
  };
6308
6316
  //#endregion
6309
6317
  //#region ../node_modules/date-fns/locale/_lib/buildFormatLongFn.js
6310
- function $n(e) {
6318
+ function er(e) {
6311
6319
  return (t = {}) => {
6312
6320
  let n = t.width ? String(t.width) : e.defaultWidth;
6313
6321
  return e.formats[n] || e.formats[e.defaultWidth];
@@ -6315,14 +6323,14 @@ function $n(e) {
6315
6323
  }
6316
6324
  //#endregion
6317
6325
  //#region ../node_modules/date-fns/locale/en-US/_lib/formatRelative.js
6318
- var er = {
6326
+ var tr = {
6319
6327
  lastWeek: "'last' eeee 'at' p",
6320
6328
  yesterday: "'yesterday at' p",
6321
6329
  today: "'today at' p",
6322
6330
  tomorrow: "'tomorrow at' p",
6323
6331
  nextWeek: "eeee 'at' p",
6324
6332
  other: "P"
6325
- }, tr = (e, t, n, r) => er[e];
6333
+ }, nr = (e, t, n, r) => tr[e];
6326
6334
  //#endregion
6327
6335
  //#region ../node_modules/date-fns/locale/_lib/buildLocalizeFn.js
6328
6336
  function X(e) {
@@ -6339,7 +6347,7 @@ function X(e) {
6339
6347
  return i[a];
6340
6348
  };
6341
6349
  }
6342
- var nr = {
6350
+ var rr = {
6343
6351
  ordinalNumber: (e, t) => {
6344
6352
  let n = Number(e), r = n % 100;
6345
6353
  if (r > 20 || r < 10) switch (r % 10) {
@@ -6544,7 +6552,7 @@ function Z(e) {
6544
6552
  return (t, n = {}) => {
6545
6553
  let r = n.width, i = r && e.matchPatterns[r] || e.matchPatterns[e.defaultMatchWidth], a = t.match(i);
6546
6554
  if (!a) return null;
6547
- let o = a[0], s = r && e.parsePatterns[r] || e.parsePatterns[e.defaultParseWidth], c = Array.isArray(s) ? ir(s, (e) => e.test(o)) : rr(s, (e) => e.test(o)), l;
6555
+ let o = a[0], s = r && e.parsePatterns[r] || e.parsePatterns[e.defaultParseWidth], c = Array.isArray(s) ? ar(s, (e) => e.test(o)) : ir(s, (e) => e.test(o)), l;
6548
6556
  l = e.valueCallback ? e.valueCallback(c) : c, l = n.valueCallback ? n.valueCallback(l) : l;
6549
6557
  let u = t.slice(o.length);
6550
6558
  return {
@@ -6553,15 +6561,15 @@ function Z(e) {
6553
6561
  };
6554
6562
  };
6555
6563
  }
6556
- function rr(e, t) {
6564
+ function ir(e, t) {
6557
6565
  for (let n in e) if (Object.prototype.hasOwnProperty.call(e, n) && t(e[n])) return n;
6558
6566
  }
6559
- function ir(e, t) {
6567
+ function ar(e, t) {
6560
6568
  for (let n = 0; n < e.length; n++) if (t(e[n])) return n;
6561
6569
  }
6562
6570
  //#endregion
6563
6571
  //#region ../node_modules/date-fns/locale/_lib/buildMatchPatternFn.js
6564
- function ar(e) {
6572
+ function or(e) {
6565
6573
  return (t, n = {}) => {
6566
6574
  let r = t.match(e.matchPattern);
6567
6575
  if (!r) return null;
@@ -6576,8 +6584,8 @@ function ar(e) {
6576
6584
  };
6577
6585
  };
6578
6586
  }
6579
- var or = {
6580
- ordinalNumber: ar({
6587
+ var sr = {
6588
+ ordinalNumber: or({
6581
6589
  matchPattern: /^(\d+)(th|st|nd|rd)?/i,
6582
6590
  parsePattern: /\d+/i,
6583
6591
  valueCallback: (e) => parseInt(e, 10)
@@ -6698,19 +6706,19 @@ var or = {
6698
6706
  };
6699
6707
  //#endregion
6700
6708
  //#region ../node_modules/date-fns/setDefaultOptions.js
6701
- function sr(e) {
6702
- let t = {}, n = Yn();
6709
+ function cr(e) {
6710
+ let t = {}, n = Xn();
6703
6711
  for (let e in n) Object.prototype.hasOwnProperty.call(n, e) && (t[e] = n[e]);
6704
6712
  for (let n in e) Object.prototype.hasOwnProperty.call(e, n) && (e[n] === void 0 ? delete t[n] : t[n] = e[n]);
6705
- Xn(t);
6713
+ Zn(t);
6706
6714
  }
6707
6715
  //#endregion
6708
6716
  //#region ../node_modules/date-fns/locale/en-GB.js
6709
- var cr = {
6717
+ var lr = {
6710
6718
  code: "en-GB",
6711
- formatDistance: Qn,
6719
+ formatDistance: $n,
6712
6720
  formatLong: {
6713
- date: $n({
6721
+ date: er({
6714
6722
  formats: {
6715
6723
  full: "EEEE, d MMMM yyyy",
6716
6724
  long: "d MMMM yyyy",
@@ -6719,7 +6727,7 @@ var cr = {
6719
6727
  },
6720
6728
  defaultWidth: "full"
6721
6729
  }),
6722
- time: $n({
6730
+ time: er({
6723
6731
  formats: {
6724
6732
  full: "HH:mm:ss zzzz",
6725
6733
  long: "HH:mm:ss z",
@@ -6728,7 +6736,7 @@ var cr = {
6728
6736
  },
6729
6737
  defaultWidth: "full"
6730
6738
  }),
6731
- dateTime: $n({
6739
+ dateTime: er({
6732
6740
  formats: {
6733
6741
  full: "{{date}} 'at' {{time}}",
6734
6742
  long: "{{date}} 'at' {{time}}",
@@ -6738,20 +6746,20 @@ var cr = {
6738
6746
  defaultWidth: "full"
6739
6747
  })
6740
6748
  },
6741
- formatRelative: tr,
6742
- localize: nr,
6743
- match: or,
6749
+ formatRelative: nr,
6750
+ localize: rr,
6751
+ match: sr,
6744
6752
  options: {
6745
6753
  weekStartsOn: 1,
6746
6754
  firstWeekContainsDate: 4
6747
6755
  }
6748
- }, { slice: lr, forEach: ur } = [];
6749
- function dr(e) {
6750
- return ur.call(lr.call(arguments, 1), (t) => {
6756
+ }, { slice: ur, forEach: dr } = [];
6757
+ function fr(e) {
6758
+ return dr.call(ur.call(arguments, 1), (t) => {
6751
6759
  if (t) for (let n in t) e[n] === void 0 && (e[n] = t[n]);
6752
6760
  }), e;
6753
6761
  }
6754
- function fr(e) {
6762
+ function pr(e) {
6755
6763
  return typeof e == "string" ? [
6756
6764
  /<\s*script.*?>/i,
6757
6765
  /<\s*\/\s*script\s*>/i,
@@ -6768,7 +6776,7 @@ function fr(e) {
6768
6776
  /innerHTML/i
6769
6777
  ].some((t) => t.test(e)) : !1;
6770
6778
  }
6771
- var pr = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/, mr = function(e, t) {
6779
+ var mr = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/, hr = function(e, t) {
6772
6780
  let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : { path: "/" }, r = `${e}=${encodeURIComponent(t)}`;
6773
6781
  if (n.maxAge > 0) {
6774
6782
  let e = n.maxAge - 0;
@@ -6776,11 +6784,11 @@ var pr = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/, mr = function(e, t) {
6776
6784
  r += `; Max-Age=${Math.floor(e)}`;
6777
6785
  }
6778
6786
  if (n.domain) {
6779
- if (!pr.test(n.domain)) throw TypeError("option domain is invalid");
6787
+ if (!mr.test(n.domain)) throw TypeError("option domain is invalid");
6780
6788
  r += `; Domain=${n.domain}`;
6781
6789
  }
6782
6790
  if (n.path) {
6783
- if (!pr.test(n.path)) throw TypeError("option path is invalid");
6791
+ if (!mr.test(n.path)) throw TypeError("option path is invalid");
6784
6792
  r += `; Path=${n.path}`;
6785
6793
  }
6786
6794
  if (n.expires) {
@@ -6803,13 +6811,13 @@ var pr = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/, mr = function(e, t) {
6803
6811
  default: throw TypeError("option sameSite is invalid");
6804
6812
  }
6805
6813
  return n.partitioned && (r += "; Partitioned"), r;
6806
- }, hr = {
6814
+ }, gr = {
6807
6815
  create(e, t, n, r) {
6808
6816
  let i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
6809
6817
  path: "/",
6810
6818
  sameSite: "strict"
6811
6819
  };
6812
- n && (i.expires = /* @__PURE__ */ new Date(), i.expires.setTime(i.expires.getTime() + n * 60 * 1e3)), r && (i.domain = r), document.cookie = mr(e, t, i);
6820
+ n && (i.expires = /* @__PURE__ */ new Date(), i.expires.setTime(i.expires.getTime() + n * 60 * 1e3)), r && (i.domain = r), document.cookie = hr(e, t, i);
6813
6821
  },
6814
6822
  read(e) {
6815
6823
  let t = `${e}=`, n = document.cookie.split(";");
@@ -6823,17 +6831,17 @@ var pr = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/, mr = function(e, t) {
6823
6831
  remove(e, t) {
6824
6832
  this.create(e, "", -1, t);
6825
6833
  }
6826
- }, gr = {
6834
+ }, _r = {
6827
6835
  name: "cookie",
6828
6836
  lookup(e) {
6829
6837
  let { lookupCookie: t } = e;
6830
- if (t && typeof document < "u") return hr.read(t) || void 0;
6838
+ if (t && typeof document < "u") return gr.read(t) || void 0;
6831
6839
  },
6832
6840
  cacheUserLanguage(e, t) {
6833
6841
  let { lookupCookie: n, cookieMinutes: r, cookieDomain: i, cookieOptions: a } = t;
6834
- n && typeof document < "u" && hr.create(n, e, r, i, a);
6842
+ n && typeof document < "u" && gr.create(n, e, r, i, a);
6835
6843
  }
6836
- }, _r = {
6844
+ }, vr = {
6837
6845
  name: "querystring",
6838
6846
  lookup(e) {
6839
6847
  let { lookupQuerystring: t } = e, n;
@@ -6848,7 +6856,7 @@ var pr = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/, mr = function(e, t) {
6848
6856
  }
6849
6857
  return n;
6850
6858
  }
6851
- }, vr = {
6859
+ }, yr = {
6852
6860
  name: "hash",
6853
6861
  lookup(e) {
6854
6862
  let { lookupHash: t, lookupFromHashIndex: n } = e, r;
@@ -6872,7 +6880,7 @@ var pr = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/, mr = function(e, t) {
6872
6880
  }
6873
6881
  return r;
6874
6882
  }
6875
- }, Q = null, yr = () => {
6883
+ }, Q = null, br = () => {
6876
6884
  if (Q !== null) return Q;
6877
6885
  try {
6878
6886
  if (Q = typeof window < "u" && window.localStorage !== null, !Q) return !1;
@@ -6882,17 +6890,17 @@ var pr = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/, mr = function(e, t) {
6882
6890
  Q = !1;
6883
6891
  }
6884
6892
  return Q;
6885
- }, br = {
6893
+ }, xr = {
6886
6894
  name: "localStorage",
6887
6895
  lookup(e) {
6888
6896
  let { lookupLocalStorage: t } = e;
6889
- if (t && yr()) return window.localStorage.getItem(t) || void 0;
6897
+ if (t && br()) return window.localStorage.getItem(t) || void 0;
6890
6898
  },
6891
6899
  cacheUserLanguage(e, t) {
6892
6900
  let { lookupLocalStorage: n } = t;
6893
- n && yr() && window.localStorage.setItem(n, e);
6901
+ n && br() && window.localStorage.setItem(n, e);
6894
6902
  }
6895
- }, $ = null, xr = () => {
6903
+ }, $ = null, Sr = () => {
6896
6904
  if ($ !== null) return $;
6897
6905
  try {
6898
6906
  if ($ = typeof window < "u" && window.sessionStorage !== null, !$) return !1;
@@ -6902,17 +6910,17 @@ var pr = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/, mr = function(e, t) {
6902
6910
  $ = !1;
6903
6911
  }
6904
6912
  return $;
6905
- }, Sr = {
6913
+ }, Cr = {
6906
6914
  name: "sessionStorage",
6907
6915
  lookup(e) {
6908
6916
  let { lookupSessionStorage: t } = e;
6909
- if (t && xr()) return window.sessionStorage.getItem(t) || void 0;
6917
+ if (t && Sr()) return window.sessionStorage.getItem(t) || void 0;
6910
6918
  },
6911
6919
  cacheUserLanguage(e, t) {
6912
6920
  let { lookupSessionStorage: n } = t;
6913
- n && xr() && window.sessionStorage.setItem(n, e);
6921
+ n && Sr() && window.sessionStorage.setItem(n, e);
6914
6922
  }
6915
- }, Cr = {
6923
+ }, wr = {
6916
6924
  name: "navigator",
6917
6925
  lookup(e) {
6918
6926
  let t = [];
@@ -6923,13 +6931,13 @@ var pr = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/, mr = function(e, t) {
6923
6931
  }
6924
6932
  return t.length > 0 ? t : void 0;
6925
6933
  }
6926
- }, wr = {
6934
+ }, Tr = {
6927
6935
  name: "htmlTag",
6928
6936
  lookup(e) {
6929
6937
  let { htmlTag: t } = e, n, r = t || (typeof document < "u" ? document.documentElement : null);
6930
6938
  return r && typeof r.getAttribute == "function" && (n = r.getAttribute("lang")), n;
6931
6939
  }
6932
- }, Tr = {
6940
+ }, Er = {
6933
6941
  name: "path",
6934
6942
  lookup(e) {
6935
6943
  let { lookupFromPathIndex: t } = e;
@@ -6937,17 +6945,17 @@ var pr = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/, mr = function(e, t) {
6937
6945
  let n = window.location.pathname.match(/\/([a-zA-Z-]*)/g);
6938
6946
  if (Array.isArray(n)) return n[typeof t == "number" ? t : 0]?.replace("/", "");
6939
6947
  }
6940
- }, Er = {
6948
+ }, Dr = {
6941
6949
  name: "subdomain",
6942
6950
  lookup(e) {
6943
6951
  let { lookupFromSubdomainIndex: t } = e, n = typeof t == "number" ? t + 1 : 1, r = typeof window < "u" && window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);
6944
6952
  if (r) return r[n];
6945
6953
  }
6946
- }, Dr = !1;
6954
+ }, Or = !1;
6947
6955
  try {
6948
- document.cookie, Dr = !0;
6956
+ document.cookie, Or = !0;
6949
6957
  } catch {}
6950
- var Or = [
6958
+ var kr = [
6951
6959
  "querystring",
6952
6960
  "cookie",
6953
6961
  "localStorage",
@@ -6955,9 +6963,9 @@ var Or = [
6955
6963
  "navigator",
6956
6964
  "htmlTag"
6957
6965
  ];
6958
- Dr || Or.splice(1, 1);
6959
- var kr = () => ({
6960
- order: Or,
6966
+ Or || kr.splice(1, 1);
6967
+ var Ar = () => ({
6968
+ order: kr,
6961
6969
  lookupQuerystring: "lng",
6962
6970
  lookupCookie: "i18next",
6963
6971
  lookupLocalStorage: "i18nextLng",
@@ -6965,14 +6973,14 @@ var kr = () => ({
6965
6973
  caches: ["localStorage"],
6966
6974
  excludeCacheFor: ["cimode"],
6967
6975
  convertDetectedLanguage: (e) => e
6968
- }), Ar = class {
6976
+ }), jr = class {
6969
6977
  constructor(e) {
6970
6978
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
6971
6979
  this.type = "languageDetector", this.detectors = {}, this.init(e, t);
6972
6980
  }
6973
6981
  init() {
6974
6982
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : { languageUtils: {} }, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
6975
- this.services = e, this.options = dr(t, this.options || {}, kr()), typeof this.options.convertDetectedLanguage == "string" && this.options.convertDetectedLanguage.indexOf("15897") > -1 && (this.options.convertDetectedLanguage = (e) => e.replace("-", "_")), this.options.lookupFromUrlIndex && (this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex), this.i18nOptions = n, this.addDetector(gr), this.addDetector(_r), this.addDetector(br), this.addDetector(Sr), this.addDetector(Cr), this.addDetector(wr), this.addDetector(Tr), this.addDetector(Er), this.addDetector(vr);
6983
+ this.services = e, this.options = fr(t, this.options || {}, Ar()), typeof this.options.convertDetectedLanguage == "string" && this.options.convertDetectedLanguage.indexOf("15897") > -1 && (this.options.convertDetectedLanguage = (e) => e.replace("-", "_")), this.options.lookupFromUrlIndex && (this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex), this.i18nOptions = n, this.addDetector(_r), this.addDetector(vr), this.addDetector(xr), this.addDetector(Cr), this.addDetector(wr), this.addDetector(Tr), this.addDetector(Er), this.addDetector(Dr), this.addDetector(yr);
6976
6984
  }
6977
6985
  addDetector(e) {
6978
6986
  return this.detectors[e.name] = e, this;
@@ -6984,7 +6992,7 @@ var kr = () => ({
6984
6992
  let n = this.detectors[e].lookup(this.options);
6985
6993
  n && typeof n == "string" && (n = [n]), n && (t = t.concat(n));
6986
6994
  }
6987
- }), t = t.filter((e) => e != null && !fr(e)).map((e) => this.options.convertDetectedLanguage(e)), this.services && this.services.languageUtils && this.services.languageUtils.getBestMatchFromCodes ? t : t.length > 0 ? t[0] : null;
6995
+ }), t = t.filter((e) => e != null && !pr(e)).map((e) => this.options.convertDetectedLanguage(e)), this.services && this.services.languageUtils && this.services.languageUtils.getBestMatchFromCodes ? t : t.length > 0 ? t[0] : null;
6988
6996
  }
6989
6997
  cacheUserLanguage(e) {
6990
6998
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.options.caches;
@@ -6993,7 +7001,7 @@ var kr = () => ({
6993
7001
  }));
6994
7002
  }
6995
7003
  };
6996
- Ar.type = "languageDetector", sr({ locale: cr }), z.use(Ar).use(Ke).init({
7004
+ jr.type = "languageDetector", cr({ locale: lr }), z.use(jr).use(Ke).init({
6997
7005
  debug: e.debug,
6998
7006
  fallbackLng: "en",
6999
7007
  interpolation: { escapeValue: !1 },
@@ -7009,12 +7017,12 @@ Ar.type = "languageDetector", sr({ locale: cr }), z.use(Ar).use(Ke).init({
7009
7017
  nb: { tranlation: {} }
7010
7018
  }
7011
7019
  });
7012
- var jr = z, Mr = class extends Error {
7020
+ var Mr = z, Nr = class extends Error {
7013
7021
  errorType;
7014
7022
  constructor(e, t) {
7015
7023
  super(t), this.name = "FormError", this.errorType = e;
7016
7024
  }
7017
- }, Nr = /* @__PURE__ */ v({ FormManager: () => Pr }), Pr = class {
7025
+ }, Pr = /* @__PURE__ */ v({ FormManager: () => Fr }), Fr = class {
7018
7026
  logger;
7019
7027
  headers;
7020
7028
  http;
@@ -7027,13 +7035,13 @@ var jr = z, Mr = class extends Error {
7027
7035
  try {
7028
7036
  let r = await this.http.get(`/external/forms/${e}`, { headers: this.headers });
7029
7037
  if (!r.ok && this.config.onFormError) {
7030
- let e = new Mr("FETCH_ERROR", r.error?.message);
7038
+ let e = new Nr("FETCH_ERROR", r.error?.message);
7031
7039
  this.config.onFormError(e);
7032
7040
  }
7033
7041
  r.ok && r.data ? (this.logger.info(`Form config loaded for: ${e}`, r.data), this.displayForm(r.data, t, n)) : this.logger.warn(`No form config found for: ${e}`);
7034
7042
  } catch (t) {
7035
7043
  if (this.logger.error(`Failed to fetch form config for: ${e}`, t), this.config.onFormError) {
7036
- let e = new Mr("FETCH_ERROR");
7044
+ let e = new Nr("FETCH_ERROR");
7037
7045
  this.config.onFormError(e);
7038
7046
  }
7039
7047
  }
@@ -7041,7 +7049,7 @@ var jr = z, Mr = class extends Error {
7041
7049
  displayForm(e, t, n) {
7042
7050
  let r = document.createElement("div");
7043
7051
  r.id = "nm", document.body.appendChild(r);
7044
- let a = g(r), o = i(Qe, { i18n: jr }, i(et, {
7052
+ let a = g(r), o = i(Qe, { i18n: Mr }, i(et, {
7045
7053
  form: e,
7046
7054
  onDismiss: async (e) => {
7047
7055
  await t(), a.unmount(), r.remove(), this.logger.info("Form dismissed", e);
@@ -7057,12 +7065,12 @@ var jr = z, Mr = class extends Error {
7057
7065
  this.logger.info("Posting form response", t);
7058
7066
  let n = await this.http.post(`/external/forms/${e.slug}`, t, { headers: this.headers });
7059
7067
  if (!n.ok && this.config.onFormError) {
7060
- let e = new Mr("SUBMISSION_ERROR", n.error?.message);
7068
+ let e = new Nr("SUBMISSION_ERROR", n.error?.message);
7061
7069
  this.config.onFormError(e);
7062
7070
  } else this.logger.info("Form response posted", n.data);
7063
7071
  }
7064
7072
  };
7065
7073
  //#endregion
7066
- export { Nr as n, Mr as r, Pr as t };
7074
+ export { Pr as n, Nr as r, Fr as t };
7067
7075
 
7068
- //# sourceMappingURL=form-manager-BqtPAs-A.js.map
7076
+ //# sourceMappingURL=form-manager-Dit5tdsl.js.map