@alfadocs/ui-kit 1.114.0 → 1.116.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (416) hide show
  1. package/dist/_chunks/accessible-target-Bs9ELM3l.js +6 -0
  2. package/dist/_chunks/{actions-cell-renderer-BVn3vDTg.js → actions-cell-renderer-DzHxDyI7.js} +3 -3
  3. package/dist/_chunks/{address-fields-D5Ije0S2.js → address-fields-BFVCtfP2.js} +3 -3
  4. package/dist/_chunks/{ai-permission-notice-BkgcGmu8.js → ai-permission-notice-C-xR2_iS.js} +2 -2
  5. package/dist/_chunks/{alia-sidebar-CKkg3gc8.js → alia-sidebar-BBxbMRmX.js} +2 -2
  6. package/dist/_chunks/{anamnesis-summary-rows-DaS-j8Jd.js → anamnesis-summary-rows-gEXqU5i5.js} +8 -8
  7. package/dist/_chunks/{antenatal-schedule-timeline-DmlXxevC.js → antenatal-schedule-timeline-va9zx7tJ.js} +11 -11
  8. package/dist/_chunks/{appointment-card-FKOnH1uJ.js → appointment-card-BMZoXaGx.js} +4 -4
  9. package/dist/_chunks/{appointment-peek-DWfcpoGy.js → appointment-peek-B1CCv-7J.js} +2 -2
  10. package/dist/_chunks/{appointment-timeline-eOi-y8m3.js → appointment-timeline-0k4LxODn.js} +4 -4
  11. package/dist/_chunks/{appointment-tray-C6oBvsG5.js → appointment-tray-DIxpgIXM.js} +2 -2
  12. package/dist/_chunks/{ar-C4YQVTH6.js → ar-BFvUBJ_g.js} +10 -10
  13. package/dist/_chunks/arrow-down-left-DECv-dJt.js +15 -0
  14. package/dist/_chunks/{balance-badge-cell-BAZynD--.js → balance-badge-cell-L7bD0Nsh.js} +28 -27
  15. package/dist/_chunks/bill-line-table-WEIRDcv6.js +1563 -0
  16. package/dist/_chunks/{bmi-calculator-Ba4yoR31.js → bmi-calculator-BjUfXqcY.js} +2 -2
  17. package/dist/_chunks/buildMatchPatternFn-jbaE1-W0.js +68 -0
  18. package/dist/_chunks/{button-group-CUnNnt8a.js → button-group-BvU9vRnX.js} +2 -2
  19. package/dist/_chunks/{calculator-dialog-D4TyJwqy.js → calculator-dialog-BGX5XQCM.js} +2 -2
  20. package/dist/_chunks/{calendar-appointment-editor-dialog-iyh9QqNw.js → calendar-appointment-editor-dialog-DqZMb4yd.js} +527 -539
  21. package/dist/_chunks/{care-plan-card-DMjlYlFc.js → care-plan-card-CfV8jiF0.js} +3 -3
  22. package/dist/_chunks/{care-plan-entry-card-3hguBW45.js → care-plan-entry-card-Bt01kyTl.js} +4 -4
  23. package/dist/_chunks/{chart-bddVIElM.js → chart-BSx8cfMm.js} +2 -2
  24. package/dist/_chunks/{chat-container-baxzy8k8.js → chat-container-B83b4hut.js} +2 -2
  25. package/dist/_chunks/checkbox-DV4sNDeB.js +282 -0
  26. package/dist/_chunks/{checkbox-group-eGdv9fZc.js → checkbox-group-EfinQS1h.js} +2 -2
  27. package/dist/_chunks/chevrons-up-down-CgiVAHb7.js +15 -0
  28. package/dist/_chunks/circle-off-DuT9pVy2.js +16 -0
  29. package/dist/_chunks/combobox-BBCVQS-S.js +935 -0
  30. package/dist/_chunks/compact-editor-fields-6sTWRLtf.js +21 -0
  31. package/dist/_chunks/{contact-profile-card-DMXWBBkU.js → contact-profile-card-BRCHbQ3-.js} +2 -2
  32. package/dist/_chunks/{country-select-CUuGOAoZ.js → country-select-C2GdvRtS.js} +2 -2
  33. package/dist/_chunks/{cycle-calculator-Dd-XbKmZ.js → cycle-calculator-Brd0PP4U.js} +6 -6
  34. package/dist/_chunks/{dashboard-grid-DrOkTtya.js → dashboard-grid-3aidD-IQ.js} +2 -2
  35. package/dist/_chunks/data-grid-ByhrYGVw.js +9814 -0
  36. package/dist/_chunks/data-grid-tabs-D9Y4DeeH.js +365 -0
  37. package/dist/_chunks/data-table-B47iw2CO.js +1694 -0
  38. package/dist/_chunks/data-table-tabs-NYLhD8_Z.js +242 -0
  39. package/dist/_chunks/date-locale-OG-MupVD.js +83 -0
  40. package/dist/_chunks/{date-picker-CdhXlgVI.js → date-picker-DBVTj6lO.js} +21 -20
  41. package/dist/_chunks/{date-picker-variants-Dt6UbonG.js → date-picker-variants-J1EeAhIH.js} +601 -678
  42. package/dist/_chunks/date-range-panel-B-DUtfw3.js +62 -0
  43. package/dist/_chunks/{date-range-picker-DCADIR8o.js → date-range-picker-PTRpDkXT.js} +72 -70
  44. package/dist/_chunks/{date-time-picker-CT2bC7-A.js → date-time-picker-CJnqiQoT.js} +22 -21
  45. package/dist/_chunks/{de-B1B3PIgY.js → de-i9wbjGPc.js} +2 -2
  46. package/dist/_chunks/default-tabs-BQcSqcNG.js +2250 -0
  47. package/dist/_chunks/dialog-CIUn5oLb.js +348 -0
  48. package/dist/_chunks/{document-preview-WvJKHJOP.js → document-preview-B_JGHsEW.js} +2 -2
  49. package/dist/_chunks/{dropdown-menu-CqxBthww.js → dropdown-menu-Dmbak7q6.js} +320 -248
  50. package/dist/_chunks/{due-date-calculator-Dl6SyMHO.js → due-date-calculator-DzIQXEX5.js} +7 -7
  51. package/dist/_chunks/{editable-currency-cell-renderer-BUdFMh67.js → editable-currency-cell-renderer-p-Q1UkZS.js} +3 -3
  52. package/dist/_chunks/{el-iLqGpapg.js → el-Cm-rWthb.js} +20 -20
  53. package/dist/_chunks/{en-GB-CxPRQbD6.js → en-GB-BHn82gW8.js} +11 -10
  54. package/dist/_chunks/en-US-C4QKhzhA.js +46 -0
  55. package/dist/_chunks/{es-Bg1oqwDs.js → es-B_6Z19UA.js} +4 -4
  56. package/dist/_chunks/export-files-BByoK9Cg.js +248 -0
  57. package/dist/_chunks/{face-scheme-DlcQaQVR.js → face-scheme-CEjJUnNe.js} +19 -18
  58. package/dist/_chunks/{fetal-weight-DmZzMRzB.js → fetal-weight-CJTlfh_k.js} +2 -2
  59. package/dist/_chunks/{file-manager-LG7B_UHB.js → file-manager-DEe51ZDe.js} +5 -5
  60. package/dist/_chunks/format-price-CIX0YJZn.js +179 -0
  61. package/dist/_chunks/format-ql5WTsYT.js +846 -0
  62. package/dist/_chunks/{fr-DpGxyOGI.js → fr-gTba51QO.js} +7 -7
  63. package/dist/_chunks/funnel-DpPV3Qkd.js +20 -0
  64. package/dist/_chunks/{gestational-age-calculator-DmzYdW5e.js → gestational-age-calculator-60y1RyQL.js} +7 -7
  65. package/dist/_chunks/grid-context-jn9y8tNE.js +46 -0
  66. package/dist/_chunks/{hcg-doubling-Tr72PetS.js → hcg-doubling-BUZQkSYC.js} +7 -6
  67. package/dist/_chunks/{header-settings-Df9q1uHt.js → header-settings-DNgvO8fS.js} +2 -2
  68. package/dist/_chunks/{heatmap-CNxCDl0D.js → heatmap-tn1WxoMT.js} +4 -4
  69. package/dist/_chunks/{help-me-write-templates-CWxgjDZl.js → help-me-write-templates-C28E_rOt.js} +2 -2
  70. package/dist/_chunks/{hi-3Dtsksrw.js → hi-BIHq9ncx.js} +10 -10
  71. package/dist/_chunks/highlighter-DSkckT2Q.js +15 -0
  72. package/dist/_chunks/icon-button-group-Ca2VkXy5.js +442 -0
  73. package/dist/_chunks/{index-CJE9uQmb.js → index-Bze5jCG_.js} +2 -1
  74. package/dist/_chunks/{isSameWeek-DyVftHWi.js → isSameWeek-CZOtDcsd.js} +2 -2
  75. package/dist/_chunks/{it-Cp0CA13d.js → it-DaCPWJ9Y.js} +11 -11
  76. package/dist/_chunks/{ja-9FOyR1lb.js → ja-BRCpkD95.js} +26 -26
  77. package/dist/_chunks/{kit-extensions-DZJRmDI6.js → kit-extensions-BFfLg7c-.js} +7 -7
  78. package/dist/_chunks/link-cell-renderer-D-Io828l.js +800 -0
  79. package/dist/_chunks/{login-dev-card-D7orCfJT.js → login-dev-card-CPndtWdz.js} +2 -2
  80. package/dist/_chunks/{marketplace-app-shell-CPNVBVLH.js → marketplace-app-shell-CBHNg8x-.js} +5 -5
  81. package/dist/_chunks/match-BATShpSX.js +336 -0
  82. package/dist/_chunks/money-OE6_oDPH.js +138 -0
  83. package/dist/_chunks/{muscle-scheme-BkmDUTmk.js → muscle-scheme-7UsRsCHP.js} +2 -2
  84. package/dist/_chunks/{nl-sfx-zJgR.js → nl-5tAwYo00.js} +6 -6
  85. package/dist/_chunks/normalizeDates-BBNNIR-v.js +36 -0
  86. package/dist/_chunks/{notes-panel-DXMTObBv.js → notes-panel-DexbfrFo.js} +3 -3
  87. package/dist/_chunks/number-input-DUSvP7Dq.js +625 -0
  88. package/dist/_chunks/{optical-prescription-CvbN8yD2.js → optical-prescription-Da_r8pMr.js} +2 -2
  89. package/dist/_chunks/{parse-B0s7bY4d.js → parse-BLBWPIgE.js} +63 -61
  90. package/dist/_chunks/{parseISO-DZZ5a-zK.js → parseISO-Dl4T9peU.js} +2 -2
  91. package/dist/_chunks/parts-CtcTW1PN.js +869 -0
  92. package/dist/_chunks/{patient-details-DdtXBNjt.js → patient-details-PJ0Y__7t.js} +2 -2
  93. package/dist/_chunks/{patient-field-row-D9rb-QJH.js → patient-field-row-0QP8KCVp.js} +7 -7
  94. package/dist/_chunks/{patient-search-DDRDCjZi.js → patient-search-Bdx_Ob3y.js} +2 -2
  95. package/dist/_chunks/{patient-summary-card-CGHz-Bvm.js → patient-summary-card-BOfXDP8a.js} +4 -4
  96. package/dist/_chunks/{payment-request-card-BmV2pLoM.js → payment-request-card-_04afZEx.js} +14 -13
  97. package/dist/_chunks/{periodontal-diagnosis-xheWfi4g.js → periodontal-diagnosis-DnZuZD14.js} +2 -2
  98. package/dist/_chunks/{permission-matrix-BJ6sg3Zp.js → permission-matrix-BXmhICzN.js} +3 -3
  99. package/dist/_chunks/{pl-BLh7KO-s.js → pl-mLYbfByR.js} +7 -7
  100. package/dist/_chunks/{practice-results-BlxfBx-D.js → practice-results-CrBjScXX.js} +3 -3
  101. package/dist/_chunks/{pregnancy-dating-BvorzHrd.js → pregnancy-dating-Bg_VUPwl.js} +8 -8
  102. package/dist/_chunks/{pregnancy-weight-gain-DQoOM8QV.js → pregnancy-weight-gain-B-eXFdmq.js} +2 -2
  103. package/dist/_chunks/privacy-mask-BlJK51MD.js +78 -0
  104. package/dist/_chunks/privacy-mask-text-B8YfzB7L.js +7 -0
  105. package/dist/_chunks/{province-select-cVOlwEc5.js → province-select-CTM8A9SM.js} +2 -2
  106. package/dist/_chunks/{pt-CPKOrOLj.js → pt-CgaqtlD9.js} +6 -6
  107. package/dist/_chunks/{radiograph-panel.agent-CXah49KM.js → radiograph-panel.agent-9jwXlOXB.js} +4 -4
  108. package/dist/_chunks/{registration-form-Lw9T7IXr.js → registration-form-DW-0X7S4.js} +2 -2
  109. package/dist/_chunks/{reserved.agent-D2jwJPac.js → reserved.agent-C1zRHaya.js} +12 -12
  110. package/dist/_chunks/{rich-text-editor-BLS2cK-u.js → rich-text-editor-r80Zw8ll.js} +14 -13
  111. package/dist/_chunks/{ro-Dc-oNqbF.js → ro-CpDg1-8v.js} +2 -2
  112. package/dist/_chunks/row-actions-Df7TJbNR.js +213 -0
  113. package/dist/_chunks/{ru-BtNpDZRR.js → ru-B7VMyjud.js} +9 -9
  114. package/dist/_chunks/saved-view-tabs-DLWm88Eq.js +932 -0
  115. package/dist/_chunks/{send-registration-link-form-DfbTjrEK.js → send-registration-link-form-DWxWa_cJ.js} +5 -5
  116. package/dist/_chunks/{sidebar-2VsPlNkZ.js → sidebar-D5DFYN5K.js} +326 -335
  117. package/dist/_chunks/{signature-request-BnTihryS.js → signature-request-CgvjLic3.js} +3 -3
  118. package/dist/_chunks/{slot-grid-BhjaLJ0o.js → slot-grid-b4eZXokb.js} +3 -3
  119. package/dist/_chunks/{sq-D4c7olaV.js → sq-B0Ree_9P.js} +2 -2
  120. package/dist/_chunks/subDays-Bsoy023P.js +8 -0
  121. package/dist/_chunks/{sv-Bf_dHPvh.js → sv-D9fP66O7.js} +4 -4
  122. package/dist/_chunks/{tab-bar-C_pggqVr.js → tab-bar-DTn8pHqH.js} +2 -2
  123. package/dist/_chunks/{tabs-CXYjr_8O.js → tabs-CsmgkiG6.js} +2 -2
  124. package/dist/_chunks/{tag-DOZGz0fT.js → tag-BNlcEJfE.js} +70 -67
  125. package/dist/_chunks/{task-card-DqVoitRk.js → task-card-BNbkwIYM.js} +2 -2
  126. package/dist/_chunks/{task-editor-D--LwVrg.js → task-editor-DgUjtqpX.js} +386 -410
  127. package/dist/_chunks/{task-tray-C6j8HVMv.js → task-tray-Bmi9wCHq.js} +2 -2
  128. package/dist/_chunks/{tasks-panel-D6PuF4MQ.js → tasks-panel-B5Nsf10r.js} +3 -3
  129. package/dist/_chunks/{theme-toggle-Czq3K9jB.js → theme-toggle-DfvdEg_V.js} +3 -3
  130. package/dist/_chunks/{token-insert-menu-Dl3x2ekR.js → token-insert-menu-BdcmK5Um.js} +2 -2
  131. package/dist/_chunks/toolbar-DbUQBrq4.js +159 -0
  132. package/dist/_chunks/{tooth-scheme-C-ALCHaV.js → tooth-scheme-LTkT4EXd.js} +2 -2
  133. package/dist/_chunks/{tr-xqQ6cbGY.js → tr-Bcz5LCHZ.js} +2 -2
  134. package/dist/_chunks/{transaction-chip-CohY6sTA.js → transaction-chip-CkYd-3ky.js} +47 -57
  135. package/dist/_chunks/{transcript-panel-A781Pkzr.js → transcript-panel-Wr8e4Zgi.js} +2 -2
  136. package/dist/_chunks/{treatment-receipt-pFqWFyD_.js → treatment-receipt-1VnuinhY.js} +3 -3
  137. package/dist/_chunks/undo-2-EBxWjj1W.js +15 -0
  138. package/dist/_chunks/{unit-converter-D77vmlzN.js → unit-converter-YKlHyUC2.js} +2 -2
  139. package/dist/_chunks/{use-appointment-details-read-BK_Gw1GG.js → use-appointment-details-read-_r7cjTtm.js} +8 -8
  140. package/dist/_chunks/{verify-identity-types-C85EXNzy.js → verify-identity-types-D_LdByCp.js} +2 -2
  141. package/dist/_chunks/{voice-control-panel-BGiX4sqB.js → voice-control-panel-Be_c0CQ0.js} +2 -2
  142. package/dist/_chunks/{widget-picker-U4JsEhQE.js → widget-picker-DrxJjEkv.js} +2 -2
  143. package/dist/_chunks/{workflow-map-B4XkcET0.js → workflow-map-D-u8_YSr.js} +2 -2
  144. package/dist/_chunks/{workflow-status-9wb7iWUd.js → workflow-status-fykpTxfb.js} +2 -2
  145. package/dist/_chunks/{workflow-webhook-action-CtBn5JvO.js → workflow-webhook-action-DM3W8XZE.js} +3 -3
  146. package/dist/_chunks/{zh-CN-C657DBCO.js → zh-CN-B7Ek17US.js} +11 -11
  147. package/dist/agent-catalog.json +3359 -1569
  148. package/dist/agent-i18n/en.json +100 -2
  149. package/dist/components/_shared/accessible-target.d.ts +12 -0
  150. package/dist/components/_shared/decimal.d.ts +171 -0
  151. package/dist/components/_shared/format-price.d.ts +54 -2
  152. package/dist/components/_shared/privacy-mask-text.d.ts +4 -0
  153. package/dist/components/_shared/privacy-mask.d.ts +2 -4
  154. package/dist/components/_shared/saved-view-tabs/saved-tab.d.ts +54 -0
  155. package/dist/components/_shared/saved-view-tabs/saved-view-tabs.d.ts +93 -0
  156. package/dist/components/_shared/saved-view-tabs/use-saved-view-tabs.d.ts +59 -0
  157. package/dist/components/_shared/saved-view-tabs/view-adapter.d.ts +69 -0
  158. package/dist/components/_shared/table-filters/calendar-day.d.ts +27 -0
  159. package/dist/components/_shared/table-filters/predicates.d.ts +56 -0
  160. package/dist/components/_shared/table-toolbar/context.d.ts +28 -0
  161. package/dist/components/_shared/table-toolbar/describe-filter.d.ts +42 -0
  162. package/dist/components/_shared/table-toolbar/export-files.d.ts +47 -0
  163. package/dist/components/{data-table/xlsx-export.d.ts → _shared/table-toolbar/export-xlsx.d.ts} +2 -2
  164. package/dist/components/_shared/table-toolbar/parts.d.ts +125 -0
  165. package/dist/components/_shared/table-toolbar/seam.d.ts +261 -0
  166. package/dist/components/address-fields/index.js +1 -1
  167. package/dist/components/ai-permission-notice/index.js +1 -1
  168. package/dist/components/appointment-card/index.js +2 -2
  169. package/dist/components/appointment-details-panel/index.js +1 -1
  170. package/dist/components/appointment-peek/index.js +1 -1
  171. package/dist/components/appointment-timeline/index.js +1 -1
  172. package/dist/components/bill-line-table/bill-line-table.agent.d.ts +4 -0
  173. package/dist/components/bill-line-table/bill-line-table.columns.d.ts +47 -0
  174. package/dist/components/bill-line-table/bill-line-table.d.ts +4 -0
  175. package/dist/components/bill-line-table/bill-line-table.model.d.ts +173 -0
  176. package/dist/components/bill-line-table/bill-line-table.types.d.ts +443 -0
  177. package/dist/components/bill-line-table/bill-line-table.variants.d.ts +34 -0
  178. package/dist/components/bill-line-table/index.d.ts +6 -0
  179. package/dist/components/bill-line-table/index.js +23 -0
  180. package/dist/components/bill-table/bill-table.agent.d.ts +4 -0
  181. package/dist/components/bill-table/bill-table.d.ts +13 -0
  182. package/dist/components/bill-table/bill-table.variants.d.ts +55 -0
  183. package/dist/components/bill-table/cells.d.ts +89 -0
  184. package/dist/components/bill-table/columns.d.ts +21 -0
  185. package/dist/components/bill-table/default-tabs.d.ts +21 -0
  186. package/dist/components/bill-table/handle.d.ts +19 -0
  187. package/dist/components/bill-table/index.d.ts +7 -0
  188. package/dist/components/bill-table/index.js +19 -0
  189. package/dist/components/bill-table/model.d.ts +103 -0
  190. package/dist/components/bill-table/row-actions.d.ts +27 -0
  191. package/dist/components/bill-table/status-maps.d.ts +225 -0
  192. package/dist/components/bill-table/types.d.ts +542 -0
  193. package/dist/components/bmi-calculator/index.js +1 -1
  194. package/dist/components/booking/index.js +1 -1
  195. package/dist/components/button-group/index.js +1 -1
  196. package/dist/components/calculator-dialog/index.js +1 -1
  197. package/dist/components/care-plan-card/index.js +1 -1
  198. package/dist/components/care-plan-entry-card/index.js +1 -1
  199. package/dist/components/chart/index.js +1 -1
  200. package/dist/components/chat-container/index.js +1 -1
  201. package/dist/components/checkbox/checkbox.d.ts +66 -6
  202. package/dist/components/checkbox/index.js +1 -1
  203. package/dist/components/checkbox-group/index.js +1 -1
  204. package/dist/components/combobox/combobox.d.ts +59 -1
  205. package/dist/components/combobox/index.d.ts +1 -1
  206. package/dist/components/combobox/index.js +1 -1
  207. package/dist/components/contact-profile-card/index.js +1 -1
  208. package/dist/components/country-select/index.js +1 -1
  209. package/dist/components/cycle-calculator/index.js +1 -1
  210. package/dist/components/dashboard-grid/index.js +1 -1
  211. package/dist/components/data-grid/announcer.d.ts +27 -0
  212. package/dist/components/data-grid/body.d.ts +101 -0
  213. package/dist/components/data-grid/columns.d.ts +96 -0
  214. package/dist/components/data-grid/data-grid.agent.d.ts +2 -1
  215. package/dist/components/data-grid/data-grid.d.ts +11 -27
  216. package/dist/components/data-grid/data-grid.variants.d.ts +110 -0
  217. package/dist/components/data-grid/editors.d.ts +14 -0
  218. package/dist/components/data-grid/export-snapshot.d.ts +3 -0
  219. package/dist/components/data-grid/features.d.ts +56 -0
  220. package/dist/components/data-grid/filter-fns.d.ts +23 -0
  221. package/dist/components/data-grid/filters/date-range-panel.d.ts +8 -0
  222. package/dist/components/data-grid/filters/filter-panels.d.ts +27 -0
  223. package/dist/components/data-grid/filters/filter-trigger.d.ts +7 -0
  224. package/dist/components/data-grid/footer.d.ts +10 -0
  225. package/dist/components/data-grid/grid-context.d.ts +18 -0
  226. package/dist/components/data-grid/handle.d.ts +60 -0
  227. package/dist/components/data-grid/header.d.ts +12 -0
  228. package/dist/components/data-grid/index.d.ts +3 -0
  229. package/dist/components/data-grid/index.js +11 -3
  230. package/dist/components/data-grid/keyboard.d.ts +76 -0
  231. package/dist/components/data-grid/pager.d.ts +18 -0
  232. package/dist/components/data-grid/persistence.d.ts +60 -0
  233. package/dist/components/data-grid/print.d.ts +10 -0
  234. package/dist/components/data-grid/responsive.d.ts +36 -0
  235. package/dist/components/data-grid/selection.d.ts +68 -0
  236. package/dist/components/data-grid/state.d.ts +119 -0
  237. package/dist/components/data-grid/states.d.ts +34 -0
  238. package/dist/components/data-grid/toolbar-seam.d.ts +7 -0
  239. package/dist/components/data-grid/toolbar.d.ts +41 -0
  240. package/dist/components/data-grid/types.d.ts +1396 -0
  241. package/dist/components/data-grid/use-data-grid-engine.d.ts +9 -0
  242. package/dist/components/data-grid/virtual-rows.d.ts +43 -0
  243. package/dist/components/data-grid-tabs/data-grid-tabs.agent.d.ts +9 -0
  244. package/dist/components/data-grid-tabs/data-grid-tabs.d.ts +4 -0
  245. package/dist/components/data-grid-tabs/grid-view-adapter.d.ts +15 -0
  246. package/dist/components/data-grid-tabs/index.d.ts +5 -0
  247. package/dist/components/data-grid-tabs/index.js +8 -0
  248. package/dist/components/data-grid-tabs/types.d.ts +220 -0
  249. package/dist/components/data-table/ag-toolbar-seam.d.ts +35 -0
  250. package/dist/components/data-table/calendar-day.d.ts +4 -21
  251. package/dist/components/data-table/data-table.d.ts +10 -6
  252. package/dist/components/data-table/filters/date-range-filter.d.ts +5 -9
  253. package/dist/components/data-table/filters/filter-kind.d.ts +6 -0
  254. package/dist/components/data-table/filters/number-filter.d.ts +6 -10
  255. package/dist/components/data-table/filters/select-filter.d.ts +2 -4
  256. package/dist/components/data-table/filters/text-filter.d.ts +2 -5
  257. package/dist/components/data-table/index.js +4 -4
  258. package/dist/components/data-table/toolbar.d.ts +25 -21
  259. package/dist/components/data-table-tabs/ag-view-adapter.d.ts +17 -0
  260. package/dist/components/data-table-tabs/data-table-tabs.d.ts +34 -33
  261. package/dist/components/data-table-tabs/index.js +1 -1
  262. package/dist/components/data-table-tabs/use-data-table-filter-tabs.d.ts +11 -66
  263. package/dist/components/date-picker/index.js +1 -1
  264. package/dist/components/date-range-picker/index.js +1 -1
  265. package/dist/components/date-time-picker/index.js +1 -1
  266. package/dist/components/dialog/focus-return.d.ts +12 -0
  267. package/dist/components/dialog/index.js +1 -1
  268. package/dist/components/document-preview/index.js +1 -1
  269. package/dist/components/dropdown-menu/dropdown-menu.d.ts +11 -0
  270. package/dist/components/dropdown-menu/index.js +1 -1
  271. package/dist/components/due-date-calculator/index.js +2 -2
  272. package/dist/components/face-scheme/index.js +1 -1
  273. package/dist/components/fetal-weight/index.js +1 -1
  274. package/dist/components/file-manager/index.js +1 -1
  275. package/dist/components/gestational-age-calculator/index.js +1 -1
  276. package/dist/components/hcg-doubling/index.js +1 -1
  277. package/dist/components/header-settings/index.js +1 -1
  278. package/dist/components/heatmap/index.js +1 -1
  279. package/dist/components/icon-button-group/icon-button-group.d.ts +19 -1
  280. package/dist/components/icon-button-group/index.d.ts +1 -1
  281. package/dist/components/icon-button-group/index.js +1 -1
  282. package/dist/components/index.d.ts +7 -0
  283. package/dist/components/money/index.js +1 -1
  284. package/dist/components/money/money.d.ts +39 -6
  285. package/dist/components/muscle-scheme/index.js +1 -1
  286. package/dist/components/notes-panel/index.js +1 -1
  287. package/dist/components/number-input/index.d.ts +2 -2
  288. package/dist/components/number-input/index.js +1 -1
  289. package/dist/components/number-input/number-input.d.ts +43 -2
  290. package/dist/components/number-input/use-locale-number.d.ts +67 -3
  291. package/dist/components/optical-prescription/index.js +1 -1
  292. package/dist/components/patient-details/index.js +1 -1
  293. package/dist/components/patient-search/index.js +1 -1
  294. package/dist/components/patient-summary-card/index.js +1 -1
  295. package/dist/components/patient-table/index.js +1 -1
  296. package/dist/components/payment-card/index.js +1 -1
  297. package/dist/components/periodontal-diagnosis/index.js +1 -1
  298. package/dist/components/permission-matrix/index.js +1 -1
  299. package/dist/components/practice-results/index.js +1 -1
  300. package/dist/components/pregnancy-dating/index.js +1 -1
  301. package/dist/components/pregnancy-weight-gain/index.js +1 -1
  302. package/dist/components/province-select/index.js +1 -1
  303. package/dist/components/radiograph-panel/index.js +1 -1
  304. package/dist/components/rich-text-editor/index.js +2 -2
  305. package/dist/components/row-actions/index.d.ts +3 -0
  306. package/dist/components/row-actions/index.js +5 -0
  307. package/dist/components/row-actions/row-actions.d.ts +63 -0
  308. package/dist/components/sidebar/index.js +1 -1
  309. package/dist/components/skeleton-scheme/index.js +1 -1
  310. package/dist/components/slot-grid/index.js +1 -1
  311. package/dist/components/smart-date/smart-date.d.ts +1 -1
  312. package/dist/components/tab-bar/index.js +1 -1
  313. package/dist/components/tabs/index.js +1 -1
  314. package/dist/components/tag/index.js +1 -1
  315. package/dist/components/task-card/index.js +1 -1
  316. package/dist/components/task-editor/index.js +1 -1
  317. package/dist/components/task-tray/index.js +1 -1
  318. package/dist/components/tasks-panel/index.js +1 -1
  319. package/dist/components/theme-toggle/index.js +1 -1
  320. package/dist/components/token-insert-menu/index.js +1 -1
  321. package/dist/components/tooth-scheme/index.js +1 -1
  322. package/dist/components/transaction-chip/index.js +1 -1
  323. package/dist/components/transaction-chip/transaction-chip.d.ts +1 -1
  324. package/dist/components/transcript-panel/index.js +1 -1
  325. package/dist/components/treatment-receipt/index.js +1 -1
  326. package/dist/components/unit-converter/index.js +1 -1
  327. package/dist/components/voice-control-panel/index.js +1 -1
  328. package/dist/components/widget-picker/index.js +1 -1
  329. package/dist/components/workflow/index.js +1 -1
  330. package/dist/components/workflow-status/index.js +1 -1
  331. package/dist/core.css +1 -1
  332. package/dist/decimal/index.js +149 -0
  333. package/dist/host-compat.css +36 -2
  334. package/dist/i18n/locales/ar.d.ts +342 -0
  335. package/dist/i18n/locales/ar.js +344 -2
  336. package/dist/i18n/locales/de.d.ts +342 -0
  337. package/dist/i18n/locales/de.js +344 -2
  338. package/dist/i18n/locales/el.d.ts +342 -0
  339. package/dist/i18n/locales/el.js +344 -2
  340. package/dist/i18n/locales/en.d.ts +342 -0
  341. package/dist/i18n/locales/en.js +345 -2
  342. package/dist/i18n/locales/es.d.ts +342 -0
  343. package/dist/i18n/locales/es.js +344 -2
  344. package/dist/i18n/locales/fr.d.ts +342 -0
  345. package/dist/i18n/locales/fr.js +344 -2
  346. package/dist/i18n/locales/hi.d.ts +342 -0
  347. package/dist/i18n/locales/hi.js +344 -2
  348. package/dist/i18n/locales/it.d.ts +342 -0
  349. package/dist/i18n/locales/it.js +344 -2
  350. package/dist/i18n/locales/ja.d.ts +342 -0
  351. package/dist/i18n/locales/ja.js +344 -2
  352. package/dist/i18n/locales/nl.d.ts +342 -0
  353. package/dist/i18n/locales/nl.js +344 -2
  354. package/dist/i18n/locales/pl.d.ts +342 -0
  355. package/dist/i18n/locales/pl.js +344 -2
  356. package/dist/i18n/locales/pt.d.ts +342 -0
  357. package/dist/i18n/locales/pt.js +344 -2
  358. package/dist/i18n/locales/ro.d.ts +342 -0
  359. package/dist/i18n/locales/ro.js +344 -2
  360. package/dist/i18n/locales/ru.d.ts +342 -0
  361. package/dist/i18n/locales/ru.js +344 -2
  362. package/dist/i18n/locales/sq.d.ts +342 -0
  363. package/dist/i18n/locales/sq.js +344 -2
  364. package/dist/i18n/locales/sv.d.ts +342 -0
  365. package/dist/i18n/locales/sv.js +344 -2
  366. package/dist/i18n/locales/tr.d.ts +342 -0
  367. package/dist/i18n/locales/tr.js +344 -2
  368. package/dist/i18n/locales/zh.d.ts +342 -0
  369. package/dist/i18n/locales/zh.js +344 -2
  370. package/dist/index.js +1305 -1241
  371. package/dist/locales/ar.json +344 -2
  372. package/dist/locales/de.json +344 -2
  373. package/dist/locales/el.json +344 -2
  374. package/dist/locales/en.json +344 -2
  375. package/dist/locales/es.json +344 -2
  376. package/dist/locales/fr.json +344 -2
  377. package/dist/locales/hi.json +344 -2
  378. package/dist/locales/it.json +344 -2
  379. package/dist/locales/ja.json +344 -2
  380. package/dist/locales/nl.json +344 -2
  381. package/dist/locales/pl.json +344 -2
  382. package/dist/locales/pt.json +344 -2
  383. package/dist/locales/ro.json +344 -2
  384. package/dist/locales/ru.json +344 -2
  385. package/dist/locales/sq.json +344 -2
  386. package/dist/locales/sv.json +344 -2
  387. package/dist/locales/tr.json +344 -2
  388. package/dist/locales/zh.json +344 -2
  389. package/dist/patterns/alia-assistant/index.js +1 -1
  390. package/dist/patterns/anamnesis/index.js +1 -1
  391. package/dist/patterns/calendar/index.js +1 -1
  392. package/dist/patterns/help-me-write-templates/index.js +1 -1
  393. package/dist/patterns/login-form/index.js +1 -1
  394. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  395. package/dist/patterns/registration-form/index.js +1 -1
  396. package/dist/patterns/send-registration-link-form/index.js +1 -1
  397. package/dist/patterns/signature-request/index.js +1 -1
  398. package/dist/patterns/verify-identity/index.js +1 -1
  399. package/dist/patterns/workflow-webhook-action/index.js +1 -1
  400. package/dist/tokens.css +1 -1
  401. package/package.json +21 -1
  402. package/dist/_chunks/checkbox-a7Sh-dXb.js +0 -227
  403. package/dist/_chunks/combobox-duuDRI1t.js +0 -688
  404. package/dist/_chunks/data-grid.agent-CASyEAnb.js +0 -1773
  405. package/dist/_chunks/data-table-C9idMvs0.js +0 -2042
  406. package/dist/_chunks/data-table-tabs-Db7zToFD.js +0 -728
  407. package/dist/_chunks/dialog-BTjSQjdY.js +0 -274
  408. package/dist/_chunks/format--x5jypvH.js +0 -1319
  409. package/dist/_chunks/format-price-BcFBa-WP.js +0 -52
  410. package/dist/_chunks/icon-button-group-mXvYDaba.js +0 -427
  411. package/dist/_chunks/link-cell-renderer-_Fv3WEmb.js +0 -867
  412. package/dist/_chunks/money-Tsczpjfz.js +0 -102
  413. package/dist/_chunks/number-input-CVwI1ltI.js +0 -423
  414. package/dist/_chunks/privacy-mask-Dc3kdkCR.js +0 -81
  415. package/dist/_chunks/subDays-DKISP2nE.js +0 -8
  416. package/dist/_chunks/undo-2-CYNAzclj.js +0 -26
