@coras-io/embed 0.5.1 → 0.6.1

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 (375) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +15 -2
  3. package/dist/components/accordion/accordion-item/accordion-item.component.js +9 -3
  4. package/dist/components/accordion/accordion-item/accordion-item.styles.js +4 -0
  5. package/dist/components/accordion/accordion.component.js +8 -0
  6. package/dist/components/alert/alert.component.d.ts +1 -1
  7. package/dist/components/alert/alert.component.js +4 -3
  8. package/dist/components/attraction-card/base/attraction-card.mixin.d.ts +0 -2
  9. package/dist/components/attraction-card/base/attraction-card.mixin.js +0 -6
  10. package/dist/components/attraction-card/base/attraction-card.types.d.ts +0 -1
  11. package/dist/components/basket-mobile/basket-mobile.component.d.ts +14 -3
  12. package/dist/components/basket-mobile/basket-mobile.component.js +71 -15
  13. package/dist/components/better-carousel/better-carousel.component.d.ts +3 -5
  14. package/dist/components/better-carousel/better-carousel.component.js +13 -34
  15. package/dist/components/breadcrumbs/breadcrumb-item/breadcrumb-item.component.js +5 -12
  16. package/dist/components/breadcrumbs/breadcrumb-item/breadcrumb-item.styles.js +13 -5
  17. package/dist/components/breadcrumbs/breadcrumbs.component.d.ts +0 -1
  18. package/dist/components/breadcrumbs/breadcrumbs.component.js +5 -8
  19. package/dist/components/breadcrumbs/breadcrumbs.styles.js +8 -2
  20. package/dist/components/button/button.constants.d.ts +1 -2
  21. package/dist/components/button/button.constants.js +0 -1
  22. package/dist/components/calendar/base/calendar.mixin.js +5 -1
  23. package/dist/components/calendar/multi/multi.component.d.ts +2 -2
  24. package/dist/components/calendar/multi/multi.component.js +12 -19
  25. package/dist/components/carousel/carousel.component.js +9 -2
  26. package/dist/components/categories-tree/categories-tree.component.d.ts +5 -3
  27. package/dist/components/categories-tree/categories-tree.component.js +22 -21
  28. package/dist/components/checkbox/checkbox.component.js +5 -1
  29. package/dist/components/checkbox-group/checkbox-group.component.js +1 -1
  30. package/dist/components/checkbox-group/checkbox-group.styles.js +1 -1
  31. package/dist/components/chip/chip.component.js +8 -3
  32. package/dist/components/crypto-auth-modal/crypto-auth-modal.component.d.ts +6 -0
  33. package/dist/components/crypto-auth-modal/crypto-auth-modal.component.js +15 -1
  34. package/dist/components/currencies-list/currencies-list.component.js +0 -1
  35. package/dist/components/dialog/dialog.component.js +52 -21
  36. package/dist/components/drawer/drawer.component.d.ts +3 -2
  37. package/dist/components/drawer/drawer.component.js +13 -18
  38. package/dist/components/drawer/drawer.styles.js +5 -2
  39. package/dist/components/dropdown/dropdown.component.js +6 -9
  40. package/dist/components/expiration-timer/expiration-timer.component.d.ts +2 -3
  41. package/dist/components/expiration-timer/expiration-timer.component.js +10 -8
  42. package/dist/components/explore-card/explore-card.component.js +3 -1
  43. package/dist/components/explore-card/explore-card.styles.js +31 -0
  44. package/dist/components/filters-drawer/filters-drawer.component.js +1 -1
  45. package/dist/components/flag-icon/flag-icon.component.d.ts +4 -2
  46. package/dist/components/flag-icon/flag-icon.component.js +16 -4
  47. package/dist/components/icon/icon.component.js +15 -2
  48. package/dist/components/image/image.component.js +4 -3
  49. package/dist/components/image-viewer/image-viewer.component.js +6 -4
  50. package/dist/components/input-field/input-field.component.js +10 -6
  51. package/dist/components/layout/layout.styles.js +1 -1
  52. package/dist/components/locales-list/locales-list.component.js +0 -1
  53. package/dist/components/location-image/location-image.component.d.ts +4 -4
  54. package/dist/components/location-image/location-image.component.js +6 -7
  55. package/dist/components/locations-results/locations-results.component.d.ts +10 -0
  56. package/dist/components/locations-results/locations-results.component.js +22 -15
  57. package/dist/components/locations-results/locations-results.styles.js +4 -1
  58. package/dist/components/message-card/message-card.component.d.ts +1 -1
  59. package/dist/components/message-card/message-card.component.js +4 -3
  60. package/dist/components/mobile-menu-item/mobile-menu-item.component.d.ts +0 -1
  61. package/dist/components/mobile-menu-item/mobile-menu-item.component.js +14 -16
  62. package/dist/components/mobile-menu-item/mobile-menu-item.styles.js +9 -5
  63. package/dist/components/option-group/option-chip/option-chip.component.d.ts +4 -1
  64. package/dist/components/option-group/option-chip/option-chip.component.js +23 -10
  65. package/dist/components/option-group/option-group.component.d.ts +3 -1
  66. package/dist/components/option-group/option-group.component.js +10 -3
  67. package/dist/components/overlay/overlay.component.d.ts +0 -5
  68. package/dist/components/overlay/overlay.component.js +3 -15
  69. package/dist/components/phone-country-code/phone-country-code.component.d.ts +4 -0
  70. package/dist/components/phone-country-code/phone-country-code.component.js +37 -0
  71. package/dist/components/phone-country-codes/phone-country-codes.component.js +1 -1
  72. package/dist/components/phone-field/phone-field.component.js +2 -2
  73. package/dist/components/search-button/search-button.component.d.ts +1 -1
  74. package/dist/components/search-button/search-button.component.js +13 -7
  75. package/dist/components/seated-selector/seated-selector.component.js +3 -3
  76. package/dist/components/seats-io/seats-io.component.d.ts +3 -2
  77. package/dist/components/seats-io/seats-io.component.js +31 -13
  78. package/dist/components/seats-io/seats-io.constants.d.ts +0 -2
  79. package/dist/components/seats-io/seats-io.constants.js +0 -3
  80. package/dist/components/seats-io/seats-io.transform.d.ts +1 -6
  81. package/dist/components/seats-io/seats-io.transform.js +1 -20
  82. package/dist/components/select-list/select-list.component.js +7 -2
  83. package/dist/components/select-list/select-option/select-option.component.d.ts +3 -1
  84. package/dist/components/select-list/select-option/select-option.component.js +10 -3
  85. package/dist/components/tabs/tabs.component.d.ts +2 -0
  86. package/dist/components/tabs/tabs.component.js +59 -5
  87. package/dist/components/time-tag/time-tag.component.js +1 -1
  88. package/dist/containers/basket/basket.component.d.ts +1 -1
  89. package/dist/containers/basket/basket.component.js +21 -20
  90. package/dist/containers/navbar/navbar.component.d.ts +12 -8
  91. package/dist/containers/navbar/navbar.component.js +108 -62
  92. package/dist/containers/navbar/navbar.styles.js +23 -5
  93. package/dist/containers/navbar/navbar.utils.js +4 -4
  94. package/dist/contexts/basket/basket.provider.d.ts +3 -4
  95. package/dist/contexts/basket/basket.provider.js +46 -61
  96. package/dist/contexts/basket/basket.types.d.ts +0 -2
  97. package/dist/controllers/time-expiration.d.ts +15 -2
  98. package/dist/controllers/time-expiration.js +47 -17
  99. package/dist/core/api/client.d.ts +9 -0
  100. package/dist/core/api/client.js +26 -0
  101. package/dist/core/api/middlewares/booking-session/booking-session.constants.d.ts +0 -2
  102. package/dist/core/api/middlewares/booking-session/booking-session.constants.js +0 -2
  103. package/dist/core/api/middlewares/booking-session/booking-session.js +3 -12
  104. package/dist/core/api/middlewares/booking-session/booking-session.utils.d.ts +0 -1
  105. package/dist/core/api/middlewares/booking-session/booking-session.utils.js +6 -28
  106. package/dist/core/api/middlewares/error-handler/error-handler.js +5 -1
  107. package/dist/core/api/middlewares/retry/retry.constants.d.ts +3 -0
  108. package/dist/core/api/middlewares/retry/retry.constants.js +7 -0
  109. package/dist/core/api/middlewares/retry/retry.d.ts +2 -0
  110. package/dist/core/api/middlewares/retry/retry.js +48 -0
  111. package/dist/core/api/queries.d.ts +13 -38
  112. package/dist/core/api/queries.js +16 -99
  113. package/dist/core/events.d.ts +2 -4
  114. package/dist/core/i18n/date.d.ts +14 -5
  115. package/dist/core/i18n/date.js +47 -20
  116. package/dist/core/i18n/localization.js +10 -3
  117. package/dist/core/images/helpers.js +6 -5
  118. package/dist/core/images/srcset.js +2 -2
  119. package/dist/core/logger.d.ts +17 -0
  120. package/dist/core/logger.js +13 -0
  121. package/dist/core/types/api-schema.d.ts +7872 -0
  122. package/dist/core/types/seats-config.d.ts +5 -4
  123. package/dist/core/types/seats-config.js +10 -3
  124. package/dist/core/utils/crypto-address.d.ts +12 -0
  125. package/dist/core/utils/crypto-address.js +17 -0
  126. package/dist/core/utils/datetime.d.ts +13 -11
  127. package/dist/core/utils/datetime.js +41 -51
  128. package/dist/core/utils/loyalty.d.ts +8 -0
  129. package/dist/core/utils/loyalty.js +10 -0
  130. package/dist/core/utils/redaction.d.ts +9 -0
  131. package/dist/core/utils/redaction.js +58 -0
  132. package/dist/core/utils/time.js +2 -3
  133. package/dist/helpers/helpers.d.ts +6 -0
  134. package/dist/helpers/helpers.js +33 -16
  135. package/dist/locales/ar-SA.d.ts +38 -21
  136. package/dist/locales/ar-SA.js +38 -21
  137. package/dist/locales/da-DK.d.ts +38 -21
  138. package/dist/locales/da-DK.js +38 -21
  139. package/dist/locales/de-DE.d.ts +38 -21
  140. package/dist/locales/de-DE.js +38 -21
  141. package/dist/locales/en-IE.d.ts +38 -21
  142. package/dist/locales/en-IE.js +38 -21
  143. package/dist/locales/en-US.d.ts +38 -21
  144. package/dist/locales/en-US.js +38 -21
  145. package/dist/locales/es-ES.d.ts +38 -21
  146. package/dist/locales/es-ES.js +38 -21
  147. package/dist/locales/fr-FR.d.ts +38 -21
  148. package/dist/locales/fr-FR.js +38 -21
  149. package/dist/locales/fr-MA.d.ts +38 -21
  150. package/dist/locales/fr-MA.js +38 -21
  151. package/dist/locales/is-IS.d.ts +38 -21
  152. package/dist/locales/is-IS.js +38 -21
  153. package/dist/locales/it-IT.d.ts +38 -21
  154. package/dist/locales/it-IT.js +38 -21
  155. package/dist/locales/ms-MY.d.ts +38 -21
  156. package/dist/locales/ms-MY.js +38 -21
  157. package/dist/locales/nb-NO.d.ts +38 -21
  158. package/dist/locales/nb-NO.js +38 -21
  159. package/dist/locales/pl-PL.d.ts +38 -21
  160. package/dist/locales/pl-PL.js +38 -21
  161. package/dist/locales/pt-PT.d.ts +38 -21
  162. package/dist/locales/pt-PT.js +38 -21
  163. package/dist/locales/sv-SE.d.ts +38 -21
  164. package/dist/locales/sv-SE.js +38 -21
  165. package/dist/locales/th-TH.d.ts +38 -21
  166. package/dist/locales/th-TH.js +38 -21
  167. package/dist/locales/tr-TR.d.ts +38 -21
  168. package/dist/locales/tr-TR.js +38 -21
  169. package/dist/locales/zh-CN.d.ts +38 -21
  170. package/dist/locales/zh-CN.js +38 -21
  171. package/dist/locales/zh-HK.d.ts +38 -21
  172. package/dist/locales/zh-HK.js +38 -21
  173. package/dist/mixins/base.mixin.d.ts +3 -1
  174. package/dist/mixins/base.mixin.js +10 -7
  175. package/dist/mixins/coinbase.mixin.d.ts +13 -17
  176. package/dist/mixins/coinbase.mixin.js +251 -288
  177. package/dist/mixins/error-modal.mixin.js +8 -4
  178. package/dist/mixins/location-search/location-search.d.ts +13 -1
  179. package/dist/mixins/location-search/location-search.js +35 -27
  180. package/dist/mixins/overlay/overlay-mixin.js +39 -3
  181. package/dist/mixins/overlay/types.d.ts +1 -0
  182. package/dist/mixins/search-mixin/search-mixin.js +8 -5
  183. package/dist/sdk/diagnostics.js +2 -0
  184. package/dist/sdk/mount.d.ts +10 -0
  185. package/dist/sdk/mount.js +20 -1
  186. package/dist/sdk/page-registry.js +5 -0
  187. package/dist/sdk/params.d.ts +53 -0
  188. package/dist/sdk/params.js +180 -0
  189. package/dist/sdk/redaction.d.ts +1 -4
  190. package/dist/sdk/redaction.js +2 -41
  191. package/dist/sdk/types.d.ts +21 -7
  192. package/dist/sdk/url.d.ts +1 -1
  193. package/dist/sdk/url.js +12 -5
  194. package/dist/sdk/validation.d.ts +1 -26
  195. package/dist/sdk/validation.js +8 -145
  196. package/dist/styles/tokens.d.ts +1 -1
  197. package/dist/styles/tokens.generated.d.ts +1 -1
  198. package/dist/styles/tokens.generated.js +1 -1
  199. package/dist/views/chrome-only-page/chrome-only-page.component.d.ts +30 -0
  200. package/dist/views/chrome-only-page/chrome-only-page.component.js +24 -0
  201. package/dist/views/chrome-only-page/chrome-only-page.d.ts +8 -0
  202. package/dist/views/chrome-only-page/chrome-only-page.js +6 -0
  203. package/dist/views/chrome-only-page/chrome-only-page.styles.js +13 -0
  204. package/dist/views/details-page/details-page.component.d.ts +11 -4
  205. package/dist/views/details-page/details-page.component.js +263 -237
  206. package/dist/views/details-page/details-page.utilts.d.ts +63 -3
  207. package/dist/views/details-page/details-page.utilts.js +53 -5
  208. package/dist/views/details-page/partials/location-categories/location-categories.component.d.ts +29 -0
  209. package/dist/views/details-page/partials/location-categories/location-categories.component.js +149 -0
  210. package/dist/views/details-page/partials/location-categories/location-categories.d.ts +8 -0
  211. package/dist/views/details-page/partials/location-categories/location-categories.js +6 -0
  212. package/dist/views/details-page/partials/location-categories/location-categories.styles.js +35 -0
  213. package/dist/views/details-page/partials/location-highlights/location-highlights.component.d.ts +26 -0
  214. package/dist/views/details-page/partials/location-highlights/location-highlights.component.js +158 -0
  215. package/dist/views/details-page/partials/location-highlights/location-highlights.d.ts +8 -0
  216. package/dist/views/details-page/partials/location-highlights/location-highlights.js +6 -0
  217. package/dist/views/details-page/partials/location-highlights/location-highlights.styles.js +42 -0
  218. package/dist/views/details-page/partials/tour-description/tour-description.component.js +1 -4
  219. package/dist/views/help-page/help-page.component.d.ts +2 -0
  220. package/dist/views/help-page/help-page.component.js +37 -18
  221. package/dist/views/help-page/help-page.utils.js +6 -5
  222. package/dist/views/landing-page/landing-page.component.d.ts +5 -8
  223. package/dist/views/landing-page/landing-page.component.js +82 -97
  224. package/dist/views/payment-page/controllers/crypto-auth.controller.d.ts +10 -4
  225. package/dist/views/payment-page/controllers/crypto-auth.controller.js +53 -31
  226. package/dist/views/payment-page/controllers/crypto-transfer.controller.d.ts +9 -5
  227. package/dist/views/payment-page/controllers/crypto-transfer.controller.js +26 -39
  228. package/dist/views/payment-page/controllers/payment-flow.controller.d.ts +6 -1
  229. package/dist/views/payment-page/controllers/payment-flow.controller.js +1 -0
  230. package/dist/views/payment-page/controllers/stripe-payment.controller.d.ts +20 -2
  231. package/dist/views/payment-page/controllers/stripe-payment.controller.js +42 -19
  232. package/dist/views/payment-page/partials/activity-details/activity-details.component.d.ts +2 -0
  233. package/dist/views/payment-page/partials/activity-details/activity-details.component.js +6 -3
  234. package/dist/views/payment-page/partials/billing-address/billing-address.component.d.ts +2 -0
  235. package/dist/views/payment-page/partials/billing-address/billing-address.component.js +5 -1
  236. package/dist/views/payment-page/partials/confirmation/confirmation.component.js +2 -3
  237. package/dist/views/payment-page/partials/country-field/country-field.component.js +1 -1
  238. package/dist/views/payment-page/partials/payment-type-selector/payment-type-selector.component.js +3 -3
  239. package/dist/views/payment-page/partials/stripe/stripe.component.d.ts +2 -0
  240. package/dist/views/payment-page/partials/stripe/stripe.component.js +36 -7
  241. package/dist/views/payment-page/partials/stripe/stripe.utils.js +0 -3
  242. package/dist/views/payment-page/payment-page.component.d.ts +39 -6
  243. package/dist/views/payment-page/payment-page.component.js +302 -178
  244. package/dist/views/payment-page/payment-page.constants.d.ts +1 -27
  245. package/dist/views/payment-page/payment-page.constants.js +3 -30
  246. package/dist/views/payment-page/payment-page.types.d.ts +1 -19
  247. package/dist/views/payment-page/payment-page.utils.d.ts +22 -13
  248. package/dist/views/payment-page/payment-page.utils.js +57 -75
  249. package/dist/views/payment-page/services/payment-api.service.d.ts +16 -34
  250. package/dist/views/payment-page/services/payment-api.service.js +19 -27
  251. package/dist/views/search-page/search-page.component.d.ts +2 -0
  252. package/dist/views/search-page/search-page.component.js +39 -20
  253. package/dist/views/suggestion-widget/suggestion-widget.component.d.ts +1 -0
  254. package/dist/views/suggestion-widget/suggestion-widget.component.js +6 -5
  255. package/package.json +24 -20
  256. package/dist/components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.component.d.ts +0 -10
  257. package/dist/components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.component.js +0 -43
  258. package/dist/components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.d.ts +0 -8
  259. package/dist/components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.js +0 -6
  260. package/dist/components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.styles.js +0 -23
  261. package/dist/components/attraction-discovery/attraction-discovery.component.d.ts +0 -10
  262. package/dist/components/attraction-discovery/attraction-discovery.component.js +0 -52
  263. package/dist/components/attraction-discovery/attraction-discovery.constants.d.ts +0 -4
  264. package/dist/components/attraction-discovery/attraction-discovery.constants.js +0 -5
  265. package/dist/components/attraction-discovery/attraction-discovery.d.ts +0 -8
  266. package/dist/components/attraction-discovery/attraction-discovery.js +0 -6
  267. package/dist/components/attraction-discovery/attraction-discovery.styles.js +0 -193
  268. package/dist/components/basket-rewards/basket-rewards.component.d.ts +0 -10
  269. package/dist/components/basket-rewards/basket-rewards.component.js +0 -52
  270. package/dist/components/basket-rewards/basket-rewards.d.ts +0 -8
  271. package/dist/components/basket-rewards/basket-rewards.js +0 -6
  272. package/dist/components/basket-rewards/basket-rewards.styles.js +0 -18
  273. package/dist/components/filter-chip/filter-chip.component.d.ts +0 -12
  274. package/dist/components/filter-chip/filter-chip.component.js +0 -68
  275. package/dist/components/filter-chip/filter-chip.constants.d.ts +0 -2
  276. package/dist/components/filter-chip/filter-chip.constants.js +0 -2
  277. package/dist/components/filter-chip/filter-chip.d.ts +0 -8
  278. package/dist/components/filter-chip/filter-chip.js +0 -6
  279. package/dist/components/filter-chip/filter-chip.styles.d.ts +0 -2
  280. package/dist/components/filter-chip/filter-chip.styles.js +0 -162
  281. package/dist/components/image-carousel/image-carousel-item/image-carousel-item.component.d.ts +0 -10
  282. package/dist/components/image-carousel/image-carousel-item/image-carousel-item.component.js +0 -43
  283. package/dist/components/image-carousel/image-carousel-item/image-carousel-item.d.ts +0 -8
  284. package/dist/components/image-carousel/image-carousel-item/image-carousel-item.js +0 -6
  285. package/dist/components/image-carousel/image-carousel-item/image-carousel-item.styles.d.ts +0 -2
  286. package/dist/components/image-carousel/image-carousel-item/image-carousel-item.styles.js +0 -28
  287. package/dist/components/image-carousel/image-carousel.component.d.ts +0 -8
  288. package/dist/components/image-carousel/image-carousel.component.js +0 -36
  289. package/dist/components/image-carousel/image-carousel.d.ts +0 -8
  290. package/dist/components/image-carousel/image-carousel.js +0 -6
  291. package/dist/components/image-carousel/image-carousel.styles.d.ts +0 -2
  292. package/dist/components/image-carousel/image-carousel.styles.js +0 -72
  293. package/dist/components/itinerary/itinerary-item/itinerary-item.component.d.ts +0 -9
  294. package/dist/components/itinerary/itinerary-item/itinerary-item.component.js +0 -45
  295. package/dist/components/itinerary/itinerary-item/itinerary-item.d.ts +0 -8
  296. package/dist/components/itinerary/itinerary-item/itinerary-item.js +0 -6
  297. package/dist/components/itinerary/itinerary-item/itinerary-item.styles.d.ts +0 -2
  298. package/dist/components/itinerary/itinerary-item/itinerary-item.styles.js +0 -70
  299. package/dist/components/itinerary/itinerary.component.d.ts +0 -7
  300. package/dist/components/itinerary/itinerary.component.js +0 -23
  301. package/dist/components/itinerary/itinerary.d.ts +0 -8
  302. package/dist/components/itinerary/itinerary.js +0 -6
  303. package/dist/components/itinerary/itinerary.styles.d.ts +0 -2
  304. package/dist/components/itinerary/itinerary.styles.js +0 -15
  305. package/dist/components/marketing-tag/marketing-tag.component.d.ts +0 -5
  306. package/dist/components/marketing-tag/marketing-tag.component.js +0 -8
  307. package/dist/components/marketing-tag/marketing-tag.d.ts +0 -8
  308. package/dist/components/marketing-tag/marketing-tag.js +0 -6
  309. package/dist/components/marketing-tag/marketing-tag.styles.d.ts +0 -2
  310. package/dist/components/marketing-tag/marketing-tag.styles.js +0 -36
  311. package/dist/components/price/price.component.d.ts +0 -12
  312. package/dist/components/price/price.component.js +0 -38
  313. package/dist/components/price/price.d.ts +0 -8
  314. package/dist/components/price/price.js +0 -6
  315. package/dist/components/reviews/review/review.component.d.ts +0 -9
  316. package/dist/components/reviews/review/review.component.js +0 -41
  317. package/dist/components/reviews/review/review.d.ts +0 -8
  318. package/dist/components/reviews/review/review.js +0 -6
  319. package/dist/components/reviews/review/review.styles.d.ts +0 -2
  320. package/dist/components/reviews/review/review.styles.js +0 -45
  321. package/dist/components/reviews/reviews.component.d.ts +0 -9
  322. package/dist/components/reviews/reviews.component.js +0 -56
  323. package/dist/components/reviews/reviews.d.ts +0 -8
  324. package/dist/components/reviews/reviews.js +0 -6
  325. package/dist/components/reviews/reviews.styles.d.ts +0 -2
  326. package/dist/components/reviews/reviews.styles.js +0 -73
  327. package/dist/components/selected-tickets-preview/selected-tickets-preview.component.d.ts +0 -10
  328. package/dist/components/selected-tickets-preview/selected-tickets-preview.component.js +0 -51
  329. package/dist/components/selected-tickets-preview/selected-tickets-preview.d.ts +0 -8
  330. package/dist/components/selected-tickets-preview/selected-tickets-preview.js +0 -6
  331. package/dist/components/selected-tickets-preview/selected-tickets-preview.styles.d.ts +0 -2
  332. package/dist/components/selected-tickets-preview/selected-tickets-preview.styles.js +0 -89
  333. package/dist/components/tag/tag.component.d.ts +0 -8
  334. package/dist/components/tag/tag.component.js +0 -33
  335. package/dist/components/tag/tag.constants.d.ts +0 -1
  336. package/dist/components/tag/tag.constants.js +0 -1
  337. package/dist/components/tag/tag.d.ts +0 -8
  338. package/dist/components/tag/tag.js +0 -6
  339. package/dist/components/tag/tag.styles.d.ts +0 -2
  340. package/dist/components/tag/tag.styles.js +0 -56
  341. package/dist/components/tooltip/tooltip.component.d.ts +0 -19
  342. package/dist/components/tooltip/tooltip.component.js +0 -124
  343. package/dist/components/tooltip/tooltip.d.ts +0 -8
  344. package/dist/components/tooltip/tooltip.js +0 -6
  345. package/dist/components/tooltip/tooltip.styles.d.ts +0 -2
  346. package/dist/components/tooltip/tooltip.styles.js +0 -79
  347. package/dist/core/signals.d.ts +0 -2
  348. package/dist/core/signals.js +0 -3
  349. package/dist/core/storybook/argTypes.d.ts +0 -1
  350. package/dist/core/storybook/argTypes.js +0 -46
  351. package/dist/core/storybook/cssprops.d.ts +0 -30
  352. package/dist/core/storybook/cssprops.js +0 -46
  353. package/dist/core/storybook/demo.d.ts +0 -4
  354. package/dist/core/storybook/demo.js +0 -17
  355. package/dist/core/types/api-errors.d.ts +0 -8
  356. package/dist/core/types/api-errors.js +0 -1
  357. package/dist/styles/contrast-fixtures.d.ts +0 -5
  358. package/dist/styles/contrast-fixtures.js +0 -131
  359. package/dist/views/payment-page/domain/payment-mappers.d.ts +0 -7
  360. package/dist/views/payment-page/domain/payment-mappers.js +0 -7
  361. package/dist/views/payment-page/domain/payment-validators.d.ts +0 -6
  362. package/dist/views/payment-page/domain/payment-validators.js +0 -6
  363. package/dist/views/payment-page/domain/recovery-payload.d.ts +0 -8
  364. package/dist/views/payment-page/domain/recovery-payload.js +0 -7
  365. package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.component.d.ts +0 -22
  366. package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.component.js +0 -65
  367. package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.d.ts +0 -8
  368. package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.js +0 -6
  369. package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.styles.d.ts +0 -2
  370. package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.styles.js +0 -12
  371. package/dist/views/payment-page/payment-page.validation-schema.d.ts +0 -28
  372. package/dist/views/payment-page/payment-page.validation-schema.js +0 -42
  373. /package/dist/{components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.styles.d.ts → views/chrome-only-page/chrome-only-page.styles.d.ts} +0 -0
  374. /package/dist/{components/attraction-discovery/attraction-discovery.styles.d.ts → views/details-page/partials/location-categories/location-categories.styles.d.ts} +0 -0
  375. /package/dist/{components/basket-rewards/basket-rewards.styles.d.ts → views/details-page/partials/location-highlights/location-highlights.styles.d.ts} +0 -0
