@voyant-travel/bookings-react 0.119.3

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 (602) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +87 -0
  3. package/dist/admin/booking-contract-dialog.d.ts +22 -0
  4. package/dist/admin/booking-contract-dialog.d.ts.map +1 -0
  5. package/dist/admin/booking-contract-dialog.js +161 -0
  6. package/dist/admin/booking-detail-host.d.ts +103 -0
  7. package/dist/admin/booking-detail-host.d.ts.map +1 -0
  8. package/dist/admin/booking-detail-host.js +127 -0
  9. package/dist/admin/booking-detail-skeleton.d.ts +7 -0
  10. package/dist/admin/booking-detail-skeleton.d.ts.map +1 -0
  11. package/dist/admin/booking-detail-skeleton.js +24 -0
  12. package/dist/admin/booking-documents-table.d.ts +13 -0
  13. package/dist/admin/booking-documents-table.d.ts.map +1 -0
  14. package/dist/admin/booking-documents-table.js +259 -0
  15. package/dist/admin/booking-invoice-sheet.d.ts +18 -0
  16. package/dist/admin/booking-invoice-sheet.d.ts.map +1 -0
  17. package/dist/admin/booking-invoice-sheet.js +101 -0
  18. package/dist/admin/booking-journey-host.d.ts +24 -0
  19. package/dist/admin/booking-journey-host.d.ts.map +1 -0
  20. package/dist/admin/booking-journey-host.js +278 -0
  21. package/dist/admin/bookings-host.d.ts +26 -0
  22. package/dist/admin/bookings-host.d.ts.map +1 -0
  23. package/dist/admin/bookings-host.js +18 -0
  24. package/dist/admin/bookings-list-skeleton.d.ts +10 -0
  25. package/dist/admin/bookings-list-skeleton.d.ts.map +1 -0
  26. package/dist/admin/bookings-list-skeleton.js +25 -0
  27. package/dist/admin/index.d.ts +273 -0
  28. package/dist/admin/index.d.ts.map +1 -0
  29. package/dist/admin/index.js +331 -0
  30. package/dist/admin/journey-billing-duplicate-warning.d.ts +3 -0
  31. package/dist/admin/journey-billing-duplicate-warning.d.ts.map +1 -0
  32. package/dist/admin/journey-billing-duplicate-warning.js +26 -0
  33. package/dist/admin/journey-departure-picker.d.ts +7 -0
  34. package/dist/admin/journey-departure-picker.d.ts.map +1 -0
  35. package/dist/admin/journey-departure-picker.js +100 -0
  36. package/dist/admin/journey-units-picker.d.ts +11 -0
  37. package/dist/admin/journey-units-picker.d.ts.map +1 -0
  38. package/dist/admin/journey-units-picker.js +60 -0
  39. package/dist/admin/journey-voucher-picker.d.ts +3 -0
  40. package/dist/admin/journey-voucher-picker.d.ts.map +1 -0
  41. package/dist/admin/journey-voucher-picker.js +71 -0
  42. package/dist/admin/pages/booking-compose-page.d.ts +9 -0
  43. package/dist/admin/pages/booking-compose-page.d.ts.map +1 -0
  44. package/dist/admin/pages/booking-compose-page.js +17 -0
  45. package/dist/admin/pages/booking-detail-page.d.ts +11 -0
  46. package/dist/admin/pages/booking-detail-page.d.ts.map +1 -0
  47. package/dist/admin/pages/booking-detail-page.js +14 -0
  48. package/dist/admin/pages/booking-journey-page.d.ts +12 -0
  49. package/dist/admin/pages/booking-journey-page.d.ts.map +1 -0
  50. package/dist/admin/pages/booking-journey-page.js +26 -0
  51. package/dist/admin/pages/booking-new-page.d.ts +15 -0
  52. package/dist/admin/pages/booking-new-page.d.ts.map +1 -0
  53. package/dist/admin/pages/booking-new-page.js +50 -0
  54. package/dist/admin/pages/bookings-index-page.d.ts +20 -0
  55. package/dist/admin/pages/bookings-index-page.d.ts.map +1 -0
  56. package/dist/admin/pages/bookings-index-page.js +18 -0
  57. package/dist/admin/person-bookings-widget.d.ts +13 -0
  58. package/dist/admin/person-bookings-widget.d.ts.map +1 -0
  59. package/dist/admin/person-bookings-widget.js +48 -0
  60. package/dist/admin/slots.d.ts +31 -0
  61. package/dist/admin/slots.d.ts.map +1 -0
  62. package/dist/admin/slots.js +30 -0
  63. package/dist/admin/use-booking-action-ledger-events.d.ts +15 -0
  64. package/dist/admin/use-booking-action-ledger-events.d.ts.map +1 -0
  65. package/dist/admin/use-booking-action-ledger-events.js +66 -0
  66. package/dist/client.d.ts +14 -0
  67. package/dist/client.d.ts.map +1 -0
  68. package/dist/client.js +59 -0
  69. package/dist/components/booking-activity-timeline.d.ts +32 -0
  70. package/dist/components/booking-activity-timeline.d.ts.map +1 -0
  71. package/dist/components/booking-activity-timeline.js +147 -0
  72. package/dist/components/booking-billing-dialog.d.ts +16 -0
  73. package/dist/components/booking-billing-dialog.d.ts.map +1 -0
  74. package/dist/components/booking-billing-dialog.js +315 -0
  75. package/dist/components/booking-cancellation-dialog.d.ts +18 -0
  76. package/dist/components/booking-cancellation-dialog.d.ts.map +1 -0
  77. package/dist/components/booking-cancellation-dialog.js +79 -0
  78. package/dist/components/booking-combobox.d.ts +13 -0
  79. package/dist/components/booking-combobox.d.ts.map +1 -0
  80. package/dist/components/booking-combobox.js +44 -0
  81. package/dist/components/booking-create-form-utils.d.ts +56 -0
  82. package/dist/components/booking-create-form-utils.d.ts.map +1 -0
  83. package/dist/components/booking-create-form-utils.js +216 -0
  84. package/dist/components/booking-create-page.d.ts +14 -0
  85. package/dist/components/booking-create-page.d.ts.map +1 -0
  86. package/dist/components/booking-create-page.js +11 -0
  87. package/dist/components/booking-create-preview-card.d.ts +26 -0
  88. package/dist/components/booking-create-preview-card.d.ts.map +1 -0
  89. package/dist/components/booking-create-preview-card.js +107 -0
  90. package/dist/components/booking-create-product-extras-picker.d.ts +18 -0
  91. package/dist/components/booking-create-product-extras-picker.d.ts.map +1 -0
  92. package/dist/components/booking-create-product-extras-picker.js +82 -0
  93. package/dist/components/booking-create-sheet.d.ts +34 -0
  94. package/dist/components/booking-create-sheet.d.ts.map +1 -0
  95. package/dist/components/booking-create-sheet.js +811 -0
  96. package/dist/components/booking-create-utils.d.ts +66 -0
  97. package/dist/components/booking-create-utils.d.ts.map +1 -0
  98. package/dist/components/booking-create-utils.js +185 -0
  99. package/dist/components/booking-detail-page.d.ts +126 -0
  100. package/dist/components/booking-detail-page.d.ts.map +1 -0
  101. package/dist/components/booking-detail-page.js +264 -0
  102. package/dist/components/booking-dialog.d.ts +28 -0
  103. package/dist/components/booking-dialog.d.ts.map +1 -0
  104. package/dist/components/booking-dialog.js +130 -0
  105. package/dist/components/booking-document-dialog.d.ts +8 -0
  106. package/dist/components/booking-document-dialog.d.ts.map +1 -0
  107. package/dist/components/booking-document-dialog.js +83 -0
  108. package/dist/components/booking-document-list.d.ts +5 -0
  109. package/dist/components/booking-document-list.d.ts.map +1 -0
  110. package/dist/components/booking-document-list.js +43 -0
  111. package/dist/components/booking-group-link-dialog.d.ts +10 -0
  112. package/dist/components/booking-group-link-dialog.d.ts.map +1 -0
  113. package/dist/components/booking-group-link-dialog.js +79 -0
  114. package/dist/components/booking-group-section.d.ts +27 -0
  115. package/dist/components/booking-group-section.d.ts.map +1 -0
  116. package/dist/components/booking-group-section.js +51 -0
  117. package/dist/components/booking-guarantee-dialog.d.ts +10 -0
  118. package/dist/components/booking-guarantee-dialog.d.ts.map +1 -0
  119. package/dist/components/booking-guarantee-dialog.js +123 -0
  120. package/dist/components/booking-guarantee-list.d.ts +5 -0
  121. package/dist/components/booking-guarantee-list.d.ts.map +1 -0
  122. package/dist/components/booking-guarantee-list.js +86 -0
  123. package/dist/components/booking-item-dialog.d.ts +10 -0
  124. package/dist/components/booking-item-dialog.d.ts.map +1 -0
  125. package/dist/components/booking-item-dialog.js +155 -0
  126. package/dist/components/booking-item-list.d.ts +12 -0
  127. package/dist/components/booking-item-list.d.ts.map +1 -0
  128. package/dist/components/booking-item-list.js +191 -0
  129. package/dist/components/booking-item-travelers.d.ts +6 -0
  130. package/dist/components/booking-item-travelers.d.ts.map +1 -0
  131. package/dist/components/booking-item-travelers.js +57 -0
  132. package/dist/components/booking-list-filters.d.ts +43 -0
  133. package/dist/components/booking-list-filters.d.ts.map +1 -0
  134. package/dist/components/booking-list-filters.js +192 -0
  135. package/dist/components/booking-list.d.ts +50 -0
  136. package/dist/components/booking-list.d.ts.map +1 -0
  137. package/dist/components/booking-list.js +352 -0
  138. package/dist/components/booking-note-dialog.d.ts +16 -0
  139. package/dist/components/booking-note-dialog.d.ts.map +1 -0
  140. package/dist/components/booking-note-dialog.js +41 -0
  141. package/dist/components/booking-notes.d.ts +5 -0
  142. package/dist/components/booking-notes.d.ts.map +1 -0
  143. package/dist/components/booking-notes.js +45 -0
  144. package/dist/components/booking-payment-reconciliation-banner.d.ts +5 -0
  145. package/dist/components/booking-payment-reconciliation-banner.d.ts.map +1 -0
  146. package/dist/components/booking-payment-reconciliation-banner.js +91 -0
  147. package/dist/components/booking-payment-schedule-dialog.d.ts +10 -0
  148. package/dist/components/booking-payment-schedule-dialog.d.ts.map +1 -0
  149. package/dist/components/booking-payment-schedule-dialog.js +117 -0
  150. package/dist/components/booking-payment-schedule-list.d.ts +10 -0
  151. package/dist/components/booking-payment-schedule-list.d.ts.map +1 -0
  152. package/dist/components/booking-payment-schedule-list.js +217 -0
  153. package/dist/components/booking-payments-summary.d.ts +83 -0
  154. package/dist/components/booking-payments-summary.d.ts.map +1 -0
  155. package/dist/components/booking-payments-summary.js +176 -0
  156. package/dist/components/booking-quick-view-sheet.d.ts +14 -0
  157. package/dist/components/booking-quick-view-sheet.d.ts.map +1 -0
  158. package/dist/components/booking-quick-view-sheet.js +283 -0
  159. package/dist/components/bookings-page.d.ts +19 -0
  160. package/dist/components/bookings-page.d.ts.map +1 -0
  161. package/dist/components/bookings-page.js +9 -0
  162. package/dist/components/file-dropzone.d.ts +25 -0
  163. package/dist/components/file-dropzone.d.ts.map +1 -0
  164. package/dist/components/file-dropzone.js +102 -0
  165. package/dist/components/icon-action-button.d.ts +18 -0
  166. package/dist/components/icon-action-button.d.ts.map +1 -0
  167. package/dist/components/icon-action-button.js +13 -0
  168. package/dist/components/option-units-stepper-section.d.ts +111 -0
  169. package/dist/components/option-units-stepper-section.d.ts.map +1 -0
  170. package/dist/components/option-units-stepper-section.js +276 -0
  171. package/dist/components/payment-schedule-section.d.ts +91 -0
  172. package/dist/components/payment-schedule-section.d.ts.map +1 -0
  173. package/dist/components/payment-schedule-section.js +206 -0
  174. package/dist/components/person-picker-section.d.ts +71 -0
  175. package/dist/components/person-picker-section.d.ts.map +1 -0
  176. package/dist/components/person-picker-section.js +160 -0
  177. package/dist/components/price-breakdown-section.d.ts +83 -0
  178. package/dist/components/price-breakdown-section.d.ts.map +1 -0
  179. package/dist/components/price-breakdown-section.js +278 -0
  180. package/dist/components/product-picker-section.d.ts +29 -0
  181. package/dist/components/product-picker-section.d.ts.map +1 -0
  182. package/dist/components/product-picker-section.js +74 -0
  183. package/dist/components/shared-room-section.d.ts +40 -0
  184. package/dist/components/shared-room-section.d.ts.map +1 -0
  185. package/dist/components/shared-room-section.js +99 -0
  186. package/dist/components/status-badge.d.ts +24 -0
  187. package/dist/components/status-badge.d.ts.map +1 -0
  188. package/dist/components/status-badge.js +65 -0
  189. package/dist/components/status-change-dialog.d.ts +10 -0
  190. package/dist/components/status-change-dialog.d.ts.map +1 -0
  191. package/dist/components/status-change-dialog.js +57 -0
  192. package/dist/components/supplier-status-dialog.d.ts +10 -0
  193. package/dist/components/supplier-status-dialog.d.ts.map +1 -0
  194. package/dist/components/supplier-status-dialog.js +98 -0
  195. package/dist/components/supplier-status-list.d.ts +5 -0
  196. package/dist/components/supplier-status-list.d.ts.map +1 -0
  197. package/dist/components/supplier-status-list.js +115 -0
  198. package/dist/components/traveler-category-buttons.d.ts +26 -0
  199. package/dist/components/traveler-category-buttons.d.ts.map +1 -0
  200. package/dist/components/traveler-category-buttons.js +35 -0
  201. package/dist/components/traveler-dialog.d.ts +10 -0
  202. package/dist/components/traveler-dialog.d.ts.map +1 -0
  203. package/dist/components/traveler-dialog.js +256 -0
  204. package/dist/components/traveler-list.d.ts +6 -0
  205. package/dist/components/traveler-list.d.ts.map +1 -0
  206. package/dist/components/traveler-list.js +295 -0
  207. package/dist/components/travelers-section-controls.d.ts +52 -0
  208. package/dist/components/travelers-section-controls.d.ts.map +1 -0
  209. package/dist/components/travelers-section-controls.js +206 -0
  210. package/dist/components/travelers-section.d.ts +159 -0
  211. package/dist/components/travelers-section.d.ts.map +1 -0
  212. package/dist/components/travelers-section.js +355 -0
  213. package/dist/components/voucher-picker-section.d.ts +50 -0
  214. package/dist/components/voucher-picker-section.d.ts.map +1 -0
  215. package/dist/components/voucher-picker-section.js +79 -0
  216. package/dist/extras/client.d.ts +14 -0
  217. package/dist/extras/client.d.ts.map +1 -0
  218. package/dist/extras/client.js +58 -0
  219. package/dist/extras/components/extra-catalog-card.d.ts +13 -0
  220. package/dist/extras/components/extra-catalog-card.d.ts.map +1 -0
  221. package/dist/extras/components/extra-catalog-card.js +52 -0
  222. package/dist/extras/components/product-combobox.d.ts +9 -0
  223. package/dist/extras/components/product-combobox.d.ts.map +1 -0
  224. package/dist/extras/components/product-combobox.js +46 -0
  225. package/dist/extras/components/slot-extras-manifest-panel.d.ts +6 -0
  226. package/dist/extras/components/slot-extras-manifest-panel.d.ts.map +1 -0
  227. package/dist/extras/components/slot-extras-manifest-panel.js +108 -0
  228. package/dist/extras/hooks/index.d.ts +5 -0
  229. package/dist/extras/hooks/index.d.ts.map +1 -0
  230. package/dist/extras/hooks/index.js +4 -0
  231. package/dist/extras/hooks/use-product-extra.d.ts +24 -0
  232. package/dist/extras/hooks/use-product-extra.d.ts.map +1 -0
  233. package/dist/extras/hooks/use-product-extra.js +12 -0
  234. package/dist/extras/hooks/use-product-extras.d.ts +30 -0
  235. package/dist/extras/hooks/use-product-extras.d.ts.map +1 -0
  236. package/dist/extras/hooks/use-product-extras.js +12 -0
  237. package/dist/extras/hooks/use-slot-extra-manifest-mutation.d.ts +48 -0
  238. package/dist/extras/hooks/use-slot-extra-manifest-mutation.d.ts.map +1 -0
  239. package/dist/extras/hooks/use-slot-extra-manifest-mutation.js +26 -0
  240. package/dist/extras/hooks/use-slot-extra-manifest.d.ts +68 -0
  241. package/dist/extras/hooks/use-slot-extra-manifest.d.ts.map +1 -0
  242. package/dist/extras/hooks/use-slot-extra-manifest.js +11 -0
  243. package/dist/extras/i18n/en.d.ts +52 -0
  244. package/dist/extras/i18n/en.d.ts.map +1 -0
  245. package/dist/extras/i18n/en.js +51 -0
  246. package/dist/extras/i18n/index.d.ts +5 -0
  247. package/dist/extras/i18n/index.d.ts.map +1 -0
  248. package/dist/extras/i18n/index.js +3 -0
  249. package/dist/extras/i18n/messages.d.ts +37 -0
  250. package/dist/extras/i18n/messages.d.ts.map +1 -0
  251. package/dist/extras/i18n/messages.js +1 -0
  252. package/dist/extras/i18n/provider.d.ts +126 -0
  253. package/dist/extras/i18n/provider.d.ts.map +1 -0
  254. package/dist/extras/i18n/provider.js +44 -0
  255. package/dist/extras/i18n/ro.d.ts +52 -0
  256. package/dist/extras/i18n/ro.d.ts.map +1 -0
  257. package/dist/extras/i18n/ro.js +51 -0
  258. package/dist/extras/index.d.ts +7 -0
  259. package/dist/extras/index.d.ts.map +1 -0
  260. package/dist/extras/index.js +6 -0
  261. package/dist/extras/provider.d.ts +2 -0
  262. package/dist/extras/provider.d.ts.map +1 -0
  263. package/dist/extras/provider.js +1 -0
  264. package/dist/extras/query-keys.d.ts +16 -0
  265. package/dist/extras/query-keys.d.ts.map +1 -0
  266. package/dist/extras/query-keys.js +8 -0
  267. package/dist/extras/query-options.d.ts +455 -0
  268. package/dist/extras/query-options.d.ts.map +1 -0
  269. package/dist/extras/query-options.js +44 -0
  270. package/dist/extras/schemas.d.ts +416 -0
  271. package/dist/extras/schemas.d.ts.map +1 -0
  272. package/dist/extras/schemas.js +89 -0
  273. package/dist/extras/ui.d.ts +4 -0
  274. package/dist/extras/ui.d.ts.map +1 -0
  275. package/dist/extras/ui.js +3 -0
  276. package/dist/extras.d.ts +10 -0
  277. package/dist/extras.d.ts.map +1 -0
  278. package/dist/extras.js +9 -0
  279. package/dist/hooks/index.d.ts +36 -0
  280. package/dist/hooks/index.d.ts.map +1 -0
  281. package/dist/hooks/index.js +35 -0
  282. package/dist/hooks/use-booking-action-ledger.d.ts +63 -0
  283. package/dist/hooks/use-booking-action-ledger.d.ts.map +1 -0
  284. package/dist/hooks/use-booking-action-ledger.js +34 -0
  285. package/dist/hooks/use-booking-activity.d.ts +17 -0
  286. package/dist/hooks/use-booking-activity.d.ts.map +1 -0
  287. package/dist/hooks/use-booking-activity.js +12 -0
  288. package/dist/hooks/use-booking-cancel-mutation.d.ts +69 -0
  289. package/dist/hooks/use-booking-cancel-mutation.d.ts.map +1 -0
  290. package/dist/hooks/use-booking-cancel-mutation.js +24 -0
  291. package/dist/hooks/use-booking-contract-generation.d.ts +31 -0
  292. package/dist/hooks/use-booking-contract-generation.d.ts.map +1 -0
  293. package/dist/hooks/use-booking-contract-generation.js +36 -0
  294. package/dist/hooks/use-booking-convert-mutation.d.ts +81 -0
  295. package/dist/hooks/use-booking-convert-mutation.d.ts.map +1 -0
  296. package/dist/hooks/use-booking-convert-mutation.js +24 -0
  297. package/dist/hooks/use-booking-create-mutation.d.ts +337 -0
  298. package/dist/hooks/use-booking-create-mutation.d.ts.map +1 -0
  299. package/dist/hooks/use-booking-create-mutation.js +43 -0
  300. package/dist/hooks/use-booking-documents.d.ts +41 -0
  301. package/dist/hooks/use-booking-documents.d.ts.map +1 -0
  302. package/dist/hooks/use-booking-documents.js +46 -0
  303. package/dist/hooks/use-booking-dual-create-mutation.d.ts +338 -0
  304. package/dist/hooks/use-booking-dual-create-mutation.d.ts.map +1 -0
  305. package/dist/hooks/use-booking-dual-create-mutation.js +45 -0
  306. package/dist/hooks/use-booking-group-for-booking.d.ts +24 -0
  307. package/dist/hooks/use-booking-group-for-booking.d.ts.map +1 -0
  308. package/dist/hooks/use-booking-group-for-booking.js +12 -0
  309. package/dist/hooks/use-booking-group-member-mutation.d.ts +27 -0
  310. package/dist/hooks/use-booking-group-member-mutation.d.ts.map +1 -0
  311. package/dist/hooks/use-booking-group-member-mutation.js +38 -0
  312. package/dist/hooks/use-booking-group-mutation.d.ts +40 -0
  313. package/dist/hooks/use-booking-group-mutation.d.ts.map +1 -0
  314. package/dist/hooks/use-booking-group-mutation.js +32 -0
  315. package/dist/hooks/use-booking-group.d.ts +85 -0
  316. package/dist/hooks/use-booking-group.d.ts.map +1 -0
  317. package/dist/hooks/use-booking-group.js +12 -0
  318. package/dist/hooks/use-booking-groups.d.ts +21 -0
  319. package/dist/hooks/use-booking-groups.d.ts.map +1 -0
  320. package/dist/hooks/use-booking-groups.js +12 -0
  321. package/dist/hooks/use-booking-item-mutation.d.ts +101 -0
  322. package/dist/hooks/use-booking-item-mutation.d.ts.map +1 -0
  323. package/dist/hooks/use-booking-item-mutation.js +42 -0
  324. package/dist/hooks/use-booking-item-travelers.d.ts +32 -0
  325. package/dist/hooks/use-booking-item-travelers.d.ts.map +1 -0
  326. package/dist/hooks/use-booking-item-travelers.js +48 -0
  327. package/dist/hooks/use-booking-items.d.ts +36 -0
  328. package/dist/hooks/use-booking-items.d.ts.map +1 -0
  329. package/dist/hooks/use-booking-items.js +12 -0
  330. package/dist/hooks/use-booking-mutation.d.ts +158 -0
  331. package/dist/hooks/use-booking-mutation.d.ts.map +1 -0
  332. package/dist/hooks/use-booking-mutation.js +39 -0
  333. package/dist/hooks/use-booking-note-mutation.d.ts +39 -0
  334. package/dist/hooks/use-booking-note-mutation.d.ts.map +1 -0
  335. package/dist/hooks/use-booking-note-mutation.js +44 -0
  336. package/dist/hooks/use-booking-notes.d.ts +15 -0
  337. package/dist/hooks/use-booking-notes.d.ts.map +1 -0
  338. package/dist/hooks/use-booking-notes.js +12 -0
  339. package/dist/hooks/use-booking-primary-product.d.ts +28 -0
  340. package/dist/hooks/use-booking-primary-product.d.ts.map +1 -0
  341. package/dist/hooks/use-booking-primary-product.js +20 -0
  342. package/dist/hooks/use-booking-status-mutation.d.ts +156 -0
  343. package/dist/hooks/use-booking-status-mutation.d.ts.map +1 -0
  344. package/dist/hooks/use-booking-status-mutation.js +54 -0
  345. package/dist/hooks/use-booking-tax-preview.d.ts +29 -0
  346. package/dist/hooks/use-booking-tax-preview.d.ts.map +1 -0
  347. package/dist/hooks/use-booking-tax-preview.js +21 -0
  348. package/dist/hooks/use-booking.d.ts +67 -0
  349. package/dist/hooks/use-booking.d.ts.map +1 -0
  350. package/dist/hooks/use-booking.js +12 -0
  351. package/dist/hooks/use-bookings.d.ts +71 -0
  352. package/dist/hooks/use-bookings.d.ts.map +1 -0
  353. package/dist/hooks/use-bookings.js +12 -0
  354. package/dist/hooks/use-pricing-preview.d.ts +61 -0
  355. package/dist/hooks/use-pricing-preview.d.ts.map +1 -0
  356. package/dist/hooks/use-pricing-preview.js +18 -0
  357. package/dist/hooks/use-public-booking-session-flow-mutation.d.ts +148 -0
  358. package/dist/hooks/use-public-booking-session-flow-mutation.d.ts.map +1 -0
  359. package/dist/hooks/use-public-booking-session-flow-mutation.js +35 -0
  360. package/dist/hooks/use-public-booking-session-state.d.ts +16 -0
  361. package/dist/hooks/use-public-booking-session-state.d.ts.map +1 -0
  362. package/dist/hooks/use-public-booking-session-state.js +12 -0
  363. package/dist/hooks/use-public-booking-session.d.ts +101 -0
  364. package/dist/hooks/use-public-booking-session.d.ts.map +1 -0
  365. package/dist/hooks/use-public-booking-session.js +12 -0
  366. package/dist/hooks/use-reveal-traveler.d.ts +54 -0
  367. package/dist/hooks/use-reveal-traveler.d.ts.map +1 -0
  368. package/dist/hooks/use-reveal-traveler.js +18 -0
  369. package/dist/hooks/use-sharing-groups.d.ts +41 -0
  370. package/dist/hooks/use-sharing-groups.d.ts.map +1 -0
  371. package/dist/hooks/use-sharing-groups.js +20 -0
  372. package/dist/hooks/use-supplier-status-mutation.d.ts +46 -0
  373. package/dist/hooks/use-supplier-status-mutation.d.ts.map +1 -0
  374. package/dist/hooks/use-supplier-status-mutation.js +39 -0
  375. package/dist/hooks/use-supplier-statuses.d.ts +20 -0
  376. package/dist/hooks/use-supplier-statuses.d.ts.map +1 -0
  377. package/dist/hooks/use-supplier-statuses.js +12 -0
  378. package/dist/hooks/use-traveler-mutation.d.ts +55 -0
  379. package/dist/hooks/use-traveler-mutation.d.ts.map +1 -0
  380. package/dist/hooks/use-traveler-mutation.js +42 -0
  381. package/dist/hooks/use-traveler-with-travel-details-mutation.d.ts +120 -0
  382. package/dist/hooks/use-traveler-with-travel-details-mutation.d.ts.map +1 -0
  383. package/dist/hooks/use-traveler-with-travel-details-mutation.js +43 -0
  384. package/dist/hooks/use-travelers.d.ts +23 -0
  385. package/dist/hooks/use-travelers.d.ts.map +1 -0
  386. package/dist/hooks/use-travelers.js +12 -0
  387. package/dist/i18n/en-base.d.ts +295 -0
  388. package/dist/i18n/en-base.d.ts.map +1 -0
  389. package/dist/i18n/en-base.js +294 -0
  390. package/dist/i18n/en-create-list.d.ts +327 -0
  391. package/dist/i18n/en-create-list.d.ts.map +1 -0
  392. package/dist/i18n/en-create-list.js +326 -0
  393. package/dist/i18n/en-journey.d.ts +229 -0
  394. package/dist/i18n/en-journey.d.ts.map +1 -0
  395. package/dist/i18n/en-journey.js +228 -0
  396. package/dist/i18n/en-operations.d.ts +382 -0
  397. package/dist/i18n/en-operations.d.ts.map +1 -0
  398. package/dist/i18n/en-operations.js +381 -0
  399. package/dist/i18n/en-sections.d.ts +360 -0
  400. package/dist/i18n/en-sections.d.ts.map +1 -0
  401. package/dist/i18n/en-sections.js +359 -0
  402. package/dist/i18n/en.d.ts +1581 -0
  403. package/dist/i18n/en.d.ts.map +1 -0
  404. package/dist/i18n/en.js +12 -0
  405. package/dist/i18n/index.d.ts +5 -0
  406. package/dist/i18n/index.d.ts.map +1 -0
  407. package/dist/i18n/index.js +3 -0
  408. package/dist/i18n/messages-base.d.ts +251 -0
  409. package/dist/i18n/messages-base.d.ts.map +1 -0
  410. package/dist/i18n/messages-base.js +1 -0
  411. package/dist/i18n/messages-create-list.d.ts +310 -0
  412. package/dist/i18n/messages-create-list.d.ts.map +1 -0
  413. package/dist/i18n/messages-create-list.js +1 -0
  414. package/dist/i18n/messages-journey.d.ts +198 -0
  415. package/dist/i18n/messages-journey.d.ts.map +1 -0
  416. package/dist/i18n/messages-journey.js +1 -0
  417. package/dist/i18n/messages-operations.d.ts +362 -0
  418. package/dist/i18n/messages-operations.d.ts.map +1 -0
  419. package/dist/i18n/messages-operations.js +1 -0
  420. package/dist/i18n/messages-sections.d.ts +312 -0
  421. package/dist/i18n/messages-sections.d.ts.map +1 -0
  422. package/dist/i18n/messages-sections.js +1 -0
  423. package/dist/i18n/messages.d.ts +7 -0
  424. package/dist/i18n/messages.d.ts.map +1 -0
  425. package/dist/i18n/messages.js +1 -0
  426. package/dist/i18n/provider.d.ts +3185 -0
  427. package/dist/i18n/provider.d.ts.map +1 -0
  428. package/dist/i18n/provider.js +45 -0
  429. package/dist/i18n/ro-base.d.ts +295 -0
  430. package/dist/i18n/ro-base.d.ts.map +1 -0
  431. package/dist/i18n/ro-base.js +294 -0
  432. package/dist/i18n/ro-create-list.d.ts +327 -0
  433. package/dist/i18n/ro-create-list.d.ts.map +1 -0
  434. package/dist/i18n/ro-create-list.js +326 -0
  435. package/dist/i18n/ro-journey.d.ts +229 -0
  436. package/dist/i18n/ro-journey.d.ts.map +1 -0
  437. package/dist/i18n/ro-journey.js +228 -0
  438. package/dist/i18n/ro-operations.d.ts +382 -0
  439. package/dist/i18n/ro-operations.d.ts.map +1 -0
  440. package/dist/i18n/ro-operations.js +381 -0
  441. package/dist/i18n/ro-sections.d.ts +360 -0
  442. package/dist/i18n/ro-sections.d.ts.map +1 -0
  443. package/dist/i18n/ro-sections.js +359 -0
  444. package/dist/i18n/ro.d.ts +1581 -0
  445. package/dist/i18n/ro.d.ts.map +1 -0
  446. package/dist/i18n/ro.js +12 -0
  447. package/dist/index.d.ts +9 -0
  448. package/dist/index.d.ts.map +1 -0
  449. package/dist/index.js +8 -0
  450. package/dist/journey/components/booking-journey-rules.d.ts +48 -0
  451. package/dist/journey/components/booking-journey-rules.d.ts.map +1 -0
  452. package/dist/journey/components/booking-journey-rules.js +235 -0
  453. package/dist/journey/components/booking-journey.d.ts +3 -0
  454. package/dist/journey/components/booking-journey.d.ts.map +1 -0
  455. package/dist/journey/components/booking-journey.js +368 -0
  456. package/dist/journey/components/configure-step-skeleton.d.ts +8 -0
  457. package/dist/journey/components/configure-step-skeleton.d.ts.map +1 -0
  458. package/dist/journey/components/configure-step-skeleton.js +11 -0
  459. package/dist/journey/components/contract-preview-dialog.d.ts +47 -0
  460. package/dist/journey/components/contract-preview-dialog.d.ts.map +1 -0
  461. package/dist/journey/components/contract-preview-dialog.js +124 -0
  462. package/dist/journey/components/journey-steps/accommodation-step.d.ts +3 -0
  463. package/dist/journey/components/journey-steps/accommodation-step.d.ts.map +1 -0
  464. package/dist/journey/components/journey-steps/accommodation-step.js +71 -0
  465. package/dist/journey/components/journey-steps/addons-step.d.ts +3 -0
  466. package/dist/journey/components/journey-steps/addons-step.d.ts.map +1 -0
  467. package/dist/journey/components/journey-steps/addons-step.js +40 -0
  468. package/dist/journey/components/journey-steps/billing-step.d.ts +8 -0
  469. package/dist/journey/components/journey-steps/billing-step.d.ts.map +1 -0
  470. package/dist/journey/components/journey-steps/billing-step.js +78 -0
  471. package/dist/journey/components/journey-steps/configure-steps.d.ts +28 -0
  472. package/dist/journey/components/journey-steps/configure-steps.d.ts.map +1 -0
  473. package/dist/journey/components/journey-steps/configure-steps.js +232 -0
  474. package/dist/journey/components/journey-steps/documents-step.d.ts +11 -0
  475. package/dist/journey/components/journey-steps/documents-step.d.ts.map +1 -0
  476. package/dist/journey/components/journey-steps/documents-step.js +36 -0
  477. package/dist/journey/components/journey-steps/payment-step.d.ts +29 -0
  478. package/dist/journey/components/journey-steps/payment-step.d.ts.map +1 -0
  479. package/dist/journey/components/journey-steps/payment-step.js +225 -0
  480. package/dist/journey/components/journey-steps/review-step.d.ts +27 -0
  481. package/dist/journey/components/journey-steps/review-step.d.ts.map +1 -0
  482. package/dist/journey/components/journey-steps/review-step.js +18 -0
  483. package/dist/journey/components/journey-steps/shared.d.ts +75 -0
  484. package/dist/journey/components/journey-steps/shared.d.ts.map +1 -0
  485. package/dist/journey/components/journey-steps/shared.js +108 -0
  486. package/dist/journey/components/journey-steps/travelers-step.d.ts +7 -0
  487. package/dist/journey/components/journey-steps/travelers-step.d.ts.map +1 -0
  488. package/dist/journey/components/journey-steps/travelers-step.js +201 -0
  489. package/dist/journey/components/journey-steps.d.ts +21 -0
  490. package/dist/journey/components/journey-steps.d.ts.map +1 -0
  491. package/dist/journey/components/journey-steps.js +20 -0
  492. package/dist/journey/components/side-panel.d.ts +17 -0
  493. package/dist/journey/components/side-panel.d.ts.map +1 -0
  494. package/dist/journey/components/side-panel.js +245 -0
  495. package/dist/journey/components/stacked-journey.d.ts +30 -0
  496. package/dist/journey/components/stacked-journey.d.ts.map +1 -0
  497. package/dist/journey/components/stacked-journey.js +50 -0
  498. package/dist/journey/components/step-header.d.ts +7 -0
  499. package/dist/journey/components/step-header.d.ts.map +1 -0
  500. package/dist/journey/components/step-header.js +12 -0
  501. package/dist/journey/index.d.ts +18 -0
  502. package/dist/journey/index.d.ts.map +1 -0
  503. package/dist/journey/index.js +17 -0
  504. package/dist/journey/lib/draft-state.d.ts +35 -0
  505. package/dist/journey/lib/draft-state.d.ts.map +1 -0
  506. package/dist/journey/lib/draft-state.js +57 -0
  507. package/dist/journey/lib/pax-band-dependencies.d.ts +27 -0
  508. package/dist/journey/lib/pax-band-dependencies.d.ts.map +1 -0
  509. package/dist/journey/lib/pax-band-dependencies.js +50 -0
  510. package/dist/journey/lib/payment-schedule.d.ts +19 -0
  511. package/dist/journey/lib/payment-schedule.d.ts.map +1 -0
  512. package/dist/journey/lib/payment-schedule.js +90 -0
  513. package/dist/journey/types.d.ts +403 -0
  514. package/dist/journey/types.d.ts.map +1 -0
  515. package/dist/journey/types.js +19 -0
  516. package/dist/provider.d.ts +2 -0
  517. package/dist/provider.d.ts.map +1 -0
  518. package/dist/provider.js +1 -0
  519. package/dist/query-keys.d.ts +74 -0
  520. package/dist/query-keys.d.ts.map +1 -0
  521. package/dist/query-keys.js +26 -0
  522. package/dist/query-options.d.ts +2534 -0
  523. package/dist/query-options.d.ts.map +1 -0
  524. package/dist/query-options.js +233 -0
  525. package/dist/requirements/client.d.ts +14 -0
  526. package/dist/requirements/client.d.ts.map +1 -0
  527. package/dist/requirements/client.js +59 -0
  528. package/dist/requirements/components/booking-requirements-contact-tab.d.ts +8 -0
  529. package/dist/requirements/components/booking-requirements-contact-tab.d.ts.map +1 -0
  530. package/dist/requirements/components/booking-requirements-contact-tab.js +8 -0
  531. package/dist/requirements/components/booking-requirements-questions-tab.d.ts +14 -0
  532. package/dist/requirements/components/booking-requirements-questions-tab.d.ts.map +1 -0
  533. package/dist/requirements/components/booking-requirements-questions-tab.js +17 -0
  534. package/dist/requirements/constants.d.ts +114 -0
  535. package/dist/requirements/constants.d.ts.map +1 -0
  536. package/dist/requirements/constants.js +45 -0
  537. package/dist/requirements/hooks/index.d.ts +6 -0
  538. package/dist/requirements/hooks/index.d.ts.map +1 -0
  539. package/dist/requirements/hooks/index.js +6 -0
  540. package/dist/requirements/hooks/use-booking-questions.d.ts +24 -0
  541. package/dist/requirements/hooks/use-booking-questions.d.ts.map +1 -0
  542. package/dist/requirements/hooks/use-booking-questions.js +9 -0
  543. package/dist/requirements/hooks/use-contact-requirements.d.ts +22 -0
  544. package/dist/requirements/hooks/use-contact-requirements.d.ts.map +1 -0
  545. package/dist/requirements/hooks/use-contact-requirements.js +9 -0
  546. package/dist/requirements/hooks/use-products.d.ts +16 -0
  547. package/dist/requirements/hooks/use-products.d.ts.map +1 -0
  548. package/dist/requirements/hooks/use-products.js +9 -0
  549. package/dist/requirements/hooks/use-question-options.d.ts +19 -0
  550. package/dist/requirements/hooks/use-question-options.d.ts.map +1 -0
  551. package/dist/requirements/hooks/use-question-options.js +9 -0
  552. package/dist/requirements/hooks/use-transport-requirements.d.ts +30 -0
  553. package/dist/requirements/hooks/use-transport-requirements.d.ts.map +1 -0
  554. package/dist/requirements/hooks/use-transport-requirements.js +9 -0
  555. package/dist/requirements/i18n/en.d.ts +94 -0
  556. package/dist/requirements/i18n/en.d.ts.map +1 -0
  557. package/dist/requirements/i18n/en.js +93 -0
  558. package/dist/requirements/i18n/index.d.ts +5 -0
  559. package/dist/requirements/i18n/index.d.ts.map +1 -0
  560. package/dist/requirements/i18n/index.js +3 -0
  561. package/dist/requirements/i18n/messages.d.ts +59 -0
  562. package/dist/requirements/i18n/messages.d.ts.map +1 -0
  563. package/dist/requirements/i18n/messages.js +1 -0
  564. package/dist/requirements/i18n/provider.d.ts +210 -0
  565. package/dist/requirements/i18n/provider.d.ts.map +1 -0
  566. package/dist/requirements/i18n/provider.js +44 -0
  567. package/dist/requirements/i18n/ro.d.ts +94 -0
  568. package/dist/requirements/i18n/ro.d.ts.map +1 -0
  569. package/dist/requirements/i18n/ro.js +93 -0
  570. package/dist/requirements/index.d.ts +9 -0
  571. package/dist/requirements/index.d.ts.map +1 -0
  572. package/dist/requirements/index.js +8 -0
  573. package/dist/requirements/provider.d.ts +2 -0
  574. package/dist/requirements/provider.d.ts.map +1 -0
  575. package/dist/requirements/provider.js +1 -0
  576. package/dist/requirements/query-keys.d.ts +33 -0
  577. package/dist/requirements/query-keys.d.ts.map +1 -0
  578. package/dist/requirements/query-keys.js +13 -0
  579. package/dist/requirements/query-options.d.ts +371 -0
  580. package/dist/requirements/query-options.d.ts.map +1 -0
  581. package/dist/requirements/query-options.js +80 -0
  582. package/dist/requirements/schemas.d.ts +320 -0
  583. package/dist/requirements/schemas.d.ts.map +1 -0
  584. package/dist/requirements/schemas.js +121 -0
  585. package/dist/requirements/ui.d.ts +4 -0
  586. package/dist/requirements/ui.d.ts.map +1 -0
  587. package/dist/requirements/ui.js +3 -0
  588. package/dist/requirements/utils.d.ts +2 -0
  589. package/dist/requirements/utils.d.ts.map +1 -0
  590. package/dist/requirements/utils.js +4 -0
  591. package/dist/schemas.d.ts +2070 -0
  592. package/dist/schemas.d.ts.map +1 -0
  593. package/dist/schemas.js +507 -0
  594. package/dist/status-presentation.d.ts +34 -0
  595. package/dist/status-presentation.d.ts.map +1 -0
  596. package/dist/status-presentation.js +38 -0
  597. package/dist/ui.d.ts +43 -0
  598. package/dist/ui.d.ts.map +1 -0
  599. package/dist/ui.js +42 -0
  600. package/package.json +256 -0
  601. package/src/requirements/styles.css +1 -0
  602. package/src/styles.css +13 -0
