@sprig-technologies/sprig-bundled 2.41.2 → 2.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,33 +1,33 @@
1
- import { u as z, h as J, a as e, c as O, g as re, d as Oe, F as me, e as be, b as ge, _ as te, T as Te, A as er, p as ne, f as rr, n as tr, q as nr, M as oe, s as Ue, o as sr, i as ir, S as ar, r as lr, j as Fe, k as or, l as dr, t as cr, m as Be } from "./view-E1bmiI1s.js";
2
- import { i as se, E as Ne, h as Pe, j as Ve, A as ur } from "./index-BiIngDfi.js";
3
- import { c as ie, a as le, H as Se, M as pe, Q as ue, O as ye, B as ee, L as xe, b as ke, S as pr, u as mr, g as gr, P as hr, d as br } from "./getAttributedUrl-DxNZ8ZsR.js";
1
+ import { u as z, h as J, a as e, c as O, g as re, d as Oe, F as me, e as be, b as ge, _ as te, T as Te, A as er, p as ne, f as rr, n as tr, q as nr, M as oe, s as Ue, o as sr, i as ir, S as ar, r as lr, j as Fe, k as or, l as dr, t as cr, m as Be } from "./view-D1SzHpEx.js";
2
+ import { i as se, E as Ne, h as Pe, j as Ve, A as ur } from "./index-AmryOSUY.js";
3
+ import { c as ie, a as le, H as Se, M as pe, Q as ue, O as ye, B as ee, L as xe, b as ke, S as pr, u as mr, g as gr, P as hr, d as br } from "./getAttributedUrl-kWGm9GHO.js";
4
4
  const vr = ({ className: t, message: s, next: o, properties: n, questionId: r, type: a }) => {
5
- const { useMobileStyling: m, border: g, isLongFormSurvey: c, focusedQuestionId: p } = z((v) => ({ useMobileStyling: v.useMobileStyling, border: v.border, isLongFormSurvey: se(v.studyType), focusedQuestionId: v.focusedQuestionId })), [d, y] = J(!1), [i, f] = J(""), [u, h] = J(!1), b = c && p === r, S = n == null ? void 0 : n.collectName, C = (n == null ? void 0 : n.nameLabelText) || "Full Name", k = (n == null ? void 0 : n.consentText) || "I agree to the stated conditions", E = (n == null ? void 0 : n.submitButtonText) || "Submit", P = !!i.trim(), D = d && (!S || P), F = (v, N = !1) => {
5
+ const { useMobileStyling: m, border: g, isLongFormSurvey: c, focusedQuestionId: p } = z((v) => ({ useMobileStyling: v.useMobileStyling, border: v.border, isLongFormSurvey: se(v.studyType), focusedQuestionId: v.focusedQuestionId })), [d, y] = J(!1), [i, f] = J(""), [u, h] = J(!1), b = c && p === r, S = n == null ? void 0 : n.collectName, C = (n == null ? void 0 : n.nameLabelText) || "Full Name", k = (n == null ? void 0 : n.consentText) || "I agree to the stated conditions", E = (n == null ? void 0 : n.submitButtonText) || "Submit", M = !!i.trim(), F = d && (!S || M), D = (v, N = !1) => {
6
6
  v.preventDefault(), v.stopPropagation();
7
7
  let B = null;
8
8
  if (!N) {
9
- if (!D) return void h(!0);
9
+ if (!F) return void h(!0);
10
10
  B = { submitted: !0 }, S && (B.name = i);
11
11
  }
12
- o({ value: B, questionId: r, type: a }, D);
12
+ o({ value: B, questionId: r, type: a }, F);
13
13
  };
14
14
  return e("div", { className: O(t, c && !b && "ul-card--unfocused", "ul-card__consent-legal", "fade-in-transition"), children: [e(ie, { isRequired: c && (n == null ? void 0 : n.required), message: s, properties: { questionHtml: n.questionHtml } }), n != null && n.richTextBody ? e(le, { children: e(Se, { className: "ul-rich-text-body", html: n.richTextBody, id: "ul-card__consent-legal-body-container" }) }) : null, e(pe, { embeddedType: "pdf", properties: n, children: e(ue, { children: [e("div", { className: "sprig-stretch", children: [e(ye, { allowTextEntry: !1, border: g, error: u && !d, id: "consent", isRadio: !1, isSelected: d, label: k, onUserInputChanged: ({ selected: v }) => {
15
15
  v !== d && y(!d);
16
16
  }, useMobileStyling: m }), S && e("input", { "aria-label": C, "aria-placeholder": C, className: O(re("ul-consent-legal__name-input", m)), "data-gramm": "false", maxLength: 250, name: "name", onBlur: (v) => {
17
- v.currentTarget.style.borderColor = u && !P ? Ne : Pe;
17
+ v.currentTarget.style.borderColor = u && !M ? Ne : Pe;
18
18
  }, onFocus: (v) => {
19
- v.currentTarget.style.borderColor = u && !P ? Ne : g;
19
+ v.currentTarget.style.borderColor = u && !M ? Ne : g;
20
20
  }, onInput: (v) => {
21
21
  v.preventDefault(), v.stopPropagation(), f(v.currentTarget.value);
22
- }, placeholder: C, style: u && !P ? { borderColor: Ne } : {}, tabIndex: 0, value: i })] }), e("div", { className: "ul-card__button-wrapper ul-card-vertical__button-wrapper", children: [e(ee, { className: D ? "" : "sprig-button-disabled", onClick: F, children: E }), n.required === !1 && !c && e("button", { className: "ul-card-skip__button", onClick: (v) => F(v, !0), children: Oe(n) })] })] }) })] }, r);
22
+ }, placeholder: C, style: u && !M ? { borderColor: Ne } : {}, tabIndex: 0, value: i })] }), e("div", { className: "ul-card__button-wrapper ul-card-vertical__button-wrapper", children: [e(ee, { className: F ? "" : "sprig-button-disabled", onClick: D, children: E }), n.required === !1 && !c && e("button", { className: "ul-card-skip__button", onClick: (v) => D(v, !0), children: Oe(n) })] })] }) })] }, r);
23
23
  }, yr = ({ activeValue: t, border: s, icon: o, isPressed: n, onSubmit: r, range: a, scaleLabelType: m, selectedValue: g, setSelectedValue: c, setActiveValue: p, setIsPressed: d, useMobileStyling: y, value: i, viewDocument: f }) => {
24
- const { isLongFormSurvey: u, enableCspTrustedTypes: h } = z((N) => ({ isLongFormSurvey: se(N.studyType), enableCspTrustedTypes: N.enableCspTrustedTypes })), b = `option-${i}`, S = m === "number", C = m === "star", k = m === "smiley", E = S && i === t || i === g, [P, D] = (() => {
24
+ const { isLongFormSurvey: u, enableCspTrustedTypes: h } = z((N) => ({ isLongFormSurvey: se(N.studyType), enableCspTrustedTypes: N.enableCspTrustedTypes })), b = `option-${i}`, S = m === "number", C = m === "star", k = m === "smiley", E = S && i === t || i === g, [M, F] = (() => {
25
25
  const N = C && g !== null && i <= g;
26
26
  return C && i <= t || k && i === t || N || i === t || i === g ? [s, n || N || i === g ? 1 : 0.3] : ["", 1];
27
- })(), F = me(() => {
28
- const N = { borderColor: E ? P : "", fillOpacity: E ? "" : D, zIndex: E ? 3 : "auto", color: g === i ? "#fff" : "" };
29
- return S ? { ...N, backgroundColor: g === i ? P : "" } : { ...N, color: C || k || g === i ? P : "" };
30
- }, [E, P, D, g, i, S, C, k]), v = me(() => Ve((({ icon: N, scaleLabelType: B, value: T, selectedValue: L }) => {
27
+ })(), D = me(() => {
28
+ const N = { borderColor: E ? M : "", fillOpacity: E ? "" : F, zIndex: E ? 3 : "auto", color: g === i ? "#fff" : "" };
29
+ return S ? { ...N, backgroundColor: g === i ? M : "" } : { ...N, color: C || k || g === i ? M : "" };
30
+ }, [E, M, F, g, i, S, C, k]), v = me(() => Ve((({ icon: N, scaleLabelType: B, value: T, selectedValue: L }) => {
31
31
  if (B === "smiley" && T === L) {
32
32
  let A = 0;
33
33
  return N.replace(/black/g, () => ++A == 1 ? "black" : "white");
@@ -51,15 +51,15 @@ const vr = ({ className: t, message: s, next: o, properties: n, questionId: r, t
51
51
  N.key === "ArrowRight" ? (L = B[T + 1]) == null || L.focus() : N.key === "ArrowLeft" ? (A = B[T - 1]) == null || A.focus() : N.key !== "Enter" && N.key !== " " || (u && (N.preventDefault(), N.stopPropagation(), c(i)), r());
52
52
  }, onPointerDown: () => d(!0), onPointerEnter: () => p(i), onPointerLeave: () => {
53
53
  p(-1), d(!1);
54
- }, style: F, tabIndex: 0 });
54
+ }, style: D, tabIndex: 0 });
55
55
  }, fr = ({ className: t, labels: s, message: o, next: n, properties: r, questionId: a, type: m }) => {
56
56
  const { border: g, useMobileStyling: c, viewDocument: p, isLongFormSurvey: d, focusedQuestionId: y } = z((T) => ({ border: T.border, useMobileStyling: T.useMobileStyling, viewDocument: T.viewDocument, isLongFormSurvey: se(T.studyType), focusedQuestionId: T.focusedQuestionId })), [i, f] = J(-1), [u, h] = J(!1), [b, S] = J(null), C = d && y === a, k = s && s.left, E = s && s.right;
57
- let P;
58
- const { range: D, scaleLabelType: F, ratingIcons: v } = r;
59
- D && (P = Number(D));
60
- const N = P || 5, B = (T) => {
57
+ let M;
58
+ const { range: F, scaleLabelType: D, ratingIcons: v } = r;
59
+ F && (M = Number(F));
60
+ const N = M || 5, B = (T) => {
61
61
  var L, A;
62
- switch (F) {
62
+ switch (D) {
63
63
  case "star":
64
64
  return (L = v[0]) == null ? void 0 : L.svg;
65
65
  case "smiley":
@@ -70,7 +70,7 @@ const vr = ({ className: t, message: s, next: o, properties: n, questionId: r, t
70
70
  };
71
71
  return e("form", { className: O(t, "ul-card--likert", "fade-in-transition", d && !C && "ul-card--unfocused"), children: [e(ie, { isRequired: d && (r == null ? void 0 : r.required), message: o, properties: r }), e(pe, { properties: r, children: e(be, { children: [e(le, { children: [e("div", { "aria-label": `Rating (1 - ${N})`, className: "ul-card--likert__numbers", role: "radiogroup", children: [...Array(N)].map((T, L) => {
72
72
  const A = L + 1;
73
- return e(yr, { activeValue: i, border: g, icon: B(L), isPressed: u, onSubmit: () => n({ value: A, questionId: a, type: m }, !0), range: N, scaleLabelType: F, selectedValue: b, setActiveValue: f, setIsPressed: h, setSelectedValue: S, useMobileStyling: c, value: A, viewDocument: p }, L);
73
+ return e(yr, { activeValue: i, border: g, icon: B(L), isPressed: u, onSubmit: () => n({ value: A, questionId: a, type: m }, !0), range: N, scaleLabelType: D, selectedValue: b, setActiveValue: f, setIsPressed: h, setSelectedValue: S, useMobileStyling: c, value: A, viewDocument: p }, L);
74
74
  }) }), e("div", { className: "ul-card--likert__labels", children: [e("span", { children: k }), e("span", { children: E })] })] }), !r.required && !d && e(ue, { children: e("div", { className: "ul-vertical-centered-container", children: e(ee, { onClick: (T) => {
75
75
  T.preventDefault(), T.stopPropagation(), n({ value: null, questionId: a, type: m }, !0);
76
76
  }, children: ge(r) }) }) })] }) })] }, a);
@@ -132,24 +132,24 @@ const vr = ({ className: t, message: s, next: o, properties: n, questionId: r, t
132
132
  }
133
133
  }, children: e(i && !d ? Tr : Cr, {}) })] });
134
134
  }, Tr = () => e("svg", { fill: "currentColor", height: "32", transform: "matrix(-1,0,0,1,0,0)", version: "1.1", viewBox: "0 0 256 256", width: "32", xmlns: "http://www.w3.org/2000/svg", children: e("path", { d: "M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z" }) }), Cr = () => e("svg", { fill: "currentColor", height: "32", viewBox: "0 0 256 256", width: "32", xmlns: "http://www.w3.org/2000/svg", children: e("path", { d: "M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z" }) }), Ir = ({ className: t, message: s, next: o, options: n, properties: r, questionId: a, type: m, showIndividualSubmit: g = !1, onSubmitButtonClick: c }) => {
135
- const { useMobileStyling: p, isLongFormSurvey: d, focusedQuestionId: y, setFocusedQuestionId: i } = z((F) => ({ useMobileStyling: F.useMobileStyling, isLongFormSurvey: se(F.studyType), focusedQuestionId: F.focusedQuestionId, setFocusedQuestionId: F.setFocusedQuestionId })), f = r.matrixColumn, u = r.required, h = d && y === a, b = (F) => {
136
- F.preventDefault(), F.stopPropagation(), o({ value: C, questionId: a, type: m }, !0), c && c();
137
- }, S = n.reduce((F, v) => (F[v.id] = null, F), {}), [C, k] = J(S), E = (F) => u && Object.values(F).every((v) => v == null), P = (F, v) => {
138
- d && o({ value: { ...C, [F]: v }, questionId: a, type: m }, !E({ ...C, [F]: v })), k((N) => ({ ...N, [F]: v }));
139
- }, D = r.displayMatrixAsAccordion || p;
135
+ const { useMobileStyling: p, isLongFormSurvey: d, focusedQuestionId: y, setFocusedQuestionId: i } = z((D) => ({ useMobileStyling: D.useMobileStyling, isLongFormSurvey: se(D.studyType), focusedQuestionId: D.focusedQuestionId, setFocusedQuestionId: D.setFocusedQuestionId })), f = r.matrixColumn, u = r.required, h = d && y === a, b = (D) => {
136
+ D.preventDefault(), D.stopPropagation(), o({ value: C, questionId: a, type: m }, !0), c && c();
137
+ }, S = n.reduce((D, v) => (D[v.id] = null, D), {}), [C, k] = J(S), E = (D) => u && Object.values(D).every((v) => v == null), M = (D, v) => {
138
+ d && o({ value: { ...C, [D]: v }, questionId: a, type: m }, !E({ ...C, [D]: v })), k((N) => ({ ...N, [D]: v }));
139
+ }, F = r.displayMatrixAsAccordion || p;
140
140
  return e("form", { className: O(t, !d && "ul-card__matrix", "fade-in-transition", d && !h && "ul-card--unfocused"), id: "text-form", onClick: () => {
141
141
  h && i(a);
142
- }, onSubmit: b, children: [e(ie, { isRequired: d && (r == null ? void 0 : r.required), message: s, properties: r }), e(pe, { properties: r, children: [e(le, { children: [e(D ? Sr : kr, { columns: f, onSelect: P, options: n, selectedOptions: C }), g && e(xe, { handleSubmit: b, isSubmitDisabled: E(C) })] }), !d && e(ue, { children: e("div", { className: "ul-card__button-wrapper", children: e(ee, { disabled: E(C), children: ge(r) }) }) })] })] }, a);
142
+ }, onSubmit: b, children: [e(ie, { isRequired: d && (r == null ? void 0 : r.required), message: s, properties: r }), e(pe, { properties: r, children: [e(le, { children: [e(F ? Sr : kr, { columns: f, onSelect: M, options: n, selectedOptions: C }), g && e(xe, { handleSubmit: b, isSubmitDisabled: E(C) })] }), !d && e(ue, { children: e("div", { className: "ul-card__button-wrapper", children: e(ee, { disabled: E(C), children: ge(r) }) }) })] })] }, a);
143
143
  }, je = ({ className: t, message: s, onSubmit: o, options: n = [], properties: r, questionId: a, type: m, showIndividualSubmit: g = !1, onSubmitButtonClick: c }) => {
144
144
  const { border: p, useMobileStyling: d, isLongFormSurvey: y, focusedQuestionId: i, setFocusedQuestionId: f } = z((_) => ({ border: _.border, useMobileStyling: _.useMobileStyling, isLongFormSurvey: se(_.studyType), focusedQuestionId: _.focusedQuestionId, setFocusedQuestionId: _.setFocusedQuestionId })), u = y && i === a, h = n.reduce((_, q) => (_[q.id] = { isSelected: !1 }, _), {}), [b, S] = J(h), C = m === "multiplechoice", k = r.required, E = n.find((_) => {
145
145
  var q;
146
146
  return (q = _.optionProperties) == null ? void 0 : q.noneOfTheAbove;
147
- }), P = (_) => Object.entries(_).some(([q, H]) => {
147
+ }), M = (_) => Object.entries(_).some(([q, H]) => {
148
148
  var l;
149
149
  const W = n.find((x) => `${x.id}` === q), V = H.userText === void 0 || H.userText.trim() === "";
150
150
  return ((l = W == null ? void 0 : W.optionProperties) == null ? void 0 : l.allowsTextEntry) && V && H.isSelected;
151
- }), D = (_) => Object.values(_).filter((q) => q.isSelected).length, F = r.minSelect && r.minSelect > 0 && r.maxSelectMode === ke.Range && D(b) < r.minSelect && (k || D(b) > 0), v = (_) => P(_) || k && !D(_) || !((q) => {
152
- const { minSelect: H = 0, maxSelect: W = 1 / 0, maxSelectMode: V } = r, l = D(q);
151
+ }), F = (_) => Object.values(_).filter((q) => q.isSelected).length, D = r.minSelect && r.minSelect > 0 && r.maxSelectMode === ke.Range && F(b) < r.minSelect && (k || F(b) > 0), v = (_) => M(_) || k && !F(_) || !((q) => {
152
+ const { minSelect: H = 0, maxSelect: W = 1 / 0, maxSelectMode: V } = r, l = F(q);
153
153
  switch (V) {
154
154
  case ke.Maximum:
155
155
  return l <= W;
@@ -165,7 +165,7 @@ const vr = ({ className: t, message: s, next: o, properties: n, questionId: r, t
165
165
  X(_.id, _.selected, _.userText, _.noneOfTheAbove), _.selected && y && !C && !u && f(a);
166
166
  }, L = (_) => {
167
167
  var q;
168
- return (r == null ? void 0 : r.maxSelectMode) !== ke.Unlimited && D(b) === (r == null ? void 0 : r.maxSelect) && !((q = b[_]) != null && q.isSelected);
168
+ return (r == null ? void 0 : r.maxSelectMode) !== ke.Unlimited && F(b) === (r == null ? void 0 : r.maxSelect) && !((q = b[_]) != null && q.isSelected);
169
169
  }, A = (_) => {
170
170
  _.preventDefault(), _.stopPropagation(), o(b, !0), c && c();
171
171
  }, X = (_, q, H, W) => {
@@ -181,16 +181,16 @@ const vr = ({ className: t, message: s, next: o, properties: n, questionId: r, t
181
181
  };
182
182
  return e("form", { className: O(t, "ul-card--multiple", "fade-in-transition", y && !u && "ul-card--unfocused"), id: "text-form", onClick: m === "multipleselect" ? () => {
183
183
  y && i !== a && m === "multipleselect" && f(a);
184
- } : void 0, onSubmit: A, children: [e(ie, { isRequired: y && (r == null ? void 0 : r.required), message: s, properties: r }), e(pe, { properties: r, children: e(be, { children: [e(le, { children: [r.isDropdown ? e(pr, { disabledOptions: n.filter((_) => L(_.id)), dropdownFooter: F ? e("div", { className: "ul-card__min-select-counter", style: { marginLeft: "16px" }, children: [D(b), "/", r.minSelect] }) : void 0, isMultiSelect: !C, multiselectText: r.dropdownMultiselectedText ?? "choices selected", onChange: (_) => {
184
+ } : void 0, onSubmit: A, children: [e(ie, { isRequired: y && (r == null ? void 0 : r.required), message: s, properties: r }), e(pe, { properties: r, children: e(be, { children: [e(le, { children: [r.isDropdown ? e(pr, { disabledOptions: n.filter((_) => L(_.id)), dropdownFooter: D ? e("div", { className: "ul-card__min-select-counter", style: { marginLeft: "16px" }, children: [F(b), "/", r.minSelect] }) : void 0, isMultiSelect: !C, multiselectText: r.dropdownMultiselectedText ?? "choices selected", onChange: (_) => {
185
185
  const q = { ...b };
186
186
  for (const H of n) _.includes(H) ? q[H.id].isSelected = !0 : q[H.id].isSelected = !1;
187
187
  y && o(q, !v(q)), S(q);
188
188
  }, options: n, placeholderText: r.dropdownPlaceholderText ?? (C ? "Select choice" : "Select choice(s)"), value: n.filter((_) => b[_.id].isSelected) }) : e("div", { className: O(re("ul-card__choices", d)), role: C ? "radiogroup" : "group", children: [n.map(({ id: _, label: q, value: H, optionProperties: W }) => {
189
189
  var Q, R;
190
190
  const V = `${_}`, { allowsTextEntry: l, noneOfTheAbove: x } = { allowsTextEntry: !1, noneOfTheAbove: !1, ...W };
191
- return e(ye, { allowTextEntry: l, border: p, disabled: L(V), error: (w = b, P(w)), id: V, isRadio: C, isSelected: !!((Q = b[V]) != null && Q.isSelected), label: q, noneOfTheAbove: x, onUserInputChanged: T, promptText: (W == null ? void 0 : W.otherOptionPlaceholder) || "Please specify", text: (R = b[_]) == null ? void 0 : R.userText, useMobileStyling: d, value: H }, V);
191
+ return e(ye, { allowTextEntry: l, border: p, disabled: L(V), error: (w = b, M(w)), id: V, isRadio: C, isSelected: !!((Q = b[V]) != null && Q.isSelected), label: q, noneOfTheAbove: x, onUserInputChanged: T, promptText: (W == null ? void 0 : W.otherOptionPlaceholder) || "Please specify", text: (R = b[_]) == null ? void 0 : R.userText, useMobileStyling: d, value: H }, V);
192
192
  var w;
193
- }), !!F && e("div", { className: "ul-card__min-select-counter", children: [D(b), "/", r.minSelect] })] }), B && e(xe, { handleSubmit: A, isSubmitDisabled: v(b) })] }), !y && e(ue, { children: e("div", { className: "ul-card__button-wrapper", children: e(ee, { disabled: v(b), onClick: A, children: ge(r) }) }) })] }) })] }, a);
193
+ }), !!D && e("div", { className: "ul-card__min-select-counter", children: [F(b), "/", r.minSelect] })] }), B && e(xe, { handleSubmit: A, isSubmitDisabled: v(b) })] }), !y && e(ue, { children: e("div", { className: "ul-card__button-wrapper", children: e(ee, { disabled: v(b), onClick: A, children: ge(r) }) }) })] }) })] }, a);
194
194
  }, _r = (t) => {
195
195
  const { questionId: s, type: o, next: n, options: r } = t, { setFocusedQuestionId: a } = z((m) => ({ setFocusedQuestionId: m.setFocusedQuestionId }));
196
196
  return e(je, { ...t, onSubmit: (m, g) => {
@@ -215,9 +215,9 @@ const vr = ({ className: t, message: s, next: o, properties: n, questionId: r, t
215
215
  return e("form", { className: O(t, "ul-card--nps", "fade-in-transition", i && !u && "ul-card--unfocused"), children: [e(ie, { isRequired: i && (n == null ? void 0 : n.required), message: o, properties: n }), e(pe, { properties: n, children: [e(le, { children: [e("div", { className: "ul-card--nps__numbers", children: [...Array(11)].map((S, C) => e("button", { className: O(re("nps-number", d), re(`nps-number-${C}`, d)), id: `option-${C}`, onClick: (k) => {
216
216
  i && (k.preventDefault(), k.stopPropagation(), c(C)), r({ value: C, questionId: a, type: m }, !0);
217
217
  }, onKeyDown: (k) => {
218
- var P, D;
218
+ var M, F;
219
219
  const E = y.querySelectorAll("button.nps-number");
220
- k.key === "ArrowRight" ? (P = E[C + 1]) == null || P.focus() : k.key === "ArrowLeft" ? (D = E[C - 1]) == null || D.focus() : k.key !== "Enter" && k.key !== " " || (i && (k.preventDefault(), k.stopPropagation(), c(C)), r({ value: C, questionId: a, type: m }, !0));
220
+ k.key === "ArrowRight" ? (M = E[C + 1]) == null || M.focus() : k.key === "ArrowLeft" ? (F = E[C - 1]) == null || F.focus() : k.key !== "Enter" && k.key !== " " || (i && (k.preventDefault(), k.stopPropagation(), c(C)), r({ value: C, questionId: a, type: m }, !0));
221
221
  }, onPointerDown: (k) => {
222
222
  k.currentTarget.style.zIndex = "2", k.currentTarget.style.borderColor = p;
223
223
  }, onPointerLeave: (k) => {
@@ -231,9 +231,9 @@ const vr = ({ className: t, message: s, next: o, properties: n, questionId: r, t
231
231
  var T, L;
232
232
  f && !b && (E ? (T = k.current) == null || T.focus() : (L = k.current) == null || L.blur());
233
233
  }, [f, E, b]);
234
- const P = S.trim(), D = r.required === !0 && !P, F = mr(k, () => i()), v = (T) => {
234
+ const M = S.trim(), F = r.required === !0 && !M, D = mr(k, () => i()), v = (T) => {
235
235
  T.preventDefault(), T.stopPropagation();
236
- const L = P.length > 0, A = !r.required || L;
236
+ const L = M.length > 0, A = !r.required || L;
237
237
  n({ value: S, questionId: a, type: m }, A), c && c(L);
238
238
  }, N = r && r.openTextPlaceholder ? r.openTextPlaceholder : "";
239
239
  if (p == null && m === "aidynamicfollowup") return e(be, {});
@@ -244,13 +244,13 @@ const vr = ({ className: t, message: s, next: o, properties: n, questionId: r, t
244
244
  T.currentTarget.style.borderColor = Pe;
245
245
  }, onChange: (T) => {
246
246
  const { value: L } = T.currentTarget;
247
- if (F(), T.preventDefault(), T.stopPropagation(), C(L), f) {
247
+ if (D(), T.preventDefault(), T.stopPropagation(), C(L), f) {
248
248
  const A = L.trim().length > 0;
249
249
  n({ value: L, questionId: a, type: m }, A);
250
250
  }
251
251
  }, onFocus: (T) => {
252
252
  T.currentTarget.style.borderColor = d, h(a);
253
- }, placeholder: N, ref: k, role: "textbox", tabIndex: 0 }) }), r.footerHtml && e(Se, { className: "footer", html: r.footerHtml }), g && e(xe, { handleSubmit: v, isSubmitDisabled: D }), e(ue, { children: !f && e(ee, { disabled: D || !!p, onClick: v, children: ge(r) }) })] }) }) })] }, a);
253
+ }, placeholder: N, ref: k, role: "textbox", tabIndex: 0 }) }), r.footerHtml && e(Se, { className: "footer", html: r.footerHtml }), g && e(xe, { handleSubmit: v, isSubmitDisabled: F }), e(ue, { children: !f && e(ee, { disabled: F || !!p, onClick: v, children: ge(r) }) })] }) }) })] }, a);
254
254
  }, we = 1, Ze = 2, We = 3, Ce = (t) => t.type === "av_permission", Qe = (t) => t.type === "screen_permission", Ge = (t, s) => t === void 0 ? we : t ? ((o, n) => !(Ce(n) ? n.permissionDescriptors : []).includes("camera") || o.getVideoTracks().length > 0)(t, s) ? We : we : Ze, Ee = { avStream: null, currentPage: null, mediaRecordingUids: null, nextQuestion: () => {
255
255
  }, passthroughData: void 0, recordingMediaTypes: void 0, screenPermissionRequested: !1, type: void 0 }, de = rr((t) => ({ ...Ee, reset: () => {
256
256
  t(Ee);
@@ -355,16 +355,16 @@ const ze = "ul-permission-graphics-container", Ye = "ul-permission-body", Ke = O
355
355
  }, Er = ({ className: t, properties: s, next: o, questionId: n }) => {
356
356
  const r = z(), { surveyId: a, responseGroupUid: m, userId: g, update: c } = r, p = de(), { screenPermissionRequested: d } = p, y = de((b) => b.avStream);
357
357
  let i = de((b) => b.currentPage);
358
- i || (i = function({ pages: b, userId: S, responseGroupUid: C, surveyId: k, questionId: E, next: P }) {
359
- const { updatePage: D } = de.getState(), { eventEmitFn: F, recorderEventEmitter: v } = z.getState(), N = { questionId: E, surveyId: k, visitorId: S, responseGroupUid: C };
358
+ i || (i = function({ pages: b, userId: S, responseGroupUid: C, surveyId: k, questionId: E, next: M }) {
359
+ const { updatePage: F } = de.getState(), { eventEmitFn: D, recorderEventEmitter: v } = z.getState(), N = { questionId: E, surveyId: k, visitorId: S, responseGroupUid: C };
360
360
  let B = 0;
361
- v.emit("recorded.task.permission.screen"), F("recorded.task.permission.screen"), v.emit("permission.status", { "permission.status.callback": (L, A, X, _) => {
361
+ v.emit("recorded.task.permission.screen"), D("recorded.task.permission.screen"), v.emit("permission.status", { "permission.status.callback": (L, A, X, _) => {
362
362
  const q = b[B], { type: H } = q, W = ["screen"];
363
363
  if (Ce(q)) {
364
364
  const { permissionDescriptors: V } = q, l = V == null ? void 0 : V.includes("microphone"), x = V == null ? void 0 : V.includes("camera");
365
365
  l && W.push("audio"), x && W.push("video"), (L != null && L.active && !x || L != null && L.active && A) && B++;
366
366
  }
367
- Qe(b[B]) && X && (B++, v.emit("begin.recording", { "recording.media.types": W, "start.recording.callback": (V) => D({ mediaRecordingUids: V }) })), D({ currentPage: b[B], avStream: L, screenPermissionRequested: X, nextQuestion: P, type: H, passthroughData: N, recordingMediaTypes: W, captureStream: _ });
367
+ Qe(b[B]) && X && (B++, v.emit("begin.recording", { "recording.media.types": W, "start.recording.callback": (V) => F({ mediaRecordingUids: V }) })), F({ currentPage: b[B], avStream: L, screenPermissionRequested: X, nextQuestion: M, type: H, passthroughData: N, recordingMediaTypes: W, captureStream: _ });
368
368
  } });
369
369
  const T = b[B];
370
370
  return T.type === "av_permission" && qe({ currentPage: T, pages: b }), T;
@@ -401,7 +401,7 @@ const ze = "ul-permission-graphics-container", Ye = "ul-permission-body", Ke = O
401
401
  const r = Math.round(Math.min(99, ...Object.values(s).filter((a) => a.isSubmitted).map((a) => a.progressPct || 0)));
402
402
  return e("div", { className: O(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(ie, { message: `${o} (${r}% complete)` }), e("p", { className: "ul-caption", children: n })] });
403
403
  }, Je = tr(void 0), Vr = ({ value: t, children: s }) => e(Je.Provider, { value: t, children: s }), Hr = ({ isRightLabel: t, isLeftLabel: s }) => t ? oe.RIGHT : s ? oe.LEFT : null, jr = "Best", Zr = "Worst", Wr = ({ className: t, labels: s, message: o, properties: n, options: r, questionId: a, type: m, next: g }) => {
404
- var E, P, D, F;
404
+ var E, M, F, D;
405
405
  const [c, p] = J(r.map((v, N) => ({ ...v, label: v.label === "" ? `Item ${N + 1}` : v.label, isRightLabel: !1, isLeftLabel: !1 }))), d = (() => {
406
406
  const v = nr(Je);
407
407
  if (v === void 0) throw new Error("usePreviousResponses must be used within a PreviousResponsesProvider");
@@ -421,33 +421,33 @@ const ze = "ul-permission-graphics-container", Ye = "ul-permission-body", Ke = O
421
421
  }, [c]);
422
422
  const { border: u, useMobileStyling: h, enableCspTrustedTypes: b } = z((v) => ({ border: v.border, useMobileStyling: v.useMobileStyling, enableCspTrustedTypes: v.enableCspTrustedTypes })), S = (v, N) => () => {
423
423
  i || p((B) => ((T, L, A) => T.map((X) => X.id === L ? { ...X, isRightLabel: A === oe.RIGHT, isLeftLabel: A === oe.LEFT } : A === oe.RIGHT && X.isRightLabel || A === oe.LEFT && X.isLeftLabel ? { ...X, isRightLabel: !1, isLeftLabel: !1 } : X))(B, v, N));
424
- }, C = (E = n.ratingIcons) == null ? void 0 : E[0].svg, k = (P = n.ratingIcons) == null ? void 0 : P[1].svg;
425
- return e("form", { className: O(t, "ul-card-maxdiff", "fade-in-transition"), children: [e(ie, { isRequired: n == null ? void 0 : n.required, message: o, properties: n }), e(le, { children: e("div", { className: "ul-card--maxdiff__question-inner-container", children: [e("div", { className: "ul-card-maxdiff__label", children: (s == null ? void 0 : s.left) || ((D = n == null ? void 0 : n.labels) == null ? void 0 : D.left) || jr }), e("div", { children: " " }), e("div", { className: "ul-card-maxdiff__label", children: (s == null ? void 0 : s.right) || ((F = n == null ? void 0 : n.labels) == null ? void 0 : F.right) || Zr }), c.map(({ id: v, label: N, isLeftLabel: B, isRightLabel: T }) => e(be, { children: [e("div", { className: "ul-card-maxdiff__option-control " + (k ? "smiley" : ""), children: k ? e($e, { ariaPressed: B, className: B ? "ul-card-maxdiff__option-btn ul-card-maxdiff__option-selected good" : "ul-card-maxdiff__option-btn", enableCspTrustedTypes: b, html: k, id: `smiley-good-${v}`, onClick: S(v, oe.LEFT) }) : e(ye, { allowTextEntry: !1, ariaLabel: `bestLabel-${N}`, border: u, choiceStyle: y, error: !1, id: `${v}`, isRadio: !0, isSelected: B, onUserInputChanged: S(v, oe.LEFT), useMobileStyling: h }) }), e("div", { className: "ul-card-maxdiff__option-label", children: N }), e("div", { className: "ul-card-maxdiff__option-control " + (C ? "smiley" : ""), children: C ? e($e, { ariaPressed: T, className: T ? "ul-card-maxdiff__option-btn ul-card-maxdiff__option-selected bad" : "ul-card-maxdiff__option-btn", enableCspTrustedTypes: b, html: C, id: `smiley-bad-${v}`, onClick: S(v, oe.RIGHT) }) : e(ye, { allowTextEntry: !1, ariaLabel: `worstLabel-${N}`, border: u, choiceStyle: y, error: !1, id: `${v}`, isRadio: !0, isSelected: T, onUserInputChanged: S(v, oe.RIGHT), useMobileStyling: h }) })] }))] }) })] }, a);
424
+ }, C = (E = n.ratingIcons) == null ? void 0 : E[0].svg, k = (M = n.ratingIcons) == null ? void 0 : M[1].svg;
425
+ return e("form", { className: O(t, "ul-card-maxdiff", "fade-in-transition"), children: [e(ie, { isRequired: n == null ? void 0 : n.required, message: o, properties: n }), e(le, { children: e("div", { className: "ul-card--maxdiff__question-inner-container", children: [e("div", { className: "ul-card-maxdiff__label", children: (s == null ? void 0 : s.left) || ((F = n == null ? void 0 : n.labels) == null ? void 0 : F.left) || jr }), e("div", { children: " " }), e("div", { className: "ul-card-maxdiff__label", children: (s == null ? void 0 : s.right) || ((D = n == null ? void 0 : n.labels) == null ? void 0 : D.right) || Zr }), c.map(({ id: v, label: N, isLeftLabel: B, isRightLabel: T }) => e(be, { children: [e("div", { className: "ul-card-maxdiff__option-control " + (k ? "smiley" : ""), children: k ? e($e, { ariaPressed: B, className: B ? "ul-card-maxdiff__option-btn ul-card-maxdiff__option-selected good" : "ul-card-maxdiff__option-btn", enableCspTrustedTypes: b, html: k, id: `smiley-good-${v}`, onClick: S(v, oe.LEFT) }) : e(ye, { allowTextEntry: !1, ariaLabel: `bestLabel-${N}`, border: u, choiceStyle: y, error: !1, id: `${v}`, isRadio: !0, isSelected: B, onUserInputChanged: S(v, oe.LEFT), useMobileStyling: h }) }), e("div", { className: "ul-card-maxdiff__option-label", children: N }), e("div", { className: "ul-card-maxdiff__option-control " + (C ? "smiley" : ""), children: C ? e($e, { ariaPressed: T, className: T ? "ul-card-maxdiff__option-btn ul-card-maxdiff__option-selected bad" : "ul-card-maxdiff__option-btn", enableCspTrustedTypes: b, html: C, id: `smiley-bad-${v}`, onClick: S(v, oe.RIGHT) }) : e(ye, { allowTextEntry: !1, ariaLabel: `worstLabel-${N}`, border: u, choiceStyle: y, error: !1, id: `${v}`, isRadio: !0, isSelected: T, onUserInputChanged: S(v, oe.RIGHT), useMobileStyling: h }) })] }))] }) })] }, a);
426
426
  }, $e = ({ enableCspTrustedTypes: t, ariaPressed: s, className: o, html: n, id: r, onClick: a }) => {
427
427
  const m = me(() => Ve(n, t), [t, n]);
428
428
  return e("span", { "aria-pressed": s, className: o, dangerouslySetInnerHTML: { __html: m }, id: r, onClick: a, tabIndex: 0, type: "button" });
429
429
  }, Gr = ({ className: t, labels: s, message: o, next: n, properties: r, questionId: a, type: m, onSubmitButtonClick: g, options: c, showIndividualSubmit: p = !1 }) => {
430
- const d = te(null), y = te(0), i = te(0), f = te(null), u = te(!1), h = te([]), [b, S] = J(() => (r == null ? void 0 : r.required) === !0), [C, k] = J(() => c.map((I) => ({ ...I, rank: null }))), E = me(() => Array.from({ length: c.length }, (I, $) => $ + 1), [c.length]), { isLongFormSurvey: P, focusedQuestionId: D, setFocusedQuestionId: F, useMobileStyling: v, isPreview: N, headers: B } = z((I) => ({ useMobileStyling: I.useMobileStyling, isLongFormSurvey: se(I.studyType), focusedQuestionId: I.focusedQuestionId, setFocusedQuestionId: I.setFocusedQuestionId, isPreview: I.isPreview, headers: I.headers })), T = (B == null ? void 0 : B["userleap-platform"]) === "android", L = v && !N && !T, A = !L && !T, X = P && D === a, _ = (I) => {
430
+ const d = te(null), y = te(0), i = te(0), f = te(null), u = te(!1), h = te([]), [b, S] = J(() => (r == null ? void 0 : r.required) === !0), [C, k] = J(() => c.map((I) => ({ ...I, rank: null }))), E = me(() => Array.from({ length: c.length }, (I, $) => $ + 1), [c.length]), { isLongFormSurvey: M, focusedQuestionId: F, setFocusedQuestionId: D, useMobileStyling: v, isPreview: N, headers: B } = z((I) => ({ useMobileStyling: I.useMobileStyling, isLongFormSurvey: se(I.studyType), focusedQuestionId: I.focusedQuestionId, setFocusedQuestionId: I.setFocusedQuestionId, isPreview: I.isPreview, headers: I.headers })), T = (B == null ? void 0 : B["userleap-platform"]) === "android", L = v && !N && !T, A = !L && !T, X = M && F === a, _ = (I) => {
431
431
  I.preventDefault(), w(C), g && g();
432
432
  }, q = (I, $) => {
433
433
  k((U) => {
434
- const M = parseInt($), Z = U.map((G) => ({ ...G }));
434
+ const P = parseInt($), Z = U.map((G) => ({ ...G }));
435
435
  Z.some((G) => G.rank == null) && Z.forEach((G, ve) => G.rank = ve + 1);
436
436
  const ae = Z.findIndex((G) => G.id === I);
437
437
  if (ae === -1) return U;
438
438
  const K = Z[ae].rank;
439
- return M < K ? Z.forEach((G) => {
440
- G.id !== I && G.rank >= M && G.rank < K && (G.rank = G.rank + 1);
441
- }) : M > K && Z.forEach((G) => {
442
- G.id !== I && G.rank > K && G.rank <= M && (G.rank = G.rank - 1);
443
- }), Z[ae].rank = M, Z.sort((G, ve) => G.rank - ve.rank), Q(Z), Z;
439
+ return P < K ? Z.forEach((G) => {
440
+ G.id !== I && G.rank >= P && G.rank < K && (G.rank = G.rank + 1);
441
+ }) : P > K && Z.forEach((G) => {
442
+ G.id !== I && G.rank > K && G.rank <= P && (G.rank = G.rank - 1);
443
+ }), Z[ae].rank = P, Z.sort((G, ve) => G.rank - ve.rank), Q(Z), Z;
444
444
  });
445
445
  }, H = (I, $) => {
446
446
  for (let U = 0; U < h.current.length; U++) {
447
- const M = h.current[U];
448
- if (!M || M === f.current) continue;
449
- const Z = M.getBoundingClientRect();
450
- if (I >= Z.left && I <= Z.right && $ >= Z.top && $ <= Z.bottom) return { element: M, index: U };
447
+ const P = h.current[U];
448
+ if (!P || P === f.current) continue;
449
+ const Z = P.getBoundingClientRect();
450
+ if (I >= Z.left && I <= Z.right && $ >= Z.top && $ <= Z.bottom) return { element: P, index: U };
451
451
  }
452
452
  return null;
453
453
  }, W = (I) => ($) => {
@@ -455,8 +455,8 @@ const ze = "ul-permission-graphics-container", Ye = "ul-permission-body", Ke = O
455
455
  $.preventDefault(), $.stopPropagation(), u.current = !0, d.current = I;
456
456
  const U = $.touches[0];
457
457
  y.current = U.clientY, i.current = U.clientY;
458
- const M = $.currentTarget.closest(".ul-card-rank__option");
459
- M && (f.current = M, M.classList.add("is-dragging"));
458
+ const P = $.currentTarget.closest(".ul-card-rank__option");
459
+ P && (f.current = P, P.classList.add("is-dragging"));
460
460
  }, V = (I) => {
461
461
  if (!L || !u.current || d.current === null) return;
462
462
  I.preventDefault(), I.stopPropagation();
@@ -466,27 +466,27 @@ const ze = "ul-permission-graphics-container", Ye = "ul-permission-body", Ke = O
466
466
  f.current && (f.current.style.transform = `translateY(${U}px)`, f.current.style.zIndex = "1000"), h.current.forEach((Z) => {
467
467
  Z && Z !== f.current && Z.classList.remove("is-drop-target");
468
468
  });
469
- const M = H($.clientX, $.clientY);
470
- M && M.element.classList.add("is-drop-target");
469
+ const P = H($.clientX, $.clientY);
470
+ P && P.element.classList.add("is-drop-target");
471
471
  }, l = (I) => {
472
472
  if (!L || !u.current || d.current === null) return;
473
473
  I.preventDefault(), I.stopPropagation();
474
474
  const $ = I.changedTouches[0], U = H($.clientX, $.clientY);
475
- f.current && (f.current.style.transform = "", f.current.style.zIndex = "", f.current.classList.remove("is-dragging")), h.current.forEach((M) => {
476
- M && M.classList.remove("is-drop-target");
475
+ f.current && (f.current.style.transform = "", f.current.style.zIndex = "", f.current.classList.remove("is-dragging")), h.current.forEach((P) => {
476
+ P && P.classList.remove("is-drop-target");
477
477
  }), U && U.index !== d.current && x(d.current, U.index), d.current = null, f.current = null, u.current = !1;
478
478
  }, x = (I, $) => {
479
479
  k((U) => {
480
- const M = U.map((ae) => ({ ...ae })), [Z] = M.splice(I, 1);
481
- return M.splice($, 0, Z), M.forEach((ae, K) => {
480
+ const P = U.map((ae) => ({ ...ae })), [Z] = P.splice(I, 1);
481
+ return P.splice($, 0, Z), P.forEach((ae, K) => {
482
482
  ae.rank = K + 1;
483
- }), Q(M), M;
483
+ }), Q(P), P;
484
484
  });
485
485
  }, w = (I) => {
486
486
  const $ = {};
487
- I.reduce((U, M) => (U[M.id] = M.rank, U), $), n({ value: $, questionId: a, type: m }, !0);
487
+ I.reduce((U, P) => (U[P.id] = P.rank, U), $), n({ value: $, questionId: a, type: m }, !0);
488
488
  }, Q = (I) => {
489
- S(!1), P && w(I);
489
+ S(!1), M && w(I);
490
490
  }, { left: R, right: j } = s, Y = c.length, ce = (I) => {
491
491
  I.preventDefault(), I.currentTarget.classList.add("is-drop-target");
492
492
  }, he = (I) => {
@@ -494,27 +494,27 @@ const ze = "ul-permission-graphics-container", Ye = "ul-permission-body", Ke = O
494
494
  }, fe = (I) => {
495
495
  d.current = null, I.currentTarget.classList.remove("is-dragging");
496
496
  };
497
- return e("form", { className: O(t, "ul-card-rank", "fade-in-transition", P && !X && "ul-card--unfocused"), onClick: P ? () => {
498
- P && D !== a && F(a);
499
- } : void 0, onSubmit: _, children: [e(ie, { isRequired: r == null ? void 0 : r.required, message: o, properties: r }), e(pe, { properties: r, children: e(be, T ? { children: [e(le, { children: [e("div", { className: "ul-card--rank__question-inner-container", children: [e("div", { className: "ul-card-rank__labels", children: e("span", { children: ["1 - ", R] }) }), e("ol", { className: "ul-card-rank__list", children: C.map(({ id: I, label: $, rank: U }) => e("li", { className: "ul-card-rank__option", children: [e("select", { "aria-label": `Rank for ${$}`, className: O("ul-card-rank__select", U == null && "ul-card-rank__select--placeholder"), name: `rank[${I}]`, onChange: (M) => q(I, M.currentTarget.value), value: U ?? "", children: [U == null && e("option", { className: "ul-card-rank__select-option", disabled: !0, value: "", children: "-" }), E.map((M) => e("option", { className: "ul-card-rank__select-option", value: M, children: M }, `${M}-${a}`))] }), e("span", { children: $ })] }, I)) }), e("div", { className: "ul-card-rank__labels", children: e("span", { children: [Y, " - ", j] }) })] }), p && e(xe, { handleSubmit: _, isSubmitDisabled: b })] }), !P && e(ue, { children: e("div", { className: "ul-card__button-wrapper", children: e(ee, { disabled: b, children: ge(r) }) }) })] } : { children: [e(le, { children: [e("div", { className: "ul-card--rank__question-inner-container", children: [e("div", { className: "ul-card-rank__labels", children: e("span", { children: ["1 - ", R] }) }), e("ol", { className: "ul-card-rank__list", onDragOver: T ? void 0 : (I) => {
497
+ return e("form", { className: O(t, "ul-card-rank", "fade-in-transition", M && !X && "ul-card--unfocused"), onClick: M && !X ? () => {
498
+ D(a);
499
+ } : void 0, onSubmit: _, children: [e(ie, { isRequired: r == null ? void 0 : r.required, message: o, properties: r }), e(pe, { properties: r, children: e(be, T ? { children: [e(le, { children: [e("div", { className: "ul-card--rank__question-inner-container", children: [e("div", { className: "ul-card-rank__labels", children: e("span", { children: ["1 - ", R] }) }), e("ol", { className: "ul-card-rank__list", children: C.map(({ id: I, label: $, rank: U }) => e("li", { className: "ul-card-rank__option", children: [e("select", { "aria-label": `Rank for ${$}`, className: O("ul-card-rank__select", U == null && "ul-card-rank__select--placeholder"), name: `rank[${I}]`, onChange: (P) => q(I, P.currentTarget.value), value: U ?? "", children: [U == null && e("option", { className: "ul-card-rank__select-option", disabled: !0, value: "", children: "-" }), E.map((P) => e("option", { className: "ul-card-rank__select-option", value: P, children: P }, `${P}-${a}`))] }), e("span", { children: $ })] }, I)) }), e("div", { className: "ul-card-rank__labels", children: e("span", { children: [Y, " - ", j] }) })] }), p && e(xe, { handleSubmit: _, isSubmitDisabled: b })] }), !M && e(ue, { children: e("div", { className: "ul-card__button-wrapper", children: e(ee, { disabled: b, children: ge(r) }) }) })] } : { children: [e(le, { children: [e("div", { className: "ul-card--rank__question-inner-container", children: [e("div", { className: "ul-card-rank__labels", children: e("span", { children: ["1 - ", R] }) }), e("ol", { className: "ul-card-rank__list", onDragOver: T ? void 0 : (I) => {
500
500
  I.preventDefault(), I.dataTransfer && (I.dataTransfer.dropEffect = "move");
501
- }, children: C.map(({ id: I, label: $, rank: U }, M) => {
502
- return e("li", { className: "ul-card-rank__option", draggable: !!A || void 0, onDragEnd: A ? fe : void 0, onDragEnter: A ? ce : void 0, onDragLeave: A ? he : void 0, onDragStart: A ? (ae = M, (K) => {
501
+ }, children: C.map(({ id: I, label: $, rank: U }, P) => {
502
+ return e("li", { className: "ul-card-rank__option", draggable: !!A || void 0, onDragEnd: A ? fe : void 0, onDragEnter: A ? ce : void 0, onDragLeave: A ? he : void 0, onDragStart: A ? (ae = P, (K) => {
503
503
  d.current = ae, K.dataTransfer && (K.dataTransfer.effectAllowed = "move", K.dataTransfer.setData("text/plain", String(ae)), K.currentTarget.classList.add("is-dragging"));
504
- }) : void 0, onDrop: A ? (Z = M, (K) => {
504
+ }) : void 0, onDrop: A ? (Z = P, (K) => {
505
505
  var ve, De;
506
506
  K.preventDefault(), K.currentTarget.classList.remove("is-drop-target");
507
507
  const G = d.current;
508
508
  d.current = null, (De = (ve = K.currentTarget.closest(".ul-card-rank__list")) == null ? void 0 : ve.querySelector(".is-dragging")) == null || De.classList.remove("is-dragging"), G != null && G !== Z && x(G, Z);
509
- }) : void 0, ref: (K) => h.current[M] = K, children: [e("select", { "aria-label": `Rank for ${$}`, className: O("ul-card-rank__select", U == null && "ul-card-rank__select--placeholder"), name: `rank[${I}]`, onChange: (K) => q(I, K.currentTarget.value), value: U ?? "", children: [U == null && e("option", { className: "ul-card-rank__select-option", disabled: !0, value: "", children: "-" }), E.map((K) => e("option", { className: "ul-card-rank__select-option", value: K, children: K }, `${K}-${a}`))] }), e("span", { children: $ }), !T && e("button", { "aria-label": `Drag ${$} to reorder`, className: "ul-card-rank__drag-btn", onTouchEnd: L ? l : void 0, onTouchMove: L ? V : void 0, onTouchStart: L ? W(M) : 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" }) }) })] }, I);
509
+ }) : void 0, ref: (K) => h.current[P] = K, children: [e("select", { "aria-label": `Rank for ${$}`, className: O("ul-card-rank__select", U == null && "ul-card-rank__select--placeholder"), name: `rank[${I}]`, onChange: (K) => q(I, K.currentTarget.value), value: U ?? "", children: [U == null && e("option", { className: "ul-card-rank__select-option", disabled: !0, value: "", children: "-" }), E.map((K) => e("option", { className: "ul-card-rank__select-option", value: K, children: K }, `${K}-${a}`))] }), e("span", { children: $ }), !T && e("button", { "aria-label": `Drag ${$} to reorder`, className: "ul-card-rank__drag-btn", onTouchEnd: L ? l : void 0, onTouchMove: L ? V : void 0, onTouchStart: L ? W(P) : 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" }) }) })] }, I);
510
510
  var Z, ae;
511
- }) }), e("div", { className: "ul-card-rank__labels", children: e("span", { children: [Y, " - ", j] }) })] }), p && e(xe, { handleSubmit: _, isSubmitDisabled: b })] }), !P && e(ue, { children: e("div", { className: "ul-card__button-wrapper", children: e(ee, { disabled: b, children: ge(r) }) }) })] }) })] }, a);
511
+ }) }), e("div", { className: "ul-card-rank__labels", children: e("span", { children: [Y, " - ", j] }) })] }), p && e(xe, { handleSubmit: _, isSubmitDisabled: b })] }), !M && e(ue, { children: e("div", { className: "ul-card__button-wrapper", children: e(ee, { disabled: b, children: ge(r) }) }) })] }) })] }, a);
512
512
  }, zr = /* @__PURE__ */ new Set(["aidynamicfollowup", "open", "matrix", "multipleselect", "multiplechoice", "rankorder"]), Ae = ({ cardInstance: t, moveToNextQuestion: s, showIndividualSubmit: o, submitQuestion: n, updateCardValues: r, allResponsesArray: a }) => {
513
513
  const { isLongFormSurvey: m, createDynamicQuestion: g, cards: c, surveyVisitorAttributes: p } = z((k) => ({ isLongFormSurvey: se(k.studyType), createDynamicQuestion: k.createDynamicQuestion, cards: k.cards, surveyVisitorAttributes: k.surveyVisitorAttributes }));
514
514
  if (!t) return null;
515
515
  const { name: d, type: y, props: i, childId: f } = t, u = o && zr.has(y), h = i == null ? void 0 : i.displayLogic, b = h == null ? void 0 : Ue({ displayLogic: h, allResponses: a, cards: c, surveyVisitorAttributes: p ?? {} });
516
516
  if (h && h.length > 0 && !b) return null;
517
- const S = { className: "ul-card", next: (k, E, P = !0) => n(k, E && P), questionId: d, type: y, showIndividualSubmit: o, ...u ? { next: (k, E) => {
517
+ const S = { className: "ul-card", next: (k, E, M = !0) => n(k, E && M), questionId: d, type: y, showIndividualSubmit: o, ...u ? { next: (k, E) => {
518
518
  r(k.questionId, k, E ?? !0);
519
519
  }, onSubmitButtonClick: (k = !1) => {
520
520
  f ? k ? (s(d), g({ parentQuestionId: d })) : s(f) : s(d);
@@ -583,23 +583,23 @@ const ze = "ul-permission-graphics-container", Ye = "ul-permission-body", Ke = O
583
583
  }));
584
584
  E.current = new Set(l);
585
585
  }, [k]);
586
- const P = te(null), D = te(!1), F = te(null), v = Te((l) => {
586
+ const M = te(null), F = te(!1), D = te(null), v = Te((l) => {
587
587
  var R, j;
588
- D.current = !0;
588
+ F.current = !0;
589
589
  const x = t.findIndex((Y) => Y.name === l);
590
- if (!c || l === null || x === -1) return void (D.current = !1);
591
- const w = (R = P.current) == null ? void 0 : R.querySelectorAll(".ul-card-scroll-wrapper")[x], Q = (j = P.current) == null ? void 0 : j.closest(".ul-card-main-content");
590
+ if (!c || l === null || x === -1) return void (F.current = !1);
591
+ const w = (R = M.current) == null ? void 0 : R.querySelectorAll(".ul-card-scroll-wrapper")[x], Q = (j = M.current) == null ? void 0 : j.closest(".ul-card-main-content");
592
592
  if (w && Q) {
593
593
  if (w && Q) {
594
594
  const Y = w.getBoundingClientRect(), ce = Q.getBoundingClientRect(), he = Y.top - ce.top + Q.scrollTop, fe = he + Y.height / 2, I = window.innerHeight - 157;
595
595
  let $;
596
596
  Y.height >= I ? $ = he : $ = fe - Q.clientHeight / 2;
597
- const U = Q.clientHeight, M = Q.scrollHeight - U, Z = Math.max(0, Math.min($, M));
597
+ const U = Q.clientHeight, P = Q.scrollHeight - U, Z = Math.max(0, Math.min($, P));
598
598
  Q.scrollTo({ top: Z, behavior: "smooth" }), setTimeout(() => {
599
- D.current = !1;
599
+ F.current = !1;
600
600
  }, 500);
601
601
  }
602
- } else D.current = !1;
602
+ } else F.current = !1;
603
603
  }, [c, t]);
604
604
  ne(() => {
605
605
  p !== null && t.findIndex((l) => l.name === p) !== -1 || d(t[0].name);
@@ -623,28 +623,28 @@ const ze = "ul-permission-graphics-container", Ye = "ul-permission-body", Ke = O
623
623
  x < t.length ? d(t[x].name) : d(l);
624
624
  };
625
625
  ne(() => {
626
- c && p !== null && (F.current !== p ? v(p) : F.current = null);
626
+ c && p !== null && (D.current !== p ? v(p) : D.current = null);
627
627
  }, [p, c, v]);
628
628
  const L = Te(() => {
629
629
  var ce, he;
630
- if (D.current) return;
631
- const l = (ce = P.current) == null ? void 0 : ce.closest(".ul-card-main-content");
630
+ if (F.current) return;
631
+ const l = (ce = M.current) == null ? void 0 : ce.closest(".ul-card-main-content");
632
632
  if (!l) return;
633
- const x = (he = P.current) == null ? void 0 : he.querySelectorAll(".ul-card-scroll-wrapper");
633
+ const x = (he = M.current) == null ? void 0 : he.querySelectorAll(".ul-card-scroll-wrapper");
634
634
  if (!x || x.length === 0) return;
635
635
  const w = l.getBoundingClientRect(), Q = w.top + w.height / 2;
636
636
  let R = 0, j = 1 / 0;
637
637
  x.forEach((fe, I) => {
638
- const $ = fe.getBoundingClientRect(), U = $.top + $.height / 2, M = Math.abs(Q - U);
639
- M < j && (j = M, R = I);
638
+ const $ = fe.getBoundingClientRect(), U = $.top + $.height / 2, P = Math.abs(Q - U);
639
+ P < j && (j = P, R = I);
640
640
  });
641
641
  const Y = t[R];
642
- F.current = Y.name, d(Y.name);
642
+ D.current = Y.name, d(Y.name);
643
643
  }, [t, d]);
644
644
  ne(() => {
645
645
  var x;
646
646
  if (!c) return;
647
- const l = ((x = P.current) == null ? void 0 : x.closest(".ul-card__container")) || null;
647
+ const l = ((x = M.current) == null ? void 0 : x.closest(".ul-card__container")) || null;
648
648
  return l && l.addEventListener("scroll", L, { passive: !0 }), () => {
649
649
  l && l.removeEventListener("scroll", L);
650
650
  };
@@ -692,7 +692,7 @@ const ze = "ul-permission-graphics-container", Ye = "ul-permission-body", Ke = O
692
692
  N({ displayCard: w, response: l }), s([Q]);
693
693
  }
694
694
  }, q = (l) => (/* @__PURE__ */ new Set(["nps", "likert", "multiplechoice"])).has(l), H = (l) => (/* @__PURE__ */ new Set(["videovoice", "consentlegal", "texturlprompt", "maxdiff"])).has(l), W = ((V = t[0]) == null ? void 0 : V.type) === "thanks";
695
- return c ? e("div", { className: "ul-card-list-container--longform", "data-testid": "ui-container", ref: P, children: [e(Vr, { value: o, children: S.map((l, x) => e(Ae, { allResponsesArray: C, cardInstance: l, moveToNextQuestion: T, showIndividualSubmit: c && t.length > 1 && x < t.length - 1, submitQuestion: _, updateCardValues: X }, (l == null ? void 0 : l.name) || x)) }), !W && e(Yr, { isSubmitDisabled: !A, onSubmit: function() {
695
+ return c ? e("div", { className: "ul-card-list-container--longform", "data-testid": "ui-container", ref: M, children: [e(Vr, { value: o, children: S.map((l, x) => e(Ae, { allResponsesArray: C, cardInstance: l, moveToNextQuestion: T, showIndividualSubmit: c && t.length > 1 && x < t.length - 1, submitQuestion: _, updateCardValues: X }, (l == null ? void 0 : l.name) || x)) }), !W && e(Yr, { isSubmitDisabled: !A, onSubmit: function() {
696
696
  const l = B(t, r);
697
697
  if ((S == null ? void 0 : S.length) === 1 && (l == null ? void 0 : l.length) === 1) {
698
698
  const x = S[0], w = l[0];