@overmap-ai/forms 1.0.32-react-flow-david-fixes.40 → 1.0.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/dist/form/Observable/index.d.ts +1 -0
  2. package/dist/form/UUIDFile/UUIDFile.d.ts +5 -0
  3. package/dist/form/UUIDFile/index.d.ts +1 -0
  4. package/dist/form/UUIDPromise/index.d.ts +2 -0
  5. package/dist/form/UUIDPromise/utils.d.ts +4 -0
  6. package/dist/form/builder/components/CreateFieldDropdownMenu.d.ts +8 -0
  7. package/dist/form/builder/components/FieldBuilder.d.ts +1 -1
  8. package/dist/form/builder/components/FieldBuilderWithActions.d.ts +9 -0
  9. package/dist/form/builder/components/index.d.ts +2 -1
  10. package/dist/form/builder/hooks.d.ts +1 -1
  11. package/dist/form/builder/list/FieldSectionWithActions.d.ts +1 -1
  12. package/dist/form/builder/utils.d.ts +2 -2
  13. package/dist/form/components/DisplayFile.d.ts +9 -0
  14. package/dist/form/components/index.d.ts +1 -0
  15. package/dist/form/conditions/BaseCondition/BaseCondition.d.ts +6 -7
  16. package/dist/form/conditions/BaseCondition/typings.d.ts +4 -4
  17. package/dist/form/conditions/BooleanFieldCondition/BooleanFieldCondition.d.ts +4 -6
  18. package/dist/form/conditions/CheckboxListFieldCondition/CheckboxListFieldCondition.d.ts +4 -6
  19. package/dist/form/conditions/ConditionManager/ConditionManager.d.ts +15 -0
  20. package/dist/form/conditions/ConditionManager/hooks.d.ts +4 -0
  21. package/dist/form/conditions/ConditionManager/index.d.ts +3 -0
  22. package/dist/form/conditions/ConditionManager/typings.d.ts +2 -0
  23. package/dist/form/conditions/DateFieldCondition/DateFieldCondition.d.ts +4 -6
  24. package/dist/form/conditions/MultiSelectFieldCondition/MultiSelectFieldCondition.d.ts +4 -14
  25. package/dist/form/conditions/MultiStringFieldCondition/MultiStringFieldCondition.d.ts +4 -6
  26. package/dist/form/conditions/NumberFieldCondition/NumberFieldCondition.d.ts +4 -17
  27. package/dist/form/conditions/OTPFieldCondition/OTPFieldCondition.d.ts +4 -6
  28. package/dist/form/conditions/PassFailFieldCondition/PassFailFieldCondition.d.ts +18 -0
  29. package/dist/form/conditions/PassFailFieldCondition/PassFailFieldConditionCell.d.ts +6 -0
  30. package/dist/form/conditions/PassFailFieldCondition/index.d.ts +3 -0
  31. package/dist/form/conditions/PassFailFieldCondition/typings.d.ts +4 -0
  32. package/dist/form/conditions/RadioFieldCondition/RadioFieldCondition.d.ts +4 -6
  33. package/dist/form/conditions/RatingFieldCondition/RatingFieldCondition.d.ts +21 -0
  34. package/dist/form/conditions/RatingFieldCondition/RatingFieldConditionCell.d.ts +6 -0
  35. package/dist/form/conditions/RatingFieldCondition/index.d.ts +3 -0
  36. package/dist/form/conditions/RatingFieldCondition/typings.d.ts +4 -0
  37. package/dist/form/conditions/ScanFieldCondition/ScanFieldCondition.d.ts +4 -6
  38. package/dist/form/conditions/SelectFieldCondition/SelectFieldCondition.d.ts +4 -6
  39. package/dist/form/conditions/StringFieldCondition/StringFieldCondition.d.ts +4 -6
  40. package/dist/form/conditions/TextFieldCondition/TextFieldCondition.d.ts +4 -6
  41. package/dist/form/conditions/UploadFieldCondition/UploadFieldCondition.d.ts +8 -8
  42. package/dist/form/conditions/constants.d.ts +32 -0
  43. package/dist/form/conditions/index.d.ts +3 -0
  44. package/dist/form/conditions/typings.d.ts +6 -3
  45. package/dist/form/conditions/utils.d.ts +3 -4
  46. package/dist/form/fields/BaseField/BaseField.d.ts +5 -6
  47. package/dist/form/fields/BaseField/typings.d.ts +3 -4
  48. package/dist/form/fields/BaseFormElement/BaseFormElement.d.ts +9 -9
  49. package/dist/form/fields/BaseFormElement/typings.d.ts +5 -5
  50. package/dist/form/fields/BaseOptionsField/BaseOptionsField.d.ts +6 -6
  51. package/dist/form/fields/BaseOptionsField/typings.d.ts +2 -2
  52. package/dist/form/fields/BaseStringField/BaseStringField.d.ts +3 -3
  53. package/dist/form/fields/BaseStringField/typings.d.ts +1 -1
  54. package/dist/form/fields/BooleanField/BooleanField.d.ts +2 -3
  55. package/dist/form/fields/CheckboxListField/CheckboxListField.d.ts +1 -1
  56. package/dist/form/fields/DateField/DateField.d.ts +1 -1
  57. package/dist/form/fields/FieldSection/FieldSection.d.ts +5 -7
  58. package/dist/form/fields/FieldSection/typings.d.ts +2 -2
  59. package/dist/form/fields/MultiSelectField/MultiSelectField.d.ts +1 -1
  60. package/dist/form/fields/MultiStringField/MultiStringField.d.ts +1 -1
  61. package/dist/form/fields/NumberField/NumberField.d.ts +1 -1
  62. package/dist/form/fields/OneTimePasswordField/OTPField.d.ts +1 -1
  63. package/dist/form/fields/PassFailField/PassFailField.d.ts +30 -0
  64. package/dist/form/fields/PassFailField/PassFailInput.d.ts +7 -0
  65. package/dist/form/fields/PassFailField/constants.d.ts +7 -0
  66. package/dist/form/fields/PassFailField/index.d.ts +5 -0
  67. package/dist/form/fields/PassFailField/typings.d.ts +17 -0
  68. package/dist/form/fields/PassFailField/utils.d.ts +7 -0
  69. package/dist/form/fields/RadioField/RadioField.d.ts +1 -1
  70. package/dist/form/fields/RatingField/RatingField.d.ts +32 -0
  71. package/dist/form/fields/RatingField/RatingInput.d.ts +7 -0
  72. package/dist/form/fields/RatingField/index.d.ts +3 -0
  73. package/dist/form/fields/RatingField/typings.d.ts +4 -0
  74. package/dist/form/fields/ScanField/ScanField.d.ts +1 -1
  75. package/dist/form/fields/SelectField/SelectField.d.ts +1 -1
  76. package/dist/form/fields/UploadField/UploadField.d.ts +10 -9
  77. package/dist/form/fields/UploadField/index.d.ts +0 -1
  78. package/dist/form/fields/UploadField/utils.d.ts +0 -3
  79. package/dist/form/fields/constants.d.ts +6 -2
  80. package/dist/form/fields/hooks.d.ts +1 -371
  81. package/dist/form/fields/index.d.ts +2 -0
  82. package/dist/form/fields/typings.d.ts +14 -16
  83. package/dist/form/fields/utils.d.ts +6 -1
  84. package/dist/form/index.d.ts +3 -0
  85. package/dist/form/modifiers/file.d.ts +3 -2
  86. package/dist/form/modifiers/index.d.ts +1 -0
  87. package/dist/form/modifiers/passFailStatus.d.ts +6 -0
  88. package/dist/form/modifiers/utils.d.ts +1 -1
  89. package/dist/form/schema/FieldSchema.d.ts +6 -5
  90. package/dist/form/typings.d.ts +6 -2
  91. package/dist/form/utils.d.ts +5 -11
  92. package/dist/forms.js +2121 -684
  93. package/dist/forms.umd.cjs +2119 -682
  94. package/package.json +3 -5
  95. package/dist/form/builder/components/FieldWithActions.d.ts +0 -10
  96. /package/dist/form/{observable → Observable}/Observable.d.ts +0 -0
  97. /package/dist/form/{fields/UploadField → UUIDPromise}/UUIDPromise.d.ts +0 -0
package/dist/forms.js CHANGED
@@ -2,9 +2,9 @@ var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
4
  import { jsxs, jsx, Fragment as Fragment$1 } from "react/jsx-runtime";
5
- import { Card, LuIcon, Text, Spinner, Overlay, ButtonGroup, Tooltip, IconButton, Separator, Input, Badge, Checkbox, CheckboxGroup, Popover, Button, DayPicker, Menu, OneTimePasswordField, RadioGroup, TextArea, stopPropagation, Heading, useToast, ToggleGroup } from "@overmap-ai/blocks";
5
+ import { Card, LuIcon, Text, Spinner, Overlay, ButtonGroup, Tooltip, IconButton, Separator, Input, Badge, Checkbox, CheckboxGroup, Popover, Button, DayPicker, Menu, OneTimePasswordField, RadioGroup, TextArea, Rating, stopPropagation, Heading, useToast, ToggleGroup } from "@overmap-ai/blocks";
6
6
  import { cx } from "class-variance-authority";
7
- import { memo, forwardRef, createContext, useContext, useRef, useCallback, useState, useEffect, useMemo, Fragment, use, useLayoutEffect, useId } from "react";
7
+ import { forwardRef, createElement, memo, createContext, useContext, useRef, useCallback, useState, useEffect, useMemo, Fragment, use, useLayoutEffect, useId } from "react";
8
8
  import "@xyflow/react/dist/style.css";
9
9
  import { getBezierPath, Position, BaseEdge, EdgeLabelRenderer, NodeToolbar, Handle, MarkerType, useNodesState, useEdgesState, ReactFlow, Panel } from "@xyflow/react";
10
10
  import { useField, useFormikContext, useFormik, FormikProvider } from "formik";
@@ -17,11 +17,609 @@ import { DecodeHintType as DecodeHintType$2, useZxing } from "react-zxing";
17
17
  import get from "lodash.get";
18
18
  import Dagre from "@dagrejs/dagre";
19
19
  import set from "lodash.set";
20
+ /**
21
+ * @license lucide-react v0.542.0 - ISC
22
+ *
23
+ * This source code is licensed under the ISC license.
24
+ * See the LICENSE file in the root directory of this source tree.
25
+ */
26
+ const toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
27
+ const toCamelCase = (string) => string.replace(
28
+ /^([A-Z])|[\s-_]+(\w)/g,
29
+ (match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()
30
+ );
31
+ const toPascalCase = (string) => {
32
+ const camelCase = toCamelCase(string);
33
+ return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
34
+ };
35
+ const mergeClasses = (...classes) => classes.filter((className, index, array) => {
36
+ return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index;
37
+ }).join(" ").trim();
38
+ const hasA11yProp = (props) => {
39
+ for (const prop in props) {
40
+ if (prop.startsWith("aria-") || prop === "role" || prop === "title") {
41
+ return true;
42
+ }
43
+ }
44
+ };
45
+ /**
46
+ * @license lucide-react v0.542.0 - ISC
47
+ *
48
+ * This source code is licensed under the ISC license.
49
+ * See the LICENSE file in the root directory of this source tree.
50
+ */
51
+ var defaultAttributes = {
52
+ xmlns: "http://www.w3.org/2000/svg",
53
+ width: 24,
54
+ height: 24,
55
+ viewBox: "0 0 24 24",
56
+ fill: "none",
57
+ stroke: "currentColor",
58
+ strokeWidth: 2,
59
+ strokeLinecap: "round",
60
+ strokeLinejoin: "round"
61
+ };
62
+ /**
63
+ * @license lucide-react v0.542.0 - ISC
64
+ *
65
+ * This source code is licensed under the ISC license.
66
+ * See the LICENSE file in the root directory of this source tree.
67
+ */
68
+ const Icon = forwardRef(
69
+ ({
70
+ color = "currentColor",
71
+ size = 24,
72
+ strokeWidth = 2,
73
+ absoluteStrokeWidth,
74
+ className = "",
75
+ children,
76
+ iconNode,
77
+ ...rest
78
+ }, ref) => createElement(
79
+ "svg",
80
+ {
81
+ ref,
82
+ ...defaultAttributes,
83
+ width: size,
84
+ height: size,
85
+ stroke: color,
86
+ strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
87
+ className: mergeClasses("lucide", className),
88
+ ...!children && !hasA11yProp(rest) && { "aria-hidden": "true" },
89
+ ...rest
90
+ },
91
+ [
92
+ ...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),
93
+ ...Array.isArray(children) ? children : [children]
94
+ ]
95
+ )
96
+ );
97
+ /**
98
+ * @license lucide-react v0.542.0 - ISC
99
+ *
100
+ * This source code is licensed under the ISC license.
101
+ * See the LICENSE file in the root directory of this source tree.
102
+ */
103
+ const createLucideIcon = (iconName, iconNode) => {
104
+ const Component = forwardRef(
105
+ ({ className, ...props }, ref) => createElement(Icon, {
106
+ ref,
107
+ iconNode,
108
+ className: mergeClasses(
109
+ `lucide-${toKebabCase(toPascalCase(iconName))}`,
110
+ `lucide-${iconName}`,
111
+ className
112
+ ),
113
+ ...props
114
+ })
115
+ );
116
+ Component.displayName = toPascalCase(iconName);
117
+ return Component;
118
+ };
119
+ /**
120
+ * @license lucide-react v0.542.0 - ISC
121
+ *
122
+ * This source code is licensed under the ISC license.
123
+ * See the LICENSE file in the root directory of this source tree.
124
+ */
125
+ const __iconNode$D = [
126
+ ["path", { d: "M3 12h18", key: "1i2n21" }],
127
+ ["path", { d: "M3 18h18", key: "1h113x" }],
128
+ ["path", { d: "M3 6h18", key: "d0wm0j" }]
129
+ ];
130
+ const AlignJustify = createLucideIcon("align-justify", __iconNode$D);
131
+ /**
132
+ * @license lucide-react v0.542.0 - ISC
133
+ *
134
+ * This source code is licensed under the ISC license.
135
+ * See the LICENSE file in the root directory of this source tree.
136
+ */
137
+ const __iconNode$C = [
138
+ ["path", { d: "m3 16 4 4 4-4", key: "1co6wj" }],
139
+ ["path", { d: "M7 20V4", key: "1yoxec" }],
140
+ ["path", { d: "m21 8-4-4-4 4", key: "1c9v7m" }],
141
+ ["path", { d: "M17 4v16", key: "7dpous" }]
142
+ ];
143
+ const ArrowDownUp = createLucideIcon("arrow-down-up", __iconNode$C);
144
+ /**
145
+ * @license lucide-react v0.542.0 - ISC
146
+ *
147
+ * This source code is licensed under the ISC license.
148
+ * See the LICENSE file in the root directory of this source tree.
149
+ */
150
+ const __iconNode$B = [
151
+ ["path", { d: "M8 3 4 7l4 4", key: "9rb6wj" }],
152
+ ["path", { d: "M4 7h16", key: "6tx8e3" }],
153
+ ["path", { d: "m16 21 4-4-4-4", key: "siv7j2" }],
154
+ ["path", { d: "M20 17H4", key: "h6l3hr" }]
155
+ ];
156
+ const ArrowLeftRight = createLucideIcon("arrow-left-right", __iconNode$B);
157
+ /**
158
+ * @license lucide-react v0.542.0 - ISC
159
+ *
160
+ * This source code is licensed under the ISC license.
161
+ * See the LICENSE file in the root directory of this source tree.
162
+ */
163
+ const __iconNode$A = [
164
+ ["path", { d: "M8 2v4", key: "1cmpym" }],
165
+ ["path", { d: "M16 2v4", key: "4m81vk" }],
166
+ ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
167
+ ["path", { d: "M3 10h18", key: "8toen8" }]
168
+ ];
169
+ const Calendar = createLucideIcon("calendar", __iconNode$A);
170
+ /**
171
+ * @license lucide-react v0.542.0 - ISC
172
+ *
173
+ * This source code is licensed under the ISC license.
174
+ * See the LICENSE file in the root directory of this source tree.
175
+ */
176
+ const __iconNode$z = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
177
+ const Check = createLucideIcon("check", __iconNode$z);
178
+ /**
179
+ * @license lucide-react v0.542.0 - ISC
180
+ *
181
+ * This source code is licensed under the ISC license.
182
+ * See the LICENSE file in the root directory of this source tree.
183
+ */
184
+ const __iconNode$y = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
185
+ const ChevronDown = createLucideIcon("chevron-down", __iconNode$y);
186
+ /**
187
+ * @license lucide-react v0.542.0 - ISC
188
+ *
189
+ * This source code is licensed under the ISC license.
190
+ * See the LICENSE file in the root directory of this source tree.
191
+ */
192
+ const __iconNode$x = [
193
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
194
+ ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
195
+ ];
196
+ const CircleCheck = createLucideIcon("circle-check", __iconNode$x);
197
+ /**
198
+ * @license lucide-react v0.542.0 - ISC
199
+ *
200
+ * This source code is licensed under the ISC license.
201
+ * See the LICENSE file in the root directory of this source tree.
202
+ */
203
+ const __iconNode$w = [
204
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
205
+ ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }]
206
+ ];
207
+ const CircleDot = createLucideIcon("circle-dot", __iconNode$w);
208
+ /**
209
+ * @license lucide-react v0.542.0 - ISC
210
+ *
211
+ * This source code is licensed under the ISC license.
212
+ * See the LICENSE file in the root directory of this source tree.
213
+ */
214
+ const __iconNode$v = [
215
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
216
+ ["path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3", key: "1u773s" }],
217
+ ["path", { d: "M12 17h.01", key: "p32p05" }]
218
+ ];
219
+ const CircleQuestionMark = createLucideIcon("circle-question-mark", __iconNode$v);
220
+ /**
221
+ * @license lucide-react v0.542.0 - ISC
222
+ *
223
+ * This source code is licensed under the ISC license.
224
+ * See the LICENSE file in the root directory of this source tree.
225
+ */
226
+ const __iconNode$u = [
227
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
228
+ ["path", { d: "m15 9-6 6", key: "1uzhvr" }],
229
+ ["path", { d: "m9 9 6 6", key: "z0biqf" }]
230
+ ];
231
+ const CircleX = createLucideIcon("circle-x", __iconNode$u);
232
+ /**
233
+ * @license lucide-react v0.542.0 - ISC
234
+ *
235
+ * This source code is licensed under the ISC license.
236
+ * See the LICENSE file in the root directory of this source tree.
237
+ */
238
+ const __iconNode$t = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]];
239
+ const Circle = createLucideIcon("circle", __iconNode$t);
240
+ /**
241
+ * @license lucide-react v0.542.0 - ISC
242
+ *
243
+ * This source code is licensed under the ISC license.
244
+ * See the LICENSE file in the root directory of this source tree.
245
+ */
246
+ const __iconNode$s = [
247
+ ["rect", { width: "8", height: "4", x: "8", y: "2", rx: "1", ry: "1", key: "tgr4d6" }],
248
+ [
249
+ "path",
250
+ {
251
+ d: "M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",
252
+ key: "116196"
253
+ }
254
+ ],
255
+ ["path", { d: "M12 11h4", key: "1jrz19" }],
256
+ ["path", { d: "M12 16h4", key: "n85exb" }],
257
+ ["path", { d: "M8 11h.01", key: "1dfujw" }],
258
+ ["path", { d: "M8 16h.01", key: "18s6g9" }]
259
+ ];
260
+ const ClipboardList = createLucideIcon("clipboard-list", __iconNode$s);
261
+ /**
262
+ * @license lucide-react v0.542.0 - ISC
263
+ *
264
+ * This source code is licensed under the ISC license.
265
+ * See the LICENSE file in the root directory of this source tree.
266
+ */
267
+ const __iconNode$r = [
268
+ ["path", { d: "m12 15 2 2 4-4", key: "2c609p" }],
269
+ ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
270
+ ["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
271
+ ];
272
+ const CopyCheck = createLucideIcon("copy-check", __iconNode$r);
273
+ /**
274
+ * @license lucide-react v0.542.0 - ISC
275
+ *
276
+ * This source code is licensed under the ISC license.
277
+ * See the LICENSE file in the root directory of this source tree.
278
+ */
279
+ const __iconNode$q = [
280
+ ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
281
+ ["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
282
+ ];
283
+ const Copy = createLucideIcon("copy", __iconNode$q);
284
+ /**
285
+ * @license lucide-react v0.542.0 - ISC
286
+ *
287
+ * This source code is licensed under the ISC license.
288
+ * See the LICENSE file in the root directory of this source tree.
289
+ */
290
+ const __iconNode$p = [
291
+ ["path", { d: "M12 15V3", key: "m9g1x1" }],
292
+ ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
293
+ ["path", { d: "m7 10 5 5 5-5", key: "brsn70" }]
294
+ ];
295
+ const Download = createLucideIcon("download", __iconNode$p);
296
+ /**
297
+ * @license lucide-react v0.542.0 - ISC
298
+ *
299
+ * This source code is licensed under the ISC license.
300
+ * See the LICENSE file in the root directory of this source tree.
301
+ */
302
+ const __iconNode$o = [
303
+ ["path", { d: "M12 17h.01", key: "p32p05" }],
304
+ ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z", key: "1mlx9k" }],
305
+ ["path", { d: "M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3", key: "mhlwft" }]
306
+ ];
307
+ const FileQuestionMark = createLucideIcon("file-question-mark", __iconNode$o);
308
+ /**
309
+ * @license lucide-react v0.542.0 - ISC
310
+ *
311
+ * This source code is licensed under the ISC license.
312
+ * See the LICENSE file in the root directory of this source tree.
313
+ */
314
+ const __iconNode$n = [
315
+ ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
316
+ ["path", { d: "M12 9v4", key: "juzpu7" }],
317
+ ["path", { d: "M12 17h.01", key: "p32p05" }]
318
+ ];
319
+ const FileWarning = createLucideIcon("file-warning", __iconNode$n);
320
+ /**
321
+ * @license lucide-react v0.542.0 - ISC
322
+ *
323
+ * This source code is licensed under the ISC license.
324
+ * See the LICENSE file in the root directory of this source tree.
325
+ */
326
+ const __iconNode$m = [
327
+ ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
328
+ ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }]
329
+ ];
330
+ const File$1 = createLucideIcon("file", __iconNode$m);
331
+ /**
332
+ * @license lucide-react v0.542.0 - ISC
333
+ *
334
+ * This source code is licensed under the ISC license.
335
+ * See the LICENSE file in the root directory of this source tree.
336
+ */
337
+ const __iconNode$l = [
338
+ ["line", { x1: "6", x2: "6", y1: "3", y2: "15", key: "17qcm7" }],
339
+ ["circle", { cx: "18", cy: "6", r: "3", key: "1h7g24" }],
340
+ ["circle", { cx: "6", cy: "18", r: "3", key: "fqmcym" }],
341
+ ["path", { d: "M18 9a9 9 0 0 1-9 9", key: "n2h4wq" }]
342
+ ];
343
+ const GitBranch = createLucideIcon("git-branch", __iconNode$l);
344
+ /**
345
+ * @license lucide-react v0.542.0 - ISC
346
+ *
347
+ * This source code is licensed under the ISC license.
348
+ * See the LICENSE file in the root directory of this source tree.
349
+ */
350
+ const __iconNode$k = [
351
+ ["line", { x1: "4", x2: "20", y1: "9", y2: "9", key: "4lhtct" }],
352
+ ["line", { x1: "4", x2: "20", y1: "15", y2: "15", key: "vyu0kd" }],
353
+ ["line", { x1: "10", x2: "8", y1: "3", y2: "21", key: "1ggp8o" }],
354
+ ["line", { x1: "16", x2: "14", y1: "3", y2: "21", key: "weycgp" }]
355
+ ];
356
+ const Hash = createLucideIcon("hash", __iconNode$k);
357
+ /**
358
+ * @license lucide-react v0.542.0 - ISC
359
+ *
360
+ * This source code is licensed under the ISC license.
361
+ * See the LICENSE file in the root directory of this source tree.
362
+ */
363
+ const __iconNode$j = [
364
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
365
+ ["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }],
366
+ ["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }]
367
+ ];
368
+ const Image = createLucideIcon("image", __iconNode$j);
369
+ /**
370
+ * @license lucide-react v0.542.0 - ISC
371
+ *
372
+ * This source code is licensed under the ISC license.
373
+ * See the LICENSE file in the root directory of this source tree.
374
+ */
375
+ const __iconNode$i = [
376
+ ["rect", { width: "18", height: "7", x: "3", y: "3", rx: "1", key: "f1a2em" }],
377
+ ["rect", { width: "7", height: "7", x: "3", y: "14", rx: "1", key: "1bb6yr" }],
378
+ ["rect", { width: "7", height: "7", x: "14", y: "14", rx: "1", key: "nxv5o0" }]
379
+ ];
380
+ const LayoutPanelTop = createLucideIcon("layout-panel-top", __iconNode$i);
381
+ /**
382
+ * @license lucide-react v0.542.0 - ISC
383
+ *
384
+ * This source code is licensed under the ISC license.
385
+ * See the LICENSE file in the root directory of this source tree.
386
+ */
387
+ const __iconNode$h = [
388
+ ["path", { d: "m3 17 2 2 4-4", key: "1jhpwq" }],
389
+ ["path", { d: "m3 7 2 2 4-4", key: "1obspn" }],
390
+ ["path", { d: "M13 6h8", key: "15sg57" }],
391
+ ["path", { d: "M13 12h8", key: "h98zly" }],
392
+ ["path", { d: "M13 18h8", key: "oe0vm4" }]
393
+ ];
394
+ const ListChecks = createLucideIcon("list-checks", __iconNode$h);
395
+ /**
396
+ * @license lucide-react v0.542.0 - ISC
397
+ *
398
+ * This source code is licensed under the ISC license.
399
+ * See the LICENSE file in the root directory of this source tree.
400
+ */
401
+ const __iconNode$g = [
402
+ ["rect", { x: "3", y: "5", width: "6", height: "6", rx: "1", key: "1defrl" }],
403
+ ["path", { d: "m3 17 2 2 4-4", key: "1jhpwq" }],
404
+ ["path", { d: "M13 6h8", key: "15sg57" }],
405
+ ["path", { d: "M13 12h8", key: "h98zly" }],
406
+ ["path", { d: "M13 18h8", key: "oe0vm4" }]
407
+ ];
408
+ const ListTodo = createLucideIcon("list-todo", __iconNode$g);
409
+ /**
410
+ * @license lucide-react v0.542.0 - ISC
411
+ *
412
+ * This source code is licensed under the ISC license.
413
+ * See the LICENSE file in the root directory of this source tree.
414
+ */
415
+ const __iconNode$f = [
416
+ ["path", { d: "M3 12h.01", key: "nlz23k" }],
417
+ ["path", { d: "M3 18h.01", key: "1tta3j" }],
418
+ ["path", { d: "M3 6h.01", key: "1rqtza" }],
419
+ ["path", { d: "M8 12h13", key: "1za7za" }],
420
+ ["path", { d: "M8 18h13", key: "1lx6n3" }],
421
+ ["path", { d: "M8 6h13", key: "ik3vkj" }]
422
+ ];
423
+ const List = createLucideIcon("list", __iconNode$f);
424
+ /**
425
+ * @license lucide-react v0.542.0 - ISC
426
+ *
427
+ * This source code is licensed under the ISC license.
428
+ * See the LICENSE file in the root directory of this source tree.
429
+ */
430
+ const __iconNode$e = [
431
+ ["path", { d: "M8 3H5a2 2 0 0 0-2 2v3", key: "1dcmit" }],
432
+ ["path", { d: "M21 8V5a2 2 0 0 0-2-2h-3", key: "1e4gt3" }],
433
+ ["path", { d: "M3 16v3a2 2 0 0 0 2 2h3", key: "wsl5sc" }],
434
+ ["path", { d: "M16 21h3a2 2 0 0 0 2-2v-3", key: "18trek" }]
435
+ ];
436
+ const Maximize = createLucideIcon("maximize", __iconNode$e);
437
+ /**
438
+ * @license lucide-react v0.542.0 - ISC
439
+ *
440
+ * This source code is licensed under the ISC license.
441
+ * See the LICENSE file in the root directory of this source tree.
442
+ */
443
+ const __iconNode$d = [["path", { d: "M5 12h14", key: "1ays0h" }]];
444
+ const Minus = createLucideIcon("minus", __iconNode$d);
445
+ /**
446
+ * @license lucide-react v0.542.0 - ISC
447
+ *
448
+ * This source code is licensed under the ISC license.
449
+ * See the LICENSE file in the root directory of this source tree.
450
+ */
451
+ const __iconNode$c = [
452
+ ["path", { d: "M8 18L12 22L16 18", key: "cskvfv" }],
453
+ ["path", { d: "M12 2V22", key: "r89rzk" }]
454
+ ];
455
+ const MoveDown = createLucideIcon("move-down", __iconNode$c);
456
+ /**
457
+ * @license lucide-react v0.542.0 - ISC
458
+ *
459
+ * This source code is licensed under the ISC license.
460
+ * See the LICENSE file in the root directory of this source tree.
461
+ */
462
+ const __iconNode$b = [
463
+ ["path", { d: "M8 6L12 2L16 6", key: "1yvkyx" }],
464
+ ["path", { d: "M12 2V22", key: "r89rzk" }]
465
+ ];
466
+ const MoveUp = createLucideIcon("move-up", __iconNode$b);
467
+ /**
468
+ * @license lucide-react v0.542.0 - ISC
469
+ *
470
+ * This source code is licensed under the ISC license.
471
+ * See the LICENSE file in the root directory of this source tree.
472
+ */
473
+ const __iconNode$a = [
474
+ ["path", { d: "M5 12h14", key: "1ays0h" }],
475
+ ["path", { d: "M12 5v14", key: "s699le" }]
476
+ ];
477
+ const Plus = createLucideIcon("plus", __iconNode$a);
478
+ /**
479
+ * @license lucide-react v0.542.0 - ISC
480
+ *
481
+ * This source code is licensed under the ISC license.
482
+ * See the LICENSE file in the root directory of this source tree.
483
+ */
484
+ const __iconNode$9 = [
485
+ ["rect", { width: "20", height: "12", x: "2", y: "6", rx: "2", key: "9lu3g6" }],
486
+ ["path", { d: "M12 12h.01", key: "1mp3jc" }],
487
+ ["path", { d: "M17 12h.01", key: "1m0b6t" }],
488
+ ["path", { d: "M7 12h.01", key: "eqddd0" }]
489
+ ];
490
+ const RectangleEllipsis = createLucideIcon("rectangle-ellipsis", __iconNode$9);
491
+ /**
492
+ * @license lucide-react v0.542.0 - ISC
493
+ *
494
+ * This source code is licensed under the ISC license.
495
+ * See the LICENSE file in the root directory of this source tree.
496
+ */
497
+ const __iconNode$8 = [
498
+ ["path", { d: "M3 7V5a2 2 0 0 1 2-2h2", key: "aa7l1z" }],
499
+ ["path", { d: "M17 3h2a2 2 0 0 1 2 2v2", key: "4qcy5o" }],
500
+ ["path", { d: "M21 17v2a2 2 0 0 1-2 2h-2", key: "6vwrx8" }],
501
+ ["path", { d: "M7 21H5a2 2 0 0 1-2-2v-2", key: "ioqczr" }]
502
+ ];
503
+ const Scan = createLucideIcon("scan", __iconNode$8);
504
+ /**
505
+ * @license lucide-react v0.542.0 - ISC
506
+ *
507
+ * This source code is licensed under the ISC license.
508
+ * See the LICENSE file in the root directory of this source tree.
509
+ */
510
+ const __iconNode$7 = [
511
+ [
512
+ "path",
513
+ {
514
+ d: "M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",
515
+ key: "1i5ecw"
516
+ }
517
+ ],
518
+ ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
519
+ ];
520
+ const Settings = createLucideIcon("settings", __iconNode$7);
521
+ /**
522
+ * @license lucide-react v0.542.0 - ISC
523
+ *
524
+ * This source code is licensed under the ISC license.
525
+ * See the LICENSE file in the root directory of this source tree.
526
+ */
527
+ const __iconNode$6 = [
528
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
529
+ ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
530
+ ];
531
+ const SquareCheck = createLucideIcon("square-check", __iconNode$6);
532
+ /**
533
+ * @license lucide-react v0.542.0 - ISC
534
+ *
535
+ * This source code is licensed under the ISC license.
536
+ * See the LICENSE file in the root directory of this source tree.
537
+ */
538
+ const __iconNode$5 = [
539
+ ["path", { d: "M5 3a2 2 0 0 0-2 2", key: "y57alp" }],
540
+ ["path", { d: "M19 3a2 2 0 0 1 2 2", key: "18rm91" }],
541
+ ["path", { d: "M21 19a2 2 0 0 1-2 2", key: "1j7049" }],
542
+ ["path", { d: "M5 21a2 2 0 0 1-2-2", key: "sbafld" }],
543
+ ["path", { d: "M9 3h1", key: "1yesri" }],
544
+ ["path", { d: "M9 21h1", key: "15o7lz" }],
545
+ ["path", { d: "M14 3h1", key: "1ec4yj" }],
546
+ ["path", { d: "M14 21h1", key: "v9vybs" }],
547
+ ["path", { d: "M3 9v1", key: "1r0deq" }],
548
+ ["path", { d: "M21 9v1", key: "mxsmne" }],
549
+ ["path", { d: "M3 14v1", key: "vnatye" }],
550
+ ["path", { d: "M21 14v1", key: "169vum" }]
551
+ ];
552
+ const SquareDashed = createLucideIcon("square-dashed", __iconNode$5);
553
+ /**
554
+ * @license lucide-react v0.542.0 - ISC
555
+ *
556
+ * This source code is licensed under the ISC license.
557
+ * See the LICENSE file in the root directory of this source tree.
558
+ */
559
+ const __iconNode$4 = [
560
+ [
561
+ "path",
562
+ {
563
+ d: "M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",
564
+ key: "r04s7s"
565
+ }
566
+ ]
567
+ ];
568
+ const Star = createLucideIcon("star", __iconNode$4);
569
+ /**
570
+ * @license lucide-react v0.542.0 - ISC
571
+ *
572
+ * This source code is licensed under the ISC license.
573
+ * See the LICENSE file in the root directory of this source tree.
574
+ */
575
+ const __iconNode$3 = [
576
+ ["path", { d: "M12 20h-1a2 2 0 0 1-2-2 2 2 0 0 1-2 2H6", key: "1528k5" }],
577
+ ["path", { d: "M13 8h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7", key: "13ksps" }],
578
+ ["path", { d: "M5 16H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1", key: "1n9rhb" }],
579
+ ["path", { d: "M6 4h1a2 2 0 0 1 2 2 2 2 0 0 1 2-2h1", key: "1mj8rg" }],
580
+ ["path", { d: "M9 6v12", key: "velyjx" }]
581
+ ];
582
+ const TextCursorInput = createLucideIcon("text-cursor-input", __iconNode$3);
583
+ /**
584
+ * @license lucide-react v0.542.0 - ISC
585
+ *
586
+ * This source code is licensed under the ISC license.
587
+ * See the LICENSE file in the root directory of this source tree.
588
+ */
589
+ const __iconNode$2 = [
590
+ ["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
591
+ ["path", { d: "M3 6h18", key: "d0wm0j" }],
592
+ ["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }]
593
+ ];
594
+ const Trash = createLucideIcon("trash", __iconNode$2);
595
+ /**
596
+ * @license lucide-react v0.542.0 - ISC
597
+ *
598
+ * This source code is licensed under the ISC license.
599
+ * See the LICENSE file in the root directory of this source tree.
600
+ */
601
+ const __iconNode$1 = [
602
+ ["path", { d: "M12 3v12", key: "1x0j5s" }],
603
+ ["path", { d: "m17 8-5-5-5 5", key: "7q97r8" }],
604
+ ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }]
605
+ ];
606
+ const Upload = createLucideIcon("upload", __iconNode$1);
607
+ /**
608
+ * @license lucide-react v0.542.0 - ISC
609
+ *
610
+ * This source code is licensed under the ISC license.
611
+ * See the LICENSE file in the root directory of this source tree.
612
+ */
613
+ const __iconNode = [
614
+ ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
615
+ ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
616
+ ];
617
+ const X = createLucideIcon("x", __iconNode);
20
618
  const FileCard = memo(
21
619
  forwardRef((props, ref) => {
22
620
  const { file, className, error, rightSlot, ...rest } = props;
23
621
  return /* @__PURE__ */ jsxs(Card, { className: cx(className, "flex w-full items-center gap-2 text-sm"), ref, ...rest, children: [
24
- error ? /* @__PURE__ */ jsx(LuIcon, { icon: "file-question-mark" }) : /* @__PURE__ */ jsx(LuIcon, { icon: "file", color: "var(--base-a11)" }),
622
+ error ? /* @__PURE__ */ jsx(LuIcon, { icon: FileQuestionMark }) : /* @__PURE__ */ jsx(LuIcon, { icon: File$1, color: "var(--base-a11)" }),
25
623
  !error ? file ? /* @__PURE__ */ jsx(Text, { className: "truncate", children: file.name }) : /* @__PURE__ */ jsx("div", { className: "flex w-full justify-center", children: /* @__PURE__ */ jsx(Spinner, {}) }) : /* @__PURE__ */ jsx(Text, { accentColor: "danger", className: "truncate", children: error }),
26
624
  rightSlot
27
625
  ] });
@@ -79,12 +677,11 @@ class BaseFormElement extends Observable {
79
677
  }
80
678
  class BaseField extends BaseFormElement {
81
679
  constructor(options) {
82
- const { label, description = null, required, image, fieldValidators = [], ...base } = options;
680
+ const { label, description = null, required, image, ...base } = options;
83
681
  super(base);
84
682
  __publicField(this, "label");
85
683
  __publicField(this, "description");
86
684
  __publicField(this, "required");
87
- __publicField(this, "fieldValidators");
88
685
  __publicField(this, "image");
89
686
  /**
90
687
  * By default, validation doesn't execute on `onChange` events when editing fields
@@ -97,7 +694,6 @@ class BaseField extends BaseFormElement {
97
694
  this.description = description;
98
695
  this.required = required;
99
696
  this.image = image;
100
- this.fieldValidators = fieldValidators;
101
697
  }
102
698
  getError(value) {
103
699
  if (this.required && this.isValueBlank(value)) {
@@ -123,24 +719,22 @@ class BaseField extends BaseFormElement {
123
719
  label: this.label,
124
720
  description: this.description,
125
721
  required: this.required,
126
- image: this.image,
127
- fieldValidators: this.fieldValidators
722
+ image: this.image
128
723
  };
129
724
  }
130
725
  setOptions(options) {
131
- const { label, description = null, required, image, fieldValidators, ...base } = options;
726
+ const { label, description = null, required, image, ...base } = options;
132
727
  this.label = label ?? this.label;
133
728
  this.description = description ?? this.description;
134
729
  this.required = required ?? this.required;
135
730
  this.image = image ?? this.image;
136
- this.fieldValidators = fieldValidators ?? this.fieldValidators;
137
731
  super.setOptions(base);
138
732
  }
139
733
  isValueBlank(value) {
140
734
  return this.areValuesEqual(value, this.blankValue());
141
735
  }
142
736
  getFieldValidators() {
143
- return [...this.fieldValidators];
737
+ return [];
144
738
  }
145
739
  }
146
740
  __publicField(BaseField, "fieldTypeName");
@@ -184,15 +778,15 @@ const ImageViewer = memo((props) => {
184
778
  variant: "ghost",
185
779
  children: [
186
780
  /* @__PURE__ */ jsxs(Tooltip.Root, { children: [
187
- /* @__PURE__ */ jsx(Tooltip.Trigger, { asChild: true, children: /* @__PURE__ */ jsx(IconButton, { onClick: handleCopy, "aria-label": "copy to clipboard", children: /* @__PURE__ */ jsx(LuIcon, { icon: "copy" }) }) }),
781
+ /* @__PURE__ */ jsx(Tooltip.Trigger, { asChild: true, children: /* @__PURE__ */ jsx(IconButton, { onClick: handleCopy, "aria-label": "copy to clipboard", children: /* @__PURE__ */ jsx(LuIcon, { icon: Copy }) }) }),
188
782
  /* @__PURE__ */ jsx(Tooltip.Content, { size: "sm", children: "Copy" })
189
783
  ] }),
190
784
  /* @__PURE__ */ jsxs(Tooltip.Root, { children: [
191
- /* @__PURE__ */ jsx(Tooltip.Trigger, { asChild: true, children: /* @__PURE__ */ jsx(IconButton, { onClick: handleDownload, "aria-label": "download", children: /* @__PURE__ */ jsx(LuIcon, { icon: "download" }) }) }),
785
+ /* @__PURE__ */ jsx(Tooltip.Trigger, { asChild: true, children: /* @__PURE__ */ jsx(IconButton, { onClick: handleDownload, "aria-label": "download", children: /* @__PURE__ */ jsx(LuIcon, { icon: Download }) }) }),
192
786
  /* @__PURE__ */ jsx(Tooltip.Content, { size: "sm", children: "Download" })
193
787
  ] }),
194
788
  /* @__PURE__ */ jsx(Separator, { orientation: "vertical", size: "sm" }),
195
- /* @__PURE__ */ jsx(Overlay.Close, { asChild: true, children: /* @__PURE__ */ jsx(IconButton, { onClick: onClose, "aria-label": "close", children: /* @__PURE__ */ jsx(LuIcon, { icon: "x" }) }) })
789
+ /* @__PURE__ */ jsx(Overlay.Close, { asChild: true, children: /* @__PURE__ */ jsx(IconButton, { onClick: onClose, "aria-label": "close", children: /* @__PURE__ */ jsx(LuIcon, { icon: X }) }) })
196
790
  ]
197
791
  }
198
792
  ),
@@ -326,12 +920,11 @@ const useFormikInput = (props) => {
326
920
  ];
327
921
  };
328
922
  const MultiStringInput = memo((props) => {
329
- const [{ inputId, labelId, size, severity, showInputOnly, field, helpText, label, fieldProps }, rest] = useFormikInput(props);
923
+ const [{ inputId, labelId, size, severity, showInputOnly, field, helpText, label, fieldProps }, { disabled }] = useFormikInput(props);
330
924
  const computedHelpText = showInputOnly ? null : helpText;
331
925
  const computedLabel = showInputOnly ? "" : label;
332
926
  const { value, name, onChange, onBlur } = fieldProps;
333
927
  const droppableId = `${inputId}-droppable`;
334
- const { disabled } = rest;
335
928
  const [intermediateValue, setIntermediateValue] = useState("");
336
929
  const [internalError, setInternalError] = useState("");
337
930
  const updatedHelpText = internalError || computedHelpText;
@@ -418,7 +1011,7 @@ const MultiStringInput = memo((props) => {
418
1011
  placeholder: field.placeholder,
419
1012
  onBlur: handleInputBlur,
420
1013
  name,
421
- ...rest
1014
+ disabled
422
1015
  }
423
1016
  ) }),
424
1017
  /* @__PURE__ */ jsx(
@@ -431,7 +1024,7 @@ const MultiStringInput = memo((props) => {
431
1024
  "aria-label": "Add option",
432
1025
  disabled: !!internalError || disabled,
433
1026
  onClick: addOption,
434
- children: /* @__PURE__ */ jsx(LuIcon, { icon: "plus" })
1027
+ children: /* @__PURE__ */ jsx(LuIcon, { icon: Plus })
435
1028
  }
436
1029
  )
437
1030
  ] })
@@ -478,7 +1071,7 @@ const MultiStringInput = memo((props) => {
478
1071
  onClick: () => {
479
1072
  handleDeleteOption(index);
480
1073
  },
481
- children: /* @__PURE__ */ jsx(LuIcon, { icon: "x" })
1074
+ children: /* @__PURE__ */ jsx(LuIcon, { icon: X })
482
1075
  }
483
1076
  )
484
1077
  ]
