@nivaro/react 0.3.23 → 0.3.25

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 (28) hide show
  1. package/dist/hooks/useSessionRecorder.js +1 -1
  2. package/dist/index.d.ts +50 -26
  3. package/dist/shared/components/FilePreviewLightbox.js +56 -35
  4. package/dist/shared/components/ItemEditForm.js +4309 -4263
  5. package/dist/shared/components/PageRenderer.js +63 -62
  6. package/dist/shared/components/ProfileView.js +555 -520
  7. package/dist/shared/components/RecordReadView.js +229 -229
  8. package/dist/shared/components/ReportView.js +123 -120
  9. package/dist/shared/components/ai/AiMarkdown.js +168 -148
  10. package/dist/shared/components/chat/RoomParts.js +120 -119
  11. package/dist/shared/components/chat/chat-core.js +228 -224
  12. package/dist/shared/components/item-edit/FieldRenderer.js +333 -333
  13. package/dist/shared/components/item-edit/FieldRow.js +413 -394
  14. package/dist/shared/components/item-edit/GroupSection.js +637 -635
  15. package/dist/shared/components/item-edit/InlineGridField.js +89 -90
  16. package/dist/shared/components/item-edit/QuickPicker.js +9 -9
  17. package/dist/shared/components/item-edit/RawEditSheet.js +80 -79
  18. package/dist/shared/components/item-edit/RowMatchPanel.js +1 -1
  19. package/dist/shared/components/item-edit/m2m-invalidate.js +19 -0
  20. package/dist/shared/components/item-edit/record-lookups.js +15 -0
  21. package/dist/shared/components/item-edit/render-stability.js +147 -0
  22. package/dist/shared/components/layout-editor/FormMapButton.js +5 -4
  23. package/dist/shared/components/notifications/DeliveryChips.js +27 -17
  24. package/dist/shared/components/profile/TeamsConnect.js +71 -0
  25. package/dist/shared/components/profile/primitives.js +4 -4
  26. package/dist/shared/lib/safe-href.js +10 -0
  27. package/dist/shared/lib/socket-realtime.js +107 -78
  28. package/package.json +6 -6
@@ -1,111 +1,111 @@
1
- import { jsx as i, jsxs as g } from "react/jsx-runtime";
2
- import { ExternalLink as Le } from "lucide-react";
3
- import { useContext as Ee, useRef as J, useEffect as oe, useState as qe } from "react";
4
- import { useDrilldown as Te, useParentDraft as Je, RelationPathDataContext as He, useApiFetchConfig as Ve, fieldDrilldownConfig as V } from "../../context.js";
5
- import { getFieldInterface as $e } from "../../lib/field-interfaces.js";
6
- import { precisionOf as Ge } from "../../lib/format-value.js";
7
- import { resolveOptionFilterTokens as ne } from "../../lib/option-filter-tokens.js";
8
- import { counterOf as Ke } from "../../lib/placement-behaviour.js";
9
- import { choiceLabel as We } from "../../lib/utils.js";
10
- import { Badge as Ye } from "../ui/badge.js";
1
+ import { jsx as n, jsxs as g } from "react/jsx-runtime";
2
+ import { ExternalLink as Ee } from "lucide-react";
3
+ import { memo as qe, useContext as Te, useRef as J, useEffect as ne, useState as Je } from "react";
4
+ import { useDrilldown as He, useParentDraft as Ve, RelationPathDataContext as $e, useApiFetchConfig as Ge, fieldDrilldownConfig as V } from "../../context.js";
5
+ import { getFieldInterface as Ke } from "../../lib/field-interfaces.js";
6
+ import { precisionOf as We } from "../../lib/format-value.js";
7
+ import { resolveOptionFilterTokens as ie } from "../../lib/option-filter-tokens.js";
8
+ import { counterOf as Ye } from "../../lib/placement-behaviour.js";
9
+ import { choiceLabel as ze } from "../../lib/utils.js";
10
+ import { Badge as Ue } from "../ui/badge.js";
11
11
  import { Input as B } from "../ui/input.js";
12
- import { Label as ze } from "../ui/label.js";
13
- import { SimpleSelect as Ue } from "../ui/SimpleSelect.js";
14
- import { Switch as Ce } from "../ui/switch.js";
12
+ import { Label as Ce } from "../ui/label.js";
13
+ import { SimpleSelect as Qe } from "../ui/SimpleSelect.js";
14
+ import { Switch as Xe } from "../ui/switch.js";
15
15
  import { Textarea as $ } from "../ui/textarea.js";
16
- import { CatalogPickerField as Qe } from "./CatalogPickerField.js";
17
- import { columnMaxLength as ie } from "./column-length.js";
18
- import { useFieldAffordances as Xe } from "./FieldAffordances.js";
19
- import { ProgressField as ae, RatingScaleField as le, DurationReadOnly as Ze, ChecklistReadOnly as Oe, ColorPackField as se, PhoneField as ce, EmailField as et, AddressAutocompleteField as tt } from "./FieldPack.js";
20
- import { FilePickerField as rt, FileM2MField as ot } from "./FilePickerField.js";
16
+ import { CatalogPickerField as Ze } from "./CatalogPickerField.js";
17
+ import { columnMaxLength as ae } from "./column-length.js";
18
+ import { useFieldAffordances as Oe } from "./FieldAffordances.js";
19
+ import { ProgressField as le, RatingScaleField as se, DurationReadOnly as et, ChecklistReadOnly as tt, ColorPackField as ce, PhoneField as de, EmailField as rt, AddressAutocompleteField as ot } from "./FieldPack.js";
20
+ import { FilePickerField as nt, FileM2MField as it } from "./FilePickerField.js";
21
21
  import { formatDisplayValue as L } from "./GroupSection.js";
