@alfadocs/ui-kit-debug 1.89.0 → 1.90.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/dist/_chunks/{anamnesis-summary-rows-DjM_HkCS.js → anamnesis-summary-rows-fbEQwcuW.js} +661 -653
  2. package/dist/_chunks/anamnesis-summary-rows-fbEQwcuW.js.map +1 -0
  3. package/dist/_chunks/{balance-badge-cell-BHXJS8Ga.js → balance-badge-cell-C4FYwmrZ.js} +2 -2
  4. package/dist/_chunks/{balance-badge-cell-BHXJS8Ga.js.map → balance-badge-cell-C4FYwmrZ.js.map} +1 -1
  5. package/dist/_chunks/browser-D5CD3WOj.js +565 -0
  6. package/dist/_chunks/browser-D5CD3WOj.js.map +1 -0
  7. package/dist/_chunks/{calendar-appointment-editor-dialog-BuumJbcv.js → calendar-appointment-editor-dialog-C1v2MNE4.js} +2 -2
  8. package/dist/_chunks/{calendar-appointment-editor-dialog-BuumJbcv.js.map → calendar-appointment-editor-dialog-C1v2MNE4.js.map} +1 -1
  9. package/dist/_chunks/{data-table-BlONA1rP.js → data-table-B_IcS0Ke.js} +552 -551
  10. package/dist/_chunks/data-table-B_IcS0Ke.js.map +1 -0
  11. package/dist/_chunks/{file-manager-C9iJjDZt.js → file-manager-C9YOT-Dn.js} +2 -2
  12. package/dist/_chunks/{file-manager-C9iJjDZt.js.map → file-manager-C9YOT-Dn.js.map} +1 -1
  13. package/dist/_chunks/{heatmap-C2Rg-SV_.js → heatmap-HTz3Jvzy.js} +2 -2
  14. package/dist/_chunks/{heatmap-C2Rg-SV_.js.map → heatmap-HTz3Jvzy.js.map} +1 -1
  15. package/dist/_chunks/index-CpVcVNBu.js +2326 -0
  16. package/dist/_chunks/index-CpVcVNBu.js.map +1 -0
  17. package/dist/_chunks/{index.es-B8zMZ1wV.js → index.es-Beo-XicE.js} +2 -2
  18. package/dist/_chunks/{index.es-B8zMZ1wV.js.map → index.es-Beo-XicE.js.map} +1 -1
  19. package/dist/_chunks/jspdf.es.min-BW7y6yhl.js +9674 -0
  20. package/dist/_chunks/jspdf.es.min-BW7y6yhl.js.map +1 -0
  21. package/dist/_chunks/{patient-search-BPjP2__L.js → patient-search-CCOUZABE.js} +415 -406
  22. package/dist/_chunks/patient-search-CCOUZABE.js.map +1 -0
  23. package/dist/_chunks/purify.es-Lo4sC_pz.js +1483 -0
  24. package/dist/_chunks/purify.es-Lo4sC_pz.js.map +1 -0
  25. package/dist/agent-catalog.json +1 -1
  26. package/dist/components/data-table/index.js +1 -1
  27. package/dist/components/data-table/toolbar.d.ts.map +1 -1
  28. package/dist/components/data-table/xlsx-export.d.ts +13 -0
  29. package/dist/components/data-table/xlsx-export.d.ts.map +1 -0
  30. package/dist/components/file-manager/index.js +1 -1
  31. package/dist/components/heatmap/index.js +1 -1
  32. package/dist/components/patient-search/index.js +1 -1
  33. package/dist/components/patient-search/patient-search.d.ts +8 -0
  34. package/dist/components/patient-search/patient-search.d.ts.map +1 -1
  35. package/dist/components/patient-table/index.js +1 -1
  36. package/dist/index.js +7 -7
  37. package/dist/patterns/anamnesis/anamnesis-export-download.d.ts +1 -1
  38. package/dist/patterns/anamnesis/anamnesis-export-download.d.ts.map +1 -1
  39. package/dist/patterns/anamnesis/anamnesis-export.d.ts +3 -1
  40. package/dist/patterns/anamnesis/anamnesis-export.d.ts.map +1 -1
  41. package/dist/patterns/anamnesis/index.js +1 -1
  42. package/dist/patterns/calendar/index.js +1 -1
  43. package/dist/safe-html/index.js +6 -6
  44. package/package.json +5 -4
  45. package/dist/_chunks/anamnesis-summary-rows-DjM_HkCS.js.map +0 -1
  46. package/dist/_chunks/data-table-BlONA1rP.js.map +0 -1
  47. package/dist/_chunks/exceljs.min-D2MHbJsF.js +0 -23046
  48. package/dist/_chunks/exceljs.min-D2MHbJsF.js.map +0 -1
  49. package/dist/_chunks/jspdf.es.min-DaapWjR1.js +0 -10007
  50. package/dist/_chunks/jspdf.es.min-DaapWjR1.js.map +0 -1
  51. package/dist/_chunks/patient-search-BPjP2__L.js.map +0 -1
  52. package/dist/_chunks/purify.es-Cm3utOpm.js +0 -561
  53. package/dist/_chunks/purify.es-Cm3utOpm.js.map +0 -1
@@ -440,7 +440,7 @@ function ii(e) {
440
440
  const a = typeof e == "string" ? St[e] : e;
441
441
  return a ? (a.targetable ?? ((n = St[a.key]) == null ? void 0 : n.targetable) ?? !1) || a.goal === !0 : !1;
442
442
  }