@@ -630,7 +1223,7 @@ class BaseOptionsField extends BaseField {
630
1223
  }
631
1224
  }
632
1225
  const BooleanInput = memo((props) => {
633
- const [{ inputId, labelId, size, severity, showInputOnly, field, helpText, label, fieldProps }, rest] = useFormikInput(props);
1226
+ const [{ inputId, labelId, size, severity, showInputOnly, field, helpText, label, fieldProps }, { disabled }] = useFormikInput(props);
634
1227
  const { name, onBlur, onChange, value } = fieldProps;
635
1228
  const computedHelpText = showInputOnly ? null : helpText;
636
1229
  const computedLabel = showInputOnly ? "" : label;
@@ -665,8 +1258,8 @@ const BooleanInput = memo((props) => {
665
1258
  size: "sm",
666
1259
  accentColor: "primary",
667
1260
  variant: "surface",
668
- ...rest,
669
- children: /* @__PURE__ */ jsx(Checkbox.Indicator, { children: /* @__PURE__ */ jsx(LuIcon, { icon: "check" }) })
1261
+ disabled,
1262
+ children: /* @__PURE__ */ jsx(Checkbox.Indicator, { children: /* @__PURE__ */ jsx(LuIcon, { icon: Check }) })
670
1263
  }
671
1264
  )
672
1265
  }
@@ -695,7 +1288,6 @@ const _BooleanField = class _BooleanField extends BaseField {
695
1288
  });
696
1289
  }
697
1290
  static deserialize(data) {
698
- if (data.type !== "boolean") throw new Error("Type mismatch.");
699
1291
  return new _BooleanField(data);
700
1292
  }
701
1293
  serializeValue(value) {
@@ -726,7 +1318,7 @@ let BooleanField = _BooleanField;
726
1318
  const NumberInput = memo((props) => {
727
1319
  const [
728
1320
  { inputId, labelId, size, severity, showInputOnly, field, helpText, label, fieldProps, touched, helpers },
729
- rest
1321
+ { disabled }
730
1322
  ] = useFormikInput(props);
731
1323
  const { name, onBlur, onChange, value } = fieldProps;
732
1324
  const computedHelpText = showInputOnly ? null : helpText;
@@ -772,7 +1364,7 @@ const NumberInput = memo((props) => {
772
1364
  max: field.maximum,
773
1365
  step: field.integers ? 1 : 0.1,
774
1366
  placeholder: field.placeholder ?? "Enter a number",
775
- ...rest
1367
+ disabled
776
1368
  }
777
1369
  ) })
778
1370
  }
@@ -808,8 +1400,7 @@ const _NumberField = class _NumberField extends BaseField {
808
1400
  description: "Minimum value",
809
1401
  integers: true,
810
1402
  required: false,
811
- identifier: `${path}minimum`,
812
- fieldValidators: []
1403
+ identifier: `${path}minimum`
813
1404
  }),
814
1405
  showDirectly: false
815
1406
  },
@@ -819,8 +1410,7 @@ const _NumberField = class _NumberField extends BaseField {
819
1410
  description: "Maximum value",
820
1411
  integers: true,
821
1412
  required: false,
822
- identifier: `${path}maximum`,
823
- fieldValidators: []
1413
+ identifier: `${path}maximum`
824
1414
  }),
825
1415
  showDirectly: false
826
1416
  },
@@ -945,7 +1535,6 @@ class BaseStringField extends BaseField {
945
1535
  identifier: `${path}minimum_length`,
946
1536
  minimum: 0,
947
1537
  maximum: 100,
948
- fieldValidators: [],
949
1538
  integers: true
950
1539
  }),
951
1540
  showDirectly: false
@@ -959,7 +1548,6 @@ class BaseStringField extends BaseField {
959
1548
  minimum: 1,
960
1549
  maximum: LONG_TEXT_FIELD_MAX_LENGTH,
961
1550
  // TODO: depends on short vs long text
962
- fieldValidators: [],
963
1551
  // TODO: default: 500 (see: "Short text fields can hold up to 500 characters on a single line.")
964
1552
  integers: true
965
1553
  }),
@@ -1029,7 +1617,7 @@ class BaseStringField extends BaseField {
1029
1617
  }
1030
1618
  }
