@mieweb/forms-renderer 0.1.9 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/react.js CHANGED
@@ -1,6 +1,7 @@
1
- import P, { useMemo as vr } from "react";
2
- import { useUIApi as Pe, useFormStore as Z, getFieldComponent as pr, useVisibleFields as br } from "@mieweb/forms-engine";
3
- var B = { exports: {} }, W = {};
1
+ import O, { useMemo as gr } from "react";
2
+ import { useUIApi as Fe, adaptSchema as mr, useFormStore as ee, getFieldComponent as hr, useVisibleFields as yr, useUIStore as br } from "@mieweb/forms-engine";
3
+ import { useFieldsArray as kr } from "@mieweb/forms-engine";
4
+ var q = { exports: {} }, W = {};
4
5
  /**
5
6
  * @license React
6
7
  * react-jsx-runtime.production.min.js
@@ -10,19 +11,19 @@ var B = { exports: {} }, W = {};
10
11
  * This source code is licensed under the MIT license found in the
11
12
  * LICENSE file in the root directory of this source tree.
12
13
  */
13
- var Se;
14
- function mr() {
15
- if (Se) return W;
16
- Se = 1;
17
- var g = P, f = Symbol.for("react.element"), d = Symbol.for("react.fragment"), v = Object.prototype.hasOwnProperty, _ = g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, D = { key: !0, ref: !0, __self: !0, __source: !0 };
18
- function T(E, c, j) {
19
- var y, h = {}, x = null, N = null;
20
- j !== void 0 && (x = "" + j), c.key !== void 0 && (x = "" + c.key), c.ref !== void 0 && (N = c.ref);
21
- for (y in c) v.call(c, y) && !D.hasOwnProperty(y) && (h[y] = c[y]);
22
- if (E && E.defaultProps) for (y in c = E.defaultProps, c) h[y] === void 0 && (h[y] = c[y]);
23
- return { $$typeof: f, type: E, key: x, ref: N, props: h, _owner: _.current };
14
+ var Oe;
15
+ function Rr() {
16
+ if (Oe) return W;
17
+ Oe = 1;
18
+ var u = O, f = Symbol.for("react.element"), c = Symbol.for("react.fragment"), d = Object.prototype.hasOwnProperty, s = u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, g = { key: !0, ref: !0, __self: !0, __source: !0 };
19
+ function w(m, v, _) {
20
+ var y, S = {}, P = null, M = null;
21
+ _ !== void 0 && (P = "" + _), v.key !== void 0 && (P = "" + v.key), v.ref !== void 0 && (M = v.ref);
22
+ for (y in v) d.call(v, y) && !g.hasOwnProperty(y) && (S[y] = v[y]);
23
+ if (m && m.defaultProps) for (y in v = m.defaultProps, v) S[y] === void 0 && (S[y] = v[y]);
24
+ return { $$typeof: f, type: m, key: P, ref: M, props: S, _owner: s.current };
24
25
  }
25
- return W.Fragment = d, W.jsx = T, W.jsxs = T, W;
26
+ return W.Fragment = c, W.jsx = w, W.jsxs = w, W;
26
27
  }
27
28
  var Y = {};
28
29
  /**
@@ -34,91 +35,91 @@ var Y = {};
34
35
  * This source code is licensed under the MIT license found in the
35
36
  * LICENSE file in the root directory of this source tree.
36
37
  */
37
- var we;
38
- function yr() {
39
- return we || (we = 1, process.env.NODE_ENV !== "production" && (function() {
40
- var g = P, f = Symbol.for("react.element"), d = Symbol.for("react.portal"), v = Symbol.for("react.fragment"), _ = Symbol.for("react.strict_mode"), D = Symbol.for("react.profiler"), T = Symbol.for("react.provider"), E = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), j = Symbol.for("react.suspense"), y = Symbol.for("react.suspense_list"), h = Symbol.for("react.memo"), x = Symbol.for("react.lazy"), N = Symbol.for("react.offscreen"), ee = Symbol.iterator, je = "@@iterator";
41
- function ke(e) {
38
+ var Pe;
39
+ function Er() {
40
+ return Pe || (Pe = 1, process.env.NODE_ENV !== "production" && (function() {
41
+ var u = O, f = Symbol.for("react.element"), c = Symbol.for("react.portal"), d = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), g = Symbol.for("react.profiler"), w = Symbol.for("react.provider"), m = Symbol.for("react.context"), v = Symbol.for("react.forward_ref"), _ = Symbol.for("react.suspense"), y = Symbol.for("react.suspense_list"), S = Symbol.for("react.memo"), P = Symbol.for("react.lazy"), M = Symbol.for("react.offscreen"), re = Symbol.iterator, ke = "@@iterator";
42
+ function Ae(e) {
42
43
  if (e === null || typeof e != "object")
43
44
  return null;
44
- var r = ee && e[ee] || e[je];
45
+ var r = re && e[re] || e[ke];
45
46
  return typeof r == "function" ? r : null;
46
47
  }
47
- var k = g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
48
- function p(e) {
48
+ var k = u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
49
+ function b(e) {
49
50
  {
50
51
  for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
51
52
  t[n - 1] = arguments[n];
52
- Fe("error", e, t);
53
+ De("error", e, t);
53
54
  }
54
55
  }
55
- function Fe(e, r, t) {
56
+ function De(e, r, t) {
56
57
  {
57
58
  var n = k.ReactDebugCurrentFrame, o = n.getStackAddendum();
58
59
  o !== "" && (r += "%s", t = t.concat([o]));
59
- var u = t.map(function(i) {
60
+ var l = t.map(function(i) {
60
61
  return String(i);
61
62
  });
62
- u.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, u);
63
+ l.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, l);
63
64
  }
64
65
  }
65
- var Ae = !1, De = !1, Ie = !1, $e = !1, We = !1, re;
66
- re = Symbol.for("react.module.reference");
67
- function Ye(e) {
68
- return !!(typeof e == "string" || typeof e == "function" || e === v || e === D || We || e === _ || e === j || e === y || $e || e === N || Ae || De || Ie || typeof e == "object" && e !== null && (e.$$typeof === x || e.$$typeof === h || e.$$typeof === T || e.$$typeof === E || e.$$typeof === c || // This needs to include all possible module reference object
66
+ var Ie = !1, $e = !1, We = !1, Ye = !1, Me = !1, te;
67
+ te = Symbol.for("react.module.reference");
68
+ function Ue(e) {
69
+ return !!(typeof e == "string" || typeof e == "function" || e === d || e === g || Me || e === s || e === _ || e === y || Ye || e === M || Ie || $e || We || typeof e == "object" && e !== null && (e.$$typeof === P || e.$$typeof === S || e.$$typeof === w || e.$$typeof === m || e.$$typeof === v || // This needs to include all possible module reference object
69
70
  // types supported by any Flight configuration anywhere since
70
71
  // we don't know which Flight build this will end up being used
71
72
  // with.
72
- e.$$typeof === re || e.getModuleId !== void 0));
73
+ e.$$typeof === te || e.getModuleId !== void 0));
73
74
  }
74
- function Ne(e, r, t) {
75
+ function Ve(e, r, t) {
75
76
  var n = e.displayName;
76
77
  if (n)
77
78
  return n;
78
79
  var o = r.displayName || r.name || "";
79
80
  return o !== "" ? t + "(" + o + ")" : t;
80
81
  }
81
- function te(e) {
82
+ function ne(e) {
82
83
  return e.displayName || "Context";
83
84
  }
84
- function O(e) {
85
+ function x(e) {
85
86
  if (e == null)
86
87
  return null;
87
- if (typeof e.tag == "number" && p("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
88
+ if (typeof e.tag == "number" && b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
88
89
  return e.displayName || e.name || null;
89
90
  if (typeof e == "string")
90
91
  return e;
91
92
  switch (e) {
92
- case v:
93
- return "Fragment";
94
93
  case d:
94
+ return "Fragment";
95
+ case c:
95
96
  return "Portal";
96
- case D:
97
+ case g:
97
98
  return "Profiler";
98
- case _:
99
+ case s:
99
100
  return "StrictMode";
100
- case j:
101
+ case _:
101
102
  return "Suspense";
102
103
  case y:
103
104
  return "SuspenseList";
104
105
  }
105
106
  if (typeof e == "object")
106
107
  switch (e.$$typeof) {
107
- case E:
108
+ case m:
108
109
  var r = e;
109
- return te(r) + ".Consumer";
110
- case T:
110
+ return ne(r) + ".Consumer";
111
+ case w:
111
112
  var t = e;
112
- return te(t._context) + ".Provider";
113
- case c:
114
- return Ne(e, e.render, "ForwardRef");
115
- case h:
113
+ return ne(t._context) + ".Provider";
114
+ case v:
115
+ return Ve(e, e.render, "ForwardRef");
116
+ case S:
116
117
  var n = e.displayName || null;
117
- return n !== null ? n : O(e.type) || "Memo";
118
- case x: {
119
- var o = e, u = o._payload, i = o._init;
118
+ return n !== null ? n : x(e.type) || "Memo";
119
+ case P: {
120
+ var o = e, l = o._payload, i = o._init;
120
121
  try {
121
- return O(i(u));
122
+ return x(i(l));
122
123
  } catch {
123
124
  return null;
124
125
  }
@@ -126,14 +127,14 @@ function yr() {
126
127
  }
127
128
  return null;
128
129
  }
129
- var S = Object.assign, I = 0, ne, ae, ie, oe, ue, se, le;
130
+ var C = Object.assign, I = 0, ae, ie, oe, se, ue, le, ce;
130
131
  function fe() {
131
132
  }
132
133
  fe.__reactDisabledLog = !0;
133
- function Ve() {
134
+ function Le() {
134
135
  {
135
136
  if (I === 0) {
136
- ne = console.log, ae = console.info, ie = console.warn, oe = console.error, ue = console.group, se = console.groupCollapsed, le = console.groupEnd;
137
+ ae = console.log, ie = console.info, oe = console.warn, se = console.error, ue = console.group, le = console.groupCollapsed, ce = console.groupEnd;
137
138
  var e = {
138
139
  configurable: !0,
139
140
  enumerable: !0,
@@ -153,7 +154,7 @@ function yr() {
153
154
  I++;
154
155
  }
155
156
  }
156
- function Le() {
157
+ function Ne() {
157
158
  {
158
159
  if (I--, I === 0) {
159
160
  var e = {
@@ -162,56 +163,56 @@ function yr() {
162
163
  writable: !0
163
164
  };
164
165
  Object.defineProperties(console, {
165
- log: S({}, e, {
166
- value: ne
167
- }),
168
- info: S({}, e, {
166
+ log: C({}, e, {
169
167
  value: ae
170
168
  }),
171
- warn: S({}, e, {
169
+ info: C({}, e, {
172
170
  value: ie
173
171
  }),
174
- error: S({}, e, {
172
+ warn: C({}, e, {
175
173
  value: oe
176
174
  }),
177
- group: S({}, e, {
178
- value: ue
179
- }),
180
- groupCollapsed: S({}, e, {
175
+ error: C({}, e, {
181
176
  value: se
182
177
  }),
183
- groupEnd: S({}, e, {
178
+ group: C({}, e, {
179
+ value: ue
180
+ }),
181
+ groupCollapsed: C({}, e, {
184
182
  value: le
183
+ }),
184
+ groupEnd: C({}, e, {
185
+ value: ce
185
186
  })
186
187
  });
187
188
  }
188
- I < 0 && p("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
189
+ I < 0 && b("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
189
190
  }
190
191
  }
191
- var J = k.ReactCurrentDispatcher, q;
192
- function V(e, r, t) {
192
+ var B = k.ReactCurrentDispatcher, J;
193
+ function U(e, r, t) {
193
194
  {
194
- if (q === void 0)
195
+ if (J === void 0)
195
196
  try {
196
197
  throw Error();
197
198
  } catch (o) {
198
199
  var n = o.stack.trim().match(/\n( *(at )?)/);
199
- q = n && n[1] || "";
200
+ J = n && n[1] || "";
200
201
  }
201
202
  return `
202
- ` + q + e;
203
+ ` + J + e;
203
204
  }
204
205
  }
205
- var K = !1, L;
206
+ var K = !1, V;
206
207
  {
207
- var Me = typeof WeakMap == "function" ? WeakMap : Map;
208
- L = new Me();
208
+ var qe = typeof WeakMap == "function" ? WeakMap : Map;
209
+ V = new qe();
209
210
  }
210
- function ce(e, r) {
211
+ function de(e, r) {
211
212
  if (!e || K)
212
213
  return "";
213
214
  {
214
- var t = L.get(e);
215
+ var t = V.get(e);
215
216
  if (t !== void 0)
216
217
  return t;
217
218
  }
@@ -219,8 +220,8 @@ function yr() {
219
220
  K = !0;
220
221
  var o = Error.prepareStackTrace;
221
222
  Error.prepareStackTrace = void 0;
222
- var u;
223
- u = J.current, J.current = null, Ve();
223
+ var l;
224
+ l = B.current, B.current = null, Le();
224
225
  try {
225
226
  if (r) {
226
227
  var i = function() {
@@ -233,144 +234,144 @@ function yr() {
233
234
  }), typeof Reflect == "object" && Reflect.construct) {
234
235
  try {
235
236
  Reflect.construct(i, []);
236
- } catch (m) {
237
- n = m;
237
+ } catch (E) {
238
+ n = E;
238
239
  }
239
240
  Reflect.construct(e, [], i);
240
241
  } else {
241
242
  try {
242
243
  i.call();
243
- } catch (m) {
244
- n = m;
244
+ } catch (E) {
245
+ n = E;
245
246
  }
246
247
  e.call(i.prototype);
247
248
  }
248
249
  } else {
249
250
  try {
250
251
  throw Error();
251
- } catch (m) {
252
- n = m;
252
+ } catch (E) {
253
+ n = E;
253
254
  }
254
255
  e();
255
256
  }
256
- } catch (m) {
257
- if (m && n && typeof m.stack == "string") {
258
- for (var a = m.stack.split(`
259
- `), b = n.stack.split(`
260
- `), s = a.length - 1, l = b.length - 1; s >= 1 && l >= 0 && a[s] !== b[l]; )
261
- l--;
262
- for (; s >= 1 && l >= 0; s--, l--)
263
- if (a[s] !== b[l]) {
264
- if (s !== 1 || l !== 1)
257
+ } catch (E) {
258
+ if (E && n && typeof E.stack == "string") {
259
+ for (var a = E.stack.split(`
260
+ `), R = n.stack.split(`
261
+ `), p = a.length - 1, h = R.length - 1; p >= 1 && h >= 0 && a[p] !== R[h]; )
262
+ h--;
263
+ for (; p >= 1 && h >= 0; p--, h--)
264
+ if (a[p] !== R[h]) {
265
+ if (p !== 1 || h !== 1)
265
266
  do
266
- if (s--, l--, l < 0 || a[s] !== b[l]) {
267
- var R = `
268
- ` + a[s].replace(" at new ", " at ");
269
- return e.displayName && R.includes("<anonymous>") && (R = R.replace("<anonymous>", e.displayName)), typeof e == "function" && L.set(e, R), R;
267
+ if (p--, h--, h < 0 || a[p] !== R[h]) {
268
+ var T = `
269
+ ` + a[p].replace(" at new ", " at ");
270
+ return e.displayName && T.includes("<anonymous>") && (T = T.replace("<anonymous>", e.displayName)), typeof e == "function" && V.set(e, T), T;
270
271
  }
271
- while (s >= 1 && l >= 0);
272
+ while (p >= 1 && h >= 0);
272
273
  break;
273
274
  }
274
275
  }
275
276
  } finally {
276
- K = !1, J.current = u, Le(), Error.prepareStackTrace = o;
277
+ K = !1, B.current = l, Ne(), Error.prepareStackTrace = o;
277
278
  }
278
- var A = e ? e.displayName || e.name : "", w = A ? V(A) : "";
279
- return typeof e == "function" && L.set(e, w), w;
279
+ var D = e ? e.displayName || e.name : "", j = D ? U(D) : "";
280
+ return typeof e == "function" && V.set(e, j), j;
280
281
  }
281
- function Ue(e, r, t) {
282
- return ce(e, !1);
282
+ function Be(e, r, t) {
283
+ return de(e, !1);
283
284
  }
284
- function Be(e) {
285
+ function Je(e) {
285
286
  var r = e.prototype;
286
287
  return !!(r && r.isReactComponent);
287
288
  }
288
- function M(e, r, t) {
289
+ function L(e, r, t) {
289
290
  if (e == null)
290
291
  return "";
291
292
  if (typeof e == "function")
292
- return ce(e, Be(e));
293
+ return de(e, Je(e));
293
294
  if (typeof e == "string")
294
- return V(e);
295
+ return U(e);
295
296
  switch (e) {
296
- case j:
297
- return V("Suspense");
297
+ case _:
298
+ return U("Suspense");
298
299
  case y:
299
- return V("SuspenseList");
300
+ return U("SuspenseList");
300
301
  }
301
302
  if (typeof e == "object")
302
303
  switch (e.$$typeof) {
303
- case c:
304
- return Ue(e.render);
305
- case h:
306
- return M(e.type, r, t);
307
- case x: {
308
- var n = e, o = n._payload, u = n._init;
304
+ case v:
305
+ return Be(e.render);
306
+ case S:
307
+ return L(e.type, r, t);
308
+ case P: {
309
+ var n = e, o = n._payload, l = n._init;
309
310
  try {
310
- return M(u(o), r, t);
311
+ return L(l(o), r, t);
311
312
  } catch {
312
313
  }
313
314
  }
314
315
  }
315
316
  return "";
316
317
  }
317
- var $ = Object.prototype.hasOwnProperty, de = {}, ve = k.ReactDebugCurrentFrame;
318
- function U(e) {
318
+ var $ = Object.prototype.hasOwnProperty, ve = {}, pe = k.ReactDebugCurrentFrame;
319
+ function N(e) {
319
320
  if (e) {
320
- var r = e._owner, t = M(e.type, e._source, r ? r.type : null);
321
- ve.setExtraStackFrame(t);
321
+ var r = e._owner, t = L(e.type, e._source, r ? r.type : null);
322
+ pe.setExtraStackFrame(t);
322
323
  } else
323
- ve.setExtraStackFrame(null);
324
+ pe.setExtraStackFrame(null);
324
325
  }
325
- function Je(e, r, t, n, o) {
326
+ function Ke(e, r, t, n, o) {
326
327
  {
327
- var u = Function.call.bind($);
328
+ var l = Function.call.bind($);
328
329
  for (var i in e)
329
- if (u(e, i)) {
330
+ if (l(e, i)) {
330
331
  var a = void 0;
331
332
  try {
332
333
  if (typeof e[i] != "function") {
333
- var b = Error((n || "React class") + ": " + t + " type `" + i + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[i] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
334
- throw b.name = "Invariant Violation", b;
334
+ var R = Error((n || "React class") + ": " + t + " type `" + i + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[i] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
335
+ throw R.name = "Invariant Violation", R;
335
336
  }
336
337
  a = e[i](r, i, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
337
- } catch (s) {
338
- a = s;
338
+ } catch (p) {
339
+ a = p;
339
340
  }
340
- a && !(a instanceof Error) && (U(o), p("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, i, typeof a), U(null)), a instanceof Error && !(a.message in de) && (de[a.message] = !0, U(o), p("Failed %s type: %s", t, a.message), U(null));
341
+ a && !(a instanceof Error) && (N(o), b("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, i, typeof a), N(null)), a instanceof Error && !(a.message in ve) && (ve[a.message] = !0, N(o), b("Failed %s type: %s", t, a.message), N(null));
341
342
  }
342
343
  }
343
344
  }
344
- var qe = Array.isArray;
345
- function z(e) {
346
- return qe(e);
345
+ var Ge = Array.isArray;
346
+ function G(e) {
347
+ return Ge(e);
347
348
  }
348
- function Ke(e) {
349
+ function ze(e) {
349
350
  {
350
351
  var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
351
352
  return t;
352
353
  }
353
354
  }
354
- function ze(e) {
355
+ function He(e) {
355
356
  try {
356
- return pe(e), !1;
357
+ return ge(e), !1;
357
358
  } catch {
358
359
  return !0;
359
360
  }
360
361
  }
361
- function pe(e) {
362
+ function ge(e) {
362
363
  return "" + e;
363
364
  }
364
- function be(e) {
365
- if (ze(e))
366
- return p("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ke(e)), pe(e);
365
+ function me(e) {
366
+ if (He(e))
367
+ return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ze(e)), ge(e);
367
368
  }
368
- var me = k.ReactCurrentOwner, Ge = {
369
+ var he = k.ReactCurrentOwner, Qe = {
369
370
  key: !0,
370
371
  ref: !0,
371
372
  __self: !0,
372
373
  __source: !0
373
- }, ye, ge;
374
+ }, ye, be;
374
375
  function Xe(e) {
375
376
  if ($.call(e, "ref")) {
376
377
  var r = Object.getOwnPropertyDescriptor(e, "ref").get;
@@ -379,7 +380,7 @@ function yr() {
379
380
  }
380
381
  return e.ref !== void 0;
381
382
  }
382
- function He(e) {
383
+ function Ze(e) {
383
384
  if ($.call(e, "key")) {
384
385
  var r = Object.getOwnPropertyDescriptor(e, "key").get;
385
386
  if (r && r.isReactWarning)
@@ -387,13 +388,13 @@ function yr() {
387
388
  }
388
389
  return e.key !== void 0;
389
390
  }
390
- function Qe(e, r) {
391
- typeof e.ref == "string" && me.current;
391
+ function er(e, r) {
392
+ typeof e.ref == "string" && he.current;
392
393
  }
393
- function Ze(e, r) {
394
+ function rr(e, r) {
394
395
  {
395
396
  var t = function() {
396
- ye || (ye = !0, p("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
397
+ ye || (ye = !0, b("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
397
398
  };
398
399
  t.isReactWarning = !0, Object.defineProperty(e, "key", {
399
400
  get: t,
@@ -401,10 +402,10 @@ function yr() {
401
402
  });
402
403
  }
403
404
  }
404
- function er(e, r) {
405
+ function tr(e, r) {
405
406
  {
406
407
  var t = function() {
407
- ge || (ge = !0, p("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
408
+ be || (be = !0, b("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
408
409
  };
409
410
  t.isReactWarning = !0, Object.defineProperty(e, "ref", {
410
411
  get: t,
@@ -412,7 +413,7 @@ function yr() {
412
413
  });
413
414
  }
414
415
  }
415
- var rr = function(e, r, t, n, o, u, i) {
416
+ var nr = function(e, r, t, n, o, l, i) {
416
417
  var a = {
417
418
  // This tag allows us to uniquely identify this as a React Element
418
419
  $$typeof: f,
@@ -422,7 +423,7 @@ function yr() {
422
423
  ref: t,
423
424
  props: i,
424
425
  // Record the component responsible for creating this element.
425
- _owner: u
426
+ _owner: l
426
427
  };
427
428
  return a._store = {}, Object.defineProperty(a._store, "validated", {
428
429
  configurable: !1,
@@ -441,41 +442,41 @@ function yr() {
441
442
  value: o
442
443
  }), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
443
444
  };
444
- function tr(e, r, t, n, o) {
445
+ function ar(e, r, t, n, o) {
445
446
  {
446
- var u, i = {}, a = null, b = null;
447
- t !== void 0 && (be(t), a = "" + t), He(r) && (be(r.key), a = "" + r.key), Xe(r) && (b = r.ref, Qe(r, o));
448
- for (u in r)
449
- $.call(r, u) && !Ge.hasOwnProperty(u) && (i[u] = r[u]);
447
+ var l, i = {}, a = null, R = null;
448
+ t !== void 0 && (me(t), a = "" + t), Ze(r) && (me(r.key), a = "" + r.key), Xe(r) && (R = r.ref, er(r, o));
449
+ for (l in r)
450
+ $.call(r, l) && !Qe.hasOwnProperty(l) && (i[l] = r[l]);
450
451
  if (e && e.defaultProps) {
451
- var s = e.defaultProps;
452
- for (u in s)
453
- i[u] === void 0 && (i[u] = s[u]);
452
+ var p = e.defaultProps;
453
+ for (l in p)
454
+ i[l] === void 0 && (i[l] = p[l]);
454
455
  }
455
- if (a || b) {
456
- var l = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
457
- a && Ze(i, l), b && er(i, l);
456
+ if (a || R) {
457
+ var h = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
458
+ a && rr(i, h), R && tr(i, h);
458
459
  }
459
- return rr(e, a, b, o, n, me.current, i);
460
+ return nr(e, a, R, o, n, he.current, i);
460
461
  }
461
462
  }
462
- var G = k.ReactCurrentOwner, Re = k.ReactDebugCurrentFrame;
463
- function F(e) {
463
+ var z = k.ReactCurrentOwner, Re = k.ReactDebugCurrentFrame;
464
+ function A(e) {
464
465
  if (e) {
465
- var r = e._owner, t = M(e.type, e._source, r ? r.type : null);
466
+ var r = e._owner, t = L(e.type, e._source, r ? r.type : null);
466
467
  Re.setExtraStackFrame(t);
467
468
  } else
468
469
  Re.setExtraStackFrame(null);
469
470
  }
470
- var X;
471
- X = !1;
472
- function H(e) {
471
+ var H;
472
+ H = !1;
473
+ function Q(e) {
473
474
  return typeof e == "object" && e !== null && e.$$typeof === f;
474
475
  }
475
476
  function Ee() {
476
477
  {
477
- if (G.current) {
478
- var e = O(G.current.type);
478
+ if (z.current) {
479
+ var e = x(z.current.type);
479
480
  if (e)
480
481
  return `
481
482
 
@@ -484,11 +485,11 @@ Check the render method of \`` + e + "`.";
484
485
  return "";
485
486
  }
486
487
  }
487
- function nr(e) {
488
+ function ir(e) {
488
489
  return "";
489
490
  }
490
- var he = {};
491
- function ar(e) {
491
+ var _e = {};
492
+ function or(e) {
492
493
  {
493
494
  var r = Ee();
494
495
  if (!r) {
@@ -500,39 +501,39 @@ Check the top-level render call using <` + t + ">.");
500
501
  return r;
501
502
  }
502
503
  }
503
- function _e(e, r) {
504
+ function Te(e, r) {
504
505
  {
505
506
  if (!e._store || e._store.validated || e.key != null)
506
507
  return;
507
508
  e._store.validated = !0;
508
- var t = ar(r);
509
- if (he[t])
509
+ var t = or(r);
510
+ if (_e[t])
510
511
  return;
511
- he[t] = !0;
512
+ _e[t] = !0;
512
513
  var n = "";
513
- e && e._owner && e._owner !== G.current && (n = " It was passed a child from " + O(e._owner.type) + "."), F(e), p('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), F(null);
514
+ e && e._owner && e._owner !== z.current && (n = " It was passed a child from " + x(e._owner.type) + "."), A(e), b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), A(null);
514
515
  }
515
516
  }
516
- function Te(e, r) {
517
+ function we(e, r) {
517
518
  {
518
519
  if (typeof e != "object")
519
520
  return;
520
- if (z(e))
521
+ if (G(e))
521
522
  for (var t = 0; t < e.length; t++) {
522
523
  var n = e[t];
523
- H(n) && _e(n, r);
524
+ Q(n) && Te(n, r);
524
525
  }
525
- else if (H(e))
526
+ else if (Q(e))
526
527
  e._store && (e._store.validated = !0);
527
528
  else if (e) {
528
- var o = ke(e);
529
+ var o = Ae(e);
529
530
  if (typeof o == "function" && o !== e.entries)
530
- for (var u = o.call(e), i; !(i = u.next()).done; )
531
- H(i.value) && _e(i.value, r);
531
+ for (var l = o.call(e), i; !(i = l.next()).done; )
532
+ Q(i.value) && Te(i.value, r);
532
533
  }
533
534
  }
534
535
  }
535
- function ir(e) {
536
+ function sr(e) {
536
537
  {
537
538
  var r = e.type;
538
539
  if (r == null || typeof r == "string")
@@ -540,137 +541,204 @@ Check the top-level render call using <` + t + ">.");
540
541
  var t;
541
542
  if (typeof r == "function")
542
543
  t = r.propTypes;
543
- else if (typeof r == "object" && (r.$$typeof === c || // Note: Memo only checks outer props here.
544
+ else if (typeof r == "object" && (r.$$typeof === v || // Note: Memo only checks outer props here.
544
545
  // Inner props are checked in the reconciler.
545
- r.$$typeof === h))
546
+ r.$$typeof === S))
546
547
  t = r.propTypes;
547
548
  else
548
549
  return;
549
550
  if (t) {
550
- var n = O(r);
551
- Je(t, e.props, "prop", n, e);
552
- } else if (r.PropTypes !== void 0 && !X) {
553
- X = !0;
554
- var o = O(r);
555
- p("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", o || "Unknown");
551
+ var n = x(r);
552
+ Ke(t, e.props, "prop", n, e);
553
+ } else if (r.PropTypes !== void 0 && !H) {
554
+ H = !0;
555
+ var o = x(r);
556
+ b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", o || "Unknown");
556
557
  }
557
- typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && p("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
558
+ typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
558
559
  }
559
560
  }
560
- function or(e) {
561
+ function ur(e) {
561
562
  {
562
563
  for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
563
564
  var n = r[t];
564
565
  if (n !== "children" && n !== "key") {
565
- F(e), p("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), F(null);
566
+ A(e), b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), A(null);
566
567
  break;
567
568
  }
568
569
  }
569
- e.ref !== null && (F(e), p("Invalid attribute `ref` supplied to `React.Fragment`."), F(null));
570
+ e.ref !== null && (A(e), b("Invalid attribute `ref` supplied to `React.Fragment`."), A(null));
570
571
  }
571
572
  }
572
- var Oe = {};
573
- function xe(e, r, t, n, o, u) {
573
+ var Se = {};
574
+ function xe(e, r, t, n, o, l) {
574
575
  {
575
- var i = Ye(e);
576
+ var i = Ue(e);
576
577
  if (!i) {
577
578
  var a = "";
578
579
  (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
579
- var b = nr();
580
- b ? a += b : a += Ee();
581
- var s;
582
- e === null ? s = "null" : z(e) ? s = "array" : e !== void 0 && e.$$typeof === f ? (s = "<" + (O(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : s = typeof e, p("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", s, a);
580
+ var R = ir();
581
+ R ? a += R : a += Ee();
582
+ var p;
583
+ e === null ? p = "null" : G(e) ? p = "array" : e !== void 0 && e.$$typeof === f ? (p = "<" + (x(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : p = typeof e, b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", p, a);
583
584
  }
584
- var l = tr(e, r, t, o, u);
585
- if (l == null)
586
- return l;
585
+ var h = ar(e, r, t, o, l);
586
+ if (h == null)
587
+ return h;
587
588
  if (i) {
588
- var R = r.children;
589
- if (R !== void 0)
589
+ var T = r.children;
590
+ if (T !== void 0)
590
591
  if (n)
591
- if (z(R)) {
592
- for (var A = 0; A < R.length; A++)
593
- Te(R[A], e);
594
- Object.freeze && Object.freeze(R);
592
+ if (G(T)) {
593
+ for (var D = 0; D < T.length; D++)
594
+ we(T[D], e);
595
+ Object.freeze && Object.freeze(T);
595
596
  } else
596
- p("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
597
+ b("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
597
598
  else
598
- Te(R, e);
599
+ we(T, e);
599
600
  }
600
601
  if ($.call(r, "key")) {
601
- var w = O(e), m = Object.keys(r).filter(function(dr) {
602
- return dr !== "key";
603
- }), Q = m.length > 0 ? "{key: someKey, " + m.join(": ..., ") + ": ...}" : "{key: someKey}";
604
- if (!Oe[w + Q]) {
605
- var cr = m.length > 0 ? "{" + m.join(": ..., ") + ": ...}" : "{}";
606
- p(`A props object containing a "key" prop is being spread into JSX:
602
+ var j = x(e), E = Object.keys(r).filter(function(pr) {
603
+ return pr !== "key";
604
+ }), X = E.length > 0 ? "{key: someKey, " + E.join(": ..., ") + ": ...}" : "{key: someKey}";
605
+ if (!Se[j + X]) {
606
+ var vr = E.length > 0 ? "{" + E.join(": ..., ") + ": ...}" : "{}";
607
+ b(`A props object containing a "key" prop is being spread into JSX:
607
608
  let props = %s;
608
609
  <%s {...props} />
609
610
  React keys must be passed directly to JSX without using spread:
610
611
  let props = %s;
611
- <%s key={someKey} {...props} />`, Q, w, cr, w), Oe[w + Q] = !0;
612
+ <%s key={someKey} {...props} />`, X, j, vr, j), Se[j + X] = !0;
612
613
  }
613
614
  }
614
- return e === v ? or(l) : ir(l), l;
615
+ return e === d ? ur(h) : sr(h), h;
615
616
  }
616
617
  }
617
- function ur(e, r, t) {
618
+ function lr(e, r, t) {
618
619
  return xe(e, r, t, !0);
619
620
  }
620
- function sr(e, r, t) {
621
+ function cr(e, r, t) {
621
622
  return xe(e, r, t, !1);
622
623
  }
623
- var lr = sr, fr = ur;
624
- Y.Fragment = v, Y.jsx = lr, Y.jsxs = fr;
624
+ var fr = cr, dr = lr;
625
+ Y.Fragment = d, Y.jsx = fr, Y.jsxs = dr;
625
626
  })()), Y;
626
627
  }
627
628
  var Ce;
628
- function gr() {
629
- return Ce || (Ce = 1, process.env.NODE_ENV === "production" ? B.exports = mr() : B.exports = yr()), B.exports;
629
+ function _r() {
630
+ return Ce || (Ce = 1, process.env.NODE_ENV === "production" ? q.exports = Rr() : q.exports = Er()), q.exports;
630
631
  }
631
- var C = gr();
632
- function Rr(g) {
633
- const f = P.useRef(!1), d = Pe();
634
- P.useEffect(() => {
635
- f.current || !Array.isArray(g) || (Z.getState().replaceAll(g), d.preview.set(!0), f.current = !0);
636
- }, [g, d.preview]);
632
+ var F = _r();
633
+ function Tr(u, f = "inhouse", c = !1) {
634
+ const d = O.useRef(!1), s = Fe();
635
+ O.useEffect(() => {
636
+ if (d.current || !u) return;
637
+ const g = mr(u, f), w = g.fields || g, m = g.conversionReport;
638
+ if (m) {
639
+ if (s.setConversionReport(m), console.log("[QuestionnaireRenderer] Schema conversion complete:", {
640
+ totalElements: m.totalElements,
641
+ convertedFields: m.convertedFields,
642
+ droppedFields: m.droppedFields.length,
643
+ warnings: m.warnings.length
644
+ }), m.warnings.length > 0) {
645
+ console.warn("[QuestionnaireRenderer] Conversion warnings detected. Some features may not work as expected.");
646
+ const v = m.warnings.filter((y) => y.impact === "high"), _ = m.warnings.filter((y) => y.impact === "medium");
647
+ v.length > 0 && console.warn(`⚠️ HIGH IMPACT (${v.length}):`, v), _.length > 0 && console.warn(`⚠️ MEDIUM IMPACT (${_.length}):`, _);
648
+ }
649
+ m.droppedFields.length > 0 && console.error("❌ DROPPED FIELDS:", m.droppedFields);
650
+ }
651
+ ee.getState().replaceAll(w), s.preview.set(!0), d.current = !0;
652
+ }, [u, f, s]), O.useEffect(() => {
653
+ s.setHideUnsupportedFields(c);
654
+ }, [c, s]);
637
655
  }
638
- const Er = P.memo(function({ id: f }) {
639
- const d = Z(P.useCallback((_) => _.byId[f], [f]));
640
- if (!d) return null;
641
- const v = pr(d.fieldType);
642
- return v ? /* @__PURE__ */ C.jsx("div", { className: "mb-1.5", "data-field-type": d.fieldType, "data-field-id": d.id, children: /* @__PURE__ */ C.jsx(v, { field: d }) }) : null;
656
+ const wr = O.memo(function({ id: f }) {
657
+ const c = ee(O.useCallback((s) => s.byId[f], [f]));
658
+ if (!c) return null;
659
+ const d = hr(c.fieldType);
660
+ return d ? /* @__PURE__ */ F.jsx("div", { className: "mb-1.5", "data-field-type": c.fieldType, "data-field-id": c.id, children: /* @__PURE__ */ F.jsx(d, { field: c }) }) : null;
643
661
  });
644
- function hr() {
645
- const g = Pe(), { fields: f } = br(g.state.isPreview), d = vr(() => f.map((v) => v.id), [f]);
646
- return /* @__PURE__ */ C.jsx("div", { children: d.map((v) => /* @__PURE__ */ C.jsx(
647
- Er,
662
+ function Sr() {
663
+ const u = Fe(), { fields: f } = yr(u.state.isPreview), c = br((s) => s.hideUnsupportedFields), d = gr(() => (c ? f.filter((g) => g.fieldType !== "unsupported") : f).map((g) => g.id), [f, c]);
664
+ return /* @__PURE__ */ F.jsx("div", { children: d.map((s) => /* @__PURE__ */ F.jsx(
665
+ wr,
648
666
  {
649
- id: v
667
+ id: s
650
668
  },
651
- v
669
+ s
652
670
  )) });
653
671
  }
654
- function Or({
655
- fields: g,
656
- onChange: f,
672
+ function Pr({
673
+ fields: u,
674
+ schemaType: f = "inhouse",
675
+ onChange: c,
657
676
  className: d = "",
658
- fullHeight: v = !1
677
+ fullHeight: s = !1,
678
+ hideUnsupportedFields: g = !1
659
679
  }) {
660
- Rr(g), P.useEffect(() => f ? Z.subscribe((T) => {
661
- const E = T.order.map((c) => T.byId[c]);
662
- f(E);
663
- }) : void 0, [f]);
664
- const _ = [
680
+ Tr(u, f, g), O.useEffect(() => c ? ee.subscribe((v) => {
681
+ const _ = v.order.map((y) => v.byId[y]);
682
+ c(_);
683
+ }) : void 0, [c]);
684
+ const w = [
665
685
  "qb-render-root",
666
686
  "bg-gray-100",
667
687
  "font-titillium",
668
- v ? "min-h-screen" : "",
688
+ s ? "min-h-screen" : "",
669
689
  d
670
690
  ].filter(Boolean).join(" ");
671
- return /* @__PURE__ */ C.jsx("div", { className: _, children: /* @__PURE__ */ C.jsx("div", { className: "max-w-4xl mx-auto px-2 pb-8 pt-4", children: /* @__PURE__ */ C.jsx(hr, {}) }) });
691
+ return /* @__PURE__ */ F.jsx("div", { className: w, children: /* @__PURE__ */ F.jsx("div", { className: "max-w-4xl mx-auto px-2 pb-8 pt-4", children: /* @__PURE__ */ F.jsx(Sr, {}) }) });
692
+ }
693
+ function je(u) {
694
+ switch (u.fieldType) {
695
+ case "input":
696
+ return u.answer ? [{ valueString: String(u.answer) }] : [];
697
+ case "radio":
698
+ return u.selected ? [{ valueString: Z(u, u.selected) }] : [];
699
+ case "check":
700
+ return (u.selected || []).map((f) => ({ valueString: Z(u, f) }));
701
+ case "selection":
702
+ return u.selected ? [{ valueString: Z(u, u.selected) }] : [];
703
+ default:
704
+ return [];
705
+ }
706
+ }
707
+ function Z(u, f) {
708
+ const c = (u.options || []).find((d) => d.id === f || d.value === f);
709
+ return c ? c.value : "";
710
+ }
711
+ function Cr(u, f, c) {
712
+ const d = [];
713
+ return (u || []).forEach((s) => {
714
+ if (s.fieldType === "section" && Array.isArray(s.fields)) {
715
+ s.fields.forEach((g) => {
716
+ g && d.push({
717
+ linkId: g.id,
718
+ text: g.question || g.title || "",
719
+ answer: je(g)
720
+ });
721
+ });
722
+ return;
723
+ }
724
+ s.fieldType !== "section" && d.push({
725
+ linkId: s.id,
726
+ text: s.question || s.title || "",
727
+ answer: je(s)
728
+ });
729
+ }), {
730
+ resourceType: "QuestionnaireResponse",
731
+ questionnaire: f,
732
+ status: "in-progress",
733
+ subject: c ? { reference: `Patient/${c}` } : void 0,
734
+ item: d
735
+ };
672
736
  }
673
737
  export {
674
- Or as QuestionnaireRenderer
738
+ wr as FieldNode,
739
+ Pr as QuestionnaireRenderer,
740
+ Sr as RendererBody,
741
+ Cr as buildQuestionnaireResponse,
742
+ kr as useFieldsArray
675
743
  };
676
744
  //# sourceMappingURL=react.js.map