@forgeroute/ui 0.5.16 → 0.5.18

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 (345) hide show
  1. package/fesm2022/forgeroute-ui-action-bar.mjs +190 -0
  2. package/fesm2022/forgeroute-ui-action-bar.mjs.map +1 -0
  3. package/fesm2022/forgeroute-ui-address-input.mjs +1164 -0
  4. package/fesm2022/forgeroute-ui-address-input.mjs.map +1 -0
  5. package/fesm2022/forgeroute-ui-alert.mjs +223 -0
  6. package/fesm2022/forgeroute-ui-alert.mjs.map +1 -0
  7. package/fesm2022/forgeroute-ui-avatar.mjs +320 -0
  8. package/fesm2022/forgeroute-ui-avatar.mjs.map +1 -0
  9. package/fesm2022/forgeroute-ui-badge.mjs +158 -0
  10. package/fesm2022/forgeroute-ui-badge.mjs.map +1 -0
  11. package/fesm2022/forgeroute-ui-bar-row.mjs +255 -0
  12. package/fesm2022/forgeroute-ui-bar-row.mjs.map +1 -0
  13. package/fesm2022/forgeroute-ui-boards.mjs +2201 -0
  14. package/fesm2022/forgeroute-ui-boards.mjs.map +1 -0
  15. package/fesm2022/forgeroute-ui-bulk-eligible.mjs +172 -0
  16. package/fesm2022/forgeroute-ui-bulk-eligible.mjs.map +1 -0
  17. package/fesm2022/forgeroute-ui-business-hours.mjs +771 -0
  18. package/fesm2022/forgeroute-ui-business-hours.mjs.map +1 -0
  19. package/fesm2022/forgeroute-ui-calendar.mjs +2006 -0
  20. package/fesm2022/forgeroute-ui-calendar.mjs.map +1 -0
  21. package/fesm2022/forgeroute-ui-card-list-item.mjs +556 -0
  22. package/fesm2022/forgeroute-ui-card-list-item.mjs.map +1 -0
  23. package/fesm2022/forgeroute-ui-charts.mjs +1 -1
  24. package/fesm2022/forgeroute-ui-charts.mjs.map +1 -1
  25. package/fesm2022/forgeroute-ui-checkbox.mjs +815 -0
  26. package/fesm2022/forgeroute-ui-checkbox.mjs.map +1 -0
  27. package/fesm2022/forgeroute-ui-chip.mjs +379 -0
  28. package/fesm2022/forgeroute-ui-chip.mjs.map +1 -0
  29. package/fesm2022/forgeroute-ui-color-input.mjs +492 -0
  30. package/fesm2022/forgeroute-ui-color-input.mjs.map +1 -0
  31. package/fesm2022/forgeroute-ui-column-filter.mjs +645 -0
  32. package/fesm2022/forgeroute-ui-column-filter.mjs.map +1 -0
  33. package/fesm2022/forgeroute-ui-columns.mjs +351 -0
  34. package/fesm2022/forgeroute-ui-columns.mjs.map +1 -0
  35. package/fesm2022/forgeroute-ui-combobox.mjs +772 -0
  36. package/fesm2022/forgeroute-ui-combobox.mjs.map +1 -0
  37. package/fesm2022/forgeroute-ui-confirm.mjs +48 -0
  38. package/fesm2022/forgeroute-ui-confirm.mjs.map +1 -0
  39. package/fesm2022/forgeroute-ui-contact-picker.mjs +865 -0
  40. package/fesm2022/forgeroute-ui-contact-picker.mjs.map +1 -0
  41. package/fesm2022/forgeroute-ui-conversations.mjs +3627 -0
  42. package/fesm2022/forgeroute-ui-conversations.mjs.map +1 -0
  43. package/fesm2022/forgeroute-ui-copy-field.mjs +378 -0
  44. package/fesm2022/forgeroute-ui-copy-field.mjs.map +1 -0
  45. package/fesm2022/{forgeroute-ui-core-ui-labels.es-Dzj_XJJM.mjs → forgeroute-ui-core-ui-labels.es-Woi3az70.mjs} +186 -2
  46. package/fesm2022/{forgeroute-ui-core-ui-labels.es-Dzj_XJJM.mjs.map → forgeroute-ui-core-ui-labels.es-Woi3az70.mjs.map} +1 -1
  47. package/fesm2022/forgeroute-ui-core.mjs +186 -2
  48. package/fesm2022/forgeroute-ui-core.mjs.map +1 -1
  49. package/fesm2022/forgeroute-ui-data-table-core.mjs +6150 -0
  50. package/fesm2022/forgeroute-ui-data-table-core.mjs.map +1 -0
  51. package/fesm2022/forgeroute-ui-date-input.mjs +384 -0
  52. package/fesm2022/forgeroute-ui-date-input.mjs.map +1 -0
  53. package/fesm2022/forgeroute-ui-date-range-picker.mjs +453 -0
  54. package/fesm2022/forgeroute-ui-date-range-picker.mjs.map +1 -0
  55. package/fesm2022/forgeroute-ui-datetime-input.mjs +375 -0
  56. package/fesm2022/forgeroute-ui-datetime-input.mjs.map +1 -0
  57. package/fesm2022/forgeroute-ui-detail-card.mjs +655 -0
  58. package/fesm2022/forgeroute-ui-detail-card.mjs.map +1 -0
  59. package/fesm2022/forgeroute-ui-discount-selector.mjs +259 -0
  60. package/fesm2022/forgeroute-ui-discount-selector.mjs.map +1 -0
  61. package/fesm2022/forgeroute-ui-divider.mjs +111 -0
  62. package/fesm2022/forgeroute-ui-divider.mjs.map +1 -0
  63. package/fesm2022/forgeroute-ui-dropdown.mjs +550 -0
  64. package/fesm2022/forgeroute-ui-dropdown.mjs.map +1 -0
  65. package/fesm2022/forgeroute-ui-editor.mjs +4545 -0
  66. package/fesm2022/forgeroute-ui-editor.mjs.map +1 -0
  67. package/fesm2022/forgeroute-ui-empty-state.mjs +231 -0
  68. package/fesm2022/forgeroute-ui-empty-state.mjs.map +1 -0
  69. package/fesm2022/forgeroute-ui-error-state.mjs +195 -0
  70. package/fesm2022/forgeroute-ui-error-state.mjs.map +1 -0
  71. package/fesm2022/forgeroute-ui-error.mjs +93 -0
  72. package/fesm2022/forgeroute-ui-error.mjs.map +1 -0
  73. package/fesm2022/forgeroute-ui-fade.mjs +117 -0
  74. package/fesm2022/forgeroute-ui-fade.mjs.map +1 -0
  75. package/fesm2022/forgeroute-ui-file-input.mjs +999 -0
  76. package/fesm2022/forgeroute-ui-file-input.mjs.map +1 -0
  77. package/fesm2022/forgeroute-ui-fixed-footer.mjs +115 -0
  78. package/fesm2022/forgeroute-ui-fixed-footer.mjs.map +1 -0
  79. package/fesm2022/forgeroute-ui-form-row.mjs +126 -0
  80. package/fesm2022/forgeroute-ui-form-row.mjs.map +1 -0
  81. package/fesm2022/forgeroute-ui-form-section.mjs +93 -0
  82. package/fesm2022/forgeroute-ui-form-section.mjs.map +1 -0
  83. package/fesm2022/forgeroute-ui-form.mjs +139 -0
  84. package/fesm2022/forgeroute-ui-form.mjs.map +1 -0
  85. package/fesm2022/forgeroute-ui-hint.mjs +47 -0
  86. package/fesm2022/forgeroute-ui-hint.mjs.map +1 -0
  87. package/fesm2022/forgeroute-ui-icon-picker.mjs +424 -0
  88. package/fesm2022/forgeroute-ui-icon-picker.mjs.map +1 -0
  89. package/fesm2022/forgeroute-ui-icon.mjs +311 -0
  90. package/fesm2022/forgeroute-ui-icon.mjs.map +1 -0
  91. package/fesm2022/forgeroute-ui-image-preview.mjs +237 -0
  92. package/fesm2022/forgeroute-ui-image-preview.mjs.map +1 -0
  93. package/fesm2022/forgeroute-ui-keypad.mjs +278 -0
  94. package/fesm2022/forgeroute-ui-keypad.mjs.map +1 -0
  95. package/fesm2022/forgeroute-ui-kpi-card.mjs +490 -0
  96. package/fesm2022/forgeroute-ui-kpi-card.mjs.map +1 -0
  97. package/fesm2022/forgeroute-ui-language-switcher.mjs +134 -0
  98. package/fesm2022/forgeroute-ui-language-switcher.mjs.map +1 -0
  99. package/fesm2022/forgeroute-ui-layout.mjs +18 -0
  100. package/fesm2022/forgeroute-ui-layout.mjs.map +1 -0
  101. package/fesm2022/forgeroute-ui-list-item.mjs +620 -0
  102. package/fesm2022/forgeroute-ui-list-item.mjs.map +1 -0
  103. package/fesm2022/forgeroute-ui-list.mjs +866 -0
  104. package/fesm2022/forgeroute-ui-list.mjs.map +1 -0
  105. package/fesm2022/forgeroute-ui-live-region.mjs +118 -0
  106. package/fesm2022/forgeroute-ui-live-region.mjs.map +1 -0
  107. package/fesm2022/forgeroute-ui-map.mjs +5 -1
  108. package/fesm2022/forgeroute-ui-map.mjs.map +1 -1
  109. package/fesm2022/forgeroute-ui-maps.mjs +2 -1
  110. package/fesm2022/forgeroute-ui-maps.mjs.map +1 -1
  111. package/fesm2022/forgeroute-ui-media.mjs +4615 -0
  112. package/fesm2022/forgeroute-ui-media.mjs.map +1 -0
  113. package/fesm2022/forgeroute-ui-messaging.mjs +20 -1
  114. package/fesm2022/forgeroute-ui-messaging.mjs.map +1 -1
  115. package/fesm2022/forgeroute-ui-more-menu.mjs +418 -0
  116. package/fesm2022/forgeroute-ui-more-menu.mjs.map +1 -0
  117. package/fesm2022/forgeroute-ui-multi-select.mjs +532 -0
  118. package/fesm2022/forgeroute-ui-multi-select.mjs.map +1 -0
  119. package/fesm2022/forgeroute-ui-notes.mjs +768 -0
  120. package/fesm2022/forgeroute-ui-notes.mjs.map +1 -0
  121. package/fesm2022/forgeroute-ui-notification-bell.mjs +587 -0
  122. package/fesm2022/forgeroute-ui-notification-bell.mjs.map +1 -0
  123. package/fesm2022/forgeroute-ui-offline-banner.mjs +156 -0
  124. package/fesm2022/forgeroute-ui-offline-banner.mjs.map +1 -0
  125. package/fesm2022/forgeroute-ui-option-card.mjs +379 -0
  126. package/fesm2022/forgeroute-ui-option-card.mjs.map +1 -0
  127. package/fesm2022/forgeroute-ui-page.mjs +317 -0
  128. package/fesm2022/forgeroute-ui-page.mjs.map +1 -0
  129. package/fesm2022/forgeroute-ui-pagination.mjs +225 -0
  130. package/fesm2022/forgeroute-ui-pagination.mjs.map +1 -0
  131. package/fesm2022/forgeroute-ui-panel-info-list.mjs +422 -0
  132. package/fesm2022/forgeroute-ui-panel-info-list.mjs.map +1 -0
  133. package/fesm2022/forgeroute-ui-password-requirements.mjs +237 -0
  134. package/fesm2022/forgeroute-ui-password-requirements.mjs.map +1 -0
  135. package/fesm2022/forgeroute-ui-payments.mjs +6258 -0
  136. package/fesm2022/forgeroute-ui-payments.mjs.map +1 -0
  137. package/fesm2022/forgeroute-ui-pdf.mjs +9 -1
  138. package/fesm2022/forgeroute-ui-pdf.mjs.map +1 -1
  139. package/fesm2022/forgeroute-ui-phone-number-picker.mjs +840 -0
  140. package/fesm2022/forgeroute-ui-phone-number-picker.mjs.map +1 -0
  141. package/fesm2022/forgeroute-ui-pill-tabs.mjs +546 -0
  142. package/fesm2022/forgeroute-ui-pill-tabs.mjs.map +1 -0
  143. package/fesm2022/forgeroute-ui-print.mjs +76 -0
  144. package/fesm2022/forgeroute-ui-print.mjs.map +1 -0
  145. package/fesm2022/forgeroute-ui-progress-bar.mjs +252 -0
  146. package/fesm2022/forgeroute-ui-progress-bar.mjs.map +1 -0
  147. package/fesm2022/forgeroute-ui-progress-ring.mjs +277 -0
  148. package/fesm2022/forgeroute-ui-progress-ring.mjs.map +1 -0
  149. package/fesm2022/forgeroute-ui-quick-filter-tabs.mjs +301 -0
  150. package/fesm2022/forgeroute-ui-quick-filter-tabs.mjs.map +1 -0
  151. package/fesm2022/forgeroute-ui-quickbooks.mjs +18 -1
  152. package/fesm2022/forgeroute-ui-quickbooks.mjs.map +1 -1
  153. package/fesm2022/forgeroute-ui-radio-matrix.mjs +471 -0
  154. package/fesm2022/forgeroute-ui-radio-matrix.mjs.map +1 -0
  155. package/fesm2022/forgeroute-ui-radio.mjs +911 -0
  156. package/fesm2022/forgeroute-ui-radio.mjs.map +1 -0
  157. package/fesm2022/forgeroute-ui-read-only-mode.mjs +15 -0
  158. package/fesm2022/forgeroute-ui-read-only-mode.mjs.map +1 -0
  159. package/fesm2022/forgeroute-ui-readonly-fieldset.mjs +146 -0
  160. package/fesm2022/forgeroute-ui-readonly-fieldset.mjs.map +1 -0
  161. package/fesm2022/forgeroute-ui-reminder-alerts.mjs +249 -0
  162. package/fesm2022/forgeroute-ui-reminder-alerts.mjs.map +1 -0
  163. package/fesm2022/forgeroute-ui-search-input.mjs +373 -0
  164. package/fesm2022/forgeroute-ui-search-input.mjs.map +1 -0
  165. package/fesm2022/forgeroute-ui-section-header.mjs +296 -0
  166. package/fesm2022/forgeroute-ui-section-header.mjs.map +1 -0
  167. package/fesm2022/forgeroute-ui-select.mjs +498 -0
  168. package/fesm2022/forgeroute-ui-select.mjs.map +1 -0
  169. package/fesm2022/forgeroute-ui-setup.mjs +4649 -0
  170. package/fesm2022/forgeroute-ui-setup.mjs.map +1 -0
  171. package/fesm2022/forgeroute-ui-share-menu.mjs +461 -0
  172. package/fesm2022/forgeroute-ui-share-menu.mjs.map +1 -0
  173. package/fesm2022/forgeroute-ui-shell.mjs +981 -0
  174. package/fesm2022/forgeroute-ui-shell.mjs.map +1 -0
  175. package/fesm2022/forgeroute-ui-show.mjs +129 -0
  176. package/fesm2022/forgeroute-ui-show.mjs.map +1 -0
  177. package/fesm2022/forgeroute-ui-sidebar-layout.mjs +355 -0
  178. package/fesm2022/forgeroute-ui-sidebar-layout.mjs.map +1 -0
  179. package/fesm2022/forgeroute-ui-skeleton.mjs +152 -0
  180. package/fesm2022/forgeroute-ui-skeleton.mjs.map +1 -0
  181. package/fesm2022/forgeroute-ui-skip-link.mjs +129 -0
  182. package/fesm2022/forgeroute-ui-skip-link.mjs.map +1 -0
  183. package/fesm2022/forgeroute-ui-snackbar.mjs +200 -0
  184. package/fesm2022/forgeroute-ui-snackbar.mjs.map +1 -0
  185. package/fesm2022/forgeroute-ui-square.mjs +15 -1
  186. package/fesm2022/forgeroute-ui-square.mjs.map +1 -1
  187. package/fesm2022/forgeroute-ui-stack.mjs +233 -0
  188. package/fesm2022/forgeroute-ui-stack.mjs.map +1 -0
  189. package/fesm2022/forgeroute-ui-stacked-bar.mjs +200 -0
  190. package/fesm2022/forgeroute-ui-stacked-bar.mjs.map +1 -0
  191. package/fesm2022/forgeroute-ui-stacking-plan.mjs +365 -0
  192. package/fesm2022/forgeroute-ui-stacking-plan.mjs.map +1 -0
  193. package/fesm2022/forgeroute-ui-star-rating.mjs +498 -0
  194. package/fesm2022/forgeroute-ui-star-rating.mjs.map +1 -0
  195. package/fesm2022/forgeroute-ui-star.mjs +184 -0
  196. package/fesm2022/forgeroute-ui-star.mjs.map +1 -0
  197. package/fesm2022/forgeroute-ui-stepper.mjs +615 -0
  198. package/fesm2022/forgeroute-ui-stepper.mjs.map +1 -0
  199. package/fesm2022/forgeroute-ui-stripe.mjs +6254 -1188
  200. package/fesm2022/forgeroute-ui-stripe.mjs.map +1 -1
  201. package/fesm2022/forgeroute-ui-swatch-picker.mjs +416 -0
  202. package/fesm2022/forgeroute-ui-swatch-picker.mjs.map +1 -0
  203. package/fesm2022/forgeroute-ui-table-toolbar.mjs +770 -0
  204. package/fesm2022/forgeroute-ui-table-toolbar.mjs.map +1 -0
  205. package/fesm2022/forgeroute-ui-table-types.mjs +277 -0
  206. package/fesm2022/forgeroute-ui-table-types.mjs.map +1 -0
  207. package/fesm2022/forgeroute-ui-text-input.mjs +1003 -0
  208. package/fesm2022/forgeroute-ui-text-input.mjs.map +1 -0
  209. package/fesm2022/forgeroute-ui-text-template-picker.mjs +356 -0
  210. package/fesm2022/forgeroute-ui-text-template-picker.mjs.map +1 -0
  211. package/fesm2022/forgeroute-ui-text.mjs +195 -0
  212. package/fesm2022/forgeroute-ui-text.mjs.map +1 -0
  213. package/fesm2022/forgeroute-ui-textarea-input.mjs +542 -0
  214. package/fesm2022/forgeroute-ui-textarea-input.mjs.map +1 -0
  215. package/fesm2022/forgeroute-ui-time-input.mjs +401 -0
  216. package/fesm2022/forgeroute-ui-time-input.mjs.map +1 -0
  217. package/fesm2022/forgeroute-ui-timeline.mjs +549 -0
  218. package/fesm2022/forgeroute-ui-timeline.mjs.map +1 -0
  219. package/fesm2022/forgeroute-ui-toast.mjs +507 -0
  220. package/fesm2022/forgeroute-ui-toast.mjs.map +1 -0
  221. package/fesm2022/forgeroute-ui-toggle-badge.mjs +177 -0
  222. package/fesm2022/forgeroute-ui-toggle-badge.mjs.map +1 -0
  223. package/fesm2022/forgeroute-ui-toggle.mjs +275 -0
  224. package/fesm2022/forgeroute-ui-toggle.mjs.map +1 -0
  225. package/fesm2022/forgeroute-ui-tooltip.mjs +155 -0
  226. package/fesm2022/forgeroute-ui-tooltip.mjs.map +1 -0
  227. package/fesm2022/forgeroute-ui-utils.mjs +1071 -0
  228. package/fesm2022/forgeroute-ui-utils.mjs.map +1 -0
  229. package/fesm2022/forgeroute-ui.mjs +105 -70663
  230. package/package.json +422 -2
  231. package/types/forgeroute-ui-action-bar.d.ts +74 -0
  232. package/types/forgeroute-ui-address-input.d.ts +354 -0
  233. package/types/forgeroute-ui-alert.d.ts +89 -0
  234. package/types/forgeroute-ui-avatar.d.ts +85 -0
  235. package/types/forgeroute-ui-badge.d.ts +45 -0
  236. package/types/forgeroute-ui-bar-row.d.ts +90 -0
  237. package/types/forgeroute-ui-boards.d.ts +575 -0
  238. package/types/forgeroute-ui-bulk-eligible.d.ts +53 -0
  239. package/types/forgeroute-ui-business-hours.d.ts +191 -0
  240. package/types/forgeroute-ui-calendar.d.ts +544 -0
  241. package/types/forgeroute-ui-card-list-item.d.ts +186 -0
  242. package/types/forgeroute-ui-charts.d.ts +1 -1
  243. package/types/forgeroute-ui-checkbox.d.ts +270 -0
  244. package/types/forgeroute-ui-chip.d.ts +125 -0
  245. package/types/forgeroute-ui-color-input.d.ts +160 -0
  246. package/types/forgeroute-ui-column-filter.d.ts +130 -0
  247. package/types/forgeroute-ui-columns.d.ts +150 -0
  248. package/types/forgeroute-ui-combobox.d.ts +252 -0
  249. package/types/forgeroute-ui-confirm.d.ts +34 -0
  250. package/types/forgeroute-ui-contact-picker.d.ts +173 -0
  251. package/types/forgeroute-ui-conversations.d.ts +993 -0
  252. package/types/forgeroute-ui-copy-field.d.ts +122 -0
  253. package/types/forgeroute-ui-core.d.ts +188 -4
  254. package/types/forgeroute-ui-data-table-core.d.ts +1221 -0
  255. package/types/forgeroute-ui-date-input.d.ts +101 -0
  256. package/types/forgeroute-ui-date-range-picker.d.ts +109 -0
  257. package/types/forgeroute-ui-datetime-input.d.ts +97 -0
  258. package/types/forgeroute-ui-detail-card.d.ts +252 -0
  259. package/types/forgeroute-ui-discount-selector.d.ts +57 -0
  260. package/types/forgeroute-ui-divider.d.ts +40 -0
  261. package/types/forgeroute-ui-dropdown.d.ts +156 -0
  262. package/types/forgeroute-ui-editor.d.ts +873 -0
  263. package/types/forgeroute-ui-empty-state.d.ts +29 -0
  264. package/types/forgeroute-ui-error-state.d.ts +38 -0
  265. package/types/forgeroute-ui-error.d.ts +29 -0
  266. package/types/forgeroute-ui-fade.d.ts +39 -0
  267. package/types/forgeroute-ui-file-input.d.ts +337 -0
  268. package/types/forgeroute-ui-fixed-footer.d.ts +53 -0
  269. package/types/forgeroute-ui-form-row.d.ts +30 -0
  270. package/types/forgeroute-ui-form-section.d.ts +18 -0
  271. package/types/forgeroute-ui-form.d.ts +68 -0
  272. package/types/forgeroute-ui-hint.d.ts +10 -0
  273. package/types/forgeroute-ui-icon-picker.d.ts +122 -0
  274. package/types/forgeroute-ui-icon.d.ts +95 -0
  275. package/types/forgeroute-ui-image-preview.d.ts +88 -0
  276. package/types/forgeroute-ui-keypad.d.ts +73 -0
  277. package/types/forgeroute-ui-kpi-card.d.ts +161 -0
  278. package/types/forgeroute-ui-language-switcher.d.ts +41 -0
  279. package/types/forgeroute-ui-layout.d.ts +13 -0
  280. package/types/forgeroute-ui-list-item.d.ts +253 -0
  281. package/types/forgeroute-ui-list.d.ts +282 -0
  282. package/types/forgeroute-ui-live-region.d.ts +49 -0
  283. package/types/forgeroute-ui-map.d.ts +1 -1
  284. package/types/forgeroute-ui-maps.d.ts +1 -1
  285. package/types/forgeroute-ui-media.d.ts +1221 -0
  286. package/types/forgeroute-ui-messaging.d.ts +11 -6
  287. package/types/forgeroute-ui-more-menu.d.ts +91 -0
  288. package/types/forgeroute-ui-multi-select.d.ts +119 -0
  289. package/types/forgeroute-ui-notes.d.ts +172 -0
  290. package/types/forgeroute-ui-notification-bell.d.ts +135 -0
  291. package/types/forgeroute-ui-offline-banner.d.ts +44 -0
  292. package/types/forgeroute-ui-option-card.d.ts +106 -0
  293. package/types/forgeroute-ui-page.d.ts +115 -0
  294. package/types/forgeroute-ui-pagination.d.ts +55 -0
  295. package/types/forgeroute-ui-panel-info-list.d.ts +147 -0
  296. package/types/forgeroute-ui-password-requirements.d.ts +89 -0
  297. package/types/forgeroute-ui-payments.d.ts +1826 -0
  298. package/types/forgeroute-ui-pdf.d.ts +1 -1
  299. package/types/forgeroute-ui-phone-number-picker.d.ts +199 -0
  300. package/types/forgeroute-ui-pill-tabs.d.ts +208 -0
  301. package/types/forgeroute-ui-print.d.ts +40 -0
  302. package/types/forgeroute-ui-progress-bar.d.ts +88 -0
  303. package/types/forgeroute-ui-progress-ring.d.ts +102 -0
  304. package/types/forgeroute-ui-quick-filter-tabs.d.ts +51 -0
  305. package/types/forgeroute-ui-quickbooks.d.ts +6 -3
  306. package/types/forgeroute-ui-radio-matrix.d.ts +131 -0
  307. package/types/forgeroute-ui-radio.d.ts +311 -0
  308. package/types/forgeroute-ui-read-only-mode.d.ts +26 -0
  309. package/types/forgeroute-ui-readonly-fieldset.d.ts +62 -0
  310. package/types/forgeroute-ui-reminder-alerts.d.ts +71 -0
  311. package/types/forgeroute-ui-search-input.d.ts +93 -0
  312. package/types/forgeroute-ui-section-header.d.ts +149 -0
  313. package/types/forgeroute-ui-select.d.ts +183 -0
  314. package/types/forgeroute-ui-setup.d.ts +775 -0
  315. package/types/forgeroute-ui-share-menu.d.ts +99 -0
  316. package/types/forgeroute-ui-shell.d.ts +173 -0
  317. package/types/forgeroute-ui-show.d.ts +40 -0
  318. package/types/forgeroute-ui-sidebar-layout.d.ts +161 -0
  319. package/types/forgeroute-ui-skeleton.d.ts +51 -0
  320. package/types/forgeroute-ui-skip-link.d.ts +51 -0
  321. package/types/forgeroute-ui-snackbar.d.ts +50 -0
  322. package/types/forgeroute-ui-square.d.ts +5 -3
  323. package/types/forgeroute-ui-stack.d.ts +99 -0
  324. package/types/forgeroute-ui-stacked-bar.d.ts +84 -0
  325. package/types/forgeroute-ui-stacking-plan.d.ts +116 -0
  326. package/types/forgeroute-ui-star-rating.d.ts +151 -0
  327. package/types/forgeroute-ui-star.d.ts +46 -0
  328. package/types/forgeroute-ui-stepper.d.ts +273 -0
  329. package/types/forgeroute-ui-stripe.d.ts +1458 -3
  330. package/types/forgeroute-ui-swatch-picker.d.ts +118 -0
  331. package/types/forgeroute-ui-table-toolbar.d.ts +116 -0
  332. package/types/forgeroute-ui-table-types.d.ts +624 -0
  333. package/types/forgeroute-ui-text-input.d.ts +359 -0
  334. package/types/forgeroute-ui-text-template-picker.d.ts +100 -0
  335. package/types/forgeroute-ui-text.d.ts +76 -0
  336. package/types/forgeroute-ui-textarea-input.d.ts +174 -0
  337. package/types/forgeroute-ui-time-input.d.ts +105 -0
  338. package/types/forgeroute-ui-timeline.d.ts +196 -0
  339. package/types/forgeroute-ui-toast.d.ts +131 -0
  340. package/types/forgeroute-ui-toggle-badge.d.ts +64 -0
  341. package/types/forgeroute-ui-toggle.d.ts +92 -0
  342. package/types/forgeroute-ui-tooltip.d.ts +36 -0
  343. package/types/forgeroute-ui-utils.d.ts +210 -0
  344. package/types/forgeroute-ui.d.ts +106 -19539
  345. package/fesm2022/forgeroute-ui.mjs.map +0 -1
