@alfadocs/ui-kit-debug 0.63.0 → 0.64.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/dist/_chunks/{ai-prompt-input-C6sCr1Vi.js → ai-prompt-input-Dx8eXoPm.js} +2 -2
  2. package/dist/_chunks/{ai-prompt-input-C6sCr1Vi.js.map → ai-prompt-input-Dx8eXoPm.js.map} +1 -1
  3. package/dist/_chunks/{audio-recorder-D6OVfNiZ.js → audio-recorder-CdXuT9ln.js} +2 -2
  4. package/dist/_chunks/{audio-recorder-D6OVfNiZ.js.map → audio-recorder-CdXuT9ln.js.map} +1 -1
  5. package/dist/_chunks/{bishop-score-B9tvgoIq.js → bishop-score-CzjSx-dm.js} +2 -2
  6. package/dist/_chunks/{bishop-score-B9tvgoIq.js.map → bishop-score-CzjSx-dm.js.map} +1 -1
  7. package/dist/_chunks/{booking-BUV9fspj.js → booking-ChfvWy3P.js} +2 -2
  8. package/dist/_chunks/{booking-BUV9fspj.js.map → booking-ChfvWy3P.js.map} +1 -1
  9. package/dist/_chunks/{care-plan-card-QmNpGggC.js → care-plan-card-DhZNoXs4.js} +2 -2
  10. package/dist/_chunks/{care-plan-card-QmNpGggC.js.map → care-plan-card-DhZNoXs4.js.map} +1 -1
  11. package/dist/_chunks/{care-plan-entry-card-Cnra7vUc.js → care-plan-entry-card-DW70yBOD.js} +2 -2
  12. package/dist/_chunks/{care-plan-entry-card-Cnra7vUc.js.map → care-plan-entry-card-DW70yBOD.js.map} +1 -1
  13. package/dist/_chunks/{editable-currency-cell-renderer-D5C5tCfu.js → editable-currency-cell-renderer-BQgaKFCz.js} +2 -2
  14. package/dist/_chunks/{editable-currency-cell-renderer-D5C5tCfu.js.map → editable-currency-cell-renderer-BQgaKFCz.js.map} +1 -1
  15. package/dist/_chunks/{gestational-age-calculator-AkNFfZYs.js → gestational-age-calculator-D85E8lGN.js} +2 -2
  16. package/dist/_chunks/{gestational-age-calculator-AkNFfZYs.js.map → gestational-age-calculator-D85E8lGN.js.map} +1 -1
  17. package/dist/_chunks/{pregnancy-dating-Dg6dTe1p.js → pregnancy-dating-7NUaAfob.js} +2 -2
  18. package/dist/_chunks/{pregnancy-dating-Dg6dTe1p.js.map → pregnancy-dating-7NUaAfob.js.map} +1 -1
  19. package/dist/_chunks/{select-hsCaJSX3.js → select-CEtRcon5.js} +46 -45
  20. package/dist/_chunks/select-CEtRcon5.js.map +1 -0
  21. package/dist/_chunks/{tabs-BpPYVme_.js → tabs-BIQ0ew1T.js} +2 -2
  22. package/dist/_chunks/{tabs-BpPYVme_.js.map → tabs-BIQ0ew1T.js.map} +1 -1
  23. package/dist/_chunks/tooth-scheme-CiphQaON.js +1257 -0
  24. package/dist/_chunks/tooth-scheme-CiphQaON.js.map +1 -0
  25. package/dist/_chunks/{unit-converter-3sINXO3m.js → unit-converter-BIbXHIQA.js} +2 -2
  26. package/dist/_chunks/{unit-converter-3sINXO3m.js.map → unit-converter-BIbXHIQA.js.map} +1 -1
  27. package/dist/agent-catalog.json +41 -4
  28. package/dist/components/ai-prompt-input/index.js +1 -1
  29. package/dist/components/audio-recorder/index.js +1 -1
  30. package/dist/components/bishop-score/index.js +1 -1
  31. package/dist/components/booking/index.js +1 -1
  32. package/dist/components/care-plan-card/index.js +1 -1
  33. package/dist/components/care-plan-entry-card/index.js +1 -1
  34. package/dist/components/data-table/index.js +1 -1
  35. package/dist/components/gestational-age-calculator/index.js +1 -1
  36. package/dist/components/pregnancy-dating/index.js +1 -1
  37. package/dist/components/select/index.js +1 -1
  38. package/dist/components/select/select.d.ts +8 -0
  39. package/dist/components/select/select.d.ts.map +1 -1
  40. package/dist/components/tabs/index.js +1 -1
  41. package/dist/components/tooth-scheme/index.d.ts +2 -2
  42. package/dist/components/tooth-scheme/index.d.ts.map +1 -1
  43. package/dist/components/tooth-scheme/index.js +22 -15
  44. package/dist/components/tooth-scheme/tooth-data.d.ts +79 -18
  45. package/dist/components/tooth-scheme/tooth-data.d.ts.map +1 -1
  46. package/dist/components/tooth-scheme/tooth-scheme.agent.d.ts +2 -0
  47. package/dist/components/tooth-scheme/tooth-scheme.agent.d.ts.map +1 -1
  48. package/dist/components/tooth-scheme/tooth-scheme.d.ts +48 -1
  49. package/dist/components/tooth-scheme/tooth-scheme.d.ts.map +1 -1
  50. package/dist/components/unit-converter/index.js +1 -1
  51. package/dist/i18n/locales/ar.d.ts +17 -0
  52. package/dist/i18n/locales/ar.d.ts.map +1 -1
  53. package/dist/i18n/locales/ar.js +18 -1
  54. package/dist/i18n/locales/ar.js.map +1 -1
  55. package/dist/i18n/locales/de.d.ts +17 -0
  56. package/dist/i18n/locales/de.d.ts.map +1 -1
  57. package/dist/i18n/locales/de.js +18 -1
  58. package/dist/i18n/locales/de.js.map +1 -1
  59. package/dist/i18n/locales/el.d.ts +17 -0
  60. package/dist/i18n/locales/el.d.ts.map +1 -1
  61. package/dist/i18n/locales/el.js +18 -1
  62. package/dist/i18n/locales/el.js.map +1 -1
  63. package/dist/i18n/locales/en.d.ts +17 -0
  64. package/dist/i18n/locales/en.d.ts.map +1 -1
  65. package/dist/i18n/locales/en.js +18 -1
  66. package/dist/i18n/locales/en.js.map +1 -1
  67. package/dist/i18n/locales/es.d.ts +17 -0
  68. package/dist/i18n/locales/es.d.ts.map +1 -1
  69. package/dist/i18n/locales/es.js +18 -1
  70. package/dist/i18n/locales/es.js.map +1 -1
  71. package/dist/i18n/locales/fr.d.ts +17 -0
  72. package/dist/i18n/locales/fr.d.ts.map +1 -1
  73. package/dist/i18n/locales/fr.js +18 -1
  74. package/dist/i18n/locales/fr.js.map +1 -1
  75. package/dist/i18n/locales/hi.d.ts +17 -0
  76. package/dist/i18n/locales/hi.d.ts.map +1 -1
  77. package/dist/i18n/locales/hi.js +18 -1
  78. package/dist/i18n/locales/hi.js.map +1 -1
  79. package/dist/i18n/locales/it.d.ts +17 -0
  80. package/dist/i18n/locales/it.d.ts.map +1 -1
  81. package/dist/i18n/locales/it.js +18 -1
  82. package/dist/i18n/locales/it.js.map +1 -1
  83. package/dist/i18n/locales/ja.d.ts +17 -0
  84. package/dist/i18n/locales/ja.d.ts.map +1 -1
  85. package/dist/i18n/locales/ja.js +18 -1
  86. package/dist/i18n/locales/ja.js.map +1 -1
  87. package/dist/i18n/locales/nl.d.ts +17 -0
  88. package/dist/i18n/locales/nl.d.ts.map +1 -1
  89. package/dist/i18n/locales/nl.js +18 -1
  90. package/dist/i18n/locales/nl.js.map +1 -1
  91. package/dist/i18n/locales/pl.d.ts +17 -0
  92. package/dist/i18n/locales/pl.d.ts.map +1 -1
  93. package/dist/i18n/locales/pl.js +18 -1
  94. package/dist/i18n/locales/pl.js.map +1 -1
  95. package/dist/i18n/locales/pt.d.ts +17 -0
  96. package/dist/i18n/locales/pt.d.ts.map +1 -1
  97. package/dist/i18n/locales/pt.js +18 -1
  98. package/dist/i18n/locales/pt.js.map +1 -1
  99. package/dist/i18n/locales/ro.d.ts +17 -0
  100. package/dist/i18n/locales/ro.d.ts.map +1 -1
  101. package/dist/i18n/locales/ro.js +18 -1
  102. package/dist/i18n/locales/ro.js.map +1 -1
  103. package/dist/i18n/locales/ru.d.ts +17 -0
  104. package/dist/i18n/locales/ru.d.ts.map +1 -1
  105. package/dist/i18n/locales/ru.js +18 -1
  106. package/dist/i18n/locales/ru.js.map +1 -1
  107. package/dist/i18n/locales/sq.d.ts +17 -0
  108. package/dist/i18n/locales/sq.d.ts.map +1 -1
  109. package/dist/i18n/locales/sq.js +18 -1
  110. package/dist/i18n/locales/sq.js.map +1 -1
  111. package/dist/i18n/locales/sv.d.ts +17 -0
  112. package/dist/i18n/locales/sv.d.ts.map +1 -1
  113. package/dist/i18n/locales/sv.js +18 -1
  114. package/dist/i18n/locales/sv.js.map +1 -1
  115. package/dist/i18n/locales/tr.d.ts +17 -0
  116. package/dist/i18n/locales/tr.d.ts.map +1 -1
  117. package/dist/i18n/locales/tr.js +18 -1
  118. package/dist/i18n/locales/tr.js.map +1 -1
  119. package/dist/i18n/locales/zh.d.ts +17 -0
  120. package/dist/i18n/locales/zh.d.ts.map +1 -1
  121. package/dist/i18n/locales/zh.js +18 -1
  122. package/dist/i18n/locales/zh.js.map +1 -1
  123. package/dist/index.js +180 -173
  124. package/dist/locales/ar.json +18 -1
  125. package/dist/locales/de.json +18 -1
  126. package/dist/locales/el.json +18 -1
  127. package/dist/locales/en.json +18 -1
  128. package/dist/locales/es.json +18 -1
  129. package/dist/locales/fr.json +18 -1
  130. package/dist/locales/hi.json +18 -1
  131. package/dist/locales/it.json +18 -1
  132. package/dist/locales/ja.json +18 -1
  133. package/dist/locales/nl.json +18 -1
  134. package/dist/locales/pl.json +18 -1
  135. package/dist/locales/pt.json +18 -1
  136. package/dist/locales/ro.json +18 -1
  137. package/dist/locales/ru.json +18 -1
  138. package/dist/locales/sq.json +18 -1
  139. package/dist/locales/sv.json +18 -1
  140. package/dist/locales/tr.json +18 -1
  141. package/dist/locales/zh.json +18 -1
  142. package/dist/tokens.css +1 -1
  143. package/package.json +1 -1
  144. package/dist/_chunks/select-hsCaJSX3.js.map +0 -1
  145. package/dist/_chunks/tooth-scheme-CxlsLjfN.js +0 -753
  146. package/dist/_chunks/tooth-scheme-CxlsLjfN.js.map +0 -1
@@ -7,7 +7,7 @@ import { P as A } from "./progress-kzIRcdaq.js";
7
7
  import { T as C } from "./timestamp-BV2lC-wV.js";
8
8
  import { T as L } from "./transaction-chip-BZCa6XDn.js";
9
9
  import { A as O, b as G, c as Y, a as $ } from "./accordion-9lJSMMsZ.js";