1031
1619
  const CheckboxListInput = memo((props) => {
1032
- const [{ inputId, labelId, size, severity, field, showInputOnly, helpText, label, fieldProps }, rest] = useFormikInput(props);
1620
+ const [{ inputId, labelId, size, severity, field, showInputOnly, helpText, label, fieldProps }, { disabled }] = useFormikInput(props);
1033
1621
  const { value, name, onChange, onBlur } = fieldProps;
1034
1622
  const computedHelpText = showInputOnly ? null : helpText;
1035
1623
  const computedLabel = showInputOnly ? "" : label;
@@ -1060,9 +1648,9 @@ const CheckboxListInput = memo((props) => {
1060
1648
  size: "sm",
1061
1649
  values: value,
1062
1650
  onValuesChange: handleChange,
1063
- ...rest,
1651
+ disabled,
1064
1652
  children: field.options.map((option, index) => /* @__PURE__ */ jsxs("label", { className: "flex gap-2 items-center min-w-0", children: [
1065
- /* @__PURE__ */ jsx(CheckboxGroup.Item, { value: option.value, children: /* @__PURE__ */ jsx(CheckboxGroup.ItemIndicator, { children: /* @__PURE__ */ jsx(LuIcon, { icon: "check" }) }) }),
1653
+ /* @__PURE__ */ jsx(CheckboxGroup.Item, { value: option.value, children: /* @__PURE__ */ jsx(CheckboxGroup.ItemIndicator, { children: /* @__PURE__ */ jsx(LuIcon, { icon: Check }) }) }),
1066
1654
  /* @__PURE__ */ jsx(Text, { size: "sm", accentColor: "base", className: "truncate", children: option.label })
1067
1655
  ] }, `${inputId}-${option.value}-${index}`))
1068
1656
  }
@@ -1118,7 +1706,7 @@ __publicField(_CheckboxListField, "fieldTypeName", "Checkbox list");
1118
1706
  __publicField(_CheckboxListField, "fieldTypeDescription", "Allows the user to select a multiple options from a list.");
1119
1707
  let CheckboxListField = _CheckboxListField;
1120
1708
  const DateInput = memo((props) => {
1121
- const [{ inputId, labelId, size, severity, showInputOnly, field, helpText, label, fieldProps }, rest] = useFormikInput(props);
1709
+ const [{ inputId, labelId, size, severity, showInputOnly, field, helpText, label, fieldProps }, { disabled }] = useFormikInput(props);
1122
1710
  const { value, name, onChange, onBlur } = fieldProps;
1123
1711
  const [popoverOpen, setPopoverOpen] = useState(false);
1124
1712
  const computedHelpText = showInputOnly ? null : helpText;
@@ -1157,14 +1745,14 @@ const DateInput = memo((props) => {
1157
1745
  accentColor: "base",
1158
1746
  variant: "surface",
1159
1747
  size: "sm",
1160
- ...rest,
1748
+ disabled,
1161
1749
  children: [
1162
1750
  value ? value.toLocaleString(void 0, {
1163
1751
  year: "numeric",
1164
1752
  month: "2-digit",
1165
1753
  day: "2-digit"
1166
1754
  }) : "yyyy-mm-dd",
1167
- /* @__PURE__ */ jsx(LuIcon, { icon: "chevron-down" })
1755
+ /* @__PURE__ */ jsx(LuIcon, { icon: ChevronDown })
1168
1756
  ]
1169
1757
  }
1170
1758
  ) }),
@@ -1235,7 +1823,7 @@ __publicField(_DateField, "fieldTypeName", "Date");
1235
1823
  __publicField(_DateField, "fieldTypeDescription", "Allows specifying a date.");
1236
1824
  let DateField = _DateField;
1237
1825
  const MultiSelectInput = memo((props) => {
1238
- const [{ inputId, labelId, size, severity, showInputOnly, field, helpText, label, fieldProps }, rest] = useFormikInput(props);
1826
+ const [{ inputId, labelId, size, severity, showInputOnly, field, helpText, label, fieldProps }, { disabled }] = useFormikInput(props);
1239
1827
  const { value, name, onChange, onBlur } = fieldProps;
1240
1828
  const computedHelpText = showInputOnly ? null : helpText;
1241
1829
  const computedLabel = showInputOnly ? "" : label;
@@ -1272,16 +1860,16 @@ const MultiSelectInput = memo((props) => {
1272
1860
  type: "button",
1273
1861
  size: "sm",
1274
1862
  accentColor: "base",
1275
- ...rest,
1863
+ disabled,
1276
1864
  children: [
1277
1865
  /* @__PURE__ */ jsx("span", { className: "truncate", children: value && value.length > 0 ? value.join(", ") : field.placeholder ?? "Select one or more..." }),
1278
- /* @__PURE__ */ jsx(LuIcon, { icon: "chevron-down" })
1866
+ /* @__PURE__ */ jsx(LuIcon, { icon: ChevronDown })
1279
1867
  ]
1280
1868
  }
1281
1869
  ) }),
1282
1870
  /* @__PURE__ */ jsx(Menu.Content, { children: /* @__PURE__ */ jsx(Menu.Scroll, { children: /* @__PURE__ */ jsxs(Menu.MultiSelectGroup, { values: value, onValuesChange: handleChange, children: [
1283
1871
  /* @__PURE__ */ jsxs(Menu.SelectAllItem, { children: [
1284
- /* @__PURE__ */ jsx(Menu.CheckboxItemIndicator, { children: (indeterminate) => indeterminate ? /* @__PURE__ */ jsx(LuIcon, { icon: "minus" }) : /* @__PURE__ */ jsx(LuIcon, { icon: "check" }) }),
1872
+ /* @__PURE__ */ jsx(Menu.CheckboxItemIndicator, { children: (indeterminate) => indeterminate ? /* @__PURE__ */ jsx(LuIcon, { icon: Minus }) : /* @__PURE__ */ jsx(LuIcon, { icon: Check }) }),
1285
1873
  "Select all"
1286
1874
  ] }),
1287
1875
  field.options.map((option, index) => /* @__PURE__ */ jsxs(
@@ -1289,7 +1877,7 @@ const MultiSelectInput = memo((props) => {
1289
1877
  {
1290
1878
  value: option.value,
1291
1879
  children: [
1292
- /* @__PURE__ */ jsx(Menu.SelectedIndicator, { children: /* @__PURE__ */ jsx(LuIcon, { icon: "check" }) }),
1880
+ /* @__PURE__ */ jsx(Menu.SelectedIndicator, { children: /* @__PURE__ */ jsx(LuIcon, { icon: Check }) }),
1293
1881
  option.label
1294
1882
  ]
1295
1883
  },
@@ -1358,7 +1946,7 @@ __publicField(_MultiSelectField, "fieldTypeName", "Multi-select");
1358
1946
  __publicField(_MultiSelectField, "fieldTypeDescription", "Allows the user to select a multiple options from a list of options.");
1359
1947
  let MultiSelectField = _MultiSelectField;
1360
1948
  const SelectInput = memo((props) => {
1361
- const [{ inputId, labelId, size, severity, showInputOnly, field, helpText, label, fieldProps }, rest] = useFormikInput(props);
1949
+ const [{ inputId, labelId, size, severity, showInputOnly, field, helpText, label, fieldProps }, { disabled }] = useFormikInput(props);
1362
1950
  const { name, onChange, onBlur, value } = fieldProps;
1363
1951
  const computedHelpText = showInputOnly ? null : helpText;
1364
1952
  const computedLabel = showInputOnly ? "" : label;
@@ -1392,15 +1980,15 @@ const SelectInput = memo((props) => {
1392
1980
  variant: "surface",
1393
1981
  type: "button",
1394
1982
  size: "sm",
1395
- ...rest,
1983
+ disabled,
1396
1984
  children: [
1397
1985
  /* @__PURE__ */ jsx("span", { className: "truncate", children: currentOption ? currentOption.label : field.placeholder ?? "Select one..." }),
1398
- /* @__PURE__ */ jsx(LuIcon, { icon: "chevron-down" })
1986
+ /* @__PURE__ */ jsx(LuIcon, { icon: ChevronDown })
1399
1987
  ]
1400
1988
  }
1401
1989
  ) }),
1402
1990
  /* @__PURE__ */ jsx(Menu.Content, { children: /* @__PURE__ */ jsx(Menu.Scroll, { children: /* @__PURE__ */ jsx(Menu.SelectGroup, { required: false, value: value ?? void 0, onValueChange: handleChange, children: field.options.map((option, index) => /* @__PURE__ */ jsxs(Menu.SelectItem, { value: option.value, children: [
1403
- /* @__PURE__ */ jsx(Menu.SelectedIndicator, { children: /* @__PURE__ */ jsx(LuIcon, { icon: "check" }) }),
1991
+ /* @__PURE__ */ jsx(Menu.SelectedIndicator, { children: /* @__PURE__ */ jsx(LuIcon, { icon: Check }) }),
1404
1992
  option.label
1405
1993
  ] }, `${inputId}-${option.value}-${index}`)) }) }) })
1406
1994
  ] })
@@ -1467,7 +2055,7 @@ let SelectField = _SelectField;
1467
2055
  const OTPInput = memo((props) => {
1468
2056
  const [
1469
2057
  { inputId, labelId, size, severity, showInputOnly, field, helpText, label, fieldProps, touched, helpers },
1470
- { formId: formId2, autoComplete: _autoComplete, ...rest }
2058
+ { formId: formId2, disabled }
1471
2059
  ] = useFormikInput(props);
1472
2060
  const { name, onBlur, onChange, value } = fieldProps;
1473
2061
  const computedHelpText = showInputOnly ? null : helpText;
@@ -1486,17 +2074,10 @@ const OTPInput = memo((props) => {
1486
2074
  },
1487
2075
  [field, helpers, touched]
1488
2076
  );
1489
- const handleBlur = useCallback(
1490
- (e) => {
1491
- const { relatedTarget } = e;
1492
- if (relatedTarget instanceof Element && inputUuids.includes(relatedTarget.id)) {
1493
- return;
1494
- }
1495
- onChange(internalValue);
1496
- onBlur(internalValue);
1497
- },
1498
- [inputUuids, internalValue, onBlur, onChange]
1499
- );
2077
+ const handleBlur = useCallback(() => {
2078
+ onChange(internalValue);
2079
+ onBlur(internalValue);
2080
+ }, [internalValue, onBlur, onChange]);
1500
2081
  return /* @__PURE__ */ jsx(InputWithLabelAndHelpText, { helpText: computedHelpText, severity, children: /* @__PURE__ */ jsx(
1501
2082
  InputWithLabel,
1502
2083
  {
@@ -1515,6 +2096,7 @@ const OTPInput = memo((props) => {
1515
2096
  onValueChange: handleChange,
1516
2097
  validationType: field.validationType,
1517
2098
  form: formId2,
2099
+ disabled,
1518
2100
  orientation: "horizontal",
1519
2101
  dir: "ltr",
1520
2102
  type: "text",
@@ -1525,9 +2107,9 @@ const OTPInput = memo((props) => {
1525
2107
  accentColor: "base",
1526
2108
  variant: "surface",
1527
2109
  size: "sm",
1528
- ...rest,
2110
+ onBlur: handleBlur,
1529
2111
  children: [
1530
- inputUuids.map((inputUuid) => /* @__PURE__ */ jsx(OneTimePasswordField.Input, { id: inputUuid, onBlur: handleBlur }, inputUuid)),
2112
+ inputUuids.map((inputUuid) => /* @__PURE__ */ jsx(OneTimePasswordField.Input, { id: inputUuid }, inputUuid)),
1531
2113
  /* @__PURE__ */ jsx(OneTimePasswordField.HiddenInput, {})
1532
2114
  ]
1533
2115
  }
@@ -1557,8 +2139,7 @@ const _OTPField = class _OTPField extends BaseField {
1557
2139
  required: false,
1558
2140
  minimum: 1,
1559
2141
  maximum: 16,
1560
- identifier: `${path}length`,
1561
- fieldValidators: []
2142
+ identifier: `${path}length`
1562
2143
  }),
1563
2144
  showDirectly: false
1564
2145
  },
@@ -1654,8 +2235,566 @@ const _OTPField = class _OTPField extends BaseField {
1654
2235
  __publicField(_OTPField, "fieldTypeName", "OTP");
1655
2236
  __publicField(_OTPField, "fieldTypeDescription", "Allows specifying a number within a given range.");
1656
2237
  let OTPField = _OTPField;
2238
+ const passFailFieldStatusMapping = {
2239
+ pass: {
2240
+ label: "Pass",
2241
+ icon: CircleCheck
2242
+ },
2243
+ fail: {
2244
+ label: "Fail",
2245
+ icon: CircleX
2246
+ },
2247
+ na: {
2248
+ label: "N/A",
2249
+ icon: CircleQuestionMark
2250
+ }
2251
+ };
2252
+ const passFailFieldStatuses = Object.keys(passFailFieldStatusMapping);
2253
+ class UUIDFile extends File {
2254
+ constructor(uuid, ...args) {
2255
+ super(...args);
2256
+ __publicField(this, "uuid");
2257
+ this.uuid = uuid;
2258
+ }
2259
+ static from(uuid, file) {
2260
+ return new UUIDFile(uuid, [file], file.name, {
2261
+ lastModified: file.lastModified,
2262
+ type: file.type
2263
+ });
2264
+ }
2265
+ }
2266
+ class UUIDPromise extends Promise {
2267
+ constructor(executor, uuid) {
2268
+ super(executor);
2269
+ __publicField(this, "_uuid");
2270
+ this._uuid = uuid;
2271
+ }
2272
+ get uuid() {
2273
+ return this._uuid;
2274
+ }
2275
+ set uuid(uuid) {
2276
+ this._uuid = uuid;
2277
+ }
2278
+ static from(promise, uuid) {
2279
+ return new UUIDPromise((resolve, reject) => {
2280
+ Promise.resolve(promise).then(resolve).catch(reject);
2281
+ }, uuid);
2282
+ }
2283
+ then(onFulfilled, onRejected) {
2284
+ const promise = super.then(onFulfilled, onRejected);
2285
+ promise.uuid = this.uuid;
2286
+ return promise;
2287
+ }
2288
+ catch(onRejected) {
2289
+ const promise = super.catch(onRejected);
2290
+ promise.uuid = this.uuid;
2291
+ return promise;
2292
+ }
2293
+ finally(onFinally) {
2294
+ const promise = super.finally(onFinally);
2295
+ promise.uuid = this.uuid;
2296
+ return promise;
2297
+ }
2298
+ }
2299
+ function isFileAndPromiseArray(value) {
2300
+ if (!Array.isArray(value)) return false;
2301
+ return value.every((item) => item instanceof UUIDPromise || item instanceof UUIDFile);
2302
+ }
2303
+ function areFileAndPromiseArraysEqual(value1, value2) {
2304
+ if (!value1.every((promise1) => value2.some((promise2) => promise1.uuid === promise2.uuid))) return false;
2305
+ if (!value2.every((promise2) => value1.some((promise1) => promise1.uuid === promise2.uuid))) return false;
2306
+ return true;
2307
+ }
2308
+ const ImageCard = memo(
2309
+ forwardRef((props, forwardedRef) => {
2310
+ const { file, alt, error, rightSlot, className, ...rest } = props;
2311
+ return /* @__PURE__ */ jsxs(
2312
+ Card,
2313
+ {
2314
+ className: cx(className, "relative flex h-[200px] w-full flex-col gap-2 overflow-hidden items-center"),
2315
+ ref: forwardedRef,
2316
+ ...rest,
2317
+ children: [
2318
+ !file && !error && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 grow flex items-center justify-center", children: /* @__PURE__ */ jsx(Spinner, {}) }),
2319
+ !!file && !error && /* @__PURE__ */ jsx(Card, { className: "flex max-w-full grow items-center !p-0 justify-center overflow-hidden bg-clip-padding", children: /* @__PURE__ */ jsx(
2320
+ "img",
2321
+ {
2322
+ className: "max-w-full object-cover",
2323
+ src: URL.createObjectURL(file),
2324
+ alt: alt ?? file.name
2325
+ }
2326
+ ) }),
2327
+ (!!file || !!error) && /* @__PURE__ */ jsxs(
2328
+ "div",
2329
+ {
2330
+ className: cx("flex w-full items-center gap-2 self-end", {
2331
+ "bg-transparent": !file
2332
+ }),
2333
+ children: [
2334
+ error ? /* @__PURE__ */ jsx(LuIcon, { icon: FileWarning }) : file && /* @__PURE__ */ jsx(LuIcon, { icon: File$1 }),
2335
+ /* @__PURE__ */ jsx(Text, { className: "truncate", size: "sm", children: error ?? (file == null ? void 0 : file.name) }),
2336
+ rightSlot
2337
+ ]
2338
+ }
2339
+ )
2340
+ ]
2341
+ }
2342
+ );
2343
+ })
2344
+ );
2345
+ const convertBytesToLargestUnit = (bytes) => {
2346
+ const units = ["byte", "kilobyte", "megabyte"];
2347
+ let sizeInUnit = bytes;
2348
+ let unitIndex = 0;
2349
+ while (sizeInUnit > 1e3 && unitIndex < units.length - 1) {
2350
+ sizeInUnit /= 1e3;
2351
+ unitIndex++;
2352
+ }
2353
+ const formatter = new Intl.NumberFormat([], {
2354
+ // 0 for bytes and kilobytes, 1 for megabytes
2355
+ maximumFractionDigits: Math.max(0, unitIndex - 1),
2356
+ style: "unit",
2357
+ unit: units[unitIndex]
2358
+ });
2359
+ return formatter.format(sizeInUnit);
2360
+ };
2361
+ const DisplayFile = memo((props) => {
2362
+ const { file, onRemove, disabled } = props;
2363
+ const [resolvedFile, setResolvedFile] = useState(null);
2364
+ const [error, setError] = useState(null);
2365
+ const openImageViewer = useImageViewer();
2366
+ const { url, name } = useMemo(() => {
2367
+ let url2 = null;
2368
+ let name2;
2369
+ let size;
2370
+ if (resolvedFile == null ? void 0 : resolvedFile.type.startsWith("image/")) {
2371
+ url2 = URL.createObjectURL(resolvedFile);
2372
+ }
2373
+ if (resolvedFile) {
2374
+ name2 = resolvedFile.name;
2375
+ size = convertBytesToLargestUnit(resolvedFile.size);
2376
+ } else {
2377
+ name2 = "Downloading...";
2378
+ size = "...";
2379
+ }
2380
+ return { url: url2, name: name2, size };
2381
+ }, [resolvedFile]);
2382
+ useEffect(() => {
2383
+ if (file instanceof UUIDPromise) {
2384
+ file.then((file2) => {
2385
+ setResolvedFile(file2);
2386
+ }).catch((err) => {
2387
+ setError(err instanceof Error ? err.message : "Unknown error");
2388
+ });
2389
+ } else {
2390
+ setResolvedFile(file);
2391
+ }
2392
+ }, [file]);
2393
+ const handleDownload = useCallback(
2394
+ (event) => {
2395
+ event.stopPropagation();
2396
+ if (!resolvedFile) {
2397
+ throw new Error("Cannot download a file that is not resolved.");
2398
+ }
2399
+ const blob = new Blob([resolvedFile]);
2400
+ saveAs(blob, name);
2401
+ },
2402
+ [name, resolvedFile]
2403
+ );
2404
+ const handleDelete = useCallback(
2405
+ (e) => {
2406
+ e.stopPropagation();
2407
+ onRemove();
2408
+ },
2409
+ [onRemove]
2410
+ );
2411
+ const handleImageCardClick = useCallback(() => {
2412
+ if (!resolvedFile) return;
2413
+ openImageViewer((closeFileViewer) => ({
2414
+ file: resolvedFile,
2415
+ onDelete: !disabled ? () => {
2416
+ onRemove();
2417
+ closeFileViewer();
2418
+ } : void 0
2419
+ }));
2420
+ }, [disabled, onRemove, openImageViewer, resolvedFile]);
2421
+ const rightSlotContent = useMemo(
2422
+ () => /* @__PURE__ */ jsxs(ButtonGroup, { className: "flex grow justify-end", variant: "ghost", accentColor: "base", size: "sm", children: [
2423
+ /* @__PURE__ */ jsx(
2424
+ IconButton,
2425
+ {
2426
+ "aria-label": `Download ${name}`,
2427
+ type: "button",
2428
+ onClick: handleDownload,
2429
+ disabled: !resolvedFile,
2430
+ children: /* @__PURE__ */ jsx(LuIcon, { icon: Download })
2431
+ }
2432
+ ),
2433
+ !disabled && /* @__PURE__ */ jsx(IconButton, { type: "button", "aria-label": `Remove ${name}`, disabled, onClick: handleDelete, children: /* @__PURE__ */ jsx(LuIcon, { icon: Trash }) })
2434
+ ] }),
2435
+ [disabled, handleDelete, handleDownload, name, resolvedFile]
2436
+ );
2437
+ return url ? /* @__PURE__ */ jsx(
2438
+ ImageCard,
2439
+ {
2440
+ className: "cursor-pointer",
2441
+ onClick: handleImageCardClick,
2442
+ file: resolvedFile,
2443
+ error: error ?? void 0,
2444
+ rightSlot: rightSlotContent
2445
+ }
2446
+ ) : /* @__PURE__ */ jsx(FileCard, { file: resolvedFile, error: error ?? void 0, rightSlot: rightSlotContent });
2447
+ });
2448
+ DisplayFile.displayName = "DisplayFile";
2449
+ const PassFailInput = memo((props) => {
2450
+ const [
2451
+ { inputId, labelId, size, severity, showInputOnly, field, helpText, label, fieldProps, touched, helpers },
2452
+ { disabled }
2453
+ ] = useFormikInput(props);
2454
+ const { value, onChange, onBlur, name } = fieldProps;
2455
+ const [internalNotes, setInternalNotes] = useState("");
2456
+ const input = useRef(null);
2457
+ const computedHelpText = showInputOnly ? null : helpText;
2458
+ const computedLabel = showInputOnly ? "" : label;
2459
+ const showNotesAndFiles = value.status && field.showNotesAndFilesOn.includes(value.status);
2460
+ const handleStatusChange = useCallback(
2461
+ (status) => {
2462
+ const newValue = field.cleanValue({
2463
+ ...value,
2464
+ status
2465
+ });
2466
+ onChange(newValue);
2467
+ onBlur(newValue);
2468
+ },
2469
+ [field, onBlur, onChange, value]
2470
+ );
2471
+ useEffect(() => {
2472
+ setInternalNotes(value.notes);
2473
+ }, [value]);
2474
+ const handleNotesChange = useCallback(
2475
+ (e) => {
2476
+ const notes = e.target.value;
2477
+ setInternalNotes(notes);
2478
+ if (touched || !field.onlyValidateAfterTouched) {
2479
+ helpers.setError(
2480
+ field.getError({
2481
+ ...value,
2482
+ notes: internalNotes
2483
+ })
2484
+ );
2485
+ }
2486
+ },
2487
+ [field, helpers, internalNotes, touched, value]
2488
+ );
2489
+ const handleNotesBlur = useCallback(() => {
2490
+ const newValue = {
2491
+ ...value,
2492
+ notes: internalNotes
2493
+ };
2494
+ onChange(newValue);
2495
+ onBlur(newValue);
2496
+ }, [internalNotes, onBlur, onChange, value]);
2497
+ const handleRemoveFile = useCallback(
2498
+ (index) => {
2499
+ const files = [...value.files];
2500
+ files.splice(index, 1);
2501
+ onChange({
2502
+ ...value,
2503
+ files
2504
+ });
2505
+ },
2506
+ [onChange, value]
2507
+ );
2508
+ const handleFileButtonClick = useCallback(() => {
2509
+ var _a2;
2510
+ (_a2 = input.current) == null ? void 0 : _a2.click();
2511
+ }, []);
2512
+ const handleFilesChange = useCallback(
2513
+ (e) => {
2514
+ const files = Array.from(e.target.files ?? []).map((file) => UUIDFile.from(v4(), file));
2515
+ const newValue = {
2516
+ ...value,
2517
+ files: [...value.files, ...files]
2518
+ };
2519
+ onChange(newValue);
2520
+ onBlur(newValue);
2521
+ },
2522
+ [onBlur, onChange, value]
2523
+ );
2524
+ useEffect(() => {
2525
+ if (!input.current) return;
2526
+ const abortController = new AbortController();
2527
+ input.current.addEventListener(
2528
+ "cancel",
2529
+ () => {
2530
+ onBlur(value);
2531
+ },
2532
+ {
2533
+ signal: abortController.signal
2534
+ }
2535
+ );
2536
+ return () => {
2537
+ abortController.abort();
2538
+ };
2539
+ }, [onBlur, value]);
2540
+ const statusInputId = `${inputId}-status`;
2541
+ const notesInputId = `${inputId}-notes`;
2542
+ const filesInputId = `${inputId}-files`;
2543
+ return /* @__PURE__ */ jsx(InputWithLabelAndHelpText, { helpText: computedHelpText, severity, children: /* @__PURE__ */ jsx(
2544
+ InputWithLabel,
2545
+ {
2546
+ size,
2547
+ severity,
2548
+ inputId,
2549
+ labelId,
2550
+ label: computedLabel,
2551
+ image: showInputOnly ? void 0 : field.image,
2552
+ children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
2553
+ /* @__PURE__ */ jsx(
2554
+ RadioGroup.Root,
2555
+ {
2556
+ id: statusInputId,
2557
+ className: "flex gap-2",
2558
+ name,
2559
+ value: value.status,
2560
+ disabled,
2561
+ accentColor: "base",
2562
+ variant: "surface",
2563
+ size: "sm",
2564
+ onValueChange: handleStatusChange,
2565
+ children: passFailFieldStatuses.map((status) => {
2566
+ const { label: label2 } = passFailFieldStatusMapping[status];
2567
+ return /* @__PURE__ */ jsxs("label", { className: "flex gap-2 items-center min-w-0", children: [
2568
+ /* @__PURE__ */ jsx(RadioGroup.Item, { value: status, children: /* @__PURE__ */ jsx(RadioGroup.Indicator, { children: /* @__PURE__ */ jsx(LuIcon, { icon: Circle, className: "fill-current" }) }) }),
2569
+ /* @__PURE__ */ jsx(Text, { size: "sm", accentColor: "base", className: "truncate", children: label2 })
2570
+ ] }, `${inputId}-${status}`);
2571
+ })
2572
+ }
2573
+ ),
2574
+ showNotesAndFiles && /* @__PURE__ */ jsxs(Fragment$1, { children: [
2575
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
2576
+ TextArea,
2577
+ {
2578
+ id: notesInputId,
2579
+ value: internalNotes,
2580
+ name,
2581
+ onChange: handleNotesChange,
2582
+ onBlur: handleNotesBlur,
2583
+ className: "field-sizing-content w-full min-h-12",
2584
+ placeholder: "Notes",
2585
+ resize: "vertical",
2586
+ accentColor: "base",
2587
+ variant: "surface",
2588
+ size: "sm",
2589
+ disabled
2590
+ }
2591
+ ) }),
2592
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
2593
+ /* @__PURE__ */ jsxs(
2594
+ Button,
2595
+ {
2596
+ className: "w-max",
2597
+ size: "sm",
2598
+ variant: "soft",
2599
+ accentColor: "base",
2600
+ onClick: handleFileButtonClick,
2601
+ type: "button",
2602
+ disabled,
2603
+ children: [
2604
+ /* @__PURE__ */ jsx(LuIcon, { icon: Upload }),
2605
+ "Select files"
2606
+ ]
2607
+ }
2608
+ ),
2609
+ /* @__PURE__ */ jsx(
2610
+ "input",
2611
+ {
2612
+ id: filesInputId,
2613
+ name,
2614
+ type: "file",
2615
+ ref: input,
2616
+ multiple: true,
2617
+ className: "hidden",
2618
+ onChange: handleFilesChange,
2619
+ value: ""
2620
+ }
2621
+ ),
2622
+ value.files.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex h-max flex-col gap-2", children: value.files.map((file, index) => /* @__PURE__ */ jsx(
2623
+ DisplayFile,
2624
+ {
2625
+ file,
2626
+ onRemove: () => {
2627
+ handleRemoveFile(index);
2628
+ },
2629
+ disabled
2630
+ },
2631
+ index
2632
+ )) })
2633
+ ] })
2634
+ ] })
2635
+ ] })
2636
+ }
2637
+ ) });
2638
+ });
2639
+ PassFailInput.displayName = "PassFailInput";
2640
+ const isPassFailFieldStatus = (value) => {
2641
+ return typeof value === "string" && passFailFieldStatuses.includes(value);
2642
+ };
2643
+ const isSerializedPassFailFieldValue = (value) => {
2644
+ if (value === null || typeof value !== "object") return false;
2645
+ if (!("status" in value) || !isPassFailFieldStatus(value.status)) return false;
2646
+ if (!("notes" in value) || !(typeof value.notes === "string")) return false;
2647
+ if (!("files" in value) || !(Array.isArray(value.files) && value.files.length === 0)) return false;
2648
+ return true;
2649
+ };
2650
+ const isPassFailFieldValue = (value) => {
2651
+ if (value === null || typeof value !== "object") return false;
2652
+ if (!("status" in value) || !isPassFailFieldStatus(value.status)) return false;
2653
+ if (!("notes" in value) || !(typeof value.notes === "string")) return false;
2654
+ if (!("files" in value) || !isFileAndPromiseArray(value.files)) return false;
2655
+ return true;
2656
+ };
2657
+ const serializePassFailFieldValue = (value) => {
2658
+ return {
2659
+ status: value.status,
2660
+ notes: value.notes,
2661
+ files: []
2662
+ };
2663
+ };
2664
+ const deserializePassFailFieldValue = (value) => {
2665
+ return {
2666
+ status: value.status,
2667
+ notes: value.notes,
2668
+ files: []
2669
+ };
2670
+ };
2671
+ const arePassFieldValuesEqual = (value1, value2) => {
2672
+ if (value1.status !== value2.status) return false;
2673
+ if (value1.notes !== value2.notes) return false;
2674
+ if (!areFileAndPromiseArraysEqual(value1.files, value2.files)) return false;
2675
+ return true;
2676
+ };
2677
+ const _PassFailField = class _PassFailField extends BaseField {
2678
+ constructor(options) {
2679
+ const { showNotesAndFilesOn, ...rest } = options;
2680
+ super(rest);
2681
+ __publicField(this, "type", "pass-fail");
2682
+ __publicField(this, "onlyValidateAfterTouched", false);
2683
+ __publicField(this, "showNotesAndFilesOn");
2684
+ this.showNotesAndFilesOn = showNotesAndFilesOn;
2685
+ }
2686
+ static getFieldCreationSchema(parentPath = "") {
2687
+ const path = parentPath && `${parentPath}.`;
2688
+ return [
2689
+ {
2690
+ field: new MultiSelectField({
2691
+ identifier: `${path}showNotesAndFilesOn`,
2692
+ label: "Show notes and files on",
2693
+ description: "Show the notes and files on desired statuses.",
2694
+ options: passFailFieldStatuses.map((status) => {
2695
+ const { label } = passFailFieldStatusMapping[status];
2696
+ return {
2697
+ value: status,
2698
+ label
2699
+ };
2700
+ }),
2701
+ required: false
2702
+ }),
2703
+ showDirectly: false
2704
+ }
2705
+ ];
2706
+ }
2707
+ serialize() {
2708
+ return {
2709
+ ...super.serialize(),
2710
+ showNotesAndFilesOn: this.showNotesAndFilesOn
2711
+ };
2712
+ }
2713
+ getOptions() {
2714
+ return {
2715
+ ...super.getOptions(),
2716
+ showNotesAndFilesOn: this.showNotesAndFilesOn
2717
+ };
2718
+ }
2719
+ duplicate(identifier) {
2720
+ return new _PassFailField({
2721
+ ...this.getOptions(),
2722
+ identifier
2723
+ });
2724
+ }
2725
+ setOptions(options) {
2726
+ const { showNotesAndFilesOn, ...rest } = options;
2727
+ this.showNotesAndFilesOn = showNotesAndFilesOn ?? this.showNotesAndFilesOn;
2728
+ super.setOptions(rest);
2729
+ }
2730
+ getFieldValidators() {
2731
+ const validators = super.getFieldValidators();
2732
+ const showNotesAndFileOn = this.showNotesAndFilesOn;
2733
+ const blankValue = this.blankValue();
2734
+ if (showNotesAndFileOn.length > 0) {
2735
+ validators.push((value) => {
2736
+ if (!value.status || !showNotesAndFileOn.includes(value.status)) return;
2737
+ if (blankValue.notes === value.notes) {
2738
+ return "Notes is required.";
2739
+ }
2740
+ });
2741
+ validators.push((value) => {
2742
+ if (!value.status || !showNotesAndFileOn.includes(value.status)) return;
2743
+ if (areFileAndPromiseArraysEqual(blankValue.files, value.files)) {
2744
+ return "Files is required.";
2745
+ }
2746
+ });
2747
+ }
2748
+ return validators;
2749
+ }
2750
+ static deserialize(data) {
2751
+ return new _PassFailField({
2752
+ ...data,
2753
+ showNotesAndFilesOn: data.showNotesAndFilesOn ?? false
2754
+ });
2755
+ }
2756
+ serializeValue(value) {
2757
+ return serializePassFailFieldValue(value);
2758
+ }
2759
+ deserializeValue(value) {
2760
+ return deserializePassFailFieldValue(value);
2761
+ }
2762
+ render(props) {
2763
+ return /* @__PURE__ */ jsx(PassFailInput, { field: this, ...props });
2764
+ }
2765
+ isSerializedValueValid(value) {
2766
+ return isSerializedPassFailFieldValue(value);
2767
+ }
2768
+ isValueValid(value) {
2769
+ return isPassFailFieldValue(value);
2770
+ }
2771
+ areValuesEqual(value1, value2) {
2772
+ return arePassFieldValuesEqual(value1, value2);
2773
+ }
2774
+ blankValue() {
2775
+ return {
2776
+ status: null,
2777
+ notes: "",
2778
+ files: []
2779
+ };
2780
+ }
2781
+ cleanValue(value) {
2782
+ if (value.status && this.showNotesAndFilesOn.includes(value.status)) {
2783
+ return value;
2784
+ } else {
2785
+ return {
2786
+ status: value.status,
2787
+ notes: "",
2788
+ files: []
2789
+ };
2790
+ }
2791
+ }
2792
+ };
2793
+ __publicField(_PassFailField, "fieldTypeName", "Pass - Fail");
2794
+ __publicField(_PassFailField, "fieldTypeDescription", "Track pass, fail, or N/A outcome.");
2795
+ let PassFailField = _PassFailField;
1657
2796
  const RadioInput = memo((props) => {
1658
- const [{ inputId, labelId, size, severity, showInputOnly, field, helpText, label, fieldProps }, rest] = useFormikInput(props);
2797
+ const [{ inputId, labelId, size, severity, showInputOnly, field, helpText, label, fieldProps }, { disabled }] = useFormikInput(props);
1659
2798
  const { name, onChange, onBlur, value } = fieldProps;
1660
2799
  const computedHelpText = showInputOnly ? null : helpText;
1661
2800
  const computedLabel = showInputOnly ? "" : label;
@@ -1690,10 +2829,10 @@ const RadioInput = memo((props) => {
1690
2829
  size: "sm",
1691
2830
  value: value ?? "",
1692
2831
  onValueChange: handleChange,
1693
- ...rest,
2832
+ disabled,
1694
2833
  children: [
1695
2834
  field.options.map((option, index) => /* @__PURE__ */ jsxs("label", { className: "flex gap-2 items-center min-w-0", children: [
1696
- /* @__PURE__ */ jsx(RadioGroup.Item, { value: option.value, children: /* @__PURE__ */ jsx(RadioGroup.Indicator, { children: /* @__PURE__ */ jsx(LuIcon, { icon: "chevron-down", className: "fill-current" }) }) }),
2835
+ /* @__PURE__ */ jsx(RadioGroup.Item, { value: option.value, children: /* @__PURE__ */ jsx(RadioGroup.Indicator, { children: /* @__PURE__ */ jsx(LuIcon, { icon: Circle, className: "fill-current" }) }) }),
1697
2836
  /* @__PURE__ */ jsx(Text, { size: "sm", accentColor: "base", className: "truncate", children: option.label })
1698
2837
  ] }, `${inputId}-${option.value}-${index}`)),
1699
2838
  !!value && /* @__PURE__ */ jsxs(
@@ -1706,7 +2845,7 @@ const RadioInput = memo((props) => {
1706
2845
  accentColor: "base",
1707
2846
  size: "sm",
1708
2847
  children: [
1709
- /* @__PURE__ */ jsx(LuIcon, { icon: "x" }),
2848
+ /* @__PURE__ */ jsx(LuIcon, { icon: X }),
1710
2849
  "Clear"
1711
2850
  ]
1712
2851
  }
@@ -1767,6 +2906,149 @@ const _RadioField = class _RadioField extends BaseOptionsField {
1767
2906
  __publicField(_RadioField, "fieldTypeName", "Option list");
1768
2907
  __publicField(_RadioField, "fieldTypeDescription", "Allows the user to select a single option from a list of options.");
1769
2908
  let RadioField = _RadioField;
2909
+ const RatingInput = memo((props) => {
2910
+ const [{ inputId, labelId, size, severity, showInputOnly, field, helpText, label, fieldProps }, { disabled }] = useFormikInput(props);
2911
+ const { name, onChange, onBlur, value } = fieldProps;
2912
+ const computedHelpText = showInputOnly ? null : helpText;
2913
+ const computedLabel = showInputOnly ? "" : label;
2914
+ const handleChange = useCallback(
2915
+ (value2) => {
2916
+ onChange(value2);
2917
+ onBlur(value2);
2918
+ },
2919
+ [onBlur, onChange]
2920
+ );
2921
+ const handleClear = useCallback(() => {
2922
+ onChange(null);
2923
+ onBlur(null);
2924
+ }, [onBlur, onChange]);
2925
+ const ratingOptions = Array.from({ length: field.maxRating }, (_, i) => i + 1);
2926
+ return /* @__PURE__ */ jsx(InputWithLabelAndHelpText, { helpText: computedHelpText, severity, children: /* @__PURE__ */ jsx(
2927
+ InputWithLabel,
2928
+ {
2929
+ size,
2930
+ severity,
2931
+ inputId,
2932
+ labelId,
2933
+ label: computedLabel,
2934
+ image: showInputOnly ? void 0 : field.image,
2935
+ children: /* @__PURE__ */ jsxs("div", { className: "flex flex-row gap-1 items-center", children: [
2936
+ /* @__PURE__ */ jsx(
2937
+ Rating.Root,
2938
+ {
2939
+ id: inputId,
2940
+ name,
2941
+ className: "flex items-center gap-0.5",
2942
+ value,
2943
+ onValueChange: handleChange,
2944
+ disabled,
2945
+ children: ratingOptions.map((rating) => /* @__PURE__ */ jsx(
2946
+ Rating.Item,
2947
+ {
2948
+ value: rating,
2949
+ className: "group size-7 flex cursor-pointer disabled:opacity-50 disabled:pointer-events-none items-center justify-center text-yellow-500 transition-colors",
2950
+ children: /* @__PURE__ */ jsx(LuIcon, { icon: Star, className: "group-data-[active=true]:fill-current size-full" })
2951
+ },
2952
+ `${inputId}-${rating}`
2953
+ ))
2954
+ }
2955
+ ),
2956
+ !disabled && value !== null && /* @__PURE__ */ jsx(IconButton, { onClick: handleClear, type: "button", variant: "ghost", accentColor: "base", size: "sm", children: /* @__PURE__ */ jsx(LuIcon, { icon: X }) })
2957
+ ] })
2958
+ }
2959
+ ) });
2960
+ });
2961
+ RatingInput.displayName = "RatingInput";
2962
+ const _RatingField = class _RatingField extends BaseField {
2963
+ constructor(options) {
2964
+ const { maxRating, ...rest } = options;
2965
+ super(rest);
2966
+ __publicField(this, "type", "rating");
2967
+ __publicField(this, "maxRating");
2968
+ this.maxRating = maxRating;
2969
+ }
2970
+ static getFieldCreationSchema(parentPath = "") {
2971
+ const path = parentPath && `${parentPath}.`;
2972
+ return [
2973
+ {
2974
+ field: new NumberField({
2975
+ label: "Max Rating",
2976
+ description: "Maximum rating value",
2977
+ integers: true,
2978
+ required: false,
2979
+ minimum: 1,
2980
+ maximum: 10,
2981
+ identifier: `${path}maxRating`
2982
+ }),
2983
+ showDirectly: false
2984
+ }
2985
+ ];
2986
+ }
2987
+ getFieldValidators() {
2988
+ const validators = super.getFieldValidators();
2989
+ const max = this.maxRating;
2990
+ validators.push((value) => {
2991
+ if (typeof value === "number" && (value < 1 || value > max)) {
2992
+ return `Rating must be between 1 and ${max}.`;
2993
+ }
2994
+ });
2995
+ return validators;
2996
+ }
2997
+ serialize() {
2998
+ return {
2999
+ ...super.serialize(),
3000
+ maxRating: this.maxRating
3001
+ };
3002
+ }
3003
+ getOptions() {
3004
+ return {
3005
+ ...super.getOptions(),
3006
+ maxRating: this.maxRating
3007
+ };
3008
+ }
3009
+ duplicate(identifier) {
3010
+ return new _RatingField({
3011
+ ...this.getOptions(),
3012
+ identifier
3013
+ });
3014
+ }
3015
+ setOptions(options) {
3016
+ const { maxRating, ...rest } = options;
3017
+ this.maxRating = maxRating ?? this.maxRating;
3018
+ super.setOptions(rest);
3019
+ }
3020
+ static deserialize(data) {
3021
+ return new _RatingField(data);
3022
+ }
3023
+ serializeValue(value) {
3024
+ return value;
3025
+ }
3026
+ deserializeValue(value) {
3027
+ return value;
3028
+ }
3029
+ render(props) {
3030
+ return /* @__PURE__ */ jsx(RatingInput, { field: this, ...props });
3031
+ }
3032
+ isSerializedValueValid(value) {
3033
+ return typeof value === "number" || value === null;
3034
+ }
3035
+ isValueValid(value) {
3036
+ return typeof value === "number" || value === null;
3037
+ }
3038
+ areValuesEqual(value1, value2) {
3039
+ return value1 === value2;
3040
+ }
3041
+ blankValue() {
3042
+ return null;
3043
+ }
3044
+ };
3045
+ __publicField(_RatingField, "fieldTypeName", "Rating");
3046
+ __publicField(_RatingField, "fieldTypeDescription", "Allows users to select a rating value.");
3047
+ let RatingField = _RatingField;
3048
+ const ScannerContext = createContext(() => {
3049
+ throw new Error("No ScannerProvider found");
3050
+ });
3051
+ const useScanner = () => use(ScannerContext);
1770
3052
  function fixProto(target, prototype) {
1771
3053
  var setPrototypeOf = Object.setPrototypeOf;
1772
3054
  setPrototypeOf ? setPrototypeOf(target, prototype) : target.__proto__ = prototype;
@@ -29901,15 +31183,38 @@ const ScannerInternal = memo((props) => {
29901
31183
  hints: SCANNER_HINTS
29902
31184
  });
29903
31185
  return /* @__PURE__ */ jsxs("div", { className: "flex size-full flex-col justify-center overflow-hidden bg-(--color-background)", children: [
29904
- /* @__PURE__ */ jsx("div", { className: "flex w-full justify-end p-4", children: /* @__PURE__ */ jsx(Overlay.Close, { asChild: true, children: /* @__PURE__ */ jsx(IconButton, { "aria-label": "close", variant: "soft", accentColor: "base", children: /* @__PURE__ */ jsx(LuIcon, { icon: "x" }) }) }) }),
31186
+ /* @__PURE__ */ jsx("div", { className: "flex w-full justify-end p-4", children: /* @__PURE__ */ jsx(Overlay.Close, { asChild: true, children: /* @__PURE__ */ jsx(IconButton, { "aria-label": "close", variant: "soft", accentColor: "base", children: /* @__PURE__ */ jsx(LuIcon, { icon: X }) }) }) }),
29905
31187
  /* @__PURE__ */ jsx("div", { className: "grow w-full max-h-full overflow-hidden p-4", children: /* @__PURE__ */ jsx("video", { className: "size-full", ref }) })
29906
31188
  ] });
29907
31189
  });
29908
31190
  ScannerInternal.displayName = "ScannerInternal";
31191
+ const ScannerProvider = memo((props) => {
31192
+ const { children } = props;
31193
+ const [config, setConfig] = useState(null);
31194
+ const closeFileViewer = useCallback(() => {
31195
+ setConfig(null);
31196
+ }, []);
31197
+ const openFileViewer = useCallback(
31198
+ (func) => {
31199
+ setConfig(func(closeFileViewer));
31200
+ },
31201
+ [closeFileViewer]
31202
+ );
31203
+ const handleClose = useCallback(() => {
31204
+ if (!config) return;
31205
+ if (config.onClose) config.onClose();
31206
+ closeFileViewer();
31207
+ }, [closeFileViewer, config]);
31208
+ return /* @__PURE__ */ jsxs(ScannerContext.Provider, { value: openFileViewer, children: [
31209
+ children,
31210
+ config && /* @__PURE__ */ jsx(Scanner, { open: true, onOpenChange: handleClose, ...config })
31211
+ ] });
31212
+ });
31213
+ ScannerProvider.displayName = "FileViewerProvider";
29909
31214
  const ScanInput = memo((props) => {
29910
31215
  const [
29911
31216
  { inputId, labelId, label, helpText, size, severity, showInputOnly, field, fieldProps, helpers, touched },
29912
- rest
31217
+ { disabled }
29913
31218
  ] = useFormikInput(props);
29914
31219
  const { name, onBlur, onChange, value } = fieldProps;
29915
31220
  const [showScanner, setShowScanner] = useState(false);
@@ -29971,7 +31276,7 @@ const ScanInput = memo((props) => {
29971
31276
  placeholder: "Enter a qr or barcode",
29972
31277
  onChange: handleChange,
29973
31278
  onBlur: handleBlur,
29974
- ...rest
31279
+ disabled
29975
31280
  }
29976
31281
  ),
29977
31282
  /* @__PURE__ */ jsxs(
@@ -29983,8 +31288,9 @@ const ScanInput = memo((props) => {
29983
31288
  variant: "soft",
29984
31289
  size: "sm",
29985
31290
  accentColor: "base",
31291
+ disabled,
29986
31292
  children: [
29987
- /* @__PURE__ */ jsx(LuIcon, { icon: "maximize" }),
31293
+ /* @__PURE__ */ jsx(LuIcon, { icon: Maximize }),
29988
31294
  "Scan"
29989
31295
  ]
29990
31296
  }
@@ -30048,7 +31354,7 @@ const SHORT_TEXT_FIELD_MAX_LENGTH = 500;
30048
31354
  const StringInput = memo((props) => {
30049
31355
  const [
30050
31356
  { inputId, labelId, size, severity, showInputOnly, field, helpText, label, fieldProps, touched, helpers },
30051
- rest
31357
+ { disabled }
30052
31358
  ] = useFormikInput(props);
30053
31359
  const { name, onBlur, onChange, value } = fieldProps;
30054
31360
  const computedHelpText = showInputOnly ? null : helpText;
@@ -30091,7 +31397,7 @@ const StringInput = memo((props) => {
30091
31397
  placeholder: field.placeholder,
30092
31398
  onChange: handleChange,
30093
31399
  onBlur: handleBlur,
30094
- ...rest
31400
+ disabled
30095
31401
  }
30096
31402
  ) })
30097
31403
  }
@@ -30122,7 +31428,6 @@ const _StringField = class _StringField extends BaseStringField {
30122
31428
  super.setOptions(options);
30123
31429
  }
30124
31430
  static deserialize(data) {
30125
- if (data.type !== "string") throw new Error("Type mismatch.");
30126
31431
  const { maximum_length, minimum_length, ...rest } = data;
30127
31432
  return new _StringField({
30128
31433
  ...rest,
@@ -30141,7 +31446,7 @@ let StringField = _StringField;
30141
31446
  const TextInput = memo((props) => {
30142
31447
  const [
30143
31448
  { inputId, labelId, size, severity, showInputOnly, field, helpText, label, fieldProps, touched, helpers },
30144
- rest
31449
+ { disabled }
30145
31450
  ] = useFormikInput(props);
30146
31451
  const { name, onBlur, onChange, value } = fieldProps;
30147
31452
  const computedHelpText = showInputOnly ? null : helpText;
@@ -30187,7 +31492,7 @@ const TextInput = memo((props) => {
30187
31492
  accentColor: "base",
30188
31493
  variant: "surface",
30189
31494
  size: "sm",
30190
- ...rest
31495
+ disabled
30191
31496
  }
30192
31497
  )
30193
31498
  }
@@ -30232,110 +31537,9 @@ const _TextField = class _TextField extends BaseStringField {
30232
31537
  __publicField(_TextField, "fieldTypeName", "Paragraph");
30233
31538
  __publicField(_TextField, "fieldTypeDescription", `Paragraph fields can hold up to ${LONG_TEXT_FIELD_MAX_LENGTH} characters and can have multiple lines.`);
30234
31539
  let TextField = _TextField;
30235
- const ImageCard = memo(
30236
- forwardRef((props, forwardedRef) => {
30237
- const { file, alt, error, rightSlot, className, ...rest } = props;
30238
- return /* @__PURE__ */ jsxs(
30239
- Card,
30240
- {
30241
- className: cx(className, "relative flex h-[200px] w-full flex-col gap-2 overflow-hidden items-center"),
30242
- ref: forwardedRef,
30243
- ...rest,
30244
- children: [
30245
- !file && !error && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 grow flex items-center justify-center", children: /* @__PURE__ */ jsx(Spinner, {}) }),
30246
- !!file && !error && /* @__PURE__ */ jsx(Card, { className: "flex max-w-full grow items-center !p-0 justify-center overflow-hidden bg-clip-padding", children: /* @__PURE__ */ jsx(
30247
- "img",
30248
- {
30249
- className: "max-w-full object-cover",
30250
- src: URL.createObjectURL(file),
30251
- alt: alt ?? file.name
30252
- }
30253
- ) }),
30254
- (!!file || !!error) && /* @__PURE__ */ jsxs(
30255
- "div",
30256
- {
30257
- className: cx("flex w-full items-center gap-2 self-end", {
30258
- "bg-transparent": !file
30259
- }),
30260
- children: [
30261
- error ? /* @__PURE__ */ jsx(LuIcon, { icon: "file-warning" }) : file && /* @__PURE__ */ jsx(LuIcon, { icon: "file" }),
30262
- /* @__PURE__ */ jsx(Text, { className: "truncate", size: "sm", children: error ?? (file == null ? void 0 : file.name) }),
30263
- rightSlot
30264
- ]
30265
- }
30266
- )
30267
- ]
30268
- }
30269
- );
30270
- })
30271
- );
30272
- class UUIDPromise extends Promise {
30273
- constructor(executor, uuid) {
30274
- super(executor);
30275
- __publicField(this, "_uuid");
30276
- this._uuid = uuid;
30277
- }
30278
- get uuid() {
30279
- return this._uuid;
30280
- }
30281
- set uuid(uuid) {
30282
- this._uuid = uuid;
30283
- }
30284
- static from(promise, uuid) {
30285
- return new UUIDPromise((resolve, reject) => {
30286
- Promise.resolve(promise).then(resolve).catch(reject);
30287
- }, uuid);
30288
- }
30289
- then(onFulfilled, onRejected) {
30290
- const promise = super.then(onFulfilled, onRejected);
30291
- promise.uuid = this.uuid;
30292
- return promise;
30293
- }
30294
- catch(onRejected) {
30295
- const promise = super.catch(onRejected);
30296
- promise.uuid = this.uuid;
30297
- return promise;
30298
- }
30299
- finally(onFinally) {
30300
- const promise = super.finally(onFinally);
30301
- promise.uuid = this.uuid;
30302
- return promise;
30303
- }
30304
- }
30305
- const convertBytesToLargestUnit = (bytes) => {
30306
- const units = ["byte", "kilobyte", "megabyte"];
30307
- let sizeInUnit = bytes;
30308
- let unitIndex = 0;
30309
- while (sizeInUnit > 1e3 && unitIndex < units.length - 1) {
30310
- sizeInUnit /= 1e3;
30311
- unitIndex++;
30312
- }
30313
- const formatter = new Intl.NumberFormat([], {
30314
- // 0 for bytes and kilobytes, 1 for megabytes
30315
- maximumFractionDigits: Math.max(0, unitIndex - 1),
30316
- style: "unit",
30317
- unit: units[unitIndex]
30318
- });
30319
- return formatter.format(sizeInUnit);
30320
- };
30321
- function areFilesEqual(file1, file2) {
30322
- return file1.name === file2.name && file1.size === file2.size && file1.type === file2.type;
30323
- }
30324
- function separateFilesFromPromises(filesOrPromises) {
30325
- const files = [];
30326
- const promises = [];
30327
- for (const fileOrPromise of filesOrPromises) {
30328
- if (fileOrPromise instanceof UUIDPromise) {
30329
- promises.push(fileOrPromise);
30330
- } else {
30331
- files.push(fileOrPromise);
30332
- }
30333
- }
30334
- return [files, promises];
30335
- }
30336
31540
  const UploadInput = memo((props) => {
30337
31541
  var _a2;
30338
- const [{ inputId, labelId, label, size, severity, helpText, showInputOnly, field, fieldProps }, rest] = useFormikInput(props);
31542
+ const [{ inputId, labelId, label, size, severity, helpText, showInputOnly, field, fieldProps }, { disabled }] = useFormikInput(props);
30339
31543
  const { value, name, onChange, onBlur } = fieldProps;
30340
31544
  const input = useRef(null);
30341
31545
  const updatedHelpText = useMemo(() => {
@@ -30357,7 +31561,7 @@ const UploadInput = memo((props) => {
30357
31561
  onBlur([]);
30358
31562
  return;
30359
31563
  }
30360
- const fileArray = Array.from(files);
31564
+ const fileArray = Array.from(files).map((file) => UUIDFile.from(v4(), file));
30361
31565
  const newValue = [...value, ...fileArray];
30362
31566
  onChange(newValue);
30363
31567
  onBlur(newValue);
@@ -30409,11 +31613,10 @@ const UploadInput = memo((props) => {
30409
31613
  variant: "soft",
30410
31614
  accentColor: "base",
30411
31615
  onClick: handleClick,
30412
- id: "upload-input-upload-button",
30413
31616
  type: "button",
30414
- ...rest,
31617
+ disabled,
30415
31618
  children: [
30416
- /* @__PURE__ */ jsx(LuIcon, { icon: "upload" }),
31619
+ /* @__PURE__ */ jsx(LuIcon, { icon: Upload }),
30417
31620
  buttonText
30418
31621
  ]
30419
31622
  }
@@ -30438,105 +31641,17 @@ const UploadInput = memo((props) => {
30438
31641
  Array.isArray(value) && value.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex h-max flex-col gap-2", children: value.map((file, index) => /* @__PURE__ */ jsx(
30439
31642
  DisplayFile,
30440
31643
  {
30441
- field,
30442
31644
  file,
30443
31645
  onRemove: () => {
30444
31646
  handleRemove(index);
30445
31647
  },
30446
- disabled: rest.disabled
31648
+ disabled
30447
31649
  },
30448
31650
  index
30449
31651
  )) })
30450
31652
  ] });
30451
31653
  });
30452
31654
  UploadInput.displayName = "UploadInput";
30453
- const DisplayFile = memo((props) => {
30454
- const { file, field, onRemove, disabled } = props;
30455
- const [resolvedFile, setResolvedFile] = useState(null);
30456
- const openImageViewer = useImageViewer();
30457
- const error = useMemo(() => resolvedFile && field.getError([resolvedFile]), [field, resolvedFile]);
30458
- const { url, name } = useMemo(() => {
30459
- let url2 = null;
30460
- let name2;
30461
- let size;
30462
- if (resolvedFile == null ? void 0 : resolvedFile.type.startsWith("image/")) {
30463
- url2 = URL.createObjectURL(resolvedFile);
30464
- }
30465
- if (resolvedFile) {
30466
- name2 = resolvedFile.name;
30467
- size = convertBytesToLargestUnit(resolvedFile.size);
30468
- } else {
30469
- name2 = "Downloading...";
30470
- size = "...";
30471
- }
30472
- return { url: url2, name: name2, size };
30473
- }, [resolvedFile]);
30474
- useEffect(() => {
30475
- if (file instanceof UUIDPromise) {
30476
- file.then((file2) => {
30477
- console.debug("file", file2);
30478
- setResolvedFile(file2);
30479
- }).catch(console.error);
30480
- } else {
30481
- setResolvedFile(file);
30482
- }
30483
- }, [file]);
30484
- const handleDownload = useCallback(
30485
- (event) => {
30486
- event.stopPropagation();
30487
- if (!resolvedFile) {
30488
- throw new Error("Cannot download a file that is not resolved.");
30489
- }
30490
- const blob = new Blob([resolvedFile]);
30491
- saveAs(blob, name);
30492
- },
30493
- [name, resolvedFile]
30494
- );
30495
- const handleDelete = useCallback(
30496
- (e) => {
30497
- e.stopPropagation();
30498
- onRemove();
30499
- },
30500
- [onRemove]
30501
- );
30502
- const handleImageCardClick = useCallback(() => {
30503
- if (!resolvedFile) return;
30504
- openImageViewer((closeFileViewer) => ({
30505
- file: resolvedFile,
30506
- onDelete: !disabled ? () => {
30507
- onRemove();
30508
- closeFileViewer();
30509
- } : void 0
30510
- }));
30511
- }, [disabled, onRemove, openImageViewer, resolvedFile]);
30512
- const rightSlotContent = useMemo(
30513
- () => /* @__PURE__ */ jsxs(ButtonGroup, { className: "flex grow justify-end", variant: "ghost", accentColor: "base", size: "sm", children: [
30514
- /* @__PURE__ */ jsx(
30515
- IconButton,
30516
- {
30517
- "aria-label": `Download ${name}`,
30518
- type: "button",
30519
- onClick: handleDownload,
30520
- disabled: !resolvedFile,
30521
- children: /* @__PURE__ */ jsx(LuIcon, { icon: "download" })
30522
- }
30523
- ),
30524
- !disabled && /* @__PURE__ */ jsx(IconButton, { type: "button", "aria-label": `Remove ${name}`, disabled, onClick: handleDelete, children: /* @__PURE__ */ jsx(LuIcon, { icon: "trash" }) })
30525
- ] }),
30526
- [disabled, handleDelete, handleDownload, name, resolvedFile]
30527
- );
30528
- return url ? /* @__PURE__ */ jsx(
30529
- ImageCard,
30530
- {
30531
- className: "cursor-pointer",
30532
- onClick: handleImageCardClick,
30533
- file: resolvedFile,
30534
- error: error ?? void 0,
30535
- rightSlot: rightSlotContent
30536
- }
30537
- ) : /* @__PURE__ */ jsx(FileCard, { file: resolvedFile, error: error ?? void 0, rightSlot: rightSlotContent });
30538
- });
30539
- DisplayFile.displayName = "DisplayFile";
30540
31655
  const _UploadField = class _UploadField extends BaseField {
30541
31656
  constructor(options) {
30542
31657
  const { extensions, maximum_files, maximum_size, ...base } = options;
@@ -30616,7 +31731,7 @@ const _UploadField = class _UploadField extends BaseField {
30616
31731
  const maxFileSizeInB = maxFileSizeInMB * 1e3 * 1e3;
30617
31732
  const maxFiles = this.maxFiles || 1;
30618
31733
  validators.push((value) => {
30619
- if (value && value.some((file) => file instanceof File && file.size > maxFileSizeInB)) {
31734
+ if (value && value.some((file) => file instanceof UUIDFile && file.size > maxFileSizeInB)) {
30620
31735
  return `Files must be at most ${maxFileSizeInMB}MB.`;
30621
31736
  }
30622
31737
  });
@@ -30673,16 +31788,10 @@ const _UploadField = class _UploadField extends BaseField {
30673
31788
  }
30674
31789
  isValueValid(value) {
30675
31790
  if (!Array.isArray(value)) return false;
30676
- return value.every((item) => item instanceof UUIDPromise || item instanceof File);
31791
+ return value.every((item) => item instanceof UUIDPromise || item instanceof UUIDFile);
30677
31792
  }
30678
31793
  areValuesEqual(value1, value2) {
30679
- const [files1, promises1] = separateFilesFromPromises(value1);
30680
- const [files2, promises2] = separateFilesFromPromises(value2);
30681
- if (!files1.every((file1) => files2.some((file2) => areFilesEqual(file1, file2)))) return false;
30682
- if (!files2.every((file2) => files1.some((file1) => areFilesEqual(file1, file2)))) return false;
30683
- if (!promises1.every((promise1) => promises2.some((promise2) => promise1.uuid === promise2.uuid))) return false;
30684
- if (!promises2.every((promise2) => promises1.some((promise1) => promise1.uuid === promise2.uuid))) return false;
30685
- return true;
31794
+ return areFileAndPromiseArraysEqual(value1, value2);
30686
31795
  }
30687
31796
  blankValue() {
30688
31797
  return [];
@@ -30704,23 +31813,27 @@ const FieldTypeToClsMapping = {
30704
31813
  "multi-select": MultiSelectField,
30705
31814
  radio: RadioField,
30706
31815
  "checkbox-list": CheckboxListField,
30707
- otp: OTPField
31816
+ "pass-fail": PassFailField,
31817
+ otp: OTPField,
31818
+ rating: RatingField
30708
31819
  };
30709
31820
  const fieldIcons = {
30710
- boolean: "square-check",
30711
- date: "calendar",
30712
- "multi-string": "list",
30713
- number: "hash",
30714
- qr: "scan",
30715
- "multi-select": "list-checks",
30716
- select: "list-todo",
30717
- string: "text-cursor-input",
30718
- text: "align-justify",
30719
- upload: "upload",
30720
- section: "layout-panel-top",
30721
- radio: "circle-dot",
30722
- "checkbox-list": "copy-check",
30723
- otp: "rectangle-ellipsis"
31821
+ boolean: SquareCheck,
31822
+ date: Calendar,
31823
+ "multi-string": List,
31824
+ number: Hash,
31825
+ qr: Scan,
31826
+ "multi-select": ListChecks,
31827
+ select: ListTodo,
31828
+ string: TextCursorInput,
31829
+ text: AlignJustify,
31830
+ upload: Upload,
31831
+ section: LayoutPanelTop,
31832
+ radio: CircleDot,
31833
+ "checkbox-list": CopyCheck,
31834
+ "pass-fail": ClipboardList,
31835
+ otp: RectangleEllipsis,
31836
+ rating: Star
30724
31837
  };
30725
31838
  const maxFileSizeMB = 50;
30726
31839
  const maxFileSizeKB = maxFileSizeMB * 1e3;
@@ -30927,6 +32040,42 @@ const NumberRangeNotInConditionModifier = ConditionModifier.create({
30927
32040
  serialize: (filterValue) => filterValue,
30928
32041
  deserialize: (filterValue) => filterValue
30929
32042
  });
32043
+ const PassFailEqualsConditionModifier = ConditionModifier.create({
32044
+ id: "pass-fail-equals",
32045
+ modifierFn: (value, filterValue) => {
32046
+ return value === filterValue;
32047
+ },
32048
+ label: "is",
32049
+ serialize: (filterValue) => filterValue,
32050
+ deserialize: (filterValue) => filterValue
32051
+ });
32052
+ const PassFailNotEqualsConditionModifier = ConditionModifier.create({
32053
+ id: "pass-fail-not-equals",
32054
+ modifierFn: (value, filterValue) => {
32055
+ return value !== filterValue;
32056
+ },
32057
+ label: "is not",
32058
+ serialize: (filterValue) => filterValue,
32059
+ deserialize: (filterValue) => filterValue
32060
+ });
32061
+ const PassFailArrayIncludesConditionModifier = ConditionModifier.create({
32062
+ id: "pass-fail-array-includes",
32063
+ modifierFn: (value, filterValue) => {
32064
+ return filterValue.includes(value);
32065
+ },
32066
+ label: "is any of",
32067
+ serialize: (filterValue) => filterValue,
32068
+ deserialize: (filterValue) => filterValue
32069
+ });
32070
+ const PassFailArrayExcludesConditionModifier = ConditionModifier.create({
32071
+ id: "pass-fail-array-excludes",
32072
+ modifierFn: (value, filterValue) => {
32073
+ return !filterValue.includes(value);
32074
+ },
32075
+ label: "is none of",
32076
+ serialize: (filterValue) => filterValue,
32077
+ deserialize: (filterValue) => filterValue
32078
+ });
30930
32079
  const StringEqualsConditionModifier = ConditionModifier.create({
30931
32080
  id: "nullable-string-equals",
30932
32081
  modifierFn: (value, filterValue) => {
@@ -31066,9 +32215,11 @@ class BaseCondition extends Observable {
31066
32215
  __publicField(this, "apply", (value) => {
31067
32216
  const modifier = this.modifiers[this.conditionModifier];
31068
32217
  const conditionValue = this.getConditionValue();
31069
- if (conditionValue === void 0 || !modifier.isConditionValueValid(conditionValue)) return true;
31070
- if (!modifier.isValueValid(value)) return false;
31071
- return modifier.modifier.modifierFn(value, conditionValue);
32218
+ if (conditionValue == void 0) return true;
32219
+ if (!modifier.isConditionValueValid(conditionValue)) return true;
32220
+ const transformedValue = this.transformValue(value);
32221
+ if (!modifier.isValueValid(transformedValue)) return false;
32222
+ return modifier.modifier.modifierFn(transformedValue, conditionValue);
31072
32223
  });
31073
32224
  this.id = id;
31074
32225
  this.field = field;
@@ -31084,6 +32235,9 @@ class BaseCondition extends Observable {
31084
32235
  conditionModifier: this.conditionModifier
31085
32236
  };
31086
32237
  }
32238
+ transformValue(value) {
32239
+ return value;
32240
+ }
31087
32241
  }
31088
32242
  const formId = "form-builder";
31089
32243
  const UNLABELLED_FIELD_LABEL = "Unlabelled";
@@ -31096,12 +32250,12 @@ const SelectItemTemplate = genericMemo(function(props) {
31096
32250
  if (typeof children === "function") {
31097
32251
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [
31098
32252
  children(meta),
31099
- /* @__PURE__ */ jsx(Menu.SelectedIndicator, { className: "ml-[auto]", children: /* @__PURE__ */ jsx(LuIcon, { icon: "check" }) })
32253
+ /* @__PURE__ */ jsx(Menu.SelectedIndicator, { className: "ml-[auto]", children: /* @__PURE__ */ jsx(LuIcon, { icon: Check }) })
31100
32254
  ] });
31101
32255
  } else {
31102
32256
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [
31103
32257
  children,
31104
- /* @__PURE__ */ jsx(Menu.SelectedIndicator, { className: "ml-[auto]", children: /* @__PURE__ */ jsx(LuIcon, { icon: "check" }) })
32258
+ /* @__PURE__ */ jsx(Menu.SelectedIndicator, { className: "ml-[auto]", children: /* @__PURE__ */ jsx(LuIcon, { icon: Check }) })
31105
32259
  ] });
31106
32260
  }
31107
32261
  },
@@ -31116,12 +32270,12 @@ const MultiSelectItemTemplate = genericMemo(function(props) {
31116
32270
  if (typeof children === "function") {
31117
32271
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [
31118
32272
  children(meta),
31119
- /* @__PURE__ */ jsx(Menu.SelectedIndicator, { className: "ml-auto", children: /* @__PURE__ */ jsx(LuIcon, { icon: "check" }) })
32273
+ /* @__PURE__ */ jsx(Menu.SelectedIndicator, { className: "ml-auto", children: /* @__PURE__ */ jsx(LuIcon, { icon: Check }) })
31120
32274
  ] });
31121
32275
  } else {
31122
32276
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [
31123
32277
  children,
31124
- /* @__PURE__ */ jsx(Menu.SelectedIndicator, { className: "ml-auto", children: /* @__PURE__ */ jsx(LuIcon, { icon: "check" }) })
32278
+ /* @__PURE__ */ jsx(Menu.SelectedIndicator, { className: "ml-auto", children: /* @__PURE__ */ jsx(LuIcon, { icon: Check }) })
31125
32279
  ] });
31126
32280
  }
31127
32281
  },
@@ -31136,12 +32290,12 @@ const SelectAllItemTemplate = memo((props) => {
31136
32290
  if (typeof children === "function") {
31137
32291
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [
31138
32292
  children(meta),
31139
- /* @__PURE__ */ jsx(Menu.CheckboxItemIndicator, { className: "ml-[auto]", children: (indeterminate) => indeterminate ? /* @__PURE__ */ jsx(LuIcon, { icon: "minus" }) : /* @__PURE__ */ jsx(LuIcon, { icon: "check" }) })
32293
+ /* @__PURE__ */ jsx(Menu.CheckboxItemIndicator, { className: "ml-[auto]", children: (indeterminate) => indeterminate ? /* @__PURE__ */ jsx(LuIcon, { icon: Minus }) : /* @__PURE__ */ jsx(LuIcon, { icon: Check }) })
31140
32294
  ] });
31141
32295
  } else {
31142
32296
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [
31143
32297
  children,
31144
- /* @__PURE__ */ jsx(Menu.CheckboxItemIndicator, { className: "ml-[auto]", children: (indeterminate) => indeterminate ? /* @__PURE__ */ jsx(LuIcon, { icon: "minus" }) : /* @__PURE__ */ jsx(LuIcon, { icon: "check" }) })
32298
+ /* @__PURE__ */ jsx(Menu.CheckboxItemIndicator, { className: "ml-[auto]", children: (indeterminate) => indeterminate ? /* @__PURE__ */ jsx(LuIcon, { icon: Minus }) : /* @__PURE__ */ jsx(LuIcon, { icon: Check }) })
31145
32299
  ] });
31146
32300
  }
31147
32301
  },
@@ -31235,7 +32389,7 @@ const MultiStringPopover = memo((props) => {
31235
32389
  variant: "soft",
31236
32390
  type: "button",
31237
32391
  onClick: handleAddValueClick,
31238
- children: /* @__PURE__ */ jsx(LuIcon, { icon: "plus" })
32392
+ children: /* @__PURE__ */ jsx(LuIcon, { icon: Plus })
31239
32393
  }
31240
32394
  )
31241
32395
  ] }),
@@ -31258,7 +32412,7 @@ const MultiStringPopover = memo((props) => {
31258
32412
  onClick: () => {
31259
32413
  handleRemoveValueClick(index);
31260
32414
  },
31261
- children: /* @__PURE__ */ jsx(LuIcon, { icon: "x" })
32415
+ children: /* @__PURE__ */ jsx(LuIcon, { icon: X })
31262
32416
  }
31263
32417
  )
31264
32418
  ]
@@ -31318,7 +32472,7 @@ const RemoveConditionButton = (props) => {
31318
32472
  const handleRemoveFilter = useCallback(() => {
31319
32473
  onClick(condition);
31320
32474
  }, [condition, onClick]);
31321
- return /* @__PURE__ */ jsx(IconButton, { onClick: handleRemoveFilter, ...rest, children: /* @__PURE__ */ jsx(LuIcon, { icon: "x" }) });
32475
+ return /* @__PURE__ */ jsx(IconButton, { onClick: handleRemoveFilter, ...rest, children: /* @__PURE__ */ jsx(LuIcon, { icon: X }) });
31322
32476
  };
31323
32477
  RemoveConditionButton.displayName = "RemoveConditionButton";
31324
32478
  const SelectFieldOptionMultiSelectGroup = memo((props) => {
@@ -31433,7 +32587,7 @@ const BooleanFieldConditionCell = (props) => {
31433
32587
  /* @__PURE__ */ jsx(RemoveConditionButton, { condition, onClick: onRemove })
31434
32588
  ] });
31435
32589
  };
31436
- const modifiers$c = {
32590
+ const modifiers$e = {
31437
32591
  equals: createConditionModifierConfig({
31438
32592
  modifier: BooleanEqualsConditionModifier,
31439
32593
  isValueValid: (_value) => true,
@@ -31450,13 +32604,11 @@ const modifiers$c = {
31450
32604
  class BooleanFieldCondition extends BaseCondition {
31451
32605
  constructor(options) {
31452
32606
  super(options);
31453
- __publicField(this, "defaultConditionModifier", "equals");
31454
- __publicField(this, "defaultConditionValue");
31455
- __publicField(this, "modifiers", modifiers$c);
32607
+ __publicField(this, "modifiers", modifiers$e);
31456
32608
  }
31457
32609
  static deserialize(serializedCondition, field) {
31458
32610
  const { conditionValue, conditionModifier, ...rest } = serializedCondition;
31459
- const modifierConfig = modifiers$c[conditionModifier];
32611
+ const modifierConfig = modifiers$e[conditionModifier];
31460
32612
  let deserializedValue = void 0;
31461
32613
  if (conditionValue !== void 0) {
31462
32614
  deserializedValue = modifierConfig.modifier.deserialize(conditionValue);
@@ -31512,7 +32664,7 @@ const CheckboxListFieldConditionCell = (props) => {
31512
32664
  /* @__PURE__ */ jsx(RemoveConditionButton, { condition, onClick: onRemove })
31513
32665
  ] });
31514
32666
  };
31515
- const modifiers$b = {
32667
+ const modifiers$d = {
31516
32668
  equals: createConditionModifierConfig({
31517
32669
  modifier: StringArrayEqualsConditionModifier,
31518
32670
  isValueValid: (_value) => true,
@@ -31547,13 +32699,11 @@ const modifiers$b = {
31547
32699
  class CheckboxListFieldCondition extends BaseCondition {
31548
32700
  constructor(options) {
31549
32701
  super(options);
31550
- __publicField(this, "defaultConditionModifier", "equals");
31551
- __publicField(this, "defaultConditionValue");
31552
- __publicField(this, "modifiers", modifiers$b);
32702
+ __publicField(this, "modifiers", modifiers$d);
31553
32703
  }
31554
32704
  static deserialize(serializedCondition, field) {
31555
32705
  const { conditionValue, conditionModifier, ...rest } = serializedCondition;
31556
- const modifierConfig = modifiers$b[conditionModifier];
32706
+ const modifierConfig = modifiers$d[conditionModifier];
31557
32707
  const deserializedValue = conditionValue !== void 0 && modifierConfig.isSerializedValueValid(conditionValue) ? modifierConfig.modifier.deserialize(conditionValue) : void 0;
31558
32708
  return new CheckboxListFieldCondition({ field, conditionModifier, conditionValue: deserializedValue, ...rest });
31559
32709
  }
@@ -31628,7 +32778,7 @@ const DateFieldConditionCell = (props) => {
31628
32778
  /* @__PURE__ */ jsx(RemoveConditionButton, { condition, onClick: onRemove })
31629
32779
  ] });
31630
32780
  };
31631
- const modifiers$a = {
32781
+ const modifiers$c = {
31632
32782
  equals: createConditionModifierConfig({
31633
32783
  modifier: DateEqualsConditionModifier,
31634
32784
  isValueValid: (value) => value instanceof Date,
@@ -31669,13 +32819,11 @@ const modifiers$a = {
31669
32819
  class DateFieldCondition extends BaseCondition {
31670
32820
  constructor(options) {
31671
32821
  super(options);
31672
- __publicField(this, "defaultConditionModifier", "equals");
31673
- __publicField(this, "defaultConditionValue");
31674
- __publicField(this, "modifiers", modifiers$a);
32822
+ __publicField(this, "modifiers", modifiers$c);
31675
32823
  }
31676
32824
  static deserialize(serializedCondition, field) {
31677
32825
  const { conditionValue, conditionModifier, ...rest } = serializedCondition;
31678
- const modifierConfig = modifiers$a[conditionModifier];
32826
+ const modifierConfig = modifiers$c[conditionModifier];
31679
32827
  const deserializedValue = conditionValue !== void 0 && modifierConfig.isSerializedValueValid(conditionValue) ? (
31680
32828
  // @ts-expect-error calling isSerializedValueValid means conditionValue is of appropriate type
31681
32829
  modifierConfig.modifier.deserialize(conditionValue)
@@ -31731,7 +32879,7 @@ const MultiSelectFieldConditionCell = (props) => {
31731
32879
  /* @__PURE__ */ jsx(RemoveConditionButton, { condition, onClick: onRemove })
31732
32880
  ] });
31733
32881
  };
31734
- const modifiers$9 = {
32882
+ const modifiers$b = {
31735
32883
  equals: createConditionModifierConfig({
31736
32884
  modifier: StringArrayEqualsConditionModifier,
31737
32885
  isValueValid: (_value) => true,
@@ -31766,13 +32914,11 @@ const modifiers$9 = {
31766
32914
  class MultiSelectFieldCondition extends BaseCondition {
31767
32915
  constructor(options) {
31768
32916
  super(options);
31769
- __publicField(this, "defaultConditionValue");
31770
- __publicField(this, "defaultConditionModifier", "equals");
31771
- __publicField(this, "modifiers", modifiers$9);
32917
+ __publicField(this, "modifiers", modifiers$b);
31772
32918
  }
31773
32919
  static deserialize(serializedCondition, field) {
31774
32920
  const { conditionValue, conditionModifier, ...rest } = serializedCondition;
31775
- const modifierConfig = modifiers$9[conditionModifier];
32921
+ const modifierConfig = modifiers$b[conditionModifier];
31776
32922
  const deserializedValue = conditionValue !== void 0 && modifierConfig.isSerializedValueValid(conditionValue) ? modifierConfig.modifier.deserialize(conditionValue) : void 0;
31777
32923
  return new MultiSelectFieldCondition({ field, conditionModifier, conditionValue: deserializedValue, ...rest });
31778
32924
  }
@@ -31816,7 +32962,7 @@ const MultiStringFieldConditionCell = (props) => {
31816
32962
  /* @__PURE__ */ jsx(RemoveConditionButton, { condition, onClick: onRemove })
31817
32963
  ] });
31818
32964
  };
31819
- const modifiers$8 = {
32965
+ const modifiers$a = {
31820
32966
  equals: createConditionModifierConfig({
31821
32967
  modifier: StringArrayEqualsConditionModifier,
31822
32968
  isValueValid: (_value) => true,
@@ -31851,13 +32997,11 @@ const modifiers$8 = {
31851
32997
  class MultiStringFieldCondition extends BaseCondition {
31852
32998
  constructor(options) {
31853
32999
  super(options);
31854
- __publicField(this, "defaultConditionValue");
31855
- __publicField(this, "defaultConditionModifier", "equals");
31856
- __publicField(this, "modifiers", modifiers$8);
33000
+ __publicField(this, "modifiers", modifiers$a);
31857
33001
  }
31858
33002
  static deserialize(serializedCondition, field) {
31859
33003
  const { conditionValue, conditionModifier, ...rest } = serializedCondition;
31860
- const modifierConfig = modifiers$8[conditionModifier];
33004
+ const modifierConfig = modifiers$a[conditionModifier];
31861
33005
  const deserializedValue = conditionValue !== void 0 && modifierConfig.isSerializedValueValid(conditionValue) ? modifierConfig.modifier.deserialize(conditionValue) : void 0;
31862
33006
  return new MultiStringFieldCondition({ field, conditionModifier, conditionValue: deserializedValue, ...rest });
31863
33007
  }
@@ -31936,7 +33080,7 @@ const NumberFieldConditionCell = (props) => {
31936
33080
  /* @__PURE__ */ jsx(RemoveConditionButton, { condition, onClick: onRemove })
31937
33081
  ] });
31938
33082
  };
31939
- const modifiers$7 = {
33083
+ const modifiers$9 = {
31940
33084
  equals: createConditionModifierConfig({
31941
33085
  modifier: NumberEqualsConditionModifier,
31942
33086
  isValueValid: (value) => typeof value === "number",
@@ -31989,13 +33133,11 @@ const modifiers$7 = {
31989
33133
  class NumberFieldCondition extends BaseCondition {
31990
33134
  constructor(options) {
31991
33135
  super(options);
31992
- __publicField(this, "defaultConditionValue");
31993
- __publicField(this, "defaultConditionModifier", "equals");
31994
- __publicField(this, "modifiers", modifiers$7);
33136
+ __publicField(this, "modifiers", modifiers$9);
31995
33137
  }
31996
33138
  static deserialize(serializedCondition, field) {
31997
33139
  const { conditionValue, conditionModifier, ...rest } = serializedCondition;
31998
- const modifierConfig = modifiers$7[conditionModifier];
33140
+ const modifierConfig = modifiers$9[conditionModifier];
31999
33141
  const deserializedValue = conditionValue !== void 0 && modifierConfig.isSerializedValueValid(conditionValue) ? (
32000
33142
  // @ts-expect-error calling isSerializedValueValid means conditionValue is of appropriate type
32001
33143
  modifierConfig.modifier.deserialize(conditionValue)
@@ -32039,7 +33181,7 @@ const OTPFieldConditionCell = (props) => {
32039
33181
  /* @__PURE__ */ jsx(RemoveConditionButton, { condition, onClick: onRemove })
32040
33182
  ] });
32041
33183
  };
32042
- const modifiers$6 = {
33184
+ const modifiers$8 = {
32043
33185
  equals: createConditionModifierConfig({
32044
33186
  modifier: StringEqualsConditionModifier,
32045
33187
  isValueValid: (_value) => true,
@@ -32068,13 +33210,11 @@ const modifiers$6 = {
32068
33210
  class OTPFieldCondition extends BaseCondition {
32069
33211
  constructor(options) {
32070
33212
  super(options);
32071
- __publicField(this, "defaultConditionValue");
32072
- __publicField(this, "defaultConditionModifier", "equals");
32073
- __publicField(this, "modifiers", modifiers$6);
33213
+ __publicField(this, "modifiers", modifiers$8);
32074
33214
  }
32075
33215
  static deserialize(serializedCondition, field) {
32076
33216
  const { conditionValue, conditionModifier, ...rest } = serializedCondition;
32077
- const modifierConfig = modifiers$6[conditionModifier];
33217
+ const modifierConfig = modifiers$8[conditionModifier];
32078
33218
  const deserializedValue = conditionValue !== void 0 && modifierConfig.isSerializedValueValid(conditionValue) ? modifierConfig.modifier.deserialize(conditionValue) : void 0;
32079
33219
  return new OTPFieldCondition({ field, conditionModifier, conditionValue: deserializedValue, ...rest });
32080
33220
  }
@@ -32082,6 +33222,117 @@ class OTPFieldCondition extends BaseCondition {
32082
33222
  return /* @__PURE__ */ jsx(OTPFieldConditionCell, { condition: this, ...props }, this.id);
32083
33223
  }
32084
33224
  }
33225
+ const PassFailFieldConditionCell = (props) => {
33226
+ const { condition, onRemove } = props;
33227
+ const field = condition.field;
33228
+ const conditionValue = condition.getConditionValue();
33229
+ const conditionModifier = condition.getConditionModifier();
33230
+ const getFilterValueUi = () => {
33231
+ switch (conditionModifier) {
33232
+ case "equals":
33233
+ case "notEquals": {
33234
+ const equalsModifier = condition.modifiers.equals;
33235
+ const equalsFilterValue = conditionValue !== void 0 && equalsModifier.isConditionValueValid(conditionValue) ? conditionValue : void 0;
33236
+ return /* @__PURE__ */ jsxs(Menu.Root, { children: [
33237
+ /* @__PURE__ */ jsx(Menu.ClickTrigger, { children: /* @__PURE__ */ jsx(Button, { type: "button", className: "min-w-0 shrink-1 grow", children: /* @__PURE__ */ jsx("span", { className: "truncate", children: equalsFilterValue !== void 0 ? equalsFilterValue ? passFailFieldStatusMapping[equalsFilterValue].label : "empty" : "..." }) }) }),
33238
+ /* @__PURE__ */ jsx(Menu.Content, { size: "sm", children: /* @__PURE__ */ jsx(
33239
+ Menu.SelectGroup,
33240
+ {
33241
+ required: false,
33242
+ value: equalsFilterValue,
33243
+ onValueChange: condition.setConditionValue,
33244
+ children: passFailFieldStatuses.map((status) => {
33245
+ const { label } = passFailFieldStatusMapping[status];
33246
+ return /* @__PURE__ */ jsx(SelectItemTemplate, { value: status, children: /* @__PURE__ */ jsx("span", { className: "truncate", children: label }) }, status);
33247
+ })
33248
+ }
33249
+ ) })
33250
+ ] });
33251
+ }
33252
+ case "includes":
33253
+ case "excludes": {
33254
+ const includesModifier = condition.modifiers.includes;
33255
+ const includesModifierFilterValue = conditionValue !== void 0 && includesModifier.isConditionValueValid(conditionValue) ? conditionValue : void 0;
33256
+ return /* @__PURE__ */ jsxs(Menu.Root, { children: [
33257
+ /* @__PURE__ */ jsx(Menu.ClickTrigger, { children: /* @__PURE__ */ jsx(Button, { type: "button", children: includesModifierFilterValue ? `${includesModifierFilterValue.length} statuses` : "..." }) }),
33258
+ /* @__PURE__ */ jsx(Menu.Content, { size: "sm", children: /* @__PURE__ */ jsxs(
33259
+ Menu.MultiSelectGroup,
33260
+ {
33261
+ values: includesModifierFilterValue ?? EMPTY_ARRAY,
33262
+ onValuesChange: condition.setConditionValue,
33263
+ children: [
33264
+ /* @__PURE__ */ jsx(SelectAllItemTemplate, { children: "Select all" }),
33265
+ passFailFieldStatuses.map((status) => {
33266
+ const { label, icon } = passFailFieldStatusMapping[status];
33267
+ return /* @__PURE__ */ jsxs(MultiSelectItemTemplate, { value: status, children: [
33268
+ /* @__PURE__ */ jsx(LuIcon, { icon }),
33269
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: label })
33270
+ ] }, status);
33271
+ })
33272
+ ]
33273
+ }
33274
+ ) })
33275
+ ] });
33276
+ }
33277
+ }
33278
+ };
33279
+ return /* @__PURE__ */ jsxs(ButtonGroup, { className: "flex w-max max-w-full min-w-0 gap-0.5", size: "sm", variant: "fill", accentColor: "base", children: [
33280
+ /* @__PURE__ */ jsxs(Badge, { className: "min-w-0 shrink-1", size: "sm", variant: "fill", accentColor: "base", children: [
33281
+ /* @__PURE__ */ jsx(LuIcon, { icon: fieldIcons[field.type] }),
33282
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: field.label || UNLABELLED_FIELD_LABEL })
33283
+ ] }),
33284
+ /* @__PURE__ */ jsx(ConditionModifierDropdown, { condition, children: /* @__PURE__ */ jsx(Button, { type: "button", children: condition.modifiers[conditionModifier].modifier.label }) }),
33285
+ getFilterValueUi(),
33286
+ /* @__PURE__ */ jsx(RemoveConditionButton, { condition, onClick: onRemove })
33287
+ ] });
33288
+ };
33289
+ const modifiers$7 = {
33290
+ equals: createConditionModifierConfig({
33291
+ modifier: PassFailEqualsConditionModifier,
33292
+ isValueValid: (value) => value !== null,
33293
+ isConditionValueValid: (conditionValue) => typeof conditionValue === "string",
33294
+ isSerializedValueValid: (serializedConditionValue) => typeof serializedConditionValue === "string"
33295
+ }),
33296
+ notEquals: createConditionModifierConfig({
33297
+ modifier: PassFailNotEqualsConditionModifier,
33298
+ isValueValid: (value) => value !== null,
33299
+ isConditionValueValid: (conditionValue) => typeof conditionValue === "string",
33300
+ isSerializedValueValid: (serializedConditionValue) => typeof serializedConditionValue === "string"
33301
+ }),
33302
+ includes: createConditionModifierConfig({
33303
+ modifier: PassFailArrayIncludesConditionModifier,
33304
+ isValueValid: (value) => value !== null,
33305
+ isConditionValueValid: (conditionValue) => Array.isArray(conditionValue),
33306
+ isSerializedValueValid: (serializedConditionValue) => Array.isArray(serializedConditionValue)
33307
+ }),
33308
+ excludes: createConditionModifierConfig({
33309
+ modifier: PassFailArrayExcludesConditionModifier,
33310
+ isValueValid: (value) => value !== null,
33311
+ isConditionValueValid: (conditionValue) => Array.isArray(conditionValue),
33312
+ isSerializedValueValid: (serializedConditionValue) => Array.isArray(serializedConditionValue)
33313
+ })
33314
+ };
33315
+ class PassFailFieldCondition extends BaseCondition {
33316
+ constructor(options) {
33317
+ super(options);
33318
+ __publicField(this, "modifiers", modifiers$7);
33319
+ }
33320
+ static deserialize(serializedCondition, field) {
33321
+ const { conditionValue, conditionModifier, ...rest } = serializedCondition;
33322
+ const modifierConfig = modifiers$7[conditionModifier];
33323
+ const deserializedValue = conditionValue !== void 0 && modifierConfig.isSerializedValueValid(conditionValue) ? (
33324
+ // @ts-expect-error calling isSerializedValueValid means conditionValue is of appropriate type
33325
+ modifierConfig.modifier.deserialize(conditionValue)
33326
+ ) : void 0;
33327
+ return new PassFailFieldCondition({ field, conditionModifier, conditionValue: deserializedValue, ...rest });
33328
+ }
33329
+ transformValue(value) {
33330
+ return value.status;
33331
+ }
33332
+ render(props) {
33333
+ return /* @__PURE__ */ jsx(PassFailFieldConditionCell, { condition: this, ...props }, this.id);
33334
+ }
33335
+ }
32085
33336
  const RadioFieldConditionCell = (props) => {
32086
33337
  const { condition, onRemove } = props;
32087
33338
  const field = condition.field;
@@ -32102,16 +33353,6 @@ const RadioFieldConditionCell = (props) => {
32102
33353
  }
32103
33354
  return mapping;
32104
33355
  }, [normalizedOptions]);
32105
- const handleValuesChange = useCallback(
32106
- (values) => {
32107
- if (values.length > 0) {
32108
- condition.setConditionValue(values);
32109
- } else {
32110
- condition.setConditionValue([]);
32111
- }
32112
- },
32113
- [condition]
32114
- );
32115
33356
  const getFilterValueUi = () => {
32116
33357
  switch (conditionModifier) {
32117
33358
  case "equals":
@@ -32141,8 +33382,8 @@ const RadioFieldConditionCell = (props) => {
32141
33382
  SelectFieldOptionMultiSelectGroup,
32142
33383
  {
32143
33384
  selectFieldOptions: field.options,
32144
- values: includesModifierFilterValue ?? [],
32145
- onValuesChange: handleValuesChange
33385
+ values: includesModifierFilterValue ?? EMPTY_ARRAY,
33386
+ onValuesChange: condition.setConditionValue
32146
33387
  }
32147
33388
  ) })
32148
33389
  ] });
@@ -32159,7 +33400,7 @@ const RadioFieldConditionCell = (props) => {
32159
33400
  /* @__PURE__ */ jsx(RemoveConditionButton, { condition, onClick: onRemove })
32160
33401
  ] });
32161
33402
  };
32162
- const modifiers$5 = {
33403
+ const modifiers$6 = {
32163
33404
  equals: createConditionModifierConfig({
32164
33405
  modifier: StringEqualsConditionModifier,
32165
33406
  isValueValid: (value) => typeof value === "string",
@@ -32188,13 +33429,11 @@ const modifiers$5 = {
32188
33429
  class RadioFieldCondition extends BaseCondition {
32189
33430
  constructor(options) {
32190
33431
  super(options);
32191
- __publicField(this, "defaultConditionValue");
32192
- __publicField(this, "defaultConditionModifier", "equals");
32193
- __publicField(this, "modifiers", modifiers$5);
33432
+ __publicField(this, "modifiers", modifiers$6);
32194
33433
  }
32195
33434
  static deserialize(serializedCondition, field) {
32196
33435
  const { conditionValue, conditionModifier, ...rest } = serializedCondition;
32197
- const modifierConfig = modifiers$5[conditionModifier];
33436
+ const modifierConfig = modifiers$6[conditionModifier];
32198
33437
  const deserializedValue = conditionValue !== void 0 && modifierConfig.isSerializedValueValid(conditionValue) ? (
32199
33438
  // @ts-expect-error calling isSerializedValueValid means conditionValue is of appropriate type
32200
33439
  modifierConfig.modifier.deserialize(conditionValue)
@@ -32205,6 +33444,146 @@ class RadioFieldCondition extends BaseCondition {
32205
33444
  return /* @__PURE__ */ jsx(RadioFieldConditionCell, { condition: this, ...props }, this.id);
32206
33445
  }
32207
33446
  }
33447
+ const RatingFieldConditionCell = (props) => {
33448
+ const { condition, onRemove } = props;
33449
+ const field = condition.field;
33450
+ const conditionValue = condition.getConditionValue();
33451
+ const conditionModifier = condition.getConditionModifier();
33452
+ const getFilterValueUi = () => {
33453
+ switch (conditionModifier) {
33454
+ case "equals":
33455
+ case "notEquals":
33456
+ case "greaterThanOrEquals":
33457
+ case "lessThanOrEquals":
33458
+ case "greaterThan":
33459
+ case "lessThan": {
33460
+ const modifier = condition.modifiers[conditionModifier];
33461
+ const filterValue = conditionValue !== void 0 && modifier.isConditionValueValid(conditionValue) ? conditionValue : void 0;
33462
+ return /* @__PURE__ */ jsx(
33463
+ NumberInputPopover,
33464
+ {
33465
+ value: filterValue ?? null,
33466
+ onValueChange: (value) => condition.setConditionValue(value ?? void 0),
33467
+ size: "sm",
33468
+ children: /* @__PURE__ */ jsx(Button, { type: "button", className: "truncate", children: filterValue !== void 0 ? filterValue : "..." })
33469
+ }
33470
+ );
33471
+ }
33472
+ case "inRange":
33473
+ case "notInRange": {
33474
+ const inRangeModifier = condition.modifiers.inRange;
33475
+ const rangeFilterValue = conditionValue !== void 0 && inRangeModifier.isConditionValueValid(conditionValue) ? conditionValue : void 0;
33476
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [
33477
+ /* @__PURE__ */ jsx(
33478
+ NumberInputPopover,
33479
+ {
33480
+ value: (rangeFilterValue == null ? void 0 : rangeFilterValue.from) ?? null,
33481
+ onValueChange: (value) => {
33482
+ condition.setConditionValue({
33483
+ from: value,
33484
+ to: (rangeFilterValue == null ? void 0 : rangeFilterValue.to) ?? null
33485
+ });
33486
+ },
33487
+ size: "sm",
33488
+ children: /* @__PURE__ */ jsx(Button, { className: "truncate", children: (rangeFilterValue == null ? void 0 : rangeFilterValue.from) ?? "..." })
33489
+ }
33490
+ ),
33491
+ /* @__PURE__ */ jsx(
33492
+ NumberInputPopover,
33493
+ {
33494
+ value: (rangeFilterValue == null ? void 0 : rangeFilterValue.to) ?? null,
33495
+ onValueChange: (value) => {
33496
+ condition.setConditionValue({
33497
+ from: (rangeFilterValue == null ? void 0 : rangeFilterValue.from) ?? null,
33498
+ to: value
33499
+ });
33500
+ },
33501
+ size: "sm",
33502
+ children: /* @__PURE__ */ jsx(Button, { className: "truncate", children: (rangeFilterValue == null ? void 0 : rangeFilterValue.to) ?? "..." })
33503
+ }
33504
+ )
33505
+ ] });
33506
+ }
33507
+ }
33508
+ };
33509
+ return /* @__PURE__ */ jsxs(ButtonGroup, { className: "flex w-max max-w-full min-w-0 gap-0.5", size: "sm", variant: "fill", accentColor: "base", children: [
33510
+ /* @__PURE__ */ jsxs(Badge, { className: "min-w-0 shrink-1", size: "sm", variant: "fill", accentColor: "base", children: [
33511
+ /* @__PURE__ */ jsx(LuIcon, { icon: fieldIcons[field.type] }),
33512
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: field.label || UNLABELLED_FIELD_LABEL })
33513
+ ] }),
33514
+ /* @__PURE__ */ jsx(ConditionModifierDropdown, { condition, children: /* @__PURE__ */ jsx(Button, { type: "button", children: condition.modifiers[conditionModifier].modifier.label }) }),
33515
+ getFilterValueUi(),
33516
+ /* @__PURE__ */ jsx(RemoveConditionButton, { condition, onClick: onRemove })
33517
+ ] });
33518
+ };
33519
+ const modifiers$5 = {
33520
+ equals: createConditionModifierConfig({
33521
+ modifier: NumberEqualsConditionModifier,
33522
+ isValueValid: (value) => typeof value === "number",
33523
+ isConditionValueValid: (conditionValue) => typeof conditionValue === "number",
33524
+ isSerializedValueValid: (conditionValue) => typeof conditionValue === "number"
33525
+ }),
33526
+ notEquals: createConditionModifierConfig({
33527
+ modifier: NumberNotEqualsConditionModifier,
33528
+ isValueValid: (value) => typeof value === "number",
33529
+ isConditionValueValid: (conditionValue) => typeof conditionValue === "number",
33530
+ isSerializedValueValid: (conditionValue) => typeof conditionValue === "number"
33531
+ }),
33532
+ lessThan: createConditionModifierConfig({
33533
+ modifier: NumberLessThanConditionModifier,
33534
+ isValueValid: (value) => typeof value === "number",
33535
+ isConditionValueValid: (conditionValue) => typeof conditionValue === "number",
33536
+ isSerializedValueValid: (conditionValue) => typeof conditionValue === "number"
33537
+ }),
33538
+ lessThanOrEquals: createConditionModifierConfig({
33539
+ modifier: NumberLessThanOrEqualsConditionModifier,
33540
+ isValueValid: (value) => typeof value === "number",
33541
+ isConditionValueValid: (conditionValue) => typeof conditionValue === "number",
33542
+ isSerializedValueValid: (conditionValue) => typeof conditionValue === "number"
33543
+ }),
33544
+ greaterThan: createConditionModifierConfig({
33545
+ modifier: NumberGreaterThanConditionModifier,
33546
+ isValueValid: (value) => typeof value === "number",
33547
+ isConditionValueValid: (conditionValue) => typeof conditionValue === "number",
33548
+ isSerializedValueValid: (conditionValue) => typeof conditionValue === "number"
33549
+ }),
33550
+ greaterThanOrEquals: createConditionModifierConfig({
33551
+ modifier: NumberGreaterThanOrEqualsConditionModifier,
33552
+ isValueValid: (value) => typeof value === "number",
33553
+ isConditionValueValid: (conditionValue) => typeof conditionValue === "number",
33554
+ isSerializedValueValid: (conditionValue) => typeof conditionValue === "number"
33555
+ }),
33556
+ inRange: createConditionModifierConfig({
33557
+ modifier: NumberRangeInConditionModifier,
33558
+ isValueValid: (value) => typeof value === "number",
33559
+ isConditionValueValid: (conditionValue) => typeof conditionValue === "object",
33560
+ isSerializedValueValid: (conditionValue) => typeof conditionValue === "object"
33561
+ }),
33562
+ notInRange: createConditionModifierConfig({
33563
+ modifier: NumberRangeNotInConditionModifier,
33564
+ isValueValid: (value) => typeof value === "number",
33565
+ isConditionValueValid: (conditionValue) => typeof conditionValue === "object",
33566
+ isSerializedValueValid: (conditionValue) => typeof conditionValue === "object"
33567
+ })
33568
+ };
33569
+ class RatingFieldCondition extends BaseCondition {
33570
+ constructor(options) {
33571
+ super(options);
33572
+ __publicField(this, "modifiers", modifiers$5);
33573
+ }
33574
+ static deserialize(serializedCondition, field) {
33575
+ const { conditionValue, conditionModifier, ...rest } = serializedCondition;
33576
+ const modifierConfig = modifiers$5[conditionModifier];
33577
+ const deserializedValue = conditionValue !== void 0 && modifierConfig.isSerializedValueValid(conditionValue) ? (
33578
+ // @ts-expect-error calling isSerializedValueValid means conditionValue is of appropriate type
33579
+ modifierConfig.modifier.deserialize(conditionValue)
33580
+ ) : void 0;
33581
+ return new RatingFieldCondition({ field, conditionModifier, conditionValue: deserializedValue, ...rest });
33582
+ }
33583
+ render(props) {
33584
+ return /* @__PURE__ */ jsx(RatingFieldConditionCell, { condition: this, ...props }, this.id);
33585
+ }
33586
+ }
32208
33587
  const ScanFieldConditionCell = (props) => {
32209
33588
  const { condition, onRemove } = props;
32210
33589
  const field = condition.field;
@@ -32267,8 +33646,6 @@ const modifiers$4 = {
32267
33646
  class ScanFieldCondition extends BaseCondition {
32268
33647
  constructor(options) {
32269
33648
  super(options);
32270
- __publicField(this, "defaultConditionValue");
32271
- __publicField(this, "defaultConditionModifier", "equals");
32272
33649
  __publicField(this, "modifiers", modifiers$4);
32273
33650
  }
32274
33651
  static deserialize(serializedCondition, field) {
@@ -32387,8 +33764,6 @@ const modifiers$3 = {
32387
33764
  class SelectFieldCondition extends BaseCondition {
32388
33765
  constructor(options) {
32389
33766
  super(options);
32390
- __publicField(this, "defaultConditionValue");
32391
- __publicField(this, "defaultConditionModifier", "equals");
32392
33767
  __publicField(this, "modifiers", modifiers$3);
32393
33768
  }
32394
33769
  static deserialize(serializedCondition, field) {
@@ -32466,8 +33841,6 @@ const modifiers$2 = {
32466
33841
  class StringFieldCondition extends BaseCondition {
32467
33842
  constructor(options) {
32468
33843
  super(options);
32469
- __publicField(this, "defaultConditionValue");
32470
- __publicField(this, "defaultConditionModifier", "equals");
32471
33844
  __publicField(this, "modifiers", modifiers$2);
32472
33845
  }
32473
33846
  static deserialize(serializedCondition, field) {
@@ -32542,8 +33915,6 @@ const modifiers$1 = {
32542
33915
  class TextFieldCondition extends BaseCondition {
32543
33916
  constructor(options) {
32544
33917
  super(options);
32545
- __publicField(this, "defaultConditionValue");
32546
- __publicField(this, "defaultConditionModifier", "equals");
32547
33918
  __publicField(this, "modifiers", modifiers$1);
32548
33919
  }
32549
33920
  static deserialize(serializedCondition, field) {
@@ -32614,8 +33985,6 @@ const modifiers = {
32614
33985
  class UploadFieldCondition extends BaseCondition {
32615
33986
  constructor(options) {
32616
33987
  super(options);
32617
- __publicField(this, "defaultConditionValue");
32618
- __publicField(this, "defaultConditionModifier", "equals");
32619
33988
  __publicField(this, "modifiers", modifiers);
32620
33989
  }
32621
33990
  static deserialize(serializedCondition, field) {
@@ -32628,43 +33997,35 @@ class UploadFieldCondition extends BaseCondition {
32628
33997
  return /* @__PURE__ */ jsx(UploadFieldConditionCell, { condition: this, ...props }, this.id);
32629
33998
  }
32630
33999
  }
32631
- const deserializeCondition = (serializedCondition, field) => {
32632
- switch (serializedCondition.type) {
32633
- case "text":
32634
- return TextFieldCondition.deserialize(serializedCondition, field);
32635
- case "boolean":
32636
- return BooleanFieldCondition.deserialize(serializedCondition, field);
32637
- case "number":
32638
- return NumberFieldCondition.deserialize(serializedCondition, field);
32639
- case "date":
32640
- return DateFieldCondition.deserialize(serializedCondition, field);
32641
- case "string":
32642
- return StringFieldCondition.deserialize(serializedCondition, field);
32643
- case "select":
32644
- return SelectFieldCondition.deserialize(serializedCondition, field);
32645
- case "multi-string":
32646
- return MultiStringFieldCondition.deserialize(serializedCondition, field);
32647
- case "multi-select":
32648
- return MultiSelectFieldCondition.deserialize(serializedCondition, field);
32649
- case "upload":
32650
- return UploadFieldCondition.deserialize(serializedCondition, field);
32651
- case "qr":
32652
- return ScanFieldCondition.deserialize(serializedCondition, field);
32653
- case "radio":
32654
- return RadioFieldCondition.deserialize(serializedCondition, field);
32655
- case "checkbox-list":
32656
- return CheckboxListFieldCondition.deserialize(serializedCondition, field);
32657
- case "otp":
32658
- return OTPFieldCondition.deserialize(serializedCondition, field);
32659
- }
34000
+ const ConditionTypeToClsMapping = {
34001
+ date: DateFieldCondition,
34002
+ number: NumberFieldCondition,
34003
+ boolean: BooleanFieldCondition,
34004
+ select: SelectFieldCondition,
34005
+ string: StringFieldCondition,
34006
+ text: TextFieldCondition,
34007
+ upload: UploadFieldCondition,
34008
+ qr: ScanFieldCondition,
34009
+ "multi-string": MultiStringFieldCondition,
34010
+ "multi-select": MultiSelectFieldCondition,
34011
+ radio: RadioFieldCondition,
34012
+ "checkbox-list": CheckboxListFieldCondition,
34013
+ "pass-fail": PassFailFieldCondition,
34014
+ otp: OTPFieldCondition,
34015
+ rating: RatingFieldCondition
32660
34016
  };
32661
- const deserializeConditions = (serializedConditions, fields) => {
34017
+ const deserializeCondition = (field, serializedCondition) => {
34018
+ if (field.type !== serializedCondition.type)
34019
+ throw new Error(`field and condition type mismatch ${field.type} !== ${serializedCondition.type}`);
34020
+ return ConditionTypeToClsMapping[serializedCondition.type].deserialize(serializedCondition, field);
34021
+ };
34022
+ const deserializeConditions = (fields, serializedConditions) => {
32662
34023
  const fieldsMapping = {};
32663
34024
  for (const field of fields) {
32664
34025
  fieldsMapping[field.identifier] = field;
32665
34026
  }
32666
34027
  return serializedConditions.map(
32667
- (serializedCondition) => deserializeCondition(serializedCondition, fieldsMapping[serializedCondition.fieldId])
34028
+ (serializedCondition) => deserializeCondition(fieldsMapping[serializedCondition.fieldId], serializedCondition)
32668
34029
  );
32669
34030
  };
32670
34031
  const applyConditions = (conditions, values) => {
@@ -32672,35 +34033,53 @@ const applyConditions = (conditions, values) => {
32672
34033
  return condition.apply(values[condition.field.identifier]);
32673
34034
  }) : true;
32674
34035
  };
32675
- const deserializeField = (serializedField) => {
32676
- switch (serializedField.type) {
32677
- case "boolean":
32678
- return BooleanField.deserialize(serializedField);
32679
- case "text":
32680
- return TextField.deserialize(serializedField);
32681
- case "number":
32682
- return NumberField.deserialize(serializedField);
32683
- case "date":
32684
- return DateField.deserialize(serializedField);
32685
- case "select":
32686
- return SelectField.deserialize(serializedField);
32687
- case "multi-string":
32688
- return MultiStringField.deserialize(serializedField);
32689
- case "multi-select":
32690
- return MultiSelectField.deserialize(serializedField);
32691
- case "upload":
32692
- return UploadField.deserialize(serializedField);
32693
- case "qr":
32694
- return ScanField.deserialize(serializedField);
32695
- case "radio":
32696
- return RadioField.deserialize(serializedField);
32697
- case "checkbox-list":
32698
- return CheckboxListField.deserialize(serializedField);
32699
- case "string":
32700
- return StringField.deserialize(serializedField);
32701
- case "otp":
32702
- return OTPField.deserialize(serializedField);
34036
+ class ConditionManager extends Observable {
34037
+ constructor(conditions) {
34038
+ super();
34039
+ __publicField(this, "conditions");
34040
+ __publicField(this, "conditionObserver", () => {
34041
+ this.conditions = [...this.conditions];
34042
+ this.notify(this);
34043
+ });
34044
+ __publicField(this, "initConditions", (conditions) => {
34045
+ for (const c of conditions) c.observe(this.conditionObserver);
34046
+ return conditions;
34047
+ });
34048
+ this.conditions = this.initConditions(conditions);
34049
+ }
34050
+ getConditions() {
34051
+ return this.conditions;
34052
+ }
34053
+ addCondition(condition) {
34054
+ this.conditions = this.initConditions([...this.conditions, condition]);
34055
+ this.notify(this);
34056
+ }
34057
+ addConditions(conditions) {
34058
+ this.conditions = this.initConditions([...this.conditions, ...conditions]);
34059
+ this.notify(this);
34060
+ }
34061
+ removeCondition(condition) {
34062
+ this.conditions = this.initConditions(this.conditions.filter((c) => c.id !== condition.id));
34063
+ this.notify(this);
32703
34064
  }
34065
+ removeConditions(conditions) {
34066
+ const conditionIds = new Set(conditions.map((c) => c.id));
34067
+ this.conditions = this.initConditions(this.conditions.filter((c) => !conditionIds.has(c.id)));
34068
+ this.notify(this);
34069
+ }
34070
+ applyConditions(values) {
34071
+ return applyConditions(this.conditions, values);
34072
+ }
34073
+ }
34074
+ const useConditionManager = (conditions, onConditionsChange) => {
34075
+ return useMemo(() => {
34076
+ const ret = new ConditionManager(conditions);
34077
+ ret.observe((conditionManager) => onConditionsChange(conditionManager.getConditions()));
34078
+ return ret;
34079
+ }, [conditions, onConditionsChange]);
34080
+ };
34081
+ const deserializeField = (serializedField) => {
34082
+ return FieldTypeToClsMapping[serializedField.type].deserialize(serializedField);
32704
34083
  };
32705
34084
  function deserializeFields(fields) {
32706
34085
  return fields.map(deserialize);
@@ -32775,6 +34154,85 @@ function cleanSerializedFieldValues(fields, values) {
32775
34154
  }
32776
34155
  return ret;
32777
34156
  }
34157
+ function extractFilesAndPromisesFromFieldValues(fields, values) {
34158
+ const cleanValues = cleanFieldValues(fields, values);
34159
+ const valuesRet = {};
34160
+ const filesRet = {};
34161
+ for (const field of fields) {
34162
+ if (!(field.identifier in cleanValues)) continue;
34163
+ const value = cleanValues[field.identifier];
34164
+ switch (field.type) {
34165
+ case "upload":
34166
+ if (!field.isValueValid(value)) break;
34167
+ filesRet[field.identifier] = value;
34168
+ valuesRet[field.identifier] = [];
34169
+ break;
34170
+ case "pass-fail":
34171
+ if (!field.isValueValid(value)) break;
34172
+ filesRet[field.identifier] = value.files;
34173
+ valuesRet[field.identifier] = {
34174
+ ...value,
34175
+ files: []
34176
+ };
34177
+ break;
34178
+ default:
34179
+ valuesRet[field.identifier] = values[field.identifier];
34180
+ }
34181
+ }
34182
+ return [valuesRet, filesRet];
34183
+ }
34184
+ function insertFilesAndPromisesToFieldValues(fields, values, filesAndPromises) {
34185
+ const ret = {};
34186
+ for (const field of fields) {
34187
+ if (!(field.identifier in values)) continue;
34188
+ const value = values[field.identifier];
34189
+ switch (field.type) {
34190
+ case "upload":
34191
+ if (!field.isValueValid(value)) break;
34192
+ ret[field.identifier] = filesAndPromises[field.identifier] ?? [];
34193
+ break;
34194
+ case "pass-fail":
34195
+ if (!field.isValueValid(value)) break;
34196
+ ret[field.identifier] = {
34197
+ ...value,
34198
+ files: filesAndPromises[field.identifier] ?? []
34199
+ };
34200
+ break;
34201
+ default:
34202
+ if (!field.isValueValid(value)) break;
34203
+ ret[field.identifier] = value;
34204
+ }
34205
+ }
34206
+ return ret;
34207
+ }
34208
+ const initializeFieldValues = (fields, values) => {
34209
+ const ret = {};
34210
+ for (const field of fields) {
34211
+ const value = values[field.identifier];
34212
+ ret[field.identifier] = value !== void 0 ? value : field.blankValue();
34213
+ }
34214
+ return ret;
34215
+ };
34216
+ const changedFieldValues = (fields, values1, values2) => {
34217
+ const ret = {};
34218
+ for (const field of fields) {
34219
+ const value1 = values1[field.identifier];
34220
+ const value2 = values2[field.identifier];
34221
+ if (field.areValuesEqual(value1, value2)) continue;
34222
+ ret[field.identifier] = value2;
34223
+ }
34224
+ return ret;
34225
+ };
34226
+ const unchangedFieldValues = (fields, values1, values2) => {
34227
+ const ret = {};
34228
+ for (const field of fields) {
34229
+ const value1 = values1[field.identifier];
34230
+ const value2 = values2[field.identifier];
34231
+ if (!field.areValuesEqual(value1, value2)) continue;
34232
+ ret[field.identifier] = value2;
34233
+ }
34234
+ return ret;
34235
+ };
32778
34236
  const RendererContext = createContext({});
32779
34237
  const FieldSectionLayout = memo((props) => {
32780
34238
  const { fieldSection: section, ...rest } = props;
@@ -32855,7 +34313,7 @@ const _FieldSection = class _FieldSection extends BaseFormElement {
32855
34313
  const fields = data.fields.map(deserializeField);
32856
34314
  const conditions = {};
32857
34315
  for (const [sectionId, serializedConditions] of Object.entries(data.conditions)) {
32858
- conditions[sectionId] = deserializeConditions(serializedConditions, fields);
34316
+ conditions[sectionId] = deserializeConditions(fields, serializedConditions);
32859
34317
  }
32860
34318
  return new _FieldSection({ ...data, fields, conditions });
32861
34319
  }
@@ -32896,12 +34354,10 @@ const _FieldSection = class _FieldSection extends BaseFormElement {
32896
34354
  getFields() {
32897
34355
  return this.fields;
32898
34356
  }
32899
- addField(field) {
32900
- this.fields = this.initFields([...this.fields, field]);
32901
- this.notify(this);
32902
- }
32903
- addFields(fields) {
32904
- this.fields = this.initFields([...this.fields, ...fields]);
34357
+ addField(field, index) {
34358
+ const copy = [...this.fields];
34359
+ copy.splice(index ?? this.fields.length, 0, field);
34360
+ this.fields = this.initFields(copy);
32905
34361
  this.notify(this);
32906
34362
  }
32907
34363
  moveField(sourceIndex, targetIndex) {
@@ -32920,16 +34376,6 @@ const _FieldSection = class _FieldSection extends BaseFormElement {
32920
34376
  this.conditions = newConditions;
32921
34377
  this.notify(this);
32922
34378
  }
32923
- removeFields(fields) {
32924
- const fieldIdentifiers = new Set(fields.map(({ identifier }) => identifier));
32925
- this.fields = this.initFields(this.fields.filter(({ identifier }) => !fieldIdentifiers.has(identifier)));
32926
- const newConditions = {};
32927
- for (const [sectionId, conditions] of Object.entries(this.conditions)) {
32928
- newConditions[sectionId] = conditions.filter(({ field }) => !fieldIdentifiers.has(field.identifier));
32929
- }
32930
- this.conditions = newConditions;
32931
- this.notify(this);
32932
- }
32933
34379
  getConditions(identifier) {
32934
34380
  return this.conditions[identifier];
32935
34381
  }
@@ -33009,27 +34455,20 @@ class FieldSchema extends Observable {
33009
34455
  getFieldSections() {
33010
34456
  return this.fieldSections;
33011
34457
  }
33012
- addFieldSection(field) {
33013
- this.fieldSections = this.initFields([...this.fieldSections, field]);
33014
- this.notify(this);
33015
- }
33016
- addFieldSections(fields) {
33017
- this.fieldSections = this.initFields([...this.fieldSections, ...fields]);
34458
+ addFieldSection(fieldSection, index) {
34459
+ const copy = [...this.fieldSections];
34460
+ copy.splice(index ?? this.fieldSections.length, 0, fieldSection);
34461
+ this.fieldSections = this.initFields(copy);
33018
34462
  this.notify(this);
33019
34463
  }
33020
- removeFieldSection(field) {
33021
- const newFields = this.fieldSections.filter((f) => f.identifier !== field.identifier);
33022
- for (const field2 of newFields) {
33023
- field2.removeConditional(field2.identifier);
34464
+ removeFieldSection(fieldSection) {
34465
+ const newFields = this.fieldSections.filter((f) => f.identifier !== fieldSection.identifier);
34466
+ for (const field of newFields) {
34467
+ field.removeConditional(field.identifier);
33024
34468
  }
33025
34469
  this.fieldSections = this.initFields(newFields);
33026
34470
  this.notify(this);
33027
34471
  }
33028
- removeFieldSections(fields) {
33029
- const fieldsIds = new Set(fields.map((f) => f.identifier));
33030
- this.fieldSections = this.initFields(this.fieldSections.filter((f) => !fieldsIds.has(f.identifier)));
33031
- this.notify(this);
33032
- }
33033
34472
  moveFieldSection(sourceIndex, targetIndex) {
33034
34473
  const newFields = [...this.fieldSections];
33035
34474
  const [removedElement] = newFields.splice(sourceIndex, 1);
@@ -33043,44 +34482,70 @@ class FieldSchema extends Observable {
33043
34482
  serializeValues(values) {
33044
34483
  return serializeFieldValues(this.getFields(), values);
33045
34484
  }
34485
+ deserializeConditions(conditions) {
34486
+ return deserializeConditions(this.getFields(), conditions);
34487
+ }
34488
+ initializeValues(values) {
34489
+ return initializeFieldValues(this.getFields(), values);
34490
+ }
33046
34491
  }
33047
34492
  const FieldSchemaContext = createContext(new FieldSchema([]));
33048
34493
  const FormBuilderContext = createContext({});
34494
+ const useFieldTypeItems = (onSelect = () => null) => {
34495
+ return useMemo(() => {
34496
+ const entries = Object.entries(FieldTypeToClsMapping);
34497
+ return entries.map(([type, fieldClass]) => ({
34498
+ children: fieldClass.fieldTypeName,
34499
+ icon: /* @__PURE__ */ jsx(LuIcon, { icon: fieldIcons[type] }),
34500
+ value: type,
34501
+ onSelect: () => {
34502
+ onSelect(type);
34503
+ }
34504
+ }));
34505
+ }, [onSelect]);
34506
+ };
34507
+ const CreateFieldDropdownMenu = memo((props) => {
34508
+ const { children, variant, size, accentColor, onSelectFieldType, ...rest } = props;
34509
+ const fieldTypeItems = useFieldTypeItems(onSelectFieldType);
34510
+ return /* @__PURE__ */ jsxs(Menu.Root, { ...rest, children: [
34511
+ /* @__PURE__ */ jsx(Menu.ClickTrigger, { children }),
34512
+ /* @__PURE__ */ jsx(Menu.Content, { variant, size, accentColor, children: /* @__PURE__ */ jsx(Menu.Scroll, { children: fieldTypeItems.flat().map((item) => /* @__PURE__ */ jsxs(Menu.Item, { onSelect: item.onSelect, children: [
34513
+ item.icon,
34514
+ item.children
34515
+ ] }, item.value)) }) })
34516
+ ] });
34517
+ });
34518
+ CreateFieldDropdownMenu.displayName = "CreateFieldDropdownMenu";
33049
34519
  const createField = (type) => {
33050
34520
  switch (type) {
33051
34521
  case "text":
33052
- return new TextField({ fieldValidators: [], label: "", required: false, identifier: v4() });
34522
+ return new TextField({ label: "", required: false, identifier: v4() });
33053
34523
  case "boolean":
33054
34524
  return new BooleanField({
33055
- fieldValidators: [],
33056
34525
  label: "",
33057
34526
  required: false,
33058
34527
  identifier: v4()
33059
34528
  });
33060
34529
  case "number":
33061
34530
  return new NumberField({
33062
- fieldValidators: [],
33063
34531
  label: "",
33064
34532
  required: false,
33065
34533
  identifier: v4()
33066
34534
  });
33067
34535
  case "date":
33068
34536
  return new DateField({
33069
- fieldValidators: [],
33070
34537
  label: "",
33071
34538
  required: false,
33072
34539
  identifier: v4()
33073
34540
  });
33074
34541
  case "string":
33075
34542
  return new StringField({
33076
- fieldValidators: [],
33077
34543
  label: "",
33078
34544
  required: false,
33079
34545
  identifier: v4()
33080
34546
  });
33081
34547
  case "select":
33082
34548
  return new SelectField({
33083
- fieldValidators: [],
33084
34549
  label: "",
33085
34550
  options: [],
33086
34551
  required: false,
@@ -33088,14 +34553,12 @@ const createField = (type) => {
33088
34553
  });
33089
34554
  case "multi-string":
33090
34555
  return new MultiStringField({
33091
- fieldValidators: [],
33092
34556
  label: "",
33093
34557
  required: false,
33094
34558
  identifier: v4()
33095
34559
  });
33096
34560
  case "multi-select":
33097
34561
  return new MultiSelectField({
33098
- fieldValidators: [],
33099
34562
  label: "",
33100
34563
  options: [],
33101
34564
  required: false,
@@ -33103,21 +34566,20 @@ const createField = (type) => {
33103
34566
  });
33104
34567
  case "upload":
33105
34568
  return new UploadField({
33106
- fieldValidators: [],
33107
34569
  label: "",
33108
34570
  required: false,
33109
- identifier: v4()
34571
+ identifier: v4(),
34572
+ maximum_files: 6,
34573
+ maximum_size: maxFileSizeMB
33110
34574
  });
33111
34575
  case "qr":
33112
34576
  return new ScanField({
33113
- fieldValidators: [],
33114
34577
  label: "",
33115
34578
  required: false,
33116
34579
  identifier: v4()
33117
34580
  });
33118
34581
  case "radio":
33119
34582
  return new RadioField({
33120
- fieldValidators: [],
33121
34583
  label: "",
33122
34584
  options: [],
33123
34585
  required: false,
@@ -33125,21 +34587,34 @@ const createField = (type) => {
33125
34587
  });
33126
34588
  case "checkbox-list":
33127
34589
  return new CheckboxListField({
33128
- fieldValidators: [],
33129
34590
  label: "",
33130
34591
  options: [],
33131
34592
  required: false,
33132
34593
  identifier: v4()
33133
34594
  });
34595
+ case "pass-fail":
34596
+ return new PassFailField({
34597
+ label: "",
34598
+ required: false,
34599
+ identifier: v4(),
34600
+ showNotesAndFilesOn: ["fail"]
34601
+ // TODO: what defaults
34602
+ });
33134
34603
  case "otp":
33135
34604
  return new OTPField({
33136
- fieldValidators: [],
33137
34605
  label: "",
33138
34606
  validationType: "none",
33139
34607
  required: false,
33140
34608
  identifier: v4(),
33141
34609
  length: 6
33142
34610
  });
34611
+ case "rating":
34612
+ return new RatingField({
34613
+ label: "",
34614
+ required: false,
34615
+ identifier: v4(),
34616
+ maxRating: 5
34617
+ });
33143
34618
  }
33144
34619
  };
33145
34620
  const createCondition = (field) => {
@@ -33223,6 +34698,13 @@ const createCondition = (field) => {
33223
34698
  conditionModifier: "equals",
33224
34699
  field
33225
34700
  });
34701
+ case "pass-fail":
34702
+ return new PassFailFieldCondition({
34703
+ id: v4(),
34704
+ conditionValue: void 0,
34705
+ conditionModifier: "equals",
34706
+ field
34707
+ });
33226
34708
  case "otp":
33227
34709
  return new OTPFieldCondition({
33228
34710
  id: v4(),
@@ -33230,6 +34712,13 @@ const createCondition = (field) => {
33230
34712
  conditionModifier: "equals",
33231
34713
  field
33232
34714
  });
34715
+ case "rating":
34716
+ return new RatingFieldCondition({
34717
+ id: v4(),
34718
+ conditionValue: void 0,
34719
+ conditionModifier: "equals",
34720
+ field
34721
+ });
33233
34722
  }
33234
34723
  };
33235
34724
  const getFieldCreationSchema = (type, path) => {
@@ -33250,8 +34739,12 @@ const getFieldCreationSchema = (type, path) => {
33250
34739
  return TextField.getFieldCreationSchema(path);
33251
34740
  case "upload":
33252
34741
  return UploadField.getFieldCreationSchema(path);
34742
+ case "pass-fail":
34743
+ return PassFailField.getFieldCreationSchema(path);
33253
34744
  case "otp":
33254
34745
  return OTPField.getFieldCreationSchema(path);
34746
+ case "rating":
34747
+ return RatingField.getFieldCreationSchema(path);
33255
34748
  default:
33256
34749
  return;
33257
34750
  }
@@ -33269,7 +34762,7 @@ const FieldSettingsPopover = memo((props) => {
33269
34762
  accentColor: "base",
33270
34763
  ...hasError && { color: SEVERITY_COLOR_MAPPING.danger },
33271
34764
  children: [
33272
- /* @__PURE__ */ jsx(LuIcon, { icon: "settings" }),
34765
+ /* @__PURE__ */ jsx(LuIcon, { icon: Settings }),
33273
34766
  "Settings"
33274
34767
  ]
33275
34768
  },
@@ -33280,7 +34773,7 @@ const FieldSettingsPopover = memo((props) => {
33280
34773
  });
33281
34774
  FieldSettingsPopover.displayName = "FieldSettingsPopover";
33282
34775
  const FieldBuilder = memo((props) => {
33283
- const { parentPath, index, field } = props;
34776
+ const { parentPath, fieldIndex, field } = props;
33284
34777
  const { errors } = useFormikContext();
33285
34778
  const openImageViewer = useImageViewer();
33286
34779
  const { disableRequiredFields } = use(FormBuilderContext);
@@ -33296,17 +34789,16 @@ const FieldBuilder = memo((props) => {
33296
34789
  const handleImageDelete = useCallback(() => {
33297
34790
  field.setOptions({ image: void 0 });
33298
34791
  }, [field]);
33299
- const type = field.type;
33300
34792
  const [directlyShownFields, popoverFields] = useMemo(() => {
33301
34793
  const directlyShownFields2 = [];
33302
34794
  const popoverFields2 = [];
33303
- const fieldObject = getFieldCreationSchema(field.type, `${parentPath}.${index}`) ?? [];
34795
+ const fieldObject = getFieldCreationSchema(field.type, `${parentPath}.${fieldIndex}`) ?? [];
33304
34796
  for (const item of fieldObject) {
33305
34797
  if (item.showDirectly) directlyShownFields2.push(item.field);
33306
34798
  else popoverFields2.push(item.field);
33307
34799
  }
33308
34800
  return [directlyShownFields2, popoverFields2];
33309
- }, [field, parentPath, index]);
34801
+ }, [field, parentPath, fieldIndex]);
33310
34802
  const directlyShownInputs = useFieldInputs(directlyShownFields, {
33311
34803
  formId,
33312
34804
  disabled: false
@@ -33331,7 +34823,7 @@ const FieldBuilder = memo((props) => {
33331
34823
  /* @__PURE__ */ jsxs("div", { className: "flex gap-2 w-full justify-between", children: [
33332
34824
  /* @__PURE__ */ jsxs("div", { className: "flex gap-2 items-center", children: [
33333
34825
  /* @__PURE__ */ jsxs(Badge, { accentColor: "base", variant: "soft", size: "sm", children: [
33334
- /* @__PURE__ */ jsx(LuIcon, { icon: fieldIcons[type] }),
34826
+ /* @__PURE__ */ jsx(LuIcon, { icon: fieldIcons[field.type] }),
33335
34827
  fieldTypeName
33336
34828
  ] }),
33337
34829
  !disableRequiredFields && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
@@ -33341,7 +34833,7 @@ const FieldBuilder = memo((props) => {
33341
34833
  checked: field.required,
33342
34834
  onCheckedChange: (required) => field.setOptions({ required: !!required }),
33343
34835
  size: "sm",
33344
- children: /* @__PURE__ */ jsx(Checkbox.Indicator, { children: /* @__PURE__ */ jsx(LuIcon, { icon: "check" }) })
34836
+ children: /* @__PURE__ */ jsx(Checkbox.Indicator, { children: /* @__PURE__ */ jsx(LuIcon, { icon: Check }) })
33345
34837
  }
33346
34838
  ),
33347
34839
  /* @__PURE__ */ jsx(Text, { size: "sm", accentColor: "base", children: "Required" })
@@ -33369,7 +34861,7 @@ const FieldBuilder = memo((props) => {
33369
34861
  "aria-label": "delete",
33370
34862
  onClick: handleImageDelete,
33371
34863
  size: "sm",
33372
- children: /* @__PURE__ */ jsx(LuIcon, { icon: "trash" })
34864
+ children: /* @__PURE__ */ jsx(LuIcon, { icon: Trash })
33373
34865
  }
33374
34866
  )
33375
34867
  ] }),
@@ -33400,46 +34892,26 @@ const FieldBuilder = memo((props) => {
33400
34892
  ] });
33401
34893
  });
33402
34894
  FieldBuilder.displayName = "FieldBuilder";
33403
- const FieldDropdownMenu = memo((props) => {
33404
- const { children, variant, size, accentColor, fields, onSelectField, ...rest } = props;
33405
- return /* @__PURE__ */ jsxs(Menu.Root, { ...rest, children: [
33406
- /* @__PURE__ */ jsx(Menu.ClickTrigger, { children }),
33407
- /* @__PURE__ */ jsx(Menu.Content, { variant, size, accentColor, children: fields.map((field) => {
33408
- return /* @__PURE__ */ jsxs(Menu.Item, { onSelect: () => onSelectField(field), children: [
33409
- /* @__PURE__ */ jsx(LuIcon, { icon: fieldIcons[field.type] }),
33410
- field.label || UNLABELLED_FIELD_LABEL
33411
- ] }, field.identifier);
33412
- }) })
33413
- ] });
33414
- });
33415
- FieldDropdownMenu.displayName = "IssueDataFilterMenu";
33416
- const FieldSectionDropdownMenu = memo((props) => {
33417
- const { children, variant, size, accentColor, fieldSections, onSelectFieldCondition, ...rest } = props;
33418
- return /* @__PURE__ */ jsxs(Menu.Root, { ...rest, children: [
33419
- /* @__PURE__ */ jsx(Menu.ClickTrigger, { children }),
33420
- /* @__PURE__ */ jsx(Menu.Content, { variant, size, accentColor, children: fieldSections.map((fieldSection) => {
33421
- return /* @__PURE__ */ jsxs(Menu.Item, { onSelect: () => onSelectFieldCondition(fieldSection), children: [
33422
- /* @__PURE__ */ jsx(LuIcon, { icon: fieldIcons[fieldSection.type] }),
33423
- fieldSection.label || UNLABELLED_SECTION_LABEL
33424
- ] }, fieldSection.identifier);
33425
- }) })
33426
- ] });
33427
- });
33428
- FieldSectionDropdownMenu.displayName = "IssueDataFilterMenu";
33429
- const FieldWithActions = memo((props) => {
33430
- const { field, fieldSection, index, sectionIndex, remove } = props;
34895
+ const FieldBuilderWithActions = memo((props) => {
34896
+ const { field, fieldSection, fieldIndex, sectionIndex } = props;
33431
34897
  const { showError } = useToast();
33432
34898
  const fileInputRef = useRef(null);
33433
34899
  const parentPath = `fields.${sectionIndex}.fields`;
34900
+ const handleAddField = useCallback(
34901
+ (type) => {
34902
+ fieldSection.addField(createField(type), fieldIndex + 1);
34903
+ },
34904
+ [fieldIndex, fieldSection]
34905
+ );
33434
34906
  const duplicateField = useCallback(() => {
33435
34907
  fieldSection.addField(field.duplicate(v4()));
33436
34908
  }, [field, fieldSection]);
33437
34909
  const moveField = useCallback(
33438
34910
  (direction) => {
33439
34911
  const targetIndex = direction === "up" ? sectionIndex - 1 : sectionIndex + 1;
33440
- fieldSection.moveField(index, targetIndex);
34912
+ fieldSection.moveField(fieldIndex, targetIndex);
33441
34913
  },
33442
- [fieldSection, index, sectionIndex]
34914
+ [fieldSection, fieldIndex, sectionIndex]
33443
34915
  );
33444
34916
  const uploadImage = useCallback(
33445
34917
  (event) => {
@@ -33471,21 +34943,48 @@ const FieldWithActions = memo((props) => {
33471
34943
  (_a2 = fileInputRef.current) == null ? void 0 : _a2.click();
33472
34944
  }, []);
33473
34945
  const handleRemove = useCallback(() => {
33474
- remove(field);
33475
- }, [field, remove]);
34946
+ fieldSection.removeField(field);
34947
+ }, [field, fieldSection]);
33476
34948
  return /* @__PURE__ */ jsxs(Card, { className: "flex items-center justify-between gap-4 w-full", children: [
33477
- /* @__PURE__ */ jsx(FieldBuilder, { index, field, parentPath }),
34949
+ /* @__PURE__ */ jsx(FieldBuilder, { fieldIndex, field, parentPath }),
33478
34950
  /* @__PURE__ */ jsxs(ButtonGroup, { className: "flex-col gap-0.5 flex", variant: "ghost", accentColor: "base", size: "sm", children: [
33479
- /* @__PURE__ */ jsx(IconButton, { type: "button", onClick: handleMoveUp, children: /* @__PURE__ */ jsx(LuIcon, { icon: "move-up" }) }),
33480
- /* @__PURE__ */ jsx(IconButton, { type: "button", onClick: handleMoveDown, children: /* @__PURE__ */ jsx(LuIcon, { icon: "move-down" }) }),
33481
- /* @__PURE__ */ jsx(IconButton, { type: "button", onClick: duplicateField, children: /* @__PURE__ */ jsx(LuIcon, { icon: "copy" }) }),
33482
- /* @__PURE__ */ jsx(IconButton, { type: "button", onClick: handleUploadImage, children: /* @__PURE__ */ jsx(LuIcon, { icon: "image" }) }),
33483
- /* @__PURE__ */ jsx(IconButton, { type: "button", onClick: handleRemove, children: /* @__PURE__ */ jsx(LuIcon, { icon: "trash" }) })
34951
+ /* @__PURE__ */ jsx(CreateFieldDropdownMenu, { onSelectFieldType: handleAddField, children: /* @__PURE__ */ jsx(IconButton, { type: "button", children: /* @__PURE__ */ jsx(LuIcon, { icon: Plus }) }) }),
34952
+ /* @__PURE__ */ jsx(IconButton, { type: "button", onClick: handleMoveUp, children: /* @__PURE__ */ jsx(LuIcon, { icon: MoveUp }) }),
34953
+ /* @__PURE__ */ jsx(IconButton, { type: "button", onClick: handleMoveDown, children: /* @__PURE__ */ jsx(LuIcon, { icon: MoveDown }) }),
34954
+ /* @__PURE__ */ jsx(IconButton, { type: "button", onClick: duplicateField, children: /* @__PURE__ */ jsx(LuIcon, { icon: Copy }) }),
34955
+ /* @__PURE__ */ jsx(IconButton, { type: "button", onClick: handleUploadImage, children: /* @__PURE__ */ jsx(LuIcon, { icon: Image }) }),
34956
+ /* @__PURE__ */ jsx(IconButton, { type: "button", onClick: handleRemove, children: /* @__PURE__ */ jsx(LuIcon, { icon: Trash }) })
33484
34957
  ] }),
33485
34958
  /* @__PURE__ */ jsx("input", { className: "hidden", ref: fileInputRef, type: "file", accept: "image/*", onChange: uploadImage })
33486
34959
  ] });
33487
34960
  });
33488
- FieldWithActions.displayName = "FieldWithActions";
34961
+ FieldBuilderWithActions.displayName = "FieldBuilderWithActions";
34962
+ const FieldDropdownMenu = memo((props) => {
34963
+ const { children, variant, size, accentColor, fields, onSelectField, ...rest } = props;
34964
+ return /* @__PURE__ */ jsxs(Menu.Root, { ...rest, children: [
34965
+ /* @__PURE__ */ jsx(Menu.ClickTrigger, { children }),
34966
+ /* @__PURE__ */ jsx(Menu.Content, { variant, size, accentColor, children: /* @__PURE__ */ jsx(Menu.Scroll, { children: fields.map((field) => {
34967
+ return /* @__PURE__ */ jsxs(Menu.Item, { onSelect: () => onSelectField(field), children: [
34968
+ /* @__PURE__ */ jsx(LuIcon, { icon: fieldIcons[field.type] }),
34969
+ field.label || UNLABELLED_FIELD_LABEL
34970
+ ] }, field.identifier);
34971
+ }) }) })
34972
+ ] });
34973
+ });
34974
+ FieldDropdownMenu.displayName = "IssueDataFilterMenu";
34975
+ const FieldSectionDropdownMenu = memo((props) => {
34976
+ const { children, variant, size, accentColor, fieldSections, onSelectFieldCondition, ...rest } = props;
34977
+ return /* @__PURE__ */ jsxs(Menu.Root, { ...rest, children: [
34978
+ /* @__PURE__ */ jsx(Menu.ClickTrigger, { children }),
34979
+ /* @__PURE__ */ jsx(Menu.Content, { variant, size, accentColor, children: fieldSections.map((fieldSection) => {
34980
+ return /* @__PURE__ */ jsxs(Menu.Item, { onSelect: () => onSelectFieldCondition(fieldSection), children: [
34981
+ /* @__PURE__ */ jsx(LuIcon, { icon: fieldIcons[fieldSection.type] }),
34982
+ fieldSection.label || UNLABELLED_SECTION_LABEL
34983
+ ] }, fieldSection.identifier);
34984
+ }) })
34985
+ ] });
34986
+ });
34987
+ FieldSectionDropdownMenu.displayName = "IssueDataFilterMenu";
33489
34988
  const FieldSectionConditionEdgeComponent = memo((props) => {
33490
34989
  const { id, sourceX, sourceY, targetX, targetY, style, markerEnd, data } = props;
33491
34990
  const { targetSection, sourceSection, layoutDirection } = data;
@@ -33539,7 +35038,7 @@ const FieldSectionConditionEdgeComponent = memo((props) => {
33539
35038
  variant: "surface",
33540
35039
  size: "xs",
33541
35040
  accentColor: "base",
33542
- children: /* @__PURE__ */ jsx(LuIcon, { icon: "plus" })
35041
+ children: /* @__PURE__ */ jsx(LuIcon, { icon: Plus })
33543
35042
  }
33544
35043
  ) }),
33545
35044
  /* @__PURE__ */ jsxs(Tooltip.Root, { children: [
@@ -33553,7 +35052,7 @@ const FieldSectionConditionEdgeComponent = memo((props) => {
33553
35052
  accentColor: "base",
33554
35053
  color: "danger",
33555
35054
  onClick: handleDelete,
33556
- children: /* @__PURE__ */ jsx(LuIcon, { icon: "trash" })
35055
+ children: /* @__PURE__ */ jsx(LuIcon, { icon: Trash })
33557
35056
  }
33558
35057
  ) }),
33559
35058
  /* @__PURE__ */ jsx(Tooltip.Content, { size: "sm", children: "Remove conditional logic" })
@@ -33569,27 +35068,14 @@ const FieldSectionConditionEdgeComponent = memo((props) => {
33569
35068
  ] });
33570
35069
  });
33571
35070
  FieldSectionConditionEdgeComponent.displayName = "FieldSectionConditionEdgeComponent";
33572
- const useFieldTypeItems = (onSelect = () => null) => {
33573
- return useMemo(() => {
33574
- const entries = Object.entries(FieldTypeToClsMapping);
33575
- return entries.map(([type, fieldClass]) => ({
33576
- children: fieldClass.fieldTypeName,
33577
- icon: /* @__PURE__ */ jsx(LuIcon, { icon: fieldIcons[type] }),
33578
- value: type,
33579
- onSelect: () => {
33580
- onSelect(type);
33581
- }
33582
- }));
33583
- }, [onSelect]);
33584
- };
33585
35071
  const FieldSectionNodeComponent = memo((props) => {
33586
35072
  const { data, selected } = props;
33587
35073
  const { fieldSection, index: sectionIndex, layoutDirection } = data;
33588
35074
  const fieldSchema = use(FieldSchemaContext);
33589
- const removeSection = useCallback(() => {
35075
+ const handleRemoveSection = useCallback(() => {
33590
35076
  fieldSchema.removeFieldSection(fieldSection);
33591
35077
  }, [fieldSchema, fieldSection]);
33592
- const addField = useCallback(
35078
+ const handleAddField = useCallback(
33593
35079
  (type) => {
33594
35080
  fieldSection.addField(createField(type));
33595
35081
  },
@@ -33603,13 +35089,6 @@ const FieldSectionNodeComponent = memo((props) => {
33603
35089
  const handleDuplicate = useCallback(() => {
33604
35090
  fieldSchema.addFieldSection(fieldSection.duplicate(v4()));
33605
35091
  }, [fieldSchema, fieldSection]);
33606
- const fieldTypeItems = useFieldTypeItems(addField);
33607
- const removeField = useCallback(
33608
- (field) => {
33609
- fieldSection.removeField(field);
33610
- },
33611
- [fieldSection]
33612
- );
33613
35092
  return /* @__PURE__ */ jsxs(
33614
35093
  Card,
33615
35094
  {
@@ -33643,25 +35122,18 @@ const FieldSectionNodeComponent = memo((props) => {
33643
35122
  ] }),
33644
35123
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
33645
35124
  /* @__PURE__ */ jsx(Text, { weight: "bold", children: "Fields" }),
33646
- /* @__PURE__ */ jsxs(Menu.Root, { children: [
33647
- /* @__PURE__ */ jsx(Menu.ClickTrigger, { children: /* @__PURE__ */ jsxs(Button, { type: "button", variant: "soft", size: "sm", accentColor: "base", children: [
33648
- /* @__PURE__ */ jsx(LuIcon, { icon: "plus" }),
33649
- " Add field"
33650
- ] }) }),
33651
- /* @__PURE__ */ jsx(Menu.Content, { children: /* @__PURE__ */ jsx(Menu.Scroll, { children: fieldTypeItems.flat().map((item) => /* @__PURE__ */ jsxs(Menu.Item, { onSelect: item.onSelect, children: [
33652
- item.icon,
33653
- item.children
33654
- ] }, item.value)) }) })
33655
- ] })
35125
+ /* @__PURE__ */ jsx(CreateFieldDropdownMenu, { onSelectFieldType: handleAddField, children: /* @__PURE__ */ jsxs(Button, { type: "button", variant: "soft", size: "sm", accentColor: "base", children: [
35126
+ /* @__PURE__ */ jsx(LuIcon, { icon: Plus }),
35127
+ " Add field"
35128
+ ] }) })
33656
35129
  ] }),
33657
35130
  /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-3", children: fieldSection.fields.map((child, index) => /* @__PURE__ */ jsx(
33658
- FieldWithActions,
35131
+ FieldBuilderWithActions,
33659
35132
  {
33660
35133
  field: child,
33661
35134
  fieldSection,
33662
- index,
33663
- sectionIndex,
33664
- remove: removeField
35135
+ fieldIndex: index,
35136
+ sectionIndex
33665
35137
  },
33666
35138
  child.identifier
33667
35139
  )) })
@@ -33682,9 +35154,9 @@ const FieldSectionNodeComponent = memo((props) => {
33682
35154
  size: "xs",
33683
35155
  onClick: (e) => e.stopPropagation(),
33684
35156
  children: /* @__PURE__ */ jsxs(ButtonGroup, { className: "flex flex-col gap-2", variant: "surface", size: "xs", accentColor: "base", children: [
33685
- /* @__PURE__ */ jsx(IconButton, { type: "button", onClick: handleAddBranch, children: /* @__PURE__ */ jsx(LuIcon, { icon: "git-branch" }) }),
33686
- /* @__PURE__ */ jsx(IconButton, { type: "button", onClick: handleDuplicate, children: /* @__PURE__ */ jsx(LuIcon, { icon: "copy" }) }),
33687
- /* @__PURE__ */ jsx(IconButton, { type: "button", onClick: removeSection, children: /* @__PURE__ */ jsx(LuIcon, { icon: "trash" }) })
35157
+ /* @__PURE__ */ jsx(IconButton, { type: "button", onClick: handleAddBranch, children: /* @__PURE__ */ jsx(LuIcon, { icon: GitBranch }) }),
35158
+ /* @__PURE__ */ jsx(IconButton, { type: "button", onClick: handleDuplicate, children: /* @__PURE__ */ jsx(LuIcon, { icon: Copy }) }),
35159
+ /* @__PURE__ */ jsx(IconButton, { type: "button", onClick: handleRemoveSection, children: /* @__PURE__ */ jsx(LuIcon, { icon: Trash }) })
33688
35160
  ] })
33689
35161
  }
33690
35162
  )
@@ -33901,7 +35373,7 @@ const FormBuilderFlowBuilder = memo(() => {
33901
35373
  }
33902
35374
  ),
33903
35375
  /* @__PURE__ */ jsx(Panel, { position: "top-left", children: /* @__PURE__ */ jsx(ButtonGroup, { className: "flex items-center justify-end gap-2", size: "sm", children: /* @__PURE__ */ jsxs(Button, { type: "button", variant: "surface", onClick: handleAddSection, children: [
33904
- /* @__PURE__ */ jsx(LuIcon, { icon: "plus" }),
35376
+ /* @__PURE__ */ jsx(LuIcon, { icon: Plus }),
33905
35377
  " Add section"
33906
35378
  ] }) }) }),
33907
35379
  /* @__PURE__ */ jsxs(Panel, { position: "top-right", className: "flex flex-col items-center gap-2", children: [
@@ -33915,16 +35387,16 @@ const FormBuilderFlowBuilder = memo(() => {
33915
35387
  value: layoutDirection,
33916
35388
  onValueChange: setLayoutDirection,
33917
35389
  children: [
33918
- /* @__PURE__ */ jsx(ToggleGroup.IconItem, { className: "rounded-b-none", value: "LR", type: "button", children: /* @__PURE__ */ jsx(LuIcon, { icon: "arrow-right-left" }) }),
33919
- /* @__PURE__ */ jsx(ToggleGroup.IconItem, { className: "rounded-t-none", value: "TB", type: "button", children: /* @__PURE__ */ jsx(LuIcon, { icon: "arrow-down-up" }) })
35390
+ /* @__PURE__ */ jsx(ToggleGroup.IconItem, { className: "rounded-b-none", value: "LR", type: "button", children: /* @__PURE__ */ jsx(LuIcon, { icon: ArrowLeftRight }) }),
35391
+ /* @__PURE__ */ jsx(ToggleGroup.IconItem, { className: "rounded-t-none", value: "TB", type: "button", children: /* @__PURE__ */ jsx(LuIcon, { icon: ArrowDownUp }) })
33920
35392
  ]
33921
35393
  }
33922
35394
  ),
33923
35395
  /* @__PURE__ */ jsx(Separator, { size: "sm" }),
33924
35396
  /* @__PURE__ */ jsxs(ButtonGroup, { className: "flex flex-col ", size: "sm", accentColor: "base", variant: "soft", children: [
33925
- /* @__PURE__ */ jsx(IconButton, { className: "rounded-b-none", onClick: () => reactFlow == null ? void 0 : reactFlow.zoomIn(), type: "button", children: /* @__PURE__ */ jsx(LuIcon, { icon: "plus" }) }),
33926
- /* @__PURE__ */ jsx(IconButton, { onClick: () => reactFlow == null ? void 0 : reactFlow.zoomOut(), radius: "none", type: "button", children: /* @__PURE__ */ jsx(LuIcon, { icon: "minus" }) }),
33927
- /* @__PURE__ */ jsx(IconButton, { className: "rounded-t-none", onClick: () => reactFlow == null ? void 0 : reactFlow.fitView(), type: "button", children: /* @__PURE__ */ jsx(LuIcon, { icon: "square-dashed" }) })
35397
+ /* @__PURE__ */ jsx(IconButton, { className: "rounded-b-none", onClick: () => reactFlow == null ? void 0 : reactFlow.zoomIn(), type: "button", children: /* @__PURE__ */ jsx(LuIcon, { icon: Plus }) }),
35398
+ /* @__PURE__ */ jsx(IconButton, { onClick: () => reactFlow == null ? void 0 : reactFlow.zoomOut(), radius: "none", type: "button", children: /* @__PURE__ */ jsx(LuIcon, { icon: Minus }) }),
35399
+ /* @__PURE__ */ jsx(IconButton, { className: "rounded-t-none", onClick: () => reactFlow == null ? void 0 : reactFlow.fitView(), type: "button", children: /* @__PURE__ */ jsx(LuIcon, { icon: SquareDashed }) })
33928
35400
  ] })
33929
35401
  ] }),
33930
35402
  /* @__PURE__ */ jsx(Panel, { position: "bottom-right", children: /* @__PURE__ */ jsxs(ButtonGroup, { className: "flex items-center justify-end gap-2", size: "sm", children: [
@@ -33962,7 +35434,7 @@ const FieldSectionConditionalItem = memo((props) => {
33962
35434
  /* @__PURE__ */ jsx(LuIcon, { icon: fieldIcons.section }),
33963
35435
  sourceFieldSection.label ?? UNLABELLED_SECTION_LABEL
33964
35436
  ] }),
33965
- /* @__PURE__ */ jsx(IconButton, { type: "button", onClick: handleDelete, variant: "ghost", children: /* @__PURE__ */ jsx(LuIcon, { icon: "trash" }) })
35437
+ /* @__PURE__ */ jsx(IconButton, { type: "button", onClick: handleDelete, variant: "ghost", children: /* @__PURE__ */ jsx(LuIcon, { icon: Trash }) })
33966
35438
  ] }),
33967
35439
  /* @__PURE__ */ jsxs("div", { className: "flex h-max w-full flex-wrap gap-2", children: [
33968
35440
  conditions.map((condition) => {
@@ -33970,7 +35442,7 @@ const FieldSectionConditionalItem = memo((props) => {
33970
35442
  onRemove: handleDeleteCondition
33971
35443
  });
33972
35444
  }),
33973
- /* @__PURE__ */ jsx(FieldDropdownMenu, { fields: sourceFieldSection.fields, onSelectField: handleSelectField, align: "start", children: /* @__PURE__ */ jsx(IconButton, { type: "button", size: "sm", variant: "soft", accentColor: "base", children: /* @__PURE__ */ jsx(LuIcon, { icon: "plus" }) }) })
35445
+ /* @__PURE__ */ jsx(FieldDropdownMenu, { fields: sourceFieldSection.fields, onSelectField: handleSelectField, align: "start", children: /* @__PURE__ */ jsx(IconButton, { type: "button", size: "sm", variant: "soft", accentColor: "base", children: /* @__PURE__ */ jsx(LuIcon, { icon: Plus }) }) })
33974
35446
  ] })
33975
35447
  ] });
33976
35448
  });
@@ -34032,7 +35504,7 @@ const FieldSectionBuilder = memo((props) => {
34032
35504
  fieldSections: validFieldSections,
34033
35505
  onSelectFieldCondition: handleAddConditional,
34034
35506
  children: /* @__PURE__ */ jsxs(Button, { type: "button", variant: "soft", size: "sm", className: "w-max", children: [
34035
- /* @__PURE__ */ jsx(LuIcon, { icon: "plus" }),
35507
+ /* @__PURE__ */ jsx(LuIcon, { icon: Plus }),
34036
35508
  "Add condition"
34037
35509
  ] })
34038
35510
  }
@@ -34052,15 +35524,9 @@ const FieldSectionBuilder = memo((props) => {
34052
35524
  });
34053
35525
  FieldSectionBuilder.displayName = "FieldSectionBuilder";
34054
35526
  const FieldSectionWithActions = memo((props) => {
34055
- const { fieldSection, index: sectionIndex } = props;
35527
+ const { fieldSection, sectionIndex } = props;
34056
35528
  const fieldSchema = use(FieldSchemaContext);
34057
- const removeField = useCallback(
34058
- (field) => {
34059
- fieldSection.removeField(field);
34060
- },
34061
- [fieldSection]
34062
- );
34063
- const removeSection = useCallback(() => {
35529
+ const handleRemoveSection = useCallback(() => {
34064
35530
  fieldSchema.removeFieldSection(fieldSection);
34065
35531
  }, [fieldSchema, fieldSection]);
34066
35532
  const moveSection = useCallback(
@@ -34073,7 +35539,7 @@ const FieldSectionWithActions = memo((props) => {
34073
35539
  const duplicateSection = useCallback(() => {
34074
35540
  fieldSchema.addFieldSection(fieldSection.duplicate(v4()));
34075
35541
  }, [fieldSchema, fieldSection]);
34076
- const handleCreateField = useCallback(
35542
+ const handleAddField = useCallback(
34077
35543
  (type) => {
34078
35544
  fieldSection.addField(createField(type));
34079
35545
  },
@@ -34085,42 +35551,34 @@ const FieldSectionWithActions = memo((props) => {
34085
35551
  const handleMoveDown = useCallback(() => {
34086
35552
  moveSection("down");
34087
35553
  }, [moveSection]);
34088
- const fieldTypeItems = useFieldTypeItems(handleCreateField);
34089
35554
  return /* @__PURE__ */ jsxs(Card, { variant: "outline", className: "flex items-center justify-between gap-4 w-full", children: [
34090
35555
  /* @__PURE__ */ jsxs("div", { className: "flex grow flex-col gap-4 w-full", children: [
34091
35556
  /* @__PURE__ */ jsx(FieldSectionBuilder, { fieldSection }),
34092
35557
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2 w-full", children: [
34093
35558
  /* @__PURE__ */ jsxs("div", { className: "flex gap-2 justify-between", children: [
34094
35559
  /* @__PURE__ */ jsx(Text, { accentColor: "base", size: "md", children: "Fields" }),
34095
- /* @__PURE__ */ jsxs(Menu.Root, { children: [
34096
- /* @__PURE__ */ jsx(Menu.ClickTrigger, { children: /* @__PURE__ */ jsxs(Button, { type: "button", variant: "soft", size: "sm", children: [
34097
- /* @__PURE__ */ jsx(LuIcon, { icon: "plus" }),
34098
- " Add field"
34099
- ] }) }),
34100
- /* @__PURE__ */ jsx(Menu.Content, { children: /* @__PURE__ */ jsx(Menu.Scroll, { children: fieldTypeItems.flat().map((item) => /* @__PURE__ */ jsxs(Menu.Item, { onSelect: item.onSelect, children: [
34101
- item.icon,
34102
- item.children
34103
- ] }, item.value)) }) })
34104
- ] })
35560
+ /* @__PURE__ */ jsx(CreateFieldDropdownMenu, { onSelectFieldType: handleAddField, children: /* @__PURE__ */ jsxs(Button, { type: "button", variant: "soft", size: "sm", children: [
35561
+ /* @__PURE__ */ jsx(LuIcon, { icon: Plus }),
35562
+ " Add field"
35563
+ ] }) })
34105
35564
  ] }),
34106
35565
  fieldSection.fields.map((child, index) => /* @__PURE__ */ jsx(
34107
- FieldWithActions,
35566
+ FieldBuilderWithActions,
34108
35567
  {
34109
35568
  field: child,
34110
35569
  fieldSection,
34111
- index,
34112
- sectionIndex,
34113
- remove: removeField
35570
+ fieldIndex: index,
35571
+ sectionIndex
34114
35572
  },
34115
35573
  child.identifier
34116
35574
  ))
34117
35575
  ] })
34118
35576
  ] }),
34119
35577
  /* @__PURE__ */ jsxs(ButtonGroup, { className: "flex-col gap-0.5 flex", variant: "ghost", accentColor: "base", size: "sm", children: [
34120
- /* @__PURE__ */ jsx(IconButton, { type: "button", onClick: handleMoveUp, children: /* @__PURE__ */ jsx(LuIcon, { icon: "move-up" }) }),
34121
- /* @__PURE__ */ jsx(IconButton, { type: "button", onClick: handleMoveDown, children: /* @__PURE__ */ jsx(LuIcon, { icon: "move-down" }) }),
34122
- /* @__PURE__ */ jsx(IconButton, { type: "button", onClick: duplicateSection, children: /* @__PURE__ */ jsx(LuIcon, { icon: "copy" }) }),
34123
- /* @__PURE__ */ jsx(IconButton, { type: "button", onClick: removeSection, children: /* @__PURE__ */ jsx(LuIcon, { icon: "trash" }) })
35578
+ /* @__PURE__ */ jsx(IconButton, { type: "button", onClick: handleMoveUp, children: /* @__PURE__ */ jsx(LuIcon, { icon: MoveUp }) }),
35579
+ /* @__PURE__ */ jsx(IconButton, { type: "button", onClick: handleMoveDown, children: /* @__PURE__ */ jsx(LuIcon, { icon: MoveDown }) }),
35580
+ /* @__PURE__ */ jsx(IconButton, { type: "button", onClick: duplicateSection, children: /* @__PURE__ */ jsx(LuIcon, { icon: Copy }) }),
35581
+ /* @__PURE__ */ jsx(IconButton, { type: "button", onClick: handleRemoveSection, children: /* @__PURE__ */ jsx(LuIcon, { icon: Trash }) })
34124
35582
  ] })
34125
35583
  ] });
34126
35584
  });
@@ -34169,7 +35627,14 @@ const FormBuilderListBuilder = memo(() => {
34169
35627
  }
34170
35628
  ),
34171
35629
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", children: [
34172
- fieldSchema.fieldSections.map((fieldSection, index) => /* @__PURE__ */ jsx(FieldSectionWithActions, { fieldSection, index }, fieldSection.identifier)),
35630
+ fieldSchema.fieldSections.map((fieldSection, index) => /* @__PURE__ */ jsx(
35631
+ FieldSectionWithActions,
35632
+ {
35633
+ fieldSection,
35634
+ sectionIndex: index
35635
+ },
35636
+ fieldSection.identifier
35637
+ )),
34173
35638
  /* @__PURE__ */ jsxs(
34174
35639
  Button,
34175
35640
  {
@@ -34180,7 +35645,7 @@ const FormBuilderListBuilder = memo(() => {
34180
35645
  size: "sm",
34181
35646
  onClick: handleCreateEmptySection,
34182
35647
  children: [
34183
- /* @__PURE__ */ jsx(LuIcon, { icon: "plus" }),
35648
+ /* @__PURE__ */ jsx(LuIcon, { icon: Plus }),
34184
35649
  " Add section"
34185
35650
  ]
34186
35651
  }
@@ -34216,53 +35681,28 @@ const validateFields = (fields, values) => {
34216
35681
  }
34217
35682
  if (Object.keys(errors).length > 0) return errors;
34218
35683
  };
34219
- const initializeFieldValues = (fields, values) => {
34220
- const ret = {};
34221
- for (const field of fields) {
34222
- const value = values[field.identifier];
34223
- ret[field.identifier] = value !== void 0 ? value : field.blankValue();
34224
- }
34225
- return ret;
34226
- };
34227
- const changedFieldValues = (fields, values1, values2) => {
34228
- const ret = {};
34229
- for (const field of fields) {
34230
- const value1 = values1[field.identifier];
34231
- const value2 = values2[field.identifier];
34232
- if (field.areValuesEqual(value1, value2)) continue;
34233
- ret[field.identifier] = value2;
34234
- }
34235
- return ret;
34236
- };
34237
- const unchangedFieldValues = (fields, values1, values2) => {
34238
- const ret = {};
35684
+ const cleanFields = (fields, values) => {
35685
+ const errors = {};
35686
+ const sectionElements = fields.filter((f) => f instanceof FieldSection);
34239
35687
  for (const field of fields) {
34240
- const value1 = values1[field.identifier];
34241
- const value2 = values2[field.identifier];
34242
- if (!field.areValuesEqual(value1, value2)) continue;
34243
- ret[field.identifier] = value2;
35688
+ if (field instanceof FieldSection) {
35689
+ const conditionalSections = sectionElements.filter((section) => field.identifier in section.conditions);
35690
+ const conditionMet = conditionalSections.length > 0 ? conditionalSections.some(
35691
+ (conditionalSection) => applyConditions(conditionalSection.getConditions(field.identifier), values)
35692
+ ) : true;
35693
+ if (conditionMet) continue;
35694
+ } else {
35695
+ if (!(field instanceof BaseField)) {
35696
+ throw new Error("Invalid field type");
35697
+ }
35698
+ const id = field.identifier;
35699
+ const error = field.getError(get(values, id));
35700
+ if (error) set(errors, id, error);
35701
+ }
34244
35702
  }
34245
- return ret;
34246
- };
34247
- const isArrayOfFiles = (value) => {
34248
- return Array.isArray(value) && value[0] instanceof File;
34249
- };
34250
- const separateFilesFromFieldValues = (values) => {
34251
- const files = {};
34252
- const newValues = {};
34253
- for (const key in values) {
34254
- const value = values[key];
34255
- if (value instanceof File) {
34256
- files[key] = [value];
34257
- } else if (isArrayOfFiles(value)) {
34258
- files[key] = value;
34259
- } else if (value !== void 0) {
34260
- newValues[key] = value;
34261
- }
34262
- }
34263
- return { values: newValues, files };
35703
+ if (Object.keys(errors).length > 0) return errors;
34264
35704
  };
34265
- const separateFilesFromFields = async (fields) => {
35705
+ const separateImagesFromFields = async (fields) => {
34266
35706
  const images = {};
34267
35707
  const newFields = [];
34268
35708
  for (const section of fields) {
@@ -34290,16 +35730,12 @@ const separateFilesFromFields = async (fields) => {
34290
35730
  }
34291
35731
  return { fields: newFields, images };
34292
35732
  };
34293
- async function awaitPromisesFromFieldValues(values) {
34294
- const valuesWithoutFiles = {};
35733
+ async function awaitFilesAndPromises(values) {
35734
+ const ret = {};
34295
35735
  for (const [key, value] of Object.entries(values)) {
34296
- if (Array.isArray(value) && value.some((item) => item instanceof UUIDPromise)) {
34297
- valuesWithoutFiles[key] = await Promise.all(value);
34298
- } else {
34299
- valuesWithoutFiles[key] = value;
34300
- }
35736
+ ret[key] = await Promise.all(value);
34301
35737
  }
34302
- return valuesWithoutFiles;
35738
+ return ret;
34303
35739
  }
34304
35740
  const FormRenderer = memo(
34305
35741
  forwardRef((props, ref) => {
@@ -34395,13 +35831,13 @@ const FormRenderer = memo(
34395
35831
  variant: "soft",
34396
35832
  onClick: onCancel,
34397
35833
  children: [
34398
- /* @__PURE__ */ jsx(LuIcon, { icon: "x" }),
35834
+ /* @__PURE__ */ jsx(LuIcon, { icon: X }),
34399
35835
  cancelText
34400
35836
  ]
34401
35837
  }
34402
35838
  ),
34403
35839
  /* @__PURE__ */ jsxs(Button, { ...buttonProps, type: "submit", accentColor: "primary", variant: "surface", children: [
34404
- /* @__PURE__ */ jsx(LuIcon, { icon: "check" }),
35840
+ /* @__PURE__ */ jsx(LuIcon, { icon: Check }),
34405
35841
  submitText
34406
35842
  ] })
34407
35843
  ] })
@@ -34521,33 +35957,6 @@ const FormBuilder = {
34521
35957
  ListBuilder: FormBuilderListBuilder,
34522
35958
  Preview: FormBuilderPreview
34523
35959
  };
34524
- const ScannerContext = createContext(() => {
34525
- throw new Error("No ScannerProvider found");
34526
- });
34527
- const useScanner = () => use(ScannerContext);
34528
- const ScannerProvider = memo((props) => {
34529
- const { children } = props;
34530
- const [config, setConfig] = useState(null);
34531
- const closeFileViewer = useCallback(() => {
34532
- setConfig(null);
34533
- }, []);
34534
- const openFileViewer = useCallback(
34535
- (func) => {
34536
- setConfig(func(closeFileViewer));
34537
- },
34538
- [closeFileViewer]
34539
- );
34540
- const handleClose = useCallback(() => {
34541
- if (!config) return;
34542
- if (config.onClose) config.onClose();
34543
- closeFileViewer();
34544
- }, [closeFileViewer, config]);
34545
- return /* @__PURE__ */ jsxs(ScannerContext.Provider, { value: openFileViewer, children: [
34546
- children,
34547
- config && /* @__PURE__ */ jsx(Scanner, { open: true, onOpenChange: handleClose, ...config })
34548
- ] });
34549
- });
34550
- ScannerProvider.displayName = "FileViewerProvider";
34551
35960
  export {
34552
35961
  BaseCondition,
34553
35962
  BaseField,
@@ -34564,6 +35973,7 @@ export {
34564
35973
  CheckboxListFieldCondition,
34565
35974
  CheckboxListFieldConditionCell,
34566
35975
  CheckboxListInput,
35976
+ ConditionManager,
34567
35977
  DateAfterConditionModifier,
34568
35978
  DateBeforeConditionModifier,
34569
35979
  DateEqualsConditionModifier,
@@ -34614,10 +36024,23 @@ export {
34614
36024
  OTPFieldCondition,
34615
36025
  OTPFieldConditionCell,
34616
36026
  OTPInput,
36027
+ Observable,
36028
+ PassFailArrayExcludesConditionModifier,
36029
+ PassFailArrayIncludesConditionModifier,
36030
+ PassFailEqualsConditionModifier,
36031
+ PassFailField,
36032
+ PassFailFieldCondition,
36033
+ PassFailFieldConditionCell,
36034
+ PassFailInput,
36035
+ PassFailNotEqualsConditionModifier,
34617
36036
  RadioField,
34618
36037
  RadioFieldCondition,
34619
36038
  RadioFieldConditionCell,
34620
36039
  RadioInput,
36040
+ RatingField,
36041
+ RatingFieldCondition,
36042
+ RatingFieldConditionCell,
36043
+ RatingInput,
34621
36044
  SEVERITY_COLOR_MAPPING,
34622
36045
  SHORT_TEXT_FIELD_MAX_LENGTH,
34623
36046
  ScanField,
@@ -34649,15 +36072,19 @@ export {
34649
36072
  TextFieldCondition,
34650
36073
  TextFieldConditionCell,
34651
36074
  TextInput,
36075
+ UUIDFile,
34652
36076
  UUIDPromise,
34653
36077
  UploadField,
34654
36078
  UploadFieldCondition,
34655
36079
  UploadFieldConditionCell,
34656
36080
  UploadInput,
34657
36081
  applyConditions,
34658
- awaitPromisesFromFieldValues,
36082
+ areFileAndPromiseArraysEqual,
36083
+ arePassFieldValuesEqual,
36084
+ awaitFilesAndPromises,
34659
36085
  changedFieldValues,
34660
36086
  cleanFieldValues,
36087
+ cleanFields,
34661
36088
  cleanSerializedFieldValues,
34662
36089
  createCondition,
34663
36090
  createConditionModifierConfig,
@@ -34669,18 +36096,28 @@ export {
34669
36096
  deserializeFieldValues,
34670
36097
  deserializeFields,
34671
36098
  deserializeOnlyFields,
36099
+ deserializePassFailFieldValue,
36100
+ extractFilesAndPromisesFromFieldValues,
34672
36101
  fieldIcons,
34673
36102
  flattenFields,
34674
36103
  getFieldsMapping,
34675
36104
  initializeFieldValues,
36105
+ insertFilesAndPromisesToFieldValues,
36106
+ isFileAndPromiseArray,
36107
+ isPassFailFieldStatus,
36108
+ isPassFailFieldValue,
36109
+ isSerializedPassFailFieldValue,
34676
36110
  isStringArray,
34677
36111
  maxFileSizeB,
34678
36112
  maxFileSizeKB,
34679
36113
  maxFileSizeMB,
34680
- separateFilesFromFieldValues,
34681
- separateFilesFromFields,
36114
+ passFailFieldStatusMapping,
36115
+ passFailFieldStatuses,
36116
+ separateImagesFromFields,
34682
36117
  serializeFieldValues,
36118
+ serializePassFailFieldValue,
34683
36119
  unchangedFieldValues,
36120
+ useConditionManager,
34684
36121
  useFieldInput,
34685
36122
  useFieldInputs,
34686
36123
  useFormikInput,