@@ -0,0 +1,1826 @@
1
+ import { SelectOption } from "@forgeroute/ui/select";
2
+ import { UiFieldValidity, UiLabelKey, UiLabelsService } from "@forgeroute/ui/core";
3
+ import * as i0 from "@angular/core";
4
+ import { DestroyRef, InjectionToken, Signal, TemplateRef } from "@angular/core";
5
+ import { Observable } from "rxjs";
6
+ import { PanelInfoSection } from "@forgeroute/ui/panel-info-list";
7
+ import { RadioOption } from "@forgeroute/ui/radio";
8
+ /** Default ACH debit authorization text (same wording the contractor bank-account kiosk used). */
9
+ export declare const DEFAULT_BANK_MANDATE_TEXT: string;
10
+ export type BankAccountType = 'checking' | 'savings';
11
+ export type BankHolderType = 'individual' | 'company';
12
+ /** What `(submitted)` emits: every text value trimmed, `mandateAccepted` always `true`. */
13
+ export interface BankAccountFormValue {
14
+ routingNumber: string;
15
+ accountNumber: string;
16
+ accountType: BankAccountType;
17
+ accountHolderName: string;
18
+ holderType: BankHolderType;
19
+ mandateAccepted: true;
20
+ }
21
+ export declare const DEFAULT_BANK_ACCOUNT_TYPE_OPTIONS: SelectOption[];
22
+ export declare const DEFAULT_BANK_HOLDER_TYPE_OPTIONS: SelectOption[];
23
+ /**
24
+ * `ui-bank-account-form` - the US bank-account entry form (routing number, account number + confirmation, account type, holder name + type,
25
+ * ACH debit authorization). Built only from library inputs; it holds NO HTTP and no provider logic: the host listens to `(submitted)` and talks to
26
+ * its payment provider (Stripe `confirmUsBankAccountSetup`, Square, ...). See docs/modal-kiosk-and-bank-account-form.md.
27
+ *
28
+ * - Validation is inline through the inputs' own `[error]` / built-in rules. The routing number is only checked for 9 digits (no ABA checksum: the
29
+ * provider validates the real number, and a client checksum would reject test numbers). Account numbers are 4-17 digits.
30
+ * - Every message (the built-in ones and the form's own routing / account / confirm messages, which are passed to the inputs as `[error]`) shows after the user left THAT field (blur), or at once on every field while `[showErrors]` is true or after a failed `submit()`. Switching the reveal flag from true back to false (the host's `showErrors` going false, or `reset()`) clears every field's touched state.
31
+ * - The form provides `UiFieldValidity` (`invalid` = not submittable), so a host can gate its own button with `viewChildren(UiFieldValidity)`,
32
+ * or use `(validChange)`.
33
+ * - The host's footer button calls `form.submit()` (via `viewChild`); Enter in a text field submits too.
34
+ */
35
+ export declare class BankAccountFormComponent implements UiFieldValidity {
36
+ protected readonly labels: UiLabelsService;
37
+ /** The host's "tried to submit" flag (e.g. a panel's `touched()`). `true` reveals every field's message at once and blocks submitting; switching it from true back to false clears every field's touched state. */
38
+ readonly showErrors: import("@angular/core").InputSignal<boolean>;
39
+ /** Disables every field and blocks `submit()`. */
40
+ readonly disabled: import("@angular/core").InputSignal<boolean>;
41
+ /** Like `disabled`, plus `aria-busy` on the host: a provider call is running. */
42
+ readonly busy: import("@angular/core").InputSignal<boolean>;
43
+ /** The authorization text next to the checkbox (it is the checkbox label). The unticked default is never changed by the form. */
44
+ readonly mandateTextInput: import("@angular/core").InputSignal<string | null>;
45
+ readonly mandateText: import("@angular/core").Signal<string>;
46
+ /** Account type choices; values must stay `checking` / `savings`. */
47
+ readonly accountTypeOptionsInput: import("@angular/core").InputSignal<SelectOption<string>[] | null>;
48
+ readonly accountTypeOptions: import("@angular/core").Signal<SelectOption<string>[]>;
49
+ /** Holder type choices; values must stay `individual` / `company`. */
50
+ readonly holderTypeOptionsInput: import("@angular/core").InputSignal<SelectOption<string>[] | null>;
51
+ readonly holderTypeOptions: import("@angular/core").Signal<SelectOption<string>[]>;
52
+ /** Pre-fills the account holder name (e.g. the customer's name) whenever it changes; the user can edit it. */
53
+ readonly accountHolderNameDefault: import("@angular/core").InputSignal<string>;
54
+ /** Prefix of the inner test ids: `<prefix>-routing`, `-account`, `-confirm`, `-holder-name`, `-account-type`, `-holder-type`, `-mandate`. */
55
+ readonly testIdPrefix: import("@angular/core").InputSignal<string>;
56
+ /** Emits the typed payload when `submit()` runs on a valid form. */
57
+ readonly submitted: import("@angular/core").OutputEmitterRef<BankAccountFormValue>;
58
+ /** Emits `true` / `false` whenever the form becomes submittable / not (also once on init). */
59
+ readonly validChange: import("@angular/core").OutputEmitterRef<boolean>;
60
+ protected readonly routingNumber: import("@angular/core").WritableSignal<string>;
61
+ protected readonly accountNumber: import("@angular/core").WritableSignal<string>;
62
+ protected readonly confirmAccount: import("@angular/core").WritableSignal<string>;
63
+ protected readonly accountHolderName: import("@angular/core").WritableSignal<string>;
64
+ protected readonly accountType: import("@angular/core").WritableSignal<string>;
65
+ protected readonly holderType: import("@angular/core").WritableSignal<string>;
66
+ protected readonly mandateAccepted: import("@angular/core").WritableSignal<boolean>;
67
+ private readonly _touched;
68
+ protected readonly routingFormatter: (raw: string) => string;
69
+ protected readonly accountFormatter: (raw: string) => string;
70
+ protected readonly locked: import("@angular/core").Signal<boolean>;
71
+ /** Handed to the inputs as `[showErrors]`. `true` reveals each input's message at once; true -> false (host flag off, or `reset()` after a failed `submit()`) clears each input's touched state. */
72
+ protected readonly reveal: import("@angular/core").Signal<boolean>;
73
+ protected readonly routingError: import("@angular/core").Signal<string>;
74
+ protected readonly accountError: import("@angular/core").Signal<string>;
75
+ protected readonly confirmError: import("@angular/core").Signal<string>;
76
+ /** First reason the form cannot be submitted ('' when it can). */
77
+ readonly errorMessage: import("@angular/core").Signal<string>;
78
+ /** True while the form cannot be submitted (`UiFieldValidity`). */
79
+ readonly invalid: import("@angular/core").Signal<boolean>;
80
+ /** True when the form can be submitted (ignores `disabled` / `busy`). */
81
+ readonly valid: import("@angular/core").Signal<boolean>;
82
+ private readonly _fields;
83
+ constructor();
84
+ protected id(name: string): string;
85
+ protected onEnter(event: Event): void;
86
+ /** Validates and, when valid, emits `submitted`. An invalid form emits nothing and reveals no message on a field the user never left. Ignored while `disabled` / `busy`. */
87
+ submit(): void;
88
+ /** Clears every field back to the defaults (checking, individual, authorization unticked, holder name = `accountHolderNameDefault`). */
89
+ reset(): void;
90
+ static ɵfac: i0.ɵɵFactoryDeclaration<BankAccountFormComponent, never>;
91
+ static ɵcmp: i0.ɵɵComponentDeclaration<BankAccountFormComponent, "ui-bank-account-form", never, {
92
+ "showErrors": {
93
+ "alias": "showErrors";
94
+ "required": false;
95
+ "isSignal": true;
96
+ };
97
+ "disabled": {
98
+ "alias": "disabled";
99
+ "required": false;
100
+ "isSignal": true;
101
+ };
102
+ "busy": {
103
+ "alias": "busy";
104
+ "required": false;
105
+ "isSignal": true;
106
+ };
107
+ "mandateTextInput": {
108
+ "alias": "mandateText";
109
+ "required": false;
110
+ "isSignal": true;
111
+ };
112
+ "accountTypeOptionsInput": {
113
+ "alias": "accountTypeOptions";
114
+ "required": false;
115
+ "isSignal": true;
116
+ };
117
+ "holderTypeOptionsInput": {
118
+ "alias": "holderTypeOptions";
119
+ "required": false;
120
+ "isSignal": true;
121
+ };
122
+ "accountHolderNameDefault": {
123
+ "alias": "accountHolderNameDefault";
124
+ "required": false;
125
+ "isSignal": true;
126
+ };
127
+ "testIdPrefix": {
128
+ "alias": "testIdPrefix";
129
+ "required": false;
130
+ "isSignal": true;
131
+ };
132
+ }, {
133
+ "submitted": "submitted";
134
+ "validChange": "validChange";
135
+ }, never, never, true, never>;
136
+ }
137
+ /**
138
+ * Types and pure helpers of `ui-payment-side-panel`. Nothing here knows a payment processor: Stripe / Square arrive as plugins
139
+ * (`PaymentMethodPlugin`), the card-present terminal as host callbacks.
140
+ */
141
+ /** Well-known method values the panel gives behaviour to. Hosts may list any other value (it is recorded like Cash). */
142
+ export declare const PAYMENT_METHOD: {
143
+ readonly CARD: "CARD";
144
+ readonly ACH: "ACH";
145
+ readonly CASH: "CASH";
146
+ readonly CHECK: "CHECK";
147
+ readonly MONEY_ORDER: "MONEY_ORDER";
148
+ readonly CARD_PRESENT: "CARD_PRESENT";
149
+ };
150
+ interface PaymentMethodOption {
151
+ value: string;
152
+ label: string;
153
+ /** `'terminal'`: listed only while the host gave the terminal callbacks (`listReaders` + `startTerminalPayment`). */
154
+ requires?: 'terminal';
155
+ }
156
+ /** The methods listed when the host gives none: Card and ACH are record-only until a processor plugin takes them over. */
157
+ export declare const DEFAULT_PAYMENT_METHODS: readonly PaymentMethodOption[];
158
+ /** The default methods with their names in the app's active language (what the panel lists when the host gives none). */
159
+ export declare function localizedPaymentMethods(): PaymentMethodOption[];
160
+ interface PayableCharge {
161
+ id: string;
162
+ chargeType: string;
163
+ description: string;
164
+ /** ISO date `YYYY-MM-DD`. */
165
+ dueDate: string;
166
+ balanceDue: number;
167
+ }
168
+ interface SavedPaymentMethod {
169
+ method: string;
170
+ last4: string;
171
+ label?: string;
172
+ }
173
+ interface AllocationModeOption {
174
+ value: string;
175
+ label: string;
176
+ }
177
+ export declare const ALLOCATION_CUSTOM = "custom";
178
+ export declare const DEFAULT_ALLOCATION_MODES: readonly AllocationModeOption[];
179
+ /** The default allocation modes with their names in the app's active language. */
180
+ export declare function localizedAllocationModes(): AllocationModeOption[];
181
+ interface ChargeAllocation {
182
+ chargeId: string;
183
+ amount: number;
184
+ }
185
+ /**
186
+ * How the payment is applied to charges. A non-custom mode sends `{ allocationMode }`. "Choose charges" sends `{ allocationChargeIds, allocations }`
187
+ * (no `allocationMode`, like the old drawer); `allocations` carries the amount per charge.
188
+ */
189
+ interface PaymentAllocation {
190
+ allocationMode?: string;
191
+ allocationChargeIds?: string[];
192
+ allocations?: ChargeAllocation[];
193
+ }
194
+ interface PaymentEntry {
195
+ paymentMethod: string;
196
+ amount: number;
197
+ /** Check number / last 4 digits; `null` when the method has none. */
198
+ reference: string | null;
199
+ /** The receipt checkbox applies to the LAST entry only (like the old drawer); earlier split entries are `false`. */
200
+ sendReceipt: boolean;
201
+ }
202
+ interface RecordPaymentPayload extends PaymentAllocation {
203
+ /** Total of all entries. */
204
+ amount: number;
205
+ /** The method of a single payment, `'SPLIT'` when `split`. */
206
+ paymentMethod: string;
207
+ receivedDate: string;
208
+ /** Reference of the single payment (`null` for a split: see `entries`). */
209
+ reference: string | null;
210
+ notes: string | null;
211
+ sendReceipt: boolean;
212
+ /** One per payment to create (the host posts one request per entry, or one request with all). */
213
+ entries: PaymentEntry[];
214
+ split: boolean;
215
+ }
216
+ interface RecordPaymentResult {
217
+ type: 'manual' | 'stripe' | 'split';
218
+ paymentMethod: string;
219
+ amount: number;
220
+ /**
221
+ * Which online processor took the payment, set by a payment plugin that is not Stripe (`'square'`, `'quickbooks'`): `type` stays `'stripe'` for every live card / bank
222
+ * payment ("online", kept for existing hosts), `processor` says which one. Absent for a manual record and for the Stripe plugin.
223
+ */
224
+ processor?: string;
225
+ }
226
+ /** What the panel reports for the host to word (toasts, analytics). It never toasts itself. */
227
+ type PaymentPanelOutcome = {
228
+ kind: 'recorded';
229
+ result: RecordPaymentResult;
230
+ } | {
231
+ kind: 'split-recorded';
232
+ result: RecordPaymentResult;
233
+ } | {
234
+ kind: 'terminal-paid';
235
+ result: RecordPaymentResult;
236
+ } | {
237
+ kind: 'plugin';
238
+ method: string;
239
+ code: string;
240
+ result?: RecordPaymentResult;
241
+ message?: string;
242
+ attemptKey?: string;
243
+ paid?: {
244
+ amount: number | null;
245
+ method: string;
246
+ };
247
+ } | {
248
+ kind: 'failed';
249
+ stage: 'record' | 'readers' | 'terminal';
250
+ message: string;
251
+ };
252
+ type HostResult<T> = Observable<T> | Promise<T> | T;
253
+ type RecordPaymentFn = (payload: RecordPaymentPayload) => HostResult<unknown>;
254
+ interface TerminalReader {
255
+ id: string;
256
+ label?: string;
257
+ status: string;
258
+ deviceType?: string;
259
+ }
260
+ interface TerminalStartContext extends PaymentAllocation {
261
+ readerId: string;
262
+ amount: number;
263
+ receivedDate: string;
264
+ notes: string | null;
265
+ }
266
+ interface TerminalStartResult {
267
+ paymentIntentId: string;
268
+ }
269
+ interface TerminalStatusResult {
270
+ status: string;
271
+ }
272
+ interface TerminalConfirmContext extends TerminalStartContext {
273
+ paymentIntentId: string;
274
+ }
275
+ type TerminalPhase = 'idle' | 'waiting' | 'confirming' | 'success';
276
+ /** Reader statuses that end the wait. */
277
+ export declare function terminalVerdict(status: string | null | undefined): 'succeeded' | 'canceled' | 'declined' | 'pending';
278
+ export declare function terminalTimeoutText(ms: number): string;
279
+ export declare const MIN_PAYMENT_AMOUNT = 0.01;
280
+ export declare const MAX_PAYMENT_AMOUNT = 99999.99;
281
+ declare const toCents: (value: number) => number;
282
+ declare const fromCents: (cents: number) => number;
283
+ declare const roundMoney: (value: number) => number;
284
+ /** A payable amount: a finite number from 0.01 to `max` with at most two decimals. */
285
+ export declare function isValidAmount(value: unknown, max?: number): value is number;
286
+ declare function sumMoney(values: readonly number[]): number;
287
+ declare function referenceKind(method: string, live: boolean): 'check' | 'last4-card' | 'last4-account' | null;
288
+ /** The last-4 box accepts digits only (blank is fine). */
289
+ export declare function last4Error(value: string): string;
290
+ declare function last4Digits(value: string, max?: number): string;
291
+ interface AllocationCheck {
292
+ general: string;
293
+ perCharge: Record<string, string>;
294
+ }
295
+ type SelectedCharges = Record<string, number | null>;
296
+ declare function allocationCheck(charges: readonly PayableCharge[], selected: SelectedCharges, totalPayment: number | null, format: (n: number) => string): AllocationCheck;
297
+ /** The amount to propose when a charge is ticked: its balance, capped by what is left of the payment. */
298
+ export declare function defaultChargeAmount(charge: PayableCharge, selected: SelectedCharges, totalPayment: number | null): number | null;
299
+ declare function buildAllocation(mode: string, charges: readonly PayableCharge[], selected: SelectedCharges): PaymentAllocation;
300
+ /** "2026-11-03" -> "Nov 3, 2026" without `Date` string parsing (Safari-safe, time-zone independent). */
301
+ declare function formatDueDate(iso: string, locale?: string): string;
302
+ /** Runs a host callback that may return an Observable, a Promise or a value; a synchronous throw becomes a rejection. */
303
+ export declare function callHost<T>(thunk: () => HostResult<T>): Promise<T>;
304
+ /** The text of a failed host call: its HTTP body message, its message, else the fallback. */
305
+ export declare function hostErrorMessage(err: unknown, fallback: string): string;
306
+ /** A method a plugin contributes to the panel's method select (while the plugin is rendered inside the panel). */
307
+ export interface PaymentPluginMethod {
308
+ value: string;
309
+ label: string;
310
+ }
311
+ /** The footer button a plugin body may ask the panel to show instead of the panel's own (the panel's own button is hidden for plugin methods). */
312
+ export interface PaymentPluginPrimary {
313
+ label: string;
314
+ disabled?: boolean;
315
+ loading?: boolean;
316
+ onClick: () => void;
317
+ }
318
+ /**
319
+ * What the panel hands to a plugin body (`<ng-template let-ctx>`). The values are a snapshot that is replaced whenever the form changes (read them in the
320
+ * template or in an `input()` of a child component); the functions are stable.
321
+ */
322
+ export interface PaymentMethodContext {
323
+ /** The selected method value (one of the plugin's `methods`). */
324
+ readonly method: string;
325
+ /** The entered amount, or `null` while it is empty or invalid (a plugin should not start a charge without it). */
326
+ readonly amount: number | null;
327
+ /** ISO date the payment was received. */
328
+ readonly receivedDate: string;
329
+ readonly note: string;
330
+ /** How the payment is applied to charges (same shape the manual payload carries). */
331
+ readonly allocation: PaymentAllocation;
332
+ /** ISO 4217 code of the panel (`'USD'`). */
333
+ readonly currency: string;
334
+ /** Every field of the panel is valid (amount, date, note, allocation). */
335
+ readonly valid: boolean;
336
+ /** Marks the panel as submit-attempted (as a failed Save click does; it reveals no message on a field the user never left) and returns whether the form is valid. Call it before starting a charge. */
337
+ validate(): boolean;
338
+ /** Clears the whole form (method, amount, note, split, allocation; the date returns to today). */
339
+ reset(): void;
340
+ /** The payment is done: the panel reports it (`outcome` kind `'plugin'`, code `'complete'`, then `recorded`). Defaults: type `'manual'`, the selected method, the entered amount. Runs once. */
341
+ complete(result?: Partial<RecordPaymentResult>): void;
342
+ /** A flow is running: the fields are locked and the method cannot be changed. */
343
+ setBusy(busy: boolean): void;
344
+ /** The plugin's own footer button (e.g. "Pay $120.00"); `null` removes it. The panel's own Save button never shows for a plugin method. */
345
+ setPrimary(button: PaymentPluginPrimary | null): void;
346
+ /** Hide the panel's fields and show only the plugin body (e.g. a "payment submitted" notice). */
347
+ setExclusive(on: boolean): void;
348
+ /**
349
+ * Optional (library source 2026-11-21): asks the panel not to close while the plugin has something that must not be abandoned (a payment waiting on a card reader). The panel calls `fn` when the user
350
+ * closes it (Cancel, X, Escape); `fn` returns `true` to let it close, `false` to keep it open (the plugin shows why). Cleared by `setCloseGuard(null)`, a method change, `complete()` and a reset. A host that
351
+ * closes the panel itself (`[open]="false"`) is not asked: the cancel hook of `onCancel` runs then. Older panels do not have it: call it as `ctx.setCloseGuard?.(...)`.
352
+ */
353
+ setCloseGuard?(fn: (() => boolean) | null): void;
354
+ /** Called when the body is about to go away unfinished: the panel closes, the method changes, or the plugin is removed. Not called after `complete()`. */
355
+ onCancel(fn: (() => void) | null): void;
356
+ /** Tell the host something happened (`outcome` kind `'plugin'`) so it can word a toast. `attemptKey` names the attempt a report is about (the second payment of a `duplicate_suspected`, the payment another tab made in `paid_elsewhere`); `paid` is the amount (major units) and method that payment was made with, for a host that reconciles it. */
357
+ report(code: string, extra?: {
358
+ result?: RecordPaymentResult;
359
+ message?: string;
360
+ attemptKey?: string;
361
+ paid?: {
362
+ amount: number | null;
363
+ method: string;
364
+ };
365
+ }): void;
366
+ /** Text for the panel's screen-reader status region. */
367
+ announce(text: string): void;
368
+ }
369
+ export interface PaymentMethodBodyContext {
370
+ $implicit: PaymentMethodContext;
371
+ }
372
+ /**
373
+ * The contract of a payment plugin: a child element of `<ui-payment-side-panel>` that contributes live methods (Stripe, Square, ...).
374
+ * The panel finds plugins with `contentChildren(PAYMENT_METHOD_PLUGIN)`, so presence IS the opt-in; remove the element and its methods leave the select.
375
+ * A plugin whose method value is `CARD` or `ACH` replaces the record-only behaviour (last 4 digits) of that value while it is rendered.
376
+ */
377
+ export declare abstract class PaymentMethodPlugin {
378
+ abstract readonly methods: Signal<readonly PaymentPluginMethod[]>;
379
+ /** The body shown under the form while one of the plugin's methods is selected. */
380
+ abstract readonly template: Signal<TemplateRef<PaymentMethodBodyContext> | undefined>;
381
+ }
382
+ export declare const PAYMENT_METHOD_PLUGIN: InjectionToken<PaymentMethodPlugin>;
383
+ /**
384
+ * The generic payment plugin: the host renders the body of a method it built itself (Square Web SDK, a gateway widget, ...).
385
+ *
386
+ * <ui-payment-side-panel ...>
387
+ * <ui-payment-custom-method value="CARD" label="Card">
388
+ * <ng-template let-ctx> <my-square-card [amount]="ctx.amount" (paid)="ctx.complete({ type: 'stripe' })" /> </ng-template>
389
+ * </ui-payment-custom-method>
390
+ * </ui-payment-side-panel>
391
+ */
392
+ export declare class PaymentCustomMethodComponent extends PaymentMethodPlugin {
393
+ readonly value: import("@angular/core").InputSignal<string>;
394
+ readonly label: import("@angular/core").InputSignal<string>;
395
+ private readonly body;
396
+ readonly methods: import("@angular/core").Signal<readonly PaymentPluginMethod[]>;
397
+ readonly template: import("@angular/core").Signal<TemplateRef<PaymentMethodBodyContext> | undefined>;
398
+ static ɵfac: i0.ɵɵFactoryDeclaration<PaymentCustomMethodComponent, never>;
399
+ static ɵcmp: i0.ɵɵComponentDeclaration<PaymentCustomMethodComponent, "ui-payment-custom-method", never, {
400
+ "value": {
401
+ "alias": "value";
402
+ "required": true;
403
+ "isSignal": true;
404
+ };
405
+ "label": {
406
+ "alias": "label";
407
+ "required": true;
408
+ "isSignal": true;
409
+ };
410
+ }, {}, ["body"], never, true, never>;
411
+ }
412
+ interface SplitEntry {
413
+ method: string;
414
+ amount: number;
415
+ reference: string;
416
+ }
417
+ /**
418
+ * Side panel for staff to RECORD or COLLECT a payment. Works on its own (record-only: Cash, Check, Money Order, Card and ACH with the last 4 digits) and grows
419
+ * by PLUGINS the host drops in as child elements (`ui-payment-stripe-method` from `@forgeroute/ui/stripe`, `ui-payment-custom-method` for Square or any widget):
420
+ * a plugin's presence IS the opt-in, and a plugin method with the value `CARD` / `ACH` replaces the record-only behaviour while it is rendered.
421
+ * The panel has no HTTP and no processor knowledge: the host gives callbacks (`recordPayment`, the terminal calls) and words the `outcome` events.
422
+ *
423
+ * <ui-payment-side-panel [open]="open()" [today]="today()" [outstandingBalance]="due()" [charges]="charges()"
424
+ * [recordPayment]="record" (recorded)="onRecorded($event)" (closed)="open.set(false)" />
425
+ *
426
+ * See docs/payment-side-panel.md.
427
+ */
428
+ export declare class PaymentSidePanelComponent {
429
+ protected readonly labels: UiLabelsService;
430
+ private readonly injector;
431
+ private readonly hostEl;
432
+ protected readonly ids: string;
433
+ protected readonly customMode = "custom";
434
+ readonly open: import("@angular/core").InputSignal<boolean>;
435
+ readonly titleInput: import("@angular/core").InputSignal<string | null>;
436
+ readonly title: import("@angular/core").Signal<string>;
437
+ readonly subtitle: import("@angular/core").InputSignal<string>;
438
+ /** Today as `YYYY-MM-DD` (the host's clock/time zone): the default Received Date. The panel never builds dates itself. */
439
+ readonly today: import("@angular/core").InputSignal<string>;
440
+ /** When > 0 a banner shows it and the amount starts at this balance. */
441
+ readonly outstandingBalance: import("@angular/core").InputSignal<number | null>;
442
+ /** ISO 4217 code used for every amount shown. */
443
+ readonly currency: import("@angular/core").InputSignal<string>;
444
+ readonly maxAmount: import("@angular/core").InputSignal<number>;
445
+ /** Latest Received Date (ISO). Default: `today`, because a payment cannot be received in the future. */
446
+ readonly maxDate: import("@angular/core").InputSignal<string>;
447
+ /** The methods listed (value/label). Default: Card, ACH / Bank Transfer, Cash, Check, Money Order, Card Present (terminal callbacks given). */
448
+ readonly methodsInput: import("@angular/core").InputSignal<readonly PaymentMethodOption[] | null>;
449
+ readonly methods: import("@angular/core").Signal<readonly PaymentMethodOption[]>;
450
+ readonly savedMethods: import("@angular/core").InputSignal<readonly SavedPaymentMethod[]>;
451
+ readonly charges: import("@angular/core").InputSignal<readonly PayableCharge[]>;
452
+ readonly allocationModesInput: import("@angular/core").InputSignal<readonly AllocationModeOption[] | null>;
453
+ readonly allocationModes: import("@angular/core").Signal<readonly AllocationModeOption[]>;
454
+ readonly defaultAllocationMode: import("@angular/core").InputSignal<string>;
455
+ /** Text of the "send receipt" checkbox (e.g. "Email receipt to resident"); empty hides it. */
456
+ readonly receiptLabel: import("@angular/core").InputSignal<string>;
457
+ readonly submitLabelInput: import("@angular/core").InputSignal<string | null>;
458
+ readonly submitLabel: import("@angular/core").Signal<string>;
459
+ readonly splitSubmitLabelInput: import("@angular/core").InputSignal<string | null>;
460
+ readonly splitSubmitLabel: import("@angular/core").Signal<string>;
461
+ /** Records the payment. Returns an Observable / Promise; a rejection is shown in the panel and it stays open. */
462
+ readonly recordPayment: import("@angular/core").InputSignal<RecordPaymentFn | null>;
463
+ readonly listReaders: import("@angular/core").InputSignal<(() => HostResult<readonly TerminalReader[]>) | null>;
464
+ readonly startTerminalPayment: import("@angular/core").InputSignal<((ctx: TerminalStartContext) => HostResult<TerminalStartResult>) | null>;
465
+ readonly terminalStatus: import("@angular/core").InputSignal<((paymentIntentId: string) => HostResult<TerminalStatusResult>) | null>;
466
+ readonly confirmTerminalPayment: import("@angular/core").InputSignal<((ctx: TerminalConfirmContext) => HostResult<unknown>) | null>;
467
+ readonly cancelTerminal: import("@angular/core").InputSignal<((readerId: string) => HostResult<unknown>) | null>;
468
+ readonly terminalProviderInput: import("@angular/core").InputSignal<string | null>;
469
+ readonly terminalProvider: import("@angular/core").Signal<string>;
470
+ readonly noReadersTextInput: import("@angular/core").InputSignal<string | null>;
471
+ readonly noReadersText: import("@angular/core").Signal<string>;
472
+ readonly terminalPollMs: import("@angular/core").InputSignal<number>;
473
+ readonly terminalTimeoutMs: import("@angular/core").InputSignal<number>;
474
+ readonly readerRefreshMs: import("@angular/core").InputSignal<number>;
475
+ readonly terminalSuccessDelayMs: import("@angular/core").InputSignal<number>;
476
+ readonly closed: import("@angular/core").OutputEmitterRef<void>;
477
+ /** The payment is done (any flow). The host closes the panel. */
478
+ readonly recorded: import("@angular/core").OutputEmitterRef<RecordPaymentResult>;
479
+ /** What happened, for the host to word (the panel never toasts). */
480
+ readonly outcome: import("@angular/core").OutputEmitterRef<PaymentPanelOutcome>;
481
+ private readonly plugins;
482
+ private readonly fields;
483
+ readonly method: import("@angular/core").WritableSignal<string>;
484
+ readonly amount: import("@angular/core").WritableSignal<number | null>;
485
+ readonly receivedDate: import("@angular/core").WritableSignal<string>;
486
+ readonly reference: import("@angular/core").WritableSignal<string>;
487
+ readonly note: import("@angular/core").WritableSignal<string>;
488
+ readonly sendReceipt: import("@angular/core").WritableSignal<boolean>;
489
+ readonly splitEntries: import("@angular/core").WritableSignal<SplitEntry[]>;
490
+ readonly allocationMode: import("@angular/core").WritableSignal<string>;
491
+ readonly selectedCharges: import("@angular/core").WritableSignal<SelectedCharges>;
492
+ readonly touched: import("@angular/core").WritableSignal<boolean>;
493
+ /** The user ticked / unticked a charge, edited a charge amount or left the charge list. Only then is the allocation message ("Select at least one charge") shown; a failed Save does not reveal it (it still blocks Save via `hasInvalid`). */
494
+ readonly allocationTouched: import("@angular/core").WritableSignal<boolean>;
495
+ readonly submitting: import("@angular/core").WritableSignal<boolean>;
496
+ readonly submitError: import("@angular/core").WritableSignal<string>;
497
+ readonly announcement: import("@angular/core").WritableSignal<string>;
498
+ private readonly pluginBusy;
499
+ protected readonly exclusive: import("@angular/core").WritableSignal<boolean>;
500
+ private readonly pluginPrimary;
501
+ private cancelHook;
502
+ /** A plugin's "may the panel close?" check (see `PaymentMethodContext.setCloseGuard`). */
503
+ private closeGuard;
504
+ /** The method value that was a live plugin method when last checked ('' = none), to notice the plugin disappearing under a selected method. */
505
+ private liveMethodValue;
506
+ private completed;
507
+ /** The plugin's last report was `verification` (a bank payment that has NOT started): its "Done" is announced as "payment not started", never as "Payment recorded". */
508
+ private verificationReported;
509
+ readonly readers: import("@angular/core").WritableSignal<readonly TerminalReader[]>;
510
+ readonly readersLoaded: import("@angular/core").WritableSignal<boolean>;
511
+ readonly loadingReaders: import("@angular/core").WritableSignal<boolean>;
512
+ readonly readersError: import("@angular/core").WritableSignal<string>;
513
+ readonly readerId: import("@angular/core").WritableSignal<string>;
514
+ readonly terminalPhase: import("@angular/core").WritableSignal<TerminalPhase>;
515
+ readonly terminalError: import("@angular/core").WritableSignal<string>;
516
+ readonly sendingToReader: import("@angular/core").WritableSignal<boolean>;
517
+ readonly retryIntentId: import("@angular/core").WritableSignal<string>;
518
+ readonly retrying: import("@angular/core").WritableSignal<boolean>;
519
+ readonly terminalAmount: import("@angular/core").WritableSignal<number>;
520
+ /** Bumped when the form is reset or the panel closes: an async terminal step that finishes later must not touch the new state. */
521
+ private session;
522
+ private retryContext;
523
+ private pollTimer;
524
+ private pollToken;
525
+ private refreshTimer;
526
+ private successTimer;
527
+ private pendingTerminalResult;
528
+ private terminalContext;
529
+ protected readonly busy: import("@angular/core").Signal<boolean>;
530
+ /** Fields are read-only while something runs, and while a taken terminal payment still has to be recorded (its amount must not change). */
531
+ protected readonly locked: import("@angular/core").Signal<boolean>;
532
+ protected readonly dateMax: import("@angular/core").Signal<string>;
533
+ protected readonly money: (value: number) => string;
534
+ protected readonly currencySymbol: import("@angular/core").Signal<string>;
535
+ private readonly terminalAvailable;
536
+ /** value -> label of every live method the rendered plugins contribute (the first plugin wins a duplicate value). */
537
+ private readonly liveMethods;
538
+ protected readonly kind: import("@angular/core").Signal<"none" | "manual" | "live" | "terminal">;
539
+ private kindOf;
540
+ /** The method list as shown: record-only built-ins (a plugin takes over its own values), plugin extras, and only manual ones while a split is being built. */
541
+ readonly methodList: import("@angular/core").Signal<PaymentMethodOption[]>;
542
+ protected readonly methodOptions: import("@angular/core").Signal<{
543
+ value: string;
544
+ label: string;
545
+ }[]>;
546
+ protected readonly methodRequired: import("@angular/core").Signal<boolean>;
547
+ protected readonly allocationOptions: import("@angular/core").Signal<{
548
+ value: string;
549
+ label: string;
550
+ }[]>;
551
+ /** Hidden while a taken terminal payment still has to be recorded: the method cannot change then. */
552
+ protected readonly savedChips: import("@angular/core").Signal<SavedPaymentMethod[]>;
553
+ protected readonly refKind: import("@angular/core").Signal<"check" | "last4-card" | "last4-account" | null>;
554
+ protected readonly referenceError: import("@angular/core").Signal<string>;
555
+ private readonly amountValid;
556
+ protected readonly splitTotal: import("@angular/core").Signal<number>;
557
+ private readonly totalPayment;
558
+ protected readonly allocation: import("@angular/core").Signal<AllocationCheck>;
559
+ private readonly allocationPayload;
560
+ /** `allocation().general` limited to what the user has interacted with. */
561
+ protected readonly allocationMessage: import("@angular/core").Signal<string>;
562
+ protected readonly hasInvalid: import("@angular/core").Signal<boolean>;
563
+ protected readonly canSplit: import("@angular/core").Signal<boolean>;
564
+ protected readonly readerOptions: import("@angular/core").Signal<{
565
+ value: string;
566
+ label: string;
567
+ }[]>;
568
+ protected readonly selectedReader: import("@angular/core").Signal<TerminalReader | null>;
569
+ protected readonly canSendToReader: import("@angular/core").Signal<boolean>;
570
+ protected readonly pluginTemplate: import("@angular/core").Signal<import("@angular/core").TemplateRef<PaymentMethodBodyContext> | undefined>;
571
+ protected readonly pluginContext: import("@angular/core").Signal<PaymentMethodBodyContext>;
572
+ protected readonly primaryLabel: import("@angular/core").Signal<string>;
573
+ protected readonly primaryLoading: import("@angular/core").Signal<boolean>;
574
+ protected readonly primaryDisabled: import("@angular/core").Signal<boolean>;
575
+ constructor();
576
+ /** The panel is gone: a late answer of a plugin (its confirmation came after the panel closed) must not emit on outputs nobody listens to any more (Angular NG0953). */
577
+ private destroyed;
578
+ private init;
579
+ private teardown;
580
+ private resetForm;
581
+ /** A card payment the reader took but that was never recorded is being abandoned: the host must hear about it. */
582
+ private dropPendingRetry;
583
+ private cleanup;
584
+ protected onClose(): void;
585
+ private runCancelHook;
586
+ protected onMethodChange(value: string | null): void;
587
+ protected selectSaved(saved: SavedPaymentMethod): void;
588
+ protected chipLabel(saved: SavedPaymentMethod): string;
589
+ protected methodLabel(value: string): string;
590
+ protected onLast4(value: string | null): void;
591
+ protected addSplit(): void;
592
+ protected removeSplit(index: number): void;
593
+ protected onAllocationMode(value: string | null): void;
594
+ protected isTicked(id: string): boolean;
595
+ protected toggleCharge(charge: PayableCharge, checked: boolean): void;
596
+ protected setChargeAmount(id: string, value: number | string | null): void;
597
+ protected chargeDescription(charge: PayableCharge): string;
598
+ private referenceFor;
599
+ private buildEntries;
600
+ /** The payload the host receives, or `null` when there is nothing valid to record. */
601
+ buildPayload(): RecordPaymentPayload | null;
602
+ protected onPrimary(): void;
603
+ submit(): Promise<void>;
604
+ /**
605
+ * A host that posts the entries one by one can tell the panel how many went through before a failure: `throw { message, postedEntries: 1 }`.
606
+ * Those first entries are removed, so a retry does not post them again.
607
+ */
608
+ private dropPostedEntries;
609
+ private buildContext;
610
+ private completeFromPlugin;
611
+ private resetTerminal;
612
+ private startTerminalSession;
613
+ protected refreshReaders(): void;
614
+ private loadReaders;
615
+ private scheduleReaderRefresh;
616
+ private stopReaderRefresh;
617
+ private terminalBase;
618
+ sendToReader(): Promise<void>;
619
+ private startPolling;
620
+ private stopPolling;
621
+ private endWaiting;
622
+ private confirmTerminal;
623
+ /** Repeats the recording for the payment the reader already took, with the amount that was charged (not the form's current values). */
624
+ protected retryRecording(): Promise<void>;
625
+ private finishTerminal;
626
+ protected cancelTerminalPayment(): void;
627
+ private cancelTerminalIfWaiting;
628
+ /** Moves focus after the next render (the control that had it was just removed from the DOM). */
629
+ private focusLater;
630
+ private fireCancelReader;
631
+ static ɵfac: i0.ɵɵFactoryDeclaration<PaymentSidePanelComponent, never>;
632
+ static ɵcmp: i0.ɵɵComponentDeclaration<PaymentSidePanelComponent, "ui-payment-side-panel", never, {
633
+ "open": {
634
+ "alias": "open";
635
+ "required": false;
636
+ "isSignal": true;
637
+ };
638
+ "titleInput": {
639
+ "alias": "title";
640
+ "required": false;
641
+ "isSignal": true;
642
+ };
643
+ "subtitle": {
644
+ "alias": "subtitle";
645
+ "required": false;
646
+ "isSignal": true;
647
+ };
648
+ "today": {
649
+ "alias": "today";
650
+ "required": false;
651
+ "isSignal": true;
652
+ };
653
+ "outstandingBalance": {
654
+ "alias": "outstandingBalance";
655
+ "required": false;
656
+ "isSignal": true;
657
+ };
658
+ "currency": {
659
+ "alias": "currency";
660
+ "required": false;
661
+ "isSignal": true;
662
+ };
663
+ "maxAmount": {
664
+ "alias": "maxAmount";
665
+ "required": false;
666
+ "isSignal": true;
667
+ };
668
+ "maxDate": {
669
+ "alias": "maxDate";
670
+ "required": false;
671
+ "isSignal": true;
672
+ };
673
+ "methodsInput": {
674
+ "alias": "methods";
675
+ "required": false;
676
+ "isSignal": true;
677
+ };
678
+ "savedMethods": {
679
+ "alias": "savedMethods";
680
+ "required": false;
681
+ "isSignal": true;
682
+ };
683
+ "charges": {
684
+ "alias": "charges";
685
+ "required": false;
686
+ "isSignal": true;
687
+ };
688
+ "allocationModesInput": {
689
+ "alias": "allocationModes";
690
+ "required": false;
691
+ "isSignal": true;
692
+ };
693
+ "defaultAllocationMode": {
694
+ "alias": "defaultAllocationMode";
695
+ "required": false;
696
+ "isSignal": true;
697
+ };
698
+ "receiptLabel": {
699
+ "alias": "receiptLabel";
700
+ "required": false;
701
+ "isSignal": true;
702
+ };
703
+ "submitLabelInput": {
704
+ "alias": "submitLabel";
705
+ "required": false;
706
+ "isSignal": true;
707
+ };
708
+ "splitSubmitLabelInput": {
709
+ "alias": "splitSubmitLabel";
710
+ "required": false;
711
+ "isSignal": true;
712
+ };
713
+ "recordPayment": {
714
+ "alias": "recordPayment";
715
+ "required": false;
716
+ "isSignal": true;
717
+ };
718
+ "listReaders": {
719
+ "alias": "listReaders";
720
+ "required": false;
721
+ "isSignal": true;
722
+ };
723
+ "startTerminalPayment": {
724
+ "alias": "startTerminalPayment";
725
+ "required": false;
726
+ "isSignal": true;
727
+ };
728
+ "terminalStatus": {
729
+ "alias": "terminalStatus";
730
+ "required": false;
731
+ "isSignal": true;
732
+ };
733
+ "confirmTerminalPayment": {
734
+ "alias": "confirmTerminalPayment";
735
+ "required": false;
736
+ "isSignal": true;
737
+ };
738
+ "cancelTerminal": {
739
+ "alias": "cancelTerminal";
740
+ "required": false;
741
+ "isSignal": true;
742
+ };
743
+ "terminalProviderInput": {
744
+ "alias": "terminalProvider";
745
+ "required": false;
746
+ "isSignal": true;
747
+ };
748
+ "noReadersTextInput": {
749
+ "alias": "noReadersText";
750
+ "required": false;
751
+ "isSignal": true;
752
+ };
753
+ "terminalPollMs": {
754
+ "alias": "terminalPollMs";
755
+ "required": false;
756
+ "isSignal": true;
757
+ };
758
+ "terminalTimeoutMs": {
759
+ "alias": "terminalTimeoutMs";
760
+ "required": false;
761
+ "isSignal": true;
762
+ };
763
+ "readerRefreshMs": {
764
+ "alias": "readerRefreshMs";
765
+ "required": false;
766
+ "isSignal": true;
767
+ };
768
+ "terminalSuccessDelayMs": {
769
+ "alias": "terminalSuccessDelayMs";
770
+ "required": false;
771
+ "isSignal": true;
772
+ };
773
+ }, {
774
+ "closed": "closed";
775
+ "recorded": "recorded";
776
+ "outcome": "outcome";
777
+ }, ["plugins"], never, true, never>;
778
+ }
779
+ export declare function warnQueuedPayment(): void;
780
+ /** Specs only: warn again. This file is NOT re-exported by the public entry (only `warnQueuedPayment` is). */
781
+ declare function resetQueuedPaymentWarning(): void;
782
+ /**
783
+ * Duplicate-payment protection shared by every payment form of the library (Stripe, Square, QuickBooks forms and the payment-panel plugins).
784
+ *
785
+ * One `PaymentAttempt` per form instance holds, in signals: the SYNCHRONOUS in-flight lock, the ATTEMPT KEY (an opaque idempotency key the host sends to its backend with the charge),
786
+ * the UNKNOWN state (timeouts, going offline mid-flight, host-reported ambiguity) with bounded status polling through the host's `checkStatus`, the OFFLINE state and the PAID lock.
787
+ * It never charges and never retries by itself: it only decides whether the form may start an attempt and what the screen says.
788
+ */
789
+ export type PaymentStatusAnswer = 'succeeded' | 'failed' | 'not_found' | 'unknown' | 'in_flight' | 'awaiting_verification';
790
+ /**
791
+ * The host's status check: asks ITS backend for the state of the attempt with this key (`GET /payments/attempts/{key}`). A rejection or an answer slower than `statusCheckTimeoutMs` counts as
792
+ * `'unknown'`. `'awaiting_verification'` = a bank payment that has NOT started because the payer still has to verify the micro-deposits (stays locked and unknown, shows the verification text, sets `awaitingVerification`);
793
+ * `'in_flight'` = the payment IS processing (after the verification, or any other running request: clears `awaitingVerification` and shows the "Checking your payment" text). **A key whose request may still be running must answer `'unknown'` / `'in_flight'`, never `'failed'`**: a `'failed'` answer unlocks the form with a NEW key, so a late-landing original
794
+ * request would become a second charge. `'not_found'` means "the backend has definitively never seen this key": the library only believes it once the attempt is older than the request timeout
795
+ * plus the fail grace (a slow original request may still be on its way), then unlocks with a new key. While the attempt's own request is unsettled `'failed'` / `'not_found'` are ignored for a hard
796
+ * maximum counted from the moment it became unknown; an attempt whose host charge may still be running (`host_silent`, `host`) is given the request timeout plus the grace counted from that
797
+ * moment too, and an attempt adopted from a reload or another tab the request timeout plus the grace counted from the START of the attempt. The request timeout is the one of the form's own request.
798
+ */
799
+ export type CheckPaymentStatusFn = (attemptKey: string) => HostResult<PaymentStatusAnswer>;
800
+ /** Why a new attempt was not started: another one is running (`locked`), the payable is paid (`paid`), the outcome of an earlier attempt is unknown (`unknown`), no connection (`offline`). */
801
+ export type PaymentAttemptRefusal = 'locked' | 'paid' | 'unknown' | 'offline';
802
+ export type PaymentAttemptOutcomeKind = 'succeeded' | 'failed' | 'unknown' | 'refused' | 'pending';
803
+ /**
804
+ * The unified outcome event of a payment form: `reason` is `timeout`, `microdeposits` (a bank payment waits for the payer to verify micro-deposits: unknown-until-verified, never paid), `offline`, `host`, `host_error`, `host_silent`, `status_check`, `error`, `auth_abandoned`, `paid`, `reload`, `other_tab`, `token`,
805
+ * `duplicate_suspected` (an attempt that started after an older one turned out paid ALSO produced a payment: the host must resolve the duplicate),
806
+ * `setup_action` (a SetupIntent that still `requires_action` after `confirmSetup`: the status check decides), `unexpected_status` (an intent state that proves nothing: no intent, an unexpected status, a SetupIntent without a payment method id; the status check decides),
807
+ * `setup_processing` (a protected SetupIntent that is `processing`, e.g. a bank debit: it can still fail, so it is unknown until the status check says it was saved), `return` (the intent a redirect brought back decided the attempt: `succeeded` /
808
+ * `failed`), `return_action` (the redirect brought back an intent that proves nothing, e.g. an unknown status: unknown, the status check decides), `start_over` (the payer chose "Start over": a `failed` outcome with a new key), `no_result`, ...
809
+ */
810
+ export interface PaymentAttemptOutcome {
811
+ kind: PaymentAttemptOutcomeKind;
812
+ attemptKey: string;
813
+ reason?: string;
814
+ /**
815
+ * Only on a `succeeded` outcome that the form did NOT see happen itself (`other_tab`: another tab / page load paid; a late success of an older attempt; a status check that found it paid after the
816
+ * form had moved on): the amount (major units) and method the PAID attempt was started with, so a host that wants to reconcile it can read them. Absent otherwise.
817
+ */
818
+ amount?: number | null;
819
+ method?: string;
820
+ }
821
+ /** What a step of an attempt reports: `success` (money moved / payment exists), `failure` (a DEFINITIVE refusal: new key), `unknown` (ambiguous: key kept, locked), `pending` (a challenge / the host's charge is in progress: lock stays), `released` (failed BEFORE any charge request: unlock, key kept). */
822
+ export type PaymentAttemptKind = 'success' | 'failure' | 'unknown' | 'pending' | 'released';
823
+ export interface PaymentAttemptResult<T> {
824
+ kind: PaymentAttemptKind;
825
+ value?: T;
826
+ reason?: string;
827
+ }
828
+ /**
829
+ * Every machine-readable code of the payments service's money endpoints, mapped explicitly (three groups below). SOURCE: host-kit/contract/payment-errors.json of the forgeroute-payments service (the library
830
+ * cannot import it: these tables repeat its codes, and `payment-errors.contract.spec.ts` embeds a verbatim copy and fails when a code has no row; a new code there must be added here).
831
+ * - NO CHARGE was made (`not_sent`: release, the key is kept): `events_backlog` (new payments are paused), `exceeds_amount_due`, `already_charged_today`, `merchant_not_ready`, `reconnect_required` and
832
+ * `processor_account_changed` (the merchant's processor connection needs attention), `reference_changed` (the balance changed since the link was made), `link_in_use` and `link_already_paid` (payment links),
833
+ * `reader_busy` (a card reader that still holds a payment: the DELETE of the reader was refused, nothing charged);
834
+ * - the attempt exists or runs (`unknown`: look it up by its key, never start another): `payment_in_flight`, `request_in_progress`, `duplicate_suspected` (an identical payment was made moments ago),
835
+ * `idempotency_in_progress`, `idempotency_key_reused`, `idempotency_error`, `payment_intent_unexpected_state`;
836
+ * - the request FAILED for good (`failure`, see {@link PAYMENT_FAILURE_CODES}): `attempt_failed_use_new_key` (a replay of a FAILED attempt, the epoch moves), the capture codes, `link_expired`, `link_cancelled`,
837
+ * `not_supported_by_processor`, `location_required` (Square connect: the seller has several locations, a definitive 400), and four of the six verify-microdeposits codes (`verification_amounts_mismatch`,
838
+ * `verification_attempts_exceeded`, `verification_timeout`, `verification_failed`);
839
+ * - `not_awaiting_verification` and `verification_rate_limited` (verify-microdeposits call only) are `unknown` too: the payment may already be verified / processing, or the try only has to wait.
840
+ */
841
+ export declare const PAYMENT_NO_CHARGE_CODES: readonly string[];
842
+ /**
843
+ * Codes that are a DEFINITIVE failure of the request, never unknown: the failed-attempt replay (the epoch moves), the capture codes of the staff API (`already_captured`, `exceeds_authorized`, `not_capturable`, 409) and the payment-link /
844
+ * processor refusals (`link_expired`, `link_cancelled` = 410, `not_supported_by_processor` = 400), the four definitive verify-microdeposits codes and `location_required` (Square connect, 400). Source: host-kit/contract/payment-errors.json.
845
+ */
846
+ export declare const PAYMENT_FAILURE_CODES: readonly string[];
847
+ /** Is this host error the payments service's "this attempt failed before, use a new attemptKey" answer (code `attempt_failed_use_new_key`)? */
848
+ export declare function isAttemptFailedReplay(error: unknown): boolean;
849
+ /**
850
+ * Is this host error the 409 `payment_in_flight` of an open payment that waits for the payer to verify bank micro-deposits (the service adds `awaitingVerification: true` to the error detail; the browser JSON of
851
+ * an app passes it through as `awaitingVerification`, read from the error, its `error` body or a `detail` object)? Then the payment has NOT started: the text is the verification one, not "already being processed".
852
+ */
853
+ export declare function isAwaitingVerificationError(error: unknown): boolean;
854
+ /** The label key of the translated text for a host error that carries one of the payment-link / reference codes (or a `payment_in_flight` that awaits bank verification), else `null` (the service's own message is shown). */
855
+ export declare function paymentErrorLabelKey(error: unknown): UiLabelKey | null;
856
+ /** Is this host error one a retry cannot change (see {@link FINAL_HOST_CODES})? */
857
+ export declare function isFinalPaymentRefusal(error: unknown): boolean;
858
+ /**
859
+ * Classifies a failed HOST call (the charge request) for `run()`:
860
+ * - `'not_sent'`: nothing was charged: the request never left (the offline layer refused it: `OfflineBlockedError` / `offlineBlocked: true`) or the payments service refused it with one of its NO-CHARGE codes
861
+ * (`events_backlog`, `exceeds_amount_due`, `already_charged_today`, `merchant_not_ready`, `reconnect_required`, `processor_account_changed`, `reference_changed`, `link_in_use`, `link_already_paid`, `reader_busy`, also as a `409`): release with the key kept, show the message;
862
+ * - `'failure'` for the codes of {@link PAYMENT_FAILURE_CODES} (`attempt_failed_use_new_key`: a replay of a FAILED attempt, even as a `409`, the epoch moves so the next click derives a new key; the capture codes
863
+ * `already_captured` / `exceeds_authorized` / `not_capturable`; `link_expired`, `link_cancelled`, `not_supported_by_processor`, `location_required`, and four verify-microdeposits codes: see the list);
864
+ * - `'unknown'`: it may have reached the processor: no answer (status `0`, a network `TypeError`, an abort / timeout), `408`, `425`, `429`, `5xx`, **any other `409`** (a service that answers "already in flight / duplicate
865
+ * suspected / idempotency in progress" must never make the payer pay again), a body or error `code` naming an idempotency / in-flight conflict, an error flagged `unknown: true`, and **an error that carries NO numeric
866
+ * status** (a wrapped `Error`, an error object of a client library): nothing proves it was refused, so only a recognised definitive code decides it;
867
+ * - `'failure'`: the host definitively refused (another `4xx`). The status is read from `status` or `response.status`.
868
+ */
869
+ export declare function classifyHostError(error: unknown): 'failure' | 'unknown' | 'not_sent';
870
+ /**
871
+ * Did the offline layer answer a charge request with its synthetic "queued for later" response (`@forgeroute/ui/offline`: HTTP 202 whose body carries `_offline: true`) instead of sending it? Such an
872
+ * answer is NOT a payment: nothing reached the processor, so the form must release (key kept) and say so. A genuine 202 from a backend ("accepted, still processing") has no `_offline` marker and is not
873
+ * affected. Checks the result itself and, for a host that hands back the response object, its `body`.
874
+ */
875
+ export declare function wasQueuedOffline(result: unknown): boolean;
876
+ export type PaymentAttemptRun<T> = {
877
+ refused: PaymentAttemptRefusal;
878
+ } | (PaymentAttemptResult<T> & {
879
+ refused?: undefined;
880
+ late?: undefined;
881
+ });
882
+ /** Defaults (ms): the status poll interval, how long it polls before offering "Check again", how long one request may take before it counts as unknown, and the status check's own timeout / fail grace. */
883
+ export declare const PAYMENT_STATUS_POLL_MS = 3000;
884
+ export declare const PAYMENT_STATUS_POLL_MAX_MS = 90000;
885
+ export declare const PAYMENT_REQUEST_TIMEOUT_MS = 60000;
886
+ export declare const PAYMENT_STATUS_CHECK_TIMEOUT_MS = 10000;
887
+ export declare const PAYMENT_STATUS_FAIL_GRACE_MS = 60000;
888
+ /** While the attempt's own request is unsettled a status `failed` / `not_found` is ignored for this long after the attempt became unknown. */
889
+ export declare const PAYMENT_STATUS_HARD_MAX_MS = 180000;
890
+ /** One request may take this long while a 3-D Secure challenge or the Square bank window is open (the main request timeout is replaced, not added). */
891
+ export declare const PAYMENT_AUTH_TIMEOUT_MS = 300000;
892
+ /** A token-only form whose host never reports (markSucceeded / markFailed / markUnknown / markNotCharged) becomes unknown after this long. */
893
+ export declare const PAYMENT_HOST_SILENCE_MS = 120000;
894
+ /** An undecided attempt marker older than this is ignored (the page that wrote it is long gone). */
895
+ export declare const PAYMENT_ATTEMPT_MARKER_TTL_MS: number;
896
+ /** An `unknown` marker of a bank payment that waits for the payer to verify micro-deposits lives this long (10 days: the verification window of a bank payment), so a page load meanwhile still does not offer Pay. Cleared earlier by any decision (a status check `succeeded` / `failed` / `not_found`, a start over, `markFailed`). */
897
+ export declare const PAYMENT_ATTEMPT_VERIFICATION_TTL_MS: number;
898
+ /** A tombstone (the attempt was decided: released / failed / succeeded) older than this is ignored. */
899
+ export declare const PAYMENT_ATTEMPT_TOMBSTONE_TTL_MS: number;
900
+ /** The record of a SUCCEEDED attempt (`ui-payment-attempt:<payable>#paid`) is kept this long and locks the payable as PAID in every form that loads meanwhile (the tombstone only covers the first 2 minutes). It is never consumed: a second payment of the same payable is `resetPaid()` or a NEW `payableRef`. */
901
+ export declare const PAYMENT_ATTEMPT_PAID_RECORD_TTL_MS: number;
902
+ /**
903
+ * Where the opaque attempt marker lives (default `localStorage`, shared by every tab of the browser profile; falls back to `sessionStorage`, then `null`). Replace it in specs. It holds ONLY the
904
+ * opaque marker `{ key, startedAt, state, owner, amount, method }` of an UNDECIDED attempt (replaced by a 2-minute tombstone `{ state, key, at, owner }` when it is decided) under
905
+ * `ui-payment-attempt:<payableRef>`, plus one integer epoch under `ui-payment-attempt:<payableRef>#epoch`: never card data, never server data, never a cached response.
906
+ */
907
+ export declare const PAYMENT_ATTEMPT_STORAGE: InjectionToken<() => Storage | null>;
908
+ export declare const PAYMENT_ATTEMPT_STORAGE_PREFIX = "ui-payment-attempt:";
909
+ /** The opaque marker of an attempt that has started and is not decided yet (shared across tabs and reloads while it lasts). */
910
+ export interface PaymentAttemptMarker {
911
+ key: string;
912
+ startedAt: number;
913
+ state: 'inflight' | 'unknown';
914
+ /** Random id of the form instance that wrote it (a second instance / tab / reload is not the owner). */
915
+ owner: string;
916
+ amount: number | null;
917
+ method: string;
918
+ /** `microdeposits` = the payment has NOT started and waits for the payer to verify micro-deposits (restored by a reload / another tab; lives {@link PAYMENT_ATTEMPT_VERIFICATION_TTL_MS}). */
919
+ reason?: 'microdeposits';
920
+ }
921
+ /** What replaces the marker for 2 minutes when the attempt is decided, so other tabs learn HOW it ended (removing the marker alone says nothing). */
922
+ export interface PaymentAttemptTombstone {
923
+ state: 'released' | 'failed' | 'succeeded';
924
+ key: string;
925
+ at: number;
926
+ owner: string;
927
+ /** Only on a `succeeded` tombstone: what the paid attempt was started with, so another tab / page load can hand it to a host that reconciles. */
928
+ amount?: number | null;
929
+ method?: string;
930
+ }
931
+ /** The record of a succeeded attempt, kept 24 hours under `ui-payment-attempt:<payable>#paid` (local state that MIRRORS a server outcome: it never replaces the backend's own record). */
932
+ export interface PaymentAttemptPaidRecord {
933
+ key: string;
934
+ amount: number | null;
935
+ method: string;
936
+ at: number;
937
+ owner: string;
938
+ }
939
+ /** What a payment-panel plugin forwards to its body, so the HOST can resolve an undecided attempt without a status check (`<ui-square-payment-method #sq>` then `sq.markSucceeded()`). */
940
+ export interface PaymentAttemptControls {
941
+ markUnknown(): void;
942
+ markSucceeded(): void;
943
+ markFailed(): void;
944
+ markNotCharged(): void;
945
+ /** A deliberate second payment of the payable: forget the paid state, move the epoch (a NEW attempt key). */
946
+ resetPaid(): void;
947
+ }
948
+ export interface PaymentAttemptOptions {
949
+ destroyRef: DestroyRef;
950
+ /** The payable this form pays (a unit balance, an invoice, a reservation): the marker of an undecided attempt is stored under it, and without a host `attemptKey` the key is DERIVED from it. `null` = memory only. */
951
+ payableRef: () => string | null;
952
+ amount: () => number | null;
953
+ method: () => string;
954
+ /** A key the host supplies: used as it is (never generated, never renewed). */
955
+ attemptKey: () => string | null;
956
+ checkStatus: () => CheckPaymentStatusFn | null;
957
+ /** The payable is paid (host re-render, back navigation): every attempt is refused for good. */
958
+ paid: () => boolean;
959
+ /** The host reports an ambiguous result (its own timeout): the form goes to the unknown state while this is true. */
960
+ hostPending?: () => boolean;
961
+ /** A step that is in flight when the connection drops becomes UNKNOWN (default true). A form that only TOKENIZES (no charge yet) turns it off: the token call answers or fails by itself. */
962
+ offlineMidFlight?: boolean;
963
+ pollMs?: () => number;
964
+ pollMaxMs?: () => number;
965
+ /** A status check slower than this counts as `'unknown'` (default 10 s). */
966
+ statusTimeoutMs?: () => number;
967
+ /** An attempt adopted from a reload / another tab, and a `not_found`, is given the request timeout plus this long before a `failed` / `not_found` is believed (default 60 s). */
968
+ failGraceMs?: () => number;
969
+ /** While the attempt's own request is unsettled a `failed` / `not_found` is ignored for this long after the attempt became unknown (default 180 s). */
970
+ statusHardMaxMs?: () => number;
971
+ /**
972
+ * Default true. False (a setup form that saves a payment method and may be used again later): a success does NOT lock the payable for 24 hours. It writes no `#paid` record, does not set `succeeded` / `paidLocked`,
973
+ * ignores the succeeded tombstone and paid record when a new attempt starts or a form mounts, and moves the epoch (the next attempt has a NEW derived key). The `succeeded` outcome is still emitted and an attempt
974
+ * is still never started while another is in flight or unknown. A success that arrives after the form was destroyed or the payable changed also moves the epoch (no tombstone is written). A second `succeed()` with no attempt started in between
975
+ * (a host `markSucceeded()` after `(confirmed)`, a repeated `handleReturn()`) settles nothing again; a late success of a key already reported is silent, and one of ANOTHER key (e.g. an older epoch that answers after a start over and a newer save)
976
+ * is reported once as `unknown` / `duplicate_suspected` for the host to resolve.
977
+ */
978
+ lockAfterSuccess?: () => boolean;
979
+ /** The request timeout is replaced by this while a 3-D Secure challenge / the bank window is open (default 300 s). */
980
+ authTimeoutMs?: () => number;
981
+ /** A token-only form whose host never reports becomes unknown after this long (default 120 s). */
982
+ hostSilenceMs?: () => number;
983
+ storage?: () => Storage | null;
984
+ /** Managed environments where `navigator.onLine === false` is a false negative (captive portal, VPN): do not refuse a click because of it (default false). */
985
+ offlineOverride?: () => boolean;
986
+ /** The clock (specs). */
987
+ now?: () => number;
988
+ onOutcome?: (outcome: PaymentAttemptOutcome) => void;
989
+ onInFlightChange?: (inFlight: boolean) => void;
990
+ onKeyChange?: (key: string) => void;
991
+ }
992
+ export declare class PaymentAttempt {
993
+ private readonly o;
994
+ /** A step of an attempt is running (set in the SAME synchronous tick as the first click / Enter / programmatic call). */
995
+ readonly inFlight: import("@angular/core").WritableSignal<boolean>;
996
+ /** The outcome of an attempt is not known: Pay stays locked, the screen says "Checking your payment...". */
997
+ readonly unknown: import("@angular/core").WritableSignal<boolean>;
998
+ /** A status check is running. */
999
+ readonly checking: import("@angular/core").WritableSignal<boolean>;
1000
+ /** The bounded polling gave up: "Check again" is offered. */
1001
+ readonly pollExpired: import("@angular/core").WritableSignal<boolean>;
1002
+ /** A payment of this form succeeded (locks the form until the host resets the payable). */
1003
+ readonly succeeded: import("@angular/core").WritableSignal<boolean>;
1004
+ /** The token was handed to the host, which is now charging: the screen says "Waiting for your payment to be confirmed" until the host reports (or stays silent too long). */
1005
+ readonly waitingForHost: import("@angular/core").WritableSignal<boolean>;
1006
+ /** The marker could not be written (storage blocked or full): reload / second-tab protection is not active. */
1007
+ readonly markerWriteFailed: import("@angular/core").WritableSignal<boolean>;
1008
+ readonly offline: import("@angular/core").WritableSignal<boolean>;
1009
+ /** The browser says offline AND the host did not turn `offlineOverride` on: the click is refused and the offline notice shows. */
1010
+ readonly blockedOffline: import("@angular/core").Signal<boolean>;
1011
+ readonly paidLocked: import("@angular/core").Signal<boolean>;
1012
+ /** No new attempt may start. */
1013
+ readonly locked: import("@angular/core").Signal<boolean>;
1014
+ /**
1015
+ * A bank payment that needs the payer to verify micro-deposits (reason `microdeposits`): the payment has NOT started and nothing is charged until the payer verifies them. It is an UNKNOWN-until-verified state
1016
+ * (locked, the status check decides), never paid; the status block says so in plain words.
1017
+ */
1018
+ private readonly verifying;
1019
+ /** Read-only for hosts: only the attempt decides (a `microdeposits` unknown, a stored marker, a status answer). */
1020
+ readonly awaitingVerification: import("@angular/core").Signal<boolean>;
1021
+ /** The host gave a status check, so the unknown state can resolve by itself. */
1022
+ readonly canCheck: import("@angular/core").Signal<boolean>;
1023
+ /** The key, amount, method and payable the running / undecided attempt was STARTED with, `null` when no attempt is undecided. */
1024
+ private readonly pinned;
1025
+ readonly pinnedAmount: import("@angular/core").Signal<number | null>;
1026
+ readonly pinnedMethod: import("@angular/core").Signal<string | null>;
1027
+ readonly pinnedRef: import("@angular/core").Signal<string | null>;
1028
+ /** Bumped when an attempt of this payable is decided: the next DERIVED key differs from every finished one. */
1029
+ private readonly epoch;
1030
+ private readonly renewTick;
1031
+ /** The attempt key in effect: the PINNED key of a running / undecided attempt, else the host's, else (with a payableRef) the key derived from payable, amount, method and epoch, else a random one. */
1032
+ readonly key: import("@angular/core").Signal<string>;
1033
+ private readonly id;
1034
+ private readonly memKeys;
1035
+ private destroyed;
1036
+ private unknownReason;
1037
+ private unknownSince;
1038
+ private liveRun;
1039
+ private runSeq;
1040
+ /** Key of an attempt that started while an OLDER one turned out paid: its own result must not change the paid state and is reported as a suspected duplicate. */
1041
+ private watchKey;
1042
+ /** Key of the attempt that made the payable paid (a late success with ANOTHER key is a suspected duplicate). */
1043
+ private paidKey;
1044
+ /** Keys already reported as `duplicate_suspected` (reported once each). */
1045
+ private readonly duplicates;
1046
+ /** Only with `lockAfterSuccess` false: a success was already settled and no new attempt began since, so a second `succeed()` (a host `markSucceeded()` after `(confirmed)`, a repeated `handleReturn()`) settles nothing again. Cleared by `begin()`, `resetPaid()` and a payable change. */
1047
+ private lastSuccessIdle;
1048
+ /** Only with `lockAfterSuccess` false: keys whose success was already reported, so a late answer for the same key is silent and a distinct key is reported as `duplicate_suspected`. */
1049
+ private readonly reportedKeys;
1050
+ /** The request timeout of the newest `run()` (the status grace is measured against it, not against the default). */
1051
+ private requestMs;
1052
+ private pollTimer;
1053
+ private silenceTimer;
1054
+ private pollElapsed;
1055
+ private pollGen;
1056
+ private checkRun;
1057
+ private hostWasPending;
1058
+ private lastRef;
1059
+ private readonly win;
1060
+ private readonly onOffline;
1061
+ private readonly onOnline;
1062
+ private readonly onStorage;
1063
+ /** A frozen / back-forward-cached page missed its storage events: read the shared state again when it comes back. */
1064
+ private readonly onResync;
1065
+ private readonly onVisible;
1066
+ constructor(o: PaymentAttemptOptions);
1067
+ /** Which storage protects this payable: `shared` (every tab), `tab` (sessionStorage fallback: this tab only), `none` (blocked). */
1068
+ storageScope(): 'shared' | 'tab' | 'none';
1069
+ /**
1070
+ * Starts an attempt: SYNCHRONOUS, so a second click / Enter / programmatic call in the same tick (or any later one while it runs) is refused. Nothing is sent when it refuses.
1071
+ * `locked` (a double click) is silent; `paid`, `unknown` and `offline` also emit a `refused` outcome. The key, amount, method and payable are PINNED here: later input changes never move a running attempt.
1072
+ */
1073
+ begin(): {
1074
+ ok: true;
1075
+ key: string;
1076
+ } | {
1077
+ ok: false;
1078
+ reason: PaymentAttemptRefusal;
1079
+ };
1080
+ /** The attempt ended BEFORE any charge request (validation, tokenization, buyer verification): unlock, the key is kept. */
1081
+ release(): void;
1082
+ /** Clears the marker of an attempt that never sent anything, even when the form is already destroyed (a destroyed form must not leave a 30-minute lock behind). */
1083
+ abandon(): void;
1084
+ /** The host says nothing was sent to the processor (it did not use the token, its call never left): unlock, the key is kept. Only valid for "NOT SENT": a retry must find any attempt state the backend holds for the key. */
1085
+ markNotCharged(): void;
1086
+ /** The payment succeeded (or exists and is settling): the form locks for this payable. Idempotent. */
1087
+ succeed(reason?: string): void;
1088
+ /**
1089
+ * The host starts a deliberate SECOND payment of this payable (an explicit "pay again" flow): forgets that this form instance saw a success, removes the succeeded record and tombstone and moves the epoch, so the next
1090
+ * attempt has a NEW key. Does nothing against the host's own `paid` input (the host clears that itself) and is IGNORED while an attempt is running or unknown (call it again once that attempt is decided).
1091
+ */
1092
+ resetPaid(): void;
1093
+ /** A DEFINITIVE failure (declined, failed, status check says failed): unlock, with a NEW key. Never for a timeout or an offline loss. Ignored after a success. */
1094
+ fail(reason?: string, external?: boolean): void;
1095
+ /** The payer chose "Start over" after the polling window: unlock with a NEW key (only offered when the backend allows ONE open or succeeded attempt per payable, which is what makes it safe). */
1096
+ startOver(): void;
1097
+ /** The outcome is ambiguous (timeout, offline mid-flight, host-reported, reload, another tab): lock, KEEP (and pin) the key, check the status. Idempotent. */
1098
+ markUnknown(reason: string, verification?: boolean): void;
1099
+ /**
1100
+ * The step that needs the processor is in progress elsewhere: the lock STAYS ON until the host or a status check decides. `token` = the host is charging a token (the screen says "Waiting for your
1101
+ * payment to be confirmed", and a host that stays silent for `hostSilenceMs` makes the outcome unknown); `auth_required` / `bank_window` = a 3-D Secure challenge / the bank window is open (the request
1102
+ * timeout is replaced by `authTimeoutMs`).
1103
+ */
1104
+ markPending(reason?: string): void;
1105
+ /** Asks the host's status check once (a newer call supersedes an older one). `succeeded` -> success state, `failed` / `not_found` -> unlocked with a new key (once believed), anything else -> stays locked. */
1106
+ checkNow(): Promise<void>;
1107
+ /** "Check again": polls for another bounded round. */
1108
+ checkAgain(): void;
1109
+ /**
1110
+ * Runs one attempt: `begin()` (synchronous), then `op(key)`, raced against `timeoutMs` (replaced by `authTimeoutMs` while `markPending('auth_required' | 'bank_window')` is on). The result decides the
1111
+ * lock: `success` locks for good, `failure` unlocks with a new key, `released` unlocks with the same key, `pending` keeps the lock, `unknown` and a timeout (or an exception) lock in the unknown state.
1112
+ * An answer that arrives AFTER the timeout still settles the attempt while it is still THE attempt (`onLate`); once the attempt moved on (a status check unlocked it, a newer attempt began) a late
1113
+ * failure / release / unknown is dropped and a late SUCCESS only marks the payable paid (and is reported once with its own, old key), never touching the newer attempt's lock, pin or marker.
1114
+ */
1115
+ run<T>(op: (key: string) => Promise<PaymentAttemptResult<T>>, options?: {
1116
+ timeoutMs?: number;
1117
+ onLate?: (result: PaymentAttemptResult<T>) => void;
1118
+ }): Promise<PaymentAttemptRun<T>>;
1119
+ /**
1120
+ * Is the run that was given `key` still THE attempt in progress (not replaced by a newer attempt, not decided, the form not destroyed)? An op uses it to skip every screen side effect of a LATE answer
1121
+ * (a decline text, `setBusy(false)`, releasing an inner form) that would otherwise land on the NEWER attempt's screen. The result it returns is still applied by `run()` with the same rules.
1122
+ */
1123
+ isLive(key: string): boolean;
1124
+ /** Applies the result of a step to THIS attempt (see {@link PaymentAttemptKind}). */
1125
+ apply<T>(result: PaymentAttemptResult<T>): void;
1126
+ private now;
1127
+ /** A success locks the payable as paid (default); `false` only for a form that opted out with `lockAfterSuccess`. */
1128
+ private keepsLock;
1129
+ /** Newest run that is still THE attempt in progress (same pinned key, not replaced by a newer run). */
1130
+ private isCurrent;
1131
+ private applyRun;
1132
+ /**
1133
+ * The form was destroyed before this attempt's answer arrived (the panel closes when it records the payment). The host is not told (nobody listens any more); the records are written so the next form of the
1134
+ * payable starts paid (success), unlocked with a new key (failure) or unlocked (released), and a development warning says it happened.
1135
+ */
1136
+ private settleDestroyed;
1137
+ /** The result of an attempt that belongs to ANOTHER payable than the one on screen: only that payable's records change; this form's lock, pin and paid state are for the payable on screen. */
1138
+ private settleOtherPayable;
1139
+ /**
1140
+ * An attempt other than the current one turned out paid (a late answer of an older attempt, a late status answer, or another tab's success): the payable IS paid. A newer attempt's lock, pin and marker are
1141
+ * left alone. When the payable was ALREADY paid by a different key, the second payment is a suspected duplicate: it is reported once (`unknown` / `duplicate_suspected`, with ITS key) for the host to resolve.
1142
+ */
1143
+ private lateSuccess;
1144
+ /**
1145
+ * The result of the attempt that was running when the payable turned out paid: it only releases its own lock (and leaves its own marker as `succeeded`). If it was an attempt with ANOTHER key and it ALSO
1146
+ * succeeded it is reported as a suspected duplicate for the host to resolve; one with the SAME key is that very payment and settles silently.
1147
+ */
1148
+ private settleWatched;
1149
+ private currentRunUnsettled;
1150
+ /**
1151
+ * Is a `failed` / `not_found` answer too early to believe? (see {@link CheckPaymentStatusFn})
1152
+ * - the attempt's own request is still unsettled: ignored for `statusHardMaxMs` after it became unknown (counted from there, so a long auth timeout does not use it up);
1153
+ * - the host's charge may still be running (`host_silent`, `host`): the request timeout plus the grace, counted from the moment it became unknown;
1154
+ * - adopted from a reload / another tab, or `not_found`: the request timeout plus the grace, counted from the START of the attempt.
1155
+ */
1156
+ private mustWait;
1157
+ /** Replaces the request timeout of the running request; `false` when no request is running. */
1158
+ private extendRunTimeout;
1159
+ private clearSilence;
1160
+ private refuse;
1161
+ private emit;
1162
+ /** What a NEW attempt starts with (its key, amount, method and payable never follow later input changes). */
1163
+ private newPin;
1164
+ private setInFlight;
1165
+ private leaveUnknown;
1166
+ /** The host says its own ambiguity is over: leave the unknown state without deciding (the host reports the result itself). */
1167
+ private endUnknown;
1168
+ private startPolling;
1169
+ /** One round: the check now, then (while still unknown and inside the bounded window) the next one after `pollMs`. */
1170
+ private pollOnce;
1171
+ private stopPolling;
1172
+ private amountPart;
1173
+ private tupleId;
1174
+ /**
1175
+ * The key of a NEW attempt: the host's; else, with a payableRef, a DERIVED readable one (`pa_<payable>_<cents>_<method>_e<epoch>`) so every tab and every reload of the same payable, amount and
1176
+ * method hold the SAME key without talking to each other (the epoch only grows when an attempt of the payable is decided); else a random one held in memory per (amount, method).
1177
+ */
1178
+ private resolveKey;
1179
+ /** The attempt with `finished` ended definitively: no key may be resolved again for it. With `bumpRef` (a definitive FAILURE of this payable) the epoch grows too, so the next attempt gets a new derived key. */
1180
+ private renew;
1181
+ private store;
1182
+ private markerKey;
1183
+ private epochName;
1184
+ private storedEpoch;
1185
+ /** The shared epoch of `ref` (cleared storage reads as 0: a replayed key then returns the ORIGINAL payment, which the host must record idempotently). */
1186
+ private readEpoch;
1187
+ /** Never goes backwards: the next epoch is one above the larger of this page's and the stored one. */
1188
+ private bumpEpoch;
1189
+ private parseStored;
1190
+ private readStored;
1191
+ /** A pending marker of this payable that another form instance (tab, page load) wrote and that is not expired. */
1192
+ private foreignMarker;
1193
+ /**
1194
+ * COMPARE-AND-WRITE: the stored record belongs to ANOTHER attempt (a different key) and must not be replaced or removed by this instance. A marker is only blocked by an undecided marker of another key
1195
+ * (a tombstone of a finished attempt is simply replaced by the next attempt's marker); a tombstone / removal is blocked by ANY stored record of another key (this instance's decision is stale).
1196
+ */
1197
+ private storedOfOther;
1198
+ private writeMarker;
1199
+ private writeTombstone;
1200
+ /** The attempt was decided: replace its marker by a short tombstone so other tabs learn HOW it ended (a removed marker says nothing). */
1201
+ private endMarker;
1202
+ private removeMarker;
1203
+ private paidName;
1204
+ /** The succeeded record of a payable (24 hours), or null. */
1205
+ private readPaidRecord;
1206
+ private writePaidRecord;
1207
+ private removePaidRecord;
1208
+ /**
1209
+ * The 24-hour record of a payment that succeeded for this payable: the payable is PAID here too for the WHOLE 24 hours (whenever the record exists and the host's `paid` input is false), however long ago it was written.
1210
+ * The record is never consumed by a form that loads later: a deliberate second payment is `resetPaid()` or a NEW `payableRef` (the host contract), never a silent new key. Returns true when the payable was marked paid.
1211
+ */
1212
+ private checkPaidRecord;
1213
+ /** Best effort, at most one pass per `begin()`: drops this library's own expired markers and tombstones (never the epochs: removing one would let a finished key be derived again). */
1214
+ private sweepStale;
1215
+ /** What another tab (or a re-read of the storage) says about this payable. */
1216
+ private react;
1217
+ /**
1218
+ * Another tab decided an attempt of this payable. `succeeded`: the payable is PAID (same key as the undecided attempt: it is that payment; another key while paid / running: it is recorded with its own key and a
1219
+ * second payment is reported as a suspected duplicate). `failed` / `released`: only an attempt this instance ADOPTED from that tab is unlocked by it.
1220
+ */
1221
+ private onTombstone;
1222
+ /** Takes over an attempt another instance started: pin ITS key, lock in the unknown state and ask the status check. */
1223
+ private adopt;
1224
+ private onPayableChange;
1225
+ }
1226
+ /**
1227
+ * Readiness gate of the payment forms: Pay is blocked, with a specific reason, while we can already tell a payment cannot complete AND be recorded (offline, a connection too slow to pay
1228
+ * safely, a blocked payment SDK, a browser that cannot pay safely, the host's backend not ready, an earlier payment of unknown outcome). It is evaluated when the form opens, every
1229
+ * `everyMs` (default 10 s) while it is open, on online / offline / visibility events, and AGAIN synchronously right before every submit (`passSync()`): a gate that turned false after
1230
+ * the last render blocks the click and sends nothing.
1231
+ */
1232
+ export interface PaymentReadinessResult {
1233
+ ready: boolean;
1234
+ reasons: string[];
1235
+ /** With the reason `payment_in_flight`: the open payment waits for the payer to verify bank micro-deposits (it has NOT started). The text says so instead of "already being processed". Ignored for any other reason. */
1236
+ awaitingVerification?: boolean;
1237
+ }
1238
+ /** The host's check (`GET /api/payments/ready?payable=...`): `{ ready, reasons }`. A slow answer (> `readinessTimeoutMs`) counts as `slow_connection`, a rejection as `offline` / `slow_connection`. */
1239
+ export type ReadinessCheckFn = () => HostResult<PaymentReadinessResult>;
1240
+ /** The machine reasons the library knows (a host may send others: they block with a generic text). */
1241
+ export declare const PAYMENT_READINESS_REASONS: readonly ["offline", "slow_connection", "sdk_blocked", "service_unavailable", "merchant_not_ready", "events_backlog", "payable_changed", "already_paid", "payment_in_flight", "unsupported_browser", "unknown_payment", "checking", "awaiting_verification", "reconnect_required", "outcome_unknown"];
1242
+ export declare const PAYMENT_READINESS_TIMEOUT_MS = 4000;
1243
+ export declare const PAYMENT_READINESS_EVERY_MS = 10000;
1244
+ /** A measured round trip above this (ms) from `navigator.connection.rtt` counts as a slow connection. */
1245
+ export declare const PAYMENT_READINESS_SLOW_RTT_MS = 2000;
1246
+ export type PaymentSdkState = 'ok' | 'loading' | 'blocked';
1247
+ export interface PaymentReadinessOptions {
1248
+ destroyRef: DestroyRef;
1249
+ /** The host's check; `null` = only the built-in checks. */
1250
+ check: () => ReadinessCheckFn | null;
1251
+ timeoutMs: () => number;
1252
+ everyMs?: () => number;
1253
+ /** The processor SDK / tokenizer state of the form: `'blocked'` (the script or the form could not be loaded) blocks with `sdk_blocked`. */
1254
+ sdk: () => PaymentSdkState;
1255
+ /** An earlier payment of unknown outcome is pending (blocks with `unknown_payment`). */
1256
+ unknownPending: () => boolean;
1257
+ /** The gate applies (the Stripe form turns it off unless duplicate protection is on). */
1258
+ enabled?: () => boolean;
1259
+ /** Is the attempt-marker storage usable? (warning only: without it a reload or a second tab cannot be recognised as an undecided attempt.) */
1260
+ storageAvailable?: () => boolean;
1261
+ /** Managed environments where `navigator.onLine === false` is a false negative (captive portal, VPN): the browser's offline flag does not block (default false). */
1262
+ offlineOverride?: () => boolean;
1263
+ onChange?: (state: PaymentReadinessResult) => void;
1264
+ }
1265
+ /** The label key that words a refusal reason (a readiness reason, `paid`, `unknown`, `offline`): one mapping for every form and plugin. */
1266
+ export declare function refusalLabelKey(reason: string): UiLabelKey;
1267
+ /** What the browser itself tells about the environment (pure: easy to fake). */
1268
+ export declare function builtInReadinessReasons(ignoreOffline?: boolean): string[];
1269
+ export declare class PaymentReadiness {
1270
+ private readonly o;
1271
+ /** The host's last answer's reasons (empty until it answered). */
1272
+ private readonly hostReasons;
1273
+ /** The host's last answer said the open payment awaits bank verification (only meaningful with the reason `payment_in_flight`). */
1274
+ private readonly hostAwaitingVerification;
1275
+ /** The check the host's last answer belongs to (a host check added or replaced later keeps the gate closed, reason `checking`, until it has answered). */
1276
+ private readonly answeredFor;
1277
+ /** The first evaluation finished: no host check to wait for, or the current one has answered. */
1278
+ readonly evaluated: import("@angular/core").Signal<boolean>;
1279
+ private readonly builtIns;
1280
+ /** Why Pay is blocked, most important first; empty = ready. */
1281
+ readonly reasons: import("@angular/core").Signal<string[]>;
1282
+ readonly ready: import("@angular/core").Signal<boolean>;
1283
+ /** The label key of the text for `reason`: the verification text for a `payment_in_flight` that awaits the payer's bank verification, else {@link refusalLabelKey}. */
1284
+ labelKeyFor(reason: string): UiLabelKey;
1285
+ /** Not blocking: the browser blocks storage, so a reload during a payment cannot reuse the attempt key automatically. */
1286
+ readonly storageWarning: import("@angular/core").Signal<boolean>;
1287
+ private destroyed;
1288
+ private timer;
1289
+ private readonly win;
1290
+ private readonly doc;
1291
+ private run;
1292
+ private loop;
1293
+ private readonly onEvent;
1294
+ private builtIn;
1295
+ constructor(o: PaymentReadinessOptions);
1296
+ /**
1297
+ * The gate right now, SYNCHRONOUSLY (called by every submit before anything is sent): the built-in checks are read afresh, the host's last answer and the SDK / unknown state are
1298
+ * current. A host check that has not answered yet keeps the gate closed. A fresh host check starts in the background for the NEXT click (a click must stay synchronous: a bank window
1299
+ * is only allowed inside the user gesture).
1300
+ */
1301
+ passSync(): boolean;
1302
+ /** Runs the checks: the built-ins now, then the host's check (raced against the timeout). */
1303
+ evaluate(): Promise<void>;
1304
+ /** Starts (or restarts) the periodic loop: any callback of an earlier schedule is invalidated, so two loops can never run side by side. */
1305
+ private schedule;
1306
+ }
1307
+ /** The inputs every protected payment form declares (the same names and defaults everywhere). */
1308
+ export interface PaymentProtectionInputs {
1309
+ payableRef: Signal<string | null>;
1310
+ attemptKey: Signal<string | null>;
1311
+ checkStatus: Signal<CheckPaymentStatusFn | null>;
1312
+ paid: Signal<boolean>;
1313
+ hostPending: Signal<boolean>;
1314
+ statusPollMs: Signal<number>;
1315
+ statusPollMaxMs: Signal<number>;
1316
+ /** A status check slower than this counts as unknown. */
1317
+ statusCheckTimeoutMs: Signal<number>;
1318
+ /** A status answer `failed` is ignored this long while the attempt's own request is unsettled. */
1319
+ statusFailGraceMs: Signal<number>;
1320
+ /** While the attempt's own request is unsettled a status answer `failed` / `not_found` is ignored this long after it became unknown (optional: default 180 s). */
1321
+ statusHardMaxMs?: Signal<number>;
1322
+ /** The request timeout is replaced by this while a 3-D Secure challenge / the bank window is open (optional: default 300 s). */
1323
+ authTimeoutMs?: Signal<number>;
1324
+ /** A token-only form whose host never reports becomes unknown after this long (optional: default 120 s). */
1325
+ hostSilenceMs?: Signal<number>;
1326
+ /** Managed environments where `navigator.onLine === false` is a false negative (captive portal, VPN): do not refuse a payment because of it (optional: default false). */
1327
+ offlineOverride?: Signal<boolean>;
1328
+ readinessCheck: Signal<ReadinessCheckFn | null>;
1329
+ readinessTimeoutMs: Signal<number>;
1330
+ readinessEveryMs: Signal<number>;
1331
+ }
1332
+ export interface PaymentProtectionOptions {
1333
+ amount: () => number | null;
1334
+ method: () => string;
1335
+ /** The processor SDK / tokenizer / form of this component. */
1336
+ sdk?: () => PaymentSdkState;
1337
+ /** The Stripe form turns everything off unless its duplicate-protection flag is on (existing behaviour stays exactly as it was). */
1338
+ enabled?: () => boolean;
1339
+ /** `false` = a success does not lock the payable for 24 hours (a setup form that opted out with `lockAfterSuccess`); default true. */
1340
+ lockAfterSuccess?: () => boolean;
1341
+ /** A form that only TOKENIZES keeps its lock to the token call: going offline then does not make the outcome unknown. */
1342
+ offlineMidFlight?: boolean;
1343
+ onOutcome?: (outcome: PaymentAttemptOutcome) => void;
1344
+ onInFlightChange?: (inFlight: boolean) => void;
1345
+ onKeyChange?: (key: string) => void;
1346
+ onReadinessChange?: (state: PaymentReadinessResult) => void;
1347
+ }
1348
+ /**
1349
+ * Builds the attempt (lock, key, unknown state) and the readiness gate of one payment form from its inputs. Call it in the component's constructor / field initializers (injection
1350
+ * context): it injects the destroy hook and the attempt-marker storage seam.
1351
+ */
1352
+ export declare function createPaymentProtection(inputs: PaymentProtectionInputs, options: PaymentProtectionOptions): {
1353
+ attempt: PaymentAttempt;
1354
+ readiness: PaymentReadiness;
1355
+ };
1356
+ /** What a protected attempt is for: a payment (default) or saving a payment method (a SetupIntent: nothing is charged). */
1357
+ export type PaymentAttemptPurpose = 'payment' | 'setup';
1358
+ /** The label key to show for `key` in an attempt of `kind` (the same key for a payment). */
1359
+ export declare function attemptLabelKey(key: UiLabelKey, kind: PaymentAttemptPurpose): UiLabelKey;
1360
+ /**
1361
+ * What the payer reads while a payment attempt is not a plain "form" any more: "Checking your payment..." (the outcome is unknown: Pay stays locked, never "failed, try again"), the
1362
+ * offline notice, and the paid state. A polite live region announces each state. Used by every payment form of the library; hosts normally never place it themselves.
1363
+ */
1364
+ export declare class PaymentAttemptStatusComponent {
1365
+ protected readonly labels: UiLabelsService;
1366
+ /** The attempt of the form this status belongs to. */
1367
+ readonly attempt: import("@angular/core").InputSignal<PaymentAttempt>;
1368
+ /** Show the paid state (a form that has its own success notice sets it off while that notice is up). */
1369
+ readonly showPaid: import("@angular/core").InputSignal<boolean>;
1370
+ /** Offer "Start over" after the polling window (only for a backend that allows ONE open or succeeded attempt per payable: that rule is what makes it safe). */
1371
+ readonly allowStartOver: import("@angular/core").InputSignal<boolean>;
1372
+ /** The readiness gate of the form (its reasons are shown while Pay is blocked). */
1373
+ readonly readiness: import("@angular/core").InputSignal<PaymentReadiness | null>;
1374
+ /** "Retry loading the payment form" was pressed (shown for `sdk_blocked`). */
1375
+ readonly retryLoad: import("@angular/core").OutputEmitterRef<void>;
1376
+ /** What the attempt is for: `'setup'` (saving a payment method) shows the setup wording instead of the payment wording. */
1377
+ readonly kind: import("@angular/core").InputSignal<PaymentAttemptPurpose>;
1378
+ /** The text of `key` for this attempt's kind. */
1379
+ protected text(key: UiLabelKey): string;
1380
+ protected readonly firstReason: import("@angular/core").Signal<string>;
1381
+ /** The translated text of the first blocking reason; a reason the library does not know blocks with the generic text. */
1382
+ protected readonly readinessText: import("@angular/core").Signal<string>;
1383
+ /** The text the live region reads: the current state, never empty while a state is on screen. */
1384
+ protected readonly announcement: import("@angular/core").Signal<string>;
1385
+ static ɵfac: i0.ɵɵFactoryDeclaration<PaymentAttemptStatusComponent, never>;
1386
+ static ɵcmp: i0.ɵɵComponentDeclaration<PaymentAttemptStatusComponent, "ui-payment-attempt-status", never, {
1387
+ "attempt": {
1388
+ "alias": "attempt";
1389
+ "required": true;
1390
+ "isSignal": true;
1391
+ };
1392
+ "showPaid": {
1393
+ "alias": "showPaid";
1394
+ "required": false;
1395
+ "isSignal": true;
1396
+ };
1397
+ "allowStartOver": {
1398
+ "alias": "allowStartOver";
1399
+ "required": false;
1400
+ "isSignal": true;
1401
+ };
1402
+ "readiness": {
1403
+ "alias": "readiness";
1404
+ "required": false;
1405
+ "isSignal": true;
1406
+ };
1407
+ "kind": {
1408
+ "alias": "kind";
1409
+ "required": false;
1410
+ "isSignal": true;
1411
+ };
1412
+ }, {
1413
+ "retryLoad": "retryLoad";
1414
+ }, never, never, true, never>;
1415
+ }
1416
+ /** A charge type the host offers (for example a community's configured charge types). `defaultAmount` and `description` pre-fill the form. */
1417
+ export interface ChargeTypeOption {
1418
+ /** Stable id (used for `track`; not sent). */
1419
+ id: string;
1420
+ /** The type's name; it is what the form value carries (`chargeType`). */
1421
+ name: string;
1422
+ /** Pre-fills the amount when the amount is still empty. */
1423
+ defaultAmount?: number | null;
1424
+ /** Replaces the description when the type is picked. */
1425
+ description?: string | null;
1426
+ }
1427
+ /** What the form hands the host. */
1428
+ export interface ChargeFormData {
1429
+ chargeType: string;
1430
+ amount: number | null;
1431
+ /** ISO date `YYYY-MM-DD`. */
1432
+ dueDate: string;
1433
+ description: string;
1434
+ }
1435
+ /**
1436
+ * Add-a-charge form, the same in every app: charge type, amount, due date and an optional description, built only from library inputs.
1437
+ * It does not talk to a server: the host passes the `chargeTypes` and saves the `submitted` data.
1438
+ *
1439
+ * <ui-charge-form [open]="open()" [chargeTypes]="types()" [saving]="saving()" (submitted)="save($event)" (closed)="open.set(false)" />
1440
+ *
1441
+ * Two shapes:
1442
+ * - `panel` (default `true`): it renders inside its own `ui-side-panel` with Cancel and the primary button (`submitLabel`).
1443
+ * `open`, `title`, `subtitle` drive the panel; `closed` is Cancel / close / Escape (not emitted while `saving`).
1444
+ * - `[panel]="false"`: body only, for a host that supplies its own panel or page section. Read `formChange` / `validChange` or call `getFormData()`.
1445
+ *
1446
+ * Rules (the common backend rules, adjustable): the type is required; the amount is required, between `minAmount` (0.01) and `maxAmount` (99,999.99)
1447
+ * with at most 2 decimals; the due date is required (default today, or `defaultDueDate`); the description is at most `descriptionMaxLength` (2000).
1448
+ * Picking a type fills the amount (only when it is still empty) and the description from the type. When `chargeTypes` is empty and `loading` is false
1449
+ * the form shows an empty state (`emptyTitle`, `emptyMessage`) instead of the fields and the primary button stays disabled.
1450
+ */
1451
+ export declare class ChargeFormComponent {
1452
+ protected readonly labels: UiLabelsService;
1453
+ /** The charge types to choose from. */
1454
+ readonly chargeTypes: import("@angular/core").InputSignal<ChargeTypeOption[]>;
1455
+ /** True while the host is still loading the types: no empty state is shown. */
1456
+ readonly loading: import("@angular/core").InputSignal<boolean>;
1457
+ /** True while the host saves: the primary button shows its spinner and Cancel / Escape do nothing. */
1458
+ readonly saving: import("@angular/core").InputSignal<boolean>;
1459
+ /** `true` (default): rendered inside its own `ui-side-panel`. `false`: body only. */
1460
+ readonly panel: import("@angular/core").InputSignal<boolean>;
1461
+ readonly open: import("@angular/core").InputSignal<boolean>;
1462
+ readonly titleInput: import("@angular/core").InputSignal<string | null>;
1463
+ readonly title: import("@angular/core").Signal<string>;
1464
+ readonly subtitle: import("@angular/core").InputSignal<string>;
1465
+ readonly submitLabelInput: import("@angular/core").InputSignal<string | null>;
1466
+ readonly submitLabel: import("@angular/core").Signal<string>;
1467
+ readonly cancelLabelInput: import("@angular/core").InputSignal<string | null>;
1468
+ readonly cancelLabel: import("@angular/core").Signal<string>;
1469
+ /** Label of the only button while the empty state is shown. */
1470
+ readonly closeLabelInput: import("@angular/core").InputSignal<string | null>;
1471
+ readonly closeLabel: import("@angular/core").Signal<string>;
1472
+ readonly emptyTitleInput: import("@angular/core").InputSignal<string | null>;
1473
+ readonly emptyTitle: import("@angular/core").Signal<string>;
1474
+ readonly emptyMessageInput: import("@angular/core").InputSignal<string | null>;
1475
+ readonly emptyMessage: import("@angular/core").Signal<string>;
1476
+ readonly minAmount: import("@angular/core").InputSignal<number>;
1477
+ readonly maxAmount: import("@angular/core").InputSignal<number>;
1478
+ readonly descriptionMaxLength: import("@angular/core").InputSignal<number>;
1479
+ /** ISO date the due date starts at. Empty (default) = today. */
1480
+ readonly defaultDueDate: import("@angular/core").InputSignal<string>;
1481
+ /** The whole form after every change. */
1482
+ readonly formChange: import("@angular/core").OutputEmitterRef<ChargeFormData>;
1483
+ /** Emits when the form becomes valid / invalid. */
1484
+ readonly validChange: import("@angular/core").OutputEmitterRef<boolean>;
1485
+ /** Panel mode: the primary button was pressed on a valid form. */
1486
+ readonly submitted: import("@angular/core").OutputEmitterRef<ChargeFormData>;
1487
+ /** Panel mode: Cancel / close / Escape (not while `saving`). */
1488
+ readonly closed: import("@angular/core").OutputEmitterRef<void>;
1489
+ protected readonly chargeType: import("@angular/core").WritableSignal<string>;
1490
+ protected readonly amount: import("@angular/core").WritableSignal<number | null>;
1491
+ protected readonly dueDate: import("@angular/core").WritableSignal<string>;
1492
+ protected readonly description: import("@angular/core").WritableSignal<string>;
1493
+ protected readonly typeOptions: import("@angular/core").Signal<SelectOption<string>[]>;
1494
+ protected readonly showEmpty: import("@angular/core").Signal<boolean>;
1495
+ /** The rule the backend enforces: min..max with at most two decimals, a type and a due date. */
1496
+ readonly valid: import("@angular/core").Signal<boolean>;
1497
+ private lastValid;
1498
+ constructor();
1499
+ /** The form as it stands. */
1500
+ getFormData(): ChargeFormData;
1501
+ /** Back to the blank form (no type, no amount, due date today or `defaultDueDate`, no description). */
1502
+ reset(): void;
1503
+ protected pickType(name: string): void;
1504
+ protected setAmount(v: number | null): void;
1505
+ protected setDueDate(v: string): void;
1506
+ protected setDescription(v: string): void;
1507
+ protected submit(): void;
1508
+ protected onClosed(): void;
1509
+ private emitForm;
1510
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChargeFormComponent, never>;
1511
+ static ɵcmp: i0.ɵɵComponentDeclaration<ChargeFormComponent, "ui-charge-form", never, {
1512
+ "chargeTypes": {
1513
+ "alias": "chargeTypes";
1514
+ "required": false;
1515
+ "isSignal": true;
1516
+ };
1517
+ "loading": {
1518
+ "alias": "loading";
1519
+ "required": false;
1520
+ "isSignal": true;
1521
+ };
1522
+ "saving": {
1523
+ "alias": "saving";
1524
+ "required": false;
1525
+ "isSignal": true;
1526
+ };
1527
+ "panel": {
1528
+ "alias": "panel";
1529
+ "required": false;
1530
+ "isSignal": true;
1531
+ };
1532
+ "open": {
1533
+ "alias": "open";
1534
+ "required": false;
1535
+ "isSignal": true;
1536
+ };
1537
+ "titleInput": {
1538
+ "alias": "title";
1539
+ "required": false;
1540
+ "isSignal": true;
1541
+ };
1542
+ "subtitle": {
1543
+ "alias": "subtitle";
1544
+ "required": false;
1545
+ "isSignal": true;
1546
+ };
1547
+ "submitLabelInput": {
1548
+ "alias": "submitLabel";
1549
+ "required": false;
1550
+ "isSignal": true;
1551
+ };
1552
+ "cancelLabelInput": {
1553
+ "alias": "cancelLabel";
1554
+ "required": false;
1555
+ "isSignal": true;
1556
+ };
1557
+ "closeLabelInput": {
1558
+ "alias": "closeLabel";
1559
+ "required": false;
1560
+ "isSignal": true;
1561
+ };
1562
+ "emptyTitleInput": {
1563
+ "alias": "emptyTitle";
1564
+ "required": false;
1565
+ "isSignal": true;
1566
+ };
1567
+ "emptyMessageInput": {
1568
+ "alias": "emptyMessage";
1569
+ "required": false;
1570
+ "isSignal": true;
1571
+ };
1572
+ "minAmount": {
1573
+ "alias": "minAmount";
1574
+ "required": false;
1575
+ "isSignal": true;
1576
+ };
1577
+ "maxAmount": {
1578
+ "alias": "maxAmount";
1579
+ "required": false;
1580
+ "isSignal": true;
1581
+ };
1582
+ "descriptionMaxLength": {
1583
+ "alias": "descriptionMaxLength";
1584
+ "required": false;
1585
+ "isSignal": true;
1586
+ };
1587
+ "defaultDueDate": {
1588
+ "alias": "defaultDueDate";
1589
+ "required": false;
1590
+ "isSignal": true;
1591
+ };
1592
+ }, {
1593
+ "formChange": "formChange";
1594
+ "validChange": "validChange";
1595
+ "submitted": "submitted";
1596
+ "closed": "closed";
1597
+ }, never, never, true, never>;
1598
+ }
1599
+ /** The payment being refunded. Amounts are in currency units (dollars), not cents. */
1600
+ export interface RefundablePayment {
1601
+ id: string;
1602
+ /** What the customer originally paid (without processor fees). */
1603
+ amount: number;
1604
+ /** Already refunded; the refundable maximum is `amount - refundedAmount`. */
1605
+ refundedAmount?: number | null;
1606
+ /** Shown read-only at the top (for example "Card", "ACH"). */
1607
+ methodLabel?: string;
1608
+ reference?: string | null;
1609
+ customerName?: string | null;
1610
+ /** The processor's fee (Stripe, Square, ...) the customer paid on top of `amount` for the WHOLE payment. 0 / absent = none. */
1611
+ processorFee?: number | null;
1612
+ /** The app's own service / processing fee the customer paid on top of `amount` for the WHOLE payment. 0 / absent = none. */
1613
+ serviceFee?: number | null;
1614
+ }
1615
+ /** What the host gets when the refund is confirmed. */
1616
+ export interface RefundRequest {
1617
+ paymentId: string;
1618
+ /** The base amount to refund (the payment's own amount, or the partial amount), in currency units with at most 2 decimals. */
1619
+ amount: number;
1620
+ /** The fees that go back to the customer with it: this refund's proportional share of the processor and service fees when `absorbFees`, else 0. */
1621
+ feeAmount: number;
1622
+ /** What the customer receives: `amount + feeAmount`. */
1623
+ total: number;
1624
+ /** The selected reason's value, or `''` when the reason field is hidden. */
1625
+ reason: string;
1626
+ notes: string;
1627
+ /**
1628
+ * True when the park chose "refund the full charge": the customer gets everything they were charged back, and the PARK loses all the fees
1629
+ * (the processor's fee and the app's service fee; none of them is returned to the park). False (default): the customer gets the charge
1630
+ * minus the fees back, i.e. only `amount`. Only offered when the payment has fees.
1631
+ */
1632
+ absorbFees: boolean;
1633
+ }
1634
+ export declare const DEFAULT_REFUND_REASONS: readonly SelectOption[];
1635
+ /**
1636
+ * Full or partial refund of a payment, the same in every app. It does not talk to a server: the host passes the `payment`,
1637
+ * calls its API on `submitted` and reports back with `saving` and `error`.
1638
+ *
1639
+ * <ui-refund-panel [open]="open()" [payment]="payment()" [saving]="saving()" [error]="error()" (submitted)="refund($event)" (closed)="open.set(false)" />
1640
+ *
1641
+ * Shapes: `panel` (default `true`) renders inside its own `ui-side-panel` (danger primary button, Cancel); `[panel]="false"` is the body only.
1642
+ * Every time the panel opens the form starts over (full refund, first reason, no notes, no fee choice).
1643
+ *
1644
+ * Built-in request mode: set `endpoint` (relative to `FORGEROUTE_CONFIG.baseUrl`, `{id}` is replaced by the payment id, for example
1645
+ * `/payments/{id}/refund`) and the panel sends the refund itself: `POST` with `{ amount, reason, reasonNotes, absorbFees }`, shows `saving` and the
1646
+ * server's error message, toasts `successMessage`, then emits `refunded` and `closed`. Without `endpoint` the host does it on `submitted`.
1647
+ *
1648
+ * Fee rule (when the payment has `processorFee` / `serviceFee`): the customer was charged `amount + fees`. Park does NOT absorb (default): the customer gets
1649
+ * the charge minus the fees back (= `amount`; for a partial refund the same proportion). Park absorbs: the customer gets the full charge back (`amount` + the
1650
+ * proportional fees) and the park alone loses the processor fee AND the app's service fee. The fee share of a partial refund is `fees * partial / amount`.
1651
+ *
1652
+ * Fields: a read-only summary (customer, method / reference, original amount, already refunded), "Refund Type" (full for the remaining amount,
1653
+ * or partial with an amount between 0.01 and the remaining amount, at most 2 decimals), an optional reason select (`showReason`), optional
1654
+ * notes (`showNotes`, up to `notesMaxLength`), and, when the payment has fees (`processorFee` + `serviceFee`, or the legacy `processorFees`), one
1655
+ * checkbox "Refund $X in fees" (unchecked = the customer gets the base amount; checked = the full charge, the park absorbs the fees) with a note that
1656
+ * the fees are non-refundable. The primary button reads "Refund $total". When the remaining amount is 0 the form is disabled with an info alert.
1657
+ */
1658
+ export declare class RefundPanelComponent {
1659
+ protected readonly labels: UiLabelsService;
1660
+ readonly payment: import("@angular/core").InputSignal<RefundablePayment | null>;
1661
+ /** True while the host processes the refund: the primary button spins and Cancel / Escape / `submitted` do nothing. */
1662
+ readonly saving: import("@angular/core").InputSignal<boolean>;
1663
+ /** A message from the host (for example a failed refund); shown as a danger alert at the bottom. */
1664
+ readonly error: import("@angular/core").InputSignal<string>;
1665
+ /** `true` (default): inside its own `ui-side-panel`. `false`: the body only. */
1666
+ readonly panel: import("@angular/core").InputSignal<boolean>;
1667
+ readonly open: import("@angular/core").InputSignal<boolean>;
1668
+ readonly titleInput: import("@angular/core").InputSignal<string | null>;
1669
+ readonly title: import("@angular/core").Signal<string>;
1670
+ readonly currency: import("@angular/core").InputSignal<string>;
1671
+ readonly showReason: import("@angular/core").InputSignal<boolean>;
1672
+ readonly reasons: import("@angular/core").InputSignal<readonly SelectOption<string>[]>;
1673
+ /** The reasons as the select wants them (a mutable copy of the readonly input). */
1674
+ protected readonly reasonOptions: import("@angular/core").Signal<SelectOption<string>[]>;
1675
+ readonly showNotes: import("@angular/core").InputSignal<boolean>;
1676
+ readonly notesMaxLength: import("@angular/core").InputSignal<number>;
1677
+ /** Legacy / host override: the total fees (currency units) the customer paid on top. Used only when the payment carries no `processorFee` / `serviceFee`. */
1678
+ readonly processorFees: import("@angular/core").InputSignal<number>;
1679
+ /** Built-in request mode: the refund endpoint (relative to the API base URL; `{id}` = the payment id). Empty = the host handles `submitted`. */
1680
+ readonly endpoint: import("@angular/core").InputSignal<string>;
1681
+ /** Toast text after a successful built-in refund. */
1682
+ readonly successMessage: import("@angular/core").InputSignal<string>;
1683
+ /** The note shown whenever the payment has fees. */
1684
+ readonly feesNote: import("@angular/core").InputSignal<string>;
1685
+ readonly warningInput: import("@angular/core").InputSignal<string | null>;
1686
+ readonly warning: import("@angular/core").Signal<string>;
1687
+ readonly nothingLeftMessageInput: import("@angular/core").InputSignal<string | null>;
1688
+ readonly nothingLeftMessage: import("@angular/core").Signal<string>;
1689
+ readonly submitted: import("@angular/core").OutputEmitterRef<RefundRequest>;
1690
+ /** Built-in request mode: the server accepted the refund. */
1691
+ readonly refunded: import("@angular/core").OutputEmitterRef<RefundRequest>;
1692
+ readonly closed: import("@angular/core").OutputEmitterRef<void>;
1693
+ private readonly http;
1694
+ private readonly toast;
1695
+ private readonly destroyRef;
1696
+ private readonly apiBase;
1697
+ private readonly busy;
1698
+ private readonly failure;
1699
+ /** True while the host or the built-in request is saving. */
1700
+ protected readonly isSaving: import("@angular/core").Signal<boolean>;
1701
+ /** The host's `error` or the built-in request's server message. */
1702
+ protected readonly shownError: import("@angular/core").Signal<string>;
1703
+ protected readonly refundType: import("@angular/core").WritableSignal<"full" | "partial">;
1704
+ protected readonly partialAmount: import("@angular/core").WritableSignal<number | null>;
1705
+ protected readonly reason: import("@angular/core").WritableSignal<string>;
1706
+ protected readonly notes: import("@angular/core").WritableSignal<string>;
1707
+ protected readonly absorbFees: import("@angular/core").WritableSignal<boolean>;
1708
+ /** What can still be refunded, rounded to cents. */
1709
+ readonly remaining: import("@angular/core").Signal<number>;
1710
+ private fmt;
1711
+ /** The fees the customer paid on top of the payment (processor + service); 0 = none. */
1712
+ readonly fees: import("@angular/core").Signal<number>;
1713
+ /** This refund's proportional share of the fees: `fees * base / payment amount`, rounded to cents (never above the fees). */
1714
+ readonly feeShare: import("@angular/core").Signal<number>;
1715
+ /** What the customer receives as things stand: the base amount, plus the fee share when the park absorbs the fees. */
1716
+ readonly customerReceives: import("@angular/core").Signal<number>;
1717
+ protected readonly summarySections: import("@angular/core").Signal<PanelInfoSection[]>;
1718
+ protected readonly refundTypeOptions: import("@angular/core").Signal<RadioOption[]>;
1719
+ /** The checkbox label: the fees that go back to the customer with this refund, for example "Refund $3.50 in fees". */
1720
+ protected readonly feeCheckboxLabel: import("@angular/core").Signal<string>;
1721
+ protected readonly feeHint: import("@angular/core").Signal<string>;
1722
+ /** The amount that will be refunded as things stand (0 when a partial amount is not yet valid). */
1723
+ readonly refundAmount: import("@angular/core").Signal<number>;
1724
+ protected readonly partialAmountError: import("@angular/core").Signal<string>;
1725
+ readonly canSubmit: import("@angular/core").Signal<boolean>;
1726
+ protected readonly primaryLabel: import("@angular/core").Signal<string>;
1727
+ constructor();
1728
+ /** Back to a full refund with the first reason, no notes and no fee choice. */
1729
+ reset(): void;
1730
+ protected setRefundType(t: string): void;
1731
+ protected submit(): void;
1732
+ protected onClosed(): void;
1733
+ static ɵfac: i0.ɵɵFactoryDeclaration<RefundPanelComponent, never>;
1734
+ static ɵcmp: i0.ɵɵComponentDeclaration<RefundPanelComponent, "ui-refund-panel", never, {
1735
+ "payment": {
1736
+ "alias": "payment";
1737
+ "required": false;
1738
+ "isSignal": true;
1739
+ };
1740
+ "saving": {
1741
+ "alias": "saving";
1742
+ "required": false;
1743
+ "isSignal": true;
1744
+ };
1745
+ "error": {
1746
+ "alias": "error";
1747
+ "required": false;
1748
+ "isSignal": true;
1749
+ };
1750
+ "panel": {
1751
+ "alias": "panel";
1752
+ "required": false;
1753
+ "isSignal": true;
1754
+ };
1755
+ "open": {
1756
+ "alias": "open";
1757
+ "required": false;
1758
+ "isSignal": true;
1759
+ };
1760
+ "titleInput": {
1761
+ "alias": "title";
1762
+ "required": false;
1763
+ "isSignal": true;
1764
+ };
1765
+ "currency": {
1766
+ "alias": "currency";
1767
+ "required": false;
1768
+ "isSignal": true;
1769
+ };
1770
+ "showReason": {
1771
+ "alias": "showReason";
1772
+ "required": false;
1773
+ "isSignal": true;
1774
+ };
1775
+ "reasons": {
1776
+ "alias": "reasons";
1777
+ "required": false;
1778
+ "isSignal": true;
1779
+ };
1780
+ "showNotes": {
1781
+ "alias": "showNotes";
1782
+ "required": false;
1783
+ "isSignal": true;
1784
+ };
1785
+ "notesMaxLength": {
1786
+ "alias": "notesMaxLength";
1787
+ "required": false;
1788
+ "isSignal": true;
1789
+ };
1790
+ "processorFees": {
1791
+ "alias": "processorFees";
1792
+ "required": false;
1793
+ "isSignal": true;
1794
+ };
1795
+ "endpoint": {
1796
+ "alias": "endpoint";
1797
+ "required": false;
1798
+ "isSignal": true;
1799
+ };
1800
+ "successMessage": {
1801
+ "alias": "successMessage";
1802
+ "required": false;
1803
+ "isSignal": true;
1804
+ };
1805
+ "feesNote": {
1806
+ "alias": "feesNote";
1807
+ "required": false;
1808
+ "isSignal": true;
1809
+ };
1810
+ "warningInput": {
1811
+ "alias": "warning";
1812
+ "required": false;
1813
+ "isSignal": true;
1814
+ };
1815
+ "nothingLeftMessageInput": {
1816
+ "alias": "nothingLeftMessage";
1817
+ "required": false;
1818
+ "isSignal": true;
1819
+ };
1820
+ }, {
1821
+ "submitted": "submitted";
1822
+ "refunded": "refunded";
1823
+ "closed": "closed";
1824
+ }, never, never, true, never>;
1825
+ }
1826
+ export type { AllocationModeOption, ChargeAllocation, HostResult, PayableCharge, PaymentAllocation, PaymentEntry, PaymentMethodOption, PaymentPanelOutcome, RecordPaymentFn, RecordPaymentPayload, RecordPaymentResult, SavedPaymentMethod, TerminalConfirmContext, TerminalPhase, TerminalReader, TerminalStartContext, TerminalStartResult, TerminalStatusResult };