10
- import { C as q } from "./care-plan-entry-card-Cnra7vUc.js";
10
+ import { C as q } from "./care-plan-entry-card-DW70yBOD.js";
11
11
  import { u as J } from "./registry-nPAVE19X.js";
12
12
  import { C as Q, e as W } from "./entity-card-COhmqHly.js";
13
13
  import { i as X } from "./is-safe-url-DkETxeHz.js";
@@ -249,4 +249,4 @@ export {
249
249
  de as C,
250
250
  Z as c
251
251
  };
252
- //# sourceMappingURL=care-plan-card-QmNpGggC.js.map
252
+ //# sourceMappingURL=care-plan-card-DhZNoXs4.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"care-plan-card-QmNpGggC.js","sources":["../../src/components/care-plan-card/care-plan-card.agent.ts","../../src/components/care-plan-card/care-plan-card.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — CarePlanCard. */\n/* */\n/* Read-only surface: expose the plan's lifecycle state and line-progress */\n/* counts so an agent can introspect a care plan's status. State enum + */\n/* counts only — never the plan name, operator, treatment names, or any */\n/* patient identity. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { CarePlanCardHandle } from './care-plan-card';\n\nexport const carePlanCardAgent: AgentAdapter<CarePlanCardHandle> = {\n id: 'care-plan-card',\n capabilities: ['view_change', 'expand'],\n state: {\n state: {\n type: \"'estimate' | 'accepted' | 'discarded' | 'closed'\",\n descriptionKey: 'ui.agent.carePlanCard.state.state',\n description:\n 'The plan lifecycle state. Enum value only — never the localised label or any PHI.',\n read: (handle) => handle.getState(),\n },\n progress: {\n type: '{ done: number; total: number }',\n descriptionKey: 'ui.agent.carePlanCard.state.progress',\n description:\n 'Line progress as done / total counts. Counts only — never treatment names or operator identity.',\n read: (handle) => handle.getProgress(),\n },\n },\n actions: {},\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'care-plan-card',\n description: 'Marks the CarePlanCard root region.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop. Addresses a specific plan.',\n },\n },\n};\n","import { forwardRef, useId, type HTMLAttributes } from 'react';\nimport { type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Badge } from '../badge/badge';\nimport { Link } from '../link/link';\nimport { Progress } from '../progress/progress';\nimport { Timestamp } from '../timestamp/timestamp';\nimport { TransactionChip } from '../transaction-chip/transaction-chip';\nimport {\n Accordion,\n AccordionItem,\n AccordionTrigger,\n AccordionContent,\n} from '../accordion/accordion';\nimport {\n CarePlanEntryCard,\n type CarePlanEntryCardProps,\n} from '../care-plan-entry-card';\nimport {\n entitySurfaceVariants,\n CARE_PLAN_STATE_BADGE,\n isSafeEntityUrl,\n type CarePlanState,\n} from '../_shared/entity-card';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { carePlanCardAgent } from './care-plan-card.agent';\n\n/* -------------------------------------------------------------------- */\n/* CarePlanCard */\n/* */\n/* The summary card for a whole care plan / estimate (\"preventivo\"). */\n/* Replaces the hand-rolled platform care-plan header that interleaves */\n/* the plan number + name, a lifecycle badge, the financial figures */\n/* (billed / due / overdue), an acceptance/closure date, a phase- */\n/* progress bar, an optional deep link, and an expandable list of the */\n/* plan's treatment lines. */\n/* */\n/* Composes: entitySurfaceVariants (shared card surface) + Badge */\n/* (lifecycle state) + TransactionChip (money) + Progress (done/total) */\n/* + Timestamp (dates) + Link (deep link) + Accordion (entries rendered */\n/* as <CarePlanEntryCard> rows). */\n/* */\n/* All visible text flows through useTranslation('ui') against the */\n/* `carePlanCard.*` namespace — the lifecycle state is ALWAYS shown as a */\n/* localised label, never the raw server string. Identifiers + structural */\n/* state only reach the agent layer — never patient identity. */\n/* -------------------------------------------------------------------- */\n\n/* -------------------------------------------------------------------- */\n/* Public types */\n/* -------------------------------------------------------------------- */\n\n/**\n * A single treatment line within the plan. Each ref is forwarded straight\n * to a `<CarePlanEntryCard>` rendered inside the Accordion. `entryId` keys\n * the row and surfaces as the line's `data-component-id`.\n */\nexport interface CarePlanEntryRef extends Omit<\n CarePlanEntryCardProps,\n 'id' | 'surface'\n> {\n /** Stable line id — identifier only, never PHI. */\n entryId: string;\n}\n\n/** Financial figures for the plan, all amounts in integer cents. */\nexport interface CarePlanAmounts {\n /** Full list price in cents (non-negative). */\n priceCents?: number;\n /** Discounted / agreed price in cents (non-negative). */\n discountedPriceCents?: number;\n /** Amount already invoiced in cents (non-negative). */\n billedAmountCents?: number;\n /** Outstanding amount still due in cents (non-negative). */\n dueCents?: number;\n /** How many days the due amount is overdue (non-negative). */\n overdueDays?: number;\n}\n\n/** Phase / line progress for the plan. */\nexport interface CarePlanProgress {\n /** Number of executed / completed lines. */\n done: number;\n /** Total number of lines. */\n total: number;\n}\n\n/** Lifecycle dates for the plan, all ISO-8601 strings. */\nexport interface CarePlanDates {\n /** When the plan was accepted. */\n acceptedIso?: string;\n /** When the plan was closed. */\n closedIso?: string;\n /** When the plan was discarded / rejected. */\n discardedIso?: string;\n}\n\n/** Curated read-only handle exposed to the agent registry. */\nexport interface CarePlanCardHandle {\n /** The plan's lifecycle state. */\n getState: () => CarePlanState;\n /** Line progress as `{ done, total }` — counts only, no PHI. */\n getProgress: () => { done: number; total: number };\n}\n\nexport interface CarePlanCardProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'aria-label' | 'title' | 'children'\n> {\n /**\n * Stable instance id — surfaced as `data-component-id` for the agent\n * registry and mirrored to the DOM `id`; also wires the heading ↔ region\n * relationship.\n */\n id?: string;\n /** Plan number (e.g. estimate number). Rendered beside the name. */\n number: string | number;\n /** Plan name / title. Rendered as the card heading. */\n name?: string;\n /** Lifecycle state — drives a localised Badge label. */\n state: CarePlanState;\n /** Optional deep link to the full plan. Guarded by `isSafeEntityUrl`. */\n url?: string;\n /** Financial figures (billed / due / overdue …). */\n amounts?: CarePlanAmounts;\n /** Line progress (done / total). */\n progress?: CarePlanProgress;\n /** Lifecycle dates (accepted / closed / discarded). */\n dates?: CarePlanDates;\n /** Reason the plan was discarded — shown only when `state === 'discarded'`. */\n discardReason?: string;\n /**\n * Dentition the plan applies to — forwarded to each entry card's tooth\n * display where relevant. Structural only.\n */\n dentitionMode?: 'permanent' | 'deciduous';\n /** Treatment lines — rendered as `<CarePlanEntryCard>` rows in an Accordion. */\n entries?: CarePlanEntryRef[];\n /** BCP 47 locale override for dates / currency. Defaults to i18n.language. */\n locale?: string;\n /** ISO 4217 currency code for the money chips. Defaults to `EUR`. */\n currency?: string;\n /**\n * `elevated` (default) paints the kit card chrome; `flat` drops it for use\n * inside an existing Card / Sheet.\n */\n surface?: 'flat' | 'elevated';\n /** Fires when the plan deep link / heading is activated. */\n onActivate?: () => void;\n /** Accessible label override for the plan region. */\n 'aria-label'?: string;\n}\n\n/* -------------------------------------------------------------------- */\n/* Helpers */\n/* -------------------------------------------------------------------- */\n\nconst DEFAULT_CURRENCY = 'EUR';\n\n/**\n * English fallbacks for the lifecycle-state labels. The canonical strings\n * live in the `ui.carePlanCard.state.*` bundle; these inline defaults guard\n * against a stale / not-yet-wired bundle so a raw key never reaches the UI.\n */\nconst STATE_LABEL_FALLBACK: Record<CarePlanState, string> = {\n estimate: 'Estimate',\n accepted: 'Accepted',\n discarded: 'Discarded',\n closed: 'Closed',\n};\n\n/* -------------------------------------------------------------------- */\n/* Component */\n/* -------------------------------------------------------------------- */\n\nexport const CarePlanCard = forwardRef<HTMLDivElement, CarePlanCardProps>(\n (\n {\n id,\n number,\n name,\n state,\n url,\n amounts,\n progress,\n dates,\n discardReason,\n dentitionMode: _dentitionMode,\n entries,\n locale,\n currency = DEFAULT_CURRENCY,\n surface = 'elevated',\n onActivate,\n 'aria-label': ariaLabel,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation();\n const headingId = useId();\n const progressLabelId = useId();\n const activeLocale = locale ?? i18n.language ?? 'en';\n\n useAgentRegistration(\n carePlanCardAgent,\n {\n getState: () => state,\n getProgress: () => ({\n done: progress?.done ?? 0,\n total: progress?.total ?? 0,\n }),\n },\n id,\n );\n\n const stateLabel = t(`carePlanCard.state.${state}`, {\n defaultValue: STATE_LABEL_FALLBACK[state],\n });\n const stateBadgeVariant = CARE_PLAN_STATE_BADGE[state];\n const hasSafeUrl = !!url && isSafeEntityUrl(url);\n const hasEntries = !!entries && entries.length > 0;\n\n // Money: prefer the outstanding \"due\" chip; mark it overdue when it has\n // run past its term. Anything billed shows a settled chip alongside.\n const dueCents = amounts?.dueCents;\n const billedCents = amounts?.billedAmountCents;\n const overdueDays = amounts?.overdueDays;\n const isOverdue =\n typeof overdueDays === 'number' &&\n overdueDays > 0 &&\n typeof dueCents === 'number' &&\n dueCents > 0;\n\n const headingNode = (\n <h3\n id={headingId}\n className=\"type-title-card ds:m-0 ds:text-[color:var(--foreground)]\"\n >\n {name ?? t('carePlanCard.untitled', 'Untitled plan')}\n </h3>\n );\n\n return (\n <div\n ref={ref}\n role=\"region\"\n aria-label={ariaLabel}\n aria-labelledby={ariaLabel ? undefined : headingId}\n data-component=\"care-plan-card\"\n data-component-id={id}\n data-state={state}\n id={id}\n className={entitySurfaceVariants({ surface, className })}\n {...rest}\n >\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n {/* Heading row: number + name + lifecycle badge */}\n <div className=\"ds:flex ds:items-start ds:gap-[var(--spacing-sm)]\">\n <div className=\"ds:flex ds:min-w-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-2xs)]\">\n <span className=\"type-eyebrow ds:text-[color:var(--muted-foreground)] ds:tabular-nums\">\n {t('carePlanCard.number', {\n number,\n defaultValue: 'Plan #{{number}}',\n })}\n </span>\n {hasSafeUrl ? (\n <Link\n href={url as string}\n weight=\"strong\"\n onClick={(event) => {\n if (\n event.defaultPrevented ||\n event.metaKey ||\n event.ctrlKey ||\n event.shiftKey\n ) {\n return;\n }\n onActivate?.();\n }}\n >\n {headingNode}\n </Link>\n ) : (\n headingNode\n )}\n </div>\n\n <Badge\n variant={stateBadgeVariant}\n size=\"sm\"\n withDot\n className=\"ds:shrink-0\"\n >\n {stateLabel}\n </Badge>\n </div>\n\n {/* Discard reason — only when discarded */}\n {state === 'discarded' && discardReason ? (\n <p className=\"type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]\">\n <span className=\"ds:font-medium ds:text-[color:var(--foreground)]\">\n {t('carePlanCard.discardReasonLabel', 'Discard reason:')}\n </span>{' '}\n {discardReason}\n </p>\n ) : null}\n\n {/* Lifecycle date line */}\n {dates ? (\n <div className=\"type-body-sm ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-md)] ds:text-[color:var(--muted-foreground)]\">\n {dates.acceptedIso ? (\n <span className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n <span>{t('carePlanCard.date.accepted', 'Accepted')}</span>\n <Timestamp\n value={dates.acceptedIso}\n format=\"absolute\"\n locale={activeLocale}\n />\n </span>\n ) : null}\n {dates.closedIso ? (\n <span className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n <span>{t('carePlanCard.date.closed', 'Closed')}</span>\n <Timestamp\n value={dates.closedIso}\n format=\"absolute\"\n locale={activeLocale}\n />\n </span>\n ) : null}\n {dates.discardedIso ? (\n <span className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n <span>{t('carePlanCard.date.discarded', 'Discarded')}</span>\n <Timestamp\n value={dates.discardedIso}\n format=\"absolute\"\n locale={activeLocale}\n />\n </span>\n ) : null}\n </div>\n ) : null}\n\n {/* Money: due / overdue / billed chips */}\n {typeof dueCents === 'number' || typeof billedCents === 'number' ? (\n <div className=\"ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]\">\n {typeof dueCents === 'number' && dueCents > 0 ? (\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n <TransactionChip\n state=\"debt\"\n amount={dueCents / 100}\n currency={currency}\n locale={activeLocale}\n showLabel\n size=\"md\"\n />\n {isOverdue ? (\n <Badge variant=\"error\" size=\"sm\" withDot>\n {t('carePlanCard.overdue', {\n count: overdueDays,\n defaultValue: 'Overdue {{count}}d',\n })}\n </Badge>\n ) : null}\n </div>\n ) : null}\n {typeof billedCents === 'number' && billedCents > 0 ? (\n <TransactionChip\n state=\"settled\"\n amount={billedCents / 100}\n currency={currency}\n locale={activeLocale}\n showLabel\n size=\"md\"\n />\n ) : null}\n </div>\n ) : null}\n\n {/* Line / phase progress */}\n {progress && progress.total > 0 ? (\n <Progress\n value={progress.done}\n max={progress.total}\n size=\"sm\"\n aria-label={t('carePlanCard.progressLabel', {\n done: progress.done,\n total: progress.total,\n defaultValue: 'Progress: {{done}} of {{total}} completed',\n })}\n >\n <div className=\"ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]\">\n <Progress.Label id={progressLabelId}>\n {t('carePlanCard.progressHeading', 'Progress')}\n </Progress.Label>\n <span className=\"type-body-sm ds:tabular-nums ds:text-[color:var(--muted-foreground)]\">\n {t('carePlanCard.progressCount', {\n done: progress.done,\n total: progress.total,\n defaultValue: '{{done}} / {{total}}',\n })}\n </span>\n </div>\n </Progress>\n ) : null}\n\n {/* Entries — expandable list of treatment lines */}\n {hasEntries ? (\n <Accordion type=\"single\" collapsible variant=\"separated\">\n <AccordionItem value=\"entries\">\n <AccordionTrigger>\n {t('carePlanCard.entries.toggle', {\n count: entries.length,\n defaultValue: 'Treatment lines ({{count}})',\n })}\n </AccordionTrigger>\n <AccordionContent>\n <ul className=\"ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-0\">\n {entries.map(({ entryId, ...entry }) => (\n <li key={entryId}>\n <CarePlanEntryCard\n id={entryId}\n surface=\"flat\"\n locale={activeLocale}\n currency={currency}\n {...entry}\n />\n </li>\n ))}\n </ul>\n </AccordionContent>\n </AccordionItem>\n </Accordion>\n ) : null}\n </div>\n </div>\n );\n },\n);\n\nCarePlanCard.displayName = 'CarePlanCard';\n\nexport type CarePlanCardSurface = NonNullable<\n VariantProps<typeof entitySurfaceVariants>['surface']\n>;\n\n/** The dentition the plan applies to. */\nexport type CarePlanCardDentition = NonNullable<\n CarePlanCardProps['dentitionMode']\n>;\n\n/* Re-export the shared lifecycle-state type for downstream typing. */\nexport type { CarePlanState } from '../_shared/entity-card';\n"],"names":["carePlanCardAgent","handle","DEFAULT_CURRENCY","STATE_LABEL_FALLBACK","CarePlanCard","forwardRef","id","number","name","state","url","amounts","progress","dates","discardReason","_dentitionMode","entries","locale","currency","surface","onActivate","ariaLabel","className","rest","ref","t","i18n","useTranslation","headingId","useId","progressLabelId","activeLocale","useAgentRegistration","stateLabel","stateBadgeVariant","CARE_PLAN_STATE_BADGE","hasSafeUrl","isSafeEntityUrl","hasEntries","dueCents","billedCents","overdueDays","isOverdue","headingNode","jsx","entitySurfaceVariants","jsxs","Link","event","Badge","Timestamp","TransactionChip","Progress","Accordion","AccordionItem","AccordionTrigger","AccordionContent","entryId","entry","CarePlanEntryCard"],"mappings":";;;;;;;;;;;;;AAYO,MAAMA,IAAsD;AAAA,EACjE,IAAI;AAAA,EACJ,cAAc,CAAC,eAAe,QAAQ;AAAA,EACtC,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,SAAA;AAAA,IAAS;AAAA,IAEpC,UAAU;AAAA,MACR,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACA,MAAWA,EAAO,YAAA;AAAA,IAAY;AAAA,EACvC;AAAA,EAEF,SAAS,CAAA;AAAA,EACT,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,IAAA;AAAA,IAEf,YAAY;AAAA,MACV,MAAM;AAAA,MACN,YAAY;AAAA,MACZ,aAAa;AAAA,IAAA;AAAA,EACf;AAEJ,GCiHMC,KAAmB,OAOnBC,KAAsD;AAAA,EAC1D,UAAU;AAAA,EACV,UAAU;AAAA,EACV,WAAW;AAAA,EACX,QAAQ;AACV,GAMaC,KAAeC;AAAA,EAC1B,CACE;AAAA,IACE,IAAAC;AAAA,IACA,QAAAC;AAAA,IACA,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,KAAAC;AAAA,IACA,SAAAC;AAAA,IACA,UAAAC;AAAA,IACA,OAAAC;AAAA,IACA,eAAAC;AAAA,IACA,eAAeC;AAAA,IACf,SAAAC;AAAA,IACA,QAAAC;AAAA,IAC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AAQ,aAC3C,UAAA,gBAAAP,EAACQ,GAAA,EAAc,OAAM,WACnB,UAAA;AAAA,YAAA,gBAAAV,EAACW,GAAA,EACE,YAAE,+BAA+B;AAAA,cAChC,OAAOvC,EAAQ;AAAA,cACf,cAAc;AAAA,YAAA,CACf,GACH;AAAA,YACA,gBAAA4B,EAACY,GAAA,EACC,UAAA,gBAAAZ,EAAC,MAAA,EAAG,WAAU,6EACX,UAAA5B,EAAQ,IAAI,CAAC,EAAE,SAAAyC,GAAS,GAAGC,EAAA,wBACzB,MAAA,EACC,UAAA,gBAAAd;AAAA,cAACe;AAAA,cAAA;AAAA,gBACC,IAAIF;AAAA,gBACJ,SAAQ;AAAA,gBACR,QAAQ1B;AAAA,gBACR,UAAAb;AAAA,gBACC,GAAGwC;AAAA,cAAA;AAAA,YAAA,KANCD,CAQT,CACD,EAAA,CACH,EAAA,CACF;AAAA,UAAA,EAAA,CACF,GACF,IACE;AAAA,QAAA,EAAA,CACN;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEArD,GAAa,cAAc;"}
1
+ {"version":3,"file":"care-plan-card-DhZNoXs4.js","sources":["../../src/components/care-plan-card/care-plan-card.agent.ts","../../src/components/care-plan-card/care-plan-card.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — CarePlanCard. */\n/* */\n/* Read-only surface: expose the plan's lifecycle state and line-progress */\n/* counts so an agent can introspect a care plan's status. State enum + */\n/* counts only — never the plan name, operator, treatment names, or any */\n/* patient identity. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { CarePlanCardHandle } from './care-plan-card';\n\nexport const carePlanCardAgent: AgentAdapter<CarePlanCardHandle> = {\n id: 'care-plan-card',\n capabilities: ['view_change', 'expand'],\n state: {\n state: {\n type: \"'estimate' | 'accepted' | 'discarded' | 'closed'\",\n descriptionKey: 'ui.agent.carePlanCard.state.state',\n description:\n 'The plan lifecycle state. Enum value only — never the localised label or any PHI.',\n read: (handle) => handle.getState(),\n },\n progress: {\n type: '{ done: number; total: number }',\n descriptionKey: 'ui.agent.carePlanCard.state.progress',\n description:\n 'Line progress as done / total counts. Counts only — never treatment names or operator identity.',\n read: (handle) => handle.getProgress(),\n },\n },\n actions: {},\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'care-plan-card',\n description: 'Marks the CarePlanCard root region.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop. Addresses a specific plan.',\n },\n },\n};\n","import { forwardRef, useId, type HTMLAttributes } from 'react';\nimport { type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Badge } from '../badge/badge';\nimport { Link } from '../link/link';\nimport { Progress } from '../progress/progress';\nimport { Timestamp } from '../timestamp/timestamp';\nimport { TransactionChip } from '../transaction-chip/transaction-chip';\nimport {\n Accordion,\n AccordionItem,\n AccordionTrigger,\n AccordionContent,\n} from '../accordion/accordion';\nimport {\n CarePlanEntryCard,\n type CarePlanEntryCardProps,\n} from '../care-plan-entry-card';\nimport {\n entitySurfaceVariants,\n CARE_PLAN_STATE_BADGE,\n isSafeEntityUrl,\n type CarePlanState,\n} from '../_shared/entity-card';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { carePlanCardAgent } from './care-plan-card.agent';\n\n/* -------------------------------------------------------------------- */\n/* CarePlanCard */\n/* */\n/* The summary card for a whole care plan / estimate (\"preventivo\"). */\n/* Replaces the hand-rolled platform care-plan header that interleaves */\n/* the plan number + name, a lifecycle badge, the financial figures */\n/* (billed / due / overdue), an acceptance/closure date, a phase- */\n/* progress bar, an optional deep link, and an expandable list of the */\n/* plan's treatment lines. */\n/* */\n/* Composes: entitySurfaceVariants (shared card surface) + Badge */\n/* (lifecycle state) + TransactionChip (money) + Progress (done/total) */\n/* + Timestamp (dates) + Link (deep link) + Accordion (entries rendered */\n/* as <CarePlanEntryCard> rows). */\n/* */\n/* All visible text flows through useTranslation('ui') against the */\n/* `carePlanCard.*` namespace — the lifecycle state is ALWAYS shown as a */\n/* localised label, never the raw server string. Identifiers + structural */\n/* state only reach the agent layer — never patient identity. */\n/* -------------------------------------------------------------------- */\n\n/* -------------------------------------------------------------------- */\n/* Public types */\n/* -------------------------------------------------------------------- */\n\n/**\n * A single treatment line within the plan. Each ref is forwarded straight\n * to a `<CarePlanEntryCard>` rendered inside the Accordion. `entryId` keys\n * the row and surfaces as the line's `data-component-id`.\n */\nexport interface CarePlanEntryRef extends Omit<\n CarePlanEntryCardProps,\n 'id' | 'surface'\n> {\n /** Stable line id — identifier only, never PHI. */\n entryId: string;\n}\n\n/** Financial figures for the plan, all amounts in integer cents. */\nexport interface CarePlanAmounts {\n /** Full list price in cents (non-negative). */\n priceCents?: number;\n /** Discounted / agreed price in cents (non-negative). */\n discountedPriceCents?: number;\n /** Amount already invoiced in cents (non-negative). */\n billedAmountCents?: number;\n /** Outstanding amount still due in cents (non-negative). */\n dueCents?: number;\n /** How many days the due amount is overdue (non-negative). */\n overdueDays?: number;\n}\n\n/** Phase / line progress for the plan. */\nexport interface CarePlanProgress {\n /** Number of executed / completed lines. */\n done: number;\n /** Total number of lines. */\n total: number;\n}\n\n/** Lifecycle dates for the plan, all ISO-8601 strings. */\nexport interface CarePlanDates {\n /** When the plan was accepted. */\n acceptedIso?: string;\n /** When the plan was closed. */\n closedIso?: string;\n /** When the plan was discarded / rejected. */\n discardedIso?: string;\n}\n\n/** Curated read-only handle exposed to the agent registry. */\nexport interface CarePlanCardHandle {\n /** The plan's lifecycle state. */\n getState: () => CarePlanState;\n /** Line progress as `{ done, total }` — counts only, no PHI. */\n getProgress: () => { done: number; total: number };\n}\n\nexport interface CarePlanCardProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'aria-label' | 'title' | 'children'\n> {\n /**\n * Stable instance id — surfaced as `data-component-id` for the agent\n * registry and mirrored to the DOM `id`; also wires the heading ↔ region\n * relationship.\n */\n id?: string;\n /** Plan number (e.g. estimate number). Rendered beside the name. */\n number: string | number;\n /** Plan name / title. Rendered as the card heading. */\n name?: string;\n /** Lifecycle state — drives a localised Badge label. */\n state: CarePlanState;\n /** Optional deep link to the full plan. Guarded by `isSafeEntityUrl`. */\n url?: string;\n /** Financial figures (billed / due / overdue …). */\n amounts?: CarePlanAmounts;\n /** Line progress (done / total). */\n progress?: CarePlanProgress;\n /** Lifecycle dates (accepted / closed / discarded). */\n dates?: CarePlanDates;\n /** Reason the plan was discarded — shown only when `state === 'discarded'`. */\n discardReason?: string;\n /**\n * Dentition the plan applies to — forwarded to each entry card's tooth\n * display where relevant. Structural only.\n */\n dentitionMode?: 'permanent' | 'deciduous';\n /** Treatment lines — rendered as `<CarePlanEntryCard>` rows in an Accordion. */\n entries?: CarePlanEntryRef[];\n /** BCP 47 locale override for dates / currency. Defaults to i18n.language. */\n locale?: string;\n /** ISO 4217 currency code for the money chips. Defaults to `EUR`. */\n currency?: string;\n /**\n * `elevated` (default) paints the kit card chrome; `flat` drops it for use\n * inside an existing Card / Sheet.\n */\n surface?: 'flat' | 'elevated';\n /** Fires when the plan deep link / heading is activated. */\n onActivate?: () => void;\n /** Accessible label override for the plan region. */\n 'aria-label'?: string;\n}\n\n/* -------------------------------------------------------------------- */\n/* Helpers */\n/* -------------------------------------------------------------------- */\n\nconst DEFAULT_CURRENCY = 'EUR';\n\n/**\n * English fallbacks for the lifecycle-state labels. The canonical strings\n * live in the `ui.carePlanCard.state.*` bundle; these inline defaults guard\n * against a stale / not-yet-wired bundle so a raw key never reaches the UI.\n */\nconst STATE_LABEL_FALLBACK: Record<CarePlanState, string> = {\n estimate: 'Estimate',\n accepted: 'Accepted',\n discarded: 'Discarded',\n closed: 'Closed',\n};\n\n/* -------------------------------------------------------------------- */\n/* Component */\n/* -------------------------------------------------------------------- */\n\nexport const CarePlanCard = forwardRef<HTMLDivElement, CarePlanCardProps>(\n (\n {\n id,\n number,\n name,\n state,\n url,\n amounts,\n progress,\n dates,\n discardReason,\n dentitionMode: _dentitionMode,\n entries,\n locale,\n currency = DEFAULT_CURRENCY,\n surface = 'elevated',\n onActivate,\n 'aria-label': ariaLabel,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation();\n const headingId = useId();\n const progressLabelId = useId();\n const activeLocale = locale ?? i18n.language ?? 'en';\n\n useAgentRegistration(\n carePlanCardAgent,\n {\n getState: () => state,\n getProgress: () => ({\n done: progress?.done ?? 0,\n total: progress?.total ?? 0,\n }),\n },\n id,\n );\n\n const stateLabel = t(`carePlanCard.state.${state}`, {\n defaultValue: STATE_LABEL_FALLBACK[state],\n });\n const stateBadgeVariant = CARE_PLAN_STATE_BADGE[state];\n const hasSafeUrl = !!url && isSafeEntityUrl(url);\n const hasEntries = !!entries && entries.length > 0;\n\n // Money: prefer the outstanding \"due\" chip; mark it overdue when it has\n // run past its term. Anything billed shows a settled chip alongside.\n const dueCents = amounts?.dueCents;\n const billedCents = amounts?.billedAmountCents;\n const overdueDays = amounts?.overdueDays;\n const isOverdue =\n typeof overdueDays === 'number' &&\n overdueDays > 0 &&\n typeof dueCents === 'number' &&\n dueCents > 0;\n\n const headingNode = (\n <h3\n id={headingId}\n className=\"type-title-card ds:m-0 ds:text-[color:var(--foreground)]\"\n >\n {name ?? t('carePlanCard.untitled', 'Untitled plan')}\n </h3>\n );\n\n return (\n <div\n ref={ref}\n role=\"region\"\n aria-label={ariaLabel}\n aria-labelledby={ariaLabel ? undefined : headingId}\n data-component=\"care-plan-card\"\n data-component-id={id}\n data-state={state}\n id={id}\n className={entitySurfaceVariants({ surface, className })}\n {...rest}\n >\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n {/* Heading row: number + name + lifecycle badge */}\n <div className=\"ds:flex ds:items-start ds:gap-[var(--spacing-sm)]\">\n <div className=\"ds:flex ds:min-w-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-2xs)]\">\n <span className=\"type-eyebrow ds:text-[color:var(--muted-foreground)] ds:tabular-nums\">\n {t('carePlanCard.number', {\n number,\n defaultValue: 'Plan #{{number}}',\n })}\n </span>\n {hasSafeUrl ? (\n <Link\n href={url as string}\n weight=\"strong\"\n onClick={(event) => {\n if (\n event.defaultPrevented ||\n event.metaKey ||\n event.ctrlKey ||\n event.shiftKey\n ) {\n return;\n }\n onActivate?.();\n }}\n >\n {headingNode}\n </Link>\n ) : (\n headingNode\n )}\n </div>\n\n <Badge\n variant={stateBadgeVariant}\n size=\"sm\"\n withDot\n className=\"ds:shrink-0\"\n >\n {stateLabel}\n </Badge>\n </div>\n\n {/* Discard reason — only when discarded */}\n {state === 'discarded' && discardReason ? (\n <p className=\"type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]\">\n <span className=\"ds:font-medium ds:text-[color:var(--foreground)]\">\n {t('carePlanCard.discardReasonLabel', 'Discard reason:')}\n </span>{' '}\n {discardReason}\n </p>\n ) : null}\n\n {/* Lifecycle date line */}\n {dates ? (\n <div className=\"type-body-sm ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-md)] ds:text-[color:var(--muted-foreground)]\">\n {dates.acceptedIso ? (\n <span className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n <span>{t('carePlanCard.date.accepted', 'Accepted')}</span>\n <Timestamp\n value={dates.acceptedIso}\n format=\"absolute\"\n locale={activeLocale}\n />\n </span>\n ) : null}\n {dates.closedIso ? (\n <span className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n <span>{t('carePlanCard.date.closed', 'Closed')}</span>\n <Timestamp\n value={dates.closedIso}\n format=\"absolute\"\n locale={activeLocale}\n />\n </span>\n ) : null}\n {dates.discardedIso ? (\n <span className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n <span>{t('carePlanCard.date.discarded', 'Discarded')}</span>\n <Timestamp\n value={dates.discardedIso}\n format=\"absolute\"\n locale={activeLocale}\n />\n </span>\n ) : null}\n </div>\n ) : null}\n\n {/* Money: due / overdue / billed chips */}\n {typeof dueCents === 'number' || typeof billedCents === 'number' ? (\n <div className=\"ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]\">\n {typeof dueCents === 'number' && dueCents > 0 ? (\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n <TransactionChip\n state=\"debt\"\n amount={dueCents / 100}\n currency={currency}\n locale={activeLocale}\n showLabel\n size=\"md\"\n />\n {isOverdue ? (\n <Badge variant=\"error\" size=\"sm\" withDot>\n {t('carePlanCard.overdue', {\n count: overdueDays,\n defaultValue: 'Overdue {{count}}d',\n })}\n </Badge>\n ) : null}\n </div>\n ) : null}\n {typeof billedCents === 'number' && billedCents > 0 ? (\n <TransactionChip\n state=\"settled\"\n amount={billedCents / 100}\n currency={currency}\n locale={activeLocale}\n showLabel\n size=\"md\"\n />\n ) : null}\n </div>\n ) : null}\n\n {/* Line / phase progress */}\n {progress && progress.total > 0 ? (\n <Progress\n value={progress.done}\n max={progress.total}\n size=\"sm\"\n aria-label={t('carePlanCard.progressLabel', {\n done: progress.done,\n total: progress.total,\n defaultValue: 'Progress: {{done}} of {{total}} completed',\n })}\n >\n <div className=\"ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]\">\n <Progress.Label id={progressLabelId}>\n {t('carePlanCard.progressHeading', 'Progress')}\n </Progress.Label>\n <span className=\"type-body-sm ds:tabular-nums ds:text-[color:var(--muted-foreground)]\">\n {t('carePlanCard.progressCount', {\n done: progress.done,\n total: progress.total,\n defaultValue: '{{done}} / {{total}}',\n })}\n </span>\n </div>\n </Progress>\n ) : null}\n\n {/* Entries — expandable list of treatment lines */}\n {hasEntries ? (\n <Accordion type=\"single\" collapsible variant=\"separated\">\n <AccordionItem value=\"entries\">\n <AccordionTrigger>\n {t('carePlanCard.entries.toggle', {\n count: entries.length,\n defaultValue: 'Treatment lines ({{count}})',\n })}\n </AccordionTrigger>\n <AccordionContent>\n <ul className=\"ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-0\">\n {entries.map(({ entryId, ...entry }) => (\n <li key={entryId}>\n <CarePlanEntryCard\n id={entryId}\n surface=\"flat\"\n locale={activeLocale}\n currency={currency}\n {...entry}\n />\n </li>\n ))}\n </ul>\n </AccordionContent>\n </AccordionItem>\n </Accordion>\n ) : null}\n </div>\n </div>\n );\n },\n);\n\nCarePlanCard.displayName = 'CarePlanCard';\n\nexport type CarePlanCardSurface = NonNullable<\n VariantProps<typeof entitySurfaceVariants>['surface']\n>;\n\n/** The dentition the plan applies to. */\nexport type CarePlanCardDentition = NonNullable<\n CarePlanCardProps['dentitionMode']\n>;\n\n/* Re-export the shared lifecycle-state type for downstream typing. */\nexport type { CarePlanState } from '../_shared/entity-card';\n"],"names":["carePlanCardAgent","handle","DEFAULT_CURRENCY","STATE_LABEL_FALLBACK","CarePlanCard","forwardRef","id","number","name","state","url","amounts","progress","dates","discardReason","_dentitionMode","entries","locale","currency","surface","onActivate","ariaLabel","className","rest","ref","t","i18n","useTranslation","headingId","useId","progressLabelId","activeLocale","useAgentRegistration","stateLabel","stateBadgeVariant","CARE_PLAN_STATE_BADGE","hasSafeUrl","isSafeEntityUrl","hasEntries","dueCents","billedCents","overdueDays","isOverdue","headingNode","jsx","entitySurfaceVariants","jsxs","Link","event","Badge","Timestamp","TransactionChip","Progress","Accordion","AccordionItem","AccordionTrigger","AccordionContent","entryId","entry","CarePlanEntryCard"],"mappings":";;;;;;;;;;;;;AAYO,MAAMA,IAAsD;AAAA,EACjE,IAAI;AAAA,EACJ,cAAc,CAAC,eAAe,QAAQ;AAAA,EACtC,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,SAAA;AAAA,IAAS;AAAA,IAEpC,UAAU;AAAA,MACR,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACA,MAAWA,EAAO,YAAA;AAAA,IAAY;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AGN;AACF;AAEArD,GAAa,cAAc;"}
@@ -6,7 +6,7 @@ import { P as O } from "./progress-kzIRcdaq.js";
6
6
  import { T as q } from "./tag-CdA0s_VV.js";
