@alfadocs/ui-kit-debug 1.54.2 → 1.54.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{address-fields-1pD-8hML.js → address-fields-BaClzQLM.js} +5 -5
- package/dist/_chunks/{address-fields-1pD-8hML.js.map → address-fields-BaClzQLM.js.map} +1 -1
- package/dist/_chunks/{anamnesis-summary-rows-BMjSBqhS.js → anamnesis-summary-rows-Brru7JrH.js} +3 -3
- package/dist/_chunks/{anamnesis-summary-rows-BMjSBqhS.js.map → anamnesis-summary-rows-Brru7JrH.js.map} +1 -1
- package/dist/_chunks/{balance-badge-cell-BDX1Krdv.js → balance-badge-cell-C5hmahoB.js} +2 -2
- package/dist/_chunks/{balance-badge-cell-BDX1Krdv.js.map → balance-badge-cell-C5hmahoB.js.map} +1 -1
- package/dist/_chunks/{bishop-score-CGAVpIWL.js → bishop-score-BzvVol-u.js} +2 -2
- package/dist/_chunks/{bishop-score-CGAVpIWL.js.map → bishop-score-BzvVol-u.js.map} +1 -1
- package/dist/_chunks/{bmi-calculator-g_wjo4nq.js → bmi-calculator-CDmQk0b5.js} +2 -2
- package/dist/_chunks/{bmi-calculator-g_wjo4nq.js.map → bmi-calculator-CDmQk0b5.js.map} +1 -1
- package/dist/_chunks/{booking-BN7TXe27.js → booking-BGY3LUi8.js} +5 -5
- package/dist/_chunks/{booking-BN7TXe27.js.map → booking-BGY3LUi8.js.map} +1 -1
- package/dist/_chunks/{calendar-workspace-BbZIx2PT.js → calendar-workspace-BJPhMb2c.js} +8 -8
- package/dist/_chunks/{calendar-workspace-BbZIx2PT.js.map → calendar-workspace-BJPhMb2c.js.map} +1 -1
- package/dist/_chunks/{city-input-DyxVWSRQ.js → city-input-BL5WsGJ3.js} +2 -2
- package/dist/_chunks/{city-input-DyxVWSRQ.js.map → city-input-BL5WsGJ3.js.map} +1 -1
- package/dist/_chunks/{cycle-calculator-CwDEdmda.js → cycle-calculator-LjsQd9Gl.js} +2 -2
- package/dist/_chunks/{cycle-calculator-CwDEdmda.js.map → cycle-calculator-LjsQd9Gl.js.map} +1 -1
- package/dist/_chunks/{data-table-DeUoJzNn.js → data-table-BErtJzaT.js} +2 -2
- package/dist/_chunks/{data-table-DeUoJzNn.js.map → data-table-BErtJzaT.js.map} +1 -1
- package/dist/_chunks/{data-table-tabs-BfEmXvUk.js → data-table-tabs-D5nFZKxg.js} +2 -2
- package/dist/_chunks/{data-table-tabs-BfEmXvUk.js.map → data-table-tabs-D5nFZKxg.js.map} +1 -1
- package/dist/_chunks/{due-date-calculator-_0Dz_d7n.js → due-date-calculator-mDvGKmRV.js} +2 -2
- package/dist/_chunks/{due-date-calculator-_0Dz_d7n.js.map → due-date-calculator-mDvGKmRV.js.map} +1 -1
- package/dist/_chunks/{email-input-Cmeo4zdT.js → email-input-DQixfopu.js} +2 -2
- package/dist/_chunks/{email-input-Cmeo4zdT.js.map → email-input-DQixfopu.js.map} +1 -1
- package/dist/_chunks/{face-scheme-pZgT26gB.js → face-scheme-Doodi6A6.js} +2 -2
- package/dist/_chunks/{face-scheme-pZgT26gB.js.map → face-scheme-Doodi6A6.js.map} +1 -1
- package/dist/_chunks/{fetal-weight-CbE61Uyk.js → fetal-weight-DBgEaMoJ.js} +2 -2
- package/dist/_chunks/{fetal-weight-CbE61Uyk.js.map → fetal-weight-DBgEaMoJ.js.map} +1 -1
- package/dist/_chunks/{file-manager-DdsAd4TQ.js → file-manager-BDNSnr7f.js} +3 -3
- package/dist/_chunks/{file-manager-DdsAd4TQ.js.map → file-manager-BDNSnr7f.js.map} +1 -1
- package/dist/_chunks/{forgot-password-form-DVVOBEGj.js → forgot-password-form-Duu3pZDU.js} +3 -3
- package/dist/_chunks/{forgot-password-form-DVVOBEGj.js.map → forgot-password-form-Duu3pZDU.js.map} +1 -1
- package/dist/_chunks/{form-field-D9WfDpYB.js → form-field-Db0liyI8.js} +72 -63
- package/dist/_chunks/form-field-Db0liyI8.js.map +1 -0
- package/dist/_chunks/form-field-context-DtiROUJV.js.map +1 -1
- package/dist/_chunks/{gestational-age-calculator-BMkoLJGR.js → gestational-age-calculator-BVBz_5dm.js} +2 -2
- package/dist/_chunks/{gestational-age-calculator-BMkoLJGR.js.map → gestational-age-calculator-BVBz_5dm.js.map} +1 -1
- package/dist/_chunks/{hcg-doubling-BtW2pBJX.js → hcg-doubling-BECrAUu3.js} +2 -2
- package/dist/_chunks/{hcg-doubling-BtW2pBJX.js.map → hcg-doubling-BECrAUu3.js.map} +1 -1
- package/dist/_chunks/{help-me-write-templates-Cy-iO5AU.js → help-me-write-templates-B4Y8dBv1.js} +3 -3
- package/dist/_chunks/{help-me-write-templates-Cy-iO5AU.js.map → help-me-write-templates-B4Y8dBv1.js.map} +1 -1
- package/dist/_chunks/{icon-picker-CSViTQL9.js → icon-picker-JZzs1ol_.js} +2 -2
- package/dist/_chunks/{icon-picker-CSViTQL9.js.map → icon-picker-JZzs1ol_.js.map} +1 -1
- package/dist/_chunks/{kit-extensions-Kca1tkfP.js → kit-extensions-GQHKTLWI.js} +6 -6
- package/dist/_chunks/{kit-extensions-Kca1tkfP.js.map → kit-extensions-GQHKTLWI.js.map} +1 -1
- package/dist/_chunks/{login-dev-card-q7iTojvV.js → login-dev-card-DletSsX3.js} +4 -4
- package/dist/_chunks/{login-dev-card-q7iTojvV.js.map → login-dev-card-DletSsX3.js.map} +1 -1
- package/dist/_chunks/{notes-panel-BPb-2ZnJ.js → notes-panel-DWJY3WV8.js} +2 -2
- package/dist/_chunks/{notes-panel-BPb-2ZnJ.js.map → notes-panel-DWJY3WV8.js.map} +1 -1
- package/dist/_chunks/{password-input-B7pQTk7l.js → password-input-6Yl6x1IO.js} +2 -2
- package/dist/_chunks/{password-input-B7pQTk7l.js.map → password-input-6Yl6x1IO.js.map} +1 -1
- package/dist/_chunks/{patient-details-BP9r_lNS.js → patient-details-D7QlsGK1.js} +2 -2
- package/dist/_chunks/{patient-details-BP9r_lNS.js.map → patient-details-D7QlsGK1.js.map} +1 -1
- package/dist/_chunks/{patient-field-row-BK9JjbzA.js → patient-field-row-Dr-ndtG8.js} +5 -5
- package/dist/_chunks/{patient-field-row-BK9JjbzA.js.map → patient-field-row-Dr-ndtG8.js.map} +1 -1
- package/dist/_chunks/{patient-summary-card-DGbRLzF1.js → patient-summary-card-A3WhxFwp.js} +2 -2
- package/dist/_chunks/{patient-summary-card-DGbRLzF1.js.map → patient-summary-card-A3WhxFwp.js.map} +1 -1
- package/dist/_chunks/{postal-code-input-BmbqjkfD.js → postal-code-input-lCk8me6K.js} +2 -2
- package/dist/_chunks/{postal-code-input-BmbqjkfD.js.map → postal-code-input-lCk8me6K.js.map} +1 -1
- package/dist/_chunks/{pregnancy-dating-DV3o2PPl.js → pregnancy-dating-BEmsMys4.js} +2 -2
- package/dist/_chunks/{pregnancy-dating-DV3o2PPl.js.map → pregnancy-dating-BEmsMys4.js.map} +1 -1
- package/dist/_chunks/{pregnancy-weight-gain-BLjWgtS9.js → pregnancy-weight-gain-DMVPvM3a.js} +2 -2
- package/dist/_chunks/{pregnancy-weight-gain-BLjWgtS9.js.map → pregnancy-weight-gain-DMVPvM3a.js.map} +1 -1
- package/dist/_chunks/{radiograph-panel.agent-C4j6eoQn.js → radiograph-panel.agent-rS3Tegx6.js} +2 -2
- package/dist/_chunks/{radiograph-panel.agent-C4j6eoQn.js.map → radiograph-panel.agent-rS3Tegx6.js.map} +1 -1
- package/dist/_chunks/{registration-form-CBDeXzlk.js → registration-form-Lz9iKrKo.js} +246 -235
- package/dist/_chunks/registration-form-Lz9iKrKo.js.map +1 -0
- package/dist/_chunks/{rich-text-editor-CCCSEPlG.js → rich-text-editor-DmnWavgl.js} +2 -2
- package/dist/_chunks/{rich-text-editor-CCCSEPlG.js.map → rich-text-editor-DmnWavgl.js.map} +1 -1
- package/dist/_chunks/{search-bar-D695TCDH.js → search-bar-ORcfuK9A.js} +2 -2
- package/dist/_chunks/{search-bar-D695TCDH.js.map → search-bar-ORcfuK9A.js.map} +1 -1
- package/dist/_chunks/{search-input-Tl-RkS5x.js → search-input-6SoR2Rf4.js} +2 -2
- package/dist/_chunks/{search-input-Tl-RkS5x.js.map → search-input-6SoR2Rf4.js.map} +1 -1
- package/dist/_chunks/{task-editor-Dl27rI3J.js → task-editor-i-juLk76.js} +3 -3
- package/dist/_chunks/{task-editor-Dl27rI3J.js.map → task-editor-i-juLk76.js.map} +1 -1
- package/dist/_chunks/{text-input-lZ2-t-p2.js → text-input-rzLEKhRU.js} +145 -97
- package/dist/_chunks/text-input-rzLEKhRU.js.map +1 -0
- package/dist/_chunks/{transcript-panel-CLgtyVbR.js → transcript-panel-jOCW4Ycl.js} +2 -2
- package/dist/_chunks/{transcript-panel-CLgtyVbR.js.map → transcript-panel-jOCW4Ycl.js.map} +1 -1
- package/dist/_chunks/{unit-converter-CXNr5P4J.js → unit-converter-Bvhj9r3m.js} +2 -2
- package/dist/_chunks/{unit-converter-CXNr5P4J.js.map → unit-converter-Bvhj9r3m.js.map} +1 -1
- package/dist/_chunks/{use-appointment-details-read-BEbLseXW.js → use-appointment-details-read-B6dBBgDa.js} +3 -3
- package/dist/_chunks/{use-appointment-details-read-BEbLseXW.js.map → use-appointment-details-read-B6dBBgDa.js.map} +1 -1
- package/dist/_chunks/use-field-match-pdbEnKvO.js.map +1 -1
- package/dist/_chunks/{widget-picker-BCbwD5Z1.js → widget-picker-Ck8HTsil.js} +2 -2
- package/dist/_chunks/{widget-picker-BCbwD5Z1.js.map → widget-picker-Ck8HTsil.js.map} +1 -1
- package/dist/agent-catalog.json +1 -1
- package/dist/components/address-fields/index.js +1 -1
- package/dist/components/appointment-details-panel/index.js +1 -1
- package/dist/components/bishop-score/index.js +1 -1
- package/dist/components/bmi-calculator/index.js +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/city-input/index.js +1 -1
- package/dist/components/cycle-calculator/index.js +1 -1
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/data-table-tabs/index.js +1 -1
- package/dist/components/due-date-calculator/index.js +1 -1
- package/dist/components/email-input/index.js +1 -1
- package/dist/components/face-scheme/index.js +1 -1
- package/dist/components/fetal-weight/index.js +1 -1
- package/dist/components/file-manager/index.js +1 -1
- package/dist/components/form-field/form-field-context.d.ts +5 -0
- package/dist/components/form-field/form-field-context.d.ts.map +1 -1
- package/dist/components/form-field/form-field.d.ts.map +1 -1
- package/dist/components/form-field/index.js +1 -1
- package/dist/components/gestational-age-calculator/index.js +1 -1
- package/dist/components/hcg-doubling/index.js +1 -1
- package/dist/components/icon-picker/index.js +1 -1
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/password-input/index.js +1 -1
- package/dist/components/patient-details/index.js +1 -1
- package/dist/components/patient-summary-card/index.js +1 -1
- package/dist/components/patient-table/index.js +1 -1
- package/dist/components/postal-code-input/index.js +1 -1
- package/dist/components/pregnancy-dating/index.js +1 -1
- package/dist/components/pregnancy-weight-gain/index.js +1 -1
- package/dist/components/radiograph-panel/index.js +1 -1
- package/dist/components/rich-text-editor/index.js +2 -2
- package/dist/components/search-bar/index.js +1 -1
- package/dist/components/search-input/index.js +1 -1
- package/dist/components/task-editor/index.js +1 -1
- package/dist/components/text-input/index.js +1 -1
- package/dist/components/text-input/text-input.d.ts +13 -0
- package/dist/components/text-input/text-input.d.ts.map +1 -1
- package/dist/components/transcript-panel/index.js +1 -1
- package/dist/components/unit-converter/index.js +1 -1
- package/dist/components/widget-picker/index.js +1 -1
- package/dist/hooks/use-field-match.d.ts +3 -2
- package/dist/hooks/use-field-match.d.ts.map +1 -1
- package/dist/i18n/locales/ar.d.ts +4 -0
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +4 -0
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts +4 -0
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +4 -0
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/el.d.ts +4 -0
- package/dist/i18n/locales/el.d.ts.map +1 -1
- package/dist/i18n/locales/el.js +4 -0
- package/dist/i18n/locales/el.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +4 -0
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +4 -0
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +4 -0
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +4 -0
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +4 -0
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +4 -0
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts +4 -0
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +4 -0
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +4 -0
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +4 -0
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts +4 -0
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +4 -0
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts +4 -0
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +4 -0
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts +4 -0
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +4 -0
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts +4 -0
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +4 -0
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ro.d.ts +4 -0
- package/dist/i18n/locales/ro.d.ts.map +1 -1
- package/dist/i18n/locales/ro.js +4 -0
- package/dist/i18n/locales/ro.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts +4 -0
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +4 -0
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/sq.d.ts +4 -0
- package/dist/i18n/locales/sq.d.ts.map +1 -1
- package/dist/i18n/locales/sq.js +4 -0
- package/dist/i18n/locales/sq.js.map +1 -1
- package/dist/i18n/locales/sv.d.ts +4 -0
- package/dist/i18n/locales/sv.d.ts.map +1 -1
- package/dist/i18n/locales/sv.js +4 -0
- package/dist/i18n/locales/sv.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts +4 -0
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +4 -0
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +4 -0
- package/dist/i18n/locales/zh.d.ts.map +1 -1
- package/dist/i18n/locales/zh.js +4 -0
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.js +42 -42
- package/dist/locales/ar.json +4 -0
- package/dist/locales/de.json +4 -0
- package/dist/locales/el.json +4 -0
- package/dist/locales/en.json +4 -0
- package/dist/locales/es.json +4 -0
- package/dist/locales/fr.json +4 -0
- package/dist/locales/hi.json +4 -0
- package/dist/locales/it.json +4 -0
- package/dist/locales/ja.json +4 -0
- package/dist/locales/nl.json +4 -0
- package/dist/locales/pl.json +4 -0
- package/dist/locales/pt.json +4 -0
- package/dist/locales/ro.json +4 -0
- package/dist/locales/ru.json +4 -0
- package/dist/locales/sq.json +4 -0
- package/dist/locales/sv.json +4 -0
- package/dist/locales/tr.json +4 -0
- package/dist/locales/zh.json +4 -0
- package/dist/patterns/anamnesis/index.js +1 -1
- package/dist/patterns/calendar/index.js +1 -1
- package/dist/patterns/forgot-password-form/index.js +1 -1
- package/dist/patterns/help-me-write-templates/index.js +1 -1
- package/dist/patterns/login-form/index.js +1 -1
- package/dist/patterns/registration-form/index.d.ts +1 -1
- package/dist/patterns/registration-form/index.d.ts.map +1 -1
- package/dist/patterns/registration-form/index.js +1 -1
- package/dist/patterns/registration-form/registration-form.d.ts +16 -0
- package/dist/patterns/registration-form/registration-form.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/_chunks/form-field-D9WfDpYB.js.map +0 -1
- package/dist/_chunks/registration-form-CBDeXzlk.js.map +0 -1
- package/dist/_chunks/text-input-lZ2-t-p2.js.map +0 -1
package/dist/_chunks/{due-date-calculator-_0Dz_d7n.js.map → due-date-calculator-mDvGKmRV.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"due-date-calculator-_0Dz_d7n.js","sources":["../../src/components/due-date-calculator/due-date-calculator.agent.ts","../../src/components/due-date-calculator/due-date-calculator.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — DueDateCalculator. */\n/* */\n/* Estimates the date of delivery from one of three dating methods (LMP / */\n/* conception / IVF transfer) plus current gestational age + trimester. */\n/* The agent surface is the dating inputs plus the computed EDD / GA; the */\n/* handle is the curated `DueDateCalculatorHandle` (the public `ref` */\n/* stays the root <div>, exactly as `slider.tsx` and `bmi-calculator.tsx` */\n/* keep theirs). */\n/* */\n/* Dates cross the boundary as local-time `yyyy-MM-dd` strings, never */\n/* `Date` objects, so nothing shifts a day under JSON/UTC serialisation. */\n/* */\n/* DEPRECATED surface: this component is superseded by PregnancyDating, */\n/* which unifies dating + gestational age. Prefer the `pregnancy-dating` */\n/* adapter for new work — every action here is marked deprecated. */\n/* */\n/* PHI (§7): never exposes patient identity — the slots return the */\n/* operator's own structural dating inputs and the dates derived from */\n/* them. See `src/docs/26-agent-readiness.mdx`. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { DueDateCalculatorHandle } from './due-date-calculator';\n\nconst DEPRECATED = 'Superseded by the `pregnancy-dating` adapter.';\n\n/** Shared JSON Schema fragment for a local calendar date. */\nconst isoDate = {\n type: 'string',\n pattern: '^\\\\d{4}-\\\\d{2}-\\\\d{2}$',\n} as const;\n\nexport const dueDateCalculatorAgent: AgentAdapter<DueDateCalculatorHandle> = {\n id: 'due-date-calculator',\n // set_value → the six `set_*` actions + the `inputs` state slot.\n capabilities: ['set_value'],\n state: {\n inputs: {\n type: '{ method: string, referenceDate: string | null, cycleLength: number | null, embryoAge: 3 | 5, crlMm: number | null, scanDate: string | null, asOfDate: string }',\n descriptionKey: 'ui.agent.dueDateCalculator.state.inputs',\n description:\n '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.',\n read: (handle) => handle.getInputs(),\n },\n result: {\n type: '{ dueDate: string, gestationalStart: string, gestationalAge: { weeks: number, days: number, totalDays: number } | null, trimester: string } | null',\n descriptionKey: 'ui.agent.dueDateCalculator.state.result',\n description:\n '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.',\n read: (handle) => handle.getResult(),\n },\n },\n actions: {\n set_method: {\n // Drives the same local input state a user picks; nothing is persisted\n // to a record, and the choice is reversible in the same UI.\n safety: 'write',\n argsType: \"{ method: 'lmp' | 'conception' | 'ivf' }\",\n argsSchema: {\n type: 'object',\n properties: {\n method: {\n enum: ['lmp', 'conception', 'ivf'],\n description:\n 'Which anchor to date from — last menstrual period, conception, or IVF transfer.',\n },\n },\n required: ['method'],\n additionalProperties: false,\n },\n idempotent: true,\n deprecated: DEPRECATED,\n returns: 'boolean',\n returnsSchema: {\n type: 'boolean',\n description: 'True when the method was applied.',\n },\n errors: [\n 'Returns false for a method outside the three supported anchors.',\n ],\n descriptionKey: 'ui.agent.dueDateCalculator.actions.setMethod',\n description:\n '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.',\n invoke: (handle, args: { method: 'lmp' | 'conception' | 'ivf' }) =>\n handle.setMethod(args.method),\n },\n set_reference_date: {\n safety: 'write',\n argsType: '{ date: string | null }',\n argsSchema: {\n type: 'object',\n properties: {\n date: {\n oneOf: [\n { ...isoDate, description: 'Local calendar date, `yyyy-MM-dd`.' },\n { type: 'null' },\n ],\n description:\n 'The date the active method anchors on — LMP, conception, or transfer — or null to clear it. Must not be in the future.',\n },\n },\n required: ['date'],\n additionalProperties: false,\n },\n idempotent: true,\n deprecated: DEPRECATED,\n returns: 'boolean',\n returnsSchema: {\n type: 'boolean',\n description: 'True when the date was applied.',\n },\n errors: [\n 'Returns false for an unparseable date or a date in the future — the on-screen DatePicker caps at today.',\n ],\n examples: [\n {\n args: { date: '2026-01-12' },\n note: 'Under the default LMP method, a last period starting 12 January.',\n },\n ],\n descriptionKey: 'ui.agent.dueDateCalculator.actions.setReferenceDate',\n description:\n 'Set the reference date for the active method. This is the only required input — the result stays null without it.',\n invoke: (handle, args: { date: string | null }) =>\n handle.setReferenceDate(args.date),\n },\n set_cycle_length: {\n safety: 'write',\n argsType: '{ days: number | null }',\n argsSchema: {\n type: 'object',\n properties: {\n days: {\n oneOf: [\n { type: 'integer', minimum: 20, maximum: 45 },\n { type: 'null' },\n ],\n description:\n 'Average cycle length in days (20–45), or null to fall back to the 28-day default.',\n },\n },\n required: ['days'],\n additionalProperties: false,\n },\n idempotent: true,\n deprecated: DEPRECATED,\n returns: 'boolean',\n returnsSchema: {\n type: 'boolean',\n description: 'True when the value was applied.',\n },\n errors: [\n 'Returns false outside 20–45 days — the same bounds the on-screen NumberInput enforces.',\n 'Applies but changes nothing unless the method is `lmp`, and is ignored once a CRL re-dating is confirmed.',\n ],\n descriptionKey: 'ui.agent.dueDateCalculator.actions.setCycleLength',\n description:\n 'LMP method only — set the average cycle length, which shifts Naegele dating off the 28-day assumption.',\n invoke: (handle, args: { days: number | null }) =>\n handle.setCycleLength(args.days),\n },\n set_embryo_age: {\n safety: 'write',\n argsType: '{ days: 3 | 5 }',\n argsSchema: {\n type: 'object',\n properties: {\n days: {\n enum: [3, 5],\n description:\n 'Embryo age at transfer in days — 3 (cleavage) or 5 (blastocyst).',\n },\n },\n required: ['days'],\n additionalProperties: false,\n },\n idempotent: true,\n deprecated: DEPRECATED,\n returns: 'boolean',\n returnsSchema: {\n type: 'boolean',\n description: 'True when the value was applied.',\n },\n errors: [\n 'Returns false for any value other than 3 or 5.',\n 'Applies but changes nothing unless the method is `ivf`.',\n ],\n descriptionKey: 'ui.agent.dueDateCalculator.actions.setEmbryoAge',\n description:\n 'IVF method only — set the embryo age at transfer, which offsets the transfer date back to a notional LMP.',\n invoke: (handle, args: { days: 3 | 5 }) => handle.setEmbryoAge(args.days),\n },\n set_crl: {\n safety: 'write',\n argsType: '{ crlMm?: number | null, scanDate?: string | null }',\n argsSchema: {\n type: 'object',\n properties: {\n crlMm: {\n oneOf: [{ type: 'number', exclusiveMinimum: 0 }, { type: 'null' }],\n description:\n 'Crown-rump length in millimetres, or null to clear it.',\n },\n scanDate: {\n oneOf: [{ ...isoDate }, { type: 'null' }],\n description:\n 'Date of the CRL scan (`yyyy-MM-dd`, not in the future), or null to clear it.',\n },\n },\n additionalProperties: false,\n },\n idempotent: true,\n deprecated: DEPRECATED,\n returns: 'boolean',\n returnsSchema: {\n type: 'boolean',\n description: 'True when the measurement was applied.',\n },\n errors: [\n '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.',\n 'Re-dating only happens under the `lmp` method, and only when both the length and the scan date are set.',\n ],\n examples: [\n {\n args: { crlMm: 42, scanDate: '2026-02-20' },\n note: 'A first-trimester CRL that may re-date the pregnancy per ACOG CO 700.',\n },\n ],\n descriptionKey: 'ui.agent.dueDateCalculator.actions.setCrl',\n description:\n '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.',\n invoke: (\n handle,\n args: { crlMm?: number | null; scanDate?: string | null },\n ) => handle.setCrl(args),\n },\n set_as_of_date: {\n safety: 'write',\n argsType: '{ date: string }',\n argsSchema: {\n type: 'object',\n properties: {\n date: {\n ...isoDate,\n description:\n 'Date to evaluate gestational age and trimester against, `yyyy-MM-dd`. May be in the future to project forward.',\n },\n },\n required: ['date'],\n additionalProperties: false,\n },\n idempotent: true,\n deprecated: DEPRECATED,\n returns: 'boolean',\n returnsSchema: {\n type: 'boolean',\n description: 'True when the date was applied.',\n },\n errors: ['Returns false for an unparseable date.'],\n examples: [\n {\n args: { date: '2026-09-15' },\n note: 'Project gestational age forward to an upcoming appointment.',\n },\n ],\n descriptionKey: 'ui.agent.dueDateCalculator.actions.setAsOfDate',\n description:\n '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.',\n invoke: (handle, args: { date: string }) => handle.setAsOfDate(args.date),\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'due-date-calculator',\n description: 'Marks the DueDateCalculator wrapper.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description:\n '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.',\n },\n },\n};\n","/* ------------------------------------------------------------------ */\n/* DueDateCalculator — estimate the date of delivery from one of three */\n/* dating methods, with current gestational age + trimester. */\n/* */\n/* - Maths lives in `./gestation` (pure, separately tested). */\n/* - Three methods: LMP (Naegele, cycle-length adjustable), conception, */\n/* and IVF transfer (Day-3 vs Day-5 embryo). */\n/* - The reference date can't be in the future, so the DatePicker caps */\n/* at today. */\n/* ------------------------------------------------------------------ */\n\nimport { forwardRef, useEffect, useMemo, useRef, useState } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { format, isAfter, parseISO } from 'date-fns';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { dueDateCalculatorAgent } from './due-date-calculator.agent';\nimport { RadioGroup, Radio } from '../radio-group';\nimport { FormField } from '../form-field';\nimport { DatePicker } from '../date-picker';\nimport { NumberInput } from '../number-input';\nimport { Card } from '../card';\nimport { Badge } from '../badge';\nimport {\n InsertButton,\n type InsertPayload,\n type InsertVariant,\n type InsertMode,\n} from '../_shared/insert-result';\nimport {\n type DueDateMethod,\n type EmbryoAge,\n type DueDateResult,\n computeDueDate,\n redateByCrl,\n DEFAULT_CYCLE_LENGTH,\n TRIMESTER_BADGE_VARIANT,\n trimesterHighlightToken,\n} from '../_shared/obstetrics';\nimport {\n computeAntenatalSchedule,\n type AntenatalScheduleOptions,\n} from '../_shared/antenatal-schedule';\nimport {\n AntenatalScheduleTimeline,\n buildScheduleInsertFields,\n} from '../_shared/antenatal-schedule-timeline';\n\nconst rootVariants = cva('ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]', {\n variants: {\n width: { full: 'ds:w-full', auto: 'ds:inline-flex' },\n },\n defaultVariants: { width: 'full' },\n});\n\n/** Reference-date i18n key per method. */\nconst DATE_LABEL_KEY: Record<DueDateMethod, string> = {\n lmp: 'dueDateCalculator.lmpDate',\n conception: 'dueDateCalculator.conceptionDate',\n ivf: 'dueDateCalculator.transferDate',\n};\n\n/* ------------------------------------------------------------------ */\n/* Agent boundary */\n/* */\n/* Dates cross the agent boundary as local-time `yyyy-MM-dd` strings, */\n/* never `Date` objects — a Date JSON-serialises to UTC and silently */\n/* shifts the day for anyone east or west of Greenwich. */\n/* ------------------------------------------------------------------ */\n\nconst toIsoDate = (d: Date): string => format(d, 'yyyy-MM-dd');\n\nconst fromIsoDate = (iso: string): Date | null => {\n const d = parseISO(iso);\n return Number.isNaN(d.getTime()) ? null : d;\n};\n\n/** UI input bounds, mirrored by the agent handle so it can't out-type a user. */\nconst CYCLE_LENGTH_RANGE = { min: 20, max: 45 } as const;\n\n/** The dating inputs as entered. */\nexport interface DueDateInputsSnapshot {\n /** Which anchor the pregnancy is dated from. */\n method: DueDateMethod;\n /** The method's reference date (`yyyy-MM-dd`), or null when unset. */\n referenceDate: string | null;\n /** LMP only — average cycle length in days, or null for the 28-day default. */\n cycleLength: number | null;\n /** IVF only — embryo age at transfer, in days. */\n embryoAge: EmbryoAge;\n /** LMP only — crown-rump length in millimetres, or null. */\n crlMm: number | null;\n /** LMP only — date of the CRL scan (`yyyy-MM-dd`), or null. */\n scanDate: string | null;\n /** The date gestational age and trimester are evaluated against. */\n asOfDate: string;\n}\n\n/** `DueDateResult` projected onto the agent boundary — ISO dates, no Dates. */\nexport interface DueDateSnapshot {\n /** Estimated date of delivery, `yyyy-MM-dd`. */\n dueDate: string;\n /** GA day-0 anchor (effective LMP) after any CRL re-dating, `yyyy-MM-dd`. */\n gestationalStart: string;\n /** Gestational age as of the evaluation date; null before conception. */\n gestationalAge: { weeks: number; days: number; totalDays: number } | null;\n /** Trimester band as of the evaluation date. */\n trimester: DueDateResult['trimester'];\n}\n\n/**\n * Curated imperative handle for agent / external automation. Reads the dating\n * inputs and the computed due date, and drives the inputs the way a user\n * would. Never exposes patient identity — only structural dates and numbers.\n * Consumed by `due-date-calculator.agent.ts`; the public `ref` stays the root\n * DOM element.\n */\nexport interface DueDateCalculatorHandle {\n /** The dating inputs as entered. */\n getInputs: () => DueDateInputsSnapshot;\n /** Computed due date, gestational age and trimester, or null until a reference date is set. */\n getResult: () => DueDateSnapshot | null;\n /** Switch the dating method. Keeps the reference date, which is re-interpreted. */\n setMethod: (method: DueDateMethod) => boolean;\n /** Set the method's reference date (`yyyy-MM-dd`, not in the future). */\n setReferenceDate: (isoDate: string | null) => boolean;\n /** LMP only — set the average cycle length in days (20–45). */\n setCycleLength: (days: number | null) => boolean;\n /** IVF only — set the embryo age at transfer (3 or 5 days). */\n setEmbryoAge: (days: EmbryoAge) => boolean;\n /** LMP only — set the CRL measurement and/or its scan date for ACOG re-dating. */\n setCrl: (next: {\n crlMm?: number | null;\n scanDate?: string | null;\n }) => boolean;\n /** Set the date gestational age and trimester are evaluated against. */\n setAsOfDate: (isoDate: string) => boolean;\n}\n\nexport interface DueDateCalculatorProps extends VariantProps<\n typeof rootVariants\n> {\n /** Initial dating method. Defaults to `'lmp'`. */\n defaultMethod?: DueDateMethod;\n /** Fires whenever a due date can be computed (and with `null` when it can't). */\n onResultChange?: (result: DueDateResult | null) => void;\n /** When provided, shows an \"Insert\" button that emits the result for an editor. */\n onInsert?: (payload: InsertPayload) => void;\n /**\n * Which verb the result button performs. Defaults to `'insert'`.\n * Use `'copy'` in an app-shell surface (no editor to insert into) — the\n * button writes the result to the clipboard as a multi-format `ClipboardItem`.\n */\n insertVariant?: InsertVariant;\n /** `copy` variant only — fired after a successful clipboard write. */\n onCopy?: (mode: InsertMode) => void;\n /** `copy` variant only — fired if the clipboard write can't proceed. */\n onError?: (error: unknown) => void;\n /**\n * Brand wordmark printed in the inserted/copied result-card footer.\n * Omitted → no brand line (and no footer hairline); a string → that custom\n * brand; `false` → no brand line. Brand is opt-in.\n */\n insertBrand?: string | false;\n /**\n * Append the antenatal exam schedule (the time-sensitive screening windows)\n * below the result, dated from the computed gestational start.\n */\n showSchedule?: boolean;\n /**\n * Passthrough options for the appended schedule (national `schedule`,\n * `plurality`, `chorionicity`, `rhNegative`, `gdmRisk`, …). `today` is\n * supplied by the component. Ignored unless `showSchedule` is set.\n */\n scheduleOptions?: Omit<AntenatalScheduleOptions, 'today'>;\n /** Opaque instance id, emitted as `data-component-id`. */\n id?: string;\n /** Extra class names on the wrapper. */\n className?: string;\n}\n\n/**\n * @deprecated Superseded by `PregnancyDating`, which unifies the due-date and\n * gestational-age calculators (any anchor → both EDD and current GA) and adds a\n * manual ±days dating adjustment. This component will be removed in a future\n * release; migrate to `PregnancyDating` (`defaultMethod=\"lmp\"`).\n */\nexport const DueDateCalculator = forwardRef<\n HTMLDivElement,\n DueDateCalculatorProps\n>(\n (\n {\n defaultMethod = 'lmp',\n onResultChange,\n onInsert,\n insertVariant = 'insert',\n onCopy,\n onError,\n insertBrand,\n showSchedule = false,\n scheduleOptions,\n id,\n width,\n className,\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation('ui');\n\n const [method, setMethod] = useState<DueDateMethod>(defaultMethod);\n const [refDate, setRefDate] = useState<Date | undefined>(undefined);\n const [cycleLength, setCycleLength] = useState<number | null>(\n DEFAULT_CYCLE_LENGTH,\n );\n const [embryoAge, setEmbryoAge] = useState<EmbryoAge>(5);\n // Optional first-trimester ultrasound (LMP method only) for ACOG CO700 redating.\n const [crlMm, setCrlMm] = useState<number | null>(null);\n const [scanDate, setScanDate] = useState<Date | undefined>(undefined);\n\n // Real today — caps the date inputs (LMP / ultrasound can't be in the future).\n const today = useMemo(() => new Date(), []);\n // The date GA, trimester and schedule status are evaluated against; defaults\n // to today but can be a future appointment date to project forward. (The EDD\n // itself is dating-anchored and does not depend on this.)\n const [asOfDate, setAsOfDate] = useState<Date>(() => new Date());\n\n // ACOG CO700 CRL redating — only when an LMP, a CRL and a scan date are set.\n const redating = useMemo(() => {\n if (method !== 'lmp' || !refDate || crlMm === null || !scanDate) {\n return null;\n }\n return redateByCrl({ lmp: refDate, scanDate, crlMm });\n }, [method, refDate, crlMm, scanDate]);\n\n const result = useMemo<DueDateResult | null>(() => {\n if (!refDate) return null;\n // A confirmed redating moves the effective LMP to the ultrasound's; the\n // CRL already reflects true gestation, so cycle adjustment no longer applies.\n const effectiveDate =\n method === 'lmp' && redating?.redated\n ? redating.gestationalStart\n : refDate;\n const effectiveCycle =\n method === 'lmp' && redating?.redated\n ? DEFAULT_CYCLE_LENGTH\n : (cycleLength ?? DEFAULT_CYCLE_LENGTH);\n return computeDueDate(\n {\n method,\n date: effectiveDate,\n cycleLength: effectiveCycle,\n embryoAge,\n },\n asOfDate,\n );\n }, [method, refDate, cycleLength, embryoAge, redating, asOfDate]);\n\n const dateFormatter = useMemo(\n () => new Intl.DateTimeFormat(i18n.language, { dateStyle: 'long' }),\n [i18n.language],\n );\n\n useEffect(() => {\n onResultChange?.(result);\n }, [result, onResultChange]);\n\n /* ── Agent handle ────────────────────────────────────────────────── */\n const liveRef = useRef({\n method,\n refDate,\n cycleLength,\n embryoAge,\n crlMm,\n scanDate,\n asOfDate,\n result,\n });\n liveRef.current = {\n method,\n refDate,\n cycleLength,\n embryoAge,\n crlMm,\n scanDate,\n asOfDate,\n result,\n };\n\n const agentHandle = useMemo<DueDateCalculatorHandle>(\n () => ({\n getInputs: () => {\n const live = liveRef.current;\n return {\n method: live.method,\n referenceDate: live.refDate ? toIsoDate(live.refDate) : null,\n cycleLength: live.cycleLength,\n embryoAge: live.embryoAge,\n crlMm: live.crlMm,\n scanDate: live.scanDate ? toIsoDate(live.scanDate) : null,\n asOfDate: toIsoDate(live.asOfDate),\n };\n },\n getResult: () => {\n const r = liveRef.current.result;\n if (!r) return null;\n return {\n dueDate: toIsoDate(r.dueDate),\n gestationalStart: toIsoDate(r.gestationalStart),\n gestationalAge: r.gestationalAge ? { ...r.gestationalAge } : null,\n trimester: r.trimester,\n };\n },\n setMethod: (next) => {\n if (next !== 'lmp' && next !== 'conception' && next !== 'ivf') {\n return false;\n }\n setMethod(next);\n return true;\n },\n setReferenceDate: (isoDate) => {\n if (isoDate === null) {\n setRefDate(undefined);\n return true;\n }\n const parsed = fromIsoDate(isoDate);\n // The DatePicker caps at today; the handle honours the same bound.\n if (!parsed || isAfter(parsed, new Date())) return false;\n setRefDate(parsed);\n return true;\n },\n setCycleLength: (days) => {\n if (\n days !== null &&\n !(\n Number.isFinite(days) &&\n days >= CYCLE_LENGTH_RANGE.min &&\n days <= CYCLE_LENGTH_RANGE.max\n )\n ) {\n return false;\n }\n setCycleLength(days);\n return true;\n },\n setEmbryoAge: (days) => {\n if (days !== 3 && days !== 5) return false;\n setEmbryoAge(days);\n return true;\n },\n setCrl: (next) => {\n const now = new Date();\n let parsedScan: Date | undefined;\n // Validate the whole payload before writing any of it, so a bad\n // value can't leave the form half-updated.\n if ('crlMm' in next) {\n const mm = next.crlMm;\n if (\n mm !== null &&\n mm !== undefined &&\n !(Number.isFinite(mm) && mm > 0)\n ) {\n return false;\n }\n }\n if ('scanDate' in next && next.scanDate != null) {\n const d = fromIsoDate(next.scanDate);\n if (!d || isAfter(d, now)) return false;\n parsedScan = d;\n }\n if ('crlMm' in next) setCrlMm(next.crlMm ?? null);\n if ('scanDate' in next) setScanDate(parsedScan);\n return true;\n },\n setAsOfDate: (isoDate) => {\n const parsed = fromIsoDate(isoDate);\n if (!parsed) return false;\n setAsOfDate(parsed);\n return true;\n },\n }),\n [],\n );\n useAgentRegistration(dueDateCalculatorAgent, agentHandle, id);\n\n const schedule = useMemo(() => {\n if (!showSchedule || !result) return null;\n return computeAntenatalSchedule(result.gestationalStart, {\n ...scheduleOptions,\n today: asOfDate,\n });\n }, [showSchedule, result, asOfDate, scheduleOptions]);\n\n return (\n <div\n ref={ref}\n data-component=\"due-date-calculator\"\n data-component-id={id}\n className={rootVariants({ width, className })}\n >\n <RadioGroup\n label={t('dueDateCalculator.method.label')}\n variant=\"horizontal\"\n value={method}\n onValueChange={(next) => setMethod(next as DueDateMethod)}\n >\n <Radio label={t('dueDateCalculator.method.lmp')} value=\"lmp\" />\n <Radio\n label={t('dueDateCalculator.method.conception')}\n value=\"conception\"\n />\n <Radio label={t('dueDateCalculator.method.ivf')} value=\"ivf\" />\n </RadioGroup>\n\n <div className=\"ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2\">\n <FormField label={t(DATE_LABEL_KEY[method])}>\n <DatePicker value={refDate} onChange={setRefDate} maxDate={today} />\n </FormField>\n\n {method === 'lmp' && (\n <FormField\n label={t('dueDateCalculator.cycleLength')}\n description={t('dueDateCalculator.cycleLengthHint')}\n >\n <NumberInput\n mode=\"integer\"\n min={CYCLE_LENGTH_RANGE.min}\n max={CYCLE_LENGTH_RANGE.max}\n value={cycleLength}\n onChange={setCycleLength}\n />\n </FormField>\n )}\n\n {method === 'ivf' && (\n <RadioGroup\n label={t('dueDateCalculator.embryoAge')}\n variant=\"horizontal\"\n value={String(embryoAge)}\n onValueChange={(next) => setEmbryoAge(Number(next) as EmbryoAge)}\n >\n <Radio label={t('dueDateCalculator.day3')} value=\"3\" />\n <Radio label={t('dueDateCalculator.day5')} value=\"5\" />\n </RadioGroup>\n )}\n </div>\n\n <FormField\n label={t('dueDateCalculator.asOfDate')}\n description={t('dueDateCalculator.asOfDateHint')}\n >\n <DatePicker value={asOfDate} onChange={(d) => d && setAsOfDate(d)} />\n </FormField>\n\n {method === 'lmp' ? (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\">\n <div className=\"ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2\">\n <FormField\n label={t('dueDateCalculator.crl')}\n description={t('dueDateCalculator.crlHint')}\n >\n <NumberInput\n mode=\"decimal\"\n min={0}\n step={0.1}\n value={crlMm}\n onChange={setCrlMm}\n />\n </FormField>\n <FormField label={t('dueDateCalculator.scanDate')}>\n <DatePicker\n value={scanDate}\n onChange={setScanDate}\n maxDate={today}\n />\n </FormField>\n </div>\n {redating ? (\n <div className=\"ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]\">\n <Badge variant={redating.redated ? 'warning' : 'success'}>\n {redating.redated\n ? t('dueDateCalculator.redated', {\n days: redating.discrepancyDays,\n })\n : t('dueDateCalculator.datesAgree')}\n </Badge>\n {!redating.crlInRange ? (\n <span className=\"type-meta ds:text-muted-foreground\">\n {t('dueDateCalculator.crlOutOfRange')}\n </span>\n ) : null}\n </div>\n ) : null}\n </div>\n ) : null}\n\n {/* Concise polite announcement when a due date resolves. */}\n <p className=\"ds:sr-only\" role=\"status\" aria-live=\"polite\">\n {result\n ? `${t('dueDateCalculator.result.dueDateLabel')}: ${dateFormatter.format(\n result.dueDate,\n )}. ${t('dueDateCalculator.result.trimesterLabel')}: ${t(\n `dueDateCalculator.trimester.${result.trimester}`,\n )}.`\n : ''}\n </p>\n\n {result ? (\n <Card variant=\"elevated\">\n <Card.Body className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n <dl className=\"ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-3\">\n <div className=\"ds:flex ds:flex-col ds:items-start ds:gap-[var(--spacing-xs)]\">\n <dt className=\"type-label ds:text-muted-foreground\">\n {t('dueDateCalculator.result.trimesterLabel')}\n </dt>\n <dd>\n <Badge\n variant={TRIMESTER_BADGE_VARIANT[result.trimester]}\n size=\"lg\"\n >\n {t(`dueDateCalculator.trimester.${result.trimester}`)}\n </Badge>\n </dd>\n </div>\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <dt className=\"type-label ds:text-muted-foreground\">\n {t('dueDateCalculator.result.gestationLabel')}\n </dt>\n <dd className=\"type-body ds:text-foreground\">\n {result.gestationalAge\n ? t('dueDateCalculator.result.gestation', {\n weeks: result.gestationalAge.weeks,\n days: result.gestationalAge.days,\n })\n : '—'}\n </dd>\n </div>\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <dt className=\"type-label ds:text-muted-foreground\">\n {t('dueDateCalculator.result.dueDateLabel')}\n </dt>\n <dd className=\"type-metric ds:text-foreground\">\n {dateFormatter.format(result.dueDate)}\n </dd>\n </div>\n </dl>\n </Card.Body>\n </Card>\n ) : (\n <p className=\"type-body ds:text-muted-foreground\">\n {t('dueDateCalculator.empty')}\n </p>\n )}\n\n {schedule ? <AntenatalScheduleTimeline events={schedule} /> : null}\n\n {/* One result-action group for the whole result — sits after both the\n due-date card and the schedule, and its payload carries the schedule\n rows when shown (no per-card buttons). */}\n {result && (insertVariant === 'copy' || onInsert) ? (\n <InsertButton\n variant={insertVariant}\n onInsert={onInsert}\n onCopy={onCopy}\n onError={onError}\n card={{\n title: t('insert.title.dueDate'),\n icon: 'calendar-heart',\n highlight: dateFormatter.format(result.dueDate),\n // Chip tinted with the trimester's semantic token so the inserted\n // PNG carries the same clinical-stage colour as the on-screen\n // trimester badge — with the contrast-safe orange override for the\n // `--warning` third trimester.\n highlightToken: trimesterHighlightToken(result.trimester),\n brand: insertBrand,\n fields: [\n {\n // The estimated date of delivery → calendar glyph.\n icon: 'calendar',\n label: t('dueDateCalculator.result.dueDateLabel'),\n value: dateFormatter.format(result.dueDate),\n },\n {\n // Gestational age is an elapsed duration → clock glyph.\n icon: 'clock',\n label: t('dueDateCalculator.result.gestationLabel'),\n value: result.gestationalAge\n ? t('dueDateCalculator.result.gestation', {\n weeks: result.gestationalAge.weeks,\n days: result.gestationalAge.days,\n })\n : '—',\n },\n {\n // Trimester is a clinical-stage classification → tag.\n icon: 'tag',\n label: t('dueDateCalculator.result.trimesterLabel'),\n value: t(`dueDateCalculator.trimester.${result.trimester}`),\n },\n // When the schedule is shown, the single Insert button carries\n // the exam windows too (no second button).\n ...(schedule\n ? buildScheduleInsertFields(schedule, t, (d) =>\n dateFormatter.format(d),\n )\n : []),\n ],\n }}\n />\n ) : null}\n </div>\n );\n },\n);\n\nDueDateCalculator.displayName = 'DueDateCalculator';\n"],"names":["DEPRECATED","isoDate","dueDateCalculatorAgent","handle","args","rootVariants","cva","DATE_LABEL_KEY","toIsoDate","d","format","fromIsoDate","iso","parseISO","CYCLE_LENGTH_RANGE","DueDateCalculator","forwardRef","defaultMethod","onResultChange","onInsert","insertVariant","onCopy","onError","insertBrand","showSchedule","scheduleOptions","id","width","className","ref","i18n","useTranslation","method","setMethod","useState","refDate","setRefDate","cycleLength","setCycleLength","DEFAULT_CYCLE_LENGTH","embryoAge","setEmbryoAge","crlMm","setCrlMm","scanDate","setScanDate","today","useMemo","asOfDate","setAsOfDate","redating","redateByCrl","result","effectiveDate","effectiveCycle","computeDueDate","dateFormatter","useEffect","liveRef","useRef","agentHandle","live","r","next","parsed","isAfter","days","now","parsedScan","mm","useAgentRegistration","schedule","computeAntenatalSchedule","jsxs","RadioGroup","jsx","Radio","FormField","DatePicker","NumberInput","Badge","Card","TRIMESTER_BADGE_VARIANT","AntenatalScheduleTimeline","InsertButton","trimesterHighlightToken","buildScheduleInsertFields"],"mappings":";;;;;;;;;;;;;;;;;AAyBA,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,UAK7DnB,MAAWhC,MAAkB,UAAUD,KACtC,gBAAAwD;AAAA,YAACS;AAAA,YAAA;AAAA,cACC,SAAShE;AAAA,cACT,UAAAD;AAAA,cACA,QAAAE;AAAA,cACA,SAAAC;AAAA,cACA,MAAM;AAAA,gBACJ,OAAO,EAAE,sBAAsB;AAAA,gBAC/B,MAAM;AAAA,gBACN,WAAWkC,EAAc,OAAOJ,EAAO,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,gBAK9C,gBAAgBiC,GAAwBjC,EAAO,SAAS;AAAA,gBACxD,OAAO7B;AAAA,gBACP,QAAQ;AAAA,kBACN;AAAA;AAAA,oBAEE,MAAM;AAAA,oBACN,OAAO,EAAE,uCAAuC;AAAA,oBAChD,OAAOiC,EAAc,OAAOJ,EAAO,OAAO;AAAA,kBAAA;AAAA,kBAE5C;AAAA;AAAA,oBAEE,MAAM;AAAA,oBACN,OAAO,EAAE,yCAAyC;AAAA,oBAClD,OAAOA,EAAO,iBACV,EAAE,sCAAsC;AAAA,sBACtC,OAAOA,EAAO,eAAe;AAAA,sBAC7B,MAAMA,EAAO,eAAe;AAAA,oBAAA,CAC7B,IACD;AAAA,kBAAA;AAAA,kBAEN;AAAA;AAAA,oBAEE,MAAM;AAAA,oBACN,OAAO,EAAE,yCAAyC;AAAA,oBAClD,OAAO,EAAE,+BAA+BA,EAAO,SAAS,EAAE;AAAA,kBAAA;AAAA;AAAA;AAAA,kBAI5D,GAAImB,IACAe;AAAA,oBAA0Bf;AAAA,oBAAU;AAAA,oBAAG,CAAC9D,MACtC+C,EAAc,OAAO/C,CAAC;AAAA,kBAAA,IAExB,CAAA;AAAA,gBAAC;AAAA,cACP;AAAA,YACF;AAAA,UAAA,IAEA;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AAEAM,GAAkB,cAAc;"}
|
|
1
|
+
{"version":3,"file":"due-date-calculator-mDvGKmRV.js","sources":["../../src/components/due-date-calculator/due-date-calculator.agent.ts","../../src/components/due-date-calculator/due-date-calculator.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — DueDateCalculator. */\n/* */\n/* Estimates the date of delivery from one of three dating methods (LMP / */\n/* conception / IVF transfer) plus current gestational age + trimester. */\n/* The agent surface is the dating inputs plus the computed EDD / GA; the */\n/* handle is the curated `DueDateCalculatorHandle` (the public `ref` */\n/* stays the root <div>, exactly as `slider.tsx` and `bmi-calculator.tsx` */\n/* keep theirs). */\n/* */\n/* Dates cross the boundary as local-time `yyyy-MM-dd` strings, never */\n/* `Date` objects, so nothing shifts a day under JSON/UTC serialisation. */\n/* */\n/* DEPRECATED surface: this component is superseded by PregnancyDating, */\n/* which unifies dating + gestational age. Prefer the `pregnancy-dating` */\n/* adapter for new work — every action here is marked deprecated. */\n/* */\n/* PHI (§7): never exposes patient identity — the slots return the */\n/* operator's own structural dating inputs and the dates derived from */\n/* them. See `src/docs/26-agent-readiness.mdx`. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { DueDateCalculatorHandle } from './due-date-calculator';\n\nconst DEPRECATED = 'Superseded by the `pregnancy-dating` adapter.';\n\n/** Shared JSON Schema fragment for a local calendar date. */\nconst isoDate = {\n type: 'string',\n pattern: '^\\\\d{4}-\\\\d{2}-\\\\d{2}$',\n} as const;\n\nexport const dueDateCalculatorAgent: AgentAdapter<DueDateCalculatorHandle> = {\n id: 'due-date-calculator',\n // set_value → the six `set_*` actions + the `inputs` state slot.\n capabilities: ['set_value'],\n state: {\n inputs: {\n type: '{ method: string, referenceDate: string | null, cycleLength: number | null, embryoAge: 3 | 5, crlMm: number | null, scanDate: string | null, asOfDate: string }',\n descriptionKey: 'ui.agent.dueDateCalculator.state.inputs',\n description:\n '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.',\n read: (handle) => handle.getInputs(),\n },\n result: {\n type: '{ dueDate: string, gestationalStart: string, gestationalAge: { weeks: number, days: number, totalDays: number } | null, trimester: string } | null',\n descriptionKey: 'ui.agent.dueDateCalculator.state.result',\n description:\n '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.',\n read: (handle) => handle.getResult(),\n },\n },\n actions: {\n set_method: {\n // Drives the same local input state a user picks; nothing is persisted\n // to a record, and the choice is reversible in the same UI.\n safety: 'write',\n argsType: \"{ method: 'lmp' | 'conception' | 'ivf' }\",\n argsSchema: {\n type: 'object',\n properties: {\n method: {\n enum: ['lmp', 'conception', 'ivf'],\n description:\n 'Which anchor to date from — last menstrual period, conception, or IVF transfer.',\n },\n },\n required: ['method'],\n additionalProperties: false,\n },\n idempotent: true,\n deprecated: DEPRECATED,\n returns: 'boolean',\n returnsSchema: {\n type: 'boolean',\n description: 'True when the method was applied.',\n },\n errors: [\n 'Returns false for a method outside the three supported anchors.',\n ],\n descriptionKey: 'ui.agent.dueDateCalculator.actions.setMethod',\n description:\n '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.',\n invoke: (handle, args: { method: 'lmp' | 'conception' | 'ivf' }) =>\n handle.setMethod(args.method),\n },\n set_reference_date: {\n safety: 'write',\n argsType: '{ date: string | null }',\n argsSchema: {\n type: 'object',\n properties: {\n date: {\n oneOf: [\n { ...isoDate, description: 'Local calendar date, `yyyy-MM-dd`.' },\n { type: 'null' },\n ],\n description:\n 'The date the active method anchors on — LMP, conception, or transfer — or null to clear it. Must not be in the future.',\n },\n },\n required: ['date'],\n additionalProperties: false,\n },\n idempotent: true,\n deprecated: DEPRECATED,\n returns: 'boolean',\n returnsSchema: {\n type: 'boolean',\n description: 'True when the date was applied.',\n },\n errors: [\n 'Returns false for an unparseable date or a date in the future — the on-screen DatePicker caps at today.',\n ],\n examples: [\n {\n args: { date: '2026-01-12' },\n note: 'Under the default LMP method, a last period starting 12 January.',\n },\n ],\n descriptionKey: 'ui.agent.dueDateCalculator.actions.setReferenceDate',\n description:\n 'Set the reference date for the active method. This is the only required input — the result stays null without it.',\n invoke: (handle, args: { date: string | null }) =>\n handle.setReferenceDate(args.date),\n },\n set_cycle_length: {\n safety: 'write',\n argsType: '{ days: number | null }',\n argsSchema: {\n type: 'object',\n properties: {\n days: {\n oneOf: [\n { type: 'integer', minimum: 20, maximum: 45 },\n { type: 'null' },\n ],\n description:\n 'Average cycle length in days (20–45), or null to fall back to the 28-day default.',\n },\n },\n required: ['days'],\n additionalProperties: false,\n },\n idempotent: true,\n deprecated: DEPRECATED,\n returns: 'boolean',\n returnsSchema: {\n type: 'boolean',\n description: 'True when the value was applied.',\n },\n errors: [\n 'Returns false outside 20–45 days — the same bounds the on-screen NumberInput enforces.',\n 'Applies but changes nothing unless the method is `lmp`, and is ignored once a CRL re-dating is confirmed.',\n ],\n descriptionKey: 'ui.agent.dueDateCalculator.actions.setCycleLength',\n description:\n 'LMP method only — set the average cycle length, which shifts Naegele dating off the 28-day assumption.',\n invoke: (handle, args: { days: number | null }) =>\n handle.setCycleLength(args.days),\n },\n set_embryo_age: {\n safety: 'write',\n argsType: '{ days: 3 | 5 }',\n argsSchema: {\n type: 'object',\n properties: {\n days: {\n enum: [3, 5],\n description:\n 'Embryo age at transfer in days — 3 (cleavage) or 5 (blastocyst).',\n },\n },\n required: ['days'],\n additionalProperties: false,\n },\n idempotent: true,\n deprecated: DEPRECATED,\n returns: 'boolean',\n returnsSchema: {\n type: 'boolean',\n description: 'True when the value was applied.',\n },\n errors: [\n 'Returns false for any value other than 3 or 5.',\n 'Applies but changes nothing unless the method is `ivf`.',\n ],\n descriptionKey: 'ui.agent.dueDateCalculator.actions.setEmbryoAge',\n description:\n 'IVF method only — set the embryo age at transfer, which offsets the transfer date back to a notional LMP.',\n invoke: (handle, args: { days: 3 | 5 }) => handle.setEmbryoAge(args.days),\n },\n set_crl: {\n safety: 'write',\n argsType: '{ crlMm?: number | null, scanDate?: string | null }',\n argsSchema: {\n type: 'object',\n properties: {\n crlMm: {\n oneOf: [{ type: 'number', exclusiveMinimum: 0 }, { type: 'null' }],\n description:\n 'Crown-rump length in millimetres, or null to clear it.',\n },\n scanDate: {\n oneOf: [{ ...isoDate }, { type: 'null' }],\n description:\n 'Date of the CRL scan (`yyyy-MM-dd`, not in the future), or null to clear it.',\n },\n },\n additionalProperties: false,\n },\n idempotent: true,\n deprecated: DEPRECATED,\n returns: 'boolean',\n returnsSchema: {\n type: 'boolean',\n description: 'True when the measurement was applied.',\n },\n errors: [\n '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.',\n 'Re-dating only happens under the `lmp` method, and only when both the length and the scan date are set.',\n ],\n examples: [\n {\n args: { crlMm: 42, scanDate: '2026-02-20' },\n note: 'A first-trimester CRL that may re-date the pregnancy per ACOG CO 700.',\n },\n ],\n descriptionKey: 'ui.agent.dueDateCalculator.actions.setCrl',\n description:\n '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.',\n invoke: (\n handle,\n args: { crlMm?: number | null; scanDate?: string | null },\n ) => handle.setCrl(args),\n },\n set_as_of_date: {\n safety: 'write',\n argsType: '{ date: string }',\n argsSchema: {\n type: 'object',\n properties: {\n date: {\n ...isoDate,\n description:\n 'Date to evaluate gestational age and trimester against, `yyyy-MM-dd`. May be in the future to project forward.',\n },\n },\n required: ['date'],\n additionalProperties: false,\n },\n idempotent: true,\n deprecated: DEPRECATED,\n returns: 'boolean',\n returnsSchema: {\n type: 'boolean',\n description: 'True when the date was applied.',\n },\n errors: ['Returns false for an unparseable date.'],\n examples: [\n {\n args: { date: '2026-09-15' },\n note: 'Project gestational age forward to an upcoming appointment.',\n },\n ],\n descriptionKey: 'ui.agent.dueDateCalculator.actions.setAsOfDate',\n description:\n '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.',\n invoke: (handle, args: { date: string }) => handle.setAsOfDate(args.date),\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'due-date-calculator',\n description: 'Marks the DueDateCalculator wrapper.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description:\n '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.',\n },\n },\n};\n","/* ------------------------------------------------------------------ */\n/* DueDateCalculator — estimate the date of delivery from one of three */\n/* dating methods, with current gestational age + trimester. */\n/* */\n/* - Maths lives in `./gestation` (pure, separately tested). */\n/* - Three methods: LMP (Naegele, cycle-length adjustable), conception, */\n/* and IVF transfer (Day-3 vs Day-5 embryo). */\n/* - The reference date can't be in the future, so the DatePicker caps */\n/* at today. */\n/* ------------------------------------------------------------------ */\n\nimport { forwardRef, useEffect, useMemo, useRef, useState } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { format, isAfter, parseISO } from 'date-fns';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { dueDateCalculatorAgent } from './due-date-calculator.agent';\nimport { RadioGroup, Radio } from '../radio-group';\nimport { FormField } from '../form-field';\nimport { DatePicker } from '../date-picker';\nimport { NumberInput } from '../number-input';\nimport { Card } from '../card';\nimport { Badge } from '../badge';\nimport {\n InsertButton,\n type InsertPayload,\n type InsertVariant,\n type InsertMode,\n} from '../_shared/insert-result';\nimport {\n type DueDateMethod,\n type EmbryoAge,\n type DueDateResult,\n computeDueDate,\n redateByCrl,\n DEFAULT_CYCLE_LENGTH,\n TRIMESTER_BADGE_VARIANT,\n trimesterHighlightToken,\n} from '../_shared/obstetrics';\nimport {\n computeAntenatalSchedule,\n type AntenatalScheduleOptions,\n} from '../_shared/antenatal-schedule';\nimport {\n AntenatalScheduleTimeline,\n buildScheduleInsertFields,\n} from '../_shared/antenatal-schedule-timeline';\n\nconst rootVariants = cva('ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]', {\n variants: {\n width: { full: 'ds:w-full', auto: 'ds:inline-flex' },\n },\n defaultVariants: { width: 'full' },\n});\n\n/** Reference-date i18n key per method. */\nconst DATE_LABEL_KEY: Record<DueDateMethod, string> = {\n lmp: 'dueDateCalculator.lmpDate',\n conception: 'dueDateCalculator.conceptionDate',\n ivf: 'dueDateCalculator.transferDate',\n};\n\n/* ------------------------------------------------------------------ */\n/* Agent boundary */\n/* */\n/* Dates cross the agent boundary as local-time `yyyy-MM-dd` strings, */\n/* never `Date` objects — a Date JSON-serialises to UTC and silently */\n/* shifts the day for anyone east or west of Greenwich. */\n/* ------------------------------------------------------------------ */\n\nconst toIsoDate = (d: Date): string => format(d, 'yyyy-MM-dd');\n\nconst fromIsoDate = (iso: string): Date | null => {\n const d = parseISO(iso);\n return Number.isNaN(d.getTime()) ? null : d;\n};\n\n/** UI input bounds, mirrored by the agent handle so it can't out-type a user. */\nconst CYCLE_LENGTH_RANGE = { min: 20, max: 45 } as const;\n\n/** The dating inputs as entered. */\nexport interface DueDateInputsSnapshot {\n /** Which anchor the pregnancy is dated from. */\n method: DueDateMethod;\n /** The method's reference date (`yyyy-MM-dd`), or null when unset. */\n referenceDate: string | null;\n /** LMP only — average cycle length in days, or null for the 28-day default. */\n cycleLength: number | null;\n /** IVF only — embryo age at transfer, in days. */\n embryoAge: EmbryoAge;\n /** LMP only — crown-rump length in millimetres, or null. */\n crlMm: number | null;\n /** LMP only — date of the CRL scan (`yyyy-MM-dd`), or null. */\n scanDate: string | null;\n /** The date gestational age and trimester are evaluated against. */\n asOfDate: string;\n}\n\n/** `DueDateResult` projected onto the agent boundary — ISO dates, no Dates. */\nexport interface DueDateSnapshot {\n /** Estimated date of delivery, `yyyy-MM-dd`. */\n dueDate: string;\n /** GA day-0 anchor (effective LMP) after any CRL re-dating, `yyyy-MM-dd`. */\n gestationalStart: string;\n /** Gestational age as of the evaluation date; null before conception. */\n gestationalAge: { weeks: number; days: number; totalDays: number } | null;\n /** Trimester band as of the evaluation date. */\n trimester: DueDateResult['trimester'];\n}\n\n/**\n * Curated imperative handle for agent / external automation. Reads the dating\n * inputs and the computed due date, and drives the inputs the way a user\n * would. Never exposes patient identity — only structural dates and numbers.\n * Consumed by `due-date-calculator.agent.ts`; the public `ref` stays the root\n * DOM element.\n */\nexport interface DueDateCalculatorHandle {\n /** The dating inputs as entered. */\n getInputs: () => DueDateInputsSnapshot;\n /** Computed due date, gestational age and trimester, or null until a reference date is set. */\n getResult: () => DueDateSnapshot | null;\n /** Switch the dating method. Keeps the reference date, which is re-interpreted. */\n setMethod: (method: DueDateMethod) => boolean;\n /** Set the method's reference date (`yyyy-MM-dd`, not in the future). */\n setReferenceDate: (isoDate: string | null) => boolean;\n /** LMP only — set the average cycle length in days (20–45). */\n setCycleLength: (days: number | null) => boolean;\n /** IVF only — set the embryo age at transfer (3 or 5 days). */\n setEmbryoAge: (days: EmbryoAge) => boolean;\n /** LMP only — set the CRL measurement and/or its scan date for ACOG re-dating. */\n setCrl: (next: {\n crlMm?: number | null;\n scanDate?: string | null;\n }) => boolean;\n /** Set the date gestational age and trimester are evaluated against. */\n setAsOfDate: (isoDate: string) => boolean;\n}\n\nexport interface DueDateCalculatorProps extends VariantProps<\n typeof rootVariants\n> {\n /** Initial dating method. Defaults to `'lmp'`. */\n defaultMethod?: DueDateMethod;\n /** Fires whenever a due date can be computed (and with `null` when it can't). */\n onResultChange?: (result: DueDateResult | null) => void;\n /** When provided, shows an \"Insert\" button that emits the result for an editor. */\n onInsert?: (payload: InsertPayload) => void;\n /**\n * Which verb the result button performs. Defaults to `'insert'`.\n * Use `'copy'` in an app-shell surface (no editor to insert into) — the\n * button writes the result to the clipboard as a multi-format `ClipboardItem`.\n */\n insertVariant?: InsertVariant;\n /** `copy` variant only — fired after a successful clipboard write. */\n onCopy?: (mode: InsertMode) => void;\n /** `copy` variant only — fired if the clipboard write can't proceed. */\n onError?: (error: unknown) => void;\n /**\n * Brand wordmark printed in the inserted/copied result-card footer.\n * Omitted → no brand line (and no footer hairline); a string → that custom\n * brand; `false` → no brand line. Brand is opt-in.\n */\n insertBrand?: string | false;\n /**\n * Append the antenatal exam schedule (the time-sensitive screening windows)\n * below the result, dated from the computed gestational start.\n */\n showSchedule?: boolean;\n /**\n * Passthrough options for the appended schedule (national `schedule`,\n * `plurality`, `chorionicity`, `rhNegative`, `gdmRisk`, …). `today` is\n * supplied by the component. Ignored unless `showSchedule` is set.\n */\n scheduleOptions?: Omit<AntenatalScheduleOptions, 'today'>;\n /** Opaque instance id, emitted as `data-component-id`. */\n id?: string;\n /** Extra class names on the wrapper. */\n className?: string;\n}\n\n/**\n * @deprecated Superseded by `PregnancyDating`, which unifies the due-date and\n * gestational-age calculators (any anchor → both EDD and current GA) and adds a\n * manual ±days dating adjustment. This component will be removed in a future\n * release; migrate to `PregnancyDating` (`defaultMethod=\"lmp\"`).\n */\nexport const DueDateCalculator = forwardRef<\n HTMLDivElement,\n DueDateCalculatorProps\n>(\n (\n {\n defaultMethod = 'lmp',\n onResultChange,\n onInsert,\n insertVariant = 'insert',\n onCopy,\n onError,\n insertBrand,\n showSchedule = false,\n scheduleOptions,\n id,\n width,\n className,\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation('ui');\n\n const [method, setMethod] = useState<DueDateMethod>(defaultMethod);\n const [refDate, setRefDate] = useState<Date | undefined>(undefined);\n const [cycleLength, setCycleLength] = useState<number | null>(\n DEFAULT_CYCLE_LENGTH,\n );\n const [embryoAge, setEmbryoAge] = useState<EmbryoAge>(5);\n // Optional first-trimester ultrasound (LMP method only) for ACOG CO700 redating.\n const [crlMm, setCrlMm] = useState<number | null>(null);\n const [scanDate, setScanDate] = useState<Date | undefined>(undefined);\n\n // Real today — caps the date inputs (LMP / ultrasound can't be in the future).\n const today = useMemo(() => new Date(), []);\n // The date GA, trimester and schedule status are evaluated against; defaults\n // to today but can be a future appointment date to project forward. (The EDD\n // itself is dating-anchored and does not depend on this.)\n const [asOfDate, setAsOfDate] = useState<Date>(() => new Date());\n\n // ACOG CO700 CRL redating — only when an LMP, a CRL and a scan date are set.\n const redating = useMemo(() => {\n if (method !== 'lmp' || !refDate || crlMm === null || !scanDate) {\n return null;\n }\n return redateByCrl({ lmp: refDate, scanDate, crlMm });\n }, [method, refDate, crlMm, scanDate]);\n\n const result = useMemo<DueDateResult | null>(() => {\n if (!refDate) return null;\n // A confirmed redating moves the effective LMP to the ultrasound's; the\n // CRL already reflects true gestation, so cycle adjustment no longer applies.\n const effectiveDate =\n method === 'lmp' && redating?.redated\n ? redating.gestationalStart\n : refDate;\n const effectiveCycle =\n method === 'lmp' && redating?.redated\n ? DEFAULT_CYCLE_LENGTH\n : (cycleLength ?? DEFAULT_CYCLE_LENGTH);\n return computeDueDate(\n {\n method,\n date: effectiveDate,\n cycleLength: effectiveCycle,\n embryoAge,\n },\n asOfDate,\n );\n }, [method, refDate, cycleLength, embryoAge, redating, asOfDate]);\n\n const dateFormatter = useMemo(\n () => new Intl.DateTimeFormat(i18n.language, { dateStyle: 'long' }),\n [i18n.language],\n );\n\n useEffect(() => {\n onResultChange?.(result);\n }, [result, onResultChange]);\n\n /* ── Agent handle ────────────────────────────────────────────────── */\n const liveRef = useRef({\n method,\n refDate,\n cycleLength,\n embryoAge,\n crlMm,\n scanDate,\n asOfDate,\n result,\n });\n liveRef.current = {\n method,\n refDate,\n cycleLength,\n embryoAge,\n crlMm,\n scanDate,\n asOfDate,\n result,\n };\n\n const agentHandle = useMemo<DueDateCalculatorHandle>(\n () => ({\n getInputs: () => {\n const live = liveRef.current;\n return {\n method: live.method,\n referenceDate: live.refDate ? toIsoDate(live.refDate) : null,\n cycleLength: live.cycleLength,\n embryoAge: live.embryoAge,\n crlMm: live.crlMm,\n scanDate: live.scanDate ? toIsoDate(live.scanDate) : null,\n asOfDate: toIsoDate(live.asOfDate),\n };\n },\n getResult: () => {\n const r = liveRef.current.result;\n if (!r) return null;\n return {\n dueDate: toIsoDate(r.dueDate),\n gestationalStart: toIsoDate(r.gestationalStart),\n gestationalAge: r.gestationalAge ? { ...r.gestationalAge } : null,\n trimester: r.trimester,\n };\n },\n setMethod: (next) => {\n if (next !== 'lmp' && next !== 'conception' && next !== 'ivf') {\n return false;\n }\n setMethod(next);\n return true;\n },\n setReferenceDate: (isoDate) => {\n if (isoDate === null) {\n setRefDate(undefined);\n return true;\n }\n const parsed = fromIsoDate(isoDate);\n // The DatePicker caps at today; the handle honours the same bound.\n if (!parsed || isAfter(parsed, new Date())) return false;\n setRefDate(parsed);\n return true;\n },\n setCycleLength: (days) => {\n if (\n days !== null &&\n !(\n Number.isFinite(days) &&\n days >= CYCLE_LENGTH_RANGE.min &&\n days <= CYCLE_LENGTH_RANGE.max\n )\n ) {\n return false;\n }\n setCycleLength(days);\n return true;\n },\n setEmbryoAge: (days) => {\n if (days !== 3 && days !== 5) return false;\n setEmbryoAge(days);\n return true;\n },\n setCrl: (next) => {\n const now = new Date();\n let parsedScan: Date | undefined;\n // Validate the whole payload before writing any of it, so a bad\n // value can't leave the form half-updated.\n if ('crlMm' in next) {\n const mm = next.crlMm;\n if (\n mm !== null &&\n mm !== undefined &&\n !(Number.isFinite(mm) && mm > 0)\n ) {\n return false;\n }\n }\n if ('scanDate' in next && next.scanDate != null) {\n const d = fromIsoDate(next.scanDate);\n if (!d || isAfter(d, now)) return false;\n parsedScan = d;\n }\n if ('crlMm' in next) setCrlMm(next.crlMm ?? null);\n if ('scanDate' in next) setScanDate(parsedScan);\n return true;\n },\n setAsOfDate: (isoDate) => {\n const parsed = fromIsoDate(isoDate);\n if (!parsed) return false;\n setAsOfDate(parsed);\n return true;\n },\n }),\n [],\n );\n useAgentRegistration(dueDateCalculatorAgent, agentHandle, id);\n\n const schedule = useMemo(() => {\n if (!showSchedule || !result) return null;\n return computeAntenatalSchedule(result.gestationalStart, {\n ...scheduleOptions,\n today: asOfDate,\n });\n }, [showSchedule, result, asOfDate, scheduleOptions]);\n\n return (\n <div\n ref={ref}\n data-component=\"due-date-calculator\"\n data-component-id={id}\n className={rootVariants({ width, className })}\n >\n <RadioGroup\n label={t('dueDateCalculator.method.label')}\n variant=\"horizontal\"\n value={method}\n onValueChange={(next) => setMethod(next as DueDateMethod)}\n >\n <Radio label={t('dueDateCalculator.method.lmp')} value=\"lmp\" />\n <Radio\n label={t('dueDateCalculator.method.conception')}\n value=\"conception\"\n />\n <Radio label={t('dueDateCalculator.method.ivf')} value=\"ivf\" />\n </RadioGroup>\n\n <div className=\"ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2\">\n <FormField label={t(DATE_LABEL_KEY[method])}>\n <DatePicker value={refDate} onChange={setRefDate} maxDate={today} />\n </FormField>\n\n {method === 'lmp' && (\n <FormField\n label={t('dueDateCalculator.cycleLength')}\n description={t('dueDateCalculator.cycleLengthHint')}\n >\n <NumberInput\n mode=\"integer\"\n min={CYCLE_LENGTH_RANGE.min}\n max={CYCLE_LENGTH_RANGE.max}\n value={cycleLength}\n onChange={setCycleLength}\n />\n </FormField>\n )}\n\n {method === 'ivf' && (\n <RadioGroup\n label={t('dueDateCalculator.embryoAge')}\n variant=\"horizontal\"\n value={String(embryoAge)}\n onValueChange={(next) => setEmbryoAge(Number(next) as EmbryoAge)}\n >\n <Radio label={t('dueDateCalculator.day3')} value=\"3\" />\n <Radio label={t('dueDateCalculator.day5')} value=\"5\" />\n </RadioGroup>\n )}\n </div>\n\n <FormField\n label={t('dueDateCalculator.asOfDate')}\n description={t('dueDateCalculator.asOfDateHint')}\n >\n <DatePicker value={asOfDate} onChange={(d) => d && setAsOfDate(d)} />\n </FormField>\n\n {method === 'lmp' ? (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\">\n <div className=\"ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2\">\n <FormField\n label={t('dueDateCalculator.crl')}\n description={t('dueDateCalculator.crlHint')}\n >\n <NumberInput\n mode=\"decimal\"\n min={0}\n step={0.1}\n value={crlMm}\n onChange={setCrlMm}\n />\n </FormField>\n <FormField label={t('dueDateCalculator.scanDate')}>\n <DatePicker\n value={scanDate}\n onChange={setScanDate}\n maxDate={today}\n />\n </FormField>\n </div>\n {redating ? (\n <div className=\"ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]\">\n <Badge variant={redating.redated ? 'warning' : 'success'}>\n {redating.redated\n ? t('dueDateCalculator.redated', {\n days: redating.discrepancyDays,\n })\n : t('dueDateCalculator.datesAgree')}\n </Badge>\n {!redating.crlInRange ? (\n <span className=\"type-meta ds:text-muted-foreground\">\n {t('dueDateCalculator.crlOutOfRange')}\n </span>\n ) : null}\n </div>\n ) : null}\n </div>\n ) : null}\n\n {/* Concise polite announcement when a due date resolves. */}\n <p className=\"ds:sr-only\" role=\"status\" aria-live=\"polite\">\n {result\n ? `${t('dueDateCalculator.result.dueDateLabel')}: ${dateFormatter.format(\n result.dueDate,\n )}. ${t('dueDateCalculator.result.trimesterLabel')}: ${t(\n `dueDateCalculator.trimester.${result.trimester}`,\n )}.`\n : ''}\n </p>\n\n {result ? (\n <Card variant=\"elevated\">\n <Card.Body className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n <dl className=\"ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-3\">\n <div className=\"ds:flex ds:flex-col ds:items-start ds:gap-[var(--spacing-xs)]\">\n <dt className=\"type-label ds:text-muted-foreground\">\n {t('dueDateCalculator.result.trimesterLabel')}\n </dt>\n <dd>\n <Badge\n variant={TRIMESTER_BADGE_VARIANT[result.trimester]}\n size=\"lg\"\n >\n {t(`dueDateCalculator.trimester.${result.trimester}`)}\n </Badge>\n </dd>\n </div>\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <dt className=\"type-label ds:text-muted-foreground\">\n {t('dueDateCalculator.result.gestationLabel')}\n </dt>\n <dd className=\"type-body ds:text-foreground\">\n {result.gestationalAge\n ? t('dueDateCalculator.result.gestation', {\n weeks: result.gestationalAge.weeks,\n days: result.gestationalAge.days,\n })\n : '—'}\n </dd>\n </div>\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <dt className=\"type-label ds:text-muted-foreground\">\n {t('dueDateCalculator.result.dueDateLabel')}\n </dt>\n <dd className=\"type-metric ds:text-foreground\">\n {dateFormatter.format(result.dueDate)}\n </dd>\n </div>\n </dl>\n </Card.Body>\n </Card>\n ) : (\n <p className=\"type-body ds:text-muted-foreground\">\n {t('dueDateCalculator.empty')}\n </p>\n )}\n\n {schedule ? <AntenatalScheduleTimeline events={schedule} /> : null}\n\n {/* One result-action group for the whole result — sits after both the\n due-date card and the schedule, and its payload carries the schedule\n rows when shown (no per-card buttons). */}\n {result && (insertVariant === 'copy' || onInsert) ? (\n <InsertButton\n variant={insertVariant}\n onInsert={onInsert}\n onCopy={onCopy}\n onError={onError}\n card={{\n title: t('insert.title.dueDate'),\n icon: 'calendar-heart',\n highlight: dateFormatter.format(result.dueDate),\n // Chip tinted with the trimester's semantic token so the inserted\n // PNG carries the same clinical-stage colour as the on-screen\n // trimester badge — with the contrast-safe orange override for the\n // `--warning` third trimester.\n highlightToken: trimesterHighlightToken(result.trimester),\n brand: insertBrand,\n fields: [\n {\n // The estimated date of delivery → calendar glyph.\n icon: 'calendar',\n label: t('dueDateCalculator.result.dueDateLabel'),\n value: dateFormatter.format(result.dueDate),\n },\n {\n // Gestational age is an elapsed duration → clock glyph.\n icon: 'clock',\n label: t('dueDateCalculator.result.gestationLabel'),\n value: result.gestationalAge\n ? t('dueDateCalculator.result.gestation', {\n weeks: result.gestationalAge.weeks,\n days: result.gestationalAge.days,\n })\n : '—',\n },\n {\n // Trimester is a clinical-stage classification → tag.\n icon: 'tag',\n label: t('dueDateCalculator.result.trimesterLabel'),\n value: t(`dueDateCalculator.trimester.${result.trimester}`),\n },\n // When the schedule is shown, the single Insert button carries\n // the exam windows too (no second button).\n ...(schedule\n ? buildScheduleInsertFields(schedule, t, (d) =>\n dateFormatter.format(d),\n )\n : []),\n ],\n }}\n />\n ) : null}\n </div>\n );\n },\n);\n\nDueDateCalculator.displayName = 'DueDateCalculator';\n"],"names":["DEPRECATED","isoDate","dueDateCalculatorAgent","handle","args","rootVariants","cva","DATE_LABEL_KEY","toIsoDate","d","format","fromIsoDate","iso","parseISO","CYCLE_LENGTH_RANGE","DueDateCalculator","forwardRef","defaultMethod","onResultChange","onInsert","insertVariant","onCopy","onError","insertBrand","showSchedule","scheduleOptions","id","width","className","ref","i18n","useTranslation","method","setMethod","useState","refDate","setRefDate","cycleLength","setCycleLength","DEFAULT_CYCLE_LENGTH","embryoAge","setEmbryoAge","crlMm","setCrlMm","scanDate","setScanDate","today","useMemo","asOfDate","setAsOfDate","redating","redateByCrl","result","effectiveDate","effectiveCycle","computeDueDate","dateFormatter","useEffect","liveRef","useRef","agentHandle","live","r","next","parsed","isAfter","days","now","parsedScan","mm","useAgentRegistration","schedule","computeAntenatalSchedule","jsxs","RadioGroup","jsx","Radio","FormField","DatePicker","NumberInput","Badge","Card","TRIMESTER_BADGE_VARIANT","AntenatalScheduleTimeline","InsertButton","trimesterHighlightToken","buildScheduleInsertFields"],"mappings":";;;;;;;;;;;;;;;;;AAyBA,MAAMA,IAAa,iDAGbC,IAAU;AAAA,EACd,MAAM;AAAA,EACN,SAAS;AACX,GAEaC,KAAgE;AAAA,EAC3E,IAAI;AAAA;AAAA,EAEJ,cAAc,CAAC,WAAW;AAAA,EAC1B,OAAO;AAAA,IACL,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,UAAA;AAAA,IAAU;AAAA,IAErC,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACA,MAAWA,EAAO,UAAA;AAAA,IAAU;AAAA,EACrC;AAAA,EAEF,SAAS;AAAA,IACP,YAAY;AAAA;AAAA;AAAA,MAGV,QAAQ;AAAA,MACR,UAAU;AAA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AAAA,kBAE5C;AAAA;AAAA,oBAEE,MAAM;AAAA,oBACN,OAAO,EAAE,yCAAyC;AAAA,oBAClD,OAAOA,EAAO,iBACV,EAAE,sCAAsC;AAAA,sBACtC,OAAOA,EAAO,eAAe;AAAA,sBAC7B,MAAMA,EAAO,eAAe;AAAA,oBAAA,CAC7B,IACD;AAAA,kBAAA;AAAA,kBAEN;AAAA;AAAA,oBAEE,MAAM;AAAA,oBACN,OAAO,EAAE,yCAAyC;AAAA,oBAClD,OAAO,EAAE,+BAA+BA,EAAO,SAAS,EAAE;AAAA,kBAAA;AAAA;AAAA;AAAA,kBAI5D,GAAImB,IACAe;AAAA,oBAA0Bf;AAAA,oBAAU;AAAA,oBAAG,CAAC9D,MACtC+C,EAAc,OAAO/C,CAAC;AAAA,kBAAA,IAExB,CAAA;AAAA,gBAAC;AAAA,cACP;AAAA,YACF;AAAA,UAAA,IAEA;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AAEAM,GAAkB,cAAc;"}
|
|
@@ -2,7 +2,7 @@ import { jsxs as W, jsx as C } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef as se, useRef as K, useId as oe, useState as X, useMemo as Q, useEffect as fe, useCallback as Z } from "react";
|
|
3
3
|
import { useTranslation as ce } from "react-i18next";
|
|
4
4
|
import { g as de } from "./_commonjsHelpers-DaMA6jEr.js";
|
|
5
|
-
import { T as me } from "./text-input-
|
|
5
|
+
import { T as me } from "./text-input-rzLEKhRU.js";
|
|
6
6
|
import { u as pe } from "./form-field-context-DtiROUJV.js";
|
|
7
7
|
import { c as ve } from "./compose-refs-C0k0tdqF.js";
|
|
8
8
|
import { u as _e } from "./registry-DvAUVLHh.js";
|
|
@@ -396,4 +396,4 @@ export {
|
|
|
396
396
|
Ee as e,
|
|
397
397
|
ne as i
|
|
398
398
|
};
|
|
399
|
-
//# sourceMappingURL=email-input-
|
|
399
|
+
//# sourceMappingURL=email-input-DQixfopu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email-input-Cmeo4zdT.js","sources":["../../node_modules/validator/lib/util/assertString.js","../../node_modules/validator/lib/util/checkHost.js","../../node_modules/validator/lib/isByteLength.js","../../node_modules/validator/lib/util/merge.js","../../node_modules/validator/lib/isFQDN.js","../../node_modules/validator/lib/isIP.js","../../node_modules/validator/lib/isEmail.js","../../src/components/email-input/email-input.agent.ts","../../src/components/email-input/email-input.tsx"],"sourcesContent":["\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = assertString;\nfunction assertString(input) {\n if (input === undefined || input === null) throw new TypeError(\"Expected a string but received a \".concat(input));\n if (input.constructor.name !== 'String') throw new TypeError(\"Expected a string but received a \".concat(input.constructor.name));\n}\nmodule.exports = exports.default;\nmodule.exports.default = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = checkHost;\nfunction isRegExp(obj) {\n return Object.prototype.toString.call(obj) === '[object RegExp]';\n}\nfunction checkHost(host, matches) {\n for (var i = 0; i < matches.length; i++) {\n var match = matches[i];\n if (host === match || isRegExp(match) && match.test(host)) {\n return true;\n }\n }\n return false;\n}\nmodule.exports = exports.default;\nmodule.exports.default = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = isByteLength;\nvar _assertString = _interopRequireDefault(require(\"./util/assertString\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\n/* eslint-disable prefer-rest-params */\nfunction isByteLength(str, options) {\n (0, _assertString.default)(str);\n var min;\n var max;\n if (_typeof(options) === 'object') {\n min = options.min || 0;\n max = options.max;\n } else {\n // backwards compatibility: isByteLength(str, min [, max])\n min = arguments[1];\n max = arguments[2];\n }\n var len = encodeURI(str).split(/%..|./).length - 1;\n return len >= min && (typeof max === 'undefined' || len <= max);\n}\nmodule.exports = exports.default;\nmodule.exports.default = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = merge;\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction merge() {\n var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var defaults = arguments.length > 1 ? arguments[1] : undefined;\n if (_typeof(obj) !== 'object' || obj === null) {\n obj = {};\n }\n for (var key in defaults) {\n if (typeof obj[key] === 'undefined') {\n obj[key] = defaults[key];\n }\n }\n return obj;\n}\nmodule.exports = exports.default;\nmodule.exports.default = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = isFQDN;\nvar _assertString = _interopRequireDefault(require(\"./util/assertString\"));\nvar _merge = _interopRequireDefault(require(\"./util/merge\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nvar default_fqdn_options = {\n require_tld: true,\n allow_underscores: false,\n allow_trailing_dot: false,\n allow_numeric_tld: false,\n allow_wildcard: false,\n ignore_max_length: false\n};\nfunction isFQDN(str, options) {\n (0, _assertString.default)(str);\n options = (0, _merge.default)(options, default_fqdn_options);\n\n /* Remove the optional trailing dot before checking validity */\n if (options.allow_trailing_dot && str[str.length - 1] === '.') {\n str = str.substring(0, str.length - 1);\n }\n\n /* Remove the optional wildcard before checking validity */\n if (options.allow_wildcard === true && str.indexOf('*.') === 0) {\n str = str.substring(2);\n }\n var parts = str.split('.');\n var tld = parts[parts.length - 1];\n if (options.require_tld) {\n // disallow fqdns without tld\n if (parts.length < 2) {\n return false;\n }\n if (!options.allow_numeric_tld && !/^([a-z\\u00A1-\\u00A8\\u00AA-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(tld)) {\n return false;\n }\n\n // disallow spaces\n if (/\\s/.test(tld)) {\n return false;\n }\n }\n\n // reject numeric TLDs\n if (!options.allow_numeric_tld && /^\\d+$/.test(tld)) {\n return false;\n }\n return parts.every(function (part) {\n if (part.length > 63 && !options.ignore_max_length) {\n return false;\n }\n if (!/^[a-z_\\u00a1-\\uffff0-9-]+$/i.test(part)) {\n return false;\n }\n\n // disallow full-width chars\n if (/[\\uff01-\\uff5e]/.test(part)) {\n return false;\n }\n\n // disallow parts starting or ending with hyphen\n if (/^-|-$/.test(part)) {\n return false;\n }\n if (!options.allow_underscores && /_/.test(part)) {\n return false;\n }\n return true;\n });\n}\nmodule.exports = exports.default;\nmodule.exports.default = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = isIP;\nvar _assertString = _interopRequireDefault(require(\"./util/assertString\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\n/**\n11.3. Examples\n\n The following addresses\n\n fe80::1234 (on the 1st link of the node)\n ff02::5678 (on the 5th link of the node)\n ff08::9abc (on the 10th organization of the node)\n\n would be represented as follows:\n\n fe80::1234%1\n ff02::5678%5\n ff08::9abc%10\n\n (Here we assume a natural translation from a zone index to the\n <zone_id> part, where the Nth zone of any scope is translated into\n \"N\".)\n\n If we use interface names as <zone_id>, those addresses could also be\n represented as follows:\n\n fe80::1234%ne0\n ff02::5678%pvc1.3\n ff08::9abc%interface10\n\n where the interface \"ne0\" belongs to the 1st link, \"pvc1.3\" belongs\n to the 5th link, and \"interface10\" belongs to the 10th organization.\n * * */\nvar IPv4SegmentFormat = '(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])';\nvar IPv4AddressFormat = \"(\".concat(IPv4SegmentFormat, \"[.]){3}\").concat(IPv4SegmentFormat);\nvar IPv4AddressRegExp = new RegExp(\"^\".concat(IPv4AddressFormat, \"$\"));\nvar IPv6SegmentFormat = '(?:[0-9a-fA-F]{1,4})';\nvar IPv6AddressRegExp = new RegExp('^(' + \"(?:\".concat(IPv6SegmentFormat, \":){7}(?:\").concat(IPv6SegmentFormat, \"|:)|\") + \"(?:\".concat(IPv6SegmentFormat, \":){6}(?:\").concat(IPv4AddressFormat, \"|:\").concat(IPv6SegmentFormat, \"|:)|\") + \"(?:\".concat(IPv6SegmentFormat, \":){5}(?::\").concat(IPv4AddressFormat, \"|(:\").concat(IPv6SegmentFormat, \"){1,2}|:)|\") + \"(?:\".concat(IPv6SegmentFormat, \":){4}(?:(:\").concat(IPv6SegmentFormat, \"){0,1}:\").concat(IPv4AddressFormat, \"|(:\").concat(IPv6SegmentFormat, \"){1,3}|:)|\") + \"(?:\".concat(IPv6SegmentFormat, \":){3}(?:(:\").concat(IPv6SegmentFormat, \"){0,2}:\").concat(IPv4AddressFormat, \"|(:\").concat(IPv6SegmentFormat, \"){1,4}|:)|\") + \"(?:\".concat(IPv6SegmentFormat, \":){2}(?:(:\").concat(IPv6SegmentFormat, \"){0,3}:\").concat(IPv4AddressFormat, \"|(:\").concat(IPv6SegmentFormat, \"){1,5}|:)|\") + \"(?:\".concat(IPv6SegmentFormat, \":){1}(?:(:\").concat(IPv6SegmentFormat, \"){0,4}:\").concat(IPv4AddressFormat, \"|(:\").concat(IPv6SegmentFormat, \"){1,6}|:)|\") + \"(?::((?::\".concat(IPv6SegmentFormat, \"){0,5}:\").concat(IPv4AddressFormat, \"|(?::\").concat(IPv6SegmentFormat, \"){1,7}|:))\") + ')(%[0-9a-zA-Z.]{1,})?$');\nfunction isIP(ipAddress) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n (0, _assertString.default)(ipAddress);\n\n // accessing 'arguments' for backwards compatibility: isIP(ipAddress [, version])\n // eslint-disable-next-line prefer-rest-params\n var version = (_typeof(options) === 'object' ? options.version : arguments[1]) || '';\n if (!version) {\n return isIP(ipAddress, {\n version: 4\n }) || isIP(ipAddress, {\n version: 6\n });\n }\n if (version.toString() === '4') {\n return IPv4AddressRegExp.test(ipAddress);\n }\n if (version.toString() === '6') {\n return IPv6AddressRegExp.test(ipAddress);\n }\n return false;\n}\nmodule.exports = exports.default;\nmodule.exports.default = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = isEmail;\nvar _assertString = _interopRequireDefault(require(\"./util/assertString\"));\nvar _checkHost = _interopRequireDefault(require(\"./util/checkHost\"));\nvar _isByteLength = _interopRequireDefault(require(\"./isByteLength\"));\nvar _isFQDN = _interopRequireDefault(require(\"./isFQDN\"));\nvar _isIP = _interopRequireDefault(require(\"./isIP\"));\nvar _merge = _interopRequireDefault(require(\"./util/merge\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nvar default_email_options = {\n allow_display_name: false,\n allow_underscores: false,\n require_display_name: false,\n allow_utf8_local_part: true,\n require_tld: true,\n blacklisted_chars: '',\n ignore_max_length: false,\n host_blacklist: [],\n host_whitelist: []\n};\n\n/* eslint-disable max-len */\n/* eslint-disable no-control-regex */\nvar splitNameAddress = /^([^\\x00-\\x1F\\x7F-\\x9F\\cX]+)</i;\nvar emailUserPart = /^[a-z\\d!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]+$/i;\nvar gmailUserPart = /^[a-z\\d]+$/;\nvar quotedEmailUser = /^([\\s\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f\\x21\\x23-\\x5b\\x5d-\\x7e]|(\\\\[\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]))*$/i;\nvar emailUserUtf8Part = /^[a-z\\d!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~\\u00A1-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]+$/i;\nvar quotedEmailUserUtf8 = /^([\\s\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f\\x21\\x23-\\x5b\\x5d-\\x7e\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]|(\\\\[\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))*$/i;\nvar defaultMaxEmailLength = 254;\n/* eslint-enable max-len */\n/* eslint-enable no-control-regex */\n\n/**\n * Validate display name according to the RFC2822: https://tools.ietf.org/html/rfc2822#appendix-A.1.2\n * @param {String} display_name\n */\nfunction validateDisplayName(display_name) {\n var display_name_without_quotes = display_name.replace(/^\"(.+)\"$/, '$1');\n // display name with only spaces is not valid\n if (!display_name_without_quotes.trim()) {\n return false;\n }\n\n // check whether display name contains illegal character\n var contains_illegal = /[\\.\";<>]/.test(display_name_without_quotes);\n if (contains_illegal) {\n // if contains illegal characters,\n // must to be enclosed in double-quotes, otherwise it's not a valid display name\n if (display_name_without_quotes === display_name) {\n return false;\n }\n\n // the quotes in display name must start with character symbol \\\n var all_start_with_back_slash = display_name_without_quotes.split('\"').length === display_name_without_quotes.split('\\\\\"').length;\n if (!all_start_with_back_slash) {\n return false;\n }\n }\n return true;\n}\nfunction isEmail(str, options) {\n (0, _assertString.default)(str);\n options = (0, _merge.default)(options, default_email_options);\n if (options.require_display_name || options.allow_display_name) {\n var display_email = str.match(splitNameAddress);\n if (display_email) {\n var display_name = display_email[1];\n\n // Remove display name and angle brackets to get email address\n // Can be done in the regex but will introduce a ReDOS (See #1597 for more info)\n str = str.replace(display_name, '').replace(/(^<|>$)/g, '');\n\n // sometimes need to trim the last space to get the display name\n // because there may be a space between display name and email address\n // eg. myname <address@gmail.com>\n // the display name is `myname` instead of `myname `, so need to trim the last space\n if (display_name.endsWith(' ')) {\n display_name = display_name.slice(0, -1);\n }\n if (!validateDisplayName(display_name)) {\n return false;\n }\n } else if (options.require_display_name) {\n return false;\n }\n }\n if (!options.ignore_max_length && str.length > defaultMaxEmailLength) {\n return false;\n }\n var parts = str.split('@');\n var domain = parts.pop();\n var lower_domain = domain.toLowerCase();\n if (options.host_blacklist.length > 0 && (0, _checkHost.default)(lower_domain, options.host_blacklist)) {\n return false;\n }\n if (options.host_whitelist.length > 0 && !(0, _checkHost.default)(lower_domain, options.host_whitelist)) {\n return false;\n }\n var user = parts.join('@');\n if (options.domain_specific_validation && (lower_domain === 'gmail.com' || lower_domain === 'googlemail.com')) {\n /*\n Previously we removed dots for gmail addresses before validating.\n This was removed because it allows `multiple..dots@gmail.com`\n to be reported as valid, but it is not.\n Gmail only normalizes single dots, removing them from here is pointless,\n should be done in normalizeEmail\n */\n user = user.toLowerCase();\n\n // Removing sub-address from username before gmail validation\n var username = user.split('+')[0];\n\n // Dots are not included in gmail length restriction\n if (!(0, _isByteLength.default)(username.replace(/\\./g, ''), {\n min: 6,\n max: 30\n })) {\n return false;\n }\n var _user_parts = username.split('.');\n for (var i = 0; i < _user_parts.length; i++) {\n if (!gmailUserPart.test(_user_parts[i])) {\n return false;\n }\n }\n }\n if (options.ignore_max_length === false && (!(0, _isByteLength.default)(user, {\n max: 64\n }) || !(0, _isByteLength.default)(domain, {\n max: 254\n }))) {\n return false;\n }\n if (!(0, _isFQDN.default)(domain, {\n require_tld: options.require_tld,\n ignore_max_length: options.ignore_max_length,\n allow_underscores: options.allow_underscores\n })) {\n if (!options.allow_ip_domain) {\n return false;\n }\n if (!(0, _isIP.default)(domain)) {\n if (!domain.startsWith('[') || !domain.endsWith(']')) {\n return false;\n }\n var noBracketdomain = domain.slice(1, -1);\n if (noBracketdomain.length === 0 || !(0, _isIP.default)(noBracketdomain)) {\n return false;\n }\n }\n }\n if (options.blacklisted_chars) {\n if (user.search(new RegExp(\"[\".concat(options.blacklisted_chars, \"]+\"), 'g')) !== -1) return false;\n }\n if (user[0] === '\"' && user[user.length - 1] === '\"') {\n user = user.slice(1, user.length - 1);\n return options.allow_utf8_local_part ? quotedEmailUserUtf8.test(user) : quotedEmailUser.test(user);\n }\n var pattern = options.allow_utf8_local_part ? emailUserUtf8Part : emailUserPart;\n var user_parts = user.split('.');\n for (var _i = 0; _i < user_parts.length; _i++) {\n if (!pattern.test(user_parts[_i])) {\n return false;\n }\n }\n return true;\n}\nmodule.exports = exports.default;\nmodule.exports.default = exports.default;","/* -------------------------------------------------------------------- */\n/* Agent adapter — EmailInput. */\n/* */\n/* Presentational specialisation of TextInput — no actions of its own. */\n/* The handle re-exposes the underlying input's value-setter so agents */\n/* can drive the field through the normal TextInput contract without */\n/* needing to know it's wrapped. See `src/docs/26-agent-readiness.mdx` */\n/* for the contract. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\n\n/**\n * Curated agent handle for EmailInput. State stays scoped to the visible\n * value + the kit-derived validity flag; never PHI (per PRS §Security).\n */\nexport interface EmailInputHandle {\n /** Returns the current input value. */\n getValue: () => string;\n /** Returns whether the current value parses as a valid email (non-empty + RFC). */\n isValid: () => boolean;\n}\n\nexport const emailInputAgent: AgentAdapter<EmailInputHandle> = {\n id: 'email-input',\n capabilities: [],\n state: {\n value: {\n type: 'string',\n descriptionKey: 'ui.agent.emailInput.state.value',\n description: 'The current email address typed into the field.',\n read: (handle) => handle.getValue(),\n },\n isValid: {\n type: 'boolean',\n descriptionKey: 'ui.agent.emailInput.state.isValid',\n description:\n 'True when the value is non-empty AND parses as a valid email per RFC 5322.',\n read: (handle) => handle.isValid(),\n },\n },\n actions: {},\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'email-input',\n description:\n 'Marks the EmailInput wrapper. The inline error element carries `role=\"alert\"` when validation fails.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop, when provided.',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n type ChangeEvent,\n type FocusEvent,\n type ReactNode,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { CircleAlert } from 'lucide-react';\n// Tree-shaken import — pulling `validator/lib/isEmail` instead of the\n// barrel keeps the bundle to ~3 KB. `import { isEmail } from 'validator'`\n// drags in ~50 KB of unused validators.\nimport isEmail from 'validator/lib/isEmail';\nimport { TextInput, type TextInputProps } from '../text-input';\nimport { useFormField } from '../form-field/form-field-context';\nimport { composeRefs } from '../_shared/compose-refs';\nimport { useAgentRegistration } from '../../agent';\nimport { emailInputAgent, type EmailInputHandle } from './email-input.agent';\n\n/* ------------------------------------------------------------------ */\n/* Public API */\n/* */\n/* `type`, `inputMode`, and `tone` are baked in — the component decides */\n/* those itself. `autoComplete` is `email` unless a sign-in form asks */\n/* for `username`. `tone` is computed from the */\n/* validation state so consumers can never wedge it into an inconsistent*/\n/* visual signal. */\n/* ------------------------------------------------------------------ */\n\nexport interface EmailInputProps extends Omit<\n TextInputProps,\n 'type' | 'autoComplete' | 'inputMode' | 'tone'\n> {\n /**\n * Override the \"Invalid email\" error message. When omitted, the\n * translated default `t('inputs.email.invalid')` is used.\n *\n * Pass `null` when the host shows the message itself (a `FormField`\n * `error`, or its own element). The input then never marks itself\n * invalid: it turns red only when the host says so, through the\n * FormField's `error` or `aria-invalid`. `onValidityChange` still fires.\n */\n errorMessage?: ReactNode | null;\n /**\n * Called whenever the validation state flips. `valid` is `true` when\n * the value is non-empty AND parses as a valid email, `false`\n * otherwise. The callback fires on every blur AND on every change\n * after the first blur — never before the user has had a chance to\n * type something.\n */\n onValidityChange?: (valid: boolean) => void;\n /**\n * Skip the built-in validation entirely. The input behaves like a\n * plain `<TextInput type=\"email\">` — useful when the consumer is\n * wiring `FormField`'s `invalid` prop themselves, or running their\n * own schema validation (zod, react-hook-form). Default: `false`.\n */\n disableBuiltInValidation?: boolean;\n /**\n * Autocomplete hint. Default `email`. Use `username` on a sign-in form,\n * where the email is what the account is known by: browsers and\n * password managers pair `username` with `current-password`.\n */\n autoComplete?: 'email' | 'username';\n}\n\n/* ------------------------------------------------------------------ */\n/* Validation engine */\n/* */\n/* Pure helper — empty values are NOT flagged (let `required` handle */\n/* empty separately). Whitespace-only values fall through to validator */\n/* which rejects them as malformed. */\n/* ------------------------------------------------------------------ */\n\nfunction checkValidity(value: string): boolean {\n if (value.length === 0) return true;\n return isEmail(value);\n}\n\nexport const EmailInput = forwardRef<HTMLInputElement, EmailInputProps>(\n (\n {\n errorMessage,\n onValidityChange,\n disableBuiltInValidation = false,\n autoComplete = 'email',\n value,\n defaultValue,\n onChange,\n onBlur,\n id,\n 'aria-describedby': consumerDescribedBy,\n 'aria-invalid': consumerAriaInvalid,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation('ui');\n const ctx = useFormField();\n\n const innerRef = useRef<HTMLInputElement | null>(null);\n const composedRef = composeRefs(ref, innerRef);\n\n // An id of its own: the FormField's error element owns `ctx.errorId`.\n const errorElementId = useId();\n\n const isControlled = value !== undefined;\n\n // Seed once from controlled `value` or `defaultValue` so we can\n // validate an already-populated field at mount (e.g. server-side\n // rehydration). Recomputing on prop changes would defeat the React\n // \"defaultValue is initial only\" contract — we read it once via the\n // lazy initialiser and let `currentValue` track every change after.\n const [internalValue, setInternalValue] = useState<string>(() => {\n if (typeof value === 'string') return value;\n if (typeof defaultValue === 'string') return defaultValue;\n return '';\n });\n const currentValue = isControlled ? String(value) : internalValue;\n\n // `touched` flips to `true` on first blur, or immediately if the\n // field is seeded with a non-empty value (consumer is asking us to\n // validate something they already collected).\n const [touched, setTouched] = useState<boolean>(\n () => currentValue.length > 0,\n );\n\n const computedValid = useMemo(\n () => checkValidity(currentValue),\n [currentValue],\n );\n\n // The format fails only when the field has been touched AND the\n // value is non-empty AND the value fails RFC. Empty is always\n // \"not yet invalid\" — `required` covers the empty case separately.\n const formatInvalid =\n !disableBuiltInValidation &&\n touched &&\n currentValue.length > 0 &&\n !computedValid;\n\n // Notify consumers on every validity flip after the first blur.\n // Empty before first blur is reported as `true` so consumers don't\n // light up a \"valid\" indicator prematurely — we only fire after\n // touched so the first emission reflects user intent.\n const lastValidRef = useRef<boolean | null>(null);\n useEffect(() => {\n if (!touched) return;\n // Empty value after touch -> `valid` is `false` because the user\n // emptied a field they were editing. This mirrors the spec note\n // that empty is reported as `false` in `onValidityChange`.\n const nextValid = currentValue.length > 0 && computedValid;\n if (lastValidRef.current !== nextValid) {\n lastValidRef.current = nextValid;\n onValidityChange?.(nextValid);\n }\n }, [touched, currentValue, computedValid, onValidityChange]);\n\n const handleChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n if (!isControlled) {\n setInternalValue(event.target.value);\n }\n onChange?.(event);\n },\n [isControlled, onChange],\n );\n\n const handleBlur = useCallback(\n (event: FocusEvent<HTMLInputElement>) => {\n setTouched(true);\n onBlur?.(event);\n },\n [onBlur],\n );\n\n /* ------------------------------------------------------------------ */\n /* Agent adapter */\n /* ------------------------------------------------------------------ */\n\n // Stable handle — both `getValue` and `isValid` read the live DOM\n // node, so the closure captures no React state. Empty dep array\n // keeps the agent registry from churning on every keystroke.\n const agentHandle = useMemo<EmailInputHandle>(\n () => ({\n getValue: () => innerRef.current?.value ?? '',\n isValid: () => {\n const v = innerRef.current?.value ?? '';\n return v.length > 0 && isEmail(v);\n },\n }),\n [],\n );\n useAgentRegistration(emailInputAgent, agentHandle, id);\n\n /* ------------------------------------------------------------------ */\n /* One message at a time */\n /* */\n /* A FormField `error` wins: its element is already in the context's */\n /* `describedBy`, so the inline message is not rendered beside it. With */\n /* `errorMessage={null}` the host owns the message, so the input never */\n /* looks invalid on its own account, with nothing to say why. */\n /* ------------------------------------------------------------------ */\n\n const showInlineError =\n formatInvalid && errorMessage !== null && !ctx.invalid;\n const contextDescribedBy = ctx.describedBy || undefined;\n const describedBy = useMemo(() => {\n const parts = [\n consumerDescribedBy,\n contextDescribedBy,\n showInlineError ? errorElementId : null,\n ].filter(Boolean) as string[];\n return parts.length > 0 ? parts.join(' ') : undefined;\n }, [\n consumerDescribedBy,\n contextDescribedBy,\n showInlineError,\n errorElementId,\n ]);\n\n // A wrapping consumer may assert invalidity for a BUSINESS reason while the\n // format is fine (e.g. \"already in use\") — honour it on the a11y attribute\n // so it's announced. Visual `tone` stays format-only, except when the\n // host owns the message: then its `aria-invalid` is the only signal.\n const consumerInvalid =\n consumerAriaInvalid === true || consumerAriaInvalid === 'true';\n const hostOwnsMessage = errorMessage === null;\n // The TextInput adds the FormField's own invalid tone.\n const effectiveTone =\n showInlineError || (hostOwnsMessage && consumerInvalid)\n ? 'error'\n : 'default';\n const effectiveAriaInvalid =\n showInlineError || ctx.invalid || consumerInvalid || undefined;\n\n const resolvedErrorMessage =\n errorMessage !== undefined\n ? errorMessage\n : t('inputs.email.invalid', 'Invalid email');\n\n return (\n <div\n data-component=\"email-input\"\n data-component-id={id}\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\"\n >\n <TextInput\n {...rest}\n ref={composedRef}\n id={id}\n type=\"email\"\n inputMode=\"email\"\n autoComplete={autoComplete}\n tone={effectiveTone}\n value={isControlled ? currentValue : undefined}\n defaultValue={!isControlled ? defaultValue : undefined}\n onChange={handleChange}\n onBlur={handleBlur}\n aria-invalid={effectiveAriaInvalid}\n aria-describedby={describedBy}\n />\n {showInlineError ? (\n <p\n id={errorElementId}\n role=\"alert\"\n data-slot=\"email-input-error\"\n className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)] type-body-sm ds:text-destructive\"\n >\n <CircleAlert aria-hidden=\"true\" className=\"ds:size-4 ds:shrink-0\" />\n <span>{resolvedErrorMessage}</span>\n </p>\n ) : null}\n </div>\n );\n },\n);\n\nEmailInput.displayName = 'EmailInput';\n"],"names":["exports","assertString","input","module","checkHost","isRegExp","obj","host","matches","i","match","isByteLength","_assertString","_interopRequireDefault","e","_typeof","o","str","options","min","max","len","merge","defaults","key","isFQDN","_merge","default_fqdn_options","parts","tld","part","isIP","IPv4SegmentFormat","IPv4AddressFormat","IPv4AddressRegExp","IPv6SegmentFormat","IPv6AddressRegExp","ipAddress","version","isEmail","_checkHost","_isByteLength","_isFQDN","_isIP","default_email_options","splitNameAddress","emailUserPart","gmailUserPart","quotedEmailUser","emailUserUtf8Part","quotedEmailUserUtf8","defaultMaxEmailLength","validateDisplayName","display_name","display_name_without_quotes","contains_illegal","all_start_with_back_slash","display_email","domain","lower_domain","user","username","_user_parts","noBracketdomain","pattern","user_parts","_i","emailInputAgent","handle","checkValidity","value","EmailInput","forwardRef","errorMessage","onValidityChange","disableBuiltInValidation","autoComplete","defaultValue","onChange","onBlur","id","consumerDescribedBy","consumerAriaInvalid","rest","ref","t","useTranslation","ctx","useFormField","innerRef","useRef","composedRef","composeRefs","errorElementId","useId","isControlled","internalValue","setInternalValue","useState","currentValue","touched","setTouched","computedValid","useMemo","formatInvalid","lastValidRef","useEffect","nextValid","handleChange","useCallback","event","handleBlur","agentHandle","_a","v","useAgentRegistration","showInlineError","contextDescribedBy","describedBy","consumerInvalid","effectiveTone","effectiveAriaInvalid","resolvedErrorMessage","jsxs","jsx","TextInput","CircleAlert"],"mappings":";;;;;;;;;;;;AAEA,WAAO,eAAcA,GAAU,cAAc;AAAA,MAC3C,OAAO;AAAA,IACT,CAAC,GACDA,EAAA,UAAkBC;AAClB,aAASA,EAAaC,GAAO;AAC3B,UAA2BA,KAAU,KAAM,OAAM,IAAI,UAAU,oCAAoC,OAAOA,CAAK,CAAC;AAChH,UAAIA,EAAM,YAAY,SAAS,SAAU,OAAM,IAAI,UAAU,oCAAoC,OAAOA,EAAM,YAAY,IAAI,CAAC;AAAA,IACjI;AACA,IAAAC,EAAA,UAAiBH,EAAQ,SACzBG,EAAA,QAAA,UAAyBH,EAAQ;AAAA;;;;;ACTjC,WAAO,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AAKQ;AAAA,cACL,IAAAX;AAAA,cACA,MAAK;AAAA,cACL,WAAU;AAAA,cACV,cAAAJ;AAAA,cACA,MAAM4C;AAAA,cACN,OAAOzB,IAAeI,IAAe;AAAA,cACrC,cAAeJ,IAA8B,SAAflB;AAAA,cAC9B,UAAU+B;AAAA,cACV,QAAQG;AAAA,cACR,gBAAcU;AAAA,cACd,oBAAkBH;AAAA,YAAA;AAAA,UAAA;AAAA,UAEnBF,IACC,gBAAAO;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,IAAI9B;AAAA,cACJ,MAAK;AAAA,cACL,aAAU;AAAA,cACV,WAAU;AAAA,cAEV,UAAA;AAAA,gBAAA,gBAAA+B,EAACE,IAAA,EAAY,eAAY,QAAO,WAAU,yBAAwB;AAAA,gBAClE,gBAAAF,EAAC,UAAM,UAAAF,GAAA,CAAqB;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA,IAE5B;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AAEAnD,GAAW,cAAc;","x_google_ignoreList":[0,1,2,3,4,5,6]}
|
|
1
|
+
{"version":3,"file":"email-input-DQixfopu.js","sources":["../../node_modules/validator/lib/util/assertString.js","../../node_modules/validator/lib/util/checkHost.js","../../node_modules/validator/lib/isByteLength.js","../../node_modules/validator/lib/util/merge.js","../../node_modules/validator/lib/isFQDN.js","../../node_modules/validator/lib/isIP.js","../../node_modules/validator/lib/isEmail.js","../../src/components/email-input/email-input.agent.ts","../../src/components/email-input/email-input.tsx"],"sourcesContent":["\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = assertString;\nfunction assertString(input) {\n if (input === undefined || input === null) throw new TypeError(\"Expected a string but received a \".concat(input));\n if (input.constructor.name !== 'String') throw new TypeError(\"Expected a string but received a \".concat(input.constructor.name));\n}\nmodule.exports = exports.default;\nmodule.exports.default = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = checkHost;\nfunction isRegExp(obj) {\n return Object.prototype.toString.call(obj) === '[object RegExp]';\n}\nfunction checkHost(host, matches) {\n for (var i = 0; i < matches.length; i++) {\n var match = matches[i];\n if (host === match || isRegExp(match) && match.test(host)) {\n return true;\n }\n }\n return false;\n}\nmodule.exports = exports.default;\nmodule.exports.default = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = isByteLength;\nvar _assertString = _interopRequireDefault(require(\"./util/assertString\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\n/* eslint-disable prefer-rest-params */\nfunction isByteLength(str, options) {\n (0, _assertString.default)(str);\n var min;\n var max;\n if (_typeof(options) === 'object') {\n min = options.min || 0;\n max = options.max;\n } else {\n // backwards compatibility: isByteLength(str, min [, max])\n min = arguments[1];\n max = arguments[2];\n }\n var len = encodeURI(str).split(/%..|./).length - 1;\n return len >= min && (typeof max === 'undefined' || len <= max);\n}\nmodule.exports = exports.default;\nmodule.exports.default = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = merge;\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction merge() {\n var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var defaults = arguments.length > 1 ? arguments[1] : undefined;\n if (_typeof(obj) !== 'object' || obj === null) {\n obj = {};\n }\n for (var key in defaults) {\n if (typeof obj[key] === 'undefined') {\n obj[key] = defaults[key];\n }\n }\n return obj;\n}\nmodule.exports = exports.default;\nmodule.exports.default = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = isFQDN;\nvar _assertString = _interopRequireDefault(require(\"./util/assertString\"));\nvar _merge = _interopRequireDefault(require(\"./util/merge\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nvar default_fqdn_options = {\n require_tld: true,\n allow_underscores: false,\n allow_trailing_dot: false,\n allow_numeric_tld: false,\n allow_wildcard: false,\n ignore_max_length: false\n};\nfunction isFQDN(str, options) {\n (0, _assertString.default)(str);\n options = (0, _merge.default)(options, default_fqdn_options);\n\n /* Remove the optional trailing dot before checking validity */\n if (options.allow_trailing_dot && str[str.length - 1] === '.') {\n str = str.substring(0, str.length - 1);\n }\n\n /* Remove the optional wildcard before checking validity */\n if (options.allow_wildcard === true && str.indexOf('*.') === 0) {\n str = str.substring(2);\n }\n var parts = str.split('.');\n var tld = parts[parts.length - 1];\n if (options.require_tld) {\n // disallow fqdns without tld\n if (parts.length < 2) {\n return false;\n }\n if (!options.allow_numeric_tld && !/^([a-z\\u00A1-\\u00A8\\u00AA-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(tld)) {\n return false;\n }\n\n // disallow spaces\n if (/\\s/.test(tld)) {\n return false;\n }\n }\n\n // reject numeric TLDs\n if (!options.allow_numeric_tld && /^\\d+$/.test(tld)) {\n return false;\n }\n return parts.every(function (part) {\n if (part.length > 63 && !options.ignore_max_length) {\n return false;\n }\n if (!/^[a-z_\\u00a1-\\uffff0-9-]+$/i.test(part)) {\n return false;\n }\n\n // disallow full-width chars\n if (/[\\uff01-\\uff5e]/.test(part)) {\n return false;\n }\n\n // disallow parts starting or ending with hyphen\n if (/^-|-$/.test(part)) {\n return false;\n }\n if (!options.allow_underscores && /_/.test(part)) {\n return false;\n }\n return true;\n });\n}\nmodule.exports = exports.default;\nmodule.exports.default = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = isIP;\nvar _assertString = _interopRequireDefault(require(\"./util/assertString\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\n/**\n11.3. Examples\n\n The following addresses\n\n fe80::1234 (on the 1st link of the node)\n ff02::5678 (on the 5th link of the node)\n ff08::9abc (on the 10th organization of the node)\n\n would be represented as follows:\n\n fe80::1234%1\n ff02::5678%5\n ff08::9abc%10\n\n (Here we assume a natural translation from a zone index to the\n <zone_id> part, where the Nth zone of any scope is translated into\n \"N\".)\n\n If we use interface names as <zone_id>, those addresses could also be\n represented as follows:\n\n fe80::1234%ne0\n ff02::5678%pvc1.3\n ff08::9abc%interface10\n\n where the interface \"ne0\" belongs to the 1st link, \"pvc1.3\" belongs\n to the 5th link, and \"interface10\" belongs to the 10th organization.\n * * */\nvar IPv4SegmentFormat = '(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])';\nvar IPv4AddressFormat = \"(\".concat(IPv4SegmentFormat, \"[.]){3}\").concat(IPv4SegmentFormat);\nvar IPv4AddressRegExp = new RegExp(\"^\".concat(IPv4AddressFormat, \"$\"));\nvar IPv6SegmentFormat = '(?:[0-9a-fA-F]{1,4})';\nvar IPv6AddressRegExp = new RegExp('^(' + \"(?:\".concat(IPv6SegmentFormat, \":){7}(?:\").concat(IPv6SegmentFormat, \"|:)|\") + \"(?:\".concat(IPv6SegmentFormat, \":){6}(?:\").concat(IPv4AddressFormat, \"|:\").concat(IPv6SegmentFormat, \"|:)|\") + \"(?:\".concat(IPv6SegmentFormat, \":){5}(?::\").concat(IPv4AddressFormat, \"|(:\").concat(IPv6SegmentFormat, \"){1,2}|:)|\") + \"(?:\".concat(IPv6SegmentFormat, \":){4}(?:(:\").concat(IPv6SegmentFormat, \"){0,1}:\").concat(IPv4AddressFormat, \"|(:\").concat(IPv6SegmentFormat, \"){1,3}|:)|\") + \"(?:\".concat(IPv6SegmentFormat, \":){3}(?:(:\").concat(IPv6SegmentFormat, \"){0,2}:\").concat(IPv4AddressFormat, \"|(:\").concat(IPv6SegmentFormat, \"){1,4}|:)|\") + \"(?:\".concat(IPv6SegmentFormat, \":){2}(?:(:\").concat(IPv6SegmentFormat, \"){0,3}:\").concat(IPv4AddressFormat, \"|(:\").concat(IPv6SegmentFormat, \"){1,5}|:)|\") + \"(?:\".concat(IPv6SegmentFormat, \":){1}(?:(:\").concat(IPv6SegmentFormat, \"){0,4}:\").concat(IPv4AddressFormat, \"|(:\").concat(IPv6SegmentFormat, \"){1,6}|:)|\") + \"(?::((?::\".concat(IPv6SegmentFormat, \"){0,5}:\").concat(IPv4AddressFormat, \"|(?::\").concat(IPv6SegmentFormat, \"){1,7}|:))\") + ')(%[0-9a-zA-Z.]{1,})?$');\nfunction isIP(ipAddress) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n (0, _assertString.default)(ipAddress);\n\n // accessing 'arguments' for backwards compatibility: isIP(ipAddress [, version])\n // eslint-disable-next-line prefer-rest-params\n var version = (_typeof(options) === 'object' ? options.version : arguments[1]) || '';\n if (!version) {\n return isIP(ipAddress, {\n version: 4\n }) || isIP(ipAddress, {\n version: 6\n });\n }\n if (version.toString() === '4') {\n return IPv4AddressRegExp.test(ipAddress);\n }\n if (version.toString() === '6') {\n return IPv6AddressRegExp.test(ipAddress);\n }\n return false;\n}\nmodule.exports = exports.default;\nmodule.exports.default = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = isEmail;\nvar _assertString = _interopRequireDefault(require(\"./util/assertString\"));\nvar _checkHost = _interopRequireDefault(require(\"./util/checkHost\"));\nvar _isByteLength = _interopRequireDefault(require(\"./isByteLength\"));\nvar _isFQDN = _interopRequireDefault(require(\"./isFQDN\"));\nvar _isIP = _interopRequireDefault(require(\"./isIP\"));\nvar _merge = _interopRequireDefault(require(\"./util/merge\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nvar default_email_options = {\n allow_display_name: false,\n allow_underscores: false,\n require_display_name: false,\n allow_utf8_local_part: true,\n require_tld: true,\n blacklisted_chars: '',\n ignore_max_length: false,\n host_blacklist: [],\n host_whitelist: []\n};\n\n/* eslint-disable max-len */\n/* eslint-disable no-control-regex */\nvar splitNameAddress = /^([^\\x00-\\x1F\\x7F-\\x9F\\cX]+)</i;\nvar emailUserPart = /^[a-z\\d!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]+$/i;\nvar gmailUserPart = /^[a-z\\d]+$/;\nvar quotedEmailUser = /^([\\s\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f\\x21\\x23-\\x5b\\x5d-\\x7e]|(\\\\[\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]))*$/i;\nvar emailUserUtf8Part = /^[a-z\\d!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~\\u00A1-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]+$/i;\nvar quotedEmailUserUtf8 = /^([\\s\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f\\x21\\x23-\\x5b\\x5d-\\x7e\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]|(\\\\[\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))*$/i;\nvar defaultMaxEmailLength = 254;\n/* eslint-enable max-len */\n/* eslint-enable no-control-regex */\n\n/**\n * Validate display name according to the RFC2822: https://tools.ietf.org/html/rfc2822#appendix-A.1.2\n * @param {String} display_name\n */\nfunction validateDisplayName(display_name) {\n var display_name_without_quotes = display_name.replace(/^\"(.+)\"$/, '$1');\n // display name with only spaces is not valid\n if (!display_name_without_quotes.trim()) {\n return false;\n }\n\n // check whether display name contains illegal character\n var contains_illegal = /[\\.\";<>]/.test(display_name_without_quotes);\n if (contains_illegal) {\n // if contains illegal characters,\n // must to be enclosed in double-quotes, otherwise it's not a valid display name\n if (display_name_without_quotes === display_name) {\n return false;\n }\n\n // the quotes in display name must start with character symbol \\\n var all_start_with_back_slash = display_name_without_quotes.split('\"').length === display_name_without_quotes.split('\\\\\"').length;\n if (!all_start_with_back_slash) {\n return false;\n }\n }\n return true;\n}\nfunction isEmail(str, options) {\n (0, _assertString.default)(str);\n options = (0, _merge.default)(options, default_email_options);\n if (options.require_display_name || options.allow_display_name) {\n var display_email = str.match(splitNameAddress);\n if (display_email) {\n var display_name = display_email[1];\n\n // Remove display name and angle brackets to get email address\n // Can be done in the regex but will introduce a ReDOS (See #1597 for more info)\n str = str.replace(display_name, '').replace(/(^<|>$)/g, '');\n\n // sometimes need to trim the last space to get the display name\n // because there may be a space between display name and email address\n // eg. myname <address@gmail.com>\n // the display name is `myname` instead of `myname `, so need to trim the last space\n if (display_name.endsWith(' ')) {\n display_name = display_name.slice(0, -1);\n }\n if (!validateDisplayName(display_name)) {\n return false;\n }\n } else if (options.require_display_name) {\n return false;\n }\n }\n if (!options.ignore_max_length && str.length > defaultMaxEmailLength) {\n return false;\n }\n var parts = str.split('@');\n var domain = parts.pop();\n var lower_domain = domain.toLowerCase();\n if (options.host_blacklist.length > 0 && (0, _checkHost.default)(lower_domain, options.host_blacklist)) {\n return false;\n }\n if (options.host_whitelist.length > 0 && !(0, _checkHost.default)(lower_domain, options.host_whitelist)) {\n return false;\n }\n var user = parts.join('@');\n if (options.domain_specific_validation && (lower_domain === 'gmail.com' || lower_domain === 'googlemail.com')) {\n /*\n Previously we removed dots for gmail addresses before validating.\n This was removed because it allows `multiple..dots@gmail.com`\n to be reported as valid, but it is not.\n Gmail only normalizes single dots, removing them from here is pointless,\n should be done in normalizeEmail\n */\n user = user.toLowerCase();\n\n // Removing sub-address from username before gmail validation\n var username = user.split('+')[0];\n\n // Dots are not included in gmail length restriction\n if (!(0, _isByteLength.default)(username.replace(/\\./g, ''), {\n min: 6,\n max: 30\n })) {\n return false;\n }\n var _user_parts = username.split('.');\n for (var i = 0; i < _user_parts.length; i++) {\n if (!gmailUserPart.test(_user_parts[i])) {\n return false;\n }\n }\n }\n if (options.ignore_max_length === false && (!(0, _isByteLength.default)(user, {\n max: 64\n }) || !(0, _isByteLength.default)(domain, {\n max: 254\n }))) {\n return false;\n }\n if (!(0, _isFQDN.default)(domain, {\n require_tld: options.require_tld,\n ignore_max_length: options.ignore_max_length,\n allow_underscores: options.allow_underscores\n })) {\n if (!options.allow_ip_domain) {\n return false;\n }\n if (!(0, _isIP.default)(domain)) {\n if (!domain.startsWith('[') || !domain.endsWith(']')) {\n return false;\n }\n var noBracketdomain = domain.slice(1, -1);\n if (noBracketdomain.length === 0 || !(0, _isIP.default)(noBracketdomain)) {\n return false;\n }\n }\n }\n if (options.blacklisted_chars) {\n if (user.search(new RegExp(\"[\".concat(options.blacklisted_chars, \"]+\"), 'g')) !== -1) return false;\n }\n if (user[0] === '\"' && user[user.length - 1] === '\"') {\n user = user.slice(1, user.length - 1);\n return options.allow_utf8_local_part ? quotedEmailUserUtf8.test(user) : quotedEmailUser.test(user);\n }\n var pattern = options.allow_utf8_local_part ? emailUserUtf8Part : emailUserPart;\n var user_parts = user.split('.');\n for (var _i = 0; _i < user_parts.length; _i++) {\n if (!pattern.test(user_parts[_i])) {\n return false;\n }\n }\n return true;\n}\nmodule.exports = exports.default;\nmodule.exports.default = exports.default;","/* -------------------------------------------------------------------- */\n/* Agent adapter — EmailInput. */\n/* */\n/* Presentational specialisation of TextInput — no actions of its own. */\n/* The handle re-exposes the underlying input's value-setter so agents */\n/* can drive the field through the normal TextInput contract without */\n/* needing to know it's wrapped. See `src/docs/26-agent-readiness.mdx` */\n/* for the contract. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\n\n/**\n * Curated agent handle for EmailInput. State stays scoped to the visible\n * value + the kit-derived validity flag; never PHI (per PRS §Security).\n */\nexport interface EmailInputHandle {\n /** Returns the current input value. */\n getValue: () => string;\n /** Returns whether the current value parses as a valid email (non-empty + RFC). */\n isValid: () => boolean;\n}\n\nexport const emailInputAgent: AgentAdapter<EmailInputHandle> = {\n id: 'email-input',\n capabilities: [],\n state: {\n value: {\n type: 'string',\n descriptionKey: 'ui.agent.emailInput.state.value',\n description: 'The current email address typed into the field.',\n read: (handle) => handle.getValue(),\n },\n isValid: {\n type: 'boolean',\n descriptionKey: 'ui.agent.emailInput.state.isValid',\n description:\n 'True when the value is non-empty AND parses as a valid email per RFC 5322.',\n read: (handle) => handle.isValid(),\n },\n },\n actions: {},\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'email-input',\n description:\n 'Marks the EmailInput wrapper. The inline error element carries `role=\"alert\"` when validation fails.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop, when provided.',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n type ChangeEvent,\n type FocusEvent,\n type ReactNode,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { CircleAlert } from 'lucide-react';\n// Tree-shaken import — pulling `validator/lib/isEmail` instead of the\n// barrel keeps the bundle to ~3 KB. `import { isEmail } from 'validator'`\n// drags in ~50 KB of unused validators.\nimport isEmail from 'validator/lib/isEmail';\nimport { TextInput, type TextInputProps } from '../text-input';\nimport { useFormField } from '../form-field/form-field-context';\nimport { composeRefs } from '../_shared/compose-refs';\nimport { useAgentRegistration } from '../../agent';\nimport { emailInputAgent, type EmailInputHandle } from './email-input.agent';\n\n/* ------------------------------------------------------------------ */\n/* Public API */\n/* */\n/* `type`, `inputMode`, and `tone` are baked in — the component decides */\n/* those itself. `autoComplete` is `email` unless a sign-in form asks */\n/* for `username`. `tone` is computed from the */\n/* validation state so consumers can never wedge it into an inconsistent*/\n/* visual signal. */\n/* ------------------------------------------------------------------ */\n\nexport interface EmailInputProps extends Omit<\n TextInputProps,\n 'type' | 'autoComplete' | 'inputMode' | 'tone'\n> {\n /**\n * Override the \"Invalid email\" error message. When omitted, the\n * translated default `t('inputs.email.invalid')` is used.\n *\n * Pass `null` when the host shows the message itself (a `FormField`\n * `error`, or its own element). The input then never marks itself\n * invalid: it turns red only when the host says so, through the\n * FormField's `error` or `aria-invalid`. `onValidityChange` still fires.\n */\n errorMessage?: ReactNode | null;\n /**\n * Called whenever the validation state flips. `valid` is `true` when\n * the value is non-empty AND parses as a valid email, `false`\n * otherwise. The callback fires on every blur AND on every change\n * after the first blur — never before the user has had a chance to\n * type something.\n */\n onValidityChange?: (valid: boolean) => void;\n /**\n * Skip the built-in validation entirely. The input behaves like a\n * plain `<TextInput type=\"email\">` — useful when the consumer is\n * wiring `FormField`'s `invalid` prop themselves, or running their\n * own schema validation (zod, react-hook-form). Default: `false`.\n */\n disableBuiltInValidation?: boolean;\n /**\n * Autocomplete hint. Default `email`. Use `username` on a sign-in form,\n * where the email is what the account is known by: browsers and\n * password managers pair `username` with `current-password`.\n */\n autoComplete?: 'email' | 'username';\n}\n\n/* ------------------------------------------------------------------ */\n/* Validation engine */\n/* */\n/* Pure helper — empty values are NOT flagged (let `required` handle */\n/* empty separately). Whitespace-only values fall through to validator */\n/* which rejects them as malformed. */\n/* ------------------------------------------------------------------ */\n\nfunction checkValidity(value: string): boolean {\n if (value.length === 0) return true;\n return isEmail(value);\n}\n\nexport const EmailInput = forwardRef<HTMLInputElement, EmailInputProps>(\n (\n {\n errorMessage,\n onValidityChange,\n disableBuiltInValidation = false,\n autoComplete = 'email',\n value,\n defaultValue,\n onChange,\n onBlur,\n id,\n 'aria-describedby': consumerDescribedBy,\n 'aria-invalid': consumerAriaInvalid,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation('ui');\n const ctx = useFormField();\n\n const innerRef = useRef<HTMLInputElement | null>(null);\n const composedRef = composeRefs(ref, innerRef);\n\n // An id of its own: the FormField's error element owns `ctx.errorId`.\n const errorElementId = useId();\n\n const isControlled = value !== undefined;\n\n // Seed once from controlled `value` or `defaultValue` so we can\n // validate an already-populated field at mount (e.g. server-side\n // rehydration). Recomputing on prop changes would defeat the React\n // \"defaultValue is initial only\" contract — we read it once via the\n // lazy initialiser and let `currentValue` track every change after.\n const [internalValue, setInternalValue] = useState<string>(() => {\n if (typeof value === 'string') return value;\n if (typeof defaultValue === 'string') return defaultValue;\n return '';\n });\n const currentValue = isControlled ? String(value) : internalValue;\n\n // `touched` flips to `true` on first blur, or immediately if the\n // field is seeded with a non-empty value (consumer is asking us to\n // validate something they already collected).\n const [touched, setTouched] = useState<boolean>(\n () => currentValue.length > 0,\n );\n\n const computedValid = useMemo(\n () => checkValidity(currentValue),\n [currentValue],\n );\n\n // The format fails only when the field has been touched AND the\n // value is non-empty AND the value fails RFC. Empty is always\n // \"not yet invalid\" — `required` covers the empty case separately.\n const formatInvalid =\n !disableBuiltInValidation &&\n touched &&\n currentValue.length > 0 &&\n !computedValid;\n\n // Notify consumers on every validity flip after the first blur.\n // Empty before first blur is reported as `true` so consumers don't\n // light up a \"valid\" indicator prematurely — we only fire after\n // touched so the first emission reflects user intent.\n const lastValidRef = useRef<boolean | null>(null);\n useEffect(() => {\n if (!touched) return;\n // Empty value after touch -> `valid` is `false` because the user\n // emptied a field they were editing. This mirrors the spec note\n // that empty is reported as `false` in `onValidityChange`.\n const nextValid = currentValue.length > 0 && computedValid;\n if (lastValidRef.current !== nextValid) {\n lastValidRef.current = nextValid;\n onValidityChange?.(nextValid);\n }\n }, [touched, currentValue, computedValid, onValidityChange]);\n\n const handleChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n if (!isControlled) {\n setInternalValue(event.target.value);\n }\n onChange?.(event);\n },\n [isControlled, onChange],\n );\n\n const handleBlur = useCallback(\n (event: FocusEvent<HTMLInputElement>) => {\n setTouched(true);\n onBlur?.(event);\n },\n [onBlur],\n );\n\n /* ------------------------------------------------------------------ */\n /* Agent adapter */\n /* ------------------------------------------------------------------ */\n\n // Stable handle — both `getValue` and `isValid` read the live DOM\n // node, so the closure captures no React state. Empty dep array\n // keeps the agent registry from churning on every keystroke.\n const agentHandle = useMemo<EmailInputHandle>(\n () => ({\n getValue: () => innerRef.current?.value ?? '',\n isValid: () => {\n const v = innerRef.current?.value ?? '';\n return v.length > 0 && isEmail(v);\n },\n }),\n [],\n );\n useAgentRegistration(emailInputAgent, agentHandle, id);\n\n /* ------------------------------------------------------------------ */\n /* One message at a time */\n /* */\n /* A FormField `error` wins: its element is already in the context's */\n /* `describedBy`, so the inline message is not rendered beside it. With */\n /* `errorMessage={null}` the host owns the message, so the input never */\n /* looks invalid on its own account, with nothing to say why. */\n /* ------------------------------------------------------------------ */\n\n const showInlineError =\n formatInvalid && errorMessage !== null && !ctx.invalid;\n const contextDescribedBy = ctx.describedBy || undefined;\n const describedBy = useMemo(() => {\n const parts = [\n consumerDescribedBy,\n contextDescribedBy,\n showInlineError ? errorElementId : null,\n ].filter(Boolean) as string[];\n return parts.length > 0 ? parts.join(' ') : undefined;\n }, [\n consumerDescribedBy,\n contextDescribedBy,\n showInlineError,\n errorElementId,\n ]);\n\n // A wrapping consumer may assert invalidity for a BUSINESS reason while the\n // format is fine (e.g. \"already in use\") — honour it on the a11y attribute\n // so it's announced. Visual `tone` stays format-only, except when the\n // host owns the message: then its `aria-invalid` is the only signal.\n const consumerInvalid =\n consumerAriaInvalid === true || consumerAriaInvalid === 'true';\n const hostOwnsMessage = errorMessage === null;\n // The TextInput adds the FormField's own invalid tone.\n const effectiveTone =\n showInlineError || (hostOwnsMessage && consumerInvalid)\n ? 'error'\n : 'default';\n const effectiveAriaInvalid =\n showInlineError || ctx.invalid || consumerInvalid || undefined;\n\n const resolvedErrorMessage =\n errorMessage !== undefined\n ? errorMessage\n : t('inputs.email.invalid', 'Invalid email');\n\n return (\n <div\n data-component=\"email-input\"\n data-component-id={id}\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\"\n >\n <TextInput\n {...rest}\n ref={composedRef}\n id={id}\n type=\"email\"\n inputMode=\"email\"\n autoComplete={autoComplete}\n tone={effectiveTone}\n value={isControlled ? currentValue : undefined}\n defaultValue={!isControlled ? defaultValue : undefined}\n onChange={handleChange}\n onBlur={handleBlur}\n aria-invalid={effectiveAriaInvalid}\n aria-describedby={describedBy}\n />\n {showInlineError ? (\n <p\n id={errorElementId}\n role=\"alert\"\n data-slot=\"email-input-error\"\n className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)] type-body-sm ds:text-destructive\"\n >\n <CircleAlert aria-hidden=\"true\" className=\"ds:size-4 ds:shrink-0\" />\n <span>{resolvedErrorMessage}</span>\n </p>\n ) : null}\n </div>\n );\n },\n);\n\nEmailInput.displayName = 'EmailInput';\n"],"names":["exports","assertString","input","module","checkHost","isRegExp","obj","host","matches","i","match","isByteLength","_assertString","_interopRequireDefault","e","_typeof","o","str","options","min","max","len","merge","defaults","key","isFQDN","_merge","default_fqdn_options","parts","tld","part","isIP","IPv4SegmentFormat","IPv4AddressFormat","IPv4AddressRegExp","IPv6SegmentFormat","IPv6AddressRegExp","ipAddress","version","isEmail","_checkHost","_isByteLength","_isFQDN","_isIP","default_email_options","splitNameAddress","emailUserPart","gmailUserPart","quotedEmailUser","emailUserUtf8Part","quotedEmailUserUtf8","defaultMaxEmailLength","validateDisplayName","display_name","display_name_without_quotes","contains_illegal","all_start_with_back_slash","display_email","domain","lower_domain","user","username","_user_parts","noBracketdomain","pattern","user_parts","_i","emailInputAgent","handle","checkValidity","value","EmailInput","forwardRef","errorMessage","onValidityChange","disableBuiltInValidation","autoComplete","defaultValue","onChange","onBlur","id","consumerDescribedBy","consumerAriaInvalid","rest","ref","t","useTranslation","ctx","useFormField","innerRef","useRef","composedRef","composeRefs","errorElementId","useId","isControlled","internalValue","setInternalValue","useState","currentValue","touched","setTouched","computedValid","useMemo","formatInvalid","lastValidRef","useEffect","nextValid","handleChange","useCallback","event","handleBlur","agentHandle","_a","v","useAgentRegistration","showInlineError","contextDescribedBy","describedBy","consumerInvalid","effectiveTone","effectiveAriaInvalid","resolvedErrorMessage","jsxs","jsx","TextInput","CircleAlert"],"mappings":";;;;;;;;;;;;AAEA,WAAO,eAAcA,GAAU,cAAc;AAAA,MAC3C,OAAO;AAAA,IACT,CAAC,GACDA,EAAA,UAAkBC;AAClB,aAASA,EAAaC,GAAO;AAC3B,UAA2BA,KAAU,KAAM,OAAM,IAAI,UAAU,oCAAoC,OAAOA,CAAK,CAAC;AAChH,UAAIA,EAAM,YAAY,SAAS,SAAU,OAAM,IAAI,UAAU,oCAAoC,OAAOA,EAAM,YAAY,IAAI,CAAC;AAAA,IACjI;AACA,IAAAC,EAAA,UAAiBH,EAAQ,SACzBG,EAAA,QAAA,UAAyBH,EAAQ;AAAA;;;;;ACTjC,WAAO,eAAcA,GAAU,cAAc;AAAA,MAC3C,OAAO;AAAA,IACT,CAAC,GACDA,EAAA,UAAkBI;AAClB,aAASC,EAASC,GAAK;AACrB,aAAO,OAAO,UAAU,SAAS,KAAKA,CAAG,MAAM;AAAA,IACjD;AACA,aAASF,EAAUG,GAAMC,GAAS;AAChC,eAASC,IAAI,GAAGA,IAAID,EAAQ,QAAQC,KAAK;AACvC,YAAIC,IAAQF,EAAQC,CAAC;AACrB,YAAIF,MAASG,KAASL,EAASK,CAAK,KAAKA,EAAM,KAAKH,CAAI;AACtD,iBAAO;AAAA,MAEb;AACE,aAAO;AAAA,IACT;AACA,IAAAJ,EAAA,UAAiBH,EAAQ,SACzBG,EAAA,QAAA,UAAyBH,EAAQ;AAAA;;;;;ACjBjC,WAAO,eAAcA,GAAU,cAAc;AAAA,MAC3C,OAAO;AAAA,IACT,CAAC,GACDA,EAAA,UAAkBW;AAClB,Q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IAE5B;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AAEAnD,GAAW,cAAc;","x_google_ignoreList":[0,1,2,3,4,5,6]}
|
|
@@ -10,7 +10,7 @@ import { I as Ke } from "./icon-button-mKIvw90h.js";
|
|
|
10
10
|
import { B as es } from "./button-group-CpEycMps.js";
|
|
11
11
|
import { C as ts } from "./combobox-DppVSuUm.js";
|
|
12
12
|
import { I as vn } from "./icon-button-group-BsQkbCX4.js";
|
|
13
|
-
import { T as Ar } from "./text-input-
|
|
13
|
+
import { T as Ar } from "./text-input-rzLEKhRU.js";
|
|
14
14
|
import { C as Ze } from "./card-DPmk26CL.js";
|
|
15
15
|
import { S as Tt } from "./separator-CYU_bGFn.js";
|
|
16
16
|
import { S as ns } from "./slider-pZ95bEm7.js";
|
|
@@ -3127,4 +3127,4 @@ export {
|
|
|
3127
3127
|
Nn as t,
|
|
3128
3128
|
Kr as u
|
|
3129
3129
|
};
|
|
3130
|
-
//# sourceMappingURL=face-scheme-
|
|
3130
|
+
//# sourceMappingURL=face-scheme-Doodi6A6.js.map
|