22
- import { parseJson as _, toLocalDatetime as nt } from "./helpers.js";
23
- import { InlineGridField as it } from "./InlineGridField.js";
24
- import { InlineTableField as at } from "./InlineTableField.js";
25
- import { checkNumberEntry as lt } from "./line-qty.js";
26
- import { M2MSingleSelectCombobox as st, M2MCombobox as ct } from "./M2MCombobox.js";
27
- import { MembershipSetField as dt } from "./MembershipSetField.js";
28
- import { PlanGridField as ut } from "./PlanGrid.js";
29
- import { smartParseDate as mt, CountdownChip as pt, DurationField as yt, FiscalPeriodField as _t, ChecklistField as ft, RepeaterField as bt, RangeSliderField as xt, DateRangeField as ht, AddressField as gt, maskFor as vt, applyInputMask as de } from "./PolishFields.js";
30
- import { QuickCreateButton as wt } from "./QuickCreateButton.js";
31
- import { RelationCombobox as Nt } from "./RelationCombobox.js";
32
- import { RelationGroupedCombobox as kt } from "./RelationGroupedCombobox.js";
33
- import { RichTextEditor as Ft } from "./RichTextEditor.js";
34
- function At({
35
- plugin: e,
36
- props: n
22
+ import { parseJson as y, toLocalDatetime as at } from "./helpers.js";
23
+ import { InlineGridField as lt } from "./InlineGridField.js";
24
+ import { InlineTableField as st } from "./InlineTableField.js";
25
+ import { checkNumberEntry as ct } from "./line-qty.js";
26
+ import { M2MSingleSelectCombobox as dt, M2MCombobox as ut } from "./M2MCombobox.js";
27
+ import { MembershipSetField as mt } from "./MembershipSetField.js";
28
+ import { PlanGridField as pt } from "./PlanGrid.js";
29
+ import { smartParseDate as yt, CountdownChip as _t, DurationField as ft, FiscalPeriodField as bt, ChecklistField as xt, RepeaterField as ht, RangeSliderField as gt, DateRangeField as vt, AddressField as wt, maskFor as Nt, applyInputMask as ue } from "./PolishFields.js";
30
+ import { QuickCreateButton as kt } from "./QuickCreateButton.js";
31
+ import { RelationCombobox as Ft } from "./RelationCombobox.js";
32
+ import { RelationGroupedCombobox as At } from "./RelationGroupedCombobox.js";
33
+ import { RichTextEditor as Rt } from "./RichTextEditor.js";
34
+ function St({
35
+ plugin: w,
36
+ props: e
37
37
  }) {
38
- const l = J(null), m = J(void 0), y = J(n);
39
- return y.current = n, oe(() => {
40
- if (l.current)
41
- return l.current.innerHTML = "", m.current = e.mount(l.current, y.current), () => {
42
- var c, u;
43
- (u = (c = m.current) == null ? void 0 : c.destroy) == null || u.call(c), m.current = void 0;
38
+ const i = J(null), l = J(void 0), p = J(e);
39
+ return p.current = e, ne(() => {
40
+ if (i.current)
41
+ return i.current.innerHTML = "", l.current = w.mount(i.current, p.current), () => {
42
+ var c, d;
43
+ (d = (c = l.current) == null ? void 0 : c.destroy) == null || d.call(c), l.current = void 0;
44
44
  };
45
- }, [e]), oe(() => {
46
- var c, u;
47
- (u = (c = m.current) == null ? void 0 : c.update) == null || u.call(c, n);
48
- }, [n]), /* @__PURE__ */ i("div", { ref: l, "data-custom-interface": e.interface });
45
+ }, [w]), ne(() => {
46
+ var c, d;
47
+ (d = (c = l.current) == null ? void 0 : c.update) == null || d.call(c, e);
48
+ }, [e]), /* @__PURE__ */ n("div", { ref: i, "data-custom-interface": w.interface });
49
49
  }
50
- function ue(e) {
51
- const n = e.validation_rules, l = Array.isArray(n) ? n : _(typeof n == "string" ? n : null);
52
- if (!Array.isArray(l)) return {};
53
- const m = (c) => {
54
- const u = /* @__PURE__ */ new Date();
55
- u.setDate(u.getDate() + c);
56
- const v = (F) => String(F).padStart(2, "0");
57
- return `${u.getFullYear()}-${v(u.getMonth() + 1)}-${v(u.getDate())}`;
58
- }, y = {};
59
- for (const c of l) {
60
- const u = Number(c == null ? void 0 : c.value);
61
- Number.isFinite(u) && ((c == null ? void 0 : c.type) === "min_days_from_today" && (y.min = m(u)), (c == null ? void 0 : c.type) === "max_days_from_today" && (y.max = m(u)));
50
+ function me(w) {
51
+ const e = w.validation_rules, i = Array.isArray(e) ? e : y(typeof e == "string" ? e : null);
52
+ if (!Array.isArray(i)) return {};
53
+ const l = (c) => {
54
+ const d = /* @__PURE__ */ new Date();
55
+ d.setDate(d.getDate() + c);
56
+ const b = (v) => String(v).padStart(2, "0");
57
+ return `${d.getFullYear()}-${b(d.getMonth() + 1)}-${b(d.getDate())}`;
58
+ }, p = {};
59
+ for (const c of i) {
60
+ const d = Number(c == null ? void 0 : c.value);
61
+ Number.isFinite(d) && ((c == null ? void 0 : c.type) === "min_days_from_today" && (p.min = l(d)), (c == null ? void 0 : c.type) === "max_days_from_today" && (p.max = l(d)));
62
62
  }
63
- return y;
63
+ return p;
64
64
  }
65
- function sr({
65
+ const dr = qe(function({
66
66
  field: e,
67
- value: n,
67
+ value: i,
68
68
  onChange: l,
69
- relations: m,
70
- collection: y,
71
- itemId: c,
72
- cascadeFilter: u,
69
+ relations: p,
70
+ collection: c,
71
+ itemId: d,
72
+ cascadeFilter: b,
73
73
  requiredParentLabel: v,
74
- narrowedBy: F,
75
- onCountChange: d,
76
- displayOnly: w,
77
- prefillParentId: me,
78
- pinnedOption: G
74
+ narrowedBy: u,
75
+ onCountChange: N,
76
+ displayOnly: G,
77
+ prefillParentId: pe,
78
+ pinnedOption: K
79
79
  }) {
80
- var U, C, Q, X, Z, O, ee, te, re;
81
- const j = Te(), P = Xe(), A = Je(), H = Ee(He), D = A, f = (() => {
80
+ var C, Q, X, Z, O, ee, te, re, oe;
81
+ const j = He(), P = Oe(), A = Ve(), H = Te($e), D = A, _ = (() => {
82
82
  try {
83
- return Ve();
83
+ return Ge();
84
84
  } catch {
85
85
  return null;
86
86
  }
87
- })(), s = e.interface ?? "", K = J($e(s)).current;
88
- if (K)
89
- return /* @__PURE__ */ i(
90
- At,
87
+ })(), s = e.interface ?? "", W = J(Ke(s)).current;
88
+ if (W)
89
+ return /* @__PURE__ */ n(
90
+ St,
91
91
  {
92
- plugin: K,
92
+ plugin: W,
93
93
  props: {
94
- value: n,
94
+ value: i,
95
95
  onChange: l,
96
96
  field: { field: e.field, label: e.label, options: e.options },
97
- readOnly: !!e.readonly || !!w,
98
- collection: y,
99
- itemId: c || null
97
+ readOnly: !!e.readonly || !!G,
98
+ collection: c,
99
+ itemId: d || null
100
100
  }
101
101
  }
102
102
  );
103
103
  if (s === "file-image" || s === "file") {
104
- const r = _(e.options);
105
- return /* @__PURE__ */ i(
106
- rt,
104
+ const r = y(e.options);
105
+ return /* @__PURE__ */ n(
106
+ nt,
107
107
  {
108
- value: n,
108
+ value: i,
109
109
  onChange: l,
110
110
  disabled: e.readonly,
111
111
  allowUpload: (r == null ? void 0 : r.allow_upload) !== !1,
@@ -113,39 +113,39 @@ function sr({
113
113
  }
114
114
  );
115
115
  }
116
- const W = !s || s.startsWith("relation-") || s === "select-multiple-m2m" || s.endsWith("-m2o") || s.endsWith("-m2m"), N = W ? m.find(
117
- (r) => r.many_collection === y && r.many_field === e.field && !r.junction_field
116
+ const Y = !s || s.startsWith("relation-") || s === "select-multiple-m2m" || s.endsWith("-m2o") || s.endsWith("-m2m"), k = Y ? p.find(
117
+ (r) => r.many_collection === c && r.many_field === e.field && !r.junction_field
118
118
  ) : null;
119
- if (N != null && N.one_collection) {
119
+ if (k != null && k.one_collection) {
120
120
  if (s === "relation-grouped") {
121
- const p = _(e.options);
122
- if (p != null && p.group_field && (p != null && p.option_field))
123
- return /* @__PURE__ */ i(
124
- kt,
121
+ const m = y(e.options);
122
+ if (m != null && m.group_field && (m != null && m.option_field))
123
+ return /* @__PURE__ */ n(
124
+ At,
125
125
  {
126
- collection: N.one_collection,
127
- value: n,
126
+ collection: k.one_collection,
127
+ value: i,
128
128
  onChange: l,
129
- groupField: p.group_field,
130
- optionField: p.option_field,
129
+ groupField: m.group_field,
130
+ optionField: m.option_field,
131
131
  disabled: e.readonly,
132
132
  placeholder: e.placeholder ?? void 0,
133
- extraFilter: u,
134
- pinned: G
133
+ extraFilter: b,
134
+ pinned: K
135
135
  }
136
136
  );
137
137
  }
138
- const r = j && n != null && n !== "" ? V(e) : null, o = _(e.options), a = ne(
138
+ const r = j && i != null && i !== "" ? V(e) : null, o = y(e.options), a = ie(
139
139
  o != null && o.option_filter && typeof o.option_filter == "object" ? o.option_filter : void 0,
140
140
  A == null ? void 0 : A.draft,
141
- c
142
- ), t = a ? u ? { _and: [a, u] } : a : u, b = /* @__PURE__ */ i(
143
- Nt,
141
+ d
142
+ ), t = a ? b ? { _and: [a, b] } : a : b, f = /* @__PURE__ */ n(
143
+ Ft,
144
144
  {
145
145
  fieldKey: e.field,
146
- missPlacement: (P == null ? void 0 : P.layoutId) != null && P.pickerMisses !== !1 ? { layoutId: Number(P.layoutId), collection: y, field: e.field } : null,
147
- collection: N.one_collection,
148
- value: n,
146
+ missPlacement: (P == null ? void 0 : P.layoutId) != null && P.pickerMisses !== !1 ? { layoutId: Number(P.layoutId), collection: c, field: e.field } : null,
147
+ collection: k.one_collection,
148
+ value: i,
149
149
  onChange: l,
150
150
  disabled: e.readonly,
151
151
  placeholder: e.placeholder ?? void 0,
@@ -153,65 +153,65 @@ function sr({
153
153
  autoSelectSingle: (o == null ? void 0 : o.auto_select_single) === !0,
154
154
  optionSort: typeof (o == null ? void 0 : o.option_sort) == "string" && o.option_sort ? o.option_sort : void 0,
155
155
  requiredParent: v ?? void 0,
156
- narrowedBy: F,
157
- pinned: G,
158
- facets: Array.isArray(o == null ? void 0 : o.picker_facets) ? o.picker_facets.map((p) => ({
159
- ...p,
156
+ narrowedBy: u,
157
+ pinned: K,
158
+ facets: Array.isArray(o == null ? void 0 : o.picker_facets) ? o.picker_facets.map((m) => ({
159
+ ...m,
160
160
  // Facet filters support the same '$parent.<field>' tokens (and
161
161
  // _and clause pruning) as option_filter, resolved from the same
162
162
  // parent draft — keeps facet option lists in sync with the main
163
163
  // option query's eligibility clauses.
164
- filter: p.filter && typeof p.filter == "object" ? ne(p.filter, A == null ? void 0 : A.draft, c) : void 0
164
+ filter: m.filter && typeof m.filter == "object" ? ie(m.filter, A == null ? void 0 : A.draft, d) : void 0
165
165
  })) : void 0
166
166
  }
167
167
  ), h = o != null && o.quick_create && Array.isArray(o.quick_create.fields) && !e.readonly ? o.quick_create : null;
168
- return !r && !h ? b : /* @__PURE__ */ g("div", { className: "flex items-center gap-1.5", children: [
169
- /* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: b }),
170
- h && /* @__PURE__ */ i(
171
- wt,
168
+ return !r && !h ? f : /* @__PURE__ */ g("div", { className: "flex items-center gap-1.5", children: [
169
+ /* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: f }),
170
+ h && /* @__PURE__ */ n(
171
+ kt,
172
172
  {
173
- targetCollection: N.one_collection,
173
+ targetCollection: k.one_collection,
174
174
  config: h,
175
- onCreated: (p) => l(p)
175
+ onCreated: (m) => l(m)
176
176
  }
177
177
  ),
178
- r && /* @__PURE__ */ i(
178
+ r && /* @__PURE__ */ n(
179
179
  "button",
180
180
  {
181
181
  type: "button",
182
182
  title: "Open detail panel",
183
183
  onClick: () => j == null ? void 0 : j.open({
184
- collection: N.one_collection,
185
- itemId: String(n),
184
+ collection: k.one_collection,
185
+ itemId: String(i),
186
186
  layoutId: r.layout_id,
187
187
  width: r.width
188
188
  }),
189
189
  className: "shrink-0 rounded p-1 text-slate-400 hover:bg-slate-100 hover:text-nvr-cyan dark:hover:bg-slate-800",
190
- children: /* @__PURE__ */ i(Le, { className: "h-3.5 w-3.5" })
190
+ children: /* @__PURE__ */ n(Ee, { className: "h-3.5 w-3.5" })
191
191
  }
192
192
  )
193
193
  ] });
194
194
  }
195
- const E = W && !N ? (() => {
196
- const r = m.find(
197
- (a) => a.one_collection === y && (a.one_field === e.field || a.junction_field != null && a.many_collection === e.field)
195
+ const E = Y && !k ? (() => {
196
+ const r = p.find(
197
+ (a) => a.one_collection === c && (a.one_field === e.field || a.junction_field != null && a.many_collection === e.field)
198
198
  );
199
199
  if (!r) return null;
200
200
  if (r.junction_field) return r;
201
- const o = m.find(
201
+ const o = p.find(
202
202
  (a) => a.many_collection === r.many_collection && a.id !== r.id
203
203
  );
204
204
  return o ? { ...r, junction_field: o.many_field } : null;
205
205
  })() : null;
206
206
  if (E) {
207
207
  if (s === "files-m2m") {
208
- const a = _(e.options);
209
- return /* @__PURE__ */ i(
210
- ot,
208
+ const a = y(e.options);
209
+ return /* @__PURE__ */ n(
210
+ it,
211
211
  {
212
212
  relation: E,
213
- parentId: c,
214
- allRelations: m,
213
+ parentId: d,
214
+ allRelations: p,
215
215
  disabled: e.readonly,
216
216
  allowUpload: (a == null ? void 0 : a.allow_upload) !== !1,
217
217
  allowPick: (a == null ? void 0 : a.allow_pick) !== !1,
@@ -219,38 +219,38 @@ function sr({
219
219
  }
220
220
  );
221
221
  }
222
- const r = _(e.options), o = typeof (r == null ? void 0 : r.option_sort) == "string" && r.option_sort ? r.option_sort : void 0;
223
- return (r == null ? void 0 : r.max_values) === 1 ? /* @__PURE__ */ i(
224
- st,
222
+ const r = y(e.options), o = typeof (r == null ? void 0 : r.option_sort) == "string" && r.option_sort ? r.option_sort : void 0;
223
+ return (r == null ? void 0 : r.max_values) === 1 ? /* @__PURE__ */ n(
224
+ dt,
225
225
  {
226
226
  relation: E,
227
- parentId: c,
228
- allRelations: m,
229
- extraFilter: u,
227
+ parentId: d,
228
+ allRelations: p,
229
+ extraFilter: b,
230
230
  optionSort: o,
231
231
  requiredParent: v ?? void 0,
232
- onCountChange: d,
233
- readOnly: w
232
+ onCountChange: N,
233
+ readOnly: G
234
234
  }
235
- ) : /* @__PURE__ */ i(
236
- ct,
235
+ ) : /* @__PURE__ */ n(
236
+ ut,
237
237
  {
238
238
  relation: E,
239
- parentId: c,
240
- allRelations: m,
241
- extraFilter: u,
239
+ parentId: d,
240
+ allRelations: p,
241
+ extraFilter: b,
242
242
  optionSort: o,
243
243
  requiredParent: v ?? void 0,
244
- onCountChange: d,
244
+ onCountChange: N,
245
245
  drilldown: V(e)
246
246
  }
247
247
  );
248
248
  }
249
249
  if (e.readonly && s !== "inline-table") {
250
- if (s === "relation-path" && n != null && n !== "" && j) {
250
+ if (s === "relation-path" && i != null && i !== "" && j) {
251
251
  const a = V(e), t = H == null ? void 0 : H[e.field];
252
252
  if (a && (t != null && t.target_collection) && t.ids.length > 0)
253
- return /* @__PURE__ */ i("div", { className: "min-h-[36px] flex items-center", children: /* @__PURE__ */ i(
253
+ return /* @__PURE__ */ n("div", { className: "min-h-[36px] flex items-center", children: /* @__PURE__ */ n(
254
254
  "button",
255
255
  {
256
256
  type: "button",
@@ -259,56 +259,56 @@ function sr({
259
259
  itemId: t.ids[0],
260
260
  layoutId: a.layout_id,
261
261
  width: a.width,
262
- title: String(n)
262
+ title: String(i)
263
263
  }),
264
264
  className: "text-left text-sm text-slate-700 underline decoration-slate-300 decoration-dotted underline-offset-2 hover:text-[#172940] hover:decoration-nvr-cyan dark:text-slate-200 dark:hover:text-nvr-cyan",
265
- children: L(n, e)
265
+ children: L(i, e)
266
266
  }
267
267
  ) });
268
268
  }
269
- const r = (U = e.options) == null ? void 0 : U.__live_delta;
269
+ const r = (C = e.options) == null ? void 0 : C.__live_delta;
270
270
  if (r && Number.isFinite(Number(r.live))) {
271
- const a = Number(r.original), t = Number(r.live) - (Number.isFinite(a) ? a : 0), b = Math.round(t * 100) / 100;
271
+ const a = Number(r.original), t = Number(r.live) - (Number.isFinite(a) ? a : 0), f = Math.round(t * 100) / 100;
272
272
  return /* @__PURE__ */ g("div", { className: "flex min-h-[36px] flex-wrap items-center gap-x-2 gap-y-0.5", children: [
273
- /* @__PURE__ */ i("span", { className: "text-sm text-slate-400 line-through tabular-nums", children: L(r.original, e) }),
274
- /* @__PURE__ */ i("span", { className: "text-slate-300", "aria-hidden": !0, children: "→" }),
275
- /* @__PURE__ */ i("span", { className: "text-sm font-medium tabular-nums", children: L(r.live, e) }),
276
- b !== 0 && /* @__PURE__ */ g(
273
+ /* @__PURE__ */ n("span", { className: "text-sm text-slate-400 line-through tabular-nums", children: L(r.original, e) }),
274
+ /* @__PURE__ */ n("span", { className: "text-slate-300", "aria-hidden": !0, children: "→" }),
275
+ /* @__PURE__ */ n("span", { className: "text-sm font-medium tabular-nums", children: L(r.live, e) }),
276
+ f !== 0 && /* @__PURE__ */ g(
277
277
  "span",
278
278
  {
279
- className: `rounded px-1.5 py-px text-[11px] font-medium tabular-nums ${b > 0 ? "bg-emerald-50 text-emerald-700 dark:bg-emerald-900/20 dark:text-emerald-400" : "bg-red-50 text-red-700 dark:bg-red-900/20 dark:text-red-400"}`,
279
+ className: `rounded px-1.5 py-px text-[11px] font-medium tabular-nums ${f > 0 ? "bg-emerald-50 text-emerald-700 dark:bg-emerald-900/20 dark:text-emerald-400" : "bg-red-50 text-red-700 dark:bg-red-900/20 dark:text-red-400"}`,
280
280
  children: [
281
- b > 0 ? "+" : "−",
282
- L(Math.abs(b), e)
281
+ f > 0 ? "+" : "−",
282
+ L(Math.abs(f), e)
283
283
  ]
284
284
  }
285
285
  )
286
286
  ] });
287
287
  }
288
- if (s === "progress") return /* @__PURE__ */ i(ae, { value: n, onChange: l, readOnly: !0 });
288
+ if (s === "progress") return /* @__PURE__ */ n(le, { value: i, onChange: l, readOnly: !0 });
289
289
  if (s === "rating") {
290
- const a = (C = _(e.options)) == null ? void 0 : C.rating_max;
291
- return /* @__PURE__ */ i(le, { value: n, onChange: l, max: a ?? 5, readOnly: !0 });
290
+ const a = (Q = y(e.options)) == null ? void 0 : Q.rating_max;
291
+ return /* @__PURE__ */ n(se, { value: i, onChange: l, max: a ?? 5, readOnly: !0 });
292
292
  }
293
- if (s === "duration") return /* @__PURE__ */ i(Ze, { value: n });
294
- if (s === "checklist") return /* @__PURE__ */ i(Oe, { value: n });
293
+ if (s === "duration") return /* @__PURE__ */ n(et, { value: i });
294
+ if (s === "checklist") return /* @__PURE__ */ n(tt, { value: i });
295
295
  if (s === "color")
296
- return /* @__PURE__ */ i(se, { field: e, value: n, onChange: l, readOnly: !0 });
297
- if (s === "phone") return /* @__PURE__ */ i(ce, { value: n, onChange: l, readOnly: !0 });
298
- const o = n == null ? /* @__PURE__ */ i("span", { className: "text-muted-foreground italic text-sm", children: "—" }) : typeof n == "boolean" ? /* @__PURE__ */ i(Ye, { variant: n ? "default" : "secondary", children: n ? "Yes" : "No" }) : /* @__PURE__ */ i("span", { className: "text-sm tabular-nums", children: L(n, e) });
299
- return /* @__PURE__ */ i("div", { className: "min-h-[36px] flex items-center", children: o });
296
+ return /* @__PURE__ */ n(ce, { field: e, value: i, onChange: l, readOnly: !0 });
297
+ if (s === "phone") return /* @__PURE__ */ n(de, { value: i, onChange: l, readOnly: !0 });
298
+ const o = i == null ? /* @__PURE__ */ n("span", { className: "text-muted-foreground italic text-sm", children: "—" }) : typeof i == "boolean" ? /* @__PURE__ */ n(Ue, { variant: i ? "default" : "secondary", children: i ? "Yes" : "No" }) : /* @__PURE__ */ n("span", { className: "text-sm tabular-nums", children: L(i, e) });
299
+ return /* @__PURE__ */ n("div", { className: "min-h-[36px] flex items-center", children: o });
300
300
  }
301
- const x = n == null ? "" : String(n);
301
+ const x = i == null ? "" : String(i);
302
302
  if (e.type === "boolean")
303
303
  return /* @__PURE__ */ g("div", { className: "flex items-center gap-2", children: [
304
- /* @__PURE__ */ i(Ce, { checked: !!n, onCheckedChange: l }),
305
- /* @__PURE__ */ i(ze, { className: "font-normal text-sm", children: n ? "Yes" : "No" })
304
+ /* @__PURE__ */ n(Xe, { checked: !!i, onCheckedChange: l }),
305
+ /* @__PURE__ */ n(Ce, { className: "font-normal text-sm", children: i ? "Yes" : "No" })
306
306
  ] });
307
307
  if (e.type === "datetime" || s === "datetime") {
308
- const r = _(e.options);
308
+ const r = y(e.options);
309
309
  if ((r == null ? void 0 : r.date_mode) === "date") {
310
- const o = ue(e);
311
- return /* @__PURE__ */ i(
310
+ const o = me(e);
311
+ return /* @__PURE__ */ n(
312
312
  B,
313
313
  {
314
314
  type: "date",
@@ -320,20 +320,20 @@ function sr({
320
320
  }
321
321
  );
322
322
  }
323
- return /* @__PURE__ */ i(
323
+ return /* @__PURE__ */ n(
324
324
  B,
325
325
  {
326
326
  type: "datetime-local",
327
- value: nt(n),
327
+ value: at(i),
328
328
  onChange: (o) => l(o.target.value ? new Date(o.target.value).toISOString() : null),
329
329
  placeholder: e.placeholder ?? void 0
330
330
  }
331
331
  );
332
332
  }
333
333
  if (e.type === "date" || s === "date") {
334
- const r = ((Q = _(e.options)) == null ? void 0 : Q.countdown) === !0, o = ue(e);
334
+ const r = ((X = y(e.options)) == null ? void 0 : X.countdown) === !0, o = me(e);
335
335
  return /* @__PURE__ */ g("div", { className: "flex items-center", children: [
336
- /* @__PURE__ */ i(
336
+ /* @__PURE__ */ n(
337
337
  B,
338
338
  {
339
339
  type: "date",
@@ -342,14 +342,14 @@ function sr({
342
342
  max: o.max,
343
343
  onChange: (a) => l(a.target.value || null),
344
344
  onPaste: (a) => {
345
- const t = mt(a.clipboardData.getData("text"));
345
+ const t = yt(a.clipboardData.getData("text"));
346
346
  t && (a.preventDefault(), l(t));
347
347
  },
348
348
  placeholder: e.placeholder ?? void 0,
349
349
  className: "flex-1"
350
350
  }
351
351
  ),
352
- r && /* @__PURE__ */ i(pt, { value: x.slice(0, 10) })
352
+ r && /* @__PURE__ */ n(_t, { value: x.slice(0, 10) })
353
353
  ] });
354
354
  }
355
355
  if ([
@@ -370,36 +370,36 @@ function sr({
370
370
  ].includes(e.type)) {
371
371
  const r = ["integer", "bigInteger", "int", "bigint", "smallint", "tinyint"].includes(
372
372
  e.type
373
- ), o = r ? 0 : Ge(e.options, -1), a = r ? "1" : o >= 0 ? String(10 ** -o) : "any", t = lt(n, { type: e.type, label: e.label || "Value" }), b = t.ok ? null : t.message;
373
+ ), o = r ? 0 : We(e.options, -1), a = r ? "1" : o >= 0 ? String(10 ** -o) : "any", t = ct(i, { type: e.type, label: e.label || "Value" }), f = t.ok ? null : t.message;
374
374
  return /* @__PURE__ */ g("div", { children: [
375
- /* @__PURE__ */ i(
375
+ /* @__PURE__ */ n(
376
376
  B,
377
377
  {
378
378
  type: "number",
379
- "aria-invalid": b ? !0 : void 0,
379
+ "aria-invalid": f ? !0 : void 0,
380
380
  step: a,
381
381
  value: x,
382
382
  onChange: (h) => l(h.target.value === "" ? null : Number(h.target.value)),
383
383
  onBlur: (h) => {
384
384
  if (o < 0 || h.target.value === "") return;
385
- const p = Number(h.target.value);
386
- if (!Number.isFinite(p)) return;
387
- const q = Number(p.toFixed(o));
388
- q !== p && l(q);
385
+ const m = Number(h.target.value);
386
+ if (!Number.isFinite(m)) return;
387
+ const q = Number(m.toFixed(o));
388
+ q !== m && l(q);
389
389
  },
390
390
  placeholder: e.placeholder ?? void 0
391
391
  }
392
392
  ),
393
- b && /* @__PURE__ */ i("p", { className: "mt-1 text-[11.5px] text-red-600 dark:text-red-400", "data-number-entry-error": !0, children: b })
393
+ f && /* @__PURE__ */ n("p", { className: "mt-1 text-[11.5px] text-red-600 dark:text-red-400", "data-number-entry-error": !0, children: f })
394
394
  ] });
395
395
  }
396
396
  if (e.type === "json" || s === "code")
397
- return /* @__PURE__ */ i(
397
+ return /* @__PURE__ */ n(
398
398
  $,
399
399
  {
400
400
  className: "font-mono text-xs",
401
401
  rows: 4,
402
- value: typeof n == "object" ? JSON.stringify(n, null, 2) : x,
402
+ value: typeof i == "object" ? JSON.stringify(i, null, 2) : x,
403
403
  onChange: (r) => {
404
404
  try {
405
405
  l(JSON.parse(r.target.value));
@@ -411,18 +411,18 @@ function sr({
411
411
  }
412
412
  );
413
413
  if (s === "textarea")
414
- return /* @__PURE__ */ i(
414
+ return /* @__PURE__ */ n(
415
415
  $,
416
416
  {
417
417
  rows: 4,
418
- maxLength: ie(e) ?? void 0,
418
+ maxLength: ae(e) ?? void 0,
419
419
  value: x,
420
420
  onChange: (r) => l(r.target.value),
421
421
  placeholder: e.placeholder ?? void 0
422
422
  }
423
423
  );
424
424
  if (s === "wysiwyg" || s === "markdown")
425
- return /* @__PURE__ */ i(
425
+ return /* @__PURE__ */ n(
426
426
  $,
427
427
  {
428
428
  rows: 6,
@@ -433,93 +433,93 @@ function sr({
433
433
  }
434
434
  );
435
435
  if (s === "input-rich-text-html" || s === "rich_text" || e.type === "rich_text" || s === "extension-editorjs")
436
- return /* @__PURE__ */ i(
437
- Ft,
436
+ return /* @__PURE__ */ n(
437
+ Rt,
438
438
  {
439
439
  value: x,
440
440
  onChange: l,
441
441
  placeholder: e.placeholder ?? void 0,
442
442
  disabled: e.readonly,
443
- pastePlain: ((X = _(e.options)) == null ? void 0 : X.paste_plain) === !0
443
+ pastePlain: ((Z = y(e.options)) == null ? void 0 : Z.paste_plain) === !0
444
444
  }
445
445
  );
446
446
  if (s === "inline-grid" || s === "relation-list" || s === "list-o2m") {
447
- const r = m.find(
448
- (o) => o.one_collection === y && !o.junction_field && (o.one_field === e.field || o.many_collection === e.field)
447
+ const r = p.find(
448
+ (o) => o.one_collection === c && !o.junction_field && (o.one_field === e.field || o.many_collection === e.field)
449
449
  );
450
450
  if (r) {
451
451
  const o = r.many_collection ?? null, a = r.many_field ?? null;
452
- if (o && a && c) {
453
- const b = (typeof e.options == "string" ? (() => {
452
+ if (o && a && d) {
453
+ const f = (typeof e.options == "string" ? (() => {
454
454
  try {
455
455
  return JSON.parse(e.options);
456
456
  } catch {
457
457
  return {};
458
458
  }
459
459
  })() : e.options ?? {}).layout_slug ?? null;
460
- return /* @__PURE__ */ i(
461
- it,
460
+ return /* @__PURE__ */ n(
461
+ lt,
462
462
  {
463
463
  relatedCollection: o,
464
464
  manyField: a,
465
- parentId: c,
466
- layoutSlug: b,
465
+ parentId: d,
466
+ layoutSlug: f,
467
467
  parentFieldKey: e.field,
468
468
  emptyLabel: e.label || void 0
469
469
  }
470
470
  );
471
471
  }
472
- return /* @__PURE__ */ i("p", { className: "text-[12px] text-slate-400 py-1", children: "Inline grid editing not available in embedded form" });
472
+ return /* @__PURE__ */ n("p", { className: "text-[12px] text-slate-400 py-1", children: "Inline grid editing not available in embedded form" });
473
473
  }
474
474
  }
475
475
  if (s === "inline-table") {
476
- const r = m.find(
477
- (o) => o.one_collection === y && !o.junction_field && (o.one_field === e.field || o.many_collection === e.field)
476
+ const r = p.find(
477
+ (o) => o.one_collection === c && !o.junction_field && (o.one_field === e.field || o.many_collection === e.field)
478
478
  );
479
479
  if (r) {
480
480
  const o = r.many_collection ?? null, a = r.many_field ?? null;
481
- if (o && a && c) {
481
+ if (o && a && d) {
482
482
  const t = typeof e.options == "string" ? (() => {
483
483
  try {
484
484
  return JSON.parse(e.options);
485
485
  } catch {
486
486
  return {};
487
487
  }
488
- })() : e.options ?? {}, b = t.layout_id ?? null, h = !!t.show_row_revisions, p = !!t.row_comments, q = t.allow_revision_restore !== !1, pe = t.save_mode ?? "immediate", ye = !!t.show_line_numbers, _e = t.enable_reorder !== !1, fe = Array.isArray(t.parent_cascades) ? t.parent_cascades : void 0, be = Array.isArray(t.row_rules) ? t.row_rules : void 0, xe = Array.isArray(t.column_presets) ? t.column_presets : void 0, he = typeof t.default_preset == "string" && t.default_preset ? t.default_preset : void 0, ge = Array.isArray(t.drawer_relations) ? t.drawer_relations : void 0, ve = Array.isArray(t.parent_context_fields) ? t.parent_context_fields : void 0, we = Array.isArray(t.unique_by) ? t.unique_by : void 0, Ne = typeof t.sort_field == "string" && t.sort_field ? t.sort_field : void 0, ke = t.sort_dir === "desc" ? "desc" : "asc", Fe = t.freeze_first_column === !0, Ae = typeof t.section_group_by == "string" && t.section_group_by.includes(".") ? t.section_group_by : void 0, Se = t.row_filter && typeof t.row_filter == "object" ? t.row_filter : void 0, Re = t.allocate_drawer && typeof t.allocate_drawer == "object" ? t.allocate_drawer : void 0, je = t.auto_allocate && typeof t.auto_allocate == "object" ? t.auto_allocate : void 0, De = Array.isArray(t.row_bulk_actions) ? t.row_bulk_actions : void 0, Ie = typeof t.upload_template == "string" && t.upload_template ? t.upload_template : void 0, Pe = t.row_match_panel ?? void 0, Me = t.row_defaults && typeof t.row_defaults == "object" ? t.row_defaults : void 0, Be = t.submission_errors === !0 ? {} : t.submission_errors && typeof t.submission_errors == "object" ? t.submission_errors : void 0, S = t.membership_set;
489
- if (S != null && S.key_field && (S != null && S.value_field))
490
- return /* @__PURE__ */ i(
491
- dt,
488
+ })() : e.options ?? {}, f = t.layout_id ?? null, h = !!t.show_row_revisions, m = !!t.row_comments, q = t.allow_revision_restore !== !1, ye = t.save_mode ?? "immediate", _e = !!t.show_line_numbers, fe = t.enable_reorder !== !1, be = Array.isArray(t.parent_cascades) ? t.parent_cascades : void 0, xe = Array.isArray(t.row_rules) ? t.row_rules : void 0, he = Array.isArray(t.column_presets) ? t.column_presets : void 0, ge = typeof t.default_preset == "string" && t.default_preset ? t.default_preset : void 0, ve = Array.isArray(t.drawer_relations) ? t.drawer_relations : void 0, we = Array.isArray(t.parent_context_fields) ? t.parent_context_fields : void 0, Ne = Array.isArray(t.unique_by) ? t.unique_by : void 0, ke = typeof t.sort_field == "string" && t.sort_field ? t.sort_field : void 0, Fe = t.sort_dir === "desc" ? "desc" : "asc", Ae = t.freeze_first_column === !0, Re = typeof t.section_group_by == "string" && t.section_group_by.includes(".") ? t.section_group_by : void 0, Se = t.row_filter && typeof t.row_filter == "object" ? t.row_filter : void 0, je = t.allocate_drawer && typeof t.allocate_drawer == "object" ? t.allocate_drawer : void 0, De = t.auto_allocate && typeof t.auto_allocate == "object" ? t.auto_allocate : void 0, Ie = Array.isArray(t.row_bulk_actions) ? t.row_bulk_actions : void 0, Pe = typeof t.upload_template == "string" && t.upload_template ? t.upload_template : void 0, Me = t.row_match_panel ?? void 0, Be = t.row_defaults && typeof t.row_defaults == "object" ? t.row_defaults : void 0, Le = t.submission_errors === !0 ? {} : t.submission_errors && typeof t.submission_errors == "object" ? t.submission_errors : void 0, R = t.membership_set;
489
+ if (R != null && R.key_field && (R != null && R.value_field))
490
+ return /* @__PURE__ */ n(
491
+ mt,
492
492
  {
493
493
  relatedCollection: o,
494
494
  manyField: a,
495
- parentId: c,
496
- config: S,
495
+ parentId: d,
496
+ config: R,
497
497
  readOnly: e.readonly
498
498
  }
499
499
  );
500
- const R = t.catalog_mode;
501
- if (R != null && R.item_field && (R != null && R.section_by))
502
- return /* @__PURE__ */ i(
503
- Qe,
500
+ const S = t.catalog_mode;
501
+ if (S != null && S.item_field && (S != null && S.section_by))
502
+ return /* @__PURE__ */ n(
503
+ Ze,
504
504
  {
505
505
  relatedCollection: o,
506
506
  manyField: a,
507
- parentId: c,
508
- parentCollection: y,
509
- config: R,
507
+ parentId: d,
508
+ parentCollection: c,
509
+ config: S,
510
510
  readOnly: e.readonly
511
511
  }
512
512
  );
513
- const k = t.row_split;
514
- if (k != null && k.key_field && (k != null && k.category_field) && Array.isArray(k.value_fields)) {
513
+ const F = t.row_split;
514
+ if (F != null && F.key_field && (F != null && F.category_field) && Array.isArray(F.value_fields)) {
515
515
  const T = t.spread_remaining;
516
- return /* @__PURE__ */ i(
517
- ut,
516
+ return /* @__PURE__ */ n(
517
+ pt,
518
518
  {
519
519
  relatedCollection: o,
520
520
  manyField: a,
521
- parentId: c,
522
- config: k,
521
+ parentId: d,
522
+ config: F,
523
523
  compareSeries: t.compare_series && typeof t.compare_series == "object" && typeof t.compare_series.endpoint == "string" ? t.compare_series : null,
524
524
  stats: Array.isArray(t.stats) ? t.stats : null,
525
525
  sumCap: t.sum_cap && typeof t.sum_cap == "object" ? t.sum_cap : null,
@@ -530,38 +530,38 @@ function sr({
530
530
  }
531
531
  );
532
532
  }
533
- return /* @__PURE__ */ i(
534
- at,
533
+ return /* @__PURE__ */ n(
534
+ st,
535
535
  {
536
536
  relatedCollection: o,
537
537
  manyField: a,
538
- parentId: c,
539
- parentCollection: y,
540
- layoutId: b,
538
+ parentId: d,
539
+ parentCollection: c,
540
+ layoutId: f,
541
541
  showRowRevisions: h,
542
- rowComments: p,
542
+ rowComments: m,
543
543
  allowRevisionRestore: q,
544
- saveMode: pe,
545
- showLineNumbers: ye,
546
- enableReorder: _e,
547
- parentCascades: fe,
548
- rowRules: be,
549
- columnPresets: xe,
550
- defaultPreset: he,
551
- drawerRelations: ge,
552
- parentContextFields: ve,
553
- uniqueBy: we,
554
- sortField: Ne,
555
- sortDir: ke,
556
- sectionGroupBy: Ae,
557
- freezeFirstColumn: Fe,
544
+ saveMode: ye,
545
+ showLineNumbers: _e,
546
+ enableReorder: fe,
547
+ parentCascades: be,
548
+ rowRules: xe,
549
+ columnPresets: he,
550
+ defaultPreset: ge,
551
+ drawerRelations: ve,
552
+ parentContextFields: we,
553
+ uniqueBy: Ne,
554
+ sortField: ke,
555
+ sortDir: Fe,
556
+ sectionGroupBy: Re,
557
+ freezeFirstColumn: Ae,
558
558
  rowFilter: Se,
559
- rowDefaults: Me,
560
- allocateDrawer: Re,
561
- autoAllocate: je,
562
- rowBulkActions: De,
563
- uploadTemplate: Ie,
564
- rowMatchPanel: Pe,
559
+ rowDefaults: Be,
560
+ allocateDrawer: je,
561
+ autoAllocate: De,
562
+ rowBulkActions: Ie,
563
+ uploadTemplate: Pe,
564
+ rowMatchPanel: Me,
565
565
  lineSla: t.line_sla ?? null,
566
566
  editorMode: t.editor_mode === "split" ? "split" : "drawer",
567
567
  rowLints: Array.isArray(t.row_lints) ? t.row_lints : null,
@@ -569,8 +569,8 @@ function sr({
569
569
  sumCap: t.sum_cap && typeof t.sum_cap == "object" ? t.sum_cap : null,
570
570
  spreadRemaining: t.spread_remaining && typeof t.spread_remaining == "object" ? t.spread_remaining : null,
571
571
  compareSeries: t.compare_series && typeof t.compare_series == "object" && typeof t.compare_series.endpoint == "string" ? t.compare_series : null,
572
- submissionErrors: Be,
573
- prefillParentId: me,
572
+ submissionErrors: Le,
573
+ prefillParentId: pe,
574
574
  parentFieldKey: e.field,
575
575
  readOnly: e.readonly,
576
576
  emptyLabel: e.label || void 0
@@ -578,106 +578,106 @@ function sr({
578
578
  );
579
579
  }
580
580
  }
581
- return /* @__PURE__ */ i("p", { className: "text-[12px] text-slate-400 py-1", children: "Inline table editing not available in embedded form" });
581
+ return /* @__PURE__ */ n("p", { className: "text-[12px] text-slate-400 py-1", children: "Inline table editing not available in embedded form" });
582
582
  }
583
- if (s === "color") return /* @__PURE__ */ i(se, { field: e, value: n, onChange: l });
583
+ if (s === "color") return /* @__PURE__ */ n(ce, { field: e, value: i, onChange: l });
584
584
  if (s === "rating") {
585
- const r = (Z = _(e.options)) == null ? void 0 : Z.rating_max;
586
- return /* @__PURE__ */ i(le, { value: n, onChange: l, max: r ?? 5 });
585
+ const r = (O = y(e.options)) == null ? void 0 : O.rating_max;
586
+ return /* @__PURE__ */ n(se, { value: i, onChange: l, max: r ?? 5 });
587
587
  }
588
- if (s === "progress") return /* @__PURE__ */ i(ae, { value: n, onChange: l });
588
+ if (s === "progress") return /* @__PURE__ */ n(le, { value: i, onChange: l });
589
589
  if (s === "phone")
590
- return /* @__PURE__ */ i(ce, { value: n, onChange: l, placeholder: e.placeholder ?? void 0 });
590
+ return /* @__PURE__ */ n(de, { value: i, onChange: l, placeholder: e.placeholder ?? void 0 });
591
591
  if (s === "email")
592
- return /* @__PURE__ */ i(et, { value: n, onChange: l, placeholder: e.placeholder ?? void 0 });
592
+ return /* @__PURE__ */ n(rt, { value: i, onChange: l, placeholder: e.placeholder ?? void 0 });
593
593
  if (s === "address-autocomplete")
594
- return /* @__PURE__ */ i(
595
- tt,
594
+ return /* @__PURE__ */ n(
595
+ ot,
596
596
  {
597
597
  field: e,
598
- value: n,
598
+ value: i,
599
599
  onChange: l,
600
- apiBase: f == null ? void 0 : f.apiBase,
601
- authHeaders: f == null ? void 0 : f.authHeaders,
602
- credentials: f == null ? void 0 : f.credentials,
600
+ apiBase: _ == null ? void 0 : _.apiBase,
601
+ authHeaders: _ == null ? void 0 : _.authHeaders,
602
+ credentials: _ == null ? void 0 : _.credentials,
603
603
  placeholder: e.placeholder ?? void 0
604
604
  }
605
605
  );
606
- if (s === "duration") return /* @__PURE__ */ i(yt, { value: n, onChange: l });
607
- if (s === "fiscal_period") return /* @__PURE__ */ i(_t, { value: n, onChange: l });
608
- if (s === "checklist") return /* @__PURE__ */ i(ft, { value: n, onChange: l });
606
+ if (s === "duration") return /* @__PURE__ */ n(ft, { value: i, onChange: l });
607
+ if (s === "fiscal_period") return /* @__PURE__ */ n(bt, { value: i, onChange: l });
608
+ if (s === "checklist") return /* @__PURE__ */ n(xt, { value: i, onChange: l });
609
609
  if (s === "repeater" || e.repeater_schema && e.type === "json")
610
- return /* @__PURE__ */ i(bt, { field: e, value: n, onChange: l });
610
+ return /* @__PURE__ */ n(ht, { field: e, value: i, onChange: l });
611
611
  if (s === "range_slider") {
612
- const r = (O = _(e.options)) == null ? void 0 : O.range_end_field;
613
- return /* @__PURE__ */ i(
614
- xt,
612
+ const r = (ee = y(e.options)) == null ? void 0 : ee.range_end_field;
613
+ return /* @__PURE__ */ n(
614
+ gt,
615
615
  {
616
616
  field: e,
617
- value: n,
617
+ value: i,
618
618
  onChange: l,
619
- pairedValue: r ? (ee = D == null ? void 0 : D.draft) == null ? void 0 : ee[r] : void 0
619
+ pairedValue: r ? (te = D == null ? void 0 : D.draft) == null ? void 0 : te[r] : void 0
620
620
  }
621
621
  );
622
622
  }
623
623
  if (s === "date_range") {
624
- const r = (te = _(e.options)) == null ? void 0 : te.range_end_field;
625
- return /* @__PURE__ */ i(
626
- ht,
624
+ const r = (re = y(e.options)) == null ? void 0 : re.range_end_field;
625
+ return /* @__PURE__ */ n(
626
+ vt,
627
627
  {
628
628
  field: e,
629
- value: n,
629
+ value: i,
630
630
  onChange: l,
631
- pairedValue: r ? (re = D == null ? void 0 : D.draft) == null ? void 0 : re[r] : void 0
631
+ pairedValue: r ? (oe = D == null ? void 0 : D.draft) == null ? void 0 : oe[r] : void 0
632
632
  }
633
633
  );
634
634
  }
635
635
  if (s === "address")
636
- return /* @__PURE__ */ i(
637
- gt,
636
+ return /* @__PURE__ */ n(
637
+ wt,
638
638
  {
639
639
  field: e,
640
- value: n,
640
+ value: i,
641
641
  onChange: l,
642
- apiBase: f == null ? void 0 : f.apiBase,
643
- authHeaders: f == null ? void 0 : f.authHeaders
642
+ apiBase: _ == null ? void 0 : _.apiBase,
643
+ authHeaders: _ == null ? void 0 : _.authHeaders
644
644
  }
645
645
  );
646
646
  if (s === "tags")
647
- return /* @__PURE__ */ i(St, { field: e, value: n, onChange: l });
647
+ return /* @__PURE__ */ n(jt, { field: e, value: i, onChange: l });
648
648
  if (s === "select-dropdown" || s === "radio-buttons") {
649
649
  const r = (() => {
650
- const o = _(e.options);
650
+ const o = y(e.options);
651
651
  return (o == null ? void 0 : o.choices) ?? [];
652
652
  })();
653
653
  if (r.length > 0)
654
- return /* @__PURE__ */ i(
655
- Ue,
654
+ return /* @__PURE__ */ n(
655
+ Qe,
656
656
  {
657
657
  value: x,
658
658
  onChange: (o) => l(o || null),
659
659
  options: [
660
660
  { value: "", label: "— Select —" },
661
- ...r.map((o) => ({ value: o.value, label: We(o.text) }))
661
+ ...r.map((o) => ({ value: o.value, label: ze(o.text) }))
662
662
  ],
663
663
  ariaLabel: e.label ?? e.field,
664
664
  className: "h-9 rounded-md text-sm"
665
665
  }
666
666
  );
667
667
  }
668
- const I = vt(e), Y = ie(e), M = (() => {
669
- const r = _(e.options);
668
+ const I = Nt(e), z = ae(e), M = (() => {
669
+ const r = y(e.options);
670
670
  if (Number.isFinite(Number(r == null ? void 0 : r.max_length))) return Number(r == null ? void 0 : r.max_length);
671
- const o = _(e.validation_rules), a = Array.isArray(o) ? o.find((t) => (t == null ? void 0 : t.type) === "max") : null;
672
- return a && Number.isFinite(Number(a.value)) ? Number(a.value) : Y;
673
- })(), z = /* @__PURE__ */ i(
671
+ const o = y(e.validation_rules), a = Array.isArray(o) ? o.find((t) => (t == null ? void 0 : t.type) === "max") : null;
672
+ return a && Number.isFinite(Number(a.value)) ? Number(a.value) : z;
673
+ })(), U = /* @__PURE__ */ n(
674
674
  B,
675
675
  {
676
- maxLength: I ? void 0 : Y ?? void 0,
677
- value: I ? de(I, x).display : x,
676
+ maxLength: I ? void 0 : z ?? void 0,
677
+ value: I ? ue(I, x).display : x,
678
678
  onChange: (r) => {
679
679
  if (I) {
680
- const { clean: o } = de(I, r.target.value);
680
+ const { clean: o } = ue(I, r.target.value);
681
681
  l(o || null);
682
682
  } else
683
683
  l(r.target.value || null);
@@ -685,10 +685,10 @@ function sr({
685
685
  placeholder: e.placeholder ?? I ?? void 0
686
686
  }
687
687
  );
688
- if (M != null && M > 0 && !Ke(e._overrides)) {
688
+ if (M != null && M > 0 && !Ye(e._overrides)) {
689
689
  const r = x.length;
690
690
  return /* @__PURE__ */ g("div", { children: [
691
- z,
691
+ U,
692
692
  r >= M * 0.6 && /* @__PURE__ */ g(
693
693
  "p",
694
694
  {
@@ -702,82 +702,82 @@ function sr({
702
702
  )
703
703
  ] });
704
704
  }
705
- return z;
706
- }
707
- function St({
708
- field: e,
709
- value: n,
710
- onChange: l
705
+ return U;
706
+ });
707
+ function jt({
708
+ field: w,
709
+ value: e,
710
+ onChange: i
711
711
  }) {
712
- const [m, y] = qe(""), c = (() => {
713
- if (Array.isArray(n)) return n.map(String);
714
- if (typeof n == "string" && n.trim().startsWith("["))
712
+ const [l, p] = Je(""), c = (() => {
713
+ if (Array.isArray(e)) return e.map(String);
714
+ if (typeof e == "string" && e.trim().startsWith("["))
715
715
  try {
716
- const d = JSON.parse(n);
717
- return Array.isArray(d) ? d.map(String) : [];
716
+ const u = JSON.parse(e);
717
+ return Array.isArray(u) ? u.map(String) : [];
718
718
  } catch {
719
719
  return [];
720
720
  }
721
- return typeof n == "string" && n.trim() !== "" ? [n] : [];
722
- })(), u = (() => {
723
- const d = _(e.options);
724
- return Array.isArray(d == null ? void 0 : d.tag_options) ? d.tag_options.map(String) : [];
725
- })(), v = (d) => l(d.length > 0 ? JSON.stringify(d) : null), F = (d) => {
726
- const w = d.trim();
727
- !w || c.includes(w) || (v([...c, w]), y(""));
721
+ return typeof e == "string" && e.trim() !== "" ? [e] : [];
722
+ })(), d = (() => {
723
+ const u = y(w.options);
724
+ return Array.isArray(u == null ? void 0 : u.tag_options) ? u.tag_options.map(String) : [];
725
+ })(), b = (u) => i(u.length > 0 ? JSON.stringify(u) : null), v = (u) => {
726
+ const N = u.trim();
727
+ !N || c.includes(N) || (b([...c, N]), p(""));
728
728
  };
729
729
  return /* @__PURE__ */ g("div", { className: "rounded-md border border-input bg-background px-2 py-1.5", children: [
730
730
  /* @__PURE__ */ g("div", { className: "flex flex-wrap items-center gap-1", children: [
731
- c.map((d) => /* @__PURE__ */ g(
731
+ c.map((u) => /* @__PURE__ */ g(
732
732
  "span",
733
733
  {
734
734
  className: "inline-flex items-center gap-1 rounded-full bg-nvr-cyan/10 px-2 py-0.5 text-[11.5px] font-medium text-nvr-navy dark:bg-nvr-cyan/15 dark:text-nvr-cyan",
735
735
  children: [
736
- d,
737
- /* @__PURE__ */ i(
736
+ u,
737
+ /* @__PURE__ */ n(
738
738
  "button",
739
739
  {
740
740
  type: "button",
741
- "aria-label": `Remove ${d}`,
742
- onClick: () => v(c.filter((w) => w !== d)),
741
+ "aria-label": `Remove ${u}`,
742
+ onClick: () => b(c.filter((N) => N !== u)),
743
743
  className: "text-slate-400 hover:text-slate-600 dark:hover:text-slate-200",
744
744
  children: "×"
745
745
  }
746
746
  )
747
747
  ]
748
748
  },
749
- d
749
+ u
750
750
  )),
751
- /* @__PURE__ */ i(
751
+ /* @__PURE__ */ n(
752
752
  "input",
753
753
  {
754
- value: m,
755
- onChange: (d) => y(d.target.value),
756
- onKeyDown: (d) => {
757
- (d.key === "Enter" || d.key === ",") && (d.preventDefault(), F(m)), d.key === "Backspace" && m === "" && c.length > 0 && v(c.slice(0, -1));
754
+ value: l,
755
+ onChange: (u) => p(u.target.value),
756
+ onKeyDown: (u) => {
757
+ (u.key === "Enter" || u.key === ",") && (u.preventDefault(), v(l)), u.key === "Backspace" && l === "" && c.length > 0 && b(c.slice(0, -1));
758
758
  },
759
- onBlur: () => F(m),
759
+ onBlur: () => v(l),
760
760
  placeholder: c.length === 0 ? "Type and press Enter…" : "",
761
761
  className: "h-6 min-w-[120px] flex-1 bg-transparent text-[13px] outline-none"
762
762
  }
763
763
  )
764
764
  ] }),
765
- u.length > 0 && /* @__PURE__ */ i("div", { className: "mt-1 flex flex-wrap gap-1 border-t border-slate-100 pt-1 dark:border-border/60", children: u.filter((d) => !c.includes(d)).map((d) => /* @__PURE__ */ g(
765
+ d.length > 0 && /* @__PURE__ */ n("div", { className: "mt-1 flex flex-wrap gap-1 border-t border-slate-100 pt-1 dark:border-border/60", children: d.filter((u) => !c.includes(u)).map((u) => /* @__PURE__ */ g(
766
766
  "button",
767
767
  {
768
768
  type: "button",
769
- onClick: () => F(d),
769
+ onClick: () => v(u),
770
770
  className: "rounded-full border border-slate-200 px-2 py-0.5 text-[11px] text-slate-500 hover:border-nvr-cyan/50 hover:text-slate-700 dark:border-border dark:text-slate-400",
771
771
  children: [
772
772
  "+ ",
773
- d
773
+ u
774
774
  ]
775
775
  },
776
- d
776
+ u
777
777
  )) })
778
778
  ] });
779
779
  }
780
780
  export {
781
- sr as FieldRenderer,
782
- ne as resolveOptionFilterTokens
781
+ dr as FieldRenderer,
782
+ ie as resolveOptionFilterTokens
783
783
  };