443
- const ad = new Set(
443
+ const Xs = new Set(
444
444
  lt.filter((e) => ii(e)).map(
445
445
  (e) => e.key
446
446
  )
@@ -1324,7 +1324,7 @@ function _o(e, { keepId: a } = {}) {
1324
1324
  }
1325
1325
  const o = ki(n), r = [...n].sort((m, v) => o(m.dateIso) - o(v.dateIso)), l = {};
1326
1326
  for (const m of So) {
1327
- const v = r.find((k) => at(k.anthropometrics[m]));
1327
+ const v = r.find((x) => at(x.anthropometrics[m]));
1328
1328
  l[m] = v ? v.anthropometrics[m] : null;
1329
1329
  }
1330
1330
  const s = r.map((m) => m.dietaryIntake).filter((m) => m != null), d = [];
@@ -1334,7 +1334,7 @@ function _o(e, { keepId: a } = {}) {
1334
1334
  const u = [];
1335
1335
  for (const m of r)
1336
1336
  for (const v of m.therapy)
1337
- u.some((k) => k.id === v.id) || u.push(v);
1337
+ u.some((x) => x.id === v.id) || u.push(v);
1338
1338
  const g = {
1339
1339
  id: pa,
1340
1340
  visitType: "first",
@@ -1724,7 +1724,7 @@ function Ho({
1724
1724
  ] }) }),
1725
1725
  /* @__PURE__ */ i("tbody", { children: d.map(
1726
1726
  (m) => {
1727
- var v, k;
1727
+ var v, x;
1728
1728
  return m.banner != null ? /* @__PURE__ */ i("tr", { className: "ds:bg-[color:var(--muted)]", children: /* @__PURE__ */ i(
1729
1729
  "th",
1730
1730
  {
@@ -1736,7 +1736,7 @@ function Ho({
1736
1736
  m.header,
1737
1737
  (v = m.cells) == null ? void 0 : v[0],
1738
1738
  m.trend,
1739
- (k = m.cells) == null ? void 0 : k.slice(1),
1739
+ (x = m.cells) == null ? void 0 : x.slice(1),
1740
1740
  m.trailing
1741
1741
  ] }, m.key);
1742
1742
  }
@@ -1807,19 +1807,19 @@ function Uo({
1807
1807
  annotations: b,
1808
1808
  onSelectAnnotation: m,
1809
1809
  baselineSources: v,
1810
- groupBanners: k = !0,
1810
+ groupBanners: x = !0,
1811
1811
  caption: f
1812
1812
  }) {
1813
- var w;
1814
- const A = oa(), h = Ee(t), y = ci(e, a), N = e.visits, j = o ?? ((w = N[N.length - 1]) == null ? void 0 : w.id), T = u ?? _i(N), R = [];
1813
+ var k;
1814
+ const T = oa(), h = Ee(t), y = ci(e, a), A = e.visits, j = o ?? ((k = A[A.length - 1]) == null ? void 0 : k.id), N = u ?? _i(A), R = [];
1815
1815
  let p = null;
1816
1816
  if (y.forEach((C) => {
1817
- k && C.def.group !== p && (p = C.def.group, R.push({
1817
+ x && C.def.group !== p && (p = C.def.group, R.push({
1818
1818
  key: `group-${C.def.group}`,
1819
1819
  banner: t(`anamnesis.group.${C.def.group}`)
1820
1820
  }));
1821
- const F = Go(C.def.referenceRange, t, h), O = T.map((D, q) => {
1822
- const { visit: $, index: V } = D, P = C.cells[V] ?? qo, G = $.id === j && !Ba($), Z = g == null || g.has(C.def.key), J = n && G && Z && !C.def.computed, me = !Ko(T, q);
1821
+ const F = Go(C.def.referenceRange, t, h), O = N.map((D, q) => {
1822
+ const { visit: $, index: V } = D, P = C.cells[V] ?? qo, G = $.id === j && !Ba($), Z = g == null || g.has(C.def.key), J = n && G && Z && !C.def.computed, me = !Ko(N, q);
1823
1823
  return /* @__PURE__ */ i(
1824
1824
  "td",
1825
1825
  {
@@ -1904,7 +1904,7 @@ function Uo({
1904
1904
  )
1905
1905
  }
1906
1906
  );
1907
- const S = T.map((C) => /* @__PURE__ */ i(
1907
+ const S = N.map((C) => /* @__PURE__ */ i(
1908
1908
  Vo,
1909
1909
  {
1910
1910
  column: C,
@@ -1919,7 +1919,7 @@ function Uo({
1919
1919
  return /* @__PURE__ */ i(
1920
1920
  Ho,
1921
1921
  {
1922
- captionId: A,
1922
+ captionId: T,
1923
1923
  caption: f ?? t("anamnesis.grid.caption"),
1924
1924
  identityLabel: t("anamnesis.grid.parameter"),
1925
1925
  trendLabel: t("anamnesis.grid.trend"),
@@ -1976,23 +1976,23 @@ function bt({
1976
1976
  () => De(n),
1977
1977
  [n]
1978
1978
  ), b = H(
1979
- () => new Set(xe(n).map((N) => N.key)),
1979
+ () => new Set(xe(n).map((A) => A.key)),
1980
1980
  [n]
1981
1981
  ), m = a("anamnesis.grid.unlabelledSource"), v = H(
1982
1982
  () => o ? Zo(e.visits, m) : [Qo(e.visits)],
1983
1983
  [o, e.visits, m]
1984
- ), k = H(
1985
- () => v.map((N) => {
1986
- const j = u != null && N.visits.some((T) => T.id === u);
1984
+ ), x = H(
1985
+ () => v.map((A) => {
1986
+ const j = u != null && A.visits.some((N) => N.id === u);
1987
1987
  return {
1988
- block: N,
1988
+ block: A,
1989
1989
  // Same reference when nothing was partitioned, so downstream memos
1990
1990
  // keep their identity.
1991
- record: N.visits === e.visits ? e : { ...e, visits: N.visits },
1991
+ record: A.visits === e.visits ? e : { ...e, visits: A.visits },
1992
1992
  defs: o ? Yo(
1993
- N.visits,
1993
+ A.visits,
1994
1994
  g,
1995
- j ? (T) => b.has(T.key) && !T.computed : void 0
1995
+ j ? (N) => b.has(N.key) && !N.computed : void 0
1996
1996
  ) : g
1997
1997
  };
1998
1998
  }),
@@ -2004,23 +2004,23 @@ function bt({
2004
2004
  u,
2005
2005
  b
2006
2006
  ]
2007
- ), f = _e(/* @__PURE__ */ new Map()), A = Qe(
2008
- (N, j) => {
2009
- f.current.set(N, j), l == null || l(
2007
+ ), f = _e(/* @__PURE__ */ new Map()), T = Qe(
2008
+ (A, j) => {
2009
+ f.current.set(A, j), l == null || l(
2010
2010
  Jo(
2011
- v.map((T) => f.current.get(T.key) ?? [])
2011
+ v.map((N) => f.current.get(N.key) ?? [])
2012
2012
  )
2013
2013
  );
2014
2014
  },
2015
2015
  [v, l]
2016
2016
  ), h = H(
2017
2017
  () => new Map(
2018
- v.map((N) => [
2019
- N.key,
2020
- (j) => A(N.key, j)
2018
+ v.map((A) => [
2019
+ A.key,
2020
+ (j) => T(A.key, j)
2021
2021
  ])
2022
2022
  ),
2023
- [v, A]
2023
+ [v, T]
2024
2024
  );
2025
2025
  return e.visits.length === 0 ? /* @__PURE__ */ i("div", { className: "ds:w-full", "data-testid": "anamnesis-evolution-empty", children: /* @__PURE__ */ i(
2026
2026
  Xe,
@@ -2039,23 +2039,23 @@ function bt({
2039
2039
  children: s
2040
2040
  }
2041
2041
  ) : null,
2042
- k.map(({ block: N, record: j, defs: T }) => /* @__PURE__ */ i(
2042
+ x.map(({ block: A, record: j, defs: N }) => /* @__PURE__ */ i(
2043
2043
  Xo,
2044
2044
  {
2045
2045
  ...d,
2046
2046
  record: j,
2047
- defs: T,
2047
+ defs: N,
2048
2048
  t: a,
2049
2049
  editable: t,
2050
2050
  editableVisitId: u,
2051
2051
  capturableKeys: b,
2052
- heading: o ? { label: N.label, count: N.visits.length } : void 0,
2052
+ heading: o ? { label: A.label, count: A.visits.length } : void 0,
2053
2053
  groupBanners: !o,
2054
2054
  carded: o && r,
2055
- onVisitSelectionChange: h.get(N.key),
2055
+ onVisitSelectionChange: h.get(A.key),
2056
2056
  toolbarEnd: o ? void 0 : s
2057
2057
  },
2058
- N.key
2058
+ A.key
2059
2059
  ))
2060
2060
  ] });
2061
2061
  }
@@ -2082,19 +2082,19 @@ function Xo({
2082
2082
  defaultVisitIds: b,
2083
2083
  defaultEventIds: m,
2084
2084
  onVisitSelectionChange: v,
2085
- onOpenNote: k,
2085
+ onOpenNote: x,
2086
2086
  toolbarEnd: f
2087
2087
  }) {
2088
- const A = H(
2088
+ const T = H(
2089
2089
  () => _o(e.visits, { keepId: r }),
2090
2090
  [e.visits, r]
2091
- ), { visits: h, pickable: y, baseline: N } = A, j = H(
2092
- () => N ? { ...e, visits: h } : e,
2093
- [e, N, h]
2094
- ), T = H(
2095
- () => N ? [pa] : [],
2096
- [N]
2097
- ), R = oa(), p = oa(), [S, w] = I(""), [C, F] = I(
2091
+ ), { visits: h, pickable: y, baseline: A } = T, j = H(
2092
+ () => A ? { ...e, visits: h } : e,
2093
+ [e, A, h]
2094
+ ), N = H(
2095
+ () => A ? [pa] : [],
2096
+ [A]
2097
+ ), R = oa(), p = oa(), [S, k] = I(""), [C, F] = I(
2098
2098
  () => (b ? [...b] : y.map((B) => B.id)).filter(
2099
2099
  (B) => B !== pa
2100
2100
  )
@@ -2104,33 +2104,33 @@ function Xo({
2104
2104
  );
2105
2105
  return B.length > 0 || y.length === 0 ? B : y.map((U) => U.id);
2106
2106
  }, [C, y]), q = H(
2107
- () => ht(h, D, { alwaysShowIds: T }),
2108
- [h, D, T]
2107
+ () => ht(h, D, { alwaysShowIds: N }),
2108
+ [h, D, N]
2109
2109
  ), $ = H(
2110
2110
  () => q.columns.flatMap(
2111
- (B) => B.visit.id === pa ? A.sources.map((U) => U.id) : [B.visit.id]
2111
+ (B) => B.visit.id === pa ? T.sources.map((U) => U.id) : [B.visit.id]
2112
2112
  ),
2113
- [q, A]
2113
+ [q, T]
2114
2114
  );
2115
2115
  ba(() => {
2116
2116
  v == null || v($);
2117
2117
  }, [$, v]);
2118
2118
  const V = H(() => {
2119
- const B = N ? 1 : 0;
2119
+ const B = A ? 1 : 0;
2120
2120
  return y.map((U, fe) => ({
2121
2121
  id: U.id,
2122
2122
  label: ro(U, fe + B, a, Ai(U))
2123
2123
  }));
2124
- }, [y, N, a]), P = D.length === y.length, G = a("anamnesis.window.pickerTrigger", {
2124
+ }, [y, A, a]), P = D.length === y.length, G = a("anamnesis.window.pickerTrigger", {
2125
2125
  shown: q.shownCount,
2126
2126
  total: q.totalCount
2127
- }), Z = () => w(a("anamnesis.window.minimum")), J = (B, U) => {
2127
+ }), Z = () => k(a("anamnesis.window.minimum")), J = (B, U) => {
2128
2128
  if (!U && D.length === 1) return Z();
2129
- w(""), F(
2129
+ k(""), F(
2130
2130
  U ? [...D, B] : D.filter((fe) => fe !== B)
2131
2131
  );
2132
2132
  }, me = () => {
2133
- w(""), F(y.map((B) => B.id));
2133
+ k(""), F(y.map((B) => B.id));
2134
2134
  }, he = H(() => {
2135
2135
  const B = q.firstIso ? be(q.firstIso, a) : "", U = q.lastIso ? be(q.lastIso, a) : "", fe = q.hiddenCount > 0 ? a("anamnesis.window.showing", {
2136
2136
  shown: q.shownCount,
@@ -2157,8 +2157,8 @@ function Xo({
2157
2157
  ), Ke = (B) => se(
2158
2158
  (U) => U.includes(B) ? U.filter((fe) => fe !== B) : [...U, B]
2159
2159
  ), Le = H(
2160
- () => k ? (B) => k({ kind: "event", eventId: B }) : void 0,
2161
- [k]
2160
+ () => x ? (B) => x({ kind: "event", eventId: B }) : void 0,
2161
+ [x]
2162
2162
  ), Ae = /* @__PURE__ */ c(
2163
2163
  "div",
2164
2164
  {
@@ -2278,8 +2278,8 @@ function Xo({
2278
2278
  capturableKeys: n,
2279
2279
  annotations: ue,
2280
2280
  onSelectAnnotation: Le,
2281
- onOpenNote: k,
2282
- baselineSources: N ? A.sources : void 0,
2281
+ onOpenNote: x,
2282
+ baselineSources: A ? T.sources : void 0,
2283
2283
  groupBanners: u,
2284
2284
  caption: d ? a("anamnesis.grid.captionInModule", { module: d.label }) : void 0
2285
2285
  }
@@ -2585,14 +2585,14 @@ function or(e) {
2585
2585
  return kt("summary", t, n);
2586
2586
  const { meta: s, patientName: d } = vt(a, l, n, r), u = [], g = [], b = a.intake;
2587
2587
  if (ae(l, "intake.answers") && b) {
2588
- const k = [];
2588
+ const x = [];
2589
2589
  for (const f of We(o)) {
2590
- const A = f.fields.filter((h) => sa(h, a.patient.sex)).filter((h) => b.answers[h.key]);
2591
- if (A.length !== 0) {
2592
- k.push(ji(ye(f, n)));
2593
- for (const h of A) {
2590
+ const T = f.fields.filter((h) => sa(h, a.patient.sex)).filter((h) => b.answers[h.key]);
2591
+ if (T.length !== 0) {
2592
+ x.push(ji(ye(f, n)));
2593
+ for (const h of T) {
2594
2594
  const y = b.answers[h.key];
2595
- y && k.push({
2595
+ y && x.push({
2596
2596
  cells: [
2597
2597
  ge(h, n),
2598
2598
  re(Ra(y.value, h, n)),
@@ -2610,7 +2610,7 @@ function or(e) {
2610
2610
  { key: "answer", header: n("anamnesis.export.column.answer") },
2611
2611
  { key: "source", header: n("anamnesis.export.column.source") }
2612
2612
  ],
2613
- rows: k,
2613
+ rows: x,
2614
2614
  emptyText: n("anamnesis.summary.noAnswers")
2615
2615
  });
2616
2616
  } else b || g.push(n("anamnesis.compile.noIntake"));
@@ -2731,7 +2731,7 @@ function rr(e) {
2731
2731
  !1
2732
2732
  );
2733
2733
  v && g.push(v);
2734
- const k = Ka(
2734
+ const x = Ka(
2735
2735
  "dietary",
2736
2736
  n("anamnesis.section.dietary"),
2737
2737
  xe(o, "dietary"),
@@ -2740,7 +2740,7 @@ function rr(e) {
2740
2740
  n,
2741
2741
  !1
2742
2742
  );
2743
- if (k && g.push(k), ae(l, "pathology.codes")) {
2743
+ if (x && g.push(x), ae(l, "pathology.codes")) {
2744
2744
  const h = dt(o);
2745
2745
  g.push({
2746
2746
  id: "pathologies",
@@ -2769,11 +2769,11 @@ function rr(e) {
2769
2769
  }), re(h.stage) && y.push({
2770
2770
  cells: [n("anamnesis.field.stage.label"), re(h.stage)]
2771
2771
  }), h.metastases) {
2772
- const N = n(`anamnesis.common.${h.metastases.present}`), j = re(h.metastases.site);
2772
+ const A = n(`anamnesis.common.${h.metastases.present}`), j = re(h.metastases.site);
2773
2773
  y.push({
2774
2774
  cells: [
2775
2775
  n("anamnesis.field.metastases.label"),
2776
- j ? `${N} — ${j}` : N
2776
+ j ? `${A} — ${j}` : A
2777
2777
  ]
2778
2778
  });
2779
2779
  }
@@ -2840,16 +2840,16 @@ function rr(e) {
2840
2840
  }), ae(l, "annual.programme")) {
2841
2841
  const h = u.annualProgramme, y = [];
2842
2842
  if (h) {
2843
- const N = (j) => n(j ? "anamnesis.common.yes" : "anamnesis.common.no");
2843
+ const A = (j) => n(j ? "anamnesis.common.yes" : "anamnesis.common.no");
2844
2844
  y.push({
2845
2845
  cells: [
2846
2846
  n("anamnesis.field.annualProposed.label"),
2847
- N(h.proposed)
2847
+ A(h.proposed)
2848
2848
  ]
2849
2849
  }), y.push({
2850
2850
  cells: [
2851
2851
  n("anamnesis.field.annualAccepted.label"),
2852
- N(h.accepted)
2852
+ A(h.accepted)
2853
2853
  ]
2854
2854
  }), re(h.declineReason) && y.push({
2855
2855
  cells: [
@@ -2862,25 +2862,25 @@ function rr(e) {
2862
2862
  Ga("annual", n("anamnesis.section.annual"), y, n)
2863
2863
  );
2864
2864
  }
2865
- const A = [];
2866
- return ae(l, "notes.nutritionalProposal") && re(u.nutritionalProposal) && A.push({
2865
+ const T = [];
2866
+ return ae(l, "notes.nutritionalProposal") && re(u.nutritionalProposal) && T.push({
2867
2867
  cells: [
2868
2868
  n("anamnesis.field.nutritionalProposal.label"),
2869
2869
  re(u.nutritionalProposal)
2870
2870
  ]
2871
- }), ae(l, "notes.clinicalNotes") && re(u.clinicalNotes) && A.push({
2871
+ }), ae(l, "notes.clinicalNotes") && re(u.clinicalNotes) && T.push({
2872
2872
  cells: [
2873
2873
  n("anamnesis.field.clinicalNotes.label"),
2874
2874
  re(u.clinicalNotes)
2875
2875
  ]
2876
- }), A.length > 0 && g.push({
2876
+ }), T.length > 0 && g.push({
2877
2877
  id: "notes",
2878
2878
  title: n("anamnesis.section.proposal"),
2879
2879
  columns: [
2880
2880
  { key: "note", header: n("anamnesis.export.column.note") },
2881
2881
  { key: "text", header: n("anamnesis.export.column.text") }
2882
2882
  ],
2883
- rows: A,
2883
+ rows: T,
2884
2884
  emptyText: n("anamnesis.export.none")
2885
2885
  }), ja(
2886
2886
  {
@@ -2921,26 +2921,26 @@ function sr(e, a) {
2921
2921
  return t == null || n == null ? null : n - t;
2922
2922
  }
2923
2923
  function dr(e) {
2924
- var A;
2924
+ var T;
2925
2925
  const { record: a, audience: t, t: n, config: o } = e, r = e.generatedAtIso ?? (/* @__PURE__ */ new Date()).toISOString(), l = e.scope ?? "selected", s = { audience: t, withheld: /* @__PURE__ */ new Set() };
2926
2926
  if (!ae(s, Ma))
2927
2927
  return kt("evolution", t, n);
2928
- const { meta: d, patientName: u } = vt(a, s, n, r), g = [], b = [], m = e.selectedVisitIds ? [...e.selectedVisitIds] : null, v = m && m.length > 0 ? m : Si(a.visits), k = l === "all" ? _i(a.visits) : ht(a.visits, v).columns;
2928
+ const { meta: d, patientName: u } = vt(a, s, n, r), g = [], b = [], m = e.selectedVisitIds ? [...e.selectedVisitIds] : null, v = m && m.length > 0 ? m : Si(a.visits), x = l === "all" ? _i(a.visits) : ht(a.visits, v).columns;
2929
2929
  if (d.push({
2930
2930
  label: n("anamnesis.export.visitsLabel"),
2931
2931
  value: l === "all" ? n("anamnesis.export.visitsAll", { total: a.visits.length }) : n("anamnesis.export.visitsSelected", {
2932
- shown: k.length,
2932
+ shown: x.length,
2933
2933
  total: a.visits.length
2934
2934
  })
2935
- }), ae(s, "visit.date") && k.length > 0) {
2936
- const h = De(o), y = ci(a, h), N = be(k[0].visit.dateIso, n), j = be(k[k.length - 1].visit.dateIso, n), T = [
2935
+ }), ae(s, "visit.date") && x.length > 0) {
2936
+ const h = De(o), y = ci(a, h), A = be(x[0].visit.dateIso, n), j = be(x[x.length - 1].visit.dateIso, n), N = [
2937
2937
  { key: "parameter", header: n("anamnesis.grid.parameter") },
2938
2938
  { key: "unit", header: n("anamnesis.export.column.unit") },
2939
2939
  {
2940
2940
  key: "referenceRange",
2941
2941
  header: n("anamnesis.export.column.referenceRange")
2942
2942
  },
2943
- ...k.map((S) => ({
2943
+ ...x.map((S) => ({
2944
2944
  key: `visit-${S.visit.id}`,
2945
2945
  header: be(S.visit.dateIso, n),
2946
2946
  numeric: !0
@@ -2953,7 +2953,7 @@ function dr(e) {
2953
2953
  {
2954
2954
  key: "change",
2955
2955
  header: n("anamnesis.export.column.change", {
2956
- from: N,
2956
+ from: A,
2957
2957
  to: j
2958
2958
  }),
2959
2959
  numeric: !0
@@ -2968,24 +2968,24 @@ function dr(e) {
2968
2968
  qe(S.def, n),
2969
2969
  S.def.unit ?? null,
2970
2970
  Pi(S.def, n),
2971
- ...k.map((w) => {
2971
+ ...x.map((k) => {
2972
2972
  var C;
2973
- return ((C = S.cells[w.index]) == null ? void 0 : C.value) ?? null;
2973
+ return ((C = S.cells[k.index]) == null ? void 0 : C.value) ?? null;
2974
2974
  }),
2975
2975
  S.target,
2976
- sr(S, k),
2977
- lr(S, k, n)
2976
+ sr(S, x),
2977
+ lr(S, x, n)
2978
2978
  ]
2979
2979
  }));
2980
2980
  g.push({
2981
2981
  id: "matrix",
2982
2982
  title: n("anamnesis.section.evolution"),
2983
- columns: T,
2983
+ columns: N,
2984
2984
  rows: R,
2985
2985
  emptyText: n("anamnesis.export.none")
2986
2986
  });
2987
- } else k.length === 0 && b.push(n("anamnesis.export.none"));
2988
- const f = He((A = k[k.length - 1]) == null ? void 0 : A.visit.dateIso) ?? He(r);
2987
+ } else x.length === 0 && b.push(n("anamnesis.export.none"));
2988
+ const f = He((T = x[x.length - 1]) == null ? void 0 : T.visit.dateIso) ?? He(r);
2989
2989
  return ja(
2990
2990
  {
2991
2991
  tab: "evolution",
@@ -3028,9 +3028,9 @@ function Ot(e, a) {
3028
3028
  excluded: e.withheld.map((t) => ur(t, a)).sort((t, n) => t.localeCompare(n, e.locale))
3029
3029
  };
3030
3030
  }
3031
- const mr = "text/csv;charset=utf-8", pr = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", Mt = `\r
3032
- `, gr = /^[=+\-@\t\r]/;
3033
- function hr(e) {
3031
+ const mr = "text/csv;charset=utf-8", Mt = `\r
3032
+ `, pr = /^[=+\-@\t\r]/;
3033
+ function gr(e) {
3034
3034
  var a;
3035
3035
  if (!e) return ".";
3036
3036
  try {
@@ -3042,25 +3042,25 @@ function hr(e) {
3042
3042
  }
3043
3043
  }
3044
3044
  function wt(e) {
3045
- return hr(e) === "," ? { delimiter: ";", decimal: ",", eol: Mt, bom: !0 } : { delimiter: ",", decimal: ".", eol: Mt, bom: !0 };
3045
+ return gr(e) === "," ? { delimiter: ";", decimal: ",", eol: Mt, bom: !0 } : { delimiter: ",", decimal: ".", eol: Mt, bom: !0 };
3046
3046
  }
3047
- function br(e, a, t) {
3047
+ function hr(e, a, t) {
3048
3048
  if (!Number.isFinite(e)) return "";
3049
3049
  const n = a == null ? String(e) : e.toFixed(a);
3050
3050
  return t.decimal === "," ? n.replace(".", ",") : n;
3051
3051
  }
3052
3052
  function Re(e, a) {
3053
- const t = gr.test(e) ? `'${e}` : e;
3053
+ const t = pr.test(e) ? `'${e}` : e;
3054
3054
  return t.includes(a.delimiter) || t.includes('"') || t.includes(`
3055
3055
  `) || t.includes("\r") || t !== t.trim() ? `"${t.replace(/"/g, '""')}"` : t;
3056
3056
  }
3057
3057
  function Vt(e, a, t) {
3058
- return e == null ? "" : typeof e == "number" ? br(e, t, a) : Re(e, a);
3058
+ return e == null ? "" : typeof e == "number" ? hr(e, t, a) : Re(e, a);
3059
3059
  }
3060
3060
  function Fi(e, a) {
3061
3061
  return e.precision ?? (a == null ? void 0 : a.precision);
3062
3062
  }
3063
- function fr(e, a = wt(e.locale)) {
3063
+ function br(e, a = wt(e.locale)) {
3064
3064
  const t = [], n = (o) => t.push(o.join(a.delimiter));
3065
3065
  n([Re(e.title, a)]);
3066
3066
  for (const o of e.meta)
@@ -3095,14 +3095,10 @@ function fr(e, a = wt(e.locale)) {
3095
3095
  }
3096
3096
  return t.join(a.eol) + a.eol;
3097
3097
  }
3098
- function yr(e, a = wt(e.locale)) {
3099
- const t = fr(e, a);
3098
+ function fr(e, a = wt(e.locale)) {
3099
+ const t = br(e, a);
3100
3100
  return new Blob([a.bom ? `\uFEFF${t}` : t], { type: mr });
3101
3101
  }
3102
- async function vr() {
3103
- const e = await import("./exceljs.min-D2MHbJsF.js").then((t) => t.e), a = e;
3104
- return typeof a.Workbook == "function" ? e : a.default ?? e;
3105
- }
3106
3102
  function Ht(e, a) {
3107
3103
  const t = e.replace(/[\\/?*[\]:]/g, " ").trim().slice(0, 31);
3108
3104
  let n = t || "Sheet", o = 2;
@@ -3112,57 +3108,69 @@ function Ht(e, a) {
3112
3108
  }
3113
3109
  return a.add(n.toLowerCase()), n;
3114
3110
  }
3115
- function kr(e) {
3111
+ function yr(e) {
3116
3112
  if (e != null)
3117
3113
  return e > 0 ? `0.${"0".repeat(e)}` : "0";
3118
3114
  }
3119
- const wr = 12, zr = 60;
3120
- function xr(e, a) {
3115
+ const vr = 12, kr = 60;
3116
+ function wr(e, a) {
3121
3117
  const t = a.reduce(
3122
3118
  (n, o) => Math.max(n, o == null ? 0 : String(o).length),
3123
3119
  e.length
3124
3120
  );
3125
- return Math.min(zr, Math.max(wr, t + 2));
3121
+ return Math.min(kr, Math.max(vr, t + 2));
3126
3122
  }
3127
- async function Ar(e) {
3128
- const a = await vr(), t = new a.Workbook();
3129
- t.created = /* @__PURE__ */ new Date();
3130
- const n = /* @__PURE__ */ new Set(), o = t.addWorksheet(Ht(e.title, n)), r = o.addRow([e.title]);
3131
- r.font = { bold: !0 };
3132
- for (const s of e.meta) o.addRow([s.label, s.value]);
3123
+ async function zr(e) {
3124
+ const { default: a } = await import("./index-CpVcVNBu.js"), t = /* @__PURE__ */ new Set(), n = (l) => l == null ? null : { value: l, fontWeight: "bold" }, o = [[n(e.title)]];
3125
+ for (const l of e.meta) o.push([l.label, l.value]);
3133
3126
  if (e.footnotes.length > 0) {
3134
- o.addRow([]);
3135
- for (const s of e.footnotes) o.addRow([s]);
3127
+ o.push([null]);
3128
+ for (const l of e.footnotes) o.push([l]);
3136
3129
  }
3137
- o.getColumn(1).width = 28, o.getColumn(2).width = 48;
3138
- for (const s of e.tables) {
3139
- const d = t.addWorksheet(Ht(s.title, n)), u = d.addRow(
3140
- s.columns.map((g) => g.header)
3141
- );
3142
- u.font = { bold: !0 }, d.views = [{ state: "frozen", ySplit: 1 }], s.rows.length === 0 && s.emptyText && d.addRow([s.emptyText]);
3143
- for (const g of s.rows) {
3144
- if (g.kind === "section") {
3145
- const v = d.addRow([g.cells[0] ?? null]);
3146
- v.font = { bold: !0 };
3130
+ const r = [
3131
+ {
3132
+ data: o,
3133
+ sheet: Ht(e.title, t),
3134
+ columns: [{ width: 28 }, { width: 48 }]
3135
+ }
3136
+ ];
3137
+ for (const l of e.tables) {
3138
+ const s = [
3139
+ l.columns.map((d) => n(d.header))
3140
+ ];
3141
+ l.rows.length === 0 && l.emptyText && s.push([l.emptyText]);
3142
+ for (const d of l.rows) {
3143
+ if (d.kind === "section") {
3144
+ s.push([n(d.cells[0] ?? null)]);
3147
3145
  continue;
3148
3146
  }
3149
- const b = s.columns.map((v, k) => g.cells[k] ?? null), m = d.addRow(b);
3150
- s.columns.forEach((v, k) => {
3151
- const f = m.getCell(k + 1);
3152
- if (typeof b[k] != "number") return;
3153
- const A = kr(Fi(g, v));
3154
- A && (f.numFmt = A), f.alignment = { horizontal: "right" };
3155
- });
3156
- }
3157
- s.columns.forEach((g, b) => {
3158
- d.getColumn(b + 1).width = xr(
3159
- g.header,
3160
- s.rows.map((m) => m.cells[b] ?? null)
3147
+ s.push(
3148
+ l.columns.map((u, g) => {
3149
+ const b = d.cells[g] ?? null;
3150
+ if (typeof b != "number") return b;
3151
+ const m = yr(Fi(d, u));
3152
+ return {
3153
+ value: b,
3154
+ type: Number,
3155
+ align: "right",
3156
+ ...m ? { format: m } : {}
3157
+ };
3158
+ })
3161
3159
  );
3160
+ }
3161
+ r.push({
3162
+ data: s,
3163
+ sheet: Ht(l.title, t),
3164
+ stickyRowsCount: 1,
3165
+ columns: l.columns.map((d, u) => ({
3166
+ width: wr(
3167
+ d.header,
3168
+ l.rows.map((g) => g.cells[u] ?? null)
3169
+ )
3170
+ }))
3162
3171
  });
3163
3172
  }
3164
- const l = await t.xlsx.writeBuffer();
3165
- return new Blob([l], { type: pr });
3173
+ return a(r).toBlob();
3166
3174
  }
3167
3175
  function zt(e, a) {
3168
3176
  return `${e.fileStem}.${a}`;
@@ -3173,11 +3181,11 @@ function xt(e, a) {
3173
3181
  const t = URL.createObjectURL(e), n = document.createElement("a");
3174
3182
  return n.href = t, n.download = a, document.body.appendChild(n), n.click(), n.remove(), window.setTimeout(() => URL.revokeObjectURL(t), 0), !0;
3175
3183
  }
3176
- function Nr(e, a = wt(e.locale)) {
3177
- return xt(yr(e, a), zt(e, "csv"));
3184
+ function xr(e, a = wt(e.locale)) {
3185
+ return xt(fr(e, a), zt(e, "csv"));
3178
3186
  }
3179
- async function Tr(e) {
3180
- return xt(await Ar(e), zt(e, "xlsx"));
3187
+ async function Ar(e) {
3188
+ return xt(await zr(e), zt(e, "xlsx"));
3181
3189
  }
3182
3190
  const Ge = {
3183
3191
  headerFill: [237, 237, 240],
@@ -3202,7 +3210,7 @@ function ta(e, a, t) {
3202
3210
  const s = l.match(/rgba?\(\s*(\d+)[,\s]+(\d+)[,\s]+(\d+)/i);
3203
3211
  return s ? [Number(s[1]), Number(s[2]), Number(s[3])] : a;
3204
3212
  }
3205
- function Cr(e) {
3213
+ function Nr(e) {
3206
3214
  return {
3207
3215
  headerFill: ta("--muted", Ge.headerFill, e),
3208
3216
  headerText: ta("--foreground", Ge.headerText, e),
@@ -3220,7 +3228,7 @@ function Cr(e) {
3220
3228
  sectionFill: ta("--muted", Ge.sectionFill, e)
3221
3229
  };
3222
3230
  }
3223
- const Sr = [
3231
+ const Tr = [
3224
3232
  ["→", "->"],
3225
3233
  // → the Evolution change header
3226
3234
  ["←", "<-"],
@@ -3289,17 +3297,17 @@ new Set(
3289
3297
  );
3290
3298
  function Oe(e) {
3291
3299
  let a = e;
3292
- for (const [t, n] of Sr)
3300
+ for (const [t, n] of Tr)
3293
3301
  a.includes(t) && (a = a.split(t).join(n));
3294
3302
  return a;
3295
3303
  }
3296
- const oe = 14, _r = 6, Dr = 15, jr = 9, Pr = 11, Bt = 8.5, qt = 8, Fe = 5;
3297
- function Er(e) {
3304
+ const oe = 14, Cr = 6, Sr = 15, _r = 9, Dr = 11, Bt = 8.5, qt = 8, Fe = 5;
3305
+ function jr(e) {
3298
3306
  return e.tables.some(
3299
- (a) => a.columns.length > _r
3307
+ (a) => a.columns.length > Cr
3300
3308
  );
3301
3309
  }
3302
- function Lr(e, a, t) {
3310
+ function Pr(e, a, t) {
3303
3311
  if (!Number.isFinite(e)) return "";
3304
3312
  try {
3305
3313
  return new Intl.NumberFormat(
@@ -3315,10 +3323,10 @@ function Lr(e, a, t) {
3315
3323
  }
3316
3324
  function Ii(e, a, t) {
3317
3325
  return e == null ? "" : Oe(
3318
- typeof e == "number" ? Lr(e, a, t) : e
3326
+ typeof e == "number" ? Pr(e, a, t) : e
3319
3327
  );
3320
3328
  }
3321
- function Fr(e, a, t) {
3329
+ function Er(e, a, t) {
3322
3330
  return a.columns.map(
3323
3331
  (n, o) => Ii(
3324
3332
  e.cells[o] ?? null,
@@ -3328,36 +3336,36 @@ function Fr(e, a, t) {
3328
3336
  );
3329
3337
  }
3330
3338
  async function Ri(e, a = {}) {
3331
- var k;
3339
+ var x;
3332
3340
  const [{ jsPDF: t }, { default: n }] = await Promise.all([
3333
- import("./jspdf.es.min-DaapWjR1.js").then((f) => f.j),
3341
+ import("./jspdf.es.min-BW7y6yhl.js").then((f) => f.j),
3334
3342
  import("./jspdf.plugin.autotable-CSiDNyPn.js")
3335
3343
  ]), o = a.palette ?? Ge, r = e.locale, l = new t({
3336
- orientation: Er(e) ? "landscape" : "portrait",
3344
+ orientation: jr(e) ? "landscape" : "portrait",
3337
3345
  unit: "mm",
3338
3346
  format: "a4"
3339
- }), s = l.internal.pageSize.getWidth(), d = l.internal.pageSize.getHeight(), u = s - oe * 2, g = (f, A, h) => {
3340
- l.setFont("helvetica", f), l.setFontSize(A), l.setTextColor(h[0], h[1], h[2]);
3347
+ }), s = l.internal.pageSize.getWidth(), d = l.internal.pageSize.getHeight(), u = s - oe * 2, g = (f, T, h) => {
3348
+ l.setFont("helvetica", f), l.setFontSize(T), l.setTextColor(h[0], h[1], h[2]);
3341
3349
  };
3342
3350
  let b = oe;
3343
- g("bold", Dr, o.headerText);
3351
+ g("bold", Sr, o.headerText);
3344
3352
  for (const f of l.splitTextToSize(
3345
3353
  Oe(e.title),
3346
3354
  u
3347
3355
  ))
3348
3356
  l.text(f, oe, b), b += Fe + 1;
3349
- b += 1, g("normal", jr, o.mutedText);
3357
+ b += 1, g("normal", _r, o.mutedText);
3350
3358
  for (const f of e.meta)
3351
3359
  l.text(Oe(`${f.label}: ${f.value}`), oe, b), b += Fe - 0.6;
3352
3360
  for (const f of e.tables) {
3353
- if (b += Fe, b > d - oe * 2 && (l.addPage(), b = oe), g("bold", Pr, o.headerText), l.text(Oe(f.title), oe, b), b += 2, f.rows.length === 0 && f.emptyText) {
3361
+ if (b += Fe, b > d - oe * 2 && (l.addPage(), b = oe), g("bold", Dr, o.headerText), l.text(Oe(f.title), oe, b), b += 2, f.rows.length === 0 && f.emptyText) {
3354
3362
  b += Fe, g("normal", Bt, o.mutedText), l.text(Oe(f.emptyText), oe, b), b += 1;
3355
3363
  continue;
3356
3364
  }
3357
- const A = /* @__PURE__ */ new Set(), h = f.rows.map((j, T) => j.kind === "section" ? (A.add(T), [
3365
+ const T = /* @__PURE__ */ new Set(), h = f.rows.map((j, N) => j.kind === "section" ? (T.add(N), [
3358
3366
  Ii(j.cells[0] ?? null, void 0, r),
3359
3367
  ...f.columns.slice(1).map(() => "")
3360
- ]) : Fr(j, f, r)), y = {}, N = {
3368
+ ]) : Er(j, f, r)), y = {}, A = {
3361
3369
  head: [f.columns.map((j) => Oe(j.header))],
3362
3370
  body: h,
3363
3371
  startY: b + 2,
@@ -3379,25 +3387,25 @@ async function Ri(e, a = {}) {
3379
3387
  },
3380
3388
  alternateRowStyles: { fillColor: o.zebraFill },
3381
3389
  columnStyles: Object.fromEntries(
3382
- f.columns.map((j, T) => [
3383
- T,
3390
+ f.columns.map((j, N) => [
3391
+ N,
3384
3392
  j.numeric ? { halign: "right" } : {}
3385
3393
  ])
3386
3394
  ),
3387
3395
  didParseCell: (j) => {
3388
- j.section === "body" && A.has(j.row.index) && (j.cell.styles.fillColor = o.sectionFill, j.cell.styles.textColor = o.headerText, j.cell.styles.fontStyle = "bold");
3396
+ j.section === "body" && T.has(j.row.index) && (j.cell.styles.fillColor = o.sectionFill, j.cell.styles.textColor = o.headerText, j.cell.styles.fontStyle = "bold");
3389
3397
  },
3390
3398
  didDrawPage: (j) => {
3391
3399
  y.table = j.table;
3392
3400
  }
3393
3401
  };
3394
- n(l, N), b = ((k = y.table) == null ? void 0 : k.finalY) ?? b + Fe;
3402
+ n(l, A), b = ((x = y.table) == null ? void 0 : x.finalY) ?? b + Fe;
3395
3403
  }
3396
3404
  if (e.footnotes.length > 0) {
3397
3405
  b += Fe + 1, b > d - oe * 2 && (l.addPage(), b = oe), g("normal", qt, o.mutedText);
3398
3406
  for (const f of e.footnotes)
3399
- for (const A of l.splitTextToSize(Oe(f), u))
3400
- l.text(A, oe, b), b += Fe - 1;
3407
+ for (const T of l.splitTextToSize(Oe(f), u))
3408
+ l.text(T, oe, b), b += Fe - 1;
3401
3409
  }
3402
3410
  const m = Oe(
3403
3411
  [e.patientName, e.audienceLabel].filter(Boolean).join(" · ")
@@ -3411,13 +3419,13 @@ async function Ri(e, a = {}) {
3411
3419
  );
3412
3420
  return a.autoPrint && l.autoPrint(), l.output("blob");
3413
3421
  }
3414
- async function Ir(e, a = {}) {
3422
+ async function Lr(e, a = {}) {
3415
3423
  return xt(
3416
3424
  await Ri(e, a),
3417
3425
  zt(e, "pdf")
3418
3426
  );
3419
3427
  }
3420
- async function Rr(e, a, t = {}) {
3428
+ async function Fr(e, a, t = {}) {
3421
3429
  if (!a || typeof URL > "u" || typeof URL.createObjectURL != "function")
3422
3430
  return null;
3423
3431
  const n = await Ri(e, { ...t, autoPrint: !0 }), o = URL.createObjectURL(n);
@@ -3434,14 +3442,14 @@ function At({
3434
3442
  defaultShareOpen: l = !1,
3435
3443
  defaultAudience: s = "clinician"
3436
3444
  }) {
3437
- const [d, u] = I(s), [g, b] = I(!1), [m, v] = I(r), [k, f] = I(l), [A, h] = I(s), [y, N] = I({ text: "", seq: 0 }), j = _e(null), T = _e(null), R = _e(null), p = _e(!1), S = oa();
3445
+ const [d, u] = I(s), [g, b] = I(!1), [m, v] = I(r), [x, f] = I(l), [T, h] = I(s), [y, A] = I({ text: "", seq: 0 }), j = _e(null), N = _e(null), R = _e(null), p = _e(!1), S = oa();
3438
3446
  ba(
3439
3447
  () => () => {
3440
3448
  R.current && URL.revokeObjectURL(R.current);
3441
3449
  },
3442
3450
  []
3443
3451
  );
3444
- const w = Qe(
3452
+ const k = Qe(
3445
3453
  (K) => cr(e, {
3446
3454
  record: a,
3447
3455
  audience: K,
@@ -3452,8 +3460,8 @@ function At({
3452
3460
  }),
3453
3461
  [e, a, t, n, o, g]
3454
3462
  ), C = t(`anamnesis.export.tab.${e}`), F = t("anamnesis.export.control.audienceBadge"), O = H(
3455
- () => m ? Ot(w("patient"), t).excluded : [],
3456
- [m, w, t]
3463
+ () => m ? Ot(k("patient"), t).excluded : [],
3464
+ [m, k, t]
3457
3465
  ), D = {
3458
3466
  clinician: O.length > 0 ? t("anamnesis.export.control.holds", {
3459
3467
  list: O.join(t("anamnesis.export.listSeparator"))
@@ -3462,12 +3470,12 @@ function At({
3462
3470
  list: O.join(t("anamnesis.export.listSeparator"))
3463
3471
  }) : t("anamnesis.export.control.excludesNone")
3464
3472
  }, q = H(
3465
- () => k ? Ot(w(A), t) : { included: [], excluded: [] },
3466
- [k, w, A, t]
3467
- ), $ = (K) => N((se) => ({ text: K, seq: se.seq + 1 })), V = (K, se) => {
3473
+ () => x ? Ot(k(T), t) : { included: [], excluded: [] },
3474
+ [x, k, T, t]
3475
+ ), $ = (K) => A((se) => ({ text: K, seq: se.seq + 1 })), V = (K, se) => {
3468
3476
  if (p.current) return;
3469
3477
  p.current = !0;
3470
- const ce = w(d);
3478
+ const ce = k(d);
3471
3479
  Promise.resolve(se(ce)).then(
3472
3480
  (ue) => $(
3473
3481
  ue ? t("anamnesis.export.control.ready", {
@@ -3477,8 +3485,8 @@ function At({
3477
3485
  ).catch(() => $(t("anamnesis.export.control.failed"))).finally(() => {
3478
3486
  p.current = !1;
3479
3487
  });
3480
- }, P = () => Cr(j.current), G = () => V("pdf", (K) => Ir(K, { palette: P() })), Z = () => V("xlsx", Tr), J = () => V("csv", Nr), me = () => {
3481
- p.current || (p.current = !0, Rr(w(d), T.current, { palette: P() }).then((K) => {
3488
+ }, P = () => Nr(j.current), G = () => V("pdf", (K) => Lr(K, { palette: P() })), Z = () => V("xlsx", Ar), J = () => V("csv", xr), me = () => {
3489
+ p.current || (p.current = !0, Fr(k(d), N.current, { palette: P() }).then((K) => {
3482
3490
  if (!K) {
3483
3491
  $(t("anamnesis.export.control.failed"));
3484
3492
  return;
@@ -3490,9 +3498,9 @@ function At({
3490
3498
  }, he = () => {
3491
3499
  h(d), f(!0);
3492
3500
  }, _ = () => {
3493
- u(A), f(!1), $(
3501
+ u(T), f(!1), $(
3494
3502
  t("anamnesis.export.share.confirmed", {
3495
- audience: t(`anamnesis.export.audience.${A}`)
3503
+ audience: t(`anamnesis.export.audience.${T}`)
3496
3504
  })
3497
3505
  );
3498
3506
  };
@@ -3627,11 +3635,11 @@ function At({
3627
3635
  }
3628
3636
  ),
3629
3637
  /* @__PURE__ */ i(
3630
- Or,
3638
+ Ir,
3631
3639
  {
3632
- open: k,
3640
+ open: x,
3633
3641
  onOpenChange: f,
3634
- audience: A,
3642
+ audience: T,
3635
3643
  onAudienceChange: h,
3636
3644
  preview: q,
3637
3645
  onConfirm: _,
@@ -3642,7 +3650,7 @@ function At({
3642
3650
  /* @__PURE__ */ i(
3643
3651
  "iframe",
3644
3652
  {
3645
- ref: T,
3653
+ ref: N,
3646
3654
  title: t("anamnesis.export.control.printFrame"),
3647
3655
  "aria-hidden": "true",
3648
3656
  tabIndex: -1,
@@ -3663,7 +3671,7 @@ function At({
3663
3671
  }
3664
3672
  );
3665
3673
  }
3666
- function Or({
3674
+ function Ir({
3667
3675
  open: e,
3668
3676
  onOpenChange: a,
3669
3677
  audience: t,
@@ -3768,17 +3776,17 @@ function Oi(e, a) {
3768
3776
  return !1;
3769
3777
  }
3770
3778
  }
3771
- function Mr(e) {
3779
+ function Rr(e) {
3772
3780
  if (!e) return;
3773
3781
  const [a, t] = e.split(":").map((n) => Number.parseInt(n, 10));
3774
3782
  if (!(Number.isNaN(a) || Number.isNaN(t)))
3775
3783
  return { hours: a, minutes: t };
3776
3784
  }
3777
- function Vr(e) {
3785
+ function Or(e) {
3778
3786
  const a = (t) => String(t).padStart(2, "0");
3779
3787
  return `${a(e.hours)}:${a(e.minutes)}`;
3780
3788
  }
3781
- function Hr(e, a) {
3789
+ function Mr(e, a) {
3782
3790
  if (e.detail !== !0) return !1;
3783
3791
  switch (e.type) {
3784
3792
  case "yesNoDetail":
@@ -3791,8 +3799,8 @@ function Hr(e, a) {
3791
3799
  return !1;
3792
3800
  }
3793
3801
  }
3794
- const Br = "ds:sr-only", qr = "ds:aspect-square ds:justify-center ds:px-0", Kr = "ds:mt-[var(--spacing-2xs)]", Gr = /* @__PURE__ */ new Set(["weightSelf", "waterPerDay"]), Ie = "ds:w-full ds:max-w-[44rem]";
3795
- function Ur(e) {
3802
+ const Vr = "ds:sr-only", Hr = "ds:aspect-square ds:justify-center ds:px-0", Br = "ds:mt-[var(--spacing-2xs)]", qr = /* @__PURE__ */ new Set(["weightSelf", "waterPerDay"]), Ie = "ds:w-full ds:max-w-[44rem]";
3803
+ function Kr(e) {
3796
3804
  return e.max !== void 0 && e.max >= 1e4 ? "md" : "sm";
3797
3805
  }
3798
3806
  function Mi({
@@ -3810,28 +3818,28 @@ function Mi({
3810
3818
  {
3811
3819
  variant: "accentSoft",
3812
3820
  size: "sm",
3813
- className: `${Kr} ${qr}`,
3821
+ className: `${Br} ${Hr}`,
3814
3822
  leading: /* @__PURE__ */ i(xn, { "aria-hidden": "true" }),
3815
- children: /* @__PURE__ */ i("span", { className: Br, children: m })
3823
+ children: /* @__PURE__ */ i("span", { className: Vr, children: m })
3816
3824
  }
3817
- ) }) : void 0, k = g ? /* @__PURE__ */ i(bi, { t: s }) : void 0;
3825
+ ) }) : void 0, x = g ? /* @__PURE__ */ i(bi, { t: s }) : void 0;
3818
3826
  let f = null;
3819
3827
  switch (e.type) {
3820
3828
  case "text": {
3821
- const A = (a == null ? void 0 : a.kind) === "text" ? a.text : "";
3829
+ const T = (a == null ? void 0 : a.kind) === "text" ? a.text : "";
3822
3830
  f = /* @__PURE__ */ i(
3823
3831
  M,
3824
3832
  {
3825
3833
  label: d,
3826
3834
  labelStart: v,
3827
- labelEnd: k,
3835
+ labelEnd: x,
3828
3836
  description: u,
3829
3837
  children: /* @__PURE__ */ i(
3830
3838
  te,
3831
3839
  {
3832
3840
  className: Ie,
3833
3841
  disabled: r,
3834
- value: A,
3842
+ value: T,
3835
3843
  onChange: (h) => t({ kind: "text", text: h.target.value })
3836
3844
  }
3837
3845
  )
@@ -3840,19 +3848,19 @@ function Mi({
3840
3848
  break;
3841
3849
  }
3842
3850
  case "textarea": {
3843
- const A = (a == null ? void 0 : a.kind) === "text" ? a.text : "";
3851
+ const T = (a == null ? void 0 : a.kind) === "text" ? a.text : "";
3844
3852
  f = /* @__PURE__ */ i(
3845
3853
  M,
3846
3854
  {
3847
3855
  label: d,
3848
3856
  labelStart: v,
3849
- labelEnd: k,
3857
+ labelEnd: x,
3850
3858
  description: u,
3851
3859
  children: /* @__PURE__ */ i(
3852
3860
  na,
3853
3861
  {
3854
3862
  disabled: r,
3855
- value: A,
3863
+ value: T,
3856
3864
  autoResize: !0,
3857
3865
  minRows: 2,
3858
3866
  className: Ie,
@@ -3864,24 +3872,24 @@ function Mi({
3864
3872
  break;
3865
3873
  }
3866
3874
  case "number": {
3867
- const A = (a == null ? void 0 : a.kind) === "number" ? a.value : null;
3875
+ const T = (a == null ? void 0 : a.kind) === "number" ? a.value : null;
3868
3876
  f = /* @__PURE__ */ i(
3869
3877
  M,
3870
3878
  {
3871
3879
  label: d,
3872
3880
  labelStart: v,
3873
- labelEnd: k,
3881
+ labelEnd: x,
3874
3882
  description: u,
3875
3883
  children: /* @__PURE__ */ i(
3876
3884
  ga,
3877
3885
  {
3878
3886
  disabled: r,
3879
- value: A,
3887
+ value: T,
3880
3888
  min: 0,
3881
3889
  variant: "plain",
3882
3890
  unit: e.unit,
3883
- inline: Ur(e),
3884
- mode: e.decimal || Gr.has(e.key) ? "decimal" : "integer",
3891
+ inline: Kr(e),
3892
+ mode: e.decimal || qr.has(e.key) ? "decimal" : "integer",
3885
3893
  onChange: (h) => t({ kind: "number", value: h })
3886
3894
  }
3887
3895
  )
@@ -3890,20 +3898,20 @@ function Mi({
3890
3898
  break;
3891
3899
  }
3892
3900
  case "frequency": {
3893
- const A = (a == null ? void 0 : a.kind) === "frequency" ? a.perWeek : null, h = (a == null ? void 0 : a.kind) === "frequency" ? a.detail ?? "" : "";
3901
+ const T = (a == null ? void 0 : a.kind) === "frequency" ? a.perWeek : null, h = (a == null ? void 0 : a.kind) === "frequency" ? a.detail ?? "" : "";
3894
3902
  f = /* @__PURE__ */ c("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
3895
3903
  /* @__PURE__ */ i(
3896
3904
  M,
3897
3905
  {
3898
3906
  label: d,
3899
3907
  labelStart: v,
3900
- labelEnd: k,
3908
+ labelEnd: x,
3901
3909
  description: u,
3902
3910
  children: /* @__PURE__ */ i(
3903
3911
  ga,
3904
3912
  {
3905
3913
  disabled: r,
3906
- value: A,
3914
+ value: T,
3907
3915
  min: 0,
3908
3916
  max: 21,
3909
3917
  variant: "plain",
@@ -3926,7 +3934,7 @@ function Mi({
3926
3934
  value: h,
3927
3935
  onChange: (y) => t({
3928
3936
  kind: "frequency",
3929
- perWeek: A,
3937
+ perWeek: T,
3930
3938
  detail: y.target.value || void 0
3931
3939
  })
3932
3940
  }
@@ -3935,7 +3943,7 @@ function Mi({
3935
3943
  break;
3936
3944
  }
3937
3945
  case "yesNoDetail": {
3938
- const A = (a == null ? void 0 : a.kind) === "yesNo" ? a.present : "unknown", h = (a == null ? void 0 : a.kind) === "yesNo" ? a.detail ?? "" : "";
3946
+ const T = (a == null ? void 0 : a.kind) === "yesNo" ? a.present : "unknown", h = (a == null ? void 0 : a.kind) === "yesNo" ? a.detail ?? "" : "";
3939
3947
  f = /* @__PURE__ */ c("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
3940
3948
  /* @__PURE__ */ c(
3941
3949
  ma,
@@ -3943,10 +3951,10 @@ function Mi({
3943
3951
  disabled: r,
3944
3952
  label: d,
3945
3953
  labelStart: v,
3946
- labelEnd: k,
3954
+ labelEnd: x,
3947
3955
  description: u,
3948
3956
  variant: "horizontal",
3949
- value: A,
3957
+ value: T,
3950
3958
  onValueChange: (y) => t({
3951
3959
  kind: "yesNo",
3952
3960
  present: y,
@@ -3980,7 +3988,7 @@ function Mi({
3980
3988
  ]
3981
3989
  }
3982
3990
  ),
3983
- Hr(e, a) ? /* @__PURE__ */ i(M, { label: s("anamnesis.common.details"), children: /* @__PURE__ */ i(
3991
+ Mr(e, a) ? /* @__PURE__ */ i(M, { label: s("anamnesis.common.details"), children: /* @__PURE__ */ i(
3984
3992
  te,
3985
3993
  {
3986
3994
  className: Ie,
@@ -3988,7 +3996,7 @@ function Mi({
3988
3996
  value: h,
3989
3997
  onChange: (y) => t({
3990
3998
  kind: "yesNo",
3991
- present: A,
3999
+ present: T,
3992
4000
  detail: y.target.value || void 0
3993
4001
  })
3994
4002
  }
@@ -4010,12 +4018,12 @@ function Mi({
4010
4018
  break;
4011
4019
  }
4012
4020
  case "choice": {
4013
- const A = (a == null ? void 0 : a.kind) === "choice" ? a.selected ?? "" : "", h = (a == null ? void 0 : a.kind) === "choice" ? a.detail ?? "" : "", y = (e.options ?? []).map((N) => ({
4014
- value: N,
4021
+ const T = (a == null ? void 0 : a.kind) === "choice" ? a.selected ?? "" : "", h = (a == null ? void 0 : a.kind) === "choice" ? a.detail ?? "" : "", y = (e.options ?? []).map((A) => ({
4022
+ value: A,
4015
4023
  // A practice-added option has no kit translation; show it verbatim
4016
4024
  // rather than the unresolved key.
4017
- label: s(`anamnesis.field.${e.key}.option.${N}`, {
4018
- defaultValue: N
4025
+ label: s(`anamnesis.field.${e.key}.option.${A}`, {
4026
+ defaultValue: A
4019
4027
  })
4020
4028
  }));
4021
4029
  f = /* @__PURE__ */ c("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
@@ -4024,7 +4032,7 @@ function Mi({
4024
4032
  {
4025
4033
  label: d,
4026
4034
  labelStart: v,
4027
- labelEnd: k,
4035
+ labelEnd: x,
4028
4036
  description: u,
4029
4037
  children: /* @__PURE__ */ i(
4030
4038
  Me,
@@ -4032,27 +4040,27 @@ function Mi({
4032
4040
  className: Ie,
4033
4041
  disabled: r,
4034
4042
  options: y,
4035
- value: A,
4043
+ value: T,
4036
4044
  placeholder: s("anamnesis.common.choose"),
4037
- onValueChange: (N) => t({
4045
+ onValueChange: (A) => t({
4038
4046
  kind: "choice",
4039
- selected: N || null,
4047
+ selected: A || null,
4040
4048
  detail: h || void 0
4041
4049
  })
4042
4050
  }
4043
4051
  )
4044
4052
  }
4045
4053
  ),
4046
- e.detail && A ? /* @__PURE__ */ i(M, { label: s("anamnesis.common.details"), children: /* @__PURE__ */ i(
4054
+ e.detail && T ? /* @__PURE__ */ i(M, { label: s("anamnesis.common.details"), children: /* @__PURE__ */ i(
4047
4055
  te,
4048
4056
  {
4049
4057
  className: Ie,
4050
4058
  disabled: r,
4051
4059
  value: h,
4052
- onChange: (N) => t({
4060
+ onChange: (A) => t({
4053
4061
  kind: "choice",
4054
- selected: A,
4055
- detail: N.target.value || void 0
4062
+ selected: T,
4063
+ detail: A.target.value || void 0
4056
4064
  })
4057
4065
  }
4058
4066
  ) }) : null
@@ -4060,17 +4068,17 @@ function Mi({
4060
4068
  break;
4061
4069
  }
4062
4070
  case "multiChoice": {
4063
- const A = (a == null ? void 0 : a.kind) === "multiChoice" ? a.selected : [], h = (y) => t({
4071
+ const T = (a == null ? void 0 : a.kind) === "multiChoice" ? a.selected : [], h = (y) => t({
4064
4072
  kind: "multiChoice",
4065
- selected: A.includes(y) ? A.filter((N) => N !== y) : [...A, y]
4073
+ selected: T.includes(y) ? T.filter((A) => A !== y) : [...T, y]
4066
4074
  });
4067
4075
  f = /* @__PURE__ */ c("fieldset", { className: "ds:m-0 ds:border-0 ds:p-0", children: [
4068
4076
  /* @__PURE__ */ i("legend", { className: "type-label ds:mb-[var(--spacing-2xs)] ds:w-full ds:text-[color:var(--foreground)]", children: /* @__PURE__ */ c("span", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
4069
4077
  v,
4070
4078
  v ? " " : null,
4071
4079
  /* @__PURE__ */ i("span", { children: d }),
4072
- k ? " " : null,
4073
- k ? /* @__PURE__ */ i("span", { className: "ds:ms-auto ds:inline-flex ds:shrink-0 ds:items-center", children: k }) : null
4080
+ x ? " " : null,
4081
+ x ? /* @__PURE__ */ i("span", { className: "ds:ms-auto ds:inline-flex ds:shrink-0 ds:items-center", children: x }) : null
4074
4082
  ] }) }),
4075
4083
  u ? /* @__PURE__ */ i("p", { className: "type-body-sm ds:m-0 ds:mb-[var(--spacing-xs)] ds:text-[color:var(--muted-foreground)]", children: u }) : null,
4076
4084
  /* @__PURE__ */ i("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: (e.options ?? []).map((y) => /* @__PURE__ */ i(
@@ -4080,7 +4088,7 @@ function Mi({
4080
4088
  label: s(`anamnesis.field.${e.key}.option.${y}`, {
4081
4089
  defaultValue: y
4082
4090
  }),
4083
- checked: A.includes(y),
4091
+ checked: T.includes(y),
4084
4092
  onCheckedChange: () => h(y)
4085
4093
  },
4086
4094
  y
@@ -4089,24 +4097,24 @@ function Mi({
4089
4097
  break;
4090
4098
  }
4091
4099
  case "meal": {
4092
- const A = (a == null ? void 0 : a.kind) === "meal" ? a.time : "", h = (a == null ? void 0 : a.kind) === "meal" ? a.description : "";
4100
+ const T = (a == null ? void 0 : a.kind) === "meal" ? a.time : "", h = (a == null ? void 0 : a.kind) === "meal" ? a.description : "";
4093
4101
  f = /* @__PURE__ */ c("fieldset", { className: "ds:m-0 ds:border-0 ds:p-0", children: [
4094
4102
  /* @__PURE__ */ i("legend", { className: "type-label ds:mb-[var(--spacing-2xs)] ds:w-full ds:text-[color:var(--foreground)]", children: /* @__PURE__ */ c("span", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
4095
4103
  v,
4096
4104
  v ? " " : null,
4097
4105
  /* @__PURE__ */ i("span", { children: d }),
4098
- k ? " " : null,
4099
- k ? /* @__PURE__ */ i("span", { className: "ds:ms-auto ds:inline-flex ds:shrink-0 ds:items-center", children: k }) : null
4106
+ x ? " " : null,
4107
+ x ? /* @__PURE__ */ i("span", { className: "ds:ms-auto ds:inline-flex ds:shrink-0 ds:items-center", children: x }) : null
4100
4108
  ] }) }),
4101
4109
  /* @__PURE__ */ c("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:sm:flex-row ds:sm:items-start", children: [
4102
4110
  /* @__PURE__ */ i(M, { label: s("anamnesis.common.time"), children: /* @__PURE__ */ i(
4103
4111
  zn,
4104
4112
  {
4105
4113
  disabled: r,
4106
- value: Mr(A),
4114
+ value: Rr(T),
4107
4115
  onChange: (y) => t({
4108
4116
  kind: "meal",
4109
- time: Vr(y),
4117
+ time: Or(y),
4110
4118
  description: h
4111
4119
  })
4112
4120
  }
@@ -4119,7 +4127,7 @@ function Mi({
4119
4127
  value: h,
4120
4128
  onChange: (y) => t({
4121
4129
  kind: "meal",
4122
- time: A,
4130
+ time: T,
4123
4131
  description: y.target.value
4124
4132
  })
4125
4133
  }
@@ -4142,7 +4150,7 @@ function Mi({
4142
4150
  function Vi(e) {
4143
4151
  return xe(e).filter((a) => a.goal === !0);
4144
4152
  }
4145
- const Wr = {
4153
+ const Gr = {
4146
4154
  // ±2% of goal weight (≈1.2 kg at 62 kg) is the day-to-day hydration and
4147
4155
  // gut-content swing — indistinguishable from being at target. 10% is the
4148
4156
  // clinically meaningful unit of weight change (the 5–10% loss guidelines are
@@ -4175,43 +4183,43 @@ const Wr = {
4175
4183
  approaching: 0.1,
4176
4184
  sided: "atLeast"
4177
4185
  }
4178
- }, $r = {
4186
+ }, Ur = {
4179
4187
  kind: "relative",
4180
4188
  onTarget: 0.05,
4181
4189
  approaching: 0.15,
4182
4190
  sided: "both"
4183
4191
  };
4184
- function Qr(e) {
4185
- return Wr[e] ?? $r;
4192
+ function Wr(e) {
4193
+ return Gr[e] ?? Ur;
4186
4194
  }
4187
4195
  function Gt(e, a, t) {
4188
4196
  return e.kind === "absolute" ? a : Math.abs(t) * a;
4189
4197
  }
4190
- function Zr(e, a, t) {
4198
+ function $r(e, a, t) {
4191
4199
  if (e == null || !Number.isFinite(e) || a == null || !Number.isFinite(a)) return null;
4192
- const n = Qr(t), o = e - a;
4200
+ const n = Wr(t), o = e - a;
4193
4201
  if (n.sided === "atLeast" && o >= 0 || n.sided === "atMost" && o <= 0) return "onTarget";
4194
4202
  const r = Math.abs(o);
4195
4203
  return r <= Gt(n, n.onTarget, a) ? "onTarget" : r <= Gt(n, n.approaching, a) ? "approaching" : "offTarget";
4196
4204
  }
4197
- const Yr = {
4205
+ const Qr = {
4198
4206
  weight: { min: 20, max: 400, step: 0.1 },
4199
4207
  bmi: { min: 10, max: 60, step: 0.1 },
4200
4208
  waist: { min: 30, max: 250, step: 1 },
4201
4209
  energy: { min: 500, max: 6e3, step: 50 },
4202
4210
  protein: { min: 10, max: 400, step: 5 }
4203
4211
  };
4204
- function Jr(e) {
4205
- const a = Yr[e.key];
4212
+ function Zr(e) {
4213
+ const a = Qr[e.key];
4206
4214
  return a || { min: 0, max: 1e4, step: 10 ** -(e.precision ?? 0) };
4207
4215
  }
4208
- function Xr(e, a) {
4216
+ function Yr(e, a) {
4209
4217
  return e == null ? !0 : Number.isFinite(e) ? e >= a.min && e <= a.max : !1;
4210
4218
  }
4211
- function el(e, a) {
4219
+ function Jr(e, a) {
4212
4220
  return e == null || a == null, e === a;
4213
4221
  }
4214
- function al(e, a) {
4222
+ function Xr(e, a) {
4215
4223
  return a.unit ? `${e.min}–${e.max} ${a.unit}` : `${e.min}–${e.max}`;
4216
4224
  }
4217
4225
  function Hi({
@@ -4222,9 +4230,9 @@ function Hi({
4222
4230
  t: o,
4223
4231
  onCommit: r
4224
4232
  }) {
4225
- const [l, s] = I(!1), [d, u] = I(t), g = Jr(e), b = Xr(d, g), m = !el(d, t), v = Te(e, o), k = al(g, e), f = (h) => {
4233
+ const [l, s] = I(!1), [d, u] = I(t), g = Zr(e), b = Yr(d, g), m = !Jr(d, t), v = Te(e, o), x = Xr(g, e), f = (h) => {
4226
4234
  h && u(t), s(h);
4227
- }, A = (h) => {
4235
+ }, T = (h) => {
4228
4236
  r(h), s(!1);
4229
4237
  };
4230
4238
  return /* @__PURE__ */ c(ke, { open: l, onOpenChange: f, children: [
@@ -4253,8 +4261,8 @@ function Hi({
4253
4261
  M,
4254
4262
  {
4255
4263
  label: o("anamnesis.targets.editField"),
4256
- description: o("anamnesis.targets.bounds", { range: k }),
4257
- error: b ? void 0 : o("anamnesis.targets.outOfBounds", { range: k }),
4264
+ description: o("anamnesis.targets.bounds", { range: x }),
4265
+ error: b ? void 0 : o("anamnesis.targets.outOfBounds", { range: x }),
4258
4266
  children: /* @__PURE__ */ i(
4259
4267
  ga,
4260
4268
  {
@@ -4277,7 +4285,7 @@ function Hi({
4277
4285
  intent: "ghost",
4278
4286
  size: "sm",
4279
4287
  disabled: t == null,
4280
- onClick: () => A(null),
4288
+ onClick: () => T(null),
4281
4289
  "data-testid": `anamnesis-target-clear-${e.key}`,
4282
4290
  children: o("anamnesis.targets.clear")
4283
4291
  }
@@ -4288,7 +4296,7 @@ function Hi({
4288
4296
  intent: "primary",
4289
4297
  size: "sm",
4290
4298
  disabled: !m || !b,
4291
- onClick: () => A(d),
4299
+ onClick: () => T(d),
4292
4300
  "data-testid": `anamnesis-target-save-${e.key}`,
4293
4301
  children: o("anamnesis.targets.save")
4294
4302
  }
@@ -4300,12 +4308,12 @@ function Hi({
4300
4308
  )
4301
4309
  ] });
4302
4310
  }
4303
- const tl = {
4311
+ const el = {
4304
4312
  onTarget: "success",
4305
4313
  approaching: "warning",
4306
4314
  offTarget: "error"
4307
4315
  };
4308
- function il({
4316
+ function al({
4309
4317
  variant: e = "outlined",
4310
4318
  label: a,
4311
4319
  target: t,
@@ -4334,7 +4342,7 @@ function il({
4334
4342
  // `mt-auto` pins it to the tile's foot, so a row of tiles stretched to
4335
4343
  // the tallest one lines its chips up instead of leaving a hole.
4336
4344
  /* @__PURE__ */ c("div", { className: "ds:mt-auto ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", children: [
4337
- o ? /* @__PURE__ */ i(Y, { variant: tl[o], size: "sm", withDot: !0, children: r }) : null,
4345
+ o ? /* @__PURE__ */ i(Y, { variant: el[o], size: "sm", withDot: !0, children: r }) : null,
4338
4346
  l
4339
4347
  ] })
4340
4348
  ) : null
@@ -4346,16 +4354,16 @@ function Ua(e, a, t) {
4346
4354
  const n = Pe(e, a.precision, t);
4347
4355
  return a.unit ? `${n} ${a.unit}` : n;
4348
4356
  }
4349
- function nl({ def: e, visits: a, target: t, t: n, onTargetChange: o }) {
4357
+ function tl({ def: e, visits: a, target: t, t: n, onTargetChange: o }) {
4350
4358
  var m;
4351
- const { t: r } = An("ui"), l = Ee(n), s = ((m = Jn(a, e)) == null ? void 0 : m.value) ?? null, d = Zr(s, t, e.key), u = n("anamnesis.targets.tileLabel", {
4359
+ const { t: r } = An("ui"), l = Ee(n), s = ((m = Jn(a, e)) == null ? void 0 : m.value) ?? null, d = $r(s, t, e.key), u = n("anamnesis.targets.tileLabel", {
4352
4360
  name: qe(e, n)
4353
4361
  }), g = e.computed && s != null, b = s == null ? n("anamnesis.targets.nowUnset") : g ? n("anamnesis.targets.nowBanded", {
4354
4362
  value: Ua(s, e, l),
4355
4363
  band: r(`bmiCalculator.category.${Tn(s)}`)
4356
4364
  }) : n("anamnesis.targets.now", { value: Ua(s, e, l) });
4357
4365
  return /* @__PURE__ */ i(
4358
- il,
4366
+ al,
4359
4367
  {
4360
4368
  variant: "elevated",
4361
4369
  label: u,
@@ -4377,7 +4385,7 @@ function nl({ def: e, visits: a, target: t, t: n, onTargetChange: o }) {
4377
4385
  }
4378
4386
  );
4379
4387
  }
4380
- function ol(e) {
4388
+ function il(e) {
4381
4389
  return e <= 1 ? "ds:grid-cols-1" : e === 2 ? "ds:grid-cols-2" : e === 3 ? "ds:grid-cols-2 ds:sm:grid-cols-3" : "ds:grid-cols-2 ds:sm:grid-cols-4";
4382
4390
  }
4383
4391
  function Bi({
@@ -4403,9 +4411,9 @@ function Bi({
4403
4411
  /* @__PURE__ */ i(
4404
4412
  "div",
4405
4413
  {
4406
- className: `ds:grid ds:gap-[var(--spacing-md)] ${ol(a.length)}`,
4414
+ className: `ds:grid ds:gap-[var(--spacing-md)] ${il(a.length)}`,
4407
4415
  children: a.map((r) => /* @__PURE__ */ i(
4408
- nl,
4416
+ tl,
4409
4417
  {
4410
4418
  def: r,
4411
4419
  visits: e,
@@ -4434,7 +4442,7 @@ function Wa({
4434
4442
  }) {
4435
4443
  const d = Ee(r);
4436
4444
  return /* @__PURE__ */ i("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2", children: a.filter((u) => !u.computed).map((u) => {
4437
- const g = je(t, u), b = n ? je(n, u) : null, m = n ? La(g, b, u) : null, v = fa(g, u.referenceRange), k = o.get(u.key) ?? null, f = Te(u, r), A = s != null && ii(u) && !e.has(u.key);
4445
+ const g = je(t, u), b = n ? je(n, u) : null, m = n ? La(g, b, u) : null, v = fa(g, u.referenceRange), x = o.get(u.key) ?? null, f = Te(u, r), T = s != null && ii(u) && !e.has(u.key);
4438
4446
  return /* @__PURE__ */ c(
4439
4447
  "div",
4440
4448
  {
@@ -4451,17 +4459,17 @@ function Wa({
4451
4459
  /* @__PURE__ */ c("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", children: [
4452
4460
  v ? /* @__PURE__ */ i(pt, { flag: v, t: r }) : null,
4453
4461
  /* @__PURE__ */ i(mt, { delta: m, def: u, t: r }),
4454
- A || k != null ? /* @__PURE__ */ c("span", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-2xs)]", children: [
4455
- /* @__PURE__ */ i("span", { className: "type-meta ds:text-[color:var(--muted-foreground)]", children: k == null ? r("anamnesis.targets.unset") : r("anamnesis.grid.target", {
4456
- value: Pe(k, u.precision, d),
4462
+ T || x != null ? /* @__PURE__ */ c("span", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-2xs)]", children: [
4463
+ /* @__PURE__ */ i("span", { className: "type-meta ds:text-[color:var(--muted-foreground)]", children: x == null ? r("anamnesis.targets.unset") : r("anamnesis.grid.target", {
4464
+ value: Pe(x, u.precision, d),
4457
4465
  unit: u.unit ?? ""
4458
4466
  }) }),
4459
- A ? /* @__PURE__ */ i(
4467
+ T ? /* @__PURE__ */ i(
4460
4468
  Hi,
4461
4469
  {
4462
4470
  def: u,
4463
4471
  label: f,
4464
- committed: k,
4472
+ committed: x,
4465
4473
  nowLabel: r("anamnesis.targets.now", {
4466
4474
  value: `${Pe(g, u.precision, d)} ${u.unit ?? ""}`.trim()
4467
4475
  }),
@@ -4536,7 +4544,7 @@ function ve({
4536
4544
  }
4537
4545
  );
4538
4546
  }
4539
- function rl({
4547
+ function nl({
4540
4548
  record: e,
4541
4549
  t: a,
4542
4550
  embedded: t = !1,
@@ -4551,23 +4559,23 @@ function rl({
4551
4559
  practitioners: b,
4552
4560
  newVisitDateIso: m,
4553
4561
  defaultView: v = "summary",
4554
- defaultExportMenuOpen: k = !1,
4562
+ defaultExportMenuOpen: x = !1,
4555
4563
  defaultShareOpen: f = !1,
4556
- defaultExportAudience: A = "clinician"
4564
+ defaultExportAudience: T = "clinician"
4557
4565
  }) {
4558
4566
  var Tt;
4559
4567
  const [h, y] = I(
4560
4568
  () => structuredClone(e)
4561
- ), N = _e(!1);
4569
+ ), A = _e(!1);
4562
4570
  ba(() => {
4563
- if (!N.current) {
4564
- N.current = !0;
4571
+ if (!A.current) {
4572
+ A.current = !0;
4565
4573
  return;
4566
4574
  }
4567
4575
  g == null || g(h);
4568
4576
  }, [h]);
4569
- const j = _e(0), { patient: T, visits: R } = h, p = R[R.length - 1], S = R.length > 1 ? R[R.length - 2] : void 0, w = H(
4570
- () => new Map(h.targets.map((z) => [z.parameterKey, z.target])),
4577
+ const j = _e(0), { patient: N, visits: R } = h, p = R[R.length - 1], S = R.length > 1 ? R[R.length - 2] : void 0, k = H(
4578
+ () => new Map(h.targets.map((w) => [w.parameterKey, w.target])),
4571
4579
  [h.targets]
4572
4580
  ), C = H(
4573
4581
  () => xe(n, "anthropometric"),
@@ -4576,39 +4584,39 @@ function rl({
4576
4584
  () => xe(n, "dietary"),
4577
4585
  [n]
4578
4586
  ), O = H(() => xe(n, "lab"), [n]), D = H(() => Vi(n), [n]), q = H(
4579
- () => new Set(D.map((z) => z.key)),
4587
+ () => new Set(D.map((w) => w.key)),
4580
4588
  [D]
4581
4589
  ), $ = H(
4582
4590
  () => Lt(p, O),
4583
4591
  [p, O]
4584
4592
  ), [V, P] = I(() => {
4585
- const z = Lt(p, O), x = {};
4586
- for (const E of vi) x[E] = z[E].open;
4587
- return x;
4593
+ const w = Lt(p, O), z = {};
4594
+ for (const E of vi) z[E] = w[E].open;
4595
+ return z;
4588
4596
  }), G = Qe(
4589
- (z) => (x) => P((E) => ({ ...E, [z]: x })),
4597
+ (w) => (z) => P((E) => ({ ...E, [w]: z })),
4590
4598
  []
4591
4599
  ), Z = H(
4592
4600
  () => We(n),
4593
4601
  [n]
4594
4602
  ), J = H(() => st(n), [n]), me = H(() => dt(n), [n]), [he, _] = I(v), [K, se] = I(!0), [ce, ue] = ft(), { containerRef: Ke, requestJump: Le } = gi(), Ae = Qe(
4595
- (z) => {
4596
- var x, E;
4597
- return (E = (x = h.intake) == null ? void 0 : x.answers[z]) == null ? void 0 : E.value;
4603
+ (w) => {
4604
+ var z, E;
4605
+ return (E = (z = h.intake) == null ? void 0 : z.answers[w]) == null ? void 0 : E.value;
4598
4606
  },
4599
4607
  [h.intake]
4600
4608
  ), B = H(
4601
- () => go(Z, Ae, T.sex, a),
4602
- [Z, Ae, T.sex, a]
4609
+ () => go(Z, Ae, N.sex, a),
4610
+ [Z, Ae, N.sex, a]
4603
4611
  ), U = H(
4604
- () => pi(J, Ae, T.sex, a),
4605
- [J, Ae, T.sex, a]
4606
- ), [fe] = I(() => new Set(U.map((z) => z.key))), va = (z) => {
4612
+ () => pi(J, Ae, N.sex, a),
4613
+ [J, Ae, N.sex, a]
4614
+ ), [fe] = I(() => new Set(U.map((w) => w.key))), va = (w) => {
4607
4615
  if (u) {
4608
- u(z);
4616
+ u(w);
4609
4617
  return;
4610
4618
  }
4611
- _("compile"), se(!0), Le(z.key);
4619
+ _("compile"), se(!0), Le(w.key);
4612
4620
  };
4613
4621
  if (!p)
4614
4622
  return /* @__PURE__ */ i(Ut, { embedded: t, children: /* @__PURE__ */ i(le, { variant: "elevated", children: /* @__PURE__ */ i(le.Body, { children: /* @__PURE__ */ i(
@@ -4620,40 +4628,40 @@ function rl({
4620
4628
  description: a("anamnesis.empty.noRecord.description")
4621
4629
  }
4622
4630
  ) }) }) });
4623
- const ne = (z) => {
4624
- y((x) => {
4625
- if (x.visits.length === 0) return x;
4626
- const E = x.visits.slice();
4627
- return E[E.length - 1] = z(E[E.length - 1]), { ...x, visits: E };
4631
+ const ne = (w) => {
4632
+ y((z) => {
4633
+ if (z.visits.length === 0) return z;
4634
+ const E = z.visits.slice();
4635
+ return E[E.length - 1] = w(E[E.length - 1]), { ...z, visits: E };
4628
4636
  });
4629
- }, Va = (z, x) => ne((E) => jt(E, z, x)), $i = (z, x, E) => y((W) => ({
4637
+ }, Va = (w, z) => ne((E) => jt(E, w, z)), $i = (w, z, E) => y((W) => ({
4630
4638
  ...W,
4631
4639
  visits: W.visits.map(
4632
- (ea) => ea.id === z.id ? jt(ea, x, E) : ea
4640
+ (ea) => ea.id === w.id ? jt(ea, z, E) : ea
4633
4641
  )
4634
- })), ka = (z, x) => {
4635
- y((E) => di(E, z.key, x)), o == null || o(z.key, x);
4636
- }, Qi = (z) => ne((x) => ({ ...x, pathologyCodes: z })), Nt = (z, x) => ne((E) => ({
4642
+ })), ka = (w, z) => {
4643
+ y((E) => di(E, w.key, z)), o == null || o(w.key, z);
4644
+ }, Qi = (w) => ne((z) => ({ ...z, pathologyCodes: w })), Nt = (w, z) => ne((E) => ({
4637
4645
  ...E,
4638
- therapy: E.therapy.map((W) => W.id === z ? { ...W, ...x } : W)
4639
- })), Zi = (z) => ne((x) => ({
4640
- ...x,
4641
- therapy: x.therapy.filter((E) => E.id !== z)
4646
+ therapy: E.therapy.map((W) => W.id === w ? { ...W, ...z } : W)
4647
+ })), Zi = (w) => ne((z) => ({
4648
+ ...z,
4649
+ therapy: z.therapy.filter((E) => E.id !== w)
4642
4650
  })), Yi = () => {
4643
4651
  j.current += 1;
4644
- const z = `new-${j.current}`;
4645
- ne((x) => ({
4646
- ...x,
4647
- therapy: [...x.therapy, { id: z, name: "", dose: "", kind: "medication" }]
4652
+ const w = `new-${j.current}`;
4653
+ ne((z) => ({
4654
+ ...z,
4655
+ therapy: [...z.therapy, { id: w, name: "", dose: "", kind: "medication" }]
4648
4656
  }));
4649
4657
  }, Ji = () => {
4650
4658
  j.current += 1;
4651
- const z = `new-visit-${j.current}`;
4652
- y((x) => {
4653
- const E = x.visits[x.visits.length - 1];
4654
- if (!E) return x;
4659
+ const w = `new-visit-${j.current}`;
4660
+ y((z) => {
4661
+ const E = z.visits[z.visits.length - 1];
4662
+ if (!E) return z;
4655
4663
  const W = {
4656
- id: z,
4664
+ id: w,
4657
4665
  visitType: "followUp",
4658
4666
  dateIso: m ?? E.dateIso,
4659
4667
  anthropometrics: {
@@ -4669,9 +4677,9 @@ function rl({
4669
4677
  therapy: [],
4670
4678
  fmdCycles: []
4671
4679
  };
4672
- return { ...x, visits: [...x.visits, W] };
4680
+ return { ...z, visits: [...z.visits, W] };
4673
4681
  });
4674
- }, Xi = (z, x) => {
4682
+ }, Xi = (w, z) => {
4675
4683
  y((E) => {
4676
4684
  var W;
4677
4685
  return {
@@ -4680,17 +4688,17 @@ function rl({
4680
4688
  ...E.intake,
4681
4689
  answers: {
4682
4690
  ...(W = E.intake) == null ? void 0 : W.answers,
4683
- [z]: { value: x, origin: "clinician" }
4691
+ [w]: { value: z, origin: "clinician" }
4684
4692
  }
4685
4693
  }
4686
4694
  };
4687
4695
  });
4688
4696
  }, en = Un(n).map(
4689
- (z) => {
4690
- const x = me[z], E = x == null ? void 0 : x.parentCode;
4697
+ (w) => {
4698
+ const z = me[w], E = z == null ? void 0 : z.parentCode;
4691
4699
  return {
4692
- value: z,
4693
- label: Se(z, a, x),
4700
+ value: w,
4701
+ label: Se(w, a, z),
4694
4702
  group: E ? ut(E, a, me[E]) : a("anamnesis.pathology.groupGeneral")
4695
4703
  };
4696
4704
  }
@@ -4701,9 +4709,9 @@ function rl({
4701
4709
  !t || s ? /* @__PURE__ */ c("div", { className: "ds:flex ds:flex-wrap ds:items-end ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
4702
4710
  t ? /* @__PURE__ */ i("span", {}) : /* @__PURE__ */ c("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]", children: [
4703
4711
  /* @__PURE__ */ c("h1", { className: "type-title-page ds:m-0 ds:text-[color:var(--foreground)]", children: [
4704
- T.firstName,
4712
+ N.firstName,
4705
4713
  " ",
4706
- T.lastName
4714
+ N.lastName
4707
4715
  ] }),
4708
4716
  /* @__PURE__ */ c("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: [
4709
4717
  Ia(h, a),
@@ -4725,7 +4733,7 @@ function rl({
4725
4733
  {
4726
4734
  visits: R,
4727
4735
  defs: D,
4728
- targets: w,
4736
+ targets: k,
4729
4737
  t: a,
4730
4738
  onTargetChange: ka
4731
4739
  }
@@ -4734,7 +4742,7 @@ function rl({
4734
4742
  Q,
4735
4743
  {
4736
4744
  value: he,
4737
- onValueChange: (z) => _(z),
4745
+ onValueChange: (w) => _(w),
4738
4746
  children: [
4739
4747
  /* @__PURE__ */ c("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
4740
4748
  /* @__PURE__ */ c(Q.List, { "aria-label": a("anamnesis.compile.viewsLabel"), children: [
@@ -4750,9 +4758,9 @@ function rl({
4750
4758
  t: a,
4751
4759
  config: n,
4752
4760
  shownVisitIds: ce,
4753
- defaultOpen: k,
4761
+ defaultOpen: x,
4754
4762
  defaultShareOpen: f,
4755
- defaultAudience: A
4763
+ defaultAudience: T
4756
4764
  }
4757
4765
  )
4758
4766
  ] }),
@@ -4761,7 +4769,7 @@ function rl({
4761
4769
  {
4762
4770
  intake: h.intake,
4763
4771
  sections: Z,
4764
- sex: T.sex,
4772
+ sex: N.sex,
4765
4773
  digest: B,
4766
4774
  missing: U,
4767
4775
  onJump: va,
@@ -4785,9 +4793,9 @@ function rl({
4785
4793
  }
4786
4794
  ],
4787
4795
  value: p.visitType,
4788
- onValueChange: (z) => ne((x) => ({
4789
- ...x,
4790
- visitType: z || "followUp"
4796
+ onValueChange: (w) => ne((z) => ({
4797
+ ...z,
4798
+ visitType: w || "followUp"
4791
4799
  }))
4792
4800
  }
4793
4801
  ) }),
@@ -4796,18 +4804,18 @@ function rl({
4796
4804
  {
4797
4805
  options: b,
4798
4806
  value: p.practitioner ?? "",
4799
- onValueChange: (z) => ne((x) => ({
4800
- ...x,
4801
- practitioner: z || void 0
4807
+ onValueChange: (w) => ne((z) => ({
4808
+ ...z,
4809
+ practitioner: w || void 0
4802
4810
  }))
4803
4811
  }
4804
4812
  ) : /* @__PURE__ */ i(
4805
4813
  te,
4806
4814
  {
4807
4815
  value: p.practitioner ?? "",
4808
- onChange: (z) => ne((x) => ({
4809
- ...x,
4810
- practitioner: z.target.value
4816
+ onChange: (w) => ne((z) => ({
4817
+ ...z,
4818
+ practitioner: w.target.value
4811
4819
  }))
4812
4820
  }
4813
4821
  ) }),
@@ -4815,9 +4823,9 @@ function rl({
4815
4823
  sn,
4816
4824
  {
4817
4825
  value: ui(p.dateIso),
4818
- onChange: (z) => z && ne((x) => ({
4819
- ...x,
4820
- dateIso: oo(z) + no(x.dateIso)
4826
+ onChange: (w) => w && ne((z) => ({
4827
+ ...z,
4828
+ dateIso: oo(w) + no(z.dateIso)
4821
4829
  }))
4822
4830
  }
4823
4831
  ) })
@@ -4850,15 +4858,15 @@ function rl({
4850
4858
  {
4851
4859
  ref: Ke,
4852
4860
  className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]",
4853
- children: J.map((z) => {
4854
- const x = z.fields.filter((E) => sa(E, T.sex)).filter((E) => fe.has(E.key));
4855
- return x.length === 0 ? null : /* @__PURE__ */ c(
4861
+ children: J.map((w) => {
4862
+ const z = w.fields.filter((E) => sa(E, N.sex)).filter((E) => fe.has(E.key));
4863
+ return z.length === 0 ? null : /* @__PURE__ */ c(
4856
4864
  "div",
4857
4865
  {
4858
4866
  className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
4859
4867
  children: [
4860
- /* @__PURE__ */ i("h3", { className: "type-title-item ds:m-0 ds:text-[color:var(--foreground)]", children: ye(z, a) }),
4861
- x.map((E) => {
4868
+ /* @__PURE__ */ i("h3", { className: "type-title-item ds:m-0 ds:text-[color:var(--foreground)]", children: ye(w, a) }),
4869
+ z.map((E) => {
4862
4870
  var ea;
4863
4871
  const W = (ea = h.intake) == null ? void 0 : ea.answers[E.key];
4864
4872
  return /* @__PURE__ */ i(
@@ -4876,7 +4884,7 @@ function rl({
4876
4884
  })
4877
4885
  ]
4878
4886
  },
4879
- z.key
4887
+ w.key
4880
4888
  );
4881
4889
  })
4882
4890
  }
@@ -4893,7 +4901,7 @@ function rl({
4893
4901
  defs: C,
4894
4902
  visit: p,
4895
4903
  previous: S,
4896
- targets: w,
4904
+ targets: k,
4897
4905
  t: a,
4898
4906
  onChange: Va,
4899
4907
  onTargetChange: ka
@@ -4907,7 +4915,7 @@ function rl({
4907
4915
  defs: F,
4908
4916
  visit: p,
4909
4917
  previous: S,
4910
- targets: w,
4918
+ targets: k,
4911
4919
  t: a,
4912
4920
  onChange: Va,
4913
4921
  onTargetChange: ka
@@ -4945,11 +4953,11 @@ function rl({
4945
4953
  te,
4946
4954
  {
4947
4955
  value: wa.tumourType ?? "",
4948
- onChange: (z) => ne((x) => ({
4949
- ...x,
4956
+ onChange: (w) => ne((z) => ({
4957
+ ...z,
4950
4958
  oncological: {
4951
- ...x.oncological,
4952
- tumourType: z.target.value
4959
+ ...z.oncological,
4960
+ tumourType: w.target.value
4953
4961
  }
4954
4962
  }))
4955
4963
  }
@@ -4958,11 +4966,11 @@ function rl({
4958
4966
  te,
4959
4967
  {
4960
4968
  value: wa.stage ?? "",
4961
- onChange: (z) => ne((x) => ({
4962
- ...x,
4969
+ onChange: (w) => ne((z) => ({
4970
+ ...z,
4963
4971
  oncological: {
4964
- ...x.oncological,
4965
- stage: z.target.value
4972
+ ...z.oncological,
4973
+ stage: w.target.value
4966
4974
  }
4967
4975
  }))
4968
4976
  }
@@ -4973,15 +4981,15 @@ function rl({
4973
4981
  label: a("anamnesis.field.metastases.label"),
4974
4982
  variant: "horizontal",
4975
4983
  value: ((Tt = wa.metastases) == null ? void 0 : Tt.present) ?? "unknown",
4976
- onValueChange: (z) => ne((x) => {
4984
+ onValueChange: (w) => ne((z) => {
4977
4985
  var E, W;
4978
4986
  return {
4979
- ...x,
4987
+ ...z,
4980
4988
  oncological: {
4981
- ...x.oncological,
4989
+ ...z.oncological,
4982
4990
  metastases: {
4983
- present: z,
4984
- site: (W = (E = x.oncological) == null ? void 0 : E.metastases) == null ? void 0 : W.site
4991
+ present: w,
4992
+ site: (W = (E = z.oncological) == null ? void 0 : E.metastases) == null ? void 0 : W.site
4985
4993
  }
4986
4994
  }
4987
4995
  };
@@ -5007,11 +5015,11 @@ function rl({
5007
5015
  te,
5008
5016
  {
5009
5017
  value: wa.treatmentStatus ?? "",
5010
- onChange: (z) => ne((x) => ({
5011
- ...x,
5018
+ onChange: (w) => ne((z) => ({
5019
+ ...z,
5012
5020
  oncological: {
5013
- ...x.oncological,
5014
- treatmentStatus: z.target.value
5021
+ ...z.oncological,
5022
+ treatmentStatus: w.target.value
5015
5023
  }
5016
5024
  }))
5017
5025
  }
@@ -5022,7 +5030,7 @@ function rl({
5022
5030
  }
5023
5031
  ),
5024
5032
  /* @__PURE__ */ i(ve, { titleKey: "anamnesis.section.therapy", t: a, children: /* @__PURE__ */ c("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
5025
- p.therapy.length === 0 ? /* @__PURE__ */ i("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: a("anamnesis.compile.noTherapy") }) : p.therapy.map((z) => /* @__PURE__ */ c(
5033
+ p.therapy.length === 0 ? /* @__PURE__ */ i("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: a("anamnesis.compile.noTherapy") }) : p.therapy.map((w) => /* @__PURE__ */ c(
5026
5034
  "div",
5027
5035
  {
5028
5036
  className: "ds:flex ds:flex-wrap ds:items-end ds:gap-[var(--spacing-sm)]",
@@ -5034,9 +5042,9 @@ function rl({
5034
5042
  children: /* @__PURE__ */ i(
5035
5043
  te,
5036
5044
  {
5037
- value: z.name,
5038
- onChange: (x) => Nt(z.id, {
5039
- name: x.target.value
5045
+ value: w.name,
5046
+ onChange: (z) => Nt(w.id, {
5047
+ name: z.target.value
5040
5048
  })
5041
5049
  }
5042
5050
  )
@@ -5045,18 +5053,18 @@ function rl({
5045
5053
  /* @__PURE__ */ i(M, { label: a("anamnesis.field.medDose.label"), children: /* @__PURE__ */ i(
5046
5054
  te,
5047
5055
  {
5048
- value: z.dose ?? "",
5049
- onChange: (x) => Nt(z.id, {
5050
- dose: x.target.value
5056
+ value: w.dose ?? "",
5057
+ onChange: (z) => Nt(w.id, {
5058
+ dose: z.target.value
5051
5059
  })
5052
5060
  }
5053
5061
  ) }),
5054
5062
  /* @__PURE__ */ i(
5055
5063
  Y,
5056
5064
  {
5057
- variant: z.kind === "medication" ? "info" : "neutral",
5065
+ variant: w.kind === "medication" ? "info" : "neutral",
5058
5066
  size: "md",
5059
- children: a(`anamnesis.medKind.${z.kind}`)
5067
+ children: a(`anamnesis.medKind.${w.kind}`)
5060
5068
  }
5061
5069
  ),
5062
5070
  /* @__PURE__ */ i(
@@ -5065,14 +5073,14 @@ function rl({
5065
5073
  icon: /* @__PURE__ */ i(Cn, { "aria-hidden": "true" }),
5066
5074
  intent: "ghost",
5067
5075
  "aria-label": a("anamnesis.compile.removeTherapy", {
5068
- name: z.name
5076
+ name: w.name
5069
5077
  }),
5070
- onClick: () => Zi(z.id)
5078
+ onClick: () => Zi(w.id)
5071
5079
  }
5072
5080
  )
5073
5081
  ]
5074
5082
  },
5075
- z.id
5083
+ w.id
5076
5084
  )),
5077
5085
  /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(
5078
5086
  ie,
@@ -5101,7 +5109,7 @@ function rl({
5101
5109
  defs: O,
5102
5110
  visit: p,
5103
5111
  previous: S,
5104
- targets: w,
5112
+ targets: k,
5105
5113
  t: a,
5106
5114
  onChange: Va,
5107
5115
  onTargetChange: ka
@@ -5117,18 +5125,18 @@ function rl({
5117
5125
  open: V.fmd,
5118
5126
  onOpenChange: G("fmd"),
5119
5127
  fill: $.fmd.fill,
5120
- children: p.fmdCycles.length === 0 ? /* @__PURE__ */ i("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: a("anamnesis.compile.noFmd") }) : /* @__PURE__ */ i("ul", { className: "ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-0", children: p.fmdCycles.map((z) => /* @__PURE__ */ c(
5128
+ children: p.fmdCycles.length === 0 ? /* @__PURE__ */ i("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: a("anamnesis.compile.noFmd") }) : /* @__PURE__ */ i("ul", { className: "ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-0", children: p.fmdCycles.map((w) => /* @__PURE__ */ c(
5121
5129
  "li",
5122
5130
  {
5123
5131
  className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]",
5124
5132
  children: [
5125
5133
  /* @__PURE__ */ i("span", { className: "type-label ds:text-[color:var(--foreground)]", children: a("anamnesis.compile.cycleNumber", {
5126
- number: z.cycleNumber
5134
+ number: w.cycleNumber
5127
5135
  }) }),
5128
5136
  /* @__PURE__ */ i("span", { className: "type-meta ds:text-[color:var(--muted-foreground)]", children: /* @__PURE__ */ i(
5129
5137
  Ze,
5130
5138
  {
5131
- value: z.startDateIso,
5139
+ value: w.startDateIso,
5132
5140
  format: "absolute",
5133
5141
  shape: "bare",
5134
5142
  absoluteFormat: Ea
@@ -5137,15 +5145,15 @@ function rl({
5137
5145
  /* @__PURE__ */ i(
5138
5146
  Y,
5139
5147
  {
5140
- variant: z.completed ? "success" : "warning",
5148
+ variant: w.completed ? "success" : "warning",
5141
5149
  size: "sm",
5142
5150
  withDot: !0,
5143
- children: z.completed ? a("anamnesis.compile.cycleCompleted") : a("anamnesis.compile.cycleInProgress")
5151
+ children: w.completed ? a("anamnesis.compile.cycleCompleted") : a("anamnesis.compile.cycleInProgress")
5144
5152
  }
5145
5153
  )
5146
5154
  ]
5147
5155
  },
5148
- z.cycleNumber
5156
+ w.cycleNumber
5149
5157
  )) })
5150
5158
  }
5151
5159
  ),
@@ -5160,9 +5168,9 @@ function rl({
5160
5168
  value: p.nutritionalProposal ?? "",
5161
5169
  autoResize: !0,
5162
5170
  minRows: 2,
5163
- onChange: (z) => ne((x) => ({
5164
- ...x,
5165
- nutritionalProposal: z.target.value
5171
+ onChange: (w) => ne((z) => ({
5172
+ ...z,
5173
+ nutritionalProposal: w.target.value
5166
5174
  }))
5167
5175
  }
5168
5176
  )
@@ -5174,9 +5182,9 @@ function rl({
5174
5182
  value: p.clinicalNotes ?? "",
5175
5183
  autoResize: !0,
5176
5184
  minRows: 2,
5177
- onChange: (z) => ne((x) => ({
5178
- ...x,
5179
- clinicalNotes: z.target.value
5185
+ onChange: (w) => ne((z) => ({
5186
+ ...z,
5187
+ clinicalNotes: w.target.value
5180
5188
  }))
5181
5189
  }
5182
5190
  ) })
@@ -5196,14 +5204,14 @@ function rl({
5196
5204
  label: a("anamnesis.field.annualProposed.label"),
5197
5205
  variant: "horizontal",
5198
5206
  value: za.proposed ? "yes" : "no",
5199
- onValueChange: (z) => ne((x) => {
5207
+ onValueChange: (w) => ne((z) => {
5200
5208
  var E, W;
5201
5209
  return {
5202
- ...x,
5210
+ ...z,
5203
5211
  annualProgramme: {
5204
- proposed: z === "yes",
5205
- accepted: ((E = x.annualProgramme) == null ? void 0 : E.accepted) ?? !1,
5206
- declineReason: (W = x.annualProgramme) == null ? void 0 : W.declineReason
5212
+ proposed: w === "yes",
5213
+ accepted: ((E = z.annualProgramme) == null ? void 0 : E.accepted) ?? !1,
5214
+ declineReason: (W = z.annualProgramme) == null ? void 0 : W.declineReason
5207
5215
  }
5208
5216
  };
5209
5217
  }),
@@ -5219,14 +5227,14 @@ function rl({
5219
5227
  label: a("anamnesis.field.annualAccepted.label"),
5220
5228
  variant: "horizontal",
5221
5229
  value: za.accepted ? "yes" : "no",
5222
- onValueChange: (z) => ne((x) => {
5230
+ onValueChange: (w) => ne((z) => {
5223
5231
  var E, W;
5224
5232
  return {
5225
- ...x,
5233
+ ...z,
5226
5234
  annualProgramme: {
5227
- proposed: ((E = x.annualProgramme) == null ? void 0 : E.proposed) ?? !1,
5228
- accepted: z === "yes",
5229
- declineReason: (W = x.annualProgramme) == null ? void 0 : W.declineReason
5235
+ proposed: ((E = z.annualProgramme) == null ? void 0 : E.proposed) ?? !1,
5236
+ accepted: w === "yes",
5237
+ declineReason: (W = z.annualProgramme) == null ? void 0 : W.declineReason
5230
5238
  }
5231
5239
  };
5232
5240
  }),
@@ -5246,14 +5254,14 @@ function rl({
5246
5254
  value: za.declineReason ?? "",
5247
5255
  autoResize: !0,
5248
5256
  minRows: 2,
5249
- onChange: (z) => ne((x) => {
5257
+ onChange: (w) => ne((z) => {
5250
5258
  var E, W;
5251
5259
  return {
5252
- ...x,
5260
+ ...z,
5253
5261
  annualProgramme: {
5254
- proposed: ((E = x.annualProgramme) == null ? void 0 : E.proposed) ?? !1,
5255
- accepted: ((W = x.annualProgramme) == null ? void 0 : W.accepted) ?? !1,
5256
- declineReason: z.target.value
5262
+ proposed: ((E = z.annualProgramme) == null ? void 0 : E.proposed) ?? !1,
5263
+ accepted: ((W = z.annualProgramme) == null ? void 0 : W.accepted) ?? !1,
5264
+ declineReason: w.target.value
5257
5265
  }
5258
5266
  };
5259
5267
  })
@@ -5291,29 +5299,29 @@ function Ut({
5291
5299
  }) {
5292
5300
  return e ? /* @__PURE__ */ i("div", { className: "ds:flex ds:w-full ds:flex-col ds:gap-[var(--spacing-lg)]", children: a }) : /* @__PURE__ */ i("div", { className: "ds:min-h-[100dvh] ds:w-full ds:bg-[color:var(--app-shell-background)] ds:py-[var(--spacing-lg)]", children: /* @__PURE__ */ i("div", { className: "ds:mx-auto ds:flex ds:w-full ds:max-w-[76rem] ds:flex-col ds:gap-[var(--spacing-lg)] ds:px-[var(--spacing-md)]", children: a }) });
5293
5301
  }
5294
- const ll = /* @__PURE__ */ new Set([
5302
+ const ol = /* @__PURE__ */ new Set([
5295
5303
  "number",
5296
5304
  "choice",
5297
5305
  "frequency",
5298
5306
  "yesNoDetail"
5299
5307
  ]);
5300
- function sl(e) {
5301
- return ll.has(e.type);
5308
+ function rl(e) {
5309
+ return ol.has(e.type);
5302
5310
  }
5303
- function dl(e) {
5304
- return e.fields.length > 0 && e.fields.every(sl);
5311
+ function ll(e) {
5312
+ return e.fields.length > 0 && e.fields.every(rl);
5305
5313
  }
5306
- function cl(e) {
5314
+ function sl(e) {
5307
5315
  return e.type === "text" && e.longForm === !0;
5308
5316
  }
5309
- function ul(e) {
5310
- return e.type === "textarea" || cl(e) ? !0 : e.detail === !0 && ml.has(e.type);
5317
+ function dl(e) {
5318
+ return e.type === "textarea" || sl(e) ? !0 : e.detail === !0 && cl.has(e.type);
5311
5319
  }
5312
- const ml = /* @__PURE__ */ new Set([
5320
+ const cl = /* @__PURE__ */ new Set([
5313
5321
  "yesNoDetail",
5314
5322
  "frequency",
5315
5323
  "choice"
5316
- ]), pl = "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-lg)] ds:@[640px]/intake:grid-cols-2 ds:@[960px]/intake:grid-cols-3 ds:@[1280px]/intake:grid-cols-4", gl = "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-lg)] ds:@[640px]/intake:grid-cols-2", hl = "ds:col-span-full";
5324
+ ]), ul = "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-lg)] ds:@[640px]/intake:grid-cols-2 ds:@[960px]/intake:grid-cols-3 ds:@[1280px]/intake:grid-cols-4", ml = "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-lg)] ds:@[640px]/intake:grid-cols-2", pl = "ds:col-span-full";
5317
5325
  function Wt(e) {
5318
5326
  var n;
5319
5327
  const a = {}, t = ((n = e.intake) == null ? void 0 : n.answers) ?? {};
@@ -5336,7 +5344,7 @@ function qi({
5336
5344
  var P;
5337
5345
  return ((P = e.intake) == null ? void 0 : P.submittedAtIso) != null;
5338
5346
  }
5339
- ), k = (P, G) => {
5347
+ ), x = (P, G) => {
5340
5348
  b((Z) => ({ ...Z, [P]: G }));
5341
5349
  }, f = H(
5342
5350
  () => st(n).map((P) => ({
@@ -5344,21 +5352,21 @@ function qi({
5344
5352
  fields: P.fields.filter((G) => sa(G, d.sex))
5345
5353
  })).filter((P) => P.fields.length > 0),
5346
5354
  [n, d.sex]
5347
- ), A = () => f.map((P) => P.key), h = (P, G) => {
5355
+ ), T = () => f.map((P) => P.key), h = (P, G) => {
5348
5356
  var me;
5349
5357
  const Z = G.relatedTarget;
5350
5358
  !(Z instanceof Node) || G.currentTarget.contains(Z) || !((me = p.current) != null && me.contains(Z)) || P.key === o || !P.fields.every(
5351
5359
  (he) => Ve(g[he.key])
5352
- ) || N((he) => he.filter((_) => _ !== P.key));
5353
- }, [y, N] = I(
5354
- () => A()
5355
- ), j = (P) => N((G) => G.includes(P) ? G : [...G, P]), [T, R] = I(e.intake);
5356
- if (e.intake !== T) {
5360
+ ) || A((he) => he.filter((_) => _ !== P.key));
5361
+ }, [y, A] = I(
5362
+ () => T()
5363
+ ), j = (P) => A((G) => G.includes(P) ? G : [...G, P]), [N, R] = I(e.intake);
5364
+ if (e.intake !== N) {
5357
5365
  R(e.intake);
5358
5366
  const P = Wt(e);
5359
- b(P), N(A());
5367
+ b(P), A(T());
5360
5368
  }
5361
- const { containerRef: p, requestJump: S } = gi(), w = H(
5369
+ const { containerRef: p, requestJump: S } = gi(), k = H(
5362
5370
  () => pi(
5363
5371
  f,
5364
5372
  (P) => g[P],
@@ -5385,7 +5393,7 @@ function qi({
5385
5393
  }, [f, g]), D = O === 0 ? 0 : Math.round(F / O * 100), q = a("anamnesis.intake.answered", {
5386
5394
  answered: F,
5387
5395
  total: O
5388
- }), $ = w.length > 0 && (F > 0 || m), V = /* @__PURE__ */ c(Ce, { children: [
5396
+ }), $ = k.length > 0 && (F > 0 || m), V = /* @__PURE__ */ c(Ce, { children: [
5389
5397
  t ? null : /* @__PURE__ */ c("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]", children: [
5390
5398
  /* @__PURE__ */ i("h1", { className: "type-title-page ds:m-0 ds:text-[color:var(--foreground)]", children: a("anamnesis.intake.title") }),
5391
5399
  /* @__PURE__ */ i("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: a("anamnesis.intake.subtitle") })
@@ -5442,7 +5450,7 @@ function qi({
5442
5450
  $ ? /* @__PURE__ */ i(
5443
5451
  hi,
5444
5452
  {
5445
- missing: w,
5453
+ missing: k,
5446
5454
  t: a,
5447
5455
  onJump: C,
5448
5456
  announce: "off"
@@ -5469,11 +5477,11 @@ function qi({
5469
5477
  type: "multiple",
5470
5478
  variant: "default",
5471
5479
  value: y,
5472
- onValueChange: N,
5480
+ onValueChange: A,
5473
5481
  children: f.map((P) => {
5474
5482
  const G = P.fields.filter(
5475
5483
  (J) => Ve(g[J.key])
5476
- ).length, Z = dl(P);
5484
+ ).length, Z = ll(P);
5477
5485
  return /* @__PURE__ */ c(
5478
5486
  _n,
5479
5487
  {
@@ -5492,15 +5500,15 @@ function qi({
5492
5500
  {
5493
5501
  "data-testid": `anamnesis-intake-section-${P.key}-fields`,
5494
5502
  "data-layout": Z ? "short" : "mixed",
5495
- className: Z ? pl : gl,
5503
+ className: Z ? ul : ml,
5496
5504
  children: P.fields.map((J) => /* @__PURE__ */ i(
5497
5505
  Mi,
5498
5506
  {
5499
5507
  readOnly: s,
5500
5508
  def: J,
5501
5509
  answer: g[J.key],
5502
- className: ul(J) ? hl : void 0,
5503
- onChange: (me) => k(J.key, me),
5510
+ className: dl(J) ? pl : void 0,
5511
+ onChange: (me) => x(J.key, me),
5504
5512
  t: a
5505
5513
  },
5506
5514
  J.key
@@ -5579,7 +5587,7 @@ function $a({
5579
5587
  ] }, l.key);
5580
5588
  }) });
5581
5589
  }
5582
- function bl({
5590
+ function gl({
5583
5591
  record: e,
5584
5592
  t: a,
5585
5593
  embedded: t = !1,
@@ -5588,8 +5596,8 @@ function bl({
5588
5596
  partitionBySource: r = !1
5589
5597
  }) {
5590
5598
  const { patient: l, visits: s } = e, d = s[s.length - 1], u = s.length > 1 ? s[s.length - 2] : void 0, g = new Map(
5591
- e.targets.map((T) => [T.parameterKey, T.target])
5592
- ), b = De(n, "anthropometric"), m = De(n, "dietary"), v = De(n, "lab"), k = We(n), f = dt(n), [A, h] = ft();
5599
+ e.targets.map((N) => [N.parameterKey, N.target])
5600
+ ), b = De(n, "anthropometric"), m = De(n, "dietary"), v = De(n, "lab"), x = We(n), f = dt(n), [T, h] = ft();
5593
5601
  if (!d)
5594
5602
  return /* @__PURE__ */ i($t, { embedded: t, children: /* @__PURE__ */ i(le, { variant: "elevated", children: /* @__PURE__ */ i(le.Body, { children: /* @__PURE__ */ i(
5595
5603
  Xe,
@@ -5600,7 +5608,7 @@ function bl({
5600
5608
  description: a("anamnesis.empty.noRecord.description")
5601
5609
  }
5602
5610
  ) }) }) });
5603
- const y = d.oncological, N = d.annualProgramme, j = /* @__PURE__ */ c(Ce, { children: [
5611
+ const y = d.oncological, A = d.annualProgramme, j = /* @__PURE__ */ c(Ce, { children: [
5604
5612
  t ? null : /* @__PURE__ */ c("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]", children: [
5605
5613
  /* @__PURE__ */ c("h1", { className: "type-title-page ds:m-0 ds:text-[color:var(--foreground)]", children: [
5606
5614
  l.firstName,
@@ -5668,7 +5676,7 @@ function bl({
5668
5676
  t: a
5669
5677
  }
5670
5678
  ) }) : null,
5671
- /* @__PURE__ */ i(we, { titleKey: "anamnesis.section.pathologies", t: a, children: d.pathologyCodes.length > 0 ? /* @__PURE__ */ i("div", { className: "ds:flex ds:flex-wrap ds:gap-[var(--spacing-xs)]", children: d.pathologyCodes.map((T) => /* @__PURE__ */ i(Y, { variant: "neutral", size: "md", children: Se(T, a, f[T]) }, T)) }) : /* @__PURE__ */ i("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: a("anamnesis.readOnly.none") }) }),
5679
+ /* @__PURE__ */ i(we, { titleKey: "anamnesis.section.pathologies", t: a, children: d.pathologyCodes.length > 0 ? /* @__PURE__ */ i("div", { className: "ds:flex ds:flex-wrap ds:gap-[var(--spacing-xs)]", children: d.pathologyCodes.map((N) => /* @__PURE__ */ i(Y, { variant: "neutral", size: "md", children: Se(N, a, f[N]) }, N)) }) : /* @__PURE__ */ i("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: a("anamnesis.readOnly.none") }) }),
5672
5680
  y ? /* @__PURE__ */ i(we, { titleKey: "anamnesis.section.oncological", t: a, children: /* @__PURE__ */ c(
5673
5681
  L,
5674
5682
  {
@@ -5691,24 +5699,24 @@ function bl({
5691
5699
  ]
5692
5700
  }
5693
5701
  ) }) : null,
5694
- /* @__PURE__ */ i(we, { titleKey: "anamnesis.section.therapy", t: a, children: d.therapy.length > 0 ? /* @__PURE__ */ i("ul", { className: "ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-0", children: d.therapy.map((T) => /* @__PURE__ */ c(
5702
+ /* @__PURE__ */ i(we, { titleKey: "anamnesis.section.therapy", t: a, children: d.therapy.length > 0 ? /* @__PURE__ */ i("ul", { className: "ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-0", children: d.therapy.map((N) => /* @__PURE__ */ c(
5695
5703
  "li",
5696
5704
  {
5697
5705
  className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]",
5698
5706
  children: [
5699
- /* @__PURE__ */ i("span", { className: "type-label ds:text-[color:var(--foreground)]", children: T.name }),
5700
- T.dose ? /* @__PURE__ */ i("span", { className: "type-meta ds:text-[color:var(--muted-foreground)]", children: T.dose }) : null,
5707
+ /* @__PURE__ */ i("span", { className: "type-label ds:text-[color:var(--foreground)]", children: N.name }),
5708
+ N.dose ? /* @__PURE__ */ i("span", { className: "type-meta ds:text-[color:var(--muted-foreground)]", children: N.dose }) : null,
5701
5709
  /* @__PURE__ */ i(
5702
5710
  Y,
5703
5711
  {
5704
- variant: T.kind === "medication" ? "info" : "neutral",
5712
+ variant: N.kind === "medication" ? "info" : "neutral",
5705
5713
  size: "sm",
5706
- children: a(`anamnesis.medKind.${T.kind}`)
5714
+ children: a(`anamnesis.medKind.${N.kind}`)
5707
5715
  }
5708
5716
  )
5709
5717
  ]
5710
5718
  },
5711
- T.id
5719
+ N.id
5712
5720
  )) }) : /* @__PURE__ */ i("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: a("anamnesis.readOnly.none") }) }),
5713
5721
  /* @__PURE__ */ i(we, { titleKey: "anamnesis.section.labs", t: a, children: /* @__PURE__ */ i(
5714
5722
  $a,
@@ -5730,32 +5738,32 @@ function bl({
5730
5738
  /* @__PURE__ */ i("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: d.clinicalNotes })
5731
5739
  ] }) : null
5732
5740
  ] }) : null,
5733
- N ? /* @__PURE__ */ i(we, { titleKey: "anamnesis.section.annual", t: a, children: /* @__PURE__ */ c("div", { className: "ds:flex ds:flex-wrap ds:gap-[var(--spacing-xs)]", children: [
5741
+ A ? /* @__PURE__ */ i(we, { titleKey: "anamnesis.section.annual", t: a, children: /* @__PURE__ */ c("div", { className: "ds:flex ds:flex-wrap ds:gap-[var(--spacing-xs)]", children: [
5734
5742
  /* @__PURE__ */ c(
5735
5743
  Y,
5736
5744
  {
5737
- variant: N.proposed ? "success" : "neutral",
5745
+ variant: A.proposed ? "success" : "neutral",
5738
5746
  size: "md",
5739
5747
  withDot: !0,
5740
5748
  children: [
5741
5749
  a("anamnesis.field.annualProposed.label"),
5742
5750
  ":",
5743
5751
  " ",
5744
- N.proposed ? a("anamnesis.common.yes") : a("anamnesis.common.no")
5752
+ A.proposed ? a("anamnesis.common.yes") : a("anamnesis.common.no")
5745
5753
  ]
5746
5754
  }
5747
5755
  ),
5748
5756
  /* @__PURE__ */ c(
5749
5757
  Y,
5750
5758
  {
5751
- variant: N.accepted ? "success" : "neutral",
5759
+ variant: A.accepted ? "success" : "neutral",
5752
5760
  size: "md",
5753
5761
  withDot: !0,
5754
5762
  children: [
5755
5763
  a("anamnesis.field.annualAccepted.label"),
5756
5764
  ":",
5757
5765
  " ",
5758
- N.accepted ? a("anamnesis.common.yes") : a("anamnesis.common.no")
5766
+ A.accepted ? a("anamnesis.common.yes") : a("anamnesis.common.no")
5759
5767
  ]
5760
5768
  }
5761
5769
  )
@@ -5764,7 +5772,7 @@ function bl({
5764
5772
  yi,
5765
5773
  {
5766
5774
  intake: e.intake,
5767
- sections: k,
5775
+ sections: x,
5768
5776
  sex: l.sex,
5769
5777
  t: a
5770
5778
  }
@@ -5786,7 +5794,7 @@ function bl({
5786
5794
  record: e,
5787
5795
  t: a,
5788
5796
  config: n,
5789
- shownVisitIds: A
5797
+ shownVisitIds: T
5790
5798
  }
5791
5799
  )
5792
5800
  }
@@ -5801,7 +5809,7 @@ function $t({
5801
5809
  }) {
5802
5810
  return e ? /* @__PURE__ */ i("div", { className: "ds:flex ds:w-full ds:flex-col ds:gap-[var(--spacing-lg)]", children: a }) : /* @__PURE__ */ i("div", { className: "ds:min-h-[100dvh] ds:w-full ds:bg-[color:var(--app-shell-background)] ds:py-[var(--spacing-lg)]", children: /* @__PURE__ */ i("div", { className: "ds:mx-auto ds:flex ds:w-full ds:max-w-[76rem] ds:flex-col ds:gap-[var(--spacing-lg)] ds:px-[var(--spacing-md)]", children: a }) });
5803
5811
  }
5804
- const fl = [];
5812
+ const hl = [];
5805
5813
  function ca({
5806
5814
  variant: e = "first-use",
5807
5815
  testId: a = "anamnesis-empty-card",
@@ -5831,28 +5839,28 @@ function Ki({
5831
5839
  statusSlot: r,
5832
5840
  onTargetChange: l,
5833
5841
  hideTargetStrip: s = !1,
5834
- leadingTabs: d = fl,
5842
+ leadingTabs: d = hl,
5835
5843
  readOnly: u = !1,
5836
5844
  questionnaireSlot: g,
5837
5845
  questionnaireHeaderSlot: b,
5838
5846
  emptyState: m,
5839
5847
  partitionBySource: v = !1,
5840
- tab: k,
5848
+ tab: x,
5841
5849
  onTabChange: f,
5842
- defaultTab: A
5850
+ defaultTab: T
5843
5851
  }) {
5844
5852
  const [h, y] = I(
5845
5853
  () => {
5846
5854
  var V;
5847
- return A ?? ((V = d[0]) == null ? void 0 : V.value) ?? "questionnaire";
5855
+ return T ?? ((V = d[0]) == null ? void 0 : V.value) ?? "questionnaire";
5848
5856
  }
5849
- ), N = k ?? h, j = (V) => {
5850
- k === void 0 && y(V), f == null || f(V);
5851
- }, [T, R] = I(e), [p, S] = I(e);
5857
+ ), A = x ?? h, j = (V) => {
5858
+ x === void 0 && y(V), f == null || f(V);
5859
+ }, [N, R] = I(e), [p, S] = I(e);
5852
5860
  e !== p && (S(e), R(e));
5853
- const w = H(
5854
- () => new Map(T.targets.map((V) => [V.parameterKey, V.target])),
5855
- [T.targets]
5861
+ const k = H(
5862
+ () => new Map(N.targets.map((V) => [V.parameterKey, V.target])),
5863
+ [N.targets]
5856
5864
  ), C = H(() => Vi(t), [t]), F = H(
5857
5865
  () => De(t),
5858
5866
  [t]
@@ -5861,7 +5869,7 @@ function Ki({
5861
5869
  }, [D, q] = ft(), $ = /* @__PURE__ */ i(
5862
5870
  bt,
5863
5871
  {
5864
- record: T,
5872
+ record: N,
5865
5873
  t: a,
5866
5874
  config: t,
5867
5875
  framed: !1,
@@ -5872,7 +5880,7 @@ function Ki({
5872
5880
  At,
5873
5881
  {
5874
5882
  tab: "evolution",
5875
- record: T,
5883
+ record: N,
5876
5884
  t: a,
5877
5885
  config: t,
5878
5886
  shownVisitIds: D
@@ -5885,17 +5893,17 @@ function Ki({
5885
5893
  // explicit column gap keeps the strip from sitting flush on the card
5886
5894
  // below it, which read as a rendering fault rather than as a heading.
5887
5895
  /* @__PURE__ */ c("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", children: [
5888
- s || m || T.visits.length === 0 ? null : /* @__PURE__ */ i(
5896
+ s || m || N.visits.length === 0 ? null : /* @__PURE__ */ i(
5889
5897
  Bi,
5890
5898
  {
5891
- visits: T.visits,
5899
+ visits: N.visits,
5892
5900
  defs: C,
5893
- targets: w,
5901
+ targets: k,
5894
5902
  t: a,
5895
5903
  onTargetChange: O
5896
5904
  }
5897
5905
  ),
5898
- /* @__PURE__ */ c(Q, { value: N, onValueChange: j, children: [
5906
+ /* @__PURE__ */ c(Q, { value: A, onValueChange: j, children: [
5899
5907
  /* @__PURE__ */ c("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
5900
5908
  /* @__PURE__ */ c(Q.List, { "aria-label": a("anamnesis.compile.viewsLabel"), children: [
5901
5909
  d.map((V) => /* @__PURE__ */ i(Q.Trigger, { value: V.value, children: V.label }, V.value)),
@@ -5925,7 +5933,7 @@ function Ki({
5925
5933
  g ?? /* @__PURE__ */ i(
5926
5934
  qi,
5927
5935
  {
5928
- record: T,
5936
+ record: N,
5929
5937
  t: a,
5930
5938
  embedded: !0,
5931
5939
  config: t,
@@ -5951,7 +5959,7 @@ function Ki({
5951
5959
  title: a("anamnesis.questionnaire.noNumeric.title"),
5952
5960
  description: a("anamnesis.questionnaire.noNumeric.description")
5953
5961
  }
5954
- ) : T.visits.length === 0 ? (
5962
+ ) : N.visits.length === 0 ? (
5955
5963
  /* The evolution's own bare no-visits state sat on the page ground
5956
5964
  while the questionnaire's sat in a card: same shell for both. */
5957
5965
  /* @__PURE__ */ i(
@@ -5979,7 +5987,7 @@ function Ki({
5979
5987
  );
5980
5988
  }
5981
5989
  Ki.displayName = "AnamnesisQuestionnaire";
5982
- function td({
5990
+ function ed({
5983
5991
  mode: e,
5984
5992
  record: a,
5985
5993
  t,
@@ -5994,18 +6002,18 @@ function td({
5994
6002
  intakeJumpToField: b,
5995
6003
  readOnly: m,
5996
6004
  onMissingAnswerJump: v,
5997
- onRecordChange: k,
6005
+ onRecordChange: x,
5998
6006
  leadingTabs: f,
5999
- questionnaireTab: A,
6007
+ questionnaireTab: T,
6000
6008
  onQuestionnaireTabChange: h,
6001
6009
  questionnaireSlot: y,
6002
- questionnaireHeaderSlot: N,
6010
+ questionnaireHeaderSlot: A,
6003
6011
  emptyState: j,
6004
- partitionBySource: T,
6012
+ partitionBySource: N,
6005
6013
  defaultQuestionnaireTab: R,
6006
6014
  practitioners: p,
6007
6015
  newVisitDateIso: S,
6008
- defaultView: w,
6016
+ defaultView: k,
6009
6017
  defaultExportMenuOpen: C,
6010
6018
  defaultShareOpen: F,
6011
6019
  defaultExportAudience: O
@@ -6033,17 +6041,17 @@ function td({
6033
6041
  onTargetChange: l,
6034
6042
  hideTargetStrip: s,
6035
6043
  leadingTabs: f,
6036
- tab: A,
6044
+ tab: T,
6037
6045
  onTabChange: h,
6038
6046
  defaultTab: R,
6039
6047
  readOnly: m,
6040
6048
  questionnaireSlot: y,
6041
- questionnaireHeaderSlot: N,
6049
+ questionnaireHeaderSlot: A,
6042
6050
  emptyState: j,
6043
- partitionBySource: T
6051
+ partitionBySource: N
6044
6052
  }
6045
6053
  ) : e === "compile" ? /* @__PURE__ */ i(
6046
- rl,
6054
+ nl,
6047
6055
  {
6048
6056
  record: a,
6049
6057
  t,
@@ -6054,24 +6062,24 @@ function td({
6054
6062
  statusSlot: d,
6055
6063
  onOpenNote: u,
6056
6064
  onMissingAnswerJump: v,
6057
- onRecordChange: k,
6065
+ onRecordChange: x,
6058
6066
  practitioners: p,
6059
6067
  newVisitDateIso: S,
6060
- defaultView: w,
6068
+ defaultView: k,
6061
6069
  defaultExportMenuOpen: C,
6062
6070
  defaultShareOpen: F,
6063
6071
  defaultExportAudience: O,
6064
- partitionBySource: T
6072
+ partitionBySource: N
6065
6073
  }
6066
6074
  ) : /* @__PURE__ */ i(
6067
- bl,
6075
+ gl,
6068
6076
  {
6069
6077
  record: a,
6070
6078
  t,
6071
6079
  embedded: o,
6072
6080
  config: r,
6073
6081
  onOpenNote: u,
6074
- partitionBySource: T
6082
+ partitionBySource: N
6075
6083
  }
6076
6084
  );
6077
6085
  return o ? /* @__PURE__ */ i(
@@ -6095,7 +6103,7 @@ function td({
6095
6103
  }
6096
6104
  );
6097
6105
  }
6098
- const yl = Xt("", {
6106
+ const bl = Xt("", {
6099
6107
  variants: {
6100
6108
  dragging: {
6101
6109
  true: "ds:opacity-60",
@@ -6136,11 +6144,11 @@ function Za({
6136
6144
  "AnamnesisReorderRow must render inside an AnamnesisReorderGroup"
6137
6145
  );
6138
6146
  const { t: l } = n, s = (m, v) => {
6139
- const k = Math.max(0, Math.min(n.count - 1, v));
6140
- k !== m && (n.onReorder(m, k), n.announce(
6147
+ const x = Math.max(0, Math.min(n.count - 1, v));
6148
+ x !== m && (n.onReorder(m, x), n.announce(
6141
6149
  l("anamnesis.configEditor.reorderAnnounce", {
6142
6150
  name: a,
6143
- to: k + 1,
6151
+ to: x + 1,
6144
6152
  total: n.count
6145
6153
  })
6146
6154
  ));
@@ -6163,7 +6171,7 @@ function Za({
6163
6171
  const v = n.dragSource;
6164
6172
  r(!1), n.setDragSource(null), !(v === null || v === e) && s(v, e);
6165
6173
  },
6166
- className: yl({
6174
+ className: bl({
6167
6175
  dragging: u,
6168
6176
  dropTarget: o && !u
6169
6177
  })
@@ -6180,7 +6188,7 @@ function Za({
6180
6188
  );
6181
6189
  return t({ rowProps: g, handle: b });
6182
6190
  }
6183
- function id() {
6191
+ function ad() {
6184
6192
  return {
6185
6193
  parameters: $e.parameters.map((e) => ({
6186
6194
  ...e,
@@ -6209,7 +6217,7 @@ function Ja(e, a, t) {
6209
6217
  const n = [...e], [o] = n.splice(a, 1);
6210
6218
  return n.splice(t, 0, o), n;
6211
6219
  }
6212
- const vl = [
6220
+ const fl = [
6213
6221
  "text",
6214
6222
  "textarea",
6215
6223
  "numberInteger",
@@ -6220,7 +6228,7 @@ const vl = [
6220
6228
  "multiChoice",
6221
6229
  "frequency",
6222
6230
  "meal"
6223
- ], kl = new Set(
6231
+ ], yl = new Set(
6224
6232
  $e.intakeSections.flatMap(
6225
6233
  (e) => e.fields.map((a) => a.key)
6226
6234
  )
@@ -6229,8 +6237,8 @@ function Ui(e, a) {
6229
6237
  const t = e.type === "number" ? e.decimal ? "numberDecimal" : "numberInteger" : e.type === "choice" && e.detail ? "choiceWithText" : e.type;
6230
6238
  return a(`anamnesis.configEditor.type.${t}`);
6231
6239
  }
6232
- const wl = ["down", "up", "toRange"], nt = ["anthropometric", "dietary", "lab"];
6233
- function nd({
6240
+ const vl = ["down", "up", "toRange"], nt = ["anthropometric", "dietary", "lab"];
6241
+ function td({
6234
6242
  config: e,
6235
6243
  onConfigChange: a,
6236
6244
  t,
@@ -6239,31 +6247,31 @@ function nd({
6239
6247
  const [o, r] = I(null), [l, s] = I(null), d = (p) => a({ ...e, parameters: e.parameters.map(p) }), u = (p) => a({
6240
6248
  ...e,
6241
6249
  intakeSections: e.intakeSections.map(p)
6242
- }), g = (p, S, w) => u(
6250
+ }), g = (p, S, k) => u(
6243
6251
  (C) => C.key === p ? {
6244
6252
  ...C,
6245
6253
  fields: C.fields.map(
6246
- (F) => F.key === S ? w(F) : F
6254
+ (F) => F.key === S ? k(F) : F
6247
6255
  )
6248
6256
  } : C
6249
- ), b = (p) => a({ ...e, pathologies: e.pathologies.map(p) }), m = (p, S, w) => {
6250
- const C = De(e, p), F = Ja(C, S, w);
6257
+ ), b = (p) => a({ ...e, pathologies: e.pathologies.map(p) }), m = (p, S, k) => {
6258
+ const C = De(e, p), F = Ja(C, S, k);
6251
6259
  if (!F) return;
6252
6260
  const O = new Map(F.map((D, q) => [D.key, q]));
6253
6261
  d(
6254
6262
  (D) => O.has(D.key) ? { ...D, order: O.get(D.key) } : D
6255
6263
  );
6256
6264
  }, v = (p, S) => {
6257
- const w = Ja(We(e), p, S);
6258
- if (!w) return;
6265
+ const k = Ja(We(e), p, S);
6266
+ if (!k) return;
6259
6267
  const C = new Map(
6260
- w.map((F, O) => [F.key, O])
6268
+ k.map((F, O) => [F.key, O])
6261
6269
  );
6262
6270
  u(
6263
6271
  (F) => C.has(F.key) ? { ...F, order: C.get(F.key) } : F
6264
6272
  );
6265
- }, k = (p, S, w) => {
6266
- const C = Ja(p.fields, S, w);
6273
+ }, x = (p, S, k) => {
6274
+ const C = Ja(p.fields, S, k);
6267
6275
  if (!C) return;
6268
6276
  const F = new Map(
6269
6277
  C.map((O, D) => [O.key, D])
@@ -6278,22 +6286,22 @@ function nd({
6278
6286
  );
6279
6287
  }, f = (p, S) => {
6280
6288
  p.kind === "parameter" ? d(
6281
- (w) => w.key === p.entry.key ? { ...w, enabled: S } : w
6289
+ (k) => k.key === p.entry.key ? { ...k, enabled: S } : k
6282
6290
  ) : p.kind === "section" ? u(
6283
- (w) => w.key === p.entry.key ? { ...w, enabled: S } : w
6284
- ) : p.kind === "field" ? g(p.sectionKey, p.entry.key, (w) => ({
6285
- ...w,
6291
+ (k) => k.key === p.entry.key ? { ...k, enabled: S } : k
6292
+ ) : p.kind === "field" ? g(p.sectionKey, p.entry.key, (k) => ({
6293
+ ...k,
6286
6294
  enabled: S
6287
6295
  })) : b(
6288
- (w) => w.code === p.entry.code ? { ...w, enabled: S } : w
6296
+ (k) => k.code === p.entry.code ? { ...k, enabled: S } : k
6289
6297
  );
6290
- }, A = xe(e).length, h = De(e).length, y = st(e).reduce(
6298
+ }, T = xe(e).length, h = De(e).length, y = st(e).reduce(
6291
6299
  (p, S) => p + S.fields.length,
6292
6300
  0
6293
- ), N = We(e).reduce(
6301
+ ), A = We(e).reduce(
6294
6302
  (p, S) => p + S.fields.length,
6295
6303
  0
6296
- ), j = ri(e).length, T = et(e).length, R = xe(e).filter(
6304
+ ), j = ri(e).length, N = et(e).length, R = xe(e).filter(
6297
6305
  (p) => p.goal === !0
6298
6306
  ).length;
6299
6307
  return /* @__PURE__ */ c(
@@ -6320,7 +6328,7 @@ function nd({
6320
6328
  })} · ${t("anamnesis.configEditor.panelNotCaptured", {
6321
6329
  // Not "archived": this also counts live questions inside
6322
6330
  // an archived section, which capture drops as a whole.
6323
- count: N - y
6331
+ count: A - y
6324
6332
  })}` }),
6325
6333
  /* @__PURE__ */ i(
6326
6334
  Qa,
@@ -6330,7 +6338,7 @@ function nd({
6330
6338
  t,
6331
6339
  children: We(e).map(
6332
6340
  (p, S) => {
6333
- const w = p.enabled === !1, C = p.fields.filter(
6341
+ const k = p.enabled === !1, C = p.fields.filter(
6334
6342
  (F) => F.enabled !== !1
6335
6343
  ).length;
6336
6344
  return /* @__PURE__ */ i(
@@ -6353,7 +6361,7 @@ function nd({
6353
6361
  children: [
6354
6362
  /* @__PURE__ */ c("h3", { className: "type-title-item ds:m-0 ds:flex ds:items-center ds:gap-[var(--spacing-xs)] ds:text-[color:var(--foreground)]", children: [
6355
6363
  ye(p, t),
6356
- w ? /* @__PURE__ */ i(Y, { size: "sm", variant: "neutral", children: t("anamnesis.configEditor.archived") }) : null
6364
+ k ? /* @__PURE__ */ i(Y, { size: "sm", variant: "neutral", children: t("anamnesis.configEditor.archived") }) : null
6357
6365
  ] }),
6358
6366
  /* @__PURE__ */ c(
6359
6367
  xa,
@@ -6384,7 +6392,7 @@ function nd({
6384
6392
  })
6385
6393
  }
6386
6394
  ),
6387
- w ? /* @__PURE__ */ i(
6395
+ k ? /* @__PURE__ */ i(
6388
6396
  de,
6389
6397
  {
6390
6398
  size: "sm",
@@ -6421,14 +6429,14 @@ function nd({
6421
6429
  ]
6422
6430
  }
6423
6431
  ),
6424
- C === 0 && !w ? /* @__PURE__ */ i("p", { className: "type-meta ds:m-0 ds:text-[color:var(--muted-foreground)]", children: t(
6432
+ C === 0 && !k ? /* @__PURE__ */ i("p", { className: "type-meta ds:m-0 ds:text-[color:var(--muted-foreground)]", children: t(
6425
6433
  "anamnesis.configEditor.sectionEmptyCapture"
6426
6434
  ) }) : null,
6427
6435
  p.fields.length > 0 ? /* @__PURE__ */ i(
6428
6436
  Qa,
6429
6437
  {
6430
6438
  count: p.fields.length,
6431
- onReorder: (D, q) => k(p, D, q),
6439
+ onReorder: (D, q) => x(p, D, q),
6432
6440
  t,
6433
6441
  children: /* @__PURE__ */ i(aa, { divider: "divided", children: p.fields.map((D, q) => /* @__PURE__ */ i(
6434
6442
  Za,
@@ -6595,9 +6603,9 @@ function nd({
6595
6603
  ] }) }),
6596
6604
  /* @__PURE__ */ i(Q.Content, { value: "parameters", children: /* @__PURE__ */ c("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)] ds:pt-[var(--spacing-md)]", children: [
6597
6605
  /* @__PURE__ */ i("p", { className: "type-meta ds:m-0 ds:text-[color:var(--muted-foreground)]", children: `${t("anamnesis.configEditor.panelLive", {
6598
- count: A
6606
+ count: T
6599
6607
  })} · ${t("anamnesis.configEditor.panelArchived", {
6600
- count: h - A
6608
+ count: h - T
6601
6609
  })}` }),
6602
6610
  nt.map((p) => {
6603
6611
  const S = De(
@@ -6614,28 +6622,28 @@ function nd({
6614
6622
  Qa,
6615
6623
  {
6616
6624
  count: S.length,
6617
- onReorder: (w, C) => m(p, w, C),
6625
+ onReorder: (k, C) => m(p, k, C),
6618
6626
  t,
6619
- children: /* @__PURE__ */ i(aa, { divider: "divided", children: S.map((w, C) => {
6627
+ children: /* @__PURE__ */ i(aa, { divider: "divided", children: S.map((k, C) => {
6620
6628
  const F = [
6621
- zl(w, t),
6629
+ kl(k, t),
6622
6630
  t(
6623
- `anamnesis.configEditor.direction.${w.betterDirection}`
6631
+ `anamnesis.configEditor.direction.${k.betterDirection}`
6624
6632
  ),
6625
- w.locked ? t("anamnesis.configEditor.lockedHint") : null
6633
+ k.locked ? t("anamnesis.configEditor.lockedHint") : null
6626
6634
  ].filter(Boolean).join(" · ");
6627
6635
  return /* @__PURE__ */ i(
6628
6636
  Za,
6629
6637
  {
6630
6638
  index: C,
6631
- label: Te(w, t),
6639
+ label: Te(k, t),
6632
6640
  children: ({ rowProps: O, handle: D }) => /* @__PURE__ */ i(
6633
6641
  aa.Item,
6634
6642
  {
6635
6643
  ...O,
6636
6644
  title: /* @__PURE__ */ c("span", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", children: [
6637
- Te(w, t),
6638
- w.locked ? /* @__PURE__ */ i(
6645
+ Te(k, t),
6646
+ k.locked ? /* @__PURE__ */ i(
6639
6647
  Y,
6640
6648
  {
6641
6649
  size: "sm",
@@ -6644,7 +6652,7 @@ function nd({
6644
6652
  children: t("anamnesis.configEditor.locked")
6645
6653
  }
6646
6654
  ) : null,
6647
- w.enabled === !1 ? /* @__PURE__ */ i(Y, { size: "sm", variant: "neutral", children: t(
6655
+ k.enabled === !1 ? /* @__PURE__ */ i(Y, { size: "sm", variant: "neutral", children: t(
6648
6656
  "anamnesis.configEditor.archived"
6649
6657
  ) }) : null
6650
6658
  ] }),
@@ -6656,7 +6664,7 @@ function nd({
6656
6664
  "anamnesis.configEditor.rowActions",
6657
6665
  {
6658
6666
  name: Te(
6659
- w,
6667
+ k,
6660
6668
  t
6661
6669
  )
6662
6670
  }
@@ -6673,18 +6681,18 @@ function nd({
6673
6681
  "anamnesis.configEditor.edit",
6674
6682
  {
6675
6683
  name: Te(
6676
- w,
6684
+ k,
6677
6685
  t
6678
6686
  )
6679
6687
  }
6680
6688
  ),
6681
6689
  onClick: () => r({
6682
6690
  kind: "parameter",
6683
- entry: w
6691
+ entry: k
6684
6692
  })
6685
6693
  }
6686
6694
  ),
6687
- w.locked ? null : w.enabled === !1 ? /* @__PURE__ */ i(
6695
+ k.locked ? null : k.enabled === !1 ? /* @__PURE__ */ i(
6688
6696
  de,
6689
6697
  {
6690
6698
  size: "sm",
@@ -6694,7 +6702,7 @@ function nd({
6694
6702
  "anamnesis.configEditor.restore",
6695
6703
  {
6696
6704
  name: Te(
6697
- w,
6705
+ k,
6698
6706
  t
6699
6707
  )
6700
6708
  }
@@ -6702,7 +6710,7 @@ function nd({
6702
6710
  onClick: () => f(
6703
6711
  {
6704
6712
  kind: "parameter",
6705
- entry: w
6713
+ entry: k
6706
6714
  },
6707
6715
  void 0
6708
6716
  )
@@ -6717,7 +6725,7 @@ function nd({
6717
6725
  "anamnesis.configEditor.archive",
6718
6726
  {
6719
6727
  name: Te(
6720
- w,
6728
+ k,
6721
6729
  t
6722
6730
  )
6723
6731
  }
@@ -6725,7 +6733,7 @@ function nd({
6725
6733
  onClick: () => f(
6726
6734
  {
6727
6735
  kind: "parameter",
6728
- entry: w
6736
+ entry: k
6729
6737
  },
6730
6738
  !1
6731
6739
  )
@@ -6737,7 +6745,7 @@ function nd({
6737
6745
  }
6738
6746
  )
6739
6747
  },
6740
- w.key
6748
+ k.key
6741
6749
  );
6742
6750
  }) })
6743
6751
  }
@@ -6762,12 +6770,12 @@ function nd({
6762
6770
  /* @__PURE__ */ i("p", { className: "type-meta ds:m-0 ds:text-[color:var(--muted-foreground)]", children: `${t("anamnesis.configEditor.panelLive", {
6763
6771
  count: j
6764
6772
  })} · ${t("anamnesis.configEditor.panelArchived", {
6765
- count: T - j
6773
+ count: N - j
6766
6774
  })}` }),
6767
6775
  /* @__PURE__ */ i(aa, { divider: "divided", children: et(e).map((p) => {
6768
6776
  const S = e.pathologies.some(
6769
6777
  (C) => C.parentCode === p.code && C.enabled !== !1
6770
- ), w = [
6778
+ ), k = [
6771
6779
  p.parentCode ? t("anamnesis.configEditor.subCodeOf", {
6772
6780
  code: p.parentCode
6773
6781
  }) : null,
@@ -6780,7 +6788,7 @@ function nd({
6780
6788
  Se(p.code, t, p),
6781
6789
  p.enabled === !1 ? /* @__PURE__ */ i(Y, { size: "sm", variant: "neutral", children: t("anamnesis.configEditor.archived") }) : null
6782
6790
  ] }),
6783
- description: w || void 0,
6791
+ description: k || void 0,
6784
6792
  trailing: /* @__PURE__ */ c(
6785
6793
  xa,
6786
6794
  {
@@ -6878,16 +6886,16 @@ function nd({
6878
6886
  className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
6879
6887
  children: [
6880
6888
  /* @__PURE__ */ i("h3", { className: "type-title-item ds:m-0 ds:text-[color:var(--foreground)]", children: t(`anamnesis.group.${p}`) }),
6881
- /* @__PURE__ */ i("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: S.map((w) => /* @__PURE__ */ i(
6889
+ /* @__PURE__ */ i("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: S.map((k) => /* @__PURE__ */ i(
6882
6890
  rt,
6883
6891
  {
6884
- label: Te(w, t),
6885
- checked: w.goal === !0,
6892
+ label: Te(k, t),
6893
+ checked: k.goal === !0,
6886
6894
  onCheckedChange: (C) => d(
6887
- (F) => F.key === w.key ? { ...F, goal: C === !0 } : F
6895
+ (F) => F.key === k.key ? { ...F, goal: C === !0 } : F
6888
6896
  )
6889
6897
  },
6890
- w.key
6898
+ k.key
6891
6899
  )) })
6892
6900
  ]
6893
6901
  },
@@ -6897,7 +6905,7 @@ function nd({
6897
6905
  ] }) })
6898
6906
  ] }) }) }),
6899
6907
  /* @__PURE__ */ i(
6900
- xl,
6908
+ wl,
6901
6909
  {
6902
6910
  editing: o,
6903
6911
  onClose: () => r(null),
@@ -6907,7 +6915,7 @@ function nd({
6907
6915
  }
6908
6916
  ),
6909
6917
  /* @__PURE__ */ i(
6910
- Cl,
6918
+ Nl,
6911
6919
  {
6912
6920
  adding: l,
6913
6921
  onClose: () => s(null),
@@ -6920,11 +6928,11 @@ function nd({
6920
6928
  }
6921
6929
  );
6922
6930
  }
6923
- function zl(e, a) {
6931
+ function kl(e, a) {
6924
6932
  const t = e.referenceRange;
6925
6933
  return t ? t.min != null && t.max != null ? `${t.min}–${t.max}` : t.max != null ? a("anamnesis.range.atMost", { value: t.max }) : t.min != null ? a("anamnesis.range.atLeast", { value: t.min }) : null : null;
6926
6934
  }
6927
- function xl({
6935
+ function wl({
6928
6936
  editing: e,
6929
6937
  onClose: a,
6930
6938
  config: t,
@@ -6939,7 +6947,7 @@ function xl({
6939
6947
  r || a();
6940
6948
  },
6941
6949
  children: e ? /* @__PURE__ */ i(
6942
- Nl,
6950
+ xl,
6943
6951
  {
6944
6952
  editing: e,
6945
6953
  onClose: a,
@@ -6947,31 +6955,31 @@ function xl({
6947
6955
  onConfigChange: n,
6948
6956
  t: o
6949
6957
  },
6950
- Al(e)
6958
+ zl(e)
6951
6959
  ) : null
6952
6960
  }
6953
6961
  );
6954
6962
  }
6955
- function Al(e) {
6963
+ function zl(e) {
6956
6964
  return e.kind === "pathology" ? `pathology:${e.entry.code}` : e.kind === "field" ? `field:${e.sectionKey}:${e.entry.key}` : `${e.kind}:${e.entry.key}`;
6957
6965
  }
6958
- function Nl({
6966
+ function xl({
6959
6967
  editing: e,
6960
6968
  onClose: a,
6961
6969
  config: t,
6962
6970
  onConfigChange: n,
6963
6971
  t: o
6964
6972
  }) {
6965
- const r = e.entry, l = Tl(e, o), [s, d] = I(r.label ?? ""), [u, g] = I(
6973
+ const r = e.entry, l = Al(e, o), [s, d] = I(r.label ?? ""), [u, g] = I(
6966
6974
  e.kind === "field" ? r.helpText ?? "" : ""
6967
6975
  ), [b, m] = I(
6968
6976
  e.kind === "field" && e.entry.required === !0
6969
- ), v = e.kind === "field" ? e.entry : null, k = v !== null && (v.type === "choice" || v.type === "multiChoice"), f = k && !kl.has(v.key), [A, h] = I(
6977
+ ), v = e.kind === "field" ? e.entry : null, x = v !== null && (v.type === "choice" || v.type === "multiChoice"), f = x && !yl.has(v.key), [T, h] = I(
6970
6978
  f ? (v.options ?? []).join(", ") : ""
6971
- ), y = A.split(",").map((T) => T.trim()).filter(Boolean), N = !f || y.length > 0, j = () => {
6972
- const T = s.trim(), R = (p) => {
6979
+ ), y = T.split(",").map((N) => N.trim()).filter(Boolean), A = !f || y.length > 0, j = () => {
6980
+ const N = s.trim(), R = (p) => {
6973
6981
  const S = { ...p };
6974
- return T ? S.label = T : delete S.label, S;
6982
+ return N ? S.label = N : delete S.label, S;
6975
6983
  };
6976
6984
  if (e.kind === "parameter")
6977
6985
  n({
@@ -6994,9 +7002,9 @@ function Nl({
6994
7002
  intakeSections: t.intakeSections.map(
6995
7003
  (S) => S.key === e.sectionKey ? {
6996
7004
  ...S,
6997
- fields: S.fields.map((w) => {
6998
- if (w.key !== e.entry.key) return w;
6999
- const C = R(w);
7005
+ fields: S.fields.map((k) => {
7006
+ if (k.key !== e.entry.key) return k;
7007
+ const C = R(k);
7000
7008
  return p ? C.helpText = p : delete C.helpText, f && (C.options = y), b ? C.required = !0 : delete C.required, C;
7001
7009
  })
7002
7010
  } : S
@@ -7034,7 +7042,7 @@ function Nl({
7034
7042
  te,
7035
7043
  {
7036
7044
  value: s,
7037
- onChange: (T) => d(T.target.value),
7045
+ onChange: (N) => d(N.target.value),
7038
7046
  placeholder: l
7039
7047
  }
7040
7048
  )
@@ -7044,7 +7052,7 @@ function Nl({
7044
7052
  na,
7045
7053
  {
7046
7054
  value: u,
7047
- onChange: (T) => g(T.target.value),
7055
+ onChange: (N) => g(N.target.value),
7048
7056
  minRows: 2
7049
7057
  }
7050
7058
  ) }) : null,
@@ -7053,7 +7061,7 @@ function Nl({
7053
7061
  {
7054
7062
  label: o("anamnesis.configEditor.requiredField"),
7055
7063
  checked: b,
7056
- onCheckedChange: (T) => m(T === !0)
7064
+ onCheckedChange: (N) => m(N === !0)
7057
7065
  }
7058
7066
  ) : null,
7059
7067
  f ? /* @__PURE__ */ i(
@@ -7065,26 +7073,26 @@ function Nl({
7065
7073
  children: /* @__PURE__ */ i(
7066
7074
  te,
7067
7075
  {
7068
- value: A,
7069
- onChange: (T) => h(T.target.value)
7076
+ value: T,
7077
+ onChange: (N) => h(N.target.value)
7070
7078
  }
7071
7079
  )
7072
7080
  }
7073
- ) : k ? /* @__PURE__ */ i("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: o("anamnesis.configEditor.optionsCurrent", {
7081
+ ) : x ? /* @__PURE__ */ i("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: o("anamnesis.configEditor.optionsCurrent", {
7074
7082
  list: (v.options ?? []).map(
7075
- (T) => o(`anamnesis.field.${v.key}.option.${T}`, {
7076
- defaultValue: T
7083
+ (N) => o(`anamnesis.field.${v.key}.option.${N}`, {
7084
+ defaultValue: N
7077
7085
  })
7078
7086
  ).join(", ")
7079
7087
  }) }) : null
7080
7088
  ] }),
7081
7089
  /* @__PURE__ */ c(ee.Footer, { children: [
7082
7090
  /* @__PURE__ */ i(ie, { intent: "ghost", onClick: a, children: o("anamnesis.configEditor.cancel") }),
7083
- /* @__PURE__ */ i(ie, { intent: "primary", onClick: j, disabled: !N, children: o("anamnesis.configEditor.save") })
7091
+ /* @__PURE__ */ i(ie, { intent: "primary", onClick: j, disabled: !A, children: o("anamnesis.configEditor.save") })
7084
7092
  ] })
7085
7093
  ] });
7086
7094
  }
7087
- function Tl(e, a) {
7095
+ function Al(e, a) {
7088
7096
  return e.kind === "parameter" ? Te({ ...e.entry, label: void 0 }, a) : e.kind === "section" ? ye({ ...e.entry, label: void 0 }, a) : e.kind === "field" ? ge({ ...e.entry, label: void 0 }, a) : Se(e.entry.code, a, {
7089
7097
  ...e.entry,
7090
7098
  label: void 0
@@ -7093,7 +7101,7 @@ function Tl(e, a) {
7093
7101
  function Xa(e) {
7094
7102
  return e === "choice" || e === "choiceWithText" || e === "multiChoice";
7095
7103
  }
7096
- function Cl({
7104
+ function Nl({
7097
7105
  adding: e,
7098
7106
  onClose: a,
7099
7107
  config: t,
@@ -7108,7 +7116,7 @@ function Cl({
7108
7116
  r || a();
7109
7117
  },
7110
7118
  children: e ? /* @__PURE__ */ i(
7111
- Sl,
7119
+ Tl,
7112
7120
  {
7113
7121
  adding: e,
7114
7122
  onClose: a,
@@ -7121,31 +7129,31 @@ function Cl({
7121
7129
  }
7122
7130
  );
7123
7131
  }
7124
- function Sl({
7132
+ function Tl({
7125
7133
  adding: e,
7126
7134
  onClose: a,
7127
7135
  config: t,
7128
7136
  onConfigChange: n,
7129
7137
  t: o
7130
7138
  }) {
7131
- const [r, l] = I(""), [s, d] = I(""), [u, g] = I(""), [b, m] = I(""), [v, k] = I(""), [f, A] = I(""), [h, y] = I("0"), [N, j] = I(""), [T, R] = I(""), [p, S] = I(""), [w, C] = I(""), [F, O] = I(!1), [D, q] = I(""), $ = nt.map((_) => ({
7139
+ const [r, l] = I(""), [s, d] = I(""), [u, g] = I(""), [b, m] = I(""), [v, x] = I(""), [f, T] = I(""), [h, y] = I("0"), [A, j] = I(""), [N, R] = I(""), [p, S] = I(""), [k, C] = I(""), [F, O] = I(!1), [D, q] = I(""), $ = nt.map((_) => ({
7132
7140
  value: _,
7133
7141
  label: o(`anamnesis.group.${_}`)
7134
- })), V = wl.map((_) => ({
7142
+ })), V = vl.map((_) => ({
7135
7143
  value: _,
7136
7144
  label: o(`anamnesis.configEditor.direction.${_}`)
7137
- })), P = vl.map((_) => ({
7145
+ })), P = fl.map((_) => ({
7138
7146
  value: _,
7139
7147
  label: o(`anamnesis.configEditor.type.${_}`)
7140
7148
  })), G = t.pathologies.filter((_) => !_.parentCode && _.enabled !== !1).map((_) => ({
7141
7149
  value: _.code,
7142
7150
  label: Se(_.code, o, _)
7143
- })), Z = T.split(",").map((_) => _.trim()).filter(Boolean), J = e.kind === "parameter" ? r.trim() !== "" && s !== "" && u !== "" : e.kind === "field" ? r.trim() !== "" && N !== "" && (!Xa(N) || Z.length > 0) : e.kind === "section" ? r.trim() !== "" : r.trim() !== "" && w.trim() !== "" && // A duplicate code would collide with the existing entry
7151
+ })), Z = N.split(",").map((_) => _.trim()).filter(Boolean), J = e.kind === "parameter" ? r.trim() !== "" && s !== "" && u !== "" : e.kind === "field" ? r.trim() !== "" && A !== "" && (!Xa(A) || Z.length > 0) : e.kind === "section" ? r.trim() !== "" : r.trim() !== "" && k.trim() !== "" && // A duplicate code would collide with the existing entry
7144
7152
  // everywhere codes are matched (lookup, archive, edit) —
7145
7153
  // uniqueness is the add gate, matching keyFromLabel's guarantee
7146
7154
  // on the other vocabularies.
7147
7155
  !t.pathologies.some(
7148
- (_) => _.code.toLowerCase() === w.trim().toLowerCase()
7156
+ (_) => _.code.toLowerCase() === k.trim().toLowerCase()
7149
7157
  ), me = () => {
7150
7158
  const _ = r.trim();
7151
7159
  if (e.kind === "parameter") {
@@ -7173,13 +7181,13 @@ function Sl({
7173
7181
  t.intakeSections.flatMap(
7174
7182
  (ue) => ue.fields.map((Ke) => Ke.key)
7175
7183
  )
7176
- ), se = N === "numberInteger" || N === "numberDecimal" ? "number" : N === "choiceWithText" ? "choice" : N, ce = {
7184
+ ), se = A === "numberInteger" || A === "numberDecimal" ? "number" : A === "choiceWithText" ? "choice" : A, ce = {
7177
7185
  key: Ya(_, K),
7178
7186
  label: _,
7179
7187
  type: se,
7180
- ...N === "numberDecimal" ? { decimal: !0 } : {},
7181
- ...N === "choiceWithText" ? { detail: !0 } : {},
7182
- ...Xa(N) ? { options: Z } : {},
7188
+ ...A === "numberDecimal" ? { decimal: !0 } : {},
7189
+ ...A === "choiceWithText" ? { detail: !0 } : {},
7190
+ ...Xa(A) ? { options: Z } : {},
7183
7191
  ...p.trim() ? { helpText: p.trim() } : {},
7184
7192
  ...F ? { required: !0 } : {}
7185
7193
  };
@@ -7203,7 +7211,7 @@ function Sl({
7203
7211
  });
7204
7212
  } else {
7205
7213
  const K = {
7206
- code: w.trim(),
7214
+ code: k.trim(),
7207
7215
  label: _,
7208
7216
  ...D ? { parentCode: D } : {}
7209
7217
  };
@@ -7214,7 +7222,7 @@ function Sl({
7214
7222
  }
7215
7223
  a();
7216
7224
  }, he = e.kind === "parameter" ? o("anamnesis.configEditor.addParameterTitle") : e.kind === "field" ? o("anamnesis.configEditor.addQuestionTitle", {
7217
- section: _l(t, e.sectionKey, o)
7225
+ section: Cl(t, e.sectionKey, o)
7218
7226
  }) : e.kind === "section" ? o("anamnesis.configEditor.addSectionTitle") : o("anamnesis.configEditor.addCodeTitle");
7219
7227
  return /* @__PURE__ */ c(ee.Content, { size: "sm", children: [
7220
7228
  /* @__PURE__ */ c(ee.Header, { children: [
@@ -7225,7 +7233,7 @@ function Sl({
7225
7233
  e.kind === "pathology" ? /* @__PURE__ */ i(M, { label: o("anamnesis.configEditor.codeField"), required: !0, children: /* @__PURE__ */ i(
7226
7234
  te,
7227
7235
  {
7228
- value: w,
7236
+ value: k,
7229
7237
  onChange: (_) => C(_.target.value)
7230
7238
  }
7231
7239
  ) }) : null,
@@ -7304,7 +7312,7 @@ function Sl({
7304
7312
  {
7305
7313
  inputMode: "decimal",
7306
7314
  value: v,
7307
- onChange: (_) => k(_.target.value)
7315
+ onChange: (_) => x(_.target.value)
7308
7316
  }
7309
7317
  )
7310
7318
  }
@@ -7319,7 +7327,7 @@ function Sl({
7319
7327
  {
7320
7328
  inputMode: "decimal",
7321
7329
  value: f,
7322
- onChange: (_) => A(_.target.value)
7330
+ onChange: (_) => T(_.target.value)
7323
7331
  }
7324
7332
  )
7325
7333
  }
@@ -7331,13 +7339,13 @@ function Sl({
7331
7339
  Me,
7332
7340
  {
7333
7341
  options: P,
7334
- value: N,
7342
+ value: A,
7335
7343
  onValueChange: (_) => j(_),
7336
7344
  placeholder: o("anamnesis.configEditor.selectPlaceholder"),
7337
7345
  "aria-label": o("anamnesis.configEditor.typeField")
7338
7346
  }
7339
7347
  ) }),
7340
- Xa(N) ? /* @__PURE__ */ i(
7348
+ Xa(A) ? /* @__PURE__ */ i(
7341
7349
  M,
7342
7350
  {
7343
7351
  label: o("anamnesis.configEditor.optionsField"),
@@ -7346,7 +7354,7 @@ function Sl({
7346
7354
  children: /* @__PURE__ */ i(
7347
7355
  te,
7348
7356
  {
7349
- value: T,
7357
+ value: N,
7350
7358
  onChange: (_) => R(_.target.value)
7351
7359
  }
7352
7360
  )
@@ -7396,7 +7404,7 @@ function Sl({
7396
7404
  ] })
7397
7405
  ] });
7398
7406
  }
7399
- function _l(e, a, t) {
7407
+ function Cl(e, a, t) {
7400
7408
  const n = e.intakeSections.find(
7401
7409
  (o) => o.key === a
7402
7410
  );
@@ -7405,7 +7413,7 @@ function _l(e, a, t) {
7405
7413
  function Qt(e) {
7406
7414
  return e.kind === "visit" ? `anamnesis-visit-${e.visitId}` : `anamnesis-event-${e.eventId}`;
7407
7415
  }
7408
- function od(e, a) {
7416
+ function id(e, a) {
7409
7417
  const t = e.visits.filter(Ai).map((o) => ({
7410
7418
  id: Qt({ kind: "visit", visitId: o.id }),
7411
7419
  dateIso: o.dateIso,
@@ -7445,7 +7453,7 @@ function od(e, a) {
7445
7453
  (o, r) => r.dateIso.localeCompare(o.dateIso)
7446
7454
  );
7447
7455
  }
7448
- const Dl = {
7456
+ const Sl = {
7449
7457
  anamnesis: {
7450
7458
  mainLabel: "سجل التاريخ المرضي: {{mode}}",
7451
7459
  mode: {
@@ -8217,7 +8225,7 @@ const Dl = {
8217
8225
  perWeek: "عدد المرات أسبوعيًا: {{times}}"
8218
8226
  }
8219
8227
  }
8220
- }, jl = {
8228
+ }, _l = {
8221
8229
  anamnesis: {
8222
8230
  mainLabel: "Anamneseakte: {{mode}}",
8223
8231
  mode: {
@@ -8953,7 +8961,7 @@ const Dl = {
8953
8961
  }
8954
8962
  }
8955
8963
  }
8956
- }, Pl = {
8964
+ }, Dl = {
8957
8965
  anamnesis: {
8958
8966
  mainLabel: "Φάκελος ιστορικού: {{mode}}",
8959
8967
  mode: {
@@ -9689,7 +9697,7 @@ const Dl = {
9689
9697
  }
9690
9698
  }
9691
9699
  }
9692
- }, El = {
9700
+ }, jl = {
9693
9701
  anamnesis: {
9694
9702
  mainLabel: "Anamnesis record — {{mode}}",
9695
9703
  mode: {
@@ -10425,7 +10433,7 @@ const Dl = {
10425
10433
  }
10426
10434
  }
10427
10435
  }
10428
- }, Ll = {
10436
+ }, Pl = {
10429
10437
  anamnesis: {
10430
10438
  mainLabel: "Historial de anamnesis: {{mode}}",
10431
10439
  mode: {
@@ -11170,7 +11178,7 @@ const Dl = {
11170
11178
  }
11171
11179
  }
11172
11180
  }
11173
- }, Fl = {
11181
+ }, El = {
11174
11182
  anamnesis: {
11175
11183
  mainLabel: "Dossier d’anamnèse : {{mode}}",
11176
11184
  mode: {
@@ -11915,7 +11923,7 @@ const Dl = {
11915
11923
  }
11916
11924
  }
11917
11925
  }
11918
- }, Il = {
11926
+ }, Ll = {
11919
11927
  anamnesis: {
11920
11928
  mainLabel: "चिकित्सा इतिहास रिकॉर्ड: {{mode}}",
11921
11929
  mode: {
@@ -12651,7 +12659,7 @@ const Dl = {
12651
12659
  }
12652
12660
  }
12653
12661
  }
12654
- }, Rl = {
12662
+ }, Fl = {
12655
12663
  anamnesis: {
12656
12664
  mainLabel: "Cartella anamnestica: {{mode}}",
12657
12665
  mode: {
@@ -13396,7 +13404,7 @@ const Dl = {
13396
13404
  }
13397
13405
  }
13398
13406
  }
13399
- }, Ol = {
13407
+ }, Il = {
13400
13408
  anamnesis: {
13401
13409
  mainLabel: "問診記録 — {{mode}}",
13402
13410
  mode: {
@@ -14132,7 +14140,7 @@ const Dl = {
14132
14140
  }
14133
14141
  }
14134
14142
  }
14135
- }, Ml = {
14143
+ }, Rl = {
14136
14144
  anamnesis: {
14137
14145
  mainLabel: "Anamnesedossier: {{mode}}",
14138
14146
  mode: {
@@ -14868,7 +14876,7 @@ const Dl = {
14868
14876
  }
14869
14877
  }
14870
14878
  }
14871
- }, Vl = {
14879
+ }, Ol = {
14872
14880
  anamnesis: {
14873
14881
  mainLabel: "Karta wywiadu medycznego: {{mode}}",
14874
14882
  mode: {
@@ -15622,7 +15630,7 @@ const Dl = {
15622
15630
  }
15623
15631
  }
15624
15632
  }
15625
- }, Hl = {
15633
+ }, Ml = {
15626
15634
  anamnesis: {
15627
15635
  mainLabel: "Registo de anamnese: {{mode}}",
15628
15636
  mode: {
@@ -16376,7 +16384,7 @@ const Dl = {
16376
16384
  }
16377
16385
  }
16378
16386
  }
16379
- }, Bl = {
16387
+ }, Vl = {
16380
16388
  anamnesis: {
16381
16389
  mainLabel: "Fișă de anamneză: {{mode}}",
16382
16390
  mode: {
@@ -17121,7 +17129,7 @@ const Dl = {
17121
17129
  }
17122
17130
  }
17123
17131
  }
17124
- }, ql = {
17132
+ }, Hl = {
17125
17133
  anamnesis: {
17126
17134
  mainLabel: "Карта анамнеза: {{mode}}",
17127
17135
  mode: {
@@ -17875,7 +17883,7 @@ const Dl = {
17875
17883
  }
17876
17884
  }
17877
17885
  }
17878
- }, Kl = {
17886
+ }, Bl = {
17879
17887
  anamnesis: {
17880
17888
  mainLabel: "Kartela e anamnezës: {{mode}}",
17881
17889
  mode: {
@@ -18611,7 +18619,7 @@ const Dl = {
18611
18619
  }
18612
18620
  }
18613
18621
  }
18614
- }, Gl = {
18622
+ }, ql = {
18615
18623
  anamnesis: {
18616
18624
  mainLabel: "Anamnesjournal: {{mode}}",
18617
18625
  mode: {
@@ -19347,7 +19355,7 @@ const Dl = {
19347
19355
  }
19348
19356
  }
19349
19357
  }
19350
- }, Ul = {
19358
+ }, Kl = {
19351
19359
  anamnesis: {
19352
19360
  mainLabel: "Anamnez kaydı: {{mode}}",
19353
19361
  mode: {
@@ -20083,7 +20091,7 @@ const Dl = {
20083
20091
  optionHasNote: "{{label}} · not"
20084
20092
  }
20085
20093
  }
20086
- }, Wl = {
20094
+ }, Gl = {
20087
20095
  anamnesis: {
20088
20096
  mainLabel: "病史档案:{{mode}}",
20089
20097
  mode: {
@@ -20819,31 +20827,31 @@ const Dl = {
20819
20827
  }
20820
20828
  }
20821
20829
  }
20822
- }, $l = "patterns", Ql = {
20823
- ar: Dl,
20824
- de: jl,
20825
- el: Pl,
20826
- en: El,
20827
- es: Ll,
20828
- fr: Fl,
20829
- hi: Il,
20830
- it: Rl,
20831
- ja: Ol,
20832
- nl: Ml,
20833
- pl: Vl,
20834
- pt: Hl,
20835
- ro: Bl,
20836
- ru: ql,
20837
- sq: Kl,
20838
- sv: Gl,
20839
- tr: Ul,
20840
- zh: Wl
20830
+ }, Ul = "patterns", Wl = {
20831
+ ar: Sl,
20832
+ de: _l,
20833
+ el: Dl,
20834
+ en: jl,
20835
+ es: Pl,
20836
+ fr: El,
20837
+ hi: Ll,
20838
+ it: Fl,
20839
+ ja: Il,
20840
+ nl: Rl,
20841
+ pl: Ol,
20842
+ pt: Ml,
20843
+ ro: Vl,
20844
+ ru: Hl,
20845
+ sq: Bl,
20846
+ sv: ql,
20847
+ tr: Kl,
20848
+ zh: Gl
20841
20849
  };
20842
- function rd(e) {
20843
- for (const [a, t] of Object.entries(Ql))
20844
- e.addResourceBundle(a, $l, t, !0, !1);
20850
+ function nd(e) {
20851
+ for (const [a, t] of Object.entries(Wl))
20852
+ e.addResourceBundle(a, Ul, t, !0, !1);
20845
20853
  }
20846
- function Zl(e) {
20854
+ function $l(e) {
20847
20855
  var t;
20848
20856
  if (!e) return;
20849
20857
  const a = Je(e) ? new Date(e).getTime() : (t = ui(e)) == null ? void 0 : t.getTime();
@@ -20852,22 +20860,22 @@ function Zl(e) {
20852
20860
  function Wi(e) {
20853
20861
  return e.reportedAtIso ?? e.response.submittedAtIso;
20854
20862
  }
20855
- function Yl(e, a) {
20863
+ function Ql(e, a) {
20856
20864
  var o;
20857
20865
  let t, n = Number.NEGATIVE_INFINITY;
20858
20866
  for (const r of a) {
20859
20867
  const l = (o = r.response.answers[e]) == null ? void 0 : o.value;
20860
20868
  if (!l || !Ve(l)) continue;
20861
- const s = Zl(Wi(r)) ?? Number.NEGATIVE_INFINITY;
20869
+ const s = $l(Wi(r)) ?? Number.NEGATIVE_INFINITY;
20862
20870
  s >= n && (t = { answer: l, source: r }, n = s);
20863
20871
  }
20864
20872
  return t;
20865
20873
  }
20866
- function Jl(e, a) {
20874
+ function Zl(e, a) {
20867
20875
  const t = e.relevance ?? "any";
20868
20876
  return a === void 0 || t === "any" || t === a;
20869
20877
  }
20870
- function Xl(e, a, t) {
20878
+ function Yl(e, a, t) {
20871
20879
  const n = {
20872
20880
  id: e.key,
20873
20881
  label: ge(e, t),
@@ -20878,19 +20886,19 @@ function Xl(e, a, t) {
20878
20886
  const o = Wi(a.source);
20879
20887
  return o && (n.reportedAtIso = o), a.source.sourceLabel && (n.sourceLabel = a.source.sourceLabel), n;
20880
20888
  }
20881
- function ld(e, a, t, n) {
20889
+ function od(e, a, t, n) {
20882
20890
  const o = [];
20883
20891
  let r = 0;
20884
20892
  for (const l of e) {
20885
20893
  const s = [];
20886
20894
  for (const d of l.fields) {
20887
- if (!Jl(d, n == null ? void 0 : n.sex)) continue;
20888
- const u = Yl(d.key, a);
20895
+ if (!Zl(d, n == null ? void 0 : n.sex)) continue;
20896
+ const u = Ql(d.key, a);
20889
20897
  if (!u) {
20890
20898
  r += 1;
20891
20899
  continue;
20892
20900
  }
20893
- s.push(Xl(d, u, t));
20901
+ s.push(Yl(d, u, t));
20894
20902
  }
20895
20903
  s.length !== 0 && o.push({
20896
20904
  id: l.key,
@@ -20901,17 +20909,17 @@ function ld(e, a, t, n) {
20901
20909
  return { sections: o, unansweredCount: r };
20902
20910
  }
20903
20911
  export {
20904
- td as A,
20912
+ ed as A,
20905
20913
  qn as L,
20906
- $l as P,
20914
+ Ul as P,
20907
20915
  $e as S,
20908
- ad as T,
20909
- nd as a,
20916
+ Xs as T,
20917
+ td as a,
20910
20918
  De as b,
20911
20919
  et as c,
20912
20920
  We as d,
20913
20921
  Qt as e,
20914
- od as f,
20922
+ id as f,
20915
20923
  Un as g,
20916
20924
  xe as h,
20917
20925
  ri as i,
@@ -20923,9 +20931,9 @@ export {
20923
20931
  ii as o,
20924
20932
  Ya as p,
20925
20933
  ra as q,
20926
- rd as r,
20927
- id as s,
20934
+ nd as r,
20935
+ ad as s,
20928
20936
  Vi as t,
20929
- ld as u
20937
+ od as u
20930
20938
  };
20931
- //# sourceMappingURL=anamnesis-summary-rows-DjM_HkCS.js.map
20939
+ //# sourceMappingURL=anamnesis-summary-rows-fbEQwcuW.js.map