@@ -0,0 +1,1563 @@
1
+ import { jsx as o, jsxs as O, Fragment as wt } from "react/jsx-runtime";
2
+ import { createContext as Nt, useContext as fe, useRef as I, useLayoutEffect as cn, useMemo as b, forwardRef as un, useEffect as Pe, useState as Te, useCallback as k, useImperativeHandle as dn } from "react";
3
+ import { useTranslation as mn } from "react-i18next";
4
+ import { u as fn } from "./registry-DvAUVLHh.js";
5
+ import { e as yn } from "./data-grid-ByhrYGVw.js";
6
+ import { a as K } from "./format-number-DdzqwMs1.js";
7
+ import { i as pn } from "./is-development-CLUAnsU7.js";
8
+ import { B as Ln } from "./badge-BUk4RjTS.js";
9
+ import { C as hn } from "./combobox-BBCVQS-S.js";
10
+ import { M as gn } from "./money-OE6_oDPH.js";
11
+ import { V as Ye } from "./visually-hidden-BHxEUGyT.js";
12
+ import { divideDecimal as vn, formatDecimal as se, multiplyDecimal as bn, sumDecimals as ke, parseDecimal as _e, FATTURAPA_VALUE as Ee, compareDecimal as xe, decimalToNumber as Se, rescaleDecimal as kt, numberToDecimal as In, shiftDecimal as Tn } from "../decimal/index.js";
13
+ import { c as _ } from "./index-D2ZczOXr.js";
14
+ import { E as wn } from "./compact-editor-fields-6sTWRLtf.js";
15
+ import { C as Nn } from "./check-DrFSN__t.js";
16
+ import { P as kn } from "./plus-DzMQ_c6b.js";
17
+ import { C as _n } from "./circle-alert-rGDZ73Wh.js";
18
+ import { T as En } from "./triangle-alert-CBnO6nq_.js";
19
+ function dt(e, t) {
20
+ throw new Error(`${e}: ${t}`);
21
+ }
22
+ const xn = "^[0-9]{1,8}([.][0-9]{1,8})?$", de = { type: "string", minLength: 1 }, we = "{ id, lineNumber, matchState, selected, selectable, readOnly, quantityLocked, itemKind, itemId, quantity, removesStock, warningCodes, invalid }", Sn = {
23
+ id: "bill-line-table",
24
+ // select_multiple: ticks. set_value: a line's quantity and its item
25
+ // (whole-value assignment to a NumberInput and a Combobox, 26 section 4).
26
+ // scroll: focus_line. No `confirm`: loading is the host's.
27
+ capabilities: ["select_multiple", "set_value", "scroll"],
28
+ state: {
29
+ lines: {
30
+ type: `Array<${we}>`,
31
+ descriptionKey: "ui.agent.billLineTable.state.lines",
32
+ description: "Every invoice line in invoice order, with what Confirm will do with it. Quantities are exact decimal text as shown, unsigned; there are no descriptions or names.",
33
+ read: (e) => e.getLines()
34
+ },
35
+ selection: {
36
+ type: "string[]",
37
+ descriptionKey: "ui.agent.billLineTable.state.selection",
38
+ description: "Ids of the ticked lines: the lines Confirm will load.",
39
+ read: (e) => e.getSelection()
40
+ },
41
+ summary: {
42
+ type: "{ lineCount, selectedCount, matchedCount, newItemCount, skippedCount, alreadyLoadedCount, warningLineCount, invoiceLoaded, invalidCount, net, vat, gross, canConfirm, dirty }",
43
+ descriptionKey: "ui.agent.billLineTable.state.summary",
44
+ description: 'Counts and totals of the ticked lines. net, vat and gross are exact decimal text with 2 places ("14.58"). canConfirm is false while no line is ticked, a ticked line cannot load, or the invoice is already loaded (invoiceLoaded).',
45
+ read: (e) => e.getSummary()
46
+ },
47
+ invalidLineIds: {
48
+ type: "string[]",
49
+ descriptionKey: "ui.agent.billLineTable.state.invalidLineIds",
50
+ description: "Ticked lines that cannot load as they are: an empty or zero quantity, an item no longer in the warehouse, or an error from the server.",
51
+ read: (e) => e.getInvalidLineIds()
52
+ }
53
+ },
54
+ actions: {
55
+ select_lines: {
56
+ safety: "write",
57
+ idempotent: !0,
58
+ argsType: "{ ids: string[]; mode?: 'replace' | 'add' | 'remove' }",
59
+ argsSchema: {
60
+ type: "object",
61
+ properties: {
62
+ ids: { type: "array", items: de, uniqueItems: !0 },
63
+ mode: { type: "string", enum: ["replace", "add", "remove"] }
64
+ },
65
+ required: ["ids"],
66
+ additionalProperties: !1
67
+ },
68
+ returns: "string[]",
69
+ errors: ["UNKNOWN_LINE", "LINE_READ_ONLY", "TABLE_READ_ONLY"],
70
+ examples: [{ args: { ids: ["ln-3", "ln-4"], mode: "add" } }],
71
+ descriptionKey: "ui.agent.billLineTable.actions.selectLines",
72
+ description: "Tick or untick lines. Lines of an invoice that is already loaded cannot be ticked. Returns the ticked ids.",
73
+ invoke: (e, t) => {
74
+ for (const u of t.ids)
75
+ e.getLine(u) || dt("UNKNOWN_LINE", `no line "${u}".`);
76
+ const i = e.getSelection(), n = t.mode ?? "replace", r = n === "replace" ? t.ids : n === "add" ? [...i, ...t.ids] : i.filter((u) => !t.ids.includes(u));
77
+ return e.setSelection(r), e.getSelection();
78
+ }
79
+ },
80
+ select_all_lines: {
81
+ safety: "write",
82
+ idempotent: !0,
83
+ returns: "string[]",
84
+ errors: ["TABLE_READ_ONLY"],
85
+ descriptionKey: "ui.agent.billLineTable.actions.selectAllLines",
86
+ description: "Tick every line that can load. Returns the ticked ids.",
87
+ invoke: (e) => (e.selectAll(), e.getSelection())
88
+ },
89
+ clear_selection: {
90
+ safety: "write",
91
+ idempotent: !0,
92
+ returns: "string[]",
93
+ errors: ["TABLE_READ_ONLY"],
94
+ descriptionKey: "ui.agent.billLineTable.actions.clearSelection",
95
+ description: "Untick every line.",
96
+ invoke: (e) => (e.clearSelection(), e.getSelection())
97
+ },
98
+ set_quantity: {
99
+ safety: "write",
100
+ idempotent: !0,
101
+ argsType: "{ lineId: string; quantity: string }",
102
+ argsSchema: {
103
+ type: "object",
104
+ properties: {
105
+ lineId: de,
106
+ quantity: { type: "string", pattern: xn }
107
+ },
108
+ required: ["lineId", "quantity"],
109
+ additionalProperties: !1
110
+ },
111
+ returns: we,
112
+ errors: [
113
+ "UNKNOWN_LINE",
114
+ "INVALID_QUANTITY",
115
+ "TABLE_READ_ONLY",
116
+ "LINE_READ_ONLY"
117
+ ],
118
+ examples: [
119
+ { args: { lineId: "ln-2", quantity: "2.5" } },
120
+ {
121
+ args: { lineId: "ln-7", quantity: "3" },
122
+ note: "On a credit note this removes 3 from stock."
123
+ }
124
+ ],
125
+ descriptionKey: "ui.agent.billLineTable.actions.setQuantity",
126
+ description: "Set the quantity of a line as shown in the table: a decimal above 0 and at most 10000000, with a dot and up to 8 places, never signed. On a credit note it is the quantity to remove. The line amount stays as invoiced. Does not tick the line.",
127
+ invoke: (e, t) => (e.setQuantity(t.lineId, t.quantity), e.getLine(t.lineId))
128
+ },
129
+ set_item: {
130
+ safety: "write",
131
+ idempotent: !0,
132
+ argsType: "{ lineId: string; itemId: string }",
133
+ argsSchema: {
134
+ type: "object",
135
+ properties: {
136
+ lineId: de,
137
+ itemId: { type: "string", minLength: 1 }
138
+ },
139
+ required: ["lineId", "itemId"],
140
+ additionalProperties: !1
141
+ },
142
+ returns: we,
143
+ errors: [
144
+ "UNKNOWN_LINE",
145
+ "UNKNOWN_ITEM",
146
+ "TABLE_READ_ONLY",
147
+ "LINE_READ_ONLY"
148
+ ],
149
+ descriptionKey: "ui.agent.billLineTable.actions.setItem",
150
+ description: "Load a line into an existing warehouse item, by item id. Does not tick the line.",
151
+ invoke: (e, t) => (e.setItem(t.lineId, { kind: "existing", itemId: t.itemId }), e.getLine(t.lineId))
152
+ },
153
+ create_new_item: {
154
+ safety: "write",
155
+ idempotent: !0,
156
+ argsType: "{ lineId: string; name?: string }",
157
+ argsSchema: {
158
+ type: "object",
159
+ properties: {
160
+ lineId: de,
161
+ // DoctorInventoryItem.name is a string of 255.
162
+ name: { type: "string", minLength: 1, maxLength: 255 }
163
+ },
164
+ required: ["lineId"],
165
+ additionalProperties: !1
166
+ },
167
+ returns: we,
168
+ errors: [
169
+ "UNKNOWN_LINE",
170
+ "INVALID_ARGS",
171
+ "TABLE_READ_ONLY",
172
+ "LINE_READ_ONLY"
173
+ ],
174
+ descriptionKey: "ui.agent.billLineTable.actions.createNewItem",
175
+ description: "Mark a line to create a new warehouse item when the invoice is loaded. Without a name, the item takes the line description. Nothing is created until Confirm. Does not tick the line.",
176
+ invoke: (e, t) => {
177
+ var n;
178
+ const i = (n = t.name) == null ? void 0 : n.trim();
179
+ return t.name !== void 0 && !i && dt("INVALID_ARGS", "name is empty."), e.setItem(t.lineId, { kind: "new", name: i ?? "" }), e.getLine(t.lineId);
180
+ }
181
+ },
182
+ focus_line: {
183
+ safety: "read",
184
+ idempotent: !0,
185
+ argsType: "{ lineId: string; field?: 'select' | 'quantity' | 'item' }",
186
+ argsSchema: {
187
+ type: "object",
188
+ properties: {
189
+ lineId: de,
190
+ field: { type: "string", enum: ["select", "quantity", "item"] }
191
+ },
192
+ required: ["lineId"],
193
+ additionalProperties: !1
194
+ },
195
+ errors: ["UNKNOWN_LINE"],
196
+ descriptionKey: "ui.agent.billLineTable.actions.focusLine",
197
+ description: "Scroll a line into view and move focus to its checkbox, quantity or item field.",
198
+ invoke: (e, t) => {
199
+ e.focusLine(t.lineId, t.field);
200
+ }
201
+ }
202
+ },
203
+ domHooks: {
204
+ root: {
205
+ attr: "data-component",
206
+ value: "bill-line-table",
207
+ description: "Marks the element as a kit BillLineTable."
208
+ },
209
+ instanceId: {
210
+ attr: "data-component-id",
211
+ sourceProp: "gridId",
212
+ description: "The agent instance id."
213
+ },
214
+ item: {
215
+ attr: "data-row-id",
216
+ sourceProp: "lines[].id",
217
+ description: "BillLine.id on each body row (written by DataGrid). The only line datum in the DOM."
218
+ }
219
+ }
220
+ }, ae = 8, _t = 8, Cn = 2, ye = 1e7, mt = 255, le = "bill-line-table:new-item", Et = "quantityTooLarge", me = { units: 0, scale: 0 }, xt = { units: ye, scale: 0 }, qn = {
221
+ ...Ee.quantity,
222
+ allowNegative: !0
223
+ };
224
+ function Ce(e) {
225
+ let { units: t, scale: i } = e;
226
+ for (; i > 0 && t % 10 === 0; )
227
+ t /= 10, i -= 1;
228
+ return { units: t || 0, scale: i };
229
+ }
230
+ function Ue(e) {
231
+ return { units: Math.abs(e.units), scale: e.scale };
232
+ }
233
+ function A(e) {
234
+ const t = {
235
+ empty: !0,
236
+ wellFormed: !1,
237
+ positive: !1,
238
+ value: null,
239
+ editorNumber: null
240
+ };
241
+ if (e === null || e.trim() === "") return t;
242
+ const i = _e(e, qn);
243
+ if (i.ok) {
244
+ const n = Se(i.value);
245
+ return {
246
+ empty: !1,
247
+ wellFormed: !0,
248
+ positive: i.value.units > 0,
249
+ value: i.value,
250
+ editorNumber: n !== null && Math.abs(n) <= ye ? n : null
251
+ };
252
+ }
253
+ return i.error === "unsafe" ? {
254
+ empty: !1,
255
+ wellFormed: !0,
256
+ positive: !e.trim().startsWith("-"),
257
+ value: null,
258
+ editorNumber: null
259
+ } : { ...t, empty: !1 };
260
+ }
261
+ function $e(e) {
262
+ const t = A(e);
263
+ return !t.wellFormed || t.editorNumber !== null;
264
+ }
265
+ function On(e) {
266
+ const t = In(e, ae);
267
+ return t ? se(Ce(t)) : null;
268
+ }
269
+ function oe(e) {
270
+ const t = _e(e, Ee.lineTotal);
271
+ return t.ok ? t.value : null;
272
+ }
273
+ function St(e) {
274
+ if (e === null) return null;
275
+ const t = _e(e, Ee.rate);
276
+ return t.ok ? t.value : null;
277
+ }
278
+ function An(e, t) {
279
+ const i = oe(e), n = A(t).value;
280
+ if (!i || !n || n.units === 0) return null;
281
+ const r = vn(i, n, _t);
282
+ return r ? se(Ce(r)) : null;
283
+ }
284
+ function Rn(e, t) {
285
+ const i = oe(e), n = oe(t);
286
+ return !i || !n ? e.trim() === t.trim() : xe(Ue(i), Ue(n)) === 0;
287
+ }
288
+ function W(e) {
289
+ const t = e.trim(), i = Array.from(t);
290
+ return i.length > mt ? i.slice(0, mt).join("").trim() : t;
291
+ }
292
+ function Qe(e, t) {
293
+ if (e.kind === "existing")
294
+ return { kind: "existing", itemId: e.itemId };
295
+ const i = W(e.name);
296
+ return {
297
+ kind: "new",
298
+ name: i === "" ? W(t.description) : i
299
+ };
300
+ }
301
+ function Vn(e) {
302
+ const t = A(e);
303
+ return t.wellFormed ? t.value === null ? !0 : xe(Ue(t.value), xt) > 0 : !1;
304
+ }
305
+ function Ct(e, t) {
306
+ return Vn(t.quantity) && !At(t.quantity, e.quantity);
307
+ }
308
+ function qt(e) {
309
+ return e.item.kind === "new" && W(e.item.name) === "";
310
+ }
311
+ function Dn(e, t) {
312
+ if (t.item.kind !== "new") return !1;
313
+ const i = W(t.item.name);
314
+ return i !== "" && i === W(e.description);
315
+ }
316
+ function te(e) {
317
+ return e.some((t) => t.alreadyLoaded);
318
+ }
319
+ function z(e) {
320
+ return {
321
+ quantity: e.quantity,
322
+ item: e.proposal === "existing" && e.proposedItemId !== null ? { kind: "existing", itemId: e.proposedItemId } : { kind: "new", name: W(e.description) }
323
+ };
324
+ }
325
+ function Vi(e) {
326
+ const t = {};
327
+ for (const i of e) t[i.id] = z(i);
328
+ return t;
329
+ }
330
+ function Ke(e) {
331
+ return te(e) ? [] : e.filter((t) => t.proposal !== "skip").map((t) => t.id);
332
+ }
333
+ function ft(e, t) {
334
+ const i = {};
335
+ for (const n of e)
336
+ i[n.id] = t[n.id] ?? z(n);
337
+ return i;
338
+ }
339
+ function Bn(e, t) {
340
+ return !e.alreadyLoaded;
341
+ }
342
+ function $(e, t) {
343
+ if (te(e) || t.length === 0) return [];
344
+ const n = new Set(t);
345
+ return e.filter((r) => n.has(r.id) && Bn(r)).map((r) => r.id);
346
+ }
347
+ function Ot(e, t) {
348
+ return e.kind === "existing" ? t.kind === "existing" && e.itemId === t.itemId : t.kind === "new" && W(e.name) === W(t.name);
349
+ }
350
+ function At(e, t) {
351
+ if (e === t) return !0;
352
+ if (e === null || t === null) return !1;
353
+ const i = A(e).value, n = A(t).value;
354
+ return i && n ? xe(i, n) === 0 : e.trim() === t.trim();
355
+ }
356
+ function Rt(e, t) {
357
+ return At(e.quantity, t.quantity) && Ot(e.item, t.item);
358
+ }
359
+ function Mn(e, t, i) {
360
+ return e.alreadyLoaded ? "alreadyLoaded" : i ? t.item.kind === "existing" ? "matched" : "newItem" : "skip";
361
+ }
362
+ function ze(e, t, i = !0) {
363
+ const n = A(t.quantity);
364
+ return !n.wellFormed || !n.positive || Ct(e, t) || !oe(e.lineTotal) || t.item.kind === "existing" && !i || qt(t) ? !0 : e.warnings.some((r) => r.severity === "error");
365
+ }
366
+ const Vt = () => !0;
367
+ function Dt(e, t) {
368
+ return e.item.kind !== "existing" || t(e.item.itemId);
369
+ }
370
+ function yt(e) {
371
+ const t = ke(e);
372
+ if (t) return t;
373
+ const i = [];
374
+ for (const n of e) {
375
+ const r = kt(n, 2);
376
+ r && i.push(r);
377
+ }
378
+ return ke(i) ?? me;
379
+ }
380
+ function Ne(e) {
381
+ return kt(e, 2) ?? me;
382
+ }
383
+ const Fe = (e) => se(e, 2);
384
+ function pt(e, t, i, n, r = Vt) {
385
+ const u = te(e), E = new Set($(e, i));
386
+ let T = 0, p = 0, g = 0, N = 0, R = 0, q = 0, V = 0;
387
+ const D = [], B = /* @__PURE__ */ new Map();
388
+ for (const m of e) {
389
+ const H = t[m.id] ?? z(m);
390
+ if ((m.warnings.length > 0 || !$e(m.quantity)) && (q += 1), m.alreadyLoaded) {
391
+ R += 1;
392
+ continue;
393
+ }
394
+ if (!E.has(m.id)) {
395
+ N += 1;
396
+ continue;
397
+ }
398
+ T += 1, H.item.kind === "existing" ? p += 1 : g += 1, ze(m, H, Dt(H, r)) && (V += 1);
399
+ const F = oe(m.lineTotal);
400
+ if (!F) continue;
401
+ D.push(F);
402
+ const f = St(m.vatPercent);
403
+ if (f) {
404
+ const he = se(Ce(f)), X = B.get(he);
405
+ X ? X.amounts.push(F) : B.set(he, { rate: f, amounts: [F] });
406
+ }
407
+ }
408
+ const j = Ne(yt(D)), y = [];
409
+ for (const m of B.values()) {
410
+ const H = {
411
+ units: m.rate.units,
412
+ scale: m.rate.scale + 2
413
+ }, F = Ne(yt(m.amounts));
414
+ y.push(bn(F, H, 2) ?? me);
415
+ }
416
+ const v = ke(y) ?? me, M = ke([j, v]) ?? me, G = $(e, n.selection), Le = G.length !== E.size || G.some((m) => !E.has(m)) || e.some(
417
+ (m) => !Rt(
418
+ t[m.id] ?? z(m),
419
+ n.values[m.id] ?? z(m)
420
+ )
421
+ );
422
+ return {
423
+ lineCount: e.length,
424
+ selectedCount: T,
425
+ matchedCount: p,
426
+ newItemCount: g,
427
+ skippedCount: N,
428
+ alreadyLoadedCount: R,
429
+ warningLineCount: q,
430
+ invoiceLoaded: u,
431
+ invalidCount: V,
432
+ net: Fe(j),
433
+ vat: Fe(Ne(v)),
434
+ gross: Fe(Ne(M)),
435
+ canConfirm: T > 0 && V === 0,
436
+ dirty: Le
437
+ };
438
+ }
439
+ function Pn(e) {
440
+ const t = A(e).value;
441
+ return t ? se(t) : e.trim();
442
+ }
443
+ function Kn(e, t, i, n, r = Vt) {
444
+ if (te(e)) return { ok: !1, invalidLineIds: [] };
445
+ const u = new Set($(e, i)), E = [], T = [];
446
+ for (const p of e) {
447
+ if (!u.has(p.id)) continue;
448
+ const g = t[p.id] ?? z(p);
449
+ if (g.quantity === null || ze(p, g, Dt(g, r))) {
450
+ T.push(p.id);
451
+ continue;
452
+ }
453
+ const N = Pn(g.quantity);
454
+ E.push({
455
+ lineId: p.id,
456
+ quantity: n === "creditNote" ? `-${N}` : N,
457
+ item: Qe(g.item, p)
458
+ });
459
+ }
460
+ return T.length > 0 ? { ok: !1, invalidLineIds: T } : { ok: !0, lines: E };
461
+ }
462
+ function Bt(e, t, i) {
463
+ const n = i.ticked.has(e.id), r = t.item.kind === "existing" ? i.findItem(t.item.itemId) ?? null : null, u = t.item.kind !== "existing" || r !== null;
464
+ return {
465
+ line: e,
466
+ value: t,
467
+ selected: n,
468
+ matchState: Mn(e, t, n),
469
+ invalid: n && ze(e, t, u),
470
+ readOnly: i.invoiceLoaded,
471
+ quantityLocked: !$e(e.quantity),
472
+ item: r,
473
+ itemKnown: u
474
+ };
475
+ }
476
+ function Fn(e, t) {
477
+ return e === t ? !0 : e === null || t === null ? !1 : e.id === t.id && e.name === t.name && e.code === t.code;
478
+ }
479
+ function Un(e, t) {
480
+ return e.line === t.line && e.value.quantity === t.value.quantity && Ot(e.value.item, t.value.item) && e.selected === t.selected && e.matchState === t.matchState && e.invalid === t.invalid && e.readOnly === t.readOnly && e.quantityLocked === t.quantityLocked && e.itemKnown === t.itemKnown && Fn(e.item, t.item);
481
+ }
482
+ function Lt(e) {
483
+ const t = {
484
+ invoiceLoaded: te(e.lines),
485
+ ticked: new Set($(e.lines, e.selection)),
486
+ findItem: e.findItem
487
+ };
488
+ return e.lines.map((i) => {
489
+ var u;
490
+ const n = Bt(
491
+ i,
492
+ e.values[i.id] ?? z(i),
493
+ t
494
+ ), r = (u = e.previous) == null ? void 0 : u.get(i.id);
495
+ return r && Un(r, n) ? r : n;
496
+ });
497
+ }
498
+ function Qn(e, t) {
499
+ const i = e.line.warnings.map((r) => r.code);
500
+ e.quantityLocked && i.push(Et);
501
+ const n = e.readOnly || e.line.alreadyLoaded;
502
+ return {
503
+ id: e.line.id,
504
+ lineNumber: e.line.lineNumber,
505
+ matchState: e.matchState,
506
+ selected: e.selected,
507
+ selectable: !n && !t.tableReadOnly,
508
+ readOnly: n || t.tableReadOnly,
509
+ quantityLocked: e.quantityLocked,
510
+ itemKind: e.value.item.kind,
511
+ itemId: e.value.item.kind === "existing" ? e.value.item.itemId : null,
512
+ quantity: e.value.quantity,
513
+ removesStock: t.documentKind === "creditNote",
514
+ warningCodes: i,
515
+ invalid: e.invalid
516
+ };
517
+ }
518
+ function Yn(e) {
519
+ const t = _e(e, Ee.quantity);
520
+ return !t.ok || t.value.units <= 0 || xe(t.value, xt) > 0 ? null : se(Ce(t.value));
521
+ }
522
+ const $n = _("ds:flex ds:min-w-0 ds:flex-col", {
523
+ variants: {
524
+ height: {
525
+ auto: "",
526
+ fill: "ds:min-h-0 ds:flex-1"
527
+ }
528
+ },
529
+ defaultVariants: { height: "fill" }
530
+ }), zn = _([
531
+ "ds:w-full ds:min-w-0",
532
+ wn
533
+ ]), Mt = _("ds:flex ds:flex-col", {
534
+ variants: {
535
+ align: {
536
+ start: "ds:items-start",
537
+ end: "ds:items-end"
538
+ }
539
+ },
540
+ defaultVariants: { align: "start" }
541
+ }), Pt = _(
542
+ "type-body-sm ds:text-[color:var(--muted-foreground)]"
543
+ ), Kt = _(
544
+ "ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-2xs)] ds:p-0",
545
+ {
546
+ variants: {
547
+ align: {
548
+ start: "ds:items-start",
549
+ end: "ds:items-end"
550
+ }
551
+ },
552
+ defaultVariants: { align: "start" }
553
+ }
554
+ ), qe = _("ds:tabular-nums"), Wn = _(
555
+ "ds:flex ds:items-start ds:gap-[var(--spacing-xs)]"
556
+ ), ht = _(
557
+ "ds:mt-[var(--spacing-2xs)] ds:size-4 ds:shrink-0",
558
+ {
559
+ variants: {
560
+ severity: {
561
+ warning: "ds:text-[color:var(--warning-foreground)]",
562
+ error: "ds:text-[color:var(--error-foreground)]"
563
+ }
564
+ },
565
+ defaultVariants: { severity: "warning" }
566
+ }
567
+ ), jn = _("ds:text-[color:var(--foreground)]"), Gn = _(
568
+ "ds:m-0 ds:grid ds:grid-cols-[auto_auto] ds:items-baseline ds:justify-end ds:gap-x-[var(--spacing-sm)] ds:gap-y-[var(--spacing-2xs)]"
569
+ ), gt = _(
570
+ "ds:text-[color:var(--muted-foreground)]"
571
+ ), vt = _("ds:m-0 ds:text-end"), Hn = {
572
+ itemOptions: [],
573
+ itemOptionIds: /* @__PURE__ */ new Set(),
574
+ serverSearch: !1,
575
+ itemsLoading: !1,
576
+ searchingLineId: null
577
+ }, Ft = Nt(Hn), pe = Nt(
578
+ null
579
+ ), Xn = {
580
+ matched: { variant: "success", check: !1 },
581
+ newItem: { variant: "info", check: !1 },
582
+ skip: { variant: "neutral", check: !1 },
583
+ alreadyLoaded: { variant: "neutral", check: !0 }
584
+ };
585
+ function bt(e, t) {
586
+ return e === "matched" ? t("billLineTable.match.matched", "Matched") : e === "newItem" ? t("billLineTable.match.newItem", "New item") : e === "alreadyLoaded" ? t("billLineTable.match.alreadyLoaded", "Already loaded") : t("billLineTable.match.skip", "Skip");
587
+ }
588
+ function Ut(e, t) {
589
+ const i = St(e), n = i ? Se(i) : null;
590
+ return n === null ? e.trim() : K(Tn(n, -2), t, {
591
+ style: "percent",
592
+ minimumFractionDigits: 0,
593
+ maximumFractionDigits: Cn
594
+ });
595
+ }
596
+ function ne({
597
+ value: e,
598
+ currency: t,
599
+ fractionDigits: i = _t,
600
+ tone: n = "default"
601
+ }) {
602
+ const r = oe(e);
603
+ return r ? /* @__PURE__ */ o(
604
+ gn,
605
+ {
606
+ size: "sm",
607
+ tone: n,
608
+ value: r.units,
609
+ scale: r.scale,
610
+ currency: t,
611
+ minimumFractionDigits: Math.min(2, i),
612
+ maximumFractionDigits: i
613
+ }
614
+ ) : /* @__PURE__ */ o("span", { dir: "ltr", className: qe(), children: e.trim() });
615
+ }
616
+ function Jn(e, t) {
617
+ const i = e.value.quantity;
618
+ if (i === null) return null;
619
+ const n = A(i), r = n.value ? Se(n.value) : null;
620
+ return /* @__PURE__ */ O("span", { className: qe(), children: [
621
+ r === null ? (
622
+ // More digits than a double holds: every digit, as sent.
623
+ /* @__PURE__ */ o("span", { dir: "ltr", children: i.trim() })
624
+ ) : K(r, t, {
625
+ maximumFractionDigits: ae
626
+ }),
627
+ e.line.unitOfMeasure ? /* @__PURE__ */ O(wt, { children: [
628
+ " ",
629
+ /* @__PURE__ */ o("span", { dir: "auto", children: e.line.unitOfMeasure })
630
+ ] }) : null
631
+ ] });
632
+ }
633
+ function Zn(e, t) {
634
+ const { t: i } = t;
635
+ if (!e.selected) return;
636
+ const n = A(e.value.quantity);
637
+ if (n.empty)
638
+ return i("billLineTable.quantity.errorRequired", "Enter a quantity");
639
+ if (!n.wellFormed || !n.positive)
640
+ return i(
641
+ "billLineTable.quantity.errorNotPositive",
642
+ "Enter a quantity above 0"
643
+ );
644
+ if (Ct(e.line, e.value))
645
+ return i("billLineTable.quantity.errorTooLarge", {
646
+ max: K(ye, t.language),
647
+ defaultValue: "Enter a quantity of {{max}} or less"
648
+ });
649
+ const r = e.line.warnings.find(
650
+ (u) => u.severity === "error"
651
+ );
652
+ return r == null ? void 0 : r.message;
653
+ }
654
+ function ei(e, t) {
655
+ if (!e.itemKnown)
656
+ return t(
657
+ "billLineTable.item.errorUnknown",
658
+ "This item is no longer in the warehouse. Choose another."
659
+ );
660
+ if (e.selected && qt(e.value))
661
+ return t(
662
+ "billLineTable.item.errorNameRequired",
663
+ "Enter a name for the new item"
664
+ );
665
+ }
666
+ function ti(e, t) {
667
+ const i = An(e.line.lineTotal, e.value.quantity), n = i !== null && !Rn(i, e.line.unitPrice) ? i : null;
668
+ return /* @__PURE__ */ O("span", { className: Mt({ align: "end" }), children: [
669
+ /* @__PURE__ */ o(ne, { value: e.line.unitPrice, currency: t.currency }),
670
+ n !== null ? /* @__PURE__ */ O("span", { className: Pt(), children: [
671
+ t.t("billLineTable.unitPrice.netLabel", "Net per unit"),
672
+ " ",
673
+ /* @__PURE__ */ o(
674
+ ne,
675
+ {
676
+ value: n,
677
+ currency: t.currency,
678
+ tone: "muted"
679
+ }
680
+ )
681
+ ] }) : null
682
+ ] });
683
+ }
684
+ function ni(e, t) {
685
+ return e.line.adjustments.length === 0 ? null : /* @__PURE__ */ o("ul", { className: Kt({ align: "end" }), children: e.line.adjustments.map((i, n) => (
686
+ // Index key: the blocks have no identity and never reorder.
687
+ /* @__PURE__ */ O("li", { className: qe(), children: [
688
+ /* @__PURE__ */ o(Ye, { children: i.type === "discount" ? t.t("billLineTable.adjustment.discount", "Discount") : t.t("billLineTable.adjustment.surcharge", "Surcharge") }),
689
+ /* @__PURE__ */ o("span", { "aria-hidden": "true", children: i.type === "discount" ? "−" : "+" }),
690
+ i.percent !== null ? Ut(i.percent, t.language) : i.amount !== null ? /* @__PURE__ */ o(ne, { value: i.amount, currency: t.currency }) : null
691
+ ] }, n)
692
+ )) });
693
+ }
694
+ function ii(e, t) {
695
+ if (e.line.vatPercent === null)
696
+ return /* @__PURE__ */ O(wt, { children: [
697
+ /* @__PURE__ */ o("span", { "aria-hidden": "true", children: "–" }),
698
+ /* @__PURE__ */ o(Ye, { children: t.t("billLineTable.vat.none", "No VAT rate") })
699
+ ] });
700
+ const i = Ut(e.line.vatPercent, t.language);
701
+ return e.line.vatNature ? t.t("billLineTable.vat.withNature", {
702
+ rate: i,
703
+ nature: e.line.vatNature,
704
+ defaultValue: "{{rate}} ({{nature}})"
705
+ }) : i;
706
+ }
707
+ function We(e, t) {
708
+ return t.privacyMode ? t.t("billLineTable.item.newOptionMasked", "New item") : t.t("billLineTable.item.newOption", {
709
+ name: e,
710
+ defaultValue: "New item: {{name}}"
711
+ });
712
+ }
713
+ function ri(e, t) {
714
+ const i = [We("", { ...t, privacyMode: !1 }).trim()];
715
+ t.privacyMode && i.push(t.t("billLineTable.item.newOptionMasked", "New item"));
716
+ for (const n of i)
717
+ if (n !== "" && e.startsWith(n))
718
+ return e.slice(n.length).trim();
719
+ return e.trim();
720
+ }
721
+ function It(e, t) {
722
+ var n;
723
+ const i = e.value.item;
724
+ return i.kind === "new" ? We(i.name, t) : ((n = e.item) == null ? void 0 : n.name) ?? "";
725
+ }
726
+ function Qt(e) {
727
+ return {
728
+ value: e.id,
729
+ label: e.name,
730
+ description: e.code ?? void 0,
731
+ // Item names are text a practice wrote.
732
+ dir: "auto"
733
+ };
734
+ }
735
+ const ai = () => 1;
736
+ function li(e, t) {
737
+ const i = [...e.line.warnings];
738
+ return e.quantityLocked && i.push({
739
+ code: Et,
740
+ message: t.t(
741
+ "billLineTable.quantity.tooLarge",
742
+ "This quantity is too large to edit here. It loads as on the invoice."
743
+ ),
744
+ severity: "warning"
745
+ }), t.privacyMode && e.selected && Dn(e.line, e.value) && i.push({
746
+ code: "newItemNameHidden",
747
+ message: t.t(
748
+ "billLineTable.item.checkNameHidden",
749
+ "The new item takes the line description as its name. Turn off privacy mode to check it before you load."
750
+ ),
751
+ severity: "warning"
752
+ }), i.length === 0 ? null : /* @__PURE__ */ o("ul", { className: Kt(), children: i.map((n, r) => (
753
+ // Index key: warnings have no identity of their own.
754
+ /* @__PURE__ */ O("li", { className: Wn(), children: [
755
+ n.severity === "error" ? /* @__PURE__ */ o(
756
+ _n,
757
+ {
758
+ "aria-hidden": "true",
759
+ className: ht({ severity: "error" })
760
+ }
761
+ ) : /* @__PURE__ */ o(
762
+ En,
763
+ {
764
+ "aria-hidden": "true",
765
+ className: ht({ severity: "warning" })
766
+ }
767
+ ),
768
+ /* @__PURE__ */ O("span", { className: jn(), children: [
769
+ /* @__PURE__ */ o(Ye, { children: n.severity === "error" ? t.t("billLineTable.warnings.error", "Error:") : t.t("billLineTable.warnings.warning", "Warning:") }),
770
+ /* @__PURE__ */ o("span", { dir: "auto", children: n.message })
771
+ ] })
772
+ ] }, r)
773
+ )) });
774
+ }
775
+ function oi({
776
+ row: e,
777
+ context: t,
778
+ deps: i
779
+ }) {
780
+ const n = fe(Ft), { t: r, setItem: u, queryItems: E } = i, { line: T, value: p, item: g } = e, N = p.item.kind === "new" ? p.item.name : null, R = I(null), q = I(i.privacyMode), V = I(0), D = I(!1);
781
+ if (q.current !== i.privacyMode) {
782
+ q.current = i.privacyMode;
783
+ const y = R.current;
784
+ y !== null && y.contains(y.ownerDocument.activeElement) && (V.current += 1, D.current = !0);
785
+ }
786
+ cn(() => {
787
+ if (!D.current) return;
788
+ D.current = !1;
789
+ const y = () => {
790
+ var v, M;
791
+ return (M = (v = R.current) == null ? void 0 : v.querySelector('input[role="combobox"]')) == null ? void 0 : M.focus();
792
+ };
793
+ y(), queueMicrotask(y);
794
+ }, [i.privacyMode]);
795
+ const B = b(() => N !== null ? [
796
+ {
797
+ value: le,
798
+ label: We(N, i),
799
+ description: r(
800
+ "billLineTable.item.newOptionDescription",
801
+ "Created when you load the invoice"
802
+ )
803
+ },
804
+ ...n.itemOptions
805
+ ] : g && !n.itemOptionIds.has(g.id) ? [Qt(g), ...n.itemOptions] : n.itemOptions, [N, g, n.itemOptions, n.itemOptionIds, i, r]), j = b(
806
+ () => ({
807
+ label: r("billLineTable.item.createNew", "Create new item"),
808
+ icon: /* @__PURE__ */ o(kn, {}),
809
+ // Marks the line only; nothing is created before Confirm (D5). The
810
+ // typed text names the item; with none, the description does.
811
+ onSelect: (y) => u(T.id, {
812
+ kind: "new",
813
+ name: ri(y, i)
814
+ })
815
+ }),
816
+ [r, u, T.id, i]
817
+ );
818
+ return /* @__PURE__ */ o("div", { ref: R, className: zn(), children: /* @__PURE__ */ o(
819
+ hn,
820
+ {
821
+ "aria-labelledby": t.labelledBy,
822
+ "aria-invalid": t.invalid || void 0,
823
+ "aria-describedby": t.errorId,
824
+ options: B,
825
+ value: p.item.kind === "existing" ? p.item.itemId : le,
826
+ onValueChange: (y) => {
827
+ y === "" || y === le || u(T.id, { kind: "existing", itemId: y });
828
+ },
829
+ placeholder: r("billLineTable.item.placeholder", "Choose an item"),
830
+ openOnFocus: !1,
831
+ popoverSize: "md",
832
+ wrapOptionLabels: !0,
833
+ action: j,
834
+ onQueryChange: n.serverSearch ? (y) => E(T.id, y) : void 0,
835
+ filter: n.serverSearch ? ai : void 0,
836
+ loading: n.serverSearch ? n.searchingLineId === T.id && n.itemsLoading : void 0
837
+ },
838
+ V.current
839
+ ) });
840
+ }
841
+ function si({ deps: e }) {
842
+ const t = fe(pe);
843
+ if (!t) return null;
844
+ const i = t.lineCount - t.alreadyLoadedCount;
845
+ return /* @__PURE__ */ O("span", { className: Mt(), children: [
846
+ /* @__PURE__ */ o("span", { children: e.t("billLineTable.footer.ticked", {
847
+ count: i,
848
+ selected: K(t.selectedCount, e.language),
849
+ total: K(i, e.language),
850
+ defaultValue: "{{selected}} of {{total}} lines ticked",
851
+ defaultValue_one: "{{selected}} of {{total}} line ticked",
852
+ defaultValue_other: "{{selected}} of {{total}} lines ticked"
853
+ }) }),
854
+ t.newItemCount > 0 ? /* @__PURE__ */ o("span", { className: Pt(), children: e.t("billLineTable.footer.newItems", {
855
+ count: t.newItemCount,
856
+ countText: K(t.newItemCount, e.language),
857
+ defaultValue: "{{countText}} new items",
858
+ defaultValue_one: "{{countText}} new item",
859
+ defaultValue_other: "{{countText}} new items"
860
+ }) }) : null
861
+ ] });
862
+ }
863
+ function ci({ currency: e }) {
864
+ const t = fe(pe);
865
+ return t ? /* @__PURE__ */ o(ne, { value: t.vat, currency: e, fractionDigits: 2 }) : null;
866
+ }
867
+ function ui({ deps: e }) {
868
+ const t = fe(pe);
869
+ return t ? /* @__PURE__ */ O("dl", { className: Gn(), children: [
870
+ /* @__PURE__ */ o("dt", { className: gt(), children: e.t("billLineTable.footer.net", "Net") }),
871
+ /* @__PURE__ */ o("dd", { className: vt(), children: /* @__PURE__ */ o(
872
+ ne,
873
+ {
874
+ value: t.net,
875
+ currency: e.currency,
876
+ fractionDigits: 2
877
+ }
878
+ ) }),
879
+ /* @__PURE__ */ o("dt", { className: gt(), children: e.t("billLineTable.footer.gross", "Total with VAT") }),
880
+ /* @__PURE__ */ o("dd", { className: vt(), children: /* @__PURE__ */ o(
881
+ ne,
882
+ {
883
+ value: t.gross,
884
+ currency: e.currency,
885
+ fractionDigits: 2
886
+ }
887
+ ) })
888
+ ] }) : null;
889
+ }
890
+ function di({ deps: e }) {
891
+ const t = fe(pe);
892
+ return !t || t.warningLineCount === 0 ? null : /* @__PURE__ */ o("span", { children: e.t("billLineTable.footer.warningLines", {
893
+ count: t.warningLineCount,
894
+ countText: K(t.warningLineCount, e.language),
895
+ defaultValue: "{{countText}} lines with warnings",
896
+ defaultValue_one: "{{countText}} line with warnings",
897
+ defaultValue_other: "{{countText}} lines with warnings"
898
+ }) });
899
+ }
900
+ function mi(e) {
901
+ const { t } = e, i = {
902
+ kind: "number",
903
+ mode: "decimal",
904
+ // The float lives only inside NumberInput: every change goes back to
905
+ // exact text at once, within BILL_LINE_MAX_QUANTITY. Unsigned in the
906
+ // field and in the value: the document carries the sign (D6).
907
+ // A typed value above the limit stays in the field with its error
908
+ // (`quantityError`); an invoiced one is locked by `isEditable`.
909
+ getValue: (n) => {
910
+ const r = A(n.value.quantity).value;
911
+ return r ? Se(r) : null;
912
+ },
913
+ onChange: (n, r) => e.setQuantity(
914
+ n.line.id,
915
+ r === null ? null : On(r)
916
+ ),
917
+ // A quantity the editor cannot hold exactly stays text, never clamped.
918
+ isEditable: (n) => !n.readOnly && !n.quantityLocked,
919
+ min: 0,
920
+ max: ye,
921
+ step: 1,
922
+ maximumFractionDigits: ae,
923
+ // DG-1: FatturaPA UnitaMisura per line, as the supplier wrote it.
924
+ unit: (n) => n.line.unitOfMeasure ?? void 0,
925
+ error: (n) => Zn(n, e),
926
+ // WCAG 3.3.2: the field says how many decimals it takes, since a digit
927
+ // past the limit is refused as it is typed. Kit copy and a constant
928
+ // only, so it shows in privacy mode too (`hostTextPrivacySafe`).
929
+ description: () => t(
930
+ "billLineTable.quantity.precision",
931
+ "Up to {{formatted}} decimal places",
932
+ {
933
+ count: ae,
934
+ formatted: K(
935
+ ae,
936
+ e.language
937
+ )
938
+ }
939
+ )
940
+ };
941
+ return [
942
+ {
943
+ id: "description",
944
+ header: t("billLineTable.column.description", "Description"),
945
+ rowHeader: !0,
946
+ pin: "start",
947
+ wrap: !0,
948
+ // Lab invoices can name a patient here (D9).
949
+ privacy: "mask",
950
+ cell: (n) => /* @__PURE__ */ o("span", { dir: "auto", children: n.line.description }),
951
+ value: (n) => n.line.description,
952
+ // No sorting in any mode (D10); privacy mode would turn it off anyway.
953
+ sort: !1,
954
+ size: 256,
955
+ minSize: 192,
956
+ hideable: !1,
957
+ reorderable: !1,
958
+ // The totals row's header cell.
959
+ footer: () => /* @__PURE__ */ o(si, { deps: e })
960
+ },
961
+ {
962
+ id: "quantity",
963
+ header: e.documentKind === "creditNote" ? t("billLineTable.column.quantityCreditNote", "Quantity to remove") : t("billLineTable.column.quantity", "Quantity"),
964
+ align: "end",
965
+ // Read-only lines (a loaded invoice, the table while loading, or a
966
+ // locked quantity): the unsigned value as text, plus the unit.
967
+ cell: (n) => Jn(n, e.language),
968
+ exportValue: (n) => n.value.quantity,
969
+ edit: i,
970
+ size: 128,
971
+ hideable: !1,
972
+ reorderable: !1
973
+ },
974
+ {
975
+ id: "item",
976
+ header: t("billLineTable.column.item", "Warehouse item"),
977
+ cell: (n) => /* @__PURE__ */ o("span", { dir: "auto", children: It(n, e) }),
978
+ exportValue: (n) => It(n, e) || null,
979
+ edit: {
980
+ kind: "custom",
981
+ render: (n, r) => /* @__PURE__ */ o(oi, { row: n, context: r, deps: e }),
982
+ error: (n) => ei(n, t)
983
+ },
984
+ size: 256,
985
+ minSize: 192,
986
+ hideable: !1,
987
+ reorderable: !1
988
+ },
989
+ {
990
+ id: "match",
991
+ header: t("billLineTable.column.match", "Status"),
992
+ cell: (n) => {
993
+ const r = Xn[n.matchState];
994
+ return /* @__PURE__ */ o(
995
+ Ln,
996
+ {
997
+ size: "sm",
998
+ variant: r.variant,
999
+ leading: r.check ? /* @__PURE__ */ o(Nn, {}) : void 0,
1000
+ children: bt(n.matchState, t)
1001
+ }
1002
+ );
1003
+ },
1004
+ exportValue: (n) => bt(n.matchState, t),
1005
+ size: 136,
1006
+ hideable: !1,
1007
+ reorderable: !1
1008
+ },
1009
+ {
1010
+ id: "warnings",
1011
+ header: t("billLineTable.column.warnings", "Warnings"),
1012
+ wrap: !0,
1013
+ // Not masked: a warning must not quote the description
1014
+ // (BillLineWarning.message), so errors stay readable (D9).
1015
+ cell: (n) => li(n, e),
1016
+ exportValue: (n) => n.line.warnings.map((r) => r.message).join("; ") || null,
1017
+ size: 224,
1018
+ hideable: !1,
1019
+ reorderable: !1,
1020
+ footer: () => /* @__PURE__ */ o(di, { deps: e })
1021
+ },
1022
+ {
1023
+ id: "lineTotal",
1024
+ header: t("billLineTable.column.lineTotal", "Amount"),
1025
+ align: "end",
1026
+ cell: (n) => /* @__PURE__ */ o(ne, { value: n.line.lineTotal, currency: e.currency }),
1027
+ exportValue: (n) => n.line.lineTotal,
1028
+ size: 128,
1029
+ hideable: !1,
1030
+ reorderable: !1,
1031
+ // From the summary (exact decimals, ticked lines), not from the
1032
+ // footer context's rows.
1033
+ footer: () => /* @__PURE__ */ o(ui, { deps: e })
1034
+ },
1035
+ {
1036
+ id: "unitPrice",
1037
+ header: t("billLineTable.column.unitPrice", "Unit price"),
1038
+ align: "end",
1039
+ cell: (n) => ti(n, e),
1040
+ exportValue: (n) => n.line.unitPrice,
1041
+ size: 128,
1042
+ hideable: !1,
1043
+ reorderable: !1
1044
+ },
1045
+ {
1046
+ id: "vat",
1047
+ header: t("billLineTable.column.vat", "VAT"),
1048
+ align: "end",
1049
+ cell: (n) => ii(n, e),
1050
+ exportValue: (n) => n.line.vatPercent,
1051
+ size: 88,
1052
+ hideable: !1,
1053
+ reorderable: !1,
1054
+ // VAT of the ticked lines, under the VAT header.
1055
+ footer: () => /* @__PURE__ */ o(ci, { currency: e.currency })
1056
+ },
1057
+ {
1058
+ id: "adjustment",
1059
+ header: t("billLineTable.column.adjustment", "Discount or surcharge"),
1060
+ align: "end",
1061
+ cell: (n) => ni(n, e),
1062
+ exportValue: (n) => n.line.adjustments.map(
1063
+ (r) => `${r.type === "discount" ? "-" : "+"}${r.percent !== null ? `${r.percent}%` : r.amount ?? ""}`
1064
+ ).join(", ") || null,
1065
+ size: 112,
1066
+ hideable: !1,
1067
+ reorderable: !1
1068
+ },
1069
+ {
1070
+ id: "supplierCode",
1071
+ header: t("billLineTable.column.supplierCode", "Supplier code"),
1072
+ cell: (n) => n.line.supplierCode === null ? null : /* @__PURE__ */ o("span", { dir: "ltr", className: qe(), children: n.line.supplierCode }),
1073
+ exportValue: (n) => n.line.supplierCode,
1074
+ size: 112,
1075
+ hideable: !1,
1076
+ reorderable: !1
1077
+ }
1078
+ ];
1079
+ }
1080
+ function fi(e) {
1081
+ return e.map(Qt);
1082
+ }
1083
+ const Tt = {};
1084
+ function ee(e, t) {
1085
+ return new Error(`${e}: ${t}`);
1086
+ }
1087
+ function yi(e, t) {
1088
+ return e.length === t.length && e.every((i, n) => i === t[n]);
1089
+ }
1090
+ function pi(e) {
1091
+ return JSON.stringify(e);
1092
+ }
1093
+ const Li = un(function({
1094
+ lines: t,
1095
+ items: i,
1096
+ selectedItems: n,
1097
+ documentKind: r = "invoice",
1098
+ currency: u = "EUR",
1099
+ gridId: E,
1100
+ caption: T,
1101
+ values: p,
1102
+ defaultValues: g,
1103
+ onValuesChange: N,
1104
+ selection: R,
1105
+ defaultSelection: q,
1106
+ onSelectionChange: V,
1107
+ onSummaryChange: D,
1108
+ onItemQueryChange: B,
1109
+ itemsLoading: j = !1,
1110
+ status: y = "ready",
1111
+ error: v,
1112
+ readOnly: M = !1,
1113
+ privacyMode: G = !1,
1114
+ height: Le = "fill",
1115
+ className: m,
1116
+ ...H
1117
+ }, F) {
1118
+ const { t: f, i18n: he } = mn("ui"), X = he.language, Oe = I(null), ge = M !== !1, Yt = I(/* @__PURE__ */ new Map()), ie = b(() => {
1119
+ const a = Yt.current;
1120
+ for (const c of n ?? []) a.set(c.id, c);
1121
+ for (const c of i) a.set(c.id, c);
1122
+ return new Map(a);
1123
+ }, [i, n]);
1124
+ Pe(() => {
1125
+ pn() && i.some((a) => a.id === le) && console.warn(
1126
+ `[BillLineTable] an item id equals "${le}", the value of the new-item option, so that item cannot be chosen.`
1127
+ );
1128
+ }, [i]);
1129
+ const je = b(() => fi(i), [i]), Ge = b(
1130
+ () => new Set(i.map((a) => a.id)),
1131
+ [i]
1132
+ ), [He, $t] = Te(null), Xe = B !== void 0, zt = b(
1133
+ () => ({
1134
+ itemOptions: je,
1135
+ itemOptionIds: Ge,
1136
+ serverSearch: Xe,
1137
+ itemsLoading: j,
1138
+ searchingLineId: He
1139
+ }),
1140
+ [je, Ge, Xe, j, He]
1141
+ ), Je = p !== void 0, [Wt, jt] = Te(
1142
+ () => g ?? Tt
1143
+ ), x = p ?? Wt, Ae = R !== void 0, [Re, Ze] = Te(
1144
+ () => q ?? Ke(t)
1145
+ ), [et, Gt] = Te(t);
1146
+ if (et !== t && (Gt(t), !Ae && q === void 0)) {
1147
+ const a = new Set(et.map((d) => d.id)), c = Ke(t).filter(
1148
+ (d) => !a.has(d) && !Re.includes(d)
1149
+ );
1150
+ c.length > 0 && Ze([...Re, ...c]);
1151
+ }
1152
+ const S = R ?? Re, U = I(x);
1153
+ U.current = x;
1154
+ const Q = I(S);
1155
+ Q.current = S;
1156
+ const tt = I(null), nt = I(null), ve = b(
1157
+ () => ({
1158
+ values: g ?? Tt,
1159
+ selection: q ?? Ke(t)
1160
+ }),
1161
+ [g, q, t]
1162
+ ), it = I(/* @__PURE__ */ new Map()), Ve = b(() => {
1163
+ const a = Lt({
1164
+ lines: t,
1165
+ values: x,
1166
+ selection: S,
1167
+ findItem: (c) => ie.get(c),
1168
+ previous: it.current
1169
+ });
1170
+ return it.current = new Map(a.map((c) => [c.line.id, c])), a;
1171
+ }, [t, x, S, ie]), Ht = b(
1172
+ () => Ve.filter((a) => a.selected).map((a) => a.line.id),
1173
+ [Ve]
1174
+ ), rt = k(
1175
+ (a) => ie.has(a),
1176
+ [ie]
1177
+ ), ce = b(
1178
+ () => pt(
1179
+ t,
1180
+ x,
1181
+ S,
1182
+ ve,
1183
+ rt
1184
+ ),
1185
+ [t, x, S, ve, rt]
1186
+ ), at = b(
1187
+ () => new Map(t.map((a) => [a.id, a])),
1188
+ [t]
1189
+ ), L = I({
1190
+ lines: t,
1191
+ lineById: at,
1192
+ itemIndex: ie,
1193
+ defaults: ve,
1194
+ documentKind: r,
1195
+ tableReadOnly: ge,
1196
+ valuesControlled: Je,
1197
+ selectionControlled: Ae
1198
+ });
1199
+ L.current = {
1200
+ lines: t,
1201
+ lineById: at,
1202
+ itemIndex: ie,
1203
+ defaults: ve,
1204
+ documentKind: r,
1205
+ tableReadOnly: ge,
1206
+ valuesControlled: Je,
1207
+ selectionControlled: Ae
1208
+ };
1209
+ const ue = I({
1210
+ onValuesChange: N,
1211
+ onSelectionChange: V,
1212
+ onSummaryChange: D,
1213
+ onItemQueryChange: B
1214
+ });
1215
+ ue.current = {
1216
+ onValuesChange: N,
1217
+ onSelectionChange: V,
1218
+ onSummaryChange: D,
1219
+ onItemQueryChange: B
1220
+ };
1221
+ const De = I(/* @__PURE__ */ new Set()), Y = k((a) => {
1222
+ for (const c of [...De.current]) c(a);
1223
+ }, []), J = k(
1224
+ (a, c, d, h) => {
1225
+ var Z, Ie;
1226
+ const C = L.current;
1227
+ if (!C.lineById.has(a)) return;
1228
+ const P = ft(C.lines, U.current), l = P[a], s = { ...l, ...d };
1229
+ if (Rt(l, s)) return;
1230
+ const w = {
1231
+ ...P,
1232
+ [a]: s
1233
+ };
1234
+ U.current = w, tt.current = w, C.valuesControlled || jt(w), (Ie = (Z = ue.current).onValuesChange) == null || Ie.call(Z, w, { lineId: a, field: c, source: h }), Y({ event: "values", source: h });
1235
+ },
1236
+ [Y]
1237
+ ), re = k(
1238
+ (a, c) => {
1239
+ var P, l;
1240
+ const d = L.current, h = $(d.lines, a), C = $(
1241
+ d.lines,
1242
+ Q.current
1243
+ );
1244
+ yi(h, C) || (Q.current = h, nt.current = h, d.selectionControlled || Ze(h), (l = (P = ue.current).onSelectionChange) == null || l.call(P, h), Y({ event: "selection", source: c }));
1245
+ },
1246
+ [Y]
1247
+ ), lt = k(
1248
+ (a, c) => J(a, "quantity", { quantity: c }, "user"),
1249
+ [J]
1250
+ ), ot = k(
1251
+ (a, c) => {
1252
+ const d = L.current.lineById.get(a);
1253
+ d && J(
1254
+ a,
1255
+ "item",
1256
+ { item: Qe(c, d) },
1257
+ "user"
1258
+ );
1259
+ },
1260
+ [J]
1261
+ ), st = k((a, c) => {
1262
+ var d, h;
1263
+ $t(a), (h = (d = ue.current).onItemQueryChange) == null || h.call(d, a, c);
1264
+ }, []), Xt = k(
1265
+ (a) => re(a, "user"),
1266
+ [re]
1267
+ ), ct = I(null);
1268
+ Pe(() => {
1269
+ var c, d;
1270
+ const a = pi(ce);
1271
+ a !== ct.current && (ct.current = a, (d = (c = ue.current).onSummaryChange) == null || d.call(c, ce));
1272
+ }, [ce]);
1273
+ const be = `${y}:${ge ? "readOnly" : "editable"}`, ut = I({
1274
+ lines: t,
1275
+ values: x,
1276
+ selection: S,
1277
+ status: be
1278
+ });
1279
+ Pe(() => {
1280
+ const a = ut.current;
1281
+ (a.lines !== t || a.values !== x && x !== tt.current) && Y({ event: "values", source: "host" }), a.selection !== S && S !== nt.current && Y({ event: "selection", source: "host" }), a.status !== be && Y({ event: "status", source: "host" }), ut.current = {
1282
+ lines: t,
1283
+ values: x,
1284
+ selection: S,
1285
+ status: be
1286
+ };
1287
+ }, [t, x, S, be, Y]);
1288
+ const Be = b(() => {
1289
+ const a = () => {
1290
+ const l = L.current;
1291
+ return Lt({
1292
+ lines: l.lines,
1293
+ values: U.current,
1294
+ selection: Q.current,
1295
+ findItem: (s) => l.itemIndex.get(s)
1296
+ });
1297
+ }, c = (l) => Qn(l, {
1298
+ tableReadOnly: L.current.tableReadOnly,
1299
+ documentKind: L.current.documentKind
1300
+ }), d = (l) => L.current.itemIndex.has(l), h = (l) => {
1301
+ const s = L.current.lineById.get(l);
1302
+ if (!s) throw ee("UNKNOWN_LINE", `no line "${l}".`);
1303
+ return s;
1304
+ }, C = () => {
1305
+ if (L.current.tableReadOnly)
1306
+ throw ee(
1307
+ "TABLE_READ_ONLY",
1308
+ "the table is read-only while the load request runs."
1309
+ );
1310
+ }, P = (l) => {
1311
+ if (te(L.current.lines))
1312
+ throw ee(
1313
+ "LINE_READ_ONLY",
1314
+ `line "${l}" belongs to an invoice that is already loaded.`
1315
+ );
1316
+ };
1317
+ return {
1318
+ getLineIds: () => L.current.lines.map((l) => l.id),
1319
+ getLine: (l) => {
1320
+ const s = L.current, w = s.lineById.get(l);
1321
+ if (!w) return null;
1322
+ const Z = Bt(
1323
+ w,
1324
+ U.current[l] ?? z(w),
1325
+ {
1326
+ invoiceLoaded: te(s.lines),
1327
+ ticked: new Set(
1328
+ $(s.lines, Q.current)
1329
+ ),
1330
+ findItem: (Ie) => s.itemIndex.get(Ie)
1331
+ }
1332
+ );
1333
+ return c(Z);
1334
+ },
1335
+ getLines: () => a().map(c),
1336
+ getSelection: () => $(L.current.lines, Q.current),
1337
+ getValues: () => ft(L.current.lines, U.current),
1338
+ getSummary: () => {
1339
+ const l = L.current;
1340
+ return pt(
1341
+ l.lines,
1342
+ U.current,
1343
+ Q.current,
1344
+ l.defaults,
1345
+ d
1346
+ );
1347
+ },
1348
+ getInvalidLineIds: () => a().filter((l) => l.invalid).map((l) => l.line.id),
1349
+ getLoadPayload: () => {
1350
+ const l = L.current;
1351
+ return Kn(
1352
+ l.lines,
1353
+ U.current,
1354
+ Q.current,
1355
+ l.documentKind,
1356
+ d
1357
+ );
1358
+ },
1359
+ setSelection: (l) => {
1360
+ for (const s of l) h(s);
1361
+ C();
1362
+ for (const s of l) {
1363
+ if (h(s).alreadyLoaded)
1364
+ throw ee(
1365
+ "LINE_READ_ONLY",
1366
+ `line "${s}" is already loaded.`
1367
+ );
1368
+ P(s);
1369
+ }
1370
+ re(l, "api");
1371
+ },
1372
+ selectAll: () => {
1373
+ C(), re(
1374
+ L.current.lines.map((l) => l.id),
1375
+ "api"
1376
+ );
1377
+ },
1378
+ clearSelection: () => {
1379
+ C(), re([], "api");
1380
+ },
1381
+ setQuantity: (l, s) => {
1382
+ const w = h(l), Z = Yn(s);
1383
+ if (Z === null)
1384
+ throw ee(
1385
+ "INVALID_QUANTITY",
1386
+ `"${s}" is not a quantity above 0 and at most ${ye}, with at most ${ae} decimal places.`
1387
+ );
1388
+ if (C(), P(l), !$e(w.quantity))
1389
+ throw ee(
1390
+ "LINE_READ_ONLY",
1391
+ `line "${l}" has a quantity too large to edit; it loads as invoiced.`
1392
+ );
1393
+ J(l, "quantity", { quantity: Z }, "api");
1394
+ },
1395
+ setItem: (l, s) => {
1396
+ const w = h(l);
1397
+ if (s.kind === "existing" && (s.itemId === le || !d(s.itemId)))
1398
+ throw ee("UNKNOWN_ITEM", `no item "${s.itemId}".`);
1399
+ C(), P(l), J(
1400
+ l,
1401
+ "item",
1402
+ { item: Qe(s, w) },
1403
+ "api"
1404
+ );
1405
+ },
1406
+ focusLine: (l, s = "select") => {
1407
+ var w;
1408
+ h(l), (w = Oe.current) == null || w.focusRow(
1409
+ l,
1410
+ s === "select" ? void 0 : s
1411
+ );
1412
+ },
1413
+ scrollToLine: (l) => {
1414
+ var s;
1415
+ h(l), (s = Oe.current) == null || s.scrollToRow(l);
1416
+ },
1417
+ subscribe: (l) => (De.current.add(l), () => {
1418
+ De.current.delete(l);
1419
+ })
1420
+ };
1421
+ }, [re, J]);
1422
+ dn(F, () => Be, [Be]), fn(Sn, Be, E);
1423
+ const Jt = b(
1424
+ () => mi({
1425
+ t: f,
1426
+ language: X,
1427
+ documentKind: r,
1428
+ currency: u,
1429
+ privacyMode: G,
1430
+ setQuantity: lt,
1431
+ setItem: ot,
1432
+ queryItems: st
1433
+ }),
1434
+ [
1435
+ f,
1436
+ X,
1437
+ r,
1438
+ u,
1439
+ G,
1440
+ lt,
1441
+ ot,
1442
+ st
1443
+ ]
1444
+ ), Zt = k((a) => a.line.id, []), en = k((a) => a.readOnly, []), tn = k(
1445
+ (a) => f("billLineTable.rowLabel", {
1446
+ number: K(a.line.lineNumber, X),
1447
+ defaultValue: "Line {{number}}"
1448
+ }),
1449
+ [f, X]
1450
+ ), nn = k(
1451
+ (a) => a.line.alreadyLoaded ? {
1452
+ state: "none",
1453
+ reason: f(
1454
+ "billLineTable.selection.alreadyLoadedReason",
1455
+ "Already loaded into the warehouse"
1456
+ )
1457
+ } : a.readOnly ? {
1458
+ state: "none",
1459
+ reason: f(
1460
+ "billLineTable.selection.invoiceLoadedReason",
1461
+ "This invoice was already loaded. Lines left out then cannot be loaded later."
1462
+ )
1463
+ } : "selectable",
1464
+ [f]
1465
+ ), rn = ce.invoiceLoaded, Me = ge ? typeof M == "object" && M.reason !== "" && !G ? M.reason : f(
1466
+ "billLineTable.selection.readOnlyReason",
1467
+ "Loading into the warehouse"
1468
+ ) : rn ? f(
1469
+ "billLineTable.selection.invoiceLoadedReason",
1470
+ "This invoice was already loaded. Lines left out then cannot be loaded later."
1471
+ ) : null, an = b(
1472
+ () => Me === null ? !1 : { reason: Me },
1473
+ [Me]
1474
+ ), ln = b(
1475
+ () => ({
1476
+ title: (v == null ? void 0 : v.title) ?? f("billLineTable.error.title", "The invoice lines could not be read"),
1477
+ description: (v == null ? void 0 : v.description) ?? f(
1478
+ "billLineTable.error.description",
1479
+ "Try again. If it keeps failing, open the invoice to check it."
1480
+ ),
1481
+ onRetry: v == null ? void 0 : v.onRetry
1482
+ }),
1483
+ [v, f]
1484
+ ), on = b(
1485
+ () => ({
1486
+ title: f(
1487
+ "billLineTable.empty.title",
1488
+ "This invoice has no lines to load"
1489
+ ),
1490
+ description: f(
1491
+ "billLineTable.empty.description",
1492
+ "Open the invoice to check what the supplier sent."
1493
+ )
1494
+ }),
1495
+ [f]
1496
+ ), sn = T ?? (r === "creditNote" ? f("billLineTable.captionCreditNote", "Credit note lines") : f("billLineTable.caption", "Invoice lines"));
1497
+ return /* @__PURE__ */ o(
1498
+ "div",
1499
+ {
1500
+ ...H,
1501
+ "data-component": "bill-line-table",
1502
+ "data-component-id": E,
1503
+ className: $n({ height: Le, className: m }),
1504
+ children: /* @__PURE__ */ o(Ft.Provider, { value: zt, children: /* @__PURE__ */ o(pe.Provider, { value: ce, children: /* @__PURE__ */ o(
1505
+ yn,
1506
+ {
1507
+ ref: Oe,
1508
+ caption: sn,
1509
+ columns: Jt,
1510
+ rows: Ve,
1511
+ getRowId: Zt,
1512
+ registerAgent: !1,
1513
+ persistColumnState: !1,
1514
+ dataMode: "client",
1515
+ selectionMode: "multiple",
1516
+ rowSelection: Ht,
1517
+ onRowSelectionChange: Xt,
1518
+ getRowSelectability: nn,
1519
+ selectAllScope: "all",
1520
+ rangeSelection: !0,
1521
+ isRowReadOnly: en,
1522
+ readOnly: an,
1523
+ getRowLabel: tn,
1524
+ rowLabelPrivacySafe: !0,
1525
+ hostTextPrivacySafe: !0,
1526
+ multiSort: !1,
1527
+ columnResizing: !1,
1528
+ responsiveColumns: !1,
1529
+ status: y,
1530
+ error: ln,
1531
+ empty: on,
1532
+ density: "default",
1533
+ height: Le,
1534
+ virtualization: "auto",
1535
+ privacyMode: G
1536
+ }
1537
+ ) }) })
1538
+ }
1539
+ );
1540
+ });
1541
+ Li.displayName = "BillLineTable";
1542
+ export {
1543
+ mt as B,
1544
+ ye as a,
1545
+ le as b,
1546
+ Cn as c,
1547
+ _t as d,
1548
+ ae as e,
1549
+ Et as f,
1550
+ Li as g,
1551
+ Sn as h,
1552
+ Kn as i,
1553
+ Mn as j,
1554
+ Ke as k,
1555
+ z as l,
1556
+ Vi as m,
1557
+ te as n,
1558
+ ze as o,
1559
+ $e as p,
1560
+ An as q,
1561
+ pt as s
1562
+ };
1563
+ //# sourceMappingURL=bill-line-table-WEIRDcv6.js.map