@alfadocs/ui-kit-debug 1.10.1 → 1.12.4
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/{actions-cell-renderer-xfSYiTXQ.js → actions-cell-renderer-BCEjn3-f.js} +2 -2
- package/dist/_chunks/{actions-cell-renderer-xfSYiTXQ.js.map → actions-cell-renderer-BCEjn3-f.js.map} +1 -1
- package/dist/_chunks/{anamnesis-summary-rows-d44s_whc.js → anamnesis-summary-rows-BfhxWPO3.js} +1421 -1418
- package/dist/_chunks/anamnesis-summary-rows-BfhxWPO3.js.map +1 -0
- package/dist/_chunks/appointment-card-Dzr3GeVz.js.map +1 -1
- package/dist/_chunks/appointment-timeline-DCn0Jx55.js +403 -0
- package/dist/_chunks/appointment-timeline-DCn0Jx55.js.map +1 -0
- package/dist/_chunks/{balance-badge-cell-C_Qz76x7.js → balance-badge-cell-BrlikHfT.js} +317 -290
- package/dist/_chunks/balance-badge-cell-BrlikHfT.js.map +1 -0
- package/dist/_chunks/booking-CBHKdsZl.js +2906 -0
- package/dist/_chunks/booking-CBHKdsZl.js.map +1 -0
- package/dist/_chunks/{chart-Bkr1Sh4o.js → chart-C6eHTxkO.js} +2 -2
- package/dist/_chunks/{chart-Bkr1Sh4o.js.map → chart-C6eHTxkO.js.map} +1 -1
- package/dist/_chunks/{contact-profile-card-CE9OJKcl.js → contact-profile-card-BMIBr5s9.js} +104 -125
- package/dist/_chunks/contact-profile-card-BMIBr5s9.js.map +1 -0
- package/dist/_chunks/{control-room-rail-Cj2iX9h_.js → control-room-rail-iO_BCaq1.js} +2 -2
- package/dist/_chunks/{control-room-rail-Cj2iX9h_.js.map → control-room-rail-iO_BCaq1.js.map} +1 -1
- package/dist/_chunks/{editable-currency-cell-renderer-zLf_bXvL.js → editable-currency-cell-renderer-B7TVZ5ZJ.js} +2 -2
- package/dist/_chunks/{editable-currency-cell-renderer-zLf_bXvL.js.map → editable-currency-cell-renderer-B7TVZ5ZJ.js.map} +1 -1
- package/dist/_chunks/{face-scheme-BfDi4YkW.js → face-scheme-CZaKm6fG.js} +2 -2
- package/dist/_chunks/{face-scheme-BfDi4YkW.js.map → face-scheme-CZaKm6fG.js.map} +1 -1
- package/dist/_chunks/{file-manager-Df6hyUYg.js → file-manager-Moc7sUFj.js} +3 -3
- package/dist/_chunks/{file-manager-Df6hyUYg.js.map → file-manager-Moc7sUFj.js.map} +1 -1
- package/dist/_chunks/format-price-DNqXPa_q.js +61 -0
- package/dist/_chunks/format-price-DNqXPa_q.js.map +1 -0
- package/dist/_chunks/{header-settings-CVC_davE.js → header-settings-J-ZCAfir.js} +2 -2
- package/dist/_chunks/{header-settings-CVC_davE.js.map → header-settings-J-ZCAfir.js.map} +1 -1
- package/dist/_chunks/{icon-button-group-D6SVMteH.js → icon-button-group-VCCod3Hz.js} +154 -145
- package/dist/_chunks/icon-button-group-VCCod3Hz.js.map +1 -0
- package/dist/_chunks/{link-cell-renderer-Cp2MSlJl.js → link-cell-renderer-CenJx-_7.js} +197 -181
- package/dist/_chunks/link-cell-renderer-CenJx-_7.js.map +1 -0
- package/dist/_chunks/{marketplace-app-shell-Chfdia7m.js → marketplace-app-shell-DDQXQ8hX.js} +2 -2
- package/dist/_chunks/{marketplace-app-shell-Chfdia7m.js.map → marketplace-app-shell-DDQXQ8hX.js.map} +1 -1
- package/dist/_chunks/{notes-panel-e9cJWVRg.js → notes-panel-CymneXtl.js} +93 -91
- package/dist/_chunks/notes-panel-CymneXtl.js.map +1 -0
- package/dist/_chunks/{practice-results-BEsAdW-B.js → practice-results-D7ygCj_W.js} +333 -291
- package/dist/_chunks/practice-results-D7ygCj_W.js.map +1 -0
- package/dist/_chunks/{signature-request-CW30B77U.js → signature-request-DVDTKLjM.js} +2 -2
- package/dist/_chunks/{signature-request-CW30B77U.js.map → signature-request-DVDTKLjM.js.map} +1 -1
- package/dist/_chunks/{stepper-accordion-BeVMZPuG.js → stepper-accordion-DmVykr5F.js} +91 -88
- package/dist/_chunks/stepper-accordion-DmVykr5F.js.map +1 -0
- package/dist/_chunks/{theme-toggle-DuMhQNFS.js → theme-toggle-uEwoKjl3.js} +2 -2
- package/dist/_chunks/{theme-toggle-DuMhQNFS.js.map → theme-toggle-uEwoKjl3.js.map} +1 -1
- package/dist/_chunks/{tool-rail-CHyUmulN.js → tool-rail-8Scslq3X.js} +2 -2
- package/dist/_chunks/tool-rail-8Scslq3X.js.map +1 -0
- package/dist/_chunks/{whatsapp-button-Ca9towA4.js → whatsapp-button-CuFIHJzG.js} +27 -19
- package/dist/_chunks/{whatsapp-button-Ca9towA4.js.map → whatsapp-button-CuFIHJzG.js.map} +1 -1
- package/dist/agent-catalog.json +12 -5
- package/dist/agent-i18n/en.json +4 -3
- package/dist/components/_shared/format-price.d.ts +21 -0
- package/dist/components/_shared/format-price.d.ts.map +1 -0
- package/dist/components/_shared/index.d.ts +1 -0
- package/dist/components/_shared/index.d.ts.map +1 -1
- package/dist/components/_shared/stepper.d.ts +28 -2
- package/dist/components/_shared/stepper.d.ts.map +1 -1
- package/dist/components/appointment-card/appointment-card.d.ts +1 -1
- package/dist/components/appointment-card/appointment-card.d.ts.map +1 -1
- package/dist/components/appointment-timeline/appointment-timeline.agent.d.ts.map +1 -1
- package/dist/components/appointment-timeline/appointment-timeline.d.ts +8 -0
- package/dist/components/appointment-timeline/appointment-timeline.d.ts.map +1 -1
- package/dist/components/appointment-timeline/index.js +1 -1
- package/dist/components/booking/booking-types.d.ts +15 -2
- package/dist/components/booking/booking-types.d.ts.map +1 -1
- package/dist/components/booking/booking.agent.d.ts.map +1 -1
- package/dist/components/booking/booking.d.ts.map +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/chart/index.js +1 -1
- package/dist/components/contact-profile-card/contact-profile-card.d.ts.map +1 -1
- package/dist/components/contact-profile-card/index.js +1 -1
- package/dist/components/control-room-rail/index.js +1 -1
- package/dist/components/data-table/filters/date-range-filter.d.ts +22 -0
- package/dist/components/data-table/filters/date-range-filter.d.ts.map +1 -1
- package/dist/components/data-table/index.js +3 -3
- package/dist/components/face-scheme/index.js +1 -1
- package/dist/components/file-manager/index.js +1 -1
- package/dist/components/header-settings/index.js +1 -1
- package/dist/components/icon-button-group/icon-button-group.d.ts.map +1 -1
- package/dist/components/icon-button-group/index.js +1 -1
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/notes-panel/notes-panel.agent.d.ts.map +1 -1
- package/dist/components/notes-panel/notes-panel.d.ts +6 -0
- package/dist/components/notes-panel/notes-panel.d.ts.map +1 -1
- package/dist/components/patient-table/columns.d.ts.map +1 -1
- package/dist/components/patient-table/index.js +1 -1
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/practice-results/practice-results.d.ts +18 -0
- package/dist/components/practice-results/practice-results.d.ts.map +1 -1
- package/dist/components/stepper-accordion/index.js +1 -1
- package/dist/components/stepper-accordion/stepper-accordion.d.ts.map +1 -1
- package/dist/components/theme-toggle/index.js +1 -1
- package/dist/components/tool-rail/index.js +1 -1
- package/dist/components/tool-rail/tool-rail.d.ts +1 -1
- package/dist/components/tool-rail/tool-rail.d.ts.map +1 -1
- package/dist/components/whatsapp-button/index.js +1 -1
- package/dist/components/whatsapp-button/whatsapp-button.d.ts.map +1 -1
- package/dist/host-compat.css +7 -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 +5 -1
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts +5 -1
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +6 -2
- 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 +5 -1
- 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 +5 -1
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +5 -1
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +6 -2
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +5 -1
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +6 -2
- 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 +5 -1
- 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 +5 -1
- 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 +5 -1
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts +5 -1
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +6 -2
- 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 +5 -1
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts +5 -1
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +6 -2
- 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 +5 -1
- 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 +5 -1
- 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 +5 -1
- 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 +5 -1
- 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 +5 -1
- 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 +5 -1
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.js +20 -20
- package/dist/locales/ar.json +5 -1
- package/dist/locales/de.json +6 -2
- package/dist/locales/el.json +5 -1
- package/dist/locales/en.json +5 -1
- package/dist/locales/es.json +6 -2
- package/dist/locales/fr.json +6 -2
- package/dist/locales/hi.json +5 -1
- package/dist/locales/it.json +5 -1
- package/dist/locales/ja.json +5 -1
- package/dist/locales/nl.json +6 -2
- package/dist/locales/pl.json +5 -1
- package/dist/locales/pt.json +6 -2
- package/dist/locales/ro.json +5 -1
- package/dist/locales/ru.json +5 -1
- package/dist/locales/sq.json +5 -1
- package/dist/locales/sv.json +5 -1
- package/dist/locales/tr.json +5 -1
- package/dist/locales/zh.json +5 -1
- package/dist/patterns/anamnesis/anamnesis-catalogue.d.ts.map +1 -1
- package/dist/patterns/anamnesis/anamnesis-compile.d.ts.map +1 -1
- package/dist/patterns/anamnesis/anamnesis-config.d.ts +18 -7
- package/dist/patterns/anamnesis/anamnesis-config.d.ts.map +1 -1
- package/dist/patterns/anamnesis/anamnesis-types.d.ts +8 -0
- package/dist/patterns/anamnesis/anamnesis-types.d.ts.map +1 -1
- package/dist/patterns/anamnesis/index.js +1 -1
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/patterns/signature-request/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/anamnesis-summary-rows-d44s_whc.js.map +0 -1
- package/dist/_chunks/appointment-timeline-0mwtpErq.js +0 -388
- package/dist/_chunks/appointment-timeline-0mwtpErq.js.map +0 -1
- package/dist/_chunks/balance-badge-cell-C_Qz76x7.js.map +0 -1
- package/dist/_chunks/booking-DHkKcUIl.js +0 -2713
- package/dist/_chunks/booking-DHkKcUIl.js.map +0 -1
- package/dist/_chunks/contact-profile-card-CE9OJKcl.js.map +0 -1
- package/dist/_chunks/icon-button-group-D6SVMteH.js.map +0 -1
- package/dist/_chunks/languages-CGLX6Qpe.js +0 -19
- package/dist/_chunks/languages-CGLX6Qpe.js.map +0 -1
- package/dist/_chunks/link-cell-renderer-Cp2MSlJl.js.map +0 -1
- package/dist/_chunks/notes-panel-e9cJWVRg.js.map +0 -1
- package/dist/_chunks/practice-results-BEsAdW-B.js.map +0 -1
- package/dist/_chunks/stepper-accordion-BeVMZPuG.js.map +0 -1
- package/dist/_chunks/tool-rail-CHyUmulN.js.map +0 -1
package/dist/_chunks/{signature-request-CW30B77U.js.map → signature-request-DVDTKLjM.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signature-request-CW30B77U.js","sources":["../../node_modules/lucide-react/dist/esm/icons/tablet.mjs","../../node_modules/lucide-react/dist/esm/icons/user-plus.mjs","../../src/patterns/signature-request/signature-request.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"rect\", { width: \"16\", height: \"20\", x: \"4\", y: \"2\", rx: \"2\", ry: \"2\", key: \"76otgf\" }],\n [\"line\", { x1: \"12\", x2: \"12.01\", y1: \"18\", y2: \"18\", key: \"1dp563\" }]\n];\nconst Tablet = createLucideIcon(\"tablet\", __iconNode);\n\nexport { __iconNode, Tablet as default };\n//# sourceMappingURL=tablet.mjs.map\n","/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2\", key: \"1yyitq\" }],\n [\"circle\", { cx: \"9\", cy: \"7\", r: \"4\", key: \"nufk8\" }],\n [\"line\", { x1: \"19\", x2: \"19\", y1: \"8\", y2: \"14\", key: \"1bvyxn\" }],\n [\"line\", { x1: \"22\", x2: \"16\", y1: \"11\", y2: \"11\", key: \"1shjgl\" }]\n];\nconst UserPlus = createLucideIcon(\"user-plus\", __iconNode);\n\nexport { __iconNode, UserPlus as default };\n//# sourceMappingURL=user-plus.mjs.map\n","/**\n * SignatureRequestModal — the practice-side \"Documenti firmati\" modal that\n * dispatches a document-signature request: assign the operator who must\n * counter-sign (or leave the request unassigned) and how their request is\n * delivered (their system-defined default channel arrives pre-checked),\n * build the patient-side signer roster (up to `maxSigners`, each with their\n * own delivery channel and, for on-device signing, an OTP waiver), and send.\n *\n * Runtime pattern: real consuming apps mount this in production (surfaced via\n * `src/patterns/index.ts` and the `./patterns/signature-request` subpath).\n * The component owns the form state — re-seeded from the `initial*` props\n * every time `open` flips back to `true` — while the host owns `open`, the\n * option lists, and what happens on submit. Multiple on-device signers sign\n * sequentially in roster order — the execution side is the Signing pattern's\n * multi-signer flow; this modal only encodes the intents.\n */\nimport {\n forwardRef,\n useEffect,\n useRef,\n useState,\n type ComponentPropsWithoutRef,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport {\n Mail,\n MessageSquare,\n PenLine,\n Plus,\n Tablet,\n UserPlus,\n X,\n} from 'lucide-react';\nimport { Dialog } from '../../components/dialog';\nimport { Button } from '../../components/button';\nimport { IconButton } from '../../components/icon-button';\nimport { Checkbox } from '../../components/checkbox';\nimport { WhatsAppGlyph } from '../../components/whatsapp-button';\nimport { Select } from '../../components/select';\nimport { Switch } from '../../components/switch';\nimport { Alert } from '../../components/alert';\nimport { InfoTip } from '../../components/info-tip';\nimport { Separator } from '../../components/separator';\nimport { Avatar } from '../../components/avatar';\n\n/** Delivery channel for one signer's signature request. */\nexport type SignatureChannel = 'sms' | 'email' | 'whatsapp' | 'on-device';\n\n/**\n * Delivery channel for the operator's counter-sign request. The default is\n * system defined — the assigned operator's own `defaultChannel` (e-mail or\n * SMS) arrives pre-checked; `'on-device'` is offerable only while a roster\n * signer also signs on this device.\n */\nexport type OperatorChannel = 'sms' | 'email' | 'on-device';\n\n/** One selectable person/role for the operator or signer selects. */\nexport interface SignerOption {\n value: string;\n label: string;\n /**\n * Delivery channels this person can actually receive. Omit (or pass an\n * empty list) to offer every channel. Hosts gate this from per-patient\n * capability flags — e.g. a patient with no mobile number drops `'sms'`\n * and `'whatsapp'`. Only meaningful for signer options, not operators.\n */\n availableChannels?: SignatureChannel[];\n /**\n * The delivery channel this operator's own settings resolve to — the\n * system-defined default, pre-checked when the operator is assigned.\n * Falls back to `'email'` when omitted. Only meaningful for operator\n * options, not signers.\n */\n defaultChannel?: 'sms' | 'email';\n}\n\n/** One patient-side signer row in the submission. */\nexport interface SignerRequest {\n signerId: string;\n channel: SignatureChannel;\n /** Only meaningful when `channel` is `'on-device'`. */\n skipOtp?: boolean;\n}\n\n/** Payload handed to `onRequestSignature`. */\nexport interface SignatureRequestSubmission {\n /** `null` when the counter-signing operator is left unassigned. */\n operatorId: string | null;\n /**\n * How the operator's counter-sign request is delivered. `null` while the\n * operator is unassigned. Defaults to the operator's own system-defined\n * channel unless explicitly changed in the modal.\n */\n operatorChannel: OperatorChannel | null;\n /** 1..N signers; on-device signers sign sequentially in this order. */\n signers: SignerRequest[];\n}\n\nexport interface SignatureRequestModalProps {\n /** Controlled open state. Reopening re-seeds the form from `initial*`. */\n open: boolean;\n /**\n * Fires when the dialog requests a state change (<kbd>Esc</kbd> or the\n * footer Close button). `false` is the dismiss signal — hosts typically\n * persist a \"dismissed this session\" flag there.\n */\n onOpenChange: (open: boolean) => void;\n /** Operators offered as the counter-signing signer. */\n operators: SignerOption[];\n /** Patient-side people/roles offered in each signer row. */\n signerOptions: SignerOption[];\n /** Enables the \"Assign to me\" shortcut targeting this operator. */\n currentOperatorId?: string;\n /** Offer an \"Assign later\" option in the operator select. Default `true`. */\n allowAssignLater?: boolean;\n /**\n * Preselected operator; `null` preselects \"Assign later\" (honoured only\n * while `allowAssignLater` — otherwise the first operator is seeded).\n */\n initialOperatorId?: string | null;\n /**\n * Preselected operator delivery channel. Defaults to the seeded operator's\n * system-defined `defaultChannel`. `'on-device'` is honoured only while a\n * seeded roster signer also signs on this device.\n */\n initialOperatorChannel?: OperatorChannel;\n /** Seed the signer roster. Defaults to the first option, on-device. */\n initialSigners?: SignerRequest[];\n /** Cap on roster size. Default `2`. */\n maxSigners?: number;\n /**\n * Whether an operator must counter-sign. `false` drops the operator\n * section entirely and submits `operatorId: null` — a host whose document\n * does not require a counter-signature must not be asked for one. Default\n * `true`.\n */\n requireOperator?: boolean;\n /**\n * Whether the patient side signs at all. `false` drops the signer roster\n * and submits an empty `signers` array — for documents only an operator\n * signs. Default `true`. Setting BOTH this and `requireOperator` to false\n * leaves nothing to request, so the primary action stays disabled.\n */\n requirePatient?: boolean;\n /** Disables all inputs and shows the primary action as loading. */\n busy?: boolean;\n /** Consumer-translated error shown above the footer (e.g. server failure). */\n error?: string;\n /** Override the dialog title. Defaults to the `ui.*` string. */\n title?: string;\n /** Override the dialog description. Defaults to the `ui.*` string. */\n description?: string;\n /** Receives the completed submission. The host closes via `onOpenChange`. */\n onRequestSignature: (submission: SignatureRequestSubmission) => void;\n /**\n * Extra attributes for the portaled dialog surface (e.g. `dir`/`lang`\n * when the host pins a locale below `<html>`, or a test id).\n */\n contentProps?: ComponentPropsWithoutRef<'div'>;\n}\n\nconst ASSIGN_LATER = '__assign-later__';\n\n/** Canonical channel display order; per-signer availability filters this. */\nconst CHANNEL_ORDER: SignatureChannel[] = [\n 'sms',\n 'email',\n 'whatsapp',\n 'on-device',\n];\n\n/** Internal roster row — `rowId` keys the DOM so editing a row's person\n * never remounts the row (which would drop keyboard focus). */\ninterface RosterRow extends SignerRequest {\n rowId: number;\n}\n\nfunction labelFor(options: SignerOption[], value: string): string {\n return options.find((option) => option.value === value)?.label ?? '';\n}\n\nexport const SignatureRequestModal = forwardRef<\n HTMLDivElement,\n SignatureRequestModalProps\n>(\n (\n {\n open,\n onOpenChange,\n operators,\n signerOptions,\n currentOperatorId,\n allowAssignLater = true,\n requireOperator = true,\n requirePatient = true,\n initialOperatorId,\n initialOperatorChannel,\n initialSigners,\n maxSigners = 2,\n busy = false,\n error,\n title,\n description,\n onRequestSignature,\n contentProps,\n },\n ref,\n ) => {\n const { t } = useTranslation();\n\n const nextRowId = useRef(0);\n const addButtonRef = useRef<HTMLButtonElement>(null);\n\n // Channels a given signer can receive on — the person's `availableChannels`\n // filtered into canonical order; omitted/empty means every channel.\n const channelsFor = (signerId: string): SignatureChannel[] => {\n const allowed = signerOptions.find(\n (option) => option.value === signerId,\n )?.availableChannels;\n return allowed && allowed.length > 0\n ? CHANNEL_ORDER.filter((channel) => allowed.includes(channel))\n : CHANNEL_ORDER;\n };\n\n // First available channel for a signer, preferring `preferred` when offered.\n const resolveChannel = (\n signerId: string,\n preferred: SignatureChannel,\n ): SignatureChannel => {\n const available = channelsFor(signerId);\n return available.includes(preferred) ? preferred : available[0];\n };\n\n const seedOperator = () => {\n if (initialOperatorId === null) {\n return allowAssignLater\n ? ASSIGN_LATER\n : (operators[0]?.value ?? ASSIGN_LATER);\n }\n return (\n initialOperatorId ??\n operators[0]?.value ??\n (allowAssignLater ? ASSIGN_LATER : '')\n );\n };\n const seedRows = (): RosterRow[] => {\n const seed =\n initialSigners && initialSigners.length > 0\n ? initialSigners\n : signerOptions.length > 0\n ? [\n {\n signerId: signerOptions[0].value,\n channel: resolveChannel(signerOptions[0].value, 'on-device'),\n },\n ]\n : [];\n return seed.map((signer) => ({ ...signer, rowId: nextRowId.current++ }));\n };\n\n // System-defined default for one operator — the channel their own\n // settings resolve to.\n const operatorDefaultChannel = (operatorId: string): OperatorChannel =>\n operators.find((option) => option.value === operatorId)?.defaultChannel ??\n 'email';\n\n // Seed clamp: `'on-device'` is honoured only when the seeded roster\n // makes it available, so the option is never checked-and-disabled, not\n // even for a frame.\n const seedOperatorChannel = (\n operatorId: string,\n rows: RosterRow[],\n ): OperatorChannel => {\n if (initialOperatorChannel === 'on-device') {\n return rows.some((signer) => signer.channel === 'on-device')\n ? 'on-device'\n : operatorDefaultChannel(operatorId);\n }\n return initialOperatorChannel ?? operatorDefaultChannel(operatorId);\n };\n\n const [operator, setOperator] = useState<string>(seedOperator);\n const [signers, setSigners] = useState<RosterRow[]>(seedRows);\n const [operatorChannel, setOperatorChannel] = useState<OperatorChannel>(\n () => seedOperatorChannel(operator, signers),\n );\n // Feeds the sr-only live region announcing the automatic channel\n // fallback below; any explicit choice clears it.\n const [revertedTo, setRevertedTo] = useState<OperatorChannel | null>(null);\n\n // Re-seed the form whenever the host reopens the (still-mounted) modal,\n // so a previous request's choices never leak into the next one.\n const wasOpen = useRef(open);\n useEffect(() => {\n if (open && !wasOpen.current) {\n const nextOperator = seedOperator();\n const nextRows = seedRows();\n setOperator(nextOperator);\n setSigners(nextRows);\n setOperatorChannel(seedOperatorChannel(nextOperator, nextRows));\n setRevertedTo(null);\n }\n wasOpen.current = open;\n // The seeds intentionally read the render-time props on the rising\n // edge only — prop changes while open (or closed) don't reset input.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open]);\n\n // Operator on-device signing piggybacks on a patient handover: it is\n // offerable only while a roster signer signs on this device, and falls\n // back to the operator's system default the moment the last on-device\n // row leaves. The fallback is announced via the live region — the\n // trigger lives in the roster section, far from the checkbox it moves.\n const anySignerOnDevice = signers.some(\n (signer) => signer.channel === 'on-device',\n );\n useEffect(() => {\n if (operatorChannel === 'on-device' && !anySignerOnDevice) {\n const fallback = operatorDefaultChannel(operator);\n setOperatorChannel(fallback);\n setRevertedTo(fallback);\n }\n // `operatorDefaultChannel` reads the render-time `operators` prop.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [operatorChannel, anySignerOnDevice, operator]);\n\n const operatorSelectOptions = allowAssignLater\n ? [\n ...operators,\n { value: ASSIGN_LATER, label: t('signatureRequest.assignLater') },\n ]\n : operators;\n const isUnassigned = operator === ASSIGN_LATER;\n\n const channelMeta: Record<\n SignatureChannel,\n { label: string; icon: React.ReactNode }\n > = {\n sms: {\n label: t('signatureRequest.viaSms'),\n icon: <MessageSquare className=\"ds:size-4\" aria-hidden />,\n },\n email: {\n label: t('signatureRequest.viaEmail'),\n icon: <Mail className=\"ds:size-4\" aria-hidden />,\n },\n whatsapp: {\n label: t('signatureRequest.viaWhatsapp'),\n icon: <WhatsAppGlyph className=\"ds:size-4\" aria-hidden />,\n },\n 'on-device': {\n label: t('signatureRequest.onThisDevice'),\n icon: <Tablet className=\"ds:size-4\" aria-hidden />,\n },\n };\n\n // Operator delivery — same checkbox visuals as the signer rows, minus\n // WhatsApp. No \"system defined\" option: the operator's own default\n // (e-mail or SMS per their settings) arrives pre-checked instead.\n // On-device greys out while no patient signer signs on this device;\n // an InfoTip explains why.\n const operatorChannelOptions: Array<{\n value: OperatorChannel;\n label: string;\n icon: React.ReactNode;\n disabled?: boolean;\n hint?: string;\n }> = [\n { value: 'sms', ...channelMeta.sms },\n { value: 'email', ...channelMeta.email },\n {\n value: 'on-device',\n ...channelMeta['on-device'],\n disabled: !anySignerOnDevice,\n hint: anySignerOnDevice\n ? undefined\n : t('signatureRequest.onDeviceUnavailableHint'),\n },\n ];\n\n const chosenIds = signers.map((signer) => signer.signerId);\n const nextFreeOption = signerOptions.find(\n (option) => !chosenIds.includes(option.value),\n );\n const canAddSigner =\n !busy && signers.length < maxSigners && nextFreeOption !== undefined;\n\n const patchSigner = (rowId: number, patch: Partial<SignerRequest>) => {\n setSigners((current) =>\n current.map((signer) =>\n signer.rowId === rowId ? { ...signer, ...patch } : signer,\n ),\n );\n };\n\n const addSigner = () => {\n if (!nextFreeOption) return;\n setSigners((current) => [\n ...current,\n {\n signerId: nextFreeOption.value,\n channel: resolveChannel(nextFreeOption.value, 'sms'),\n rowId: nextRowId.current++,\n },\n ]);\n };\n\n const removeSigner = (rowId: number) => {\n // Move focus BEFORE the row (and the focused remove button) unmounts —\n // otherwise Radix's focus scope dumps focus on the dialog container.\n addButtonRef.current?.focus();\n setSigners((current) =>\n current.filter((signer) => signer.rowId !== rowId),\n );\n };\n\n const handleRequest = () => {\n onRequestSignature({\n operatorId: !requireOperator || isUnassigned ? null : operator,\n operatorChannel:\n !requireOperator || isUnassigned ? null : operatorChannel,\n signers: requirePatient\n ? signers.map(({ rowId: _rowId, ...signer }) => signer)\n : [],\n });\n };\n\n return (\n <div ref={ref} className=\"ds:contents\" data-component=\"signature-request\">\n <Dialog open={open} onOpenChange={onOpenChange}>\n <Dialog.Content size=\"lg\" hideCloseButton {...contentProps}>\n <Dialog.Header>\n <Dialog.Title>\n {title ?? t('signatureRequest.title')}\n </Dialog.Title>\n <Dialog.Description>\n {description ?? t('signatureRequest.noSignedVersions')}\n </Dialog.Description>\n </Dialog.Header>\n\n <Dialog.Body className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n {requireOperator ? (\n <section className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\">\n <div className=\"ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]\">\n <p className=\"type-eyebrow ds:text-start ds:text-[color:var(--muted-foreground)]\">\n {t('signatureRequest.operatorSection')}\n </p>\n {currentOperatorId !== undefined ? (\n <Button\n intent=\"primary\"\n size=\"sm\"\n startIcon={<UserPlus />}\n disabled={busy}\n onClick={() => {\n setOperator(currentOperatorId);\n setOperatorChannel(\n operatorDefaultChannel(currentOperatorId),\n );\n setRevertedTo(null);\n }}\n >\n {t('signatureRequest.assignToMe')}\n </Button>\n ) : null}\n </div>\n\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-sm)]\">\n {/* Mirrors the select value — decorative for AT. No name →\n Avatar's built-in placeholder-icon fallback. */}\n <Avatar\n aria-hidden=\"true\"\n name={\n isUnassigned ? undefined : labelFor(operators, operator)\n }\n size=\"sm\"\n />\n <div className=\"ds:min-w-0 ds:flex-1 ds:text-start\">\n <Select\n options={operatorSelectOptions}\n value={operator}\n onValueChange={(value) => {\n if (!value) return;\n setOperator(value);\n // A different operator brings their own system\n // default along.\n setOperatorChannel(\n value === ASSIGN_LATER\n ? 'email'\n : operatorDefaultChannel(value),\n );\n setRevertedTo(null);\n }}\n required\n disabled={busy}\n placeholder={t('signatureRequest.operatorPlaceholder')}\n aria-label={t('signatureRequest.operatorSection')}\n />\n </div>\n </div>\n\n {/* One channel for the operator too — same mutually exclusive\n checkbox visuals as the signer rows. Hidden while the\n request is unassigned: there is nobody to deliver to. */}\n {isUnassigned ? null : (\n <div\n role=\"group\"\n aria-label={t('signatureRequest.operatorChannelLabel')}\n className=\"ds:flex ds:flex-wrap ds:items-center ds:gap-x-[var(--spacing-lg)] ds:gap-y-[var(--spacing-sm)] ds:ps-[var(--spacing-xl)]\"\n >\n {operatorChannelOptions.map((option) => (\n <span\n key={option.value}\n className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)]\"\n >\n <Checkbox\n checked={operatorChannel === option.value}\n disabled={busy || option.disabled}\n onCheckedChange={(checked) => {\n if (checked !== true) return;\n setOperatorChannel(option.value);\n setRevertedTo(null);\n }}\n label={\n <span className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n <span\n aria-hidden=\"true\"\n className=\"ds:text-[var(--accent)]\"\n >\n {option.icon}\n </span>\n {option.label}\n </span>\n }\n />\n {/* Sibling of the checkbox, never inside its label —\n the tip is its own interactive control. The wider\n gap keeps the tip's touch hit-area off the label. */}\n {option.hint ? (\n <InfoTip size=\"sm\" content={option.hint} />\n ) : null}\n </span>\n ))}\n </div>\n )}\n\n {/* Announces the automatic on-device → default fallback: the\n trigger (the patient's channel change) sits in another\n section, so the moved checkmark alone is not enough. */}\n <span role=\"status\" className=\"ds:sr-only\">\n {revertedTo\n ? t('signatureRequest.operatorChannelReverted', {\n channel: channelMeta[revertedTo].label,\n })\n : null}\n </span>\n </section>\n ) : null}\n\n {/* The rule only separates two sections that are both there. */}\n {requireOperator && requirePatient ? (\n <Separator decorative />\n ) : null}\n\n {requirePatient ? (\n <section className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:text-start\">\n <div className=\"ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]\">\n <p className=\"type-eyebrow ds:text-[color:var(--muted-foreground)]\">\n {t('signatureRequest.signersSection')}\n </p>\n {/* Offered only when the roster holds more than one\n person. A patient with nobody else to sign for them saw\n a permanently greyed action — a promise the modal could\n never keep. With two or more it stays, greying (not\n hiding) once every seat is taken so the cap reads. */}\n {signerOptions.length > 1 ? (\n <Button\n ref={addButtonRef}\n intent=\"primary\"\n size=\"sm\"\n startIcon={<Plus />}\n disabled={!canAddSigner}\n onClick={addSigner}\n >\n {t('signatureRequest.addSigner')}\n </Button>\n ) : null}\n </div>\n\n {signers.map((signer) => {\n const rowOptions = signerOptions.filter(\n (option) =>\n option.value === signer.signerId ||\n !chosenIds.includes(option.value),\n );\n const rowLabel = labelFor(signerOptions, signer.signerId);\n const rowChannelOptions = channelsFor(signer.signerId).map(\n (channel) => ({\n value: channel,\n ...channelMeta[channel],\n }),\n );\n return (\n <div\n key={signer.rowId}\n role=\"group\"\n aria-label={rowLabel}\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\"\n >\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-sm)]\">\n {/* Mirrors the select value — decorative for AT. */}\n <Avatar\n aria-hidden=\"true\"\n name={rowLabel}\n size=\"sm\"\n />\n <div className=\"ds:min-w-0 ds:flex-1\">\n <Select\n options={rowOptions}\n value={signer.signerId}\n onValueChange={(value) => {\n if (!value) return;\n const channel = resolveChannel(\n value,\n signer.channel,\n );\n patchSigner(signer.rowId, {\n signerId: value,\n channel,\n skipOtp:\n channel === 'on-device'\n ? signer.skipOtp\n : undefined,\n });\n }}\n required\n disabled={busy}\n placeholder={t(\n 'signatureRequest.signerPlaceholder',\n )}\n aria-label={t(\n 'signatureRequest.signerPlaceholder',\n )}\n />\n </div>\n {signers.length > 1 ? (\n <IconButton\n intent=\"ghost\"\n size=\"sm\"\n icon={<X />}\n disabled={busy}\n aria-label={t('signatureRequest.removeSigner')}\n onClick={() => removeSigner(signer.rowId)}\n />\n ) : null}\n </div>\n\n {/* One channel per signer — checkbox visuals, but the\n choice is mutually exclusive: checking a channel\n unchecks the others, and the active one can't be\n unchecked. */}\n <div\n role=\"group\"\n aria-label={t('signatureRequest.channelLabel')}\n className=\"ds:flex ds:flex-wrap ds:items-center ds:gap-x-[var(--spacing-lg)] ds:gap-y-[var(--spacing-sm)] ds:ps-[var(--spacing-xl)]\"\n >\n {rowChannelOptions.map((option) => (\n <Checkbox\n key={option.value}\n checked={signer.channel === option.value}\n disabled={busy}\n onCheckedChange={(checked) =>\n checked === true &&\n patchSigner(signer.rowId, {\n channel: option.value,\n skipOtp: undefined,\n })\n }\n label={\n <span className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n <span\n aria-hidden=\"true\"\n className=\"ds:text-[var(--accent)]\"\n >\n {option.icon}\n </span>\n {option.label}\n </span>\n }\n />\n ))}\n </div>\n\n {signer.channel === 'on-device' ? (\n <div className=\"ds:ps-[var(--spacing-xl)]\">\n <Switch\n label={t('signatureRequest.noOtp')}\n checked={signer.skipOtp === true}\n disabled={busy}\n onCheckedChange={(checked) =>\n patchSigner(signer.rowId, { skipOtp: checked })\n }\n />\n </div>\n ) : null}\n </div>\n );\n })}\n </section>\n ) : null}\n\n {/* Dedicated alert area — one warning regardless of how many\n signers waive OTP, stacked with any submission error, all at\n the same full width as the operator hint. */}\n {signers.some(\n (signer) =>\n signer.channel === 'on-device' && signer.skipOtp === true,\n ) ? (\n <Alert variant=\"warning\">\n <Alert.Description>\n {t('signatureRequest.noOtpWarning')}\n </Alert.Description>\n </Alert>\n ) : null}\n {error ? (\n <Alert variant=\"error\">\n <Alert.Description>{error}</Alert.Description>\n </Alert>\n ) : null}\n </Dialog.Body>\n\n <Dialog.Footer>\n <Button\n intent=\"primary\"\n startIcon={<PenLine />}\n onClick={handleRequest}\n disabled={\n busy ||\n (requirePatient && signers.length === 0) ||\n (!requirePatient && !requireOperator)\n }\n loading={busy}\n >\n {t('signatureRequest.requestSignature')}\n </Button>\n <Dialog.Close asChild>\n <Button intent=\"outline\" disabled={busy}>\n {t('signatureRequest.close')}\n </Button>\n </Dialog.Close>\n </Dialog.Footer>\n </Dialog.Content>\n </Dialog>\n </div>\n );\n },\n);\nSignatureRequestModal.displayName = 'SignatureRequestModal';\n"],"names":["__iconNode","Tablet","createLucideIcon","UserPlus","ASSIGN_LATER","CHANNEL_ORDER","labelFor","options","value","_a","option","SignatureRequestModal","forwardRef","open","onOpenChange","operators","signerOptions","currentOperatorId","allowAssignLater","requireOperator","requirePatient","initialOperatorId","initialOperatorChannel","initialSigners","maxSigners","busy","error","title","description","onRequestSignature","contentProps","ref","t","useTranslation","nextRowId","useRef","addButtonRef","channelsFor","signerId","allowed","channel","resolveChannel","preferred","available","seedOperator","_b","seedRows","signer","operatorDefaultChannel","operatorId","seedOperatorChannel","rows","operator","setOperator","useState","signers","setSigners","operatorChannel","setOperatorChannel","revertedTo","setRevertedTo","wasOpen","useEffect","nextOperator","nextRows","anySignerOnDevice","fallback","operatorSelectOptions","isUnassigned","channelMeta","jsx","MessageSquare","Mail","WhatsAppGlyph","operatorChannelOptions","chosenIds","nextFreeOption","canAddSigner","patchSigner","rowId","patch","current","addSigner","removeSigner","handleRequest","_rowId","Dialog","jsxs","Button","Avatar","Select","Checkbox","checked","InfoTip","Separator","Plus","rowOptions","rowLabel","rowChannelOptions","IconButton","X","Switch","Alert","PenLine"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,OAAO,MAAM,QAAQ,MAAM,GAAG,KAAK,GAAG,KAAK,IAAI,KAAK,IAAI,KAAK,KAAK,UAAU;AAAA,EACvF,CAAC,QAAQ,EAAE,IAAI,MAAM,IAAI,SAAS,IAAI,MAAM,IAAI,MAAM,KAAK,SAAQ,CAAE;AACvE,GACMC,KAASC,GAAiB,UAAUF,EAAU;ACbpD;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,6CAA6C,KAAK,SAAQ,CAAE;AAAA,EAC1E,CAAC,UAAU,EAAE,IAAI,KAAK,IAAI,KAAK,GAAG,KAAK,KAAK,SAAS;AAAA,EACrD,CAAC,QAAQ,EAAE,IAAI,MAAM,IAAI,MAAM,IAAI,KAAK,IAAI,MAAM,KAAK,SAAQ,CAAE;AAAA,EACjE,CAAC,QAAQ,EAAE,IAAI,MAAM,IAAI,MAAM,IAAI,MAAM,IAAI,MAAM,KAAK,SAAQ,CAAE;AACpE,GACMG,KAAWD,GAAiB,aAAaF,EAAU,GCkJnDI,IAAe,oBAGfC,KAAoC;AAAA,EACxC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAQA,SAASC,GAASC,GAAyBC,GAAuB;;AAChE,WAAOC,IAAAF,EAAQ,KAAK,CAACG,MAAWA,EAAO,UAAUF,CAAK,MAA/C,gBAAAC,EAAkD,UAAS;AACpE;AAEO,MAAME,KAAwBC;AAAA,EAInC,CACE;AAAA,IACE,MAAAC;AAAA,IACA,cAAAC;AAAA,IACA,WAAAC;AAAA,IACA,eAAAC;AAAA,IACA,mBAAAC;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ACN;AAAA,MAEA,gBAAA6D,EAACD,EAAO,QAAP,EACC,UAAA;AAAA,QAAA,gBAAAhB;AAAA,UAACkB;AAAA,UAAA;AAAA,YACC,QAAO;AAAA,YACP,6BAAYe,IAAA,EAAQ;AAAA,YACpB,SAASnB;AAAA,YACT,UACE3D,KACCL,KAAkBmC,EAAQ,WAAW,KACrC,CAACnC,KAAkB,CAACD;AAAA,YAEvB,SAASM;AAAA,YAER,YAAE,mCAAmC;AAAA,UAAA;AAAA,QAAA;AAAA,QAExC,gBAAA6C,EAACgB,EAAO,OAAP,EAAa,SAAO,IACnB,UAAA,gBAAAhB,EAACkB,GAAA,EAAO,QAAO,WAAU,UAAU/D,GAChC,UAAAO,EAAE,wBAAwB,GAC7B,EAAA,CACF;AAAA,MAAA,EAAA,CACF;AAAA,IAAA,EAAA,CACF,GACF,GACF;AAAA,EAEJ;AACF;AACArB,GAAsB,cAAc;","x_google_ignoreList":[0,1]}
|
|
1
|
+
{"version":3,"file":"signature-request-DVDTKLjM.js","sources":["../../node_modules/lucide-react/dist/esm/icons/tablet.mjs","../../node_modules/lucide-react/dist/esm/icons/user-plus.mjs","../../src/patterns/signature-request/signature-request.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"rect\", { width: \"16\", height: \"20\", x: \"4\", y: \"2\", rx: \"2\", ry: \"2\", key: \"76otgf\" }],\n [\"line\", { x1: \"12\", x2: \"12.01\", y1: \"18\", y2: \"18\", key: \"1dp563\" }]\n];\nconst Tablet = createLucideIcon(\"tablet\", __iconNode);\n\nexport { __iconNode, Tablet as default };\n//# sourceMappingURL=tablet.mjs.map\n","/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2\", key: \"1yyitq\" }],\n [\"circle\", { cx: \"9\", cy: \"7\", r: \"4\", key: \"nufk8\" }],\n [\"line\", { x1: \"19\", x2: \"19\", y1: \"8\", y2: \"14\", key: \"1bvyxn\" }],\n [\"line\", { x1: \"22\", x2: \"16\", y1: \"11\", y2: \"11\", key: \"1shjgl\" }]\n];\nconst UserPlus = createLucideIcon(\"user-plus\", __iconNode);\n\nexport { __iconNode, UserPlus as default };\n//# sourceMappingURL=user-plus.mjs.map\n","/**\n * SignatureRequestModal — the practice-side \"Documenti firmati\" modal that\n * dispatches a document-signature request: assign the operator who must\n * counter-sign (or leave the request unassigned) and how their request is\n * delivered (their system-defined default channel arrives pre-checked),\n * build the patient-side signer roster (up to `maxSigners`, each with their\n * own delivery channel and, for on-device signing, an OTP waiver), and send.\n *\n * Runtime pattern: real consuming apps mount this in production (surfaced via\n * `src/patterns/index.ts` and the `./patterns/signature-request` subpath).\n * The component owns the form state — re-seeded from the `initial*` props\n * every time `open` flips back to `true` — while the host owns `open`, the\n * option lists, and what happens on submit. Multiple on-device signers sign\n * sequentially in roster order — the execution side is the Signing pattern's\n * multi-signer flow; this modal only encodes the intents.\n */\nimport {\n forwardRef,\n useEffect,\n useRef,\n useState,\n type ComponentPropsWithoutRef,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport {\n Mail,\n MessageSquare,\n PenLine,\n Plus,\n Tablet,\n UserPlus,\n X,\n} from 'lucide-react';\nimport { Dialog } from '../../components/dialog';\nimport { Button } from '../../components/button';\nimport { IconButton } from '../../components/icon-button';\nimport { Checkbox } from '../../components/checkbox';\nimport { WhatsAppGlyph } from '../../components/whatsapp-button';\nimport { Select } from '../../components/select';\nimport { Switch } from '../../components/switch';\nimport { Alert } from '../../components/alert';\nimport { InfoTip } from '../../components/info-tip';\nimport { Separator } from '../../components/separator';\nimport { Avatar } from '../../components/avatar';\n\n/** Delivery channel for one signer's signature request. */\nexport type SignatureChannel = 'sms' | 'email' | 'whatsapp' | 'on-device';\n\n/**\n * Delivery channel for the operator's counter-sign request. The default is\n * system defined — the assigned operator's own `defaultChannel` (e-mail or\n * SMS) arrives pre-checked; `'on-device'` is offerable only while a roster\n * signer also signs on this device.\n */\nexport type OperatorChannel = 'sms' | 'email' | 'on-device';\n\n/** One selectable person/role for the operator or signer selects. */\nexport interface SignerOption {\n value: string;\n label: string;\n /**\n * Delivery channels this person can actually receive. Omit (or pass an\n * empty list) to offer every channel. Hosts gate this from per-patient\n * capability flags — e.g. a patient with no mobile number drops `'sms'`\n * and `'whatsapp'`. Only meaningful for signer options, not operators.\n */\n availableChannels?: SignatureChannel[];\n /**\n * The delivery channel this operator's own settings resolve to — the\n * system-defined default, pre-checked when the operator is assigned.\n * Falls back to `'email'` when omitted. Only meaningful for operator\n * options, not signers.\n */\n defaultChannel?: 'sms' | 'email';\n}\n\n/** One patient-side signer row in the submission. */\nexport interface SignerRequest {\n signerId: string;\n channel: SignatureChannel;\n /** Only meaningful when `channel` is `'on-device'`. */\n skipOtp?: boolean;\n}\n\n/** Payload handed to `onRequestSignature`. */\nexport interface SignatureRequestSubmission {\n /** `null` when the counter-signing operator is left unassigned. */\n operatorId: string | null;\n /**\n * How the operator's counter-sign request is delivered. `null` while the\n * operator is unassigned. Defaults to the operator's own system-defined\n * channel unless explicitly changed in the modal.\n */\n operatorChannel: OperatorChannel | null;\n /** 1..N signers; on-device signers sign sequentially in this order. */\n signers: SignerRequest[];\n}\n\nexport interface SignatureRequestModalProps {\n /** Controlled open state. Reopening re-seeds the form from `initial*`. */\n open: boolean;\n /**\n * Fires when the dialog requests a state change (<kbd>Esc</kbd> or the\n * footer Close button). `false` is the dismiss signal — hosts typically\n * persist a \"dismissed this session\" flag there.\n */\n onOpenChange: (open: boolean) => void;\n /** Operators offered as the counter-signing signer. */\n operators: SignerOption[];\n /** Patient-side people/roles offered in each signer row. */\n signerOptions: SignerOption[];\n /** Enables the \"Assign to me\" shortcut targeting this operator. */\n currentOperatorId?: string;\n /** Offer an \"Assign later\" option in the operator select. Default `true`. */\n allowAssignLater?: boolean;\n /**\n * Preselected operator; `null` preselects \"Assign later\" (honoured only\n * while `allowAssignLater` — otherwise the first operator is seeded).\n */\n initialOperatorId?: string | null;\n /**\n * Preselected operator delivery channel. Defaults to the seeded operator's\n * system-defined `defaultChannel`. `'on-device'` is honoured only while a\n * seeded roster signer also signs on this device.\n */\n initialOperatorChannel?: OperatorChannel;\n /** Seed the signer roster. Defaults to the first option, on-device. */\n initialSigners?: SignerRequest[];\n /** Cap on roster size. Default `2`. */\n maxSigners?: number;\n /**\n * Whether an operator must counter-sign. `false` drops the operator\n * section entirely and submits `operatorId: null` — a host whose document\n * does not require a counter-signature must not be asked for one. Default\n * `true`.\n */\n requireOperator?: boolean;\n /**\n * Whether the patient side signs at all. `false` drops the signer roster\n * and submits an empty `signers` array — for documents only an operator\n * signs. Default `true`. Setting BOTH this and `requireOperator` to false\n * leaves nothing to request, so the primary action stays disabled.\n */\n requirePatient?: boolean;\n /** Disables all inputs and shows the primary action as loading. */\n busy?: boolean;\n /** Consumer-translated error shown above the footer (e.g. server failure). */\n error?: string;\n /** Override the dialog title. Defaults to the `ui.*` string. */\n title?: string;\n /** Override the dialog description. Defaults to the `ui.*` string. */\n description?: string;\n /** Receives the completed submission. The host closes via `onOpenChange`. */\n onRequestSignature: (submission: SignatureRequestSubmission) => void;\n /**\n * Extra attributes for the portaled dialog surface (e.g. `dir`/`lang`\n * when the host pins a locale below `<html>`, or a test id).\n */\n contentProps?: ComponentPropsWithoutRef<'div'>;\n}\n\nconst ASSIGN_LATER = '__assign-later__';\n\n/** Canonical channel display order; per-signer availability filters this. */\nconst CHANNEL_ORDER: SignatureChannel[] = [\n 'sms',\n 'email',\n 'whatsapp',\n 'on-device',\n];\n\n/** Internal roster row — `rowId` keys the DOM so editing a row's person\n * never remounts the row (which would drop keyboard focus). */\ninterface RosterRow extends SignerRequest {\n rowId: number;\n}\n\nfunction labelFor(options: SignerOption[], value: string): string {\n return options.find((option) => option.value === value)?.label ?? '';\n}\n\nexport const SignatureRequestModal = forwardRef<\n HTMLDivElement,\n SignatureRequestModalProps\n>(\n (\n {\n open,\n onOpenChange,\n operators,\n signerOptions,\n currentOperatorId,\n allowAssignLater = true,\n requireOperator = true,\n requirePatient = true,\n initialOperatorId,\n initialOperatorChannel,\n initialSigners,\n maxSigners = 2,\n busy = false,\n error,\n title,\n description,\n onRequestSignature,\n contentProps,\n },\n ref,\n ) => {\n const { t } = useTranslation();\n\n const nextRowId = useRef(0);\n const addButtonRef = useRef<HTMLButtonElement>(null);\n\n // Channels a given signer can receive on — the person's `availableChannels`\n // filtered into canonical order; omitted/empty means every channel.\n const channelsFor = (signerId: string): SignatureChannel[] => {\n const allowed = signerOptions.find(\n (option) => option.value === signerId,\n )?.availableChannels;\n return allowed && allowed.length > 0\n ? CHANNEL_ORDER.filter((channel) => allowed.includes(channel))\n : CHANNEL_ORDER;\n };\n\n // First available channel for a signer, preferring `preferred` when offered.\n const resolveChannel = (\n signerId: string,\n preferred: SignatureChannel,\n ): SignatureChannel => {\n const available = channelsFor(signerId);\n return available.includes(preferred) ? preferred : available[0];\n };\n\n const seedOperator = () => {\n if (initialOperatorId === null) {\n return allowAssignLater\n ? ASSIGN_LATER\n : (operators[0]?.value ?? ASSIGN_LATER);\n }\n return (\n initialOperatorId ??\n operators[0]?.value ??\n (allowAssignLater ? ASSIGN_LATER : '')\n );\n };\n const seedRows = (): RosterRow[] => {\n const seed =\n initialSigners && initialSigners.length > 0\n ? initialSigners\n : signerOptions.length > 0\n ? [\n {\n signerId: signerOptions[0].value,\n channel: resolveChannel(signerOptions[0].value, 'on-device'),\n },\n ]\n : [];\n return seed.map((signer) => ({ ...signer, rowId: nextRowId.current++ }));\n };\n\n // System-defined default for one operator — the channel their own\n // settings resolve to.\n const operatorDefaultChannel = (operatorId: string): OperatorChannel =>\n operators.find((option) => option.value === operatorId)?.defaultChannel ??\n 'email';\n\n // Seed clamp: `'on-device'` is honoured only when the seeded roster\n // makes it available, so the option is never checked-and-disabled, not\n // even for a frame.\n const seedOperatorChannel = (\n operatorId: string,\n rows: RosterRow[],\n ): OperatorChannel => {\n if (initialOperatorChannel === 'on-device') {\n return rows.some((signer) => signer.channel === 'on-device')\n ? 'on-device'\n : operatorDefaultChannel(operatorId);\n }\n return initialOperatorChannel ?? operatorDefaultChannel(operatorId);\n };\n\n const [operator, setOperator] = useState<string>(seedOperator);\n const [signers, setSigners] = useState<RosterRow[]>(seedRows);\n const [operatorChannel, setOperatorChannel] = useState<OperatorChannel>(\n () => seedOperatorChannel(operator, signers),\n );\n // Feeds the sr-only live region announcing the automatic channel\n // fallback below; any explicit choice clears it.\n const [revertedTo, setRevertedTo] = useState<OperatorChannel | null>(null);\n\n // Re-seed the form whenever the host reopens the (still-mounted) modal,\n // so a previous request's choices never leak into the next one.\n const wasOpen = useRef(open);\n useEffect(() => {\n if (open && !wasOpen.current) {\n const nextOperator = seedOperator();\n const nextRows = seedRows();\n setOperator(nextOperator);\n setSigners(nextRows);\n setOperatorChannel(seedOperatorChannel(nextOperator, nextRows));\n setRevertedTo(null);\n }\n wasOpen.current = open;\n // The seeds intentionally read the render-time props on the rising\n // edge only — prop changes while open (or closed) don't reset input.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open]);\n\n // Operator on-device signing piggybacks on a patient handover: it is\n // offerable only while a roster signer signs on this device, and falls\n // back to the operator's system default the moment the last on-device\n // row leaves. The fallback is announced via the live region — the\n // trigger lives in the roster section, far from the checkbox it moves.\n const anySignerOnDevice = signers.some(\n (signer) => signer.channel === 'on-device',\n );\n useEffect(() => {\n if (operatorChannel === 'on-device' && !anySignerOnDevice) {\n const fallback = operatorDefaultChannel(operator);\n setOperatorChannel(fallback);\n setRevertedTo(fallback);\n }\n // `operatorDefaultChannel` reads the render-time `operators` prop.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [operatorChannel, anySignerOnDevice, operator]);\n\n const operatorSelectOptions = allowAssignLater\n ? [\n ...operators,\n { value: ASSIGN_LATER, label: t('signatureRequest.assignLater') },\n ]\n : operators;\n const isUnassigned = operator === ASSIGN_LATER;\n\n const channelMeta: Record<\n SignatureChannel,\n { label: string; icon: React.ReactNode }\n > = {\n sms: {\n label: t('signatureRequest.viaSms'),\n icon: <MessageSquare className=\"ds:size-4\" aria-hidden />,\n },\n email: {\n label: t('signatureRequest.viaEmail'),\n icon: <Mail className=\"ds:size-4\" aria-hidden />,\n },\n whatsapp: {\n label: t('signatureRequest.viaWhatsapp'),\n icon: <WhatsAppGlyph className=\"ds:size-4\" aria-hidden />,\n },\n 'on-device': {\n label: t('signatureRequest.onThisDevice'),\n icon: <Tablet className=\"ds:size-4\" aria-hidden />,\n },\n };\n\n // Operator delivery — same checkbox visuals as the signer rows, minus\n // WhatsApp. No \"system defined\" option: the operator's own default\n // (e-mail or SMS per their settings) arrives pre-checked instead.\n // On-device greys out while no patient signer signs on this device;\n // an InfoTip explains why.\n const operatorChannelOptions: Array<{\n value: OperatorChannel;\n label: string;\n icon: React.ReactNode;\n disabled?: boolean;\n hint?: string;\n }> = [\n { value: 'sms', ...channelMeta.sms },\n { value: 'email', ...channelMeta.email },\n {\n value: 'on-device',\n ...channelMeta['on-device'],\n disabled: !anySignerOnDevice,\n hint: anySignerOnDevice\n ? undefined\n : t('signatureRequest.onDeviceUnavailableHint'),\n },\n ];\n\n const chosenIds = signers.map((signer) => signer.signerId);\n const nextFreeOption = signerOptions.find(\n (option) => !chosenIds.includes(option.value),\n );\n const canAddSigner =\n !busy && signers.length < maxSigners && nextFreeOption !== undefined;\n\n const patchSigner = (rowId: number, patch: Partial<SignerRequest>) => {\n setSigners((current) =>\n current.map((signer) =>\n signer.rowId === rowId ? { ...signer, ...patch } : signer,\n ),\n );\n };\n\n const addSigner = () => {\n if (!nextFreeOption) return;\n setSigners((current) => [\n ...current,\n {\n signerId: nextFreeOption.value,\n channel: resolveChannel(nextFreeOption.value, 'sms'),\n rowId: nextRowId.current++,\n },\n ]);\n };\n\n const removeSigner = (rowId: number) => {\n // Move focus BEFORE the row (and the focused remove button) unmounts —\n // otherwise Radix's focus scope dumps focus on the dialog container.\n addButtonRef.current?.focus();\n setSigners((current) =>\n current.filter((signer) => signer.rowId !== rowId),\n );\n };\n\n const handleRequest = () => {\n onRequestSignature({\n operatorId: !requireOperator || isUnassigned ? null : operator,\n operatorChannel:\n !requireOperator || isUnassigned ? null : operatorChannel,\n signers: requirePatient\n ? signers.map(({ rowId: _rowId, ...signer }) => signer)\n : [],\n });\n };\n\n return (\n <div ref={ref} className=\"ds:contents\" data-component=\"signature-request\">\n <Dialog open={open} onOpenChange={onOpenChange}>\n <Dialog.Content size=\"lg\" hideCloseButton {...contentProps}>\n <Dialog.Header>\n <Dialog.Title>\n {title ?? t('signatureRequest.title')}\n </Dialog.Title>\n <Dialog.Description>\n {description ?? t('signatureRequest.noSignedVersions')}\n </Dialog.Description>\n </Dialog.Header>\n\n <Dialog.Body className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n {requireOperator ? (\n <section className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\">\n <div className=\"ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]\">\n <p className=\"type-eyebrow ds:text-start ds:text-[color:var(--muted-foreground)]\">\n {t('signatureRequest.operatorSection')}\n </p>\n {currentOperatorId !== undefined ? (\n <Button\n intent=\"primary\"\n size=\"sm\"\n startIcon={<UserPlus />}\n disabled={busy}\n onClick={() => {\n setOperator(currentOperatorId);\n setOperatorChannel(\n operatorDefaultChannel(currentOperatorId),\n );\n setRevertedTo(null);\n }}\n >\n {t('signatureRequest.assignToMe')}\n </Button>\n ) : null}\n </div>\n\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-sm)]\">\n {/* Mirrors the select value — decorative for AT. No name →\n Avatar's built-in placeholder-icon fallback. */}\n <Avatar\n aria-hidden=\"true\"\n name={\n isUnassigned ? undefined : labelFor(operators, operator)\n }\n size=\"sm\"\n />\n <div className=\"ds:min-w-0 ds:flex-1 ds:text-start\">\n <Select\n options={operatorSelectOptions}\n value={operator}\n onValueChange={(value) => {\n if (!value) return;\n setOperator(value);\n // A different operator brings their own system\n // default along.\n setOperatorChannel(\n value === ASSIGN_LATER\n ? 'email'\n : operatorDefaultChannel(value),\n );\n setRevertedTo(null);\n }}\n required\n disabled={busy}\n placeholder={t('signatureRequest.operatorPlaceholder')}\n aria-label={t('signatureRequest.operatorSection')}\n />\n </div>\n </div>\n\n {/* One channel for the operator too — same mutually exclusive\n checkbox visuals as the signer rows. Hidden while the\n request is unassigned: there is nobody to deliver to. */}\n {isUnassigned ? null : (\n <div\n role=\"group\"\n aria-label={t('signatureRequest.operatorChannelLabel')}\n className=\"ds:flex ds:flex-wrap ds:items-center ds:gap-x-[var(--spacing-lg)] ds:gap-y-[var(--spacing-sm)] ds:ps-[var(--spacing-xl)]\"\n >\n {operatorChannelOptions.map((option) => (\n <span\n key={option.value}\n className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)]\"\n >\n <Checkbox\n checked={operatorChannel === option.value}\n disabled={busy || option.disabled}\n onCheckedChange={(checked) => {\n if (checked !== true) return;\n setOperatorChannel(option.value);\n setRevertedTo(null);\n }}\n label={\n <span className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n <span\n aria-hidden=\"true\"\n className=\"ds:text-[var(--accent)]\"\n >\n {option.icon}\n </span>\n {option.label}\n </span>\n }\n />\n {/* Sibling of the checkbox, never inside its label —\n the tip is its own interactive control. The wider\n gap keeps the tip's touch hit-area off the label. */}\n {option.hint ? (\n <InfoTip size=\"sm\" content={option.hint} />\n ) : null}\n </span>\n ))}\n </div>\n )}\n\n {/* Announces the automatic on-device → default fallback: the\n trigger (the patient's channel change) sits in another\n section, so the moved checkmark alone is not enough. */}\n <span role=\"status\" className=\"ds:sr-only\">\n {revertedTo\n ? t('signatureRequest.operatorChannelReverted', {\n channel: channelMeta[revertedTo].label,\n })\n : null}\n </span>\n </section>\n ) : null}\n\n {/* The rule only separates two sections that are both there. */}\n {requireOperator && requirePatient ? (\n <Separator decorative />\n ) : null}\n\n {requirePatient ? (\n <section className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:text-start\">\n <div className=\"ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]\">\n <p className=\"type-eyebrow ds:text-[color:var(--muted-foreground)]\">\n {t('signatureRequest.signersSection')}\n </p>\n {/* Offered only when the roster holds more than one\n person. A patient with nobody else to sign for them saw\n a permanently greyed action — a promise the modal could\n never keep. With two or more it stays, greying (not\n hiding) once every seat is taken so the cap reads. */}\n {signerOptions.length > 1 ? (\n <Button\n ref={addButtonRef}\n intent=\"primary\"\n size=\"sm\"\n startIcon={<Plus />}\n disabled={!canAddSigner}\n onClick={addSigner}\n >\n {t('signatureRequest.addSigner')}\n </Button>\n ) : null}\n </div>\n\n {signers.map((signer) => {\n const rowOptions = signerOptions.filter(\n (option) =>\n option.value === signer.signerId ||\n !chosenIds.includes(option.value),\n );\n const rowLabel = labelFor(signerOptions, signer.signerId);\n const rowChannelOptions = channelsFor(signer.signerId).map(\n (channel) => ({\n value: channel,\n ...channelMeta[channel],\n }),\n );\n return (\n <div\n key={signer.rowId}\n role=\"group\"\n aria-label={rowLabel}\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\"\n >\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-sm)]\">\n {/* Mirrors the select value — decorative for AT. */}\n <Avatar\n aria-hidden=\"true\"\n name={rowLabel}\n size=\"sm\"\n />\n <div className=\"ds:min-w-0 ds:flex-1\">\n <Select\n options={rowOptions}\n value={signer.signerId}\n onValueChange={(value) => {\n if (!value) return;\n const channel = resolveChannel(\n value,\n signer.channel,\n );\n patchSigner(signer.rowId, {\n signerId: value,\n channel,\n skipOtp:\n channel === 'on-device'\n ? signer.skipOtp\n : undefined,\n });\n }}\n required\n disabled={busy}\n placeholder={t(\n 'signatureRequest.signerPlaceholder',\n )}\n aria-label={t(\n 'signatureRequest.signerPlaceholder',\n )}\n />\n </div>\n {signers.length > 1 ? (\n <IconButton\n intent=\"ghost\"\n size=\"sm\"\n icon={<X />}\n disabled={busy}\n aria-label={t('signatureRequest.removeSigner')}\n onClick={() => removeSigner(signer.rowId)}\n />\n ) : null}\n </div>\n\n {/* One channel per signer — checkbox visuals, but the\n choice is mutually exclusive: checking a channel\n unchecks the others, and the active one can't be\n unchecked. */}\n <div\n role=\"group\"\n aria-label={t('signatureRequest.channelLabel')}\n className=\"ds:flex ds:flex-wrap ds:items-center ds:gap-x-[var(--spacing-lg)] ds:gap-y-[var(--spacing-sm)] ds:ps-[var(--spacing-xl)]\"\n >\n {rowChannelOptions.map((option) => (\n <Checkbox\n key={option.value}\n checked={signer.channel === option.value}\n disabled={busy}\n onCheckedChange={(checked) =>\n checked === true &&\n patchSigner(signer.rowId, {\n channel: option.value,\n skipOtp: undefined,\n })\n }\n label={\n <span className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n <span\n aria-hidden=\"true\"\n className=\"ds:text-[var(--accent)]\"\n >\n {option.icon}\n </span>\n {option.label}\n </span>\n }\n />\n ))}\n </div>\n\n {signer.channel === 'on-device' ? (\n <div className=\"ds:ps-[var(--spacing-xl)]\">\n <Switch\n label={t('signatureRequest.noOtp')}\n checked={signer.skipOtp === true}\n disabled={busy}\n onCheckedChange={(checked) =>\n patchSigner(signer.rowId, { skipOtp: checked })\n }\n />\n </div>\n ) : null}\n </div>\n );\n })}\n </section>\n ) : null}\n\n {/* Dedicated alert area — one warning regardless of how many\n signers waive OTP, stacked with any submission error, all at\n the same full width as the operator hint. */}\n {signers.some(\n (signer) =>\n signer.channel === 'on-device' && signer.skipOtp === true,\n ) ? (\n <Alert variant=\"warning\">\n <Alert.Description>\n {t('signatureRequest.noOtpWarning')}\n </Alert.Description>\n </Alert>\n ) : null}\n {error ? (\n <Alert variant=\"error\">\n <Alert.Description>{error}</Alert.Description>\n </Alert>\n ) : null}\n </Dialog.Body>\n\n <Dialog.Footer>\n <Button\n intent=\"primary\"\n startIcon={<PenLine />}\n onClick={handleRequest}\n disabled={\n busy ||\n (requirePatient && signers.length === 0) ||\n (!requirePatient && !requireOperator)\n }\n loading={busy}\n >\n {t('signatureRequest.requestSignature')}\n </Button>\n <Dialog.Close asChild>\n <Button intent=\"outline\" disabled={busy}>\n {t('signatureRequest.close')}\n </Button>\n </Dialog.Close>\n </Dialog.Footer>\n </Dialog.Content>\n </Dialog>\n </div>\n );\n },\n);\nSignatureRequestModal.displayName = 'SignatureRequestModal';\n"],"names":["__iconNode","Tablet","createLucideIcon","UserPlus","ASSIGN_LATER","CHANNEL_ORDER","labelFor","options","value","_a","option","SignatureRequestModal","forwardRef","open","onOpenChange","operators","signerOptions","currentOperatorId","allowAssignLater","requireOperator","requirePatient","initialOperatorId","initialOperatorChannel","initialSigners","maxSigners","busy","error","title","description","onRequestSignature","contentProps","ref","t","useTranslation","nextRowId","useRef","addButtonRef","channelsFor","signerId","allowed","channel","resolveChannel","preferred","available","seedOperator","_b","seedRows","signer","operatorDefaultChannel","operatorId","seedOperatorChannel","rows","operator","setOperator","useState","signers","setSigners","operatorChannel","setOperatorChannel","revertedTo","setRevertedTo","wasOpen","useEffect","nextOperator","nextRows","anySignerOnDevice","fallback","operatorSelectOptions","isUnassigned","channelMeta","jsx","MessageSquare","Mail","WhatsAppGlyph","operatorChannelOptions","chosenIds","nextFreeOption","canAddSigner","patchSigner","rowId","patch","current","addSigner","removeSigner","handleRequest","_rowId","Dialog","jsxs","Button","Avatar","Select","Checkbox","checked","InfoTip","Separator","Plus","rowOptions","rowLabel","rowChannelOptions","IconButton","X","Switch","Alert","PenLine"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE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nC,KAAkB,CAACD;AAAA,YAEvB,SAASM;AAAA,YAER,YAAE,mCAAmC;AAAA,UAAA;AAAA,QAAA;AAAA,QAExC,gBAAA6C,EAACgB,EAAO,OAAP,EAAa,SAAO,IACnB,UAAA,gBAAAhB,EAACkB,GAAA,EAAO,QAAO,WAAU,UAAU/D,GAChC,UAAAO,EAAE,wBAAwB,GAC7B,EAAA,CACF;AAAA,MAAA,EAAA,CACF;AAAA,IAAA,EAAA,CACF,GACF,GACF;AAAA,EAEJ;AACF;AACArB,GAAsB,cAAc;","x_google_ignoreList":[0,1]}
|
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { forwardRef as
|
|
1
|
+
import { jsx as e, jsxs as c, Fragment as j } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as P, useMemo as B, useImperativeHandle as D } from "react";
|
|
3
3
|
import * as m from "@radix-ui/react-accordion";
|
|
4
|
-
import { c as
|
|
5
|
-
import { useTranslation as
|
|
6
|
-
import { C as
|
|
7
|
-
import { L as
|
|
8
|
-
function
|
|
9
|
-
return r === "error" ? "error" :
|
|
4
|
+
import { c as b } from "./index-D2ZczOXr.js";
|
|
5
|
+
import { useTranslation as G } from "react-i18next";
|
|
6
|
+
import { C as H } from "./chevron-down-DWE7GSq9.js";
|
|
7
|
+
import { L as U } from "./lock-ClAFG1gy.js";
|
|
8
|
+
function W(s, i, r) {
|
|
9
|
+
return r === "error" ? "error" : s === i ? "current" : r === "completed" || s < i ? "completed" : "upcoming";
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
function O(s, i, r) {
|
|
12
|
+
return r !== void 0 ? !0 : s <= i;
|
|
13
|
+
}
|
|
14
|
+
const C = "step-", w = (s) => `${C}${s}`, X = (s) => Number(s.slice(C.length)), h = [
|
|
12
15
|
"ds:[stroke-dasharray:1] ds:[stroke-dashoffset:1]",
|
|
13
16
|
"ds:animate-[stepper-icon-draw_var(--animation-duration)_var(--ease-out)_forwards]",
|
|
14
17
|
"ds:motion-reduce:animate-none ds:motion-reduce:[stroke-dashoffset:0]"
|
|
15
18
|
].join(" ");
|
|
16
|
-
function
|
|
19
|
+
function q() {
|
|
17
20
|
return /* @__PURE__ */ e(
|
|
18
21
|
"svg",
|
|
19
22
|
{
|
|
@@ -25,12 +28,12 @@ function W() {
|
|
|
25
28
|
strokeLinejoin: "round",
|
|
26
29
|
"aria-hidden": "true",
|
|
27
30
|
className: "ds:size-4",
|
|
28
|
-
children: /* @__PURE__ */ e("path", { pathLength: "1", d: "M5 12l5 5L20 7", className:
|
|
31
|
+
children: /* @__PURE__ */ e("path", { pathLength: "1", d: "M5 12l5 5L20 7", className: h })
|
|
29
32
|
}
|
|
30
33
|
);
|
|
31
34
|
}
|
|
32
|
-
function
|
|
33
|
-
return /* @__PURE__ */
|
|
35
|
+
function J() {
|
|
36
|
+
return /* @__PURE__ */ c(
|
|
34
37
|
"svg",
|
|
35
38
|
{
|
|
36
39
|
viewBox: "0 0 24 24",
|
|
@@ -42,13 +45,13 @@ function O() {
|
|
|
42
45
|
"aria-hidden": "true",
|
|
43
46
|
className: "ds:size-4",
|
|
44
47
|
children: [
|
|
45
|
-
/* @__PURE__ */ e("path", { pathLength: "1", d: "M6 6l12 12", className:
|
|
46
|
-
/* @__PURE__ */ e("path", { pathLength: "1", d: "M18 6l-12 12", className:
|
|
48
|
+
/* @__PURE__ */ e("path", { pathLength: "1", d: "M6 6l12 12", className: h }),
|
|
49
|
+
/* @__PURE__ */ e("path", { pathLength: "1", d: "M18 6l-12 12", className: h })
|
|
47
50
|
]
|
|
48
51
|
}
|
|
49
52
|
);
|
|
50
53
|
}
|
|
51
|
-
const
|
|
54
|
+
const K = [
|
|
52
55
|
"ds:inline-flex ds:shrink-0 ds:items-center ds:justify-center",
|
|
53
56
|
"ds:min-w-[var(--min-target-size)] ds:min-h-[var(--min-target-size)]",
|
|
54
57
|
"ds:size-[var(--min-target-size)]",
|
|
@@ -58,7 +61,7 @@ const X = [
|
|
|
58
61
|
"ds:transition-[background-color,border-color,color]",
|
|
59
62
|
"ds:duration-[var(--animation-duration)] ds:ease-[var(--ease-out)]",
|
|
60
63
|
"ds:motion-reduce:transition-none"
|
|
61
|
-
].join(" "),
|
|
64
|
+
].join(" "), Q = b(K, {
|
|
62
65
|
variants: {
|
|
63
66
|
state: {
|
|
64
67
|
upcoming: "ds:bg-[var(--background)] ds:text-[var(--muted-foreground)]",
|
|
@@ -75,7 +78,7 @@ const X = [
|
|
|
75
78
|
].join(" ")
|
|
76
79
|
}
|
|
77
80
|
}
|
|
78
|
-
}),
|
|
81
|
+
}), Y = b(
|
|
79
82
|
[
|
|
80
83
|
"ds:group/item ds:overflow-hidden ds:rounded-[var(--radius-md)]",
|
|
81
84
|
"ds:border ds:border-[color:var(--card-border)] ds:[.theme-accessible_&]:border-2 ds:bg-[var(--card)]",
|
|
@@ -92,7 +95,7 @@ const X = [
|
|
|
92
95
|
},
|
|
93
96
|
defaultVariants: { tone: "neutral" }
|
|
94
97
|
}
|
|
95
|
-
),
|
|
98
|
+
), Z = [
|
|
96
99
|
"ds:flex ds:w-full ds:items-center ds:gap-[var(--spacing-sm)]",
|
|
97
100
|
"ds:min-h-[var(--min-target-size)]",
|
|
98
101
|
"ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]",
|
|
@@ -104,144 +107,144 @@ const X = [
|
|
|
104
107
|
"ds:transition-[background-color] ds:duration-[var(--animation-duration)] ds:ease-[var(--ease-out)]",
|
|
105
108
|
"ds:motion-reduce:transition-none",
|
|
106
109
|
"ds:hover:enabled:bg-[var(--muted)]/40"
|
|
107
|
-
].join(" "),
|
|
110
|
+
].join(" "), S = (s) => [
|
|
108
111
|
"type-body-sm",
|
|
109
|
-
|
|
110
|
-
].join(" "),
|
|
112
|
+
s === "current" || s === "error" ? "ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)]" : s === "completed" ? "ds:text-[var(--foreground)]" : "ds:text-[var(--muted-foreground)]"
|
|
113
|
+
].join(" "), ee = [
|
|
111
114
|
"type-meta ds:text-[var(--muted-foreground)]",
|
|
112
115
|
"ds:mt-[var(--spacing-xs)]"
|
|
113
|
-
].join(" "),
|
|
116
|
+
].join(" "), g = [
|
|
114
117
|
"type-meta",
|
|
115
118
|
"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]",
|
|
116
119
|
"ds:text-[var(--muted-foreground)]"
|
|
117
|
-
].join(" "),
|
|
120
|
+
].join(" "), re = [
|
|
118
121
|
"ds:size-4 ds:shrink-0 ds:text-[var(--muted-foreground)]",
|
|
119
122
|
"ds:transition-transform ds:duration-[var(--animation-duration)] ds:ease-[var(--ease-out)]",
|
|
120
123
|
"ds:motion-reduce:transition-none",
|
|
121
124
|
"ds:group-data-[state=open]/item:rotate-180"
|
|
122
|
-
].join(" "),
|
|
125
|
+
].join(" "), se = [
|
|
123
126
|
"type-meta ds:text-[var(--muted-foreground)]",
|
|
124
127
|
"ds:ps-[calc(var(--min-target-size)+var(--spacing-md)+var(--spacing-sm))]",
|
|
125
128
|
"ds:pe-[var(--spacing-md)] ds:pb-[var(--spacing-sm)]",
|
|
126
129
|
"ds:group-data-[state=open]/item:hidden"
|
|
127
|
-
].join(" "),
|
|
130
|
+
].join(" "), ae = [
|
|
128
131
|
"ds:overflow-hidden",
|
|
129
132
|
"ds:data-[state=open]:animate-[accordion-down_var(--animation-duration)_var(--ease-out)]",
|
|
130
133
|
"ds:data-[state=closed]:animate-[accordion-up_var(--animation-duration)_var(--ease-in)]"
|
|
131
|
-
].join(" "),
|
|
134
|
+
].join(" "), te = [
|
|
132
135
|
"ds:ps-[calc(var(--min-target-size)+var(--spacing-md)+var(--spacing-sm))]",
|
|
133
136
|
"ds:pe-[var(--spacing-md)] ds:pt-[var(--spacing-xs)] ds:pb-[var(--spacing-md)]"
|
|
134
|
-
].join(" "),
|
|
137
|
+
].join(" "), ne = b("ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", {
|
|
135
138
|
variants: {}
|
|
136
|
-
}),
|
|
139
|
+
}), oe = P(
|
|
137
140
|
({
|
|
138
|
-
activeStep:
|
|
139
|
-
steps:
|
|
141
|
+
activeStep: s,
|
|
142
|
+
steps: i,
|
|
140
143
|
onStepChange: r,
|
|
141
|
-
"aria-label":
|
|
142
|
-
id:
|
|
143
|
-
className:
|
|
144
|
-
...
|
|
145
|
-
},
|
|
146
|
-
const { t: d } =
|
|
144
|
+
"aria-label": _,
|
|
145
|
+
id: x,
|
|
146
|
+
className: z,
|
|
147
|
+
...L
|
|
148
|
+
}, M) => {
|
|
149
|
+
const { t: d } = G(), l = i.length, n = Math.max(0, Math.min(s, l - 1)), V = _ ?? d("navigation.stepper.label"), y = d("navigation.stepper.edit"), N = d("navigation.stepper.open"), $ = d("navigation.stepper.locked"), A = d("navigation.stepper.completed"), F = d("navigation.stepper.error"), I = (t) => {
|
|
147
150
|
if (!t) return;
|
|
148
|
-
const
|
|
149
|
-
Number.isFinite(
|
|
150
|
-
},
|
|
151
|
+
const a = X(t);
|
|
152
|
+
Number.isFinite(a) && a !== n && (r == null || r(a));
|
|
153
|
+
}, k = B(
|
|
151
154
|
() => ({
|
|
152
|
-
getCurrentStep: () =>
|
|
155
|
+
getCurrentStep: () => n,
|
|
153
156
|
getTotalSteps: () => l,
|
|
154
|
-
getOpenSteps: () => [
|
|
157
|
+
getOpenSteps: () => [n],
|
|
155
158
|
gotoStep: (t) => {
|
|
156
159
|
if (!r) return;
|
|
157
|
-
const
|
|
158
|
-
|
|
160
|
+
const a = Math.max(0, Math.min(t, Math.max(l - 1, 0)));
|
|
161
|
+
a !== n && r(a);
|
|
159
162
|
},
|
|
160
163
|
next: () => {
|
|
161
|
-
r &&
|
|
164
|
+
r && n < l - 1 && r(n + 1);
|
|
162
165
|
},
|
|
163
166
|
previous: () => {
|
|
164
|
-
r &&
|
|
167
|
+
r && n > 0 && r(n - 1);
|
|
165
168
|
}
|
|
166
169
|
}),
|
|
167
|
-
[
|
|
170
|
+
[n, l, r]
|
|
168
171
|
);
|
|
169
|
-
return
|
|
172
|
+
return D(M, () => k, [k]), /* @__PURE__ */ e(
|
|
170
173
|
m.Root,
|
|
171
174
|
{
|
|
172
175
|
type: "single",
|
|
173
|
-
value:
|
|
174
|
-
onValueChange:
|
|
176
|
+
value: w(n),
|
|
177
|
+
onValueChange: I,
|
|
175
178
|
collapsible: !1,
|
|
176
|
-
"aria-label":
|
|
177
|
-
id:
|
|
179
|
+
"aria-label": V,
|
|
180
|
+
id: x,
|
|
178
181
|
"data-component": "stepper-accordion",
|
|
179
|
-
"data-component-id":
|
|
180
|
-
className:
|
|
181
|
-
...
|
|
182
|
-
children:
|
|
183
|
-
const
|
|
184
|
-
/* @__PURE__ */ e(
|
|
185
|
-
/* @__PURE__ */ e("span", { className: "ds:sr-only", children:
|
|
186
|
-
] }) :
|
|
187
|
-
/* @__PURE__ */ e(
|
|
188
|
-
/* @__PURE__ */ e("span", { className: "ds:sr-only", children:
|
|
189
|
-
] }) : /* @__PURE__ */ e("span", { children:
|
|
190
|
-
/* @__PURE__ */ e(
|
|
191
|
-
|
|
192
|
-
] }) : null;
|
|
193
|
-
return /* @__PURE__ */
|
|
182
|
+
"data-component-id": x,
|
|
183
|
+
className: ne({ className: z }),
|
|
184
|
+
...L,
|
|
185
|
+
children: i.map((t, a) => {
|
|
186
|
+
const o = W(a, n, t.status), u = o === "current" || o === "error", p = o === "upcoming", v = p && !O(a, n, t.status), T = o === "error" ? "error" : "neutral", f = d("navigation.stepper.stepN", { n: a + 1 }), R = o === "completed" ? /* @__PURE__ */ c(j, { children: [
|
|
187
|
+
/* @__PURE__ */ e(q, {}),
|
|
188
|
+
/* @__PURE__ */ e("span", { className: "ds:sr-only", children: A })
|
|
189
|
+
] }) : o === "error" ? /* @__PURE__ */ c(j, { children: [
|
|
190
|
+
/* @__PURE__ */ e(J, {}),
|
|
191
|
+
/* @__PURE__ */ e("span", { className: "ds:sr-only", children: F })
|
|
192
|
+
] }) : /* @__PURE__ */ e("span", { children: a + 1 }), E = o === "completed" ? /* @__PURE__ */ e("span", { className: g, children: y }) : v ? /* @__PURE__ */ c("span", { className: g, children: [
|
|
193
|
+
/* @__PURE__ */ e(U, { "aria-hidden": "true", className: "ds:size-3" }),
|
|
194
|
+
$
|
|
195
|
+
] }) : p ? /* @__PURE__ */ e("span", { className: g, children: N }) : null;
|
|
196
|
+
return /* @__PURE__ */ c(
|
|
194
197
|
m.Item,
|
|
195
198
|
{
|
|
196
|
-
value:
|
|
197
|
-
"data-step-id": String(
|
|
198
|
-
className:
|
|
199
|
+
value: w(a),
|
|
200
|
+
"data-step-id": String(a),
|
|
201
|
+
className: Y({ tone: T }),
|
|
199
202
|
children: [
|
|
200
|
-
/* @__PURE__ */ e(m.Header, { className: "ds:flex", children: /* @__PURE__ */
|
|
203
|
+
/* @__PURE__ */ e(m.Header, { className: "ds:flex", children: /* @__PURE__ */ c(
|
|
201
204
|
m.Trigger,
|
|
202
205
|
{
|
|
203
|
-
disabled:
|
|
206
|
+
disabled: v,
|
|
204
207
|
"aria-disabled": u || void 0,
|
|
205
|
-
"aria-label":
|
|
208
|
+
"aria-label": o === "completed" ? `${f}, ${y}` : p && !v ? `${f}, ${N}` : f,
|
|
206
209
|
"aria-current": u ? "step" : void 0,
|
|
207
|
-
className:
|
|
210
|
+
className: Z,
|
|
208
211
|
children: [
|
|
209
212
|
/* @__PURE__ */ e(
|
|
210
213
|
"span",
|
|
211
214
|
{
|
|
212
215
|
"aria-hidden": "true",
|
|
213
|
-
className:
|
|
214
|
-
children:
|
|
216
|
+
className: Q({ state: o }),
|
|
217
|
+
children: R
|
|
215
218
|
}
|
|
216
219
|
),
|
|
217
|
-
/* @__PURE__ */
|
|
218
|
-
/* @__PURE__ */ e("span", { className:
|
|
219
|
-
t.description ? /* @__PURE__ */ e("span", { className:
|
|
220
|
+
/* @__PURE__ */ c("span", { className: "ds:flex ds:min-w-0 ds:flex-1 ds:flex-col", children: [
|
|
221
|
+
/* @__PURE__ */ e("span", { className: S(o), children: t.label }),
|
|
222
|
+
t.description ? /* @__PURE__ */ e("span", { className: ee, children: t.description }) : null
|
|
220
223
|
] }),
|
|
221
|
-
|
|
224
|
+
E,
|
|
222
225
|
u ? null : /* @__PURE__ */ e(
|
|
223
|
-
|
|
226
|
+
H,
|
|
224
227
|
{
|
|
225
228
|
"aria-hidden": "true",
|
|
226
|
-
className:
|
|
229
|
+
className: re
|
|
227
230
|
}
|
|
228
231
|
)
|
|
229
232
|
]
|
|
230
233
|
}
|
|
231
234
|
) }),
|
|
232
|
-
t.summary &&
|
|
233
|
-
/* @__PURE__ */ e(m.Content, { className:
|
|
235
|
+
t.summary && o === "completed" ? /* @__PURE__ */ e("div", { className: se, children: t.summary }) : null,
|
|
236
|
+
/* @__PURE__ */ e(m.Content, { className: ae, children: /* @__PURE__ */ e("div", { className: te, children: t.content }) })
|
|
234
237
|
]
|
|
235
238
|
},
|
|
236
|
-
|
|
239
|
+
a
|
|
237
240
|
);
|
|
238
241
|
})
|
|
239
242
|
}
|
|
240
243
|
);
|
|
241
244
|
}
|
|
242
245
|
);
|
|
243
|
-
|
|
246
|
+
oe.displayName = "StepperAccordion";
|
|
244
247
|
export {
|
|
245
|
-
|
|
248
|
+
oe as S
|
|
246
249
|
};
|
|
247
|
-
//# sourceMappingURL=stepper-accordion-
|
|
250
|
+
//# sourceMappingURL=stepper-accordion-DmVykr5F.js.map
|