@sprig-technologies/sprig-bundled 1.1.3 → 1.1.5

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,4019 +0,0 @@
1
- import { g as pr, a as fr, C as b, b as G, T as W, i as ze, c as yt, D as xt, A as _e, I as ee, e as Le, s as $e, S as oe, d as ye, P as Ke, f as _r, R as hr, u as Ye, h as mr, j as gr, k as br, l as w, E as vr, m as H, n as xe, o as st, p as pe, q as z, r as Se, t as B, v as I, M as Q, w as yr, x as xr, y as Cr, z as Ct, B as kr } from "./index-Ist5vU7V.js";
2
- var Te, x, tn, ce, kt, nn, Je, rn, we = {}, on = [], Sr = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, Ve = Array.isArray;
3
- function J(e, t) {
4
- for (var n in t)
5
- e[n] = t[n];
6
- return e;
7
- }
8
- function an(e) {
9
- var t = e.parentNode;
10
- t && t.removeChild(e);
11
- }
12
- function V(e, t, n) {
13
- var r, o, i, a = {};
14
- for (i in t)
15
- i == "key" ? r = t[i] : i == "ref" ? o = t[i] : a[i] = t[i];
16
- if (arguments.length > 2 && (a.children = arguments.length > 3 ? Te.call(arguments, 2) : n), typeof e == "function" && e.defaultProps != null)
17
- for (i in e.defaultProps)
18
- a[i] === void 0 && (a[i] = e.defaultProps[i]);
19
- return Ce(e, a, r, o, null);
20
- }
21
- function Ce(e, t, n, r, o) {
22
- var i = { type: e, props: t, key: n, ref: r, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, constructor: void 0, __v: o ?? ++tn, __i: -1, __u: 0 };
23
- return o == null && x.vnode != null && x.vnode(i), i;
24
- }
25
- function sn() {
26
- return { current: null };
27
- }
28
- function j(e) {
29
- return e.children;
30
- }
31
- function Z(e, t) {
32
- this.props = e, this.context = t;
33
- }
34
- function he(e, t) {
35
- if (t == null)
36
- return e.__ ? he(e.__, e.__i + 1) : null;
37
- for (var n; t < e.__k.length; t++)
38
- if ((n = e.__k[t]) != null && n.__e != null)
39
- return n.__e;
40
- return typeof e.type == "function" ? he(e) : null;
41
- }
42
- function ln(e) {
43
- var t, n;
44
- if ((e = e.__) != null && e.__c != null) {
45
- for (e.__e = e.__c.base = null, t = 0; t < e.__k.length; t++)
46
- if ((n = e.__k[t]) != null && n.__e != null) {
47
- e.__e = e.__c.base = n.__e;
48
- break;
49
- }
50
- return ln(e);
51
- }
52
- }
53
- function Xe(e) {
54
- (!e.__d && (e.__d = !0) && ce.push(e) && !Oe.__r++ || kt !== x.debounceRendering) && ((kt = x.debounceRendering) || nn)(Oe);
55
- }
56
- function Oe() {
57
- var e, t, n, r, o, i, a, l, c;
58
- for (ce.sort(Je); e = ce.shift(); )
59
- e.__d && (t = ce.length, r = void 0, i = (o = (n = e).__v).__e, l = [], c = [], (a = n.__P) && ((r = J({}, o)).__v = o.__v + 1, x.vnode && x.vnode(r), lt(a, r, o, n.__n, a.ownerSVGElement !== void 0, 32 & o.__u ? [i] : null, l, i ?? he(o), !!(32 & o.__u), c), r.__.__k[r.__i] = r, dn(l, r, c), r.__e != i && ln(r)), ce.length > t && ce.sort(Je));
60
- Oe.__r = 0;
61
- }
62
- function cn(e, t, n, r, o, i, a, l, c, d, p) {
63
- var s, _, f, m, g, y = r && r.__k || on, v = t.length;
64
- for (n.__d = c, wr(n, t, y), c = n.__d, s = 0; s < v; s++)
65
- (f = n.__k[s]) != null && typeof f != "boolean" && typeof f != "function" && (_ = f.__i === -1 ? we : y[f.__i] || we, f.__i = s, lt(e, f, _, o, i, a, l, c, d, p), m = f.__e, f.ref && _.ref != f.ref && (_.ref && ct(_.ref, null, f), p.push(f.ref, f.__c || m, f)), g == null && m != null && (g = m), 65536 & f.__u || _.__k === f.__k ? c = un(f, c, e) : typeof f.type == "function" && f.__d !== void 0 ? c = f.__d : m && (c = m.nextSibling), f.__d = void 0, f.__u &= -196609);
66
- n.__d = c, n.__e = g;
67
- }
68
- function wr(e, t, n) {
69
- var r, o, i, a, l, c = t.length, d = n.length, p = d, s = 0;
70
- for (e.__k = [], r = 0; r < c; r++)
71
- (o = e.__k[r] = (o = t[r]) == null || typeof o == "boolean" || typeof o == "function" ? null : typeof o == "string" || typeof o == "number" || typeof o == "bigint" || o.constructor == String ? Ce(null, o, null, null, o) : Ve(o) ? Ce(j, { children: o }, null, null, null) : o.constructor === void 0 && o.__b > 0 ? Ce(o.type, o.props, o.key, o.ref ? o.ref : null, o.__v) : o) != null ? (o.__ = e, o.__b = e.__b + 1, l = Tr(o, n, a = r + s, p), o.__i = l, i = null, l !== -1 && (p--, (i = n[l]) && (i.__u |= 131072)), i == null || i.__v === null ? (l == -1 && s--, typeof o.type != "function" && (o.__u |= 65536)) : l !== a && (l === a + 1 ? s++ : l > a ? p > c - a ? s += l - a : s-- : s = l < a && l == a - 1 ? l - a : 0, l !== r + s && (o.__u |= 65536))) : (i = n[r]) && i.key == null && i.__e && (i.__e == e.__d && (e.__d = he(i)), et(i, i, !1), n[r] = null, p--);
72
- if (p)
73
- for (r = 0; r < d; r++)
74
- (i = n[r]) != null && !(131072 & i.__u) && (i.__e == e.__d && (e.__d = he(i)), et(i, i));
75
- }
76
- function un(e, t, n) {
77
- var r, o;
78
- if (typeof e.type == "function") {
79
- for (r = e.__k, o = 0; r && o < r.length; o++)
80
- r[o] && (r[o].__ = e, t = un(r[o], t, n));
81
- return t;
82
- }
83
- return e.__e != t && (n.insertBefore(e.__e, t || null), t = e.__e), t && t.nextSibling;
84
- }
85
- function X(e, t) {
86
- return t = t || [], e == null || typeof e == "boolean" || (Ve(e) ? e.some(function(n) {
87
- X(n, t);
88
- }) : t.push(e)), t;
89
- }
90
- function Tr(e, t, n, r) {
91
- var o = e.key, i = e.type, a = n - 1, l = n + 1, c = t[n];
92
- if (c === null || c && o == c.key && i === c.type)
93
- return n;
94
- if (r > (c != null && !(131072 & c.__u) ? 1 : 0))
95
- for (; a >= 0 || l < t.length; ) {
96
- if (a >= 0) {
97
- if ((c = t[a]) && !(131072 & c.__u) && o == c.key && i === c.type)
98
- return a;
99
- a--;
100
- }
101
- if (l < t.length) {
102
- if ((c = t[l]) && !(131072 & c.__u) && o == c.key && i === c.type)
103
- return l;
104
- l++;
105
- }
106
- }
107
- return -1;
108
- }
109
- function St(e, t, n) {
110
- t[0] === "-" ? e.setProperty(t, n ?? "") : e[t] = n == null ? "" : typeof n != "number" || Sr.test(t) ? n : n + "px";
111
- }
112
- function Ne(e, t, n, r, o) {
113
- var i;
114
- e:
115
- if (t === "style")
116
- if (typeof n == "string")
117
- e.style.cssText = n;
118
- else {
119
- if (typeof r == "string" && (e.style.cssText = r = ""), r)
120
- for (t in r)
121
- n && t in n || St(e.style, t, "");
122
- if (n)
123
- for (t in n)
124
- r && n[t] === r[t] || St(e.style, t, n[t]);
125
- }
126
- else if (t[0] === "o" && t[1] === "n")
127
- i = t !== (t = t.replace(/(PointerCapture)$|Capture$/, "$1")), t = t.toLowerCase() in e ? t.toLowerCase().slice(2) : t.slice(2), e.l || (e.l = {}), e.l[t + i] = n, n ? r ? n.u = r.u : (n.u = Date.now(), e.addEventListener(t, i ? Tt : wt, i)) : e.removeEventListener(t, i ? Tt : wt, i);
128
- else {
129
- if (o)
130
- t = t.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
131
- else if (t !== "width" && t !== "height" && t !== "href" && t !== "list" && t !== "form" && t !== "tabIndex" && t !== "download" && t !== "rowSpan" && t !== "colSpan" && t !== "role" && t in e)
132
- try {
133
- e[t] = n ?? "";
134
- break e;
135
- } catch {
136
- }
137
- typeof n == "function" || (n == null || n === !1 && t[4] !== "-" ? e.removeAttribute(t) : e.setAttribute(t, n));
138
- }
139
- }
140
- function wt(e) {
141
- var t = this.l[e.type + !1];
142
- if (e.t) {
143
- if (e.t <= t.u)
144
- return;
145
- } else
146
- e.t = Date.now();
147
- return t(x.event ? x.event(e) : e);
148
- }
149
- function Tt(e) {
150
- return this.l[e.type + !0](x.event ? x.event(e) : e);
151
- }
152
- function lt(e, t, n, r, o, i, a, l, c, d) {
153
- var p, s, _, f, m, g, y, v, C, k, R, P, S, A, N, h = t.type;
154
- if (t.constructor !== void 0)
155
- return null;
156
- 128 & n.__u && (c = !!(32 & n.__u), i = [l = t.__e = n.__e]), (p = x.__b) && p(t);
157
- e:
158
- if (typeof h == "function")
159
- try {
160
- if (v = t.props, C = (p = h.contextType) && r[p.__c], k = p ? C ? C.props.value : p.__ : r, n.__c ? y = (s = t.__c = n.__c).__ = s.__E : ("prototype" in h && h.prototype.render ? t.__c = s = new h(v, k) : (t.__c = s = new Z(v, k), s.constructor = h, s.render = Er), C && C.sub(s), s.props = v, s.state || (s.state = {}), s.context = k, s.__n = r, _ = s.__d = !0, s.__h = [], s._sb = []), s.__s == null && (s.__s = s.state), h.getDerivedStateFromProps != null && (s.__s == s.state && (s.__s = J({}, s.__s)), J(s.__s, h.getDerivedStateFromProps(v, s.__s))), f = s.props, m = s.state, s.__v = t, _)
161
- h.getDerivedStateFromProps == null && s.componentWillMount != null && s.componentWillMount(), s.componentDidMount != null && s.__h.push(s.componentDidMount);
162
- else {
163
- if (h.getDerivedStateFromProps == null && v !== f && s.componentWillReceiveProps != null && s.componentWillReceiveProps(v, k), !s.__e && (s.shouldComponentUpdate != null && s.shouldComponentUpdate(v, s.__s, k) === !1 || t.__v === n.__v)) {
164
- for (t.__v !== n.__v && (s.props = v, s.state = s.__s, s.__d = !1), t.__e = n.__e, t.__k = n.__k, t.__k.forEach(function(T) {
165
- T && (T.__ = t);
166
- }), R = 0; R < s._sb.length; R++)
167
- s.__h.push(s._sb[R]);
168
- s._sb = [], s.__h.length && a.push(s);
169
- break e;
170
- }
171
- s.componentWillUpdate != null && s.componentWillUpdate(v, s.__s, k), s.componentDidUpdate != null && s.__h.push(function() {
172
- s.componentDidUpdate(f, m, g);
173
- });
174
- }
175
- if (s.context = k, s.props = v, s.__P = e, s.__e = !1, P = x.__r, S = 0, "prototype" in h && h.prototype.render) {
176
- for (s.state = s.__s, s.__d = !1, P && P(t), p = s.render(s.props, s.state, s.context), A = 0; A < s._sb.length; A++)
177
- s.__h.push(s._sb[A]);
178
- s._sb = [];
179
- } else
180
- do
181
- s.__d = !1, P && P(t), p = s.render(s.props, s.state, s.context), s.state = s.__s;
182
- while (s.__d && ++S < 25);
183
- s.state = s.__s, s.getChildContext != null && (r = J(J({}, r), s.getChildContext())), _ || s.getSnapshotBeforeUpdate == null || (g = s.getSnapshotBeforeUpdate(f, m)), cn(e, Ve(N = p != null && p.type === j && p.key == null ? p.props.children : p) ? N : [N], t, n, r, o, i, a, l, c, d), s.base = t.__e, t.__u &= -161, s.__h.length && a.push(s), y && (s.__E = s.__ = null);
184
- } catch (T) {
185
- t.__v = null, c || i != null ? (t.__e = l, t.__u |= c ? 160 : 32, i[i.indexOf(l)] = null) : (t.__e = n.__e, t.__k = n.__k), x.__e(T, t, n);
186
- }
187
- else
188
- i == null && t.__v === n.__v ? (t.__k = n.__k, t.__e = n.__e) : t.__e = Pr(n.__e, t, n, r, o, i, a, c, d);
189
- (p = x.diffed) && p(t);
190
- }
191
- function dn(e, t, n) {
192
- t.__d = void 0;
193
- for (var r = 0; r < n.length; r++)
194
- ct(n[r], n[++r], n[++r]);
195
- x.__c && x.__c(t, e), e.some(function(o) {
196
- try {
197
- e = o.__h, o.__h = [], e.some(function(i) {
198
- i.call(o);
199
- });
200
- } catch (i) {
201
- x.__e(i, o.__v);
202
- }
203
- });
204
- }
205
- function Pr(e, t, n, r, o, i, a, l, c) {
206
- var d, p, s, _, f, m, g, y = n.props, v = t.props, C = t.type;
207
- if (C === "svg" && (o = !0), i != null) {
208
- for (d = 0; d < i.length; d++)
209
- if ((f = i[d]) && "setAttribute" in f == !!C && (C ? f.localName === C : f.nodeType === 3)) {
210
- e = f, i[d] = null;
211
- break;
212
- }
213
- }
214
- if (e == null) {
215
- if (C === null)
216
- return document.createTextNode(v);
217
- e = o ? document.createElementNS("http://www.w3.org/2000/svg", C) : document.createElement(C, v.is && v), i = null, l = !1;
218
- }
219
- if (C === null)
220
- y === v || l && e.data === v || (e.data = v);
221
- else {
222
- if (i = i && Te.call(e.childNodes), y = n.props || we, !l && i != null)
223
- for (y = {}, d = 0; d < e.attributes.length; d++)
224
- y[(f = e.attributes[d]).name] = f.value;
225
- for (d in y)
226
- f = y[d], d == "children" || (d == "dangerouslySetInnerHTML" ? s = f : d === "key" || d in v || Ne(e, d, null, f, o));
227
- for (d in v)
228
- f = v[d], d == "children" ? _ = f : d == "dangerouslySetInnerHTML" ? p = f : d == "value" ? m = f : d == "checked" ? g = f : d === "key" || l && typeof f != "function" || y[d] === f || Ne(e, d, f, y[d], o);
229
- if (p)
230
- l || s && (p.__html === s.__html || p.__html === e.innerHTML) || (e.innerHTML = p.__html), t.__k = [];
231
- else if (s && (e.innerHTML = ""), cn(e, Ve(_) ? _ : [_], t, n, r, o && C !== "foreignObject", i, a, i ? i[0] : n.__k && he(n, 0), l, c), i != null)
232
- for (d = i.length; d--; )
233
- i[d] != null && an(i[d]);
234
- l || (d = "value", m !== void 0 && (m !== e[d] || C === "progress" && !m || C === "option" && m !== y[d]) && Ne(e, d, m, y[d], !1), d = "checked", g !== void 0 && g !== e[d] && Ne(e, d, g, y[d], !1));
235
- }
236
- return e;
237
- }
238
- function ct(e, t, n) {
239
- try {
240
- typeof e == "function" ? e(t) : e.current = t;
241
- } catch (r) {
242
- x.__e(r, n);
243
- }
244
- }
245
- function et(e, t, n) {
246
- var r, o;
247
- if (x.unmount && x.unmount(e), (r = e.ref) && (r.current && r.current !== e.__e || ct(r, null, t)), (r = e.__c) != null) {
248
- if (r.componentWillUnmount)
249
- try {
250
- r.componentWillUnmount();
251
- } catch (i) {
252
- x.__e(i, t);
253
- }
254
- r.base = r.__P = null, e.__c = void 0;
255
- }
256
- if (r = e.__k)
257
- for (o = 0; o < r.length; o++)
258
- r[o] && et(r[o], t, n || typeof e.type != "function");
259
- n || e.__e == null || an(e.__e), e.__ = e.__e = e.__d = void 0;
260
- }
261
- function Er(e, t, n) {
262
- return this.constructor(e, n);
263
- }
264
- function me(e, t, n) {
265
- var r, o, i, a;
266
- x.__ && x.__(e, t), o = (r = typeof n == "function") ? null : n && n.__k || t.__k, i = [], a = [], lt(t, e = (!r && n || t).__k = V(j, null, [e]), o || we, we, t.ownerSVGElement !== void 0, !r && n ? [n] : o ? null : t.firstChild ? Te.call(t.childNodes) : null, i, !r && n ? n : o ? o.__e : t.firstChild, r, a), dn(i, e, a);
267
- }
268
- function pn(e, t) {
269
- me(e, t, pn);
270
- }
271
- function Rr(e, t, n) {
272
- var r, o, i, a, l = J({}, e.props);
273
- for (i in e.type && e.type.defaultProps && (a = e.type.defaultProps), t)
274
- i == "key" ? r = t[i] : i == "ref" ? o = t[i] : l[i] = t[i] === void 0 && a !== void 0 ? a[i] : t[i];
275
- return arguments.length > 2 && (l.children = arguments.length > 3 ? Te.call(arguments, 2) : n), Ce(e.type, l, r || e.key, o || e.ref, null);
276
- }
277
- function fn(e, t) {
278
- var n = { __c: t = "__cC" + rn++, __: e, Consumer: function(r, o) {
279
- return r.children(o);
280
- }, Provider: function(r) {
281
- var o, i;
282
- return this.getChildContext || (o = [], (i = {})[t] = this, this.getChildContext = function() {
283
- return i;
284
- }, this.shouldComponentUpdate = function(a) {
285
- this.props.value !== a.value && o.some(function(l) {
286
- l.__e = !0, Xe(l);
287
- });
288
- }, this.sub = function(a) {
289
- o.push(a);
290
- var l = a.componentWillUnmount;
291
- a.componentWillUnmount = function() {
292
- o.splice(o.indexOf(a), 1), l && l.call(a);
293
- };
294
- }), r.children;
295
- } };
296
- return n.Provider.__ = n.Consumer.contextType = n;
297
- }
298
- Te = on.slice, x = { __e: function(e, t, n, r) {
299
- for (var o, i, a; t = t.__; )
300
- if ((o = t.__c) && !o.__)
301
- try {
302
- if ((i = o.constructor) && i.getDerivedStateFromError != null && (o.setState(i.getDerivedStateFromError(e)), a = o.__d), o.componentDidCatch != null && (o.componentDidCatch(e, r || {}), a = o.__d), a)
303
- return o.__E = o;
304
- } catch (l) {
305
- e = l;
306
- }
307
- throw e;
308
- } }, tn = 0, Z.prototype.setState = function(e, t) {
309
- var n;
310
- n = this.__s != null && this.__s !== this.state ? this.__s : this.__s = J({}, this.state), typeof e == "function" && (e = e(J({}, n), this.props)), e && J(n, e), e != null && this.__v && (t && this._sb.push(t), Xe(this));
311
- }, Z.prototype.forceUpdate = function(e) {
312
- this.__v && (this.__e = !0, e && this.__h.push(e), Xe(this));
313
- }, Z.prototype.render = j, ce = [], nn = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, Je = function(e, t) {
314
- return e.__v.__b - t.__v.__b;
315
- }, Oe.__r = 0, rn = 0;
316
- function _n(e) {
317
- var t, n, r = "";
318
- if (typeof e == "string" || typeof e == "number")
319
- r += e;
320
- else if (typeof e == "object")
321
- if (Array.isArray(e))
322
- for (t = 0; t < e.length; t++)
323
- e[t] && (n = _n(e[t])) && (r && (r += " "), r += n);
324
- else
325
- for (t in e)
326
- e[t] && (r && (r += " "), r += t);
327
- return r;
328
- }
329
- function L() {
330
- for (var e, t, n = 0, r = ""; n < arguments.length; )
331
- (e = arguments[n++]) && (t = _n(e)) && (r && (r += " "), r += t);
332
- return r;
333
- }
334
- var te, M, We, Pt, ge = 0, hn = [], Ie = [], Et = x.__b, Rt = x.__r, Nt = x.diffed, Lt = x.__c, It = x.unmount;
335
- function ue(e, t) {
336
- x.__h && x.__h(M, e, ge || t), ge = 0;
337
- var n = M.__H || (M.__H = { __: [], __h: [] });
338
- return e >= n.__.length && n.__.push({ __V: Ie }), n.__[e];
339
- }
340
- function D(e) {
341
- return ge = 1, ut(yn, e);
342
- }
343
- function ut(e, t, n) {
344
- var r = ue(te++, 2);
345
- if (r.t = e, !r.__c && (r.__ = [n ? n(t) : yn(void 0, t), function(l) {
346
- var c = r.__N ? r.__N[0] : r.__[0], d = r.t(c, l);
347
- c !== d && (r.__N = [d, r.__[1]], r.__c.setState({}));
348
- }], r.__c = M, !M.u)) {
349
- var o = function(l, c, d) {
350
- if (!r.__c.__H)
351
- return !0;
352
- var p = r.__c.__H.__.filter(function(_) {
353
- return _.__c;
354
- });
355
- if (p.every(function(_) {
356
- return !_.__N;
357
- }))
358
- return !i || i.call(this, l, c, d);
359
- var s = !1;
360
- return p.forEach(function(_) {
361
- if (_.__N) {
362
- var f = _.__[0];
363
- _.__ = _.__N, _.__N = void 0, f !== _.__[0] && (s = !0);
364
- }
365
- }), !(!s && r.__c.props === l) && (!i || i.call(this, l, c, d));
366
- };
367
- M.u = !0;
368
- var i = M.shouldComponentUpdate, a = M.componentWillUpdate;
369
- M.componentWillUpdate = function(l, c, d) {
370
- if (this.__e) {
371
- var p = i;
372
- i = void 0, o(l, c, d), i = p;
373
- }
374
- a && a.call(this, l, c, d);
375
- }, M.shouldComponentUpdate = o;
376
- }
377
- return r.__N || r.__;
378
- }
379
- function F(e, t) {
380
- var n = ue(te++, 3);
381
- !x.__s && pt(n.__H, t) && (n.__ = e, n.i = t, M.__H.__h.push(n));
382
- }
383
- function Pe(e, t) {
384
- var n = ue(te++, 4);
385
- !x.__s && pt(n.__H, t) && (n.__ = e, n.i = t, M.__h.push(n));
386
- }
387
- function ne(e) {
388
- return ge = 5, He(function() {
389
- return { current: e };
390
- }, []);
391
- }
392
- function mn(e, t, n) {
393
- ge = 6, Pe(function() {
394
- return typeof e == "function" ? (e(t()), function() {
395
- return e(null);
396
- }) : e ? (e.current = t(), function() {
397
- return e.current = null;
398
- }) : void 0;
399
- }, n == null ? n : n.concat(e));
400
- }
401
- function He(e, t) {
402
- var n = ue(te++, 7);
403
- return pt(n.__H, t) ? (n.__V = e(), n.i = t, n.__h = e, n.__V) : n.__;
404
- }
405
- function gn(e, t) {
406
- return ge = 8, He(function() {
407
- return e;
408
- }, t);
409
- }
410
- function bn(e) {
411
- var t = M.context[e.__c], n = ue(te++, 9);
412
- return n.c = e, t ? (n.__ == null && (n.__ = !0, t.sub(M)), t.props.value) : e.__;
413
- }
414
- function dt(e, t) {
415
- x.useDebugValue && x.useDebugValue(t ? t(e) : e);
416
- }
417
- function Nr(e) {
418
- var t = ue(te++, 10), n = D();
419
- return t.__ = e, M.componentDidCatch || (M.componentDidCatch = function(r, o) {
420
- t.__ && t.__(r, o), n[1](r);
421
- }), [n[0], function() {
422
- n[1](void 0);
423
- }];
424
- }
425
- function vn() {
426
- var e = ue(te++, 11);
427
- if (!e.__) {
428
- for (var t = M.__v; t !== null && !t.__m && t.__ !== null; )
429
- t = t.__;
430
- var n = t.__m || (t.__m = [0, 0]);
431
- e.__ = "P" + n[0] + "-" + n[1]++;
432
- }
433
- return e.__;
434
- }
435
- function Lr() {
436
- for (var e; e = hn.shift(); )
437
- if (e.__P && e.__H)
438
- try {
439
- e.__H.__h.forEach(Ae), e.__H.__h.forEach(tt), e.__H.__h = [];
440
- } catch (t) {
441
- e.__H.__h = [], x.__e(t, e.__v);
442
- }
443
- }
444
- x.__b = function(e) {
445
- M = null, Et && Et(e);
446
- }, x.__r = function(e) {
447
- Rt && Rt(e), te = 0;
448
- var t = (M = e.__c).__H;
449
- t && (We === M ? (t.__h = [], M.__h = [], t.__.forEach(function(n) {
450
- n.__N && (n.__ = n.__N), n.__V = Ie, n.__N = n.i = void 0;
451
- })) : (t.__h.forEach(Ae), t.__h.forEach(tt), t.__h = [], te = 0)), We = M;
452
- }, x.diffed = function(e) {
453
- Nt && Nt(e);
454
- var t = e.__c;
455
- t && t.__H && (t.__H.__h.length && (hn.push(t) !== 1 && Pt === x.requestAnimationFrame || ((Pt = x.requestAnimationFrame) || Ir)(Lr)), t.__H.__.forEach(function(n) {
456
- n.i && (n.__H = n.i), n.__V !== Ie && (n.__ = n.__V), n.i = void 0, n.__V = Ie;
457
- })), We = M = null;
458
- }, x.__c = function(e, t) {
459
- t.some(function(n) {
460
- try {
461
- n.__h.forEach(Ae), n.__h = n.__h.filter(function(r) {
462
- return !r.__ || tt(r);
463
- });
464
- } catch (r) {
465
- t.some(function(o) {
466
- o.__h && (o.__h = []);
467
- }), t = [], x.__e(r, n.__v);
468
- }
469
- }), Lt && Lt(e, t);
470
- }, x.unmount = function(e) {
471
- It && It(e);
472
- var t, n = e.__c;
473
- n && n.__H && (n.__H.__.forEach(function(r) {
474
- try {
475
- Ae(r);
476
- } catch (o) {
477
- t = o;
478
- }
479
- }), n.__H = void 0, t && x.__e(t, n.__v));
480
- };
481
- var At = typeof requestAnimationFrame == "function";
482
- function Ir(e) {
483
- var t, n = function() {
484
- clearTimeout(r), At && cancelAnimationFrame(t), setTimeout(e);
485
- }, r = setTimeout(n, 100);
486
- At && (t = requestAnimationFrame(n));
487
- }
488
- function Ae(e) {
489
- var t = M, n = e.__c;
490
- typeof n == "function" && (e.__c = void 0, n()), M = t;
491
- }
492
- function tt(e) {
493
- var t = M;
494
- e.__c = e.__(), M = t;
495
- }
496
- function pt(e, t) {
497
- return !e || e.length !== t.length || t.some(function(n, r) {
498
- return n !== e[r];
499
- });
500
- }
501
- function yn(e, t) {
502
- return typeof t == "function" ? t(e) : t;
503
- }
504
- function xn(e, t) {
505
- for (var n in t)
506
- e[n] = t[n];
507
- return e;
508
- }
509
- function nt(e, t) {
510
- for (var n in e)
511
- if (n !== "__source" && !(n in t))
512
- return !0;
513
- for (var r in t)
514
- if (r !== "__source" && e[r] !== t[r])
515
- return !0;
516
- return !1;
517
- }
518
- function Ue(e) {
519
- this.props = e;
520
- }
521
- function Cn(e, t) {
522
- function n(o) {
523
- var i = this.props.ref, a = i == o.ref;
524
- return !a && i && (i.call ? i(null) : i.current = null), t ? !t(this.props, o) || !a : nt(this.props, o);
525
- }
526
- function r(o) {
527
- return this.shouldComponentUpdate = n, V(e, o);
528
- }
529
- return r.displayName = "Memo(" + (e.displayName || e.name) + ")", r.prototype.isReactComponent = !0, r.__f = !0, r;
530
- }
531
- (Ue.prototype = new Z()).isPureReactComponent = !0, Ue.prototype.shouldComponentUpdate = function(e, t) {
532
- return nt(this.props, e) || nt(this.state, t);
533
- };
534
- var Mt = x.__b;
535
- x.__b = function(e) {
536
- e.type && e.type.__f && e.ref && (e.props.ref = e.ref, e.ref = null), Mt && Mt(e);
537
- };
538
- var Ar = typeof Symbol < "u" && Symbol.for && Symbol.for("react.forward_ref") || 3911;
539
- function kn(e) {
540
- function t(n) {
541
- var r = xn({}, n);
542
- return delete r.ref, e(r, n.ref || null);
543
- }
544
- return t.$$typeof = Ar, t.render = t, t.prototype.isReactComponent = t.__f = !0, t.displayName = "ForwardRef(" + (e.displayName || e.name) + ")", t;
545
- }
546
- var $t = function(e, t) {
547
- return e == null ? null : X(X(e).map(t));
548
- }, Sn = { map: $t, forEach: $t, count: function(e) {
549
- return e ? X(e).length : 0;
550
- }, only: function(e) {
551
- var t = X(e);
552
- if (t.length !== 1)
553
- throw "Children.only";
554
- return t[0];
555
- }, toArray: X }, Mr = x.__e;
556
- x.__e = function(e, t, n, r) {
557
- if (e.then) {
558
- for (var o, i = t; i = i.__; )
559
- if ((o = i.__c) && o.__c)
560
- return t.__e == null && (t.__e = n.__e, t.__k = n.__k), o.__c(e, t);
561
- }
562
- Mr(e, t, n, r);
563
- };
564
- var Ot = x.unmount;
565
- function wn(e, t, n) {
566
- return e && (e.__c && e.__c.__H && (e.__c.__H.__.forEach(function(r) {
567
- typeof r.__c == "function" && r.__c();
568
- }), e.__c.__H = null), (e = xn({}, e)).__c != null && (e.__c.__P === n && (e.__c.__P = t), e.__c = null), e.__k = e.__k && e.__k.map(function(r) {
569
- return wn(r, t, n);
570
- })), e;
571
- }
572
- function Tn(e, t, n) {
573
- return e && n && (e.__v = null, e.__k = e.__k && e.__k.map(function(r) {
574
- return Tn(r, t, n);
575
- }), e.__c && e.__c.__P === t && (e.__e && n.appendChild(e.__e), e.__c.__e = !0, e.__c.__P = n)), e;
576
- }
577
- function ke() {
578
- this.__u = 0, this.t = null, this.__b = null;
579
- }
580
- function Pn(e) {
581
- var t = e.__.__c;
582
- return t && t.__a && t.__a(e);
583
- }
584
- function En(e) {
585
- var t, n, r;
586
- function o(i) {
587
- if (t || (t = e()).then(function(a) {
588
- n = a.default || a;
589
- }, function(a) {
590
- r = a;
591
- }), r)
592
- throw r;
593
- if (!n)
594
- throw t;
595
- return V(n, i);
596
- }
597
- return o.displayName = "Lazy", o.__f = !0, o;
598
- }
599
- function fe() {
600
- this.u = null, this.o = null;
601
- }
602
- x.unmount = function(e) {
603
- var t = e.__c;
604
- t && t.__R && t.__R(), t && 32 & e.__u && (e.type = null), Ot && Ot(e);
605
- }, (ke.prototype = new Z()).__c = function(e, t) {
606
- var n = t.__c, r = this;
607
- r.t == null && (r.t = []), r.t.push(n);
608
- var o = Pn(r.__v), i = !1, a = function() {
609
- i || (i = !0, n.__R = null, o ? o(l) : l());
610
- };
611
- n.__R = a;
612
- var l = function() {
613
- if (!--r.__u) {
614
- if (r.state.__a) {
615
- var c = r.state.__a;
616
- r.__v.__k[0] = Tn(c, c.__c.__P, c.__c.__O);
617
- }
618
- var d;
619
- for (r.setState({ __a: r.__b = null }); d = r.t.pop(); )
620
- d.forceUpdate();
621
- }
622
- };
623
- r.__u++ || 32 & t.__u || r.setState({ __a: r.__b = r.__v.__k[0] }), e.then(a, a);
624
- }, ke.prototype.componentWillUnmount = function() {
625
- this.t = [];
626
- }, ke.prototype.render = function(e, t) {
627
- if (this.__b) {
628
- if (this.__v.__k) {
629
- var n = document.createElement("div"), r = this.__v.__k[0].__c;
630
- this.__v.__k[0] = wn(this.__b, n, r.__O = r.__P);
631
- }
632
- this.__b = null;
633
- }
634
- var o = t.__a && V(j, null, e.fallback);
635
- return o && (o.__u &= -33), [V(j, null, t.__a ? null : e.children), o];
636
- };
637
- var Ut = function(e, t, n) {
638
- if (++n[1] === n[0] && e.o.delete(t), e.props.revealOrder && (e.props.revealOrder[0] !== "t" || !e.o.size))
639
- for (n = e.u; n; ) {
640
- for (; n.length > 3; )
641
- n.pop()();
642
- if (n[1] < n[0])
643
- break;
644
- e.u = n = n[2];
645
- }
646
- };
647
- function $r(e) {
648
- return this.getChildContext = function() {
649
- return e.context;
650
- }, e.children;
651
- }
652
- function Or(e) {
653
- var t = this, n = e.i;
654
- t.componentWillUnmount = function() {
655
- me(null, t.l), t.l = null, t.i = null;
656
- }, t.i && t.i !== n && t.componentWillUnmount(), t.l || (t.i = n, t.l = { nodeType: 1, parentNode: n, childNodes: [], appendChild: function(r) {
657
- this.childNodes.push(r), t.i.appendChild(r);
658
- }, insertBefore: function(r, o) {
659
- this.childNodes.push(r), t.i.appendChild(r);
660
- }, removeChild: function(r) {
661
- this.childNodes.splice(this.childNodes.indexOf(r) >>> 1, 1), t.i.removeChild(r);
662
- } }), me(V($r, { context: t.context }, e.__v), t.l);
663
- }
664
- function Rn(e, t) {
665
- var n = V(Or, { __v: e, i: t });
666
- return n.containerInfo = t, n;
667
- }
668
- (fe.prototype = new Z()).__a = function(e) {
669
- var t = this, n = Pn(t.__v), r = t.o.get(e);
670
- return r[0]++, function(o) {
671
- var i = function() {
672
- t.props.revealOrder ? (r.push(o), Ut(t, e, r)) : o();
673
- };
674
- n ? n(i) : i();
675
- };
676
- }, fe.prototype.render = function(e) {
677
- this.u = null, this.o = /* @__PURE__ */ new Map();
678
- var t = X(e.children);
679
- e.revealOrder && e.revealOrder[0] === "b" && t.reverse();
680
- for (var n = t.length; n--; )
681
- this.o.set(t[n], this.u = [1, 0, this.u]);
682
- return e.children;
683
- }, fe.prototype.componentDidUpdate = fe.prototype.componentDidMount = function() {
684
- var e = this;
685
- this.o.forEach(function(t, n) {
686
- Ut(e, n, t);
687
- });
688
- };
689
- var Nn = typeof Symbol < "u" && Symbol.for && Symbol.for("react.element") || 60103, Ur = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/, Vr = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, Hr = /[A-Z0-9]/g, Br = typeof document < "u", Dr = function(e) {
690
- return (typeof Symbol < "u" && typeof Symbol() == "symbol" ? /fil|che|rad/ : /fil|che|ra/).test(e);
691
- };
692
- function Ln(e, t, n) {
693
- return t.__k == null && (t.textContent = ""), me(e, t), typeof n == "function" && n(), e ? e.__c : null;
694
- }
695
- function In(e, t, n) {
696
- return pn(e, t), typeof n == "function" && n(), e ? e.__c : null;
697
- }
698
- Z.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(e) {
699
- Object.defineProperty(Z.prototype, e, { configurable: !0, get: function() {
700
- return this["UNSAFE_" + e];
701
- }, set: function(t) {
702
- Object.defineProperty(this, e, { configurable: !0, writable: !0, value: t });
703
- } });
704
- });
705
- var Vt = x.event;
706
- function jr() {
707
- }
708
- function Fr() {
709
- return this.cancelBubble;
710
- }
711
- function qr() {
712
- return this.defaultPrevented;
713
- }
714
- x.event = function(e) {
715
- return Vt && (e = Vt(e)), e.persist = jr, e.isPropagationStopped = Fr, e.isDefaultPrevented = qr, e.nativeEvent = e;
716
- };
717
- var ft, zr = { enumerable: !1, configurable: !0, get: function() {
718
- return this.class;
719
- } }, Ht = x.vnode;
720
- x.vnode = function(e) {
721
- typeof e.type == "string" && function(t) {
722
- var n = t.props, r = t.type, o = {};
723
- for (var i in n) {
724
- var a = n[i];
725
- if (!(i === "value" && "defaultValue" in n && a == null || Br && i === "children" && r === "noscript" || i === "class" || i === "className")) {
726
- var l = i.toLowerCase();
727
- i === "defaultValue" && "value" in n && n.value == null ? i = "value" : i === "download" && a === !0 ? a = "" : l === "ondoubleclick" ? i = "ondblclick" : l !== "onchange" || r !== "input" && r !== "textarea" || Dr(n.type) ? l === "onfocus" ? i = "onfocusin" : l === "onblur" ? i = "onfocusout" : Vr.test(i) ? i = l : r.indexOf("-") === -1 && Ur.test(i) ? i = i.replace(Hr, "-$&").toLowerCase() : a === null && (a = void 0) : l = i = "oninput", l === "oninput" && o[i = l] && (i = "oninputCapture"), o[i] = a;
728
- }
729
- }
730
- r == "select" && o.multiple && Array.isArray(o.value) && (o.value = X(n.children).forEach(function(c) {
731
- c.props.selected = o.value.indexOf(c.props.value) != -1;
732
- })), r == "select" && o.defaultValue != null && (o.value = X(n.children).forEach(function(c) {
733
- c.props.selected = o.multiple ? o.defaultValue.indexOf(c.props.value) != -1 : o.defaultValue == c.props.value;
734
- })), n.class && !n.className ? (o.class = n.class, Object.defineProperty(o, "className", zr)) : (n.className && !n.class || n.class && n.className) && (o.class = o.className = n.className), t.props = o;
735
- }(e), e.$$typeof = Nn, Ht && Ht(e);
736
- };
737
- var Bt = x.__r;
738
- x.__r = function(e) {
739
- Bt && Bt(e), ft = e.__c;
740
- };
741
- var Dt = x.diffed;
742
- x.diffed = function(e) {
743
- Dt && Dt(e);
744
- var t = e.props, n = e.__e;
745
- n != null && e.type === "textarea" && "value" in t && t.value !== n.value && (n.value = t.value == null ? "" : t.value), ft = null;
746
- };
747
- var An = { ReactCurrentDispatcher: { current: { readContext: function(e) {
748
- return ft.__n[e.__c].props.value;
749
- } } } }, Wr = "17.0.2";
750
- function Mn(e) {
751
- return V.bind(null, e);
752
- }
753
- function Ee(e) {
754
- return !!e && e.$$typeof === Nn;
755
- }
756
- function $n(e) {
757
- return Ee(e) && e.type === j;
758
- }
759
- function On(e) {
760
- return Ee(e) ? Rr.apply(null, arguments) : e;
761
- }
762
- function Un(e) {
763
- return !!e.__k && (me(null, e), !0);
764
- }
765
- function Vn(e) {
766
- return e && (e.base || e.nodeType === 1 && e) || null;
767
- }
768
- var Hn = function(e, t) {
769
- return e(t);
770
- }, Bn = function(e, t) {
771
- return e(t);
772
- }, Dn = j;
773
- function _t(e) {
774
- e();
775
- }
776
- function jn(e) {
777
- return e;
778
- }
779
- function Fn() {
780
- return [!1, _t];
781
- }
782
- var qn = Pe, zn = Ee;
783
- function Wn(e, t) {
784
- var n = t(), r = D({ h: { __: n, v: t } }), o = r[0].h, i = r[1];
785
- return Pe(function() {
786
- o.__ = n, o.v = t, Ze(o) && i({ h: o });
787
- }, [e, n, t]), F(function() {
788
- return Ze(o) && i({ h: o }), e(function() {
789
- Ze(o) && i({ h: o });
790
- });
791
- }, [e]), n;
792
- }
793
- function Ze(e) {
794
- var t, n, r = e.v, o = e.__;
795
- try {
796
- var i = r();
797
- return !((t = o) === (n = i) && (t !== 0 || 1 / t == 1 / n) || t != t && n != n);
798
- } catch {
799
- return !0;
800
- }
801
- }
802
- var Zr = { useState: D, useId: vn, useReducer: ut, useEffect: F, useLayoutEffect: Pe, useInsertionEffect: qn, useTransition: Fn, useDeferredValue: jn, useSyncExternalStore: Wn, startTransition: _t, useRef: ne, useImperativeHandle: mn, useMemo: He, useCallback: gn, useContext: bn, useDebugValue: dt, version: "17.0.2", Children: Sn, render: Ln, hydrate: In, unmountComponentAtNode: Un, createPortal: Rn, createElement: V, createContext: fn, createFactory: Mn, cloneElement: On, createRef: sn, Fragment: j, isValidElement: Ee, isElement: zn, isFragment: $n, findDOMNode: Vn, Component: Z, PureComponent: Ue, memo: Cn, forwardRef: kn, flushSync: Bn, unstable_batchedUpdates: Hn, StrictMode: Dn, Suspense: ke, SuspenseList: fe, lazy: En, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: An };
803
- const Gr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
804
- __proto__: null,
805
- Children: Sn,
806
- Component: Z,
807
- Fragment: j,
808
- PureComponent: Ue,
809
- StrictMode: Dn,
810
- Suspense: ke,
811
- SuspenseList: fe,
812
- __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: An,
813
- cloneElement: On,
814
- createContext: fn,
815
- createElement: V,
816
- createFactory: Mn,
817
- createPortal: Rn,
818
- createRef: sn,
819
- default: Zr,
820
- findDOMNode: Vn,
821
- flushSync: Bn,
822
- forwardRef: kn,
823
- hydrate: In,
824
- isElement: zn,
825
- isFragment: $n,
826
- isValidElement: Ee,
827
- lazy: En,
828
- memo: Cn,
829
- render: Ln,
830
- startTransition: _t,
831
- unmountComponentAtNode: Un,
832
- unstable_batchedUpdates: Hn,
833
- useCallback: gn,
834
- useContext: bn,
835
- useDebugValue: dt,
836
- useDeferredValue: jn,
837
- useEffect: F,
838
- useErrorBoundary: Nr,
839
- useId: vn,
840
- useImperativeHandle: mn,
841
- useInsertionEffect: qn,
842
- useLayoutEffect: Pe,
843
- useMemo: He,
844
- useReducer: ut,
845
- useRef: ne,
846
- useState: D,
847
- useSyncExternalStore: Wn,
848
- useTransition: Fn,
849
- version: Wr
850
- }, Symbol.toStringTag, { value: "Module" })), jt = (e) => {
851
- let t;
852
- const n = /* @__PURE__ */ new Set(), r = (c, d) => {
853
- const p = typeof c == "function" ? c(t) : c;
854
- if (!Object.is(p, t)) {
855
- const s = t;
856
- t = d ?? typeof p != "object" ? p : Object.assign({}, t, p), n.forEach((_) => _(t, s));
857
- }
858
- }, o = () => t, l = { setState: r, getState: o, subscribe: (c) => (n.add(c), () => n.delete(c)), destroy: () => n.clear() };
859
- return t = e(r, o, l), l;
860
- }, Qr = (e) => e ? jt(e) : jt;
861
- var Zn = { exports: {} }, Gn = {};
862
- const Qn = /* @__PURE__ */ pr(Gr);
863
- var Kn = { exports: {} }, Yn = {};
864
- /**
865
- * @license React
866
- * use-sync-external-store-shim.production.min.js
867
- *
868
- * Copyright (c) Facebook, Inc. and its affiliates.
869
- *
870
- * This source code is licensed under the MIT license found in the
871
- * LICENSE file in the root directory of this source tree.
872
- */
873
- var be = Qn;
874
- function Kr(e, t) {
875
- return e === t && (e !== 0 || 1 / e === 1 / t) || e !== e && t !== t;
876
- }
877
- var Yr = typeof Object.is == "function" ? Object.is : Kr, Jr = be.useState, Xr = be.useEffect, eo = be.useLayoutEffect, to = be.useDebugValue;
878
- function no(e, t) {
879
- var n = t(), r = Jr({ inst: { value: n, getSnapshot: t } }), o = r[0].inst, i = r[1];
880
- return eo(function() {
881
- o.value = n, o.getSnapshot = t, Ge(o) && i({ inst: o });
882
- }, [e, n, t]), Xr(function() {
883
- return Ge(o) && i({ inst: o }), e(function() {
884
- Ge(o) && i({ inst: o });
885
- });
886
- }, [e]), to(n), n;
887
- }
888
- function Ge(e) {
889
- var t = e.getSnapshot;
890
- e = e.value;
891
- try {
892
- var n = t();
893
- return !Yr(e, n);
894
- } catch {
895
- return !0;
896
- }
897
- }
898
- function ro(e, t) {
899
- return t();
900
- }
901
- var oo = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? ro : no;
902
- Yn.useSyncExternalStore = be.useSyncExternalStore !== void 0 ? be.useSyncExternalStore : oo;
903
- Kn.exports = Yn;
904
- var io = Kn.exports;
905
- /**
906
- * @license React
907
- * use-sync-external-store-shim/with-selector.production.min.js
908
- *
909
- * Copyright (c) Facebook, Inc. and its affiliates.
910
- *
911
- * This source code is licensed under the MIT license found in the
912
- * LICENSE file in the root directory of this source tree.
913
- */
914
- var Be = Qn, ao = io;
915
- function so(e, t) {
916
- return e === t && (e !== 0 || 1 / e === 1 / t) || e !== e && t !== t;
917
- }
918
- var lo = typeof Object.is == "function" ? Object.is : so, co = ao.useSyncExternalStore, uo = Be.useRef, po = Be.useEffect, fo = Be.useMemo, _o = Be.useDebugValue;
919
- Gn.useSyncExternalStoreWithSelector = function(e, t, n, r, o) {
920
- var i = uo(null);
921
- if (i.current === null) {
922
- var a = { hasValue: !1, value: null };
923
- i.current = a;
924
- } else
925
- a = i.current;
926
- i = fo(function() {
927
- function c(f) {
928
- if (!d) {
929
- if (d = !0, p = f, f = r(f), o !== void 0 && a.hasValue) {
930
- var m = a.value;
931
- if (o(m, f))
932
- return s = m;
933
- }
934
- return s = f;
935
- }
936
- if (m = s, lo(p, f))
937
- return m;
938
- var g = r(f);
939
- return o !== void 0 && o(m, g) ? m : (p = f, s = g);
940
- }
941
- var d = !1, p, s, _ = n === void 0 ? null : n;
942
- return [function() {
943
- return c(t());
944
- }, _ === null ? void 0 : function() {
945
- return c(_());
946
- }];
947
- }, [t, n, r, o]);
948
- var l = co(e, i[0], i[1]);
949
- return po(function() {
950
- a.hasValue = !0, a.value = l;
951
- }, [l]), _o(l), l;
952
- };
953
- Zn.exports = Gn;
954
- var ho = Zn.exports;
955
- const mo = /* @__PURE__ */ fr(ho), { useSyncExternalStoreWithSelector: go } = mo;
956
- function bo(e, t = e.getState, n) {
957
- const r = go(
958
- e.subscribe,
959
- e.getState,
960
- e.getServerState || e.getState,
961
- t,
962
- n
963
- );
964
- return dt(r), r;
965
- }
966
- const Ft = (e) => {
967
- const t = typeof e == "function" ? Qr(e) : e, n = (r, o) => bo(t, r, o);
968
- return Object.assign(n, t), n;
969
- }, Jn = (e) => e ? Ft(e) : Ft;
970
- var rt = /* @__PURE__ */ ((e) => (e[e.And = 1] = "And", e[e.Or = 2] = "Or", e))(rt || {});
971
- const qt = 1, ht = {
972
- eq(e, t) {
973
- return e == t;
974
- },
975
- neq(e, t) {
976
- return !this.eq(e, t);
977
- },
978
- gt(e, t) {
979
- return e > t;
980
- },
981
- gte(e, t) {
982
- return e >= t;
983
- },
984
- lt(e, t) {
985
- return e < t;
986
- },
987
- lte(e, t) {
988
- return e <= t;
989
- },
990
- // multiselect comparators
991
- list_exact(e, t) {
992
- return !Array.isArray(e) || !Array.isArray(t) ? !1 : e.slice().sort().join(",") === t.slice().sort().join(",");
993
- },
994
- /**
995
- * a contains b
996
- */
997
- list_all(e, t) {
998
- return !Array.isArray(e) || !Array.isArray(t) ? !1 : !t.some((n) => e.indexOf(n) === -1);
999
- },
1000
- /**
1001
- * a has at least one value from b
1002
- */
1003
- list_alo(e, t) {
1004
- if (!Array.isArray(t))
1005
- return !1;
1006
- const n = Array.isArray(e) ? e : [e], r = new Set(n);
1007
- return t.some((o) => r.has(o));
1008
- },
1009
- /**
1010
- * a is not included in b
1011
- */
1012
- list_dni(e, t) {
1013
- if (!Array.isArray(t))
1014
- return !1;
1015
- const n = Array.isArray(e) ? e : [e], r = new Set(n);
1016
- return t.every((o) => !r.has(o));
1017
- },
1018
- /**
1019
- * a contains b
1020
- */
1021
- contains(e, t) {
1022
- const n = e.toLowerCase(), r = t.toLowerCase();
1023
- return n.includes(r);
1024
- },
1025
- /**
1026
- * a not contains b
1027
- */
1028
- notcontains(e, t) {
1029
- return !this.contains(e, t);
1030
- }
1031
- }, vo = (e, t, n) => {
1032
- switch (t) {
1033
- case b.VideoVoice:
1034
- return !!(e && e.value);
1035
- case b.Open:
1036
- return !!n;
1037
- case b.MultipleSelect:
1038
- return !!(n && Object.keys(n).length);
1039
- case b.RecordedTask:
1040
- return (n == null ? void 0 : n.taskStatus) === W.Completed;
1041
- case b.TextUrlPrompt:
1042
- return !e.value;
1043
- case b.ConsentLegal:
1044
- return n !== null;
1045
- case b.MultipleChoice:
1046
- return n !== void 0;
1047
- case b.Matrix:
1048
- return !!(n && Object.values(n).every((r) => r !== null));
1049
- case b.NPS:
1050
- return n !== null;
1051
- case b.Likert:
1052
- return n !== null;
1053
- default:
1054
- return !0;
1055
- }
1056
- }, Xn = (e, t) => {
1057
- if (t === b.Matrix) {
1058
- const n = Object.keys(e).length, r = Object.values(e).filter((o) => o !== null).length;
1059
- return r > 0 && r < n;
1060
- }
1061
- return !1;
1062
- }, er = ({
1063
- cards: e,
1064
- index: t,
1065
- hasEndCard: n,
1066
- allResponses: r,
1067
- uploadProgress: o = {}
1068
- }) => {
1069
- if (t >= e.length || t < 0)
1070
- return null;
1071
- const i = e[t];
1072
- let a = t + 1;
1073
- const l = i.props.routingOptions || [];
1074
- for (let p = 0; p < l.length; p++) {
1075
- const {
1076
- group: s,
1077
- target: _
1078
- } = l[p];
1079
- if (!(s != null && s.length))
1080
- continue;
1081
- const f = s[0];
1082
- if (f.questionIndex === void 0 || f.questionIndex > r.length)
1083
- continue;
1084
- let m = zt({
1085
- comparator: f.comparator,
1086
- // @ts-expect-error - unknown response type
1087
- response: r[f.questionIndex],
1088
- // @ts-expect-error - expected card type
1089
- type: i.type,
1090
- value: f.value
1091
- });
1092
- for (let g = 1; g < s.length; g += 2) {
1093
- const y = s[g], v = s[g + 1], C = zt({
1094
- comparator: v.comparator,
1095
- // @ts-expect-error - unknown response type
1096
- response: r[v.questionIndex],
1097
- // @ts-expect-error - expected card type
1098
- type: e[v.questionIndex].type,
1099
- value: v.value
1100
- });
1101
- y === rt.And ? m && (m = C) : y === rt.Or && (m || (m = C));
1102
- }
1103
- if (m) {
1104
- a = _ === -1 && n ? e.length - 1 : _;
1105
- break;
1106
- }
1107
- }
1108
- const c = e.findIndex((p) => p.type === b.Uploading);
1109
- let d;
1110
- return c > 0 ? d = n ? e.length - 3 : e.length - 2 : d = e.length - 1, t >= d || a === -1 || a !== null && a > d ? c > 0 && Object.values(o).some((s) => s.isSubmitted && !s.isComplete) ? c : n ? e.length - 1 : null : a === -1 ? null : a;
1111
- }, zt = ({
1112
- comparator: e,
1113
- response: t,
1114
- type: n,
1115
- value: r
1116
- }) => {
1117
- if (e === G.Answered)
1118
- switch (n) {
1119
- case b.TextUrlPrompt:
1120
- return t === void 0;
1121
- case b.ConsentLegal:
1122
- return t && t.submitted === !0;
1123
- case b.RecordedTask:
1124
- return "taskStatus" in t && t.taskStatus === W.Completed;
1125
- case b.Likert:
1126
- return Number.isInteger(t);
1127
- case b.Open:
1128
- return t && t.length > 0;
1129
- case b.MultipleChoice:
1130
- case b.MultipleSelect:
1131
- return Object.keys(t).length > 0;
1132
- case b.Matrix:
1133
- return Object.values(t).every((o) => o !== null);
1134
- case b.NPS:
1135
- return Number.isInteger(t);
1136
- case b.VideoVoice:
1137
- return !!(t != null && t.mediaRecordingUid);
1138
- default:
1139
- return !1;
1140
- }
1141
- if (e === G.GivenUp)
1142
- return n === b.RecordedTask ? "taskStatus" in t && t.taskStatus === W.GivenUp : !0;
1143
- if (e === G.Partial)
1144
- return n === b.Matrix ? Xn(t, n) : !1;
1145
- if (e === G.Skipped)
1146
- switch (n) {
1147
- case b.TextUrlPrompt:
1148
- return t == null ? void 0 : t.skipped;
1149
- case b.ConsentLegal:
1150
- return t === null;
1151
- case b.RecordedTask:
1152
- return "taskStatus" in t && t.taskStatus === W.Abandoned;
1153
- case b.Likert:
1154
- return t === null;
1155
- case b.Open:
1156
- return (t == null ? void 0 : t.length) === 0;
1157
- case b.MultipleChoice:
1158
- return t === void 0;
1159
- case b.MultipleSelect:
1160
- return (t == null ? void 0 : t.length) === 0;
1161
- case b.Matrix:
1162
- return Object.values(t).every((o) => o === null);
1163
- case b.NPS:
1164
- return t === null;
1165
- case b.VideoVoice:
1166
- return t === null;
1167
- default:
1168
- return !1;
1169
- }
1170
- return ht[e](t, r);
1171
- }, yo = 13, xo = (e, t) => e.reduce((n, r) => n.concat(n.map((o) => [...o, r])), [[]]).filter((n) => t || n.length > 0), Co = (e) => {
1172
- var t, n, r;
1173
- switch (e.type) {
1174
- case b.MultipleSelect:
1175
- return !e || !e.props || !e.props.options ? null : e.props.options.length > yo ? e.props.options.map((o) => [o.value]) : xo(e.props.options.map((o) => o.value), !e.props.properties.required);
1176
- case b.MultipleChoice: {
1177
- if (!e || !e.props || !e.props.options)
1178
- return null;
1179
- const o = e.props.options.map((i) => i.value);
1180
- return e.props.properties.required || o.push(void 0), o;
1181
- }
1182
- case b.Matrix: {
1183
- if (!((t = e == null ? void 0 : e.props) != null && t.options))
1184
- return null;
1185
- const o = e.props.properties.matrixColumn, i = e.props.options, a = i.reduce((p, s) => (p[s.id] = null, p), {}), l = {
1186
- ...a,
1187
- [i[0].id]: o[0].value
1188
- }, c = i.reduce((p, s) => (p[s.id] = o[0].value, p), {}), d = [l, c];
1189
- return e.props.properties.required || d.push(a), d;
1190
- }
1191
- case b.Likert: {
1192
- const o = Number((r = (n = e.props) == null ? void 0 : n.properties) == null ? void 0 : r.range) || 5;
1193
- return [...Array.from(Array(o).keys()).map((a) => a + 1), ...e.props.properties.required ? [] : [null]];
1194
- }
1195
- case b.NPS:
1196
- return [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ...e.props.properties.required ? [] : [null]];
1197
- case b.VideoVoice:
1198
- case b.Open:
1199
- return ["1", ...e.props.properties.required ? [] : [""]];
1200
- case b.RecordedTask:
1201
- return [{
1202
- taskStatus: W.Completed
1203
- }, {
1204
- taskStatus: W.GivenUp
1205
- }, ...e.props.properties.required ? [] : [{
1206
- taskStatus: W.Abandoned
1207
- }]];
1208
- case b.TextUrlPrompt:
1209
- return [void 0, ...e.props.properties.required ? [] : [{
1210
- skipped: !0
1211
- }]];
1212
- case b.ConsentLegal:
1213
- return [qt, ...e.props.properties.required ? [] : [null]];
1214
- default:
1215
- return [qt];
1216
- }
1217
- }, ko = (e) => e in ht, So = (e) => typeof e == "object" && e !== null && "taskStatus" in e, wo = (e, t = []) => t.reduce((n, r) => {
1218
- const {
1219
- group: o,
1220
- target: i
1221
- } = r;
1222
- if (!(o != null && o.length))
1223
- return [...n];
1224
- const a = o.filter((l) => Number(l) ? !0 : typeof l == "object" ? l.questionIndex === e : !1).map((l) => {
1225
- const {
1226
- comparator: c,
1227
- value: d
1228
- } = l;
1229
- return {
1230
- comparator: c,
1231
- target: i,
1232
- value: d
1233
- };
1234
- });
1235
- return [...n, ...a];
1236
- }, []), To = (e, t) => {
1237
- const n = /* @__PURE__ */ new Set([b.Thanks, b.Uploading]);
1238
- if (t >= e.length || t < 0 || n.has(e[t].type))
1239
- return 0;
1240
- const r = e.filter((i) => !n.has(i.type));
1241
- if (t === r.length - 1)
1242
- return 1;
1243
- const o = {
1244
- [r.length - 1]: 1,
1245
- [-1]: 0
1246
- };
1247
- for (let i = r.length - 2; i >= t; i--) {
1248
- const a = r[i], l = wo(i, a.props.routingOptions);
1249
- if (l.length === 0) {
1250
- o[i] = o[i + 1] + 1;
1251
- continue;
1252
- }
1253
- let c = 0, d = Co(a);
1254
- if (d === null)
1255
- return r.length - 1 - t;
1256
- for (let p = 0; p < l.length && d.length !== 0; p++) {
1257
- const {
1258
- comparator: s,
1259
- target: _,
1260
- value: f
1261
- } = l[p], m = d.filter((g) => {
1262
- const y = vo({
1263
- value: g
1264
- }, a.type, g), v = Xn(g, a.type);
1265
- return !(y && s === G.Answered || v && s === G.Partial || !y && !v && s === G.Skipped || s === G.GivenUp && So(g) && g.taskStatus === W.GivenUp || y && a.type === b.Open && (s === G.Contains || s === G.DoesNotContain) || y && ko(s) && ht[s](g, f));
1266
- });
1267
- if (m.length < d.length) {
1268
- const g = parseInt(String(_), 10);
1269
- if (g !== -1 && g <= i || g >= r.length)
1270
- return r.length - 1 - t;
1271
- c = Math.max(o[g] + 1, c);
1272
- }
1273
- d = m;
1274
- }
1275
- d.length > 0 && (c = Math.max(o[i + 1] + 1, c)), o[i] = c;
1276
- }
1277
- return o[t];
1278
- }, Po = (e) => !(e.type === b.Thanks || e.type === b.Uploading), $ = Jn()((e, t) => ({
1279
- allResponses: [],
1280
- answers: void 0,
1281
- apiURL: "",
1282
- border: "#000000",
1283
- cards: [],
1284
- close: async (n = _e) => {
1285
- const r = t(), {
1286
- fadeout: o,
1287
- remove: i,
1288
- trackHistory: a
1289
- } = r;
1290
- await o(n), Qe(r) || a({
1291
- event: "closed"
1292
- }), ze(`Closing survey: ${r.surveyId}`), yt.enable(), i({
1293
- initiator: xt.Closed
1294
- });
1295
- },
1296
- configureExitOnOverlayClick: () => {
1297
- },
1298
- customMetadata: {},
1299
- destroy: async (n) => {
1300
- const {
1301
- eventEmitFn: r,
1302
- fadeout: o,
1303
- remove: i
1304
- } = t();
1305
- r(ee.SurveyComplete), await o(n), yt.enable(), i({
1306
- initiator: xt.Complete
1307
- });
1308
- },
1309
- endCard: {
1310
- headline: ""
1311
- },
1312
- envId: "",
1313
- eventEmitFn: Le.emit.bind(Le),
1314
- fadeout: async (n) => {
1315
- const {
1316
- eventEmitFn: r,
1317
- headers: o,
1318
- viewDocument: i
1319
- } = t();
1320
- return $e(o) ? Promise.resolve() : (r(oe.SurveyFadingOut), new Promise((a) => {
1321
- const l = i.getElementById(n);
1322
- l ? (l.addEventListener("transitionend", () => {
1323
- a();
1324
- }), l.classList.remove("ul-app--visible")) : a();
1325
- }));
1326
- },
1327
- forceBrandedLogo: !1,
1328
- frame: document.createElement("iframe"),
1329
- handleClickEmbedButton: (n) => {
1330
- const {
1331
- cards: r,
1332
- eventEmitFn: o,
1333
- index: i
1334
- } = t();
1335
- o(n, {
1336
- [ye.QuestionId]: r[i].name,
1337
- [ye.Props]: r[i].props
1338
- // Only return the upcoming card
1339
- }), e(() => ({
1340
- hasViewedEmbed: !0
1341
- }));
1342
- },
1343
- handleUploadUpdate: ({
1344
- mediaRecordingUid: n,
1345
- isComplete: r,
1346
- progressPct: o,
1347
- isSubmitted: i
1348
- }) => {
1349
- var f, m, g;
1350
- const {
1351
- cards: a,
1352
- destroy: l,
1353
- index: c,
1354
- uploadProgress: d
1355
- } = t(), p = r || ((f = d[n]) == null ? void 0 : f.isComplete), s = {
1356
- ...d,
1357
- [n]: {
1358
- progressPct: p ? 100 : o || ((m = d[n]) == null ? void 0 : m.progressPct),
1359
- isComplete: p,
1360
- isSubmitted: i || ((g = d[n]) == null ? void 0 : g.isSubmitted)
1361
- }
1362
- };
1363
- if (e({
1364
- uploadProgress: s
1365
- }), a[c].type !== b.Uploading)
1366
- return;
1367
- const _ = Object.entries(d).every(([y, v]) => !v.isSubmitted || v.isComplete || n == y && r);
1368
- if (_ && c >= a.length - 1)
1369
- return l(_e);
1370
- e({
1371
- index: _ ? c + 1 : c,
1372
- uploadingCardViewed: !0
1373
- });
1374
- },
1375
- hasViewedEmbed: !1,
1376
- headers: {
1377
- Authorization: "",
1378
- "Content-Type": "",
1379
- "userleap-platform": Ke.Web,
1380
- "x-ul-environment-id": "",
1381
- "x-ul-installation-method": _r.Snippet,
1382
- "x-ul-sdk-version": "",
1383
- "x-ul-visitor-id": ""
1384
- },
1385
- index: 0,
1386
- isPreview: !1,
1387
- marketingUrl: "https://sprig.com",
1388
- meta: {
1389
- ch: 0,
1390
- cw: 0,
1391
- l: "",
1392
- mode: null,
1393
- p: "",
1394
- sh: 0,
1395
- sw: 0
1396
- },
1397
- mode: void 0,
1398
- next: (n) => {
1399
- const {
1400
- allResponses: r,
1401
- cards: o,
1402
- eventEmitFn: i,
1403
- index: a,
1404
- responseGroupUid: l,
1405
- submit: c,
1406
- trackHistory: d,
1407
- uploadProgress: p,
1408
- viewedCardCount: s
1409
- } = t(), _ = Date.now(), f = [...o], m = f[a], {
1410
- type: g
1411
- } = n.data, y = {
1412
- ...n.data
1413
- }, v = y.value;
1414
- Po(m) && (m.value = v), y.answeredAt = _, delete y.type;
1415
- const C = {
1416
- response: y,
1417
- responseGroupUid: l,
1418
- questionIndex: a
1419
- };
1420
- let k = g === b.MultipleChoice ? Object.values(v).find((N) => N !== !1) : v;
1421
- g === b.MultipleSelect && (k = f[a].props.options.reduce((N, h) => (v[h.id] && N.push(h.value), N), []));
1422
- const R = r.slice(0);
1423
- R[a] = k, e({
1424
- allResponses: R
1425
- });
1426
- const P = er({
1427
- cards: f,
1428
- index: a,
1429
- hasEndCard: !!n.endCard,
1430
- uploadProgress: p,
1431
- allResponses: R
1432
- });
1433
- if (P === null) {
1434
- C.completedAt = _, c(C), n.completeSurvey();
1435
- return;
1436
- } else
1437
- [b.Thanks, b.Uploading].includes(f[P].type) && (C.completedAt = _);
1438
- const S = c(C);
1439
- [b.Thanks, b.Uploading].includes(f[P].type) || S.finally(() => {
1440
- d({
1441
- event: "seen",
1442
- index: P
1443
- });
1444
- });
1445
- const A = f[P];
1446
- f[P] && i && i(ee.CurrentQuestion, {
1447
- [ye.QuestionId]: A.name,
1448
- [ye.Props]: A.props
1449
- // Only return the upcoming card
1450
- }), e({
1451
- cards: f,
1452
- hasViewedEmbed: !1,
1453
- index: P,
1454
- viewedCardCount: s + 1
1455
- });
1456
- },
1457
- pendingRemoveIframeReason: null,
1458
- previewKey: null,
1459
- recorder: () => {
1460
- },
1461
- recorderEventEmitter: Le,
1462
- resolveTrackedPromise: () => {
1463
- const {
1464
- removeIframeIfReady: n
1465
- } = t();
1466
- e((r) => ({
1467
- unresolvedRequestCount: r.unresolvedRequestCount - 1
1468
- })), n();
1469
- },
1470
- responseGroupUid: "",
1471
- remove: ({
1472
- initiator: n
1473
- }) => {
1474
- const {
1475
- removeIframeIfReady: r
1476
- } = t();
1477
- e({
1478
- pendingRemoveIframeReason: n
1479
- }), r();
1480
- },
1481
- removeIframeIfReady: () => {
1482
- const {
1483
- eventEmitFn: n,
1484
- pendingRemoveIframeReason: r,
1485
- unresolvedRequestCount: o
1486
- } = t();
1487
- r && o === 0 && (n(oe.SurveyWillClose, {
1488
- name: oe.SurveyWillClose,
1489
- initiator: r
1490
- }), e({
1491
- pendingRemoveIframeReason: null
1492
- }));
1493
- },
1494
- seen: async () => {
1495
- const {
1496
- trackHistory: n
1497
- } = t();
1498
- return n({
1499
- event: "seen",
1500
- isNew: !0
1501
- });
1502
- },
1503
- slugName: null,
1504
- showStripes: !1,
1505
- showSurveyBrand: !1,
1506
- styleNonce: "",
1507
- submit: async ({
1508
- completedAt: n,
1509
- questionIndex: r,
1510
- response: o,
1511
- responseGroupUid: i
1512
- }) => {
1513
- const a = t();
1514
- if (!i || Qe(a))
1515
- return;
1516
- const l = {
1517
- responseGroupUid: i,
1518
- meta: a.meta,
1519
- customMetadata: a.customMetadata,
1520
- responses: [o],
1521
- completedAt: n,
1522
- previewKey: a.previewKey
1523
- };
1524
- ze(`Submitting response: ${JSON.stringify(o.value, null, 2)} for survey: ${a.surveyId}`), n && (ze("Survey complete"), hr({
1525
- id: a.surveyId,
1526
- userAgent: window.navigator.userAgent
1527
- }));
1528
- const c = await a.trackPromise(Ye(`${a.apiURL}/sdk/1/environments/${a.envId}/visitors/${a.userId}/responses/submit`, {
1529
- body: JSON.stringify(l),
1530
- headers: a.headers,
1531
- method: "POST"
1532
- }));
1533
- if (!c.ok) {
1534
- c.reportError && (console.warn("[Sprig] (ERR-427) Failed to submit response", c.error), await a.trackPromise(Wt(a, "submitResponse", c.error)));
1535
- return;
1536
- }
1537
- a.eventEmitFn(oe.QuestionAnswered, {
1538
- ...o,
1539
- questionIndex: r
1540
- });
1541
- },
1542
- surveyId: 0,
1543
- tabTitle: "",
1544
- trackHistory: async ({
1545
- event: n,
1546
- index: r,
1547
- isNew: o = !1
1548
- }) => {
1549
- const i = t();
1550
- if (Qe(i))
1551
- return;
1552
- const {
1553
- cards: a,
1554
- index: l
1555
- } = i, c = r !== void 0 ? a[r] : a[l], d = {
1556
- sid: i.surveyId,
1557
- qid: c.name,
1558
- action: n,
1559
- vid: i.userId,
1560
- eid: i.envId,
1561
- isNew: o,
1562
- responseGroupUid: i.responseGroupUid,
1563
- previewKey: i.previewKey
1564
- }, p = await i.trackPromise(Ye(`${i.apiURL}/sdk/1/visitors/${i.userId}/surveys/${i.surveyId}/history`, {
1565
- body: JSON.stringify(d),
1566
- headers: i.headers,
1567
- method: "POST"
1568
- }));
1569
- !p.ok && p.reportError && (console.warn("[Sprig] (ERR-428) Failed to track survey event", p.error), await i.trackPromise(Wt(i, "trackHistory", p.error)));
1570
- },
1571
- trackPromise: async (n) => {
1572
- let {
1573
- resolveTrackedPromise: r
1574
- } = t();
1575
- return e((o) => ({
1576
- unresolvedRequestCount: o.unresolvedRequestCount + 1
1577
- })), n.then((o) => (r(), o)).catch((o) => {
1578
- throw r(), o;
1579
- });
1580
- },
1581
- unresolvedRequestCount: 0,
1582
- update: () => {
1583
- const {
1584
- cards: n,
1585
- index: r,
1586
- headers: o,
1587
- eventEmitFn: i,
1588
- frame: a,
1589
- useMobileStyling: l,
1590
- viewDocument: c
1591
- } = t(), p = n[r].type === b.Matrix;
1592
- setTimeout(() => {
1593
- var f, m;
1594
- const [s, _] = mr(c);
1595
- $e(o) ? i(oe.SurveyHeight, {
1596
- name: oe.SurveyHeight,
1597
- contentFrameHeight: s
1598
- }) : ((f = a.setHeight) == null || f.call(a, s), l || (m = a.setWidth) == null || m.call(a, p ? _ : parseInt(gr)));
1599
- }, 100);
1600
- },
1601
- uploadingCardViewed: !1,
1602
- uploadProgress: {},
1603
- useDesktopPrototype: void 0,
1604
- useMobileStyling: !1,
1605
- userId: "",
1606
- viewDocument: window.document,
1607
- viewedCardCount: 0
1608
- })), Qe = (e) => !e.userId || e.meta && e.meta.mode === "test" || e.isPreview, Wt = async (e, t, n) => {
1609
- const {
1610
- mode: r,
1611
- userId: o,
1612
- envId: i,
1613
- apiURL: a,
1614
- headers: l,
1615
- viewDocument: c
1616
- } = e, d = c.documentElement, p = {
1617
- mode: r,
1618
- screenWidth: window.screen.width,
1619
- screenHeight: window.screen.height,
1620
- clientWidth: d.clientWidth,
1621
- clientHeight: d.clientHeight,
1622
- location: window.location.href,
1623
- language: window.navigator.language
1624
- }, s = {
1625
- action: t,
1626
- err: {
1627
- message: n == null ? void 0 : n.message,
1628
- stack: n == null ? void 0 : n.stack
1629
- },
1630
- meta: p,
1631
- vid: o,
1632
- envId: i
1633
- }, _ = await Ye(`${a}/sdk/1/errors`, {
1634
- method: "POST",
1635
- headers: Object.assign({
1636
- "x-ul-error": window.btoa(`userleap-${Date.now()}-error`)
1637
- }, l),
1638
- body: JSON.stringify(s)
1639
- });
1640
- if (!_.ok)
1641
- console.warn("[Sprig] (ERR-444) Failed to report error to API", n);
1642
- else {
1643
- const {
1644
- presignedUrl: f
1645
- } = _.json;
1646
- br(f);
1647
- }
1648
- };
1649
- var Eo = 0;
1650
- function u(e, t, n, r, o, i) {
1651
- var a, l, c = {};
1652
- for (l in t)
1653
- l == "ref" ? a = t[l] : c[l] = t[l];
1654
- var d = { type: e, props: c, key: n, ref: a, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, constructor: void 0, __v: --Eo, __i: -1, __u: 0, __source: o, __self: i };
1655
- if (typeof e == "function" && (a = e.defaultProps))
1656
- for (l in a)
1657
- c[l] === void 0 && (c[l] = a[l]);
1658
- return x.vnode && x.vnode(d), d;
1659
- }
1660
- const q = (e) => u("button", {
1661
- ...e,
1662
- className: L("ul-card-text__button", e.className),
1663
- id: "ul-card-text__button"
1664
- }), Y = ({
1665
- message: e,
1666
- properties: t
1667
- }) => {
1668
- const n = t == null ? void 0 : t.captionText;
1669
- return u(j, {
1670
- children: [e && u("h1", {
1671
- className: w.QuestionHeader,
1672
- id: w.QuestionHeader,
1673
- ...n ? {} : {
1674
- style: {
1675
- marginBottom: "15px"
1676
- }
1677
- },
1678
- children: e
1679
- }), n && u("p", {
1680
- className: w.Caption,
1681
- id: w.Caption,
1682
- children: n
1683
- })]
1684
- });
1685
- }, Zt = ({
1686
- buttonText: e = "View Prototype",
1687
- handleClick: t
1688
- }) => u("button", {
1689
- className: "prototype-button",
1690
- onClick: t,
1691
- children: e
1692
- }, "prototype-btn"), ae = ({
1693
- defaultBody: e,
1694
- embeddedType: t = "prototype",
1695
- properties: n
1696
- }) => {
1697
- var s;
1698
- const {
1699
- handleClickEmbedButton: r,
1700
- hasViewedEmbed: o,
1701
- headers: i,
1702
- useDesktopPrototype: a
1703
- } = $((_) => ({
1704
- handleClickEmbedButton: _.handleClickEmbedButton,
1705
- hasViewedEmbed: _.hasViewedEmbed,
1706
- headers: _.headers,
1707
- useDesktopPrototype: _.useDesktopPrototype
1708
- })), l = (n == null ? void 0 : n.conceptUrl) || ((s = n == null ? void 0 : n.consentDocument) == null ? void 0 : s.url), c = window.innerWidth < vr, d = i["userleap-platform"], p = (_, f) => {
1709
- _.preventDefault(), r(f);
1710
- };
1711
- if (!a && c && !o && l && ["email", "link"].includes(d)) {
1712
- if (t === "prototype")
1713
- return u(Zt, {
1714
- handleClick: (_) => {
1715
- p(_, ee.ViewPrototypeClick);
1716
- }
1717
- });
1718
- if (t === "pdf")
1719
- return u(Zt, {
1720
- buttonText: (n == null ? void 0 : n.viewDocumentText) || "View Document",
1721
- handleClick: (_) => {
1722
- p(_, ee.ViewAgreementClick);
1723
- }
1724
- });
1725
- }
1726
- return e();
1727
- }, tr = (e, t) => {
1728
- const n = ne(0), r = () => {
1729
- if (e.current) {
1730
- const o = e.current;
1731
- o.style.height = "1px";
1732
- const i = o.scrollHeight, a = o.offsetHeight - o.clientHeight, l = i + a, c = parseInt(window.getComputedStyle(o).getPropertyValue("max-height")), d = l <= c ? l : c;
1733
- n.current !== d && t(), n.current = d, o.style.height = `${d}px`;
1734
- }
1735
- };
1736
- return F(r, []), r;
1737
- }, mt = ({
1738
- ariaLabel: e,
1739
- border: t,
1740
- choiceStyle: n = {},
1741
- label: r,
1742
- isSelected: o,
1743
- value: i,
1744
- text: a,
1745
- id: l,
1746
- isRadio: c,
1747
- useMobileStyling: d,
1748
- error: p,
1749
- allowTextEntry: s,
1750
- noneOfTheAbove: _,
1751
- promptText: f,
1752
- onUserInputChanged: m
1753
- }) => {
1754
- const {
1755
- styleNonce: g,
1756
- viewDocument: y
1757
- } = $((U) => ({
1758
- styleNonce: U.styleNonce,
1759
- viewDocument: U.viewDocument
1760
- })), [v, C] = D(!1);
1761
- Lo(y, t, g);
1762
- const k = ({
1763
- isSelected: U,
1764
- userText: de
1765
- }) => {
1766
- m && m({
1767
- id: l || "",
1768
- selected: U,
1769
- value: i,
1770
- userText: de,
1771
- noneOfTheAbove: _
1772
- });
1773
- }, R = (U) => {
1774
- U.stopPropagation(), k({
1775
- isSelected: c || !o,
1776
- userText: a
1777
- }), C(!1);
1778
- }, P = () => {
1779
- v || C(!0);
1780
- }, S = () => {
1781
- v && C(!1);
1782
- }, A = (U) => {
1783
- (U.key === "Enter" || U.key === " ") && R(U);
1784
- }, N = {
1785
- onClick: (U) => R(U),
1786
- onKeyPress: (U) => A(U)
1787
- };
1788
- "ontouchstart" in y.documentElement ? (N.onTouchStart = S, N.onTouchCancel = S, N.onTouchEnd = S) : (N.onMouseDown = P, N.onMouseLeave = S);
1789
- const h = c ? `radio-${l}` : `checkbox-${l}`, T = o || v ? [Me] : [], O = [...p ? [nr] : [], ...T], se = r ? {
1790
- "aria-labelledby": `label-${l}`
1791
- } : {
1792
- "aria-label": e
1793
- };
1794
- return u("div", {
1795
- className: L([...H(w.Choice, d), ...O]),
1796
- id: `choice-div-${l}`,
1797
- style: {
1798
- ...n,
1799
- ...p ? {
1800
- borderColor: xe
1801
- } : {}
1802
- },
1803
- ...N,
1804
- children: [u("div", {
1805
- className: L([w.ChoiceLabelContainer]),
1806
- children: [c ? u("div", {
1807
- ...se,
1808
- className: L([w.ChoiceRadio, ...T]),
1809
- id: h,
1810
- role: "radio",
1811
- tabIndex: 0
1812
- }) : u("div", {
1813
- "aria-checked": o,
1814
- "aria-labelledby": `label-${l}`,
1815
- className: w.ChoiceCheckbox,
1816
- id: h,
1817
- role: "checkbox",
1818
- style: o ? {
1819
- backgroundColor: t,
1820
- borderColor: t,
1821
- boxShadow: "none"
1822
- } : {},
1823
- tabIndex: 0,
1824
- children: o && u("svg", {
1825
- fill: "none",
1826
- height: "10",
1827
- viewBox: "0 0 10 10",
1828
- width: "10",
1829
- xmlns: "http://www.w3.org/2000/svg",
1830
- children: u("path", {
1831
- d: "M9.15377 1.30774L4.07685 8.23082L1.30762 5.00005",
1832
- stroke: "white",
1833
- strokeLinecap: "round",
1834
- strokeWidth: "2"
1835
- })
1836
- })
1837
- }), r && u("label", {
1838
- className: L(H(w.ChoiceLabel, d)),
1839
- htmlFor: h,
1840
- id: `label-${l}`,
1841
- children: r
1842
- })]
1843
- }), s && o && u("div", {
1844
- className: L([w.ChoiceTextEntryContainer, ...T]),
1845
- children: u(Ro, {
1846
- onTextChange: (U) => k({
1847
- isSelected: o,
1848
- userText: U
1849
- }),
1850
- promptText: f || "Please specify",
1851
- textValue: a,
1852
- useMobileStyling: d
1853
- })
1854
- })]
1855
- });
1856
- }, Ro = ({
1857
- promptText: e,
1858
- textValue: t,
1859
- onTextChange: n,
1860
- useMobileStyling: r
1861
- }) => {
1862
- const o = ne(null), {
1863
- update: i
1864
- } = $((l) => ({
1865
- update: l.update
1866
- })), a = tr(o, () => i());
1867
- return F(() => {
1868
- o.current && o.current.focus();
1869
- }, []), u("textarea", {
1870
- "aria-label": e,
1871
- "aria-multiline": "true",
1872
- "aria-placeholder": e,
1873
- className: L(H(w.ChoiceTextInput, r)),
1874
- "data-gramm": "false",
1875
- maxLength: 5e3,
1876
- name: "text",
1877
- onChange: (l) => {
1878
- a(), l.stopPropagation(), n(l.currentTarget.value);
1879
- },
1880
- onClick: (l) => {
1881
- l.stopPropagation();
1882
- },
1883
- onKeyPress: (l) => {
1884
- l.stopPropagation();
1885
- },
1886
- placeholder: e,
1887
- ref: o,
1888
- role: "textbox",
1889
- rows: 1,
1890
- value: t
1891
- });
1892
- }, Gt = "ul-select-style-element", Me = "ul-select-active-dynamic-style", nr = "ul-select-error-dynamic-style", No = (e) => e.tagName.toLowerCase() === "style", Lo = (e, t, n) => {
1893
- let r = e.getElementById(Gt), o = !1;
1894
- r || (r = e.createElement("style"), o = !0), No(r) && (r.id = Gt, n && (r.nonce = n), r.textContent = Io(t), o && e.head.appendChild(r));
1895
- }, Io = (e) => `
1896
- .${Me} {
1897
- border-color: ${e};
1898
- }
1899
- .${Me} .${w.ChoiceRadio}, .${Me}.${w.ChoiceRadio} {
1900
- border: 6px solid ${e};
1901
- box-shadow: none;
1902
- }
1903
- .${nr} {
1904
- border-color: ${xe};
1905
- }
1906
- `, ve = (e) => (e == null ? void 0 : e.buttonText) || "Next", rr = (e) => (e == null ? void 0 : e.skipButtonText) || "Skip", Ao = ({
1907
- className: e,
1908
- message: t,
1909
- next: n,
1910
- properties: r,
1911
- questionId: o,
1912
- type: i
1913
- }) => {
1914
- const {
1915
- useMobileStyling: a,
1916
- border: l
1917
- } = $((h) => ({
1918
- useMobileStyling: h.useMobileStyling,
1919
- border: h.border
1920
- })), [c, d] = D(!1), [p, s] = D(""), [_, f] = D(!1), m = r == null ? void 0 : r.collectName, g = (r == null ? void 0 : r.nameLabelText) || "Full Name", y = (r == null ? void 0 : r.consentText) || "I agree to the stated conditions", v = (r == null ? void 0 : r.submitButtonText) || "Submit", C = !!p.trim(), k = c && (!m || C), R = (h, T = !1) => {
1921
- h.preventDefault(), h.stopPropagation();
1922
- let O = null;
1923
- if (!T) {
1924
- if (!k) {
1925
- f(!0);
1926
- return;
1927
- }
1928
- O = {
1929
- submitted: !0
1930
- }, m && (O.name = p);
1931
- }
1932
- n({
1933
- value: O,
1934
- questionId: o,
1935
- type: i
1936
- });
1937
- }, P = (h) => {
1938
- h.preventDefault(), h.stopPropagation(), s(h.currentTarget.value);
1939
- }, S = (h) => {
1940
- h.currentTarget.style.borderColor = _ && !C ? xe : l;
1941
- }, A = (h) => {
1942
- h.currentTarget.style.borderColor = _ && !C ? xe : st;
1943
- }, N = () => u("div", {
1944
- children: [u(mt, {
1945
- allowTextEntry: !1,
1946
- border: l,
1947
- error: _ && !c,
1948
- isRadio: !1,
1949
- isSelected: c,
1950
- label: y,
1951
- onUserInputChanged: ({
1952
- selected: h
1953
- }) => {
1954
- h !== c && d(!c);
1955
- },
1956
- useMobileStyling: a
1957
- }), m && u("input", {
1958
- "aria-label": g,
1959
- "aria-placeholder": g,
1960
- className: L(H(w.ConsentLegalNameInput, a)),
1961
- "data-gramm": "false",
1962
- maxLength: 250,
1963
- name: "name",
1964
- onBlur: A,
1965
- onFocus: S,
1966
- onInput: P,
1967
- placeholder: g,
1968
- style: _ && !C ? {
1969
- borderColor: xe
1970
- } : {},
1971
- tabIndex: 0,
1972
- value: p
1973
- }), u("div", {
1974
- className: "ul-card__button-wrapper ul-card-vertical__button-wrapper",
1975
- children: [u(q, {
1976
- className: k ? "" : w.ButtonDisabled,
1977
- onClick: R,
1978
- children: v
1979
- }), r.required === !1 && u("button", {
1980
- className: w.SkipButton,
1981
- onClick: (h) => R(h, !0),
1982
- children: rr(r)
1983
- })]
1984
- })]
1985
- });
1986
- return u("div", {
1987
- className: L([e, "ul-card__consent-legal", w.FadeInTransition]),
1988
- children: [u(Y, {
1989
- message: t
1990
- }), u("div", {
1991
- className: "ul-rich-text-body",
1992
- dangerouslySetInnerHTML: r != null && r.richTextBody ? {
1993
- __html: r.richTextBody
1994
- } : void 0,
1995
- id: "ul-card__consent-legal-body-container"
1996
- }), u(ae, {
1997
- properties: r,
1998
- defaultBody: N,
1999
- embeddedType: "pdf"
2000
- })]
2001
- }, o);
2002
- }, Mo = ({
2003
- activeValue: e,
2004
- border: t,
2005
- icon: n,
2006
- isPressed: r,
2007
- onSubmit: o,
2008
- range: i,
2009
- scaleLabelType: a,
2010
- setActiveValue: l,
2011
- setIsPressed: c,
2012
- useMobileStyling: d,
2013
- value: p
2014
- }) => {
2015
- const s = `option-${p}`, _ = a === pe.Number, f = a === pe.Star, m = _ && p === e, [g, y] = p <= e && f || p === e ? r ? [t, 1] : [t, 0.3] : ["", 1], v = () => {
2016
- switch (a) {
2017
- case pe.Star:
2018
- return L([...H(w.LikertStar, d), ...H(`${w.LikertStar}-${p}`, d)]);
2019
- case pe.Smiley:
2020
- return L([...H(w.LikertSmiley, d), ...H(`${w.LikertSmiley}-${p}`, d)]);
2021
- default:
2022
- return L(p === i ? [...H(w.LikertNumber, d), ...H(`${w.LikertNumber}-${p}`, d), ...H("likert-last-option", d)] : [...H(w.LikertNumber, d), ...H(`${w.LikertNumber}-${p}`, d)]);
2023
- }
2024
- }, C = () => {
2025
- l(-1), c(!1);
2026
- };
2027
- return u("div", {
2028
- "aria-label": _ ? void 0 : String(p),
2029
- className: v(),
2030
- dangerouslySetInnerHTML: {
2031
- __html: n
2032
- },
2033
- id: s,
2034
- onClick: () => o(),
2035
- onPointerDown: () => c(!0),
2036
- onPointerEnter: () => l(p),
2037
- onPointerLeave: C,
2038
- role: "radio",
2039
- style: {
2040
- color: _ ? "" : g,
2041
- borderColor: m ? g : "",
2042
- fillOpacity: m ? "" : y,
2043
- zIndex: m ? 3 : "auto"
2044
- },
2045
- tabIndex: 0
2046
- });
2047
- }, $o = ({
2048
- className: e,
2049
- labels: t,
2050
- message: n,
2051
- next: r,
2052
- properties: o,
2053
- questionId: i,
2054
- type: a
2055
- }) => {
2056
- const {
2057
- border: l,
2058
- useMobileStyling: c
2059
- } = $((N) => ({
2060
- border: N.border,
2061
- useMobileStyling: N.useMobileStyling
2062
- })), [d, p] = D(-1), [s, _] = D(!1), f = t && t.left, m = t && t.right;
2063
- let g;
2064
- const {
2065
- range: y,
2066
- scaleLabelType: v,
2067
- ratingIcons: C
2068
- } = o;
2069
- y && (g = Number(y));
2070
- const k = g || 5, R = (N) => {
2071
- var h, T;
2072
- switch (v) {
2073
- case pe.Star:
2074
- return (h = C[0]) == null ? void 0 : h.svg;
2075
- case pe.Smiley:
2076
- return (T = C[N]) == null ? void 0 : T.svg;
2077
- default:
2078
- return String(N + 1);
2079
- }
2080
- }, P = [...Array(k)].map((N, h) => {
2081
- const T = h + 1;
2082
- return u(Mo, {
2083
- activeValue: d,
2084
- border: l,
2085
- icon: R(h),
2086
- isPressed: s,
2087
- onSubmit: () => r({
2088
- value: T,
2089
- questionId: i,
2090
- type: a
2091
- }),
2092
- range: k,
2093
- scaleLabelType: v,
2094
- setActiveValue: p,
2095
- setIsPressed: _,
2096
- useMobileStyling: c,
2097
- value: T
2098
- }, h);
2099
- }), S = (N) => {
2100
- N.preventDefault(), N.stopPropagation(), r({
2101
- value: null,
2102
- questionId: i,
2103
- type: a
2104
- });
2105
- }, A = () => u(j, {
2106
- children: [u("div", {
2107
- "aria-label": `Rating (1 - ${k})`,
2108
- className: "ul-card--likert__numbers",
2109
- role: "radiogroup",
2110
- children: P
2111
- }), u("div", {
2112
- className: "ul-card--likert__labels",
2113
- children: [u("span", {
2114
- children: f
2115
- }), u("span", {
2116
- children: m
2117
- })]
2118
- }), !o.required && u("div", {
2119
- className: "ul-vertical-centered-container",
2120
- children: u(q, {
2121
- onClick: S,
2122
- children: ve(o)
2123
- })
2124
- })]
2125
- });
2126
- return u("form", {
2127
- className: L([e, "ul-card--likert", w.FadeInTransition]),
2128
- children: [u(Y, {
2129
- message: n,
2130
- properties: o
2131
- }), u(ae, {
2132
- properties: o,
2133
- defaultBody: A
2134
- })]
2135
- }, i);
2136
- }, Oo = ({
2137
- className: e,
2138
- message: t,
2139
- next: n,
2140
- options: r,
2141
- properties: o,
2142
- questionId: i,
2143
- type: a
2144
- }) => {
2145
- const {
2146
- border: l,
2147
- useMobileStyling: c
2148
- } = $((h) => ({
2149
- border: h.border,
2150
- useMobileStyling: h.useMobileStyling
2151
- })), d = o.matrixColumn, p = r.length, s = d.length, _ = o.required, f = ne(null), [m, g] = D(!1), y = () => {
2152
- const h = f.current;
2153
- h && g(h.clientWidth + Math.abs(h.scrollLeft) < h.scrollWidth);
2154
- };
2155
- F(() => {
2156
- let h;
2157
- if (f.current) {
2158
- h = f.current;
2159
- const T = new ResizeObserver((O) => {
2160
- g(Math.round(O[0].contentRect.width) < h.scrollWidth);
2161
- });
2162
- return T.observe(h), () => {
2163
- h && T.unobserve(h);
2164
- };
2165
- }
2166
- }, []);
2167
- const v = (h) => {
2168
- h.preventDefault(), h.stopPropagation(), n({
2169
- value: k,
2170
- questionId: i,
2171
- type: a
2172
- });
2173
- }, C = r.reduce((h, T) => (h[T.id] = null, h), {}), [k, R] = D(C), P = (h, T) => {
2174
- R((O) => ({
2175
- ...O,
2176
- [h]: T
2177
- }));
2178
- }, S = _ && Object.values(k).every((h) => h == null), A = r.map((h) => u(j, {
2179
- children: [u("div", {
2180
- "aria-label": h.label,
2181
- className: "ul-matrix-row-label",
2182
- children: h.label
2183
- }, h.label), u("div", {
2184
- className: "ul-matrix-row-options",
2185
- role: "radiogroup",
2186
- children: d.map((T, O) => {
2187
- const se = O === s - 1;
2188
- return u("div", {
2189
- className: L("ul-matrix-option-wrapper", se && "ul-matrix-last-option"),
2190
- children: u(mt, {
2191
- allowTextEntry: !1,
2192
- ariaLabel: `${h.label}-${T.label}`,
2193
- border: l,
2194
- choiceStyle: {
2195
- background: "transparent",
2196
- border: "none",
2197
- marginBottom: "0",
2198
- padding: "0"
2199
- },
2200
- error: !1,
2201
- id: `${h.id}-${T.value}`,
2202
- isRadio: !0,
2203
- isSelected: k[h.id] === T.value,
2204
- onUserInputChanged: () => P(h.id, T.value),
2205
- useMobileStyling: c
2206
- })
2207
- }, T.value);
2208
- })
2209
- })]
2210
- })), N = () => u("div", {
2211
- className: "ul-card--matrix_question_container",
2212
- children: [u("div", {
2213
- className: L(["ul-card--matrix_container", m && "ul-matrix-scroll-gradient"]),
2214
- onScroll: () => {
2215
- y();
2216
- },
2217
- ref: f,
2218
- children: u("div", {
2219
- className: "ul-card--matrix_grid",
2220
- style: `--numColumns: ${s}; --numRows: ${p + 1}`,
2221
- children: [u("div", {}), " ", d.map((h) => u("div", {
2222
- className: "ul-matrix-column-label",
2223
- children: h.label
2224
- }, h.label)), A]
2225
- })
2226
- }), m && u("button", {
2227
- className: "ul-matrix-scroll-arrow",
2228
- onClick: (h) => {
2229
- h.preventDefault();
2230
- const T = f.current;
2231
- if (T) {
2232
- const O = getComputedStyle(T).direction === "rtl";
2233
- T.scrollLeft = O ? T.clientWidth - T.scrollWidth : T.scrollWidth;
2234
- }
2235
- },
2236
- children: u("svg", {
2237
- fill: "currentColor",
2238
- height: "32",
2239
- viewBox: "0 0 256 256",
2240
- width: "32",
2241
- xmlns: "http://www.w3.org/2000/svg",
2242
- children: u("path", {
2243
- 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"
2244
- })
2245
- })
2246
- }), u("div", {
2247
- className: "ul-card__button-wrapper",
2248
- children: u(q, {
2249
- disabled: S,
2250
- children: ve(o)
2251
- })
2252
- })]
2253
- });
2254
- return u("form", {
2255
- className: L([e, w.FadeInTransition, "ul-card__matrix"]),
2256
- id: "text-form",
2257
- onSubmit: v,
2258
- children: [u(Y, {
2259
- message: t,
2260
- properties: o
2261
- }), u(ae, {
2262
- properties: o,
2263
- defaultBody: N
2264
- })]
2265
- }, i);
2266
- }, or = ({
2267
- className: e,
2268
- message: t,
2269
- onSubmit: n,
2270
- options: r = [],
2271
- properties: o,
2272
- questionId: i,
2273
- type: a
2274
- }) => {
2275
- const {
2276
- border: l,
2277
- useMobileStyling: c
2278
- } = $((S) => ({
2279
- border: S.border,
2280
- useMobileStyling: S.useMobileStyling
2281
- })), d = r.reduce((S, A) => (S[A.id] = {
2282
- isSelected: !1
2283
- }, S), {}), [p, s] = D(d), _ = a === b.MultipleChoice, f = o.required, m = r.find((S) => {
2284
- var A;
2285
- return (A = S.optionProperties) == null ? void 0 : A.noneOfTheAbove;
2286
- }), g = Object.entries(p).some(([S, A]) => {
2287
- var T;
2288
- const N = r.find((O) => `${O.id}` === S), h = A.userText === void 0 || A.userText.trim() === "";
2289
- return ((T = N == null ? void 0 : N.optionProperties) == null ? void 0 : T.allowsTextEntry) && h && A.isSelected;
2290
- }), y = Object.values(p).some((S) => S.isSelected), v = g || f && !y, C = r.map(({
2291
- id: S,
2292
- label: A,
2293
- value: N,
2294
- optionProperties: h
2295
- }) => {
2296
- var U, de;
2297
- const T = `${S}`, {
2298
- allowsTextEntry: O,
2299
- noneOfTheAbove: se
2300
- } = {
2301
- allowsTextEntry: !1,
2302
- noneOfTheAbove: !1,
2303
- ...h
2304
- };
2305
- return u(mt, {
2306
- allowTextEntry: O,
2307
- border: l,
2308
- error: !1,
2309
- id: T,
2310
- isRadio: _,
2311
- noneOfTheAbove: se,
2312
- isSelected: !!((U = p[T]) != null && U.isSelected),
2313
- label: A,
2314
- onUserInputChanged: (E) => R(E.id, E.selected, E.userText, E.noneOfTheAbove),
2315
- promptText: "Please specify",
2316
- text: (de = p[S]) == null ? void 0 : de.userText,
2317
- useMobileStyling: c,
2318
- value: N
2319
- }, T);
2320
- }), k = (S) => {
2321
- S.preventDefault(), S.stopPropagation(), n(p);
2322
- }, R = (S, A, N, h) => {
2323
- const T = Object.assign({}, p);
2324
- if ((_ || h) && A)
2325
- for (const O of Object.values(T))
2326
- O.isSelected = !1, delete O.userText;
2327
- else
2328
- m && !h && p[m.id].isSelected && (T[m.id].isSelected = !1);
2329
- T[S] = {
2330
- isSelected: A,
2331
- userText: N
2332
- }, s(T);
2333
- }, P = () => u("div", {
2334
- children: [u("div", {
2335
- className: L(H(w.ChoiceGroup, c)),
2336
- role: _ ? "radiogroup" : "group",
2337
- children: C
2338
- }), u("div", {
2339
- className: "ul-card__button-wrapper",
2340
- children: u(q, {
2341
- disabled: v,
2342
- onClick: k,
2343
- children: ve(o)
2344
- })
2345
- })]
2346
- });
2347
- return u("form", {
2348
- className: L([e, "ul-card--multiple", w.FadeInTransition]),
2349
- id: "text-form",
2350
- onSubmit: k,
2351
- children: [u(Y, {
2352
- message: t,
2353
- properties: o
2354
- }), u(ae, {
2355
- properties: o,
2356
- defaultBody: P
2357
- })]
2358
- }, i);
2359
- }, Uo = (e) => {
2360
- const {
2361
- questionId: t,
2362
- type: n,
2363
- next: r,
2364
- options: o
2365
- } = e;
2366
- return u(or, {
2367
- ...e,
2368
- onSubmit: (a) => {
2369
- const l = Object.entries(a).find(([, _]) => _.isSelected) || [void 0, void 0], [c, d] = l, p = o.find((_) => `${_.id}` === c), s = d != null && d.userText ? {
2370
- [c]: {
2371
- userText: d.userText
2372
- }
2373
- } : null;
2374
- r({
2375
- value: p && c ? {
2376
- [c]: p.value
2377
- } : {},
2378
- secondaryValue: s,
2379
- questionId: t,
2380
- type: n
2381
- });
2382
- }
2383
- });
2384
- }, Vo = (e) => {
2385
- const {
2386
- questionId: t,
2387
- type: n,
2388
- next: r
2389
- } = e;
2390
- return u(or, {
2391
- ...e,
2392
- onSubmit: (i) => {
2393
- const a = {}, l = Object.entries(i).reduce((d, [p, s]) => (d[p] = s.isSelected, d), a), c = Object.entries(i).reduce((d, [p, s]) => {
2394
- if (!s.userText)
2395
- return d;
2396
- const _ = d || {};
2397
- return _[p] = {
2398
- userText: s.userText
2399
- }, _;
2400
- }, null);
2401
- r({
2402
- value: l,
2403
- secondaryValue: c,
2404
- questionId: t,
2405
- type: n
2406
- });
2407
- }
2408
- });
2409
- }, Ho = ({
2410
- className: e,
2411
- props: {
2412
- labels: t,
2413
- message: n,
2414
- properties: r
2415
- },
2416
- next: o,
2417
- questionId: i,
2418
- type: a
2419
- }) => {
2420
- const {
2421
- border: l,
2422
- useMobileStyling: c
2423
- } = $((m) => ({
2424
- border: m.border,
2425
- useMobileStyling: m.useMobileStyling
2426
- })), d = t && t.left, p = t && t.right, s = [...Array(11)].map((m, g) => u("div", {
2427
- className: L([...H(w.NPSNumber, c), ...H(`${w.NPSNumber}-${g}`, c)]),
2428
- id: `option-${g}`,
2429
- onClick: () => o({
2430
- value: g,
2431
- questionId: i,
2432
- type: a
2433
- }),
2434
- onKeyPress: (y) => {
2435
- y.preventDefault(), (y.key === "Enter" || y.key === " ") && o({
2436
- value: g,
2437
- questionId: i,
2438
- type: a
2439
- });
2440
- },
2441
- onPointerDown: (y) => {
2442
- y.currentTarget.style.zIndex = "2", y.currentTarget.style.borderColor = l;
2443
- },
2444
- onPointerLeave: (y) => {
2445
- y.currentTarget.style.zIndex = "auto", y.currentTarget.style.borderColor = st;
2446
- },
2447
- role: "radio",
2448
- tabIndex: 0,
2449
- children: g
2450
- }, g)), _ = (m) => {
2451
- m.preventDefault(), m.stopPropagation(), o({
2452
- value: null,
2453
- questionId: i,
2454
- type: a
2455
- });
2456
- }, f = () => u("div", {
2457
- children: [u("div", {
2458
- className: "ul-card--nps__numbers",
2459
- children: s
2460
- }), u("div", {
2461
- className: "ul-card--nps__labels",
2462
- children: [u("span", {
2463
- children: d
2464
- }), u("span", {
2465
- children: p
2466
- })]
2467
- }), !r.required && u("div", {
2468
- className: "ul-vertical-centered-container",
2469
- children: u(q, {
2470
- onClick: _,
2471
- children: ve(r)
2472
- })
2473
- })]
2474
- });
2475
- return u("form", {
2476
- className: L([e, "ul-card--nps", w.FadeInTransition]),
2477
- children: [u(Y, {
2478
- message: n,
2479
- properties: r
2480
- }), u(ae, {
2481
- properties: r,
2482
- defaultBody: f
2483
- })]
2484
- }, i);
2485
- }, Bo = ({
2486
- className: e,
2487
- message: t,
2488
- next: n,
2489
- properties: r,
2490
- questionId: o,
2491
- type: i
2492
- }) => {
2493
- const {
2494
- border: a,
2495
- useMobileStyling: l,
2496
- update: c
2497
- } = $((P) => ({
2498
- border: P.border,
2499
- useMobileStyling: P.useMobileStyling,
2500
- update: P.update
2501
- })), [d, p] = D(""), s = ne(null), _ = d.trim(), f = r.required === !0 && !_, m = tr(s, () => c()), g = (P) => {
2502
- m(), P.preventDefault(), P.stopPropagation(), p(P.currentTarget.value);
2503
- }, y = (P) => {
2504
- P.preventDefault(), P.stopPropagation(), n({
2505
- value: d,
2506
- questionId: o,
2507
- type: i
2508
- });
2509
- }, v = r && r.openTextPlaceholder ? r.openTextPlaceholder : "", C = (P) => {
2510
- P.currentTarget.style.borderColor = a;
2511
- }, k = (P) => {
2512
- P.currentTarget.style.borderColor = st;
2513
- }, R = () => u("div", {
2514
- className: "ul-card-text",
2515
- children: [u("div", {
2516
- className: "ul-card-text__container",
2517
- children: u("textarea", {
2518
- "aria-label": v,
2519
- "aria-labelledby": w.QuestionHeader,
2520
- "aria-multiline": "true",
2521
- "aria-placeholder": v,
2522
- className: L(H(w.OpenTextInput, l)),
2523
- "data-gramm": "false",
2524
- maxLength: 5e3,
2525
- name: "text",
2526
- onBlur: k,
2527
- onChange: g,
2528
- onFocus: C,
2529
- placeholder: v,
2530
- ref: s,
2531
- role: "textbox",
2532
- tabIndex: 0
2533
- })
2534
- }), u(q, {
2535
- disabled: f,
2536
- onClick: y,
2537
- style: {
2538
- backgroundColor: f ? "" : a
2539
- },
2540
- children: ve(r)
2541
- })]
2542
- });
2543
- return u("form", {
2544
- className: L([e, "ul-card--text", w.FadeInTransition]),
2545
- id: "text-form",
2546
- children: [u(Y, {
2547
- message: t,
2548
- properties: r
2549
- }), u(ae, {
2550
- defaultBody: R,
2551
- properties: r
2552
- })]
2553
- }, o);
2554
- };
2555
- var ie = /* @__PURE__ */ ((e) => (e[e.RequestNeeded = 1] = "RequestNeeded", e[e.TryAgain = 2] = "TryAgain", e[e.Ready = 3] = "Ready", e))(ie || {});
2556
- const De = (e) => e.type === z.AvPermission, ir = (e) => e.type === z.ScreenPermission, Do = (e, t) => !(De(t) ? t.permissionDescriptors : []).includes(Se.Camera) || e.getVideoTracks().length > 0, ar = (e, t) => {
2557
- if (e === void 0)
2558
- return ie.RequestNeeded;
2559
- if (e) {
2560
- if (!Do(e, t))
2561
- return ie.RequestNeeded;
2562
- } else
2563
- return ie.TryAgain;
2564
- return ie.Ready;
2565
- }, Qt = {
2566
- avStream: null,
2567
- currentPage: null,
2568
- mediaRecordingUids: null,
2569
- nextQuestion: () => {
2570
- },
2571
- passthroughData: void 0,
2572
- recordingMediaTypes: void 0,
2573
- screenPermissionRequested: !1,
2574
- type: void 0
2575
- }, K = Jn((e) => ({
2576
- ...Qt,
2577
- reset: () => {
2578
- e(Qt);
2579
- },
2580
- updatePage: (t) => {
2581
- e(t);
2582
- }
2583
- }));
2584
- function ot({
2585
- currentPage: e,
2586
- pages: t
2587
- }) {
2588
- const {
2589
- avStream: n,
2590
- recordingMediaTypes: r,
2591
- updatePage: o
2592
- } = K.getState(), {
2593
- recorderEventEmitter: i
2594
- } = $.getState();
2595
- i.emit(B.AvPermission, {
2596
- [I.PermissionDescriptors]: e.permissionDescriptors,
2597
- [I.StreamReadyCallback]: (a, l) => {
2598
- if (n === a)
2599
- return;
2600
- let c = e;
2601
- if (a && !e.permissionDescriptors.includes(Se.Camera)) {
2602
- const d = t.indexOf(e), p = l != null && l.active ? d + 2 : d + 1;
2603
- l != null && l.active && r && i.emit(B.BeginRecording, {
2604
- [I.RecordingMediaTypes]: r,
2605
- [I.StartRecordingCallback]: (s) => o({
2606
- mediaRecordingUids: s
2607
- })
2608
- }), c = t[p];
2609
- }
2610
- o({
2611
- currentPage: c,
2612
- avStream: a
2613
- });
2614
- }
2615
- });
2616
- }
2617
- function jo({
2618
- pages: e,
2619
- userId: t,
2620
- responseGroupUid: n,
2621
- surveyId: r,
2622
- questionId: o,
2623
- next: i
2624
- }) {
2625
- const {
2626
- updatePage: a
2627
- } = K.getState(), {
2628
- eventEmitFn: l,
2629
- recorderEventEmitter: c
2630
- } = $.getState(), d = {
2631
- questionId: o,
2632
- surveyId: r,
2633
- visitorId: t,
2634
- responseGroupUid: n
2635
- };
2636
- let p = 0;
2637
- c.emit(ee.RecordedTaskPermissionScreen), l(ee.RecordedTaskPermissionScreen), c.emit(B.PermissionStatus, {
2638
- [I.PermissionStatusCallback]: (_, f, m, g) => {
2639
- const y = e[p], {
2640
- type: v
2641
- } = y, C = [Q.Screen];
2642
- if (De(y)) {
2643
- const {
2644
- permissionDescriptors: k
2645
- } = y, R = k == null ? void 0 : k.includes(Se.Microphone), P = k == null ? void 0 : k.includes(Se.Camera);
2646
- R && C.push(Q.Audio), P && C.push(Q.Video);
2647
- const S = (_ == null ? void 0 : _.active) && !P, A = (_ == null ? void 0 : _.active) && f;
2648
- (S || A) && p++;
2649
- }
2650
- ir(e[p]) && m && (p++, c.emit(B.BeginRecording, {
2651
- [I.RecordingMediaTypes]: C,
2652
- [I.StartRecordingCallback]: (k) => a({
2653
- mediaRecordingUids: k
2654
- })
2655
- })), a({
2656
- currentPage: e[p],
2657
- avStream: _,
2658
- screenPermissionRequested: m,
2659
- nextQuestion: i,
2660
- type: v,
2661
- passthroughData: d,
2662
- recordingMediaTypes: C,
2663
- captureStream: g
2664
- });
2665
- }
2666
- });
2667
- const s = e[p];
2668
- return s.type === z.AvPermission && ot({
2669
- currentPage: s,
2670
- pages: e
2671
- }), s;
2672
- }
2673
- function it({
2674
- status: e
2675
- }) {
2676
- const {
2677
- nextQuestion: t,
2678
- passthroughData: n,
2679
- mediaRecordingUids: r,
2680
- reset: o
2681
- } = K.getState(), {
2682
- recorderEventEmitter: i,
2683
- handleUploadUpdate: a,
2684
- index: l
2685
- } = $.getState(), c = {
2686
- value: {
2687
- taskStatus: e
2688
- },
2689
- type: b.RecordedTask,
2690
- questionId: (n == null ? void 0 : n.questionId) || 1
2691
- };
2692
- n && i.emit(B.FinishTask, {
2693
- [I.BeginCallback]: (d) => {
2694
- a({
2695
- mediaRecordingUid: d,
2696
- isSubmitted: !0,
2697
- progressPct: 0,
2698
- isComplete: !1
2699
- });
2700
- },
2701
- [I.ProgressCallback]: (d, p) => {
2702
- a({
2703
- mediaRecordingUid: d,
2704
- progressPct: p.detail,
2705
- isSubmitted: !1,
2706
- isComplete: !1
2707
- });
2708
- },
2709
- [I.UploadCallback]: (d) => {
2710
- d && a({
2711
- mediaRecordingUid: d,
2712
- isComplete: !0,
2713
- isSubmitted: !0,
2714
- progressPct: 100
2715
- });
2716
- },
2717
- [I.PassthroughData]: n,
2718
- [I.CurrentIndex]: l,
2719
- [I.TaskResponse]: c,
2720
- [I.TaskCompleteCallback]: (d) => {
2721
- c.value.taskDurationMillisecond = d, r && (c.value.mediaRecordingUids = r), o(), t(c);
2722
- }
2723
- });
2724
- }
2725
- function gt({
2726
- pages: e,
2727
- setIsRequestingPermission: t
2728
- }) {
2729
- const {
2730
- recorderEventEmitter: n,
2731
- eventEmitFn: r
2732
- } = $.getState(), {
2733
- updatePage: o,
2734
- currentPage: i,
2735
- recordingMediaTypes: a,
2736
- screenPermissionRequested: l
2737
- } = K.getState();
2738
- if (!i)
2739
- return;
2740
- const c = e.indexOf(i);
2741
- switch (i.type) {
2742
- case z.AvPermission: {
2743
- const d = l ? c + 2 : c + 1;
2744
- l && a && n.emit(B.BeginRecording, {
2745
- [I.RecordingMediaTypes]: a,
2746
- [I.StartRecordingCallback]: (p) => {
2747
- o({
2748
- mediaRecordingUids: p
2749
- });
2750
- }
2751
- }), o({
2752
- currentPage: e[d]
2753
- });
2754
- return;
2755
- }
2756
- case z.ScreenPermission:
2757
- n.emit(B.ScreenPermission, {
2758
- [I.ScreenPermissionRequested]: t,
2759
- [I.StreamReadyCallback]: (d, p) => {
2760
- const s = p ? e[c + 1] : i;
2761
- p && a && n.emit(B.BeginRecording, {
2762
- [I.RecordingMediaTypes]: a,
2763
- [I.StartRecordingCallback]: (_) => {
2764
- o({
2765
- captureStream: p,
2766
- mediaRecordingUids: _
2767
- });
2768
- }
2769
- }), o({
2770
- currentPage: s,
2771
- screenPermissionRequested: !0,
2772
- captureStream: p
2773
- });
2774
- }
2775
- });
2776
- return;
2777
- case z.StartTask:
2778
- r(ee.RecordedTaskStart), n.emit(ee.RecordedTaskStart), n.emit(B.StartTask), o({
2779
- currentPage: e[c + 1],
2780
- screenPermissionRequested: !0
2781
- });
2782
- return;
2783
- case z.CompleteTask:
2784
- return;
2785
- }
2786
- }
2787
- const sr = "ul-permission-graphics-container", lr = "ul-permission-body", cr = L([sr, "ul_recorded-task-inset-spacing"]), je = L(["ul-horizontal-button-container", "ul-horizontal-button-container-left"]), ur = ({
2788
- richTextBody: e
2789
- }) => u("div", {
2790
- className: "ul-rich-text-body",
2791
- dangerouslySetInnerHTML: {
2792
- __html: e
2793
- },
2794
- id: "ul-task-detail-container"
2795
- }), Fe = ({
2796
- required: e,
2797
- skipButtonText: t,
2798
- bottom: n = !1
2799
- }) => e ? null : u(q, {
2800
- className: L([n && "ul-skip-button-below", w.InactiveButton]),
2801
- onClick: it.bind(null, {
2802
- status: W.Abandoned
2803
- }),
2804
- children: t || "Skip"
2805
- }), bt = (e) => {
2806
- const {
2807
- avStream: t,
2808
- captureStream: n,
2809
- recordingMediaTypes: r,
2810
- updatePage: o
2811
- } = K.getState(), i = (r == null ? void 0 : r.includes(Q.Audio)) || (r == null ? void 0 : r.includes(Q.Video));
2812
- F(() => {
2813
- const a = setInterval(() => {
2814
- i && t && !t.active ? o({
2815
- avStream: null,
2816
- currentPage: e[0]
2817
- }) : (!n || !n.active) && o({
2818
- captureStream: void 0,
2819
- currentPage: e[i ? 1 : 0]
2820
- });
2821
- }, 1e3);
2822
- return () => clearInterval(a);
2823
- }, [t, n, i, e, r, o]);
2824
- }, Fo = ({
2825
- content: e,
2826
- pages: t,
2827
- required: n
2828
- }) => {
2829
- const {
2830
- buttonText: r,
2831
- skipButtonText: o,
2832
- taskDetail: i
2833
- } = e;
2834
- return bt(t), u("div", {
2835
- className: "ul-task-page",
2836
- children: [i && u(ur, {
2837
- richTextBody: i
2838
- }), u("div", {
2839
- className: je,
2840
- children: [u(q, {
2841
- onClick: gt.bind(null, {
2842
- pages: t
2843
- }),
2844
- children: r
2845
- }), u(Fe, {
2846
- required: n,
2847
- skipButtonText: o
2848
- })]
2849
- })]
2850
- }, "start-task");
2851
- }, qo = ({
2852
- content: e,
2853
- pages: t,
2854
- properties: n
2855
- }) => {
2856
- const {
2857
- buttonText: r,
2858
- skipButtonText: o
2859
- } = e;
2860
- bt(t);
2861
- const a = u(ae, {
2862
- properties: n,
2863
- defaultBody: () => u("div", {
2864
- className: je,
2865
- children: [u(q, {
2866
- className: "ul-complete-task-button",
2867
- onClick: it.bind(null, {
2868
- status: W.Completed
2869
- }),
2870
- children: r
2871
- }), u(q, {
2872
- className: L([w.InactiveButton]),
2873
- onClick: it.bind(null, {
2874
- status: W.GivenUp
2875
- }),
2876
- children: o
2877
- })]
2878
- })
2879
- });
2880
- return u("div", {
2881
- className: "ul-task-page",
2882
- children: [e.taskDetail && u(ur, {
2883
- richTextBody: e.taskDetail
2884
- }), a]
2885
- }, "complete-task");
2886
- }, zo = ({
2887
- content: e,
2888
- pages: t,
2889
- required: n
2890
- }) => {
2891
- const {
2892
- buttonText: r,
2893
- skipButtonText: o
2894
- } = e, [i] = $((c) => [c.tabTitle]), [a, l] = D(!1);
2895
- return u("div", {
2896
- children: [u("div", {
2897
- className: cr,
2898
- children: [u("p", {
2899
- style: {
2900
- marginTop: "auto"
2901
- },
2902
- children: e.selectTabText
2903
- }), u("div", {
2904
- className: "ul-select-tab-container",
2905
- children: u("p", {
2906
- className: lr,
2907
- children: i
2908
- })
2909
- })]
2910
- }), u("div", {
2911
- className: n ? "" : je,
2912
- children: [u(q, {
2913
- disabled: a,
2914
- onClick: gt.bind(null, {
2915
- pages: t,
2916
- setIsRequestingPermission: l
2917
- }),
2918
- children: r
2919
- }), u(Fe, {
2920
- required: n,
2921
- skipButtonText: o
2922
- })]
2923
- })]
2924
- });
2925
- }, Wo = ({
2926
- content: e
2927
- }) => u("div", {
2928
- className: L([sr, "ul_permission_svg_container", "ul_recorded-task-inset-spacing", "ul-center-horizontally"]),
2929
- dangerouslySetInnerHTML: {
2930
- __html: e.svg
2931
- }
2932
- }, "ul-permission-request-graphic"), Zo = ({
2933
- content: e,
2934
- pages: t,
2935
- required: n
2936
- }) => {
2937
- const {
2938
- permissionDeniedHeadline: r,
2939
- permissionDeniedBody: o,
2940
- skipButtonText: i,
2941
- tryAgainButtonText: a
2942
- } = e, l = De(t[0]) ? t[0] : null;
2943
- return F(() => {
2944
- const c = setInterval(() => {
2945
- l !== null && ot({
2946
- currentPage: l,
2947
- pages: t
2948
- });
2949
- }, 1e3);
2950
- return () => clearInterval(c);
2951
- }, [l, t]), l ? u("div", {
2952
- children: [u("div", {
2953
- className: cr,
2954
- children: u("p", {
2955
- className: "ul-av-permission-denied-paragraph",
2956
- children: [u("span", {
2957
- className: "ul-av-permission-denied-headline",
2958
- children: r
2959
- }), u("span", {
2960
- className: lr,
2961
- children: o
2962
- })]
2963
- })
2964
- }), u("div", {
2965
- className: je,
2966
- children: [u(q, {
2967
- onClick: ot.bind(null, {
2968
- currentPage: l,
2969
- pages: t
2970
- }),
2971
- children: a
2972
- }), u(Fe, {
2973
- required: n,
2974
- skipButtonText: i
2975
- })]
2976
- })]
2977
- }) : null;
2978
- }, Go = ({
2979
- stream: e
2980
- }) => u("video", {
2981
- autoPlay: !0,
2982
- className: L(["ul_recorded-task-inset-spacing"]),
2983
- id: "ul-record-task-video-preview",
2984
- muted: !0,
2985
- ref: (t) => {
2986
- t && (t.srcObject = e || null);
2987
- }
2988
- }), Qo = ({
2989
- content: e,
2990
- pages: t,
2991
- required: n
2992
- }) => {
2993
- const {
2994
- skipButtonText: r
2995
- } = e, {
2996
- avStream: o
2997
- } = K.getState();
2998
- return bt(t), u("div", {
2999
- children: [u(Go, {
3000
- stream: o
3001
- }), u("div", {
3002
- className: "ul-vertical-button-container-center",
3003
- children: [u(q, {
3004
- onClick: gt.bind(null, {
3005
- pages: t
3006
- }),
3007
- children: e.buttonText
3008
- }), u(Fe, {
3009
- bottom: !0,
3010
- required: n,
3011
- skipButtonText: r
3012
- })]
3013
- })]
3014
- });
3015
- }, Ko = ({
3016
- properties: e
3017
- }) => {
3018
- const {
3019
- pages: t,
3020
- required: n
3021
- } = e, {
3022
- avStream: r,
3023
- currentPage: o
3024
- } = K.getState();
3025
- if (o === void 0)
3026
- return null;
3027
- switch (o == null ? void 0 : o.type) {
3028
- case z.AvPermission: {
3029
- const i = ar(r, o);
3030
- return i === ie.RequestNeeded ? u(Wo, {
3031
- content: o
3032
- }) : i === ie.TryAgain ? u(Zo, {
3033
- content: o,
3034
- pages: t,
3035
- required: n
3036
- }) : u(Qo, {
3037
- content: o,
3038
- pages: t,
3039
- required: n
3040
- });
3041
- }
3042
- case z.ScreenPermission:
3043
- return u(zo, {
3044
- content: o,
3045
- pages: t,
3046
- required: n
3047
- });
3048
- case z.StartTask:
3049
- return u(Fo, {
3050
- content: o,
3051
- pages: t,
3052
- required: n
3053
- });
3054
- case z.CompleteTask:
3055
- return u(qo, {
3056
- content: o,
3057
- pages: t,
3058
- properties: e
3059
- });
3060
- default:
3061
- return null;
3062
- }
3063
- }, Yo = ({
3064
- className: e,
3065
- properties: t,
3066
- next: n,
3067
- questionId: r
3068
- }) => {
3069
- const o = $(), {
3070
- surveyId: i,
3071
- responseGroupUid: a,
3072
- userId: l
3073
- } = o, c = K(), {
3074
- screenPermissionRequested: d
3075
- } = c, p = K((g) => g.avStream);
3076
- let s = K((g) => g.currentPage);
3077
- s || (s = jo({
3078
- questionId: r,
3079
- surveyId: i,
3080
- next: (g) => {
3081
- n(g);
3082
- },
3083
- pages: t.pages,
3084
- responseGroupUid: a,
3085
- userId: l
3086
- }));
3087
- let _ = s.headline, f = s.captionText;
3088
- const m = ar(p, s);
3089
- return ir(s) && d && (_ = s.permissionDeniedHeadline, f = s.permissionDeniedCaptionText), De(s) && m === ie.Ready && (_ = s.permissionGrantedHeadline, f = s.permissionGrantedCaptionText), u("div", {
3090
- className: L([e, "ul-center-horizontally", w.FadeInTransition]),
3091
- children: [u(Y, {
3092
- message: _,
3093
- properties: {
3094
- captionText: f
3095
- }
3096
- }), u(Ko, {
3097
- properties: t
3098
- })]
3099
- });
3100
- }, Jo = {
3101
- "{{user_id}}": "externalUserId",
3102
- "{{email}}": "email"
3103
- }, Xo = (e = void 0, t = {}) => {
3104
- if (!e)
3105
- return e;
3106
- let n = e;
3107
- const r = [];
3108
- for (const [c, d] of Object.entries(Jo))
3109
- if (n.toLowerCase().includes(c))
3110
- if (t[d]) {
3111
- const p = new RegExp(c, "gi");
3112
- n = n.replace(p, t[d]);
3113
- } else
3114
- r.push(c);
3115
- if (r.length === 0 || !n.includes("?"))
3116
- return n;
3117
- const o = n.slice(0, n.indexOf("?")), a = n.slice(n.indexOf("?") + 1).split("&").map((c) => c.split("=")).filter((c) => !r.includes(c[1]));
3118
- if (a.length === 0)
3119
- return o;
3120
- const l = a.map((c) => c.join("=")).join("&");
3121
- return `${o}?${l}`;
3122
- }, ei = ({
3123
- className: e,
3124
- message: t,
3125
- next: n,
3126
- properties: r,
3127
- questionId: o,
3128
- type: i
3129
- }) => {
3130
- const {
3131
- visitorAttributes: a
3132
- } = $((s) => ({
3133
- visitorAttributes: s.visitorAttributes
3134
- })), l = (s, _ = !1) => {
3135
- n({
3136
- value: _ ? {
3137
- skipped: !0
3138
- } : void 0,
3139
- questionId: o,
3140
- type: i
3141
- });
3142
- }, c = (s) => {
3143
- (s.key === "Enter" || s.key === " ") && n({
3144
- value: void 0,
3145
- questionId: o,
3146
- type: i
3147
- });
3148
- }, d = () => {
3149
- const s = Xo(r && r.buttonUrl, a);
3150
- return u("div", {
3151
- className: "ul-card-button-group",
3152
- children: [u("a", {
3153
- className: "ul-card-text__button ul-card__text-url-prompt-button",
3154
- href: s,
3155
- id: "ul-card-text__button",
3156
- onClick: l,
3157
- onKeyPress: c,
3158
- rel: "noreferrer",
3159
- role: s ? "link" : "button",
3160
- tabIndex: 0,
3161
- target: "_blank",
3162
- children: ve(r)
3163
- }), r.required === !1 && u("button", {
3164
- className: w.SkipButton,
3165
- onClick: (_) => l(_, !0),
3166
- children: rr(r)
3167
- })]
3168
- });
3169
- }, p = (s, _) => s ? u("div", {
3170
- className: "ul-rich-text-body",
3171
- dangerouslySetInnerHTML: {
3172
- __html: s
3173
- },
3174
- id: "ul-card__text-url-body-container"
3175
- }) : u("div", {
3176
- className: "ul-rich-text-body",
3177
- id: "ul-card__text-url-body-container",
3178
- children: (_ ? _.split(/\n\s*\n/g) : []).map((f, m) => u("p", {
3179
- children: f
3180
- }, m))
3181
- });
3182
- return u("div", {
3183
- className: L([e, "ul-card__text-url-prompt", w.FadeInTransition]),
3184
- children: [u(Y, {
3185
- message: t
3186
- }), p(r == null ? void 0 : r.richTextBody, r == null ? void 0 : r.body), u(ae, {
3187
- defaultBody: d,
3188
- properties: r
3189
- })]
3190
- }, o);
3191
- }, ti = ({
3192
- className: e,
3193
- questionId: t
3194
- }) => {
3195
- const {
3196
- border: n,
3197
- destroy: r,
3198
- endCard: o,
3199
- forceBrandedLogo: i
3200
- } = $((c) => ({
3201
- border: c.border,
3202
- destroy: c.destroy,
3203
- endCard: c.endCard,
3204
- forceBrandedLogo: c.forceBrandedLogo
3205
- }));
3206
- F(() => {
3207
- setTimeout(() => {
3208
- r(_e);
3209
- }, i ? 4e3 : 2e3);
3210
- }, [r, i]);
3211
- const a = o && o.subheader ? u("p", {
3212
- className: w.Caption,
3213
- children: o.subheader
3214
- }) : null, l = o && o.headline ? o.headline : "";
3215
- return u("div", {
3216
- className: L([e, "ul-card--thanks", w.FadeInTransition]),
3217
- children: u("div", {
3218
- children: u("div", {
3219
- className: "ul-card--thanks-content",
3220
- children: [u("div", {
3221
- className: "ul-thanks-check",
3222
- children: u("svg", {
3223
- "aria-labelledby": "title",
3224
- fill: "none",
3225
- height: "99",
3226
- viewBox: "0 0 81 99",
3227
- width: "81",
3228
- xmlns: "http://www.w3.org/2000/svg",
3229
- children: [u("path", {
3230
- clipRule: "evenodd",
3231
- d: "M40.5 77C60.9345 77 77.5 60.4345 77.5 40C77.5 19.5655 60.9345 3 40.5 3C20.0655 3 3.5 19.5655 3.5 40C3.5 60.4345 20.0655 77 40.5 77ZM80.5 40C80.5 62.0914 62.5914 80 40.5 80C18.4086 80 0.5 62.0914 0.5 40C0.5 17.9086 18.4086 0 40.5 0C62.5914 0 80.5 17.9086 80.5 40Z",
3232
- fill: n,
3233
- fillRule: "evenodd"
3234
- }), u("path", {
3235
- clipRule: "evenodd",
3236
- d: "M55.025 22.9046C55.6299 23.4705 55.6616 24.4198 55.0956 25.0247C54.8724 25.2634 54.6109 25.5285 54.3157 25.8277C52.2547 27.9168 48.5549 31.667 44.8135 39.6658C43.2818 42.9406 42.0864 45.8386 41.0823 48.2729C40.6539 49.3116 40.2603 50.2659 39.8902 51.129C39.287 52.5359 38.7248 53.7508 38.1744 54.625C37.8997 55.0613 37.5806 55.4905 37.2017 55.8245C36.8201 56.1607 36.2613 56.5 35.5457 56.5C34.6742 56.5 34.0892 55.9692 33.7774 55.6083C33.4502 55.2296 33.1752 54.7511 32.9396 54.301C32.7305 53.9013 32.5088 53.4367 32.2797 52.9565C32.2429 52.8794 32.2059 52.8019 32.1688 52.7243C31.8942 52.1499 31.5959 51.534 31.2537 50.8868C29.8886 48.305 27.8539 45.2878 24.2343 43.1382C23.522 42.7152 23.2875 41.7949 23.7105 41.0826C24.1335 40.3703 25.0539 40.1358 25.7662 40.5588C30.0556 43.1062 32.4149 46.6647 33.9058 49.4845C34.2776 50.1876 34.5973 50.8487 34.8753 51.4302C34.9147 51.5124 34.9529 51.5926 34.9902 51.6707C35.2222 52.1567 35.4164 52.5637 35.5978 52.9102C35.6151 52.9434 35.6321 52.9754 35.6485 53.0061C36.0565 52.3531 36.5341 51.3434 37.133 49.9468C37.4781 49.1418 37.8572 48.2229 38.2761 47.2074C39.2886 44.7532 40.5339 41.7347 42.0961 38.3948C46.0591 29.9221 50.0641 25.8648 52.1535 23.7482C52.4423 23.4556 52.6944 23.2002 52.9048 22.9753C53.4708 22.3703 54.42 22.3387 55.025 22.9046ZM35.1994 53.5892C35.1994 53.5892 35.2 53.5888 35.2012 53.5879C35.2 53.5889 35.1994 53.5893 35.1994 53.5892ZM36.0666 53.6682C36.0732 53.674 36.0765 53.6775 36.0765 53.6777C36.0765 53.678 36.0732 53.6751 36.0666 53.6682Z",
3237
- fill: n,
3238
- fillRule: "evenodd"
3239
- }), u("path", {
3240
- d: "M69.5 97C69.5 98.1046 56.2924 99 40 99C23.7076 99 10.5 98.1046 10.5 97C10.5 95.8954 23.7076 95 40 95C56.2924 95 69.5 95.8954 69.5 97Z",
3241
- fill: "black",
3242
- fillOpacity: "0.2"
3243
- })]
3244
- })
3245
- }), u(Y, {
3246
- message: l
3247
- }), a]
3248
- })
3249
- })
3250
- }, t);
3251
- }, ni = ({
3252
- className: e
3253
- }) => {
3254
- const {
3255
- uploadProgress: t
3256
- } = $((i) => ({
3257
- uploadProgress: i.uploadProgress
3258
- }));
3259
- let n, r;
3260
- Object.values(t).filter((i) => i.isSubmitted).length > 1 ? (n = "Your responses are processing", r = "Please keep this tab open until your responses are fully processed.") : (n = "Your response is processing", r = "Please keep this tab open until your response is fully processed.");
3261
- const o = Math.round(Math.min(99, ...Object.values(t).filter((i) => i.isSubmitted).map((i) => i.progressPct || 0)));
3262
- return u("div", {
3263
- className: L([e, "ul-card--uploading", w.FadeInTransition]),
3264
- children: [u("div", {
3265
- "aria-busy": "true",
3266
- "aria-label": "Processing...",
3267
- "aria-live": "polite",
3268
- className: w.LoadingSpinnerContainer,
3269
- role: "progressbar",
3270
- children: u("div", {
3271
- className: w.LoadingSpinner,
3272
- children: [u("div", {
3273
- className: w.LoadingSpinnerFirst
3274
- }), u("div", {
3275
- className: w.LoadingSpinnerSecond
3276
- }), u("div", {
3277
- className: w.LoadingSpinnerThird
3278
- }), u("div", {
3279
- className: w.LoadingSpinnerFourth
3280
- })]
3281
- })
3282
- }), u(Y, {
3283
- message: `${n} (${o}% complete)`
3284
- }), u("p", {
3285
- className: w.Caption,
3286
- children: r
3287
- })]
3288
- });
3289
- }, Kt = ({
3290
- logoOnly: e = !1,
3291
- style: t = {}
3292
- }) => u("svg", {
3293
- alt: `${e ? "Powered by " : ""}Sprig`,
3294
- width: e ? "35" : "112",
3295
- height: "15",
3296
- viewBox: e ? "79 0 31 15" : "0 0 112 15",
3297
- fill: "none",
3298
- xmlns: "http://www.w3.org/2000/svg",
3299
- style: {
3300
- display: "block",
3301
- ...t
3302
- },
3303
- children: [!e && u("path", {
3304
- d: "M0.648926 12.0181V2.8584H4.21631C6.0127 2.8584 7.25684 4.06445 7.25684 5.86084V5.87354C7.25684 7.66357 6.0127 8.88867 4.21631 8.88867H2.0708V12.0181H0.648926ZM3.86084 4.05811H2.0708V7.69531H3.86084C5.09229 7.69531 5.80957 7.02881 5.80957 5.87988V5.86719C5.80957 4.72461 5.09229 4.05811 3.86084 4.05811ZM11.6621 12.1514C9.63721 12.1514 8.39941 10.7993 8.39941 8.57764V8.56494C8.39941 6.34961 9.64355 4.99121 11.6621 4.99121C13.6743 4.99121 14.9185 6.34326 14.9185 8.56494V8.57764C14.9185 10.7993 13.6807 12.1514 11.6621 12.1514ZM11.6621 11.0024C12.8428 11.0024 13.5156 10.1011 13.5156 8.57764V8.56494C13.5156 7.03516 12.8428 6.14014 11.6621 6.14014C10.4751 6.14014 9.80859 7.03516 9.80859 8.56494V8.57764C9.80859 10.1074 10.4751 11.0024 11.6621 11.0024ZM17.6226 12.0181L15.7183 5.12451H17.1021L18.3398 10.4438H18.4414L19.8633 5.12451H21.1709L22.5928 10.4438H22.7007L23.9321 5.12451H25.2969L23.3989 12.0181H21.9834L20.5552 6.87646H20.4473L19.0254 12.0181H17.6226ZM29.334 12.1514C27.3154 12.1514 26.0967 10.7739 26.0967 8.59033V8.58398C26.0967 6.43213 27.3408 4.99121 29.2642 4.99121C31.1875 4.99121 32.3682 6.38135 32.3682 8.45068V8.93311H27.4805C27.5059 10.2534 28.2295 11.0215 29.3657 11.0215C30.248 11.0215 30.7749 10.5835 30.9399 10.228L30.9653 10.1772L32.292 10.1709L32.2793 10.228C32.0508 11.1357 31.0986 12.1514 29.334 12.1514ZM29.2705 6.12109C28.3311 6.12109 27.6201 6.76221 27.4995 7.94922H31.0034C30.8955 6.71777 30.2036 6.12109 29.2705 6.12109ZM34.0059 12.0181V5.12451H35.3833V6.16553H35.4849C35.7324 5.43555 36.3735 5.00391 37.2939 5.00391C37.5161 5.00391 37.7573 5.03564 37.897 5.06738V6.33691C37.6494 6.28613 37.4146 6.25439 37.1543 6.25439C36.1006 6.25439 35.3833 6.90186 35.3833 7.89844V12.0181H34.0059ZM41.9277 12.1514C39.9092 12.1514 38.6904 10.7739 38.6904 8.59033V8.58398C38.6904 6.43213 39.9346 4.99121 41.8579 4.99121C43.7812 4.99121 44.9619 6.38135 44.9619 8.45068V8.93311H40.0742C40.0996 10.2534 40.8232 11.0215 41.9595 11.0215C42.8418 11.0215 43.3687 10.5835 43.5337 10.228L43.5591 10.1772L44.8857 10.1709L44.873 10.228C44.6445 11.1357 43.6924 12.1514 41.9277 12.1514ZM41.8643 6.12109C40.9248 6.12109 40.2139 6.76221 40.0933 7.94922H43.5972C43.4893 6.71777 42.7974 6.12109 41.8643 6.12109ZM49.1133 12.1323C47.3804 12.1323 46.2568 10.7422 46.2568 8.57764V8.56494C46.2568 6.38135 47.3613 5.00391 49.1133 5.00391C50.0591 5.00391 50.8652 5.47363 51.2334 6.21631H51.3413V2.42041H52.7124V12.0181H51.3413V10.9326H51.2334C50.8335 11.688 50.0781 12.1323 49.1133 12.1323ZM49.5068 10.958C50.6558 10.958 51.3604 10.0503 51.3604 8.57764V8.56494C51.3604 7.09229 50.6494 6.18457 49.5068 6.18457C48.3516 6.18457 47.6597 7.08594 47.6597 8.56494V8.57764C47.6597 10.0566 48.3516 10.958 49.5068 10.958ZM61.98 12.1323C61.0151 12.1323 60.2598 11.688 59.8599 10.9326H59.7583V12.0181H58.3809V2.42041H59.7583V6.21631H59.8599C60.228 5.47363 61.0342 5.00391 61.98 5.00391C63.7319 5.00391 64.8364 6.38135 64.8364 8.56494V8.57764C64.8364 10.7422 63.7192 12.1323 61.98 12.1323ZM61.5928 10.958C62.7417 10.958 63.4336 10.0566 63.4336 8.57764V8.56494C63.4336 7.08594 62.7417 6.18457 61.5928 6.18457C60.4438 6.18457 59.7329 7.09229 59.7329 8.56494V8.57764C59.7329 10.0503 60.4438 10.958 61.5928 10.958ZM66.8867 14.4429C66.7153 14.4429 66.5122 14.4302 66.3345 14.4111V13.3257C66.4678 13.3447 66.6392 13.3511 66.7979 13.3511C67.439 13.3511 67.8262 13.0781 68.0293 12.3799L68.1309 12.0244L65.6299 5.12451H67.1152L68.8418 10.6343H68.9624L70.6826 5.12451H72.1299L69.5654 12.2847C68.9814 13.9287 68.2832 14.4429 66.8867 14.4429Z",
3305
- fill: "black",
3306
- fillOpacity: "0.7"
3307
- }), u("path", {
3308
- d: "M81.1088 6.63629C79.6878 6.32154 78.9672 5.76865 78.9672 4.99369C78.9672 4.19299 79.736 3.5886 80.7556 3.5886C81.8066 3.5886 82.5995 4.25285 82.5995 5.13336V5.20352H84.0518V5.13336C84.0518 3.52424 82.6405 2.30774 80.7693 2.30774C79.8676 2.30774 79.0414 2.58451 78.4433 3.08655C78.1463 3.33144 77.9077 3.63818 77.7448 3.98479C77.5818 4.33141 77.4984 4.70934 77.5005 5.09153C77.4946 5.44197 77.5675 5.78934 77.714 6.10857C77.8605 6.42779 78.0769 6.71092 78.3475 6.93752C78.8512 7.37584 79.5659 7.70024 80.4709 7.90299C81.9949 8.23898 82.7676 8.81054 82.7676 9.60094C82.7676 10.4576 81.9258 11.1032 80.813 11.1032C79.6571 11.1032 78.7854 10.3856 78.7854 9.43424V9.36408H77.3318V9.43424C77.3318 11.1167 78.8219 12.3847 80.7973 12.3847C81.7421 12.3847 82.6093 12.0983 83.2393 11.5769C83.5519 11.3237 83.8034 11.0048 83.9753 10.6433C84.1472 10.2818 84.2352 9.88702 84.2329 9.48766C84.2329 8.05875 83.1833 7.09907 81.1088 6.63629Z",
3309
- fill: "black",
3310
- fillOpacity: "0.7"
3311
- }), u("path", {
3312
- d: "M89.2394 4.68276C88.6963 4.67605 88.1596 4.79915 87.6751 5.04156C87.1905 5.28397 86.7725 5.63851 86.4566 6.07497V4.85204H85.0747V14.8479H86.4566V11.0356C86.7725 11.472 87.1906 11.8265 87.6751 12.0688C88.1596 12.3111 88.6963 12.434 89.2394 12.4272C91.3836 12.4272 93 10.7627 93 8.55495C93 6.34723 91.3836 4.68276 89.2394 4.68276ZM91.5608 8.84202C91.5057 9.41605 91.2512 9.95356 90.8406 10.3633C90.4299 10.773 89.8883 11.0296 89.3078 11.0896C88.5363 11.1669 87.8177 10.9461 87.2841 10.4692C86.7505 9.99222 86.4566 9.3106 86.4566 8.55495C86.4566 7.10159 87.5538 6.00546 89.0087 6.00546C89.7619 6.00546 90.4421 6.29124 90.9171 6.81002C91.407 7.34232 91.6357 8.06385 91.5608 8.84202Z",
3313
- fill: "black",
3314
- fillOpacity: "0.7"
3315
- }), u("path", {
3316
- d: "M109.95 4.85407V6.06349C109.298 5.18298 108.292 4.68286 107.153 4.68286C105.017 4.68286 103.406 6.31709 103.406 8.48426C103.406 10.6514 105.017 12.285 107.153 12.285C108.296 12.285 109.303 11.79 109.95 10.9185V11.1046C109.95 12.6101 108.993 13.5826 107.513 13.5826C106.513 13.5826 105.68 13.1494 105.284 12.424L105.264 12.3867H103.838L103.871 12.48C104.112 13.1892 104.583 13.8001 105.211 14.2179C105.841 14.6324 106.637 14.8512 107.513 14.8512C108.637 14.8512 109.594 14.4972 110.28 13.8285C110.967 13.1597 111.332 12.2194 111.332 11.1213V4.85407H109.95ZM109.175 10.3502C108.588 10.905 107.752 11.138 106.879 10.9887C106.361 10.8984 105.886 10.6475 105.523 10.2725C105.16 9.89751 104.927 9.41787 104.859 8.90328C104.736 8.03757 104.999 7.21756 105.581 6.655C106.069 6.19093 106.723 5.93643 107.401 5.94699C107.565 5.94713 107.729 5.96026 107.891 5.98625C108.946 6.15489 109.781 7.01609 109.921 8.0852C110.039 8.96507 109.766 9.78958 109.175 10.3502Z",
3317
- fill: "black",
3318
- fillOpacity: "0.7"
3319
- }), u("path", {
3320
- d: "M101.89 2.12378C101.63 2.06766 101.358 2.11486 101.133 2.25518C100.908 2.39551 100.747 2.61769 100.687 2.87371C100.626 3.12973 100.67 3.39902 100.809 3.62339C100.947 3.84775 101.17 4.00917 101.428 4.07275C101.503 4.08936 101.58 4.09778 101.657 4.09786C101.906 4.09824 102.146 4.0083 102.331 3.84518C102.517 3.68206 102.636 3.45714 102.664 3.21327C102.693 2.9694 102.63 2.72361 102.487 2.5227C102.344 2.32179 102.132 2.17981 101.89 2.12378Z",
3321
- fill: "black",
3322
- fillOpacity: "0.7"
3323
- }), u("path", {
3324
- d: "M100.967 10.934H99.7755C98.9285 10.934 98.4196 10.3644 98.4196 9.40982C98.4196 8.4791 98.8757 7.36945 99.8054 6.01778L99.8178 5.99976V5.61807L95.8571 5.06453C95.8585 4.90331 95.8162 4.74466 95.7346 4.60501C95.653 4.46536 95.5352 4.34979 95.3932 4.27027C95.0381 4.07718 94.6498 4.07717 94.3279 4.26383C94.1667 4.35799 94.035 4.4945 93.9476 4.65816C93.8602 4.82182 93.8205 5.00623 93.8328 5.19087C93.8452 5.37552 93.9092 5.55315 94.0176 5.70402C94.1261 5.85489 94.2748 5.97309 94.4472 6.04546L93.2151 12.258H94.5833L95.7196 6.35891L97.8593 6.7155C97.284 7.73439 96.9921 8.68442 96.9921 9.53919C96.9921 11.1168 97.9577 12.1498 99.5187 12.2496V12.258H102.346V4.87723H100.967V10.934Z",
3325
- fill: "black",
3326
- fillOpacity: "0.7"
3327
- })]
3328
- }), ri = () => {
3329
- const {
3330
- border: e,
3331
- cards: t,
3332
- forceBrandedLogo: n,
3333
- headers: r,
3334
- index: o,
3335
- marketingUrl: i,
3336
- showSurveyBrand: a,
3337
- slugName: l,
3338
- surveyId: c,
3339
- viewedCardCount: d
3340
- } = $((k) => ({
3341
- border: k.border,
3342
- cards: k.cards,
3343
- forceBrandedLogo: k.forceBrandedLogo,
3344
- headers: k.headers,
3345
- index: k.index,
3346
- marketingUrl: k.marketingUrl,
3347
- showSurveyBrand: k.showSurveyBrand,
3348
- slugName: k.slugName,
3349
- surveyId: k.surveyId,
3350
- viewedCardCount: k.viewedCardCount
3351
- })), p = ne(null), s = t.filter((k) => k.type !== b.Uploading && k.type !== b.Thanks), _ = To(t, o), f = d + 1, m = f / (f + _), g = `${i}?utm_source=survey_branding&utm_medium=website&utm_campaign=${l}&utm_content=${c}${n && "&utm_term=poweredby_pill"}`;
3352
- F(() => {
3353
- p.current && (p.current.style.width = `${m * 100}%`);
3354
- }, [m]);
3355
- const y = () => u(j, {
3356
- children: [s.length > 1 && u("div", {
3357
- id: "ul-progress-bar-container",
3358
- children: u("div", {
3359
- id: "ul-progress-bar-current",
3360
- ref: p,
3361
- style: {
3362
- border: `1px solid ${e || "#000"}`
3363
- }
3364
- })
3365
- }), a ? u("div", {
3366
- className: n ? "yellow-footer-logo" : "",
3367
- style: {
3368
- marginTop: "4px"
3369
- },
3370
- children: u("a", {
3371
- href: g,
3372
- rel: "noreferrer",
3373
- target: "_blank",
3374
- children: u("div", {
3375
- style: {
3376
- display: "flex"
3377
- },
3378
- children: [u(Kt, {
3379
- logoOnly: !1
3380
- }), n && u(Yt, {
3381
- style: {
3382
- display: "block",
3383
- margin: "auto 0 auto 4px",
3384
- transform: "rotateY(0deg) rotate(-45deg)"
3385
- }
3386
- })]
3387
- })
3388
- })
3389
- }) : null]
3390
- }), v = () => u("a", {
3391
- dir: "ltr",
3392
- href: g,
3393
- rel: "noreferrer",
3394
- target: "_blank",
3395
- children: u("div", {
3396
- className: "thank-you-card-link",
3397
- children: [u("div", {
3398
- className: "sprig-box-logo",
3399
- children: u(Kt, {
3400
- logoOnly: !0,
3401
- style: {
3402
- margin: "auto"
3403
- }
3404
- })
3405
- }), u("div", {
3406
- children: u("p", {
3407
- children: ["Capture insights about your own product", u(Yt, {
3408
- style: {
3409
- display: "inline-flex",
3410
- marginInlineStart: "4px",
3411
- verticalAlign: "middle"
3412
- }
3413
- })]
3414
- })
3415
- })]
3416
- })
3417
- }), C = t[o].type === b.Thanks;
3418
- return u("footer", {
3419
- className: `ul-footer ${r["userleap-platform"] === "link" ? "ul-footer__link" : ""}`,
3420
- style: a ? {} : {
3421
- marginBottom: "10px"
3422
- },
3423
- children: C && n ? v() : y()
3424
- });
3425
- }, Yt = ({
3426
- style: e
3427
- }) => u("svg", {
3428
- fill: "none",
3429
- height: "10",
3430
- style: e,
3431
- viewBox: "0 0 12 10",
3432
- width: "12",
3433
- xmlns: "http://www.w3.org/2000/svg",
3434
- children: [u("path", {
3435
- d: "M1.47839 5.2085L10.9384 5.2085",
3436
- stroke: "black",
3437
- strokeLinecap: "round",
3438
- strokeLinejoin: "round",
3439
- strokeWidth: "1.35"
3440
- }), u("path", {
3441
- d: "M7.0686 1.15845L10.9386 5.20845L7.0686 9.25845",
3442
- stroke: "black",
3443
- strokeLinecap: "round",
3444
- strokeLinejoin: "round",
3445
- strokeWidth: "1.35"
3446
- })]
3447
- }), oi = () => {
3448
- const {
3449
- answers: e,
3450
- border: t,
3451
- cards: n,
3452
- close: r,
3453
- configureExitOnOverlayClick: o,
3454
- destroy: i,
3455
- endCard: a,
3456
- eventEmitFn: l,
3457
- fontFamily: c,
3458
- headers: d,
3459
- index: p,
3460
- next: s,
3461
- showStripes: _,
3462
- surveyId: f,
3463
- update: m,
3464
- useMobileStyling: g,
3465
- viewDocument: y
3466
- } = $((E) => ({
3467
- answers: E.answers,
3468
- border: E.border,
3469
- cards: E.cards,
3470
- close: E.close,
3471
- configureExitOnOverlayClick: E.configureExitOnOverlayClick,
3472
- destroy: E.destroy,
3473
- endCard: E.endCard,
3474
- eventEmitFn: E.eventEmitFn,
3475
- fontFamily: E.fontFamily,
3476
- headers: E.headers,
3477
- index: E.index,
3478
- next: E.next,
3479
- showStripes: E.showStripes,
3480
- surveyId: E.surveyId,
3481
- update: E.update,
3482
- useMobileStyling: E.useMobileStyling,
3483
- viewDocument: E.viewDocument
3484
- })), v = ne(null), C = ne(!1), k = d["userleap-platform"], {
3485
- props: R,
3486
- type: P,
3487
- name: S
3488
- } = n[p], A = n.length;
3489
- F(() => {
3490
- v.current && (v.current.classList.contains("ul-app--visible") || v.current.classList.add("ul-app--visible"), !C.current && l && (C.current = !0, l(oe.SurveyAppeared, {
3491
- name: oe.SurveyAppeared,
3492
- [xr.SurveyId]: f
3493
- })));
3494
- }, [l, f]), F(() => {
3495
- m();
3496
- }, [p, m]), F(() => {
3497
- o(() => r());
3498
- }, [r, o]);
3499
- const N = () => r(_e), h = (E) => {
3500
- E.key === "Enter" && N();
3501
- }, T = async function(E) {
3502
- s({
3503
- data: E,
3504
- completeSurvey: () => {
3505
- i(_e);
3506
- },
3507
- endCard: a
3508
- }), Cr(y);
3509
- };
3510
- if (e) {
3511
- for (const E of e)
3512
- if (E.questionId === S) {
3513
- let re;
3514
- if (P === b.MultipleChoice) {
3515
- const le = R.options.find(({
3516
- value: qe
3517
- }) => qe === E.value);
3518
- if (!le)
3519
- break;
3520
- re = {
3521
- [le.id]: le.value
3522
- };
3523
- } else
3524
- re = E.value;
3525
- T({
3526
- value: re,
3527
- type: P,
3528
- questionId: E.questionId
3529
- });
3530
- break;
3531
- }
3532
- }
3533
- const O = () => [Ke.Email, Ke.Link].includes(d["userleap-platform"]) ? !1 : !a || p + 1 !== A, se = () => g ? {
3534
- borderColor: t
3535
- } : {
3536
- borderColor: t,
3537
- margin: "15px"
3538
- }, U = () => {
3539
- const E = {
3540
- className: "ul-card",
3541
- next: T,
3542
- questionId: S,
3543
- type: P
3544
- };
3545
- switch (P) {
3546
- case b.ConsentLegal:
3547
- return V(Ao, {
3548
- ...E,
3549
- ...R,
3550
- key: S
3551
- });
3552
- case b.Likert:
3553
- return V($o, {
3554
- ...E,
3555
- ...R,
3556
- key: S
3557
- });
3558
- case b.Matrix:
3559
- return V(Oo, {
3560
- ...E,
3561
- ...R,
3562
- key: S
3563
- });
3564
- case b.MultipleChoice:
3565
- return V(Uo, {
3566
- ...E,
3567
- ...R,
3568
- key: S
3569
- });
3570
- case b.MultipleSelect:
3571
- return V(Vo, {
3572
- ...E,
3573
- ...R,
3574
- key: S
3575
- });
3576
- case b.NPS:
3577
- return V(Ho, {
3578
- ...E,
3579
- key: S,
3580
- props: R
3581
- });
3582
- case b.Open:
3583
- return V(Bo, {
3584
- ...E,
3585
- ...R,
3586
- key: S
3587
- });
3588
- case b.RecordedTask:
3589
- return V(Yo, {
3590
- ...E,
3591
- ...R,
3592
- key: S
3593
- });
3594
- case b.TextUrlPrompt:
3595
- return V(ei, {
3596
- ...E,
3597
- ...R,
3598
- key: S
3599
- });
3600
- case b.Thanks:
3601
- return V(ti, {
3602
- ...E,
3603
- ...R,
3604
- key: S
3605
- });
3606
- case b.Uploading:
3607
- return V(ni, {
3608
- ...E,
3609
- ...R,
3610
- key: S
3611
- });
3612
- case b.VideoVoice:
3613
- return null;
3614
- default:
3615
- return null;
3616
- }
3617
- }, de = (E) => {
3618
- var vt;
3619
- const re = window.sprigAPI, le = E.target;
3620
- if (!re || !le)
3621
- return;
3622
- const qe = [le, le.parentElement];
3623
- for (const Re of qe)
3624
- if (((vt = Re == null ? void 0 : Re.tagName) == null ? void 0 : vt.toLowerCase()) === "a") {
3625
- E.preventDefault(), re == null || re.openUrl(Re.href);
3626
- return;
3627
- }
3628
- };
3629
- return u("div", {
3630
- className: L("ul-app", $e(d) ? "ul-app--visible" : "ul-app--overlay"),
3631
- dir: "auto",
3632
- id: _e,
3633
- onClick: de,
3634
- ref: v,
3635
- style: {
3636
- "--theme": t,
3637
- ...c ? {
3638
- fontFamily: c.replace(";", "")
3639
- } : {}
3640
- },
3641
- children: u("div", {
3642
- className: "ul-app__container",
3643
- children: u("div", {
3644
- className: L(H(w.CardContainer, g)),
3645
- style: se(),
3646
- children: [O() && u("div", {
3647
- className: L(H(w.CloseContainer, g)),
3648
- children: u("div", {
3649
- "aria-label": "Close button",
3650
- className: w.CloseButton,
3651
- onClick: N,
3652
- onKeyPress: h,
3653
- role: "button",
3654
- tabIndex: 0,
3655
- children: u("svg", {
3656
- fill: "none",
3657
- height: "18px",
3658
- viewBox: "0 0 13 13",
3659
- width: "18px",
3660
- xmlns: "http://www.w3.org/2000/svg",
3661
- children: u("path", {
3662
- d: "M2.54964 1.78369L1.78369 2.54964L5.73405 6.5L1.78369 10.4504L2.54964 11.2163L6.5 7.26595L10.4504 11.2163L11.2163 10.4504L7.26595 6.5L11.2163 2.54964L10.4504 1.78369L6.5 5.73405L2.54964 1.78369Z",
3663
- fill: "#262136"
3664
- })
3665
- })
3666
- })
3667
- }), _ && u("div", {
3668
- className: "ul-header__container",
3669
- dir: "ltr",
3670
- children: u("div", {
3671
- className: "ul-header",
3672
- children: "For development purposes only"
3673
- })
3674
- }), u("div", {
3675
- className: L(yr(w.CardMainContent, k)),
3676
- children: U()
3677
- }), u(ri, {})]
3678
- })
3679
- })
3680
- });
3681
- }, ii = 'html,body,p,ol,ul,li,dl,dt,dd,blockquote,figure,fieldset,legend,textarea,pre,iframe,hr,h1,h2,h3,h4,h5,h6{margin:0;padding:0}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:400}button,input,select,textarea{margin:0}html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}ol,ul{padding-inline-start:1em}.ul-card{flex:1 1 auto;border-radius:2px;display:flex;flex-direction:column;font-size:17px;line-height:19px;margin:auto;text-align:start;min-width:200px}.ul-card__container--desktop{border:2px solid #fff;box-shadow:0 0 15px #00000026}.ul-card__container--mobile{border-width:0;box-shadow:0 0 5px #00000040;margin-top:5px}.ul-card__container{background:#fff;border-radius:6px;display:flex;flex-direction:column;flex-grow:1;flex:1 1 auto;font-size:17px;line-height:23px;overflow:auto;padding:20px 20px 5px;position:relative;text-align:center;word-break:break-word}.ul-card-vertical__button-wrapper{flex-direction:column;align-items:center}.ul-card__button-wrapper{margin-top:4px;margin-bottom:3px;display:flex;gap:16px;justify-content:center}.ul-rich-text-body{min-height:2em}.ul-rich-text-body,.ul-rich-text-body p{margin-top:10px;margin-bottom:10px}.ul-rich-text-body li{margin:5px 0}.ul-rich-text-body p,.ul-rich-text-body li{font-size:15px;line-height:130.35%;letter-spacing:.02em;color:#343442;text-align:start;white-space:pre-line}.ul-rich-text-body:last-child,.ul-rich-text-body li:last-child{margin-bottom:15px}.ul-card-main-content__link,.ul-card-main-content__email{flex-grow:55;display:flex}.ul-card-main-content__web,.ul-card-main-content__android,.ul-card-main-content__ios{margin-bottom:5px}.ul-question{color:#343442;display:block;font-size:20px;line-height:125%;font-weight:500;cursor:default;text-align:start}.ul-caption{flex:1 0 auto;margin-top:8px;margin-bottom:15px;font-size:15px;line-height:130.35%;letter-spacing:.02em;color:#6c6c6e;text-align:start}.ul-card__choices{margin:5px 0 0;flex:1 0}.choice--mobile{border:2px solid #e6e6e6}.choice--desktop{border:1px solid #e6e6e6}.choice{align-items:flex-start;color:#262136;cursor:pointer;display:flex;justify-content:flex-start;flex-direction:column;box-sizing:border-box;border-radius:3px;margin-bottom:7px;font-size:15px;line-height:20px;padding:10px 20px 10px 15px;background-color:#00000003}.choice--desktop:hover,.choice--desktop:active,.choice--mobile:active{background-color:#0000000d}.choice-label-container{align-items:center;display:flex;flex-direction:row;flex:0 0 fit-content;gap:15px;height:fit-content;justify-content:flex-start;width:100%}.choice-text-entry-container{width:100%;height:fit-content;flex:0 1 fit-content;overflow:hidden}.choice .choice-text-input--mobile{max-height:63px}.choice .choice-text-input--desktop{max-height:150px}.choice .choice-text-input{box-sizing:border-box;background-color:transparent;color:#343442;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;min-height:20px;max-height:60px;padding:0;margin-top:8px;resize:none;width:100%;font-size:14px;line-height:20px;outline:none;border:none;overflow-wrap:break-word}.choice .choice-text-input::placeholder{color:#6c6c6e80}.ul-thanks-check{text-align:center;margin-bottom:20px}.ul-card--thanks-content{padding:20px 0 10px}.ul-card--thanks .ul-question{padding-top:0;text-align:center}.ul-card--thanks .ul-caption{padding-top:0;text-align:center;overflow-wrap:break-word;-webkit-hyphens:auto;hyphens:auto;hyphenate-limit-lines:no-limit}.ul-card--uploading .ul-question{padding-top:15px;text-align:center}.ul-card--uploading .ul-caption{padding-top:5px;text-align:center;overflow-wrap:break-word}.ul-loading-spinner-container{font-size:1.8rem;flex-grow:1;width:100%;height:100%;display:flex;align-items:center;justify-content:center}.ul-loading-spinner{display:inline-block;position:relative;width:6rem;height:6rem}.ul-loading-spinner div{box-sizing:border-box;display:block;position:absolute;width:80%;height:80%;margin:5px;border:5px solid #152e3e;border-radius:50%;animation:lds-ring 1.2s cubic-bezier(.5,0,.5,1) infinite;border-color:#152e3e transparent transparent transparent}.ul-loading-spinner .first{animation-delay:-.45s}.ul-loading-spinner .second{animation-delay:-.3s}.ul-loading-spinner .third{animation-delay:-.15s}@keyframes lds-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.select-checkbox{height:16px;width:16px;border-radius:3px;border:1px solid #323232;display:flex;box-sizing:border-box;box-shadow:inset 3px 3px #0000001a;background-color:"transparent";align-items:center;justify-content:center}.select-radio{height:16px;width:16px;border-radius:16px;border:1px solid #323232;display:flex;box-sizing:border-box;box-shadow:inset 2px 2px #0000001a;background-color:"transparent";align-items:center;justify-content:center}.fade-in-transition{animation:fadeIn .4s ease-in;-webkit-animation:fadeIn .4s ease-in;-moz-animation:fadeIn .4s ease-in;-o-animation:fadeIn .4s ease-in;-ms-animation:fadeIn .4s ease-in}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@-moz-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@-webkit-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@-o-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@-ms-keyframes fadeIn{0%{opacity:0}to{opacity:1}}[class^=CenteredSurveyLayout] .ul-header__container,[class^=QuestionConceptTestLayout] .ul-header__container,.ul-websurvey-frame .ul-card__container,.ul-websurvey-frame-mobile .ul-card__container{margin-bottom:unset}[class^=CenteredSurveyLayout] .ul-card__container,[class^=QuestionConceptTestLayout] .ul-card__container,.ul-websurvey-frame .ul-card__container,.ul-websurvey-frame-mobile .ul-card__container{align-self:center;box-shadow:unset;border-radius:unset;border:none!important;position:unset;width:100%}@media only screen and (min-height: 600px) and (width: 600px){.ul-card{position:relative;top:-20px}}.ul-vertical-centered-container{display:flex;flex-direction:column;align-items:center}.ul-consent-legal__name-input--mobile{border:2px solid #e6e6e6}.ul-consent-legal__name-input--desktop{border:1px solid #e6e6e6}.ul-consent-legal__name-input{background:#00000003;box-sizing:border-box;color:#343442;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;padding:10px 20px 10px 15px;border-radius:3px;font-size:15px;line-height:20px;margin-bottom:7px;width:100%}.ul-consent-legal__name-input::placeholder{color:#6c6c6e80}.ul-consent-legal__name-input:focus{outline:none;background:#fff}.ul-consent-legal__name-input--desktop:hover:not(:focus){background-color:#0000000d}.ul-card__consent-legal .choice{font-size:15px;padding:10px 15px;background-color:#00000003}.ul-card__consent-legal .choice--desktop:hover,.ul-card__consent-legal .choice--desktop:active,.ul-card__consent-legal .choice--mobile:active{background-color:#0000000d}.ul-card--likert__numbers{align-items:center;border-radius:5px;display:flex;flex-direction:row;flex:1 0;justify-content:center;margin:5px 0 0}.likert-number--mobile{border:2px solid #e6e6e6}.likert-number--mobile:not(:first-child){margin-inline-start:-2px}.likert-number--desktop{border:1px solid #e6e6e6}.likert-number--desktop:not(:first-child){margin-inline-start:-1px}.likert-number{align-items:center;cursor:pointer;display:flex;justify-content:center;flex:1 0;background-color:#00000003;font-size:18px;line-height:24px;height:67px}.likert-number:first-child{border-start-start-radius:5px;border-end-start-radius:5px}.likert-number:last-child{border-start-end-radius:5px;border-end-end-radius:5px}.likert-number:active,.likert-number--desktop:hover{background-color:#0000000d;font-weight:500}.likert-star--mobile:not(:first-child){margin-inline-start:-2px}.likert-star--desktop:not(:first-child){margin-inline-start:-1px}.likert-star{align-items:center;cursor:pointer;display:flex;justify-content:space-between;flex:1 0;color:transparent;font-size:18px;line-height:24px;height:67px}.likert-smiley--mobile:not(:first-child){margin-inline-start:-2px}.likert-smiley--desktop:not(:first-child){margin-inline-start:-1px}.likert-smiley{align-items:center;cursor:pointer;display:flex;justify-content:space-between;flex:1 0;color:transparent;line-height:24px;height:67px}.likert-smiley circle:not(:first-child){fill-opacity:1}.ul-card--likert__labels{align-items:center;color:#262136;display:flex;flex-direction:row;flex:1 0;font-weight:500;font-size:13px;line-height:15px;justify-content:space-between;margin:7px 0 10px}.ul-card--matrix_grid{display:grid;grid-template-columns:max-content repeat(var(--numColumns),minmax(93px,1fr));grid-template-rows:repeat(var(--numRows),min-content);margin:0 auto;row-gap:4px;width:max-content}.ul-matrix-row-options{display:grid;grid-column:2/-1;grid-template-columns:subgrid}.ul-matrix-column-label{font-size:15px;max-width:150px;padding:10px 12px;text-align:center}.ul-card--matrix_container{margin-bottom:16px;overflow:auto}.ul-card--matrix_question_container{display:flex;flex-direction:column}.ul-matrix-scroll-gradient{-webkit-mask-image:linear-gradient(90deg,#000 90%,transparent);mask-image:linear-gradient(90deg,#000 90%,transparent)}.ul-matrix-scroll-gradient:dir(rtl){-webkit-mask-image:linear-gradient(270deg,#000,90%,transparent);mask-image:linear-gradient(270deg,#000,90%,transparent)}.ul-matrix-scroll-gradient:dir(rtl)+.ul-matrix-scroll-arrow{rotate:180deg}.ul-matrix-scroll-arrow{align-self:flex-end;background:none;border:none;color:#000;padding:0;position:absolute;top:45%}.ul-matrix-scroll-arrow:hover{cursor:pointer}.ul-matrix-option-wrapper{align-items:center;background:#f9f9f8;display:flex;justify-content:center;padding:10px 12px}.ul-matrix-last-option{border-start-end-radius:4px;border-end-end-radius:4px}.ul-matrix-row-label{align-items:center;background:#f9f9f8;border-end-start-radius:4px;border-start-start-radius:4px;display:flex;font-size:15px;left:0;right:0;max-width:200px;min-width:100px;padding:10px 12px;position:sticky}.ul-matrix-option-selected{border:6px solid var(--border);box-shadow:none}.ul-card__matrix{max-width:100%}.select-label{cursor:pointer;flex:1;overflow-wrap:anywhere;text-align:start}.ul-card--nps__numbers{align-items:center;border-radius:5px;display:flex;flex-direction:row;flex:1 0;justify-content:center;margin:5px 0 0}.nps-number--mobile{border:2px solid #e6e6e6}.nps-number--mobile:not(:first-child){margin-inline-start:-2px}.nps-number--desktop{border:1px solid #e6e6e6}.nps-number--desktop:not(:first-child){margin-inline-start:-1px}.nps-number{align-items:center;cursor:pointer;display:flex;justify-content:center;flex:1 0;background-color:#00000003;font-size:18px;line-height:24px;height:67px}.nps-number:first-child{border-start-start-radius:5px;border-end-start-radius:5px}.nps-number:last-child{border-start-end-radius:5px;border-end-end-radius:5px}.nps-number:active,.nps-number--desktop:hover{background-color:#0000000d;font-weight:500}.ul-card--nps__labels{align-items:center;color:#262136;display:flex;flex-direction:row;flex:1 0;font-weight:500;font-size:13px;line-height:15px;justify-content:space-between;margin:7px 0 10px}.ul-card-text{flex:1 0 auto;margin-top:2px;margin-bottom:3px;align-items:center;display:flex;flex-wrap:wrap;justify-content:center;padding:0}.ul-card-text__container{align-items:center;box-sizing:border-box;border-radius:3px;display:flex;justify-content:center;margin-bottom:12px;flex:1 0 100%}.ul-card-text__input--mobile{border:2px solid #e6e6e6;max-height:63px}.ul-card-text__input--desktop{border:1px solid #e6e6e6;max-height:150px}.ul-card-text__input{background:#00000003;box-sizing:border-box;color:#343442;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;min-height:63px;overflow:auto;padding:12px;resize:none;width:100%;border-radius:3px;font-size:15px;line-height:20px;overflow-wrap:break-word}.ul-card-text__input::placeholder{color:#6c6c6e80}.ul-card-text__input:focus{outline:none;background:#fff}.ul-card-text__input--desktop:hover:not(:focus){background-color:#0000000d}.ul-card__text-url-prompt-button{text-decoration:none;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;max-width:-webkit-fill-available}#ul-card-voice__video{align-items:center;display:flex;flex-direction:column}#ul-card-voice__video>div{margin-bottom:10px;width:100%}#ul-card-video__player_recorder{width:100%;width:-moz-available;width:-webkit-fill-available;width:fill-available}.ul-card-record__task{flex:1 0 auto;margin-top:2px;margin-bottom:3px;align-items:center;display:flex;flex-wrap:wrap;justify-content:center;padding:0}#ul-record-task-upload-progress,#ul-record-task-video-preview{width:100%;height:150px}.ul-permission-graphics-container{width:100%;height:150px;background-color:#0000000d;text-align:center;flex-direction:column;margin-left:auto;margin-right:auto;border-radius:5px;display:flex;align-items:center;font-size:15px;color:#000000b3}.ul-av-permission-denied-paragraph{margin:auto 15px;font-size:12px}.ul-av-permission-denied-headline{font-size:14px;color:#262136;text-decoration:underline;font-size:12px}.ul-permission-body{color:#000;margin:5px auto 5px 5px;line-height:135%;text-align:center}.ul-select-tab-container{width:240px;height:46px;background:#fff;border-radius:5px;text-align:start;align-items:center;display:flex;padding:0 5px;margin-top:20px;margin-bottom:auto}.ul-select-tab-text{color:#4b575d;margin:5px;line-height:135%;text-align:center}button.ul-task-skip-button{color:#000;background-color:#fff}#ul-task-detail-container{margin-top:0;margin-bottom:0;overflow:auto}#ul-task-detail-container.ul-rich-text-body p,#ul-task-detail-container.ul-rich-text-body li,#ul-task-detail-container.ul-rich-text-body{color:#4c4c4c}#ul-task-detail-container :first-child{margin-top:0}#ul-task-detail-container :last-child{margin-bottom:20px}.ul-horizontal-button-container{width:100%;display:flex;flex-direction:row}.ul-skip-button-below{margin-top:5px}.ul-horizontal-button-container-center{justify-content:center}.ul-vertical-button-container-center{display:flex;flex-direction:column;align-items:center}.ul-horizontal-button-container-left{justify-content:flex-start}.ul_recorded-task-inset-spacing{margin-top:5px;margin-bottom:24px}.ul_permission_svg_container{justify-content:center}.ul-card-text__button{background-color:var(--theme);border-radius:3px;border:none;color:#fff;cursor:pointer;font-size:15px;font-weight:500;line-height:18px;padding:10.5px 21px}.ul-card-text__button:disabled,.ul-card-text__button.sprig-button-disabled{background-color:#0000001a;color:#0003}.ul-card-text__button.ul-button-inactive{background-color:#fff!important;color:#5d696f!important}.ul-card-skip__button{color:#00000080;background:none;border:none;font-size:15px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;cursor:pointer}.ul-card-button-group{align-items:center;display:flex;gap:15px;justify-content:center;flex-direction:column}html,body{cursor:default;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;height:100%;overflow:hidden;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;-webkit-touch-callout:none}b{font-weight:500}#ul-app{opacity:0;width:100%;flex-grow:2;display:flex}#ul-app.ul-app--overlay{position:absolute;bottom:0;transition:opacity .1s ease-out;transition-delay:.1s}#ul-app.ul-app--visible{opacity:1;bottom:0}.ul-app__container{width:100%;display:flex;flex-direction:column;max-height:100vh}.ul-header__container{margin-bottom:15px}.ul-header{align-items:center;background:repeating-linear-gradient(120deg,#ebebeb,#ebebeb 24px,#fff 24px,#fff 48px);border-bottom:2px solid #ebebeb;display:flex;font-size:14px;font-weight:500;height:40px;justify-content:center;left:0;position:absolute;top:0;width:100%}.ul-footer{display:flex;flex-direction:column;align-items:center;justify-content:center;margin-top:auto;flex-grow:1;width:100%}.ul-footer>.yellow-footer-logo{background:#fad133;border:1px solid #f9c600;border-radius:14px;padding:6px 12px}.ul-footer>.yellow-footer-logo:hover{background:#f9c600}.ul-footer .thank-you-card-link{background:#00000003;border:1px solid #e6e6e6;border-radius:8px;cursor:pointer;display:inline-flex;font-size:14px;gap:12px;margin-bottom:15px;padding:12px;text-align:initial;width:280px}.ul-footer .thank-you-card-link:hover{background:#00000008}.ul-footer>a{color:inherit}.ul-footer-bubble{display:inline-block;margin:0 3px;width:7px;height:7px;border-radius:3px;border:1px solid transparent}.sprig-box-logo{background:#f9c600;border-radius:5px;display:flex;padding:4px}.close-container{display:flex;justify-content:flex-end;width:100%}.close-btn{cursor:pointer;height:18px;margin-inline-end:-10px;position:relative;top:-10px;width:18px;z-index:1}.ul-app__container{transition:opacity .3s ease-out}.ul-center-horizontally{text-align:center}#ul-progress-bar-container{width:100%;height:2px;background-color:#0000001a;border-radius:2px;max-width:250px;margin:25px 0}#ul-progress-bar-current{transition:width 1s ease;width:0%;height:0;border-radius:2px}.prototype-button{width:100%;background:#00000003;border:1.5px solid #e6e6e6;border-radius:4px 0 0 4px;flex:none;flex-grow:1;margin:0;padding:20px 0;font-size:14px;font-family:inherit;text-decoration:underline}.prototype-button:hover{cursor:pointer}', ai = async (e, t) => {
3682
- var r;
3683
- const n = await fetch(t, {
3684
- method: "POST",
3685
- cache: "no-cache",
3686
- headers: {
3687
- "Content-Type": "application/json"
3688
- },
3689
- body: JSON.stringify(e)
3690
- });
3691
- if (n.ok) {
3692
- const o = await n.json();
3693
- return (r = o == null ? void 0 : o.upload) == null ? void 0 : r.url;
3694
- } else
3695
- return null;
3696
- }, dr = () => MediaRecorder.isTypeSupported(
3697
- "video/webm"
3698
- /* Webm */
3699
- ) ? "video/webm" : "video/mp4", Jt = (e) => {
3700
- const t = {
3701
- audioBitsPerSecond: 128e3,
3702
- //standard setting based on documentation's example
3703
- videoBitsPerSecond: 25e5,
3704
- mimeType: dr()
3705
- };
3706
- return new MediaRecorder(e, t);
3707
- }, Xt = (e, t, n) => {
3708
- n[t] = [], e.ondataavailable = function(r) {
3709
- n[t].push(r.data);
3710
- }, e.currentMediaRecordingUid = t, e.start();
3711
- };
3712
- function en(e, t, n, r, o, i) {
3713
- if (e && e.state !== "inactive") {
3714
- const {
3715
- [I.BeginCallback]: a
3716
- } = r, l = e.currentMediaRecordingUid;
3717
- if (!l)
3718
- return;
3719
- a && a(l), e.onstop = () => si(t, e, n, r, l, o, i), e.stop();
3720
- }
3721
- }
3722
- async function si(e, t, n, r, o, i, a) {
3723
- const l = $.getState().viewDocument, {
3724
- [I.UploadCallback]: c,
3725
- [I.ProgressCallback]: d
3726
- } = r, p = {
3727
- mediaType: n,
3728
- updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
3729
- mediaRecordingUid: o,
3730
- ...r[I.PassthroughData]
3731
- }, s = await ai(p, e);
3732
- if (!s) {
3733
- c && c(null, {
3734
- message: "failed to get upload url"
3735
- });
3736
- return;
3737
- }
3738
- const _ = new Blob(a, {
3739
- type: dr()
3740
- });
3741
- if (!l.defaultView)
3742
- return;
3743
- const f = new l.defaultView.File([_], `recording video ${Date.now()}`), m = i.createUpload({
3744
- // endpoint computed from backend separately and hacked together
3745
- endpoint: s,
3746
- file: f,
3747
- chunkSize: 5120
3748
- // Uploads the file in ~5mb chunks
3749
- });
3750
- m.on("error", (g) => {
3751
- c && c(null, g);
3752
- }), m.on("progress", (g) => {
3753
- d && d(o, g);
3754
- }), m.on("success", () => {
3755
- c && c(o, !0);
3756
- });
3757
- }
3758
- const li = {
3759
- chunks: {}
3760
- }, ci = {
3761
- state: {
3762
- ...li
3763
- },
3764
- stopRecording(e) {
3765
- const {
3766
- uploadApiEndpoint: t,
3767
- avRecorder: n,
3768
- screenRecorder: r,
3769
- UpChunk: o
3770
- } = this.state, i = this.state.avStream && this.state.avStream.getVideoTracks().length > 0 ? Q.Video : Q.Audio;
3771
- this.state.chunks && t && o && (n != null && n.currentMediaRecordingUid && en(n, t, i, e, o, this.state.chunks[n == null ? void 0 : n.currentMediaRecordingUid]), r != null && r.currentMediaRecordingUid && en(r, t, Q.Screen, e, o, this.state.chunks[r == null ? void 0 : r.currentMediaRecordingUid]));
3772
- },
3773
- handleCancelledStream(e) {
3774
- const t = e.getVideoTracks(), n = e.getAudioTracks();
3775
- let r = t.length && t[0];
3776
- r = r || n.length && n[0], r && r.addEventListener("ended", () => {
3777
- [this.state.avRecorder, this.state.screenRecorder].map((o) => {
3778
- o && (o.state === "recording" && o.stop(), o.stream.getTracks().map((i) => {
3779
- i.readyState === "live" && i.stop();
3780
- }));
3781
- }), Object.assign(this.state, {
3782
- avStream: null,
3783
- captureStream: null,
3784
- avRecorder: null,
3785
- screenRecorder: null
3786
- });
3787
- });
3788
- },
3789
- taskDurationMillisecond() {
3790
- return this.state.startTime ? (/* @__PURE__ */ new Date()).getTime() - this.state.startTime.getTime() : 0;
3791
- },
3792
- setUpChunk(e) {
3793
- this.state.UpChunk = e;
3794
- },
3795
- configure(e, t) {
3796
- Object.assign(this.state, t), this.state.uploadApiEndpoint = `${t.apiURL}/2/environments/integrations/upload`, this.state.chunks = {}, e.on(B.PermissionStatus, this.permissionStatusCallback.bind(this)), e.on(B.AvPermission, async (n) => {
3797
- this.avPermissionCallback(n);
3798
- }), e.on(B.BeginRecording, this.beginRecordingCallback.bind(this)), e.on(B.StartTask, this.startTaskCallback.bind(this)), e.on(B.ScreenPermission, async (n) => {
3799
- this.screenPermissionCallback(n);
3800
- }), e.on(B.FinishTask, async (n) => {
3801
- this.finishTaskCallback(n);
3802
- });
3803
- },
3804
- async avPermissionCallback(e) {
3805
- var r, o, i;
3806
- const {
3807
- [I.StreamReadyCallback]: t,
3808
- [I.PermissionDescriptors]: n
3809
- } = e;
3810
- try {
3811
- (r = this.state.avStream) != null && r.active && (this.state.avStream.getTracks().map((a) => a.readyState === "live" && a.stop()), ((o = this.state.captureStream) == null ? void 0 : o.getAudioTracks().length) === 1 && this.state.captureStream.removeTrack(this.state.captureStream.getAudioTracks()[0])), this.state.avStream = await navigator.mediaDevices.getUserMedia({
3812
- video: n.includes(Se.Camera),
3813
- audio: !0
3814
- }), ((i = this.state.captureStream) == null ? void 0 : i.getAudioTracks().length) === 0 && this.state.captureStream.addTrack(this.state.avStream.getAudioTracks()[0]), this.handleCancelledStream(this.state.avStream);
3815
- } catch (a) {
3816
- console.warn("Error: failed to get permissions: " + a), t && t(null, null);
3817
- return;
3818
- }
3819
- t && t(this.state.avStream, this.state.captureStream);
3820
- },
3821
- async screenPermissionCallback(e) {
3822
- const {
3823
- [I.ScreenPermissionRequested]: t,
3824
- [I.StreamReadyCallback]: n
3825
- } = e;
3826
- t == null || t(!0);
3827
- try {
3828
- this.state.captureStream = await navigator.mediaDevices.getDisplayMedia({
3829
- video: !0,
3830
- cursor: "always",
3831
- displaySurface: "browser",
3832
- preferCurrentTab: !0
3833
- });
3834
- } catch (r) {
3835
- t == null || t(!1), console.warn("Error: failed to get permissions: " + r), n && n(null, null);
3836
- return;
3837
- }
3838
- t == null || t(!1), this.state.avStream && this.state.avStream.getAudioTracks().length > 0 && this.state.captureStream.addTrack(this.state.avStream.getAudioTracks()[0]), this.handleCancelledStream(this.state.captureStream), n && n(this.state.avStream || null, this.state.captureStream);
3839
- },
3840
- beginRecordingCallback(e) {
3841
- const {
3842
- [I.RecordingMediaTypes]: t,
3843
- [I.StartRecordingCallback]: n
3844
- } = e;
3845
- if (!t)
3846
- return;
3847
- const r = [];
3848
- if (t.includes(Q.Video) && this.state.avStream) {
3849
- this.state.avRecorder = Jt(this.state.avStream);
3850
- const o = Ct();
3851
- Xt(this.state.avRecorder, o, this.state.chunks), r.push(o);
3852
- }
3853
- if (t.includes(Q.Screen) && this.state.captureStream) {
3854
- this.state.screenRecorder = Jt(this.state.captureStream);
3855
- const o = Ct();
3856
- Xt(this.state.screenRecorder, o, this.state.chunks), r.push(o);
3857
- }
3858
- r && n && n(r);
3859
- },
3860
- async finishTaskCallback(e) {
3861
- const {
3862
- [I.CurrentIndex]: t,
3863
- [I.TaskResponse]: n,
3864
- [I.TaskCompleteCallback]: r
3865
- } = e;
3866
- await this.stopRecording(e), r && r(this.taskDurationMillisecond()), this.state.cards && this.state.hasEndCard !== void 0 && this.lookAheadAndStopStream(t, n, this.state.cards, this.state.hasEndCard);
3867
- },
3868
- startTaskCallback() {
3869
- this.state.startTime = /* @__PURE__ */ new Date();
3870
- },
3871
- permissionStatusCallback(e) {
3872
- var r;
3873
- const {
3874
- [I.PermissionStatusCallback]: t
3875
- } = e, n = this.state.avStream;
3876
- t && t(n, n ? (n == null ? void 0 : n.getVideoTracks().length) > 0 : !1, !!((r = this.state.captureStream) != null && r.active), this.state.captureStream);
3877
- },
3878
- lookAheadAndStopStream(e, t, n, r) {
3879
- const {
3880
- avRecorder: o,
3881
- screenRecorder: i
3882
- } = this.state, {
3883
- allResponses: a
3884
- } = $.getState(), l = er({
3885
- cards: n,
3886
- index: e,
3887
- hasEndCard: r,
3888
- allResponses: a
3889
- });
3890
- l !== null && n[l].type === b.RecordedTask || [o, i].map((c) => {
3891
- c && (c.state === "recording" && c.stop(), c.stream.getTracks().map((d) => {
3892
- d.readyState === "live" && d.stop();
3893
- }));
3894
- });
3895
- }
3896
- }, at = Object.create(ci);
3897
- Object.freeze(at);
3898
- const ui = (e, t) => {
3899
- const n = [...e], r = /* @__PURE__ */ new Set([b.VideoVoice, b.RecordedTask]);
3900
- return e.some((o) => r.has(o.type)) && n.push({
3901
- name: -2,
3902
- props: {
3903
- routingOptions: []
3904
- },
3905
- type: b.Uploading
3906
- }), t && n.push({
3907
- name: -1,
3908
- props: {
3909
- routingOptions: []
3910
- },
3911
- type: b.Thanks
3912
- }), n;
3913
- }, di = ({
3914
- mode: e = null,
3915
- viewWindow: t,
3916
- viewDocument: n
3917
- }) => {
3918
- const r = n.documentElement;
3919
- let o;
3920
- try {
3921
- o = t.parent.location.href;
3922
- } catch {
3923
- o = t.location.href;
3924
- }
3925
- return {
3926
- mode: e,
3927
- sw: t.screen.width,
3928
- sh: t.screen.height,
3929
- cw: r.clientWidth,
3930
- ch: r.clientHeight,
3931
- p: o,
3932
- l: t.navigator.language
3933
- };
3934
- };
3935
- function pi(e, t = !0) {
3936
- var P;
3937
- const {
3938
- answers: n,
3939
- apiURL: r,
3940
- customStyles: o,
3941
- endCard: i,
3942
- eventEmitFn: a,
3943
- fontFamilyURL: l,
3944
- frame: c,
3945
- previewKey: d,
3946
- viewDocument: p,
3947
- viewWindow: s
3948
- } = e, _ = $e(e.headers) ? e.frame : p.body, f = e.UpChunk || window.UpChunk, m = Le, g = ui(e.cards, !!i);
3949
- at.configure(m, {
3950
- cards: g,
3951
- hasEndCard: !!i,
3952
- apiURL: r,
3953
- UpChunk: f
3954
- }), $.setState({
3955
- apiURL: r,
3956
- answers: n,
3957
- border: e.border,
3958
- index: e.startingQuestionIdx || 0,
3959
- cards: g,
3960
- configureExitOnOverlayClick: e.configureExitOnOverlayClick,
3961
- customMetadata: e.customMetadata,
3962
- endCard: e.endCard,
3963
- envId: e.envId,
3964
- eventEmitFn: a,
3965
- fontFamily: e.fontFamily,
3966
- forceBrandedLogo: e.forceBrandedLogo,
3967
- frame: c,
3968
- headers: e.headers,
3969
- hasViewedEmbed: !1,
3970
- isPreview: e.isPreview,
3971
- marketingUrl: "https://sprig.com",
3972
- meta: di({
3973
- mode: e.mode,
3974
- viewWindow: s,
3975
- viewDocument: p
3976
- }),
3977
- mode: e.mode,
3978
- previewKey: d,
3979
- recorder: at,
3980
- recorderEventEmitter: m,
3981
- responseGroupUid: e.responseGroupUid,
3982
- showStripes: e.showStripes,
3983
- showSurveyBrand: e.showSurveyBrand,
3984
- slugName: e.slugName,
3985
- styleNonce: e.styleNonce,
3986
- surveyId: e.surveyId,
3987
- tabTitle: e.tabTitle,
3988
- uploadingCardViewed: !1,
3989
- uploadProgress: {},
3990
- useMobileStyling: e.useMobileStyling,
3991
- useDesktopPrototype: e.useDesktopPrototype,
3992
- userId: e.userId,
3993
- viewDocument: e.viewDocument,
3994
- visitorAttributes: e.visitorAttributes,
3995
- viewedCardCount: e.startingQuestionIdx || 0
3996
- });
3997
- const {
3998
- seen: y
3999
- } = $.getState();
4000
- y();
4001
- const {
4002
- head: v
4003
- } = p, C = p.createElement("style");
4004
- if (C.id = "sprig-style", C.textContent = ii, C.nonce = e.styleNonce, v.appendChild(C), e.fontFamily && l && parent) {
4005
- const S = p.createElement("link");
4006
- S.rel = "stylesheet", S.href = l, v.appendChild(S);
4007
- }
4008
- e.customStyles && kr(p, o, e.styleNonce);
4009
- const k = "2.26.6", R = a || ((P = c.eventEmitter) == null ? void 0 : P.emit);
4010
- R == null || R(ee.VerifyViewVersion, {
4011
- [ye.ViewVersion]: k
4012
- }), _ && t && me(u(oi, {}), _);
4013
- }
4014
- const _i = {
4015
- configure: pi
4016
- };
4017
- export {
4018
- _i as default
4019
- };