@alfadocs/ui-kit 1.3.13 → 1.4.0

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 (185) hide show
  1. package/dist/_chunks/agenda-card.agent-Cb5tuEh3.js +28 -0
  2. package/dist/_chunks/{alia-sidebar-DzNz1gDf.js → alia-sidebar-DSBZMick.js} +3 -3
  3. package/dist/_chunks/{anamnesis-i18n-CfC0qYzy.js → anamnesis-i18n-BA631X4t.js} +2209 -2144
  4. package/dist/_chunks/{antenatal-schedule-timeline-BMMpi2lb.js → antenatal-schedule-timeline-u8TsS2QJ.js} +27 -26
  5. package/dist/_chunks/{appointment-timeline-B630OT_J.js → appointment-timeline-Bqf1sTU5.js} +2 -2
  6. package/dist/_chunks/{ar-THMLfSoN.js → ar-BR1FGFP2.js} +14 -14
  7. package/dist/_chunks/{bmi-calculator-CM0-G2mg.js → bmi-calculator-CpyY13MV.js} +2 -2
  8. package/dist/_chunks/{booking-DjNbd7C1.js → booking-BjsA7j1-.js} +699 -688
  9. package/dist/_chunks/calculator-dialog-12d3Sxaz.js +48 -0
  10. package/dist/_chunks/{care-plan-card-1G_f4I5s.js → care-plan-card-BvQy366X.js} +3 -3
  11. package/dist/_chunks/{care-plan-entry-card-DmBsffHS.js → care-plan-entry-card-apk_5B3O.js} +2 -2
  12. package/dist/_chunks/{chat-container-HlFnoEIl.js → chat-container-CYYego1W.js} +105 -81
  13. package/dist/_chunks/cycle-calculator-B7fyH-h4.js +425 -0
  14. package/dist/_chunks/{date-picker-ZHejTVAJ.js → date-picker-Bp64zk2p.js} +19 -19
  15. package/dist/_chunks/date-picker-variants-pKAJfnWr.js +2089 -0
  16. package/dist/_chunks/{date-range-picker-pEG3Ln3i.js → date-range-picker-CDrZ8Zh0.js} +27 -27
  17. package/dist/_chunks/{date-time-picker-695QvBGj.js → date-time-picker-DafkGDGO.js} +10 -10
  18. package/dist/_chunks/{de-DmZ-8rTN.js → de-3iM4rGqo.js} +7 -7
  19. package/dist/_chunks/{document-preview-D3gg4MXB.js → document-preview-DOrsqiN1.js} +2 -2
  20. package/dist/_chunks/due-date-calculator-CnkbbAej.js +571 -0
  21. package/dist/_chunks/{editor-overlay-DE3esyio.js → editor-overlay-B1tr2i7B.js} +22 -21
  22. package/dist/_chunks/{el-Bela9mxs.js → el-C96rGJvU.js} +2 -2
  23. package/dist/_chunks/{es-BNncHKex.js → es-Cxiqjx8r.js} +12 -12
  24. package/dist/_chunks/fetal-weight-avlj-l-S.js +223 -0
  25. package/dist/_chunks/format-4HNwNGrN.js +1315 -0
  26. package/dist/_chunks/{fr-CH8ADfhN.js → fr-Bhr6SYKj.js} +21 -21
  27. package/dist/_chunks/{freemium-paywall-C_Ue6wxU.js → freemium-paywall-DRDdWuOg.js} +3 -3
  28. package/dist/_chunks/gestational-age-calculator-BljY_DVJ.js +488 -0
  29. package/dist/_chunks/hcg-doubling-Cv_vH61p.js +312 -0
  30. package/dist/_chunks/header-settings-Cn5fPXCE.js +335 -0
  31. package/dist/_chunks/{hi-Bppfxp8l.js → hi-BxXX26d_.js} +12 -12
  32. package/dist/_chunks/isSameWeek-B73MagWB.js +13 -0
  33. package/dist/_chunks/{it-B4ySaRyK.js → it-Xmjomvyj.js} +24 -24
  34. package/dist/_chunks/{ja-CGF6Io9P.js → ja-mfZvt1ZV.js} +16 -16
  35. package/dist/_chunks/{link-cell-renderer-C5XLwVXQ.js → link-cell-renderer-CJ_gk7gl.js} +3 -3
  36. package/dist/_chunks/{locale-picker-BfBUdT1m.js → locale-picker-D9Kv2zrK.js} +153 -132
  37. package/dist/_chunks/map-view-2yZCQW2l.js +445 -0
  38. package/dist/_chunks/{marketplace-app-shell-DwcFMxzp.js → marketplace-app-shell-BLRvg-M0.js} +49 -40
  39. package/dist/_chunks/{nl-DuShqwuV.js → nl-DDs-KEnD.js} +15 -15
  40. package/dist/_chunks/{notes-panel-DPsgB4Mv.js → notes-panel-CiFN3sLW.js} +2 -2
  41. package/dist/_chunks/{number-input-DrozbZAU.js → number-input-DOe5VYei.js} +64 -64
  42. package/dist/_chunks/{optical-prescription-BDHJr8Zz.js → optical-prescription-CRemE8fL.js} +2 -2
  43. package/dist/_chunks/{parse-DvA97ro9.js → parse-JqixfsU0.js} +43 -43
  44. package/dist/_chunks/parseISO-fOGpHKXm.js +120 -0
  45. package/dist/_chunks/{patient-details-DqjjwPmt.js → patient-details-CpunD0qx.js} +3 -3
  46. package/dist/_chunks/{patient-table-BmIDrLIS.js → patient-table-2eWx-Rrk.js} +2 -2
  47. package/dist/_chunks/{payment-form-h-BZ8onk.js → payment-form-Ds1I9KqB.js} +308 -231
  48. package/dist/_chunks/{pdf-viewer-Ddx-T053.js → pdf-viewer-DUIsV9s5.js} +429 -369
  49. package/dist/_chunks/{pl-CKQwX9Fk.js → pl-BYYMnEWP.js} +18 -18
  50. package/dist/_chunks/{practice-results-B-HPc13W.js → practice-results-SjCniMd2.js} +2 -2
  51. package/dist/_chunks/pregnancy-dating-BmpHScZ0.js +770 -0
  52. package/dist/_chunks/pregnancy-weight-gain-B5KSJzdc.js +553 -0
  53. package/dist/_chunks/progress-CK8otcQ-.js +343 -0
  54. package/dist/_chunks/{pt-_njpXyOZ.js → pt-BSPnVrQ7.js} +20 -20
  55. package/dist/_chunks/{radiograph-panel.agent-BQZ64Riy.js → radiograph-panel.agent-CtFtNMzk.js} +3 -3
  56. package/dist/_chunks/{rich-text-editor-CfeXPPWs.js → rich-text-editor-BedTpWzL.js} +2 -2
  57. package/dist/_chunks/{ro-3X6_4FcN.js → ro-BbiylGmG.js} +14 -14
  58. package/dist/_chunks/{ru-bAcgmnS-.js → ru-BX_qsV67.js} +14 -14
  59. package/dist/_chunks/{session-countdown-Bc70VXN1.js → session-countdown-BL-Psg8u.js} +2 -2
  60. package/dist/_chunks/{sign-document-CW_ByDUh.js → sign-document-jF4fZDJ5.js} +2 -2
  61. package/dist/_chunks/slot-grid-DNiUcXy2.js +640 -0
  62. package/dist/_chunks/{sparkline-BTY4B5tv.js → sparkline-BmGcEyZO.js} +209 -164
  63. package/dist/_chunks/{sq-jYFqr4Ga.js → sq-i9UOk4P7.js} +10 -10
  64. package/dist/_chunks/subDays-CAUv47M1.js +8 -0
  65. package/dist/_chunks/{sv-BSGEJ-8B.js → sv-CpTdtmDQ.js} +8 -8
  66. package/dist/_chunks/{tab-bar-Axhk6xzx.js → tab-bar-BYESZINM.js} +83 -77
  67. package/dist/_chunks/task-card.agent-CF2N_uu4.js +29 -0
  68. package/dist/_chunks/{tr-CTpgUtw6.js → tr-DXG2QN1K.js} +17 -17
  69. package/dist/_chunks/{unit-converter-COgkN7YP.js → unit-converter-CHPDuV7W.js} +2 -2
  70. package/dist/_chunks/{warning-stack-BtjmJChC.js → warning-stack-B7t_8jRE.js} +42 -37
  71. package/dist/_chunks/{zh-CN-BgM0Io2O.js → zh-CN-vPkPEK6H.js} +18 -18
  72. package/dist/agent-catalog.json +6426 -3382
  73. package/dist/agent-i18n/en.json +234 -15
  74. package/dist/components/agenda-card/index.js +1 -1
  75. package/dist/components/appointment-timeline/index.js +1 -1
  76. package/dist/components/bmi-calculator/index.js +1 -1
  77. package/dist/components/booking/index.js +1 -1
  78. package/dist/components/calculator-dialog/index.js +1 -1
  79. package/dist/components/care-plan-card/index.js +1 -1
  80. package/dist/components/care-plan-entry-card/index.js +1 -1
  81. package/dist/components/chat-container/chat-container.d.ts +14 -0
  82. package/dist/components/chat-container/index.js +1 -1
  83. package/dist/components/cycle-calculator/cycle-calculator.agent.d.ts +4 -0
  84. package/dist/components/cycle-calculator/cycle-calculator.d.ts +42 -0
  85. package/dist/components/cycle-calculator/index.d.ts +1 -1
  86. package/dist/components/cycle-calculator/index.js +1 -1
  87. package/dist/components/data-table/index.js +1 -1
  88. package/dist/components/date-picker/index.js +1 -1
  89. package/dist/components/date-range-picker/index.js +1 -1
  90. package/dist/components/date-time-picker/index.js +1 -1
  91. package/dist/components/document-preview/index.js +1 -1
  92. package/dist/components/due-date-calculator/due-date-calculator.agent.d.ts +4 -0
  93. package/dist/components/due-date-calculator/due-date-calculator.d.ts +61 -1
  94. package/dist/components/due-date-calculator/index.d.ts +1 -1
  95. package/dist/components/due-date-calculator/index.js +2 -2
  96. package/dist/components/editor-overlay/editor-overlay.d.ts +7 -1
  97. package/dist/components/editor-overlay/index.js +1 -1
  98. package/dist/components/fetal-weight/fetal-weight.agent.d.ts +4 -0
  99. package/dist/components/fetal-weight/fetal-weight.d.ts +26 -0
  100. package/dist/components/fetal-weight/index.d.ts +1 -1
  101. package/dist/components/fetal-weight/index.js +1 -1
  102. package/dist/components/freemium-paywall/index.js +1 -1
  103. package/dist/components/gestational-age-calculator/gestational-age-calculator.agent.d.ts +4 -0
  104. package/dist/components/gestational-age-calculator/gestational-age-calculator.d.ts +44 -2
  105. package/dist/components/gestational-age-calculator/index.d.ts +1 -1
  106. package/dist/components/gestational-age-calculator/index.js +1 -1
  107. package/dist/components/hcg-doubling/hcg-doubling.agent.d.ts +4 -0
  108. package/dist/components/hcg-doubling/hcg-doubling.d.ts +30 -0
  109. package/dist/components/hcg-doubling/index.d.ts +1 -1
  110. package/dist/components/hcg-doubling/index.js +1 -1
  111. package/dist/components/header-settings/header-settings.d.ts +13 -1
  112. package/dist/components/header-settings/index.js +1 -1
  113. package/dist/components/locale-picker/index.js +1 -1
  114. package/dist/components/locale-picker/locale-picker.d.ts +9 -0
  115. package/dist/components/map-view/index.js +1 -1
  116. package/dist/components/map-view/map-view.d.ts +22 -0
  117. package/dist/components/notes-panel/index.js +1 -1
  118. package/dist/components/number-input/index.js +1 -1
  119. package/dist/components/number-input/number-input.d.ts +2 -1
  120. package/dist/components/optical-prescription/index.js +1 -1
  121. package/dist/components/patient-details/index.js +1 -1
  122. package/dist/components/patient-table/index.js +1 -1
  123. package/dist/components/payment-form/index.d.ts +1 -1
  124. package/dist/components/payment-form/index.js +1 -1
  125. package/dist/components/payment-form/payment-form.d.ts +32 -1
  126. package/dist/components/pdf-viewer/index.js +1 -1
  127. package/dist/components/pdf-viewer/pdf-viewer.d.ts +13 -0
  128. package/dist/components/practice-results/index.js +1 -1
  129. package/dist/components/pregnancy-dating/index.d.ts +1 -1
  130. package/dist/components/pregnancy-dating/index.js +1 -1
  131. package/dist/components/pregnancy-dating/pregnancy-dating.agent.d.ts +4 -0
  132. package/dist/components/pregnancy-dating/pregnancy-dating.d.ts +65 -1
  133. package/dist/components/pregnancy-weight-gain/index.d.ts +2 -1
  134. package/dist/components/pregnancy-weight-gain/index.js +6 -5
  135. package/dist/components/pregnancy-weight-gain/pregnancy-weight-gain.agent.d.ts +4 -0
  136. package/dist/components/pregnancy-weight-gain/pregnancy-weight-gain.d.ts +35 -0
  137. package/dist/components/progress/index.js +1 -1
  138. package/dist/components/progress/progress.d.ts +13 -0
  139. package/dist/components/radiograph-panel/index.js +1 -1
  140. package/dist/components/rich-text-editor/index.js +1 -1
  141. package/dist/components/session-countdown/index.js +1 -1
  142. package/dist/components/sign-document/index.js +1 -1
  143. package/dist/components/slot-grid/index.d.ts +2 -1
  144. package/dist/components/slot-grid/index.js +5 -4
  145. package/dist/components/slot-grid/slot-grid.agent.d.ts +4 -0
  146. package/dist/components/slot-grid/slot-grid.d.ts +34 -0
  147. package/dist/components/sparkline/index.js +1 -1
  148. package/dist/components/sparkline/sparkline.d.ts +10 -0
  149. package/dist/components/tab-bar/index.js +1 -1
  150. package/dist/components/tab-bar/tab-bar.d.ts +13 -0
  151. package/dist/components/task-card/index.js +1 -1
  152. package/dist/components/unit-converter/index.js +1 -1
  153. package/dist/components/warning-stack/index.js +1 -1
  154. package/dist/index.js +630 -627
  155. package/dist/patterns/alia-assistant/index.js +1 -1
  156. package/dist/patterns/anamnesis/anamnesis-derive.d.ts +27 -8
  157. package/dist/patterns/anamnesis/anamnesis-format.d.ts +11 -3
  158. package/dist/patterns/anamnesis/anamnesis-highlight.d.ts +6 -0
  159. package/dist/patterns/anamnesis/anamnesis-questionnaire.d.ts +23 -9
  160. package/dist/patterns/anamnesis/anamnesis-types.d.ts +7 -0
  161. package/dist/patterns/anamnesis/anamnesis.d.ts +16 -7
  162. package/dist/patterns/anamnesis/index.d.ts +3 -2
  163. package/dist/patterns/anamnesis/index.js +7 -6
  164. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  165. package/dist/patterns/marketplace-app-shell/marketplace-app-shell.d.ts +6 -0
  166. package/dist/tokens.css +1 -1
  167. package/package.json +1 -1
  168. package/dist/_chunks/agenda-card.agent-mTCrkKSZ.js +0 -27
  169. package/dist/_chunks/calculator-dialog-DuXMQSdm.js +0 -40
  170. package/dist/_chunks/cycle-calculator-BwqYVPB4.js +0 -252
  171. package/dist/_chunks/date-picker-variants-eL6HjWvw.js +0 -3363
  172. package/dist/_chunks/due-date-calculator-CwfsFd3T.js +0 -256
  173. package/dist/_chunks/fetal-weight-ePlLjJPc.js +0 -122
  174. package/dist/_chunks/gestational-age-calculator-DdgbH69Z.js +0 -311
  175. package/dist/_chunks/hcg-doubling-BBqD2wI2.js +0 -170
  176. package/dist/_chunks/header-settings--pjYOe6g.js +0 -284
  177. package/dist/_chunks/isSameDay-DUEiAT0G.js +0 -39
  178. package/dist/_chunks/isSameWeek-CK4HS9lH.js +0 -14
  179. package/dist/_chunks/map-view-CsaHfoo6.js +0 -378
  180. package/dist/_chunks/pregnancy-dating-DzYTlBkT.js +0 -421
  181. package/dist/_chunks/pregnancy-weight-gain-O6J0sUIi.js +0 -322
  182. package/dist/_chunks/progress-DA413-zn.js +0 -299
  183. package/dist/_chunks/slot-grid-CQSULZjd.js +0 -502
  184. package/dist/_chunks/subDays-BcNi04uf.js +0 -8
  185. package/dist/_chunks/task-card.agent-Bt14CzUd.js +0 -25