@@ -0,0 +1,331 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ // agent-quality: file-size exception -- owner: bookings-react; existing UI surface stays co-located until a dedicated split preserves behavior and tests.
3
+ import { defineAdminExtension, } from "@voyant-travel/admin";
4
+ // Importing the slot id also binds the crm-ui `AdminDestinations`
5
+ // augmentation (`person.list`, `organization.list`, ...) into this program;
6
+ // this package already peer-depends on `@voyant-travel/relationships-react/ui`.
7
+ import { personDetailBookingsTabSlot } from "@voyant-travel/relationships-react/admin";
8
+ import * as React from "react";
9
+ import { z } from "zod";
10
+ // Lean statics only: the client module (fetcher), query-key types, and the
11
+ // skeletons. Query options and page data helpers resolve via dynamic import
12
+ // inside the loaders so the data layer (clients + response schemas) stays
13
+ // out of the workspace-chrome chunk that evaluates this factory.
14
+ import { defaultFetcher } from "../client.js";
15
+ import { BookingDetailSkeleton } from "./booking-detail-skeleton.js";
16
+ import { BookingsListSkeleton } from "./bookings-list-skeleton.js";
17
+ export { BookingDetailSkeleton } from "./booking-detail-skeleton.js";
18
+ export { BookingsListSkeleton } from "./bookings-list-skeleton.js";
19
+ export { bookingDetailFinanceEndSlot, bookingDetailFinanceStartSlot, bookingDetailInvoicesTabSlot, } from "./slots.js";
20
+ const bookingsListSortBySchema = z.enum([
21
+ "bookingNumber",
22
+ "status",
23
+ "sellAmount",
24
+ "pax",
25
+ "startDate",
26
+ "endDate",
27
+ "createdAt",
28
+ ]);
29
+ const bookingsListSortDirSchema = z.enum(["asc", "desc"]);
30
+ /**
31
+ * Search contract for the bookings list page: the URL projection of
32
+ * `BookingListFiltersState` (filters, sort, paging). Package-owned so the
33
+ * route file, the host, and the extension contribution validate the same
34
+ * shape. Defaults are absent from the URL — see
35
+ * {@link bookingsFiltersToSearch}.
36
+ */
37
+ export const bookingsIndexSearchSchema = z.object({
38
+ search: z.string().optional(),
39
+ status: z.string().optional(),
40
+ productId: z.string().optional(),
41
+ optionId: z.string().optional(),
42
+ supplierId: z.string().optional(),
43
+ productCategoryId: z.string().optional(),
44
+ personId: z.string().optional(),
45
+ organizationId: z.string().optional(),
46
+ availabilitySlotId: z.string().optional(),
47
+ dateFrom: z.string().optional(),
48
+ dateTo: z.string().optional(),
49
+ paxMin: z.string().optional(),
50
+ paxMax: z.string().optional(),
51
+ sortBy: bookingsListSortBySchema.optional(),
52
+ sortDir: bookingsListSortDirSchema.optional(),
53
+ offset: z.coerce.number().int().min(0).optional(),
54
+ });
55
+ /** URL search params → `BookingList` initial state. Empty / `"all"` /
56
+ * default values are absent in the URL; we let `BookingList`'s defaults
57
+ * fill them in. */
58
+ export function bookingsSearchToFilters(search) {
59
+ return {
60
+ search: search.search,
61
+ status: search.status,
62
+ productId: search.productId ?? null,
63
+ optionId: search.optionId ?? null,
64
+ supplierId: search.supplierId ?? null,
65
+ productCategoryId: search.productCategoryId ?? null,
66
+ personId: search.personId ?? null,
67
+ organizationId: search.organizationId ?? null,
68
+ availabilitySlotId: search.availabilitySlotId ?? null,
69
+ dateFrom: search.dateFrom ?? null,
70
+ dateTo: search.dateTo ?? null,
71
+ paxMin: search.paxMin,
72
+ paxMax: search.paxMax,
73
+ sortBy: search.sortBy,
74
+ sortDir: search.sortDir,
75
+ offset: search.offset,
76
+ };
77
+ }
78
+ /** Project the filter snapshot back into URL search params, dropping
79
+ * any value that matches the component's default so the URL stays
80
+ * clean when the operator is viewing the unfiltered list. */
81
+ export function bookingsFiltersToSearch(filters) {
82
+ return {
83
+ search: filters.search || undefined,
84
+ status: filters.status === "all" ? undefined : filters.status,
85
+ productId: filters.productId ?? undefined,
86
+ optionId: filters.optionId ?? undefined,
87
+ supplierId: filters.supplierId ?? undefined,
88
+ productCategoryId: filters.productCategoryId ?? undefined,
89
+ personId: filters.personId ?? undefined,
90
+ organizationId: filters.organizationId ?? undefined,
91
+ availabilitySlotId: filters.availabilitySlotId ?? undefined,
92
+ dateFrom: filters.dateFrom ?? undefined,
93
+ dateTo: filters.dateTo ?? undefined,
94
+ paxMin: filters.paxMin || undefined,
95
+ paxMax: filters.paxMax || undefined,
96
+ sortBy: filters.sortBy === "createdAt" ? undefined : filters.sortBy,
97
+ sortDir: filters.sortDir === "desc" ? undefined : filters.sortDir,
98
+ offset: filters.offset === 0 ? undefined : filters.offset,
99
+ };
100
+ }
101
+ /** Tab values of the canonical `BookingDetailPage`, as a search-param schema. */
102
+ export const bookingDetailTabSchema = z.enum([
103
+ "items",
104
+ "travelers",
105
+ "finance",
106
+ "invoices",
107
+ "documents",
108
+ "suppliers",
109
+ "activity",
110
+ "metadata",
111
+ ]);
112
+ /**
113
+ * Search contract for the booking detail page. `productId`/`slotId` only
114
+ * matter for the `"new"` pseudo-id: a deep link with a product pre-chosen
115
+ * redirects into the unified booking journey (host route concern).
116
+ */
117
+ export const bookingDetailSearchSchema = z.object({
118
+ productId: z.string().optional(),
119
+ slotId: z.string().optional(),
120
+ tab: bookingDetailTabSchema.optional(),
121
+ });
122
+ /**
123
+ * Search contract for the packaged "New booking" entry page. A deep link
124
+ * with `productId` pre-chosen (e.g. launched from a product page) forwards
125
+ * straight into the unified booking journey; `slotId` pins the departure.
126
+ */
127
+ export const bookingNewSearchSchema = z.object({
128
+ productId: z.string().optional(),
129
+ slotId: z.string().optional(),
130
+ });
131
+ /**
132
+ * Search contract for the unified booking journey page — the URL projection
133
+ * of the journey's entry state (provenance, pre-pinned departure/option/
134
+ * rate, side-panel preview hints). Key PRESENCE is meaningful: callers pass
135
+ * only the fields their selection actually carries.
136
+ */
137
+ export const bookingJourneySearchSchema = z.object({
138
+ sourceKind: z.string().min(1),
139
+ sourceConnectionId: z.string().optional(),
140
+ sourceRef: z.string().optional(),
141
+ departureId: z.string().optional(),
142
+ departureDate: z.string().optional(),
143
+ optionId: z.string().optional(),
144
+ roomTypeId: z.string().optional(),
145
+ ratePlanId: z.string().optional(),
146
+ board: z.string().optional(),
147
+ entityName: z.string().optional(),
148
+ entityImageUrl: z.string().optional(),
149
+ /** Stable draft id — refresh-safe. When absent, the journey page
150
+ * generates a fresh id on mount. */
151
+ draftId: z.string().optional(),
152
+ });
153
+ /** Map the host-supplied route runtime onto the bookings data client shape. */
154
+ function loaderClient(runtime) {
155
+ return { baseUrl: runtime.baseUrl, fetcher: runtime.fetcher ?? defaultFetcher };
156
+ }
157
+ const LazyPersonBookingsWidget = React.lazy(() => import("./person-bookings-widget.js").then((module) => ({
158
+ default: module.PersonBookingsWidget,
159
+ })));
160
+ /**
161
+ * Suspense-wrapped lazy mount of {@link LazyPersonBookingsWidget}. The widget
162
+ * registry takes a sync component, but the card (and the booking-list stack
163
+ * behind it) must not load with workspace chrome — the chunk fetches when the
164
+ * CRM person page actually renders the Bookings tab.
165
+ */
166
+ function PersonBookingsWidgetLoader(props) {
167
+ return (_jsx(React.Suspense, { fallback: null, children: _jsx(LazyPersonBookingsWidget, { ...props }) }));
168
+ }
169
+ function adminWidgetComponent(Widget) {
170
+ return function AdminWidgetComponent(props) {
171
+ return _jsx(Widget, { ...props });
172
+ };
173
+ }
174
+ const PersonBookingsWidgetContribution = adminWidgetComponent(PersonBookingsWidgetLoader);
175
+ /**
176
+ * The bookings admin contribution (packaged-admin RFC Phase 3,
177
+ * `@voyant-travel/<domain>-ui/admin` convention).
178
+ *
179
+ * NAVIGATION: deliberately none. The Bookings nav item is part of the BASE
180
+ * operator navigation — see `createOperatorAdminNavigation` in
181
+ * `@voyant-travel/admin` — so contributing nav entries here would duplicate it.
182
+ * If the base nav ever drops the bookings item, this extension is where the
183
+ * entry moves.
184
+ *
185
+ * ROUTES: full implementations (packaged-admin RFC §4.8) — the package-owned
186
+ * search contracts ({@link bookingsIndexSearchSchema} for the list,
187
+ * {@link bookingDetailSearchSchema} for the detail page), loaders that
188
+ * prefetch through the host-supplied runtime, and lazy `page` modules. The
189
+ * PAGES are package-owned too: {@link BookingsHost} and
190
+ * {@link BookingDetailHost} bind the canonical bookings pages to their data
191
+ * wiring (bookings/finance provider context) and resolve every cross-route
192
+ * link through the semantic destinations declared above — no app RPC client,
193
+ * no host route tree.
194
+ *
195
+ * `component:` stays unattached; each contribution carries a lazy `page`
196
+ * loader instead. The host binder wraps it in the router's lazy-component
197
+ * machinery (so the page lands in its own chunk) and hands the resolved
198
+ * component its route state as `AdminRoutePageProps` — which is how the
199
+ * param/search-taking bookings pages mount without a host route file. The
200
+ * `page` thunks below dynamically import the SPECIFIC page modules, never
201
+ * this barrel, so the factory itself never pins page code into the
202
+ * workspace-chrome chunk.
203
+ *
204
+ * WIDGETS: the crm-ui ↔ bookings-ui cycle resolution (RFC §4.7). The CRM
205
+ * person detail page mounts a Bookings tab, but this package depends on
206
+ * `@voyant-travel/relationships-react/ui`, so crm-ui's host cannot import the bookings-owned
207
+ * card. Instead this extension contributes {@link PersonBookingsWidget} on
208
+ * the `person.details.bookings-tab` slot crm-ui's `PersonDetailHost`
209
+ * exposes; the host mounts its Bookings tab whenever a contribution targets
210
+ * that slot and hands the widget its typed slot context
211
+ * (`PersonDetailBookingsTabContext`) as props.
212
+ */
213
+ export function createBookingsAdminExtension(options = {}) {
214
+ const { basePath = "/bookings", labels = {}, indexHeaderActions, detailPageComponent } = options;
215
+ const { bookings = "Bookings" } = labels;
216
+ return defineAdminExtension({
217
+ id: "bookings",
218
+ routes: [
219
+ {
220
+ id: "bookings-index",
221
+ path: basePath,
222
+ title: bookings,
223
+ // Route-backed destination (RFC §4.7 endgame): the key resolves by
224
+ // pure path interpolation of this route, so the host's resolver is
225
+ // generated (`voyant admin generate --destinations`). `booking.detail`
226
+ // is deliberately NOT bound: its resolver constructs the `tab` search
227
+ // param, which is beyond path interpolation — it stays hand-written.
228
+ destination: "booking.list",
229
+ ssr: "data-only",
230
+ validateSearch: (search) => bookingsIndexSearchSchema.parse(search),
231
+ pendingComponent: BookingsListSkeleton,
232
+ // Dynamic import on purpose: the query options pull the bookings
233
+ // data layer (client + response schemas), and a static import here
234
+ // would pin it into the workspace-chrome chunk that evaluates this
235
+ // factory. The loader and the page resolve shared modules once.
236
+ loader: async ({ queryClient, runtime }) => {
237
+ const { getBookingsQueryOptions } = await import("../query-options.js");
238
+ return queryClient.ensureQueryData(getBookingsQueryOptions(loaderClient(runtime)));
239
+ },
240
+ page: async () => {
241
+ const module = await import("./pages/bookings-index-page.js");
242
+ const Page = module.default;
243
+ // Tiny wrapper only — the heavy page stays in its own chunk; this
244
+ // closure just threads the app-owned header actions through.
245
+ return {
246
+ default: (props) => (_jsx(Page, { ...props, headerActions: indexHeaderActions })),
247
+ };
248
+ },
249
+ },
250
+ {
251
+ id: "bookings-detail",
252
+ path: `${basePath}/$id`,
253
+ title: bookings,
254
+ ssr: "data-only",
255
+ validateSearch: (search) => bookingDetailSearchSchema.parse(search),
256
+ pendingComponent: BookingDetailSkeleton,
257
+ // The static `/bookings/new` route (the "bookings-new" contribution
258
+ // below) outranks this param route for the `"new"` segment, but the
259
+ // loader stays defensive — nothing to prefetch for a pseudo-id.
260
+ loader: async ({ queryClient, runtime, params }) => {
261
+ const id = params.id;
262
+ if (!id || id === "new")
263
+ return;
264
+ // Dynamic import on purpose — see the index loader above.
265
+ const { getBookingActivityQueryOptions, getBookingNotesQueryOptions, getBookingQueryOptions, getSupplierStatusesQueryOptions, getTravelersQueryOptions, } = await import("../query-options.js");
266
+ const client = loaderClient(runtime);
267
+ // Critical: booking itself drives the header. Everything else
268
+ // (travelers, supplier statuses, activity, notes) is per-section
269
+ // and renders progressively.
270
+ await queryClient.ensureQueryData(getBookingQueryOptions(client, id));
271
+ void queryClient.prefetchQuery(getTravelersQueryOptions(client, id));
272
+ void queryClient.prefetchQuery(getSupplierStatusesQueryOptions(client, id));
273
+ void queryClient.prefetchQuery(getBookingActivityQueryOptions(client, id));
274
+ void queryClient.prefetchQuery(getBookingNotesQueryOptions(client, id));
275
+ },
276
+ page: async () => {
277
+ const module = await (detailPageComponent
278
+ ? detailPageComponent()
279
+ : import("./pages/booking-detail-page.js"));
280
+ const Page = module.default;
281
+ return {
282
+ default: ({ params, search, updateSearch }) => (_jsx(Page, { id: params.id ?? "", activeTab: search.tab, onTabChange: (tab) => updateSearch((prev) => ({ ...prev, tab }), { replace: true }) })),
283
+ };
284
+ },
285
+ },
286
+ {
287
+ id: "bookings-new",
288
+ path: `${basePath}/new`,
289
+ title: bookings,
290
+ // Route-backed destination (RFC §4.7 endgame): the key resolves by
291
+ // pure path interpolation of this route (no params), so the host's
292
+ // resolver is generated.
293
+ destination: "booking.create",
294
+ validateSearch: (search) => bookingNewSearchSchema.parse(search),
295
+ page: () => import("./pages/booking-new-page.js"),
296
+ },
297
+ {
298
+ id: "bookings-compose",
299
+ path: `${basePath}/compose`,
300
+ title: bookings,
301
+ // Alias route: forwards to the host's trips via the
302
+ // `trip.create` destination (see the page module).
303
+ page: () => import("./pages/booking-compose-page.js"),
304
+ },
305
+ {
306
+ id: "bookings-journey",
307
+ // Deliberately OUTSIDE `basePath`: the journey mounts on the catalog
308
+ // plane (`bookingJourney.start` hrefs point here), flat under the
309
+ // workspace layout so it renders without catalog section nesting —
310
+ // the same semantics the old escaped `catalog_.journey` route file
311
+ // had. NOT destination-annotated: `bookingJourney.start` constructs
312
+ // search params, which is beyond path interpolation — its resolver
313
+ // stays hand-written in the host map.
314
+ path: "/catalog/journey/$entityModule/$entityId",
315
+ title: bookings,
316
+ validateSearch: (search) => bookingJourneySearchSchema.parse(search),
317
+ page: () => import("./pages/booking-journey-page.js"),
318
+ },
319
+ ],
320
+ widgets: [
321
+ {
322
+ id: "bookings-person-bookings",
323
+ slot: personDetailBookingsTabSlot,
324
+ // The widget registry is untyped (`Record<string, unknown>` props);
325
+ // the typed contract is `PersonDetailBookingsTabContext`, which
326
+ // crm-ui's person detail host passes verbatim to this slot's widgets.
327
+ component: PersonBookingsWidgetContribution,
328
+ },
329
+ ],
330
+ });
331
+ }
@@ -0,0 +1,3 @@
1
+ import type { BillingExtrasContext } from "../journey/index.js";
2
+ export declare function JourneyBillingDuplicateWarning({ buyerType, personId, organizationId, productId, departureSlotId, }: BillingExtrasContext): React.ReactElement | null;
3
+ //# sourceMappingURL=journey-billing-duplicate-warning.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"journey-billing-duplicate-warning.d.ts","sourceRoot":"","sources":["../../src/admin/journey-billing-duplicate-warning.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAE/D,wBAAgB,8BAA8B,CAAC,EAC7C,SAAS,EACT,QAAQ,EACR,cAAc,EACd,SAAS,EACT,eAAe,GAChB,EAAE,oBAAoB,GAAG,KAAK,CAAC,YAAY,GAAG,IAAI,CA0ClD"}
@@ -0,0 +1,26 @@
1
+ "use client";
2
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
3
+ /**
4
+ * Heads-up shown under the billing block when the picked lead (person for B2C,
5
+ * organization for B2B) already has a booking on the selected departure — with
6
+ * a link to each. Helps operators avoid accidental duplicate bookings.
7
+ */
8
+ import { useAdminNavigate, useOperatorAdminMessages } from "@voyant-travel/admin";
9
+ import { useBookings } from "../hooks/use-bookings.js";
10
+ export function JourneyBillingDuplicateWarning({ buyerType, personId, organizationId, productId, departureSlotId, }) {
11
+ const t = useOperatorAdminMessages().bookings.detail.bookingJourney;
12
+ const navigate = useAdminNavigate();
13
+ const leadId = buyerType === "B2B" ? organizationId : personId;
14
+ // Only a scheduled departure (slot) gives a precise duplicate match.
15
+ const enabled = Boolean(leadId && departureSlotId);
16
+ const query = useBookings({
17
+ ...(buyerType === "B2B" ? { organizationId } : { personId }),
18
+ productId,
19
+ availabilitySlotId: departureSlotId,
20
+ enabled,
21
+ });
22
+ const existing = (query.data?.data ?? []).filter((booking) => booking.status !== "cancelled");
23
+ if (!enabled || existing.length === 0)
24
+ return null;
25
+ return (_jsxs("div", { className: "space-y-1 rounded-md border border-amber-300 bg-amber-50 p-3 text-amber-900 text-sm dark:border-amber-700 dark:bg-amber-950 dark:text-amber-100", children: [_jsxs("p", { children: ["\u26A0 ", t.duplicateDepartureWarning] }), _jsx("ul", { className: "space-y-0.5", children: existing.map((booking) => (_jsxs("li", { children: [_jsx("button", { type: "button", className: "font-medium underline underline-offset-2 hover:opacity-80", onClick: () => navigate("booking.detail", { bookingId: booking.id }), children: booking.bookingNumber }), booking.items?.[0]?.title ? (_jsxs("span", { className: "text-amber-900/80 dark:text-amber-100/80", children: [" ", "\u00B7 ", booking.items[0].title] })) : null] }, booking.id))) })] }));
26
+ }
@@ -0,0 +1,7 @@
1
+ import type { DeparturePickerProps } from "../journey/index.js";
2
+ export declare function JourneyDeparturePicker({ productId, optionId, slotId, departureDate, onChange, lockDeparture, }: DeparturePickerProps & {
3
+ /** The departure is fixed (a sourced offer's date came in pre-selected) —
4
+ * show it read-only rather than a re-editable input. */
5
+ lockDeparture?: boolean;
6
+ }): React.ReactElement;
7
+ //# sourceMappingURL=journey-departure-picker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"journey-departure-picker.d.ts","sourceRoot":"","sources":["../../src/admin/journey-departure-picker.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AA4B/D,wBAAgB,sBAAsB,CAAC,EACrC,SAAS,EACT,QAAQ,EACR,MAAM,EACN,aAAa,EACb,QAAQ,EACR,aAAqB,GACtB,EAAE,oBAAoB,GAAG;IACxB;6DACyD;IACzD,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB,GAAG,KAAK,CAAC,YAAY,CAsIrB"}
@@ -0,0 +1,100 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useSlots } from "@voyant-travel/operations-react/availability";
4
+ import { Combobox, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxInput, ComboboxItem, ComboboxList, } from "@voyant-travel/ui/components/combobox";
5
+ import { Input } from "@voyant-travel/ui/components/input";
6
+ import { Label } from "@voyant-travel/ui/components/label";
7
+ import { useEffect, useMemo, useState } from "react";
8
+ import { getBookableDepartureSlots } from "../components/booking-create-utils.js";
9
+ import { useBookingsUiMessagesOrDefault } from "../i18n/provider.js";
10
+ /**
11
+ * Admin departure picker for the booking journey's `"departure"`
12
+ * sub-step. Loads the owned product's scheduled departures from
13
+ * availability and lets the operator pick a real one (filtered by the
14
+ * chosen product option). When the product has no scheduled
15
+ * departures, it falls back to a free date so non-scheduled
16
+ * products can still be booked.
17
+ *
18
+ * Wired into `<BookingJourneyHost />` via the journey's
19
+ * `renderDeparturePicker` slot.
20
+ */
21
+ const dateFormatter = new Intl.DateTimeFormat(undefined, {
22
+ year: "numeric",
23
+ month: "short",
24
+ day: "numeric",
25
+ });
26
+ export function JourneyDeparturePicker({ productId, optionId, slotId, departureDate, onChange, lockDeparture = false, }) {
27
+ const messages = useBookingsUiMessagesOrDefault().bookingCreateDialog;
28
+ // Stable "now" so the slot query + future filter don't churn every render.
29
+ const [nowIso] = useState(() => new Date().toISOString());
30
+ const query = useSlots({
31
+ productId: productId || undefined,
32
+ status: "open",
33
+ startsAtFrom: nowIso,
34
+ limit: 100,
35
+ enabled: Boolean(productId) && !lockDeparture,
36
+ });
37
+ const slots = useMemo(() => getBookableDepartureSlots((query.data?.data ?? []), {
38
+ nowIso,
39
+ optionId,
40
+ }), [query.data?.data, nowIso, optionId]);
41
+ const slotMap = useMemo(() => new Map(slots.map((s) => [s.id, s])), [slots]);
42
+ const formatLabel = (slot) => {
43
+ const date = dateFormatter.format(new Date(slot.startsAt));
44
+ const remaining = !slot.unlimited && typeof slot.remainingPax === "number"
45
+ ? ` · ${slot.remainingPax} ${messages.labels.remainingCapacity}`
46
+ : "";
47
+ return `${date}${remaining}`;
48
+ };
49
+ const [inputValue, setInputValue] = useState(() => {
50
+ const current = slotId ? slotMap.get(slotId) : undefined;
51
+ return current ? formatLabel(current) : "";
52
+ });
53
+ // The draft keeps the picked slotId across step navigation, but this
54
+ // component's input is local state and re-seeds to "" on remount (before
55
+ // slots load). Reflect the selected slot's label once it resolves so a
56
+ // revisited departure shows as selected rather than empty.
57
+ // biome-ignore lint/correctness/useExhaustiveDependencies: formatLabel is render-stable; slotId/slotMap are the real triggers -- owner: bookings-react; existing suppression is intentional pending typed cleanup.
58
+ useEffect(() => {
59
+ if (!slotId)
60
+ return;
61
+ const slot = slotMap.get(slotId);
62
+ if (slot)
63
+ setInputValue((prev) => (prev ? prev : formatLabel(slot)));
64
+ }, [slotId, slotMap]);
65
+ // Sourced offer with a fixed date (came in pre-selected) → show it read-only.
66
+ // A different date would be a different offer, so there's nothing to edit.
67
+ if (lockDeparture && departureDate) {
68
+ return (_jsxs("div", { className: "space-y-1", children: [_jsx(Label, { children: messages.fields.departure }), _jsx("p", { className: "font-medium text-sm", children: dateFormatter.format(new Date(`${departureDate.slice(0, 10)}T00:00:00`)) })] }));
69
+ }
70
+ // No scheduled departures for this product → a free date so the operator can
71
+ // still set a departure for non-scheduled products. (No time field — tour /
72
+ // package departures are by date.)
73
+ if (!query.isLoading && slots.length === 0) {
74
+ return (_jsxs("div", { className: "space-y-1", children: [_jsx(Label, { htmlFor: "bj-departure-date", children: messages.fields.departure }), _jsx(Input, { id: "bj-departure-date", type: "date", className: "sm:max-w-xs", value: departureDate ?? "", onChange: (e) => onChange({ departureDate: e.target.value || null }) })] }));
75
+ }
76
+ return (_jsxs("div", { className: "flex flex-col gap-1", children: [_jsxs(Label, { children: [messages.fields.departure, " ", _jsx("span", { className: "text-destructive", children: "*" })] }), _jsxs(Combobox, { items: slots.map((s) => s.id), value: slotId || null, inputValue: inputValue, autoHighlight: true, disabled: query.isLoading, filter: () => true, itemToStringLabel: (id) => {
77
+ const slot = slotMap.get(id);
78
+ return slot ? formatLabel(slot) : id;
79
+ }, itemToStringValue: (id) => id, onInputValueChange: (next) => setInputValue(next), onValueChange: (next) => {
80
+ const id = next ?? "";
81
+ const slot = id ? slotMap.get(id) : undefined;
82
+ if (!slot) {
83
+ onChange({ slotId: null, departureDate: null });
84
+ setInputValue("");
85
+ return;
86
+ }
87
+ onChange({
88
+ slotId: slot.id,
89
+ // Anchor the free-date field on the slot's date so downstream
90
+ // (payment schedules, hold) has a concrete departure date.
91
+ departureDate: slot.startsAt.slice(0, 10),
92
+ });
93
+ setInputValue(formatLabel(slot));
94
+ }, children: [_jsx(ComboboxInput, { placeholder: messages.placeholders.departure, showClear: Boolean(slotId) }), _jsxs(ComboboxContent, { children: [_jsx(ComboboxEmpty, { children: messages.placeholders.departureEmpty }), _jsx(ComboboxList, { children: _jsx(ComboboxCollection, { children: (id) => {
95
+ const slot = slotMap.get(id);
96
+ if (!slot)
97
+ return null;
98
+ return (_jsx(ComboboxItem, { value: slot.id, children: formatLabel(slot) }, slot.id));
99
+ } }) })] })] })] }));
100
+ }
@@ -0,0 +1,11 @@
1
+ import type { UnitsPickerProps } from "../journey/index.js";
2
+ /**
3
+ * Admin rooms/units picker for the booking journey's `"option-units"`
4
+ * sub-step. Wraps the shared `OptionUnitsStepperSection` (which loads the
5
+ * product's option units + per-slot availability) and mirrors the picked
6
+ * quantities into the journey draft's `configure.optionSelections`.
7
+ *
8
+ * Wired into `<BookingJourneyHost />` via the `renderUnitsPicker` slot.
9
+ */
10
+ export declare function JourneyUnitsPicker({ productId, optionId, slotId, selections, onChange, }: UnitsPickerProps): React.ReactElement;
11
+ //# sourceMappingURL=journey-units-picker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"journey-units-picker.d.ts","sourceRoot":"","sources":["../../src/admin/journey-units-picker.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAA0B,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAEnF;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,SAAS,EACT,QAAQ,EACR,MAAM,EACN,UAAU,EACV,QAAQ,GACT,EAAE,gBAAgB,GAAG,KAAK,CAAC,YAAY,CAuDvC"}
@@ -0,0 +1,60 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { useRef, useState } from "react";
4
+ import { emptyOptionUnitsStepperValue, OptionUnitsStepperSection, } from "../components/option-units-stepper-section.js";
5
+ /**
6
+ * Admin rooms/units picker for the booking journey's `"option-units"`
7
+ * sub-step. Wraps the shared `OptionUnitsStepperSection` (which loads the
8
+ * product's option units + per-slot availability) and mirrors the picked
9
+ * quantities into the journey draft's `configure.optionSelections`.
10
+ *
11
+ * Wired into `<BookingJourneyHost />` via the `renderUnitsPicker` slot.
12
+ */
13
+ export function JourneyUnitsPicker({ productId, optionId, slotId, selections, onChange, }) {
14
+ // Seed the stepper from any selections already on the draft (refresh /
15
+ // step revisit). Local state mirrors the departure picker's approach.
16
+ const [value, setValue] = useState(() => {
17
+ const quantities = {};
18
+ for (const selection of selections) {
19
+ if (selection.optionUnitId)
20
+ quantities[selection.optionUnitId] = selection.quantity;
21
+ }
22
+ return Object.keys(quantities).length > 0 ? { quantities } : emptyOptionUnitsStepperValue;
23
+ });
24
+ // The loaded unit metadata (optionId + name per unit) needed to rebuild
25
+ // `optionSelections` from the quantity map.
26
+ // Loaded unit metadata is kept in a ref, NOT state: it's only read when
27
+ // the operator changes a quantity, never rendered. Using state here would
28
+ // make `onUnitsChange` (which fires as units load) re-render → the stepper
29
+ // re-emits → setDraft → re-quote → re-render … an infinite loop.
30
+ const unitsRef = useRef([]);
31
+ const emit = (quantities) => {
32
+ const next = [];
33
+ for (const unit of unitsRef.current) {
34
+ const quantity = quantities[unit.optionUnitId] ?? 0;
35
+ if (quantity <= 0)
36
+ continue;
37
+ const unitOptionId = unit.optionId ?? optionId;
38
+ if (!unitOptionId)
39
+ continue;
40
+ next.push({
41
+ optionId: unitOptionId,
42
+ optionUnitId: unit.optionUnitId,
43
+ optionUnitName: unit.unitName,
44
+ quantity,
45
+ });
46
+ }
47
+ onChange(next);
48
+ };
49
+ return (_jsx(OptionUnitsStepperSection, { value: value, onChange: (nextValue) => {
50
+ setValue(nextValue);
51
+ emit(nextValue.quantities);
52
+ }, productId: productId, slotId: slotId ?? undefined, optionId: optionId,
53
+ // The journey nests rooms under the chosen option — show only that
54
+ // option's units (New having no rooms correctly shows none).
55
+ restrictToOption: true, enabled: true,
56
+ // Record loaded units without triggering a render (see unitsRef note).
57
+ onUnitsChange: (loadedUnits) => {
58
+ unitsRef.current = loadedUnits;
59
+ } }));
60
+ }
@@ -0,0 +1,3 @@
1
+ import type { VoucherPickerProps } from "../journey/index.js";
2
+ export declare function JourneyVoucherPicker({ value, onApply }: VoucherPickerProps): React.ReactElement;
3
+ //# sourceMappingURL=journey-voucher-picker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"journey-voucher-picker.d.ts","sourceRoot":"","sources":["../../src/admin/journey-voucher-picker.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAc7D,wBAAgB,oBAAoB,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,kBAAkB,GAAG,KAAK,CAAC,YAAY,CAgF/F"}
@@ -0,0 +1,71 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ /**
4
+ * Admin voucher picker — an async combobox over the admin vouchers list.
5
+ * Staff search by code and pick a voucher (the full remaining balance is
6
+ * redeemed); they never need to know the exact code, unlike storefront
7
+ * customers. Wired into `<BookingJourneyHost />` via `renderVoucherPicker`.
8
+ */
9
+ import { useOperatorAdminMessages } from "@voyant-travel/admin";
10
+ import { useVouchers } from "@voyant-travel/finance-react";
11
+ import { Combobox, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxInput, ComboboxItem, ComboboxList, } from "@voyant-travel/ui/components/combobox";
12
+ import { Label } from "@voyant-travel/ui/components/label";
13
+ import { useEffect, useState } from "react";
14
+ function formatMoney(cents, currency) {
15
+ try {
16
+ return new Intl.NumberFormat(undefined, { style: "currency", currency }).format(cents / 100);
17
+ }
18
+ catch {
19
+ return `${(cents / 100).toFixed(2)} ${currency}`;
20
+ }
21
+ }
22
+ function voucherLabel(voucher) {
23
+ return `${voucher.code} · ${formatMoney(voucher.remainingAmountCents, voucher.currency)}`;
24
+ }
25
+ export function JourneyVoucherPicker({ value, onApply }) {
26
+ const t = useOperatorAdminMessages().bookings.detail.bookingJourney;
27
+ const [inputValue, setInputValue] = useState("");
28
+ const [search, setSearch] = useState("");
29
+ // Active vouchers with a remaining balance, filtered by the typed code.
30
+ const query = useVouchers({
31
+ status: "active",
32
+ hasBalance: true,
33
+ search: search || undefined,
34
+ limit: 20,
35
+ });
36
+ const vouchers = query.data?.data ?? [];
37
+ const byId = new Map(vouchers.map((v) => [v.id, v]));
38
+ const selectedId = value.voucherId ?? null;
39
+ // Reflect a pre-selected voucher's label once its record loads.
40
+ useEffect(() => {
41
+ if (selectedId && byId.has(selectedId)) {
42
+ setInputValue(voucherLabel(byId.get(selectedId)));
43
+ }
44
+ }, [selectedId, byId]);
45
+ return (_jsxs("div", { className: "space-y-1", children: [_jsx(Label, { children: t.voucherPickerLabel }), _jsxs(Combobox, { items: vouchers.map((v) => v.id), value: selectedId, inputValue: inputValue, autoHighlight: true, itemToStringLabel: (id) => {
46
+ const v = byId.get(id);
47
+ return v ? voucherLabel(v) : id;
48
+ }, itemToStringValue: (id) => id, onInputValueChange: (next) => {
49
+ setInputValue(next);
50
+ setSearch(next);
51
+ if (!next)
52
+ onApply(null);
53
+ }, onValueChange: (next) => {
54
+ const id = next ?? null;
55
+ if (!id) {
56
+ onApply(null);
57
+ setInputValue("");
58
+ return;
59
+ }
60
+ const v = byId.get(id);
61
+ if (v) {
62
+ onApply({ voucherId: v.id, amountCents: v.remainingAmountCents });
63
+ setInputValue(voucherLabel(v));
64
+ }
65
+ }, children: [_jsx(ComboboxInput, { placeholder: t.voucherSearchPlaceholder, showClear: !!selectedId }), _jsxs(ComboboxContent, { children: [_jsx(ComboboxEmpty, { children: t.voucherEmpty }), _jsx(ComboboxList, { children: _jsx(ComboboxCollection, { children: (id) => {
66
+ const v = byId.get(id);
67
+ if (!v)
68
+ return null;
69
+ return (_jsx(ComboboxItem, { value: v.id, children: _jsxs("div", { className: "flex min-w-0 flex-col", children: [_jsx("span", { className: "truncate font-medium", children: v.code }), _jsx("span", { className: "truncate text-muted-foreground text-xs", children: formatMoney(v.remainingAmountCents, v.currency) })] }) }, v.id));
70
+ } }) })] })] })] }));
71
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Legacy alias: `/bookings/compose` → the trips. The composer used
3
+ * to live here; it moved under the trips area, and this packaged page keeps
4
+ * the old URL working by forwarding to the `trip.create` destination (the
5
+ * host resolves it to its composer route). `replace` keeps route-redirect
6
+ * history semantics — the alias never lands in history.
7
+ */
8
+ export default function BookingComposePage(): null;
9
+ //# sourceMappingURL=booking-compose-page.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"booking-compose-page.d.ts","sourceRoot":"","sources":["../../../src/admin/pages/booking-compose-page.tsx"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,SAQzC"}