@sprig-technologies/sprig-browser 2.40.1 → 2.40.2

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,7 +1,7 @@
1
- import { a as A, u as e, h as $, c as L, b as j, e as J, f as fe, p as te, F as oe, _ as K, T as le, A as Ve, g as ke, i as Fe, j as Ze, k as Ye, w as Re, l as ze } from "./view-Cu1EeVuN.js";
2
- import { v as Ke, R as V, B as X, M as z, Q as re, O as xe, a as W, b as ue, S as Xe, L as We, u as Je, H as ce, c as Ce, g as et, P as tt, p as rt, d as nt, s as st } from "./getAttributedUrl-C8OLV7E9.js";
3
- import { a as ve, D as Te, A as _e, g as at } from "./core-swSxd_ys.js";
4
- import { t as Le } from "./metricsReporter-D0NmprYW.js";
1
+ import { a as A, u as e, h as $, c as L, b as j, e as J, f as fe, p as te, F as oe, _ as K, T as le, A as Ve, g as ke, i as Fe, j as Ze, k as Ye, w as Re, l as ze } from "./view-BGlLLPXB.js";
2
+ import { v as Ke, R as V, B as X, M as z, Q as re, O as xe, a as W, b as ue, S as Xe, L as We, u as Je, H as ce, c as Ce, g as et, P as tt, p as rt, d as nt, s as st } from "./getAttributedUrl-C_5gL6aZ.js";
3
+ import { a as ve, D as Te, A as _e, g as at } from "./core-Cyu7gofl.js";
4
+ import { t as Le } from "./metricsReporter-B-oKhuWk.js";
5
5
  const it = ({ properties: t, surveyVideoUrl: s, questionId: r }) => {
6
6
  const n = `ul-card-video__question_player-q${r}`, { apiURL: a, viewDocument: i } = A((o) => ({ apiURL: o.apiURL, viewDocument: o.viewDocument }));
7
7
  return e("div", { id: n, ref: (o) => {
@@ -11,24 +11,24 @@ const it = ({ properties: t, surveyVideoUrl: s, questionId: r }) => {
11
11
  }
12
12
  } });
13
13
  }, se = ({ isDisabled: t, onClick: s, children: r }) => e(X, { className: "ul-card__button-checkmark", disabled: t, onClick: s, type: "button", children: [e("svg", { fill: "none", height: "10", viewBox: "0 0 13 10", width: "13", xmlns: "http://www.w3.org/2000/svg", children: e("path", { d: "M11.5 1.5L4.5 8.5L1 5", stroke: "#ffffff", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.5" }) }), r || "Ok"] }), lt = ({ className: t, next: s, properties: r, questionId: n, type: a }) => {
14
- const { useMobileStyling: i, border: o } = A((k) => ({ useMobileStyling: k.useMobileStyling, border: k.border })), [d, c] = $(!1), [m, h] = $(""), [l, u] = $(!1), y = r == null ? void 0 : r.collectName, f = (r == null ? void 0 : r.nameLabelText) || "Full Name", p = (r == null ? void 0 : r.consentText) || "I agree to the stated conditions", C = (r == null ? void 0 : r.submitButtonText) || "Submit", w = !!m.trim(), v = d && (!y || w), T = (k, q = !1) => {
15
- k.preventDefault(), k.stopPropagation();
16
- let D = null;
17
- if (!q) {
18
- if (!v) return void u(!0);
19
- D = { submitted: !0 }, y && (D.name = m);
14
+ const { useMobileStyling: i, border: o } = A((g) => ({ useMobileStyling: g.useMobileStyling, border: g.border })), [d, c] = $(!1), [m, h] = $(""), [l, u] = $(!1), y = r == null ? void 0 : r.collectName, x = (r == null ? void 0 : r.nameLabelText) || "Full Name", p = (r == null ? void 0 : r.consentText) || "I agree to the stated conditions", T = (r == null ? void 0 : r.submitButtonText) || "Submit", D = !!m.trim(), R = d && (!y || D), f = (g, w = !1) => {
15
+ g.preventDefault(), g.stopPropagation();
16
+ let I = null;
17
+ if (!w) {
18
+ if (!R) return void u(!0);
19
+ I = { submitted: !0 }, y && (I.name = m);
20
20
  }
21
- s({ value: D, questionId: n, type: a }, !!q || v);
21
+ s({ value: I, questionId: n, type: a }, !!w || R);
22
22
  };
23
- return e("div", { className: L(t, "ul-card__consent-legal", "fade-in-transition"), children: e(z, { embeddedType: "pdf", properties: r, children: e(re, { children: [e("div", { className: "sprig-stretch", children: [e(xe, { allowTextEntry: !1, border: o, error: l && !d, id: "consent", isRadio: !1, isSelected: d, label: p, onUserInputChanged: ({ selected: k }) => {
24
- k !== d && c(!d);
25
- }, useMobileStyling: i }), y && e("input", { "aria-label": f, "aria-placeholder": f, className: L(j("ul-consent-legal__name-input", i)), "data-gramm": "false", maxLength: 250, name: "name", onBlur: (k) => {
26
- k.currentTarget.style.borderColor = l && !w ? ve : Te;
27
- }, onFocus: (k) => {
28
- k.currentTarget.style.borderColor = l && !w ? ve : o;
29
- }, onInput: (k) => {
30
- k.preventDefault(), k.stopPropagation(), h(k.currentTarget.value);
31
- }, placeholder: f, style: l && !w ? { borderColor: ve } : {}, tabIndex: 0, value: m })] }), e("div", { className: "ul-card__button-wrapper ul-card-vertical__button-wrapper", children: [e(se, { isDisabled: !v, onClick: (k) => T(new SubmitEvent(k.type)), children: J({ buttonText: C }) }), r.required === !1 && e("button", { className: "ul-card-skip__button", onClick: (k) => T(new SubmitEvent(k.type), !0), children: fe(r) })] })] }) }) }, n);
23
+ return e("div", { className: L(t, "ul-card__consent-legal", "fade-in-transition"), children: e(z, { embeddedType: "pdf", properties: r, children: e(re, { children: [e("div", { className: "sprig-stretch", children: [e(xe, { allowTextEntry: !1, border: o, error: l && !d, id: "consent", isRadio: !1, isSelected: d, label: p, onUserInputChanged: ({ selected: g }) => {
24
+ g !== d && c(!d);
25
+ }, useMobileStyling: i }), y && e("input", { "aria-label": x, "aria-placeholder": x, className: L(j("ul-consent-legal__name-input", i)), "data-gramm": "false", maxLength: 250, name: "name", onBlur: (g) => {
26
+ g.currentTarget.style.borderColor = l && !D ? ve : Te;
27
+ }, onFocus: (g) => {
28
+ g.currentTarget.style.borderColor = l && !D ? ve : o;
29
+ }, onInput: (g) => {
30
+ g.preventDefault(), g.stopPropagation(), h(g.currentTarget.value);
31
+ }, placeholder: x, style: l && !D ? { borderColor: ve } : {}, tabIndex: 0, value: m })] }), e("div", { className: "ul-card__button-wrapper ul-card-vertical__button-wrapper", children: [e(se, { isDisabled: !R, onClick: (g) => f(new SubmitEvent(g.type)), children: J({ buttonText: T }) }), r.required === !1 && e("button", { className: "ul-card-skip__button", onClick: (g) => f(new SubmitEvent(g.type), !0), children: fe(r) })] })] }) }) }, n);
32
32
  }, ot = () => {
33
33
  const { destroy: t, forceBrandedLogo: s } = A((r) => ({ destroy: r.destroy, forceBrandedLogo: r.forceBrandedLogo }));
34
34
  return te(() => {
@@ -37,18 +37,18 @@ const it = ({ properties: t, surveyVideoUrl: s, questionId: r }) => {
37
37
  }, s ? 4e3 : 2e3);
38
38
  }, [t, s]), e("div", { className: "end-of-survey-text", children: "End of survey" });
39
39
  }, ct = ({ activeValue: t, border: s, icon: r, enableCspTrustedTypes: n, isPressed: a, range: i, scaleLabelType: o, selectedValue: d, setSelectedValue: c, setActiveValue: m, setIsPressed: h, useMobileStyling: l, value: u, viewDocument: y }) => {
40
- const f = `option-${u}`, p = o === "number", C = o === "star", w = o === "smiley", v = p && u === t || u === d, [T, k] = (() => {
41
- const _ = C && d !== null && u <= d;
42
- return C && u <= t || w && u === t || _ || u === t || u === d ? [s, a || _ || u === d ? 1 : 0.3] : ["", 1];
43
- })(), q = oe(() => {
44
- const _ = { borderColor: v ? T : "", fillOpacity: v ? "" : k, zIndex: v ? 3 : "auto", color: d === u ? "#fff" : "" };
45
- return p ? { ..._, backgroundColor: d === u ? T : "" } : { ..._, color: C || w || d === u ? T : "" };
46
- }, [v, T, k, d, u, p, C, w]), D = oe(() => at((({ icon: _, scaleLabelType: b, value: S, selectedValue: g }) => {
47
- if (b === "smiley" && S === g) {
48
- let N = 0;
49
- return _.replace(/black/g, () => ++N == 1 ? "black" : "white");
40
+ const x = `option-${u}`, p = o === "number", T = o === "star", D = o === "smiley", R = p && u === t || u === d, [f, g] = (() => {
41
+ const k = T && d !== null && u <= d;
42
+ return T && u <= t || D && u === t || k || u === t || u === d ? [s, a || k || u === d ? 1 : 0.3] : ["", 1];
43
+ })(), w = oe(() => {
44
+ const k = { borderColor: R ? f : "", fillOpacity: R ? "" : g, zIndex: R ? 3 : "auto", color: d === u ? "#fff" : "" };
45
+ return p ? { ...k, backgroundColor: d === u ? f : "" } : { ...k, color: T || D || d === u ? f : "" };
46
+ }, [R, f, g, d, u, p, T, D]), I = oe(() => at((({ icon: k, scaleLabelType: b, value: S, selectedValue: v }) => {
47
+ if (b === "smiley" && S === v) {
48
+ let _ = 0;
49
+ return k.replace(/black/g, () => ++_ == 1 ? "black" : "white");
50
50
  }
51
- return _;
51
+ return k;
52
52
  })({ icon: r, scaleLabelType: o, value: u, selectedValue: d }), n), [n, r, o, d, u]);
53
53
  return e("button", { "aria-label": p ? void 0 : String(u), className: (() => {
54
54
  switch (o) {
@@ -59,68 +59,68 @@ const it = ({ properties: t, surveyVideoUrl: s, questionId: r }) => {
59
59
  default:
60
60
  return u === i ? L(j("likert-number", l), j(`likert-number-${u}`, l), j("likert-last-option", l)) : L(j("likert-number", l), j(`likert-number-${u}`, l));
61
61
  }
62
- })(), dangerouslySetInnerHTML: { __html: D }, id: f, onClick: (_) => {
63
- _.preventDefault(), _.stopPropagation(), c(u);
64
- }, onKeyDown: (_) => {
65
- var g, N;
62
+ })(), dangerouslySetInnerHTML: { __html: I }, id: x, onClick: (k) => {
63
+ k.preventDefault(), k.stopPropagation(), c(u);
64
+ }, onKeyDown: (k) => {
65
+ var v, _;
66
66
  const b = y.querySelectorAll(`.likert-${o ?? "number"}`), S = u - 1;
67
- _.key === "ArrowRight" ? (g = b[S + 1]) == null || g.focus() : _.key === "ArrowLeft" ? (N = b[S - 1]) == null || N.focus() : _.key !== "Enter" && _.key !== " " || (_.preventDefault(), _.stopPropagation(), c(u));
67
+ k.key === "ArrowRight" ? (v = b[S + 1]) == null || v.focus() : k.key === "ArrowLeft" ? (_ = b[S - 1]) == null || _.focus() : k.key !== "Enter" && k.key !== " " || (k.preventDefault(), k.stopPropagation(), c(u));
68
68
  }, onPointerDown: () => h(!0), onPointerEnter: () => m(u), onPointerLeave: () => {
69
69
  m(-1), h(!1);
70
- }, style: q, tabIndex: 0 });
70
+ }, style: w, tabIndex: 0 });
71
71
  }, dt = ({ className: t, labels: s, next: r, properties: n, questionId: a, type: i }) => {
72
- const { border: o, useMobileStyling: d, viewDocument: c, enableCspTrustedTypes: m } = A((b) => ({ border: b.border, useMobileStyling: b.useMobileStyling, viewDocument: b.viewDocument, enableCspTrustedTypes: b.enableCspTrustedTypes })), [h, l] = $(-1), [u, y] = $(!1), [f, p] = $(null), C = s && s.left, w = s && s.right;
73
- let v;
74
- const { range: T, scaleLabelType: k, ratingIcons: q } = n;
75
- T && (v = Number(T));
76
- const D = v || 5, _ = (b) => {
77
- var S, g;
78
- switch (k) {
72
+ const { border: o, useMobileStyling: d, viewDocument: c, enableCspTrustedTypes: m } = A((b) => ({ border: b.border, useMobileStyling: b.useMobileStyling, viewDocument: b.viewDocument, enableCspTrustedTypes: b.enableCspTrustedTypes })), [h, l] = $(-1), [u, y] = $(!1), [x, p] = $(null), T = s && s.left, D = s && s.right;
73
+ let R;
74
+ const { range: f, scaleLabelType: g, ratingIcons: w } = n;
75
+ f && (R = Number(f));
76
+ const I = R || 5, k = (b) => {
77
+ var S, v;
78
+ switch (g) {
79
79
  case "star":
80
- return (S = q[0]) == null ? void 0 : S.svg;
80
+ return (S = w[0]) == null ? void 0 : S.svg;
81
81
  case "smiley":
82
- return (g = q[b]) == null ? void 0 : g.svg;
82
+ return (v = w[b]) == null ? void 0 : v.svg;
83
83
  default:
84
84
  return String(b + 1);
85
85
  }
86
86
  };
87
- return e("form", { className: L(t, "ul-card--likert", "fade-in-transition"), children: e(z, { properties: n, children: [e(W, { children: [e("div", { "aria-label": `Rating (1 - ${D})`, className: "ul-card--likert__numbers", role: "radiogroup", children: [...Array(D)].map((b, S) => {
88
- const g = S + 1;
89
- return e(ct, { activeValue: h, border: o, enableCspTrustedTypes: m, icon: _(S), isPressed: u, range: D, scaleLabelType: k, selectedValue: f, setActiveValue: l, setIsPressed: y, setSelectedValue: p, useMobileStyling: d, value: g, viewDocument: c }, S);
90
- }) }), e("div", { className: "ul-card--likert__labels", children: [e("span", { children: C }), e("span", { children: w })] })] }), e(re, { children: e(se, { isDisabled: f === null && n.required, onClick: () => r({ value: f, questionId: a, type: i }, !0), children: J(n) }) })] }) }, a);
87
+ return e("form", { className: L(t, "ul-card--likert", "fade-in-transition"), children: e(z, { properties: n, children: [e(W, { children: [e("div", { "aria-label": `Rating (1 - ${I})`, className: "ul-card--likert__numbers", role: "radiogroup", children: [...Array(I)].map((b, S) => {
88
+ const v = S + 1;
89
+ return e(ct, { activeValue: h, border: o, enableCspTrustedTypes: m, icon: k(S), isPressed: u, range: I, scaleLabelType: g, selectedValue: x, setActiveValue: l, setIsPressed: y, setSelectedValue: p, useMobileStyling: d, value: v, viewDocument: c }, S);
90
+ }) }), e("div", { className: "ul-card--likert__labels", children: [e("span", { children: T }), e("span", { children: D })] })] }), e(re, { children: e(se, { isDisabled: x === null && n.required, onClick: () => r({ value: x, questionId: a, type: i }, !0), children: J(n) }) })] }) }, a);
91
91
  }, ut = ({ columns: t, onSelect: s, options: r, selectedOptions: n }) => {
92
92
  const a = K([]), { border: i, useMobileStyling: o } = A((u) => ({ border: u.border, useMobileStyling: u.useMobileStyling })), d = r.findIndex((u) => n[u.id] === null), [c, m] = $(d), h = le((u, y) => {
93
93
  s(u, y);
94
- const f = c + 1, p = r[f];
95
- p && n[p.id] === null && m(f);
94
+ const x = c + 1, p = r[x];
95
+ p && n[p.id] === null && m(x);
96
96
  }, [s, r, n, c]), l = le((u, y) => {
97
- const f = c === u;
98
- return e(Ve, { animate: !0, header: y.label, isOpen: f, onClick: () => {
97
+ const x = c === u;
98
+ return e(Ve, { animate: !0, header: y.label, isOpen: x, onClick: () => {
99
99
  var p;
100
- return m(f && !((p = window.UserLeap) != null && p.isMobileSDK) ? -1 : u);
100
+ return m(x && !((p = window.UserLeap) != null && p.isMobileSDK) ? -1 : u);
101
101
  }, ref: (p) => {
102
102
  p && (a.current[u] = p);
103
103
  }, showHeaderCheck: n[y.id] !== null, children: e("div", { style: { paddingTop: "12px" }, children: t.map((p) => e(xe, { allowTextEntry: !1, ariaLabel: `${y.label}-${p.label}`, border: i, error: !1, id: `${y.id}-${p.value}`, isRadio: !0, isSelected: n[y.id] === p.value, label: p.label, onUserInputChanged: () => h(y.id, p.value), useMobileStyling: o }, p.label)) }) }, y.id);
104
104
  }, [i, t, c, h, n, o]);
105
105
  return e("div", { children: r.map((u, y) => l(y, u)) });
106
106
  }, pt = ({ className: t, next: s, options: r, properties: n, questionId: a, type: i, onSubmitButtonClick: o }) => {
107
- const d = n.matrixColumn, c = n.required, m = (f) => {
108
- f.preventDefault(), f.stopPropagation(), s({ value: l, questionId: a, type: i }, !0), o && o();
109
- }, h = r.reduce((f, p) => (f[p.id] = null, f), {}), [l, u] = $(h);
110
- return e("form", { className: L(t, "ul-card__matrix", "fade-in-transition"), id: "text-form", onSubmit: m, children: e(z, { properties: n, children: [e(W, { children: e(ut, { columns: d, onSelect: (f, p) => {
111
- u((C) => ({ ...C, [f]: p }));
112
- }, options: r, selectedOptions: l }) }), e(re, { children: e(se, { isDisabled: (y = l, c && Object.values(y).every((f) => f == null)), onClick: () => m(new SubmitEvent("submit")), children: J(n) }) })] }) }, a);
107
+ const d = n.matrixColumn, c = n.required, m = (x) => {
108
+ x.preventDefault(), x.stopPropagation(), s({ value: l, questionId: a, type: i }, !0), o && o();
109
+ }, h = r.reduce((x, p) => (x[p.id] = null, x), {}), [l, u] = $(h);
110
+ return e("form", { className: L(t, "ul-card__matrix", "fade-in-transition"), id: "text-form", onSubmit: m, children: e(z, { properties: n, children: [e(W, { children: e(ut, { columns: d, onSelect: (x, p) => {
111
+ u((T) => ({ ...T, [x]: p }));
112
+ }, options: r, selectedOptions: l }) }), e(re, { children: e(se, { isDisabled: (y = l, c && Object.values(y).every((x) => x == null)), onClick: () => m(new SubmitEvent("submit")), children: J(n) }) })] }) }, a);
113
113
  var y;
114
114
  }, Me = ({ className: t, onSubmit: s, options: r = [], properties: n, questionId: a, type: i, showIndividualSubmit: o = !1, onSubmitButtonClick: d }) => {
115
- const { border: c, useMobileStyling: m } = A((g) => ({ border: g.border, useMobileStyling: g.useMobileStyling })), h = r.reduce((g, N) => (g[N.id] = { isSelected: !1 }, g), {}), [l, u] = $(h), y = i === "multiplechoice", f = n.required, p = r.find((g) => {
116
- var N;
117
- return (N = g.optionProperties) == null ? void 0 : N.noneOfTheAbove;
118
- }), C = (g) => Object.entries(g).some(([N, B]) => {
115
+ const { border: c, useMobileStyling: m } = A((v) => ({ border: v.border, useMobileStyling: v.useMobileStyling })), h = r.reduce((v, _) => (v[_.id] = { isSelected: !1 }, v), {}), [l, u] = $(h), y = i === "multiplechoice", x = n.required, p = r.find((v) => {
116
+ var _;
117
+ return (_ = v.optionProperties) == null ? void 0 : _.noneOfTheAbove;
118
+ }), T = (v) => Object.entries(v).some(([_, B]) => {
119
119
  var Q;
120
- const H = r.find((ee) => `${ee.id}` === N), O = B.userText === void 0 || B.userText.trim() === "";
120
+ const H = r.find((ee) => `${ee.id}` === _), O = B.userText === void 0 || B.userText.trim() === "";
121
121
  return ((Q = H == null ? void 0 : H.optionProperties) == null ? void 0 : Q.allowsTextEntry) && O && B.isSelected;
122
- }), w = (g) => Object.values(g).filter((N) => N.isSelected).length, v = n.minSelect && n.minSelect > 0 && n.maxSelectMode === ue.Range && w(l) < n.minSelect && (f || w(l) > 0), T = (g) => C(g) || f && !w(g) || !((N) => {
123
- const { minSelect: B = 0, maxSelect: H = 1 / 0, maxSelectMode: O } = n, Q = w(N);
122
+ }), D = (v) => Object.values(v).filter((_) => _.isSelected).length, R = n.minSelect && n.minSelect > 0 && n.maxSelectMode === ue.Range && D(l) < n.minSelect && (x || D(l) > 0), f = (v) => T(v) || x && !D(v) || !((_) => {
123
+ const { minSelect: B = 0, maxSelect: H = 1 / 0, maxSelectMode: O } = n, Q = D(_);
124
124
  switch (O) {
125
125
  case ue.Maximum:
126
126
  return Q <= H;
@@ -129,32 +129,32 @@ const it = ({ properties: t, surveyVideoUrl: s, questionId: r }) => {
129
129
  default:
130
130
  return !0;
131
131
  }
132
- })(g), k = Object.entries(l).some(([g, N]) => {
132
+ })(v), g = Object.entries(l).some(([v, _]) => {
133
133
  var B, H;
134
- return N.isSelected && ((H = (B = r.find((O) => `${O.id}` === g)) == null ? void 0 : B.optionProperties) == null ? void 0 : H.allowsTextEntry);
135
- }), q = o && (!y || k), D = (g) => {
136
- S(g.id, g.selected, g.userText, g.noneOfTheAbove);
137
- }, _ = (g) => {
138
- var N;
139
- return (n == null ? void 0 : n.maxSelectMode) !== ue.Unlimited && w(l) === (n == null ? void 0 : n.maxSelect) && !((N = l[g]) != null && N.isSelected);
134
+ return _.isSelected && ((H = (B = r.find((O) => `${O.id}` === v)) == null ? void 0 : B.optionProperties) == null ? void 0 : H.allowsTextEntry);
135
+ }), w = o && (!y || g), I = (v) => {
136
+ S(v.id, v.selected, v.userText, v.noneOfTheAbove);
137
+ }, k = (v) => {
138
+ var _;
139
+ return (n == null ? void 0 : n.maxSelectMode) !== ue.Unlimited && D(l) === (n == null ? void 0 : n.maxSelect) && !((_ = l[v]) != null && _.isSelected);
140
140
  }, b = () => {
141
141
  s(l, !0), d && d();
142
- }, S = (g, N, B, H) => {
142
+ }, S = (v, _, B, H) => {
143
143
  const O = Object.assign({}, l);
144
- if ((y || H) && N) for (const Q of Object.values(O)) Q.isSelected = !1, delete Q.userText;
144
+ if ((y || H) && _) for (const Q of Object.values(O)) Q.isSelected = !1, delete Q.userText;
145
145
  else p && !H && l[p.id].isSelected && (O[p.id].isSelected = !1);
146
- O[g] = { isSelected: N, userText: B }, u(O);
146
+ O[v] = { isSelected: _, userText: B }, u(O);
147
147
  };
148
- return e("form", { className: L(t, "ul-card--multiple", "fade-in-transition"), id: "text-form", onSubmit: b, children: e(z, { properties: n, children: [e(W, { children: [n.isDropdown ? e(Xe, { disabledOptions: r.filter((g) => _(g.id)), dropdownFooter: v ? e("div", { className: "ul-card__min-select-counter", style: { marginLeft: "16px" }, children: [w(l), "/", n.minSelect] }) : void 0, isMultiSelect: !y, multiselectText: n.dropdownMultiselectedText ?? "choices selected", onChange: (g) => {
149
- const N = { ...l };
150
- for (const B of r) g.includes(B) ? N[B.id].isSelected = !0 : N[B.id].isSelected = !1;
151
- u(N);
152
- }, options: r, placeholderText: n.dropdownPlaceholderText ?? (y ? "Select choice" : "Select choice(s)"), value: r.filter((g) => l[g.id].isSelected) }) : e("div", { className: L(j("ul-card__choices", m)), role: y ? "radiogroup" : "group", children: [r.map(({ id: g, label: N, value: B, optionProperties: H }) => {
148
+ return e("form", { className: L(t, "ul-card--multiple", "fade-in-transition"), id: "text-form", onSubmit: b, children: e(z, { properties: n, children: [e(W, { children: [n.isDropdown ? e(Xe, { disabledOptions: r.filter((v) => k(v.id)), dropdownFooter: R ? e("div", { className: "ul-card__min-select-counter", style: { marginLeft: "16px" }, children: [D(l), "/", n.minSelect] }) : void 0, isMultiSelect: !y, multiselectText: n.dropdownMultiselectedText ?? "choices selected", onChange: (v) => {
149
+ const _ = { ...l };
150
+ for (const B of r) v.includes(B) ? _[B.id].isSelected = !0 : _[B.id].isSelected = !1;
151
+ u(_);
152
+ }, options: r, placeholderText: n.dropdownPlaceholderText ?? (y ? "Select choice" : "Select choice(s)"), value: r.filter((v) => l[v.id].isSelected) }) : e("div", { className: L(j("ul-card__choices", m)), role: y ? "radiogroup" : "group", children: [r.map(({ id: v, label: _, value: B, optionProperties: H }) => {
153
153
  var G, ne;
154
- const O = `${g}`, { allowsTextEntry: Q, noneOfTheAbove: ee } = { allowsTextEntry: !1, noneOfTheAbove: !1, ...H };
155
- return e(xe, { allowTextEntry: Q, border: c, disabled: _(O), error: (Z = l, C(Z)), id: O, isRadio: y, isSelected: !!((G = l[O]) != null && G.isSelected), label: N, noneOfTheAbove: ee, onUserInputChanged: D, promptText: "Please specify", text: (ne = l[g]) == null ? void 0 : ne.userText, useMobileStyling: m, value: B }, O);
154
+ const O = `${v}`, { allowsTextEntry: Q, noneOfTheAbove: ee } = { allowsTextEntry: !1, noneOfTheAbove: !1, ...H };
155
+ return e(xe, { allowTextEntry: Q, border: c, disabled: k(O), error: (Z = l, T(Z)), id: O, isRadio: y, isSelected: !!((G = l[O]) != null && G.isSelected), label: _, noneOfTheAbove: ee, onUserInputChanged: I, promptText: "Please specify", text: (ne = l[v]) == null ? void 0 : ne.userText, useMobileStyling: m, value: B }, O);
156
156
  var Z;
157
- }), !!v && e("div", { className: "ul-card__min-select-counter", children: [w(l), "/", n.minSelect] })] }), q && e(We, { handleSubmit: b, isSubmitDisabled: T(l) })] }), e(re, { children: e(se, { isDisabled: T(l), onClick: b, children: J(n) }) })] }) }, a);
157
+ }), !!R && e("div", { className: "ul-card__min-select-counter", children: [D(l), "/", n.minSelect] })] }), w && e(We, { handleSubmit: b, isSubmitDisabled: f(l) })] }), e(re, { children: e(se, { isDisabled: f(l), onClick: b, children: J(n) }) })] }) }, a);
158
158
  }, mt = (t) => {
159
159
  const { questionId: s, type: r, next: n, options: a } = t;
160
160
  return e(Me, { ...t, onSubmit: (i, o) => {
@@ -173,112 +173,112 @@ const it = ({ properties: t, surveyVideoUrl: s, questionId: r }) => {
173
173
  } });
174
174
  }, vt = ({ className: t, labels: s, properties: r, next: n, questionId: a, type: i }) => {
175
175
  const [o, d] = $(null), { border: c, useMobileStyling: m, viewDocument: h } = A((y) => ({ border: y.border, useMobileStyling: y.useMobileStyling, viewDocument: y.viewDocument })), l = s && s.left, u = s && s.right;
176
- return e("form", { className: L(t, "ul-card--nps", "fade-in-transition"), children: e(z, { properties: r, children: [e(W, { children: [e("div", { className: "ul-card--nps__numbers", children: [...Array(11)].map((y, f) => e("button", { className: L(j("nps-number", m), j(`nps-number-${f}`, m)), id: `option-${f}`, onClick: (p) => {
177
- p.preventDefault(), p.stopPropagation(), d(f);
176
+ return e("form", { className: L(t, "ul-card--nps", "fade-in-transition"), children: e(z, { properties: r, children: [e(W, { children: [e("div", { className: "ul-card--nps__numbers", children: [...Array(11)].map((y, x) => e("button", { className: L(j("nps-number", m), j(`nps-number-${x}`, m)), id: `option-${x}`, onClick: (p) => {
177
+ p.preventDefault(), p.stopPropagation(), d(x);
178
178
  }, onKeyDown: (p) => {
179
- var w, v;
180
- const C = h.querySelectorAll("button.nps-number");
181
- p.key === "ArrowRight" ? (w = C[f + 1]) == null || w.focus() : p.key === "ArrowLeft" ? (v = C[f - 1]) == null || v.focus() : p.key !== "Enter" && p.key !== " " || (p.preventDefault(), p.stopPropagation(), d(f));
179
+ var D, R;
180
+ const T = h.querySelectorAll("button.nps-number");
181
+ p.key === "ArrowRight" ? (D = T[x + 1]) == null || D.focus() : p.key === "ArrowLeft" ? (R = T[x - 1]) == null || R.focus() : p.key !== "Enter" && p.key !== " " || (p.preventDefault(), p.stopPropagation(), d(x));
182
182
  }, onPointerDown: (p) => {
183
183
  p.currentTarget.style.zIndex = "2", p.currentTarget.style.borderColor = c;
184
184
  }, onPointerLeave: (p) => {
185
185
  p.currentTarget.style.zIndex = "auto", p.currentTarget.style.borderColor = Te;
186
- }, style: o === f ? { backgroundColor: c, color: "#fff" } : void 0, tabIndex: 0, children: f }, f)) }), e("div", { className: "ul-card--nps__labels", children: [e("span", { children: l }), e("span", { children: u })] })] }), e(re, { children: e(se, { isDisabled: o === null && r.required, onClick: () => n({ value: o, questionId: a, type: i }, !0), children: J(r) }) })] }) }, a);
186
+ }, style: o === x ? { backgroundColor: c, color: "#fff" } : void 0, tabIndex: 0, children: x }, x)) }), e("div", { className: "ul-card--nps__labels", children: [e("span", { children: l }), e("span", { children: u })] })] }), e(re, { children: e(se, { isDisabled: o === null && r.required, onClick: () => n({ value: o, questionId: a, type: i }, !0), children: J(r) }) })] }) }, a);
187
187
  }, gt = ({ className: t, next: s, properties: r, questionId: n, type: a, onSubmitButtonClick: i }) => {
188
- const { border: o, useMobileStyling: d, update: c } = A((C) => ({ border: C.border, useMobileStyling: C.useMobileStyling, update: C.update })), [m, h] = $(""), l = K(null), u = m.trim(), y = r.required === !0 && !u, f = Je(l, () => c()), p = r && r.openTextPlaceholder ? r.openTextPlaceholder : "";
189
- return e("form", { className: L(t, "ul-card-text", "fade-in-transition"), id: "text-form", children: e(z, { properties: r, children: e("div", { className: "ul-card-text", children: [e(W, { children: [e("div", { className: "ul-card-text__container", children: e("textarea", { "aria-describedby": "ul-caption", "aria-labelledby": "ul-question", "aria-multiline": "true", "aria-placeholder": p, className: L(j("ul-card-text__input", d)), "data-gramm": "false", maxLength: 5e3, name: "text", onBlur: (C) => {
190
- C.currentTarget.style.borderColor = Te;
191
- }, onChange: (C) => {
192
- const { value: w } = C.currentTarget;
193
- f(), C.preventDefault(), C.stopPropagation(), h(w);
194
- }, onFocus: (C) => {
195
- C.currentTarget.style.borderColor = o;
196
- }, placeholder: p, ref: l, role: "textbox", tabIndex: 0 }) }), r.footerHtml && e(ce, { className: "footer", html: r.footerHtml })] }), e(re, { children: e(se, { isDisabled: y, onClick: (C) => {
197
- C.preventDefault(), C.stopPropagation();
198
- const w = r.required !== !0 || u.length > 0;
199
- s({ value: m, questionId: n, type: a }, w), i && i();
188
+ const { border: o, useMobileStyling: d, update: c } = A((T) => ({ border: T.border, useMobileStyling: T.useMobileStyling, update: T.update })), [m, h] = $(""), l = K(null), u = m.trim(), y = r.required === !0 && !u, x = Je(l, () => c()), p = r && r.openTextPlaceholder ? r.openTextPlaceholder : "";
189
+ return e("form", { className: L(t, "ul-card-text", "fade-in-transition"), id: "text-form", children: e(z, { properties: r, children: e("div", { className: "ul-card-text", children: [e(W, { children: [e("div", { className: "ul-card-text__container", children: e("textarea", { "aria-describedby": "ul-caption", "aria-labelledby": "ul-question", "aria-multiline": "true", "aria-placeholder": p, className: L(j("ul-card-text__input", d)), "data-gramm": "false", maxLength: 5e3, name: "text", onBlur: (T) => {
190
+ T.currentTarget.style.borderColor = Te;
191
+ }, onChange: (T) => {
192
+ const { value: D } = T.currentTarget;
193
+ x(), T.preventDefault(), T.stopPropagation(), h(D);
194
+ }, onFocus: (T) => {
195
+ T.currentTarget.style.borderColor = o;
196
+ }, placeholder: p, ref: l, role: "textbox", tabIndex: 0 }) }), r.footerHtml && e(ce, { className: "footer", html: r.footerHtml })] }), e(re, { children: e(se, { isDisabled: y, onClick: (T) => {
197
+ T.preventDefault(), T.stopPropagation();
198
+ const D = r.required !== !0 || u.length > 0;
199
+ s({ value: m, questionId: n, type: a }, D), i && i();
200
200
  }, children: J(r) }) })] }) }) }, n);
201
201
  }, bt = ({ className: t, labels: s, next: r, properties: n, questionId: a, type: i, onSubmitButtonClick: o, options: d }) => {
202
- const c = K(null), m = K(0), h = K(0), l = K(null), u = K(!1), y = K([]), [f, p] = $(() => (n == null ? void 0 : n.required) === !0), [C, w] = $(() => d.map((x) => ({ ...x, rank: null }))), v = oe(() => Array.from({ length: d.length }, (x, P) => P + 1), [d.length]), { useMobileStyling: T, isPreview: k, headers: q } = A((x) => ({ useMobileStyling: x.useMobileStyling, isPreview: x.isPreview, headers: x.headers })), D = (q == null ? void 0 : q["userleap-platform"]) === "android", _ = T && !k && !D, b = !_ && !D, S = (x, P) => {
203
- w((R) => {
204
- const I = parseInt(P), U = R.map((M) => ({ ...M }));
202
+ const c = K(null), m = K(0), h = K(0), l = K(null), u = K(!1), y = K([]), [x, p] = $(() => (n == null ? void 0 : n.required) === !0), [T, D] = $(() => d.map((C) => ({ ...C, rank: null }))), R = oe(() => Array.from({ length: d.length }, (C, q) => q + 1), [d.length]), { useMobileStyling: f, isPreview: g, headers: w } = A((C) => ({ useMobileStyling: C.useMobileStyling, isPreview: C.isPreview, headers: C.headers })), I = (w == null ? void 0 : w["userleap-platform"]) === "android", k = f && !g && !I, b = !k && !I, S = (C, q) => {
203
+ D((P) => {
204
+ const N = parseInt(q), U = P.map((M) => ({ ...M }));
205
205
  U.some((M) => M.rank == null) && U.forEach((M, ae) => M.rank = ae + 1);
206
- const F = U.findIndex((M) => M.id === x);
207
- if (F === -1) return R;
206
+ const F = U.findIndex((M) => M.id === C);
207
+ if (F === -1) return P;
208
208
  const E = U[F].rank;
209
- return I < E ? U.forEach((M) => {
210
- M.id !== x && M.rank >= I && M.rank < E && (M.rank = M.rank + 1);
211
- }) : I > E && U.forEach((M) => {
212
- M.id !== x && M.rank > E && M.rank <= I && (M.rank = M.rank - 1);
213
- }), U[F].rank = I, U.sort((M, ae) => M.rank - ae.rank), ee(), U;
209
+ return N < E ? U.forEach((M) => {
210
+ M.id !== C && M.rank >= N && M.rank < E && (M.rank = M.rank + 1);
211
+ }) : N > E && U.forEach((M) => {
212
+ M.id !== C && M.rank > E && M.rank <= N && (M.rank = M.rank - 1);
213
+ }), U[F].rank = N, U.sort((M, ae) => M.rank - ae.rank), ee(), U;
214
214
  });
215
- }, g = (x, P) => {
216
- for (let R = 0; R < y.current.length; R++) {
217
- const I = y.current[R];
218
- if (!I || I === l.current) continue;
219
- const U = I.getBoundingClientRect();
220
- if (x >= U.left && x <= U.right && P >= U.top && P <= U.bottom) return { element: I, index: R };
215
+ }, v = (C, q) => {
216
+ for (let P = 0; P < y.current.length; P++) {
217
+ const N = y.current[P];
218
+ if (!N || N === l.current) continue;
219
+ const U = N.getBoundingClientRect();
220
+ if (C >= U.left && C <= U.right && q >= U.top && q <= U.bottom) return { element: N, index: P };
221
221
  }
222
222
  return null;
223
- }, N = (x) => (P) => {
224
- if (!_) return;
225
- P.preventDefault(), P.stopPropagation(), u.current = !0, c.current = x;
226
- const R = P.touches[0];
227
- m.current = R.clientY, h.current = R.clientY;
228
- const I = P.currentTarget.closest(".ul-card-rank__option");
229
- I && (l.current = I, I.classList.add("is-dragging"));
230
- }, B = (x) => {
231
- if (!_ || !u.current || c.current === null) return;
232
- x.preventDefault(), x.stopPropagation();
233
- const P = x.touches[0];
234
- h.current = P.clientY;
235
- const R = h.current - m.current;
236
- l.current && (l.current.style.transform = `translateY(${R}px)`, l.current.style.zIndex = "1000"), y.current.forEach((U) => {
223
+ }, _ = (C) => (q) => {
224
+ if (!k) return;
225
+ q.preventDefault(), q.stopPropagation(), u.current = !0, c.current = C;
226
+ const P = q.touches[0];
227
+ m.current = P.clientY, h.current = P.clientY;
228
+ const N = q.currentTarget.closest(".ul-card-rank__option");
229
+ N && (l.current = N, N.classList.add("is-dragging"));
230
+ }, B = (C) => {
231
+ if (!k || !u.current || c.current === null) return;
232
+ C.preventDefault(), C.stopPropagation();
233
+ const q = C.touches[0];
234
+ h.current = q.clientY;
235
+ const P = h.current - m.current;
236
+ l.current && (l.current.style.transform = `translateY(${P}px)`, l.current.style.zIndex = "1000"), y.current.forEach((U) => {
237
237
  U && U !== l.current && U.classList.remove("is-drop-target");
238
238
  });
239
- const I = g(P.clientX, P.clientY);
240
- I && I.element.classList.add("is-drop-target");
241
- }, H = (x) => {
242
- if (!_ || !u.current || c.current === null) return;
243
- x.preventDefault(), x.stopPropagation();
244
- const P = x.changedTouches[0], R = g(P.clientX, P.clientY);
245
- l.current && (l.current.style.transform = "", l.current.style.zIndex = "", l.current.classList.remove("is-dragging")), y.current.forEach((I) => {
246
- I && I.classList.remove("is-drop-target");
247
- }), R && R.index !== c.current && O(c.current, R.index), c.current = null, l.current = null, u.current = !1;
248
- }, O = (x, P) => {
249
- w((R) => {
250
- const I = R.map((F) => ({ ...F })), [U] = I.splice(x, 1);
251
- return I.splice(P, 0, U), I.forEach((F, E) => {
239
+ const N = v(q.clientX, q.clientY);
240
+ N && N.element.classList.add("is-drop-target");
241
+ }, H = (C) => {
242
+ if (!k || !u.current || c.current === null) return;
243
+ C.preventDefault(), C.stopPropagation();
244
+ const q = C.changedTouches[0], P = v(q.clientX, q.clientY);
245
+ l.current && (l.current.style.transform = "", l.current.style.zIndex = "", l.current.classList.remove("is-dragging")), y.current.forEach((N) => {
246
+ N && N.classList.remove("is-drop-target");
247
+ }), P && P.index !== c.current && O(c.current, P.index), c.current = null, l.current = null, u.current = !1;
248
+ }, O = (C, q) => {
249
+ D((P) => {
250
+ const N = P.map((F) => ({ ...F })), [U] = N.splice(C, 1);
251
+ return N.splice(q, 0, U), N.forEach((F, E) => {
252
252
  F.rank = E + 1;
253
- }), ee(), I;
253
+ }), ee(), N;
254
254
  });
255
- }, Q = (x) => {
256
- const P = {};
257
- x.reduce((R, I) => (R[I.id] = I.rank, R), P), r({ value: P, questionId: a, type: i }, !0);
255
+ }, Q = (C) => {
256
+ const q = {};
257
+ C.reduce((P, N) => (P[N.id] = N.rank, P), q), r({ value: q, questionId: a, type: i }, !0);
258
258
  }, ee = () => {
259
259
  p(!1);
260
- }, { left: Z, right: G } = s, ne = d.length, de = (x) => {
261
- x.preventDefault(), x.currentTarget.classList.add("is-drop-target");
262
- }, Ge = (x) => {
263
- x.currentTarget.classList.remove("is-drop-target");
264
- }, je = (x) => {
265
- c.current = null, x.currentTarget.classList.remove("is-dragging");
260
+ }, { left: Z, right: G } = s, ne = d.length, de = (C) => {
261
+ C.preventDefault(), C.currentTarget.classList.add("is-drop-target");
262
+ }, Ge = (C) => {
263
+ C.currentTarget.classList.remove("is-drop-target");
264
+ }, je = (C) => {
265
+ c.current = null, C.currentTarget.classList.remove("is-dragging");
266
266
  };
267
- return e("form", { className: L(t, "ul-card-rank", "fade-in-transition"), onSubmit: (x) => {
268
- x.preventDefault(), Q(C), o && o();
269
- }, children: e(z, { properties: n, children: D ? e(W, { children: e("div", { className: "ul-card--rank__question-inner-container", children: [e("div", { className: "ul-card-rank__labels", children: e("span", { children: ["1 - ", Z] }) }), e("ol", { className: "ul-card-rank__list", children: C.map(({ id: x, label: P, rank: R }) => e("li", { className: "ul-card-rank__option", children: [e("select", { "aria-label": `Rank for ${P}`, className: L("ul-card-rank__select", R == null && "ul-card-rank__select--placeholder"), name: `rank[${x}]`, onChange: (I) => S(x, I.currentTarget.value), value: R ?? "", children: [R == null && e("option", { className: "ul-card-rank__select-option", disabled: !0, value: "", children: "-" }), v.map((I) => e("option", { className: "ul-card-rank__select-option", value: I, children: I }, `${I}-${a}`))] }), e("span", { children: P })] }, x)) }), e("div", { className: "ul-card-rank__labels", children: e("span", { children: [ne, " - ", G] }) })] }) }) : e(ke, { children: [e(W, { children: e("div", { className: "ul-card--rank__question-inner-container", children: [e("div", { className: "ul-card-rank__labels", children: e("span", { children: ["1 - ", Z] }) }), e("ol", { className: "ul-card-rank__list", onDragOver: D ? void 0 : (x) => {
270
- x.preventDefault(), x.dataTransfer && (x.dataTransfer.dropEffect = "move");
271
- }, children: C.map(({ id: x, label: P, rank: R }, I) => {
272
- return e("li", { className: "ul-card-rank__option", draggable: !!b || void 0, onDragEnd: b ? je : void 0, onDragEnter: b ? de : void 0, onDragLeave: b ? Ge : void 0, onDragStart: b ? (F = I, (E) => {
267
+ return e("form", { className: L(t, "ul-card-rank", "fade-in-transition"), onSubmit: (C) => {
268
+ C.preventDefault(), Q(T), o && o();
269
+ }, children: e(z, { properties: n, children: I ? e(W, { children: e("div", { className: "ul-card--rank__question-inner-container", children: [e("div", { className: "ul-card-rank__labels", children: e("span", { children: ["1 - ", Z] }) }), e("ol", { className: "ul-card-rank__list", children: T.map(({ id: C, label: q, rank: P }) => e("li", { className: "ul-card-rank__option", children: [e("select", { "aria-label": `Rank for ${q}`, className: L("ul-card-rank__select", P == null && "ul-card-rank__select--placeholder"), name: `rank[${C}]`, onChange: (N) => S(C, N.currentTarget.value), value: P ?? "", children: [P == null && e("option", { className: "ul-card-rank__select-option", disabled: !0, value: "", children: "-" }), R.map((N) => e("option", { className: "ul-card-rank__select-option", value: N, children: N }, `${N}-${a}`))] }), e("span", { children: q })] }, C)) }), e("div", { className: "ul-card-rank__labels", children: e("span", { children: [ne, " - ", G] }) })] }) }) : e(ke, { children: [e(W, { children: e("div", { className: "ul-card--rank__question-inner-container", children: [e("div", { className: "ul-card-rank__labels", children: e("span", { children: ["1 - ", Z] }) }), e("ol", { className: "ul-card-rank__list", onDragOver: I ? void 0 : (C) => {
270
+ C.preventDefault(), C.dataTransfer && (C.dataTransfer.dropEffect = "move");
271
+ }, children: T.map(({ id: C, label: q, rank: P }, N) => {
272
+ return e("li", { className: "ul-card-rank__option", draggable: !!b || void 0, onDragEnd: b ? je : void 0, onDragEnter: b ? de : void 0, onDragLeave: b ? Ge : void 0, onDragStart: b ? (F = N, (E) => {
273
273
  c.current = F, E.dataTransfer && (E.dataTransfer.effectAllowed = "move", E.dataTransfer.setData("text/plain", String(F)), E.currentTarget.classList.add("is-dragging"));
274
- }) : void 0, onDrop: b ? (U = I, (E) => {
274
+ }) : void 0, onDrop: b ? (U = N, (E) => {
275
275
  var ae, Ie;
276
276
  E.preventDefault(), E.currentTarget.classList.remove("is-drop-target");
277
277
  const M = c.current;
278
278
  c.current = null, (Ie = (ae = E.currentTarget.closest(".ul-card-rank__list")) == null ? void 0 : ae.querySelector(".is-dragging")) == null || Ie.classList.remove("is-dragging"), M != null && M !== U && O(M, U);
279
- }) : void 0, ref: (E) => y.current[I] = E, children: [e("select", { "aria-label": `Rank for ${P}`, className: L("ul-card-rank__select", R == null && "ul-card-rank__select--placeholder"), name: `rank[${x}]`, onChange: (E) => S(x, E.currentTarget.value), value: R ?? "", children: [R == null && e("option", { className: "ul-card-rank__select-option", disabled: !0, value: "", children: "-" }), v.map((E) => e("option", { className: "ul-card-rank__select-option", value: E, children: E }, E))] }), e("span", { children: P }), !D && e("button", { "aria-label": `Drag ${P} to reorder`, className: "ul-card-rank__drag-btn", onTouchEnd: _ ? H : void 0, onTouchMove: _ ? B : void 0, onTouchStart: _ ? N(I) : void 0, title: "Drag to reorder", type: "button", children: e("svg", { fill: "none", height: "17", viewBox: "0 0 16 17", width: "16", xmlns: "http://www.w3.org/2000/svg", children: e("path", { d: "M5.75 11.625C6.37132 11.625 6.875 12.1287 6.875 12.75C6.875 13.3713 6.37132 13.875 5.75 13.875C5.12868 13.875 4.625 13.3713 4.625 12.75C4.625 12.1287 5.12868 11.625 5.75 11.625ZM10.25 11.625C10.8713 11.625 11.375 12.1287 11.375 12.75C11.375 13.3713 10.8713 13.875 10.25 13.875C9.62868 13.875 9.125 13.3713 9.125 12.75C9.125 12.1287 9.62868 11.625 10.25 11.625ZM5.75 7.375C6.37132 7.375 6.875 7.87868 6.875 8.5C6.875 9.12132 6.37132 9.625 5.75 9.625C5.12868 9.625 4.625 9.12132 4.625 8.5C4.625 7.87868 5.12868 7.375 5.75 7.375ZM10.25 7.375C10.8713 7.375 11.375 7.87868 11.375 8.5C11.375 9.12132 10.8713 9.625 10.25 9.625C9.62868 9.625 9.125 9.12132 9.125 8.5C9.125 7.87868 9.62868 7.375 10.25 7.375ZM5.75 3.125C6.37132 3.125 6.875 3.62868 6.875 4.25C6.875 4.87132 6.37132 5.375 5.75 5.375C5.12868 5.375 4.625 4.87132 4.625 4.25C4.625 3.62868 5.12868 3.125 5.75 3.125ZM10.25 3.125C10.8713 3.125 11.375 3.62868 11.375 4.25C11.375 4.87132 10.8713 5.375 10.25 5.375C9.62868 5.375 9.125 4.87132 9.125 4.25C9.125 3.62868 9.62868 3.125 10.25 3.125Z", fill: "currentColor" }) }) })] }, x);
279
+ }) : void 0, ref: (E) => y.current[N] = E, children: [e("select", { "aria-label": `Rank for ${q}`, className: L("ul-card-rank__select", P == null && "ul-card-rank__select--placeholder"), name: `rank[${C}]`, onChange: (E) => S(C, E.currentTarget.value), value: P ?? "", children: [P == null && e("option", { className: "ul-card-rank__select-option", disabled: !0, value: "", children: "-" }), R.map((E) => e("option", { className: "ul-card-rank__select-option", value: E, children: E }, E))] }), e("span", { children: q }), !I && e("button", { "aria-label": `Drag ${q} to reorder`, className: "ul-card-rank__drag-btn", onTouchEnd: k ? H : void 0, onTouchMove: k ? B : void 0, onTouchStart: k ? _(N) : void 0, title: "Drag to reorder", type: "button", children: e("svg", { fill: "none", height: "17", viewBox: "0 0 16 17", width: "16", xmlns: "http://www.w3.org/2000/svg", children: e("path", { d: "M5.75 11.625C6.37132 11.625 6.875 12.1287 6.875 12.75C6.875 13.3713 6.37132 13.875 5.75 13.875C5.12868 13.875 4.625 13.3713 4.625 12.75C4.625 12.1287 5.12868 11.625 5.75 11.625ZM10.25 11.625C10.8713 11.625 11.375 12.1287 11.375 12.75C11.375 13.3713 10.8713 13.875 10.25 13.875C9.62868 13.875 9.125 13.3713 9.125 12.75C9.125 12.1287 9.62868 11.625 10.25 11.625ZM5.75 7.375C6.37132 7.375 6.875 7.87868 6.875 8.5C6.875 9.12132 6.37132 9.625 5.75 9.625C5.12868 9.625 4.625 9.12132 4.625 8.5C4.625 7.87868 5.12868 7.375 5.75 7.375ZM10.25 7.375C10.8713 7.375 11.375 7.87868 11.375 8.5C11.375 9.12132 10.8713 9.625 10.25 9.625C9.62868 9.625 9.125 9.12132 9.125 8.5C9.125 7.87868 9.62868 7.375 10.25 7.375ZM5.75 3.125C6.37132 3.125 6.875 3.62868 6.875 4.25C6.875 4.87132 6.37132 5.375 5.75 5.375C5.12868 5.375 4.625 4.87132 4.625 4.25C4.625 3.62868 5.12868 3.125 5.75 3.125ZM10.25 3.125C10.8713 3.125 11.375 3.62868 11.375 4.25C11.375 4.87132 10.8713 5.375 10.25 5.375C9.62868 5.375 9.125 4.87132 9.125 4.25C9.125 3.62868 9.62868 3.125 10.25 3.125Z", fill: "currentColor" }) }) })] }, C);
280
280
  var U, F;
281
- }) }), e("div", { className: "ul-card-rank__labels", children: e("span", { children: [ne, " - ", G] }) })] }) }), e(re, { children: e("div", { className: "ul-card__button-wrapper", children: e(X, { disabled: f, children: J(n) }) }) })] }) }) }, a);
281
+ }) }), e("div", { className: "ul-card-rank__labels", children: e("span", { children: [ne, " - ", G] }) })] }) }), e(re, { children: e("div", { className: "ul-card__button-wrapper", children: e(X, { disabled: x, children: J(n) }) }) })] }) }) }, a);
282
282
  }, ge = 1, Ue = 2, Ee = 3, pe = (t) => t.type === "av_permission", De = (t) => t.type === "screen_permission", Ae = (t, s) => t === void 0 ? ge : t ? ((r, n) => !(pe(n) ? n.permissionDescriptors : []).includes("camera") || r.getVideoTracks().length > 0)(t, s) ? Ee : ge : Ue, we = { avStream: null, currentPage: null, mediaRecordingUids: null, nextQuestion: () => {
283
283
  }, passthroughData: void 0, recordingMediaTypes: void 0, screenPermissionRequested: !1, type: void 0 }, Y = Fe((t) => ({ ...we, reset: () => {
284
284
  t(we);
@@ -383,25 +383,25 @@ const $e = "ul-permission-graphics-container", Be = "ul-permission-body", Oe = L
383
383
  }, Nt = ({ className: t, properties: s, next: r, questionId: n }) => {
384
384
  const a = A(), { surveyId: i, responseGroupUid: o, userId: d } = a, c = Y(), { screenPermissionRequested: m } = c, h = Y((p) => p.avStream);
385
385
  let l = Y((p) => p.currentPage);
386
- l || (l = function({ pages: p, userId: C, responseGroupUid: w, surveyId: v, questionId: T, next: k }) {
387
- const { updatePage: q } = Y.getState(), { eventEmitFn: D, recorderEventEmitter: _ } = A.getState(), b = { questionId: T, surveyId: v, visitorId: C, responseGroupUid: w };
386
+ l || (l = function({ pages: p, userId: T, responseGroupUid: D, surveyId: R, questionId: f, next: g }) {
387
+ const { updatePage: w } = Y.getState(), { eventEmitFn: I, recorderEventEmitter: k } = A.getState(), b = { questionId: f, surveyId: R, visitorId: T, responseGroupUid: D };
388
388
  let S = 0;
389
- _.emit("recorded.task.permission.screen"), D("recorded.task.permission.screen"), _.emit("permission.status", { "permission.status.callback": (N, B, H, O) => {
389
+ k.emit("recorded.task.permission.screen"), I("recorded.task.permission.screen"), k.emit("permission.status", { "permission.status.callback": (_, B, H, O) => {
390
390
  const Q = p[S], { type: ee } = Q, Z = ["screen"];
391
391
  if (pe(Q)) {
392
392
  const { permissionDescriptors: G } = Q, ne = G == null ? void 0 : G.includes("microphone"), de = G == null ? void 0 : G.includes("camera");
393
- ne && Z.push("audio"), de && Z.push("video"), (N != null && N.active && !de || N != null && N.active && B) && S++;
393
+ ne && Z.push("audio"), de && Z.push("video"), (_ != null && _.active && !de || _ != null && _.active && B) && S++;
394
394
  }
395
- De(p[S]) && H && (S++, _.emit("begin.recording", { "recording.media.types": Z, "start.recording.callback": (G) => q({ mediaRecordingUids: G }) })), q({ currentPage: p[S], avStream: N, screenPermissionRequested: H, nextQuestion: k, type: ee, passthroughData: b, recordingMediaTypes: Z, captureStream: O });
395
+ De(p[S]) && H && (S++, k.emit("begin.recording", { "recording.media.types": Z, "start.recording.callback": (G) => w({ mediaRecordingUids: G }) })), w({ currentPage: p[S], avStream: _, screenPermissionRequested: H, nextQuestion: g, type: ee, passthroughData: b, recordingMediaTypes: Z, captureStream: O });
396
396
  } });
397
- const g = p[S];
398
- return g.type === "av_permission" && be({ currentPage: g, pages: p }), g;
397
+ const v = p[S];
398
+ return v.type === "av_permission" && be({ currentPage: v, pages: p }), v;
399
399
  }({ questionId: n, surveyId: i, next: (p) => {
400
400
  r(p, !0);
401
401
  }, pages: s.pages, responseGroupUid: o, userId: d }));
402
402
  let u = l.headline, y = l.captionText;
403
- const f = Ae(h, l);
404
- return De(l) && m && (u = l.permissionDeniedHeadline, y = l.permissionDeniedCaptionText), pe(l) && f === Ee && (u = l.permissionGrantedHeadline, y = l.permissionGrantedCaptionText), e("div", { className: L(t, "ul-center-horizontally", "fade-in-transition"), children: [e(Ce, { isRequired: s == null ? void 0 : s.required, message: u, properties: { captionText: y } }), e(W, { children: e(St, { properties: s }) })] });
403
+ const x = Ae(h, l);
404
+ return De(l) && m && (u = l.permissionDeniedHeadline, y = l.permissionDeniedCaptionText), pe(l) && x === Ee && (u = l.permissionGrantedHeadline, y = l.permissionGrantedCaptionText), e("div", { className: L(t, "ul-center-horizontally", "fade-in-transition"), children: [e(Ce, { isRequired: s == null ? void 0 : s.required, message: u, properties: { captionText: y } }), e(W, { children: e(St, { properties: s }) })] });
405
405
  }, It = ({ className: t, next: s, properties: r, questionId: n, type: a }) => {
406
406
  const { visitorAttributes: i, isLongFormSurvey: o } = A((h) => ({ visitorAttributes: h.visitorAttributes, isLongFormSurvey: Le(h.studyType) })), d = (h, l = !1) => {
407
407
  s({ value: l ? { skipped: !0 } : void 0, questionId: n, type: a }, !0);
@@ -425,19 +425,19 @@ const $e = "ul-permission-graphics-container", Be = "ul-permission-body", Oe = L
425
425
  const a = Math.round(Math.min(99, ...Object.values(s).filter((i) => i.isSubmitted).map((i) => i.progressPct || 0)));
426
426
  return e("div", { className: L(t, "ul-card--uploading", "fade-in-transition"), children: [e("div", { "aria-busy": "true", "aria-label": "Processing...", "aria-live": "polite", className: "ul-loading-spinner-container", role: "progressbar", children: e("div", { className: "ul-loading-spinner", children: [e("div", { className: "first" }), e("div", { className: "second" }), e("div", { className: "third" }), e("div", { className: "fourth" })] }) }), e(Ce, { message: `${r} (${a}% complete)` }), e("p", { className: "ul-caption", children: n })] });
427
427
  }, qe = 0, Pe = 1, Pt = ({ className: t, next: s, properties: r, questionId: n, type: a }) => {
428
- const i = `ul-card-video__player_recorder-q${n}`, { apiURL: o, envId: d, handleUploadUpdate: c, headers: m, responseGroupUid: h, surveyId: l, viewDocument: u, visitorId: y } = A((b) => ({ apiURL: b.apiURL, envId: b.envId, handleUploadUpdate: b.handleUploadUpdate, headers: b.headers, responseGroupUid: b.responseGroupUid, surveyId: b.surveyId, viewDocument: b.viewDocument, visitorId: b.userId })), [f, p] = $(!1), [C, w] = $(null), [v, T] = $(null), [k, q] = $(qe), D = (b, S) => {
429
- b === V.UPLOAD_STARTED ? (w(S[V.UPLOAD_ID]), T(S[V.MEDIA_RECORDING_UID]), p(!0)) : b === V.DELETE ? (w(null), T(null), p(!1)) : b === V.UPLOAD_PROGRESS ? isNaN(S[V.UPLOAD_PROGRESS_PCT]) ? c({ mediaRecordingUid: S[V.MEDIA_RECORDING_UID], isComplete: !0 }) : c({ mediaRecordingUid: S[V.MEDIA_RECORDING_UID], progressPct: S[V.UPLOAD_PROGRESS_PCT] }) : b === V.UPLOAD_FINISHED && c({ mediaRecordingUid: S[V.MEDIA_RECORDING_UID], isComplete: !0 });
430
- }, _ = (b) => {
431
- b.preventDefault(), b.stopPropagation(), document.getElementById(i) && st(i), C && v ? (c({ mediaRecordingUid: v, isSubmitted: !0 }), s({ value: { mediaRecordingUid: v }, questionId: n, type: a }, !0)) : s({ value: null, questionId: n, type: a }, !0);
428
+ const i = `ul-card-video__player_recorder-q${n}`, { apiURL: o, envId: d, handleUploadUpdate: c, headers: m, responseGroupUid: h, surveyId: l, viewDocument: u, visitorId: y } = A((b) => ({ apiURL: b.apiURL, envId: b.envId, handleUploadUpdate: b.handleUploadUpdate, headers: b.headers, responseGroupUid: b.responseGroupUid, surveyId: b.surveyId, viewDocument: b.viewDocument, visitorId: b.userId })), [x, p] = $(!1), [T, D] = $(null), [R, f] = $(null), [g, w] = $(qe), I = (b, S) => {
429
+ b === V.UPLOAD_STARTED ? (D(S[V.UPLOAD_ID]), f(S[V.MEDIA_RECORDING_UID]), p(!0)) : b === V.DELETE ? (D(null), f(null), p(!1)) : b === V.UPLOAD_PROGRESS ? isNaN(S[V.UPLOAD_PROGRESS_PCT]) ? c({ mediaRecordingUid: S[V.MEDIA_RECORDING_UID], isComplete: !0 }) : c({ mediaRecordingUid: S[V.MEDIA_RECORDING_UID], progressPct: S[V.UPLOAD_PROGRESS_PCT] }) : b === V.UPLOAD_FINISHED && c({ mediaRecordingUid: S[V.MEDIA_RECORDING_UID], isComplete: !0 });
430
+ }, k = (b) => {
431
+ b.preventDefault(), b.stopPropagation(), document.getElementById(i) && st(i), T && R ? (c({ mediaRecordingUid: R, isSubmitted: !0 }), s({ value: { mediaRecordingUid: R }, questionId: n, type: a }, !0)) : s({ value: null, questionId: n, type: a }, !0);
432
432
  };
433
- return e("form", { className: L(t, "ul-card--video", "fade-in-transition"), id: "ul-video-interview-form", children: [e(W, { children: [e("div", { id: "ul-question-player-container", style: { display: k === qe ? "" : "none" }, children: e(z, { properties: r, children: e("button", { className: "ul-video-btn ul-record-response-btn", onClick: (b) => {
434
- b.preventDefault(), b.stopPropagation(), document.getElementById(i) && rt(i), q(Pe);
435
- } }) }) }), e("div", { style: { display: k === Pe ? "block" : "none" }, children: e("div", { id: "ul-recorder-player-container", ref: (b) => {
433
+ return e("form", { className: L(t, "ul-card--video", "fade-in-transition"), id: "ul-video-interview-form", children: [e(W, { children: [e("div", { id: "ul-question-player-container", style: { display: g === qe ? "" : "none" }, children: e(z, { properties: r, children: e("button", { className: "ul-video-btn ul-record-response-btn", onClick: (b) => {
434
+ b.preventDefault(), b.stopPropagation(), document.getElementById(i) && rt(i), w(Pe);
435
+ } }) }) }), e("div", { style: { display: g === Pe ? "block" : "none" }, children: e("div", { id: "ul-recorder-player-container", ref: (b) => {
436
436
  if (b && b.children.length === 0) {
437
- const S = nt(i, { surveyId: l, responseGroupUid: h, questionId: n, visitorId: y, envId: d }, o, D, void 0, { ...m, "x-ul-video-recorder-origin": "sdk" }, r.mediaType === V.MEDIA_TYPE_AUDIO, u);
437
+ const S = nt(i, { surveyId: l, responseGroupUid: h, questionId: n, visitorId: y, envId: d }, o, I, void 0, { ...m, "x-ul-video-recorder-origin": "sdk" }, r.mediaType === V.MEDIA_TYPE_AUDIO, u);
438
438
  b.appendChild(S);
439
439
  }
440
- } }) })] }), e(re, { children: [e(se, { isDisabled: !!r.required && !f, onClick: _, children: J(r) }), e("button", { className: "ul-card-text__button ul-button-inactive ul-card-skip__button", id: "ul-card-video__skip_button", onClick: _, style: { ...r.required ? { display: "none" } : {}, ...f ? { display: "none" } : {} }, children: fe(r) })] })] });
440
+ } }) })] }), e(re, { children: [e(se, { isDisabled: !!r.required && !x, onClick: k, children: J(r) }), e("button", { className: "ul-card-text__button ul-button-inactive ul-card-skip__button", id: "ul-card-video__skip_button", onClick: k, style: { ...r.required ? { display: "none" } : {}, ...x ? { display: "none" } : {} }, children: fe(r) })] })] });
441
441
  }, Qe = (t) => t.type === "thanks" || t.type === "uploading", Rt = ({ card: t, avatars: s, isThinking: r, isCurrentQuestion: n, currentQuestionBubbleRef: a }) => {
442
442
  const i = ((o) => "properties" in o.props && o.props.properties && "questionHtml" in o.props.properties && o.props.properties.questionHtml ? { content: o.props.properties.questionHtml, isHtml: !0 } : "message" in o.props ? { content: o.props.message, isHtml: !1 } : { content: "Question", isHtml: !1 })(t);
443
443
  return e(ie, { avatars: s, isLeft: !0, message: { id: `question-${t.name}`, type: "question", content: i.content }, ref: n ? a : null, children: r ? e(wt, {}) : e(ke, { children: [i.isHtml ? e(ce, { className: "chat-message-text", html: i.content }) : e("div", { className: "chat-message-text", children: i.content }), t.type === "videovoice" && e(it, { properties: t.props, questionId: t.name, surveyVideoUrl: t.props.properties.videoUrl })] }) });
@@ -468,8 +468,8 @@ const $e = "ul-permission-graphics-container", Be = "ul-permission-body", Oe = L
468
468
  }, Et = ({ card: t, cardIndex: s, index: r, avatars: n, cardResponses: a, questionThinkingStates: i, startingQuestionIdx: o, currentQuestionBubbleRef: d, handleCardResponse: c }) => {
469
469
  const m = s === r, h = s < r, l = Qe(t);
470
470
  if (l) return e(Ut, { avatars: n, card: t, currentQuestionBubbleRef: d, isCurrentQuestion: m });
471
- const u = `${t.name}`, y = a.get(u), f = t.type === "open", p = i.get(u), C = s > (o ?? 0) && t.type !== "thanks" && t.type !== "uploading" && (p === !0 || p === void 0);
472
- return e(Re.Fragment, { children: [e(Rt, { avatars: n, card: t, currentQuestionBubbleRef: d, isCurrentQuestion: m, isThinking: C }), !C && e(Lt, { avatars: n, card: t }), h && f ? e(Mt, { avatars: n, card: t, userResponse: y }) : (!h || !f) && !C && e(ie, { avatars: n, isLeft: !1, message: { id: `card-${t.name}`, type: "card", content: "" }, children: e("div", { className: "chat-card-container", children: e($t, { card: t, className: l ? "chat-thanks-card" : "chat-card", isAnswered: h, next: m ? c : () => {
471
+ const u = `${t.name}`, y = a.get(u), x = t.type === "open", p = i.get(u), T = s > (o ?? 0) && t.type !== "thanks" && t.type !== "uploading" && (p === !0 || p === void 0);
472
+ return e(Re.Fragment, { children: [e(Rt, { avatars: n, card: t, currentQuestionBubbleRef: d, isCurrentQuestion: m, isThinking: T }), !T && e(Lt, { avatars: n, card: t }), h && x ? e(Mt, { avatars: n, card: t, userResponse: y }) : (!h || !x) && !T && e(ie, { avatars: n, isLeft: !1, message: { id: `card-${t.name}`, type: "card", content: "" }, children: e("div", { className: "chat-card-container", children: e($t, { card: t, className: l ? "chat-thanks-card" : "chat-card", isAnswered: h, next: m ? c : () => {
473
473
  } }) }) })] }, `question-card-${t.name}`);
474
474
  }, ie = Re.forwardRef(({ message: t, isLeft: s = !1, children: r, avatars: n, hideAvatar: a = !1 }, i) => {
475
475
  const o = s ? "chat-bubble-left" : "chat-bubble-right";
@@ -516,63 +516,63 @@ const At = () => {
516
516
  }
517
517
  }, Gt = ({ cards: t, next: s, previousResponses: r }) => {
518
518
  const { cardResponses: n, setCardResponse: a } = (() => {
519
- const [v, T] = $(/* @__PURE__ */ new Map());
520
- return { cardResponses: v, setCardResponse: le((k, q) => {
521
- T((D) => new Map(D).set(k, q));
519
+ const [f, g] = $(/* @__PURE__ */ new Map());
520
+ return { cardResponses: f, setCardResponse: le((w, I) => {
521
+ g((k) => new Map(k).set(w, I));
522
522
  }, []) };
523
- })(), { index: i, isLongFormSurvey: o, avatars: d, startingQuestionIdx: c, viewDocument: m } = A((v) => ({ index: v.index, isLongFormSurvey: Le(v.studyType), avatars: v.avatars, startingQuestionIdx: v.startingQuestionIdx, viewDocument: v.viewDocument })), { currentQuestionBubbleRef: h, scrollToCurrentQuestion: l } = (({ viewDocument: v }) => {
524
- const T = K(null), k = le(() => {
525
- const q = v.querySelector(".ul-card-main-content");
526
- if (T.current && q && q instanceof HTMLElement) {
527
- const D = T.current.offsetTop - q.offsetTop - 16;
528
- q.scrollTo({ top: Math.max(0, D), behavior: "smooth" });
523
+ })(), { index: i, isLongFormSurvey: o, avatars: d, startingQuestionIdx: c, viewDocument: m, update: h } = A((f) => ({ index: f.index, isLongFormSurvey: Le(f.studyType), avatars: f.avatars, startingQuestionIdx: f.startingQuestionIdx, viewDocument: f.viewDocument, update: f.update })), { currentQuestionBubbleRef: l, scrollToCurrentQuestion: u } = (({ viewDocument: f }) => {
524
+ const g = K(null), w = le(() => {
525
+ const I = f.querySelector(".ul-card-main-content");
526
+ if (g.current && I && I instanceof HTMLElement) {
527
+ const k = g.current.offsetTop - I.offsetTop - 16;
528
+ I.scrollTo({ top: Math.max(0, k), behavior: "smooth" });
529
529
  }
530
530
  }, []);
531
- return { currentQuestionBubbleRef: T, scrollToCurrentQuestion: k };
532
- })({ viewDocument: m }), u = ((v, T, k) => {
533
- const [q, D] = $(/* @__PURE__ */ new Map());
531
+ return { currentQuestionBubbleRef: g, scrollToCurrentQuestion: w };
532
+ })({ viewDocument: m }), y = ((f, g, w) => {
533
+ const [I, k] = $(/* @__PURE__ */ new Map());
534
534
  return te(() => {
535
- if (v.length > 0 && T < v.length) {
536
- const _ = v[T], b = `${_.name}`;
537
- if (T <= (k ?? 0) || Qe(_)) return void D((g) => new Map(g).set(b, !1));
538
- D((g) => new Map(g).set(b, !0));
539
- const S = setTimeout(() => {
540
- D((g) => new Map(g).set(b, !1));
535
+ if (f.length > 0 && g < f.length) {
536
+ const b = f[g], S = `${b.name}`;
537
+ if (g <= (w ?? 0) || Qe(b)) return void k((_) => new Map(_).set(S, !1));
538
+ k((_) => new Map(_).set(S, !0));
539
+ const v = setTimeout(() => {
540
+ k((_) => new Map(_).set(S, !1));
541
541
  }, 1e3);
542
- return () => clearTimeout(S);
542
+ return () => clearTimeout(v);
543
543
  }
544
- }, [T, v, k]), q;
545
- })(t, i, c), y = ((v, T) => {
546
- const [k, q] = $(/* @__PURE__ */ new Set([0]));
544
+ }, [g, f, w]), I;
545
+ })(t, i, c), x = ((f, g) => {
546
+ const [w, I] = $(/* @__PURE__ */ new Set([0]));
547
547
  return te(() => {
548
- q((D) => new Set(D).add(v));
549
- }, [v]), te(() => {
550
- const D = T ?? 0;
551
- D > 0 && q((_) => {
552
- const b = new Set(_);
553
- for (let S = 0; S <= D; S++) b.add(S);
554
- return b;
548
+ I((k) => new Set(k).add(f));
549
+ }, [f]), te(() => {
550
+ const k = g ?? 0;
551
+ k > 0 && I((b) => {
552
+ const S = new Set(b);
553
+ for (let v = 0; v <= k; v++) S.add(v);
554
+ return S;
555
555
  });
556
- }, [T]), k;
557
- })(i, c), f = oe(() => ({ ...r, ...Ze(t.map((v, T) => {
558
- var k, q;
559
- return { ...v, value: T < i ? ((k = n.get(`${v.name}`)) == null ? void 0 : k.value) ?? null : null, secondaryValue: T < i ? ((q = n.get(`${v.name}`)) == null ? void 0 : q.secondaryValue) ?? null : null };
560
- })) }), [r, n, t, i]), p = Ye(t, f);
556
+ }, [g]), w;
557
+ })(i, c), p = oe(() => ({ ...r, ...Ze(t.map((f, g) => {
558
+ var w, I;
559
+ return { ...f, value: g < i ? ((w = n.get(`${f.name}`)) == null ? void 0 : w.value) ?? null : null, secondaryValue: g < i ? ((I = n.get(`${f.name}`)) == null ? void 0 : I.secondaryValue) ?? null : null };
560
+ })) }), [r, n, t, i]), T = Ye(t, p);
561
561
  te(() => {
562
562
  requestAnimationFrame(() => {
563
- l();
564
- });
565
- }, [i, l, u]);
566
- const C = le((v, T) => {
567
- if (!T) return;
568
- const k = p[i];
569
- if (!k) return;
570
- const q = `${k.name}`;
571
- a(q, v);
572
- const D = { ...v, questionText: ze(k) };
573
- s([D]);
574
- }, [p, i, s, a]), w = p.map((v, T) => ({ card: v, cardIndex: T })).filter(({ cardIndex: v }) => y.has(v));
575
- return e("div", { className: "conversational-ui ul-conversational-ui", "data-testid": "ui-container", children: [!o && e(At, {}), e("div", { className: "chat-container", children: e("div", { className: "chat-messages", children: w.map(({ card: v, cardIndex: T }) => e(Et, { avatars: d, card: v, cardIndex: T, cardResponses: n, currentQuestionBubbleRef: h, handleCardResponse: C, index: i, questionThinkingStates: u, startingQuestionIdx: c }, `question-card-${v.name}`)) }) })] });
563
+ u();
564
+ }), h();
565
+ }, [i, u, y, h]);
566
+ const D = le((f, g) => {
567
+ if (!g) return;
568
+ const w = T[i];
569
+ if (!w) return;
570
+ const I = `${w.name}`;
571
+ a(I, f);
572
+ const k = { ...f, questionText: ze(w) };
573
+ s([k]);
574
+ }, [T, i, s, a]), R = T.map((f, g) => ({ card: f, cardIndex: g })).filter(({ cardIndex: f }) => x.has(f));
575
+ return e("div", { className: "conversational-ui ul-conversational-ui", "data-testid": "ui-container", children: [!o && e(At, {}), e("div", { className: "chat-container", children: e("div", { className: "chat-messages", children: R.map(({ card: f, cardIndex: g }) => e(Et, { avatars: d, card: f, cardIndex: g, cardResponses: n, currentQuestionBubbleRef: l, handleCardResponse: D, index: i, questionThinkingStates: y, startingQuestionIdx: c }, `question-card-${f.name}`)) }) })] });
576
576
  };
577
577
  export {
578
578
  Gt as default