@alfadocs/ui-kit-debug 1.12.6 → 1.14.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.
- package/dist/_chunks/actions-cell-renderer-yy03OgRL.js +137 -0
- package/dist/_chunks/actions-cell-renderer-yy03OgRL.js.map +1 -0
- package/dist/_chunks/{address-fields-CZP4Wncx.js → address-fields-CZ0pEdEI.js} +4 -4
- package/dist/_chunks/{address-fields-CZP4Wncx.js.map → address-fields-CZ0pEdEI.js.map} +1 -1
- package/dist/_chunks/{ai-prompt-input-DnbfEJnr.js → ai-prompt-input-CrHr-5H8.js} +2 -2
- package/dist/_chunks/{ai-prompt-input-DnbfEJnr.js.map → ai-prompt-input-CrHr-5H8.js.map} +1 -1
- package/dist/_chunks/{anamnesis-summary-rows-BfhxWPO3.js → anamnesis-summary-rows-CRWO8x8g.js} +4 -4
- package/dist/_chunks/{anamnesis-summary-rows-BfhxWPO3.js.map → anamnesis-summary-rows-CRWO8x8g.js.map} +1 -1
- package/dist/_chunks/{audio-recorder-EWBCNIsd.js → audio-recorder-DXG6LTtO.js} +2 -2
- package/dist/_chunks/{audio-recorder-EWBCNIsd.js.map → audio-recorder-DXG6LTtO.js.map} +1 -1
- package/dist/_chunks/{autocomplete-BrONKN8l.js → autocomplete-MpBhz-fG.js} +86 -74
- package/dist/_chunks/{autocomplete-BrONKN8l.js.map → autocomplete-MpBhz-fG.js.map} +1 -1
- package/dist/_chunks/{balance-badge-cell-7L6nzB29.js → balance-badge-cell-CgkxYO96.js} +9 -8
- package/dist/_chunks/{balance-badge-cell-7L6nzB29.js.map → balance-badge-cell-CgkxYO96.js.map} +1 -1
- package/dist/_chunks/{bishop-score-Cnu0xs-z.js → bishop-score-CJUVBfAu.js} +2 -2
- package/dist/_chunks/{bishop-score-Cnu0xs-z.js.map → bishop-score-CJUVBfAu.js.map} +1 -1
- package/dist/_chunks/{booking-CBHKdsZl.js → booking-DQbo6mQF.js} +609 -591
- package/dist/_chunks/booking-DQbo6mQF.js.map +1 -0
- package/dist/_chunks/{calendar-B4Gnyu1C.js → calendar-CHT9Rm3M.js} +2 -2
- package/dist/_chunks/{calendar-B4Gnyu1C.js.map → calendar-CHT9Rm3M.js.map} +1 -1
- package/dist/_chunks/{calendar-event-card-Bjdbik8G.js → calendar-event-card-BjdHZaqz.js} +18 -14
- package/dist/_chunks/{calendar-event-card-Bjdbik8G.js.map → calendar-event-card-BjdHZaqz.js.map} +1 -1
- package/dist/_chunks/calendar-plus-BFrIRE4r.js +19 -0
- package/dist/_chunks/calendar-plus-BFrIRE4r.js.map +1 -0
- package/dist/_chunks/calendar-workspace-DI49_t6t.js +7429 -0
- package/dist/_chunks/calendar-workspace-DI49_t6t.js.map +1 -0
- package/dist/_chunks/{care-plan-card-aDN4oem9.js → care-plan-card-D-FMfDKH.js} +2 -2
- package/dist/_chunks/{care-plan-card-aDN4oem9.js.map → care-plan-card-D-FMfDKH.js.map} +1 -1
- package/dist/_chunks/{care-plan-entry-card-BEhANdBE.js → care-plan-entry-card-Bvw_9T-d.js} +2 -2
- package/dist/_chunks/{care-plan-entry-card-BEhANdBE.js.map → care-plan-entry-card-Bvw_9T-d.js.map} +1 -1
- package/dist/_chunks/{care-plan-header-CkpPyQqG.js → care-plan-header-B5CBE0zu.js} +2 -2
- package/dist/_chunks/{care-plan-header-CkpPyQqG.js.map → care-plan-header-B5CBE0zu.js.map} +1 -1
- package/dist/_chunks/{city-input-towzBenY.js → city-input-DaQc-Hbj.js} +2 -2
- package/dist/_chunks/{city-input-towzBenY.js.map → city-input-DaQc-Hbj.js.map} +1 -1
- package/dist/_chunks/clipboard-list-rSzfIYZB.js +25 -0
- package/dist/_chunks/clipboard-list-rSzfIYZB.js.map +1 -0
- package/dist/_chunks/{color-picker-oZ6zYks8.js → color-picker-CU303VjY.js} +4 -2
- package/dist/_chunks/{color-picker-oZ6zYks8.js.map → color-picker-CU303VjY.js.map} +1 -1
- package/dist/_chunks/{combobox-DiMLItyu.js → combobox-D7_NLE2Z.js} +89 -81
- package/dist/_chunks/{combobox-DiMLItyu.js.map → combobox-D7_NLE2Z.js.map} +1 -1
- package/dist/_chunks/{contact-profile-card-BMIBr5s9.js → contact-profile-card-BZqi8Hck.js} +38 -36
- package/dist/_chunks/{contact-profile-card-BMIBr5s9.js.map → contact-profile-card-BZqi8Hck.js.map} +1 -1
- package/dist/_chunks/{country-select-UEF9BEeQ.js → country-select-DzbPFktV.js} +2 -2
- package/dist/_chunks/{country-select-UEF9BEeQ.js.map → country-select-DzbPFktV.js.map} +1 -1
- package/dist/_chunks/data-table-DC5rO3Ty.js +1817 -0
- package/dist/_chunks/data-table-DC5rO3Ty.js.map +1 -0
- package/dist/_chunks/{document-preview-oyx9RhCo.js → document-preview-CDb-n_W7.js} +2 -2
- package/dist/_chunks/{document-preview-oyx9RhCo.js.map → document-preview-CDb-n_W7.js.map} +1 -1
- package/dist/_chunks/{face-scheme-CZaKm6fG.js → face-scheme-DA2vjqaM.js} +2 -2
- package/dist/_chunks/{face-scheme-CZaKm6fG.js.map → face-scheme-DA2vjqaM.js.map} +1 -1
- package/dist/_chunks/{field-value-DG8zaZvo.js → field-value-D-vkX9uL.js} +120 -140
- package/dist/_chunks/field-value-D-vkX9uL.js.map +1 -0
- package/dist/_chunks/{file-manager-C0y7HBAN.js → file-manager-DJMeB3V8.js} +138 -153
- package/dist/_chunks/file-manager-DJMeB3V8.js.map +1 -0
- package/dist/_chunks/folder-plus-CutOs4DP.js +22 -0
- package/dist/_chunks/folder-plus-CutOs4DP.js.map +1 -0
- package/dist/_chunks/{gestational-age-calculator-CxZelpu2.js → gestational-age-calculator-CiOQjzgx.js} +2 -2
- package/dist/_chunks/{gestational-age-calculator-CxZelpu2.js.map → gestational-age-calculator-CiOQjzgx.js.map} +1 -1
- package/dist/_chunks/hourglass-BEAzW1wE.js +26 -0
- package/dist/_chunks/hourglass-BEAzW1wE.js.map +1 -0
- package/dist/_chunks/key-value-pair-BIBdZBLg.js +188 -0
- package/dist/_chunks/key-value-pair-BIBdZBLg.js.map +1 -0
- package/dist/_chunks/{link-cell-renderer-CenJx-_7.js → link-cell-renderer-CIASXsVM.js} +4 -4
- package/dist/_chunks/{link-cell-renderer-CenJx-_7.js.map → link-cell-renderer-CIASXsVM.js.map} +1 -1
- package/dist/_chunks/{multi-select-DqL4o0qV.js → multi-select-DYOvx2SJ.js} +56 -48
- package/dist/_chunks/{multi-select-DqL4o0qV.js.map → multi-select-DYOvx2SJ.js.map} +1 -1
- package/dist/_chunks/{muscle-scheme-yfzP_xoJ.js → muscle-scheme-BSJsI4-I.js} +2 -2
- package/dist/_chunks/{muscle-scheme-yfzP_xoJ.js.map → muscle-scheme-BSJsI4-I.js.map} +1 -1
- package/dist/_chunks/{notes-panel-CymneXtl.js → notes-panel-DYAtlq_i.js} +2 -2
- package/dist/_chunks/{notes-panel-CymneXtl.js.map → notes-panel-DYAtlq_i.js.map} +1 -1
- package/dist/_chunks/{optical-prescription-Dj3Eh5Ok.js → optical-prescription-BvwuqTpl.js} +2 -2
- package/dist/_chunks/{optical-prescription-Dj3Eh5Ok.js.map → optical-prescription-BvwuqTpl.js.map} +1 -1
- package/dist/_chunks/{patient-details-xrqe13az.js → patient-details-BfzvFnxQ.js} +75 -94
- package/dist/_chunks/patient-details-BfzvFnxQ.js.map +1 -0
- package/dist/_chunks/{patient-search-D5ufYoRc.js → patient-search-HeEUB-_X.js} +2 -2
- package/dist/_chunks/{patient-search-D5ufYoRc.js.map → patient-search-HeEUB-_X.js.map} +1 -1
- package/dist/_chunks/{patient-summary-card-CBfuDvJ5.js → patient-summary-card-D5Vfa321.js} +3 -3
- package/dist/_chunks/{patient-summary-card-CBfuDvJ5.js.map → patient-summary-card-D5Vfa321.js.map} +1 -1
- package/dist/_chunks/{payment-request-card-YVCcCZ25.js → payment-request-card-lmKLwsDs.js} +2 -2
- package/dist/_chunks/{payment-request-card-YVCcCZ25.js.map → payment-request-card-lmKLwsDs.js.map} +1 -1
- package/dist/_chunks/{periodontal-chart-BatZEFar.js → periodontal-chart-B9fphroR.js} +2 -2
- package/dist/_chunks/{periodontal-chart-BatZEFar.js.map → periodontal-chart-B9fphroR.js.map} +1 -1
- package/dist/_chunks/{periodontal-chart-card-BBpY_rBc.js → periodontal-chart-card-qEZPXj83.js} +2 -2
- package/dist/_chunks/{periodontal-chart-card-BBpY_rBc.js.map → periodontal-chart-card-qEZPXj83.js.map} +1 -1
- package/dist/_chunks/{practice-results-D7ygCj_W.js → practice-results-DL_ExLYE.js} +159 -172
- package/dist/_chunks/practice-results-DL_ExLYE.js.map +1 -0
- package/dist/_chunks/{pregnancy-dating-DtToyMyc.js → pregnancy-dating-D2wchD11.js} +2 -2
- package/dist/_chunks/{pregnancy-dating-DtToyMyc.js.map → pregnancy-dating-D2wchD11.js.map} +1 -1
- package/dist/_chunks/{province-select-BDywtmL-.js → province-select-BBc7s7vR.js} +2 -2
- package/dist/_chunks/{province-select-BDywtmL-.js.map → province-select-BBc7s7vR.js.map} +1 -1
- package/dist/_chunks/{rich-text-editor-BDfFtK4H.js → rich-text-editor-DtbcA6s1.js} +2 -2
- package/dist/_chunks/{rich-text-editor-BDfFtK4H.js.map → rich-text-editor-DtbcA6s1.js.map} +1 -1
- package/dist/_chunks/{select-BW5ecXlX.js → select-Bi8zril7.js} +165 -136
- package/dist/_chunks/select-Bi8zril7.js.map +1 -0
- package/dist/_chunks/signature-CpFNpsVK.js +21 -0
- package/dist/_chunks/signature-CpFNpsVK.js.map +1 -0
- package/dist/_chunks/{signature-field-0rFODJlW.js → signature-field-CEiPe-vX.js} +19 -34
- package/dist/_chunks/signature-field-CEiPe-vX.js.map +1 -0
- package/dist/_chunks/{signature-request-DVDTKLjM.js → signature-request-CUe903hj.js} +2 -2
- package/dist/_chunks/{signature-request-DVDTKLjM.js.map → signature-request-CUe903hj.js.map} +1 -1
- package/dist/_chunks/smartphone-C0rFF2if.js +15 -0
- package/dist/_chunks/smartphone-C0rFF2if.js.map +1 -0
- package/dist/_chunks/{tabs-CBb2AidH.js → tabs-DqKtTIjZ.js} +2 -2
- package/dist/_chunks/{tabs-CBb2AidH.js.map → tabs-DqKtTIjZ.js.map} +1 -1
- package/dist/_chunks/{tasks-panel-Do5SFp-j.js → tasks-panel-DPCNaRko.js} +2 -2
- package/dist/_chunks/{tasks-panel-Do5SFp-j.js.map → tasks-panel-DPCNaRko.js.map} +1 -1
- package/dist/_chunks/{toast.agent-D1tdg6DS.js → toast-YZz2sBzB.js} +160 -212
- package/dist/_chunks/toast-YZz2sBzB.js.map +1 -0
- package/dist/_chunks/toast.agent-DNQ0JYGv.js +56 -0
- package/dist/_chunks/toast.agent-DNQ0JYGv.js.map +1 -0
- package/dist/_chunks/{tooth-scheme-WdyVymQ1.js → tooth-scheme-2IsmbE6w.js} +2 -2
- package/dist/_chunks/{tooth-scheme-WdyVymQ1.js.map → tooth-scheme-2IsmbE6w.js.map} +1 -1
- package/dist/_chunks/{unit-converter-BPumXMA6.js → unit-converter-C6jMjqL9.js} +2 -2
- package/dist/_chunks/{unit-converter-BPumXMA6.js.map → unit-converter-C6jMjqL9.js.map} +1 -1
- package/dist/_chunks/{workflow-map-DE_ribRM.js → workflow-map-dNzJjBWG.js} +104 -113
- package/dist/_chunks/workflow-map-dNzJjBWG.js.map +1 -0
- package/dist/agent-catalog.json +867 -1
- package/dist/agent-i18n/en.json +27 -0
- package/dist/components/_shared/option.d.ts +1 -0
- package/dist/components/_shared/option.d.ts.map +1 -1
- package/dist/components/address-fields/index.js +1 -1
- package/dist/components/ai-prompt-input/index.js +1 -1
- package/dist/components/audio-recorder/index.js +1 -1
- package/dist/components/autocomplete/autocomplete.d.ts.map +1 -1
- package/dist/components/autocomplete/index.js +1 -1
- package/dist/components/bishop-score/index.js +1 -1
- package/dist/components/booking/booking.d.ts.map +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/calendar/index.js +1 -1
- package/dist/components/calendar-event-card/index.js +1 -1
- package/dist/components/care-plan-card/index.js +1 -1
- package/dist/components/care-plan-entry-card/index.js +1 -1
- package/dist/components/care-plan-header/index.js +1 -1
- package/dist/components/city-input/index.js +1 -1
- package/dist/components/color-picker/index.js +1 -1
- package/dist/components/combobox/combobox.d.ts.map +1 -1
- package/dist/components/combobox/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/country-select/index.js +1 -1
- package/dist/components/data-table/index.js +39 -38
- package/dist/components/data-table/index.js.map +1 -1
- package/dist/components/document-preview/index.js +1 -1
- package/dist/components/face-scheme/index.js +1 -1
- package/dist/components/file-manager/index.js +1 -1
- package/dist/components/gestational-age-calculator/index.js +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/key-value-pair/index.js +1 -1
- package/dist/components/key-value-pair/key-value-pair.d.ts +16 -0
- package/dist/components/key-value-pair/key-value-pair.d.ts.map +1 -1
- package/dist/components/multi-select/index.js +1 -1
- package/dist/components/multi-select/multi-select.d.ts.map +1 -1
- package/dist/components/muscle-scheme/index.js +1 -1
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/optical-prescription/index.js +1 -1
- package/dist/components/patient-details/index.js +1 -1
- package/dist/components/patient-search/index.js +1 -1
- package/dist/components/patient-summary-card/index.js +1 -1
- package/dist/components/patient-table/index.js +1 -1
- package/dist/components/payment-card/index.js +1 -1
- package/dist/components/periodontal-chart/index.js +1 -1
- package/dist/components/periodontal-chart-card/index.js +1 -1
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/pregnancy-dating/index.js +1 -1
- package/dist/components/province-select/index.js +1 -1
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/select/index.js +1 -1
- package/dist/components/select/select.d.ts +24 -0
- package/dist/components/select/select.d.ts.map +1 -1
- package/dist/components/signature-field/index.js +1 -1
- package/dist/components/skeleton-scheme/index.js +1 -1
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/tasks-panel/index.js +1 -1
- package/dist/components/toast/index.js +7 -6
- package/dist/components/toast/index.js.map +1 -1
- package/dist/components/tooth-scheme/index.js +1 -1
- package/dist/components/unit-converter/index.js +1 -1
- package/dist/components/workflow/index.js +1 -1
- package/dist/i18n/locales/ar.d.ts +680 -0
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +680 -0
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts +680 -0
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +680 -0
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/el.d.ts +680 -0
- package/dist/i18n/locales/el.d.ts.map +1 -1
- package/dist/i18n/locales/el.js +680 -0
- package/dist/i18n/locales/el.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +680 -0
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +680 -0
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +680 -0
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +680 -0
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +680 -0
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +680 -0
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts +680 -0
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +680 -0
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +680 -0
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +680 -0
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts +680 -0
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +680 -0
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts +680 -0
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +680 -0
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts +680 -0
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +680 -0
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts +680 -0
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +680 -0
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ro.d.ts +680 -0
- package/dist/i18n/locales/ro.d.ts.map +1 -1
- package/dist/i18n/locales/ro.js +680 -0
- package/dist/i18n/locales/ro.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts +680 -0
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +680 -0
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/sq.d.ts +680 -0
- package/dist/i18n/locales/sq.d.ts.map +1 -1
- package/dist/i18n/locales/sq.js +680 -0
- package/dist/i18n/locales/sq.js.map +1 -1
- package/dist/i18n/locales/sv.d.ts +680 -0
- package/dist/i18n/locales/sv.d.ts.map +1 -1
- package/dist/i18n/locales/sv.js +680 -0
- package/dist/i18n/locales/sv.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts +680 -0
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +680 -0
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +680 -0
- package/dist/i18n/locales/zh.d.ts.map +1 -1
- package/dist/i18n/locales/zh.js +680 -0
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.js +830 -812
- package/dist/index.js.map +1 -1
- package/dist/locales/ar.json +680 -0
- package/dist/locales/de.json +680 -0
- package/dist/locales/el.json +680 -0
- package/dist/locales/en.json +680 -0
- package/dist/locales/es.json +680 -0
- package/dist/locales/fr.json +680 -0
- package/dist/locales/hi.json +680 -0
- package/dist/locales/it.json +680 -0
- package/dist/locales/ja.json +680 -0
- package/dist/locales/nl.json +680 -0
- package/dist/locales/pl.json +680 -0
- package/dist/locales/pt.json +680 -0
- package/dist/locales/ro.json +680 -0
- package/dist/locales/ru.json +680 -0
- package/dist/locales/sq.json +680 -0
- package/dist/locales/sv.json +680 -0
- package/dist/locales/tr.json +680 -0
- package/dist/locales/zh.json +680 -0
- package/dist/patterns/anamnesis/index.js +1 -1
- package/dist/patterns/calendar/calendar-workspace.d.ts +62 -0
- package/dist/patterns/calendar/calendar-workspace.d.ts.map +1 -0
- package/dist/patterns/calendar/calendar-workspace.model.d.ts +358 -0
- package/dist/patterns/calendar/calendar-workspace.model.d.ts.map +1 -0
- package/dist/patterns/calendar/calendar.data.d.ts +122 -0
- package/dist/patterns/calendar/calendar.data.d.ts.map +1 -0
- package/dist/patterns/calendar/calendar.host.d.ts +10 -0
- package/dist/patterns/calendar/calendar.host.d.ts.map +1 -0
- package/dist/patterns/calendar/calendar.journey.d.ts +119 -0
- package/dist/patterns/calendar/calendar.journey.d.ts.map +1 -0
- package/dist/patterns/calendar/calendar.model.d.ts +684 -0
- package/dist/patterns/calendar/calendar.model.d.ts.map +1 -0
- package/dist/patterns/calendar/calendar.preferences.d.ts +74 -0
- package/dist/patterns/calendar/calendar.preferences.d.ts.map +1 -0
- package/dist/patterns/calendar/calendar.sheets.d.ts +398 -0
- package/dist/patterns/calendar/calendar.sheets.d.ts.map +1 -0
- package/dist/patterns/calendar/calendar.surface.d.ts +77 -0
- package/dist/patterns/calendar/calendar.surface.d.ts.map +1 -0
- package/dist/patterns/calendar/calendar.types.d.ts +413 -0
- package/dist/patterns/calendar/calendar.types.d.ts.map +1 -0
- package/dist/patterns/calendar/index.d.ts +13 -0
- package/dist/patterns/calendar/index.d.ts.map +1 -0
- package/dist/patterns/calendar/index.js +19 -0
- package/dist/patterns/calendar/index.js.map +1 -0
- package/dist/patterns/signature-request/index.js +1 -1
- package/package.json +5 -1
- package/dist/_chunks/actions-cell-renderer-DnSLrgQD.js +0 -1945
- package/dist/_chunks/actions-cell-renderer-DnSLrgQD.js.map +0 -1
- package/dist/_chunks/booking-CBHKdsZl.js.map +0 -1
- package/dist/_chunks/field-value-DG8zaZvo.js.map +0 -1
- package/dist/_chunks/file-manager-C0y7HBAN.js.map +0 -1
- package/dist/_chunks/key-value-pair-BubG4fUa.js +0 -144
- package/dist/_chunks/key-value-pair-BubG4fUa.js.map +0 -1
- package/dist/_chunks/patient-details-xrqe13az.js.map +0 -1
- package/dist/_chunks/practice-results-D7ygCj_W.js.map +0 -1
- package/dist/_chunks/select-BW5ecXlX.js.map +0 -1
- package/dist/_chunks/signature-field-0rFODJlW.js.map +0 -1
- package/dist/_chunks/toast.agent-D1tdg6DS.js.map +0 -1
- package/dist/_chunks/workflow-map-DE_ribRM.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"toast.agent-D1tdg6DS.js","sources":["../../node_modules/sonner/dist/index.mjs","../../src/components/toast/toast.tsx","../../src/components/toast/toast.agent.ts"],"sourcesContent":["'use client';\nfunction __insertCSS(code) {\n if (!code || typeof document == 'undefined') return\n let head = document.head || document.getElementsByTagName('head')[0]\n let style = document.createElement('style')\n style.type = 'text/css'\n head.appendChild(style)\n ;style.styleSheet ? (style.styleSheet.cssText = code) : style.appendChild(document.createTextNode(code))\n}\n\nimport React from 'react';\nimport ReactDOM from 'react-dom';\n\nconst getAsset = (type)=>{\n switch(type){\n case 'success':\n return SuccessIcon;\n case 'info':\n return InfoIcon;\n case 'warning':\n return WarningIcon;\n case 'error':\n return ErrorIcon;\n default:\n return null;\n }\n};\nconst bars = Array(12).fill(0);\nconst Loader = ({ visible, className })=>{\n return /*#__PURE__*/ React.createElement(\"div\", {\n className: [\n 'sonner-loading-wrapper',\n className\n ].filter(Boolean).join(' '),\n \"data-visible\": visible\n }, /*#__PURE__*/ React.createElement(\"div\", {\n className: \"sonner-spinner\"\n }, bars.map((_, i)=>/*#__PURE__*/ React.createElement(\"div\", {\n className: \"sonner-loading-bar\",\n key: `spinner-bar-${i}`\n }))));\n};\nconst SuccessIcon = /*#__PURE__*/ React.createElement(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 20 20\",\n fill: \"currentColor\",\n height: \"20\",\n width: \"20\"\n}, /*#__PURE__*/ React.createElement(\"path\", {\n fillRule: \"evenodd\",\n d: \"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z\",\n clipRule: \"evenodd\"\n}));\nconst WarningIcon = /*#__PURE__*/ React.createElement(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n fill: \"currentColor\",\n height: \"20\",\n width: \"20\"\n}, /*#__PURE__*/ React.createElement(\"path\", {\n fillRule: \"evenodd\",\n d: \"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z\",\n clipRule: \"evenodd\"\n}));\nconst InfoIcon = /*#__PURE__*/ React.createElement(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 20 20\",\n fill: \"currentColor\",\n height: \"20\",\n width: \"20\"\n}, /*#__PURE__*/ React.createElement(\"path\", {\n fillRule: \"evenodd\",\n d: \"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z\",\n clipRule: \"evenodd\"\n}));\nconst ErrorIcon = /*#__PURE__*/ React.createElement(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 20 20\",\n fill: \"currentColor\",\n height: \"20\",\n width: \"20\"\n}, /*#__PURE__*/ React.createElement(\"path\", {\n fillRule: \"evenodd\",\n d: \"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z\",\n clipRule: \"evenodd\"\n}));\nconst CloseIcon = /*#__PURE__*/ React.createElement(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"12\",\n height: \"12\",\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: \"1.5\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}, /*#__PURE__*/ React.createElement(\"line\", {\n x1: \"18\",\n y1: \"6\",\n x2: \"6\",\n y2: \"18\"\n}), /*#__PURE__*/ React.createElement(\"line\", {\n x1: \"6\",\n y1: \"6\",\n x2: \"18\",\n y2: \"18\"\n}));\n\nconst useIsDocumentHidden = ()=>{\n const [isDocumentHidden, setIsDocumentHidden] = React.useState(document.hidden);\n React.useEffect(()=>{\n const callback = ()=>{\n setIsDocumentHidden(document.hidden);\n };\n document.addEventListener('visibilitychange', callback);\n return ()=>window.removeEventListener('visibilitychange', callback);\n }, []);\n return isDocumentHidden;\n};\n\nlet toastsCounter = 1;\nclass Observer {\n constructor(){\n // We use arrow functions to maintain the correct `this` reference\n this.subscribe = (subscriber)=>{\n this.subscribers.push(subscriber);\n return ()=>{\n const index = this.subscribers.indexOf(subscriber);\n this.subscribers.splice(index, 1);\n };\n };\n this.publish = (data)=>{\n this.subscribers.forEach((subscriber)=>subscriber(data));\n };\n this.addToast = (data)=>{\n this.publish(data);\n this.toasts = [\n ...this.toasts,\n data\n ];\n };\n this.create = (data)=>{\n var _data_id;\n const { message, ...rest } = data;\n const id = typeof (data == null ? void 0 : data.id) === 'number' || ((_data_id = data.id) == null ? void 0 : _data_id.length) > 0 ? data.id : toastsCounter++;\n const alreadyExists = this.toasts.find((toast)=>{\n return toast.id === id;\n });\n const dismissible = data.dismissible === undefined ? true : data.dismissible;\n if (this.dismissedToasts.has(id)) {\n this.dismissedToasts.delete(id);\n }\n if (alreadyExists) {\n this.toasts = this.toasts.map((toast)=>{\n if (toast.id === id) {\n this.publish({\n ...toast,\n ...data,\n id,\n title: message\n });\n return {\n ...toast,\n ...data,\n id,\n dismissible,\n title: message\n };\n }\n return toast;\n });\n } else {\n this.addToast({\n title: message,\n ...rest,\n dismissible,\n id\n });\n }\n return id;\n };\n this.dismiss = (id)=>{\n if (id) {\n this.dismissedToasts.add(id);\n requestAnimationFrame(()=>this.subscribers.forEach((subscriber)=>subscriber({\n id,\n dismiss: true\n })));\n } else {\n this.toasts.forEach((toast)=>{\n this.subscribers.forEach((subscriber)=>subscriber({\n id: toast.id,\n dismiss: true\n }));\n });\n }\n return id;\n };\n this.message = (message, data)=>{\n return this.create({\n ...data,\n message\n });\n };\n this.error = (message, data)=>{\n return this.create({\n ...data,\n message,\n type: 'error'\n });\n };\n this.success = (message, data)=>{\n return this.create({\n ...data,\n type: 'success',\n message\n });\n };\n this.info = (message, data)=>{\n return this.create({\n ...data,\n type: 'info',\n message\n });\n };\n this.warning = (message, data)=>{\n return this.create({\n ...data,\n type: 'warning',\n message\n });\n };\n this.loading = (message, data)=>{\n return this.create({\n ...data,\n type: 'loading',\n message\n });\n };\n this.promise = (promise, data)=>{\n if (!data) {\n // Nothing to show\n return;\n }\n let id = undefined;\n if (data.loading !== undefined) {\n id = this.create({\n ...data,\n promise,\n type: 'loading',\n message: data.loading,\n description: typeof data.description !== 'function' ? data.description : undefined\n });\n }\n const p = Promise.resolve(promise instanceof Function ? promise() : promise);\n let shouldDismiss = id !== undefined;\n let result;\n const originalPromise = p.then(async (response)=>{\n result = [\n 'resolve',\n response\n ];\n const isReactElementResponse = React.isValidElement(response);\n if (isReactElementResponse) {\n shouldDismiss = false;\n this.create({\n id,\n type: 'default',\n message: response\n });\n } else if (isHttpResponse(response) && !response.ok) {\n shouldDismiss = false;\n const promiseData = typeof data.error === 'function' ? await data.error(`HTTP error! status: ${response.status}`) : data.error;\n const description = typeof data.description === 'function' ? await data.description(`HTTP error! status: ${response.status}`) : data.description;\n const isExtendedResult = typeof promiseData === 'object' && !React.isValidElement(promiseData);\n const toastSettings = isExtendedResult ? promiseData : {\n message: promiseData\n };\n this.create({\n id,\n type: 'error',\n description,\n ...toastSettings\n });\n } else if (response instanceof Error) {\n shouldDismiss = false;\n const promiseData = typeof data.error === 'function' ? await data.error(response) : data.error;\n const description = typeof data.description === 'function' ? await data.description(response) : data.description;\n const isExtendedResult = typeof promiseData === 'object' && !React.isValidElement(promiseData);\n const toastSettings = isExtendedResult ? promiseData : {\n message: promiseData\n };\n this.create({\n id,\n type: 'error',\n description,\n ...toastSettings\n });\n } else if (data.success !== undefined) {\n shouldDismiss = false;\n const promiseData = typeof data.success === 'function' ? await data.success(response) : data.success;\n const description = typeof data.description === 'function' ? await data.description(response) : data.description;\n const isExtendedResult = typeof promiseData === 'object' && !React.isValidElement(promiseData);\n const toastSettings = isExtendedResult ? promiseData : {\n message: promiseData\n };\n this.create({\n id,\n type: 'success',\n description,\n ...toastSettings\n });\n }\n }).catch(async (error)=>{\n result = [\n 'reject',\n error\n ];\n if (data.error !== undefined) {\n shouldDismiss = false;\n const promiseData = typeof data.error === 'function' ? await data.error(error) : data.error;\n const description = typeof data.description === 'function' ? await data.description(error) : data.description;\n const isExtendedResult = typeof promiseData === 'object' && !React.isValidElement(promiseData);\n const toastSettings = isExtendedResult ? promiseData : {\n message: promiseData\n };\n this.create({\n id,\n type: 'error',\n description,\n ...toastSettings\n });\n }\n }).finally(()=>{\n if (shouldDismiss) {\n // Toast is still in load state (and will be indefinitely — dismiss it)\n this.dismiss(id);\n id = undefined;\n }\n data.finally == null ? void 0 : data.finally.call(data);\n });\n const unwrap = ()=>new Promise((resolve, reject)=>originalPromise.then(()=>result[0] === 'reject' ? reject(result[1]) : resolve(result[1])).catch(reject));\n if (typeof id !== 'string' && typeof id !== 'number') {\n // cannot Object.assign on undefined\n return {\n unwrap\n };\n } else {\n return Object.assign(id, {\n unwrap\n });\n }\n };\n this.custom = (jsx, data)=>{\n const id = (data == null ? void 0 : data.id) || toastsCounter++;\n this.create({\n jsx: jsx(id),\n id,\n ...data\n });\n return id;\n };\n this.getActiveToasts = ()=>{\n return this.toasts.filter((toast)=>!this.dismissedToasts.has(toast.id));\n };\n this.subscribers = [];\n this.toasts = [];\n this.dismissedToasts = new Set();\n }\n}\nconst ToastState = new Observer();\n// bind this to the toast function\nconst toastFunction = (message, data)=>{\n const id = (data == null ? void 0 : data.id) || toastsCounter++;\n ToastState.addToast({\n title: message,\n ...data,\n id\n });\n return id;\n};\nconst isHttpResponse = (data)=>{\n return data && typeof data === 'object' && 'ok' in data && typeof data.ok === 'boolean' && 'status' in data && typeof data.status === 'number';\n};\nconst basicToast = toastFunction;\nconst getHistory = ()=>ToastState.toasts;\nconst getToasts = ()=>ToastState.getActiveToasts();\n// We use `Object.assign` to maintain the correct types as we would lose them otherwise\nconst toast = Object.assign(basicToast, {\n success: ToastState.success,\n info: ToastState.info,\n warning: ToastState.warning,\n error: ToastState.error,\n custom: ToastState.custom,\n message: ToastState.message,\n promise: ToastState.promise,\n dismiss: ToastState.dismiss,\n loading: ToastState.loading\n}, {\n getHistory,\n getToasts\n});\n\n__insertCSS(\"[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}\");\n\nfunction isAction(action) {\n return action.label !== undefined;\n}\n\n// Visible toasts amount\nconst VISIBLE_TOASTS_AMOUNT = 3;\n// Viewport padding\nconst VIEWPORT_OFFSET = '24px';\n// Mobile viewport padding\nconst MOBILE_VIEWPORT_OFFSET = '16px';\n// Default lifetime of a toasts (in ms)\nconst TOAST_LIFETIME = 4000;\n// Default toast width\nconst TOAST_WIDTH = 356;\n// Default gap between toasts\nconst GAP = 14;\n// Threshold to dismiss a toast\nconst SWIPE_THRESHOLD = 45;\n// Equal to exit animation duration\nconst TIME_BEFORE_UNMOUNT = 200;\nfunction cn(...classes) {\n return classes.filter(Boolean).join(' ');\n}\nfunction getDefaultSwipeDirections(position) {\n const [y, x] = position.split('-');\n const directions = [];\n if (y) {\n directions.push(y);\n }\n if (x) {\n directions.push(x);\n }\n return directions;\n}\nconst Toast = (props)=>{\n var _toast_classNames, _toast_classNames1, _toast_classNames2, _toast_classNames3, _toast_classNames4, _toast_classNames5, _toast_classNames6, _toast_classNames7, _toast_classNames8;\n const { invert: ToasterInvert, toast, unstyled, interacting, setHeights, visibleToasts, heights, index, toasts, expanded, removeToast, defaultRichColors, closeButton: closeButtonFromToaster, style, cancelButtonStyle, actionButtonStyle, className = '', descriptionClassName = '', duration: durationFromToaster, position, gap, expandByDefault, classNames, icons, closeButtonAriaLabel = 'Close toast' } = props;\n const [swipeDirection, setSwipeDirection] = React.useState(null);\n const [swipeOutDirection, setSwipeOutDirection] = React.useState(null);\n const [mounted, setMounted] = React.useState(false);\n const [removed, setRemoved] = React.useState(false);\n const [swiping, setSwiping] = React.useState(false);\n const [swipeOut, setSwipeOut] = React.useState(false);\n const [isSwiped, setIsSwiped] = React.useState(false);\n const [offsetBeforeRemove, setOffsetBeforeRemove] = React.useState(0);\n const [initialHeight, setInitialHeight] = React.useState(0);\n const remainingTime = React.useRef(toast.duration || durationFromToaster || TOAST_LIFETIME);\n const dragStartTime = React.useRef(null);\n const toastRef = React.useRef(null);\n const isFront = index === 0;\n const isVisible = index + 1 <= visibleToasts;\n const toastType = toast.type;\n const dismissible = toast.dismissible !== false;\n const toastClassname = toast.className || '';\n const toastDescriptionClassname = toast.descriptionClassName || '';\n // Height index is used to calculate the offset as it gets updated before the toast array, which means we can calculate the new layout faster.\n const heightIndex = React.useMemo(()=>heights.findIndex((height)=>height.toastId === toast.id) || 0, [\n heights,\n toast.id\n ]);\n const closeButton = React.useMemo(()=>{\n var _toast_closeButton;\n return (_toast_closeButton = toast.closeButton) != null ? _toast_closeButton : closeButtonFromToaster;\n }, [\n toast.closeButton,\n closeButtonFromToaster\n ]);\n const duration = React.useMemo(()=>toast.duration || durationFromToaster || TOAST_LIFETIME, [\n toast.duration,\n durationFromToaster\n ]);\n const closeTimerStartTimeRef = React.useRef(0);\n const offset = React.useRef(0);\n const lastCloseTimerStartTimeRef = React.useRef(0);\n const pointerStartRef = React.useRef(null);\n const [y, x] = position.split('-');\n const toastsHeightBefore = React.useMemo(()=>{\n return heights.reduce((prev, curr, reducerIndex)=>{\n // Calculate offset up until current toast\n if (reducerIndex >= heightIndex) {\n return prev;\n }\n return prev + curr.height;\n }, 0);\n }, [\n heights,\n heightIndex\n ]);\n const isDocumentHidden = useIsDocumentHidden();\n const invert = toast.invert || ToasterInvert;\n const disabled = toastType === 'loading';\n offset.current = React.useMemo(()=>heightIndex * gap + toastsHeightBefore, [\n heightIndex,\n toastsHeightBefore\n ]);\n React.useEffect(()=>{\n remainingTime.current = duration;\n }, [\n duration\n ]);\n React.useEffect(()=>{\n // Trigger enter animation without using CSS animation\n setMounted(true);\n }, []);\n React.useEffect(()=>{\n const toastNode = toastRef.current;\n if (toastNode) {\n const height = toastNode.getBoundingClientRect().height;\n // Add toast height to heights array after the toast is mounted\n setInitialHeight(height);\n setHeights((h)=>[\n {\n toastId: toast.id,\n height,\n position: toast.position\n },\n ...h\n ]);\n return ()=>setHeights((h)=>h.filter((height)=>height.toastId !== toast.id));\n }\n }, [\n setHeights,\n toast.id\n ]);\n React.useLayoutEffect(()=>{\n // Keep height up to date with the content in case it updates\n if (!mounted) return;\n const toastNode = toastRef.current;\n const originalHeight = toastNode.style.height;\n toastNode.style.height = 'auto';\n const newHeight = toastNode.getBoundingClientRect().height;\n toastNode.style.height = originalHeight;\n setInitialHeight(newHeight);\n setHeights((heights)=>{\n const alreadyExists = heights.find((height)=>height.toastId === toast.id);\n if (!alreadyExists) {\n return [\n {\n toastId: toast.id,\n height: newHeight,\n position: toast.position\n },\n ...heights\n ];\n } else {\n return heights.map((height)=>height.toastId === toast.id ? {\n ...height,\n height: newHeight\n } : height);\n }\n });\n }, [\n mounted,\n toast.title,\n toast.description,\n setHeights,\n toast.id,\n toast.jsx,\n toast.action,\n toast.cancel\n ]);\n const deleteToast = React.useCallback(()=>{\n // Save the offset for the exit swipe animation\n setRemoved(true);\n setOffsetBeforeRemove(offset.current);\n setHeights((h)=>h.filter((height)=>height.toastId !== toast.id));\n setTimeout(()=>{\n removeToast(toast);\n }, TIME_BEFORE_UNMOUNT);\n }, [\n toast,\n removeToast,\n setHeights,\n offset\n ]);\n React.useEffect(()=>{\n if (toast.promise && toastType === 'loading' || toast.duration === Infinity || toast.type === 'loading') return;\n let timeoutId;\n // Pause the timer on each hover\n const pauseTimer = ()=>{\n if (lastCloseTimerStartTimeRef.current < closeTimerStartTimeRef.current) {\n // Get the elapsed time since the timer started\n const elapsedTime = new Date().getTime() - closeTimerStartTimeRef.current;\n remainingTime.current = remainingTime.current - elapsedTime;\n }\n lastCloseTimerStartTimeRef.current = new Date().getTime();\n };\n const startTimer = ()=>{\n // setTimeout(, Infinity) behaves as if the delay is 0.\n // As a result, the toast would be closed immediately, giving the appearance that it was never rendered.\n // See: https://github.com/denysdovhan/wtfjs?tab=readme-ov-file#an-infinite-timeout\n if (remainingTime.current === Infinity) return;\n closeTimerStartTimeRef.current = new Date().getTime();\n // Let the toast know it has started\n timeoutId = setTimeout(()=>{\n toast.onAutoClose == null ? void 0 : toast.onAutoClose.call(toast, toast);\n deleteToast();\n }, remainingTime.current);\n };\n if (expanded || interacting || isDocumentHidden) {\n pauseTimer();\n } else {\n startTimer();\n }\n return ()=>clearTimeout(timeoutId);\n }, [\n expanded,\n interacting,\n toast,\n toastType,\n isDocumentHidden,\n deleteToast\n ]);\n React.useEffect(()=>{\n if (toast.delete) {\n deleteToast();\n toast.onDismiss == null ? void 0 : toast.onDismiss.call(toast, toast);\n }\n }, [\n deleteToast,\n toast.delete\n ]);\n function getLoadingIcon() {\n var _toast_classNames;\n if (icons == null ? void 0 : icons.loading) {\n var _toast_classNames1;\n return /*#__PURE__*/ React.createElement(\"div\", {\n className: cn(classNames == null ? void 0 : classNames.loader, toast == null ? void 0 : (_toast_classNames1 = toast.classNames) == null ? void 0 : _toast_classNames1.loader, 'sonner-loader'),\n \"data-visible\": toastType === 'loading'\n }, icons.loading);\n }\n return /*#__PURE__*/ React.createElement(Loader, {\n className: cn(classNames == null ? void 0 : classNames.loader, toast == null ? void 0 : (_toast_classNames = toast.classNames) == null ? void 0 : _toast_classNames.loader),\n visible: toastType === 'loading'\n });\n }\n const icon = toast.icon || (icons == null ? void 0 : icons[toastType]) || getAsset(toastType);\n var _toast_richColors, _icons_close;\n return /*#__PURE__*/ React.createElement(\"li\", {\n tabIndex: 0,\n ref: toastRef,\n className: cn(className, toastClassname, classNames == null ? void 0 : classNames.toast, toast == null ? void 0 : (_toast_classNames = toast.classNames) == null ? void 0 : _toast_classNames.toast, classNames == null ? void 0 : classNames.default, classNames == null ? void 0 : classNames[toastType], toast == null ? void 0 : (_toast_classNames1 = toast.classNames) == null ? void 0 : _toast_classNames1[toastType]),\n \"data-sonner-toast\": \"\",\n \"data-rich-colors\": (_toast_richColors = toast.richColors) != null ? _toast_richColors : defaultRichColors,\n \"data-styled\": !Boolean(toast.jsx || toast.unstyled || unstyled),\n \"data-mounted\": mounted,\n \"data-promise\": Boolean(toast.promise),\n \"data-swiped\": isSwiped,\n \"data-removed\": removed,\n \"data-visible\": isVisible,\n \"data-y-position\": y,\n \"data-x-position\": x,\n \"data-index\": index,\n \"data-front\": isFront,\n \"data-swiping\": swiping,\n \"data-dismissible\": dismissible,\n \"data-type\": toastType,\n \"data-invert\": invert,\n \"data-swipe-out\": swipeOut,\n \"data-swipe-direction\": swipeOutDirection,\n \"data-expanded\": Boolean(expanded || expandByDefault && mounted),\n \"data-testid\": toast.testId,\n style: {\n '--index': index,\n '--toasts-before': index,\n '--z-index': toasts.length - index,\n '--offset': `${removed ? offsetBeforeRemove : offset.current}px`,\n '--initial-height': expandByDefault ? 'auto' : `${initialHeight}px`,\n ...style,\n ...toast.style\n },\n onDragEnd: ()=>{\n setSwiping(false);\n setSwipeDirection(null);\n pointerStartRef.current = null;\n },\n onPointerDown: (event)=>{\n if (event.button === 2) return; // Return early on right click\n if (disabled || !dismissible) return;\n dragStartTime.current = new Date();\n setOffsetBeforeRemove(offset.current);\n // Ensure we maintain correct pointer capture even when going outside of the toast (e.g. when swiping)\n event.target.setPointerCapture(event.pointerId);\n if (event.target.tagName === 'BUTTON') return;\n setSwiping(true);\n pointerStartRef.current = {\n x: event.clientX,\n y: event.clientY\n };\n },\n onPointerUp: ()=>{\n var _toastRef_current, _toastRef_current1, _dragStartTime_current;\n if (swipeOut || !dismissible) return;\n pointerStartRef.current = null;\n const swipeAmountX = Number(((_toastRef_current = toastRef.current) == null ? void 0 : _toastRef_current.style.getPropertyValue('--swipe-amount-x').replace('px', '')) || 0);\n const swipeAmountY = Number(((_toastRef_current1 = toastRef.current) == null ? void 0 : _toastRef_current1.style.getPropertyValue('--swipe-amount-y').replace('px', '')) || 0);\n const timeTaken = new Date().getTime() - ((_dragStartTime_current = dragStartTime.current) == null ? void 0 : _dragStartTime_current.getTime());\n const swipeAmount = swipeDirection === 'x' ? swipeAmountX : swipeAmountY;\n const velocity = Math.abs(swipeAmount) / timeTaken;\n if (Math.abs(swipeAmount) >= SWIPE_THRESHOLD || velocity > 0.11) {\n setOffsetBeforeRemove(offset.current);\n toast.onDismiss == null ? void 0 : toast.onDismiss.call(toast, toast);\n if (swipeDirection === 'x') {\n setSwipeOutDirection(swipeAmountX > 0 ? 'right' : 'left');\n } else {\n setSwipeOutDirection(swipeAmountY > 0 ? 'down' : 'up');\n }\n deleteToast();\n setSwipeOut(true);\n return;\n } else {\n var _toastRef_current2, _toastRef_current3;\n (_toastRef_current2 = toastRef.current) == null ? void 0 : _toastRef_current2.style.setProperty('--swipe-amount-x', `0px`);\n (_toastRef_current3 = toastRef.current) == null ? void 0 : _toastRef_current3.style.setProperty('--swipe-amount-y', `0px`);\n }\n setIsSwiped(false);\n setSwiping(false);\n setSwipeDirection(null);\n },\n onPointerMove: (event)=>{\n var _window_getSelection, // Apply transform using both x and y values\n _toastRef_current, _toastRef_current1;\n if (!pointerStartRef.current || !dismissible) return;\n const isHighlighted = ((_window_getSelection = window.getSelection()) == null ? void 0 : _window_getSelection.toString().length) > 0;\n if (isHighlighted) return;\n const yDelta = event.clientY - pointerStartRef.current.y;\n const xDelta = event.clientX - pointerStartRef.current.x;\n var _props_swipeDirections;\n const swipeDirections = (_props_swipeDirections = props.swipeDirections) != null ? _props_swipeDirections : getDefaultSwipeDirections(position);\n // Determine swipe direction if not already locked\n if (!swipeDirection && (Math.abs(xDelta) > 1 || Math.abs(yDelta) > 1)) {\n setSwipeDirection(Math.abs(xDelta) > Math.abs(yDelta) ? 'x' : 'y');\n }\n let swipeAmount = {\n x: 0,\n y: 0\n };\n const getDampening = (delta)=>{\n const factor = Math.abs(delta) / 20;\n return 1 / (1.5 + factor);\n };\n // Only apply swipe in the locked direction\n if (swipeDirection === 'y') {\n // Handle vertical swipes\n if (swipeDirections.includes('top') || swipeDirections.includes('bottom')) {\n if (swipeDirections.includes('top') && yDelta < 0 || swipeDirections.includes('bottom') && yDelta > 0) {\n swipeAmount.y = yDelta;\n } else {\n // Smoothly transition to dampened movement\n const dampenedDelta = yDelta * getDampening(yDelta);\n // Ensure we don't jump when transitioning to dampened movement\n swipeAmount.y = Math.abs(dampenedDelta) < Math.abs(yDelta) ? dampenedDelta : yDelta;\n }\n }\n } else if (swipeDirection === 'x') {\n // Handle horizontal swipes\n if (swipeDirections.includes('left') || swipeDirections.includes('right')) {\n if (swipeDirections.includes('left') && xDelta < 0 || swipeDirections.includes('right') && xDelta > 0) {\n swipeAmount.x = xDelta;\n } else {\n // Smoothly transition to dampened movement\n const dampenedDelta = xDelta * getDampening(xDelta);\n // Ensure we don't jump when transitioning to dampened movement\n swipeAmount.x = Math.abs(dampenedDelta) < Math.abs(xDelta) ? dampenedDelta : xDelta;\n }\n }\n }\n if (Math.abs(swipeAmount.x) > 0 || Math.abs(swipeAmount.y) > 0) {\n setIsSwiped(true);\n }\n (_toastRef_current = toastRef.current) == null ? void 0 : _toastRef_current.style.setProperty('--swipe-amount-x', `${swipeAmount.x}px`);\n (_toastRef_current1 = toastRef.current) == null ? void 0 : _toastRef_current1.style.setProperty('--swipe-amount-y', `${swipeAmount.y}px`);\n }\n }, closeButton && !toast.jsx && toastType !== 'loading' ? /*#__PURE__*/ React.createElement(\"button\", {\n \"aria-label\": closeButtonAriaLabel,\n \"data-disabled\": disabled,\n \"data-close-button\": true,\n onClick: disabled || !dismissible ? ()=>{} : ()=>{\n deleteToast();\n toast.onDismiss == null ? void 0 : toast.onDismiss.call(toast, toast);\n },\n className: cn(classNames == null ? void 0 : classNames.closeButton, toast == null ? void 0 : (_toast_classNames2 = toast.classNames) == null ? void 0 : _toast_classNames2.closeButton)\n }, (_icons_close = icons == null ? void 0 : icons.close) != null ? _icons_close : CloseIcon) : null, (toastType || toast.icon || toast.promise) && toast.icon !== null && ((icons == null ? void 0 : icons[toastType]) !== null || toast.icon) ? /*#__PURE__*/ React.createElement(\"div\", {\n \"data-icon\": \"\",\n className: cn(classNames == null ? void 0 : classNames.icon, toast == null ? void 0 : (_toast_classNames3 = toast.classNames) == null ? void 0 : _toast_classNames3.icon)\n }, toast.promise || toast.type === 'loading' && !toast.icon ? toast.icon || getLoadingIcon() : null, toast.type !== 'loading' ? icon : null) : null, /*#__PURE__*/ React.createElement(\"div\", {\n \"data-content\": \"\",\n className: cn(classNames == null ? void 0 : classNames.content, toast == null ? void 0 : (_toast_classNames4 = toast.classNames) == null ? void 0 : _toast_classNames4.content)\n }, /*#__PURE__*/ React.createElement(\"div\", {\n \"data-title\": \"\",\n className: cn(classNames == null ? void 0 : classNames.title, toast == null ? void 0 : (_toast_classNames5 = toast.classNames) == null ? void 0 : _toast_classNames5.title)\n }, toast.jsx ? toast.jsx : typeof toast.title === 'function' ? toast.title() : toast.title), toast.description ? /*#__PURE__*/ React.createElement(\"div\", {\n \"data-description\": \"\",\n className: cn(descriptionClassName, toastDescriptionClassname, classNames == null ? void 0 : classNames.description, toast == null ? void 0 : (_toast_classNames6 = toast.classNames) == null ? void 0 : _toast_classNames6.description)\n }, typeof toast.description === 'function' ? toast.description() : toast.description) : null), /*#__PURE__*/ React.isValidElement(toast.cancel) ? toast.cancel : toast.cancel && isAction(toast.cancel) ? /*#__PURE__*/ React.createElement(\"button\", {\n \"data-button\": true,\n \"data-cancel\": true,\n style: toast.cancelButtonStyle || cancelButtonStyle,\n onClick: (event)=>{\n // We need to check twice because typescript\n if (!isAction(toast.cancel)) return;\n if (!dismissible) return;\n toast.cancel.onClick == null ? void 0 : toast.cancel.onClick.call(toast.cancel, event);\n deleteToast();\n },\n className: cn(classNames == null ? void 0 : classNames.cancelButton, toast == null ? void 0 : (_toast_classNames7 = toast.classNames) == null ? void 0 : _toast_classNames7.cancelButton)\n }, toast.cancel.label) : null, /*#__PURE__*/ React.isValidElement(toast.action) ? toast.action : toast.action && isAction(toast.action) ? /*#__PURE__*/ React.createElement(\"button\", {\n \"data-button\": true,\n \"data-action\": true,\n style: toast.actionButtonStyle || actionButtonStyle,\n onClick: (event)=>{\n // We need to check twice because typescript\n if (!isAction(toast.action)) return;\n toast.action.onClick == null ? void 0 : toast.action.onClick.call(toast.action, event);\n if (event.defaultPrevented) return;\n deleteToast();\n },\n className: cn(classNames == null ? void 0 : classNames.actionButton, toast == null ? void 0 : (_toast_classNames8 = toast.classNames) == null ? void 0 : _toast_classNames8.actionButton)\n }, toast.action.label) : null);\n};\nfunction getDocumentDirection() {\n if (typeof window === 'undefined') return 'ltr';\n if (typeof document === 'undefined') return 'ltr'; // For Fresh purpose\n const dirAttribute = document.documentElement.getAttribute('dir');\n if (dirAttribute === 'auto' || !dirAttribute) {\n return window.getComputedStyle(document.documentElement).direction;\n }\n return dirAttribute;\n}\nfunction assignOffset(defaultOffset, mobileOffset) {\n const styles = {};\n [\n defaultOffset,\n mobileOffset\n ].forEach((offset, index)=>{\n const isMobile = index === 1;\n const prefix = isMobile ? '--mobile-offset' : '--offset';\n const defaultValue = isMobile ? MOBILE_VIEWPORT_OFFSET : VIEWPORT_OFFSET;\n function assignAll(offset) {\n [\n 'top',\n 'right',\n 'bottom',\n 'left'\n ].forEach((key)=>{\n styles[`${prefix}-${key}`] = typeof offset === 'number' ? `${offset}px` : offset;\n });\n }\n if (typeof offset === 'number' || typeof offset === 'string') {\n assignAll(offset);\n } else if (typeof offset === 'object') {\n [\n 'top',\n 'right',\n 'bottom',\n 'left'\n ].forEach((key)=>{\n if (offset[key] === undefined) {\n styles[`${prefix}-${key}`] = defaultValue;\n } else {\n styles[`${prefix}-${key}`] = typeof offset[key] === 'number' ? `${offset[key]}px` : offset[key];\n }\n });\n } else {\n assignAll(defaultValue);\n }\n });\n return styles;\n}\nfunction useSonner() {\n const [activeToasts, setActiveToasts] = React.useState([]);\n React.useEffect(()=>{\n return ToastState.subscribe((toast)=>{\n if (toast.dismiss) {\n setTimeout(()=>{\n ReactDOM.flushSync(()=>{\n setActiveToasts((toasts)=>toasts.filter((t)=>t.id !== toast.id));\n });\n });\n return;\n }\n // Prevent batching, temp solution.\n setTimeout(()=>{\n ReactDOM.flushSync(()=>{\n setActiveToasts((toasts)=>{\n const indexOfExistingToast = toasts.findIndex((t)=>t.id === toast.id);\n // Update the toast if it already exists\n if (indexOfExistingToast !== -1) {\n return [\n ...toasts.slice(0, indexOfExistingToast),\n {\n ...toasts[indexOfExistingToast],\n ...toast\n },\n ...toasts.slice(indexOfExistingToast + 1)\n ];\n }\n return [\n toast,\n ...toasts\n ];\n });\n });\n });\n });\n }, []);\n return {\n toasts: activeToasts\n };\n}\nconst Toaster = /*#__PURE__*/ React.forwardRef(function Toaster(props, ref) {\n const { id, invert, position = 'bottom-right', hotkey = [\n 'altKey',\n 'KeyT'\n ], expand, closeButton, className, offset, mobileOffset, theme = 'light', richColors, duration, style, visibleToasts = VISIBLE_TOASTS_AMOUNT, toastOptions, dir = getDocumentDirection(), gap = GAP, icons, containerAriaLabel = 'Notifications' } = props;\n const [toasts, setToasts] = React.useState([]);\n const filteredToasts = React.useMemo(()=>{\n if (id) {\n return toasts.filter((toast)=>toast.toasterId === id);\n }\n return toasts.filter((toast)=>!toast.toasterId);\n }, [\n toasts,\n id\n ]);\n const possiblePositions = React.useMemo(()=>{\n return Array.from(new Set([\n position\n ].concat(filteredToasts.filter((toast)=>toast.position).map((toast)=>toast.position))));\n }, [\n filteredToasts,\n position\n ]);\n const [heights, setHeights] = React.useState([]);\n const [expanded, setExpanded] = React.useState(false);\n const [interacting, setInteracting] = React.useState(false);\n const [actualTheme, setActualTheme] = React.useState(theme !== 'system' ? theme : typeof window !== 'undefined' ? window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light' : 'light');\n const listRef = React.useRef(null);\n const hotkeyLabel = hotkey.join('+').replace(/Key/g, '').replace(/Digit/g, '');\n const lastFocusedElementRef = React.useRef(null);\n const isFocusWithinRef = React.useRef(false);\n const removeToast = React.useCallback((toastToRemove)=>{\n setToasts((toasts)=>{\n var _toasts_find;\n if (!((_toasts_find = toasts.find((toast)=>toast.id === toastToRemove.id)) == null ? void 0 : _toasts_find.delete)) {\n ToastState.dismiss(toastToRemove.id);\n }\n return toasts.filter(({ id })=>id !== toastToRemove.id);\n });\n }, []);\n React.useEffect(()=>{\n return ToastState.subscribe((toast)=>{\n if (toast.dismiss) {\n // Prevent batching of other state updates\n requestAnimationFrame(()=>{\n setToasts((toasts)=>toasts.map((t)=>t.id === toast.id ? {\n ...t,\n delete: true\n } : t));\n });\n return;\n }\n // Prevent batching, temp solution.\n setTimeout(()=>{\n ReactDOM.flushSync(()=>{\n setToasts((toasts)=>{\n const indexOfExistingToast = toasts.findIndex((t)=>t.id === toast.id);\n // Update the toast if it already exists\n if (indexOfExistingToast !== -1) {\n return [\n ...toasts.slice(0, indexOfExistingToast),\n {\n ...toasts[indexOfExistingToast],\n ...toast\n },\n ...toasts.slice(indexOfExistingToast + 1)\n ];\n }\n return [\n toast,\n ...toasts\n ];\n });\n });\n });\n });\n }, [\n toasts\n ]);\n React.useEffect(()=>{\n if (theme !== 'system') {\n setActualTheme(theme);\n return;\n }\n if (theme === 'system') {\n // check if current preference is dark\n if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {\n // it's currently dark\n setActualTheme('dark');\n } else {\n // it's not dark\n setActualTheme('light');\n }\n }\n if (typeof window === 'undefined') return;\n const darkMediaQuery = window.matchMedia('(prefers-color-scheme: dark)');\n try {\n // Chrome & Firefox\n darkMediaQuery.addEventListener('change', ({ matches })=>{\n if (matches) {\n setActualTheme('dark');\n } else {\n setActualTheme('light');\n }\n });\n } catch (error) {\n // Safari < 14\n darkMediaQuery.addListener(({ matches })=>{\n try {\n if (matches) {\n setActualTheme('dark');\n } else {\n setActualTheme('light');\n }\n } catch (e) {\n console.error(e);\n }\n });\n }\n }, [\n theme\n ]);\n React.useEffect(()=>{\n // Ensure expanded is always false when no toasts are present / only one left\n if (toasts.length <= 1) {\n setExpanded(false);\n }\n }, [\n toasts\n ]);\n React.useEffect(()=>{\n const handleKeyDown = (event)=>{\n var _listRef_current;\n const isHotkeyPressed = hotkey.every((key)=>event[key] || event.code === key);\n if (isHotkeyPressed) {\n var _listRef_current1;\n setExpanded(true);\n (_listRef_current1 = listRef.current) == null ? void 0 : _listRef_current1.focus();\n }\n if (event.code === 'Escape' && (document.activeElement === listRef.current || ((_listRef_current = listRef.current) == null ? void 0 : _listRef_current.contains(document.activeElement)))) {\n setExpanded(false);\n }\n };\n document.addEventListener('keydown', handleKeyDown);\n return ()=>document.removeEventListener('keydown', handleKeyDown);\n }, [\n hotkey\n ]);\n React.useEffect(()=>{\n if (listRef.current) {\n return ()=>{\n if (lastFocusedElementRef.current) {\n lastFocusedElementRef.current.focus({\n preventScroll: true\n });\n lastFocusedElementRef.current = null;\n isFocusWithinRef.current = false;\n }\n };\n }\n }, [\n listRef.current\n ]);\n return(// Remove item from normal navigation flow, only available via hotkey\n /*#__PURE__*/ React.createElement(\"section\", {\n ref: ref,\n \"aria-label\": `${containerAriaLabel} ${hotkeyLabel}`,\n tabIndex: -1,\n \"aria-live\": \"polite\",\n \"aria-relevant\": \"additions text\",\n \"aria-atomic\": \"false\",\n suppressHydrationWarning: true\n }, possiblePositions.map((position, index)=>{\n var _heights_;\n const [y, x] = position.split('-');\n if (!filteredToasts.length) return null;\n return /*#__PURE__*/ React.createElement(\"ol\", {\n key: position,\n dir: dir === 'auto' ? getDocumentDirection() : dir,\n tabIndex: -1,\n ref: listRef,\n className: className,\n \"data-sonner-toaster\": true,\n \"data-sonner-theme\": actualTheme,\n \"data-y-position\": y,\n \"data-x-position\": x,\n style: {\n '--front-toast-height': `${((_heights_ = heights[0]) == null ? void 0 : _heights_.height) || 0}px`,\n '--width': `${TOAST_WIDTH}px`,\n '--gap': `${gap}px`,\n ...style,\n ...assignOffset(offset, mobileOffset)\n },\n onBlur: (event)=>{\n if (isFocusWithinRef.current && !event.currentTarget.contains(event.relatedTarget)) {\n isFocusWithinRef.current = false;\n if (lastFocusedElementRef.current) {\n lastFocusedElementRef.current.focus({\n preventScroll: true\n });\n lastFocusedElementRef.current = null;\n }\n }\n },\n onFocus: (event)=>{\n const isNotDismissible = event.target instanceof HTMLElement && event.target.dataset.dismissible === 'false';\n if (isNotDismissible) return;\n if (!isFocusWithinRef.current) {\n isFocusWithinRef.current = true;\n lastFocusedElementRef.current = event.relatedTarget;\n }\n },\n onMouseEnter: ()=>setExpanded(true),\n onMouseMove: ()=>setExpanded(true),\n onMouseLeave: ()=>{\n // Avoid setting expanded to false when interacting with a toast, e.g. swiping\n if (!interacting) {\n setExpanded(false);\n }\n },\n onDragEnd: ()=>setExpanded(false),\n onPointerDown: (event)=>{\n const isNotDismissible = event.target instanceof HTMLElement && event.target.dataset.dismissible === 'false';\n if (isNotDismissible) return;\n setInteracting(true);\n },\n onPointerUp: ()=>setInteracting(false)\n }, filteredToasts.filter((toast)=>!toast.position && index === 0 || toast.position === position).map((toast, index)=>{\n var _toastOptions_duration, _toastOptions_closeButton;\n return /*#__PURE__*/ React.createElement(Toast, {\n key: toast.id,\n icons: icons,\n index: index,\n toast: toast,\n defaultRichColors: richColors,\n duration: (_toastOptions_duration = toastOptions == null ? void 0 : toastOptions.duration) != null ? _toastOptions_duration : duration,\n className: toastOptions == null ? void 0 : toastOptions.className,\n descriptionClassName: toastOptions == null ? void 0 : toastOptions.descriptionClassName,\n invert: invert,\n visibleToasts: visibleToasts,\n closeButton: (_toastOptions_closeButton = toastOptions == null ? void 0 : toastOptions.closeButton) != null ? _toastOptions_closeButton : closeButton,\n interacting: interacting,\n position: position,\n style: toastOptions == null ? void 0 : toastOptions.style,\n unstyled: toastOptions == null ? void 0 : toastOptions.unstyled,\n classNames: toastOptions == null ? void 0 : toastOptions.classNames,\n cancelButtonStyle: toastOptions == null ? void 0 : toastOptions.cancelButtonStyle,\n actionButtonStyle: toastOptions == null ? void 0 : toastOptions.actionButtonStyle,\n closeButtonAriaLabel: toastOptions == null ? void 0 : toastOptions.closeButtonAriaLabel,\n removeToast: removeToast,\n toasts: filteredToasts.filter((t)=>t.position == toast.position),\n heights: heights.filter((h)=>h.position == toast.position),\n setHeights: setHeights,\n expandByDefault: expand,\n gap: gap,\n expanded: expanded,\n swipeDirections: props.swipeDirections\n });\n }));\n })));\n});\n\nexport { Toaster, toast, useSonner };\n","import { type ReactNode, useEffect, useRef, useState } from 'react';\nimport { Toaster as SonnerToaster, toast } from 'sonner';\nimport { useTranslation } from 'react-i18next';\nimport { Info, CircleCheck, TriangleAlert, CircleAlert, X } from 'lucide-react';\nimport { IconButton } from '../button/icon-button';\n\nconst iconMap = {\n info: (\n <Info\n aria-hidden=\"true\"\n size={20}\n className=\"ds:shrink-0 ds:text-[var(--info)]\"\n />\n ),\n success: (\n <CircleCheck\n aria-hidden=\"true\"\n size={20}\n className=\"ds:shrink-0 ds:text-[var(--success)]\"\n />\n ),\n warning: (\n <TriangleAlert\n aria-hidden=\"true\"\n size={20}\n className=\"ds:shrink-0 ds:text-[var(--warning)]\"\n />\n ),\n error: (\n <CircleAlert\n aria-hidden=\"true\"\n size={20}\n className=\"ds:shrink-0 ds:text-[var(--destructive)]\"\n />\n ),\n} as const;\n\n// Ensures only one SonnerToaster is active at a time (guards against multiple\n// mounts on Storybook docs pages where each story gets its own React root).\nlet _toasterActive = false;\n\n// Track currently-visible toasts by id so the agent adapter can snapshot the\n// active set without scraping the DOM. Updated by `fireToast` on creation and\n// by the `onDismiss` / `onAutoClose` sonner callbacks.\nconst _activeToasts = new Set<string>();\n\ntype LogicalPosition =\n | 'top-start'\n | 'top-center'\n | 'top-end'\n | 'bottom-start'\n | 'bottom-center'\n | 'bottom-end';\n\ntype PhysicalPosition =\n | 'top-left'\n | 'top-right'\n | 'bottom-left'\n | 'bottom-right'\n | 'top-center'\n | 'bottom-center';\n\nfunction resolvePosition(logical: LogicalPosition): PhysicalPosition {\n const isRtl =\n typeof document !== 'undefined' && document.documentElement.dir === 'rtl';\n\n const map: Record<LogicalPosition, PhysicalPosition> = {\n 'top-start': isRtl ? 'top-right' : 'top-left',\n 'top-center': 'top-center',\n 'top-end': isRtl ? 'top-left' : 'top-right',\n 'bottom-start': isRtl ? 'bottom-right' : 'bottom-left',\n 'bottom-center': 'bottom-center',\n 'bottom-end': isRtl ? 'bottom-left' : 'bottom-right',\n };\n\n return map[logical];\n}\n\nexport interface ToasterProps {\n position?: LogicalPosition;\n offset?: string;\n gap?: number;\n visibleToasts?: number;\n className?: string;\n}\n\nexport function Toaster({\n position = 'bottom-end',\n offset = 'var(--spacing-lg)',\n gap = 8,\n visibleToasts = 3,\n className,\n}: ToasterProps) {\n const [isActive] = useState(() => {\n if (_toasterActive) return false;\n _toasterActive = true;\n return true;\n });\n\n // Sonner renders a portaled <ol data-sonner-toaster> at <body>. It does\n // NOT spread arbitrary props onto that element, so we can't pass\n // `data-component` as a prop. Instead, ref-callback and set it imperatively.\n // This is the bounding marker the kit's cascade reset depends on — without\n // it, toasts portal outside any `[data-component]` ancestor and miss the\n // scoped preflight.\n const toasterRef = useRef<HTMLElement | null>(null);\n\n const [docDir, setDocDir] = useState<'ltr' | 'rtl'>(() =>\n typeof document !== 'undefined'\n ? (document.documentElement.dir as 'ltr' | 'rtl') || 'ltr'\n : 'ltr',\n );\n\n useEffect(() => {\n return () => {\n if (isActive) _toasterActive = false;\n };\n }, [isActive]);\n\n useEffect(() => {\n if (!isActive) return;\n const obs = new MutationObserver(() => {\n setDocDir((document.documentElement.dir as 'ltr' | 'rtl') || 'ltr');\n });\n obs.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['dir'],\n });\n return () => obs.disconnect();\n }, [isActive]);\n\n if (!isActive) return null;\n\n return (\n <SonnerToaster\n ref={(el) => {\n toasterRef.current = el;\n if (el) el.setAttribute('data-component', 'toast-region');\n }}\n dir={docDir}\n position={resolvePosition(position)}\n richColors={false}\n visibleToasts={visibleToasts}\n gap={gap}\n offset={offset}\n className={className}\n toastOptions={{\n unstyled: true,\n classNames: {\n toast: [\n 'ds:flex ds:items-center',\n 'ds:bg-[var(--popover)] ds:text-[var(--popover-foreground)]',\n 'ds:shadow-[var(--shadow-lg)]',\n 'ds:forced-colors:border ds:forced-colors:border-[CanvasText]',\n 'ds:rounded-[var(--radius-md)]',\n 'ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:py-[var(--spacing-sm)]',\n 'ds:[max-inline-size:360px] ds:max-sm:[max-inline-size:88dvw]',\n 'break-words',\n 'ds:z-[var(--z-toast)]',\n 'ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n ].join(' '),\n icon: 'hidden',\n content: 'ds:flex ds:flex-col ds:min-w-0 ds:flex-1',\n title: 'ds:w-full ds:min-w-0',\n },\n }}\n />\n );\n}\nToaster.displayName = 'Toaster';\n\nexport interface ToastOptions {\n description?: string;\n duration?: number;\n action?: {\n label: string;\n onClick: () => void;\n };\n cancel?: {\n label: string;\n onClick: () => void;\n };\n onDismiss?: () => void;\n onAutoClose?: () => void;\n}\n\ntype ToastVariant = 'info' | 'success' | 'warning' | 'error';\n\nfunction buildMessageNode(\n variant: ToastVariant,\n message: string,\n toastId: string,\n description?: string,\n): ReactNode {\n return (\n <div\n data-toast-id={toastId}\n className=\"ds:flex ds:w-full ds:items-center ds:gap-[var(--spacing-sm)]\"\n >\n {iconMap[variant]}\n <div className=\"ds:flex-1 ds:min-w-0 ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <span dir=\"auto\" className=\"type-label ds:leading-snug ds:break-words\">\n {message}\n </span>\n {description && (\n <span\n dir=\"auto\"\n className=\"type-body-sm ds:text-[var(--muted-foreground)] ds:break-words\"\n >\n {description}\n </span>\n )}\n </div>\n <ToastCloseButton toastId={toastId} />\n </div>\n );\n}\n\nfunction ToastCloseButton({ toastId }: { toastId: string }) {\n const { t } = useTranslation();\n return (\n <IconButton\n icon={<X />}\n intent=\"ghost\"\n size=\"sm\"\n aria-label={t('common.close')}\n onClick={() => toast.dismiss(toastId)}\n className=\"ds:shrink-0\"\n />\n );\n}\n\nfunction fireToast(\n variant: ToastVariant,\n message: string,\n options?: ToastOptions,\n): string | number {\n const defaultDuration = variant === 'error' ? Infinity : 4000;\n const id = `${Date.now()}-${Math.random().toString(36).slice(2, 7)}`;\n\n const content = buildMessageNode(variant, message, id, options?.description);\n\n _activeToasts.add(id);\n\n const toastData = {\n id,\n icon: null,\n duration: options?.duration ?? defaultDuration,\n action: options?.action\n ? { label: options.action.label, onClick: options.action.onClick }\n : undefined,\n cancel: options?.cancel\n ? { label: options.cancel.label, onClick: options.cancel.onClick }\n : undefined,\n onDismiss: () => {\n _activeToasts.delete(id);\n options?.onDismiss?.();\n },\n onAutoClose: () => {\n _activeToasts.delete(id);\n options?.onAutoClose?.();\n },\n };\n\n /* Use sonner's typed methods so the correct aria-live region is used:\n toast.error() → role=\"alert\" aria-live=\"assertive\"\n toast.info/success/warning() → role=\"status\" aria-live=\"polite\" */\n switch (variant) {\n case 'error':\n return toast.error(content, toastData);\n case 'success':\n return toast.success(content, toastData);\n case 'warning':\n return toast.warning(content, toastData);\n case 'info':\n return toast.info(content, toastData);\n default:\n return toast(content, toastData);\n }\n}\n\nexport function toastInfo(\n message: string,\n options?: ToastOptions,\n): string | number {\n return fireToast('info', message, options);\n}\n\nexport function toastSuccess(\n message: string,\n options?: ToastOptions,\n): string | number {\n return fireToast('success', message, options);\n}\n\nexport function toastWarning(\n message: string,\n options?: ToastOptions,\n): string | number {\n return fireToast('warning', message, options);\n}\n\nexport function toastError(\n message: string,\n options?: ToastOptions,\n): string | number {\n return fireToast('error', message, options);\n}\n\n/* -------------------------------------------------------------------- */\n/* Agent handle — module-level, since Toast is imperatively created. */\n/* */\n/* The future MCP UI bridge calls into this handle to dismiss specific */\n/* toasts and snapshot the visible set. Hosts can register this handle */\n/* once at app root via `useAgentRegistration(toastAgent, toastAgentHandle, 'toast')`.\n/* -------------------------------------------------------------------- */\n\nexport interface ToastAgentHandle {\n getVisibleToasts: () => Array<{ id: string }>;\n dismiss: (id: string) => void;\n dismissAll: () => void;\n}\n\nexport const toastAgentHandle: ToastAgentHandle = {\n getVisibleToasts: () => Array.from(_activeToasts).map((id) => ({ id })),\n dismiss: (id: string) => {\n _activeToasts.delete(id);\n toast.dismiss(id);\n },\n dismissAll: () => {\n _activeToasts.clear();\n toast.dismiss();\n },\n};\n","/* -------------------------------------------------------------------- */\n/* Agent adapter — Toast. */\n/* */\n/* Toast is imperative: a single page-level <Toaster /> renders all */\n/* toasts created via `toastInfo` / `toastSuccess` / etc. The DS exports */\n/* a module-level handle (`toastAgentHandle`) which sonner-dismisses by */\n/* toast id and snapshots the current visible-toast set. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { ToastAgentHandle } from './toast';\n\nexport const toastAgent: AgentAdapter<ToastAgentHandle> = {\n id: 'toast',\n capabilities: ['dismiss'],\n state: {\n visibleToasts: {\n type: 'Array<{ id: string }>',\n descriptionKey: 'ui.agent.toast.state.visibleToasts',\n description:\n 'Snapshot of currently-visible toasts by opaque id. Never carries the toast body text.',\n read: (handle) => handle.getVisibleToasts(),\n },\n },\n actions: {\n dismiss: {\n safety: 'destructive',\n argsType: '{ id: string }',\n argsSchema: {\n type: 'object',\n properties: { id: { type: 'string' } },\n required: ['id'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.toast.actions.dismiss',\n description:\n 'Dismiss the toast with the given id. Irreversible from the same UI.',\n invoke: (handle, args: { id: string }) => {\n handle.dismiss(args.id);\n },\n },\n dismiss_all: {\n safety: 'destructive',\n idempotent: true,\n descriptionKey: 'ui.agent.toast.actions.dismissAll',\n description: 'Dismiss every visible toast.',\n invoke: (handle) => {\n handle.dismissAll();\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n // The sonner <ol> region wrapper emits `data-component=\"toast-region\"`\n // (not the bare adapter id) — toasts are imperatively created and\n // addressed individually by id, not by a per-instance component root.\n value: 'toast-region',\n description:\n 'Marks the Toaster region wrapper (data-component=\"toast-region\"). Toast is imperatively created; the registry addresses individual toasts by id, not by per-instance root.',\n },\n item: {\n attr: 'data-toast-id',\n description:\n 'Stable opaque toast id assigned at creation. Used by `dismiss({id})`.',\n },\n },\n};\n"],"names":["__insertCSS","code","head","style","getAsset","type","SuccessIcon","InfoIcon","WarningIcon","ErrorIcon","bars","Loader","visible","className","React","_","i","CloseIcon","useIsDocumentHidden","isDocumentHidden","setIsDocumentHidden","callback","toastsCounter","Observer","subscriber","index","data","_data_id","message","rest","id","alreadyExists","toast","dismissible","promise","p","shouldDismiss","result","originalPromise","response","isHttpResponse","promiseData","description","toastSettings","error","unwrap","resolve","reject","jsx","ToastState","toastFunction","basicToast","getHistory","getToasts","isAction","action","VISIBLE_TOASTS_AMOUNT","VIEWPORT_OFFSET","MOBILE_VIEWPORT_OFFSET","TOAST_LIFETIME","TOAST_WIDTH","GAP","SWIPE_THRESHOLD","TIME_BEFORE_UNMOUNT","cn","classes","getDefaultSwipeDirections","position","y","x","directions","Toast","props","_toast_classNames","_toast_classNames1","_toast_classNames2","_toast_classNames3","_toast_classNames4","_toast_classNames5","_toast_classNames6","_toast_classNames7","_toast_classNames8","ToasterInvert","unstyled","interacting","setHeights","visibleToasts","heights","toasts","expanded","removeToast","defaultRichColors","closeButtonFromToaster","cancelButtonStyle","actionButtonStyle","descriptionClassName","durationFromToaster","gap","expandByDefault","classNames","icons","closeButtonAriaLabel","swipeDirection","setSwipeDirection","swipeOutDirection","setSwipeOutDirection","mounted","setMounted","removed","setRemoved","swiping","setSwiping","swipeOut","setSwipeOut","isSwiped","setIsSwiped","offsetBeforeRemove","setOffsetBeforeRemove","initialHeight","setInitialHeight","remainingTime","dragStartTime","toastRef","isFront","isVisible","toastType","toastClassname","toastDescriptionClassname","heightIndex","height","closeButton","_toast_closeButton","duration","closeTimerStartTimeRef","offset","lastCloseTimerStartTimeRef","pointerStartRef","toastsHeightBefore","prev","curr","reducerIndex","invert","disabled","toastNode","h","originalHeight","newHeight","deleteToast","timeoutId","elapsedTime","getLoadingIcon","icon","_toast_richColors","_icons_close","event","_toastRef_current","_toastRef_current1","_dragStartTime_current","swipeAmountX","swipeAmountY","timeTaken","swipeAmount","velocity","_toastRef_current2","_toastRef_current3","_window_getSelection","yDelta","xDelta","_props_swipeDirections","swipeDirections","getDampening","delta","dampenedDelta","getDocumentDirection","dirAttribute","assignOffset","defaultOffset","mobileOffset","styles","isMobile","prefix","defaultValue","assignAll","key","Toaster","ref","hotkey","expand","theme","richColors","toastOptions","dir","containerAriaLabel","setToasts","filteredToasts","possiblePositions","setExpanded","setInteracting","actualTheme","setActualTheme","listRef","hotkeyLabel","lastFocusedElementRef","isFocusWithinRef","toastToRemove","_toasts_find","t","ReactDOM","indexOfExistingToast","darkMediaQuery","matches","e","handleKeyDown","_listRef_current","_listRef_current1","_heights_","_toastOptions_duration","_toastOptions_closeButton","iconMap","Info","CircleCheck","TriangleAlert","CircleAlert","_toasterActive","_activeToasts","resolvePosition","logical","isRtl","isActive","useState","toasterRef","useRef","docDir","setDocDir","useEffect","obs","SonnerToaster","el","buildMessageNode","variant","toastId","jsxs","ToastCloseButton","useTranslation","IconButton","X","fireToast","options","defaultDuration","content","toastData","_a","toastInfo","toastSuccess","toastWarning","toastError","toastAgentHandle","toastAgent","handle","args"],"mappings":";;;;;;;;;;AACA,SAASA,GAAYC,GAAM;AACzB,MAAa,OAAO,WAAY,IAAa;AAC7C,MAAIC,IAAO,SAAS,QAAQ,SAAS,qBAAqB,MAAM,EAAE,CAAC,GAC/DC,IAAQ,SAAS,cAAc,OAAO;AAC1C,EAAAA,EAAM,OAAO,YACbD,EAAK,YAAYC,CAAK,GACrBA,EAAM,aAAcA,EAAM,WAAW,UAAUF,IAAQE,EAAM,YAAY,SAAS,eAAeF,CAAI,CAAC;AACzG;AAKA,MAAMG,KAAW,CAACC,MAAO;AACrB,UAAOA,GAAI;AAAA,IACP,KAAK;AACD,aAAOC;AAAA,IACX,KAAK;AACD,aAAOC;AAAA,IACX,KAAK;AACD,aAAOC;AAAA,IACX,KAAK;AACD,aAAOC;AAAA,IACX;AACI,aAAO;AAAA,EACnB;AACA,GACMC,KAAO,MAAM,EAAE,EAAE,KAAK,CAAC,GACvBC,KAAS,CAAC,EAAE,SAAAC,GAAS,WAAAC,QACFC,gBAAAA,EAAM,cAAc,OAAO;AAAA,EAC5C,WAAW;AAAA,IACP;AAAA,IACAD;AAAA,EACZ,EAAU,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,EAC1B,gBAAgBD;AACxB,GAAqBE,gBAAAA,EAAM,cAAc,OAAO;AAAA,EACxC,WAAW;AACnB,GAAOJ,GAAK,IAAI,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A,IAEF,aAAa;AAAA,MACX,QAAQ;AAAA,MACR,YAAY;AAAA,MACZ,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,QAAQ,CAACD,MAAW;AAClB,QAAAA,EAAO,WAAA;AAAA,MACT;AAAA,IAAA;AAAA,EACF;AAAA,EAEF,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,MAAM;AAAA;AAAA;AAAA;AAAA,MAIN,OAAO;AAAA,MACP,aACE;AAAA,IAAA;AAAA,IAEJ,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,aACE;AAAA,IAAA;AAAA,EACJ;AAEJ;","x_google_ignoreList":[0]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-map-DE_ribRM.js","sources":["../../node_modules/lucide-react/dist/esm/icons/circle-dashed.mjs","../../node_modules/lucide-react/dist/esm/icons/circle-pause.mjs","../../node_modules/lucide-react/dist/esm/icons/power-off.mjs","../../node_modules/lucide-react/dist/esm/icons/power.mjs","../../node_modules/lucide-react/dist/esm/icons/smartphone.mjs","../../src/components/workflow/workflow-card.tsx","../../src/components/workflow/workflow.agent.ts","../../src/components/workflow/workflow-types.ts","../../src/components/workflow/workflow-editor.tsx","../../src/components/workflow/workflow-map.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 [\"path\", { d: \"M10.1 2.182a10 10 0 0 1 3.8 0\", key: \"5ilxe3\" }],\n [\"path\", { d: \"M13.9 21.818a10 10 0 0 1-3.8 0\", key: \"11zvb9\" }],\n [\"path\", { d: \"M17.609 3.721a10 10 0 0 1 2.69 2.7\", key: \"1iw5b2\" }],\n [\"path\", { d: \"M2.182 13.9a10 10 0 0 1 0-3.8\", key: \"c0bmvh\" }],\n [\"path\", { d: \"M20.279 17.609a10 10 0 0 1-2.7 2.69\", key: \"1ruxm7\" }],\n [\"path\", { d: \"M21.818 10.1a10 10 0 0 1 0 3.8\", key: \"qkgqxc\" }],\n [\"path\", { d: \"M3.721 6.391a10 10 0 0 1 2.7-2.69\", key: \"1mcia2\" }],\n [\"path\", { d: \"M6.391 20.279a10 10 0 0 1-2.69-2.7\", key: \"1fvljs\" }]\n];\nconst CircleDashed = createLucideIcon(\"circle-dashed\", __iconNode);\n\nexport { __iconNode, CircleDashed as default };\n//# sourceMappingURL=circle-dashed.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 [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"line\", { x1: \"10\", x2: \"10\", y1: \"15\", y2: \"9\", key: \"c1nkhi\" }],\n [\"line\", { x1: \"14\", x2: \"14\", y1: \"15\", y2: \"9\", key: \"h65svq\" }]\n];\nconst CirclePause = createLucideIcon(\"circle-pause\", __iconNode);\n\nexport { __iconNode, CirclePause as default };\n//# sourceMappingURL=circle-pause.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: \"M18.36 6.64A9 9 0 0 1 20.77 15\", key: \"dxknvb\" }],\n [\"path\", { d: \"M6.16 6.16a9 9 0 1 0 12.68 12.68\", key: \"1x7qb5\" }],\n [\"path\", { d: \"M12 2v4\", key: \"3427ic\" }],\n [\"path\", { d: \"m2 2 20 20\", key: \"1ooewy\" }]\n];\nconst PowerOff = createLucideIcon(\"power-off\", __iconNode);\n\nexport { __iconNode, PowerOff as default };\n//# sourceMappingURL=power-off.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: \"M12 2v10\", key: \"mnfbl\" }],\n [\"path\", { d: \"M18.4 6.6a9 9 0 1 1-12.77.04\", key: \"obofu9\" }]\n];\nconst Power = createLucideIcon(\"power\", __iconNode);\n\nexport { __iconNode, Power as default };\n//# sourceMappingURL=power.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 [\"rect\", { width: \"14\", height: \"20\", x: \"5\", y: \"2\", rx: \"2\", ry: \"2\", key: \"1yt0o3\" }],\n [\"path\", { d: \"M12 18h.01\", key: \"mhygvu\" }]\n];\nconst Smartphone = createLucideIcon(\"smartphone\", __iconNode);\n\nexport { __iconNode, Smartphone as default };\n//# sourceMappingURL=smartphone.mjs.map\n","import { forwardRef, type MouseEvent, type ReactNode } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport {\n Circle,\n CircleDashed,\n CirclePause,\n Pencil,\n Power,\n PowerOff,\n Trash2,\n} from 'lucide-react';\nimport { Card } from '../card';\nimport { Badge } from '../badge';\nimport { KeyValuePair } from '../key-value-pair';\nimport { Timestamp } from '../timestamp';\nimport { IconButton } from '../button/icon-button';\nimport type { WorkflowStatus, WorkflowSummary } from './workflow-types';\n\n/* ------------------------------------------------------------------ */\n/* Variants */\n/* ------------------------------------------------------------------ */\n\nconst workflowCardVariants = cva('ds:relative ds:w-full', {\n variants: {\n density: {\n comfortable: '',\n compact: '',\n },\n },\n defaultVariants: {\n density: 'comfortable',\n },\n});\n\n/* ------------------------------------------------------------------ */\n/* Status → badge + icon mapping */\n/* ------------------------------------------------------------------ */\n\ntype BadgeVariant = 'neutral' | 'success' | 'warning';\n\ninterface StatusMeta {\n badgeVariant: BadgeVariant;\n icon: ReactNode;\n}\n\nfunction getStatusMeta(status: WorkflowStatus): StatusMeta {\n switch (status) {\n case 'active':\n // Filled dot for `active` — readable without hue (WCAG 1.4.1).\n return {\n badgeVariant: 'success',\n icon: <Circle className=\"ds:fill-current\" aria-hidden=\"true\" />,\n };\n case 'paused':\n return {\n badgeVariant: 'warning',\n icon: <CirclePause aria-hidden=\"true\" />,\n };\n case 'inactive':\n default:\n return {\n badgeVariant: 'neutral',\n icon: <CircleDashed aria-hidden=\"true\" />,\n };\n }\n}\n\n/* ------------------------------------------------------------------ */\n/* Props */\n/* ------------------------------------------------------------------ */\n\nexport interface WorkflowCardProps extends VariantProps<\n typeof workflowCardVariants\n> {\n workflow: WorkflowSummary;\n density?: 'comfortable' | 'compact';\n /** Fires when the card body is clicked. Absent → card is not interactive. */\n onView?: (id: string) => void;\n /** Fires when the edit IconButton is clicked. Absent → no edit button. */\n onEdit?: (id: string) => void;\n /** Fires when the delete IconButton is clicked. Absent → no delete button. */\n onDelete?: (id: string) => void;\n /**\n * Fires when the activate/deactivate IconButton is clicked. The second\n * argument is the TARGET state (the opposite of the current status), so the\n * consumer's handler is idempotent. Absent → no toggle button.\n */\n onToggleActive?: (id: string, active: boolean) => void;\n className?: string;\n}\n\n/* ------------------------------------------------------------------ */\n/* WorkflowCard */\n/* ------------------------------------------------------------------ */\n\nexport const WorkflowCard = forwardRef<HTMLElement, WorkflowCardProps>(\n function WorkflowCard(\n {\n workflow,\n density = 'comfortable',\n onView,\n onEdit,\n onDelete,\n onToggleActive,\n className,\n },\n ref,\n ) {\n const { t } = useTranslation();\n\n const statusMeta = getStatusMeta(workflow.status);\n const isActive = workflow.status === 'active';\n const isCompact = density === 'compact';\n\n // Icon-button clicks must not bubble up to the card body so that\n // `onView` doesn't fire along with edit / delete / toggle.\n const stop =\n (handler: (() => void) | undefined) =>\n (event: MouseEvent<HTMLButtonElement>) => {\n event.stopPropagation();\n handler?.();\n };\n\n const statusBadge = (\n <Badge\n variant={statusMeta.badgeVariant}\n leading={statusMeta.icon}\n withDot={false}\n >\n {t(`workflow.status.${workflow.status}`)}\n </Badge>\n );\n\n const activeCountLabel = t('workflow.card.activeEnrollments');\n\n // When `onView` is provided we can't make the `<article>` itself a\n // role=\"button\" — that would violate both `aria-allowed-role`\n // (article forbids role=button) and `nested-interactive` (the\n // IconButtons in the footer would nest inside an outer button).\n // Instead we expose a single accessible-name-carrying `<button>`\n // on the title, styled to span the whole card via an inset ::after\n // pseudo-element so the hit target stays card-wide.\n return (\n <Card\n ref={ref}\n variant=\"default\"\n className={workflowCardVariants({ density, className })}\n data-component=\"workflow-card\"\n data-component-id={workflow.id}\n >\n <Card.Header>\n <div className=\"ds:flex ds:items-start ds:justify-between ds:gap-[var(--spacing-sm)]\">\n <div className=\"ds:flex ds:min-w-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <h3 className=\"ds:m-0 type-title-card ds:text-[color:var(--foreground)] ds:[overflow-wrap:anywhere] ds:break-words\">\n {onView ? (\n <button\n type=\"button\"\n onClick={() => onView(workflow.id)}\n className={[\n 'ds:text-start ds:font-inherit ds:text-inherit',\n // Inset overlay that turns the whole card into a\n // click target without nesting buttons. The\n // IconButton cluster in the footer paints above\n // this pseudo via `position: relative` + z-10.\n 'ds:after:absolute ds:after:inset-0 ds:after:content-[\"\"]',\n 'ds:after:rounded-[var(--radius-lg)]',\n 'ds:focus-visible:outline-none',\n 'ds:focus-visible:after:outline-[length:var(--focus-ring-width)]',\n 'ds:focus-visible:after:outline-solid',\n 'ds:focus-visible:after:outline-[color:var(--ring)]',\n 'ds:focus-visible:after:outline-offset-[length:var(--focus-ring-offset)]',\n ].join(' ')}\n >\n {workflow.name}\n </button>\n ) : (\n workflow.name\n )}\n </h3>\n {isCompact && (\n <span className=\"ds:flex ds:items-baseline ds:gap-[var(--spacing-xs)] type-body-sm ds:text-[color:var(--muted-foreground)]\">\n <span>{activeCountLabel}</span>\n <span className=\"ds:font-medium ds:text-[color:var(--foreground)]\">\n {workflow.stats.activeEnrollments}\n </span>\n </span>\n )}\n </div>\n <div className=\"ds:shrink-0\">{statusBadge}</div>\n </div>\n </Card.Header>\n\n {!isCompact && (\n <Card.Body className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\">\n <KeyValuePair\n label={t('workflow.card.activeEnrollments')}\n value={workflow.stats.activeEnrollments}\n />\n <KeyValuePair\n label={t('workflow.card.totalEnrollments')}\n value={workflow.stats.totalEnrollments}\n />\n </Card.Body>\n )}\n\n <Card.Footer className=\"ds:flex-wrap ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]\">\n <div className=\"ds:flex ds:min-w-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-xs)] type-body-sm ds:text-[color:var(--muted-foreground)]\">\n <span className=\"ds:truncate\" title={workflow.createdBy}>\n {t('workflow.createdBy', { name: workflow.createdBy })}\n </span>\n {workflow.updatedAt && (\n <Timestamp\n value={workflow.updatedAt}\n format=\"absolute\"\n shape=\"bare\"\n absoluteFormat={{ dateStyle: 'medium' }}\n className=\"ds:truncate\"\n />\n )}\n </div>\n\n <div className=\"ds:relative ds:z-10 ds:flex ds:shrink-0 ds:items-center ds:gap-[var(--spacing-xs)] ds:ms-auto\">\n {onEdit && (\n <IconButton\n icon={<Pencil />}\n size=\"sm\"\n intent=\"ghost\"\n aria-label={t('workflow.card.edit')}\n onClick={stop(() => onEdit(workflow.id))}\n />\n )}\n {onToggleActive && (\n <IconButton\n icon={isActive ? <PowerOff /> : <Power />}\n size=\"sm\"\n intent=\"ghost\"\n aria-label={t(\n isActive\n ? 'workflow.card.deactivate'\n : 'workflow.card.activate',\n )}\n onClick={stop(() => onToggleActive(workflow.id, !isActive))}\n />\n )}\n {onDelete && (\n <IconButton\n icon={<Trash2 />}\n size=\"sm\"\n intent=\"destructive\"\n aria-label={t('workflow.card.delete')}\n onClick={stop(() => onDelete(workflow.id))}\n />\n )}\n </div>\n </Card.Footer>\n </Card>\n );\n },\n);\n\nWorkflowCard.displayName = 'WorkflowCard';\n","/* -------------------------------------------------------------------- */\n/* Agent adapters — Workflow surfaces. */\n/* */\n/* The `workflow/` directory ships three distinct components — each with */\n/* its own `data-component` value (workflow-card, workflow-editor, */\n/* workflow-map). Three adapters are declared here, one per surface, so */\n/* the catalog reflects what's actually rendered in the DOM. The editor */\n/* is the only mutation surface; card and map are presentational and ship */\n/* root hooks only. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { WorkflowEditorHandle } from './workflow-editor';\n\nexport const workflowCardAgent: AgentAdapter = {\n id: 'workflow-card',\n // Presentational summary card — no agent-facing action or state. Navigation\n // is owned by the host pattern, so no capability is declared here.\n capabilities: [],\n state: {},\n actions: {},\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'workflow-card',\n description:\n 'Marks a Workflow summary card. Presentational — actions are owned by the host pattern.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n },\n};\n\nexport const workflowMapAgent: AgentAdapter = {\n id: 'workflow-map',\n // Presentational linear visualisation — no agent-facing action or state.\n capabilities: [],\n state: {},\n actions: {},\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'workflow-map',\n description:\n 'Marks a Workflow map (linear visualisation). Presentational.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n item: {\n attr: 'data-node-id',\n description: 'Stable opaque workflow node id emitted on each step.',\n },\n },\n};\n\nexport const workflowEditorAgent: AgentAdapter<WorkflowEditorHandle> = {\n id: 'workflow-editor',\n // `goto_step` focuses a node (navigation). No `expand` capability: the\n // WorkflowEditorHandle exposes no expand/collapse method to back it.\n capabilities: ['navigate'],\n state: {\n totalSteps: {\n type: 'number',\n descriptionKey: 'ui.agent.workflowEditor.state.totalSteps',\n description: 'Total number of nodes currently in the workflow graph.',\n read: (handle) => handle.getTotalSteps(),\n },\n currentStep: {\n type: 'string | null',\n descriptionKey: 'ui.agent.workflowEditor.state.currentStep',\n description: 'Opaque node id of the currently-focused step, or null.',\n read: (handle) => handle.getCurrentStep(),\n },\n },\n actions: {\n goto_step: {\n safety: 'read',\n argsType: '{ id: string }',\n argsSchema: {\n type: 'object',\n properties: { id: { type: 'string' } },\n required: ['id'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.workflowEditor.actions.gotoStep',\n description: 'Focus a node by its opaque id.',\n invoke: (handle, args: { id: string }) => {\n handle.gotoStep(args.id);\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'workflow-editor',\n description: 'Marks the WorkflowEditor surface.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n item: {\n attr: 'data-node-id',\n description: 'Stable opaque workflow node id emitted on each node card.',\n },\n },\n};\n","/**\n * Shared types and helpers for the Workflow component suite\n * (WorkflowCard · WorkflowEditor · WorkflowMap).\n *\n * The prop surface is DAG-shaped from day one — { nodes, edges } —\n * even though v1 renders workflows linearly. A linear pipeline is a\n * degenerate DAG where every node has exactly one outgoing edge with\n * a null condition. This means v2 branching (if/else) can ship as an\n * additive change without breaking v1 consumers.\n\n */\n\n// ---------------------------------------------------------------\n// Node types\n// ---------------------------------------------------------------\n\nexport type WorkflowActionType =\n | 'add_delay'\n | 'send_email'\n | 'send_sms'\n | 'create_task'\n // v2 types accepted by the type system today; the editor renders a\n // generic card for these until bespoke summariser UI ships.\n | 'send_whatsapp'\n | 'update_patient_field'\n | 'webhook';\n\nexport type WorkflowStatus = 'active' | 'inactive' | 'paused';\n\n// ---------------------------------------------------------------\n// Discriminated settings — `kind` narrows `WorkflowNode['settings']`\n// without the consumer needing a cast.\n// ---------------------------------------------------------------\n\nexport interface DelaySettings {\n kind: 'add_delay';\n days?: number;\n hours?: number;\n minutes?: number;\n}\n\nexport interface EmailSettings {\n kind: 'send_email';\n subject: string;\n body?: string;\n templateId?: string;\n}\n\nexport interface SmsSettings {\n kind: 'send_sms';\n body: string;\n}\n\nexport interface TaskSettings {\n kind: 'create_task';\n title: string;\n description?: string;\n assigneeId?: string;\n}\n\nexport interface WhatsAppSettings {\n kind: 'send_whatsapp';\n templateName: string;\n body?: string;\n}\n\nexport interface UpdateFieldSettings {\n kind: 'update_patient_field';\n /** Custom ObjectField id — NEVER a core patient column. */\n fieldId: string;\n fieldLabel: string;\n value: string;\n}\n\nexport interface WebhookSettings {\n kind: 'webhook';\n url: string;\n method: 'POST' | 'PUT';\n headers?: Record<string, string>;\n}\n\nexport type WorkflowActionSettings =\n | DelaySettings\n | EmailSettings\n | SmsSettings\n | TaskSettings\n | WhatsAppSettings\n | UpdateFieldSettings\n | WebhookSettings;\n\n// ---------------------------------------------------------------\n// Graph shape\n// ---------------------------------------------------------------\n\nexport interface WorkflowNode {\n id: string;\n type: WorkflowActionType;\n settings: WorkflowActionSettings;\n}\n\nexport interface WorkflowEdge {\n from: string;\n to: string;\n /**\n * Edge condition label. Null / omitted for linear pipelines.\n * Reserved for v2 branching: 'true' | 'false' for if_else nodes.\n */\n condition?: string | null;\n}\n\nexport interface WorkflowGraph {\n nodes: WorkflowNode[];\n edges: WorkflowEdge[];\n}\n\n// ---------------------------------------------------------------\n// Summary & stats (WorkflowCard)\n// ---------------------------------------------------------------\n\nexport interface WorkflowStats {\n totalEnrollments: number;\n activeEnrollments: number;\n}\n\nexport interface WorkflowSummary {\n id: string;\n name: string;\n status: WorkflowStatus;\n stats: WorkflowStats;\n actionCount: number;\n createdBy: string;\n createdAt: Date;\n updatedAt: Date;\n}\n\nexport interface EnrollmentCriteria {\n ruleCount: number;\n summary?: string;\n}\n\n// ---------------------------------------------------------------\n// Pure graph helpers — never mutate their inputs.\n// ---------------------------------------------------------------\n\n/**\n * Walk the linear chain starting from the first node (the one that\n * has no incoming linear edge). Returns nodes in execution order.\n * Throws in dev if the graph has a cycle or a node with multiple\n * linear outgoing edges (reserved for v2 branching).\n */\nexport function linearOrder(graph: WorkflowGraph): WorkflowNode[] {\n if (graph.nodes.length === 0) return [];\n\n const linearEdges = graph.edges.filter((e) => e.condition == null);\n const targets = new Set(linearEdges.map((e) => e.to));\n const roots = graph.nodes.filter((n) => !targets.has(n.id));\n\n // Fall back to the first declared node if the edges don't identify\n // a root (e.g. a brand-new graph with a single node and no edges).\n const start = roots[0] ?? graph.nodes[0];\n const byId = new Map(graph.nodes.map((n) => [n.id, n]));\n const edgesFrom = new Map<string, WorkflowEdge[]>();\n for (const edge of linearEdges) {\n const bucket = edgesFrom.get(edge.from) ?? [];\n bucket.push(edge);\n edgesFrom.set(edge.from, bucket);\n }\n\n const seen = new Set<string>();\n const order: WorkflowNode[] = [];\n let cursor: WorkflowNode | undefined = start;\n while (cursor && !seen.has(cursor.id)) {\n seen.add(cursor.id);\n order.push(cursor);\n const outgoing: WorkflowEdge[] = edgesFrom.get(cursor.id) ?? [];\n if (outgoing.length > 1) {\n // v2 branching surface — v1 renderer should warn but not crash.\n if (typeof console !== 'undefined') {\n console.warn(\n `[workflow] node ${cursor.id} has ${outgoing.length} outgoing linear edges; v1 walks the first only.`,\n );\n }\n }\n cursor = outgoing[0] ? byId.get(outgoing[0].to) : undefined;\n }\n\n // Append any orphan nodes (not reachable from the root) so callers\n // still see them in the UI instead of silently dropping them.\n for (const node of graph.nodes) {\n if (!seen.has(node.id)) order.push(node);\n }\n return order;\n}\n\n/**\n * Insert a new node after `afterNodeId` (or at the head when null).\n * Rewrites edges so the linear chain stays singly-linked.\n */\nexport function addNodeAfter(\n graph: WorkflowGraph,\n afterNodeId: string | null,\n node: WorkflowNode,\n): WorkflowGraph {\n const nodes = [...graph.nodes, node];\n\n if (afterNodeId === null) {\n // Insert at head.\n const oldHead = graph.nodes[0];\n if (!oldHead) {\n return { nodes, edges: [] };\n }\n return {\n nodes,\n edges: [\n { from: node.id, to: oldHead.id, condition: null },\n ...graph.edges,\n ],\n };\n }\n\n const outgoing = graph.edges.find(\n (e) => e.from === afterNodeId && e.condition == null,\n );\n\n if (!outgoing) {\n // Append at tail.\n return {\n nodes,\n edges: [\n ...graph.edges,\n { from: afterNodeId, to: node.id, condition: null },\n ],\n };\n }\n\n // Splice into the middle.\n const otherEdges = graph.edges.filter((e) => e !== outgoing);\n return {\n nodes,\n edges: [\n ...otherEdges,\n { from: afterNodeId, to: node.id, condition: null },\n { from: node.id, to: outgoing.to, condition: null },\n ],\n };\n}\n\n/** Remove a node and reconnect its neighbours so the chain stays intact. */\nexport function removeNode(\n graph: WorkflowGraph,\n nodeId: string,\n): WorkflowGraph {\n const incoming = graph.edges.find(\n (e) => e.to === nodeId && e.condition == null,\n );\n const outgoing = graph.edges.find(\n (e) => e.from === nodeId && e.condition == null,\n );\n\n const kept = graph.edges.filter((e) => e.from !== nodeId && e.to !== nodeId);\n\n const bridged =\n incoming && outgoing\n ? [...kept, { from: incoming.from, to: outgoing.to, condition: null }]\n : kept;\n\n return {\n nodes: graph.nodes.filter((n) => n.id !== nodeId),\n edges: bridged,\n };\n}\n\n/** Swap a node with its neighbour in the linear chain. */\nexport function moveNode(\n graph: WorkflowGraph,\n nodeId: string,\n direction: 'up' | 'down',\n): WorkflowGraph {\n const order = linearOrder(graph);\n const index = order.findIndex((n) => n.id === nodeId);\n if (index === -1) return graph;\n\n const swapIndex = direction === 'up' ? index - 1 : index + 1;\n if (swapIndex < 0 || swapIndex >= order.length) return graph;\n\n const a = order[index];\n const b = order[swapIndex];\n if (!a || !b) return graph;\n\n // Remove both, then re-insert in swapped order via the helpers above.\n // This is O(n) but keeps the invariant maintenance in one place.\n const afterRemove = removeNode(removeNode(graph, a.id), b.id);\n\n const first = direction === 'up' ? a : b;\n const second = direction === 'up' ? b : a;\n\n // Identify the node that now precedes the swap pair (or null for head).\n const firstPredecessor = order[Math.min(index, swapIndex) - 1]?.id ?? null;\n\n const step1 = addNodeAfter(afterRemove, firstPredecessor, first);\n return addNodeAfter(step1, first.id, second);\n}\n\n// ---------------------------------------------------------------\n// Action-type registry — single source of truth for icons + labels.\n// Adding a new action type requires: (a) extending\n// `WorkflowActionType`, (b) adding an entry here, (c) adding i18n\n// keys under `ui.workflow.action.*`. Nothing else.\n// ---------------------------------------------------------------\n\nexport interface WorkflowActionMeta {\n /** i18n key for the type label — full path under `ui.*`. */\n labelKey: string;\n /** lucide-react icon name for dynamic lookup by consumers. */\n iconName:\n | 'Clock'\n | 'Mail'\n | 'Smartphone'\n | 'CheckSquare'\n | 'MessageCircle'\n | 'UserCog'\n | 'Globe';\n}\n\n/**\n * Core patient columns that a workflow MUST NOT overwrite. The\n * `update_patient_field` action is scoped to custom `ObjectField`\n * entries only; passing one of these ids is a misconfiguration and\n * the editor surfaces a warning strip.\n *\n * The maintainability requirement behind this: a misconfigured\n * workflow must not be able to overwrite a patient's legal name or\n * contact info.\n */\nexport const CORE_PATIENT_FIELDS: ReadonlySet<string> = new Set([\n 'dateOfBirth',\n 'date_of_birth',\n 'firstName',\n 'first_name',\n 'lastName',\n 'last_name',\n 'name',\n 'email',\n 'phone',\n 'phoneNumber',\n 'phone_number',\n 'fiscalCode',\n 'fiscal_code',\n 'taxId',\n 'tax_id',\n 'gender',\n 'address',\n 'id',\n]);\n\n/** True when the field id targets a core patient column (never allowed). */\nexport function isCorePatientField(fieldId: string): boolean {\n return CORE_PATIENT_FIELDS.has(fieldId);\n}\n\nexport const workflowActionRegistry: Record<\n WorkflowActionType,\n WorkflowActionMeta\n> = {\n add_delay: {\n labelKey: 'workflow.action.addDelay',\n iconName: 'Clock',\n },\n send_email: {\n labelKey: 'workflow.action.sendEmail',\n iconName: 'Mail',\n },\n send_sms: {\n labelKey: 'workflow.action.sendSms',\n iconName: 'Smartphone',\n },\n create_task: {\n labelKey: 'workflow.action.createTask',\n iconName: 'CheckSquare',\n },\n send_whatsapp: {\n labelKey: 'workflow.action.sendWhatsapp',\n iconName: 'MessageCircle',\n },\n update_patient_field: {\n labelKey: 'workflow.action.updateField',\n iconName: 'UserCog',\n },\n webhook: {\n labelKey: 'workflow.action.webhook',\n iconName: 'Globe',\n },\n};\n","import {\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type KeyboardEvent as ReactKeyboardEvent,\n type MutableRefObject,\n type ReactNode,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { workflowEditorAgent } from './workflow.agent';\nimport {\n SquareCheckBig,\n ChevronDown,\n ChevronUp,\n Clock,\n Globe,\n Mail,\n MessageCircle,\n Pencil,\n Plus,\n Smartphone,\n Trash2,\n UserCog,\n type LucideIcon,\n} from 'lucide-react';\nimport { Card } from '../card';\nimport { Alert } from '../alert';\nimport { Button } from '../button';\nimport { IconButton } from '../button/icon-button';\nimport { DropdownMenu } from '../dropdown-menu';\nimport { EmptyState } from '../empty-state';\nimport {\n addNodeAfter,\n isCorePatientField,\n linearOrder,\n moveNode,\n workflowActionRegistry,\n type EnrollmentCriteria,\n type WorkflowActionMeta,\n type WorkflowActionSettings,\n type WorkflowActionType,\n type WorkflowGraph,\n type WorkflowNode,\n} from './workflow-types';\n\n/* ------------------------------------------------------------------ */\n/* Icon map — explicit so the bundler can tree-shake lucide-react */\n/* properly. Driven by `iconName` from the action registry. */\n/* ------------------------------------------------------------------ */\n\nconst ACTION_ICONS: Record<WorkflowActionMeta['iconName'], LucideIcon> = {\n Clock,\n Mail,\n Smartphone,\n CheckSquare: SquareCheckBig,\n MessageCircle,\n UserCog,\n Globe,\n};\n\nfunction ActionIcon({\n iconName,\n className,\n}: {\n iconName: WorkflowActionMeta['iconName'];\n className?: string;\n}) {\n const Glyph = ACTION_ICONS[iconName];\n return <Glyph aria-hidden=\"true\" className={className ?? 'ds:size-4'} />;\n}\n\n/* ------------------------------------------------------------------ */\n/* Settings summary helper — narrows on the discriminated-union */\n/* `kind` so every branch reads its type-specific fields safely. */\n/* ------------------------------------------------------------------ */\n\nconst TRUNCATE_EMAIL = 40;\nconst TRUNCATE_SMS = 60;\n\nfunction truncate(value: string, max: number): string {\n if (value.length <= max) return value;\n return `${value.slice(0, max - 1)}\\u2026`;\n}\n\ninterface SummaryResult {\n /** Displayed (possibly truncated) text. */\n text: string;\n /** Full, un-truncated text for `title` and `aria-label`. */\n full: string;\n}\n\nfunction summariseSettings(\n settings: WorkflowActionSettings,\n t: (key: string, options?: Record<string, unknown>) => string,\n): SummaryResult | null {\n switch (settings.kind) {\n case 'add_delay': {\n const days = settings.days ?? 0;\n const summary = t('workflow.delay.summary', { count: days });\n return { text: summary, full: summary };\n }\n case 'send_email': {\n const subject = settings.subject ?? '';\n const prefix = t('workflow.action.sendEmail');\n const full = `${prefix}: ${subject}`;\n return { text: truncate(full, TRUNCATE_EMAIL), full };\n }\n case 'send_sms': {\n const body = settings.body ?? '';\n return { text: truncate(body, TRUNCATE_SMS), full: body };\n }\n case 'create_task': {\n const title = settings.title ?? '';\n return { text: title, full: title };\n }\n // v2 types — generic fallback (no bespoke summariser yet).\n case 'send_whatsapp':\n case 'update_patient_field':\n case 'webhook':\n default:\n return null;\n }\n}\n\n/* ------------------------------------------------------------------ */\n/* Classes (no hardcoded colours / physical props / inline styles) */\n/* ------------------------------------------------------------------ */\n\nconst rootClasses = [\n 'ds:flex ds:flex-col',\n 'ds:w-full',\n 'ds:text-start',\n 'ds:gap-[var(--spacing-sm)]',\n].join(' ');\n\n// Connector line between items. Uses `border-inline-start` so the rule\n// automatically mirrors in RTL without any physical left/right reference.\nconst connectorClasses = [\n 'ds:block',\n 'ds:self-start',\n 'ds:h-[var(--spacing-md)]',\n 'ds:ms-[calc(var(--min-target-size)/2)]',\n 'ds:border-inline-start-[var(--border-width-hairline)]',\n 'ds:border-solid',\n 'ds:border-[color:var(--border)]',\n].join(' ');\n\nconst addButtonClasses = [\n 'ds:inline-flex ds:items-center ds:justify-center ds:gap-[var(--spacing-xs)]',\n 'ds:min-h-[var(--min-target-size)] ds:min-w-[var(--min-target-size)]',\n 'ds:rounded-[var(--radius-full)]',\n 'ds:border ds:border-dashed ds:border-[color:var(--border)]',\n 'ds:bg-[color:var(--background)]',\n 'ds:text-[color:var(--muted-foreground)]',\n 'ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)]',\n 'ds:text-[length:var(--font-size-sm)]',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:hover:bg-[color:var(--muted)]/20 ds:hover:text-[color:var(--foreground)]',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:forced-colors:focus-visible:outline-[CanvasText]',\n 'ds:disabled:opacity-50 ds:disabled:cursor-not-allowed',\n].join(' ');\n\nconst nodeCardFocusableClasses = [\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:forced-colors:focus-visible:outline-[CanvasText]',\n 'ds:rounded-[var(--radius-lg)]',\n].join(' ');\n\n/* ------------------------------------------------------------------ */\n/* Props */\n/* ------------------------------------------------------------------ */\n\n/** Curated imperative handle for agent / external automation. */\nexport interface WorkflowEditorHandle {\n getTotalSteps: () => number;\n getCurrentStep: () => string | null;\n gotoStep: (id: string) => void;\n}\n\nexport interface WorkflowEditorProps {\n /** DAG-shaped graph. v1 renders the linear chain via `linearOrder`. */\n graph: WorkflowGraph;\n /**\n * Fires for INTERNAL mutations only — add / reorder. Never fired for\n * edit or delete (those have their own callbacks). When `isActive`\n * is true the editor MUST NOT call this.\n */\n onChange: (graph: WorkflowGraph) => void;\n /** Optional enrollment-criteria summary rendered as a fixed header card. */\n enrollmentCriteria?: EnrollmentCriteria;\n /** Fires when the \"Edit criteria\" CTA in the criteria header is clicked. */\n onEditEnrollmentCriteria?: () => void;\n /** Locks ALL mutation controls and shows the active-lock banner. */\n isActive?: boolean;\n /**\n * Action types available in the add-action DropdownMenu.\n * Defaults to every key in `workflowActionRegistry`.\n */\n availableActions?: WorkflowActionType[];\n /** Fires when a node's edit IconButton is clicked. Consumer owns the form. */\n onEditNode?: (nodeId: string) => void;\n /** Fires when a node's delete IconButton is clicked. Consumer confirms. */\n onDeleteNode?: (nodeId: string) => void;\n className?: string;\n}\n\n/* ------------------------------------------------------------------ */\n/* Defaults */\n/* ------------------------------------------------------------------ */\n\nconst ALL_ACTION_TYPES = Object.keys(\n workflowActionRegistry,\n) as WorkflowActionType[];\n\nlet nodeIdCounter = 0;\nfunction generateNodeId(): string {\n nodeIdCounter += 1;\n const random = Math.random().toString(36).slice(2, 8);\n return `wf-node-${Date.now()}-${nodeIdCounter}-${random}`;\n}\n\nfunction defaultSettingsFor(type: WorkflowActionType): WorkflowActionSettings {\n switch (type) {\n case 'add_delay':\n return { kind: 'add_delay', days: 1 };\n case 'send_email':\n return { kind: 'send_email', subject: '' };\n case 'send_sms':\n return { kind: 'send_sms', body: '' };\n case 'create_task':\n return { kind: 'create_task', title: '' };\n case 'send_whatsapp':\n return { kind: 'send_whatsapp', templateName: '' };\n case 'update_patient_field':\n return {\n kind: 'update_patient_field',\n fieldId: '',\n fieldLabel: '',\n value: '',\n };\n case 'webhook':\n return { kind: 'webhook', url: '', method: 'POST' };\n }\n}\n\n/* ------------------------------------------------------------------ */\n/* Roving-tabindex helper: a `useRef`-backed mutable index without */\n/* re-rendering on every arrow keystroke. */\n/* ------------------------------------------------------------------ */\n\nfunction useMutableIndex(\n initial = 0,\n): [MutableRefObject<number>, (v: number) => void] {\n const ref = useRef(initial);\n const setter = useCallback((v: number) => {\n ref.current = v;\n }, []);\n return [ref, setter];\n}\n\n/* ------------------------------------------------------------------ */\n/* Action-node card */\n/* ------------------------------------------------------------------ */\n\ninterface ActionNodeCardProps {\n node: WorkflowNode;\n position: number;\n total: number;\n disabled: boolean;\n onEdit?: (id: string) => void;\n onDelete?: (id: string) => void;\n onMove: (id: string, direction: 'up' | 'down') => void;\n registerRef: (id: string, el: HTMLDivElement | null) => void;\n}\n\nfunction ActionNodeCard({\n node,\n position,\n total,\n disabled,\n onEdit,\n onDelete,\n onMove,\n registerRef,\n}: ActionNodeCardProps) {\n const { t } = useTranslation();\n const meta = workflowActionRegistry[node.type];\n\n // Roving tabindex: the card itself is tabbable; once focused, arrow\n // keys step through its internal controls.\n const controlsRef = useRef<HTMLDivElement | null>(null);\n const [activeControl, setActiveControl] = useMutableIndex(0);\n\n const focusControl = useCallback(\n (index: number) => {\n const controls = controlsRef.current?.querySelectorAll<HTMLButtonElement>(\n 'button[data-wf-control]:not([disabled])',\n );\n if (!controls || controls.length === 0) return;\n const clamped = Math.max(0, Math.min(index, controls.length - 1));\n controls[clamped]?.focus();\n setActiveControl(clamped);\n },\n [setActiveControl],\n );\n\n const handleCardKeyDown = (event: ReactKeyboardEvent<HTMLDivElement>) => {\n // Only intercept keystrokes landing on the card wrapper itself.\n if (event.target !== event.currentTarget) return;\n if (event.key === 'ArrowRight' || event.key === 'ArrowDown') {\n event.preventDefault();\n focusControl(0);\n }\n };\n\n const handleControlsKeyDown = (event: ReactKeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'ArrowRight') {\n event.preventDefault();\n focusControl(activeControl.current + 1);\n } else if (event.key === 'ArrowLeft') {\n event.preventDefault();\n focusControl(activeControl.current - 1);\n } else if (event.key === 'Home') {\n event.preventDefault();\n focusControl(0);\n } else if (event.key === 'End') {\n event.preventDefault();\n focusControl(Number.POSITIVE_INFINITY);\n }\n };\n\n const summary = summariseSettings(node.settings, t);\n const typeLabel = t(meta.labelKey);\n const canMoveUp = position > 0;\n const canMoveDown = position < total - 1;\n\n const positionText = t('workflow.editor.position', {\n current: position + 1,\n total,\n });\n const nodeAriaLabel = t('workflow.editor.nodeAriaLabel', {\n type: typeLabel,\n current: position + 1,\n total,\n });\n\n return (\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions -- node card is keyboard-actionable via roving tabindex; pipeline keys handled in onKeyDown\n <div\n ref={(el) => registerRef(node.id, el)}\n tabIndex={disabled ? -1 : 0}\n onKeyDown={handleCardKeyDown}\n aria-label={nodeAriaLabel}\n data-node-id={node.id}\n className={nodeCardFocusableClasses}\n >\n <Card variant=\"outlined\">\n <Card.Header className=\"ds:pb-[var(--spacing-sm)]\">\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-sm)]\">\n <span\n aria-hidden=\"true\"\n className=\"ds:inline-flex ds:size-8 ds:shrink-0 ds:items-center ds:justify-center ds:rounded-[var(--radius-sm)] ds:bg-[color:var(--muted)]/20 ds:text-[color:var(--foreground)]\"\n >\n <ActionIcon iconName={meta.iconName} className=\"ds:size-4\" />\n </span>\n <div className=\"ds:flex ds:min-w-0 ds:flex-1 ds:flex-col\">\n <span className=\"ds:text-[length:var(--font-size-sm)] ds:font-[var(--font-weight-semibold)] ds:text-[color:var(--foreground)] ds:[overflow-wrap:anywhere] ds:break-words\">\n {typeLabel}\n </span>\n <span className=\"ds:text-[length:var(--font-size-xs)] ds:text-[color:var(--muted-foreground)]\">\n {positionText}\n </span>\n </div>\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions -- inner controls subtree handles arrow-key navigation between edit/delete buttons */}\n <div\n ref={controlsRef}\n onKeyDown={handleControlsKeyDown}\n className=\"ds:flex ds:shrink-0 ds:items-center ds:gap-[var(--spacing-xs)] ds:ms-auto\"\n >\n {onEdit ? (\n <IconButton\n data-wf-control=\"edit\"\n icon={<Pencil />}\n size=\"sm\"\n intent=\"ghost\"\n disabled={disabled}\n tabIndex={-1}\n aria-label={t('workflow.editor.editAction')}\n onClick={() => onEdit(node.id)}\n />\n ) : null}\n <IconButton\n data-wf-control=\"up\"\n icon={<ChevronUp />}\n size=\"sm\"\n intent=\"ghost\"\n disabled={disabled || !canMoveUp}\n tabIndex={-1}\n aria-label={t('workflow.editor.moveUp')}\n onClick={() => onMove(node.id, 'up')}\n />\n <IconButton\n data-wf-control=\"down\"\n icon={<ChevronDown />}\n size=\"sm\"\n intent=\"ghost\"\n disabled={disabled || !canMoveDown}\n tabIndex={-1}\n aria-label={t('workflow.editor.moveDown')}\n onClick={() => onMove(node.id, 'down')}\n />\n {onDelete ? (\n <IconButton\n data-wf-control=\"delete\"\n icon={<Trash2 />}\n size=\"sm\"\n intent=\"destructive\"\n disabled={disabled}\n tabIndex={-1}\n aria-label={t('workflow.editor.deleteAction')}\n onClick={() => onDelete(node.id)}\n />\n ) : null}\n </div>\n </div>\n </Card.Header>\n {summary ? (\n <Card.Body className=\"ds:pt-0\">\n <p\n className=\"ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)] ds:[overflow-wrap:anywhere] ds:break-words\"\n title={summary.full}\n >\n {summary.text}\n </p>\n </Card.Body>\n ) : null}\n {node.settings.kind === 'update_patient_field' &&\n isCorePatientField(node.settings.fieldId) ? (\n <Card.Body className=\"ds:pt-0\">\n <Alert variant=\"error\" data-testid=\"workflow-editor-invalid-field\">\n {t('workflow.editor.invalidField')}\n </Alert>\n </Card.Body>\n ) : null}\n </Card>\n </div>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Add-action trigger + DropdownMenu */\n/* ------------------------------------------------------------------ */\n\ninterface AddActionMenuProps {\n availableActions: WorkflowActionType[];\n onSelect: (type: WorkflowActionType) => void;\n disabled: boolean;\n label: string;\n compact?: boolean;\n}\n\nfunction AddActionMenu({\n availableActions,\n onSelect,\n disabled,\n label,\n compact = true,\n}: AddActionMenuProps) {\n const { t } = useTranslation();\n\n return (\n <DropdownMenu.Root>\n <DropdownMenu.Trigger asChild>\n <button\n type=\"button\"\n disabled={disabled}\n aria-label={label}\n className={addButtonClasses}\n >\n <Plus aria-hidden=\"true\" className=\"ds:size-4\" />\n {compact ? null : (\n <span className=\"ds:text-[length:var(--font-size-sm)]\">\n {label}\n </span>\n )}\n </button>\n </DropdownMenu.Trigger>\n <DropdownMenu.Content align=\"start\" sideOffset={6}>\n <DropdownMenu.Label>\n {t('workflow.editor.addAction')}\n </DropdownMenu.Label>\n {availableActions.map((type) => {\n const meta = workflowActionRegistry[type];\n return (\n <DropdownMenu.Item\n key={type}\n startIcon={<ActionIcon iconName={meta.iconName} />}\n onSelect={() => onSelect(type)}\n >\n {t(meta.labelKey)}\n </DropdownMenu.Item>\n );\n })}\n </DropdownMenu.Content>\n </DropdownMenu.Root>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Criteria header */\n/* ------------------------------------------------------------------ */\n\ninterface CriteriaHeaderProps {\n criteria?: EnrollmentCriteria;\n onEdit?: () => void;\n disabled: boolean;\n}\n\nfunction CriteriaHeader({ criteria, onEdit, disabled }: CriteriaHeaderProps) {\n const { t } = useTranslation();\n const count = criteria?.ruleCount ?? 0;\n const summaryText =\n count > 0\n ? t('workflow.editor.criteriaCount', { count })\n : t('workflow.editor.noCriteria');\n\n return (\n <Card variant=\"outlined\">\n <Card.Header className=\"ds:pb-[var(--spacing-sm)]\">\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-sm)]\">\n <div className=\"ds:flex ds:min-w-0 ds:flex-1 ds:flex-col\">\n <span className=\"ds:text-[length:var(--font-size-sm)] ds:font-[var(--font-weight-semibold)] ds:text-[color:var(--foreground)]\">\n {t('workflow.editor.enrollmentCriteria')}\n </span>\n <span className=\"ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)] ds:[overflow-wrap:anywhere] ds:break-words\">\n {criteria?.summary ?? summaryText}\n </span>\n </div>\n {onEdit ? (\n <IconButton\n icon={<Pencil />}\n size=\"sm\"\n intent=\"ghost\"\n disabled={disabled}\n aria-label={t('workflow.editor.editCriteria')}\n onClick={onEdit}\n />\n ) : null}\n </div>\n </Card.Header>\n </Card>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* WorkflowEditor */\n/* ------------------------------------------------------------------ */\n\nexport const WorkflowEditor = forwardRef<HTMLDivElement, WorkflowEditorProps>(\n function WorkflowEditor(\n {\n graph,\n onChange,\n enrollmentCriteria,\n onEditEnrollmentCriteria,\n isActive = false,\n availableActions,\n onEditNode,\n onDeleteNode,\n className,\n },\n ref,\n ) {\n const { t } = useTranslation();\n const types = availableActions ?? ALL_ACTION_TYPES;\n const ordered = useMemo(() => linearOrder(graph), [graph]);\n const nodeRefs = useRef<Map<string, HTMLDivElement | null>>(new Map());\n const focusTargetRef = useRef<string | null>(null);\n\n // Dev-mode guard: `onChange` should never fire while the editor is\n // locked. We wrap the consumer-supplied handler so internal calls\n // cannot violate the contract even if disabled state leaks.\n const safeOnChange = useCallback(\n (next: WorkflowGraph) => {\n if (isActive) {\n if (import.meta.env.DEV) {\n console.warn(\n '[WorkflowEditor] onChange suppressed — editor is active-locked.',\n );\n }\n return;\n }\n onChange(next);\n },\n [isActive, onChange],\n );\n\n const registerRef = useCallback((id: string, el: HTMLDivElement | null) => {\n if (el) {\n nodeRefs.current.set(id, el);\n } else {\n nodeRefs.current.delete(id);\n }\n }, []);\n\n const [currentStep, setCurrentStep] = useState<string | null>(null);\n const currentStepRef = useRef<string | null>(null);\n currentStepRef.current = currentStep;\n\n const rootRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => rootRef.current as HTMLDivElement, []);\n\n const agentHandle = useMemo<WorkflowEditorHandle>(\n () => ({\n getTotalSteps: () => ordered.length,\n getCurrentStep: () => currentStepRef.current,\n gotoStep: (id: string) => {\n const el = nodeRefs.current.get(id);\n if (el) {\n el.focus();\n setCurrentStep(id);\n }\n },\n }),\n [ordered.length],\n );\n useAgentRegistration(workflowEditorAgent, agentHandle, undefined);\n\n // After a mutation, focus returns to the inserted / moved card.\n useEffect(() => {\n const id = focusTargetRef.current;\n if (!id) return;\n const el = nodeRefs.current.get(id);\n if (el) {\n el.focus();\n focusTargetRef.current = null;\n }\n });\n\n const handleAddAfter = (\n afterId: string | null,\n type: WorkflowActionType,\n ) => {\n if (isActive) return;\n const node: WorkflowNode = {\n id: generateNodeId(),\n type,\n settings: defaultSettingsFor(type),\n };\n focusTargetRef.current = node.id;\n safeOnChange(addNodeAfter(graph, afterId, node));\n };\n\n const handleMove = (id: string, direction: 'up' | 'down') => {\n if (isActive) return;\n focusTargetRef.current = id;\n safeOnChange(moveNode(graph, id, direction));\n };\n\n const handleEdit = (id: string) => {\n if (isActive || !onEditNode) return;\n onEditNode(id);\n };\n\n const handleDelete = (id: string) => {\n if (isActive || !onDeleteNode) return;\n onDeleteNode(id);\n };\n\n const renderBanner = (): ReactNode =>\n isActive ? (\n <Alert variant=\"warning\">\n <Alert.Title as=\"p\">{t('workflow.editor.activeLock')}</Alert.Title>\n </Alert>\n ) : null;\n\n const renderCriteria = (): ReactNode =>\n enrollmentCriteria || onEditEnrollmentCriteria ? (\n <>\n <CriteriaHeader\n criteria={enrollmentCriteria}\n onEdit={onEditEnrollmentCriteria}\n disabled={isActive}\n />\n <span aria-hidden=\"true\" className={connectorClasses} />\n </>\n ) : null;\n\n const total = ordered.length;\n\n if (total === 0) {\n return (\n <div\n ref={rootRef}\n className={[rootClasses, className].filter(Boolean).join(' ')}\n >\n {renderBanner()}\n {renderCriteria()}\n <EmptyState\n variant=\"first-use\"\n title={t('workflow.editor.addFirstAction')}\n description={t('workflow.editor.empty')}\n >\n <EmptyState.Illustration>\n <svg\n viewBox=\"0 0 120 120\"\n fill=\"none\"\n aria-hidden=\"true\"\n className=\"ds:w-full ds:h-full\"\n >\n <circle\n cx=\"60\"\n cy=\"60\"\n r=\"50\"\n fill=\"var(--muted)\"\n stroke=\"var(--border)\"\n strokeWidth=\"2\"\n />\n <rect\n x=\"55\"\n y=\"30\"\n width=\"10\"\n height=\"60\"\n rx=\"5\"\n fill=\"var(--primary)\"\n />\n <rect\n x=\"30\"\n y=\"55\"\n width=\"60\"\n height=\"10\"\n rx=\"5\"\n fill=\"var(--primary)\"\n />\n </svg>\n </EmptyState.Illustration>\n <EmptyState.Title>\n {t('workflow.editor.addFirstAction')}\n </EmptyState.Title>\n <EmptyState.Description>\n {t('workflow.editor.empty')}\n </EmptyState.Description>\n <EmptyState.Actions>\n <DropdownMenu.Root>\n <DropdownMenu.Trigger asChild>\n <Button intent=\"primary\" disabled={isActive}>\n <Plus aria-hidden=\"true\" className=\"ds:size-4\" />\n <span>{t('workflow.editor.addFirstAction')}</span>\n </Button>\n </DropdownMenu.Trigger>\n <DropdownMenu.Content align=\"center\" sideOffset={6}>\n <DropdownMenu.Label>\n {t('workflow.editor.addAction')}\n </DropdownMenu.Label>\n {types.map((type) => {\n const meta = workflowActionRegistry[type];\n return (\n <DropdownMenu.Item\n key={type}\n startIcon={<ActionIcon iconName={meta.iconName} />}\n onSelect={() => handleAddAfter(null, type)}\n >\n {t(meta.labelKey)}\n </DropdownMenu.Item>\n );\n })}\n </DropdownMenu.Content>\n </DropdownMenu.Root>\n </EmptyState.Actions>\n </EmptyState>\n </div>\n );\n }\n\n // Non-empty: render the full pipeline.\n //\n // Structure:\n // [banner?]\n // [criteria header? + connector]\n // [leading ⊕]\n // <ol role=\"list\" aria-label=\"Workflow pipeline\">\n // <li> ← native role=\"listitem\"\n // connector + action-card + connector + trailing ⊕ (per-item)\n // </li>\n // …\n // </ol>\n //\n // The interleaved ⊕ buttons live inside each <li> — they are NOT\n // listitems themselves (they're <button>s), so the accessible tree\n // still reports \"list with N items\". The card-focus wrapper carries\n // `role=\"listitem\"` redundantly to keep the wrapper the single\n // focusable interactive surface; native <li> also implies listitem\n // but the browser already dedupes identical roles.\n return (\n <div\n ref={rootRef}\n data-component=\"workflow-editor\"\n className={[rootClasses, className].filter(Boolean).join(' ')}\n >\n {renderBanner()}\n {renderCriteria()}\n\n {/* Leading ⊕ button — OUTSIDE the list. */}\n <div>\n <AddActionMenu\n availableActions={types}\n disabled={isActive}\n label={t('workflow.editor.addAction')}\n onSelect={(type) => handleAddAfter(null, type)}\n />\n </div>\n\n {/* eslint-disable-next-line jsx-a11y/no-redundant-roles -- Safari strips the implicit list role on <ol> with list-style:none; this guard puts it back in the accessibility tree */}\n <ol\n role=\"list\"\n aria-label={t('workflow.editor.pipeline')}\n className=\"ds:list-none ds:m-0 ds:p-0 ds:flex ds:flex-col\"\n >\n {ordered.map((node, index) => (\n <li key={node.id} className=\"ds:list-none ds:flex ds:flex-col\">\n <span aria-hidden=\"true\" className={connectorClasses} />\n <ActionNodeCard\n node={node}\n position={index}\n total={total}\n disabled={isActive}\n onEdit={onEditNode ? handleEdit : undefined}\n onDelete={onDeleteNode ? handleDelete : undefined}\n onMove={handleMove}\n registerRef={registerRef}\n />\n <span aria-hidden=\"true\" className={connectorClasses} />\n <div>\n <AddActionMenu\n availableActions={types}\n disabled={isActive}\n label={t('workflow.editor.addActionAfter')}\n onSelect={(type) => handleAddAfter(node.id, type)}\n />\n </div>\n </li>\n ))}\n </ol>\n </div>\n );\n },\n);\n\nWorkflowEditor.displayName = 'WorkflowEditor';\n","import {\n forwardRef,\n useMemo,\n type ComponentType,\n type KeyboardEvent as ReactKeyboardEvent,\n type MouseEvent as ReactMouseEvent,\n type SVGProps,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport {\n Check,\n SquareCheckBig,\n Clock,\n Globe,\n ClipboardCheck,\n Mail,\n MessageCircle,\n Smartphone,\n UserCog,\n} from 'lucide-react';\nimport {\n linearOrder,\n workflowActionRegistry,\n type EnrollmentCriteria,\n type WorkflowActionMeta,\n type WorkflowActionSettings,\n type WorkflowGraph,\n type WorkflowNode,\n} from './workflow-types';\n\n/* ------------------------------------------------------------------ */\n/* Icon lookup — typed map over the registry's `iconName` union so we */\n/* get exhaustiveness + tree-shakeable named imports from lucide-react. */\n/* ------------------------------------------------------------------ */\n\ntype LucideIcon = ComponentType<SVGProps<SVGSVGElement>>;\n\nconst iconByName: Record<WorkflowActionMeta['iconName'], LucideIcon> = {\n Clock,\n Mail,\n Smartphone,\n CheckSquare: SquareCheckBig,\n MessageCircle,\n UserCog,\n Globe,\n};\n\n/* ------------------------------------------------------------------ */\n/* CVA variants */\n/* ------------------------------------------------------------------ */\n\nconst rootVariants = cva(\n // The map is a list of steps — never a list of meaningful controls.\n // Layout via logical properties only; connectors are sibling spacers\n // styled with border-inline-start / border-block-end (see node/spacer).\n 'ds:flex ds:list-none ds:p-0 ds:m-0',\n {\n variants: {\n orientation: {\n vertical: 'ds:flex-col ds:items-stretch',\n horizontal: 'ds:flex-row ds:items-stretch ds:flex-wrap',\n },\n compact: {\n true: 'ds:gap-0',\n false: 'ds:gap-0',\n },\n },\n defaultVariants: {\n orientation: 'vertical',\n compact: false,\n },\n },\n);\n\n// Each node's <li> stacks the node card and the trailing connector along\n// the root's main axis so the chain reads continuously in either\n// orientation. Vertical root (flex-col) → li is flex-col; horizontal root\n// (flex-row) → li is flex-row.\nconst nodeWrapperVariants = cva('ds:flex', {\n variants: {\n orientation: {\n vertical: 'ds:flex-col ds:items-stretch',\n horizontal: 'ds:flex-row ds:items-center',\n },\n },\n});\n\nconst nodeCardVariants = cva(\n [\n 'ds:relative ds:flex ds:items-center',\n 'ds:gap-[var(--spacing-sm)]',\n 'ds:rounded-[var(--radius-md)]',\n // Flat-hairline: 1px card-border, no shadow; accessible theme bumps to 2px.\n 'ds:border ds:border-[color:var(--card-border)] ds:[.theme-accessible_&]:border-2',\n 'ds:bg-[var(--card)] ds:text-[var(--card-foreground)]',\n // Motion honours the accessible theme (--animation-duration → 0ms).\n 'ds:transition-[box-shadow,transform,opacity] ds:duration-[var(--animation-duration)]',\n 'ds:motion-reduce:transition-none',\n // Content wraps instead of pushing siblings off-screen (DE / CJK story contract).\n 'ds:[word-break:break-word] ds:[overflow-wrap:anywhere]',\n ].join(' '),\n {\n variants: {\n orientation: {\n vertical: 'ds:inline-size-full',\n horizontal: 'ds:block-size-full',\n },\n compact: {\n true: 'ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:py-[var(--spacing-xs)] ds:min-h-[var(--spacing-xl)]',\n false:\n 'ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:py-[var(--spacing-sm)]',\n },\n state: {\n completed: '',\n current:\n 'ds:ring-2 ds:ring-[color:var(--ring)] ds:font-[var(--font-weight-semibold)]',\n // Pending state uses a dashed border + muted foreground so the\n // step reads as \"upcoming\" without dropping text contrast below\n // the 4.5:1 AA floor in dark-accessible. Applying opacity to\n // text that is already on --muted-foreground fails axe on the\n // dark themes (contrast ~3.6:1 after a 50 % dim).\n pending:\n 'ds:border-dashed ds:text-[color:var(--muted-foreground)] ds:[&_[data-testid=workflow-map-summary]]:text-[color:var(--muted-foreground)]',\n neutral: '',\n },\n interactive: {\n true: [\n 'ds:cursor-pointer',\n 'ds:hover:shadow-[var(--shadow-sm)]',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n ].join(' '),\n false: '',\n },\n },\n },\n);\n\n/**\n * Connector spacer — a bare <span aria-hidden=\"true\"> that draws the\n * line between nodes via logical-property borders. Vertical maps get\n * `border-inline-start`; horizontal maps get `border-block-end`. No\n * physical direction properties, no SVG.\n */\nconst spacerVariants = cva(\n ['ds:block', 'ds:border-solid', 'ds:border-[color:var(--border)]'].join(' '),\n {\n variants: {\n orientation: {\n vertical: [\n // Single edge: `border-s-[length:…]` maps to\n // `border-inline-start-width` in Tailwind v4, so only the\n // inline-start side renders — the other three stay at 0.\n // `ms-[…]` aligns the line under the icon column.\n 'ds:ms-[calc(var(--spacing-md)+var(--spacing-sm))]',\n 'ds:border-s-[length:var(--border-width-hairline)]',\n 'ds:border-inline-start',\n ].join(' '),\n horizontal: [\n 'ds:self-center',\n 'ds:border-b-[length:var(--border-width-hairline)]',\n 'ds:border-block-end',\n ].join(' '),\n },\n compact: {\n true: '',\n false: '',\n },\n },\n compoundVariants: [\n {\n orientation: 'vertical',\n compact: false,\n class: 'ds:h-[var(--spacing-md)]',\n },\n {\n orientation: 'vertical',\n compact: true,\n class: 'ds:h-[var(--spacing-sm)]',\n },\n {\n orientation: 'horizontal',\n compact: false,\n class: 'ds:w-[var(--spacing-md)]',\n },\n {\n orientation: 'horizontal',\n compact: true,\n class: 'ds:w-[var(--spacing-sm)]',\n },\n ],\n },\n);\n\n/* ------------------------------------------------------------------ */\n/* Settings summariser — short, token-aware one-liner per action type. */\n/* The i18n key is resolved by the caller; this returns either a */\n/* {key, options} pair for pluralised strings or a plain string literal. */\n/* ------------------------------------------------------------------ */\n\ninterface SummaryKey {\n key: string;\n options?: Record<string, unknown>;\n}\n\nfunction summariseSettings(\n settings: WorkflowActionSettings,\n): SummaryKey | string | undefined {\n switch (settings.kind) {\n case 'add_delay': {\n if (typeof settings.days === 'number' && settings.days > 0) {\n return {\n key: 'workflow.delay.days',\n options: { count: settings.days },\n };\n }\n if (typeof settings.hours === 'number' && settings.hours > 0) {\n return {\n key: 'workflow.delay.hours',\n options: { count: settings.hours },\n };\n }\n if (typeof settings.minutes === 'number' && settings.minutes > 0) {\n return {\n key: 'workflow.delay.minutes',\n options: { count: settings.minutes },\n };\n }\n return undefined;\n }\n case 'send_email':\n return settings.subject || undefined;\n case 'send_sms':\n return settings.body || undefined;\n case 'create_task':\n return settings.title || undefined;\n case 'send_whatsapp':\n return settings.templateName || undefined;\n case 'update_patient_field':\n return settings.fieldLabel || undefined;\n case 'webhook':\n return settings.url || undefined;\n default:\n return undefined;\n }\n}\n\ntype TFn = (key: string, options?: Record<string, unknown>) => string;\n\nfunction resolveSummary(\n summary: SummaryKey | string | undefined,\n t: TFn,\n): string | undefined {\n if (summary === undefined) return undefined;\n if (typeof summary === 'string') return summary;\n return t(summary.key, summary.options);\n}\n\n/* ------------------------------------------------------------------ */\n/* Props */\n/* ------------------------------------------------------------------ */\n\nexport interface WorkflowMapProps extends VariantProps<typeof rootVariants> {\n /** Instance id surfaced as `data-component-id` on the root. */\n id?: string;\n /** Workflow graph (DAG-shaped, linear in v1). */\n graph: WorkflowGraph;\n /** Id of the currently active step. When unset, the map is structural. */\n activeNodeId?: string;\n /** When provided, nodes become focusable buttons. */\n onNodeClick?: (nodeId: string) => void;\n /** Optional leading criteria summary card — NOT part of the graph. */\n enrollmentCriteria?: EnrollmentCriteria;\n /** Orientation. @default 'vertical' */\n orientation?: 'vertical' | 'horizontal';\n /** Compact mode: smaller padding, hides settings summary text. */\n compact?: boolean;\n className?: string;\n /** Override the auto-generated aria-label on the list root. */\n 'aria-label'?: string;\n}\n\n/* ------------------------------------------------------------------ */\n/* Component */\n/* ------------------------------------------------------------------ */\n\ntype NodeState = 'completed' | 'current' | 'pending' | 'neutral';\n\nexport const WorkflowMap = forwardRef<HTMLOListElement, WorkflowMapProps>(\n function WorkflowMap(\n {\n graph,\n activeNodeId,\n onNodeClick,\n enrollmentCriteria,\n orientation = 'vertical',\n compact = false,\n className,\n 'aria-label': ariaLabelOverride,\n ...rest\n },\n ref,\n ) {\n const { t } = useTranslation();\n\n const ordered = useMemo(() => linearOrder(graph), [graph]);\n const activeIndex = useMemo(\n () =>\n activeNodeId ? ordered.findIndex((n) => n.id === activeNodeId) : -1,\n [ordered, activeNodeId],\n );\n\n const ariaLabel =\n ariaLabelOverride ?? t('workflow.map.label', { count: ordered.length });\n\n const nodeState = (index: number): NodeState => {\n if (activeIndex === -1) return 'neutral';\n if (index === activeIndex) return 'current';\n if (index < activeIndex) return 'completed';\n return 'pending';\n };\n\n return (\n // eslint-disable-next-line jsx-a11y/no-redundant-roles -- Safari strips the implicit list role on <ol> with list-style:none; this guard puts it back in the accessibility tree\n <ol\n ref={ref}\n role=\"list\"\n aria-label={ariaLabel}\n data-component=\"workflow-map\"\n data-component-id={rest.id}\n className={rootVariants({ orientation, compact, className })}\n {...rest}\n >\n {enrollmentCriteria ? (\n <EnrollmentCriteriaHeader\n orientation={orientation}\n compact={compact}\n criteria={enrollmentCriteria}\n />\n ) : null}\n {ordered.map((node, index) => {\n const state = nodeState(index);\n const isLast = index === ordered.length - 1;\n return (\n <MapNode\n key={node.id}\n node={node}\n state={state}\n orientation={orientation}\n compact={compact}\n isLast={isLast}\n onNodeClick={onNodeClick}\n />\n );\n })}\n </ol>\n );\n },\n);\n\nWorkflowMap.displayName = 'WorkflowMap';\n\n/* ------------------------------------------------------------------ */\n/* Internal: MapNode */\n/* ------------------------------------------------------------------ */\n\ninterface MapNodeProps {\n node: WorkflowNode;\n state: NodeState;\n orientation: 'vertical' | 'horizontal';\n compact: boolean;\n isLast: boolean;\n onNodeClick?: (nodeId: string) => void;\n}\n\nfunction MapNode({\n node,\n state,\n orientation,\n compact,\n isLast,\n onNodeClick,\n}: MapNodeProps) {\n const { t } = useTranslation();\n const meta = workflowActionRegistry[node.type];\n const Icon = iconByName[meta.iconName];\n const typeLabel = t(meta.labelKey);\n const summary = resolveSummary(summariseSettings(node.settings), t);\n const isInteractive = typeof onNodeClick === 'function';\n\n const isCurrent = state === 'current';\n const isCompleted = state === 'completed';\n\n const handleClick = (event: ReactMouseEvent<HTMLDivElement>) => {\n if (!isInteractive) return;\n event.preventDefault();\n onNodeClick?.(node.id);\n };\n\n const handleKeyDown = (event: ReactKeyboardEvent<HTMLDivElement>) => {\n if (!isInteractive) return;\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n onNodeClick?.(node.id);\n }\n };\n\n // sr-only state label so greyscale / colour-blind users get\n // an announceable state hint alongside the visual cue.\n const stateLabel = isCurrent\n ? t('workflow.map.current')\n : isCompleted\n ? t('workflow.map.completed')\n : state === 'pending'\n ? t('workflow.map.pending')\n : null;\n\n return (\n // `<li>` has implicit role=\"listitem\"; no explicit role needed.\n <li data-node-id={node.id} className={nodeWrapperVariants({ orientation })}>\n <div\n role={isInteractive ? 'button' : undefined}\n tabIndex={isInteractive ? 0 : undefined}\n aria-current={isCurrent ? 'step' : undefined}\n aria-label={\n isInteractive && compact\n ? summary\n ? t('workflow.map.nodeLabelWithSummary', {\n type: typeLabel,\n summary,\n })\n : t('workflow.map.nodeLabel', { type: typeLabel })\n : undefined\n }\n // Expose the full text on truncation (compact mode) so DE / CJK\n // long compound labels remain discoverable via tooltip.\n title={\n compact && summary\n ? t('workflow.map.nodeLabelWithSummary', {\n type: typeLabel,\n summary,\n })\n : undefined\n }\n onClick={isInteractive ? handleClick : undefined}\n onKeyDown={isInteractive ? handleKeyDown : undefined}\n className={nodeCardVariants({\n orientation,\n compact,\n state,\n interactive: isInteractive,\n })}\n data-node-id={node.id}\n data-state={state}\n >\n <span\n aria-hidden=\"true\"\n className=\"ds:flex ds:items-center ds:justify-center ds:shrink-0 ds:size-[var(--spacing-md)] ds:text-[var(--muted-foreground)]\"\n >\n {isCompleted ? (\n <Check\n className=\"ds:size-[var(--spacing-md)] ds:text-[color:var(--success)]\"\n data-testid=\"workflow-map-check\"\n />\n ) : (\n <Icon className=\"ds:size-[var(--spacing-md)]\" />\n )}\n </span>\n <span className=\"ds:flex ds:flex-col ds:min-w-0 ds:flex-1\">\n <span className={compact ? 'type-meta ds:truncate' : 'type-body-sm'}>\n {typeLabel}\n </span>\n {!compact && summary ? (\n <span\n className=\"type-meta ds:text-[var(--muted-foreground)]\"\n data-testid=\"workflow-map-summary\"\n >\n {summary}\n </span>\n ) : null}\n </span>\n {stateLabel ? <span className=\"ds:sr-only\">{stateLabel}</span> : null}\n </div>\n {!isLast ? (\n <span\n aria-hidden=\"true\"\n className={spacerVariants({ orientation, compact })}\n data-testid=\"workflow-map-connector\"\n />\n ) : null}\n </li>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Internal: Enrollment criteria header */\n/* ------------------------------------------------------------------ */\n\ninterface EnrollmentCriteriaHeaderProps {\n orientation: 'vertical' | 'horizontal';\n compact: boolean;\n criteria: EnrollmentCriteria;\n}\n\nfunction EnrollmentCriteriaHeader({\n orientation,\n compact,\n criteria,\n}: EnrollmentCriteriaHeaderProps) {\n const { t } = useTranslation();\n\n // Not part of the graph; rendered as a leading listitem. The root's\n // aria-label advertises the graph step count (not list-item count) so\n // the SR announcement stays accurate for the pipeline proper.\n return (\n <li className={nodeWrapperVariants({ orientation })}>\n <div\n className={nodeCardVariants({\n orientation,\n compact,\n state: 'neutral',\n interactive: false,\n })}\n data-testid=\"workflow-map-criteria\"\n >\n <span\n aria-hidden=\"true\"\n className=\"ds:flex ds:items-center ds:justify-center ds:shrink-0 ds:size-[var(--spacing-md)] ds:text-[var(--muted-foreground)]\"\n >\n <ClipboardCheck className=\"ds:size-[var(--spacing-md)]\" />\n </span>\n <span className=\"ds:flex ds:flex-col ds:min-w-0 ds:flex-1\">\n <span className={compact ? 'type-meta ds:truncate' : 'type-body-sm'}>\n {t('workflow.editor.enrollmentCriteria')}\n </span>\n {!compact ? (\n <span className=\"type-meta ds:text-[var(--muted-foreground)]\">\n {criteria.summary ??\n t('workflow.editor.criteriaCount', {\n count: criteria.ruleCount,\n })}\n </span>\n ) : null}\n </span>\n </div>\n <span\n aria-hidden=\"true\"\n className={spacerVariants({ orientation, compact })}\n />\n </li>\n );\n}\n"],"names":["__iconNode","CircleDashed","createLucideIcon","CirclePause","PowerOff","Power","Smartphone","workflowCardVariants","cva","getStatusMeta","status","jsx","Circle","WorkflowCard","forwardRef","workflow","density","onView","onEdit","onDelete","onToggleActive","className","ref","t","useTranslation","statusMeta","isActive","isCompact","stop","handler","event","statusBadge","Badge","activeCountLabel","jsxs","Card","KeyValuePair","Timestamp","IconButton","Pencil","Trash2","workflowCardAgent","workflowMapAgent","workflowEditorAgent","handle","args","linearOrder","graph","linearEdges","e","targets","start","n","byId","edgesFrom","edge","bucket","seen","order","cursor","outgoing","node","addNodeAfter","afterNodeId","nodes","oldHead","otherEdges","removeNode","nodeId","incoming","kept","bridged","moveNode","direction","index","swapIndex","b","afterRemove","first","second","firstPredecessor","_a","step1","CORE_PATIENT_FIELDS","isCorePatientField","fieldId","workflowActionRegistry","ACTION_ICONS","Clock","Mail","SquareCheckBig","MessageCircle","UserCog","Globe","ActionIcon","iconName","Glyph","TRUNCATE_EMAIL","TRUNCATE_SMS","truncate","value","max","summariseSettings","settings","days","summary","subject","full","body","title","rootClasses","connectorClasses","addButtonClasses","nodeCardFocusableClasses","ALL_ACTION_TYPES","nodeIdCounter","generateNodeId","random","defaultSettingsFor","type","useMutableIndex","initial","useRef","setter","useCallback","v","ActionNodeCard","position","total","disabled","onMove","registerRef","meta","controlsRef","activeControl","setActiveControl","focusControl","controls","clamped","_b","handleCardKeyDown","handleControlsKeyDown","typeLabel","canMoveUp","canMoveDown","positionText","nodeAriaLabel","el","ChevronUp","ChevronDown","Alert","AddActionMenu","availableActions","onSelect","label","compact","DropdownMenu","Plus","CriteriaHeader","criteria","count","summaryText","WorkflowEditor","onChange","enrollmentCriteria","onEditEnrollmentCriteria","onEditNode","onDeleteNode","types","ordered","useMemo","nodeRefs","focusTargetRef","safeOnChange","next","id","currentStep","setCurrentStep","useState","currentStepRef","rootRef","useImperativeHandle","agentHandle","useAgentRegistration","useEffect","handleAddAfter","afterId","handleMove","handleEdit","handleDelete","renderBanner","renderCriteria","Fragment","EmptyState","Button","iconByName","rootVariants","nodeWrapperVariants","nodeCardVariants","spacerVariants","resolveSummary","WorkflowMap","activeNodeId","onNodeClick","orientation","ariaLabelOverride","rest","activeIndex","ariaLabel","nodeState","EnrollmentCriteriaHeader","state","isLast","MapNode","Icon","isInteractive","isCurrent","isCompleted","handleClick","handleKeyDown","stateLabel","Check","ClipboardCheck"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,iCAAiC,KAAK,SAAQ,CAAE;AAAA,EAC9D,CAAC,QAAQ,EAAE,GAAG,kCAAkC,KAAK,SAAQ,CAAE;AAAA,EAC/D,CAAC,QAAQ,EAAE,GAAG,sCAAsC,KAAK,SAAQ,CAAE;AAAA,EACnE,CAAC,QAAQ,EAAE,GAAG,iCAAiC,KAAK,SAAQ,CAAE;AAAA,EAC9D,CAAC,QAAQ,EAAE,GAAG,uCAAuC,KAAK,SAAQ,CAAE;AAAA,EACpE,CAAC,QAAQ,EAAE,GAAG,kCAAkC,KAAK,SAAQ,CAAE;AAAA,EAC/D,CAAC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