@@ -1,38 +1,12 @@
1
- export declare const STRIPE_ERRORS: {
2
- invalid_number: () => string;
3
- invalid_expiry_month: () => string;
4
- invalid_expiry_year: () => string;
5
- invalid_expiry_year_past: () => string;
6
- invalid_cvc: () => string;
7
- incorrect_number: () => string;
8
- incomplete_number: () => string;
9
- incomplete_cvc: () => string;
10
- incomplete_expiry: () => string;
11
- expired_card: () => string;
12
- incorrect_cvc: () => string;
13
- incorrect_zip: () => string;
14
- card_declined: () => string;
15
- missing: () => string;
16
- processing_error: () => string;
17
- };
18
- export declare const STRIPE_FIELD_GENERIC_ERROR: () => string;
19
1
  export declare const PAYMENT_LAYOUT_BREAKPOINT_PX = 900;
20
2
  export declare const TRANSACTION_POLLING_MAX_ATTEMPTS = 30;
21
3
  export declare const TRANSACTION_POLLING_INITIAL_INTERVAL_MS = 1000;
22
4
  export declare const TRANSACTION_POLLING_MAX_INTERVAL_MS = 8000;
5
+ export declare const TRANSACTION_RECHECK_MAX_ATTEMPTS = 3;
23
6
  export declare const OTP_INACTIVITY_TIMEOUT_MS = 30000;