@@ -0,0 +1,571 @@
1
+ import { jsxs as i, jsx as a } from "react/jsx-runtime";
2
+ import { forwardRef as se, useState as p, useMemo as f, useEffect as ne, useRef as le } from "react";
3
+ import { c as oe } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as ie } from "react-i18next";
5
+ import { u as de } from "./registry-DvAUVLHh.js";
6
+ import { R as C } from "./radio-TWf9Q-mp.js";
7
+ import { R as z } from "./radio-group-CI-6SmSw.js";
8
+ import { F as w } from "./form-field-M5UpX65Z.js";
9
+ import { D as T } from "./date-picker-Bp64zk2p.js";
10
+ import { N as Y } from "./number-input-DOe5VYei.js";
11
+ import { C as U } from "./card-DPmk26CL.js";
12
+ import { B as W } from "./badge-DCOqV9mI.js";
13
+ import { I as ce } from "./insert-result-D074GtHX.js";
14
+ import { D as x, r as ue, c as me, e as pe, f as he, A as ge, h as fe, i as ye } from "./antenatal-schedule-timeline-u8TsS2QJ.js";
15
+ import { c as J } from "./date-picker-variants-pKAJfnWr.js";
16
+ import { p as De } from "./parseISO-fOGpHKXm.js";
17
+ import { f as be } from "./format-4HNwNGrN.js";
18
+ const y = "Superseded by the `pregnancy-dating` adapter.", R = {
19
+ type: "string",
20
+ pattern: "^\\d{4}-\\d{2}-\\d{2}$"
21
+ }, ve = {
22
+ id: "due-date-calculator",
23
+ // set_value → the six `set_*` actions + the `inputs` state slot.
24
+ capabilities: ["set_value"],
25
+ state: {
26
+ inputs: {
27
+ type: "{ method: string, referenceDate: string | null, cycleLength: number | null, embryoAge: 3 | 5, crlMm: number | null, scanDate: string | null, asOfDate: string }",
28
+ descriptionKey: "ui.agent.dueDateCalculator.state.inputs",
29
+ description: "The dating inputs as entered — method, its reference date, cycle length (LMP), embryo age (IVF), the optional CRL + scan date, and the evaluation date. Dates are `yyyy-MM-dd`. Read this to see which method a reference date will be interpreted under.",
30
+ read: (s) => s.getInputs()
31
+ },
32
+ result: {
33
+ type: "{ dueDate: string, gestationalStart: string, gestationalAge: { weeks: number, days: number, totalDays: number } | null, trimester: string } | null",
34
+ descriptionKey: "ui.agent.dueDateCalculator.state.result",
35
+ description: "Computed estimated delivery date, the GA day-0 anchor after any CRL re-dating, the gestational age as of the evaluation date, and the trimester band. Null until a reference date is set.",
36
+ read: (s) => s.getResult()
37
+ }
38
+ },
39
+ actions: {
40
+ set_method: {
41
+ // Drives the same local input state a user picks; nothing is persisted
42
+ // to a record, and the choice is reversible in the same UI.
43
+ safety: "write",
44
+ argsType: "{ method: 'lmp' | 'conception' | 'ivf' }",
45
+ argsSchema: {
46
+ type: "object",
47
+ properties: {
48
+ method: {
49
+ enum: ["lmp", "conception", "ivf"],
50
+ description: "Which anchor to date from — last menstrual period, conception, or IVF transfer."
51
+ }
52
+ },
53
+ required: ["method"],
54
+ additionalProperties: !1
55
+ },
56
+ idempotent: !0,
57
+ deprecated: y,
58
+ returns: "boolean",
59
+ returnsSchema: {
60
+ type: "boolean",
61
+ description: "True when the method was applied."
62
+ },
63
+ errors: [
64
+ "Returns false for a method outside the three supported anchors."
65
+ ],
66
+ descriptionKey: "ui.agent.dueDateCalculator.actions.setMethod",
67
+ description: "Choose which anchor the pregnancy is dated from. The reference date is kept and re-interpreted under the new method, so set the method first.",
68
+ invoke: (s, n) => s.setMethod(n.method)
69
+ },
70
+ set_reference_date: {
71
+ safety: "write",
72
+ argsType: "{ date: string | null }",
73
+ argsSchema: {
74
+ type: "object",
75
+ properties: {
76
+ date: {
77
+ oneOf: [
78
+ { ...R, description: "Local calendar date, `yyyy-MM-dd`." },
79
+ { type: "null" }
80
+ ],
81
+ description: "The date the active method anchors on — LMP, conception, or transfer — or null to clear it. Must not be in the future."
82
+ }
83
+ },
84
+ required: ["date"],
85
+ additionalProperties: !1
86
+ },
87
+ idempotent: !0,
88
+ deprecated: y,
89
+ returns: "boolean",
90
+ returnsSchema: {
91
+ type: "boolean",
92
+ description: "True when the date was applied."
93
+ },
94
+ errors: [
95
+ "Returns false for an unparseable date or a date in the future — the on-screen DatePicker caps at today."
96
+ ],
97
+ examples: [
98
+ {
99
+ args: { date: "2026-01-12" },
100
+ note: "Under the default LMP method, a last period starting 12 January."
101
+ }
102
+ ],
103
+ descriptionKey: "ui.agent.dueDateCalculator.actions.setReferenceDate",
104
+ description: "Set the reference date for the active method. This is the only required input — the result stays null without it.",
105
+ invoke: (s, n) => s.setReferenceDate(n.date)
106
+ },
107
+ set_cycle_length: {
108
+ safety: "write",
109
+ argsType: "{ days: number | null }",
110
+ argsSchema: {
111
+ type: "object",
112
+ properties: {
113
+ days: {
114
+ oneOf: [
115
+ { type: "integer", minimum: 20, maximum: 45 },
116
+ { type: "null" }
117
+ ],
118
+ description: "Average cycle length in days (20–45), or null to fall back to the 28-day default."
119
+ }
120
+ },
121
+ required: ["days"],
122
+ additionalProperties: !1
123
+ },
124
+ idempotent: !0,
125
+ deprecated: y,
126
+ returns: "boolean",
127
+ returnsSchema: {
128
+ type: "boolean",
129
+ description: "True when the value was applied."
130
+ },
131
+ errors: [
132
+ "Returns false outside 20–45 days — the same bounds the on-screen NumberInput enforces.",
133
+ "Applies but changes nothing unless the method is `lmp`, and is ignored once a CRL re-dating is confirmed."
134
+ ],
135
+ descriptionKey: "ui.agent.dueDateCalculator.actions.setCycleLength",
136
+ description: "LMP method only — set the average cycle length, which shifts Naegele dating off the 28-day assumption.",
137
+ invoke: (s, n) => s.setCycleLength(n.days)
138
+ },
139
+ set_embryo_age: {
140
+ safety: "write",
141
+ argsType: "{ days: 3 | 5 }",
142
+ argsSchema: {
143
+ type: "object",
144
+ properties: {
145
+ days: {
146
+ enum: [3, 5],
147
+ description: "Embryo age at transfer in days — 3 (cleavage) or 5 (blastocyst)."
148
+ }
149
+ },
150
+ required: ["days"],
151
+ additionalProperties: !1
152
+ },
153
+ idempotent: !0,
154
+ deprecated: y,
155
+ returns: "boolean",
156
+ returnsSchema: {
157
+ type: "boolean",
158
+ description: "True when the value was applied."
159
+ },
160
+ errors: [
161
+ "Returns false for any value other than 3 or 5.",
162
+ "Applies but changes nothing unless the method is `ivf`."
163
+ ],
164
+ descriptionKey: "ui.agent.dueDateCalculator.actions.setEmbryoAge",
165
+ description: "IVF method only — set the embryo age at transfer, which offsets the transfer date back to a notional LMP.",
166
+ invoke: (s, n) => s.setEmbryoAge(n.days)
167
+ },
168
+ set_crl: {
169
+ safety: "write",
170
+ argsType: "{ crlMm?: number | null, scanDate?: string | null }",
171
+ argsSchema: {
172
+ type: "object",
173
+ properties: {
174
+ crlMm: {
175
+ oneOf: [{ type: "number", exclusiveMinimum: 0 }, { type: "null" }],
176
+ description: "Crown-rump length in millimetres, or null to clear it."
177
+ },
178
+ scanDate: {
179
+ oneOf: [{ ...R }, { type: "null" }],
180
+ description: "Date of the CRL scan (`yyyy-MM-dd`, not in the future), or null to clear it."
181
+ }
182
+ },
183
+ additionalProperties: !1
184
+ },
185
+ idempotent: !0,
186
+ deprecated: y,
187
+ returns: "boolean",
188
+ returnsSchema: {
189
+ type: "boolean",
190
+ description: "True when the measurement was applied."
191
+ },
192
+ errors: [
193
+ "Returns false and writes nothing when the length is not positive or the scan date is unparseable or in the future — the payload applies all-or-nothing.",
194
+ "Re-dating only happens under the `lmp` method, and only when both the length and the scan date are set."
195
+ ],
196
+ examples: [
197
+ {
198
+ args: { crlMm: 42, scanDate: "2026-02-20" },
199
+ note: "A first-trimester CRL that may re-date the pregnancy per ACOG CO 700."
200
+ }
201
+ ],
202
+ descriptionKey: "ui.agent.dueDateCalculator.actions.setCrl",
203
+ description: "LMP method only — set the first-trimester crown-rump length and its scan date. When the two disagree with the LMP beyond the ACOG threshold, the scan re-dates the pregnancy and overrides cycle length.",
204
+ invoke: (s, n) => s.setCrl(n)
205
+ },
206
+ set_as_of_date: {
207
+ safety: "write",
208
+ argsType: "{ date: string }",
209
+ argsSchema: {
210
+ type: "object",
211
+ properties: {
212
+ date: {
213
+ ...R,
214
+ description: "Date to evaluate gestational age and trimester against, `yyyy-MM-dd`. May be in the future to project forward."
215
+ }
216
+ },
217
+ required: ["date"],
218
+ additionalProperties: !1
219
+ },
220
+ idempotent: !0,
221
+ deprecated: y,
222
+ returns: "boolean",
223
+ returnsSchema: {
224
+ type: "boolean",
225
+ description: "True when the date was applied."
226
+ },
227
+ errors: ["Returns false for an unparseable date."],
228
+ examples: [
229
+ {
230
+ args: { date: "2026-09-15" },
231
+ note: "Project gestational age forward to an upcoming appointment."
232
+ }
233
+ ],
234
+ descriptionKey: "ui.agent.dueDateCalculator.actions.setAsOfDate",
235
+ description: "Set the date gestational age, trimester and the antenatal schedule are evaluated against. Defaults to today; the estimated delivery date itself does not depend on it.",
236
+ invoke: (s, n) => s.setAsOfDate(n.date)
237
+ }
238
+ },
239
+ domHooks: {
240
+ root: {
241
+ attr: "data-component",
242
+ value: "due-date-calculator",
243
+ description: "Marks the DueDateCalculator wrapper."
244
+ },
245
+ instanceId: {
246
+ attr: "data-component-id",
247
+ sourceProp: "id",
248
+ description: "Sourced from the id prop. Also the registry key — without an `id` the instance does not register and the handle-driven actions/state are unreachable."
249
+ }
250
+ }
251
+ }, Ce = oe("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
252
+ variants: {
253
+ width: { full: "ds:w-full", auto: "ds:inline-flex" }
254
+ },
255
+ defaultVariants: { width: "full" }
256
+ }), we = {
257
+ lmp: "dueDateCalculator.lmpDate",
258
+ conception: "dueDateCalculator.conceptionDate",
259
+ ivf: "dueDateCalculator.transferDate"
260
+ }, A = (s) => be(s, "yyyy-MM-dd"), k = (s) => {
261
+ const n = De(s);
262
+ return Number.isNaN(n.getTime()) ? null : n;
263
+ }, M = { min: 20, max: 45 }, Ae = se(
264
+ ({
265
+ defaultMethod: s = "lmp",
266
+ onResultChange: n,
267
+ onInsert: E,
268
+ insertVariant: _ = "insert",
269
+ onCopy: Q,
270
+ onError: X,
271
+ insertBrand: Z,
272
+ showSchedule: O = !1,
273
+ scheduleOptions: P,
274
+ id: I,
275
+ width: ee,
276
+ className: te
277
+ }, ae) => {
278
+ const { t, i18n: F } = ie(), [l, j] = p(s), [c, N] = p(void 0), [D, K] = p(
279
+ x
280
+ ), [b, G] = p(5), [h, H] = p(null), [g, $] = p(void 0), B = f(() => /* @__PURE__ */ new Date(), []), [m, V] = p(() => /* @__PURE__ */ new Date()), o = f(() => l !== "lmp" || !c || h === null || !g ? null : ue({ lmp: c, scanDate: g, crlMm: h }), [l, c, h, g]), r = f(() => {
281
+ if (!c) return null;
282
+ const e = l === "lmp" && (o != null && o.redated) ? o.gestationalStart : c, d = l === "lmp" && (o != null && o.redated) ? x : D ?? x;
283
+ return me(
284
+ {
285
+ method: l,
286
+ date: e,
287
+ cycleLength: d,
288
+ embryoAge: b
289
+ },
290
+ m
291
+ );
292
+ }, [l, c, D, b, o, m]), v = f(
293
+ () => new Intl.DateTimeFormat(F.language, { dateStyle: "long" }),
294
+ [F.language]
295
+ );
296
+ ne(() => {
297
+ n == null || n(r);
298
+ }, [r, n]);
299
+ const S = le({
300
+ method: l,
301
+ refDate: c,
302
+ cycleLength: D,
303
+ embryoAge: b,
304
+ crlMm: h,
305
+ scanDate: g,
306
+ asOfDate: m,
307
+ result: r
308
+ });
309
+ S.current = {
310
+ method: l,
311
+ refDate: c,
312
+ cycleLength: D,
313
+ embryoAge: b,
314
+ crlMm: h,
315
+ scanDate: g,
316
+ asOfDate: m,
317
+ result: r
318
+ };
319
+ const re = f(
320
+ () => ({
321
+ getInputs: () => {
322
+ const e = S.current;
323
+ return {
324
+ method: e.method,
325
+ referenceDate: e.refDate ? A(e.refDate) : null,
326
+ cycleLength: e.cycleLength,
327
+ embryoAge: e.embryoAge,
328
+ crlMm: e.crlMm,
329
+ scanDate: e.scanDate ? A(e.scanDate) : null,
330
+ asOfDate: A(e.asOfDate)
331
+ };
332
+ },
333
+ getResult: () => {
334
+ const e = S.current.result;
335
+ return e ? {
336
+ dueDate: A(e.dueDate),
337
+ gestationalStart: A(e.gestationalStart),
338
+ gestationalAge: e.gestationalAge ? { ...e.gestationalAge } : null,
339
+ trimester: e.trimester
340
+ } : null;
341
+ },
342
+ setMethod: (e) => e !== "lmp" && e !== "conception" && e !== "ivf" ? !1 : (j(e), !0),
343
+ setReferenceDate: (e) => {
344
+ if (e === null)
345
+ return N(void 0), !0;
346
+ const d = k(e);
347
+ return !d || J(d, /* @__PURE__ */ new Date()) ? !1 : (N(d), !0);
348
+ },
349
+ setCycleLength: (e) => e !== null && !(Number.isFinite(e) && e >= M.min && e <= M.max) ? !1 : (K(e), !0),
350
+ setEmbryoAge: (e) => e !== 3 && e !== 5 ? !1 : (G(e), !0),
351
+ setCrl: (e) => {
352
+ const d = /* @__PURE__ */ new Date();
353
+ let q;
354
+ if ("crlMm" in e) {
355
+ const u = e.crlMm;
356
+ if (u != null && !(Number.isFinite(u) && u > 0))
357
+ return !1;
358
+ }
359
+ if ("scanDate" in e && e.scanDate != null) {
360
+ const u = k(e.scanDate);
361
+ if (!u || J(u, d)) return !1;
362
+ q = u;
363
+ }
364
+ return "crlMm" in e && H(e.crlMm ?? null), "scanDate" in e && $(q), !0;
365
+ },
366
+ setAsOfDate: (e) => {
367
+ const d = k(e);
368
+ return d ? (V(d), !0) : !1;
369
+ }
370
+ }),
371
+ []
372
+ );
373
+ de(ve, re, I);
374
+ const L = f(() => !O || !r ? null : pe(r.gestationalStart, {
375
+ ...P,
376
+ today: m
377
+ }), [O, r, m, P]);
378
+ return /* @__PURE__ */ i(
379
+ "div",
380
+ {
381
+ ref: ae,
382
+ "data-component": "due-date-calculator",
383
+ "data-component-id": I,
384
+ className: Ce({ width: ee, className: te }),
385
+ children: [
386
+ /* @__PURE__ */ i(
387
+ z,
388
+ {
389
+ label: t("dueDateCalculator.method.label"),
390
+ variant: "horizontal",
391
+ value: l,
392
+ onValueChange: (e) => j(e),
393
+ children: [
394
+ /* @__PURE__ */ a(C, { label: t("dueDateCalculator.method.lmp"), value: "lmp" }),
395
+ /* @__PURE__ */ a(
396
+ C,
397
+ {
398
+ label: t("dueDateCalculator.method.conception"),
399
+ value: "conception"
400
+ }
401
+ ),
402
+ /* @__PURE__ */ a(C, { label: t("dueDateCalculator.method.ivf"), value: "ivf" })
403
+ ]
404
+ }
405
+ ),
406
+ /* @__PURE__ */ i("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2", children: [
407
+ /* @__PURE__ */ a(w, { label: t(we[l]), children: /* @__PURE__ */ a(T, { value: c, onChange: N, maxDate: B }) }),
408
+ l === "lmp" && /* @__PURE__ */ a(
409
+ w,
410
+ {
411
+ label: t("dueDateCalculator.cycleLength"),
412
+ description: t("dueDateCalculator.cycleLengthHint"),
413
+ children: /* @__PURE__ */ a(
414
+ Y,
415
+ {
416
+ mode: "integer",
417
+ min: M.min,
418
+ max: M.max,
419
+ value: D,
420
+ onChange: K
421
+ }
422
+ )
423
+ }
424
+ ),
425
+ l === "ivf" && /* @__PURE__ */ i(
426
+ z,
427
+ {
428
+ label: t("dueDateCalculator.embryoAge"),
429
+ variant: "horizontal",
430
+ value: String(b),
431
+ onValueChange: (e) => G(Number(e)),
432
+ children: [
433
+ /* @__PURE__ */ a(C, { label: t("dueDateCalculator.day3"), value: "3" }),
434
+ /* @__PURE__ */ a(C, { label: t("dueDateCalculator.day5"), value: "5" })
435
+ ]
436
+ }
437
+ )
438
+ ] }),
439
+ /* @__PURE__ */ a(
440
+ w,
441
+ {
442
+ label: t("dueDateCalculator.asOfDate"),
443
+ description: t("dueDateCalculator.asOfDateHint"),
444
+ children: /* @__PURE__ */ a(T, { value: m, onChange: (e) => e && V(e) })
445
+ }
446
+ ),
447
+ l === "lmp" ? /* @__PURE__ */ i("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
448
+ /* @__PURE__ */ i("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2", children: [
449
+ /* @__PURE__ */ a(
450
+ w,
451
+ {
452
+ label: t("dueDateCalculator.crl"),
453
+ description: t("dueDateCalculator.crlHint"),
454
+ children: /* @__PURE__ */ a(
455
+ Y,
456
+ {
457
+ mode: "decimal",
458
+ min: 0,
459
+ step: 0.1,
460
+ value: h,
461
+ onChange: H
462
+ }
463
+ )
464
+ }
465
+ ),
466
+ /* @__PURE__ */ a(w, { label: t("dueDateCalculator.scanDate"), children: /* @__PURE__ */ a(
467
+ T,
468
+ {
469
+ value: g,
470
+ onChange: $,
471
+ maxDate: B
472
+ }
473
+ ) })
474
+ ] }),
475
+ o ? /* @__PURE__ */ i("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]", children: [
476
+ /* @__PURE__ */ a(W, { variant: o.redated ? "warning" : "success", children: o.redated ? t("dueDateCalculator.redated", {
477
+ days: o.discrepancyDays
478
+ }) : t("dueDateCalculator.datesAgree") }),
479
+ o.crlInRange ? null : /* @__PURE__ */ a("span", { className: "type-meta ds:text-muted-foreground", children: t("dueDateCalculator.crlOutOfRange") })
480
+ ] }) : null
481
+ ] }) : null,
482
+ /* @__PURE__ */ a("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: r ? `${t("dueDateCalculator.result.dueDateLabel")}: ${v.format(
483
+ r.dueDate
484
+ )}. ${t("dueDateCalculator.result.trimesterLabel")}: ${t(
485
+ `dueDateCalculator.trimester.${r.trimester}`
486
+ )}.` : "" }),
487
+ r ? /* @__PURE__ */ a(U, { variant: "elevated", children: /* @__PURE__ */ a(U.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: /* @__PURE__ */ i("dl", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-3", children: [
488
+ /* @__PURE__ */ i("div", { className: "ds:flex ds:flex-col ds:items-start ds:gap-[var(--spacing-xs)]", children: [
489
+ /* @__PURE__ */ a("dt", { className: "type-label ds:text-muted-foreground", children: t("dueDateCalculator.result.trimesterLabel") }),
490
+ /* @__PURE__ */ a("dd", { children: /* @__PURE__ */ a(
491
+ W,
492
+ {
493
+ variant: he[r.trimester],
494
+ size: "lg",
495
+ children: t(`dueDateCalculator.trimester.${r.trimester}`)
496
+ }
497
+ ) })
498
+ ] }),
499
+ /* @__PURE__ */ i("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
500
+ /* @__PURE__ */ a("dt", { className: "type-label ds:text-muted-foreground", children: t("dueDateCalculator.result.gestationLabel") }),
501
+ /* @__PURE__ */ a("dd", { className: "type-body ds:text-foreground", children: r.gestationalAge ? t("dueDateCalculator.result.gestation", {
502
+ weeks: r.gestationalAge.weeks,
503
+ days: r.gestationalAge.days
504
+ }) : "—" })
505
+ ] }),
506
+ /* @__PURE__ */ i("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
507
+ /* @__PURE__ */ a("dt", { className: "type-label ds:text-muted-foreground", children: t("dueDateCalculator.result.dueDateLabel") }),
508
+ /* @__PURE__ */ a("dd", { className: "type-metric ds:text-foreground", children: v.format(r.dueDate) })
509
+ ] })
510
+ ] }) }) }) : /* @__PURE__ */ a("p", { className: "type-body ds:text-muted-foreground", children: t("dueDateCalculator.empty") }),
511
+ L ? /* @__PURE__ */ a(ge, { events: L }) : null,
512
+ r && (_ === "copy" || E) ? /* @__PURE__ */ a(
513
+ ce,
514
+ {
515
+ variant: _,
516
+ onInsert: E,
517
+ onCopy: Q,
518
+ onError: X,
519
+ card: {
520
+ title: t("insert.title.dueDate"),
521
+ icon: "calendar-heart",
522
+ highlight: v.format(r.dueDate),
523
+ // Chip tinted with the trimester's semantic token so the inserted
524
+ // PNG carries the same clinical-stage colour as the on-screen
525
+ // trimester badge — with the contrast-safe orange override for the
526
+ // `--warning` third trimester.
527
+ highlightToken: ye(r.trimester),
528
+ brand: Z,
529
+ fields: [
530
+ {
531
+ // The estimated date of delivery → calendar glyph.
532
+ icon: "calendar",
533
+ label: t("dueDateCalculator.result.dueDateLabel"),
534
+ value: v.format(r.dueDate)
535
+ },
536
+ {
537
+ // Gestational age is an elapsed duration → clock glyph.
538
+ icon: "clock",
539
+ label: t("dueDateCalculator.result.gestationLabel"),
540
+ value: r.gestationalAge ? t("dueDateCalculator.result.gestation", {
541
+ weeks: r.gestationalAge.weeks,
542
+ days: r.gestationalAge.days
543
+ }) : "—"
544
+ },
545
+ {
546
+ // Trimester is a clinical-stage classification → tag.
547
+ icon: "tag",
548
+ label: t("dueDateCalculator.result.trimesterLabel"),
549
+ value: t(`dueDateCalculator.trimester.${r.trimester}`)
550
+ },
551
+ // When the schedule is shown, the single Insert button carries
552
+ // the exam windows too (no second button).
553
+ ...L ? fe(
554
+ L,
555
+ t,
556
+ (e) => v.format(e)
557
+ ) : []
558
+ ]
559
+ }
560
+ }
561
+ ) : null
562
+ ]
563
+ }
564
+ );
565
+ }
566
+ );
567
+ Ae.displayName = "DueDateCalculator";
568
+ export {
569
+ Ae as D
570
+ };
571
+ //# sourceMappingURL=due-date-calculator-CnkbbAej.js.map
@@ -1,10 +1,10 @@
1
1
  import { jsx as s, jsxs as f } from "react/jsx-runtime";
2
- import { useRef as p, useId as h, useCallback as w, useEffect as y } from "react";
3
- import { useTranslation as k } from "react-i18next";
4
- import { c as E } from "./index-D2ZczOXr.js";
5
- import { I as j } from "./icon-button-C_kbcd7I.js";
6
- import { X as I } from "./x-B5YnXwCz.js";
7
- const N = E(
2
+ import { useRef as p, useId as w, useCallback as y, useEffect as k } from "react";
3
+ import { useTranslation as E } from "react-i18next";
4
+ import { c as j } from "./index-D2ZczOXr.js";
5
+ import { I } from "./icon-button-C_kbcd7I.js";
6
+ import { X as N } from "./x-B5YnXwCz.js";
7
+ const z = j(
8
8
  [
9
9
  // Spans the editor's block-end edge (a docked bar) and expands from the pill.
10
10
  "ds:absolute ds:z-20",
@@ -26,21 +26,22 @@ const N = E(
26
26
  "ds:origin-bottom-right ds:animate-in ds:fade-in-0 ds:zoom-in-95",
27
27
  "ds:motion-reduce:animate-none"
28
28
  ].join(" ")
29
- ), z = "ds:text-[length:var(--font-size-base)] ds:font-medium ds:text-[color:var(--foreground)]";
30
- function L({
29
+ ), C = "ds:text-[length:var(--font-size-base)] ds:font-medium ds:text-[color:var(--foreground)]";
30
+ function D({
31
31
  open: n,
32
32
  onClose: t,
33
33
  title: a,
34
34
  ariaLabel: v,
35
35
  children: b,
36
36
  footer: i,
37
- className: g
37
+ id: g,
38
+ className: x
38
39
  }) {
39
- const { t: x } = k(), o = p(null), c = p(null), l = h(), d = w(() => t(), [t]);
40
- return y(() => {
40
+ const { t: _ } = E(), o = p(null), c = p(null), l = w(), d = y(() => t(), [t]);
41
+ return k(() => {
41
42
  if (!n) return;
42
43
  c.current = document.activeElement;
43
- const _ = window.requestAnimationFrame(() => {
44
+ const h = window.requestAnimationFrame(() => {
44
45
  var r, u;
45
46
  (u = ((r = o.current) == null ? void 0 : r.querySelector(
46
47
  'input, textarea, button, [tabindex]:not([tabindex="-1"])'
@@ -50,9 +51,9 @@ function L({
50
51
  };
51
52
  return document.addEventListener("keydown", m), () => {
52
53
  var e, r;
53
- window.cancelAnimationFrame(_), document.removeEventListener("keydown", m), (r = (e = c.current) == null ? void 0 : e.focus) == null || r.call(e);
54
+ window.cancelAnimationFrame(h), document.removeEventListener("keydown", m), (r = (e = c.current) == null ? void 0 : e.focus) == null || r.call(e);
54
55
  };
55
- }, [n, d]), n ? /* @__PURE__ */ s("div", { "data-component": "editor-overlay", children: /* @__PURE__ */ f(
56
+ }, [n, d]), n ? /* @__PURE__ */ s("div", { "data-component": "editor-overlay", "data-component-id": g, children: /* @__PURE__ */ f(
56
57
  "div",
57
58
  {
58
59
  ref: o,
@@ -61,17 +62,17 @@ function L({
61
62
  "aria-labelledby": a ? l : void 0,
62
63
  "aria-label": a ? void 0 : v,
63
64
  tabIndex: -1,
64
- className: [N(), g].filter(Boolean).join(" "),
65
+ className: [z(), x].filter(Boolean).join(" "),
65
66
  children: [
66
67
  a ? /* @__PURE__ */ f("div", { className: "ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
67
- /* @__PURE__ */ s("div", { id: l, className: z, children: a }),
68
+ /* @__PURE__ */ s("div", { id: l, className: C, children: a }),
68
69
  /* @__PURE__ */ s(
69
- j,
70
+ I,
70
71
  {
71
72
  size: "sm",
72
73
  intent: "ghost",
73
- icon: /* @__PURE__ */ s(I, {}),
74
- "aria-label": x("common.close"),
74
+ icon: /* @__PURE__ */ s(N, {}),
75
+ "aria-label": _("common.close"),
75
76
  onClick: d
76
77
  }
77
78
  )
@@ -83,6 +84,6 @@ function L({
83
84
  ) }) : null;
84
85
  }
85
86
  export {
86
- L as E
87
+ D as E
87
88
  };
88
- //# sourceMappingURL=editor-overlay-DE3esyio.js.map
89
+ //# sourceMappingURL=editor-overlay-B1tr2i7B.js.map
@@ -1,4 +1,4 @@
1
- import { A as s, B as i, E as o, F as d } from "./date-picker-variants-eL6HjWvw.js";
1
+ import { g as s, h as i, j as o, k as d } from "./format-4HNwNGrN.js";
2
2
  const u = {
3
3
  lessThanXSeconds: {
4
4
  one: "λιγότερο από ένα δευτερόλεπτο",
@@ -370,4 +370,4 @@ const u = {
370
370
  export {
371
371
  q as el
372
372
  };
373
- //# sourceMappingURL=el-Bela9mxs.js.map
373
+ //# sourceMappingURL=el-C96rGJvU.js.map