motion-surveyjs-ui 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +738 -699
- package/dist/index.js.map +1 -1
- package/dist/lib/MotionSurvey.d.ts.map +1 -1
- package/dist/lib/ui/Logo.d.ts +5 -0
- package/dist/lib/ui/Logo.d.ts.map +1 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Question as
|
|
3
|
-
import { useAnimationControls as
|
|
4
|
-
import * as
|
|
5
|
-
import * as
|
|
6
|
-
import * as
|
|
7
|
-
import * as
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
function
|
|
11
|
-
if (
|
|
12
|
-
|
|
1
|
+
import Me, { useEffect as me, useState as J, forwardRef as Ee, createElement as pe, useRef as he, useMemo as ye, useReducer as be } from "react";
|
|
2
|
+
import { Question as je, Model as Oe } from "survey-core";
|
|
3
|
+
import { useAnimationControls as De, motion as v, AnimatePresence as V, useDragControls as Fe, Reorder as ge } from "motion/react";
|
|
4
|
+
import * as ve from "@radix-ui/react-label";
|
|
5
|
+
import * as H from "@radix-ui/react-radio-group";
|
|
6
|
+
import * as xe from "@radix-ui/react-checkbox";
|
|
7
|
+
import * as D from "@radix-ui/react-select";
|
|
8
|
+
var de = { exports: {} }, ae = {};
|
|
9
|
+
var Ne;
|
|
10
|
+
function Be() {
|
|
11
|
+
if (Ne) return ae;
|
|
12
|
+
Ne = 1;
|
|
13
13
|
var n = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
|
|
14
|
-
function a(
|
|
14
|
+
function a(s, i, o) {
|
|
15
15
|
var c = null;
|
|
16
16
|
if (o !== void 0 && (c = "" + o), i.key !== void 0 && (c = "" + i.key), "key" in i) {
|
|
17
17
|
o = {};
|
|
@@ -20,258 +20,258 @@ function Ae() {
|
|
|
20
20
|
} else o = i;
|
|
21
21
|
return i = o.ref, {
|
|
22
22
|
$$typeof: n,
|
|
23
|
-
type:
|
|
23
|
+
type: s,
|
|
24
24
|
key: c,
|
|
25
25
|
ref: i !== void 0 ? i : null,
|
|
26
26
|
props: o
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
return
|
|
29
|
+
return ae.Fragment = t, ae.jsx = a, ae.jsxs = a, ae;
|
|
30
30
|
}
|
|
31
|
-
var
|
|
32
|
-
var
|
|
33
|
-
function
|
|
34
|
-
return
|
|
35
|
-
function n(
|
|
36
|
-
if (
|
|
37
|
-
if (typeof
|
|
38
|
-
return
|
|
39
|
-
if (typeof
|
|
40
|
-
switch (
|
|
31
|
+
var se = {};
|
|
32
|
+
var ke;
|
|
33
|
+
function Ve() {
|
|
34
|
+
return ke || (ke = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
35
|
+
function n(l) {
|
|
36
|
+
if (l == null) return null;
|
|
37
|
+
if (typeof l == "function")
|
|
38
|
+
return l.$$typeof === q ? null : l.displayName || l.name || null;
|
|
39
|
+
if (typeof l == "string") return l;
|
|
40
|
+
switch (l) {
|
|
41
41
|
case b:
|
|
42
42
|
return "Fragment";
|
|
43
43
|
case k:
|
|
44
44
|
return "Profiler";
|
|
45
45
|
case g:
|
|
46
46
|
return "StrictMode";
|
|
47
|
-
case
|
|
47
|
+
case K:
|
|
48
48
|
return "Suspense";
|
|
49
|
-
case
|
|
49
|
+
case P:
|
|
50
50
|
return "SuspenseList";
|
|
51
|
-
case
|
|
51
|
+
case O:
|
|
52
52
|
return "Activity";
|
|
53
53
|
}
|
|
54
|
-
if (typeof
|
|
55
|
-
switch (typeof
|
|
54
|
+
if (typeof l == "object")
|
|
55
|
+
switch (typeof l.tag == "number" && console.error(
|
|
56
56
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
57
|
-
),
|
|
58
|
-
case
|
|
57
|
+
), l.$$typeof) {
|
|
58
|
+
case p:
|
|
59
59
|
return "Portal";
|
|
60
|
-
case
|
|
61
|
-
return
|
|
62
|
-
case
|
|
63
|
-
return (
|
|
64
|
-
case
|
|
65
|
-
var
|
|
66
|
-
return
|
|
67
|
-
case
|
|
68
|
-
return
|
|
60
|
+
case $:
|
|
61
|
+
return l.displayName || "Context";
|
|
62
|
+
case I:
|
|
63
|
+
return (l._context.displayName || "Context") + ".Consumer";
|
|
64
|
+
case Q:
|
|
65
|
+
var y = l.render;
|
|
66
|
+
return l = l.displayName, l || (l = y.displayName || y.name || "", l = l !== "" ? "ForwardRef(" + l + ")" : "ForwardRef"), l;
|
|
67
|
+
case Y:
|
|
68
|
+
return y = l.displayName || null, y !== null ? y : n(l.type) || "Memo";
|
|
69
69
|
case U:
|
|
70
|
-
|
|
70
|
+
y = l._payload, l = l._init;
|
|
71
71
|
try {
|
|
72
|
-
return n(
|
|
72
|
+
return n(l(y));
|
|
73
73
|
} catch {
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
return null;
|
|
77
77
|
}
|
|
78
|
-
function t(
|
|
79
|
-
return "" +
|
|
78
|
+
function t(l) {
|
|
79
|
+
return "" + l;
|
|
80
80
|
}
|
|
81
|
-
function a(
|
|
81
|
+
function a(l) {
|
|
82
82
|
try {
|
|
83
|
-
t(
|
|
84
|
-
var
|
|
83
|
+
t(l);
|
|
84
|
+
var y = !1;
|
|
85
85
|
} catch {
|
|
86
|
-
|
|
86
|
+
y = !0;
|
|
87
87
|
}
|
|
88
|
-
if (
|
|
89
|
-
|
|
90
|
-
var
|
|
91
|
-
return
|
|
92
|
-
|
|
88
|
+
if (y) {
|
|
89
|
+
y = console;
|
|
90
|
+
var w = y.error, R = typeof Symbol == "function" && Symbol.toStringTag && l[Symbol.toStringTag] || l.constructor.name || "Object";
|
|
91
|
+
return w.call(
|
|
92
|
+
y,
|
|
93
93
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
94
|
-
|
|
95
|
-
), t(
|
|
94
|
+
R
|
|
95
|
+
), t(l);
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
-
function
|
|
99
|
-
if (
|
|
100
|
-
if (typeof
|
|
98
|
+
function s(l) {
|
|
99
|
+
if (l === b) return "<>";
|
|
100
|
+
if (typeof l == "object" && l !== null && l.$$typeof === U)
|
|
101
101
|
return "<...>";
|
|
102
102
|
try {
|
|
103
|
-
var
|
|
104
|
-
return
|
|
103
|
+
var y = n(l);
|
|
104
|
+
return y ? "<" + y + ">" : "<...>";
|
|
105
105
|
} catch {
|
|
106
106
|
return "<...>";
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
function i() {
|
|
110
|
-
var
|
|
111
|
-
return
|
|
110
|
+
var l = Z.A;
|
|
111
|
+
return l === null ? null : l.getOwner();
|
|
112
112
|
}
|
|
113
113
|
function o() {
|
|
114
114
|
return Error("react-stack-top-frame");
|
|
115
115
|
}
|
|
116
|
-
function c(
|
|
117
|
-
if (
|
|
118
|
-
var
|
|
119
|
-
if (
|
|
116
|
+
function c(l) {
|
|
117
|
+
if (le.call(l, "key")) {
|
|
118
|
+
var y = Object.getOwnPropertyDescriptor(l, "key").get;
|
|
119
|
+
if (y && y.isReactWarning) return !1;
|
|
120
120
|
}
|
|
121
|
-
return
|
|
121
|
+
return l.key !== void 0;
|
|
122
122
|
}
|
|
123
|
-
function m(
|
|
124
|
-
function
|
|
125
|
-
|
|
123
|
+
function m(l, y) {
|
|
124
|
+
function w() {
|
|
125
|
+
B || (B = !0, console.error(
|
|
126
126
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
127
|
-
|
|
127
|
+
y
|
|
128
128
|
));
|
|
129
129
|
}
|
|
130
|
-
|
|
131
|
-
get:
|
|
130
|
+
w.isReactWarning = !0, Object.defineProperty(l, "key", {
|
|
131
|
+
get: w,
|
|
132
132
|
configurable: !0
|
|
133
133
|
});
|
|
134
134
|
}
|
|
135
135
|
function d() {
|
|
136
|
-
var
|
|
137
|
-
return
|
|
136
|
+
var l = n(this.type);
|
|
137
|
+
return oe[l] || (oe[l] = !0, console.error(
|
|
138
138
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
139
|
-
)),
|
|
139
|
+
)), l = this.props.ref, l !== void 0 ? l : null;
|
|
140
140
|
}
|
|
141
|
-
function u(
|
|
142
|
-
var
|
|
143
|
-
return
|
|
144
|
-
$$typeof:
|
|
145
|
-
type:
|
|
146
|
-
key:
|
|
147
|
-
props:
|
|
148
|
-
_owner:
|
|
149
|
-
}, (
|
|
141
|
+
function u(l, y, w, R, G, X) {
|
|
142
|
+
var _ = w.ref;
|
|
143
|
+
return l = {
|
|
144
|
+
$$typeof: f,
|
|
145
|
+
type: l,
|
|
146
|
+
key: y,
|
|
147
|
+
props: w,
|
|
148
|
+
_owner: R
|
|
149
|
+
}, (_ !== void 0 ? _ : null) !== null ? Object.defineProperty(l, "ref", {
|
|
150
150
|
enumerable: !1,
|
|
151
151
|
get: d
|
|
152
|
-
}) : Object.defineProperty(
|
|
152
|
+
}) : Object.defineProperty(l, "ref", { enumerable: !1, value: null }), l._store = {}, Object.defineProperty(l._store, "validated", {
|
|
153
153
|
configurable: !1,
|
|
154
154
|
enumerable: !1,
|
|
155
155
|
writable: !0,
|
|
156
156
|
value: 0
|
|
157
|
-
}), Object.defineProperty(
|
|
157
|
+
}), Object.defineProperty(l, "_debugInfo", {
|
|
158
158
|
configurable: !1,
|
|
159
159
|
enumerable: !1,
|
|
160
160
|
writable: !0,
|
|
161
161
|
value: null
|
|
162
|
-
}), Object.defineProperty(
|
|
162
|
+
}), Object.defineProperty(l, "_debugStack", {
|
|
163
163
|
configurable: !1,
|
|
164
164
|
enumerable: !1,
|
|
165
165
|
writable: !0,
|
|
166
|
-
value:
|
|
167
|
-
}), Object.defineProperty(
|
|
166
|
+
value: G
|
|
167
|
+
}), Object.defineProperty(l, "_debugTask", {
|
|
168
168
|
configurable: !1,
|
|
169
169
|
enumerable: !1,
|
|
170
170
|
writable: !0,
|
|
171
|
-
value:
|
|
172
|
-
}), Object.freeze && (Object.freeze(
|
|
171
|
+
value: X
|
|
172
|
+
}), Object.freeze && (Object.freeze(l.props), Object.freeze(l)), l;
|
|
173
173
|
}
|
|
174
|
-
function l
|
|
175
|
-
var
|
|
176
|
-
if (
|
|
177
|
-
if (
|
|
178
|
-
if (
|
|
179
|
-
for (
|
|
180
|
-
x(
|
|
181
|
-
Object.freeze && Object.freeze(
|
|
174
|
+
function r(l, y, w, R, G, X) {
|
|
175
|
+
var _ = y.children;
|
|
176
|
+
if (_ !== void 0)
|
|
177
|
+
if (R)
|
|
178
|
+
if (ie(_)) {
|
|
179
|
+
for (R = 0; R < _.length; R++)
|
|
180
|
+
x(_[R]);
|
|
181
|
+
Object.freeze && Object.freeze(_);
|
|
182
182
|
} else
|
|
183
183
|
console.error(
|
|
184
184
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
185
185
|
);
|
|
186
|
-
else x(
|
|
187
|
-
if (
|
|
188
|
-
|
|
189
|
-
var
|
|
190
|
-
return
|
|
186
|
+
else x(_);
|
|
187
|
+
if (le.call(y, "key")) {
|
|
188
|
+
_ = n(l);
|
|
189
|
+
var S = Object.keys(y).filter(function(A) {
|
|
190
|
+
return A !== "key";
|
|
191
191
|
});
|
|
192
|
-
|
|
192
|
+
R = 0 < S.length ? "{key: someKey, " + S.join(": ..., ") + ": ...}" : "{key: someKey}", te[_ + R] || (S = 0 < S.length ? "{" + S.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
193
193
|
`A props object containing a "key" prop is being spread into JSX:
|
|
194
194
|
let props = %s;
|
|
195
195
|
<%s {...props} />
|
|
196
196
|
React keys must be passed directly to JSX without using spread:
|
|
197
197
|
let props = %s;
|
|
198
198
|
<%s key={someKey} {...props} />`,
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
),
|
|
199
|
+
R,
|
|
200
|
+
_,
|
|
201
|
+
S,
|
|
202
|
+
_
|
|
203
|
+
), te[_ + R] = !0);
|
|
204
204
|
}
|
|
205
|
-
if (
|
|
206
|
-
|
|
207
|
-
for (var
|
|
208
|
-
|
|
209
|
-
} else
|
|
210
|
-
return
|
|
211
|
-
|
|
212
|
-
typeof
|
|
205
|
+
if (_ = null, w !== void 0 && (a(w), _ = "" + w), c(y) && (a(y.key), _ = "" + y.key), "key" in y) {
|
|
206
|
+
w = {};
|
|
207
|
+
for (var N in y)
|
|
208
|
+
N !== "key" && (w[N] = y[N]);
|
|
209
|
+
} else w = y;
|
|
210
|
+
return _ && m(
|
|
211
|
+
w,
|
|
212
|
+
typeof l == "function" ? l.displayName || l.name || "Unknown" : l
|
|
213
213
|
), u(
|
|
214
|
-
|
|
214
|
+
l,
|
|
215
|
+
_,
|
|
215
216
|
w,
|
|
216
|
-
f,
|
|
217
217
|
i(),
|
|
218
|
-
|
|
219
|
-
|
|
218
|
+
G,
|
|
219
|
+
X
|
|
220
220
|
);
|
|
221
221
|
}
|
|
222
|
-
function x(
|
|
223
|
-
h(
|
|
222
|
+
function x(l) {
|
|
223
|
+
h(l) ? l._store && (l._store.validated = 1) : typeof l == "object" && l !== null && l.$$typeof === U && (l._payload.status === "fulfilled" ? h(l._payload.value) && l._payload.value._store && (l._payload.value._store.validated = 1) : l._store && (l._store.validated = 1));
|
|
224
224
|
}
|
|
225
|
-
function h(
|
|
226
|
-
return typeof
|
|
225
|
+
function h(l) {
|
|
226
|
+
return typeof l == "object" && l !== null && l.$$typeof === f;
|
|
227
227
|
}
|
|
228
|
-
var j =
|
|
228
|
+
var j = Me, f = Symbol.for("react.transitional.element"), p = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), g = Symbol.for("react.strict_mode"), k = Symbol.for("react.profiler"), I = Symbol.for("react.consumer"), $ = Symbol.for("react.context"), Q = Symbol.for("react.forward_ref"), K = Symbol.for("react.suspense"), P = Symbol.for("react.suspense_list"), Y = Symbol.for("react.memo"), U = Symbol.for("react.lazy"), O = Symbol.for("react.activity"), q = Symbol.for("react.client.reference"), Z = j.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, le = Object.prototype.hasOwnProperty, ie = Array.isArray, z = console.createTask ? console.createTask : function() {
|
|
229
229
|
return null;
|
|
230
230
|
};
|
|
231
231
|
j = {
|
|
232
|
-
react_stack_bottom_frame: function(
|
|
233
|
-
return
|
|
232
|
+
react_stack_bottom_frame: function(l) {
|
|
233
|
+
return l();
|
|
234
234
|
}
|
|
235
235
|
};
|
|
236
|
-
var
|
|
236
|
+
var B, oe = {}, ee = j.react_stack_bottom_frame.bind(
|
|
237
237
|
j,
|
|
238
238
|
o
|
|
239
|
-
)(),
|
|
240
|
-
|
|
241
|
-
var
|
|
242
|
-
return
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
239
|
+
)(), ce = z(s(o)), te = {};
|
|
240
|
+
se.Fragment = b, se.jsx = function(l, y, w) {
|
|
241
|
+
var R = 1e4 > Z.recentlyCreatedOwnerStacks++;
|
|
242
|
+
return r(
|
|
243
|
+
l,
|
|
244
|
+
y,
|
|
245
|
+
w,
|
|
246
246
|
!1,
|
|
247
|
-
|
|
248
|
-
|
|
247
|
+
R ? Error("react-stack-top-frame") : ee,
|
|
248
|
+
R ? z(s(l)) : ce
|
|
249
249
|
);
|
|
250
|
-
},
|
|
251
|
-
var
|
|
252
|
-
return
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
250
|
+
}, se.jsxs = function(l, y, w) {
|
|
251
|
+
var R = 1e4 > Z.recentlyCreatedOwnerStacks++;
|
|
252
|
+
return r(
|
|
253
|
+
l,
|
|
254
|
+
y,
|
|
255
|
+
w,
|
|
256
256
|
!0,
|
|
257
|
-
|
|
258
|
-
|
|
257
|
+
R ? Error("react-stack-top-frame") : ee,
|
|
258
|
+
R ? z(s(l)) : ce
|
|
259
259
|
);
|
|
260
260
|
};
|
|
261
|
-
})()),
|
|
261
|
+
})()), se;
|
|
262
262
|
}
|
|
263
|
-
var
|
|
264
|
-
function
|
|
265
|
-
return
|
|
263
|
+
var we;
|
|
264
|
+
function He() {
|
|
265
|
+
return we || (we = 1, process.env.NODE_ENV === "production" ? de.exports = Be() : de.exports = Ve()), de.exports;
|
|
266
266
|
}
|
|
267
|
-
var e =
|
|
268
|
-
function
|
|
267
|
+
var e = He();
|
|
268
|
+
function C({
|
|
269
269
|
element: n,
|
|
270
270
|
opts: t,
|
|
271
271
|
children: a
|
|
272
272
|
}) {
|
|
273
|
-
const i = n instanceof
|
|
274
|
-
|
|
273
|
+
const i = n instanceof je ? n : null, o = t.validationSeq > 0 && i && typeof i.hasErrors == "function" ? i.hasErrors() : !1, c = De();
|
|
274
|
+
me(() => {
|
|
275
275
|
t.animate && o && c.start({
|
|
276
276
|
x: [0, -6, 6, -4, 0],
|
|
277
277
|
transition: { duration: 0.32, ease: "easeInOut" }
|
|
@@ -279,7 +279,7 @@ function T({
|
|
|
279
279
|
}, [c, o, t.animate, t.validationSeq]);
|
|
280
280
|
const m = n.name;
|
|
281
281
|
return /* @__PURE__ */ e.jsx(
|
|
282
|
-
|
|
282
|
+
v.div,
|
|
283
283
|
{
|
|
284
284
|
className: o ? "msj__question msj__question--invalid" : "msj__question",
|
|
285
285
|
"data-msj-element": m,
|
|
@@ -288,13 +288,13 @@ function T({
|
|
|
288
288
|
whileInView: t.animate ? { opacity: 1, y: 0 } : void 0,
|
|
289
289
|
viewport: { amount: 0.25, once: !0 },
|
|
290
290
|
transition: { duration: t.duration },
|
|
291
|
-
children: /* @__PURE__ */ e.jsx(
|
|
291
|
+
children: /* @__PURE__ */ e.jsx(v.div, { className: "msj__questionInner", animate: c, children: a })
|
|
292
292
|
}
|
|
293
293
|
);
|
|
294
294
|
}
|
|
295
|
-
function
|
|
296
|
-
return n.length === 0 ? null : /* @__PURE__ */ e.jsx(
|
|
297
|
-
|
|
295
|
+
function L({ errors: n, opts: t }) {
|
|
296
|
+
return n.length === 0 ? null : /* @__PURE__ */ e.jsx(V, { initial: !1, children: n.map((a) => /* @__PURE__ */ e.jsx(
|
|
297
|
+
v.div,
|
|
298
298
|
{
|
|
299
299
|
className: "msj__error",
|
|
300
300
|
layout: !0,
|
|
@@ -307,36 +307,36 @@ function P({ errors: n, opts: t }) {
|
|
|
307
307
|
a
|
|
308
308
|
)) });
|
|
309
309
|
}
|
|
310
|
-
function
|
|
310
|
+
function E(n, t) {
|
|
311
311
|
const a = (n.title ?? "") || n.name;
|
|
312
312
|
return t.showQuestionNumbers === "off" || t.showQuestionNumbers === "on" && t.globalQuestionIndex < 0 || t.showQuestionNumbers === "onPage" && t.questionIndex < 0 ? a : `${t.showQuestionNumbers === "on" ? t.globalQuestionIndex + 1 : t.questionIndex + 1}. ${a}`;
|
|
313
313
|
}
|
|
314
|
-
function
|
|
314
|
+
function Qe(n) {
|
|
315
315
|
const t = n;
|
|
316
316
|
return (typeof t.getText == "function" ? t.getText() : t.text) ?? "";
|
|
317
317
|
}
|
|
318
|
-
function
|
|
319
|
-
return (n.errors ?? []).map(
|
|
318
|
+
function M(n) {
|
|
319
|
+
return (n.errors ?? []).map(Qe).filter(Boolean);
|
|
320
320
|
}
|
|
321
|
-
function
|
|
322
|
-
if (n instanceof
|
|
323
|
-
const a = n,
|
|
324
|
-
if (
|
|
325
|
-
|
|
321
|
+
function T(n, t) {
|
|
322
|
+
if (n instanceof je) {
|
|
323
|
+
const a = n, s = a.survey;
|
|
324
|
+
if (s && typeof s.setValue == "function" && a.name) {
|
|
325
|
+
s.setValue(a.name, t);
|
|
326
326
|
return;
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
329
|
Reflect.set(n, "value", t);
|
|
330
330
|
}
|
|
331
|
-
function
|
|
332
|
-
const a = n,
|
|
333
|
-
return /* @__PURE__ */ e.jsxs(
|
|
334
|
-
/* @__PURE__ */ e.jsxs(
|
|
335
|
-
|
|
331
|
+
function Ye({ question: n, opts: t }) {
|
|
332
|
+
const a = n, s = E(a, t), i = t.validationSeq > 0 ? M(a) : [], [o, c] = J(!1);
|
|
333
|
+
return /* @__PURE__ */ e.jsxs(C, { element: a, opts: t, children: [
|
|
334
|
+
/* @__PURE__ */ e.jsxs(ve.Root, { className: "msj__label", htmlFor: a.id, children: [
|
|
335
|
+
s,
|
|
336
336
|
a.isRequired ? /* @__PURE__ */ e.jsx("span", { "aria-hidden": !0, children: " *" }) : null
|
|
337
337
|
] }),
|
|
338
338
|
/* @__PURE__ */ e.jsx(
|
|
339
|
-
|
|
339
|
+
v.div,
|
|
340
340
|
{
|
|
341
341
|
className: "msj__inputWrap",
|
|
342
342
|
initial: !1,
|
|
@@ -348,28 +348,28 @@ function Oe({ question: n, opts: t }) {
|
|
|
348
348
|
id: a.id,
|
|
349
349
|
className: "msj__input",
|
|
350
350
|
value: a.value ?? "",
|
|
351
|
-
onChange: (m) =>
|
|
351
|
+
onChange: (m) => T(a, m.currentTarget.value),
|
|
352
352
|
onFocus: () => c(!0),
|
|
353
353
|
onBlur: () => c(!1)
|
|
354
354
|
}
|
|
355
355
|
)
|
|
356
356
|
}
|
|
357
357
|
),
|
|
358
|
-
/* @__PURE__ */ e.jsx(
|
|
358
|
+
/* @__PURE__ */ e.jsx(L, { errors: i, opts: t })
|
|
359
359
|
] });
|
|
360
360
|
}
|
|
361
|
-
function
|
|
361
|
+
function We({
|
|
362
362
|
question: n,
|
|
363
363
|
opts: t
|
|
364
364
|
}) {
|
|
365
|
-
const a = n,
|
|
366
|
-
return /* @__PURE__ */ e.jsxs(
|
|
367
|
-
/* @__PURE__ */ e.jsxs(
|
|
368
|
-
|
|
365
|
+
const a = n, s = E(a, t), i = t.validationSeq > 0 ? M(a) : [], [o, c] = J(!1), m = String(a.value ?? ""), d = a.maxWordCount ?? a.maxWords ?? 200, r = (m.trim() ? m.trim().split(/\s+/).filter(Boolean) : []).length, x = r >= d * 0.9;
|
|
366
|
+
return /* @__PURE__ */ e.jsxs(C, { element: a, opts: t, children: [
|
|
367
|
+
/* @__PURE__ */ e.jsxs(ve.Root, { className: "msj__label", htmlFor: a.id, children: [
|
|
368
|
+
s,
|
|
369
369
|
a.isRequired ? /* @__PURE__ */ e.jsx("span", { "aria-hidden": !0, children: " *" }) : null
|
|
370
370
|
] }),
|
|
371
371
|
/* @__PURE__ */ e.jsxs(
|
|
372
|
-
|
|
372
|
+
v.div,
|
|
373
373
|
{
|
|
374
374
|
className: "msj__textareaWrap",
|
|
375
375
|
initial: !1,
|
|
@@ -385,96 +385,96 @@ function De({
|
|
|
385
385
|
onFocus: () => c(!0),
|
|
386
386
|
onBlur: () => c(!1),
|
|
387
387
|
onChange: (h) => {
|
|
388
|
-
const j = h.currentTarget.value,
|
|
389
|
-
if (
|
|
390
|
-
|
|
388
|
+
const j = h.currentTarget.value, f = j.trim() ? j.trim().split(/\s+/).filter(Boolean) : [];
|
|
389
|
+
if (f.length <= d) {
|
|
390
|
+
T(a, j);
|
|
391
391
|
return;
|
|
392
392
|
}
|
|
393
|
-
|
|
393
|
+
T(a, `${f.slice(0, d).join(" ")} `);
|
|
394
394
|
}
|
|
395
395
|
}
|
|
396
396
|
),
|
|
397
397
|
/* @__PURE__ */ e.jsx(
|
|
398
|
-
|
|
398
|
+
v.div,
|
|
399
399
|
{
|
|
400
400
|
className: "msj__counter",
|
|
401
401
|
initial: !1,
|
|
402
402
|
animate: x ? { scale: 1.05, color: "#dc2626" } : { scale: 1, color: "#64748b" },
|
|
403
403
|
transition: { type: "spring", stiffness: 400, damping: 25 },
|
|
404
|
-
children: t.t("wordCount", { count:
|
|
404
|
+
children: t.t("wordCount", { count: r, max: d })
|
|
405
405
|
}
|
|
406
406
|
)
|
|
407
407
|
]
|
|
408
408
|
}
|
|
409
409
|
),
|
|
410
|
-
/* @__PURE__ */ e.jsx(
|
|
410
|
+
/* @__PURE__ */ e.jsx(L, { errors: i, opts: t })
|
|
411
411
|
] });
|
|
412
412
|
}
|
|
413
|
-
function
|
|
413
|
+
function Ue({
|
|
414
414
|
question: n,
|
|
415
415
|
opts: t
|
|
416
416
|
}) {
|
|
417
|
-
const a = n,
|
|
418
|
-
let
|
|
419
|
-
a.value === m ?
|
|
420
|
-
const x = (
|
|
421
|
-
|
|
417
|
+
const a = n, s = E(a, t), i = t.validationSeq > 0 ? M(a) : [], o = a.labelTrue || "Yes", c = a.labelFalse || "No", m = a.valueTrue ?? !0, d = a.valueFalse ?? !1, u = a.swapOrder === !0;
|
|
418
|
+
let r;
|
|
419
|
+
a.value === m ? r = "true" : a.value === d ? r = "false" : a.value === !0 ? r = "true" : a.value === !1 && (r = "false");
|
|
420
|
+
const x = (I) => {
|
|
421
|
+
T(a, I === "true" ? m : d);
|
|
422
422
|
};
|
|
423
|
-
let h = "50%", j = "-50%",
|
|
424
|
-
|
|
425
|
-
const
|
|
426
|
-
return /* @__PURE__ */ e.jsxs(
|
|
423
|
+
let h = "50%", j = "-50%", f = "40px";
|
|
424
|
+
r === "true" ? (f = "calc(50% - 6px)", u ? (h = "0%", j = "4px") : (h = "100%", j = "calc(-100% - 4px)")) : r === "false" && (f = "calc(50% - 6px)", u ? (h = "100%", j = "calc(-100% - 4px)") : (h = "0%", j = "4px"));
|
|
425
|
+
const p = u ? o : c, b = u ? c : o, g = u ? "true" : "false", k = u ? "false" : "true";
|
|
426
|
+
return /* @__PURE__ */ e.jsxs(C, { element: a, opts: t, children: [
|
|
427
427
|
/* @__PURE__ */ e.jsxs("div", { className: "msj__label", children: [
|
|
428
|
-
|
|
428
|
+
s,
|
|
429
429
|
a.isRequired ? /* @__PURE__ */ e.jsx("span", { "aria-hidden": !0, children: " *" }) : null
|
|
430
430
|
] }),
|
|
431
431
|
/* @__PURE__ */ e.jsxs(
|
|
432
|
-
|
|
432
|
+
H.Root,
|
|
433
433
|
{
|
|
434
434
|
className: "msj__toggleSwitch",
|
|
435
|
-
value:
|
|
435
|
+
value: r,
|
|
436
436
|
onValueChange: x,
|
|
437
437
|
children: [
|
|
438
438
|
/* @__PURE__ */ e.jsxs("div", { className: "msj__toggleTrack", "aria-hidden": "true", children: [
|
|
439
|
-
/* @__PURE__ */ e.jsx("div", { className: "msj__toggleTrackLabel msj__toggleTrackLabel--left", children:
|
|
439
|
+
/* @__PURE__ */ e.jsx("div", { className: "msj__toggleTrackLabel msj__toggleTrackLabel--left", children: p }),
|
|
440
440
|
/* @__PURE__ */ e.jsx("div", { className: "msj__toggleTrackLabel msj__toggleTrackLabel--right", children: b }),
|
|
441
441
|
/* @__PURE__ */ e.jsx(
|
|
442
|
-
|
|
442
|
+
v.div,
|
|
443
443
|
{
|
|
444
|
-
className: `msj__toggleHandle ${
|
|
444
|
+
className: `msj__toggleHandle ${r === "true" ? "msj__toggleHandle--true" : r === "false" ? "msj__toggleHandle--false" : ""}`,
|
|
445
445
|
initial: !1,
|
|
446
|
-
animate: { left: h, x: j, width:
|
|
446
|
+
animate: { left: h, x: j, width: f },
|
|
447
447
|
transition: { type: "spring", stiffness: 500, damping: 30 },
|
|
448
448
|
children: /* @__PURE__ */ e.jsx(
|
|
449
|
-
|
|
449
|
+
v.span,
|
|
450
450
|
{
|
|
451
451
|
initial: { opacity: 0, scale: 0.8 },
|
|
452
452
|
animate: { opacity: 1, scale: 1 },
|
|
453
453
|
exit: { opacity: 0, scale: 0.8 },
|
|
454
|
-
children:
|
|
454
|
+
children: r === "true" ? o : r === "false" ? c : ""
|
|
455
455
|
},
|
|
456
|
-
|
|
456
|
+
r || "empty"
|
|
457
457
|
)
|
|
458
458
|
}
|
|
459
459
|
)
|
|
460
460
|
] }),
|
|
461
461
|
/* @__PURE__ */ e.jsxs("div", { className: "msj__toggleInputs", children: [
|
|
462
|
-
/* @__PURE__ */ e.jsx(
|
|
463
|
-
/* @__PURE__ */ e.jsx(
|
|
462
|
+
/* @__PURE__ */ e.jsx(H.Item, { value: g, className: "msj__toggleInput", "aria-label": p }),
|
|
463
|
+
/* @__PURE__ */ e.jsx(H.Item, { value: k, className: "msj__toggleInput", "aria-label": b })
|
|
464
464
|
] })
|
|
465
465
|
]
|
|
466
466
|
}
|
|
467
467
|
),
|
|
468
|
-
/* @__PURE__ */ e.jsx(
|
|
468
|
+
/* @__PURE__ */ e.jsx(L, { errors: i, opts: t })
|
|
469
469
|
] });
|
|
470
470
|
}
|
|
471
|
-
function
|
|
471
|
+
function Ie({
|
|
472
472
|
active: n,
|
|
473
473
|
duration: t,
|
|
474
474
|
size: a = 14
|
|
475
475
|
}) {
|
|
476
476
|
return /* @__PURE__ */ e.jsx(
|
|
477
|
-
|
|
477
|
+
v.svg,
|
|
478
478
|
{
|
|
479
479
|
className: "msj__checkmark",
|
|
480
480
|
width: a,
|
|
@@ -483,7 +483,7 @@ function Te({
|
|
|
483
483
|
fill: "none",
|
|
484
484
|
"aria-hidden": !0,
|
|
485
485
|
children: /* @__PURE__ */ e.jsx(
|
|
486
|
-
|
|
486
|
+
v.path,
|
|
487
487
|
{
|
|
488
488
|
d: "M3.2 8.4 6.6 11.8 12.8 4.8",
|
|
489
489
|
stroke: "currentColor",
|
|
@@ -499,32 +499,32 @@ function Te({
|
|
|
499
499
|
}
|
|
500
500
|
);
|
|
501
501
|
}
|
|
502
|
-
function
|
|
502
|
+
function Se({
|
|
503
503
|
question: n,
|
|
504
504
|
isMulti: t,
|
|
505
505
|
opts: a
|
|
506
506
|
}) {
|
|
507
|
-
const
|
|
507
|
+
const s = n, i = E(s, a), o = a.validationSeq > 0 ? M(s) : [], c = s.visibleChoices ?? [];
|
|
508
508
|
if (!t) {
|
|
509
|
-
const d =
|
|
510
|
-
return /* @__PURE__ */ e.jsxs(
|
|
509
|
+
const d = s.value == null ? "" : String(s.value);
|
|
510
|
+
return /* @__PURE__ */ e.jsxs(C, { element: s, opts: a, children: [
|
|
511
511
|
/* @__PURE__ */ e.jsxs("div", { className: "msj__label", children: [
|
|
512
512
|
i,
|
|
513
|
-
|
|
513
|
+
s.isRequired ? /* @__PURE__ */ e.jsx("span", { "aria-hidden": !0, children: " *" }) : null
|
|
514
514
|
] }),
|
|
515
515
|
/* @__PURE__ */ e.jsx(
|
|
516
|
-
|
|
516
|
+
H.Root,
|
|
517
517
|
{
|
|
518
518
|
className: "msj__choiceList",
|
|
519
519
|
value: d,
|
|
520
520
|
onValueChange: (u) => {
|
|
521
|
-
const
|
|
522
|
-
|
|
521
|
+
const r = c.find((x) => String(x.value) === u);
|
|
522
|
+
T(s, r ? r.value : void 0);
|
|
523
523
|
},
|
|
524
524
|
children: c.map((u) => {
|
|
525
|
-
const
|
|
526
|
-
return /* @__PURE__ */ e.jsx(
|
|
527
|
-
|
|
525
|
+
const r = String(u.value), x = u.text ?? r, h = d === r, j = `msj-radio-bg-${s.id}`;
|
|
526
|
+
return /* @__PURE__ */ e.jsx(H.Item, { value: r, asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
527
|
+
v.button,
|
|
528
528
|
{
|
|
529
529
|
type: "button",
|
|
530
530
|
className: "msj__choiceOption",
|
|
@@ -532,7 +532,7 @@ function Ne({
|
|
|
532
532
|
transition: { duration: a.duration },
|
|
533
533
|
children: [
|
|
534
534
|
h ? /* @__PURE__ */ e.jsx(
|
|
535
|
-
|
|
535
|
+
v.span,
|
|
536
536
|
{
|
|
537
537
|
className: "msj__choiceOptionBg",
|
|
538
538
|
layoutId: j,
|
|
@@ -541,8 +541,8 @@ function Ne({
|
|
|
541
541
|
) : null,
|
|
542
542
|
/* @__PURE__ */ e.jsxs("span", { className: "msj__choiceOptionContent", children: [
|
|
543
543
|
/* @__PURE__ */ e.jsxs("span", { className: "msj__radioItem", children: [
|
|
544
|
-
/* @__PURE__ */ e.jsx(
|
|
545
|
-
|
|
544
|
+
/* @__PURE__ */ e.jsx(H.Indicator, { forceMount: !0, asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
545
|
+
v.span,
|
|
546
546
|
{
|
|
547
547
|
className: "msj__radioIndicator",
|
|
548
548
|
initial: !1,
|
|
@@ -551,35 +551,35 @@ function Ne({
|
|
|
551
551
|
}
|
|
552
552
|
) }),
|
|
553
553
|
h ? /* @__PURE__ */ e.jsx(
|
|
554
|
-
|
|
554
|
+
v.span,
|
|
555
555
|
{
|
|
556
556
|
className: "msj__radioPulse",
|
|
557
557
|
initial: { scale: 0.8, opacity: 0.28 },
|
|
558
558
|
animate: { scale: 2.2, opacity: 0 },
|
|
559
559
|
transition: { duration: Math.max(0.22, a.duration * 1.4) }
|
|
560
560
|
},
|
|
561
|
-
`${
|
|
561
|
+
`${r}-pulse`
|
|
562
562
|
) : null
|
|
563
563
|
] }),
|
|
564
564
|
/* @__PURE__ */ e.jsx("span", { children: x })
|
|
565
565
|
] })
|
|
566
566
|
]
|
|
567
567
|
}
|
|
568
|
-
) },
|
|
568
|
+
) }, r);
|
|
569
569
|
})
|
|
570
570
|
}
|
|
571
571
|
),
|
|
572
|
-
/* @__PURE__ */ e.jsx(
|
|
572
|
+
/* @__PURE__ */ e.jsx(L, { errors: o, opts: a })
|
|
573
573
|
] });
|
|
574
574
|
}
|
|
575
|
-
const m = new Set(Array.isArray(
|
|
576
|
-
return /* @__PURE__ */ e.jsxs(
|
|
575
|
+
const m = new Set(Array.isArray(s.value) ? s.value : []);
|
|
576
|
+
return /* @__PURE__ */ e.jsxs(C, { element: s, opts: a, children: [
|
|
577
577
|
/* @__PURE__ */ e.jsxs("div", { className: "msj__label", children: [
|
|
578
578
|
i,
|
|
579
|
-
|
|
579
|
+
s.isRequired ? /* @__PURE__ */ e.jsx("span", { "aria-hidden": !0, children: " *" }) : null
|
|
580
580
|
] }),
|
|
581
581
|
/* @__PURE__ */ e.jsx("div", { className: "msj__choiceList", children: c.map((d) => {
|
|
582
|
-
const u = d.value,
|
|
582
|
+
const u = d.value, r = String(u), x = d.text ?? r, h = m.has(u);
|
|
583
583
|
return /* @__PURE__ */ e.jsxs(
|
|
584
584
|
"label",
|
|
585
585
|
{
|
|
@@ -587,7 +587,7 @@ function Ne({
|
|
|
587
587
|
"data-state": h ? "checked" : "unchecked",
|
|
588
588
|
children: [
|
|
589
589
|
/* @__PURE__ */ e.jsx(
|
|
590
|
-
|
|
590
|
+
v.span,
|
|
591
591
|
{
|
|
592
592
|
className: "msj__choiceOptionBg",
|
|
593
593
|
"aria-hidden": !0,
|
|
@@ -597,22 +597,22 @@ function Ne({
|
|
|
597
597
|
),
|
|
598
598
|
/* @__PURE__ */ e.jsxs("span", { className: "msj__choiceOptionContent", children: [
|
|
599
599
|
/* @__PURE__ */ e.jsx(
|
|
600
|
-
|
|
600
|
+
xe.Root,
|
|
601
601
|
{
|
|
602
602
|
className: "msj__checkbox",
|
|
603
603
|
checked: h,
|
|
604
604
|
onCheckedChange: (j) => {
|
|
605
|
-
const
|
|
606
|
-
j === !0 ?
|
|
605
|
+
const f = new Set(Array.isArray(s.value) ? s.value : []);
|
|
606
|
+
j === !0 ? f.add(u) : f.delete(u), T(s, Array.from(f));
|
|
607
607
|
},
|
|
608
|
-
children: /* @__PURE__ */ e.jsx(
|
|
609
|
-
|
|
608
|
+
children: /* @__PURE__ */ e.jsx(xe.Indicator, { forceMount: !0, asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
609
|
+
v.span,
|
|
610
610
|
{
|
|
611
611
|
className: "msj__checkboxIndicator",
|
|
612
612
|
initial: !1,
|
|
613
613
|
animate: h ? { opacity: 1, scale: 1 } : { opacity: 0, scale: 0.9 },
|
|
614
614
|
transition: { duration: Math.max(0.12, a.duration * 0.5) },
|
|
615
|
-
children: /* @__PURE__ */ e.jsx(
|
|
615
|
+
children: /* @__PURE__ */ e.jsx(Ie, { active: h, duration: Math.max(0.22, a.duration * 1.2) })
|
|
616
616
|
}
|
|
617
617
|
) })
|
|
618
618
|
}
|
|
@@ -621,53 +621,53 @@ function Ne({
|
|
|
621
621
|
] })
|
|
622
622
|
]
|
|
623
623
|
},
|
|
624
|
-
|
|
624
|
+
r
|
|
625
625
|
);
|
|
626
626
|
}) }),
|
|
627
|
-
/* @__PURE__ */ e.jsx(
|
|
627
|
+
/* @__PURE__ */ e.jsx(L, { errors: o, opts: a })
|
|
628
628
|
] });
|
|
629
629
|
}
|
|
630
|
-
function
|
|
630
|
+
function ze({
|
|
631
631
|
question: n,
|
|
632
632
|
opts: t
|
|
633
633
|
}) {
|
|
634
|
-
const a = n,
|
|
635
|
-
return /* @__PURE__ */ e.jsxs(
|
|
634
|
+
const a = n, s = E(a, t), i = t.validationSeq > 0 ? M(a) : [], o = a.visibleChoices ?? [], c = "__msj-empty__", m = a.value == null ? c : String(a.value), d = o.find((h) => String(h.value) === m), u = m === c ? t.t("selectPlaceholder") : d?.text ?? m, [r, x] = J(!1);
|
|
635
|
+
return /* @__PURE__ */ e.jsxs(C, { element: a, opts: t, children: [
|
|
636
636
|
/* @__PURE__ */ e.jsxs("div", { className: "msj__label", children: [
|
|
637
|
-
|
|
637
|
+
s,
|
|
638
638
|
a.isRequired ? /* @__PURE__ */ e.jsx("span", { "aria-hidden": !0, children: " *" }) : null
|
|
639
639
|
] }),
|
|
640
640
|
/* @__PURE__ */ e.jsxs(
|
|
641
|
-
|
|
641
|
+
D.Root,
|
|
642
642
|
{
|
|
643
|
-
open:
|
|
643
|
+
open: r,
|
|
644
644
|
onOpenChange: x,
|
|
645
645
|
value: m,
|
|
646
646
|
onValueChange: (h) => {
|
|
647
647
|
if (h === c) {
|
|
648
|
-
|
|
648
|
+
T(a, void 0);
|
|
649
649
|
return;
|
|
650
650
|
}
|
|
651
|
-
const j = o.find((
|
|
652
|
-
|
|
651
|
+
const j = o.find((f) => String(f.value) === h);
|
|
652
|
+
T(a, j ? j.value : h);
|
|
653
653
|
},
|
|
654
654
|
children: [
|
|
655
|
-
/* @__PURE__ */ e.jsxs(
|
|
656
|
-
/* @__PURE__ */ e.jsx(
|
|
657
|
-
/* @__PURE__ */ e.jsx(
|
|
655
|
+
/* @__PURE__ */ e.jsxs(D.Trigger, { className: "msj__selectTrigger", "aria-label": s, children: [
|
|
656
|
+
/* @__PURE__ */ e.jsx(D.Value, { className: m === c ? "msj__selectValue msj__selectValue--placeholder" : "msj__selectValue", children: u }),
|
|
657
|
+
/* @__PURE__ */ e.jsx(D.Icon, { className: "msj__selectIcon", children: "▾" })
|
|
658
658
|
] }),
|
|
659
|
-
/* @__PURE__ */ e.jsx(
|
|
660
|
-
|
|
659
|
+
/* @__PURE__ */ e.jsx(D.Portal, { container: t.portalContainer ?? void 0, children: /* @__PURE__ */ e.jsx(V, { children: r ? /* @__PURE__ */ e.jsx(D.Content, { className: "msj__selectContent", position: "popper", asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
660
|
+
v.div,
|
|
661
661
|
{
|
|
662
662
|
initial: { opacity: 0, y: -6, scale: 0.98 },
|
|
663
663
|
animate: { opacity: 1, y: 0, scale: 1 },
|
|
664
664
|
exit: { opacity: 0, y: -6, scale: 0.98 },
|
|
665
665
|
transition: { type: "spring", stiffness: 650, damping: 40 },
|
|
666
|
-
children: /* @__PURE__ */ e.jsxs(
|
|
667
|
-
/* @__PURE__ */ e.jsx(
|
|
666
|
+
children: /* @__PURE__ */ e.jsxs(D.Viewport, { className: "msj__selectViewport", children: [
|
|
667
|
+
/* @__PURE__ */ e.jsx(D.Item, { value: c, className: "msj__selectItem", children: /* @__PURE__ */ e.jsx(D.ItemText, { children: t.t("selectPlaceholder") }) }),
|
|
668
668
|
o.map((h) => {
|
|
669
669
|
const j = String(h.value);
|
|
670
|
-
return /* @__PURE__ */ e.jsx(
|
|
670
|
+
return /* @__PURE__ */ e.jsx(D.Item, { value: j, className: "msj__selectItem", children: /* @__PURE__ */ e.jsx(D.ItemText, { children: h.text ?? j }) }, j);
|
|
671
671
|
})
|
|
672
672
|
] })
|
|
673
673
|
}
|
|
@@ -675,45 +675,45 @@ function Be({
|
|
|
675
675
|
]
|
|
676
676
|
}
|
|
677
677
|
),
|
|
678
|
-
/* @__PURE__ */ e.jsx(
|
|
678
|
+
/* @__PURE__ */ e.jsx(L, { errors: i, opts: t })
|
|
679
679
|
] });
|
|
680
680
|
}
|
|
681
|
-
function
|
|
682
|
-
const a = n,
|
|
683
|
-
return /* @__PURE__ */ e.jsxs(
|
|
684
|
-
a.title ? /* @__PURE__ */ e.jsx("div", { className: "msj__label", children:
|
|
685
|
-
/* @__PURE__ */ e.jsx("div", { className: "msj__html", dangerouslySetInnerHTML: { __html:
|
|
681
|
+
function Ge({ question: n, opts: t }) {
|
|
682
|
+
const a = n, s = a.html ?? "";
|
|
683
|
+
return /* @__PURE__ */ e.jsxs(C, { element: n, opts: t, children: [
|
|
684
|
+
a.title ? /* @__PURE__ */ e.jsx("div", { className: "msj__label", children: E(n, t) }) : null,
|
|
685
|
+
/* @__PURE__ */ e.jsx("div", { className: "msj__html", dangerouslySetInnerHTML: { __html: s } })
|
|
686
686
|
] });
|
|
687
687
|
}
|
|
688
|
-
function
|
|
689
|
-
const a = n,
|
|
690
|
-
return /* @__PURE__ */ e.jsxs(
|
|
691
|
-
a.title ? /* @__PURE__ */ e.jsx("div", { className: "msj__label", children:
|
|
692
|
-
|
|
688
|
+
function Xe({ question: n, opts: t }) {
|
|
689
|
+
const a = n, s = a.imageLink ?? "", i = a.title ?? a.name;
|
|
690
|
+
return /* @__PURE__ */ e.jsxs(C, { element: n, opts: t, children: [
|
|
691
|
+
a.title ? /* @__PURE__ */ e.jsx("div", { className: "msj__label", children: E(n, t) }) : null,
|
|
692
|
+
s ? /* @__PURE__ */ e.jsx("img", { className: "msj__image", src: s, alt: i }) : null
|
|
693
693
|
] });
|
|
694
694
|
}
|
|
695
|
-
function
|
|
696
|
-
const a = n,
|
|
697
|
-
return /* @__PURE__ */ e.jsxs(
|
|
698
|
-
/* @__PURE__ */ e.jsx("div", { className: "msj__label", children:
|
|
695
|
+
function Je({ question: n, opts: t }) {
|
|
696
|
+
const a = n, s = E(n, t), i = a.displayValue ?? a.value;
|
|
697
|
+
return /* @__PURE__ */ e.jsxs(C, { element: n, opts: t, children: [
|
|
698
|
+
/* @__PURE__ */ e.jsx("div", { className: "msj__label", children: s }),
|
|
699
699
|
/* @__PURE__ */ e.jsx("div", { className: "msj__expression", children: i == null ? "" : String(i) })
|
|
700
700
|
] });
|
|
701
701
|
}
|
|
702
|
-
function
|
|
702
|
+
function Ke({ question: n, opts: t }) {
|
|
703
703
|
return null;
|
|
704
704
|
}
|
|
705
|
-
const
|
|
705
|
+
const qe = (n) => n.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Ze = (n) => n.replace(
|
|
706
706
|
/^([A-Z])|[\s-_]+(\w)/g,
|
|
707
|
-
(t, a,
|
|
708
|
-
),
|
|
709
|
-
const t =
|
|
707
|
+
(t, a, s) => s ? s.toUpperCase() : a.toLowerCase()
|
|
708
|
+
), Te = (n) => {
|
|
709
|
+
const t = Ze(n);
|
|
710
710
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
711
|
-
},
|
|
711
|
+
}, Pe = (...n) => n.filter((t, a, s) => !!t && t.trim() !== "" && s.indexOf(t) === a).join(" ").trim(), et = (n) => {
|
|
712
712
|
for (const t in n)
|
|
713
713
|
if (t.startsWith("aria-") || t === "role" || t === "title")
|
|
714
714
|
return !0;
|
|
715
715
|
};
|
|
716
|
-
var
|
|
716
|
+
var tt = {
|
|
717
717
|
xmlns: "http://www.w3.org/2000/svg",
|
|
718
718
|
width: 24,
|
|
719
719
|
height: 24,
|
|
@@ -724,103 +724,103 @@ var ze = {
|
|
|
724
724
|
strokeLinecap: "round",
|
|
725
725
|
strokeLinejoin: "round"
|
|
726
726
|
};
|
|
727
|
-
const
|
|
727
|
+
const nt = Ee(
|
|
728
728
|
({
|
|
729
729
|
color: n = "currentColor",
|
|
730
730
|
size: t = 24,
|
|
731
731
|
strokeWidth: a = 2,
|
|
732
|
-
absoluteStrokeWidth:
|
|
732
|
+
absoluteStrokeWidth: s,
|
|
733
733
|
className: i = "",
|
|
734
734
|
children: o,
|
|
735
735
|
iconNode: c,
|
|
736
736
|
...m
|
|
737
|
-
}, d) =>
|
|
737
|
+
}, d) => pe(
|
|
738
738
|
"svg",
|
|
739
739
|
{
|
|
740
740
|
ref: d,
|
|
741
|
-
...
|
|
741
|
+
...tt,
|
|
742
742
|
width: t,
|
|
743
743
|
height: t,
|
|
744
744
|
stroke: n,
|
|
745
|
-
strokeWidth:
|
|
746
|
-
className:
|
|
747
|
-
...!o && !
|
|
745
|
+
strokeWidth: s ? Number(a) * 24 / Number(t) : a,
|
|
746
|
+
className: Pe("lucide", i),
|
|
747
|
+
...!o && !et(m) && { "aria-hidden": "true" },
|
|
748
748
|
...m
|
|
749
749
|
},
|
|
750
750
|
[
|
|
751
|
-
...c.map(([u,
|
|
751
|
+
...c.map(([u, r]) => pe(u, r)),
|
|
752
752
|
...Array.isArray(o) ? o : [o]
|
|
753
753
|
]
|
|
754
754
|
)
|
|
755
755
|
);
|
|
756
|
-
const
|
|
757
|
-
const a =
|
|
758
|
-
({ className:
|
|
756
|
+
const F = (n, t) => {
|
|
757
|
+
const a = Ee(
|
|
758
|
+
({ className: s, ...i }, o) => pe(nt, {
|
|
759
759
|
ref: o,
|
|
760
760
|
iconNode: t,
|
|
761
|
-
className:
|
|
762
|
-
`lucide-${
|
|
761
|
+
className: Pe(
|
|
762
|
+
`lucide-${qe(Te(n))}`,
|
|
763
763
|
`lucide-${n}`,
|
|
764
|
-
|
|
764
|
+
s
|
|
765
765
|
),
|
|
766
766
|
...i
|
|
767
767
|
})
|
|
768
768
|
);
|
|
769
|
-
return a.displayName =
|
|
769
|
+
return a.displayName = Te(n), a;
|
|
770
770
|
};
|
|
771
|
-
const
|
|
771
|
+
const at = [
|
|
772
772
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
773
773
|
["path", { d: "M16 16s-1.5-2-4-2-4 2-4 2", key: "epbg0q" }],
|
|
774
774
|
["path", { d: "M7.5 8 10 9", key: "olxxln" }],
|
|
775
775
|
["path", { d: "m14 9 2.5-1", key: "1j6cij" }],
|
|
776
776
|
["path", { d: "M9 10h.01", key: "qbtxuw" }],
|
|
777
777
|
["path", { d: "M15 10h.01", key: "1qmjsl" }]
|
|
778
|
-
],
|
|
779
|
-
const
|
|
778
|
+
], st = F("angry", at);
|
|
779
|
+
const rt = [
|
|
780
780
|
["path", { d: "M12 5v14", key: "s699le" }],
|
|
781
781
|
["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
|
|
782
|
-
],
|
|
783
|
-
const
|
|
782
|
+
], lt = F("arrow-down", rt);
|
|
783
|
+
const it = [
|
|
784
784
|
["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
|
|
785
785
|
["path", { d: "M12 19V5", key: "x0mq9r" }]
|
|
786
|
-
],
|
|
787
|
-
const
|
|
786
|
+
], ot = F("arrow-up", it);
|
|
787
|
+
const ct = [
|
|
788
788
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
789
789
|
["path", { d: "M16 16s-1.5-2-4-2-4 2-4 2", key: "epbg0q" }],
|
|
790
790
|
["line", { x1: "9", x2: "9.01", y1: "9", y2: "9", key: "yxxnd0" }],
|
|
791
791
|
["line", { x1: "15", x2: "15.01", y1: "9", y2: "9", key: "1p4y9e" }]
|
|
792
|
-
],
|
|
793
|
-
const
|
|
792
|
+
], ut = F("frown", ct);
|
|
793
|
+
const dt = [
|
|
794
794
|
["circle", { cx: "9", cy: "12", r: "1", key: "1vctgf" }],
|
|
795
795
|
["circle", { cx: "9", cy: "5", r: "1", key: "hp0tcf" }],
|
|
796
796
|
["circle", { cx: "9", cy: "19", r: "1", key: "fkjjf6" }],
|
|
797
797
|
["circle", { cx: "15", cy: "12", r: "1", key: "1tmaij" }],
|
|
798
798
|
["circle", { cx: "15", cy: "5", r: "1", key: "19l28e" }],
|
|
799
799
|
["circle", { cx: "15", cy: "19", r: "1", key: "f4zoj3" }]
|
|
800
|
-
],
|
|
801
|
-
const
|
|
800
|
+
], mt = F("grip-vertical", dt);
|
|
801
|
+
const ht = [
|
|
802
802
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
803
803
|
["path", { d: "M18 13a6 6 0 0 1-6 5 6 6 0 0 1-6-5h12Z", key: "b2q4dd" }],
|
|
804
804
|
["line", { x1: "9", x2: "9.01", y1: "9", y2: "9", key: "yxxnd0" }],
|
|
805
805
|
["line", { x1: "15", x2: "15.01", y1: "9", y2: "9", key: "1p4y9e" }]
|
|
806
|
-
],
|
|
807
|
-
const
|
|
806
|
+
], xt = F("laugh", ht);
|
|
807
|
+
const jt = [
|
|
808
808
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
809
809
|
["line", { x1: "8", x2: "16", y1: "15", y2: "15", key: "1xb1d9" }],
|
|
810
810
|
["line", { x1: "9", x2: "9.01", y1: "9", y2: "9", key: "yxxnd0" }],
|
|
811
811
|
["line", { x1: "15", x2: "15.01", y1: "9", y2: "9", key: "1p4y9e" }]
|
|
812
|
-
],
|
|
813
|
-
const
|
|
812
|
+
], _t = F("meh", jt);
|
|
813
|
+
const ft = [
|
|
814
814
|
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
815
815
|
["path", { d: "M12 5v14", key: "s699le" }]
|
|
816
|
-
],
|
|
817
|
-
const
|
|
816
|
+
], pt = F("plus", ft);
|
|
817
|
+
const gt = [
|
|
818
818
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
819
819
|
["path", { d: "M8 14s1.5 2 4 2 4-2 4-2", key: "1y1vjs" }],
|
|
820
820
|
["line", { x1: "9", x2: "9.01", y1: "9", y2: "9", key: "yxxnd0" }],
|
|
821
821
|
["line", { x1: "15", x2: "15.01", y1: "9", y2: "9", key: "1p4y9e" }]
|
|
822
|
-
],
|
|
823
|
-
const
|
|
822
|
+
], vt = F("smile", gt);
|
|
823
|
+
const yt = [
|
|
824
824
|
[
|
|
825
825
|
"path",
|
|
826
826
|
{
|
|
@@ -828,46 +828,46 @@ const xt = [
|
|
|
828
828
|
key: "r04s7s"
|
|
829
829
|
}
|
|
830
830
|
]
|
|
831
|
-
],
|
|
832
|
-
const
|
|
831
|
+
], bt = F("star", yt);
|
|
832
|
+
const Nt = [
|
|
833
833
|
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
834
834
|
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
835
|
-
],
|
|
836
|
-
function
|
|
837
|
-
return /* @__PURE__ */ e.jsx(
|
|
835
|
+
], kt = F("x", Nt);
|
|
836
|
+
function wt({ active: n }) {
|
|
837
|
+
return /* @__PURE__ */ e.jsx(bt, { size: 24, fill: n ? "currentColor" : "none", strokeWidth: 2 });
|
|
838
838
|
}
|
|
839
|
-
function
|
|
839
|
+
function St({ idx: n, total: t }) {
|
|
840
840
|
const a = t > 1 ? n / (t - 1) : 0.5;
|
|
841
|
-
return a < 0.2 ? /* @__PURE__ */ e.jsx(
|
|
841
|
+
return a < 0.2 ? /* @__PURE__ */ e.jsx(st, { size: 24 }) : a < 0.4 ? /* @__PURE__ */ e.jsx(ut, { size: 24 }) : a < 0.6 ? /* @__PURE__ */ e.jsx(_t, { size: 24 }) : a < 0.8 ? /* @__PURE__ */ e.jsx(vt, { size: 24 }) : /* @__PURE__ */ e.jsx(xt, { size: 24 });
|
|
842
842
|
}
|
|
843
|
-
function
|
|
844
|
-
const a = n,
|
|
845
|
-
return /* @__PURE__ */ e.jsxs(
|
|
843
|
+
function Tt({ question: n, opts: t }) {
|
|
844
|
+
const a = n, s = E(n, t), i = t.validationSeq > 0 ? M(n) : [], o = a.visibleRateValues ?? [], c = n.value == null ? "" : String(n.value), m = `msj-rating-bg-${n.id}`, d = a.rateType ?? "labels", u = a.scaleColorMode, r = a.minRateDescription, x = a.maxRateDescription, h = a.displayRateDescriptionsAsExtremeItems, j = o.findIndex((f) => String(f.value) === c);
|
|
845
|
+
return /* @__PURE__ */ e.jsxs(C, { element: n, opts: t, children: [
|
|
846
846
|
/* @__PURE__ */ e.jsxs("div", { className: "msj__label", children: [
|
|
847
|
-
|
|
847
|
+
s,
|
|
848
848
|
n.isRequired ? /* @__PURE__ */ e.jsx("span", { "aria-hidden": !0, children: " *" }) : null
|
|
849
849
|
] }),
|
|
850
850
|
/* @__PURE__ */ e.jsxs("div", { className: "msj__rating", "data-type": d, "data-color-mode": u, children: [
|
|
851
|
-
|
|
852
|
-
o.map((
|
|
853
|
-
const b = String(
|
|
854
|
-
let g =
|
|
855
|
-
h && (
|
|
856
|
-
const k = c === b,
|
|
857
|
-
let
|
|
858
|
-
return u === "colored" && (
|
|
859
|
-
|
|
851
|
+
r && !h ? /* @__PURE__ */ e.jsx("span", { className: "msj__ratingDescription msj__ratingDescription--min", children: r }) : null,
|
|
852
|
+
o.map((f, p) => {
|
|
853
|
+
const b = String(f.value);
|
|
854
|
+
let g = f.text ?? b;
|
|
855
|
+
h && (p === 0 && r && (g = r), p === o.length - 1 && x && (g = x));
|
|
856
|
+
const k = c === b, I = d === "stars" && j >= 0 ? p <= j : k;
|
|
857
|
+
let $;
|
|
858
|
+
return u === "colored" && ($ = { "--msj-rating-color": `hsl(${o.length > 1 ? p / (o.length - 1) * 120 : 60}, 70%, 50%)` }), /* @__PURE__ */ e.jsxs(
|
|
859
|
+
v.button,
|
|
860
860
|
{
|
|
861
861
|
type: "button",
|
|
862
862
|
className: "msj__ratingItem",
|
|
863
|
-
onClick: () =>
|
|
863
|
+
onClick: () => T(n, f.value),
|
|
864
864
|
layout: !0,
|
|
865
865
|
transition: { duration: t.duration },
|
|
866
866
|
"aria-label": g,
|
|
867
|
-
style:
|
|
867
|
+
style: $,
|
|
868
868
|
children: [
|
|
869
869
|
k ? /* @__PURE__ */ e.jsx(
|
|
870
|
-
|
|
870
|
+
v.span,
|
|
871
871
|
{
|
|
872
872
|
className: "msj__ratingItemBg",
|
|
873
873
|
layoutId: m,
|
|
@@ -875,8 +875,8 @@ function gt({ question: n, opts: t }) {
|
|
|
875
875
|
}
|
|
876
876
|
) : null,
|
|
877
877
|
/* @__PURE__ */ e.jsxs("span", { className: "msj__ratingItemContent", children: [
|
|
878
|
-
d === "stars" ? /* @__PURE__ */ e.jsx(
|
|
879
|
-
d === "smileys" ? /* @__PURE__ */ e.jsx(
|
|
878
|
+
d === "stars" ? /* @__PURE__ */ e.jsx(wt, { active: I }) : null,
|
|
879
|
+
d === "smileys" ? /* @__PURE__ */ e.jsx(St, { idx: p, total: o.length }) : null,
|
|
880
880
|
d === "labels" ? g : null
|
|
881
881
|
] })
|
|
882
882
|
]
|
|
@@ -886,35 +886,35 @@ function gt({ question: n, opts: t }) {
|
|
|
886
886
|
}),
|
|
887
887
|
x && !h ? /* @__PURE__ */ e.jsx("span", { className: "msj__ratingDescription msj__ratingDescription--max", children: x }) : null
|
|
888
888
|
] }),
|
|
889
|
-
/* @__PURE__ */ e.jsx(
|
|
889
|
+
/* @__PURE__ */ e.jsx(L, { errors: i, opts: t })
|
|
890
890
|
] });
|
|
891
891
|
}
|
|
892
|
-
function
|
|
893
|
-
const a = n,
|
|
894
|
-
return /* @__PURE__ */ e.jsxs(
|
|
892
|
+
function Ct({ question: n, opts: t }) {
|
|
893
|
+
const a = n, s = E(n, t), i = t.validationSeq > 0 ? M(n) : [], o = a.items ?? [], c = n.value ?? {};
|
|
894
|
+
return /* @__PURE__ */ e.jsxs(C, { element: n, opts: t, children: [
|
|
895
895
|
/* @__PURE__ */ e.jsxs("div", { className: "msj__label", children: [
|
|
896
|
-
|
|
896
|
+
s,
|
|
897
897
|
n.isRequired ? /* @__PURE__ */ e.jsx("span", { "aria-hidden": !0, children: " *" }) : null
|
|
898
898
|
] }),
|
|
899
899
|
/* @__PURE__ */ e.jsx("div", { className: "msj__multipleText", children: o.map((m, d) => {
|
|
900
900
|
const u = `${n.id}-${m.name}`;
|
|
901
901
|
return /* @__PURE__ */ e.jsxs(
|
|
902
|
-
|
|
902
|
+
v.div,
|
|
903
903
|
{
|
|
904
904
|
className: "msj__multipleTextRow",
|
|
905
905
|
initial: { opacity: 0, x: -8 },
|
|
906
906
|
animate: { opacity: 1, x: 0 },
|
|
907
907
|
transition: { delay: d * 0.05, duration: t.duration },
|
|
908
908
|
children: [
|
|
909
|
-
/* @__PURE__ */ e.jsx(
|
|
909
|
+
/* @__PURE__ */ e.jsx(ve.Root, { className: "msj__labelInline", htmlFor: u, children: m.title ?? m.name }),
|
|
910
910
|
/* @__PURE__ */ e.jsx(
|
|
911
911
|
"input",
|
|
912
912
|
{
|
|
913
913
|
id: u,
|
|
914
914
|
className: "msj__input",
|
|
915
915
|
value: c[m.name] ?? "",
|
|
916
|
-
onChange: (
|
|
917
|
-
|
|
916
|
+
onChange: (r) => {
|
|
917
|
+
T(n, { ...c, [m.name]: r.currentTarget.value });
|
|
918
918
|
}
|
|
919
919
|
}
|
|
920
920
|
)
|
|
@@ -923,35 +923,35 @@ function yt({ question: n, opts: t }) {
|
|
|
923
923
|
m.name
|
|
924
924
|
);
|
|
925
925
|
}) }),
|
|
926
|
-
/* @__PURE__ */ e.jsx(
|
|
926
|
+
/* @__PURE__ */ e.jsx(L, { errors: i, opts: t })
|
|
927
927
|
] });
|
|
928
928
|
}
|
|
929
|
-
function
|
|
930
|
-
const a = n,
|
|
929
|
+
function Rt({ question: n, opts: t }) {
|
|
930
|
+
const a = n, s = E(n, t), i = t.validationSeq > 0 ? M(n) : [], o = a.visibleChoices ?? [], c = !!a.multiSelect, m = new Set(
|
|
931
931
|
c ? Array.isArray(n.value) ? n.value : [] : [n.value]
|
|
932
932
|
), d = {
|
|
933
933
|
rest: { opacity: 0 },
|
|
934
934
|
hover: { opacity: 1 }
|
|
935
935
|
};
|
|
936
|
-
return /* @__PURE__ */ e.jsxs(
|
|
936
|
+
return /* @__PURE__ */ e.jsxs(C, { element: n, opts: t, children: [
|
|
937
937
|
/* @__PURE__ */ e.jsxs("div", { className: "msj__label", children: [
|
|
938
|
-
|
|
938
|
+
s,
|
|
939
939
|
n.isRequired ? /* @__PURE__ */ e.jsx("span", { "aria-hidden": !0, children: " *" }) : null
|
|
940
940
|
] }),
|
|
941
941
|
/* @__PURE__ */ e.jsx("div", { className: "msj__imagePicker", children: o.map((u) => {
|
|
942
|
-
const
|
|
942
|
+
const r = String(u.value), x = m.has(u.value), h = `msj-imagePicker-bg-${n.id}`;
|
|
943
943
|
return /* @__PURE__ */ e.jsxs(
|
|
944
|
-
|
|
944
|
+
v.button,
|
|
945
945
|
{
|
|
946
946
|
type: "button",
|
|
947
947
|
className: x ? "msj__imagePickerItem msj__imagePickerItem--active" : "msj__imagePickerItem",
|
|
948
948
|
onClick: () => {
|
|
949
949
|
if (!c) {
|
|
950
|
-
|
|
950
|
+
T(n, u.value);
|
|
951
951
|
return;
|
|
952
952
|
}
|
|
953
953
|
const j = new Set(Array.isArray(n.value) ? n.value : []);
|
|
954
|
-
j.has(u.value) ? j.delete(u.value) : j.add(u.value),
|
|
954
|
+
j.has(u.value) ? j.delete(u.value) : j.add(u.value), T(n, Array.from(j));
|
|
955
955
|
},
|
|
956
956
|
layout: !0,
|
|
957
957
|
initial: "rest",
|
|
@@ -959,7 +959,7 @@ function bt({ question: n, opts: t }) {
|
|
|
959
959
|
transition: { duration: t.duration },
|
|
960
960
|
children: [
|
|
961
961
|
x ? null : /* @__PURE__ */ e.jsx(
|
|
962
|
-
|
|
962
|
+
v.span,
|
|
963
963
|
{
|
|
964
964
|
className: "msj__imagePickerHoverBg",
|
|
965
965
|
variants: d,
|
|
@@ -967,43 +967,43 @@ function bt({ question: n, opts: t }) {
|
|
|
967
967
|
}
|
|
968
968
|
),
|
|
969
969
|
x ? /* @__PURE__ */ e.jsx(
|
|
970
|
-
|
|
970
|
+
v.span,
|
|
971
971
|
{
|
|
972
972
|
className: "msj__imagePickerItemBg",
|
|
973
973
|
layoutId: h,
|
|
974
974
|
transition: { type: "spring", stiffness: 700, damping: 40 }
|
|
975
975
|
}
|
|
976
976
|
) : null,
|
|
977
|
-
u.imageLink ? /* @__PURE__ */ e.jsx("img", { className: "msj__imagePickerImg", src: u.imageLink, alt: u.text ??
|
|
977
|
+
u.imageLink ? /* @__PURE__ */ e.jsx("img", { className: "msj__imagePickerImg", src: u.imageLink, alt: u.text ?? r }) : null,
|
|
978
978
|
u.text ? /* @__PURE__ */ e.jsx("span", { className: "msj__imagePickerLabel", children: u.text }) : null
|
|
979
979
|
]
|
|
980
980
|
},
|
|
981
|
-
|
|
981
|
+
r
|
|
982
982
|
);
|
|
983
983
|
}) }),
|
|
984
|
-
/* @__PURE__ */ e.jsx(
|
|
984
|
+
/* @__PURE__ */ e.jsx(L, { errors: i, opts: t })
|
|
985
985
|
] });
|
|
986
986
|
}
|
|
987
|
-
function
|
|
988
|
-
const a = n,
|
|
989
|
-
return /* @__PURE__ */ e.jsxs(
|
|
987
|
+
function Et({ question: n, opts: t }) {
|
|
988
|
+
const a = n, s = E(n, t), i = t.validationSeq > 0 ? M(n) : [], o = a.visibleChoices ?? [], c = n.value == null ? "" : String(n.value), m = `msj-btnGroup-bg-${n.id}`;
|
|
989
|
+
return /* @__PURE__ */ e.jsxs(C, { element: n, opts: t, children: [
|
|
990
990
|
/* @__PURE__ */ e.jsxs("div", { className: "msj__label", children: [
|
|
991
|
-
|
|
991
|
+
s,
|
|
992
992
|
n.isRequired ? /* @__PURE__ */ e.jsx("span", { "aria-hidden": !0, children: " *" }) : null
|
|
993
993
|
] }),
|
|
994
994
|
/* @__PURE__ */ e.jsx("div", { className: "msj__buttonGroup", children: o.map((d) => {
|
|
995
|
-
const u = String(d.value),
|
|
995
|
+
const u = String(d.value), r = c === u;
|
|
996
996
|
return /* @__PURE__ */ e.jsxs(
|
|
997
|
-
|
|
997
|
+
v.button,
|
|
998
998
|
{
|
|
999
999
|
type: "button",
|
|
1000
|
-
className:
|
|
1001
|
-
onClick: () =>
|
|
1000
|
+
className: r ? "msj__buttonGroupItem msj__buttonGroupItem--active" : "msj__buttonGroupItem",
|
|
1001
|
+
onClick: () => T(n, d.value),
|
|
1002
1002
|
layout: !0,
|
|
1003
1003
|
transition: { duration: t.duration },
|
|
1004
1004
|
children: [
|
|
1005
|
-
|
|
1006
|
-
|
|
1005
|
+
r ? /* @__PURE__ */ e.jsx(
|
|
1006
|
+
v.span,
|
|
1007
1007
|
{
|
|
1008
1008
|
className: "msj__buttonGroupItemBg",
|
|
1009
1009
|
layoutId: m,
|
|
@@ -1016,35 +1016,35 @@ function Nt({ question: n, opts: t }) {
|
|
|
1016
1016
|
u
|
|
1017
1017
|
);
|
|
1018
1018
|
}) }),
|
|
1019
|
-
/* @__PURE__ */ e.jsx(
|
|
1019
|
+
/* @__PURE__ */ e.jsx(L, { errors: i, opts: t })
|
|
1020
1020
|
] });
|
|
1021
1021
|
}
|
|
1022
|
-
function
|
|
1023
|
-
const a = n,
|
|
1024
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1022
|
+
function It({ question: n, opts: t }) {
|
|
1023
|
+
const a = n, s = E(n, t), i = t.validationSeq > 0 ? M(n) : [], o = a.visibleChoices ?? [], c = new Set(Array.isArray(n.value) ? n.value : []);
|
|
1024
|
+
return /* @__PURE__ */ e.jsxs(C, { element: n, opts: t, children: [
|
|
1025
1025
|
/* @__PURE__ */ e.jsxs("div", { className: "msj__label", children: [
|
|
1026
|
-
|
|
1026
|
+
s,
|
|
1027
1027
|
n.isRequired ? /* @__PURE__ */ e.jsx("span", { "aria-hidden": !0, children: " *" }) : null
|
|
1028
1028
|
] }),
|
|
1029
1029
|
/* @__PURE__ */ e.jsx("div", { className: "msj__tagbox", children: o.map((m) => {
|
|
1030
|
-
const d = m.value, u = String(d),
|
|
1030
|
+
const d = m.value, u = String(d), r = c.has(d);
|
|
1031
1031
|
return /* @__PURE__ */ e.jsxs(
|
|
1032
|
-
|
|
1032
|
+
v.button,
|
|
1033
1033
|
{
|
|
1034
1034
|
type: "button",
|
|
1035
|
-
className:
|
|
1035
|
+
className: r ? "msj__tag msj__tag--active" : "msj__tag",
|
|
1036
1036
|
onClick: () => {
|
|
1037
1037
|
const x = new Set(Array.isArray(n.value) ? n.value : []);
|
|
1038
|
-
x.has(d) ? x.delete(d) : x.add(d),
|
|
1038
|
+
x.has(d) ? x.delete(d) : x.add(d), T(n, Array.from(x));
|
|
1039
1039
|
},
|
|
1040
1040
|
initial: !1,
|
|
1041
|
-
animate:
|
|
1041
|
+
animate: r ? { scale: 1.02 } : { scale: 1 },
|
|
1042
1042
|
whileHover: { scale: 1.04 },
|
|
1043
1043
|
whileTap: { scale: 0.97 },
|
|
1044
1044
|
transition: { type: "spring", stiffness: 500, damping: 30 },
|
|
1045
1045
|
children: [
|
|
1046
|
-
|
|
1047
|
-
|
|
1046
|
+
r ? /* @__PURE__ */ e.jsx(
|
|
1047
|
+
v.span,
|
|
1048
1048
|
{
|
|
1049
1049
|
className: "msj__tagBg",
|
|
1050
1050
|
initial: { opacity: 0, scale: 0.8 },
|
|
@@ -1058,14 +1058,14 @@ function kt({ question: n, opts: t }) {
|
|
|
1058
1058
|
u
|
|
1059
1059
|
);
|
|
1060
1060
|
}) }),
|
|
1061
|
-
/* @__PURE__ */ e.jsx(
|
|
1061
|
+
/* @__PURE__ */ e.jsx(L, { errors: i, opts: t })
|
|
1062
1062
|
] });
|
|
1063
1063
|
}
|
|
1064
|
-
const
|
|
1064
|
+
const _e = ({
|
|
1065
1065
|
value: n,
|
|
1066
1066
|
text: t,
|
|
1067
1067
|
index: a,
|
|
1068
|
-
total:
|
|
1068
|
+
total: s,
|
|
1069
1069
|
onClick: i,
|
|
1070
1070
|
onMoveUp: o,
|
|
1071
1071
|
onMoveDown: c,
|
|
@@ -1073,18 +1073,18 @@ const he = ({
|
|
|
1073
1073
|
longTap: d,
|
|
1074
1074
|
enableDrag: u = !0
|
|
1075
1075
|
}) => {
|
|
1076
|
-
const
|
|
1076
|
+
const r = Fe(), x = he(null), h = (b) => {
|
|
1077
1077
|
d && !i ? (x.current && clearTimeout(x.current), x.current = setTimeout(() => {
|
|
1078
|
-
|
|
1079
|
-
}, 500)) : i ||
|
|
1078
|
+
r.start(b), navigator.vibrate && navigator.vibrate(50);
|
|
1079
|
+
}, 500)) : i || r.start(b);
|
|
1080
1080
|
}, j = () => {
|
|
1081
1081
|
x.current && (clearTimeout(x.current), x.current = null);
|
|
1082
|
-
},
|
|
1082
|
+
}, f = (b) => {
|
|
1083
1083
|
i && (b.key === "Enter" || b.key === " ") && (b.preventDefault(), i());
|
|
1084
|
-
},
|
|
1084
|
+
}, p = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1085
1085
|
/* @__PURE__ */ e.jsx("span", { className: "msj__rankingLabel", style: { flex: 1 }, children: t }),
|
|
1086
1086
|
/* @__PURE__ */ e.jsxs("span", { className: "msj__rankingControls", style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
1087
|
-
i && (m ? /* @__PURE__ */ e.jsx(
|
|
1087
|
+
i && (m ? /* @__PURE__ */ e.jsx(kt, { size: 16 }) : /* @__PURE__ */ e.jsx(pt, { size: 16 })),
|
|
1088
1088
|
!i && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1089
1089
|
o && a !== void 0 && a > 0 && /* @__PURE__ */ e.jsx(
|
|
1090
1090
|
"button",
|
|
@@ -1095,10 +1095,10 @@ const he = ({
|
|
|
1095
1095
|
b.stopPropagation(), o();
|
|
1096
1096
|
},
|
|
1097
1097
|
"aria-label": "Move up",
|
|
1098
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1098
|
+
children: /* @__PURE__ */ e.jsx(ot, { size: 16 })
|
|
1099
1099
|
}
|
|
1100
1100
|
),
|
|
1101
|
-
c && a !== void 0 &&
|
|
1101
|
+
c && a !== void 0 && s !== void 0 && a < s - 1 && /* @__PURE__ */ e.jsx(
|
|
1102
1102
|
"button",
|
|
1103
1103
|
{
|
|
1104
1104
|
type: "button",
|
|
@@ -1107,7 +1107,7 @@ const he = ({
|
|
|
1107
1107
|
b.stopPropagation(), c();
|
|
1108
1108
|
},
|
|
1109
1109
|
"aria-label": "Move down",
|
|
1110
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1110
|
+
children: /* @__PURE__ */ e.jsx(lt, { size: 16 })
|
|
1111
1111
|
}
|
|
1112
1112
|
),
|
|
1113
1113
|
/* @__PURE__ */ e.jsx(
|
|
@@ -1123,21 +1123,21 @@ const he = ({
|
|
|
1123
1123
|
alignItems: "center",
|
|
1124
1124
|
padding: "4px"
|
|
1125
1125
|
},
|
|
1126
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1126
|
+
children: /* @__PURE__ */ e.jsx(mt, { size: 16, className: "msj__muted" })
|
|
1127
1127
|
}
|
|
1128
1128
|
)
|
|
1129
1129
|
] })
|
|
1130
1130
|
] })
|
|
1131
1131
|
] });
|
|
1132
1132
|
return u ? /* @__PURE__ */ e.jsx(
|
|
1133
|
-
|
|
1133
|
+
ge.Item,
|
|
1134
1134
|
{
|
|
1135
1135
|
value: n,
|
|
1136
1136
|
className: "msj__rankingItem",
|
|
1137
1137
|
dragListener: !1,
|
|
1138
|
-
dragControls:
|
|
1138
|
+
dragControls: r,
|
|
1139
1139
|
onClick: i,
|
|
1140
|
-
onKeyDown:
|
|
1140
|
+
onKeyDown: f,
|
|
1141
1141
|
tabIndex: i ? 0 : void 0,
|
|
1142
1142
|
role: i ? "button" : void 0,
|
|
1143
1143
|
"aria-label": i ? `${m ? "Remove" : "Add"} ${t}` : void 0,
|
|
@@ -1146,14 +1146,14 @@ const he = ({
|
|
|
1146
1146
|
touchAction: "none"
|
|
1147
1147
|
// Important for drag to work reliably on mobile
|
|
1148
1148
|
},
|
|
1149
|
-
children:
|
|
1149
|
+
children: p
|
|
1150
1150
|
}
|
|
1151
1151
|
) : /* @__PURE__ */ e.jsx(
|
|
1152
1152
|
"li",
|
|
1153
1153
|
{
|
|
1154
1154
|
className: "msj__rankingItem",
|
|
1155
1155
|
onClick: i,
|
|
1156
|
-
onKeyDown:
|
|
1156
|
+
onKeyDown: f,
|
|
1157
1157
|
tabIndex: i ? 0 : void 0,
|
|
1158
1158
|
role: i ? "button" : void 0,
|
|
1159
1159
|
"aria-label": i ? `${m ? "Remove" : "Add"} ${t}` : void 0,
|
|
@@ -1161,37 +1161,37 @@ const he = ({
|
|
|
1161
1161
|
cursor: i ? "pointer" : "default",
|
|
1162
1162
|
touchAction: "none"
|
|
1163
1163
|
},
|
|
1164
|
-
children:
|
|
1164
|
+
children: p
|
|
1165
1165
|
}
|
|
1166
1166
|
);
|
|
1167
1167
|
};
|
|
1168
|
-
function
|
|
1169
|
-
const a = n,
|
|
1170
|
-
|
|
1171
|
-
},
|
|
1168
|
+
function Pt({ question: n, opts: t }) {
|
|
1169
|
+
const a = n, s = E(n, t), i = t.validationSeq > 0 ? M(n) : [], o = a.visibleChoices ?? [], c = Array.isArray(n.value) ? n.value : [], m = a.selectToRankEnabled === !0, d = a.selectToRankAreasLayout || "horizontal", u = a.selectToRankEmptyRankedAreaText || "Drag items here to rank them", r = a.selectToRankEmptyUnrankedAreaText || "All items ranked", x = a.longTap === !0, h = m ? c : [.../* @__PURE__ */ new Set([...c, ...o.map((g) => g.value)])], j = m ? o.filter((g) => !c.includes(g.value)).map((g) => g.value) : [], f = (g) => {
|
|
1170
|
+
T(n, g);
|
|
1171
|
+
}, p = (g) => {
|
|
1172
1172
|
const k = [...c, g];
|
|
1173
|
-
|
|
1173
|
+
T(n, k);
|
|
1174
1174
|
}, b = (g) => {
|
|
1175
|
-
const k = c.filter((
|
|
1176
|
-
|
|
1175
|
+
const k = c.filter((I) => I !== g);
|
|
1176
|
+
T(n, k);
|
|
1177
1177
|
};
|
|
1178
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1178
|
+
return /* @__PURE__ */ e.jsxs(C, { element: n, opts: t, children: [
|
|
1179
1179
|
/* @__PURE__ */ e.jsxs("div", { className: "msj__label", children: [
|
|
1180
|
-
|
|
1180
|
+
s,
|
|
1181
1181
|
n.isRequired ? /* @__PURE__ */ e.jsx("span", { "aria-hidden": !0, children: " *" }) : null
|
|
1182
1182
|
] }),
|
|
1183
1183
|
m ? /* @__PURE__ */ e.jsxs("div", { className: `msj__rankingContainer msj__rankingContainer--${d}`, children: [
|
|
1184
1184
|
/* @__PURE__ */ e.jsxs("div", { className: "msj__rankingArea", children: [
|
|
1185
1185
|
/* @__PURE__ */ e.jsx("div", { className: "msj__rankingAreaTitle", children: "Choices" }),
|
|
1186
|
-
j.length === 0 && /* @__PURE__ */ e.jsx("div", { className: "msj__rankingEmpty", children:
|
|
1187
|
-
/* @__PURE__ */ e.jsx(
|
|
1188
|
-
const k = String(g),
|
|
1189
|
-
return /* @__PURE__ */ e.jsx(
|
|
1190
|
-
|
|
1186
|
+
j.length === 0 && /* @__PURE__ */ e.jsx("div", { className: "msj__rankingEmpty", children: r }),
|
|
1187
|
+
/* @__PURE__ */ e.jsx(v.ul, { className: "msj__ranking", layout: !0, children: /* @__PURE__ */ e.jsx(V, { initial: !1, children: j.map((g) => {
|
|
1188
|
+
const k = String(g), I = o.find(($) => $.value === g)?.text ?? k;
|
|
1189
|
+
return /* @__PURE__ */ e.jsx(v.div, { layout: !0, initial: { opacity: 0, scale: 0.8 }, animate: { opacity: 1, scale: 1 }, exit: { opacity: 0, scale: 0.8 }, children: /* @__PURE__ */ e.jsx(
|
|
1190
|
+
_e,
|
|
1191
1191
|
{
|
|
1192
1192
|
value: g,
|
|
1193
|
-
text:
|
|
1194
|
-
onClick: () =>
|
|
1193
|
+
text: I,
|
|
1194
|
+
onClick: () => p(g),
|
|
1195
1195
|
isRanked: !1,
|
|
1196
1196
|
longTap: x,
|
|
1197
1197
|
enableDrag: !1
|
|
@@ -1202,13 +1202,13 @@ function wt({ question: n, opts: t }) {
|
|
|
1202
1202
|
/* @__PURE__ */ e.jsxs("div", { className: "msj__rankingArea", children: [
|
|
1203
1203
|
/* @__PURE__ */ e.jsx("div", { className: "msj__rankingAreaTitle", children: "Ranked" }),
|
|
1204
1204
|
h.length === 0 && /* @__PURE__ */ e.jsx("div", { className: "msj__rankingEmpty", children: u }),
|
|
1205
|
-
/* @__PURE__ */ e.jsx(
|
|
1206
|
-
const k = String(g),
|
|
1205
|
+
/* @__PURE__ */ e.jsx(ge.Group, { axis: "y", values: h, onReorder: f, className: "msj__ranking", children: /* @__PURE__ */ e.jsx(V, { initial: !1, children: h.map((g) => {
|
|
1206
|
+
const k = String(g), I = o.find(($) => $.value === g)?.text ?? k;
|
|
1207
1207
|
return /* @__PURE__ */ e.jsx(
|
|
1208
|
-
|
|
1208
|
+
_e,
|
|
1209
1209
|
{
|
|
1210
1210
|
value: g,
|
|
1211
|
-
text:
|
|
1211
|
+
text: I,
|
|
1212
1212
|
onClick: () => b(g),
|
|
1213
1213
|
isRanked: !0,
|
|
1214
1214
|
longTap: x
|
|
@@ -1217,54 +1217,54 @@ function wt({ question: n, opts: t }) {
|
|
|
1217
1217
|
);
|
|
1218
1218
|
}) }) })
|
|
1219
1219
|
] })
|
|
1220
|
-
] }) : /* @__PURE__ */ e.jsx(
|
|
1221
|
-
const
|
|
1220
|
+
] }) : /* @__PURE__ */ e.jsx(ge.Group, { axis: "y", values: h, onReorder: f, className: "msj__ranking", children: h.map((g, k) => {
|
|
1221
|
+
const I = String(g), $ = o.find((P) => P.value === g)?.text ?? I, Q = () => {
|
|
1222
1222
|
if (k > 0) {
|
|
1223
|
-
const
|
|
1224
|
-
|
|
1223
|
+
const P = [...h], Y = P[k];
|
|
1224
|
+
P[k] = P[k - 1], P[k - 1] = Y, f(P);
|
|
1225
1225
|
}
|
|
1226
|
-
},
|
|
1226
|
+
}, K = () => {
|
|
1227
1227
|
if (k < h.length - 1) {
|
|
1228
|
-
const
|
|
1229
|
-
|
|
1228
|
+
const P = [...h], Y = P[k];
|
|
1229
|
+
P[k] = P[k + 1], P[k + 1] = Y, f(P);
|
|
1230
1230
|
}
|
|
1231
1231
|
};
|
|
1232
1232
|
return /* @__PURE__ */ e.jsx(
|
|
1233
|
-
|
|
1233
|
+
_e,
|
|
1234
1234
|
{
|
|
1235
1235
|
value: g,
|
|
1236
|
-
text:
|
|
1236
|
+
text: $,
|
|
1237
1237
|
index: k,
|
|
1238
1238
|
total: h.length,
|
|
1239
|
-
onMoveUp:
|
|
1240
|
-
onMoveDown:
|
|
1239
|
+
onMoveUp: Q,
|
|
1240
|
+
onMoveDown: K,
|
|
1241
1241
|
longTap: x
|
|
1242
1242
|
},
|
|
1243
|
-
|
|
1243
|
+
I
|
|
1244
1244
|
);
|
|
1245
1245
|
}) }),
|
|
1246
|
-
/* @__PURE__ */ e.jsx(
|
|
1246
|
+
/* @__PURE__ */ e.jsx(L, { errors: i, opts: t })
|
|
1247
1247
|
] });
|
|
1248
1248
|
}
|
|
1249
|
-
async function
|
|
1249
|
+
async function At(n) {
|
|
1250
1250
|
const t = await new Promise((a) => {
|
|
1251
|
-
const
|
|
1252
|
-
|
|
1251
|
+
const s = new FileReader();
|
|
1252
|
+
s.onload = () => a(String(s.result ?? "")), s.readAsDataURL(n);
|
|
1253
1253
|
});
|
|
1254
1254
|
return { name: n.name, type: n.type, content: t };
|
|
1255
1255
|
}
|
|
1256
|
-
function
|
|
1257
|
-
const a = n,
|
|
1258
|
-
const u = await Promise.all(d.map(
|
|
1259
|
-
|
|
1256
|
+
function Lt({ question: n, opts: t }) {
|
|
1257
|
+
const a = n, s = E(n, t), i = t.validationSeq > 0 ? M(n) : [], [o, c] = J(!1), m = async (d) => {
|
|
1258
|
+
const u = await Promise.all(d.map(At));
|
|
1259
|
+
T(n, a.allowMultiple === !0 ? u : u[0] ?? void 0);
|
|
1260
1260
|
};
|
|
1261
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1261
|
+
return /* @__PURE__ */ e.jsxs(C, { element: n, opts: t, children: [
|
|
1262
1262
|
/* @__PURE__ */ e.jsxs("div", { className: "msj__label", children: [
|
|
1263
|
-
|
|
1263
|
+
s,
|
|
1264
1264
|
n.isRequired ? /* @__PURE__ */ e.jsx("span", { "aria-hidden": !0, children: " *" }) : null
|
|
1265
1265
|
] }),
|
|
1266
1266
|
/* @__PURE__ */ e.jsxs(
|
|
1267
|
-
|
|
1267
|
+
v.div,
|
|
1268
1268
|
{
|
|
1269
1269
|
className: "msj__fileDropZone",
|
|
1270
1270
|
initial: !1,
|
|
@@ -1296,12 +1296,12 @@ function Tt({ question: n, opts: t }) {
|
|
|
1296
1296
|
]
|
|
1297
1297
|
}
|
|
1298
1298
|
),
|
|
1299
|
-
/* @__PURE__ */ e.jsx(
|
|
1299
|
+
/* @__PURE__ */ e.jsx(L, { errors: i, opts: t })
|
|
1300
1300
|
] });
|
|
1301
1301
|
}
|
|
1302
|
-
function
|
|
1303
|
-
const a =
|
|
1304
|
-
return
|
|
1302
|
+
function $t({ question: n, opts: t }) {
|
|
1303
|
+
const a = E(n, t), s = t.validationSeq > 0 ? M(n) : [], i = he(null), o = he(!1), [c, m] = J(0);
|
|
1304
|
+
return me(() => {
|
|
1305
1305
|
const d = i.current;
|
|
1306
1306
|
if (!d) return;
|
|
1307
1307
|
let u = null;
|
|
@@ -1312,29 +1312,29 @@ function Ct({ question: n, opts: t }) {
|
|
|
1312
1312
|
}
|
|
1313
1313
|
if (!u) return;
|
|
1314
1314
|
u.lineWidth = 2, u.lineCap = "round", u.strokeStyle = "rgba(15, 23, 42, 0.9)";
|
|
1315
|
-
const
|
|
1316
|
-
const
|
|
1315
|
+
const r = (f) => {
|
|
1316
|
+
const p = d.getBoundingClientRect(), b = d.width / p.width, g = d.height / p.height;
|
|
1317
1317
|
return {
|
|
1318
|
-
x: (
|
|
1319
|
-
y: (
|
|
1318
|
+
x: (f.clientX - p.left) * b,
|
|
1319
|
+
y: (f.clientY - p.top) * g
|
|
1320
1320
|
};
|
|
1321
|
-
}, x = (
|
|
1321
|
+
}, x = (f) => {
|
|
1322
1322
|
o.current = !0;
|
|
1323
1323
|
try {
|
|
1324
|
-
d.setPointerCapture(
|
|
1324
|
+
d.setPointerCapture(f.pointerId);
|
|
1325
1325
|
} catch {
|
|
1326
1326
|
}
|
|
1327
|
-
const
|
|
1328
|
-
u.beginPath(), u.moveTo(
|
|
1329
|
-
}, h = (
|
|
1327
|
+
const p = r(f);
|
|
1328
|
+
u.beginPath(), u.moveTo(p.x, p.y);
|
|
1329
|
+
}, h = (f) => {
|
|
1330
1330
|
if (!o.current) return;
|
|
1331
|
-
const
|
|
1332
|
-
u.lineTo(
|
|
1331
|
+
const p = r(f);
|
|
1332
|
+
u.lineTo(p.x, p.y), u.stroke();
|
|
1333
1333
|
}, j = () => {
|
|
1334
1334
|
if (o.current) {
|
|
1335
1335
|
o.current = !1;
|
|
1336
1336
|
try {
|
|
1337
|
-
|
|
1337
|
+
T(n, d.toDataURL("image/png"));
|
|
1338
1338
|
} catch {
|
|
1339
1339
|
}
|
|
1340
1340
|
}
|
|
@@ -1342,14 +1342,14 @@ function Ct({ question: n, opts: t }) {
|
|
|
1342
1342
|
return d.addEventListener("pointerdown", x), d.addEventListener("pointermove", h), window.addEventListener("pointerup", j), () => {
|
|
1343
1343
|
d.removeEventListener("pointerdown", x), d.removeEventListener("pointermove", h), window.removeEventListener("pointerup", j);
|
|
1344
1344
|
};
|
|
1345
|
-
}, [n, c]), /* @__PURE__ */ e.jsxs(
|
|
1345
|
+
}, [n, c]), /* @__PURE__ */ e.jsxs(C, { element: n, opts: t, children: [
|
|
1346
1346
|
/* @__PURE__ */ e.jsxs("div", { className: "msj__label", children: [
|
|
1347
1347
|
a,
|
|
1348
1348
|
n.isRequired ? /* @__PURE__ */ e.jsx("span", { "aria-hidden": !0, children: " *" }) : null
|
|
1349
1349
|
] }),
|
|
1350
1350
|
/* @__PURE__ */ e.jsxs("div", { className: "msj__signaturePadWrap", children: [
|
|
1351
1351
|
/* @__PURE__ */ e.jsx(
|
|
1352
|
-
|
|
1352
|
+
v.canvas,
|
|
1353
1353
|
{
|
|
1354
1354
|
ref: i,
|
|
1355
1355
|
className: "msj__signaturePad",
|
|
@@ -1362,33 +1362,33 @@ function Ct({ question: n, opts: t }) {
|
|
|
1362
1362
|
c
|
|
1363
1363
|
),
|
|
1364
1364
|
/* @__PURE__ */ e.jsx(
|
|
1365
|
-
|
|
1365
|
+
v.button,
|
|
1366
1366
|
{
|
|
1367
1367
|
type: "button",
|
|
1368
1368
|
className: "msj__miniButton",
|
|
1369
1369
|
whileHover: { scale: 1.05 },
|
|
1370
1370
|
whileTap: { scale: 0.95 },
|
|
1371
1371
|
onClick: () => {
|
|
1372
|
-
m((d) => d + 1),
|
|
1372
|
+
m((d) => d + 1), T(n, void 0);
|
|
1373
1373
|
},
|
|
1374
1374
|
children: "Clear"
|
|
1375
1375
|
}
|
|
1376
1376
|
)
|
|
1377
1377
|
] }),
|
|
1378
|
-
/* @__PURE__ */ e.jsx(
|
|
1378
|
+
/* @__PURE__ */ e.jsx(L, { errors: s, opts: t })
|
|
1379
1379
|
] });
|
|
1380
1380
|
}
|
|
1381
|
-
function
|
|
1381
|
+
function Mt({
|
|
1382
1382
|
question: n,
|
|
1383
1383
|
opts: t,
|
|
1384
1384
|
render: a
|
|
1385
1385
|
}) {
|
|
1386
|
-
const
|
|
1387
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1386
|
+
const s = n, i = E(n, t), o = s.panels ?? [];
|
|
1387
|
+
return /* @__PURE__ */ e.jsxs(C, { element: n, opts: t, children: [
|
|
1388
1388
|
/* @__PURE__ */ e.jsx("div", { className: "msj__label", children: i }),
|
|
1389
1389
|
/* @__PURE__ */ e.jsxs("div", { className: "msj__panelDynamic", children: [
|
|
1390
|
-
/* @__PURE__ */ e.jsx(
|
|
1391
|
-
|
|
1390
|
+
/* @__PURE__ */ e.jsx(V, { mode: "popLayout", children: o.map((c, m) => /* @__PURE__ */ e.jsxs(
|
|
1391
|
+
v.div,
|
|
1392
1392
|
{
|
|
1393
1393
|
className: "msj__panelDynamicItem",
|
|
1394
1394
|
initial: { opacity: 0, y: -10, scale: 0.98 },
|
|
@@ -1401,12 +1401,12 @@ function Rt({
|
|
|
1401
1401
|
"Item ",
|
|
1402
1402
|
m + 1
|
|
1403
1403
|
] }),
|
|
1404
|
-
|
|
1405
|
-
|
|
1404
|
+
s.removePanel ? /* @__PURE__ */ e.jsx(
|
|
1405
|
+
v.button,
|
|
1406
1406
|
{
|
|
1407
1407
|
type: "button",
|
|
1408
1408
|
className: "msj__miniButton",
|
|
1409
|
-
onClick: () =>
|
|
1409
|
+
onClick: () => s.removePanel?.(c),
|
|
1410
1410
|
whileHover: { scale: 1.05 },
|
|
1411
1411
|
whileTap: { scale: 0.95 },
|
|
1412
1412
|
children: "Remove"
|
|
@@ -1418,12 +1418,12 @@ function Rt({
|
|
|
1418
1418
|
},
|
|
1419
1419
|
c.name ?? m
|
|
1420
1420
|
)) }),
|
|
1421
|
-
|
|
1422
|
-
|
|
1421
|
+
s.addPanel ? /* @__PURE__ */ e.jsx(
|
|
1422
|
+
v.button,
|
|
1423
1423
|
{
|
|
1424
1424
|
type: "button",
|
|
1425
1425
|
className: "msj__button",
|
|
1426
|
-
onClick: () =>
|
|
1426
|
+
onClick: () => s.addPanel?.(),
|
|
1427
1427
|
whileHover: { scale: 1.02 },
|
|
1428
1428
|
whileTap: { scale: 0.98 },
|
|
1429
1429
|
transition: { type: "spring", stiffness: 400, damping: 25 },
|
|
@@ -1433,77 +1433,77 @@ function Rt({
|
|
|
1433
1433
|
] })
|
|
1434
1434
|
] });
|
|
1435
1435
|
}
|
|
1436
|
-
function
|
|
1437
|
-
const a = n,
|
|
1438
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1436
|
+
function Ot({ question: n, opts: t }) {
|
|
1437
|
+
const a = n, s = E(n, t), i = t.validationSeq > 0 ? M(n) : [], o = a.rows ?? a.visibleRows ?? [], c = a.columns ?? a.visibleColumns ?? [], m = n.value ?? {}, d = a.cellType === "checkbox";
|
|
1438
|
+
return /* @__PURE__ */ e.jsxs(C, { element: n, opts: t, children: [
|
|
1439
1439
|
/* @__PURE__ */ e.jsxs("div", { className: "msj__label", children: [
|
|
1440
|
-
|
|
1440
|
+
s,
|
|
1441
1441
|
n.isRequired ? /* @__PURE__ */ e.jsx("span", { "aria-hidden": !0, children: " *" }) : null
|
|
1442
1442
|
] }),
|
|
1443
1443
|
/* @__PURE__ */ e.jsxs("div", { className: "msj__matrix", style: { "--msj-matrix-cols": String(c.length) }, children: [
|
|
1444
1444
|
/* @__PURE__ */ e.jsxs("div", { className: "msj__matrixHeader", "aria-hidden": !0, children: [
|
|
1445
1445
|
/* @__PURE__ */ e.jsx("div", { className: "msj__matrixHeaderCell msj__matrixCorner" }),
|
|
1446
1446
|
c.map((u) => {
|
|
1447
|
-
const
|
|
1448
|
-
return /* @__PURE__ */ e.jsx("div", { className: "msj__matrixHeaderCell", children: u.text ??
|
|
1447
|
+
const r = String(u.value);
|
|
1448
|
+
return /* @__PURE__ */ e.jsx("div", { className: "msj__matrixHeaderCell", children: u.text ?? r }, r);
|
|
1449
1449
|
})
|
|
1450
1450
|
] }),
|
|
1451
1451
|
o.map((u) => {
|
|
1452
|
-
const
|
|
1452
|
+
const r = String(u.value), x = u.text ?? r;
|
|
1453
1453
|
return /* @__PURE__ */ e.jsxs("div", { className: "msj__matrixRow", children: [
|
|
1454
1454
|
/* @__PURE__ */ e.jsx("div", { className: "msj__matrixRowTitle", children: x }),
|
|
1455
1455
|
d ? /* @__PURE__ */ e.jsx("div", { className: "msj__matrixRowChoices", children: c.map((h) => {
|
|
1456
|
-
const j = String(h.value),
|
|
1457
|
-
return /* @__PURE__ */ e.jsx("label", { className: "msj__matrixCell", "data-state":
|
|
1458
|
-
|
|
1456
|
+
const j = String(h.value), f = Array.isArray(m[r]) ? m[r] : [], p = f.includes(h.value);
|
|
1457
|
+
return /* @__PURE__ */ e.jsx("label", { className: "msj__matrixCell", "data-state": p ? "checked" : "unchecked", children: /* @__PURE__ */ e.jsx(
|
|
1458
|
+
xe.Root,
|
|
1459
1459
|
{
|
|
1460
1460
|
className: "msj__checkbox",
|
|
1461
|
-
checked:
|
|
1461
|
+
checked: p,
|
|
1462
1462
|
onCheckedChange: (b) => {
|
|
1463
|
-
const g = new Set(
|
|
1464
|
-
b === !0 ? g.add(h.value) : g.delete(h.value),
|
|
1463
|
+
const g = new Set(f);
|
|
1464
|
+
b === !0 ? g.add(h.value) : g.delete(h.value), T(n, { ...m, [r]: Array.from(g) });
|
|
1465
1465
|
},
|
|
1466
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1467
|
-
|
|
1466
|
+
children: /* @__PURE__ */ e.jsx(xe.Indicator, { forceMount: !0, asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1467
|
+
v.span,
|
|
1468
1468
|
{
|
|
1469
1469
|
className: "msj__checkboxIndicator",
|
|
1470
1470
|
initial: !1,
|
|
1471
|
-
animate:
|
|
1471
|
+
animate: p ? { opacity: 1, scale: 1 } : { opacity: 0, scale: 0.9 },
|
|
1472
1472
|
transition: { duration: Math.max(0.12, t.duration * 0.5) },
|
|
1473
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1473
|
+
children: /* @__PURE__ */ e.jsx(Ie, { active: p, duration: Math.max(0.22, t.duration * 1.2) })
|
|
1474
1474
|
}
|
|
1475
1475
|
) })
|
|
1476
1476
|
}
|
|
1477
1477
|
) }, j);
|
|
1478
1478
|
}) }) : /* @__PURE__ */ e.jsx(
|
|
1479
|
-
|
|
1479
|
+
H.Root,
|
|
1480
1480
|
{
|
|
1481
1481
|
className: "msj__matrixRowChoices",
|
|
1482
|
-
value: m[
|
|
1482
|
+
value: m[r] == null ? "" : String(m[r]),
|
|
1483
1483
|
onValueChange: (h) => {
|
|
1484
|
-
|
|
1484
|
+
T(n, { ...m, [r]: h });
|
|
1485
1485
|
},
|
|
1486
1486
|
children: c.map((h) => {
|
|
1487
|
-
const j = String(h.value),
|
|
1488
|
-
return /* @__PURE__ */ e.jsx(
|
|
1487
|
+
const j = String(h.value), f = h.text ?? j, p = String(m[r] ?? "") === j;
|
|
1488
|
+
return /* @__PURE__ */ e.jsx(H.Item, { value: j, asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1489
1489
|
"button",
|
|
1490
1490
|
{
|
|
1491
1491
|
type: "button",
|
|
1492
1492
|
className: "msj__matrixCell",
|
|
1493
|
-
"aria-label": `${x}: ${
|
|
1494
|
-
"data-state":
|
|
1493
|
+
"aria-label": `${x}: ${f}`,
|
|
1494
|
+
"data-state": p ? "checked" : "unchecked",
|
|
1495
1495
|
children: /* @__PURE__ */ e.jsxs("span", { className: "msj__radioItem", "aria-hidden": !0, children: [
|
|
1496
|
-
/* @__PURE__ */ e.jsx(
|
|
1497
|
-
|
|
1496
|
+
/* @__PURE__ */ e.jsx(H.Indicator, { forceMount: !0, asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1497
|
+
v.span,
|
|
1498
1498
|
{
|
|
1499
1499
|
className: "msj__radioIndicator",
|
|
1500
1500
|
initial: !1,
|
|
1501
|
-
animate:
|
|
1502
|
-
transition:
|
|
1501
|
+
animate: p ? { scale: 1, opacity: 1 } : { scale: 0, opacity: 0 },
|
|
1502
|
+
transition: p ? { type: "spring", stiffness: 900, damping: 45 } : { duration: Math.max(0.12, t.duration * 0.4) }
|
|
1503
1503
|
}
|
|
1504
1504
|
) }),
|
|
1505
|
-
|
|
1506
|
-
|
|
1505
|
+
p ? /* @__PURE__ */ e.jsx(
|
|
1506
|
+
v.span,
|
|
1507
1507
|
{
|
|
1508
1508
|
className: "msj__radioPulse",
|
|
1509
1509
|
initial: { scale: 0.8, opacity: 0.28 },
|
|
@@ -1513,143 +1513,163 @@ function Et({ question: n, opts: t }) {
|
|
|
1513
1513
|
) : null
|
|
1514
1514
|
] })
|
|
1515
1515
|
}
|
|
1516
|
-
) }, `${
|
|
1516
|
+
) }, `${r}:${j}`);
|
|
1517
1517
|
})
|
|
1518
1518
|
}
|
|
1519
1519
|
)
|
|
1520
|
-
] },
|
|
1520
|
+
] }, r);
|
|
1521
1521
|
})
|
|
1522
1522
|
] }),
|
|
1523
|
-
/* @__PURE__ */ e.jsx(
|
|
1523
|
+
/* @__PURE__ */ e.jsx(L, { errors: i, opts: t })
|
|
1524
1524
|
] });
|
|
1525
1525
|
}
|
|
1526
|
-
function
|
|
1527
|
-
const a =
|
|
1528
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1526
|
+
function Dt({ question: n, opts: t }) {
|
|
1527
|
+
const a = E(n, t);
|
|
1528
|
+
return /* @__PURE__ */ e.jsxs(C, { element: n, opts: t, children: [
|
|
1529
1529
|
/* @__PURE__ */ e.jsx("div", { className: "msj__label", children: a }),
|
|
1530
1530
|
/* @__PURE__ */ e.jsx("div", { className: "msj__unsupported", children: "Matrix Dropdown is not yet fully supported." })
|
|
1531
1531
|
] });
|
|
1532
1532
|
}
|
|
1533
|
-
function
|
|
1534
|
-
const a =
|
|
1535
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1533
|
+
function Ft({ question: n, opts: t }) {
|
|
1534
|
+
const a = E(n, t);
|
|
1535
|
+
return /* @__PURE__ */ e.jsxs(C, { element: n, opts: t, children: [
|
|
1536
1536
|
/* @__PURE__ */ e.jsx("div", { className: "msj__label", children: a }),
|
|
1537
1537
|
/* @__PURE__ */ e.jsx("div", { className: "msj__unsupported", children: "Matrix Dynamic is not yet fully supported." })
|
|
1538
1538
|
] });
|
|
1539
1539
|
}
|
|
1540
|
-
function
|
|
1540
|
+
function fe({
|
|
1541
1541
|
element: n,
|
|
1542
1542
|
opts: t,
|
|
1543
1543
|
render: a
|
|
1544
1544
|
}) {
|
|
1545
|
-
const
|
|
1546
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1547
|
-
|
|
1545
|
+
const s = n, i = s.elements ?? [];
|
|
1546
|
+
return /* @__PURE__ */ e.jsxs(C, { element: n, opts: t, children: [
|
|
1547
|
+
s.title ? /* @__PURE__ */ e.jsx("div", { className: "msj__label", children: s.title }) : null,
|
|
1548
1548
|
/* @__PURE__ */ e.jsx("div", { className: "msj__panel", children: i.map((o, c) => {
|
|
1549
1549
|
const m = typeof o.getType == "function" ? o.getType() : "unknown", d = o.name ?? `${m}-${c}`;
|
|
1550
1550
|
return /* @__PURE__ */ e.jsx("div", { children: a(o, t) }, d);
|
|
1551
1551
|
}) })
|
|
1552
1552
|
] });
|
|
1553
1553
|
}
|
|
1554
|
-
function
|
|
1554
|
+
function re(n, t) {
|
|
1555
1555
|
const a = typeof n.getType == "function" ? n.getType() : "unknown";
|
|
1556
|
-
if (!(n instanceof
|
|
1556
|
+
if (!(n instanceof je))
|
|
1557
1557
|
switch (a) {
|
|
1558
1558
|
case "flowpanel":
|
|
1559
|
-
return /* @__PURE__ */ e.jsx(
|
|
1559
|
+
return /* @__PURE__ */ e.jsx(fe, { element: n, opts: t, render: re });
|
|
1560
1560
|
case "page":
|
|
1561
|
-
return /* @__PURE__ */ e.jsx(
|
|
1561
|
+
return /* @__PURE__ */ e.jsx(fe, { element: n, opts: t, render: re });
|
|
1562
1562
|
default:
|
|
1563
|
-
return /* @__PURE__ */ e.jsx(
|
|
1563
|
+
return /* @__PURE__ */ e.jsx(fe, { element: n, opts: t, render: re });
|
|
1564
1564
|
}
|
|
1565
|
-
const
|
|
1565
|
+
const s = n;
|
|
1566
1566
|
switch (a) {
|
|
1567
1567
|
case "comment":
|
|
1568
|
-
return /* @__PURE__ */ e.jsx(
|
|
1568
|
+
return /* @__PURE__ */ e.jsx(We, { question: s, opts: t });
|
|
1569
1569
|
case "boolean":
|
|
1570
|
-
return /* @__PURE__ */ e.jsx(
|
|
1570
|
+
return /* @__PURE__ */ e.jsx(Ue, { question: s, opts: t });
|
|
1571
1571
|
case "radiogroup":
|
|
1572
|
-
return /* @__PURE__ */ e.jsx(
|
|
1572
|
+
return /* @__PURE__ */ e.jsx(Se, { question: s, isMulti: !1, opts: t });
|
|
1573
1573
|
case "checkbox":
|
|
1574
|
-
return /* @__PURE__ */ e.jsx(
|
|
1574
|
+
return /* @__PURE__ */ e.jsx(Se, { question: s, isMulti: !0, opts: t });
|
|
1575
1575
|
case "dropdown":
|
|
1576
|
-
return /* @__PURE__ */ e.jsx(
|
|
1576
|
+
return /* @__PURE__ */ e.jsx(ze, { question: s, opts: t });
|
|
1577
1577
|
case "tagbox":
|
|
1578
|
-
return /* @__PURE__ */ e.jsx(
|
|
1578
|
+
return /* @__PURE__ */ e.jsx(It, { question: s, opts: t });
|
|
1579
1579
|
case "buttongroup":
|
|
1580
|
-
return /* @__PURE__ */ e.jsx(
|
|
1580
|
+
return /* @__PURE__ */ e.jsx(Et, { question: s, opts: t });
|
|
1581
1581
|
case "ranking":
|
|
1582
|
-
return /* @__PURE__ */ e.jsx(
|
|
1582
|
+
return /* @__PURE__ */ e.jsx(Pt, { question: s, opts: t });
|
|
1583
1583
|
case "imagepicker":
|
|
1584
|
-
return /* @__PURE__ */ e.jsx(
|
|
1584
|
+
return /* @__PURE__ */ e.jsx(Rt, { question: s, opts: t });
|
|
1585
1585
|
case "file":
|
|
1586
|
-
return /* @__PURE__ */ e.jsx(
|
|
1586
|
+
return /* @__PURE__ */ e.jsx(Lt, { question: s, opts: t });
|
|
1587
1587
|
case "signaturepad":
|
|
1588
|
-
return /* @__PURE__ */ e.jsx(
|
|
1588
|
+
return /* @__PURE__ */ e.jsx($t, { question: s, opts: t });
|
|
1589
1589
|
case "paneldynamic":
|
|
1590
|
-
return /* @__PURE__ */ e.jsx(
|
|
1590
|
+
return /* @__PURE__ */ e.jsx(Mt, { question: s, opts: t, render: re });
|
|
1591
1591
|
case "matrix":
|
|
1592
|
-
return /* @__PURE__ */ e.jsx(
|
|
1592
|
+
return /* @__PURE__ */ e.jsx(Ot, { question: s, opts: t });
|
|
1593
1593
|
case "matrixdropdown":
|
|
1594
|
-
return /* @__PURE__ */ e.jsx(
|
|
1594
|
+
return /* @__PURE__ */ e.jsx(Dt, { question: s, opts: t });
|
|
1595
1595
|
case "matrixdynamic":
|
|
1596
|
-
return /* @__PURE__ */ e.jsx(
|
|
1596
|
+
return /* @__PURE__ */ e.jsx(Ft, { question: s, opts: t });
|
|
1597
1597
|
case "html":
|
|
1598
|
-
return /* @__PURE__ */ e.jsx(
|
|
1598
|
+
return /* @__PURE__ */ e.jsx(Ge, { question: s, opts: t });
|
|
1599
1599
|
case "image":
|
|
1600
|
-
return /* @__PURE__ */ e.jsx(
|
|
1600
|
+
return /* @__PURE__ */ e.jsx(Xe, { question: s, opts: t });
|
|
1601
1601
|
case "expression":
|
|
1602
|
-
return /* @__PURE__ */ e.jsx(
|
|
1602
|
+
return /* @__PURE__ */ e.jsx(Je, { question: s, opts: t });
|
|
1603
1603
|
case "empty":
|
|
1604
|
-
return /* @__PURE__ */ e.jsx(
|
|
1604
|
+
return /* @__PURE__ */ e.jsx(Ke, { question: s, opts: t });
|
|
1605
1605
|
case "rating":
|
|
1606
|
-
return /* @__PURE__ */ e.jsx(
|
|
1606
|
+
return /* @__PURE__ */ e.jsx(Tt, { question: s, opts: t });
|
|
1607
1607
|
case "multipletext":
|
|
1608
|
-
return /* @__PURE__ */ e.jsx(
|
|
1608
|
+
return /* @__PURE__ */ e.jsx(Ct, { question: s, opts: t });
|
|
1609
1609
|
case "text":
|
|
1610
1610
|
default:
|
|
1611
|
-
return /* @__PURE__ */ e.jsx(
|
|
1611
|
+
return /* @__PURE__ */ e.jsx(Ye, { question: s, opts: t });
|
|
1612
1612
|
}
|
|
1613
1613
|
}
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
}
|
|
1624
|
-
|
|
1625
|
-
|
|
1614
|
+
function Ce({ survey: n }) {
|
|
1615
|
+
const t = n.logo;
|
|
1616
|
+
if (!t) return null;
|
|
1617
|
+
const a = n.logoWidth, s = n.logoHeight, i = n.logoFit ?? "contain", o = n.logoPosition ?? "left";
|
|
1618
|
+
if (o === "none") return null;
|
|
1619
|
+
const c = {
|
|
1620
|
+
objectFit: i,
|
|
1621
|
+
width: a ? typeof a == "number" ? `${a}px` : a : void 0,
|
|
1622
|
+
height: s ? typeof s == "number" ? `${s}px` : s : void 0
|
|
1623
|
+
};
|
|
1624
|
+
return /* @__PURE__ */ e.jsx(
|
|
1625
|
+
"img",
|
|
1626
|
+
{
|
|
1627
|
+
src: t,
|
|
1628
|
+
alt: "Survey Logo",
|
|
1629
|
+
className: `msj__logo msj__logo--${o}`,
|
|
1630
|
+
style: c
|
|
1631
|
+
}
|
|
1632
|
+
);
|
|
1633
|
+
}
|
|
1634
|
+
const Bt = "Previous", Vt = "Next", Ht = "Complete", Qt = "Thanks!", Yt = "Your responses have been recorded.", Wt = "Select…", Ut = "{count}/{max} words", zt = "Page {current} of {total}", Gt = {
|
|
1635
|
+
back: Bt,
|
|
1636
|
+
next: Vt,
|
|
1626
1637
|
complete: Ht,
|
|
1627
|
-
thanksTitle:
|
|
1628
|
-
thanksHint:
|
|
1629
|
-
selectPlaceholder:
|
|
1630
|
-
wordCount:
|
|
1631
|
-
pageXofY:
|
|
1632
|
-
},
|
|
1633
|
-
|
|
1634
|
-
|
|
1638
|
+
thanksTitle: Qt,
|
|
1639
|
+
thanksHint: Yt,
|
|
1640
|
+
selectPlaceholder: Wt,
|
|
1641
|
+
wordCount: Ut,
|
|
1642
|
+
pageXofY: zt
|
|
1643
|
+
}, Xt = "Previous", Jt = "Next", Kt = "Complete", qt = "Thanks!", Zt = "Your responses have been recorded.", en = "Select…", tn = "{count}/{max} words", nn = "Page {current} of {total}", an = {
|
|
1644
|
+
back: Xt,
|
|
1645
|
+
next: Jt,
|
|
1646
|
+
complete: Kt,
|
|
1647
|
+
thanksTitle: qt,
|
|
1648
|
+
thanksHint: Zt,
|
|
1649
|
+
selectPlaceholder: en,
|
|
1650
|
+
wordCount: tn,
|
|
1651
|
+
pageXofY: nn
|
|
1652
|
+
}, Re = {
|
|
1653
|
+
"en-US": an,
|
|
1654
|
+
"en-GB": Gt
|
|
1635
1655
|
};
|
|
1636
|
-
function
|
|
1637
|
-
return
|
|
1656
|
+
function sn(n) {
|
|
1657
|
+
return Re[n ?? "en-US"] ?? Re["en-US"];
|
|
1638
1658
|
}
|
|
1639
|
-
function
|
|
1659
|
+
function rn({
|
|
1640
1660
|
locale: n,
|
|
1641
1661
|
messages: t
|
|
1642
1662
|
}) {
|
|
1643
|
-
const
|
|
1663
|
+
const s = { ...sn(n), ...t ?? {} };
|
|
1644
1664
|
return (i, o) => {
|
|
1645
|
-
let c =
|
|
1665
|
+
let c = s[i] ?? i;
|
|
1646
1666
|
if (o)
|
|
1647
1667
|
for (const [m, d] of Object.entries(o))
|
|
1648
1668
|
c = c.replaceAll(`{${m}}`, String(d));
|
|
1649
1669
|
return c;
|
|
1650
1670
|
};
|
|
1651
1671
|
}
|
|
1652
|
-
function
|
|
1672
|
+
function ln() {
|
|
1653
1673
|
return /* @__PURE__ */ e.jsx(
|
|
1654
1674
|
"svg",
|
|
1655
1675
|
{
|
|
@@ -1673,7 +1693,7 @@ function Zt() {
|
|
|
1673
1693
|
}
|
|
1674
1694
|
);
|
|
1675
1695
|
}
|
|
1676
|
-
function
|
|
1696
|
+
function on() {
|
|
1677
1697
|
return /* @__PURE__ */ e.jsx(
|
|
1678
1698
|
"svg",
|
|
1679
1699
|
{
|
|
@@ -1697,11 +1717,11 @@ function en() {
|
|
|
1697
1717
|
}
|
|
1698
1718
|
);
|
|
1699
1719
|
}
|
|
1700
|
-
function
|
|
1720
|
+
function mn({
|
|
1701
1721
|
json: n,
|
|
1702
1722
|
model: t,
|
|
1703
1723
|
data: a,
|
|
1704
|
-
onComplete:
|
|
1724
|
+
onComplete: s,
|
|
1705
1725
|
animate: i = !0,
|
|
1706
1726
|
animationDurationMs: o = 180,
|
|
1707
1727
|
theme: c = "modern",
|
|
@@ -1709,93 +1729,107 @@ function sn({
|
|
|
1709
1729
|
messages: d,
|
|
1710
1730
|
className: u
|
|
1711
1731
|
}) {
|
|
1712
|
-
const
|
|
1732
|
+
const r = ye(() => {
|
|
1713
1733
|
if (t) return t;
|
|
1714
|
-
const
|
|
1715
|
-
return a && (
|
|
1716
|
-
}, [t, n, a]), [, x] =
|
|
1717
|
-
(
|
|
1734
|
+
const _ = n ?? {}, S = _.showQuestionNumbers === void 0 ? { ..._, showQuestionNumbers: "onPage" } : _, N = new Oe(S);
|
|
1735
|
+
return a && (N.data = a), N;
|
|
1736
|
+
}, [t, n, a]), [, x] = be((_) => _ + 1, 0), [h, j] = be(
|
|
1737
|
+
(_, S) => S.type === "setPage" ? { pageName: S.pageName, seq: 0 } : _.pageName !== S.pageName ? { pageName: S.pageName, seq: 1 } : { pageName: _.pageName, seq: _.seq + 1 },
|
|
1718
1738
|
{ pageName: null, seq: 0 }
|
|
1719
|
-
),
|
|
1739
|
+
), f = he(null), p = o / 1e3, b = ye(() => rn({ locale: m, messages: d }), [m, d]), [g, k] = J(null), I = [
|
|
1720
1740
|
"msj",
|
|
1721
1741
|
c ? `msj--theme-${c}` : null,
|
|
1722
1742
|
u
|
|
1723
|
-
].filter(Boolean).join(" ")
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1743
|
+
].filter(Boolean).join(" "), $ = r.logoPosition ?? "left", Q = r.backgroundImage, K = r.backgroundImageFit ?? "auto", P = r.backgroundImageAttachment ?? "scroll", Y = r.backgroundOpacity ?? 1, U = Q ? {
|
|
1744
|
+
backgroundImage: `url(${Q})`,
|
|
1745
|
+
backgroundSize: K,
|
|
1746
|
+
backgroundAttachment: P,
|
|
1747
|
+
opacity: Y
|
|
1748
|
+
} : void 0;
|
|
1749
|
+
if (me(() => {
|
|
1750
|
+
const _ = () => x(), S = () => {
|
|
1751
|
+
j({ type: "setPage", pageName: r.currentPage?.name ?? null }), _();
|
|
1752
|
+
}, N = () => {
|
|
1753
|
+
s?.(r.data, r), _();
|
|
1729
1754
|
};
|
|
1730
|
-
return
|
|
1731
|
-
|
|
1755
|
+
return r.onValueChanged.add(_), r.onCurrentPageChanged.add(S), r.onComplete.add(N), () => {
|
|
1756
|
+
r.onValueChanged.remove(_), r.onCurrentPageChanged.remove(S), r.onComplete.remove(N);
|
|
1732
1757
|
};
|
|
1733
|
-
}, [
|
|
1734
|
-
const
|
|
1735
|
-
if (!
|
|
1736
|
-
|
|
1737
|
-
const
|
|
1738
|
-
if (!
|
|
1739
|
-
const
|
|
1758
|
+
}, [r, s]), me(() => {
|
|
1759
|
+
const _ = f.current;
|
|
1760
|
+
if (!_) return;
|
|
1761
|
+
f.current = null;
|
|
1762
|
+
const S = typeof window < "u" && window.CSS && typeof window.CSS.escape == "function" ? window.CSS.escape : (W) => W.replaceAll('"', '\\"'), N = document.querySelector(`[data-msj-question="${S(_)}"]`);
|
|
1763
|
+
if (!N) return;
|
|
1764
|
+
const A = N.querySelector(
|
|
1740
1765
|
'input, textarea, select, button, [tabindex]:not([tabindex="-1"])'
|
|
1741
1766
|
);
|
|
1742
1767
|
try {
|
|
1743
|
-
|
|
1768
|
+
N.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
1744
1769
|
} catch {
|
|
1745
|
-
|
|
1770
|
+
N.scrollIntoView();
|
|
1746
1771
|
}
|
|
1747
|
-
|
|
1748
|
-
}),
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1772
|
+
A?.focus({ preventScroll: !0 });
|
|
1773
|
+
}), r.state === "loading") {
|
|
1774
|
+
const _ = r.loadingHtml;
|
|
1775
|
+
return /* @__PURE__ */ e.jsx("div", { className: I, children: /* @__PURE__ */ e.jsx("div", { className: "msj__card", children: _ ? /* @__PURE__ */ e.jsx("div", { dangerouslySetInnerHTML: { __html: _ } }) : /* @__PURE__ */ e.jsx("div", { className: "msj__hint", children: "Loading..." }) }) });
|
|
1776
|
+
}
|
|
1777
|
+
if (r.state === "completed") {
|
|
1778
|
+
const _ = r.completedHtml, S = r.completedBeforeHtml;
|
|
1779
|
+
return /* @__PURE__ */ e.jsx("div", { className: I, children: /* @__PURE__ */ e.jsxs("div", { className: "msj__card", children: [
|
|
1780
|
+
S ? /* @__PURE__ */ e.jsx("div", { dangerouslySetInnerHTML: { __html: S } }) : null,
|
|
1781
|
+
_ ? /* @__PURE__ */ e.jsx("div", { dangerouslySetInnerHTML: { __html: _ } }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1782
|
+
/* @__PURE__ */ e.jsx("h2", { className: "msj__title", children: b("thanksTitle") }),
|
|
1783
|
+
/* @__PURE__ */ e.jsx("div", { className: "msj__hint", children: b("thanksHint") })
|
|
1784
|
+
] })
|
|
1752
1785
|
] }) });
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1786
|
+
}
|
|
1787
|
+
const O = r.currentPage, q = O?.questions ?? [], Z = O?.elements ?? q, le = h.pageName === (O?.name ?? null) ? h.seq : 0, ie = r.showPageTitles !== !1, z = r.showPageNumbers === !0, B = r.showQuestionNumbers, oe = B === !0 ? "on" : B === !1 ? "off" : B === "off" || B === "on" || B === "onPage" ? B : "onPage", ee = r.navigationButtonsLocation ?? "bottom", ce = r.showNavigationButtons !== !1, te = O?.navigationButtonsVisibility ?? "inherit", l = te === "hide" ? !1 : te === "show" ? !0 : ce, y = r.showPrevButton !== !1, w = l && y && !r.isFirstPage, R = l && !r.isLastPage, G = l && r.isLastPage, X = (_) => ee === "topBottom" || ee === _ ? /* @__PURE__ */ e.jsxs("div", { className: _ === "top" ? "msj__nav msj__nav--top" : "msj__nav", children: [
|
|
1788
|
+
/* @__PURE__ */ e.jsx("div", { className: "msj__navSlot msj__navSlot--left", children: /* @__PURE__ */ e.jsx(V, { initial: !1, children: w ? /* @__PURE__ */ e.jsxs(
|
|
1789
|
+
v.button,
|
|
1756
1790
|
{
|
|
1757
1791
|
type: "button",
|
|
1758
1792
|
className: "msj__button msj__button--nav",
|
|
1759
1793
|
onClick: () => {
|
|
1760
|
-
|
|
1794
|
+
r.prevPage(), x();
|
|
1761
1795
|
},
|
|
1762
1796
|
initial: i ? { opacity: 0, x: -6 } : !1,
|
|
1763
1797
|
animate: i ? { opacity: 1, x: 0 } : void 0,
|
|
1764
1798
|
exit: i ? { opacity: 0, x: -6 } : void 0,
|
|
1765
|
-
transition: { duration:
|
|
1799
|
+
transition: { duration: p },
|
|
1766
1800
|
whileHover: i ? { x: -2 } : void 0,
|
|
1767
1801
|
whileTap: i ? { scale: 0.98 } : void 0,
|
|
1768
1802
|
children: [
|
|
1769
|
-
/* @__PURE__ */ e.jsx(
|
|
1803
|
+
/* @__PURE__ */ e.jsx(ln, {}),
|
|
1770
1804
|
b("back")
|
|
1771
1805
|
]
|
|
1772
1806
|
},
|
|
1773
1807
|
"prev"
|
|
1774
1808
|
) : null }) }),
|
|
1775
|
-
/* @__PURE__ */ e.jsx("div", { className: "msj__navSlot msj__navSlot--center", children: /* @__PURE__ */ e.jsx(
|
|
1776
|
-
|
|
1809
|
+
/* @__PURE__ */ e.jsx("div", { className: "msj__navSlot msj__navSlot--center", children: /* @__PURE__ */ e.jsx(V, { initial: !1, children: G ? /* @__PURE__ */ e.jsx(
|
|
1810
|
+
v.button,
|
|
1777
1811
|
{
|
|
1778
1812
|
type: "button",
|
|
1779
1813
|
className: "msj__button msj__button--primary msj__button--complete",
|
|
1780
1814
|
onClick: () => {
|
|
1781
|
-
let
|
|
1815
|
+
let N = !1;
|
|
1782
1816
|
try {
|
|
1783
|
-
|
|
1817
|
+
N = r.validateCurrentPage();
|
|
1784
1818
|
} catch {
|
|
1785
|
-
|
|
1819
|
+
N = !1;
|
|
1786
1820
|
}
|
|
1787
|
-
if (!
|
|
1788
|
-
const
|
|
1789
|
-
|
|
1821
|
+
if (!N) {
|
|
1822
|
+
const A = q.find((W) => W.hasErrors());
|
|
1823
|
+
f.current = A?.name ?? null, j({ type: "bump", pageName: O?.name ?? null }), x();
|
|
1790
1824
|
return;
|
|
1791
1825
|
}
|
|
1792
|
-
|
|
1826
|
+
r.tryComplete(), x();
|
|
1793
1827
|
},
|
|
1794
1828
|
initial: i ? { opacity: 0, y: 6, scale: 0.98 } : !1,
|
|
1795
1829
|
animate: i ? { opacity: 1, y: 0, scale: 1 } : void 0,
|
|
1796
1830
|
exit: i ? { opacity: 0, y: 6, scale: 0.98 } : void 0,
|
|
1797
1831
|
transition: {
|
|
1798
|
-
duration:
|
|
1832
|
+
duration: p,
|
|
1799
1833
|
x: { type: "tween", duration: 0.32, ease: "easeInOut" },
|
|
1800
1834
|
rotate: { type: "tween", duration: 0.32, ease: "easeInOut" }
|
|
1801
1835
|
},
|
|
@@ -1808,98 +1842,103 @@ function sn({
|
|
|
1808
1842
|
},
|
|
1809
1843
|
"complete"
|
|
1810
1844
|
) : null }) }),
|
|
1811
|
-
/* @__PURE__ */ e.jsx("div", { className: "msj__navSlot msj__navSlot--right", children: /* @__PURE__ */ e.jsx(
|
|
1812
|
-
|
|
1845
|
+
/* @__PURE__ */ e.jsx("div", { className: "msj__navSlot msj__navSlot--right", children: /* @__PURE__ */ e.jsx(V, { initial: !1, children: R ? /* @__PURE__ */ e.jsxs(
|
|
1846
|
+
v.button,
|
|
1813
1847
|
{
|
|
1814
1848
|
type: "button",
|
|
1815
1849
|
className: "msj__button msj__button--primary msj__button--navPrimary",
|
|
1816
1850
|
onClick: () => {
|
|
1817
|
-
let
|
|
1851
|
+
let N = !1;
|
|
1818
1852
|
try {
|
|
1819
|
-
|
|
1853
|
+
N = r.validateCurrentPage();
|
|
1820
1854
|
} catch {
|
|
1821
|
-
|
|
1855
|
+
N = !1;
|
|
1822
1856
|
}
|
|
1823
|
-
if (!
|
|
1824
|
-
const
|
|
1825
|
-
|
|
1857
|
+
if (!N) {
|
|
1858
|
+
const A = q.find((W) => W.hasErrors());
|
|
1859
|
+
f.current = A?.name ?? null, j({ type: "bump", pageName: O?.name ?? null }), x();
|
|
1826
1860
|
return;
|
|
1827
1861
|
}
|
|
1828
|
-
|
|
1862
|
+
r.nextPage(), x();
|
|
1829
1863
|
},
|
|
1830
1864
|
initial: i ? { opacity: 0, x: 6 } : !1,
|
|
1831
1865
|
animate: i ? { opacity: 1, x: 0 } : void 0,
|
|
1832
1866
|
exit: i ? { opacity: 0, x: 6 } : void 0,
|
|
1833
|
-
transition: { duration:
|
|
1867
|
+
transition: { duration: p },
|
|
1834
1868
|
whileHover: i ? { x: 2 } : void 0,
|
|
1835
1869
|
whileTap: i ? { scale: 0.98 } : void 0,
|
|
1836
1870
|
children: [
|
|
1837
1871
|
b("next"),
|
|
1838
|
-
/* @__PURE__ */ e.jsx(
|
|
1872
|
+
/* @__PURE__ */ e.jsx(on, {})
|
|
1839
1873
|
]
|
|
1840
1874
|
},
|
|
1841
1875
|
"next"
|
|
1842
1876
|
) : null }) })
|
|
1843
1877
|
] }) : null;
|
|
1844
|
-
return /* @__PURE__ */ e.
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1878
|
+
return /* @__PURE__ */ e.jsxs("div", { className: I, ref: k, children: [
|
|
1879
|
+
U ? /* @__PURE__ */ e.jsx("div", { className: "msj__background", style: U }) : null,
|
|
1880
|
+
/* @__PURE__ */ e.jsxs("div", { className: "msj__card", children: [
|
|
1881
|
+
$ !== "bottom" ? /* @__PURE__ */ e.jsx(Ce, { survey: r }) : null,
|
|
1882
|
+
r.title ? /* @__PURE__ */ e.jsx("h2", { className: "msj__title", children: r.title }) : null,
|
|
1883
|
+
X("top"),
|
|
1884
|
+
/* @__PURE__ */ e.jsx(V, { mode: "wait", initial: !1, children: /* @__PURE__ */ e.jsxs(
|
|
1885
|
+
v.div,
|
|
1886
|
+
{
|
|
1887
|
+
initial: i ? { opacity: 0, y: 8 } : !1,
|
|
1888
|
+
animate: i ? { opacity: 1, y: 0 } : void 0,
|
|
1889
|
+
exit: i ? { opacity: 0, y: -8 } : void 0,
|
|
1890
|
+
transition: { duration: p },
|
|
1891
|
+
children: [
|
|
1892
|
+
ie || z ? /* @__PURE__ */ e.jsxs("div", { className: "msj__pageHeader", children: [
|
|
1893
|
+
ie && O?.title ? /* @__PURE__ */ e.jsx("div", { className: "msj__pageTitle", children: O.title }) : null,
|
|
1894
|
+
z ? /* @__PURE__ */ e.jsx("div", { className: "msj__pageNumber", children: b("pageXofY", {
|
|
1895
|
+
current: (r.currentPageNo ?? 0) + 1,
|
|
1896
|
+
total: r.pages?.length ?? 0
|
|
1897
|
+
}) }) : null
|
|
1898
|
+
] }) : null,
|
|
1899
|
+
(() => {
|
|
1900
|
+
const _ = (r.pages ?? []).slice(0, r.currentPageNo ?? 0).reduce((N, A) => N + (A.questions ?? []).length, 0);
|
|
1901
|
+
return Z.reduce(
|
|
1902
|
+
(N, A, W) => {
|
|
1903
|
+
const ne = typeof A.getType == "function" ? A.getType() : "unknown", ue = A instanceof je && ne !== "html" && ne !== "image" && ne !== "expression" && ne !== "empty", Ae = ue ? N.pageQuestionIndex : -1, Le = ue ? N.globalQuestionIndex : -1, $e = A.name ?? `${ne}-${W}`;
|
|
1904
|
+
return {
|
|
1905
|
+
items: [
|
|
1906
|
+
...N.items,
|
|
1907
|
+
/* @__PURE__ */ e.jsx("div", { children: re(
|
|
1908
|
+
A,
|
|
1909
|
+
{
|
|
1910
|
+
animate: i,
|
|
1911
|
+
duration: p,
|
|
1912
|
+
t: b,
|
|
1913
|
+
validationSeq: le,
|
|
1914
|
+
questionIndex: Ae,
|
|
1915
|
+
globalQuestionIndex: Le,
|
|
1916
|
+
showQuestionNumbers: oe,
|
|
1917
|
+
portalContainer: g
|
|
1918
|
+
}
|
|
1919
|
+
) }, $e)
|
|
1920
|
+
],
|
|
1921
|
+
pageQuestionIndex: ue ? N.pageQuestionIndex + 1 : N.pageQuestionIndex,
|
|
1922
|
+
globalQuestionIndex: ue ? N.globalQuestionIndex + 1 : N.globalQuestionIndex
|
|
1923
|
+
};
|
|
1924
|
+
},
|
|
1925
|
+
{
|
|
1926
|
+
items: [],
|
|
1927
|
+
pageQuestionIndex: 0,
|
|
1928
|
+
globalQuestionIndex: _
|
|
1929
|
+
}
|
|
1930
|
+
).items;
|
|
1931
|
+
})()
|
|
1932
|
+
]
|
|
1933
|
+
},
|
|
1934
|
+
O?.name ?? "page"
|
|
1935
|
+
) }),
|
|
1936
|
+
X("bottom"),
|
|
1937
|
+
$ === "bottom" ? /* @__PURE__ */ e.jsx(Ce, { survey: r }) : null
|
|
1938
|
+
] })
|
|
1939
|
+
] });
|
|
1901
1940
|
}
|
|
1902
1941
|
export {
|
|
1903
|
-
|
|
1942
|
+
mn as MotionSurvey
|
|
1904
1943
|
};
|
|
1905
1944
|
//# sourceMappingURL=index.js.map
|