24
- export declare const OTP_EXPIRY_MINUTES = 10;
25
7
  export declare const OTP_MIN_RESEND_INTERVAL_MS = 60000;
26
8
  export declare const OTP_MAX_ATTEMPTS_PER_SESSION = 5;
27
- export declare const SMS_OTP_INACTIVITY_TIMEOUT_MS = 30000;
28
- export declare const SMS_OTP_EXPIRY_MINUTES = 5;
29
9
  export declare const SMS_OTP_MIN_RESEND_INTERVAL_MS = 60000;
30
10
  export declare const SMS_OTP_MAX_ATTEMPTS_PER_SESSION = 5;
31
11
  export declare const BALANCE_BACKOFF_INITIAL_MS = 5000;
32
12
  export declare const BALANCE_BACKOFF_MAX_MS = 60000;
33
- export declare const STRIPE_MIN_KEY_LENGTH = 32;
34
- export declare const STRIPE_PAYMENT_INTENT_PREFIX = "pi_";
35
- export declare const PHONE_NUMBER_MAX_LENGTH = 15;
36
- export declare const OTP_CODE_LENGTH = 6;
37
- export declare const SCROLL_TO_ERROR_DELAY_MS = 100;
38
- export declare const FORM_DEBOUNCE_MS = 300;
@@ -1,45 +1,18 @@
1
- import { msg } from "@lit/localize";
2
- export const STRIPE_ERRORS = {
3
- invalid_number: () => msg("Your card number is not a valid credit card number."),
4
- invalid_expiry_month: () => msg("Your card’s expiration month is invalid."),
5
- invalid_expiry_year: () => msg("Your card’s expiration year is invalid."),
6
- invalid_expiry_year_past: () => msg("Your card’s expiration year is in the past."),
7
- invalid_cvc: () => msg("Your card’s security code is invalid."),
8
- incorrect_number: () => msg("Your card number is incorrect."),
9
- incomplete_number: () => msg("Your card number is incomplete."),
10
- incomplete_cvc: () => msg("Your card’s security code is incomplete."),
11
- incomplete_expiry: () => msg("Your card’s expiration date is incomplete."),
12
- expired_card: () => msg("Your card has expired."),
13
- incorrect_cvc: () => msg("Your card’s security code is incorrect."),
14
- incorrect_zip: () => msg("Your card’s zip code failed validation."),
15
- card_declined: () => msg("Your card was declined."),
16
- missing: () => msg("There is no card on a customer that is being charged."),
17
- processing_error: () => msg("An error occurred while processing the card."),
18
- };
19
- export const STRIPE_FIELD_GENERIC_ERROR = () => msg("An error occurred.");
20
1
  export const PAYMENT_LAYOUT_BREAKPOINT_PX = 900;
