@bahmni/services 0.0.1-dev.82 → 0.0.1-dev.85

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -10,7 +10,7 @@ const { toString: hi } = Object.prototype, { getPrototypeOf: An } = Object, { it
10
10
  const r = hi.call(t);
11
11
  return e[r] || (e[r] = r.slice(8, -1).toLowerCase());
12
12
  })(/* @__PURE__ */ Object.create(null)), De = (e) => (e = e.toLowerCase(), (t) => Ir(t) === e), Cr = (e) => (t) => typeof t === e, { isArray: dt } = Array, it = Cr("undefined");
13
- function Tt(e) {
13
+ function $t(e) {
14
14
  return e !== null && !it(e) && e.constructor !== null && !it(e.constructor) && _e(e.constructor.isBuffer) && e.constructor.isBuffer(e);
15
15
  }
16
16
  const ao = De("ArrayBuffer");
@@ -18,24 +18,24 @@ function pi(e) {
18
18
  let t;
19
19
  return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && ao(e.buffer), t;
20
20
  }
21
- const mi = Cr("string"), _e = Cr("function"), oo = Cr("number"), $t = (e) => e !== null && typeof e == "object", gi = (e) => e === !0 || e === !1, vr = (e) => {
21
+ const mi = Cr("string"), _e = Cr("function"), oo = Cr("number"), Tt = (e) => e !== null && typeof e == "object", gi = (e) => e === !0 || e === !1, vr = (e) => {
22
22
  if (Ir(e) !== "object")
23
23
  return !1;
24
24
  const t = An(e);
25
25
  return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(so in e) && !(Dr in e);
26
26
  }, yi = (e) => {
27
- if (!$t(e) || Tt(e))
27
+ if (!Tt(e) || $t(e))
28
28
  return !1;
29
29
  try {
30
30
  return Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype;
31
31
  } catch {
32
32
  return !1;
33
33
  }
34
- }, vi = De("Date"), wi = De("File"), bi = De("Blob"), Ei = De("FileList"), _i = (e) => $t(e) && _e(e.pipe), Si = (e) => {
34
+ }, vi = De("Date"), wi = De("File"), bi = De("Blob"), Ei = De("FileList"), _i = (e) => Tt(e) && _e(e.pipe), Si = (e) => {
35
35
  let t;
36
36
  return e && (typeof FormData == "function" && e instanceof FormData || _e(e.append) && ((t = Ir(e)) === "formdata" || // detect form-data instance
37
37
  t === "object" && _e(e.toString) && e.toString() === "[object FormData]"));
38
- }, Ri = De("URLSearchParams"), [Pi, Ti, $i, Oi] = ["ReadableStream", "Request", "Response", "Headers"].map(De), Ai = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
38
+ }, Ri = De("URLSearchParams"), [Pi, $i, Ti, Oi] = ["ReadableStream", "Request", "Response", "Headers"].map(De), Ai = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
39
39
  function Ot(e, t, { allOwnKeys: r = !1 } = {}) {
40
40
  if (e === null || typeof e > "u")
41
41
  return;
@@ -44,7 +44,7 @@ function Ot(e, t, { allOwnKeys: r = !1 } = {}) {
44
44
  for (n = 0, s = e.length; n < s; n++)
45
45
  t.call(null, e[n], n, e);
46
46
  else {
47
- if (Tt(e))
47
+ if ($t(e))
48
48
  return;
49
49
  const a = r ? Object.getOwnPropertyNames(e) : Object.keys(e), o = a.length;
50
50
  let i;
@@ -53,7 +53,7 @@ function Ot(e, t, { allOwnKeys: r = !1 } = {}) {
53
53
  }
54
54
  }
55
55
  function io(e, t) {
56
- if (Tt(e))
56
+ if ($t(e))
57
57
  return null;
58
58
  t = t.toLowerCase();
59
59
  const r = Object.keys(e);
@@ -155,10 +155,10 @@ function Wi(e) {
155
155
  }
156
156
  const Gi = (e) => {
157
157
  const t = new Array(10), r = (n, s) => {
158
- if ($t(n)) {
158
+ if (Tt(n)) {
159
159
  if (t.indexOf(n) >= 0)
160
160
  return;
161
- if (Tt(n))
161
+ if ($t(n))
162
162
  return n;
163
163
  if (!("toJSON" in n)) {
164
164
  t[s] = n;
@@ -172,7 +172,7 @@ const Gi = (e) => {
172
172
  return n;
173
173
  };
174
174
  return r(e, 0);
175
- }, Ki = De("AsyncFunction"), Yi = (e) => e && ($t(e) || _e(e)) && _e(e.then) && _e(e.catch), lo = ((e, t) => e ? setImmediate : t ? ((r, n) => (We.addEventListener("message", ({ source: s, data: a }) => {
175
+ }, Ki = De("AsyncFunction"), Yi = (e) => e && (Tt(e) || _e(e)) && _e(e.then) && _e(e.catch), lo = ((e, t) => e ? setImmediate : t ? ((r, n) => (We.addEventListener("message", ({ source: s, data: a }) => {
176
176
  s === We && a === r && n.length && n.shift()();
177
177
  }, !1), (s) => {
178
178
  n.push(s), We.postMessage(r, "*");
@@ -182,18 +182,18 @@ const Gi = (e) => {
182
182
  ), Ji = typeof queueMicrotask < "u" ? queueMicrotask.bind(We) : typeof process < "u" && process.nextTick || lo, Xi = (e) => e != null && _e(e[Dr]), D = {
183
183
  isArray: dt,
184
184
  isArrayBuffer: ao,
185
- isBuffer: Tt,
185
+ isBuffer: $t,
186
186
  isFormData: Si,
187
187
  isArrayBufferView: pi,
188
188
  isString: mi,
189
189
  isNumber: oo,
190
190
  isBoolean: gi,
191
- isObject: $t,
191
+ isObject: Tt,
192
192
  isPlainObject: vr,
193
193
  isEmptyObject: yi,
194
194
  isReadableStream: Pi,
195
- isRequest: Ti,
196
- isResponse: $i,
195
+ isRequest: $i,
196
+ isResponse: Ti,
197
197
  isHeaders: Oi,
198
198
  isUndefined: it,
199
199
  isDate: vi,
@@ -929,12 +929,12 @@ const Sr = (e, t, r = 3) => {
929
929
  function Pc(e) {
930
930
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
931
931
  }
932
- function Tc(e, t) {
932
+ function $c(e, t) {
933
933
  return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
934
934
  }
935
935
  function Eo(e, t, r) {
936
936
  let n = !Pc(t);
937
- return e && (n || r == !1) ? Tc(e, t) : t;
937
+ return e && (n || r == !1) ? $c(e, t) : t;
938
938
  }
939
939
  const Xn = (e) => e instanceof Se ? { ...e } : e;
940
940
  function Ke(e, t) {
@@ -1022,7 +1022,7 @@ const _o = (e) => {
1022
1022
  c && o.set(s, c);
1023
1023
  }
1024
1024
  return t;
1025
- }, $c = typeof XMLHttpRequest < "u", Oc = $c && function(e) {
1025
+ }, Tc = typeof XMLHttpRequest < "u", Oc = Tc && function(e) {
1026
1026
  return new Promise(function(r, n) {
1027
1027
  const s = _o(e);
1028
1028
  let a = s.data;
@@ -1243,8 +1243,8 @@ const _o = (e) => {
1243
1243
  method: "POST",
1244
1244
  body: h,
1245
1245
  duplex: "half"
1246
- }), $;
1247
- if (D.isFormData(h) && ($ = M.headers.get("content-type")) && O.setContentType($), M.body) {
1246
+ }), T;
1247
+ if (D.isFormData(h) && (T = M.headers.get("content-type")) && O.setContentType(T), M.body) {
1248
1248
  const [C, N] = Yn(
1249
1249
  z,
1250
1250
  Sr(Jn(E))
@@ -1270,8 +1270,8 @@ const _o = (e) => {
1270
1270
  ["status", "statusText", "headers"].forEach((w) => {
1271
1271
  M[w] = ce[w];
1272
1272
  });
1273
- const $ = D.toFiniteNumber(ce.headers.get("content-length")), [C, N] = _ && Yn(
1274
- $,
1273
+ const T = D.toFiniteNumber(ce.headers.get("content-length")), [C, N] = _ && Yn(
1274
+ T,
1275
1275
  Sr(Jn(_), !0)
1276
1276
  ) || [];
1277
1277
  ce = new n(
@@ -1283,8 +1283,8 @@ const _o = (e) => {
1283
1283
  }
1284
1284
  S = S || "text";
1285
1285
  let ie = await m[D.findKey(m, S) || "text"](ce, v);
1286
- return !ee && F && F(), await new Promise((M, $) => {
1287
- bo(M, $, {
1286
+ return !ee && F && F(), await new Promise((M, T) => {
1287
+ bo(M, T, {
1288
1288
  data: ie,
1289
1289
  headers: Se.from(ce.headers),
1290
1290
  status: ce.status,
@@ -1386,7 +1386,7 @@ function ss(e) {
1386
1386
  ), n.response.headers = Se.from(n.response.headers))), Promise.reject(n);
1387
1387
  });
1388
1388
  }
1389
- const To = "1.12.0", Lr = {};
1389
+ const $o = "1.12.0", Lr = {};
1390
1390
  ["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
1391
1391
  Lr[e] = function(n) {
1392
1392
  return typeof n === e || "a" + (t < 1 ? "n " : " ") + e;
@@ -1395,7 +1395,7 @@ const To = "1.12.0", Lr = {};
1395
1395
  const as = {};
1396
1396
  Lr.transitional = function(t, r, n) {
1397
1397
  function s(a, o) {
1398
- return "[Axios v" + To + "] Transitional option '" + a + "'" + o + (n ? ". " + n : "");
1398
+ return "[Axios v" + $o + "] Transitional option '" + a + "'" + o + (n ? ". " + n : "");
1399
1399
  }
1400
1400
  return (a, o, i) => {
1401
1401
  if (t === !1)
@@ -1559,7 +1559,7 @@ D.forEach(["post", "put", "patch"], function(t) {
1559
1559
  }
1560
1560
  Ge.prototype[t] = r(), Ge.prototype[t + "Form"] = r(!0);
1561
1561
  });
1562
- let xc = class $o {
1562
+ let xc = class To {
1563
1563
  constructor(t) {
1564
1564
  if (typeof t != "function")
1565
1565
  throw new TypeError("executor must be a function.");
@@ -1625,7 +1625,7 @@ let xc = class $o {
1625
1625
  static source() {
1626
1626
  let t;
1627
1627
  return {
1628
- token: new $o(function(s) {
1628
+ token: new To(function(s) {
1629
1629
  t = s;
1630
1630
  }),
1631
1631
  cancel: t
@@ -1719,7 +1719,7 @@ ue.Axios = Ge;
1719
1719
  ue.CanceledError = ft;
1720
1720
  ue.CancelToken = xc;
1721
1721
  ue.isCancel = wo;
1722
- ue.VERSION = To;
1722
+ ue.VERSION = $o;
1723
1723
  ue.toFormData = kr;
1724
1724
  ue.AxiosError = G;
1725
1725
  ue.Cancel = ue.CanceledError;
@@ -2029,7 +2029,7 @@ const ou = [" ", ",", "?", "!", ";"], iu = new au(20), cu = (e, t, r) => {
2029
2029
  o > 0 && !s.test(e.substring(0, o)) && (a = !0);
2030
2030
  }
2031
2031
  return a;
2032
- }, Tn = function(e, t) {
2032
+ }, $n = function(e, t) {
2033
2033
  let r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ".";
2034
2034
  if (!e) return;
2035
2035
  if (e[t])
@@ -2065,7 +2065,7 @@ const ou = [" ", ",", "?", "!", ";"], iu = new au(20), cu = (e, t, r) => {
2065
2065
  console?.[e]?.apply?.(console, t);
2066
2066
  }
2067
2067
  };
2068
- class Tr {
2068
+ class $r {
2069
2069
  constructor(t) {
2070
2070
  let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
2071
2071
  this.init(t, r);
@@ -2098,16 +2098,16 @@ class Tr {
2098
2098
  return s && !this.debug ? null : (W(t[0]) && (t[0] = `${n}${this.prefix} ${t[0]}`), this.logger[r](t));
2099
2099
  }
2100
2100
  create(t) {
2101
- return new Tr(this.logger, {
2101
+ return new $r(this.logger, {
2102
2102
  prefix: `${this.prefix}:${t}:`,
2103
2103
  ...this.options
2104
2104
  });
2105
2105
  }
2106
2106
  clone(t) {
2107
- return t = t || this.options, t.prefix = t.prefix || this.prefix, new Tr(this.logger, t);
2107
+ return t = t || this.options, t.prefix = t.prefix || this.prefix, new $r(this.logger, t);
2108
2108
  }
2109
2109
  }
2110
- var ke = new Tr();
2110
+ var ke = new $r();
2111
2111
  class Mr {
2112
2112
  constructor() {
2113
2113
  this.observers = {};
@@ -2163,7 +2163,7 @@ class ds extends Mr {
2163
2163
  let i;
2164
2164
  t.indexOf(".") > -1 ? i = t.split(".") : (i = [t, r], n && (Array.isArray(n) ? i.push(...n) : W(n) && a ? i.push(...n.split(a)) : i.push(n)));
2165
2165
  const c = Rr(this.data, i);
2166
- return !c && !r && !n && t.indexOf(".") > -1 && (t = i[0], r = i[1], n = i.slice(2).join(".")), c || !o || !W(n) ? c : Tn(this.data?.[t]?.[r], n, a);
2166
+ return !c && !r && !n && t.indexOf(".") > -1 && (t = i[0], r = i[1], n = i.slice(2).join(".")), c || !o || !W(n) ? c : $n(this.data?.[t]?.[r], n, a);
2167
2167
  }
2168
2168
  addResource(t, r, n, s) {
2169
2169
  let a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
@@ -2227,7 +2227,7 @@ var Do = {
2227
2227
  }
2228
2228
  };
2229
2229
  const fs = {}, hs = (e) => !W(e) && typeof e != "boolean" && typeof e != "number";
2230
- class $r extends Mr {
2230
+ class Tr extends Mr {
2231
2231
  constructor(t) {
2232
2232
  let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
2233
2233
  super(), Zc(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], t, this), this.options = r, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = ke.create("translator");
@@ -2294,7 +2294,7 @@ class $r extends Mr {
2294
2294
  }
2295
2295
  const m = this.resolve(t, r);
2296
2296
  let y = m?.res;
2297
- const R = m?.usedKey || o, v = m?.exactUsedKey || o, g = ["[object Number]", "[object Function]", "[object RegExp]"], f = r.joinArrays !== void 0 ? r.joinArrays : this.options.joinArrays, h = !this.i18nFormat || this.i18nFormat.handleAsObject, u = r.count !== void 0 && !W(r.count), p = $r.hasDefaultValue(r), b = u ? this.pluralResolver.getSuffix(d, r.count, r) : "", _ = r.ordinal && u ? this.pluralResolver.getSuffix(d, r.count, {
2297
+ const R = m?.usedKey || o, v = m?.exactUsedKey || o, g = ["[object Number]", "[object Function]", "[object RegExp]"], f = r.joinArrays !== void 0 ? r.joinArrays : this.options.joinArrays, h = !this.i18nFormat || this.i18nFormat.handleAsObject, u = r.count !== void 0 && !W(r.count), p = Tr.hasDefaultValue(r), b = u ? this.pluralResolver.getSuffix(d, r.count, r) : "", _ = r.ordinal && u ? this.pluralResolver.getSuffix(d, r.count, {
2298
2298
  ordinal: !1
2299
2299
  }) : "", E = u && !r.ordinal && r.count === 0, S = E && r[`defaultValue${this.options.pluralSeparator}zero`] || r[`defaultValue${b}`] || r[`defaultValue${_}`] || r.defaultValue;
2300
2300
  let O = y;
@@ -2347,14 +2347,14 @@ class $r extends Mr {
2347
2347
  for (let ie = 0; ie < ce.length; ie++)
2348
2348
  he.push(ce[ie]);
2349
2349
  else this.options.saveMissingTo === "all" ? he = this.languageUtils.toResolveHierarchy(r.lng || this.language) : he.push(r.lng || this.language);
2350
- const ee = (ie, M, $) => {
2351
- const C = p && $ !== y ? $ : z;
2350
+ const ee = (ie, M, T) => {
2351
+ const C = p && T !== y ? T : z;
2352
2352
  this.options.missingKeyHandler ? this.options.missingKeyHandler(ie, c, M, C, Y, r) : this.backendConnector?.saveMissing && this.backendConnector.saveMissing(ie, c, M, C, Y, r), this.emit("missingKey", ie, c, M, y);
2353
2353
  };
2354
2354
  this.options.saveMissing && (this.options.saveMissingPlurals && u ? he.forEach((ie) => {
2355
2355
  const M = this.pluralResolver.getSuffixes(ie, r);
2356
- E && r[`defaultValue${this.options.pluralSeparator}zero`] && M.indexOf(`${this.options.pluralSeparator}zero`) < 0 && M.push(`${this.options.pluralSeparator}zero`), M.forEach(($) => {
2357
- ee([ie], o + $, r[`defaultValue${$}`] || S);
2356
+ E && r[`defaultValue${this.options.pluralSeparator}zero`] && M.indexOf(`${this.options.pluralSeparator}zero`) < 0 && M.push(`${this.options.pluralSeparator}zero`), M.forEach((T) => {
2357
+ ee([ie], o + T, r[`defaultValue${T}`] || S);
2358
2358
  });
2359
2359
  }) : ee(he, o, S));
2360
2360
  }
@@ -2605,7 +2605,7 @@ class lu {
2605
2605
  }
2606
2606
  const ys = function(e, t, r) {
2607
2607
  let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ".", s = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, a = ru(e, t, r);
2608
- return !a && s && W(r) && (a = Tn(e, r, n), a === void 0 && (a = Tn(t, r, n))), a;
2608
+ return !a && s && W(r) && (a = $n(e, r, n), a === void 0 && (a = $n(t, r, n))), a;
2609
2609
  }, rn = (e) => e.replace(/\$/g, "$$$$");
2610
2610
  class du {
2611
2611
  constructor() {
@@ -3085,7 +3085,7 @@ class Rt extends Mr {
3085
3085
  for (var v = arguments.length, g = new Array(v > 1 ? v - 1 : 0), f = 1; f < v; f++)
3086
3086
  g[f - 1] = arguments[f];
3087
3087
  t.emit(R, ...g);
3088
- }), this.modules.languageDetector && (y.languageDetector = a(this.modules.languageDetector), y.languageDetector.init && y.languageDetector.init(y, this.options.detection, this.options)), this.modules.i18nFormat && (y.i18nFormat = a(this.modules.i18nFormat), y.i18nFormat.init && y.i18nFormat.init(this)), this.translator = new $r(this.services, this.options), this.translator.on("*", function(R) {
3088
+ }), this.modules.languageDetector && (y.languageDetector = a(this.modules.languageDetector), y.languageDetector.init && y.languageDetector.init(y, this.options.detection, this.options)), this.modules.i18nFormat && (y.i18nFormat = a(this.modules.i18nFormat), y.i18nFormat.init && y.i18nFormat.init(this)), this.translator = new Tr(this.services, this.options), this.translator.on("*", function(R) {
3089
3089
  for (var v = arguments.length, g = new Array(v > 1 ? v - 1 : 0), f = 1; f < v; f++)
3090
3090
  g[f - 1] = arguments[f];
3091
3091
  t.emit(R, ...g);
@@ -3273,7 +3273,7 @@ class Rt extends Mr {
3273
3273
  }, l), {})), {});
3274
3274
  a.store = new ds(i, s), a.services.resourceStore = a.store;
3275
3275
  }
3276
- return a.translator = new $r(a.services, s), a.translator.on("*", function(i) {
3276
+ return a.translator = new Tr(a.services, s), a.translator.on("*", function(i) {
3277
3277
  for (var c = arguments.length, d = new Array(c > 1 ? c - 1 : 0), l = 1; l < c; l++)
3278
3278
  d[l - 1] = arguments[l];
3279
3279
  a.emit(i, ...d);
@@ -3500,7 +3500,7 @@ const Ss = () => {
3500
3500
  }
3501
3501
  return et;
3502
3502
  };
3503
- var Tu = {
3503
+ var $u = {
3504
3504
  name: "sessionStorage",
3505
3505
  lookup(e) {
3506
3506
  let {
@@ -3515,7 +3515,7 @@ var Tu = {
3515
3515
  } = t;
3516
3516
  r && Ss() && window.sessionStorage.setItem(r, e);
3517
3517
  }
3518
- }, $u = {
3518
+ }, Tu = {
3519
3519
  name: "navigator",
3520
3520
  lookup(e) {
3521
3521
  const t = [];
@@ -3593,7 +3593,7 @@ class ko {
3593
3593
  let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
3594
3594
  languageUtils: {}
3595
3595
  }, r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3596
- this.services = t, this.options = wu(r, this.options || {}, Du()), typeof this.options.convertDetectedLanguage == "string" && this.options.convertDetectedLanguage.indexOf("15897") > -1 && (this.options.convertDetectedLanguage = (s) => s.replace("-", "_")), this.options.lookupFromUrlIndex && (this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex), this.i18nOptions = n, this.addDetector(_u), this.addDetector(Su), this.addDetector(Pu), this.addDetector(Tu), this.addDetector($u), this.addDetector(Ou), this.addDetector(Au), this.addDetector(Nu), this.addDetector(Ru);
3596
+ this.services = t, this.options = wu(r, this.options || {}, Du()), typeof this.options.convertDetectedLanguage == "string" && this.options.convertDetectedLanguage.indexOf("15897") > -1 && (this.options.convertDetectedLanguage = (s) => s.replace("-", "_")), this.options.lookupFromUrlIndex && (this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex), this.i18nOptions = n, this.addDetector(_u), this.addDetector(Su), this.addDetector(Pu), this.addDetector($u), this.addDetector(Tu), this.addDetector(Ou), this.addDetector(Au), this.addDetector(Nu), this.addDetector(Ru);
3597
3597
  }
3598
3598
  addDetector(t) {
3599
3599
  return this.detectors[t.name] = t, this;
@@ -3615,7 +3615,7 @@ class ko {
3615
3615
  }
3616
3616
  }
3617
3617
  ko.type = "languageDetector";
3618
- const Iu = process.env.PUBLIC_URL ?? "/", Pe = "/openmrs/ws/fhir2/R4", ae = "/openmrs/ws/rest/v1", Cu = "/openmrs/ws/rest/v2", ku = "bahmni.user", Ty = "/bahmni/home/index.html", Lu = ae + "/bahmnicore/whoami", Mu = ae + "/bahmnicore/visitLocation/", xu = (e) => `${ae}/bahmniprogramenrollment?patient=${e}&v=full`, qu = "en", Lo = "NG_TRANSLATE_LANG_KEY", ju = (e, t) => Iu + `${e}/locales/locale_${t}.json`, Uu = (e, t) => `/bahmni_config/openmrs/i18n/${e}/locale_${t}.json`, xr = () => localStorage.getItem(Lo) ?? qu, Rs = async (e) => {
3618
+ const Iu = process.env.PUBLIC_URL ?? "/", Pe = "/openmrs/ws/fhir2/R4", ae = "/openmrs/ws/rest/v1", Cu = "/openmrs/ws/rest/v2", ku = "bahmni.user", $y = "/bahmni/home/index.html", Lu = ae + "/bahmnicore/whoami", Mu = ae + "/bahmnicore/visitLocation/", xu = (e) => `${ae}/bahmniprogramenrollment?patient=${e}&v=full`, qu = "en", Lo = "NG_TRANSLATE_LANG_KEY", ju = (e, t) => Iu + `${e}/locales/locale_${t}.json`, Uu = (e, t) => `/bahmni_config/openmrs/i18n/${e}/locale_${t}.json`, xr = () => localStorage.getItem(Lo) ?? qu, Rs = async (e) => {
3619
3619
  try {
3620
3620
  const t = await K(e);
3621
3621
  return t || (console.error(`Invalid response from ${e}`), {});
@@ -3639,7 +3639,7 @@ const Iu = process.env.PUBLIC_URL ?? "/", Pe = "/openmrs/ws/fhir2/R4", ae = "/op
3639
3639
  }, e !== "en" && (r.en = {
3640
3640
  [t]: await Ps(t, "en")
3641
3641
  }), r;
3642
- }, $y = (e, t) => {
3642
+ }, Ty = (e, t) => {
3643
3643
  const r = e.toUpperCase(), n = t.toUpperCase().replace(/\s+/g, "_").replace(/[^A-Z0-9_]/g, "");
3644
3644
  return `${r}_${n}`;
3645
3645
  }, Oy = async (e) => {
@@ -3684,9 +3684,9 @@ function Ay() {
3684
3684
  }, []);
3685
3685
  return fi(() => () => n(), [n]), { videoRef: e, start: r, stop: n, capture: s };
3686
3686
  }
3687
- const Vu = "bahmni.enableAuditLog", Mo = (e) => `${ae}/bahmnicore/sql/globalproperty?property=${e}`, xo = 6048e5, Hu = 864e5, qo = 6e4, jo = 36e5, Ts = /* @__PURE__ */ Symbol.for("constructDateFrom");
3687
+ const Vu = "bahmni.enableAuditLog", Mo = (e) => `${ae}/bahmnicore/sql/globalproperty?property=${e}`, xo = 6048e5, Hu = 864e5, qo = 6e4, jo = 36e5, $s = /* @__PURE__ */ Symbol.for("constructDateFrom");
3688
3688
  function Oe(e, t) {
3689
- return typeof e == "function" ? e(t) : e && typeof e == "object" && Ts in e ? e[Ts](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
3689
+ return typeof e == "function" ? e(t) : e && typeof e == "object" && $s in e ? e[$s](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
3690
3690
  }
3691
3691
  function fe(e, t) {
3692
3692
  return Oe(t || e, e);
@@ -3728,7 +3728,7 @@ function Uo(e, t) {
3728
3728
  const i = Or(o);
3729
3729
  return r.getTime() >= a.getTime() ? n + 1 : r.getTime() >= i.getTime() ? n : n - 1;
3730
3730
  }
3731
- function $s(e) {
3731
+ function Ts(e) {
3732
3732
  const t = fe(e), r = new Date(
3733
3733
  Date.UTC(
3734
3734
  t.getFullYear(),
@@ -3758,7 +3758,7 @@ function Fo(e, t, r) {
3758
3758
  r?.in,
3759
3759
  e,
3760
3760
  t
3761
- ), a = Os(n), o = Os(s), i = +a - $s(a), c = +o - $s(o);
3761
+ ), a = Os(n), o = Os(s), i = +a - Ts(a), c = +o - Ts(o);
3762
3762
  return Math.round((i - c) / Hu);
3763
3763
  }
3764
3764
  function Wu(e, t) {
@@ -3794,7 +3794,7 @@ function Yu(e, t, r) {
3794
3794
  );
3795
3795
  return n.getFullYear() - s.getFullYear();
3796
3796
  }
3797
- function $n(e, t, r) {
3797
+ function Tn(e, t, r) {
3798
3798
  const [n, s] = pt(
3799
3799
  r?.in,
3800
3800
  e,
@@ -4223,7 +4223,7 @@ const ml = /^(\d+)(th|st|nd|rd)?/i, gl = /\d+/i, yl = {
4223
4223
  }, Pl = {
4224
4224
  narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
4225
4225
  any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
4226
- }, Tl = {
4226
+ }, $l = {
4227
4227
  any: {
4228
4228
  am: /^a/i,
4229
4229
  pm: /^p/i,
@@ -4268,7 +4268,7 @@ const ml = /^(\d+)(th|st|nd|rd)?/i, gl = /\d+/i, yl = {
4268
4268
  dayPeriod: de({
4269
4269
  matchPatterns: Pl,
4270
4270
  defaultMatchWidth: "any",
4271
- parsePatterns: Tl,
4271
+ parsePatterns: $l,
4272
4272
  defaultParseWidth: "any"
4273
4273
  })
4274
4274
  }, Wo = {
@@ -4283,7 +4283,7 @@ const ml = /^(\d+)(th|st|nd|rd)?/i, gl = /\d+/i, yl = {
4283
4283
  firstWeekContainsDate: 1
4284
4284
  }
4285
4285
  };
4286
- function $l(e, t) {
4286
+ function Tl(e, t) {
4287
4287
  const r = fe(e, t?.in);
4288
4288
  return Fo(r, Zu(r)) + 1;
4289
4289
  }
@@ -4558,7 +4558,7 @@ const je = {
4558
4558
  },
4559
4559
  // Day of year
4560
4560
  D: function(e, t, r) {
4561
- const n = $l(e);
4561
+ const n = Tl(e);
4562
4562
  return t === "Do" ? r.ordinalNumber(n, { unit: "dayOfYear" }) : se(n, t.length);
4563
4563
  },
4564
4564
  // Day of week
@@ -5484,7 +5484,7 @@ const ks = {
5484
5484
  formattingValues: Sd,
5485
5485
  defaultFormattingWidth: "wide"
5486
5486
  })
5487
- }, Td = /^(\d+)(\.)?/i, $d = /\d+/i, Od = {
5487
+ }, $d = /^(\d+)(\.)?/i, Td = /\d+/i, Od = {
5488
5488
  narrow: /^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,
5489
5489
  abbreviated: /^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,
5490
5490
  wide: /^(vor Christus|vor unserer Zeitrechnung|nach Christus|unserer Zeitrechnung)/i
@@ -5555,8 +5555,8 @@ const ks = {
5555
5555
  }
5556
5556
  }, qd = {
5557
5557
  ordinalNumber: Ur({
5558
- matchPattern: Td,
5559
- parsePattern: $d,
5558
+ matchPattern: $d,
5559
+ parsePattern: Td,
5560
5560
  valueCallback: (e) => parseInt(e)
5561
5561
  }),
5562
5562
  era: de({
@@ -6101,14 +6101,14 @@ const ks = {
6101
6101
  formats: Rf,
6102
6102
  defaultWidth: "full"
6103
6103
  })
6104
- }, Tf = {
6104
+ }, $f = {
6105
6105
  lastWeek: "eeee 'dernier à' p",
6106
6106
  yesterday: "'hier à' p",
6107
6107
  today: "'aujourd’hui à' p",
6108
6108
  tomorrow: "'demain à' p'",
6109
6109
  nextWeek: "eeee 'prochain à' p",
6110
6110
  other: "P"
6111
- }, $f = (e, t, r, n) => Tf[e], Of = {
6111
+ }, Tf = (e, t, r, n) => $f[e], Of = {
6112
6112
  narrow: ["av. J.-C", "ap. J.-C"],
6113
6113
  abbreviated: ["av. J.-C", "ap. J.-C"],
6114
6114
  wide: ["avant Jésus-Christ", "après Jésus-Christ"]
@@ -6332,14 +6332,14 @@ const ks = {
6332
6332
  code: "fr",
6333
6333
  formatDistance: Ef,
6334
6334
  formatLong: Pf,
6335
- formatRelative: $f,
6335
+ formatRelative: Tf,
6336
6336
  localize: Lf,
6337
6337
  match: Kf,
6338
6338
  options: {
6339
6339
  weekStartsOn: 1,
6340
6340
  firstWeekContainsDate: 4
6341
6341
  }
6342
- }, Yf = "dd/MM/yyyy", Ny = "MMMM dd, yyyy", Dy = "do MMM, yyyy", Jf = "dd/MM/yyyy HH:mm", Iy = "yyyy-MM-dd", Cy = "d/m/Y", $e = {
6342
+ }, Yf = "dd/MM/yyyy", Ny = "MMMM dd, yyyy", Dy = "do MMM, yyyy", Jf = "dd/MM/yyyy HH:mm", Iy = "yyyy-MM-dd", Cy = "d/m/Y", Te = {
6343
6343
  PARSE_ERROR: "DATE_ERROR_PARSE",
6344
6344
  FORMAT_ERROR: "DATE_ERROR_FORMAT",
6345
6345
  EMPTY_OR_INVALID: "DATE_ERROR_EMPTY_OR_INVALID",
@@ -6367,7 +6367,7 @@ function Qf(e) {
6367
6367
  if (!Nt(t)) return null;
6368
6368
  const r = /* @__PURE__ */ new Date();
6369
6369
  if (t > r) return null;
6370
- const n = Ln(r, t), s = Cn(t, n), a = kn(r, s), o = qr(s, a), i = $n(r, o);
6370
+ const n = Ln(r, t), s = Cn(t, n), a = kn(r, s), o = qr(s, a), i = Tn(r, o);
6371
6371
  return { years: n, months: a, days: i };
6372
6372
  }
6373
6373
  function Xo(e, t) {
@@ -6375,16 +6375,16 @@ function Xo(e, t) {
6375
6375
  return {
6376
6376
  date: null,
6377
6377
  error: {
6378
- title: t($e.PARSE_ERROR),
6379
- message: t($e.EMPTY_OR_INVALID)
6378
+ title: t(Te.PARSE_ERROR),
6379
+ message: t(Te.EMPTY_OR_INVALID)
6380
6380
  }
6381
6381
  };
6382
6382
  const r = Yo(e);
6383
6383
  return Nt(r) ? { date: r } : {
6384
6384
  date: null,
6385
6385
  error: {
6386
- title: t($e.PARSE_ERROR),
6387
- message: t($e.INVALID_FORMAT)
6386
+ title: t(Te.PARSE_ERROR),
6387
+ message: t(Te.INVALID_FORMAT)
6388
6388
  }
6389
6389
  };
6390
6390
  }
@@ -6393,8 +6393,8 @@ function Qo(e, t, r) {
6393
6393
  return {
6394
6394
  formattedResult: "",
6395
6395
  error: {
6396
- title: r($e.FORMAT_ERROR),
6397
- message: r($e.NULL_OR_UNDEFINED)
6396
+ title: r(Te.FORMAT_ERROR),
6397
+ message: r(Te.NULL_OR_UNDEFINED)
6398
6398
  }
6399
6399
  };
6400
6400
  let n;
@@ -6412,8 +6412,8 @@ function Qo(e, t, r) {
6412
6412
  return {
6413
6413
  formattedResult: "",
6414
6414
  error: {
6415
- title: r($e.PARSE_ERROR),
6416
- message: r($e.INVALID_FORMAT)
6415
+ title: r(Te.PARSE_ERROR),
6416
+ message: r(Te.INVALID_FORMAT)
6417
6417
  }
6418
6418
  };
6419
6419
  const s = Xf();
@@ -6445,16 +6445,16 @@ function My(e, t) {
6445
6445
  return {
6446
6446
  formattedResult: "",
6447
6447
  error: {
6448
- title: t($e.FORMAT_ERROR),
6449
- message: t($e.NULL_OR_UNDEFINED)
6448
+ title: t(Te.FORMAT_ERROR),
6449
+ message: t(Te.NULL_OR_UNDEFINED)
6450
6450
  }
6451
6451
  };
6452
6452
  if (typeof e != "string")
6453
6453
  return {
6454
6454
  formattedResult: "",
6455
6455
  error: {
6456
- title: t($e.FORMAT_ERROR),
6457
- message: t($e.INVALID_FORMAT)
6456
+ title: t(Te.FORMAT_ERROR),
6457
+ message: t(Te.INVALID_FORMAT)
6458
6458
  }
6459
6459
  };
6460
6460
  const r = Xo(e, t);
@@ -6513,9 +6513,9 @@ function qy(e, t) {
6513
6513
  return c;
6514
6514
  }
6515
6515
  function jy(e, t) {
6516
- const r = new Date(e), n = /* @__PURE__ */ new Date(), s = Ln(n, r), a = Cn(r, s), o = kn(n, a), i = qr(a, o), c = $n(n, i);
6516
+ const r = new Date(e), n = /* @__PURE__ */ new Date(), s = Ln(n, r), a = Cn(r, s), o = kn(n, a), i = qr(a, o), c = Tn(n, i);
6517
6517
  if (s === 0 && o < 3) {
6518
- const m = $n(n, r);
6518
+ const m = Tn(n, r);
6519
6519
  if (!t)
6520
6520
  return `${m} days`;
6521
6521
  const y = t("REGISTRATION_DAYS_SHORT", { count: m });
@@ -6678,13 +6678,13 @@ const ei = () => {
6678
6678
  }, ti = ae + "/idgen/identifiertype", uh = (e) => ae + `/bahmni/app/setting?module=${e}`, lh = "bahmni.primaryIdentifierType", dh = ae + "/bahmnicore/patientprofile", fh = (e) => ae + `/bahmnicore/patientprofile/${e}`, hh = (e) => ae + `/patientprofile/${e}?v=full`, ph = ae + "/visit", mh = (e) => ae + `/visit?includeInactive=false&patient=${e}&v=custom:(uuid,visitType,location:(uuid))`, gh = (e) => Mu + `${e}`, yh = (e, t, r = 20, n) => {
6679
6679
  let s = `/openmrs/module/addresshierarchy/ajax/getPossibleAddressHierarchyEntriesWithParents.form?addressField=${e}&limit=${r}&searchString=${encodeURIComponent(t)}`;
6680
6680
  return n && (s += `&parent=${n}`), s;
6681
- }, vh = "/openmrs/module/addresshierarchy/ajax/getOrderedAddressHierarchyLevels.form", wh = ae + "/relationshiptype?v=custom:(aIsToB,bIsToA,uuid)", bh = 20, Eh = 2, Yy = 120, Jy = 50, Xy = 15, _h = /^[a-f0-9-]{36}$/i, Sh = () => ae + "/bahmnicore/config/bahmniencounter?callerContext=REGISTRATION_CONCEPTS", Rh = (e) => Cu + `/patientImage?patientUuid=${e}`, Ph = ae + "/personattributetype?v=custom:(uuid,name,sortWeight,description,format,concept:(uuid,display,answers:(uuid,name)))", Th = async (e) => {
6681
+ }, vh = "/openmrs/module/addresshierarchy/ajax/getOrderedAddressHierarchyLevels.form", wh = ae + "/relationshiptype?v=custom:(aIsToB,bIsToA,uuid)", bh = 20, Eh = 2, Yy = 120, Jy = 50, Xy = 15, _h = /^[a-f0-9-]{36}$/i, Sh = () => ae + "/bahmnicore/config/bahmniencounter?callerContext=REGISTRATION_CONCEPTS", Rh = (e) => Cu + `/patientImage?patientUuid=${e}`, Ph = ae + "/personattributetype?v=custom:(uuid,name,sortWeight,description,format,concept:(uuid,display,answers:(uuid,name)))", $h = async (e) => {
6682
6682
  if (!e || e.trim() === "")
6683
6683
  throw new Error("Invalid patient UUID: UUID cannot be empty");
6684
6684
  if (!_h.test(e))
6685
6685
  throw new Error(`Invalid patient UUID format: ${e}`);
6686
6686
  return K(oh(e));
6687
- }, $h = (e) => !e.extension || !Array.isArray(e.extension) ? [] : e.extension.flatMap((t) => t.extension && Array.isArray(t.extension) ? t.extension.filter((r) => r.valueString).map((r) => r.valueString) : []), Oh = (e) => {
6687
+ }, Th = (e) => !e.extension || !Array.isArray(e.extension) ? [] : e.extension.flatMap((t) => t.extension && Array.isArray(t.extension) ? t.extension.filter((r) => r.valueString).map((r) => r.valueString) : []), Oh = (e) => {
6688
6688
  if (!e.name || e.name.length === 0)
6689
6689
  return null;
6690
6690
  const t = e.name[0], r = t.given?.join(" ") ?? "", n = t.family ?? "";
@@ -6694,7 +6694,7 @@ const ei = () => {
6694
6694
  const t = [
6695
6695
  ...e.line ?? [],
6696
6696
  // Standard address lines
6697
- ...$h(e)
6697
+ ...Th(e)
6698
6698
  // Extracted address extensions
6699
6699
  ], r = e.city ?? "", n = e.state ?? "", s = e.postalCode ?? "", a = t.filter(Boolean);
6700
6700
  return r && a.push(r), n && s ? a.push(`${n} ${s}`) : n ? a.push(n) : s && a.push(s), a.length > 0 ? a.join(", ").trim() : null;
@@ -6715,7 +6715,7 @@ const ei = () => {
6715
6715
  age: a
6716
6716
  };
6717
6717
  }, Qy = async (e) => {
6718
- const t = await Th(e);
6718
+ const t = await $h(e);
6719
6719
  return Dh(t);
6720
6720
  }, Zy = async (e) => {
6721
6721
  const t = await fetch(Rh(e));
@@ -6837,7 +6837,7 @@ const Mh = () => {
6837
6837
  const t = `${qh(e)}`;
6838
6838
  return K(t);
6839
6839
  };
6840
- async function Tv(e) {
6840
+ async function $v(e) {
6841
6841
  return await K(Uh(e));
6842
6842
  }
6843
6843
  const Vh = (e) => Pe + `/AllergyIntolerance?patient=${e}&_count=100&_sort=-_lastUpdated`, rt = {
@@ -6862,7 +6862,7 @@ const Vh = (e) => Pe + `/AllergyIntolerance?patient=${e}&_count=100&_sort=-_last
6862
6862
  }), an = (e, t) => {
6863
6863
  const r = e.expansion?.contains ?? [];
6864
6864
  return Bh(r).map((s) => zh(s, t));
6865
- }, $v = async (e, t, r) => {
6865
+ }, Tv = async (e, t, r) => {
6866
6866
  const n = e ?? rt.MEDICATION.code, s = t ?? rt.FOOD.code, a = r ?? rt.ENVIRONMENT.code, [o, i, c] = await Promise.all([
6867
6867
  Er(n),
6868
6868
  Er(s),
@@ -7078,14 +7078,15 @@ async function Ep(e) {
7078
7078
  }
7079
7079
  function _p(e) {
7080
7080
  return (e.entry?.map((r) => r.resource) ?? []).map((r) => {
7081
- const n = r.occurrencePeriod?.start, s = r.replaces?.map((a) => (a.reference ?? "").split("/").pop() ?? "").filter((a) => a.length > 0);
7081
+ const n = r.occurrencePeriod?.start, s = r.replaces?.map((o) => (o.reference ?? "").split("/").pop() ?? "").filter((o) => o.length > 0), a = r.note?.[0]?.text;
7082
7082
  return {
7083
7083
  id: r.id,
7084
7084
  testName: r.code.text,
7085
7085
  priority: r.priority,
7086
7086
  orderedBy: r.requester.display,
7087
7087
  orderedDate: n,
7088
- ...s && s.length > 0 && { replaces: s }
7088
+ ...s && s.length > 0 && { replaces: s },
7089
+ ...a && { note: a }
7089
7090
  };
7090
7091
  });
7091
7092
  }
@@ -7095,7 +7096,7 @@ async function xv(e) {
7095
7096
  }
7096
7097
  const Sp = "d3560b17-5e07-11ef-8f7c-0242ac120002", Rp = "http://fhir.bahmni.org/ext/lab-order-concept-type", Pp = (e) => Pe + `/ServiceRequest?category=${Sp}&patient=${e}&numberOfVisits=5&_count=100&_sort=-_lastUpdated`;
7097
7098
  var _r = /* @__PURE__ */ ((e) => (e.stat = "Urgent", e.routine = "Routine", e))(_r || {});
7098
- const Tp = (e) => {
7099
+ const $p = (e) => {
7099
7100
  switch (e.priority) {
7100
7101
  case "routine":
7101
7102
  return _r.routine;
@@ -7105,7 +7106,7 @@ const Tp = (e) => {
7105
7106
  return _r.routine;
7106
7107
  }
7107
7108
  };
7108
- function $p(e) {
7109
+ function Tp(e) {
7109
7110
  if (!e.entry) return [];
7110
7111
  const t = new Set(
7111
7112
  e.entry.flatMap((r) => r.resource?.replaces ?? []).map((r) => r.reference?.split("/").pop()).filter(Boolean)
@@ -7119,7 +7120,7 @@ function $p(e) {
7119
7120
  async function Op(e) {
7120
7121
  const t = await K(
7121
7122
  `${Pp(e)}`
7122
- ), r = $p(t);
7123
+ ), r = Tp(t);
7123
7124
  return {
7124
7125
  ...t,
7125
7126
  entry: r
@@ -7132,10 +7133,10 @@ function Np(e, t) {
7132
7133
  return e.filter(
7133
7134
  (r) => !!r.id
7134
7135
  ).map((r) => {
7135
- const n = Tp(r), s = r.occurrencePeriod?.start;
7136
+ const n = $p(r), s = r.occurrencePeriod?.start;
7136
7137
  let a;
7137
7138
  s && (a = Zf(s, t, "MMMM d, yyyy").formattedResult || s.split("T")[0]);
7138
- const o = Ap(r);
7139
+ const o = Ap(r), i = r.note?.[0]?.text;
7139
7140
  return {
7140
7141
  id: r.id,
7141
7142
  testName: r.code?.text ?? "",
@@ -7145,7 +7146,8 @@ function Np(e, t) {
7145
7146
  formattedDate: a ?? "",
7146
7147
  // Result would typically come from a separate Observation resource
7147
7148
  result: void 0,
7148
- testType: o
7149
+ testType: o,
7150
+ note: i
7149
7151
  };
7150
7152
  });
7151
7153
  }
@@ -7995,17 +7997,17 @@ function Q() {
7995
7997
  return typeof N == "boolean" || typeof N == "number" || N === null ? !N : (0, t._)`!${C(N)}`;
7996
7998
  }
7997
7999
  e.not = he;
7998
- const ce = $(e.operators.AND);
8000
+ const ce = T(e.operators.AND);
7999
8001
  function ee(...N) {
8000
8002
  return N.reduce(ce);
8001
8003
  }
8002
8004
  e.and = ee;
8003
- const ie = $(e.operators.OR);
8005
+ const ie = T(e.operators.OR);
8004
8006
  function M(...N) {
8005
8007
  return N.reduce(ie);
8006
8008
  }
8007
8009
  e.or = M;
8008
- function $(N) {
8010
+ function T(N) {
8009
8011
  return (w, P) => w === t.nil ? P : P === t.nil ? w : (0, t._)`${C(w)} ${N} ${C(P)}`;
8010
8012
  }
8011
8013
  function C(N) {
@@ -8988,172 +8990,172 @@ function Hr() {
8988
8990
  if (aa) return Le;
8989
8991
  aa = 1, Object.defineProperty(Le, "__esModule", { value: !0 }), Le.getData = Le.KeywordCxt = Le.validateFunctionCode = void 0;
8990
8992
  const e = Fp(), t = Nr(), r = ai(), n = Nr(), s = Vp(), a = Hp(), o = Bp(), i = Q(), c = Fe(), d = Vr(), l = te(), m = Fr();
8991
- function y(T) {
8992
- if (_(T) && (S(T), b(T))) {
8993
- f(T);
8993
+ function y($) {
8994
+ if (_($) && (S($), b($))) {
8995
+ f($);
8994
8996
  return;
8995
8997
  }
8996
- R(T, () => (0, e.topBoolOrEmptySchema)(T));
8998
+ R($, () => (0, e.topBoolOrEmptySchema)($));
8997
8999
  }
8998
9000
  Le.validateFunctionCode = y;
8999
- function R({ gen: T, validateName: A, schema: k, schemaEnv: x, opts: H }, X) {
9000
- H.code.es5 ? T.func(A, (0, i._)`${c.default.data}, ${c.default.valCxt}`, x.$async, () => {
9001
- T.code((0, i._)`"use strict"; ${u(k, H)}`), g(T, H), T.code(X);
9002
- }) : T.func(A, (0, i._)`${c.default.data}, ${v(H)}`, x.$async, () => T.code(u(k, H)).code(X));
9001
+ function R({ gen: $, validateName: A, schema: k, schemaEnv: x, opts: H }, X) {
9002
+ H.code.es5 ? $.func(A, (0, i._)`${c.default.data}, ${c.default.valCxt}`, x.$async, () => {
9003
+ $.code((0, i._)`"use strict"; ${u(k, H)}`), g($, H), $.code(X);
9004
+ }) : $.func(A, (0, i._)`${c.default.data}, ${v(H)}`, x.$async, () => $.code(u(k, H)).code(X));
9003
9005
  }
9004
- function v(T) {
9005
- return (0, i._)`{${c.default.instancePath}="", ${c.default.parentData}, ${c.default.parentDataProperty}, ${c.default.rootData}=${c.default.data}${T.dynamicRef ? (0, i._)`, ${c.default.dynamicAnchors}={}` : i.nil}}={}`;
9006
+ function v($) {
9007
+ return (0, i._)`{${c.default.instancePath}="", ${c.default.parentData}, ${c.default.parentDataProperty}, ${c.default.rootData}=${c.default.data}${$.dynamicRef ? (0, i._)`, ${c.default.dynamicAnchors}={}` : i.nil}}={}`;
9006
9008
  }
9007
- function g(T, A) {
9008
- T.if(c.default.valCxt, () => {
9009
- T.var(c.default.instancePath, (0, i._)`${c.default.valCxt}.${c.default.instancePath}`), T.var(c.default.parentData, (0, i._)`${c.default.valCxt}.${c.default.parentData}`), T.var(c.default.parentDataProperty, (0, i._)`${c.default.valCxt}.${c.default.parentDataProperty}`), T.var(c.default.rootData, (0, i._)`${c.default.valCxt}.${c.default.rootData}`), A.dynamicRef && T.var(c.default.dynamicAnchors, (0, i._)`${c.default.valCxt}.${c.default.dynamicAnchors}`);
9009
+ function g($, A) {
9010
+ $.if(c.default.valCxt, () => {
9011
+ $.var(c.default.instancePath, (0, i._)`${c.default.valCxt}.${c.default.instancePath}`), $.var(c.default.parentData, (0, i._)`${c.default.valCxt}.${c.default.parentData}`), $.var(c.default.parentDataProperty, (0, i._)`${c.default.valCxt}.${c.default.parentDataProperty}`), $.var(c.default.rootData, (0, i._)`${c.default.valCxt}.${c.default.rootData}`), A.dynamicRef && $.var(c.default.dynamicAnchors, (0, i._)`${c.default.valCxt}.${c.default.dynamicAnchors}`);
9010
9012
  }, () => {
9011
- T.var(c.default.instancePath, (0, i._)`""`), T.var(c.default.parentData, (0, i._)`undefined`), T.var(c.default.parentDataProperty, (0, i._)`undefined`), T.var(c.default.rootData, c.default.data), A.dynamicRef && T.var(c.default.dynamicAnchors, (0, i._)`{}`);
9013
+ $.var(c.default.instancePath, (0, i._)`""`), $.var(c.default.parentData, (0, i._)`undefined`), $.var(c.default.parentDataProperty, (0, i._)`undefined`), $.var(c.default.rootData, c.default.data), A.dynamicRef && $.var(c.default.dynamicAnchors, (0, i._)`{}`);
9012
9014
  });
9013
9015
  }
9014
- function f(T) {
9015
- const { schema: A, opts: k, gen: x } = T;
9016
- R(T, () => {
9017
- k.$comment && A.$comment && F(T), j(T), x.let(c.default.vErrors, null), x.let(c.default.errors, 0), k.unevaluated && h(T), O(T), z(T);
9016
+ function f($) {
9017
+ const { schema: A, opts: k, gen: x } = $;
9018
+ R($, () => {
9019
+ k.$comment && A.$comment && F($), j($), x.let(c.default.vErrors, null), x.let(c.default.errors, 0), k.unevaluated && h($), O($), z($);
9018
9020
  });
9019
9021
  }
9020
- function h(T) {
9021
- const { gen: A, validateName: k } = T;
9022
- T.evaluated = A.const("evaluated", (0, i._)`${k}.evaluated`), A.if((0, i._)`${T.evaluated}.dynamicProps`, () => A.assign((0, i._)`${T.evaluated}.props`, (0, i._)`undefined`)), A.if((0, i._)`${T.evaluated}.dynamicItems`, () => A.assign((0, i._)`${T.evaluated}.items`, (0, i._)`undefined`));
9022
+ function h($) {
9023
+ const { gen: A, validateName: k } = $;
9024
+ $.evaluated = A.const("evaluated", (0, i._)`${k}.evaluated`), A.if((0, i._)`${$.evaluated}.dynamicProps`, () => A.assign((0, i._)`${$.evaluated}.props`, (0, i._)`undefined`)), A.if((0, i._)`${$.evaluated}.dynamicItems`, () => A.assign((0, i._)`${$.evaluated}.items`, (0, i._)`undefined`));
9023
9025
  }
9024
- function u(T, A) {
9025
- const k = typeof T == "object" && T[A.schemaId];
9026
+ function u($, A) {
9027
+ const k = typeof $ == "object" && $[A.schemaId];
9026
9028
  return k && (A.code.source || A.code.process) ? (0, i._)`/*# sourceURL=${k} */` : i.nil;
9027
9029
  }
9028
- function p(T, A) {
9029
- if (_(T) && (S(T), b(T))) {
9030
- E(T, A);
9030
+ function p($, A) {
9031
+ if (_($) && (S($), b($))) {
9032
+ E($, A);
9031
9033
  return;
9032
9034
  }
9033
- (0, e.boolOrEmptySchema)(T, A);
9035
+ (0, e.boolOrEmptySchema)($, A);
9034
9036
  }
9035
- function b({ schema: T, self: A }) {
9036
- if (typeof T == "boolean")
9037
- return !T;
9038
- for (const k in T)
9037
+ function b({ schema: $, self: A }) {
9038
+ if (typeof $ == "boolean")
9039
+ return !$;
9040
+ for (const k in $)
9039
9041
  if (A.RULES.all[k])
9040
9042
  return !0;
9041
9043
  return !1;
9042
9044
  }
9043
- function _(T) {
9044
- return typeof T.schema != "boolean";
9045
+ function _($) {
9046
+ return typeof $.schema != "boolean";
9045
9047
  }
9046
- function E(T, A) {
9047
- const { schema: k, gen: x, opts: H } = T;
9048
- H.$comment && k.$comment && F(T), q(T), U(T);
9048
+ function E($, A) {
9049
+ const { schema: k, gen: x, opts: H } = $;
9050
+ H.$comment && k.$comment && F($), q($), U($);
9049
9051
  const X = x.const("_errs", c.default.errors);
9050
- O(T, X), x.var(A, (0, i._)`${X} === ${c.default.errors}`);
9052
+ O($, X), x.var(A, (0, i._)`${X} === ${c.default.errors}`);
9051
9053
  }
9052
- function S(T) {
9053
- (0, l.checkUnknownRules)(T), L(T);
9054
+ function S($) {
9055
+ (0, l.checkUnknownRules)($), L($);
9054
9056
  }
9055
- function O(T, A) {
9056
- if (T.opts.jtd)
9057
- return he(T, [], !1, A);
9058
- const k = (0, t.getSchemaTypes)(T.schema), x = (0, t.coerceAndCheckDataType)(T, k);
9059
- he(T, k, !x, A);
9057
+ function O($, A) {
9058
+ if ($.opts.jtd)
9059
+ return he($, [], !1, A);
9060
+ const k = (0, t.getSchemaTypes)($.schema), x = (0, t.coerceAndCheckDataType)($, k);
9061
+ he($, k, !x, A);
9060
9062
  }
9061
- function L(T) {
9062
- const { schema: A, errSchemaPath: k, opts: x, self: H } = T;
9063
+ function L($) {
9064
+ const { schema: A, errSchemaPath: k, opts: x, self: H } = $;
9063
9065
  A.$ref && x.ignoreKeywordsWithRef && (0, l.schemaHasRulesButRef)(A, H.RULES) && H.logger.warn(`$ref: keywords ignored in schema at path "${k}"`);
9064
9066
  }
9065
- function j(T) {
9066
- const { schema: A, opts: k } = T;
9067
- A.default !== void 0 && k.useDefaults && k.strictSchema && (0, l.checkStrictMode)(T, "default is ignored in the schema root");
9067
+ function j($) {
9068
+ const { schema: A, opts: k } = $;
9069
+ A.default !== void 0 && k.useDefaults && k.strictSchema && (0, l.checkStrictMode)($, "default is ignored in the schema root");
9068
9070
  }
9069
- function q(T) {
9070
- const A = T.schema[T.opts.schemaId];
9071
- A && (T.baseId = (0, d.resolveUrl)(T.opts.uriResolver, T.baseId, A));
9071
+ function q($) {
9072
+ const A = $.schema[$.opts.schemaId];
9073
+ A && ($.baseId = (0, d.resolveUrl)($.opts.uriResolver, $.baseId, A));
9072
9074
  }
9073
- function U(T) {
9074
- if (T.schema.$async && !T.schemaEnv.$async)
9075
+ function U($) {
9076
+ if ($.schema.$async && !$.schemaEnv.$async)
9075
9077
  throw new Error("async schema in sync schema");
9076
9078
  }
9077
- function F({ gen: T, schemaEnv: A, schema: k, errSchemaPath: x, opts: H }) {
9079
+ function F({ gen: $, schemaEnv: A, schema: k, errSchemaPath: x, opts: H }) {
9078
9080
  const X = k.$comment;
9079
9081
  if (H.$comment === !0)
9080
- T.code((0, i._)`${c.default.self}.logger.log(${X})`);
9082
+ $.code((0, i._)`${c.default.self}.logger.log(${X})`);
9081
9083
  else if (typeof H.$comment == "function") {
9082
- const pe = (0, i.str)`${x}/$comment`, Ae = T.scopeValue("root", { ref: A.root });
9083
- T.code((0, i._)`${c.default.self}.opts.$comment(${X}, ${pe}, ${Ae}.schema)`);
9084
+ const pe = (0, i.str)`${x}/$comment`, Ae = $.scopeValue("root", { ref: A.root });
9085
+ $.code((0, i._)`${c.default.self}.opts.$comment(${X}, ${pe}, ${Ae}.schema)`);
9084
9086
  }
9085
9087
  }
9086
- function z(T) {
9087
- const { gen: A, schemaEnv: k, validateName: x, ValidationError: H, opts: X } = T;
9088
- k.$async ? A.if((0, i._)`${c.default.errors} === 0`, () => A.return(c.default.data), () => A.throw((0, i._)`new ${H}(${c.default.vErrors})`)) : (A.assign((0, i._)`${x}.errors`, c.default.vErrors), X.unevaluated && Y(T), A.return((0, i._)`${c.default.errors} === 0`));
9088
+ function z($) {
9089
+ const { gen: A, schemaEnv: k, validateName: x, ValidationError: H, opts: X } = $;
9090
+ k.$async ? A.if((0, i._)`${c.default.errors} === 0`, () => A.return(c.default.data), () => A.throw((0, i._)`new ${H}(${c.default.vErrors})`)) : (A.assign((0, i._)`${x}.errors`, c.default.vErrors), X.unevaluated && Y($), A.return((0, i._)`${c.default.errors} === 0`));
9089
9091
  }
9090
- function Y({ gen: T, evaluated: A, props: k, items: x }) {
9091
- k instanceof i.Name && T.assign((0, i._)`${A}.props`, k), x instanceof i.Name && T.assign((0, i._)`${A}.items`, x);
9092
+ function Y({ gen: $, evaluated: A, props: k, items: x }) {
9093
+ k instanceof i.Name && $.assign((0, i._)`${A}.props`, k), x instanceof i.Name && $.assign((0, i._)`${A}.items`, x);
9092
9094
  }
9093
- function he(T, A, k, x) {
9094
- const { gen: H, schema: X, data: pe, allErrors: Ae, opts: be, self: Ee } = T, { RULES: me } = Ee;
9095
+ function he($, A, k, x) {
9096
+ const { gen: H, schema: X, data: pe, allErrors: Ae, opts: be, self: Ee } = $, { RULES: me } = Ee;
9095
9097
  if (X.$ref && (be.ignoreKeywordsWithRef || !(0, l.schemaHasRulesButRef)(X, me))) {
9096
- H.block(() => V(T, "$ref", me.all.$ref.definition));
9098
+ H.block(() => V($, "$ref", me.all.$ref.definition));
9097
9099
  return;
9098
9100
  }
9099
- be.jtd || ee(T, A), H.block(() => {
9100
- for (const Te of me.rules)
9101
- Je(Te);
9101
+ be.jtd || ee($, A), H.block(() => {
9102
+ for (const $e of me.rules)
9103
+ Je($e);
9102
9104
  Je(me.post);
9103
9105
  });
9104
- function Je(Te) {
9105
- (0, r.shouldUseGroup)(X, Te) && (Te.type ? (H.if((0, n.checkDataType)(Te.type, pe, be.strictNumbers)), ce(T, Te), A.length === 1 && A[0] === Te.type && k && (H.else(), (0, n.reportTypeError)(T)), H.endIf()) : ce(T, Te), Ae || H.if((0, i._)`${c.default.errors} === ${x || 0}`));
9106
+ function Je($e) {
9107
+ (0, r.shouldUseGroup)(X, $e) && ($e.type ? (H.if((0, n.checkDataType)($e.type, pe, be.strictNumbers)), ce($, $e), A.length === 1 && A[0] === $e.type && k && (H.else(), (0, n.reportTypeError)($)), H.endIf()) : ce($, $e), Ae || H.if((0, i._)`${c.default.errors} === ${x || 0}`));
9106
9108
  }
9107
9109
  }
9108
- function ce(T, A) {
9109
- const { gen: k, schema: x, opts: { useDefaults: H } } = T;
9110
- H && (0, s.assignDefaults)(T, A.type), k.block(() => {
9110
+ function ce($, A) {
9111
+ const { gen: k, schema: x, opts: { useDefaults: H } } = $;
9112
+ H && (0, s.assignDefaults)($, A.type), k.block(() => {
9111
9113
  for (const X of A.rules)
9112
- (0, r.shouldUseRule)(x, X) && V(T, X.keyword, X.definition, A.type);
9114
+ (0, r.shouldUseRule)(x, X) && V($, X.keyword, X.definition, A.type);
9113
9115
  });
9114
9116
  }
9115
- function ee(T, A) {
9116
- T.schemaEnv.meta || !T.opts.strictTypes || (ie(T, A), T.opts.allowUnionTypes || M(T, A), $(T, T.dataTypes));
9117
+ function ee($, A) {
9118
+ $.schemaEnv.meta || !$.opts.strictTypes || (ie($, A), $.opts.allowUnionTypes || M($, A), T($, $.dataTypes));
9117
9119
  }
9118
- function ie(T, A) {
9120
+ function ie($, A) {
9119
9121
  if (A.length) {
9120
- if (!T.dataTypes.length) {
9121
- T.dataTypes = A;
9122
+ if (!$.dataTypes.length) {
9123
+ $.dataTypes = A;
9122
9124
  return;
9123
9125
  }
9124
9126
  A.forEach((k) => {
9125
- N(T.dataTypes, k) || P(T, `type "${k}" not allowed by context "${T.dataTypes.join(",")}"`);
9126
- }), w(T, A);
9127
+ N($.dataTypes, k) || P($, `type "${k}" not allowed by context "${$.dataTypes.join(",")}"`);
9128
+ }), w($, A);
9127
9129
  }
9128
9130
  }
9129
- function M(T, A) {
9130
- A.length > 1 && !(A.length === 2 && A.includes("null")) && P(T, "use allowUnionTypes to allow union type keyword");
9131
+ function M($, A) {
9132
+ A.length > 1 && !(A.length === 2 && A.includes("null")) && P($, "use allowUnionTypes to allow union type keyword");
9131
9133
  }
9132
- function $(T, A) {
9133
- const k = T.self.RULES.all;
9134
+ function T($, A) {
9135
+ const k = $.self.RULES.all;
9134
9136
  for (const x in k) {
9135
9137
  const H = k[x];
9136
- if (typeof H == "object" && (0, r.shouldUseRule)(T.schema, H)) {
9138
+ if (typeof H == "object" && (0, r.shouldUseRule)($.schema, H)) {
9137
9139
  const { type: X } = H.definition;
9138
- X.length && !X.some((pe) => C(A, pe)) && P(T, `missing type "${X.join(",")}" for keyword "${x}"`);
9140
+ X.length && !X.some((pe) => C(A, pe)) && P($, `missing type "${X.join(",")}" for keyword "${x}"`);
9139
9141
  }
9140
9142
  }
9141
9143
  }
9142
- function C(T, A) {
9143
- return T.includes(A) || A === "number" && T.includes("integer");
9144
+ function C($, A) {
9145
+ return $.includes(A) || A === "number" && $.includes("integer");
9144
9146
  }
9145
- function N(T, A) {
9146
- return T.includes(A) || A === "integer" && T.includes("number");
9147
+ function N($, A) {
9148
+ return $.includes(A) || A === "integer" && $.includes("number");
9147
9149
  }
9148
- function w(T, A) {
9150
+ function w($, A) {
9149
9151
  const k = [];
9150
- for (const x of T.dataTypes)
9152
+ for (const x of $.dataTypes)
9151
9153
  N(A, x) ? k.push(x) : A.includes("integer") && x === "number" && k.push("integer");
9152
- T.dataTypes = k;
9154
+ $.dataTypes = k;
9153
9155
  }
9154
- function P(T, A) {
9155
- const k = T.schemaEnv.baseId + T.errSchemaPath;
9156
- A += ` at "${k}" (strictTypes)`, (0, l.checkStrictMode)(T, A, T.opts.strictTypes);
9156
+ function P($, A) {
9157
+ const k = $.schemaEnv.baseId + $.errSchemaPath;
9158
+ A += ` at "${k}" (strictTypes)`, (0, l.checkStrictMode)($, A, $.opts.strictTypes);
9157
9159
  }
9158
9160
  class I {
9159
9161
  constructor(A, k, x) {
@@ -9257,23 +9259,23 @@ function Hr() {
9257
9259
  }
9258
9260
  }
9259
9261
  Le.KeywordCxt = I;
9260
- function V(T, A, k, x) {
9261
- const H = new I(T, k, A);
9262
+ function V($, A, k, x) {
9263
+ const H = new I($, k, A);
9262
9264
  "code" in k ? k.code(H, x) : H.$data && k.validate ? (0, a.funcKeywordCode)(H, k) : "macro" in k ? (0, a.macroKeywordCode)(H, k) : (k.compile || k.validate) && (0, a.funcKeywordCode)(H, k);
9263
9265
  }
9264
9266
  const B = /^\/(?:[^~]|~0|~1)*$/, re = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
9265
- function Z(T, { dataLevel: A, dataNames: k, dataPathArr: x }) {
9267
+ function Z($, { dataLevel: A, dataNames: k, dataPathArr: x }) {
9266
9268
  let H, X;
9267
- if (T === "")
9269
+ if ($ === "")
9268
9270
  return c.default.rootData;
9269
- if (T[0] === "/") {
9270
- if (!B.test(T))
9271
- throw new Error(`Invalid JSON-pointer: ${T}`);
9272
- H = T, X = c.default.rootData;
9271
+ if ($[0] === "/") {
9272
+ if (!B.test($))
9273
+ throw new Error(`Invalid JSON-pointer: ${$}`);
9274
+ H = $, X = c.default.rootData;
9273
9275
  } else {
9274
- const Ee = re.exec(T);
9276
+ const Ee = re.exec($);
9275
9277
  if (!Ee)
9276
- throw new Error(`Invalid JSON-pointer: ${T}`);
9278
+ throw new Error(`Invalid JSON-pointer: ${$}`);
9277
9279
  const me = +Ee[1];
9278
9280
  if (H = Ee[2], H === "#") {
9279
9281
  if (me >= A)
@@ -9869,7 +9871,7 @@ function sm() {
9869
9871
  } }), Object.defineProperty(e, "CodeGen", { enumerable: !0, get: function() {
9870
9872
  return r.CodeGen;
9871
9873
  } });
9872
- const n = xn(), s = Br(), a = si(), o = qn(), i = Q(), c = Vr(), d = Nr(), l = te(), m = Qp, y = nm(), R = (M, $) => new RegExp(M, $);
9874
+ const n = xn(), s = Br(), a = si(), o = qn(), i = Q(), c = Vr(), d = Nr(), l = te(), m = Qp, y = nm(), R = (M, T) => new RegExp(M, T);
9873
9875
  R.code = "new RegExp";
9874
9876
  const v = ["removeAdditional", "useDefaults", "coerceTypes"], g = /* @__PURE__ */ new Set([
9875
9877
  "validate",
@@ -9907,13 +9909,13 @@ function sm() {
9907
9909
  unicode: '"minLength"/"maxLength" account for unicode characters by default.'
9908
9910
  }, u = 200;
9909
9911
  function p(M) {
9910
- var $, C, N, w, P, I, V, B, re, Z, T, A, k, x, H, X, pe, Ae, be, Ee, me, Je, Te, Wr, Gr;
9911
- const mt = M.strict, Kr = ($ = M.code) === null || $ === void 0 ? void 0 : $.optimize, Fn = Kr === !0 || Kr === void 0 ? 1 : Kr || 0, Vn = (N = (C = M.code) === null || C === void 0 ? void 0 : C.regExp) !== null && N !== void 0 ? N : R, li = (w = M.uriResolver) !== null && w !== void 0 ? w : y.default;
9912
+ var T, C, N, w, P, I, V, B, re, Z, $, A, k, x, H, X, pe, Ae, be, Ee, me, Je, $e, Wr, Gr;
9913
+ const mt = M.strict, Kr = (T = M.code) === null || T === void 0 ? void 0 : T.optimize, Fn = Kr === !0 || Kr === void 0 ? 1 : Kr || 0, Vn = (N = (C = M.code) === null || C === void 0 ? void 0 : C.regExp) !== null && N !== void 0 ? N : R, li = (w = M.uriResolver) !== null && w !== void 0 ? w : y.default;
9912
9914
  return {
9913
9915
  strictSchema: (I = (P = M.strictSchema) !== null && P !== void 0 ? P : mt) !== null && I !== void 0 ? I : !0,
9914
9916
  strictNumbers: (B = (V = M.strictNumbers) !== null && V !== void 0 ? V : mt) !== null && B !== void 0 ? B : !0,
9915
9917
  strictTypes: (Z = (re = M.strictTypes) !== null && re !== void 0 ? re : mt) !== null && Z !== void 0 ? Z : "log",
9916
- strictTuples: (A = (T = M.strictTuples) !== null && T !== void 0 ? T : mt) !== null && A !== void 0 ? A : "log",
9918
+ strictTuples: (A = ($ = M.strictTuples) !== null && $ !== void 0 ? $ : mt) !== null && A !== void 0 ? A : "log",
9917
9919
  strictRequired: (x = (k = M.strictRequired) !== null && k !== void 0 ? k : mt) !== null && x !== void 0 ? x : !1,
9918
9920
  code: M.code ? { ...M.code, optimize: Fn, regExp: Vn } : { optimize: Fn, regExp: Vn },
9919
9921
  loopRequired: (H = M.loopRequired) !== null && H !== void 0 ? H : u,
@@ -9924,54 +9926,54 @@ function sm() {
9924
9926
  schemaId: (Ee = M.schemaId) !== null && Ee !== void 0 ? Ee : "$id",
9925
9927
  addUsedSchema: (me = M.addUsedSchema) !== null && me !== void 0 ? me : !0,
9926
9928
  validateSchema: (Je = M.validateSchema) !== null && Je !== void 0 ? Je : !0,
9927
- validateFormats: (Te = M.validateFormats) !== null && Te !== void 0 ? Te : !0,
9929
+ validateFormats: ($e = M.validateFormats) !== null && $e !== void 0 ? $e : !0,
9928
9930
  unicodeRegExp: (Wr = M.unicodeRegExp) !== null && Wr !== void 0 ? Wr : !0,
9929
9931
  int32range: (Gr = M.int32range) !== null && Gr !== void 0 ? Gr : !0,
9930
9932
  uriResolver: li
9931
9933
  };
9932
9934
  }
9933
9935
  class b {
9934
- constructor($ = {}) {
9935
- this.schemas = {}, this.refs = {}, this.formats = {}, this._compilations = /* @__PURE__ */ new Set(), this._loading = {}, this._cache = /* @__PURE__ */ new Map(), $ = this.opts = { ...$, ...p($) };
9936
+ constructor(T = {}) {
9937
+ this.schemas = {}, this.refs = {}, this.formats = {}, this._compilations = /* @__PURE__ */ new Set(), this._loading = {}, this._cache = /* @__PURE__ */ new Map(), T = this.opts = { ...T, ...p(T) };
9936
9938
  const { es5: C, lines: N } = this.opts.code;
9937
- this.scope = new i.ValueScope({ scope: {}, prefixes: g, es5: C, lines: N }), this.logger = U($.logger);
9938
- const w = $.validateFormats;
9939
- $.validateFormats = !1, this.RULES = (0, a.getRules)(), _.call(this, f, $, "NOT SUPPORTED"), _.call(this, h, $, "DEPRECATED", "warn"), this._metaOpts = j.call(this), $.formats && O.call(this), this._addVocabularies(), this._addDefaultMetaSchema(), $.keywords && L.call(this, $.keywords), typeof $.meta == "object" && this.addMetaSchema($.meta), S.call(this), $.validateFormats = w;
9939
+ this.scope = new i.ValueScope({ scope: {}, prefixes: g, es5: C, lines: N }), this.logger = U(T.logger);
9940
+ const w = T.validateFormats;
9941
+ T.validateFormats = !1, this.RULES = (0, a.getRules)(), _.call(this, f, T, "NOT SUPPORTED"), _.call(this, h, T, "DEPRECATED", "warn"), this._metaOpts = j.call(this), T.formats && O.call(this), this._addVocabularies(), this._addDefaultMetaSchema(), T.keywords && L.call(this, T.keywords), typeof T.meta == "object" && this.addMetaSchema(T.meta), S.call(this), T.validateFormats = w;
9940
9942
  }
9941
9943
  _addVocabularies() {
9942
9944
  this.addKeyword("$async");
9943
9945
  }
9944
9946
  _addDefaultMetaSchema() {
9945
- const { $data: $, meta: C, schemaId: N } = this.opts;
9947
+ const { $data: T, meta: C, schemaId: N } = this.opts;
9946
9948
  let w = m;
9947
- N === "id" && (w = { ...m }, w.id = w.$id, delete w.$id), C && $ && this.addMetaSchema(w, w[N], !1);
9949
+ N === "id" && (w = { ...m }, w.id = w.$id, delete w.$id), C && T && this.addMetaSchema(w, w[N], !1);
9948
9950
  }
9949
9951
  defaultMeta() {
9950
- const { meta: $, schemaId: C } = this.opts;
9951
- return this.opts.defaultMeta = typeof $ == "object" ? $[C] || $ : void 0;
9952
+ const { meta: T, schemaId: C } = this.opts;
9953
+ return this.opts.defaultMeta = typeof T == "object" ? T[C] || T : void 0;
9952
9954
  }
9953
- validate($, C) {
9955
+ validate(T, C) {
9954
9956
  let N;
9955
- if (typeof $ == "string") {
9956
- if (N = this.getSchema($), !N)
9957
- throw new Error(`no schema with key or ref "${$}"`);
9957
+ if (typeof T == "string") {
9958
+ if (N = this.getSchema(T), !N)
9959
+ throw new Error(`no schema with key or ref "${T}"`);
9958
9960
  } else
9959
- N = this.compile($);
9961
+ N = this.compile(T);
9960
9962
  const w = N(C);
9961
9963
  return "$async" in N || (this.errors = N.errors), w;
9962
9964
  }
9963
- compile($, C) {
9964
- const N = this._addSchema($, C);
9965
+ compile(T, C) {
9966
+ const N = this._addSchema(T, C);
9965
9967
  return N.validate || this._compileSchemaEnv(N);
9966
9968
  }
9967
- compileAsync($, C) {
9969
+ compileAsync(T, C) {
9968
9970
  if (typeof this.opts.loadSchema != "function")
9969
9971
  throw new Error("options.loadSchema should be a function");
9970
9972
  const { loadSchema: N } = this.opts;
9971
- return w.call(this, $, C);
9972
- async function w(Z, T) {
9973
+ return w.call(this, T, C);
9974
+ async function w(Z, $) {
9973
9975
  await P.call(this, Z.$schema);
9974
- const A = this._addSchema(Z, T);
9976
+ const A = this._addSchema(Z, $);
9975
9977
  return A.validate || I.call(this, A);
9976
9978
  }
9977
9979
  async function P(Z) {
@@ -9980,24 +9982,24 @@ function sm() {
9980
9982
  async function I(Z) {
9981
9983
  try {
9982
9984
  return this._compileSchemaEnv(Z);
9983
- } catch (T) {
9984
- if (!(T instanceof s.default))
9985
- throw T;
9986
- return V.call(this, T), await B.call(this, T.missingSchema), I.call(this, Z);
9985
+ } catch ($) {
9986
+ if (!($ instanceof s.default))
9987
+ throw $;
9988
+ return V.call(this, $), await B.call(this, $.missingSchema), I.call(this, Z);
9987
9989
  }
9988
9990
  }
9989
- function V({ missingSchema: Z, missingRef: T }) {
9991
+ function V({ missingSchema: Z, missingRef: $ }) {
9990
9992
  if (this.refs[Z])
9991
- throw new Error(`AnySchema ${Z} is loaded but ${T} cannot be resolved`);
9993
+ throw new Error(`AnySchema ${Z} is loaded but ${$} cannot be resolved`);
9992
9994
  }
9993
9995
  async function B(Z) {
9994
- const T = await re.call(this, Z);
9995
- this.refs[Z] || await P.call(this, T.$schema), this.refs[Z] || this.addSchema(T, Z, C);
9996
+ const $ = await re.call(this, Z);
9997
+ this.refs[Z] || await P.call(this, $.$schema), this.refs[Z] || this.addSchema($, Z, C);
9996
9998
  }
9997
9999
  async function re(Z) {
9998
- const T = this._loading[Z];
9999
- if (T)
10000
- return T;
10000
+ const $ = this._loading[Z];
10001
+ if ($)
10002
+ return $;
10001
10003
  try {
10002
10004
  return await (this._loading[Z] = N(Z));
10003
10005
  } finally {
@@ -10006,35 +10008,35 @@ function sm() {
10006
10008
  }
10007
10009
  }
10008
10010
  // Adds schema to the instance
10009
- addSchema($, C, N, w = this.opts.validateSchema) {
10010
- if (Array.isArray($)) {
10011
- for (const I of $)
10011
+ addSchema(T, C, N, w = this.opts.validateSchema) {
10012
+ if (Array.isArray(T)) {
10013
+ for (const I of T)
10012
10014
  this.addSchema(I, void 0, N, w);
10013
10015
  return this;
10014
10016
  }
10015
10017
  let P;
10016
- if (typeof $ == "object") {
10018
+ if (typeof T == "object") {
10017
10019
  const { schemaId: I } = this.opts;
10018
- if (P = $[I], P !== void 0 && typeof P != "string")
10020
+ if (P = T[I], P !== void 0 && typeof P != "string")
10019
10021
  throw new Error(`schema ${I} must be string`);
10020
10022
  }
10021
- return C = (0, c.normalizeId)(C || P), this._checkUnique(C), this.schemas[C] = this._addSchema($, N, C, w, !0), this;
10023
+ return C = (0, c.normalizeId)(C || P), this._checkUnique(C), this.schemas[C] = this._addSchema(T, N, C, w, !0), this;
10022
10024
  }
10023
10025
  // Add schema that will be used to validate other schemas
10024
10026
  // options in META_IGNORE_OPTIONS are alway set to false
10025
- addMetaSchema($, C, N = this.opts.validateSchema) {
10026
- return this.addSchema($, C, !0, N), this;
10027
+ addMetaSchema(T, C, N = this.opts.validateSchema) {
10028
+ return this.addSchema(T, C, !0, N), this;
10027
10029
  }
10028
10030
  // Validate schema against its meta-schema
10029
- validateSchema($, C) {
10030
- if (typeof $ == "boolean")
10031
+ validateSchema(T, C) {
10032
+ if (typeof T == "boolean")
10031
10033
  return !0;
10032
10034
  let N;
10033
- if (N = $.$schema, N !== void 0 && typeof N != "string")
10035
+ if (N = T.$schema, N !== void 0 && typeof N != "string")
10034
10036
  throw new Error("$schema must be a string");
10035
10037
  if (N = N || this.opts.defaultMeta || this.defaultMeta(), !N)
10036
10038
  return this.logger.warn("meta-schema not available"), this.errors = null, !0;
10037
- const w = this.validate(N, $);
10039
+ const w = this.validate(N, T);
10038
10040
  if (!w && C) {
10039
10041
  const P = "schema is invalid: " + this.errorsText();
10040
10042
  if (this.opts.validateSchema === "log")
@@ -10046,15 +10048,15 @@ function sm() {
10046
10048
  }
10047
10049
  // Get compiled schema by `key` or `ref`.
10048
10050
  // (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id)
10049
- getSchema($) {
10051
+ getSchema(T) {
10050
10052
  let C;
10051
- for (; typeof (C = E.call(this, $)) == "string"; )
10052
- $ = C;
10053
+ for (; typeof (C = E.call(this, T)) == "string"; )
10054
+ T = C;
10053
10055
  if (C === void 0) {
10054
10056
  const { schemaId: N } = this.opts, w = new o.SchemaEnv({ schema: {}, schemaId: N });
10055
- if (C = o.resolveSchema.call(this, w, $), !C)
10057
+ if (C = o.resolveSchema.call(this, w, T), !C)
10056
10058
  return;
10057
- this.refs[$] = C;
10059
+ this.refs[T] = C;
10058
10060
  }
10059
10061
  return C.validate || this._compileSchemaEnv(C);
10060
10062
  }
@@ -10062,20 +10064,20 @@ function sm() {
10062
10064
  // If no parameter is passed all schemas but meta-schemas are removed.
10063
10065
  // If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed.
10064
10066
  // Even if schema is referenced by other schemas it still can be removed as other schemas have local references.
10065
- removeSchema($) {
10066
- if ($ instanceof RegExp)
10067
- return this._removeAllSchemas(this.schemas, $), this._removeAllSchemas(this.refs, $), this;
10068
- switch (typeof $) {
10067
+ removeSchema(T) {
10068
+ if (T instanceof RegExp)
10069
+ return this._removeAllSchemas(this.schemas, T), this._removeAllSchemas(this.refs, T), this;
10070
+ switch (typeof T) {
10069
10071
  case "undefined":
10070
10072
  return this._removeAllSchemas(this.schemas), this._removeAllSchemas(this.refs), this._cache.clear(), this;
10071
10073
  case "string": {
10072
- const C = E.call(this, $);
10073
- return typeof C == "object" && this._cache.delete(C.schema), delete this.schemas[$], delete this.refs[$], this;
10074
+ const C = E.call(this, T);
10075
+ return typeof C == "object" && this._cache.delete(C.schema), delete this.schemas[T], delete this.refs[T], this;
10074
10076
  }
10075
10077
  case "object": {
10076
- const C = $;
10078
+ const C = T;
10077
10079
  this._cache.delete(C);
10078
- let N = $[this.opts.schemaId];
10080
+ let N = T[this.opts.schemaId];
10079
10081
  return N && (N = (0, c.normalizeId)(N), delete this.schemas[N], delete this.refs[N]), this;
10080
10082
  }
10081
10083
  default:
@@ -10083,17 +10085,17 @@ function sm() {
10083
10085
  }
10084
10086
  }
10085
10087
  // add "vocabulary" - a collection of keywords
10086
- addVocabulary($) {
10087
- for (const C of $)
10088
+ addVocabulary(T) {
10089
+ for (const C of T)
10088
10090
  this.addKeyword(C);
10089
10091
  return this;
10090
10092
  }
10091
- addKeyword($, C) {
10093
+ addKeyword(T, C) {
10092
10094
  let N;
10093
- if (typeof $ == "string")
10094
- N = $, typeof C == "object" && (this.logger.warn("these parameters are deprecated, see docs for addKeyword"), C.keyword = N);
10095
- else if (typeof $ == "object" && C === void 0) {
10096
- if (C = $, N = C.keyword, Array.isArray(N) && !N.length)
10095
+ if (typeof T == "string")
10096
+ N = T, typeof C == "object" && (this.logger.warn("these parameters are deprecated, see docs for addKeyword"), C.keyword = N);
10097
+ else if (typeof T == "object" && C === void 0) {
10098
+ if (C = T, N = C.keyword, Array.isArray(N) && !N.length)
10097
10099
  throw new Error("addKeywords: keyword must be string or non-empty array");
10098
10100
  } else
10099
10101
  throw new Error("invalid addKeywords parameters");
@@ -10107,33 +10109,33 @@ function sm() {
10107
10109
  };
10108
10110
  return (0, l.eachItem)(N, w.type.length === 0 ? (P) => Y.call(this, P, w) : (P) => w.type.forEach((I) => Y.call(this, P, w, I))), this;
10109
10111
  }
10110
- getKeyword($) {
10111
- const C = this.RULES.all[$];
10112
+ getKeyword(T) {
10113
+ const C = this.RULES.all[T];
10112
10114
  return typeof C == "object" ? C.definition : !!C;
10113
10115
  }
10114
10116
  // Remove keyword
10115
- removeKeyword($) {
10117
+ removeKeyword(T) {
10116
10118
  const { RULES: C } = this;
10117
- delete C.keywords[$], delete C.all[$];
10119
+ delete C.keywords[T], delete C.all[T];
10118
10120
  for (const N of C.rules) {
10119
- const w = N.rules.findIndex((P) => P.keyword === $);
10121
+ const w = N.rules.findIndex((P) => P.keyword === T);
10120
10122
  w >= 0 && N.rules.splice(w, 1);
10121
10123
  }
10122
10124
  return this;
10123
10125
  }
10124
10126
  // Add format
10125
- addFormat($, C) {
10126
- return typeof C == "string" && (C = new RegExp(C)), this.formats[$] = C, this;
10127
+ addFormat(T, C) {
10128
+ return typeof C == "string" && (C = new RegExp(C)), this.formats[T] = C, this;
10127
10129
  }
10128
- errorsText($ = this.errors, { separator: C = ", ", dataVar: N = "data" } = {}) {
10129
- return !$ || $.length === 0 ? "No errors" : $.map((w) => `${N}${w.instancePath} ${w.message}`).reduce((w, P) => w + C + P);
10130
+ errorsText(T = this.errors, { separator: C = ", ", dataVar: N = "data" } = {}) {
10131
+ return !T || T.length === 0 ? "No errors" : T.map((w) => `${N}${w.instancePath} ${w.message}`).reduce((w, P) => w + C + P);
10130
10132
  }
10131
- $dataMetaSchema($, C) {
10133
+ $dataMetaSchema(T, C) {
10132
10134
  const N = this.RULES.all;
10133
- $ = JSON.parse(JSON.stringify($));
10135
+ T = JSON.parse(JSON.stringify(T));
10134
10136
  for (const w of C) {
10135
10137
  const P = w.split("/").slice(1);
10136
- let I = $;
10138
+ let I = T;
10137
10139
  for (const V of P)
10138
10140
  I = I[V];
10139
10141
  for (const V in N) {
@@ -10144,56 +10146,56 @@ function sm() {
10144
10146
  re && Z && (I[V] = ie(Z));
10145
10147
  }
10146
10148
  }
10147
- return $;
10149
+ return T;
10148
10150
  }
10149
- _removeAllSchemas($, C) {
10150
- for (const N in $) {
10151
- const w = $[N];
10152
- (!C || C.test(N)) && (typeof w == "string" ? delete $[N] : w && !w.meta && (this._cache.delete(w.schema), delete $[N]));
10151
+ _removeAllSchemas(T, C) {
10152
+ for (const N in T) {
10153
+ const w = T[N];
10154
+ (!C || C.test(N)) && (typeof w == "string" ? delete T[N] : w && !w.meta && (this._cache.delete(w.schema), delete T[N]));
10153
10155
  }
10154
10156
  }
10155
- _addSchema($, C, N, w = this.opts.validateSchema, P = this.opts.addUsedSchema) {
10157
+ _addSchema(T, C, N, w = this.opts.validateSchema, P = this.opts.addUsedSchema) {
10156
10158
  let I;
10157
10159
  const { schemaId: V } = this.opts;
10158
- if (typeof $ == "object")
10159
- I = $[V];
10160
+ if (typeof T == "object")
10161
+ I = T[V];
10160
10162
  else {
10161
10163
  if (this.opts.jtd)
10162
10164
  throw new Error("schema must be object");
10163
- if (typeof $ != "boolean")
10165
+ if (typeof T != "boolean")
10164
10166
  throw new Error("schema must be object or boolean");
10165
10167
  }
10166
- let B = this._cache.get($);
10168
+ let B = this._cache.get(T);
10167
10169
  if (B !== void 0)
10168
10170
  return B;
10169
10171
  N = (0, c.normalizeId)(I || N);
10170
- const re = c.getSchemaRefs.call(this, $, N);
10171
- return B = new o.SchemaEnv({ schema: $, schemaId: V, meta: C, baseId: N, localRefs: re }), this._cache.set(B.schema, B), P && !N.startsWith("#") && (N && this._checkUnique(N), this.refs[N] = B), w && this.validateSchema($, !0), B;
10172
+ const re = c.getSchemaRefs.call(this, T, N);
10173
+ return B = new o.SchemaEnv({ schema: T, schemaId: V, meta: C, baseId: N, localRefs: re }), this._cache.set(B.schema, B), P && !N.startsWith("#") && (N && this._checkUnique(N), this.refs[N] = B), w && this.validateSchema(T, !0), B;
10172
10174
  }
10173
- _checkUnique($) {
10174
- if (this.schemas[$] || this.refs[$])
10175
- throw new Error(`schema with key or id "${$}" already exists`);
10175
+ _checkUnique(T) {
10176
+ if (this.schemas[T] || this.refs[T])
10177
+ throw new Error(`schema with key or id "${T}" already exists`);
10176
10178
  }
10177
- _compileSchemaEnv($) {
10178
- if ($.meta ? this._compileMetaSchema($) : o.compileSchema.call(this, $), !$.validate)
10179
+ _compileSchemaEnv(T) {
10180
+ if (T.meta ? this._compileMetaSchema(T) : o.compileSchema.call(this, T), !T.validate)
10179
10181
  throw new Error("ajv implementation error");
10180
- return $.validate;
10182
+ return T.validate;
10181
10183
  }
10182
- _compileMetaSchema($) {
10184
+ _compileMetaSchema(T) {
10183
10185
  const C = this.opts;
10184
10186
  this.opts = this._metaOpts;
10185
10187
  try {
10186
- o.compileSchema.call(this, $);
10188
+ o.compileSchema.call(this, T);
10187
10189
  } finally {
10188
10190
  this.opts = C;
10189
10191
  }
10190
10192
  }
10191
10193
  }
10192
10194
  b.ValidationError = n.default, b.MissingRefError = s.default, e.default = b;
10193
- function _(M, $, C, N = "error") {
10195
+ function _(M, T, C, N = "error") {
10194
10196
  for (const w in M) {
10195
10197
  const P = w;
10196
- P in $ && this.logger[N](`${C}: option ${w}. ${M[P]}`);
10198
+ P in T && this.logger[N](`${C}: option ${w}. ${M[P]}`);
10197
10199
  }
10198
10200
  }
10199
10201
  function E(M) {
@@ -10205,13 +10207,13 @@ function sm() {
10205
10207
  if (Array.isArray(M))
10206
10208
  this.addSchema(M);
10207
10209
  else
10208
- for (const $ in M)
10209
- this.addSchema(M[$], $);
10210
+ for (const T in M)
10211
+ this.addSchema(M[T], T);
10210
10212
  }
10211
10213
  function O() {
10212
10214
  for (const M in this.opts.formats) {
10213
- const $ = this.opts.formats[M];
10214
- $ && this.addFormat(M, $);
10215
+ const T = this.opts.formats[M];
10216
+ T && this.addFormat(M, T);
10215
10217
  }
10216
10218
  }
10217
10219
  function L(M) {
@@ -10220,15 +10222,15 @@ function sm() {
10220
10222
  return;
10221
10223
  }
10222
10224
  this.logger.warn("keywords option as map is deprecated, pass array");
10223
- for (const $ in M) {
10224
- const C = M[$];
10225
- C.keyword || (C.keyword = $), this.addKeyword(C);
10225
+ for (const T in M) {
10226
+ const C = M[T];
10227
+ C.keyword || (C.keyword = T), this.addKeyword(C);
10226
10228
  }
10227
10229
  }
10228
10230
  function j() {
10229
10231
  const M = { ...this.opts };
10230
- for (const $ of v)
10231
- delete M[$];
10232
+ for (const T of v)
10233
+ delete M[T];
10232
10234
  return M;
10233
10235
  }
10234
10236
  const q = { log() {
@@ -10245,42 +10247,42 @@ function sm() {
10245
10247
  throw new Error("logger must implement log, warn and error methods");
10246
10248
  }
10247
10249
  const F = /^[a-z_$][a-z0-9_$:-]*$/i;
10248
- function z(M, $) {
10250
+ function z(M, T) {
10249
10251
  const { RULES: C } = this;
10250
10252
  if ((0, l.eachItem)(M, (N) => {
10251
10253
  if (C.keywords[N])
10252
10254
  throw new Error(`Keyword ${N} is already defined`);
10253
10255
  if (!F.test(N))
10254
10256
  throw new Error(`Keyword ${N} has invalid name`);
10255
- }), !!$ && $.$data && !("code" in $ || "validate" in $))
10257
+ }), !!T && T.$data && !("code" in T || "validate" in T))
10256
10258
  throw new Error('$data keyword must have "code" or "validate" function');
10257
10259
  }
10258
- function Y(M, $, C) {
10260
+ function Y(M, T, C) {
10259
10261
  var N;
10260
- const w = $?.post;
10262
+ const w = T?.post;
10261
10263
  if (C && w)
10262
10264
  throw new Error('keyword with "post" flag cannot have "type"');
10263
10265
  const { RULES: P } = this;
10264
10266
  let I = w ? P.post : P.rules.find(({ type: B }) => B === C);
10265
- if (I || (I = { type: C, rules: [] }, P.rules.push(I)), P.keywords[M] = !0, !$)
10267
+ if (I || (I = { type: C, rules: [] }, P.rules.push(I)), P.keywords[M] = !0, !T)
10266
10268
  return;
10267
10269
  const V = {
10268
10270
  keyword: M,
10269
10271
  definition: {
10270
- ...$,
10271
- type: (0, d.getJSONTypes)($.type),
10272
- schemaType: (0, d.getJSONTypes)($.schemaType)
10272
+ ...T,
10273
+ type: (0, d.getJSONTypes)(T.type),
10274
+ schemaType: (0, d.getJSONTypes)(T.schemaType)
10273
10275
  }
10274
10276
  };
10275
- $.before ? he.call(this, I, V, $.before) : I.rules.push(V), P.all[M] = V, (N = $.implements) === null || N === void 0 || N.forEach((B) => this.addKeyword(B));
10277
+ T.before ? he.call(this, I, V, T.before) : I.rules.push(V), P.all[M] = V, (N = T.implements) === null || N === void 0 || N.forEach((B) => this.addKeyword(B));
10276
10278
  }
10277
- function he(M, $, C) {
10279
+ function he(M, T, C) {
10278
10280
  const N = M.rules.findIndex((w) => w.keyword === C);
10279
- N >= 0 ? M.rules.splice(N, 0, $) : (M.rules.push($), this.logger.warn(`rule ${C} is not defined`));
10281
+ N >= 0 ? M.rules.splice(N, 0, T) : (M.rules.push(T), this.logger.warn(`rule ${C} is not defined`));
10280
10282
  }
10281
10283
  function ce(M) {
10282
- let { metaSchema: $ } = M;
10283
- $ !== void 0 && (M.$data && this.opts.$data && ($ = ie($)), M.validateSchema = this.compile($, !0));
10284
+ let { metaSchema: T } = M;
10285
+ T !== void 0 && (M.$data && this.opts.$data && (T = ie(T)), M.validateSchema = this.compile(T, !0));
10284
10286
  }
10285
10287
  const ee = {
10286
10288
  $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"
@@ -10609,17 +10611,17 @@ function mm() {
10609
10611
  };
10610
10612
  return Jt.default = r, Jt;
10611
10613
  }
10612
- var Xt = {}, Qt = {}, Ta;
10614
+ var Xt = {}, Qt = {}, $a;
10613
10615
  function jn() {
10614
- if (Ta) return Qt;
10615
- Ta = 1, Object.defineProperty(Qt, "__esModule", { value: !0 });
10616
+ if ($a) return Qt;
10617
+ $a = 1, Object.defineProperty(Qt, "__esModule", { value: !0 });
10616
10618
  const e = oi();
10617
10619
  return e.code = 'require("ajv/dist/runtime/equal").default', Qt.default = e, Qt;
10618
10620
  }
10619
- var $a;
10621
+ var Ta;
10620
10622
  function gm() {
10621
- if ($a) return Xt;
10622
- $a = 1, Object.defineProperty(Xt, "__esModule", { value: !0 });
10623
+ if (Ta) return Xt;
10624
+ Ta = 1, Object.defineProperty(Xt, "__esModule", { value: !0 });
10623
10625
  const e = Nr(), t = Q(), r = te(), n = jn(), a = {
10624
10626
  keyword: "uniqueItems",
10625
10627
  type: "array",
@@ -11122,7 +11124,7 @@ function Pm() {
11122
11124
  return ir.default = s, ir;
11123
11125
  }
11124
11126
  var cr = {}, Ua;
11125
- function Tm() {
11127
+ function $m() {
11126
11128
  if (Ua) return cr;
11127
11129
  Ua = 1, Object.defineProperty(cr, "__esModule", { value: !0 });
11128
11130
  const e = Ie(), t = Q(), r = te(), n = te(), s = {
@@ -11163,7 +11165,7 @@ function Tm() {
11163
11165
  return cr.default = s, cr;
11164
11166
  }
11165
11167
  var ur = {}, Fa;
11166
- function $m() {
11168
+ function Tm() {
11167
11169
  if (Fa) return ur;
11168
11170
  Fa = 1, Object.defineProperty(ur, "__esModule", { value: !0 });
11169
11171
  const e = te(), t = {
@@ -11323,7 +11325,7 @@ var Ga;
11323
11325
  function Cm() {
11324
11326
  if (Ga) return tr;
11325
11327
  Ga = 1, Object.defineProperty(tr, "__esModule", { value: !0 });
11326
- const e = ii(), t = bm(), r = ci(), n = Em(), s = _m(), a = Sm(), o = Rm(), i = ui(), c = Pm(), d = Tm(), l = $m(), m = Om(), y = Am(), R = Nm(), v = Dm(), g = Im();
11328
+ const e = ii(), t = bm(), r = ci(), n = Em(), s = _m(), a = Sm(), o = Rm(), i = ui(), c = Pm(), d = $m(), l = Tm(), m = Om(), y = Am(), R = Nm(), v = Dm(), g = Im();
11327
11329
  function f(h = !1) {
11328
11330
  const u = [
11329
11331
  // any
@@ -11624,12 +11626,12 @@ const Ym = /* @__PURE__ */ Up(Km), Un = "/bahmni_config/openmrs/apps/clinical/v2
11624
11626
  type: wg,
11625
11627
  additionalProperties: bg,
11626
11628
  properties: Eg
11627
- }, Sg = "http://json-schema.org/draft-07/schema#", Rg = "Registration Configuration Schema", Pg = "Schema for validating registration app configuration", Tg = "object", $g = !1, Og = { id: { type: "string", description: "Unique identifier for the registration configuration" }, contextModel: { type: "array", description: "Array of context model configurations", items: { type: "string" } }, patientSearch: { type: "object", description: "Patient search configuration", additionalProperties: !1, properties: { customAttributes: { type: "array", description: "Array of available search fields", items: { type: "object", additionalProperties: !1, properties: { translationKey: { type: "string", description: "Translation key for the dropdown label" }, fields: { type: "array", description: "Array of field names to search against", items: { type: "string" } }, expectedFields: { type: "array", description: "Array of fields configurations with translation keys to display on table headers", items: { type: "object", additionalProperties: !1, properties: { field: { type: "string", description: "field corresponding to table header" }, translationKey: { type: "string", description: "Translation key for the table header" } } } }, type: { type: "string", enum: ["person", "address", "program", "appointment"], description: "Type of the search field (person, address, program, appointment)" } } } }, appointment: { type: "array", description: "Array of available search fields for appointments", items: { type: "object", additionalProperties: !0, required: ["translationKey", "fields"], properties: { translationKey: { type: "string", description: "Translation key for the field label" }, fields: { type: "array", description: "Array of field names to search against", items: { type: "string" } }, expectedFields: { type: "array", description: "Array of expected fields with optional types", items: { type: "object", required: ["field", "translationKey"], properties: { field: { type: "string", description: "The field name (e.g., apptNumber, apptDate)" }, translationKey: { type: "string", description: "Translation key for the field's display label" }, type: { type: "string", description: "Optional field type (e.g., date, string)" } } } }, type: { type: "string", enum: ["appointment"], description: "Type of the search field (appointment)" }, actions: { type: "array", description: "Array of actions allowed on this search field", items: { type: "object", required: ["translationKey", "type", "enabledRule", "onAction"], properties: { translationKey: { type: "string", description: "Translation key for the action button label" }, type: { type: "string", enum: ["changeStatus", "navigate"], description: "Type of action to perform" }, enabledRule: { type: "array", description: "Conditions to enable this action (rules)", items: { type: "object", properties: { type: { type: "string", enum: ["privilegeCheck", "statusCheck", "appDateCheck"], description: "Type of rule to evaluate" }, values: { type: "array", items: { type: "string" }, description: "Values to check against for the rule" } } } }, onAction: { type: "object", description: "What happens when action is triggered", additionalProperties: !0, properties: { status: { type: "string", description: "Status to set (for changeStatus type)" }, navigation: { type: "string", description: "URL path to navigate to (for navigate type)" } } }, onSuccess: { type: "object", description: "Notification or other success response", additionalProperties: !0, properties: { notification: { type: "string", description: "Translation key for success notification message" } } } } } } } } } } }, defaultVisitType: { type: "string", description: "Default visit type for patient registration" }, patientInformation: { type: "object", description: "Patient name related fields configuration", additionalProperties: !0, properties: { defaultIdentifierPrefix: { type: "string", description: "Default prefix for patient identifiers" }, showEnterManually: { type: "boolean" }, showMiddleName: { type: "boolean" }, showLastName: { type: "boolean" }, isFirstNameMandatory: { type: "boolean" }, isMiddleNameMandatory: { type: "boolean" }, isGenderMandatory: { type: "boolean" }, isDateOfBirthMandatory: { type: "boolean" }, isLastNameMandatory: { type: "boolean" }, patientNameDisplayOrder: { type: "array", description: "Order in which patient name fields should be displayed", items: { type: "string" } }, showBirthTime: { type: "boolean" }, showDOBEstimated: { type: "boolean" }, addressHierarchy: { type: "object", description: "Address hierarchy levels to be displayed", additionalProperties: !1, properties: { showAddressFieldsTopDown: { type: "boolean" }, strictAutocompleteFromLevel: { type: "string" }, expectedFields: { type: "array", description: "Array of expected fields with translation keys", items: { type: "object", properties: { addressField: { type: "string", description: "Field name" }, translationKey: { type: "string", description: "Translation key for the field label" } } } } } }, additionalPatientInformation: { type: "object", description: "Additional patient information configuration", additionalProperties: !0, properties: { translationKey: { type: "string", description: "Translation key for the section title" }, attributes: { type: "array", description: "Array of attribute fields with translation keys", items: { type: "object", required: ["field", "translationKey"], properties: { field: { type: "string", description: "Field name" }, translationKey: { type: "string", description: "Translation key for the field label" } } } } } }, contactInformation: { type: "object", additionalProperties: !0, properties: { translationKey: { type: "string", description: "Translation key for the section title" }, attributes: { type: "array", description: "Array of attribute fields with translation keys", items: { type: "object", required: ["field", "translationKey"], properties: { field: { type: "string", description: "Field name" }, translationKey: { type: "string", description: "Translation key for the field label" } } } } } }, showExtraPatientIdentifiersSection: { type: "boolean", description: "Whether to show extra patient identifiers section" } } }, fieldValidation: { type: "object", description: "Field validation rules with regex patterns and error messages", additionalProperties: !0, patternProperties: { "^.*$": { type: "object", properties: { pattern: { type: "string", description: "Regular expression pattern for field validation" }, errorMessage: { type: "string", description: "Error message to display when validation fails" } } } } }, extensionPoints: { type: "array", description: "Array of extension point definitions that extensions can attach to", items: { type: "object", required: ["id"], additionalProperties: !1, properties: { id: { type: "string", description: "Unique identifier for the extension point (e.g., 'org.bahmni.registration.navigation')" }, description: { type: "string", description: "Human-readable description of what this extension point is for" } } } }, registrationAppExtensions: { type: "array", description: "Array of app extension configurations for registration", items: { type: "object", description: "Extension configuration", additionalProperties: !1, required: ["id", "extensionPointId", "type", "requiredPrivilege"], properties: { id: { type: "string", description: "Unique identifier for the extension" }, extensionPointId: { type: "string", description: "Extension point identifier this extension attaches to" }, type: { type: "string", enum: ["link", "startVisit"], description: "Type of extension (e.g., 'link', 'startVisit')" }, translationKey: { type: "string", description: "Translation key for the extension label" }, url: { type: "string", description: "URL path for the extension" }, shortcutKey: { type: "string", description: "Keyboard shortcut key for the extension" }, icon: { type: "string", description: "Icon class name (e.g., FontAwesome class like 'fa-search')" }, order: { type: "number", description: "Display order of the extension" }, kind: { type: "string", enum: ["primary", "secondary", "tertiary", "ghost", "danger"], description: "Button kind/variant (defaults to 'primary' if not specified)" }, requiredPrivilege: { type: "string", description: "Required privilege to access this extension" } } } } }, Ag = {
11629
+ }, Sg = "http://json-schema.org/draft-07/schema#", Rg = "Registration Configuration Schema", Pg = "Schema for validating registration app configuration", $g = "object", Tg = !1, Og = { id: { type: "string", description: "Unique identifier for the registration configuration" }, contextModel: { type: "array", description: "Array of context model configurations", items: { type: "string" } }, patientSearch: { type: "object", description: "Patient search configuration", additionalProperties: !1, properties: { customAttributes: { type: "array", description: "Array of available search fields", items: { type: "object", additionalProperties: !1, properties: { translationKey: { type: "string", description: "Translation key for the dropdown label" }, fields: { type: "array", description: "Array of field names to search against", items: { type: "string" } }, expectedFields: { type: "array", description: "Array of fields configurations with translation keys to display on table headers", items: { type: "object", additionalProperties: !1, properties: { field: { type: "string", description: "field corresponding to table header" }, translationKey: { type: "string", description: "Translation key for the table header" } } } }, type: { type: "string", enum: ["person", "address", "program", "appointment"], description: "Type of the search field (person, address, program, appointment)" } } } }, appointment: { type: "array", description: "Array of available search fields for appointments", items: { type: "object", additionalProperties: !0, required: ["translationKey", "fields"], properties: { translationKey: { type: "string", description: "Translation key for the field label" }, fields: { type: "array", description: "Array of field names to search against", items: { type: "string" } }, expectedFields: { type: "array", description: "Array of expected fields with optional types", items: { type: "object", required: ["field", "translationKey"], properties: { field: { type: "string", description: "The field name (e.g., apptNumber, apptDate)" }, translationKey: { type: "string", description: "Translation key for the field's display label" }, type: { type: "string", description: "Optional field type (e.g., date, string)" } } } }, type: { type: "string", enum: ["appointment"], description: "Type of the search field (appointment)" }, actions: { type: "array", description: "Array of actions allowed on this search field", items: { type: "object", required: ["translationKey", "type", "enabledRule", "onAction"], properties: { translationKey: { type: "string", description: "Translation key for the action button label" }, type: { type: "string", enum: ["changeStatus", "navigate"], description: "Type of action to perform" }, enabledRule: { type: "array", description: "Conditions to enable this action (rules)", items: { type: "object", properties: { type: { type: "string", enum: ["privilegeCheck", "statusCheck", "appDateCheck"], description: "Type of rule to evaluate" }, values: { type: "array", items: { type: "string" }, description: "Values to check against for the rule" } } } }, onAction: { type: "object", description: "What happens when action is triggered", additionalProperties: !0, properties: { status: { type: "string", description: "Status to set (for changeStatus type)" }, navigation: { type: "string", description: "URL path to navigate to (for navigate type)" } } }, onSuccess: { type: "object", description: "Notification or other success response", additionalProperties: !0, properties: { notification: { type: "string", description: "Translation key for success notification message" } } } } } } } } } } }, defaultVisitType: { type: "string", description: "Default visit type for patient registration" }, patientInformation: { type: "object", description: "Patient name related fields configuration", additionalProperties: !0, properties: { defaultIdentifierPrefix: { type: "string", description: "Default prefix for patient identifiers" }, showEnterManually: { type: "boolean" }, showMiddleName: { type: "boolean" }, showLastName: { type: "boolean" }, isFirstNameMandatory: { type: "boolean" }, isMiddleNameMandatory: { type: "boolean" }, isGenderMandatory: { type: "boolean" }, isDateOfBirthMandatory: { type: "boolean" }, isLastNameMandatory: { type: "boolean" }, patientNameDisplayOrder: { type: "array", description: "Order in which patient name fields should be displayed", items: { type: "string" } }, showBirthTime: { type: "boolean" }, showDOBEstimated: { type: "boolean" }, addressHierarchy: { type: "object", description: "Address hierarchy levels to be displayed", additionalProperties: !1, properties: { showAddressFieldsTopDown: { type: "boolean" }, strictAutocompleteFromLevel: { type: "string" }, expectedFields: { type: "array", description: "Array of expected fields with translation keys", items: { type: "object", properties: { addressField: { type: "string", description: "Field name" }, translationKey: { type: "string", description: "Translation key for the field label" } } } } } }, additionalPatientInformation: { type: "object", description: "Additional patient information configuration", additionalProperties: !0, properties: { translationKey: { type: "string", description: "Translation key for the section title" }, attributes: { type: "array", description: "Array of attribute fields with translation keys", items: { type: "object", required: ["field", "translationKey"], properties: { field: { type: "string", description: "Field name" }, translationKey: { type: "string", description: "Translation key for the field label" } } } } } }, contactInformation: { type: "object", additionalProperties: !0, properties: { translationKey: { type: "string", description: "Translation key for the section title" }, attributes: { type: "array", description: "Array of attribute fields with translation keys", items: { type: "object", required: ["field", "translationKey"], properties: { field: { type: "string", description: "Field name" }, translationKey: { type: "string", description: "Translation key for the field label" } } } } } }, showExtraPatientIdentifiersSection: { type: "boolean", description: "Whether to show extra patient identifiers section" } } }, fieldValidation: { type: "object", description: "Field validation rules with regex patterns and error messages", additionalProperties: !0, patternProperties: { "^.*$": { type: "object", properties: { pattern: { type: "string", description: "Regular expression pattern for field validation" }, errorMessage: { type: "string", description: "Error message to display when validation fails" } } } } }, extensionPoints: { type: "array", description: "Array of extension point definitions that extensions can attach to", items: { type: "object", required: ["id"], additionalProperties: !1, properties: { id: { type: "string", description: "Unique identifier for the extension point (e.g., 'org.bahmni.registration.navigation')" }, description: { type: "string", description: "Human-readable description of what this extension point is for" } } } }, registrationAppExtensions: { type: "array", description: "Array of app extension configurations for registration", items: { type: "object", description: "Extension configuration", additionalProperties: !1, required: ["id", "extensionPointId", "type", "requiredPrivilege"], properties: { id: { type: "string", description: "Unique identifier for the extension" }, extensionPointId: { type: "string", description: "Extension point identifier this extension attaches to" }, type: { type: "string", enum: ["link", "startVisit"], description: "Type of extension (e.g., 'link', 'startVisit')" }, translationKey: { type: "string", description: "Translation key for the extension label" }, url: { type: "string", description: "URL path for the extension" }, shortcutKey: { type: "string", description: "Keyboard shortcut key for the extension" }, icon: { type: "string", description: "Icon class name (e.g., FontAwesome class like 'fa-search')" }, order: { type: "number", description: "Display order of the extension" }, kind: { type: "string", enum: ["primary", "secondary", "tertiary", "ghost", "danger"], description: "Button kind/variant (defaults to 'primary' if not specified)" }, requiredPrivilege: { type: "string", description: "Required privilege to access this extension" } } } } }, Ag = {
11628
11630
  $schema: Sg,
11629
11631
  title: Rg,
11630
11632
  description: Pg,
11631
- type: Tg,
11632
- additionalProperties: $g,
11633
+ type: $g,
11634
+ additionalProperties: Tg,
11633
11635
  properties: Og
11634
11636
  }, Fv = async () => zr(Xm, cg), Vv = async (e) => {
11635
11637
  const t = await zr(
@@ -11910,7 +11912,7 @@ export {
11910
11912
  Yh as AllergyStatus,
11911
11913
  Ch as AttributeFormat,
11912
11914
  kh as AttributeInputType,
11913
- Ty as BAHMNI_HOME_PATH,
11915
+ $y as BAHMNI_HOME_PATH,
11914
11916
  Yf as DATE_FORMAT,
11915
11917
  Cy as DATE_PICKER_INPUT_FORMAT,
11916
11918
  Jf as DATE_TIME_FORMAT,
@@ -11939,7 +11941,7 @@ export {
11939
11941
  uv as createVisit,
11940
11942
  Py as del,
11941
11943
  Yv as dispatchAuditEvent,
11942
- $v as fetchAndFormatAllergenConcepts,
11944
+ Tv as fetchAndFormatAllergenConcepts,
11943
11945
  ew as fetchFormMetadata,
11944
11946
  Zv as fetchObservationForms,
11945
11947
  Ov as fetchReactionConcepts,
@@ -11958,7 +11960,7 @@ export {
11958
11960
  Gh as getAllergies,
11959
11961
  Rv as getAppointmentById,
11960
11962
  Fv as getClinicalConfig,
11961
- Tv as getConceptById,
11963
+ $v as getConceptById,
11962
11964
  kv as getConditions,
11963
11965
  Zo as getCookieByName,
11964
11966
  Wv as getCurrentProvider,
@@ -11977,7 +11979,7 @@ export {
11977
11979
  Hv as getMedicationConfig,
11978
11980
  Mp as getOrderTypes,
11979
11981
  fv as getOrderedAddressHierarchyLevels,
11980
- Th as getPatientById,
11982
+ $h as getPatientById,
11981
11983
  Lv as getPatientDiagnoses,
11982
11984
  Zy as getPatientImageAsDataUrl,
11983
11985
  jv as getPatientLabInvestigations,
@@ -12012,7 +12014,7 @@ export {
12012
12014
  Hy as isStringEmpty,
12013
12015
  Ev as isTextFormat,
12014
12016
  Qg as logAuditEvent,
12015
- $y as normalizeTranslationKey,
12017
+ Ty as normalizeTranslationKey,
12016
12018
  sn as notificationService,
12017
12019
  th as parseQueryParams,
12018
12020
  ht as post,