7
7
  import { T as b } from "./timestamp-BV2lC-wV.js";
8
8
  import { T as G } from "./transaction-chip-BZCa6XDn.js";
9
- import { f as J } from "./tooth-scheme-CxlsLjfN.js";
9
+ import { T as J } from "./tooth-scheme-CiphQaON.js";
10
10
  import { C as Q, b as X, a as Z } from "./collapsible-X3oaLPU3.js";
11
11
  import { u as ee } from "./registry-nPAVE19X.js";
12
12
  import { C as ae } from "./chevron-down-BX_NP2Yh.js";
@@ -315,4 +315,4 @@ export {
315
315
  le as C,
316
316
  re as c
317
317
  };
318
- //# sourceMappingURL=care-plan-entry-card-Cnra7vUc.js.map
318
+ //# sourceMappingURL=care-plan-entry-card-DW70yBOD.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"care-plan-entry-card-Cnra7vUc.js","sources":["../../src/components/care-plan-entry-card/care-plan-entry-card.agent.ts","../../src/components/care-plan-entry-card/care-plan-entry-card.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — CarePlanEntryCard. */\n/* */\n/* Read-only surface: expose the execution flag and phase-progress */\n/* counts so an agent can introspect a treatment line's status. Counts + */\n/* booleans only — never the treatment name, operator, or any patient */\n/* identity. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { CarePlanEntryCardHandle } from './care-plan-entry-card';\n\nexport const carePlanEntryCardAgent: AgentAdapter<CarePlanEntryCardHandle> = {\n id: 'care-plan-entry-card',\n capabilities: ['view_change'],\n state: {\n done: {\n type: 'boolean',\n descriptionKey: 'ui.agent.carePlanEntryCard.state.done',\n description: 'Whether the treatment line is marked executed.',\n read: (handle) => handle.isDone(),\n },\n phaseProgress: {\n type: '{ executed: number; total: number }',\n descriptionKey: 'ui.agent.carePlanEntryCard.state.phaseProgress',\n description:\n 'Phase progress as executed / total counts. Counts only — never phase labels or operator identity.',\n read: (handle) => handle.getPhaseProgress(),\n },\n },\n actions: {},\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'care-plan-entry-card',\n description: 'Marks the CarePlanEntryCard root region.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop. Addresses a specific line.',\n },\n },\n};\n","import { forwardRef, useId, type HTMLAttributes, type ReactNode } from 'react';\nimport { type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { ChevronDown } from 'lucide-react';\nimport { Badge } from '../badge/badge';\nimport { Progress } from '../progress/progress';\nimport { Tag } from '../tag/tag';\nimport { Timestamp } from '../timestamp/timestamp';\nimport { TransactionChip } from '../transaction-chip/transaction-chip';\nimport { ToothScheme } from '../tooth-scheme/tooth-scheme';\nimport type { FdiId, ToothCondition } from '../tooth-scheme/tooth-data';\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from '../collapsible/collapsible';\nimport { entitySurfaceVariants } from '../_shared/entity-card';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { carePlanEntryCardAgent } from './care-plan-entry-card.agent';\n\n/* -------------------------------------------------------------------- */\n/* CarePlanEntryCard */\n/* */\n/* A single granular treatment line within a care plan / estimate */\n/* (\"voce di preventivo\"). Replaces the hand-rolled platform treatment */\n/* row that interleaves the treatment label, FDI tooth codes, an */\n/* execution badge, a phase-progress bar, a price chip, and an */\n/* expandable per-phase breakdown. */\n/* */\n/* Composes: entitySurfaceVariants (shared card surface) + Tag / ToothScheme*/\n/* (elements) + Badge (lifecycle flags) + Timestamp (execution / planned) */\n/* + Progress (phases) + TransactionChip (price) + Collapsible (per-phase */\n/* detail). */\n/* */\n/* All visible text flows through useTranslation('ui') against the */\n/* `carePlanEntryCard.*` namespace. Identifiers + structural state only */\n/* reach the agent layer — never patient identity. */\n/* -------------------------------------------------------------------- */\n\n/* -------------------------------------------------------------------- */\n/* Public types */\n/* -------------------------------------------------------------------- */\n\n/** A planned (not-yet-executed) appointment the line is scheduled into. */\nexport interface CarePlanEntryPlannedAppointment {\n /** ISO-8601 date / datetime string. */\n dateIso: string;\n /** Stable appointment id (identifier only — never PHI). */\n appointmentId: string;\n /** Optional deep link to the appointment. */\n url?: string;\n}\n\n/** Price breakdown for the line, all amounts in integer cents. */\nexport interface CarePlanEntryPrice {\n /** List price in cents (non-negative). */\n priceCents?: number;\n /** Discounted price in cents (non-negative), when a discount applies. */\n discountedPriceCents?: number;\n /** Discount percentage (0–100), for the discount label. */\n discountPercentage?: number;\n}\n\n/** One row of the per-phase execution breakdown. */\nexport interface CarePlanEntryPhaseDetail {\n /** Short localised phase label (consumer-localised). */\n label: string;\n /** Whether this phase has been executed. */\n executed: boolean;\n /** ISO-8601 execution date, when executed. */\n executionDateIso?: string;\n /** Operator display name for the phase. */\n operator?: string;\n /** Unique Device Identifier / lot string for traceable materials. */\n udi?: string;\n}\n\n/** Phase progress summary + optional drill-down detail. */\nexport interface CarePlanEntryPhases {\n /** Number of executed phases. */\n executed: number;\n /** Total number of phases. */\n total: number;\n /** Optional per-phase breakdown rendered inside the Collapsible. */\n detail?: CarePlanEntryPhaseDetail[];\n}\n\n/** Operator the line is assigned to. */\nexport interface CarePlanEntryOperator {\n /** Operator display name (consumer-localised). */\n name: string;\n}\n\n/** Curated read-only handle exposed to the agent registry. */\nexport interface CarePlanEntryCardHandle {\n /** Whether the line is marked executed. */\n isDone: () => boolean;\n /** Phase progress as `{ executed, total }` — counts only, no PHI. */\n getPhaseProgress: () => { executed: number; total: number };\n}\n\nexport interface CarePlanEntryCardProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'aria-label' | 'title' | 'children'\n> {\n /**\n * Stable instance id — surfaced as `data-component-id` for the agent\n * registry and used to wire up the heading ↔ region relationship.\n */\n id?: string;\n /** Treatment / service name. Rendered as the line heading. */\n careName: string;\n /** Optional treatment code (e.g. tariff code) shown beside the name. */\n code?: string;\n /** Optional secondary label (e.g. category) under the name. */\n label?: string;\n /** FDI tooth codes the line applies to (e.g. `['16', '36']`). */\n elements?: string[];\n /** Whether the line has been executed / completed. */\n done?: boolean;\n /** ISO-8601 execution date — rendered next to the \"done\" badge. */\n executionDateIso?: string;\n /** A planned appointment the line is scheduled into, when not yet done. */\n plannedAppointment?: CarePlanEntryPlannedAppointment;\n /** Operator the line is assigned to. */\n operator?: CarePlanEntryOperator;\n /** Price breakdown (list / discounted). */\n price?: CarePlanEntryPrice;\n /** Phase progress + optional drill-down detail. */\n phases?: CarePlanEntryPhases;\n /** Whether the line has been billed / invoiced. */\n billed?: boolean;\n /** Whether the line falls outside the accepted estimate. */\n outsideOfEstimate?: boolean;\n /** Count of attached notes — rendered as a neutral count badge when > 0. */\n notesCount?: number;\n /**\n * How to render `elements`: `'chips'` (default) lists each FDI code as a\n * Tag; `'scheme'` renders a read-only `ToothScheme` highlighting them.\n */\n toothDisplay?: 'scheme' | 'chips';\n /** BCP 47 locale override for dates / currency. Defaults to i18n.language. */\n locale?: string;\n /** ISO 4217 currency code for the price chip. Defaults to `EUR`. */\n currency?: string;\n /**\n * `elevated` (default) paints the kit card chrome; `flat` drops it for use\n * inside an existing Card / Sheet.\n */\n surface?: 'flat' | 'elevated';\n /** Accessible label override for the line region. */\n 'aria-label'?: string;\n}\n\n/* -------------------------------------------------------------------- */\n/* Helpers */\n/* -------------------------------------------------------------------- */\n\nconst DEFAULT_CURRENCY = 'EUR';\n\n/**\n * Map the FDI element codes to a `ToothScheme` conditions shortcut. Codes\n * outside the FDI vocabulary are dropped (the scheme ignores unknown ids).\n * Every applied tooth is flagged `filled` so the display-mode chart marks\n * them with both colour and pattern — colour-not-alone.\n */\nfunction elementsToConditions(\n elements: string[],\n): Partial<Record<FdiId, ToothCondition[]>> {\n const conditions: Partial<Record<FdiId, ToothCondition[]>> = {};\n for (const code of elements) {\n conditions[code as FdiId] = ['filled'];\n }\n return conditions;\n}\n\n/* -------------------------------------------------------------------- */\n/* Component */\n/* -------------------------------------------------------------------- */\n\nexport const CarePlanEntryCard = forwardRef<\n HTMLDivElement,\n CarePlanEntryCardProps\n>(\n (\n {\n id,\n careName,\n code,\n label,\n elements,\n done = false,\n executionDateIso,\n plannedAppointment,\n operator,\n price,\n phases,\n billed = false,\n outsideOfEstimate = false,\n notesCount,\n toothDisplay = 'chips',\n locale,\n currency = DEFAULT_CURRENCY,\n surface = 'elevated',\n 'aria-label': ariaLabel,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation();\n const headingId = useId();\n const phasesLabelId = useId();\n const detailTriggerId = useId();\n const detailContentId = useId();\n const activeLocale = locale ?? i18n.language ?? 'en';\n\n useAgentRegistration(\n carePlanEntryCardAgent,\n {\n isDone: () => done,\n getPhaseProgress: () => ({\n executed: phases?.executed ?? 0,\n total: phases?.total ?? 0,\n }),\n },\n id,\n );\n\n const hasElements = !!elements && elements.length > 0;\n const hasPhaseDetail = !!phases?.detail && phases.detail.length > 0;\n\n // Price: prefer the discounted amount when present; show the list price\n // struck through beside it. Both are \"to-invoice\" until billed, then\n // settled.\n const priceState = billed ? 'settled' : 'to-invoice';\n const listCents = price?.priceCents;\n const discountedCents = price?.discountedPriceCents;\n const hasDiscount =\n discountedCents !== undefined &&\n listCents !== undefined &&\n discountedCents < listCents;\n const payableCents = discountedCents ?? listCents;\n\n const formatMoney = (cents: number): string =>\n new Intl.NumberFormat(activeLocale, {\n style: 'currency',\n currency,\n }).format(cents / 100);\n\n return (\n <div\n ref={ref}\n role=\"region\"\n aria-label={ariaLabel}\n aria-labelledby={ariaLabel ? undefined : headingId}\n data-component=\"care-plan-entry-card\"\n data-component-id={id}\n data-done={done ? 'true' : 'false'}\n id={id}\n className={entitySurfaceVariants({ surface, className })}\n {...rest}\n >\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\">\n {/* Heading row: name + code + trailing status flags */}\n <div className=\"ds:flex ds:items-start ds:gap-[var(--spacing-sm)]\">\n <div className=\"ds:flex ds:min-w-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-2xs)]\">\n <div className=\"ds:flex ds:flex-wrap ds:items-baseline ds:gap-[var(--spacing-xs)]\">\n <h3\n id={headingId}\n className=\"type-title-item ds:m-0 ds:text-[color:var(--foreground)]\"\n >\n {careName}\n </h3>\n {code ? (\n <span className=\"type-meta ds:text-[color:var(--muted-foreground)] ds:tabular-nums\">\n {code}\n </span>\n ) : null}\n </div>\n {label ? (\n <span className=\"type-body-sm ds:text-[color:var(--muted-foreground)]\">\n {label}\n </span>\n ) : null}\n </div>\n\n <div className=\"ds:flex ds:shrink-0 ds:flex-wrap ds:items-center ds:justify-end ds:gap-[var(--spacing-2xs)]\">\n {done ? (\n <Badge variant=\"success\" size=\"sm\" withDot>\n {t('carePlanEntryCard.flag.done', 'Done')}\n </Badge>\n ) : null}\n {outsideOfEstimate ? (\n <Badge variant=\"warning\" size=\"sm\" withDot>\n {t(\n 'carePlanEntryCard.flag.outsideOfEstimate',\n 'Outside estimate',\n )}\n </Badge>\n ) : null}\n {billed ? (\n <Badge variant=\"neutral\" size=\"sm\">\n {t('carePlanEntryCard.flag.billed', 'Billed')}\n </Badge>\n ) : null}\n {typeof notesCount === 'number' && notesCount > 0 ? (\n <Badge\n variant=\"neutral\"\n size=\"sm\"\n aria-label={t('carePlanEntryCard.notesLabel', {\n count: notesCount,\n defaultValue: '{{count}} notes',\n })}\n >\n {notesCount}\n </Badge>\n ) : null}\n </div>\n </div>\n\n {/* Elements: tooth scheme (display mode) or FDI tag chips */}\n {hasElements ? (\n toothDisplay === 'scheme' ? (\n <ToothScheme\n mode=\"display\"\n conditions={elementsToConditions(elements)}\n ariaLabel={t('carePlanEntryCard.toothSchemeLabel', {\n count: elements.length,\n defaultValue: 'Teeth involved: {{count}}',\n })}\n />\n ) : (\n <div\n role=\"list\"\n aria-label={t(\n 'carePlanEntryCard.elementsLabel',\n 'Teeth involved',\n )}\n className=\"ds:flex ds:flex-wrap ds:gap-[var(--spacing-2xs)]\"\n >\n {elements.map((element) => (\n <div role=\"listitem\" key={element}>\n <Tag label={element} variant=\"info\" size=\"sm\" />\n </div>\n ))}\n </div>\n )\n ) : null}\n\n {/* Schedule / execution line */}\n {done && executionDateIso ? (\n <p className=\"type-body-sm ds:m-0 ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)] ds:text-[color:var(--muted-foreground)]\">\n <span>{t('carePlanEntryCard.executedOn', 'Executed on')}</span>\n <Timestamp\n value={executionDateIso}\n format=\"absolute\"\n locale={activeLocale}\n />\n {operator ? (\n <span>\n {t('carePlanEntryCard.byOperator', {\n operator: operator.name,\n defaultValue: 'by {{operator}}',\n })}\n </span>\n ) : null}\n </p>\n ) : plannedAppointment ? (\n <p className=\"type-body-sm ds:m-0 ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)] ds:text-[color:var(--muted-foreground)]\">\n <span>{t('carePlanEntryCard.plannedFor', 'Planned for')}</span>\n <Timestamp\n value={plannedAppointment.dateIso}\n format=\"absolute\"\n locale={activeLocale}\n />\n {operator ? (\n <span>\n {t('carePlanEntryCard.byOperator', {\n operator: operator.name,\n defaultValue: 'by {{operator}}',\n })}\n </span>\n ) : null}\n </p>\n ) : operator ? (\n <p className=\"type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]\">\n {t('carePlanEntryCard.assignedTo', {\n operator: operator.name,\n defaultValue: 'Assigned to {{operator}}',\n })}\n </p>\n ) : null}\n\n {/* Phase progress */}\n {phases && phases.total > 0 ? (\n <Progress\n value={phases.executed}\n max={phases.total}\n size=\"sm\"\n aria-label={t('carePlanEntryCard.phasesLabel', {\n executed: phases.executed,\n total: phases.total,\n defaultValue: 'Phases: {{executed}} of {{total}} executed',\n })}\n >\n <div className=\"ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]\">\n <Progress.Label id={phasesLabelId}>\n {t('carePlanEntryCard.phasesHeading', 'Phases')}\n </Progress.Label>\n <span className=\"type-body-sm ds:tabular-nums ds:text-[color:var(--muted-foreground)]\">\n {t('carePlanEntryCard.phasesCount', {\n executed: phases.executed,\n total: phases.total,\n defaultValue: '{{executed}} / {{total}}',\n })}\n </span>\n </div>\n </Progress>\n ) : null}\n\n {/* Footer: price + (optional) phase-detail disclosure */}\n {payableCents !== undefined || hasPhaseDetail ? (\n <div className=\"ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]\">\n {payableCents !== undefined ? (\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n <TransactionChip\n state={priceState}\n amount={payableCents / 100}\n currency={currency}\n locale={activeLocale}\n size=\"md\"\n />\n {hasDiscount && listCents !== undefined ? (\n <span className=\"type-meta ds:text-[color:var(--muted-foreground)] ds:line-through ds:tabular-nums\">\n {formatMoney(listCents)}\n </span>\n ) : null}\n {hasDiscount && price?.discountPercentage !== undefined ? (\n <Badge variant=\"success\" size=\"sm\">\n {t('carePlanEntryCard.discountLabel', {\n percentage: price.discountPercentage,\n defaultValue: '-{{percentage}}%',\n })}\n </Badge>\n ) : null}\n </div>\n ) : null}\n\n {hasPhaseDetail ? (\n <Collapsible\n variant=\"default\"\n className=\"ds:ms-auto ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\"\n >\n <CollapsibleTrigger asChild>\n <button\n type=\"button\"\n id={detailTriggerId}\n aria-controls={detailContentId}\n className=\"ds:group ds:inline-flex ds:items-center ds:gap-[var(--spacing-2xs)] ds:rounded-[var(--radius-sm)] ds:border-0 ds:bg-transparent type-body-sm ds:text-[color:var(--foreground)] ds:cursor-pointer ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]\"\n >\n <span>\n {t(\n 'carePlanEntryCard.phaseDetail.toggle',\n 'Phase detail',\n )}\n </span>\n <ChevronDown\n aria-hidden=\"true\"\n className=\"ds:size-4 ds:shrink-0 ds:text-[color:var(--muted-foreground)] ds:transition-transform ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none ds:group-data-[state=open]:rotate-180\"\n />\n </button>\n </CollapsibleTrigger>\n <CollapsibleContent\n id={detailContentId}\n aria-labelledby={detailTriggerId}\n >\n <ul className=\"ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-xs)] ds:p-0\">\n {phases?.detail?.map((phase, index) => (\n <PhaseDetailRow\n key={`${phase.label}-${index}`}\n phase={phase}\n locale={activeLocale}\n />\n ))}\n </ul>\n </CollapsibleContent>\n </Collapsible>\n ) : null}\n </div>\n ) : null}\n </div>\n </div>\n );\n },\n);\n\nCarePlanEntryCard.displayName = 'CarePlanEntryCard';\n\n/* -------------------------------------------------------------------- */\n/* PhaseDetailRow — one row inside the per-phase Collapsible */\n/* -------------------------------------------------------------------- */\n\nfunction PhaseDetailRow({\n phase,\n locale,\n}: {\n phase: CarePlanEntryPhaseDetail;\n locale: string;\n}): ReactNode {\n const { t } = useTranslation();\n return (\n <li className=\"ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]\">\n <Badge variant={phase.executed ? 'success' : 'neutral'} size=\"sm\" withDot>\n {phase.executed\n ? t('carePlanEntryCard.phaseDetail.executed', 'Executed')\n : t('carePlanEntryCard.phaseDetail.pending', 'Pending')}\n </Badge>\n <span className=\"type-body-sm ds:text-[color:var(--foreground)]\">\n {phase.label}\n </span>\n {phase.executed && phase.executionDateIso ? (\n <Timestamp\n value={phase.executionDateIso}\n format=\"absolute\"\n locale={locale}\n />\n ) : null}\n {phase.operator ? (\n <span className=\"type-meta ds:text-[color:var(--muted-foreground)]\">\n {t('carePlanEntryCard.byOperator', {\n operator: phase.operator,\n defaultValue: 'by {{operator}}',\n })}\n </span>\n ) : null}\n {phase.udi ? (\n <span className=\"type-meta ds:text-[color:var(--muted-foreground)] ds:tabular-nums\">\n {t('carePlanEntryCard.phaseDetail.udi', {\n udi: phase.udi,\n defaultValue: 'UDI {{udi}}',\n })}\n </span>\n ) : null}\n </li>\n );\n}\n\nexport type CarePlanEntryCardSurface = NonNullable<\n VariantProps<typeof entitySurfaceVariants>['surface']\n>;\n"],"names":["carePlanEntryCardAgent","handle","DEFAULT_CURRENCY","elementsToConditions","elements","conditions","code","CarePlanEntryCard","forwardRef","id","careName","label","done","executionDateIso","plannedAppointment","operator","price","phases","billed","outsideOfEstimate","notesCount","toothDisplay","locale","currency","surface","ariaLabel","className","rest","ref","t","i18n","useTranslation","headingId","useId","phasesLabelId","detailTriggerId","detailContentId","activeLocale","useAgentRegistration","hasElements","hasPhaseDetail","priceState","listCents","discountedCents","hasDiscount","payableCents","formatMoney","cents","jsx","entitySurfaceVariants","jsxs","Badge","ToothScheme","element","Tag","Timestamp","Progress","TransactionChip","Collapsible","CollapsibleTrigger","ChevronDown","CollapsibleContent","phase","index","PhaseDetailRow"],"mappings":";;;;;;;;;;;;;AAYO,MAAMA,KAAgE;AAAA,EAC3E,IAAI;AAAA,EACJ,cAAc,CAAC,aAAa;AAAA,EAC5B,OAAO;AAAA,IACL,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACC,MAAWA,EAAO,OAAA;AAAA,IAAO;AAAA,IAElC,eAAe;AAAA,MACb,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACA,MAAWA,EAAO,iBAAA;AAAA,IAAiB;AAAA,EAC5C;AAAA,EAEF,SAAS,CAAA;AAAA,EACT,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,IAAA;AAAA,IAEf,YAAY;AAAA,MACV,MAAM;AAAA,MACN,YAAY;AAAA,MACZ,aAAa;AAAA,IAAA;AAAA,EACf;AAEJ,GCmHMC,KAAmB;AAQzB,SAASC,GACPC,GAC0C;AAC1C,QAAMC,IAAuD,CAAA;AAC7D,aAAWC,KAAQF;AACjB,IAAAC,EAAWC,CAAa,IAAI,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;AAAA,QACb,QAAO;AAAA,QACP,QAAAxC;AAAA,MAAA;AAAA,IAAA,IAEA;AAAA,IACHwC,EAAM,WACL,gBAAAd,EAAC,UAAK,WAAU,qDACb,YAAE,gCAAgC;AAAA,MACjC,UAAUc,EAAM;AAAA,MAChB,cAAc;AAAA,IAAA,CACf,GACH,IACE;AAAA,IACHA,EAAM,MACL,gBAAAd,EAAC,UAAK,WAAU,qEACb,YAAE,qCAAqC;AAAA,MACtC,KAAKc,EAAM;AAAA,MACX,cAAc;AAAA,IAAA,CACf,GACH,IACE;AAAA,EAAA,GACN;AAEJ;"}
1
+ {"version":3,"file":"care-plan-entry-card-DW70yBOD.js","sources":["../../src/components/care-plan-entry-card/care-plan-entry-card.agent.ts","../../src/components/care-plan-entry-card/care-plan-entry-card.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — CarePlanEntryCard. */\n/* */\n/* Read-only surface: expose the execution flag and phase-progress */\n/* counts so an agent can introspect a treatment line's status. Counts + */\n/* booleans only — never the treatment name, operator, or any patient */\n/* identity. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { CarePlanEntryCardHandle } from './care-plan-entry-card';\n\nexport const carePlanEntryCardAgent: AgentAdapter<CarePlanEntryCardHandle> = {\n id: 'care-plan-entry-card',\n capabilities: ['view_change'],\n state: {\n done: {\n type: 'boolean',\n descriptionKey: 'ui.agent.carePlanEntryCard.state.done',\n description: 'Whether the treatment line is marked executed.',\n read: (handle) => handle.isDone(),\n },\n phaseProgress: {\n type: '{ executed: number; total: number }',\n descriptionKey: 'ui.agent.carePlanEntryCard.state.phaseProgress',\n description:\n 'Phase progress as executed / total counts. Counts only — never phase labels or operator identity.',\n read: (handle) => handle.getPhaseProgress(),\n },\n },\n actions: {},\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'care-plan-entry-card',\n description: 'Marks the CarePlanEntryCard root region.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop. Addresses a specific line.',\n },\n },\n};\n","import { forwardRef, useId, type HTMLAttributes, type ReactNode } from 'react';\nimport { type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { ChevronDown } from 'lucide-react';\nimport { Badge } from '../badge/badge';\nimport { Progress } from '../progress/progress';\nimport { Tag } from '../tag/tag';\nimport { Timestamp } from '../timestamp/timestamp';\nimport { TransactionChip } from '../transaction-chip/transaction-chip';\nimport { ToothScheme } from '../tooth-scheme/tooth-scheme';\nimport type { FdiId, ToothCondition } from '../tooth-scheme/tooth-data';\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from '../collapsible/collapsible';\nimport { entitySurfaceVariants } from '../_shared/entity-card';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { carePlanEntryCardAgent } from './care-plan-entry-card.agent';\n\n/* -------------------------------------------------------------------- */\n/* CarePlanEntryCard */\n/* */\n/* A single granular treatment line within a care plan / estimate */\n/* (\"voce di preventivo\"). Replaces the hand-rolled platform treatment */\n/* row that interleaves the treatment label, FDI tooth codes, an */\n/* execution badge, a phase-progress bar, a price chip, and an */\n/* expandable per-phase breakdown. */\n/* */\n/* Composes: entitySurfaceVariants (shared card surface) + Tag / ToothScheme*/\n/* (elements) + Badge (lifecycle flags) + Timestamp (execution / planned) */\n/* + Progress (phases) + TransactionChip (price) + Collapsible (per-phase */\n/* detail). */\n/* */\n/* All visible text flows through useTranslation('ui') against the */\n/* `carePlanEntryCard.*` namespace. Identifiers + structural state only */\n/* reach the agent layer — never patient identity. */\n/* -------------------------------------------------------------------- */\n\n/* -------------------------------------------------------------------- */\n/* Public types */\n/* -------------------------------------------------------------------- */\n\n/** A planned (not-yet-executed) appointment the line is scheduled into. */\nexport interface CarePlanEntryPlannedAppointment {\n /** ISO-8601 date / datetime string. */\n dateIso: string;\n /** Stable appointment id (identifier only — never PHI). */\n appointmentId: string;\n /** Optional deep link to the appointment. */\n url?: string;\n}\n\n/** Price breakdown for the line, all amounts in integer cents. */\nexport interface CarePlanEntryPrice {\n /** List price in cents (non-negative). */\n priceCents?: number;\n /** Discounted price in cents (non-negative), when a discount applies. */\n discountedPriceCents?: number;\n /** Discount percentage (0–100), for the discount label. */\n discountPercentage?: number;\n}\n\n/** One row of the per-phase execution breakdown. */\nexport interface CarePlanEntryPhaseDetail {\n /** Short localised phase label (consumer-localised). */\n label: string;\n /** Whether this phase has been executed. */\n executed: boolean;\n /** ISO-8601 execution date, when executed. */\n executionDateIso?: string;\n /** Operator display name for the phase. */\n operator?: string;\n /** Unique Device Identifier / lot string for traceable materials. */\n udi?: string;\n}\n\n/** Phase progress summary + optional drill-down detail. */\nexport interface CarePlanEntryPhases {\n /** Number of executed phases. */\n executed: number;\n /** Total number of phases. */\n total: number;\n /** Optional per-phase breakdown rendered inside the Collapsible. */\n detail?: CarePlanEntryPhaseDetail[];\n}\n\n/** Operator the line is assigned to. */\nexport interface CarePlanEntryOperator {\n /** Operator display name (consumer-localised). */\n name: string;\n}\n\n/** Curated read-only handle exposed to the agent registry. */\nexport interface CarePlanEntryCardHandle {\n /** Whether the line is marked executed. */\n isDone: () => boolean;\n /** Phase progress as `{ executed, total }` — counts only, no PHI. */\n getPhaseProgress: () => { executed: number; total: number };\n}\n\nexport interface CarePlanEntryCardProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'aria-label' | 'title' | 'children'\n> {\n /**\n * Stable instance id — surfaced as `data-component-id` for the agent\n * registry and used to wire up the heading ↔ region relationship.\n */\n id?: string;\n /** Treatment / service name. Rendered as the line heading. */\n careName: string;\n /** Optional treatment code (e.g. tariff code) shown beside the name. */\n code?: string;\n /** Optional secondary label (e.g. category) under the name. */\n label?: string;\n /** FDI tooth codes the line applies to (e.g. `['16', '36']`). */\n elements?: string[];\n /** Whether the line has been executed / completed. */\n done?: boolean;\n /** ISO-8601 execution date — rendered next to the \"done\" badge. */\n executionDateIso?: string;\n /** A planned appointment the line is scheduled into, when not yet done. */\n plannedAppointment?: CarePlanEntryPlannedAppointment;\n /** Operator the line is assigned to. */\n operator?: CarePlanEntryOperator;\n /** Price breakdown (list / discounted). */\n price?: CarePlanEntryPrice;\n /** Phase progress + optional drill-down detail. */\n phases?: CarePlanEntryPhases;\n /** Whether the line has been billed / invoiced. */\n billed?: boolean;\n /** Whether the line falls outside the accepted estimate. */\n outsideOfEstimate?: boolean;\n /** Count of attached notes — rendered as a neutral count badge when > 0. */\n notesCount?: number;\n /**\n * How to render `elements`: `'chips'` (default) lists each FDI code as a\n * Tag; `'scheme'` renders a read-only `ToothScheme` highlighting them.\n */\n toothDisplay?: 'scheme' | 'chips';\n /** BCP 47 locale override for dates / currency. Defaults to i18n.language. */\n locale?: string;\n /** ISO 4217 currency code for the price chip. Defaults to `EUR`. */\n currency?: string;\n /**\n * `elevated` (default) paints the kit card chrome; `flat` drops it for use\n * inside an existing Card / Sheet.\n */\n surface?: 'flat' | 'elevated';\n /** Accessible label override for the line region. */\n 'aria-label'?: string;\n}\n\n/* -------------------------------------------------------------------- */\n/* Helpers */\n/* -------------------------------------------------------------------- */\n\nconst DEFAULT_CURRENCY = 'EUR';\n\n/**\n * Map the FDI element codes to a `ToothScheme` conditions shortcut. Codes\n * outside the FDI vocabulary are dropped (the scheme ignores unknown ids).\n * Every applied tooth is flagged `filled` so the display-mode chart marks\n * them with both colour and pattern — colour-not-alone.\n */\nfunction elementsToConditions(\n elements: string[],\n): Partial<Record<FdiId, ToothCondition[]>> {\n const conditions: Partial<Record<FdiId, ToothCondition[]>> = {};\n for (const code of elements) {\n conditions[code as FdiId] = ['filled'];\n }\n return conditions;\n}\n\n/* -------------------------------------------------------------------- */\n/* Component */\n/* -------------------------------------------------------------------- */\n\nexport const CarePlanEntryCard = forwardRef<\n HTMLDivElement,\n CarePlanEntryCardProps\n>(\n (\n {\n id,\n careName,\n code,\n label,\n elements,\n done = false,\n executionDateIso,\n plannedAppointment,\n operator,\n price,\n phases,\n billed = false,\n outsideOfEstimate = false,\n notesCount,\n toothDisplay = 'chips',\n locale,\n currency = DEFAULT_CURRENCY,\n surface = 'elevated',\n 'aria-label': ariaLabel,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation();\n const headingId = useId();\n const phasesLabelId = useId();\n const detailTriggerId = useId();\n const detailContentId = useId();\n const activeLocale = locale ?? i18n.language ?? 'en';\n\n useAgentRegistration(\n carePlanEntryCardAgent,\n {\n isDone: () => done,\n getPhaseProgress: () => ({\n executed: phases?.executed ?? 0,\n total: phases?.total ?? 0,\n }),\n },\n id,\n );\n\n const hasElements = !!elements && elements.length > 0;\n const hasPhaseDetail = !!phases?.detail && phases.detail.length > 0;\n\n // Price: prefer the discounted amount when present; show the list price\n // struck through beside it. Both are \"to-invoice\" until billed, then\n // settled.\n const priceState = billed ? 'settled' : 'to-invoice';\n const listCents = price?.priceCents;\n const discountedCents = price?.discountedPriceCents;\n const hasDiscount =\n discountedCents !== undefined &&\n listCents !== undefined &&\n discountedCents < listCents;\n const payableCents = discountedCents ?? listCents;\n\n const formatMoney = (cents: number): string =>\n new Intl.NumberFormat(activeLocale, {\n style: 'currency',\n currency,\n }).format(cents / 100);\n\n return (\n <div\n ref={ref}\n role=\"region\"\n aria-label={ariaLabel}\n aria-labelledby={ariaLabel ? undefined : headingId}\n data-component=\"care-plan-entry-card\"\n data-component-id={id}\n data-done={done ? 'true' : 'false'}\n id={id}\n className={entitySurfaceVariants({ surface, className })}\n {...rest}\n >\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\">\n {/* Heading row: name + code + trailing status flags */}\n <div className=\"ds:flex ds:items-start ds:gap-[var(--spacing-sm)]\">\n <div className=\"ds:flex ds:min-w-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-2xs)]\">\n <div className=\"ds:flex ds:flex-wrap ds:items-baseline ds:gap-[var(--spacing-xs)]\">\n <h3\n id={headingId}\n className=\"type-title-item ds:m-0 ds:text-[color:var(--foreground)]\"\n >\n {careName}\n </h3>\n {code ? (\n <span className=\"type-meta ds:text-[color:var(--muted-foreground)] ds:tabular-nums\">\n {code}\n </span>\n ) : null}\n </div>\n {label ? (\n <span className=\"type-body-sm ds:text-[color:var(--muted-foreground)]\">\n {label}\n </span>\n ) : null}\n </div>\n\n <div className=\"ds:flex ds:shrink-0 ds:flex-wrap ds:items-center ds:justify-end ds:gap-[var(--spacing-2xs)]\">\n {done ? (\n <Badge variant=\"success\" size=\"sm\" withDot>\n {t('carePlanEntryCard.flag.done', 'Done')}\n </Badge>\n ) : null}\n {outsideOfEstimate ? (\n <Badge variant=\"warning\" size=\"sm\" withDot>\n {t(\n 'carePlanEntryCard.flag.outsideOfEstimate',\n 'Outside estimate',\n )}\n </Badge>\n ) : null}\n {billed ? (\n <Badge variant=\"neutral\" size=\"sm\">\n {t('carePlanEntryCard.flag.billed', 'Billed')}\n </Badge>\n ) : null}\n {typeof notesCount === 'number' && notesCount > 0 ? (\n <Badge\n variant=\"neutral\"\n size=\"sm\"\n aria-label={t('carePlanEntryCard.notesLabel', {\n count: notesCount,\n defaultValue: '{{count}} notes',\n })}\n >\n {notesCount}\n </Badge>\n ) : null}\n </div>\n </div>\n\n {/* Elements: tooth scheme (display mode) or FDI tag chips */}\n {hasElements ? (\n toothDisplay === 'scheme' ? (\n <ToothScheme\n mode=\"display\"\n conditions={elementsToConditions(elements)}\n ariaLabel={t('carePlanEntryCard.toothSchemeLabel', {\n count: elements.length,\n defaultValue: 'Teeth involved: {{count}}',\n })}\n />\n ) : (\n <div\n role=\"list\"\n aria-label={t(\n 'carePlanEntryCard.elementsLabel',\n 'Teeth involved',\n )}\n className=\"ds:flex ds:flex-wrap ds:gap-[var(--spacing-2xs)]\"\n >\n {elements.map((element) => (\n <div role=\"listitem\" key={element}>\n <Tag label={element} variant=\"info\" size=\"sm\" />\n </div>\n ))}\n </div>\n )\n ) : null}\n\n {/* Schedule / execution line */}\n {done && executionDateIso ? (\n <p className=\"type-body-sm ds:m-0 ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)] ds:text-[color:var(--muted-foreground)]\">\n <span>{t('carePlanEntryCard.executedOn', 'Executed on')}</span>\n <Timestamp\n value={executionDateIso}\n format=\"absolute\"\n locale={activeLocale}\n />\n {operator ? (\n <span>\n {t('carePlanEntryCard.byOperator', {\n operator: operator.name,\n defaultValue: 'by {{operator}}',\n })}\n </span>\n ) : null}\n </p>\n ) : plannedAppointment ? (\n <p className=\"type-body-sm ds:m-0 ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)] ds:text-[color:var(--muted-foreground)]\">\n <span>{t('carePlanEntryCard.plannedFor', 'Planned for')}</span>\n <Timestamp\n value={plannedAppointment.dateIso}\n format=\"absolute\"\n locale={activeLocale}\n />\n {operator ? (\n <span>\n {t('carePlanEntryCard.byOperator', {\n operator: operator.name,\n defaultValue: 'by {{operator}}',\n })}\n </span>\n ) : null}\n </p>\n ) : operator ? (\n <p className=\"type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]\">\n {t('carePlanEntryCard.assignedTo', {\n operator: operator.name,\n defaultValue: 'Assigned to {{operator}}',\n })}\n </p>\n ) : null}\n\n {/* Phase progress */}\n {phases && phases.total > 0 ? (\n <Progress\n value={phases.executed}\n max={phases.total}\n size=\"sm\"\n aria-label={t('carePlanEntryCard.phasesLabel', {\n executed: phases.executed,\n total: phases.total,\n defaultValue: 'Phases: {{executed}} of {{total}} executed',\n })}\n >\n <div className=\"ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]\">\n <Progress.Label id={phasesLabelId}>\n {t('carePlanEntryCard.phasesHeading', 'Phases')}\n </Progress.Label>\n <span className=\"type-body-sm ds:tabular-nums ds:text-[color:var(--muted-foreground)]\">\n {t('carePlanEntryCard.phasesCount', {\n executed: phases.executed,\n total: phases.total,\n defaultValue: '{{executed}} / {{total}}',\n })}\n </span>\n </div>\n </Progress>\n ) : null}\n\n {/* Footer: price + (optional) phase-detail disclosure */}\n {payableCents !== undefined || hasPhaseDetail ? (\n <div className=\"ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]\">\n {payableCents !== undefined ? (\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n <TransactionChip\n state={priceState}\n amount={payableCents / 100}\n currency={currency}\n locale={activeLocale}\n size=\"md\"\n />\n {hasDiscount && listCents !== undefined ? (\n <span className=\"type-meta ds:text-[color:var(--muted-foreground)] ds:line-through ds:tabular-nums\">\n {formatMoney(listCents)}\n </span>\n ) : null}\n {hasDiscount && price?.discountPercentage !== undefined ? (\n <Badge variant=\"success\" size=\"sm\">\n {t('carePlanEntryCard.discountLabel', {\n percentage: price.discountPercentage,\n defaultValue: '-{{percentage}}%',\n })}\n </Badge>\n ) : null}\n </div>\n ) : null}\n\n {hasPhaseDetail ? (\n <Collapsible\n variant=\"default\"\n className=\"ds:ms-auto ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\"\n >\n <CollapsibleTrigger asChild>\n <button\n type=\"button\"\n id={detailTriggerId}\n aria-controls={detailContentId}\n className=\"ds:group ds:inline-flex ds:items-center ds:gap-[var(--spacing-2xs)] ds:rounded-[var(--radius-sm)] ds:border-0 ds:bg-transparent type-body-sm ds:text-[color:var(--foreground)] ds:cursor-pointer ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]\"\n >\n <span>\n {t(\n 'carePlanEntryCard.phaseDetail.toggle',\n 'Phase detail',\n )}\n </span>\n <ChevronDown\n aria-hidden=\"true\"\n className=\"ds:size-4 ds:shrink-0 ds:text-[color:var(--muted-foreground)] ds:transition-transform ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none ds:group-data-[state=open]:rotate-180\"\n />\n </button>\n </CollapsibleTrigger>\n <CollapsibleContent\n id={detailContentId}\n aria-labelledby={detailTriggerId}\n >\n <ul className=\"ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-xs)] ds:p-0\">\n {phases?.detail?.map((phase, index) => (\n <PhaseDetailRow\n key={`${phase.label}-${index}`}\n phase={phase}\n locale={activeLocale}\n />\n ))}\n </ul>\n </CollapsibleContent>\n </Collapsible>\n ) : null}\n </div>\n ) : null}\n </div>\n </div>\n );\n },\n);\n\nCarePlanEntryCard.displayName = 'CarePlanEntryCard';\n\n/* -------------------------------------------------------------------- */\n/* PhaseDetailRow — one row inside the per-phase Collapsible */\n/* -------------------------------------------------------------------- */\n\nfunction PhaseDetailRow({\n phase,\n locale,\n}: {\n phase: CarePlanEntryPhaseDetail;\n locale: string;\n}): ReactNode {\n const { t } = useTranslation();\n return (\n <li className=\"ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]\">\n <Badge variant={phase.executed ? 'success' : 'neutral'} size=\"sm\" withDot>\n {phase.executed\n ? t('carePlanEntryCard.phaseDetail.executed', 'Executed')\n : t('carePlanEntryCard.phaseDetail.pending', 'Pending')}\n </Badge>\n <span className=\"type-body-sm ds:text-[color:var(--foreground)]\">\n {phase.label}\n </span>\n {phase.executed && phase.executionDateIso ? (\n <Timestamp\n value={phase.executionDateIso}\n format=\"absolute\"\n locale={locale}\n />\n ) : null}\n {phase.operator ? (\n <span className=\"type-meta ds:text-[color:var(--muted-foreground)]\">\n {t('carePlanEntryCard.byOperator', {\n operator: phase.operator,\n defaultValue: 'by {{operator}}',\n })}\n </span>\n ) : null}\n {phase.udi ? (\n <span className=\"type-meta ds:text-[color:var(--muted-foreground)] ds:tabular-nums\">\n {t('carePlanEntryCard.phaseDetail.udi', {\n udi: phase.udi,\n defaultValue: 'UDI {{udi}}',\n })}\n </span>\n ) : null}\n </li>\n );\n}\n\nexport type CarePlanEntryCardSurface = NonNullable<\n VariantProps<typeof entitySurfaceVariants>['surface']\n>;\n"],"names":["carePlanEntryCardAgent","handle","DEFAULT_CURRENCY","elementsToConditions","elements","conditions","code","CarePlanEntryCard","forwardRef","id","careName","label","done","executionDateIso","plannedAppointment","operator","price","phases","billed","outsideOfEstimate","notesCount","toothDisplay","locale","currency","surface","ariaLabel","className","rest","ref","t","i18n","useTranslation","headingId","useId","phasesLabelId","detailTriggerId","detailContentId","activeLocale","useAgentRegistration","hasElements","hasPhaseDetail","priceState","listCents","discountedCents","hasDiscount","payableCents","formatMoney","cents","jsx","entitySurfaceVariants","jsxs","Badge","ToothScheme","element","Tag","Timestamp","Progress","TransactionChip","Collapsible","CollapsibleTrigger","ChevronDown","CollapsibleContent","phase","index","PhaseDetailRow"],"mappings":";;;;;;;;;;;;;AAYO,MAAMA,KAAgE;AAAA,EAC3E,IAAI;AAAA,EACJ,cAAc,CAAC,aAAa;AAAA,EAC5B,OAAO;AAAA,IACL,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACC,MAAWA,EAAO,OAAA;AAAA,IAAO;AAAA,IAElC,eAAe;AAAA,MACb,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACA,MAAWA,EAAO,iBAAA;AAAA,IAAiB;AAAA,EAC5C;AAAA,EAEF,SAAS,CAAA;AAAA,EACT,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,IAAA;AAAA,IAEf,YAAY;AAAA,MACV,MAAM;AAAA,MACN,YAAY;AAAA,MACZ,aAAa;AAAA,IAAA;AAAA,EACf;AAEJ,GCmHMC,KAAmB;AAQzB,SAASC,GACPC,GAC0C;AAC1C,QAAMC,IAAuD,CAAA;AAC7D,aAAWC,KAAQF;AACjB,IAAAC,EAAWC,CAAa,IAAI,CAAC,QAAQ;AAEvC,SAAOD;AACT;AAMO,MAAME,KAAoBC;AAAA,EAI/B,CACE;AAAA,IACE,IAAAC;AAAA,IACA,UAAAC;AAAA,IACA,MAAAJ;AAAA,IACA,OAAAK;AAAA,IACA,UAAAP;AAAA,IACA,MAA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AAc;AAAA,IAAA,CACf,GACH,IACE;AAAA,IACHA,EAAM,MACL,gBAAAd,EAAC,UAAK,WAAU,qEACb,YAAE,qCAAqC;AAAA,MACtC,KAAKc,EAAM;AAAA,MACX,cAAc;AAAA,IAAA,CACf,GACH,IACE;AAAA,EAAA,GACN;AAEJ;"}
@@ -23,7 +23,7 @@ import { F as ke } from "./file-text-DSNuv2B8.js";
23
23
  import { D as ne } from "./download-CDF1sbL9.js";
24
24
  import { F as Et } from "./file-spreadsheet-zUkY8rJ2.js";
25
25
  import It from "i18next";
26
- import { S as Ee } from "./select-hsCaJSX3.js";
26
+ import { S as Ee } from "./select-CEtRcon5.js";
27
27
  import { u as zt } from "./use-prefers-reduced-motion-BMwIQRjB.js";
28
28
  import { u as At } from "./use-theme-CAuo6EYT.js";
29
29
  import { u as Pt } from "./registry-nPAVE19X.js";
@@ -2322,4 +2322,4 @@ export {
2322
2322
  Be as q,
2323
2323
  Cn as u
2324
2324
  };
2325
- //# sourceMappingURL=editable-currency-cell-renderer-D5C5tCfu.js.map
2325
+ //# sourceMappingURL=editable-currency-cell-renderer-BQgaKFCz.js.map