2
+ // Key of the loyalty token in the API's `loyalty.pay` / `loyalty.earn` maps
21
3
  // Transaction polling configuration
22
4
  export const TRANSACTION_POLLING_MAX_ATTEMPTS = 30;
23
5
  export const TRANSACTION_POLLING_INITIAL_INTERVAL_MS = 1000;
24
6
  export const TRANSACTION_POLLING_MAX_INTERVAL_MS = 8000;
7
+ // Attempts for the customer-triggered "Check again" from the pending state
8
+ export const TRANSACTION_RECHECK_MAX_ATTEMPTS = 3;
25
9
  // OTP configuration (Email)
26
10
  export const OTP_INACTIVITY_TIMEOUT_MS = 30000; // 30 seconds
27
- export const OTP_EXPIRY_MINUTES = 10;
28
11
  export const OTP_MIN_RESEND_INTERVAL_MS = 60000; // 1 minute minimum between OTP sends
29
12
  export const OTP_MAX_ATTEMPTS_PER_SESSION = 5; // Maximum OTP attempts per session
30
13
  // SMS OTP configuration (for phone linking)
31
- export const SMS_OTP_INACTIVITY_TIMEOUT_MS = 30000; // 30 seconds
32
- export const SMS_OTP_EXPIRY_MINUTES = 5; // SMS codes expire faster than email
33
14
  export const SMS_OTP_MIN_RESEND_INTERVAL_MS = 60000; // 1 minute minimum between SMS sends
34
15
  export const SMS_OTP_MAX_ATTEMPTS_PER_SESSION = 5; // Maximum SMS attempts per session
35
16
  // Balance polling configuration
36
17
  export const BALANCE_BACKOFF_INITIAL_MS = 5000;
37
18
  export const BALANCE_BACKOFF_MAX_MS = 60000;
38
- // Stripe configuration
39
- export const STRIPE_MIN_KEY_LENGTH = 32;
40
- export const STRIPE_PAYMENT_INTENT_PREFIX = "pi_";
41
- // Form configuration
42
- export const PHONE_NUMBER_MAX_LENGTH = 15;
43
- export const OTP_CODE_LENGTH = 6;
44
- export const SCROLL_TO_ERROR_DELAY_MS = 100;
45
- export const FORM_DEBOUNCE_MS = 300;
@@ -1,6 +1,5 @@
1
1
  import type { components } from "../../core/types/api-schema.js";
2
2
  import type { Stripe, StripeCardNumberElement, StripeElements, PaymentRequest } from "@stripe/stripe-js";
3
- export type PaymentOption = "fida" | "card" | "google" | "apple";
4
3
  export type { PhoneCodeSelection } from "../../components/phone-field/phone-field.types.js";
5
4
  type ReservationsData = {
6
5
  [reservationId: string]: {
@@ -46,7 +45,7 @@ export type TransactionStatus = components["schemas"]["UserTransactions"]["statu
46
45
  export type ReservationConfirmationResponse = components["schemas"]["ReservationsPutResponse"];
47
46
  export interface ApiError {
48
47
  title?: string;
49
- errors?: {
48
+ errors: {
50
49
  [fieldName: string]: string[] | string | Record<string, string[] | string> | Record<string, Record<string, string[] | string>> | undefined;
51
50
  };
52
51
  }
@@ -69,23 +68,6 @@ export interface CustomerData {
69
68
  phone?: string;
70
69
  address?: StripeBillingAddress;
71
70
  }
72
- /**
73
- * Transaction status values from the API.
74
- */
75
- export type TransactionPollingStatus = "PAID" | "PENDING" | "ADDED" | "SUSPENDED" | "FAILED" | null;
76
- /**
77
- * OTP rate limiting state for crypto authentication.
78
- */
79
- export interface OtpRateLimitState {
80
- /** Number of OTP send attempts in current session */
81
- attempts: number;
82
- /** Timestamp of last OTP send */
83
- lastSentTime: number;
84
- /** Whether currently rate limited */
85
- isRateLimited: boolean;
86
- /** Seconds remaining before next send allowed */
87
- cooldownRemaining: number;
88
- }
89
71
  /**
90
72
  * Field visibility flags computed from requirements data.
91
73
  */
@@ -3,11 +3,18 @@ import type { ReservationSummary } from "../../contexts/basket/basket.types.js";
3
3
  import type { FormValues, PhoneCodeSelection, FieldsConfig, ApiError, InputFieldType, InputFieldAutocomplete } from "./payment-page.types.js";
4
4
  import type { Client } from "openapi-fetch";
5
5
  import type { SupportedLocales } from "../../core/types/index.js";
6
- import type { ValidatorContext } from "./payment-page.validators.js";
6
+ import type { Logger } from "../../core/logger.js";
7
+ import { type ValidatorContext } from "./payment-page.validators.js";
7
8
  /**
8
9
  * Capitalizes the first letter of a string and replaces underscores with spaces
9
10
  */
10
11
  export declare const capitalizeFirstLetter: (str: string) => string;
12
+ /**
13
+ * Field elements that show an error state, in the forms the partials render.
14
+ * Shared by the payment page's scroll-to-first-error, which cannot query
15
+ * through the partials' shadow roots itself.
16
+ */
17
+ export declare const INVALID_FIELD_SELECTOR: string;
11
18
  /**
12
19
  * Gets the default phone code selection based on locale.
13
20
  * Extracts the country code from the locale (e.g., "en-IE" -> "IE")
@@ -134,6 +141,11 @@ export declare function prepareAttendeesData(reservations: ReservationSummary[],
134
141
  }[];
135
142
  hasRequirements: boolean;
136
143
  };
144
+ /**
145
+ * The error middleware wraps every non-ok body in an `APIError`; the field
146
+ * mapping below reads the body itself.
147
+ */
148
+ export declare const unwrapApiErrorBody: (err: unknown) => unknown;
137
149
  /**
138
150
  * Type guard for API errors
139
151
  */
@@ -153,17 +165,15 @@ export declare function mapApiErrorsToForm(error: unknown, currentFormErrors: Re
153
165
  cardError?: string;
154
166
  };
155
167
  /**
156
- * Checks transaction status with exponential backoff.
168
+ * Polls the customer's transactions for `transactionId` with exponential
169
+ * backoff until it reaches a final status or `maxAttempts` is spent. A
170
+ * transaction that is not listed yet counts as non-final and keeps polling.
157
171
  * Pass an AbortSignal to cancel polling early (e.g., on component disconnect).
158
172
  */
159
- export declare function pollTransactionStatus(userId: string, maxAttempts: number, initialInterval: number, maxInterval: number, client: Client<paths>, distributorID: string, locale: SupportedLocales, onReferenceId?: (id: string) => void, signal?: AbortSignal): Promise<{
173
+ export declare function pollTransactionStatus(userId: string, transactionId: string, maxAttempts: number, initialInterval: number, maxInterval: number, client: Client<paths>, distributorID: string, locale: SupportedLocales, logger: Logger, onReferenceId?: (id: string) => void, signal?: AbortSignal): Promise<{
160
174
  status: string | null;
161
175
  tokensToIssue: string | null;
162
176
  }>;
163
- /**
164
- * Validates an email address
165
- */
166
- export declare const isValidEmail: (email: string) => boolean;
167
177
  /**
168
178
  * Validates a wallet email address
169
179
  */
@@ -198,13 +208,12 @@ export declare function mapStripeErrorToField(error: unknown): "number" | "expir
198
208
  export declare function isFinalStatus(status: string | null): boolean;
199
209
  export declare function extractPaymentIntentId(clientSecret: string): string;
200
210
  /**
201
- * Formats phone number with a plus prefix if needed.
202
- * IMPROVED: Validates a phone format before adding a prefix to prevent invalid numbers.
203
- *
204
- * @param phone - Phone number to format
205
- * @returns Formatted phone number with + prefix, or undefined if invalid
211
+ * Normalises a customer-entered phone number to E.164 ("+353871234567").
212
+ * The country resolves national input, including a trunk prefix such as the
213
+ * leading 0 in "0871234567"; a number typed with "+" is taken as-is.
214
+ * Returns undefined when the input is empty or cannot be parsed.
206
215
  */
207
- export declare function formatPhoneWithPlus(phone?: string | null): string | undefined;
216
+ export declare function toE164(value: string | null | undefined, countryCode?: string | null): string | undefined;
208
217
  /**
209
218
  * Persisted transfer payload stored in localStorage for crash recovery.
210
219
  */
@@ -1,5 +1,9 @@
1
1
  import { msg } from "@lit/localize";
2
- import { apiGet, withErrorHandling } from "../../core/api/queries.js";
2
+ import { apiGet } from "../../core/api/queries.js";
3
+ import { getLoyaltyAmount } from "../../core/utils/loyalty.js";
4
+ import { APIError } from "../../core/api/api-error.js";
5
+ import { parsePhoneNumberFromString, } from "libphonenumber-js/min";
6
+ import { validEmail, } from "./payment-page.validators.js";
3
7
  /**
4
8
  * Capitalizes the first letter of a string and replaces underscores with spaces
5
9
  */
@@ -8,6 +12,18 @@ export const capitalizeFirstLetter = (str) => {
8
12
  return "";
9
13
  return str.charAt(0).toUpperCase() + str.slice(1).replace(/_/g, " ");
10
14
  };
15
+ /**
16
+ * Field elements that show an error state, in the forms the partials render.
17
+ * Shared by the payment page's scroll-to-first-error, which cannot query
18
+ * through the partials' shadow roots itself.
19
+ */
20
+ export const INVALID_FIELD_SELECTOR = [
21
+ "coras-field[error]",
22
+ "coras-phone-field[error]",
23
+ "coras-country-field[has-error]",
24
+ "coras-hotel-pickup-field[has-error]",
25
+ "coras-joined-fields[error]",
26
+ ].join(", ");
11
27
  /**
12
28
  * Gets the default phone code selection based on locale.
13
29
  * Extracts the country code from the locale (e.g., "en-IE" -> "IE")
@@ -89,7 +105,8 @@ export const getFieldValue = (fieldName, formValues) => {
89
105
  * Handles form value changes and updates the form values object
90
106
  */
91
107
  export const handleFormValueChange = (fieldName, value, formValues) => {
92
- // Create a deep copy of the current formValues
108
+ // Shallow copy: a new top-level object is what Lit's property change
109
+ // detection needs; nested reservation entries are updated in place below.
93
110
  const newFormValues = { ...formValues };
94
111
  // Check if this is a reservation field
95
112
  if (fieldName && fieldName.startsWith("reservation_")) {
@@ -342,13 +359,12 @@ export function prepareCustomerData(formValues, selectedPhoneCode, findCountryCo
342
359
  const name = getFieldValue("name", formValues);
343
360
  const email = getFieldValue("email", formValues);
344
361
  const phone = getFieldValue("phone", formValues);
345
- const phoneCode = selectedPhoneCode?.phoneCode || "";
346
362
  const countryName = getFieldValue("country", formValues);
347
363
  const countryCode = findCountryCode(countryName);
348
364
  const customerData = {
349
365
  name: name || `${firstName} ${secondName}`.trim(),
350
366
  email,
351
- phone: phone ? `${phoneCode}${phone}` : undefined,
367
+ phone: toE164(phone, selectedPhoneCode?.code),
352
368
  address: {
353
369
  line1: getFieldValue("addressLine1", formValues),
354
370
  line2: getFieldValue("addressLine2", formValues),
@@ -463,21 +479,11 @@ export function prepareAttendeesData(reservations, reservationsCheck, getFieldVa
463
479
  const city = getFieldValue(`${fieldNamePrefix}city`);
464
480
  const province = getFieldValue(`${fieldNamePrefix}province`);
465
481
  const dateOfBirth = getFieldValue(`${fieldNamePrefix}date_of_birth`);
466
- // Handle phone number with country code
467
- const phoneNumberRaw = getFieldValue(`${fieldNamePrefix}phone_number`);
468
- // Get dial code (e.g. "353") and prepend to local number
469
- const phoneCode = getFieldValue(`${fieldNamePrefix}phone_code`) ||
470
- selectedPhoneCode?.phoneCode ||
471
- "";
472
- const fullPhone = phoneCode && phoneNumberRaw
473
- ? `${phoneCode}${phoneNumberRaw}`
474
- : phoneNumberRaw;
475
- const phoneNumber = formatPhoneWithPlus(fullPhone);
482
+ const attendeeCountryCode = getFieldValue(`${fieldNamePrefix}country_code`) ||
483
+ selectedPhoneCode?.code;
484
+ const phoneNumber = toE164(getFieldValue(`${fieldNamePrefix}phone_number`), attendeeCountryCode);
476
485
  // Only send country_code alongside an actual phone number.
477
- const countryCode = phoneNumber
478
- ? getFieldValue(`${fieldNamePrefix}country_code`) ||
479
- selectedPhoneCode?.code
480
- : undefined;
486
+ const countryCode = phoneNumber ? attendeeCountryCode : undefined;
481
487
  // The API rejects null for any attendee field it did not require
482
488
  // ("Field may not be null."). Only the fields the customer filled in
483
489
  // are required and rendered, so send those and omit the rest.
@@ -501,6 +507,11 @@ export function prepareAttendeesData(reservations, reservationsCheck, getFieldVa
501
507
  });
502
508
  return { attendees, hasRequirements };
503
509
  }
510
+ /**
511
+ * The error middleware wraps every non-ok body in an `APIError`; the field
512
+ * mapping below reads the body itself.
513
+ */
514
+ export const unwrapApiErrorBody = (err) => err instanceof APIError ? err.response : err;
504
515
  /**
505
516
  * Type guard for API errors
506
517
  */
@@ -508,7 +519,8 @@ export const isApiError = (err) => {
508
519
  return (typeof err === "object" &&
509
520
  err !== null &&
510
521
  "errors" in err &&
511
- typeof err.errors === "object");
522
+ typeof err.errors === "object" &&
523
+ err.errors !== null);
512
524
  };
513
525
  /**
514
526
  * Extracts a user-safe error message from an unknown error.
@@ -538,7 +550,7 @@ export function sanitizeErrorMessage(error, fallback) {
538
550
  * Handles API errors by mapping them to form fields
539
551
  */
540
552
  export function mapApiErrorsToForm(error, currentFormErrors, attendees, reservations) {
541
- if (isApiError(error) && error.errors) {
553
+ if (isApiError(error)) {
542
554
  const formErrors = { ...currentFormErrors };
543
555
  // Map API errors to form fields
544
556
  Object.entries(error.errors).forEach(([field, message]) => {
@@ -616,42 +628,42 @@ export function mapApiErrorsToForm(error, currentFormErrors, attendees, reservat
616
628
  }
617
629
  }
618
630
  /**
619
- * Checks transaction status with exponential backoff.
631
+ * The reservation PUT returns the id as UUID hex while the transactions list
632
+ * uses the hyphenated form; compare them on their digits only.
633
+ */
634
+ const isSameTransactionId = (a, b) => a.replace(/-/g, "").toLowerCase() === b.replace(/-/g, "").toLowerCase();
635
+ /**
636
+ * Polls the customer's transactions for `transactionId` with exponential
637
+ * backoff until it reaches a final status or `maxAttempts` is spent. A
638
+ * transaction that is not listed yet counts as non-final and keeps polling.
620
639
  * Pass an AbortSignal to cancel polling early (e.g., on component disconnect).
621
640
  */
622
- export async function pollTransactionStatus(userId, maxAttempts, initialInterval, maxInterval, client, distributorID, locale, onReferenceId, signal) {
641
+ export async function pollTransactionStatus(userId, transactionId, maxAttempts, initialInterval, maxInterval, client, distributorID, locale, logger, onReferenceId, signal) {
623
642
  let attempts = 0;
624
643
  let currentInterval = initialInterval;
625
644
  const checkStatus = async () => {
626
645
  try {
627
- const { data, error } = await withErrorHandling(apiGet({
646
+ const { data } = await apiGet({
628
647
  client,
629
648
  distributorID,
630
649
  locale,
631
650
  endpoint: "/{api_version}/users/{customer_id}/transactions",
632
651
  path: { customer_id: userId },
633
- }));
634
- if (error) {
635
- console.error("Failed to check transaction status");
636
- return { status: null, tokensToIssue: null };
637
- }
638
- if (data && data.length > 0) {
639
- const transaction = data[0];
640
- if (!transaction)
641
- return { status: null, tokensToIssue: null };
652
+ });
653
+ const transaction = data?.find((entry) => isSameTransactionId(entry.transaction_id, transactionId));
654
+ if (transaction) {
642
655
  if (transaction.reference_id && onReferenceId) {
643
656
  onReferenceId(transaction.reference_id);
644
657
  }
645
- const loyaltyEarn = transaction.loyalty?.earn;
646
- const tokensToIssue = loyaltyEarn
647
- ? String(Object.values(loyaltyEarn)[0] ?? "")
658
+ const tokensToIssue = transaction.loyalty?.earn
659
+ ? String(getLoyaltyAmount(transaction.loyalty, "earn"))
648
660
  : null;
649
661
  return { status: transaction.status || null, tokensToIssue };
650
662
  }
651
663
  return { status: null, tokensToIssue: null };
652
664
  }
653
665
  catch (err) {
654
- console.error("Error polling transaction status:", err);
666
+ logger.error(err, { context: "transaction status poll" });
655
667
  return { status: null, tokensToIssue: null };
656
668
  }
657
669
  };
@@ -675,16 +687,9 @@ export async function pollTransactionStatus(userId, maxAttempts, initialInterval
675
687
  currentInterval = nextInterval;
676
688
  setTimeout(poll, currentInterval);
677
689
  };
678
- poll();
690
+ void poll();
679
691
  });
680
692
  }
681
- /**
682
- * Validates an email address
683
- */
684
- export const isValidEmail = (email) => {
685
- const re = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
686
- return re.test(email);
687
- };
688
693
  /**
689
694
  * Validates a wallet email address
690
695
  */
@@ -692,10 +697,7 @@ export const validateWalletEmail = (email) => {
692
697
  if (!email) {
693
698
  return msg("Email is required");
694
699
  }
695
- if (!isValidEmail(email)) {
696
- return msg("Please enter a valid email address");
697
- }
698
- return "";
700
+ return validEmail({ value: email }) ?? "";
699
701
  };
700
702
  /**
701
703
  * ISO-3166-1 alpha-2 pattern (two uppercase letters).
@@ -722,7 +724,6 @@ export const findCountryCode = (countryName, countries = []) => {
722
724
  if (country?.code)
723
725
  return country.code;
724
726
  // PP-007: Deterministic fallback instead of returning raw name
725
- console.warn(`Country "${countryName}" could not be mapped to ISO code, falling back to ${DEFAULT_COUNTRY_CODE}`);
726
727
  return DEFAULT_COUNTRY_CODE;
727
728
  };
728
729
  /**
@@ -809,34 +810,15 @@ export function extractPaymentIntentId(clientSecret) {
809
810
  return parts[0] || "";
810
811
  }
811
812
  /**
812
- * Formats phone number with a plus prefix if needed.
813
- * IMPROVED: Validates a phone format before adding a prefix to prevent invalid numbers.
814
- *
815
- * @param phone - Phone number to format
816
- * @returns Formatted phone number with + prefix, or undefined if invalid
813
+ * Normalises a customer-entered phone number to E.164 ("+353871234567").
814
+ * The country resolves national input, including a trunk prefix such as the
815
+ * leading 0 in "0871234567"; a number typed with "+" is taken as-is.
816
+ * Returns undefined when the input is empty or cannot be parsed.
817
817
  */
818
- export function formatPhoneWithPlus(phone) {
819
- if (!phone)
818
+ export function toE164(value, countryCode) {
819
+ if (!value)
820
820
  return undefined;
821
- // Remove whitespace and common separators
822
- const cleaned = phone.replace(/[\s\-().]/g, "");
823
- // Phone already has + prefix
824
- if (cleaned.startsWith("+")) {
825
- // Validate it's not just "+" with no digits
826
- const digitsOnly = cleaned.slice(1);
827
- if (!digitsOnly || !/^\d+$/.test(digitsOnly)) {
828
- console.error("Invalid phone number format");
829
- return undefined;
830
- }
831
- return cleaned;
832
- }
833
- // Validate contains only digits before adding a prefix
834
- if (!/^\d+$/.test(cleaned)) {
835
- console.error("Phone number contains invalid characters");
836
- return undefined;
837
- }
838
- // Add + prefix
839
- return `+${cleaned}`;
821
+ return parsePhoneNumberFromString(value, (countryCode || undefined))?.format("E.164");
840
822
  }
841
823
  // ────────────────────────────────────────────────────────────────────────────
842
824
  // Pending crypto transfer recovery - validation & integrity
@@ -3,7 +3,8 @@
3
3
  *
4
4
  * Provides a stable interface for payment-related API operations,
5
5
  * decoupling controllers from the raw API query functions.
6
- * Currently delegates to apiGet/apiPut/apiPatch from core/api/queries.
6
+ * Every method resolves with the response and throws an `APIError` (from the
7
+ * client's error middleware) on a non-ok response.
7
8
  */
8
9
  import type { SupportedLocales } from "../../../core/types/index.js";
9
10
  import type { paths, components } from "../../../core/types/api-schema.js";
@@ -22,9 +23,8 @@ export declare class PaymentApiService {
22
23
  code: string;
23
24
  name: string;
24
25
  phone_code: number;
25
- }[] | undefined;
26
- response: Response | undefined;
27
- error: unknown;
26
+ }[];
27
+ response: Response;
28
28
  }>;
29
29
  fetchGeolocation(): Promise<{
30
30
  data: {
@@ -34,53 +34,37 @@ export declare class PaymentApiService {
34
34
  slug: string | null;
35
35
  parent_location_type: null;
36
36
  parent_location: null;
37
- } | undefined;
38
- response: Response | undefined;
39
- error: unknown;
37
+ };
38
+ response: Response;
40
39
  }>;
41
40
  checkReservations(bookingSession: string | null): Promise<{
42
41
  data: {
43
42
  general: components["schemas"]["GeneralRequirements"];
44
43
  reservations: components["schemas"]["ReservationRequirementsAndRestrictions"][];
45
- } | undefined;
46
- response: Response | undefined;
47
- error: unknown;
44
+ };
45
+ response: Response;
48
46
  }>;
49
47
  fetchReservations(bookingSession: string): Promise<{
50
48
  data: {
51
49
  reservations: (components["schemas"]["EventReservationSummary"] | components["schemas"]["TourReservationSummary"])[];
52
50
  total_price: number;
53
- } | undefined;
54
- response: Response | undefined;
55
- error: unknown;
51
+ };
52
+ response: Response;
56
53
  }>;
57
54
  confirmReservation(body: components["schemas"]["ReservationsPutRequest"], bookingSession: string | null, headers?: Record<string, string>): Promise<{
58
55
  data: {
59
56
  transaction_id: string;
60
57
  user_id: string;
61
58
  client_secret: string | null;
62
- } | undefined;
63
- response: Response | undefined;
64
- error: unknown;
59
+ };
60
+ response: Response;
65
61
  }>;
66
62
  patchReservation(reservationId: string, body: {
67
63
  pickup_id: string | null;
68
64
  pickup_entry: string | null;
69
65
  }): Promise<{
70
66
  data: undefined;
71
- response: Response | undefined;
72
- error: unknown;
73
- }>;
74
- fetchTransactions(userId: string): Promise<{
75
- data: {
76
- transaction_id: string;
77
- status: "ADDED" | "PAID" | "PENDING" | "FAILED" | "SUSPENDED" | "REFUNDED" | "PARTIAL_REFUNDED" | "CANCELLED" | "PARTIALLY_CANCELLED" | "PARTIALLY_CONFIRMED";
78
- created_at: string;
79
- reference_id: string;
80
- loyalty: components["schemas"]["LoyaltySchema"];
81
- }[] | undefined;
82
- response: Response | undefined;
83
- error: unknown;
67
+ response: Response;
84
68
  }>;
85
69
  fetchConfig(): Promise<{
86
70
  data: {
@@ -92,13 +76,11 @@ export declare class PaymentApiService {
92
76
  seatsio_public_workspace_key: string | null;
93
77
  seatsio_region: "eu" | "na" | "sa" | "oc";
94
78
  treasury_wallet_address: string | null;
95
- } | undefined;
96
- response: Response | undefined;
97
- error: unknown;
79
+ };
80
+ response: Response;
98
81
  }>;
99
82
  submitUserConsent(email: string, headers?: Record<string, string>): Promise<{
100
83
  data: undefined;
101
- response: Response | undefined;
102
- error: unknown;
84
+ response: Response;
103
85
  }>;
104
86
  }