@coras-io/embed 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/LICENSE +201 -0
- package/NOTICE +8 -0
- package/README.md +51 -0
- package/dist/components/accordion/accordion-item/accordion-item.component.d.ts +9 -0
- package/dist/components/accordion/accordion-item/accordion-item.component.js +44 -0
- package/dist/components/accordion/accordion-item/accordion-item.d.ts +8 -0
- package/dist/components/accordion/accordion-item/accordion-item.js +6 -0
- package/dist/components/accordion/accordion-item/accordion-item.styles.d.ts +2 -0
- package/dist/components/accordion/accordion-item/accordion-item.styles.js +62 -0
- package/dist/components/accordion/accordion.component.d.ts +8 -0
- package/dist/components/accordion/accordion.component.js +31 -0
- package/dist/components/accordion/accordion.d.ts +8 -0
- package/dist/components/accordion/accordion.js +6 -0
- package/dist/components/accordion/accordion.styles.d.ts +2 -0
- package/dist/components/accordion/accordion.styles.js +13 -0
- package/dist/components/alert/alert.component.d.ts +11 -0
- package/dist/components/alert/alert.component.js +59 -0
- package/dist/components/alert/alert.d.ts +8 -0
- package/dist/components/alert/alert.js +6 -0
- package/dist/components/alert/alert.styles.d.ts +2 -0
- package/dist/components/alert/alert.styles.js +158 -0
- package/dist/components/alert/alert.types.d.ts +1 -0
- package/dist/components/alert/alert.types.js +1 -0
- package/dist/components/attraction-card/base/attraction-card.mixin.d.ts +8 -0
- package/dist/components/attraction-card/base/attraction-card.mixin.js +109 -0
- package/dist/components/attraction-card/base/attraction-card.styles.d.ts +2 -0
- package/dist/components/attraction-card/base/attraction-card.styles.js +94 -0
- package/dist/components/attraction-card/base/attraction-card.types.d.ts +24 -0
- package/dist/components/attraction-card/base/attraction-card.types.js +1 -0
- package/dist/components/attraction-card/long/attraction-long-card.component.d.ts +10 -0
- package/dist/components/attraction-card/long/attraction-long-card.component.js +78 -0
- package/dist/components/attraction-card/long/attraction-long-card.d.ts +8 -0
- package/dist/components/attraction-card/long/attraction-long-card.js +6 -0
- package/dist/components/attraction-card/long/attraction-long-card.styles.d.ts +2 -0
- package/dist/components/attraction-card/long/attraction-long-card.styles.js +127 -0
- package/dist/components/attraction-card/short/attraction-short-card.component.d.ts +10 -0
- package/dist/components/attraction-card/short/attraction-short-card.component.js +75 -0
- package/dist/components/attraction-card/short/attraction-short-card.d.ts +8 -0
- package/dist/components/attraction-card/short/attraction-short-card.js +6 -0
- package/dist/components/attraction-card/short/attraction-short-card.styles.d.ts +2 -0
- package/dist/components/attraction-card/short/attraction-short-card.styles.js +66 -0
- package/dist/components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.component.d.ts +10 -0
- package/dist/components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.component.js +43 -0
- package/dist/components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.d.ts +8 -0
- package/dist/components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.js +6 -0
- package/dist/components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.styles.d.ts +2 -0
- package/dist/components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.styles.js +23 -0
- package/dist/components/attraction-discovery/attraction-discovery.component.d.ts +10 -0
- package/dist/components/attraction-discovery/attraction-discovery.component.js +52 -0
- package/dist/components/attraction-discovery/attraction-discovery.constants.d.ts +4 -0
- package/dist/components/attraction-discovery/attraction-discovery.constants.js +5 -0
- package/dist/components/attraction-discovery/attraction-discovery.d.ts +8 -0
- package/dist/components/attraction-discovery/attraction-discovery.js +6 -0
- package/dist/components/attraction-discovery/attraction-discovery.styles.d.ts +2 -0
- package/dist/components/attraction-discovery/attraction-discovery.styles.js +193 -0
- package/dist/components/attraction-header/attraction-header.component.d.ts +31 -0
- package/dist/components/attraction-header/attraction-header.component.js +69 -0
- package/dist/components/attraction-header/attraction-header.d.ts +8 -0
- package/dist/components/attraction-header/attraction-header.js +6 -0
- package/dist/components/attraction-header/attraction-header.styles.d.ts +2 -0
- package/dist/components/attraction-header/attraction-header.styles.js +41 -0
- package/dist/components/attraction-header/attraction-header.utils.d.ts +20 -0
- package/dist/components/attraction-header/attraction-header.utils.js +37 -0
- package/dist/components/attraction-option/attraction-option.component.d.ts +11 -0
- package/dist/components/attraction-option/attraction-option.component.js +82 -0
- package/dist/components/attraction-option/attraction-option.d.ts +8 -0
- package/dist/components/attraction-option/attraction-option.js +6 -0
- package/dist/components/attraction-option/attraction-option.styles.d.ts +2 -0
- package/dist/components/attraction-option/attraction-option.styles.js +132 -0
- package/dist/components/basket/basket.component.d.ts +28 -0
- package/dist/components/basket/basket.component.js +162 -0
- package/dist/components/basket/basket.d.ts +8 -0
- package/dist/components/basket/basket.js +6 -0
- package/dist/components/basket/basket.styles.d.ts +2 -0
- package/dist/components/basket/basket.styles.js +196 -0
- package/dist/components/basket-empty/basket-empty.component.d.ts +5 -0
- package/dist/components/basket-empty/basket-empty.component.js +24 -0
- package/dist/components/basket-empty/basket-empty.d.ts +8 -0
- package/dist/components/basket-empty/basket-empty.js +6 -0
- package/dist/components/basket-empty/basket-empty.styles.d.ts +2 -0
- package/dist/components/basket-empty/basket-empty.styles.js +39 -0
- package/dist/components/basket-item/basket-item.component.d.ts +27 -0
- package/dist/components/basket-item/basket-item.component.js +153 -0
- package/dist/components/basket-item/basket-item.d.ts +8 -0
- package/dist/components/basket-item/basket-item.js +6 -0
- package/dist/components/basket-item/basket-item.styles.d.ts +2 -0
- package/dist/components/basket-item/basket-item.styles.js +178 -0
- package/dist/components/basket-item-ticket/basket-item-ticket.component.d.ts +9 -0
- package/dist/components/basket-item-ticket/basket-item-ticket.component.js +57 -0
- package/dist/components/basket-item-ticket/basket-item-ticket.d.ts +8 -0
- package/dist/components/basket-item-ticket/basket-item-ticket.js +6 -0
- package/dist/components/basket-item-ticket/basket-item-ticket.styles.d.ts +2 -0
- package/dist/components/basket-item-ticket/basket-item-ticket.styles.js +59 -0
- package/dist/components/basket-mobile/basket-mobile.component.d.ts +10 -0
- package/dist/components/basket-mobile/basket-mobile.component.js +59 -0
- package/dist/components/basket-mobile/basket-mobile.d.ts +8 -0
- package/dist/components/basket-mobile/basket-mobile.js +6 -0
- package/dist/components/basket-mobile/basket-mobile.styles.d.ts +2 -0
- package/dist/components/basket-mobile/basket-mobile.styles.js +71 -0
- package/dist/components/basket-rewards/basket-rewards.component.d.ts +10 -0
- package/dist/components/basket-rewards/basket-rewards.component.js +52 -0
- package/dist/components/basket-rewards/basket-rewards.d.ts +8 -0
- package/dist/components/basket-rewards/basket-rewards.js +6 -0
- package/dist/components/basket-rewards/basket-rewards.styles.d.ts +2 -0
- package/dist/components/basket-rewards/basket-rewards.styles.js +18 -0
- package/dist/components/better-carousel/better-carousel-item/better-carousel-item.component.d.ts +10 -0
- package/dist/components/better-carousel/better-carousel-item/better-carousel-item.component.js +17 -0
- package/dist/components/better-carousel/better-carousel-item/better-carousel-item.d.ts +8 -0
- package/dist/components/better-carousel/better-carousel-item/better-carousel-item.js +6 -0
- package/dist/components/better-carousel/better-carousel-item/better-carousel-item.styles.d.ts +2 -0
- package/dist/components/better-carousel/better-carousel-item/better-carousel-item.styles.js +16 -0
- package/dist/components/better-carousel/better-carousel.component.d.ts +94 -0
- package/dist/components/better-carousel/better-carousel.component.js +335 -0
- package/dist/components/better-carousel/better-carousel.d.ts +8 -0
- package/dist/components/better-carousel/better-carousel.js +6 -0
- package/dist/components/better-carousel/better-carousel.styles.d.ts +2 -0
- package/dist/components/better-carousel/better-carousel.styles.js +159 -0
- package/dist/components/bottom-drawer/bottom-drawer.component.d.ts +27 -0
- package/dist/components/bottom-drawer/bottom-drawer.component.js +210 -0
- package/dist/components/bottom-drawer/bottom-drawer.d.ts +8 -0
- package/dist/components/bottom-drawer/bottom-drawer.js +6 -0
- package/dist/components/bottom-drawer/bottom-drawer.styles.d.ts +2 -0
- package/dist/components/bottom-drawer/bottom-drawer.styles.js +88 -0
- package/dist/components/breadcrumbs/breadcrumb-item/breadcrumb-item.component.d.ts +6 -0
- package/dist/components/breadcrumbs/breadcrumb-item/breadcrumb-item.component.js +35 -0
- package/dist/components/breadcrumbs/breadcrumb-item/breadcrumb-item.d.ts +8 -0
- package/dist/components/breadcrumbs/breadcrumb-item/breadcrumb-item.js +6 -0
- package/dist/components/breadcrumbs/breadcrumb-item/breadcrumb-item.styles.d.ts +2 -0
- package/dist/components/breadcrumbs/breadcrumb-item/breadcrumb-item.styles.js +48 -0
- package/dist/components/breadcrumbs/breadcrumbs.component.d.ts +6 -0
- package/dist/components/breadcrumbs/breadcrumbs.component.js +28 -0
- package/dist/components/breadcrumbs/breadcrumbs.d.ts +8 -0
- package/dist/components/breadcrumbs/breadcrumbs.js +6 -0
- package/dist/components/breadcrumbs/breadcrumbs.styles.d.ts +2 -0
- package/dist/components/breadcrumbs/breadcrumbs.styles.js +14 -0
- package/dist/components/button/button.component.d.ts +29 -0
- package/dist/components/button/button.component.js +156 -0
- package/dist/components/button/button.constants.d.ts +5 -0
- package/dist/components/button/button.constants.js +11 -0
- package/dist/components/button/button.d.ts +8 -0
- package/dist/components/button/button.js +6 -0
- package/dist/components/button/button.styles.d.ts +2 -0
- package/dist/components/button/button.styles.js +356 -0
- package/dist/components/calendar/base/calendar.mixin.d.ts +3 -0
- package/dist/components/calendar/base/calendar.mixin.js +231 -0
- package/dist/components/calendar/base/calendar.styles.d.ts +2 -0
- package/dist/components/calendar/base/calendar.styles.js +122 -0
- package/dist/components/calendar/base/calendar.types.d.ts +21 -0
- package/dist/components/calendar/base/calendar.types.js +1 -0
- package/dist/components/calendar/dual/dual.component.d.ts +11 -0
- package/dist/components/calendar/dual/dual.component.js +93 -0
- package/dist/components/calendar/dual/dual.d.ts +8 -0
- package/dist/components/calendar/dual/dual.js +6 -0
- package/dist/components/calendar/dual/dual.styles.d.ts +2 -0
- package/dist/components/calendar/dual/dual.styles.js +13 -0
- package/dist/components/calendar/month/month.component.d.ts +14 -0
- package/dist/components/calendar/month/month.component.js +83 -0
- package/dist/components/calendar/month/month.d.ts +8 -0
- package/dist/components/calendar/month/month.js +6 -0
- package/dist/components/calendar/month/month.styles.d.ts +2 -0
- package/dist/components/calendar/month/month.styles.js +5 -0
- package/dist/components/calendar/multi/multi.component.d.ts +9 -0
- package/dist/components/calendar/multi/multi.component.js +59 -0
- package/dist/components/calendar/multi/multi.d.ts +8 -0
- package/dist/components/calendar/multi/multi.js +6 -0
- package/dist/components/calendar/multi/multi.styles.d.ts +2 -0
- package/dist/components/calendar/multi/multi.styles.js +23 -0
- package/dist/components/carousel/carousel-item/carousel-item.component.d.ts +18 -0
- package/dist/components/carousel/carousel-item/carousel-item.component.js +84 -0
- package/dist/components/carousel/carousel-item/carousel-item.constants.d.ts +4 -0
- package/dist/components/carousel/carousel-item/carousel-item.constants.js +5 -0
- package/dist/components/carousel/carousel-item/carousel-item.d.ts +8 -0
- package/dist/components/carousel/carousel-item/carousel-item.js +6 -0
- package/dist/components/carousel/carousel-item/carousel-item.styles.d.ts +2 -0
- package/dist/components/carousel/carousel-item/carousel-item.styles.js +86 -0
- package/dist/components/carousel/carousel.component.d.ts +24 -0
- package/dist/components/carousel/carousel.component.js +132 -0
- package/dist/components/carousel/carousel.d.ts +8 -0
- package/dist/components/carousel/carousel.js +6 -0
- package/dist/components/carousel/carousel.styles.d.ts +2 -0
- package/dist/components/carousel/carousel.styles.js +72 -0
- package/dist/components/categories-tree/categories-tree.component.d.ts +15 -0
- package/dist/components/categories-tree/categories-tree.component.js +202 -0
- package/dist/components/categories-tree/categories-tree.d.ts +8 -0
- package/dist/components/categories-tree/categories-tree.js +6 -0
- package/dist/components/categories-tree/categories-tree.styles.d.ts +2 -0
- package/dist/components/categories-tree/categories-tree.styles.js +14 -0
- package/dist/components/category-tag/category-tag.component.d.ts +12 -0
- package/dist/components/category-tag/category-tag.component.js +78 -0
- package/dist/components/category-tag/category-tag.d.ts +8 -0
- package/dist/components/category-tag/category-tag.js +6 -0
- package/dist/components/category-tag/category-tag.styles.d.ts +2 -0
- package/dist/components/category-tag/category-tag.styles.js +99 -0
- package/dist/components/category-tag/category-tag.types.d.ts +8 -0
- package/dist/components/category-tag/category-tag.types.js +1 -0
- package/dist/components/checkbox/checkbox.component.d.ts +13 -0
- package/dist/components/checkbox/checkbox.component.js +68 -0
- package/dist/components/checkbox/checkbox.constants.d.ts +5 -0
- package/dist/components/checkbox/checkbox.constants.js +6 -0
- package/dist/components/checkbox/checkbox.d.ts +8 -0
- package/dist/components/checkbox/checkbox.js +6 -0
- package/dist/components/checkbox/checkbox.styles.d.ts +2 -0
- package/dist/components/checkbox/checkbox.styles.js +129 -0
- package/dist/components/checkbox-group/checkbox-group.component.d.ts +6 -0
- package/dist/components/checkbox-group/checkbox-group.component.js +14 -0
- package/dist/components/checkbox-group/checkbox-group.d.ts +8 -0
- package/dist/components/checkbox-group/checkbox-group.js +6 -0
- package/dist/components/checkbox-group/checkbox-group.styles.d.ts +2 -0
- package/dist/components/checkbox-group/checkbox-group.styles.js +40 -0
- package/dist/components/checkbox-group/checkbox-group.types.d.ts +12 -0
- package/dist/components/checkbox-group/checkbox-group.types.js +1 -0
- package/dist/components/chip/chip.component.d.ts +11 -0
- package/dist/components/chip/chip.component.js +53 -0
- package/dist/components/chip/chip.constants.d.ts +1 -0
- package/dist/components/chip/chip.constants.js +1 -0
- package/dist/components/chip/chip.d.ts +8 -0
- package/dist/components/chip/chip.js +6 -0
- package/dist/components/chip/chip.styles.d.ts +2 -0
- package/dist/components/chip/chip.styles.js +103 -0
- package/dist/components/collect-fida/collect-fida.component.d.ts +11 -0
- package/dist/components/collect-fida/collect-fida.component.js +75 -0
- package/dist/components/collect-fida/collect-fida.d.ts +8 -0
- package/dist/components/collect-fida/collect-fida.js +6 -0
- package/dist/components/collect-fida/collect-fida.styles.d.ts +2 -0
- package/dist/components/collect-fida/collect-fida.styles.js +95 -0
- package/dist/components/crypto-auth-modal/crypto-auth-modal.component.d.ts +162 -0
- package/dist/components/crypto-auth-modal/crypto-auth-modal.component.js +570 -0
- package/dist/components/crypto-auth-modal/crypto-auth-modal.d.ts +8 -0
- package/dist/components/crypto-auth-modal/crypto-auth-modal.js +6 -0
- package/dist/components/crypto-auth-modal/crypto-auth-modal.styles.d.ts +2 -0
- package/dist/components/crypto-auth-modal/crypto-auth-modal.styles.js +141 -0
- package/dist/components/currencies-list/currencies-list.component.d.ts +15 -0
- package/dist/components/currencies-list/currencies-list.component.js +50 -0
- package/dist/components/currencies-list/currencies-list.d.ts +8 -0
- package/dist/components/currencies-list/currencies-list.js +6 -0
- package/dist/components/currencies-list/currencies-list.styles.d.ts +2 -0
- package/dist/components/currencies-list/currencies-list.styles.js +5 -0
- package/dist/components/dialog/dialog.component.d.ts +69 -0
- package/dist/components/dialog/dialog.component.js +373 -0
- package/dist/components/dialog/dialog.d.ts +8 -0
- package/dist/components/dialog/dialog.js +6 -0
- package/dist/components/dialog/dialog.styles.d.ts +2 -0
- package/dist/components/dialog/dialog.styles.js +264 -0
- package/dist/components/drawer/drawer.component.d.ts +12 -0
- package/dist/components/drawer/drawer.component.js +89 -0
- package/dist/components/drawer/drawer.d.ts +8 -0
- package/dist/components/drawer/drawer.js +6 -0
- package/dist/components/drawer/drawer.styles.d.ts +2 -0
- package/dist/components/drawer/drawer.styles.js +129 -0
- package/dist/components/dropdown/dropdown.component.d.ts +25 -0
- package/dist/components/dropdown/dropdown.component.js +204 -0
- package/dist/components/dropdown/dropdown.d.ts +8 -0
- package/dist/components/dropdown/dropdown.js +6 -0
- package/dist/components/dropdown/dropdown.styles.d.ts +2 -0
- package/dist/components/dropdown/dropdown.styles.js +60 -0
- package/dist/components/expiration-timer/expiration-timer.component.d.ts +12 -0
- package/dist/components/expiration-timer/expiration-timer.component.js +52 -0
- package/dist/components/expiration-timer/expiration-timer.d.ts +8 -0
- package/dist/components/expiration-timer/expiration-timer.js +6 -0
- package/dist/components/expiration-timer/expiration-timer.styles.d.ts +2 -0
- package/dist/components/expiration-timer/expiration-timer.styles.js +37 -0
- package/dist/components/explore-card/explore-card.component.d.ts +11 -0
- package/dist/components/explore-card/explore-card.component.js +48 -0
- package/dist/components/explore-card/explore-card.constants.d.ts +4 -0
- package/dist/components/explore-card/explore-card.constants.js +5 -0
- package/dist/components/explore-card/explore-card.d.ts +8 -0
- package/dist/components/explore-card/explore-card.js +6 -0
- package/dist/components/explore-card/explore-card.styles.d.ts +2 -0
- package/dist/components/explore-card/explore-card.styles.js +71 -0
- package/dist/components/filter-chip/filter-chip.component.d.ts +12 -0
- package/dist/components/filter-chip/filter-chip.component.js +68 -0
- package/dist/components/filter-chip/filter-chip.constants.d.ts +2 -0
- package/dist/components/filter-chip/filter-chip.constants.js +2 -0
- package/dist/components/filter-chip/filter-chip.d.ts +8 -0
- package/dist/components/filter-chip/filter-chip.js +6 -0
- package/dist/components/filter-chip/filter-chip.styles.d.ts +2 -0
- package/dist/components/filter-chip/filter-chip.styles.js +160 -0
- package/dist/components/filters-drawer/filters-drawer.component.d.ts +9 -0
- package/dist/components/filters-drawer/filters-drawer.component.js +55 -0
- package/dist/components/filters-drawer/filters-drawer.d.ts +8 -0
- package/dist/components/filters-drawer/filters-drawer.js +6 -0
- package/dist/components/filters-drawer/filters-drawer.styles.d.ts +2 -0
- package/dist/components/filters-drawer/filters-drawer.styles.js +60 -0
- package/dist/components/flag-icon/flag-icon.component.d.ts +9 -0
- package/dist/components/flag-icon/flag-icon.component.js +45 -0
- package/dist/components/flag-icon/flag-icon.constants.d.ts +1 -0
- package/dist/components/flag-icon/flag-icon.constants.js +371 -0
- package/dist/components/flag-icon/flag-icon.d.ts +8 -0
- package/dist/components/flag-icon/flag-icon.js +6 -0
- package/dist/components/flag-icon/flag-icon.styles.d.ts +2 -0
- package/dist/components/flag-icon/flag-icon.styles.js +16 -0
- package/dist/components/footer-menu/footer-menu-item/footer-menu-item.component.d.ts +8 -0
- package/dist/components/footer-menu/footer-menu-item/footer-menu-item.component.js +40 -0
- package/dist/components/footer-menu/footer-menu-item/footer-menu-item.d.ts +8 -0
- package/dist/components/footer-menu/footer-menu-item/footer-menu-item.js +6 -0
- package/dist/components/footer-menu/footer-menu-item/footer-menu-item.styles.d.ts +2 -0
- package/dist/components/footer-menu/footer-menu-item/footer-menu-item.styles.js +55 -0
- package/dist/components/footer-menu/footer-menu.component.d.ts +5 -0
- package/dist/components/footer-menu/footer-menu.component.js +17 -0
- package/dist/components/footer-menu/footer-menu.d.ts +8 -0
- package/dist/components/footer-menu/footer-menu.js +6 -0
- package/dist/components/footer-menu/footer-menu.styles.d.ts +2 -0
- package/dist/components/footer-menu/footer-menu.styles.js +47 -0
- package/dist/components/icon/icon.component.d.ts +14 -0
- package/dist/components/icon/icon.component.js +104 -0
- package/dist/components/icon/icon.d.ts +8 -0
- package/dist/components/icon/icon.js +6 -0
- package/dist/components/icon/icon.styles.d.ts +2 -0
- package/dist/components/icon/icon.styles.js +43 -0
- package/dist/components/icon/icon.types.d.ts +2 -0
- package/dist/components/icon/icon.types.js +1 -0
- package/dist/components/icon-list/icon-list-item/icon-list-item.component.d.ts +8 -0
- package/dist/components/icon-list/icon-list-item/icon-list-item.component.js +42 -0
- package/dist/components/icon-list/icon-list-item/icon-list-item.d.ts +8 -0
- package/dist/components/icon-list/icon-list-item/icon-list-item.js +6 -0
- package/dist/components/icon-list/icon-list-item/icon-list-item.styles.d.ts +2 -0
- package/dist/components/icon-list/icon-list-item/icon-list-item.styles.js +23 -0
- package/dist/components/icon-list/icon-list.component.d.ts +5 -0
- package/dist/components/icon-list/icon-list.component.js +12 -0
- package/dist/components/icon-list/icon-list.d.ts +8 -0
- package/dist/components/icon-list/icon-list.js +6 -0
- package/dist/components/icon-list/icon-list.styles.d.ts +2 -0
- package/dist/components/icon-list/icon-list.styles.js +15 -0
- package/dist/components/image/image.component.d.ts +83 -0
- package/dist/components/image/image.component.js +301 -0
- package/dist/components/image/image.d.ts +8 -0
- package/dist/components/image/image.js +6 -0
- package/dist/components/image/image.styles.d.ts +2 -0
- package/dist/components/image/image.styles.js +88 -0
- package/dist/components/image-carousel/image-carousel-item/image-carousel-item.component.d.ts +10 -0
- package/dist/components/image-carousel/image-carousel-item/image-carousel-item.component.js +43 -0
- package/dist/components/image-carousel/image-carousel-item/image-carousel-item.d.ts +8 -0
- package/dist/components/image-carousel/image-carousel-item/image-carousel-item.js +6 -0
- package/dist/components/image-carousel/image-carousel-item/image-carousel-item.styles.d.ts +2 -0
- package/dist/components/image-carousel/image-carousel-item/image-carousel-item.styles.js +28 -0
- package/dist/components/image-carousel/image-carousel.component.d.ts +8 -0
- package/dist/components/image-carousel/image-carousel.component.js +36 -0
- package/dist/components/image-carousel/image-carousel.d.ts +8 -0
- package/dist/components/image-carousel/image-carousel.js +6 -0
- package/dist/components/image-carousel/image-carousel.styles.d.ts +2 -0
- package/dist/components/image-carousel/image-carousel.styles.js +72 -0
- package/dist/components/image-chip/image-chip.component.d.ts +8 -0
- package/dist/components/image-chip/image-chip.component.js +33 -0
- package/dist/components/image-chip/image-chip.d.ts +8 -0
- package/dist/components/image-chip/image-chip.js +6 -0
- package/dist/components/image-chip/image-chip.styles.d.ts +2 -0
- package/dist/components/image-chip/image-chip.styles.js +43 -0
- package/dist/components/image-viewer/image-viewer.component.d.ts +49 -0
- package/dist/components/image-viewer/image-viewer.component.js +193 -0
- package/dist/components/image-viewer/image-viewer.d.ts +8 -0
- package/dist/components/image-viewer/image-viewer.js +6 -0
- package/dist/components/image-viewer/image-viewer.styles.d.ts +2 -0
- package/dist/components/image-viewer/image-viewer.styles.js +146 -0
- package/dist/components/input-field/input-field.component.d.ts +54 -0
- package/dist/components/input-field/input-field.component.js +331 -0
- package/dist/components/input-field/input-field.d.ts +8 -0
- package/dist/components/input-field/input-field.js +6 -0
- package/dist/components/input-field/input-field.styles.d.ts +2 -0
- package/dist/components/input-field/input-field.styles.js +274 -0
- package/dist/components/itinerary/itinerary-item/itinerary-item.component.d.ts +9 -0
- package/dist/components/itinerary/itinerary-item/itinerary-item.component.js +45 -0
- package/dist/components/itinerary/itinerary-item/itinerary-item.d.ts +8 -0
- package/dist/components/itinerary/itinerary-item/itinerary-item.js +6 -0
- package/dist/components/itinerary/itinerary-item/itinerary-item.styles.d.ts +2 -0
- package/dist/components/itinerary/itinerary-item/itinerary-item.styles.js +70 -0
- package/dist/components/itinerary/itinerary.component.d.ts +7 -0
- package/dist/components/itinerary/itinerary.component.js +23 -0
- package/dist/components/itinerary/itinerary.d.ts +8 -0
- package/dist/components/itinerary/itinerary.js +6 -0
- package/dist/components/itinerary/itinerary.styles.d.ts +2 -0
- package/dist/components/itinerary/itinerary.styles.js +15 -0
- package/dist/components/joined-fields/joined-fields.component.d.ts +16 -0
- package/dist/components/joined-fields/joined-fields.component.js +93 -0
- package/dist/components/joined-fields/joined-fields.d.ts +8 -0
- package/dist/components/joined-fields/joined-fields.js +6 -0
- package/dist/components/joined-fields/joined-fields.styles.d.ts +2 -0
- package/dist/components/joined-fields/joined-fields.styles.js +101 -0
- package/dist/components/layout/layout.component.d.ts +10 -0
- package/dist/components/layout/layout.component.js +34 -0
- package/dist/components/layout/layout.d.ts +8 -0
- package/dist/components/layout/layout.js +6 -0
- package/dist/components/layout/layout.styles.d.ts +2 -0
- package/dist/components/layout/layout.styles.js +31 -0
- package/dist/components/list/list-item/list-item.component.d.ts +9 -0
- package/dist/components/list/list-item/list-item.component.js +30 -0
- package/dist/components/list/list-item/list-item.d.ts +8 -0
- package/dist/components/list/list-item/list-item.js +6 -0
- package/dist/components/list/list-item/list-item.styles.d.ts +2 -0
- package/dist/components/list/list-item/list-item.styles.js +34 -0
- package/dist/components/list/list.component.d.ts +6 -0
- package/dist/components/list/list.component.js +25 -0
- package/dist/components/list/list.d.ts +8 -0
- package/dist/components/list/list.js +6 -0
- package/dist/components/list/list.styles.d.ts +2 -0
- package/dist/components/list/list.styles.js +24 -0
- package/dist/components/loading-spinner/loading-spinner.component.d.ts +7 -0
- package/dist/components/loading-spinner/loading-spinner.component.js +22 -0
- package/dist/components/loading-spinner/loading-spinner.d.ts +8 -0
- package/dist/components/loading-spinner/loading-spinner.js +6 -0
- package/dist/components/loading-spinner/loading-spinner.styles.d.ts +2 -0
- package/dist/components/loading-spinner/loading-spinner.styles.js +47 -0
- package/dist/components/loading-spinner/loading-spinner.types.d.ts +1 -0
- package/dist/components/loading-spinner/loading-spinner.types.js +1 -0
- package/dist/components/locales-list/locales-list.component.d.ts +17 -0
- package/dist/components/locales-list/locales-list.component.js +55 -0
- package/dist/components/locales-list/locales-list.constants.d.ts +2 -0
- package/dist/components/locales-list/locales-list.constants.js +370 -0
- package/dist/components/locales-list/locales-list.d.ts +8 -0
- package/dist/components/locales-list/locales-list.js +6 -0
- package/dist/components/locales-list/locales-list.styles.d.ts +2 -0
- package/dist/components/locales-list/locales-list.styles.js +5 -0
- package/dist/components/location-image/location-image.component.d.ts +29 -0
- package/dist/components/location-image/location-image.component.js +135 -0
- package/dist/components/location-image/location-image.d.ts +8 -0
- package/dist/components/location-image/location-image.js +6 -0
- package/dist/components/location-image/location-image.styles.d.ts +2 -0
- package/dist/components/location-image/location-image.styles.js +49 -0
- package/dist/components/locations-results/locations-results.component.d.ts +21 -0
- package/dist/components/locations-results/locations-results.component.js +83 -0
- package/dist/components/locations-results/locations-results.d.ts +8 -0
- package/dist/components/locations-results/locations-results.js +6 -0
- package/dist/components/locations-results/locations-results.styles.d.ts +2 -0
- package/dist/components/locations-results/locations-results.styles.js +64 -0
- package/dist/components/marketing-tag/marketing-tag.component.d.ts +5 -0
- package/dist/components/marketing-tag/marketing-tag.component.js +8 -0
- package/dist/components/marketing-tag/marketing-tag.d.ts +8 -0
- package/dist/components/marketing-tag/marketing-tag.js +6 -0
- package/dist/components/marketing-tag/marketing-tag.styles.d.ts +2 -0
- package/dist/components/marketing-tag/marketing-tag.styles.js +36 -0
- package/dist/components/message-card/message-card.component.d.ts +12 -0
- package/dist/components/message-card/message-card.component.js +56 -0
- package/dist/components/message-card/message-card.d.ts +8 -0
- package/dist/components/message-card/message-card.js +6 -0
- package/dist/components/message-card/message-card.styles.d.ts +2 -0
- package/dist/components/message-card/message-card.styles.js +72 -0
- package/dist/components/message-card/message-card.types.d.ts +1 -0
- package/dist/components/message-card/message-card.types.js +1 -0
- package/dist/components/mobile-menu-item/mobile-menu-item.component.d.ts +9 -0
- package/dist/components/mobile-menu-item/mobile-menu-item.component.js +43 -0
- package/dist/components/mobile-menu-item/mobile-menu-item.d.ts +8 -0
- package/dist/components/mobile-menu-item/mobile-menu-item.js +6 -0
- package/dist/components/mobile-menu-item/mobile-menu-item.styles.d.ts +2 -0
- package/dist/components/mobile-menu-item/mobile-menu-item.styles.js +46 -0
- package/dist/components/option-group/option-chip/option-chip.component.d.ts +7 -0
- package/dist/components/option-group/option-chip/option-chip.component.js +35 -0
- package/dist/components/option-group/option-chip/option-chip.d.ts +8 -0
- package/dist/components/option-group/option-chip/option-chip.js +6 -0
- package/dist/components/option-group/option-chip/option-chip.styles.d.ts +2 -0
- package/dist/components/option-group/option-chip/option-chip.styles.js +45 -0
- package/dist/components/option-group/option-group.component.d.ts +6 -0
- package/dist/components/option-group/option-group.component.js +31 -0
- package/dist/components/option-group/option-group.d.ts +8 -0
- package/dist/components/option-group/option-group.js +6 -0
- package/dist/components/option-group/option-group.styles.d.ts +2 -0
- package/dist/components/option-group/option-group.styles.js +30 -0
- package/dist/components/order-confirmation/order-confirmation-item/order-confirmation-item.component.d.ts +11 -0
- package/dist/components/order-confirmation/order-confirmation-item/order-confirmation-item.component.js +81 -0
- package/dist/components/order-confirmation/order-confirmation-item/order-confirmation-item.d.ts +8 -0
- package/dist/components/order-confirmation/order-confirmation-item/order-confirmation-item.js +6 -0
- package/dist/components/order-confirmation/order-confirmation-item/order-confirmation-item.styles.d.ts +2 -0
- package/dist/components/order-confirmation/order-confirmation-item/order-confirmation-item.styles.js +107 -0
- package/dist/components/order-confirmation/order-confirmation.component.d.ts +12 -0
- package/dist/components/order-confirmation/order-confirmation.component.js +72 -0
- package/dist/components/order-confirmation/order-confirmation.d.ts +8 -0
- package/dist/components/order-confirmation/order-confirmation.js +6 -0
- package/dist/components/order-confirmation/order-confirmation.styles.d.ts +2 -0
- package/dist/components/order-confirmation/order-confirmation.styles.js +102 -0
- package/dist/components/otp/otp.component.d.ts +24 -0
- package/dist/components/otp/otp.component.js +148 -0
- package/dist/components/otp/otp.d.ts +8 -0
- package/dist/components/otp/otp.js +6 -0
- package/dist/components/otp/otp.styles.d.ts +2 -0
- package/dist/components/otp/otp.styles.js +87 -0
- package/dist/components/otp/otp.utils.d.ts +9 -0
- package/dist/components/otp/otp.utils.js +26 -0
- package/dist/components/overlay/overlay.component.d.ts +13 -0
- package/dist/components/overlay/overlay.component.js +52 -0
- package/dist/components/overlay/overlay.d.ts +8 -0
- package/dist/components/overlay/overlay.js +6 -0
- package/dist/components/overlay/overlay.styles.d.ts +2 -0
- package/dist/components/overlay/overlay.styles.js +39 -0
- package/dist/components/pay-in/pay-in.component.d.ts +10 -0
- package/dist/components/pay-in/pay-in.component.js +52 -0
- package/dist/components/pay-in/pay-in.d.ts +8 -0
- package/dist/components/pay-in/pay-in.js +6 -0
- package/dist/components/pay-in/pay-in.styles.d.ts +2 -0
- package/dist/components/pay-in/pay-in.styles.js +58 -0
- package/dist/components/payment-fiat-method/payment-fiat-method.component.d.ts +16 -0
- package/dist/components/payment-fiat-method/payment-fiat-method.component.js +63 -0
- package/dist/components/payment-fiat-method/payment-fiat-method.d.ts +8 -0
- package/dist/components/payment-fiat-method/payment-fiat-method.js +6 -0
- package/dist/components/payment-fiat-method/payment-fiat-method.styles.d.ts +2 -0
- package/dist/components/payment-fiat-method/payment-fiat-method.styles.js +38 -0
- package/dist/components/payment-option/payment-option.component.d.ts +38 -0
- package/dist/components/payment-option/payment-option.component.js +131 -0
- package/dist/components/payment-option/payment-option.d.ts +8 -0
- package/dist/components/payment-option/payment-option.js +6 -0
- package/dist/components/payment-option/payment-option.styles.d.ts +2 -0
- package/dist/components/payment-option/payment-option.styles.js +206 -0
- package/dist/components/performance-time/performance-time.component.d.ts +9 -0
- package/dist/components/performance-time/performance-time.component.js +47 -0
- package/dist/components/performance-time/performance-time.d.ts +8 -0
- package/dist/components/performance-time/performance-time.js +6 -0
- package/dist/components/performance-time/performance-time.styles.d.ts +2 -0
- package/dist/components/performance-time/performance-time.styles.js +53 -0
- package/dist/components/phone-country-code/phone-country-code.component.d.ts +13 -0
- package/dist/components/phone-country-code/phone-country-code.component.js +53 -0
- package/dist/components/phone-country-code/phone-country-code.d.ts +8 -0
- package/dist/components/phone-country-code/phone-country-code.js +6 -0
- package/dist/components/phone-country-code/phone-country-code.styles.d.ts +2 -0
- package/dist/components/phone-country-code/phone-country-code.styles.js +44 -0
- package/dist/components/phone-country-codes/phone-country-codes.component.d.ts +11 -0
- package/dist/components/phone-country-codes/phone-country-codes.component.js +47 -0
- package/dist/components/phone-country-codes/phone-country-codes.d.ts +8 -0
- package/dist/components/phone-country-codes/phone-country-codes.js +6 -0
- package/dist/components/phone-country-codes/phone-country-codes.styles.d.ts +2 -0
- package/dist/components/phone-country-codes/phone-country-codes.styles.js +21 -0
- package/dist/components/phone-field/phone-field.component.d.ts +53 -0
- package/dist/components/phone-field/phone-field.component.js +200 -0
- package/dist/components/phone-field/phone-field.d.ts +9 -0
- package/dist/components/phone-field/phone-field.js +7 -0
- package/dist/components/phone-field/phone-field.styles.d.ts +2 -0
- package/dist/components/phone-field/phone-field.styles.js +41 -0
- package/dist/components/phone-field/phone-field.types.d.ts +5 -0
- package/dist/components/phone-field/phone-field.types.js +1 -0
- package/dist/components/phone-field/phone-field.utils.d.ts +2 -0
- package/dist/components/phone-field/phone-field.utils.js +7 -0
- package/dist/components/points/points.component.d.ts +9 -0
- package/dist/components/points/points.component.js +36 -0
- package/dist/components/points/points.d.ts +8 -0
- package/dist/components/points/points.js +6 -0
- package/dist/components/points/points.styles.d.ts +2 -0
- package/dist/components/points/points.styles.js +47 -0
- package/dist/components/price/price.component.d.ts +12 -0
- package/dist/components/price/price.component.js +38 -0
- package/dist/components/price/price.d.ts +8 -0
- package/dist/components/price/price.js +6 -0
- package/dist/components/reservation-preview/reservation-preview.component.d.ts +11 -0
- package/dist/components/reservation-preview/reservation-preview.component.js +84 -0
- package/dist/components/reservation-preview/reservation-preview.d.ts +8 -0
- package/dist/components/reservation-preview/reservation-preview.js +6 -0
- package/dist/components/reservation-preview/reservation-preview.styles.d.ts +2 -0
- package/dist/components/reservation-preview/reservation-preview.styles.js +190 -0
- package/dist/components/reservation-preview-item/reservation-preview-item.component.d.ts +7 -0
- package/dist/components/reservation-preview-item/reservation-preview-item.component.js +36 -0
- package/dist/components/reservation-preview-item/reservation-preview-item.d.ts +8 -0
- package/dist/components/reservation-preview-item/reservation-preview-item.js +6 -0
- package/dist/components/reservation-preview-item/reservation-preview-item.styles.d.ts +2 -0
- package/dist/components/reservation-preview-item/reservation-preview-item.styles.js +70 -0
- package/dist/components/reviews/review/review.component.d.ts +9 -0
- package/dist/components/reviews/review/review.component.js +41 -0
- package/dist/components/reviews/review/review.d.ts +8 -0
- package/dist/components/reviews/review/review.js +6 -0
- package/dist/components/reviews/review/review.styles.d.ts +2 -0
- package/dist/components/reviews/review/review.styles.js +45 -0
- package/dist/components/reviews/reviews.component.d.ts +9 -0
- package/dist/components/reviews/reviews.component.js +56 -0
- package/dist/components/reviews/reviews.d.ts +8 -0
- package/dist/components/reviews/reviews.js +6 -0
- package/dist/components/reviews/reviews.styles.d.ts +2 -0
- package/dist/components/reviews/reviews.styles.js +73 -0
- package/dist/components/search-button/search-button.component.d.ts +8 -0
- package/dist/components/search-button/search-button.component.js +37 -0
- package/dist/components/search-button/search-button.d.ts +8 -0
- package/dist/components/search-button/search-button.js +6 -0
- package/dist/components/search-button/search-button.styles.d.ts +2 -0
- package/dist/components/search-button/search-button.styles.js +61 -0
- package/dist/components/search-results-item/search-results-item.d.ts +13 -0
- package/dist/components/search-results-item/search-results-item.js +26 -0
- package/dist/components/seated-selector/seated-selector.component.d.ts +42 -0
- package/dist/components/seated-selector/seated-selector.component.js +321 -0
- package/dist/components/seated-selector/seated-selector.d.ts +8 -0
- package/dist/components/seated-selector/seated-selector.js +6 -0
- package/dist/components/seated-selector/seated-selector.styles.d.ts +2 -0
- package/dist/components/seated-selector/seated-selector.styles.js +84 -0
- package/dist/components/seats-io/seats-io.component.d.ts +27 -0
- package/dist/components/seats-io/seats-io.component.js +162 -0
- package/dist/components/seats-io/seats-io.constants.d.ts +12 -0
- package/dist/components/seats-io/seats-io.constants.js +23 -0
- package/dist/components/seats-io/seats-io.d.ts +8 -0
- package/dist/components/seats-io/seats-io.js +6 -0
- package/dist/components/seats-io/seats-io.styles.d.ts +2 -0
- package/dist/components/seats-io/seats-io.styles.js +15 -0
- package/dist/components/seats-io/seats-io.transform.d.ts +77 -0
- package/dist/components/seats-io/seats-io.transform.js +152 -0
- package/dist/components/select-list/select-list.component.d.ts +19 -0
- package/dist/components/select-list/select-list.component.js +160 -0
- package/dist/components/select-list/select-list.d.ts +8 -0
- package/dist/components/select-list/select-list.js +6 -0
- package/dist/components/select-list/select-list.styles.d.ts +2 -0
- package/dist/components/select-list/select-list.styles.js +46 -0
- package/dist/components/select-list/select-option/select-option.component.d.ts +7 -0
- package/dist/components/select-list/select-option/select-option.component.js +28 -0
- package/dist/components/select-list/select-option/select-option.d.ts +8 -0
- package/dist/components/select-list/select-option/select-option.js +6 -0
- package/dist/components/select-list/select-option/select-option.styles.d.ts +2 -0
- package/dist/components/select-list/select-option/select-option.styles.js +52 -0
- package/dist/components/selected-tickets-preview/selected-tickets-preview.component.d.ts +10 -0
- package/dist/components/selected-tickets-preview/selected-tickets-preview.component.js +51 -0
- package/dist/components/selected-tickets-preview/selected-tickets-preview.d.ts +8 -0
- package/dist/components/selected-tickets-preview/selected-tickets-preview.js +6 -0
- package/dist/components/selected-tickets-preview/selected-tickets-preview.styles.d.ts +2 -0
- package/dist/components/selected-tickets-preview/selected-tickets-preview.styles.js +89 -0
- package/dist/components/sort-dropdown/sort-dropdown.component.d.ts +14 -0
- package/dist/components/sort-dropdown/sort-dropdown.component.js +57 -0
- package/dist/components/sort-dropdown/sort-dropdown.d.ts +8 -0
- package/dist/components/sort-dropdown/sort-dropdown.js +6 -0
- package/dist/components/sort-dropdown/sort-dropdown.styles.d.ts +2 -0
- package/dist/components/sort-dropdown/sort-dropdown.styles.js +22 -0
- package/dist/components/sort-list/sort-list.component.d.ts +7 -0
- package/dist/components/sort-list/sort-list.component.js +25 -0
- package/dist/components/sort-list/sort-list.d.ts +8 -0
- package/dist/components/sort-list/sort-list.js +6 -0
- package/dist/components/sort-list/sort-list.styles.d.ts +2 -0
- package/dist/components/sort-list/sort-list.styles.js +17 -0
- package/dist/components/sport-options/sport-option/sport-option.component.d.ts +10 -0
- package/dist/components/sport-options/sport-option/sport-option.component.js +57 -0
- package/dist/components/sport-options/sport-option/sport-option.d.ts +8 -0
- package/dist/components/sport-options/sport-option/sport-option.js +6 -0
- package/dist/components/sport-options/sport-option/sport-option.styles.d.ts +2 -0
- package/dist/components/sport-options/sport-option/sport-option.styles.js +156 -0
- package/dist/components/sport-options/sport-options.component.d.ts +6 -0
- package/dist/components/sport-options/sport-options.component.js +27 -0
- package/dist/components/sport-options/sport-options.d.ts +8 -0
- package/dist/components/sport-options/sport-options.js +6 -0
- package/dist/components/sport-options/sport-options.styles.d.ts +2 -0
- package/dist/components/sport-options/sport-options.styles.js +33 -0
- package/dist/components/star-rating/star-rating.component.d.ts +15 -0
- package/dist/components/star-rating/star-rating.component.js +77 -0
- package/dist/components/star-rating/star-rating.d.ts +8 -0
- package/dist/components/star-rating/star-rating.js +6 -0
- package/dist/components/star-rating/star-rating.styles.d.ts +2 -0
- package/dist/components/star-rating/star-rating.styles.js +49 -0
- package/dist/components/tab/tab.component.d.ts +12 -0
- package/dist/components/tab/tab.component.js +52 -0
- package/dist/components/tab/tab.constants.d.ts +4 -0
- package/dist/components/tab/tab.constants.js +5 -0
- package/dist/components/tab/tab.d.ts +8 -0
- package/dist/components/tab/tab.js +6 -0
- package/dist/components/tab/tab.styles.d.ts +2 -0
- package/dist/components/tab/tab.styles.js +50 -0
- package/dist/components/tab-panel/tab-panel.component.d.ts +9 -0
- package/dist/components/tab-panel/tab-panel.component.js +35 -0
- package/dist/components/tab-panel/tab-panel.d.ts +8 -0
- package/dist/components/tab-panel/tab-panel.js +6 -0
- package/dist/components/tab-panel/tab-panel.styles.d.ts +2 -0
- package/dist/components/tab-panel/tab-panel.styles.js +23 -0
- package/dist/components/tabs/tabs.component.d.ts +19 -0
- package/dist/components/tabs/tabs.component.js +87 -0
- package/dist/components/tabs/tabs.d.ts +8 -0
- package/dist/components/tabs/tabs.js +6 -0
- package/dist/components/tabs/tabs.styles.d.ts +2 -0
- package/dist/components/tabs/tabs.styles.js +32 -0
- package/dist/components/tag/tag.component.d.ts +8 -0
- package/dist/components/tag/tag.component.js +33 -0
- package/dist/components/tag/tag.constants.d.ts +1 -0
- package/dist/components/tag/tag.constants.js +1 -0
- package/dist/components/tag/tag.d.ts +8 -0
- package/dist/components/tag/tag.js +6 -0
- package/dist/components/tag/tag.styles.d.ts +2 -0
- package/dist/components/tag/tag.styles.js +56 -0
- package/dist/components/text-section/text-section.component.d.ts +6 -0
- package/dist/components/text-section/text-section.component.js +31 -0
- package/dist/components/text-section/text-section.d.ts +8 -0
- package/dist/components/text-section/text-section.js +6 -0
- package/dist/components/text-section/text-section.styles.d.ts +2 -0
- package/dist/components/text-section/text-section.styles.js +94 -0
- package/dist/components/time-tag/time-tag.component.d.ts +14 -0
- package/dist/components/time-tag/time-tag.component.js +58 -0
- package/dist/components/time-tag/time-tag.d.ts +8 -0
- package/dist/components/time-tag/time-tag.js +6 -0
- package/dist/components/time-tag/time-tag.styles.d.ts +2 -0
- package/dist/components/time-tag/time-tag.styles.js +41 -0
- package/dist/components/tooltip/tooltip.component.d.ts +19 -0
- package/dist/components/tooltip/tooltip.component.js +124 -0
- package/dist/components/tooltip/tooltip.d.ts +8 -0
- package/dist/components/tooltip/tooltip.js +6 -0
- package/dist/components/tooltip/tooltip.styles.d.ts +2 -0
- package/dist/components/tooltip/tooltip.styles.js +79 -0
- package/dist/components/tour-ticket-type-selector/tour-ticket-counter-button/tour-ticket-counter-button.component.d.ts +9 -0
- package/dist/components/tour-ticket-type-selector/tour-ticket-counter-button/tour-ticket-counter-button.component.js +36 -0
- package/dist/components/tour-ticket-type-selector/tour-ticket-counter-button/tour-ticket-counter-button.d.ts +8 -0
- package/dist/components/tour-ticket-type-selector/tour-ticket-counter-button/tour-ticket-counter-button.js +6 -0
- package/dist/components/tour-ticket-type-selector/tour-ticket-counter-button/tour-ticket-counter-button.styles.d.ts +2 -0
- package/dist/components/tour-ticket-type-selector/tour-ticket-counter-button/tour-ticket-counter-button.styles.js +35 -0
- package/dist/components/tour-ticket-type-selector/tour-ticket-type/tour-ticket-type.component.d.ts +9 -0
- package/dist/components/tour-ticket-type-selector/tour-ticket-type/tour-ticket-type.component.js +47 -0
- package/dist/components/tour-ticket-type-selector/tour-ticket-type/tour-ticket-type.d.ts +8 -0
- package/dist/components/tour-ticket-type-selector/tour-ticket-type/tour-ticket-type.js +6 -0
- package/dist/components/tour-ticket-type-selector/tour-ticket-type/tour-ticket-type.styles.d.ts +2 -0
- package/dist/components/tour-ticket-type-selector/tour-ticket-type/tour-ticket-type.styles.js +78 -0
- package/dist/components/tour-ticket-type-selector/tour-ticket-type-selector.component.d.ts +13 -0
- package/dist/components/tour-ticket-type-selector/tour-ticket-type-selector.component.js +74 -0
- package/dist/components/tour-ticket-type-selector/tour-ticket-type-selector.d.ts +8 -0
- package/dist/components/tour-ticket-type-selector/tour-ticket-type-selector.js +6 -0
- package/dist/components/tour-ticket-type-selector/tour-ticket-type-selector.styles.d.ts +2 -0
- package/dist/components/tour-ticket-type-selector/tour-ticket-type-selector.styles.js +40 -0
- package/dist/components/transfer-modal/transfer-modal.component.d.ts +72 -0
- package/dist/components/transfer-modal/transfer-modal.component.js +297 -0
- package/dist/components/transfer-modal/transfer-modal.d.ts +8 -0
- package/dist/components/transfer-modal/transfer-modal.js +6 -0
- package/dist/components/transfer-modal/transfer-modal.styles.d.ts +2 -0
- package/dist/components/transfer-modal/transfer-modal.styles.js +141 -0
- package/dist/containers/basket/basket.component.d.ts +25 -0
- package/dist/containers/basket/basket.component.js +257 -0
- package/dist/containers/basket/basket.d.ts +8 -0
- package/dist/containers/basket/basket.js +6 -0
- package/dist/containers/footer/footer.component.d.ts +8 -0
- package/dist/containers/footer/footer.component.js +65 -0
- package/dist/containers/footer/footer.d.ts +8 -0
- package/dist/containers/footer/footer.js +6 -0
- package/dist/containers/footer/footer.styles.d.ts +2 -0
- package/dist/containers/footer/footer.styles.js +31 -0
- package/dist/containers/navbar/navbar.component.d.ts +102 -0
- package/dist/containers/navbar/navbar.component.js +727 -0
- package/dist/containers/navbar/navbar.d.ts +8 -0
- package/dist/containers/navbar/navbar.js +6 -0
- package/dist/containers/navbar/navbar.styles.d.ts +2 -0
- package/dist/containers/navbar/navbar.styles.js +257 -0
- package/dist/containers/navbar/navbar.utils.d.ts +12 -0
- package/dist/containers/navbar/navbar.utils.js +40 -0
- package/dist/contexts/basket/basket.context.d.ts +4 -0
- package/dist/contexts/basket/basket.context.js +2 -0
- package/dist/contexts/basket/basket.d.ts +8 -0
- package/dist/contexts/basket/basket.js +6 -0
- package/dist/contexts/basket/basket.provider.d.ts +30 -0
- package/dist/contexts/basket/basket.provider.js +218 -0
- package/dist/contexts/basket/basket.styles.d.ts +2 -0
- package/dist/contexts/basket/basket.styles.js +9 -0
- package/dist/contexts/basket/basket.types.d.ts +18 -0
- package/dist/contexts/basket/basket.types.js +1 -0
- package/dist/contexts/client.context.d.ts +5 -0
- package/dist/contexts/client.context.js +2 -0
- package/dist/contexts/current-page.context.d.ts +4 -0
- package/dist/contexts/current-page.context.js +2 -0
- package/dist/contexts/events.context.d.ts +33 -0
- package/dist/contexts/events.context.js +2 -0
- package/dist/contexts/pages.context.d.ts +25 -0
- package/dist/contexts/pages.context.js +1 -0
- package/dist/contexts/properties.context.d.ts +24 -0
- package/dist/contexts/properties.context.js +9 -0
- package/dist/contexts/types.d.ts +16 -0
- package/dist/contexts/types.js +1 -0
- package/dist/contexts/utils.d.ts +1 -0
- package/dist/contexts/utils.js +1 -0
- package/dist/controllers/time-expiration.d.ts +11 -0
- package/dist/controllers/time-expiration.js +31 -0
- package/dist/core/api/api-error.d.ts +20 -0
- package/dist/core/api/api-error.js +27 -0
- package/dist/core/api/middlewares/booking-session/booking-session.constants.d.ts +5 -0
- package/dist/core/api/middlewares/booking-session/booking-session.constants.js +5 -0
- package/dist/core/api/middlewares/booking-session/booking-session.d.ts +2 -0
- package/dist/core/api/middlewares/booking-session/booking-session.js +56 -0
- package/dist/core/api/middlewares/booking-session/booking-session.utils.d.ts +5 -0
- package/dist/core/api/middlewares/booking-session/booking-session.utils.js +70 -0
- package/dist/core/api/middlewares/error-handler/error-handler.d.ts +6 -0
- package/dist/core/api/middlewares/error-handler/error-handler.js +27 -0
- package/dist/core/api/queries.d.ts +74 -0
- package/dist/core/api/queries.js +120 -0
- package/dist/core/constants/api-version.d.ts +1 -0
- package/dist/core/constants/api-version.js +1 -0
- package/dist/core/currency/constants.d.ts +5 -0
- package/dist/core/currency/constants.js +101 -0
- package/dist/core/currency/index.d.ts +12 -0
- package/dist/core/currency/index.js +6 -0
- package/dist/core/events.d.ts +196 -0
- package/dist/core/events.js +46 -0
- package/dist/core/i18n/date.d.ts +7 -0
- package/dist/core/i18n/date.js +65 -0
- package/dist/core/i18n/locale-codes.d.ts +13 -0
- package/dist/core/i18n/locale-codes.js +52 -0
- package/dist/core/i18n/localization.d.ts +5 -0
- package/dist/core/i18n/localization.js +15 -0
- package/dist/core/images/constants.d.ts +7 -0
- package/dist/core/images/constants.js +7 -0
- package/dist/core/images/filters.d.ts +28 -0
- package/dist/core/images/filters.js +51 -0
- package/dist/core/images/helpers.d.ts +12 -0
- package/dist/core/images/helpers.js +14 -0
- package/dist/core/images/preset-adapter.d.ts +23 -0
- package/dist/core/images/preset-adapter.js +52 -0
- package/dist/core/images/selection.d.ts +45 -0
- package/dist/core/images/selection.js +125 -0
- package/dist/core/images/srcset.d.ts +28 -0
- package/dist/core/images/srcset.js +52 -0
- package/dist/core/images/url.d.ts +23 -0
- package/dist/core/images/url.js +40 -0
- package/dist/core/pages.d.ts +68 -0
- package/dist/core/pages.js +1 -0
- package/dist/core/signals.d.ts +2 -0
- package/dist/core/signals.js +3 -0
- package/dist/core/storybook/argTypes.d.ts +1 -0
- package/dist/core/storybook/argTypes.js +46 -0
- package/dist/core/storybook/cssprops.d.ts +30 -0
- package/dist/core/storybook/cssprops.js +46 -0
- package/dist/core/types/api-errors.d.ts +8 -0
- package/dist/core/types/api-errors.js +1 -0
- package/dist/core/types/basket.d.ts +18 -0
- package/dist/core/types/basket.js +1 -0
- package/dist/core/types/core/base.d.ts +11 -0
- package/dist/core/types/core/base.js +1 -0
- package/dist/core/types/core/category.d.ts +2 -0
- package/dist/core/types/core/category.js +1 -0
- package/dist/core/types/core/currency.d.ts +2 -0
- package/dist/core/types/core/currency.js +1 -0
- package/dist/core/types/core/index.d.ts +6 -0
- package/dist/core/types/core/index.js +1 -0
- package/dist/core/types/core/locale.d.ts +2 -0
- package/dist/core/types/core/locale.js +1 -0
- package/dist/core/types/core/points.d.ts +4 -0
- package/dist/core/types/core/points.js +1 -0
- package/dist/core/types/core/rating.d.ts +1 -0
- package/dist/core/types/core/rating.js +1 -0
- package/dist/core/types/core/sorting.d.ts +2 -0
- package/dist/core/types/core/sorting.js +1 -0
- package/dist/core/types/currencies.d.ts +2 -0
- package/dist/core/types/currencies.js +1 -0
- package/dist/core/types/index.d.ts +6 -0
- package/dist/core/types/index.js +1 -0
- package/dist/core/types/locales.d.ts +4 -0
- package/dist/core/types/locales.js +1 -0
- package/dist/core/types/seats-config.d.ts +13 -0
- package/dist/core/types/seats-config.js +9 -0
- package/dist/core/types/shared.d.ts +1 -0
- package/dist/core/types/shared.js +1 -0
- package/dist/core/utils/datetime.d.ts +77 -0
- package/dist/core/utils/datetime.js +153 -0
- package/dist/core/utils/function.d.ts +4 -0
- package/dist/core/utils/function.js +22 -0
- package/dist/core/utils/html.d.ts +28 -0
- package/dist/core/utils/html.js +78 -0
- package/dist/core/utils/locale.d.ts +3 -0
- package/dist/core/utils/locale.js +3 -0
- package/dist/core/utils/scroll-lock.d.ts +50 -0
- package/dist/core/utils/scroll-lock.js +121 -0
- package/dist/core/utils/text.d.ts +9 -0
- package/dist/core/utils/text.js +50 -0
- package/dist/core/utils/time.d.ts +2 -0
- package/dist/core/utils/time.js +10 -0
- package/dist/custom-elements.json +37289 -0
- package/dist/errors.d.ts +3 -0
- package/dist/errors.js +5 -0
- package/dist/helpers/helpers.d.ts +5 -0
- package/dist/helpers/helpers.js +31 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +14 -0
- package/dist/locales/da-DK.d.ts +261 -0
- package/dist/locales/da-DK.js +273 -0
- package/dist/locales/de-DE.d.ts +261 -0
- package/dist/locales/de-DE.js +273 -0
- package/dist/locales/en-IE.d.ts +261 -0
- package/dist/locales/en-IE.js +273 -0
- package/dist/locales/en-US.d.ts +261 -0
- package/dist/locales/en-US.js +273 -0
- package/dist/locales/es-ES.d.ts +261 -0
- package/dist/locales/es-ES.js +273 -0
- package/dist/locales/fr-FR.d.ts +261 -0
- package/dist/locales/fr-FR.js +273 -0
- package/dist/locales/fr-MA.d.ts +261 -0
- package/dist/locales/fr-MA.js +273 -0
- package/dist/locales/is-IS.d.ts +261 -0
- package/dist/locales/is-IS.js +273 -0
- package/dist/locales/it-IT.d.ts +261 -0
- package/dist/locales/it-IT.js +273 -0
- package/dist/locales/ms-MY.d.ts +261 -0
- package/dist/locales/ms-MY.js +273 -0
- package/dist/locales/nb-NO.d.ts +261 -0
- package/dist/locales/nb-NO.js +273 -0
- package/dist/locales/pl-PL.d.ts +261 -0
- package/dist/locales/pl-PL.js +273 -0
- package/dist/locales/pt-PT.d.ts +261 -0
- package/dist/locales/pt-PT.js +273 -0
- package/dist/locales/sv-SE.d.ts +261 -0
- package/dist/locales/sv-SE.js +273 -0
- package/dist/locales/th-TH.d.ts +261 -0
- package/dist/locales/th-TH.js +273 -0
- package/dist/locales/tr-TR.d.ts +261 -0
- package/dist/locales/tr-TR.js +273 -0
- package/dist/locales/zh-CN.d.ts +261 -0
- package/dist/locales/zh-CN.js +273 -0
- package/dist/mixins/base.mixin.d.ts +22 -0
- package/dist/mixins/base.mixin.js +120 -0
- package/dist/mixins/coinbase.mixin.d.ts +70 -0
- package/dist/mixins/coinbase.mixin.js +979 -0
- package/dist/mixins/error-modal.mixin.d.ts +16 -0
- package/dist/mixins/error-modal.mixin.js +108 -0
- package/dist/mixins/error-modal.styles.d.ts +2 -0
- package/dist/mixins/error-modal.styles.js +81 -0
- package/dist/mixins/location-search/location-search.d.ts +7 -0
- package/dist/mixins/location-search/location-search.js +334 -0
- package/dist/mixins/location-search/location-search.styles.d.ts +2 -0
- package/dist/mixins/location-search/location-search.styles.js +80 -0
- package/dist/mixins/location-search/types.d.ts +10 -0
- package/dist/mixins/location-search/types.js +1 -0
- package/dist/mixins/overlay/overlay-mixin.d.ts +4 -0
- package/dist/mixins/overlay/overlay-mixin.js +86 -0
- package/dist/mixins/overlay/types.d.ts +8 -0
- package/dist/mixins/overlay/types.js +1 -0
- package/dist/mixins/points/points.d.ts +3 -0
- package/dist/mixins/points/points.js +30 -0
- package/dist/mixins/points/types.d.ts +8 -0
- package/dist/mixins/points/types.js +1 -0
- package/dist/mixins/search-mixin/search-mixin.d.ts +4 -0
- package/dist/mixins/search-mixin/search-mixin.js +66 -0
- package/dist/mixins/search-mixin/types.d.ts +7 -0
- package/dist/mixins/search-mixin/types.js +1 -0
- package/dist/sdk/chrome.d.ts +10 -0
- package/dist/sdk/chrome.js +83 -0
- package/dist/sdk/element-adapter.d.ts +16 -0
- package/dist/sdk/element-adapter.js +60 -0
- package/dist/sdk/meta.d.ts +7 -0
- package/dist/sdk/meta.js +9 -0
- package/dist/sdk/mount.d.ts +19 -0
- package/dist/sdk/mount.js +289 -0
- package/dist/sdk/navigation-intent.d.ts +34 -0
- package/dist/sdk/navigation-intent.js +28 -0
- package/dist/sdk/page-registry.d.ts +32 -0
- package/dist/sdk/page-registry.js +84 -0
- package/dist/sdk/redaction.d.ts +11 -0
- package/dist/sdk/redaction.js +61 -0
- package/dist/sdk/theme.d.ts +19 -0
- package/dist/sdk/theme.js +75 -0
- package/dist/sdk/types.d.ts +258 -0
- package/dist/sdk/types.js +1 -0
- package/dist/sdk/url.d.ts +47 -0
- package/dist/sdk/url.js +199 -0
- package/dist/sdk/validation.d.ts +50 -0
- package/dist/sdk/validation.js +318 -0
- package/dist/styles/contrast-fixtures.d.ts +10 -0
- package/dist/styles/contrast-fixtures.js +61 -0
- package/dist/styles/contrast.d.ts +19 -0
- package/dist/styles/contrast.js +100 -0
- package/dist/styles/defaults/component.d.ts +2 -0
- package/dist/styles/defaults/component.js +31 -0
- package/dist/styles/primitives.d.ts +14 -0
- package/dist/styles/primitives.js +68 -0
- package/dist/styles/tokens.css +359 -0
- package/dist/styles/tokens.d.ts +18 -0
- package/dist/styles/tokens.generated.d.ts +1 -0
- package/dist/styles/tokens.generated.js +4 -0
- package/dist/styles/tokens.js +54 -0
- package/dist/styles/tokens.metadata.d.ts +14 -0
- package/dist/styles/tokens.metadata.js +210 -0
- package/dist/views/constants.d.ts +3 -0
- package/dist/views/constants.js +2 -0
- package/dist/views/details-page/details-page.component.d.ts +129 -0
- package/dist/views/details-page/details-page.component.js +1567 -0
- package/dist/views/details-page/details-page.d.ts +8 -0
- package/dist/views/details-page/details-page.js +6 -0
- package/dist/views/details-page/details-page.styles.d.ts +2 -0
- package/dist/views/details-page/details-page.styles.js +558 -0
- package/dist/views/details-page/details-page.utilts.d.ts +40 -0
- package/dist/views/details-page/details-page.utilts.js +188 -0
- package/dist/views/details-page/partials/theater-description/theater-description.component.d.ts +13 -0
- package/dist/views/details-page/partials/theater-description/theater-description.component.js +76 -0
- package/dist/views/details-page/partials/theater-description/theater-description.d.ts +8 -0
- package/dist/views/details-page/partials/theater-description/theater-description.js +6 -0
- package/dist/views/details-page/partials/theater-description/theater-description.styles.d.ts +2 -0
- package/dist/views/details-page/partials/theater-description/theater-description.styles.js +19 -0
- package/dist/views/details-page/partials/tour-description/tour-description.component.d.ts +20 -0
- package/dist/views/details-page/partials/tour-description/tour-description.component.js +155 -0
- package/dist/views/details-page/partials/tour-description/tour-description.d.ts +8 -0
- package/dist/views/details-page/partials/tour-description/tour-description.js +6 -0
- package/dist/views/details-page/partials/tour-description/tour-description.styles.d.ts +2 -0
- package/dist/views/details-page/partials/tour-description/tour-description.styles.js +11 -0
- package/dist/views/help-page/help-page.component.d.ts +74 -0
- package/dist/views/help-page/help-page.component.js +594 -0
- package/dist/views/help-page/help-page.d.ts +8 -0
- package/dist/views/help-page/help-page.fields.d.ts +12 -0
- package/dist/views/help-page/help-page.fields.js +46 -0
- package/dist/views/help-page/help-page.js +6 -0
- package/dist/views/help-page/help-page.styles.d.ts +2 -0
- package/dist/views/help-page/help-page.styles.js +218 -0
- package/dist/views/help-page/help-page.types.d.ts +36 -0
- package/dist/views/help-page/help-page.types.js +1 -0
- package/dist/views/help-page/help-page.utils.d.ts +3 -0
- package/dist/views/help-page/help-page.utils.js +29 -0
- package/dist/views/help-page/help-page.validators.d.ts +7 -0
- package/dist/views/help-page/help-page.validators.js +22 -0
- package/dist/views/landing-page/landing-page.component.d.ts +127 -0
- package/dist/views/landing-page/landing-page.component.js +1003 -0
- package/dist/views/landing-page/landing-page.constants.d.ts +1 -0
- package/dist/views/landing-page/landing-page.constants.js +1 -0
- package/dist/views/landing-page/landing-page.d.ts +8 -0
- package/dist/views/landing-page/landing-page.js +6 -0
- package/dist/views/landing-page/landing-page.styles.d.ts +2 -0
- package/dist/views/landing-page/landing-page.styles.js +109 -0
- package/dist/views/landing-page/landing-page.types.d.ts +7 -0
- package/dist/views/landing-page/landing-page.types.js +1 -0
- package/dist/views/payment-page/controllers/crypto-auth.controller.d.ts +71 -0
- package/dist/views/payment-page/controllers/crypto-auth.controller.js +252 -0
- package/dist/views/payment-page/controllers/crypto-transfer.controller.d.ts +99 -0
- package/dist/views/payment-page/controllers/crypto-transfer.controller.js +288 -0
- package/dist/views/payment-page/controllers/form-validation.controller.d.ts +60 -0
- package/dist/views/payment-page/controllers/form-validation.controller.js +122 -0
- package/dist/views/payment-page/controllers/layout.controller.d.ts +22 -0
- package/dist/views/payment-page/controllers/layout.controller.js +43 -0
- package/dist/views/payment-page/controllers/payment-flow.controller.d.ts +47 -0
- package/dist/views/payment-page/controllers/payment-flow.controller.js +63 -0
- package/dist/views/payment-page/controllers/stripe-payment.controller.d.ts +66 -0
- package/dist/views/payment-page/controllers/stripe-payment.controller.js +202 -0
- package/dist/views/payment-page/domain/payment-mappers.d.ts +7 -0
- package/dist/views/payment-page/domain/payment-mappers.js +7 -0
- package/dist/views/payment-page/domain/payment-validators.d.ts +6 -0
- package/dist/views/payment-page/domain/payment-validators.js +6 -0
- package/dist/views/payment-page/domain/recovery-payload.d.ts +8 -0
- package/dist/views/payment-page/domain/recovery-payload.js +7 -0
- package/dist/views/payment-page/partials/activity-details/activity-details.component.d.ts +47 -0
- package/dist/views/payment-page/partials/activity-details/activity-details.component.js +247 -0
- package/dist/views/payment-page/partials/activity-details/activity-details.d.ts +8 -0
- package/dist/views/payment-page/partials/activity-details/activity-details.js +6 -0
- package/dist/views/payment-page/partials/activity-details/activity-details.styles.d.ts +2 -0
- package/dist/views/payment-page/partials/activity-details/activity-details.styles.js +77 -0
- package/dist/views/payment-page/partials/billing-address/billing-address.component.d.ts +34 -0
- package/dist/views/payment-page/partials/billing-address/billing-address.component.js +165 -0
- package/dist/views/payment-page/partials/billing-address/billing-address.d.ts +8 -0
- package/dist/views/payment-page/partials/billing-address/billing-address.js +6 -0
- package/dist/views/payment-page/partials/billing-address/billing-address.styles.d.ts +2 -0
- package/dist/views/payment-page/partials/billing-address/billing-address.styles.js +27 -0
- package/dist/views/payment-page/partials/confirmation/confirmation.component.d.ts +17 -0
- package/dist/views/payment-page/partials/confirmation/confirmation.component.js +193 -0
- package/dist/views/payment-page/partials/confirmation/confirmation.d.ts +8 -0
- package/dist/views/payment-page/partials/confirmation/confirmation.js +6 -0
- package/dist/views/payment-page/partials/confirmation/confirmation.styles.d.ts +2 -0
- package/dist/views/payment-page/partials/confirmation/confirmation.styles.js +191 -0
- package/dist/views/payment-page/partials/country-field/country-field.component.d.ts +44 -0
- package/dist/views/payment-page/partials/country-field/country-field.component.js +260 -0
- package/dist/views/payment-page/partials/country-field/country-field.d.ts +8 -0
- package/dist/views/payment-page/partials/country-field/country-field.js +6 -0
- package/dist/views/payment-page/partials/country-field/country-field.styles.d.ts +2 -0
- package/dist/views/payment-page/partials/country-field/country-field.styles.js +21 -0
- package/dist/views/payment-page/partials/hotel-pickup-field/hotel-pickup-field.component.d.ts +19 -0
- package/dist/views/payment-page/partials/hotel-pickup-field/hotel-pickup-field.component.js +108 -0
- package/dist/views/payment-page/partials/hotel-pickup-field/hotel-pickup-field.d.ts +8 -0
- package/dist/views/payment-page/partials/hotel-pickup-field/hotel-pickup-field.js +6 -0
- package/dist/views/payment-page/partials/hotel-pickup-field/hotel-pickup-field.styles.d.ts +2 -0
- package/dist/views/payment-page/partials/hotel-pickup-field/hotel-pickup-field.styles.js +21 -0
- package/dist/views/payment-page/partials/hotel-pickup-list/hotel-pickup-list.component.d.ts +10 -0
- package/dist/views/payment-page/partials/hotel-pickup-list/hotel-pickup-list.component.js +54 -0
- package/dist/views/payment-page/partials/hotel-pickup-list/hotel-pickup-list.d.ts +8 -0
- package/dist/views/payment-page/partials/hotel-pickup-list/hotel-pickup-list.js +6 -0
- package/dist/views/payment-page/partials/hotel-pickup-list/hotel-pickup-list.styles.d.ts +2 -0
- package/dist/views/payment-page/partials/hotel-pickup-list/hotel-pickup-list.styles.js +54 -0
- package/dist/views/payment-page/partials/payment-type-selector/payment-type-selector.component.d.ts +48 -0
- package/dist/views/payment-page/partials/payment-type-selector/payment-type-selector.component.js +215 -0
- package/dist/views/payment-page/partials/payment-type-selector/payment-type-selector.d.ts +8 -0
- package/dist/views/payment-page/partials/payment-type-selector/payment-type-selector.js +6 -0
- package/dist/views/payment-page/partials/payment-type-selector/payment-type-selector.styles.d.ts +2 -0
- package/dist/views/payment-page/partials/payment-type-selector/payment-type-selector.styles.js +61 -0
- package/dist/views/payment-page/partials/stripe/stripe.component.d.ts +104 -0
- package/dist/views/payment-page/partials/stripe/stripe.component.js +522 -0
- package/dist/views/payment-page/partials/stripe/stripe.constants.d.ts +46 -0
- package/dist/views/payment-page/partials/stripe/stripe.constants.js +48 -0
- package/dist/views/payment-page/partials/stripe/stripe.d.ts +8 -0
- package/dist/views/payment-page/partials/stripe/stripe.js +6 -0
- package/dist/views/payment-page/partials/stripe/stripe.styles.d.ts +2 -0
- package/dist/views/payment-page/partials/stripe/stripe.styles.js +102 -0
- package/dist/views/payment-page/partials/stripe/stripe.types.d.ts +72 -0
- package/dist/views/payment-page/partials/stripe/stripe.types.js +4 -0
- package/dist/views/payment-page/partials/stripe/stripe.utils.d.ts +85 -0
- package/dist/views/payment-page/partials/stripe/stripe.utils.js +228 -0
- package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.component.d.ts +22 -0
- package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.component.js +65 -0
- package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.d.ts +8 -0
- package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.js +6 -0
- package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.styles.d.ts +2 -0
- package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.styles.js +12 -0
- package/dist/views/payment-page/payment-page.component.d.ts +237 -0
- package/dist/views/payment-page/payment-page.component.js +1733 -0
- package/dist/views/payment-page/payment-page.constants.d.ts +38 -0
- package/dist/views/payment-page/payment-page.constants.js +45 -0
- package/dist/views/payment-page/payment-page.d.ts +8 -0
- package/dist/views/payment-page/payment-page.fields.d.ts +162 -0
- package/dist/views/payment-page/payment-page.fields.js +164 -0
- package/dist/views/payment-page/payment-page.js +6 -0
- package/dist/views/payment-page/payment-page.styles.d.ts +2 -0
- package/dist/views/payment-page/payment-page.styles.js +392 -0
- package/dist/views/payment-page/payment-page.types.d.ts +98 -0
- package/dist/views/payment-page/payment-page.types.js +1 -0
- package/dist/views/payment-page/payment-page.utils.d.ts +239 -0
- package/dist/views/payment-page/payment-page.utils.js +906 -0
- package/dist/views/payment-page/payment-page.validation-schema.d.ts +28 -0
- package/dist/views/payment-page/payment-page.validation-schema.js +42 -0
- package/dist/views/payment-page/payment-page.validators.d.ts +56 -0
- package/dist/views/payment-page/payment-page.validators.js +147 -0
- package/dist/views/payment-page/services/payment-api.service.d.ts +104 -0
- package/dist/views/payment-page/services/payment-api.service.js +99 -0
- package/dist/views/search-page/search-page.component.d.ts +61 -0
- package/dist/views/search-page/search-page.component.js +358 -0
- package/dist/views/search-page/search-page.d.ts +8 -0
- package/dist/views/search-page/search-page.js +6 -0
- package/dist/views/search-page/search-page.styles.d.ts +2 -0
- package/dist/views/search-page/search-page.styles.js +81 -0
- package/dist/views/suggestion-widget/suggestion-widget.component.d.ts +33 -0
- package/dist/views/suggestion-widget/suggestion-widget.component.js +111 -0
- package/dist/views/suggestion-widget/suggestion-widget.d.ts +8 -0
- package/dist/views/suggestion-widget/suggestion-widget.js +6 -0
- package/dist/views/suggestion-widget/suggestion-widget.styles.d.ts +2 -0
- package/dist/views/suggestion-widget/suggestion-widget.styles.js +41 -0
- package/package.json +158 -0
|
@@ -0,0 +1,1733 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { html, LitElement, nothing } from "lit";
|
|
8
|
+
import { property, query, state } from "lit/decorators.js";
|
|
9
|
+
import { localized, msg } from "@lit/localize";
|
|
10
|
+
import { fireEvent } from "../../core/events.js";
|
|
11
|
+
import "../../components/alert/alert.js";
|
|
12
|
+
import "../../components/button/button.js";
|
|
13
|
+
import "../../components/checkbox/checkbox.js";
|
|
14
|
+
import "../../components/input-field/input-field.js";
|
|
15
|
+
import "../../components/flag-icon/flag-icon.js";
|
|
16
|
+
import "../../components/phone-field/phone-field.js";
|
|
17
|
+
import "../../components/dropdown/dropdown.js";
|
|
18
|
+
import "../../components/joined-fields/joined-fields.js";
|
|
19
|
+
import "../../containers/basket/basket.js";
|
|
20
|
+
import "../../contexts/basket/basket.js";
|
|
21
|
+
import "../../components/layout/layout.js";
|
|
22
|
+
import "../../components/icon/icon.js";
|
|
23
|
+
import "../../components/collect-fida/collect-fida.js";
|
|
24
|
+
import "../../components/select-list/select-list.js";
|
|
25
|
+
import "../../components/select-list/select-option/select-option.js";
|
|
26
|
+
import "../../components/transfer-modal/transfer-modal.js";
|
|
27
|
+
import "../../components/crypto-auth-modal/crypto-auth-modal.js";
|
|
28
|
+
import { BaseMixin } from "../../mixins/base.mixin.js";
|
|
29
|
+
import { ErrorModalMixin } from "../../mixins/error-modal.mixin.js";
|
|
30
|
+
import { CoinbaseMixin } from "../../mixins/coinbase.mixin.js";
|
|
31
|
+
import styles from "./payment-page.styles.js";
|
|
32
|
+
import "../../components/bottom-drawer/bottom-drawer.js";
|
|
33
|
+
import "../../components/expiration-timer/expiration-timer.js";
|
|
34
|
+
import { Task } from "@lit/task";
|
|
35
|
+
import { FIELDS } from "./payment-page.fields.js";
|
|
36
|
+
import "./partials/stripe/stripe.js";
|
|
37
|
+
import "./partials/country-field/country-field.js";
|
|
38
|
+
import "./partials/hotel-pickup-field/hotel-pickup-field.js";
|
|
39
|
+
import "./partials/confirmation/confirmation.js";
|
|
40
|
+
import "./partials/payment-type-selector/payment-type-selector.js";
|
|
41
|
+
import "./partials/activity-details/activity-details.js";
|
|
42
|
+
import "./partials/billing-address/billing-address.js";
|
|
43
|
+
import { getBookingSession, removeBookingSession, } from "../../core/api/middlewares/booking-session/booking-session.utils.js";
|
|
44
|
+
import { PaymentApiService } from "./services/payment-api.service.js";
|
|
45
|
+
import { getDefaultPhoneCode, getDefaultCountry, getShortestExpirationSeconds, getTotalQuantity, getTotalPrice, isValidEmail, validateWalletEmail, findCountryCode as findCountryCodeUtil, formatPhoneWithPlus, prepareReservationData, prepareAttendeesData, isApiError, mapApiErrorsToForm, prepareCustomerData as prepareCustomerDataUtil, getFieldConfig, pollTransactionStatus, } from "./payment-page.utils.js";
|
|
46
|
+
import { consume } from "@lit/context";
|
|
47
|
+
import { currentPageContext } from "../../contexts/current-page.context.js";
|
|
48
|
+
import { convertToLocaleCurrency } from "../../core/currency/index.js";
|
|
49
|
+
import { TRANSACTION_POLLING_MAX_ATTEMPTS, TRANSACTION_POLLING_INITIAL_INTERVAL_MS, TRANSACTION_POLLING_MAX_INTERVAL_MS, BALANCE_BACKOFF_INITIAL_MS, BALANCE_BACKOFF_MAX_MS, } from "./payment-page.constants.js";
|
|
50
|
+
import { getLocale, setLocale } from "../../core/i18n/localization.js";
|
|
51
|
+
import { StripePaymentController } from "./controllers/stripe-payment.controller.js";
|
|
52
|
+
import { PaymentFlowController } from "./controllers/payment-flow.controller.js";
|
|
53
|
+
import { FormValidationController } from "./controllers/form-validation.controller.js";
|
|
54
|
+
import { LayoutController } from "./controllers/layout.controller.js";
|
|
55
|
+
import { CryptoAuthController } from "./controllers/crypto-auth.controller.js";
|
|
56
|
+
import { CryptoTransferController, } from "./controllers/crypto-transfer.controller.js";
|
|
57
|
+
/**
|
|
58
|
+
* Payment page component for processing checkout and payments.
|
|
59
|
+
*
|
|
60
|
+
* @fires coras:navigate - Dispatched when navigating to another page
|
|
61
|
+
* @fires coras:payment-status - Dispatched when a payment attempt changes status
|
|
62
|
+
*/
|
|
63
|
+
let CorasPaymentPage = class CorasPaymentPage extends CoinbaseMixin(ErrorModalMixin(BaseMixin(LitElement))) {
|
|
64
|
+
constructor() {
|
|
65
|
+
super(...arguments);
|
|
66
|
+
this.stripeKey = "";
|
|
67
|
+
// Custom key-value pairs forwarded to the reservations/confirm API `metadata`
|
|
68
|
+
// field (see openapi `ReservationsPutRequest`/`ConfirmReservationsSchema`).
|
|
69
|
+
this.metadata = {};
|
|
70
|
+
// Branding/preview mode (set by the SDK mount). With no booking session the
|
|
71
|
+
// page renders the full form with actions disabled instead of the empty state
|
|
72
|
+
// so the checkout chrome can be styled. See CorasMountOptions.preview.
|
|
73
|
+
this.preview = false;
|
|
74
|
+
this.cdpProjectId = "";
|
|
75
|
+
this.currentPage = "payment";
|
|
76
|
+
this.stripeController = new StripePaymentController(this);
|
|
77
|
+
this.flowController = new PaymentFlowController(this);
|
|
78
|
+
this.formController = new FormValidationController(this);
|
|
79
|
+
this.layoutController = new LayoutController(this);
|
|
80
|
+
this.cryptoAuthController = new CryptoAuthController(this, {
|
|
81
|
+
sendCode: (email) => this.sendCode(email),
|
|
82
|
+
loginWithCode: (email, code) => this.loginWithCode(email, code),
|
|
83
|
+
initiateMfaEnrollment: (phone) => this.initiateMfaEnrollment(phone),
|
|
84
|
+
submitMfaEnrollment: (code) => this.submitMfaEnrollment(code),
|
|
85
|
+
onLoginSuccess: () => this.handleCryptoLoginSuccess(),
|
|
86
|
+
onBalanceRefresh: () => this.balanceTask.run(),
|
|
87
|
+
onMfaEnrollmentComplete: () => this._syncMfaPhoneToFormIfEmpty(),
|
|
88
|
+
});
|
|
89
|
+
this.cryptoTransferController = new CryptoTransferController(this, {
|
|
90
|
+
transferTokens: (amount) => this.transferTokens(amount),
|
|
91
|
+
confirmReservation: async () => {
|
|
92
|
+
const result = await this.confirmReservation();
|
|
93
|
+
if (result) {
|
|
94
|
+
return {
|
|
95
|
+
transaction_id: result.transaction_id ?? this.transactionId,
|
|
96
|
+
user_id: result.user_id ?? this.userId,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
return null;
|
|
100
|
+
},
|
|
101
|
+
checkTransactionStatus: (userId) => this.checkTransactionStatus(userId),
|
|
102
|
+
showErrorModalOnce: () => this.showErrorModalOnce(),
|
|
103
|
+
redirectToConfirmation: (success) => this.redirectToConfirmation(success),
|
|
104
|
+
refreshBalance: () => this.balanceTask.run(),
|
|
105
|
+
submitMfaVerification: (code) => this.submitMfaVerification(code),
|
|
106
|
+
initiateMfaVerification: () => this.initiateMfaVerification(),
|
|
107
|
+
resetMfaVerificationState: () => this.resetMfaVerificationState(),
|
|
108
|
+
getPendingTransferAmount: () => this.pendingTransferAmount,
|
|
109
|
+
getCurrentCartTotal: () => String(this.getReservationsLoyaltyTotal("pay")),
|
|
110
|
+
setTransactionId: (id) => {
|
|
111
|
+
this.transactionId = id;
|
|
112
|
+
},
|
|
113
|
+
setUserId: (id) => {
|
|
114
|
+
this.userId = id;
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
/** AbortController for canceling long-running async ops on disconnect. */
|
|
118
|
+
this.abortController = new AbortController();
|
|
119
|
+
this.apiService = null;
|
|
120
|
+
this.showCryptoAuthModal = false;
|
|
121
|
+
this.transactionId = "";
|
|
122
|
+
this.userId = "";
|
|
123
|
+
// Stripe PaymentIntent secret from a successful reservation. Retained across
|
|
124
|
+
// a card decline so the corrected card can be re-submitted to Stripe without
|
|
125
|
+
// re-running the reservation, which consumes the single-use booking session.
|
|
126
|
+
this.pendingClientSecret = null;
|
|
127
|
+
this.referenceId = "";
|
|
128
|
+
this.earnedTokensToIssue = null;
|
|
129
|
+
this.canMakePayment = {
|
|
130
|
+
applePay: false,
|
|
131
|
+
googlePay: false,
|
|
132
|
+
};
|
|
133
|
+
this.paymentType = "stripe";
|
|
134
|
+
this.paymentMethod = "card";
|
|
135
|
+
this.paymentSuccessful = false;
|
|
136
|
+
this.paymentFailed = false;
|
|
137
|
+
this.loyaltyPageUrl = null;
|
|
138
|
+
this.userEmail = "";
|
|
139
|
+
this.configTask = new Task(this, {
|
|
140
|
+
autoRun: false,
|
|
141
|
+
task: async () => {
|
|
142
|
+
const result = await this.getApiService().fetchConfig();
|
|
143
|
+
if (!result.data) {
|
|
144
|
+
throw new Error("Failed to fetch payment configuration");
|
|
145
|
+
}
|
|
146
|
+
const config = result.data;
|
|
147
|
+
this.stripeKey = config.stripe_publishable_key;
|
|
148
|
+
if (config.coinbase_project_id) {
|
|
149
|
+
this.cdpProjectId = config.coinbase_project_id;
|
|
150
|
+
}
|
|
151
|
+
if (config.rpc_url) {
|
|
152
|
+
this.cryptoRpc = config.rpc_url;
|
|
153
|
+
this.cryptoNetwork = config.rpc_url.includes("mainnet")
|
|
154
|
+
? "base"
|
|
155
|
+
: "base-sepolia";
|
|
156
|
+
}
|
|
157
|
+
if (config.fida_token_address) {
|
|
158
|
+
this.tokenContractAddress = config.fida_token_address;
|
|
159
|
+
}
|
|
160
|
+
if (config.treasury_wallet_address) {
|
|
161
|
+
this.recipientAddress = config.treasury_wallet_address;
|
|
162
|
+
}
|
|
163
|
+
if (config.loyalty_page_url) {
|
|
164
|
+
this.loyaltyPageUrl = config.loyalty_page_url;
|
|
165
|
+
}
|
|
166
|
+
return config;
|
|
167
|
+
},
|
|
168
|
+
});
|
|
169
|
+
this.countriesTask = new Task(this, {
|
|
170
|
+
autoRun: false,
|
|
171
|
+
task: async () => {
|
|
172
|
+
const language_code = this.locale.split("-")[0] || "en";
|
|
173
|
+
const { data, error } = await this.getApiService().fetchCountries(language_code);
|
|
174
|
+
if (error) {
|
|
175
|
+
console.error("Error fetching countries:", error);
|
|
176
|
+
return [];
|
|
177
|
+
}
|
|
178
|
+
if (data) {
|
|
179
|
+
const defaultCode = getDefaultPhoneCode(data, this.locale);
|
|
180
|
+
if (defaultCode) {
|
|
181
|
+
this.formController.handlePhoneCodeSelection(defaultCode);
|
|
182
|
+
}
|
|
183
|
+
// Pre-fill country from geolocation if not already set
|
|
184
|
+
if (!this.formController.getFieldValue("country")) {
|
|
185
|
+
await this.geolocationTask.taskComplete;
|
|
186
|
+
const geoData = this.geolocationTask.value;
|
|
187
|
+
if (geoData?.code) {
|
|
188
|
+
const defaultCountry = getDefaultCountry(data, geoData.code);
|
|
189
|
+
if (defaultCountry) {
|
|
190
|
+
this.handleFormValueChange("country", defaultCountry);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
return data;
|
|
195
|
+
}
|
|
196
|
+
return [];
|
|
197
|
+
},
|
|
198
|
+
});
|
|
199
|
+
this.geolocationTask = new Task(this, {
|
|
200
|
+
autoRun: false,
|
|
201
|
+
task: async () => {
|
|
202
|
+
const result = await this.getApiService().fetchGeolocation();
|
|
203
|
+
if (result.error) {
|
|
204
|
+
console.error("Error fetching geolocation:", result.error);
|
|
205
|
+
return null;
|
|
206
|
+
}
|
|
207
|
+
return result.data ?? null;
|
|
208
|
+
},
|
|
209
|
+
});
|
|
210
|
+
this.balanceBackoffMs = BALANCE_BACKOFF_INITIAL_MS;
|
|
211
|
+
this.balanceTask = new Task(this, {
|
|
212
|
+
task: async ([loggedIn, hasRpc, loyaltyPoints]) => {
|
|
213
|
+
if (!loyaltyPoints || !loggedIn || !hasRpc) {
|
|
214
|
+
this.balanceBackoffMs = BALANCE_BACKOFF_INITIAL_MS;
|
|
215
|
+
this.clearBalanceBackoff();
|
|
216
|
+
return null;
|
|
217
|
+
}
|
|
218
|
+
try {
|
|
219
|
+
// IMPORTANT: For gas-sponsored transfers, we need to check Smart Account balance
|
|
220
|
+
// Only tokens in the Smart Account can be used with gas sponsorship
|
|
221
|
+
// The EOA balance doesn't matter for sponsored transactions
|
|
222
|
+
const smartAccountAddress = this.coinbaseSession?.smartAccountAddress;
|
|
223
|
+
if (!smartAccountAddress) {
|
|
224
|
+
console.error("No smart account address available for balance check");
|
|
225
|
+
this.balanceBackoffMs = BALANCE_BACKOFF_INITIAL_MS;
|
|
226
|
+
this.clearBalanceBackoff();
|
|
227
|
+
return null;
|
|
228
|
+
}
|
|
229
|
+
const balance = await this.getTokenBalance(smartAccountAddress);
|
|
230
|
+
// Success — reset backoff
|
|
231
|
+
this.balanceBackoffMs = BALANCE_BACKOFF_INITIAL_MS;
|
|
232
|
+
this.clearBalanceBackoff();
|
|
233
|
+
return balance;
|
|
234
|
+
}
|
|
235
|
+
catch (error) {
|
|
236
|
+
console.error("Balance fetch failed, retrying with backoff:", error);
|
|
237
|
+
// Schedule retry with exponential backoff
|
|
238
|
+
this.clearBalanceBackoff();
|
|
239
|
+
this.balanceRetryTimerId = setTimeout(() => {
|
|
240
|
+
this.balanceRetryTimerId = undefined;
|
|
241
|
+
this.balanceTask.run();
|
|
242
|
+
}, this.balanceBackoffMs);
|
|
243
|
+
this.balanceBackoffMs = Math.min(this.balanceBackoffMs * 2, BALANCE_BACKOFF_MAX_MS);
|
|
244
|
+
// Re-throw so the Task stays in error state
|
|
245
|
+
throw error;
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
args: () => [
|
|
249
|
+
Boolean(this.coinbaseSession),
|
|
250
|
+
Boolean(this.cryptoRpc),
|
|
251
|
+
Boolean(this.loyaltyPoints),
|
|
252
|
+
],
|
|
253
|
+
});
|
|
254
|
+
this.reservationsCheckTask = new Task(this, {
|
|
255
|
+
autoRun: false,
|
|
256
|
+
task: async () => {
|
|
257
|
+
const bookingSession = getBookingSession();
|
|
258
|
+
// No session means there is nothing to check out: a legitimate empty
|
|
259
|
+
// state (lost/expired session, or the branding preview), not an error.
|
|
260
|
+
// Returning empty keeps the error modal reserved for real API failures.
|
|
261
|
+
if (!bookingSession) {
|
|
262
|
+
return undefined;
|
|
263
|
+
}
|
|
264
|
+
const { data, error } = await this.getApiService().checkReservations(bookingSession);
|
|
265
|
+
if (error) {
|
|
266
|
+
throw error;
|
|
267
|
+
}
|
|
268
|
+
return data;
|
|
269
|
+
},
|
|
270
|
+
});
|
|
271
|
+
this.reservationsTask = new Task(this, {
|
|
272
|
+
autoRun: false,
|
|
273
|
+
task: async () => {
|
|
274
|
+
const bookingSession = getBookingSession();
|
|
275
|
+
if (!bookingSession) {
|
|
276
|
+
return {
|
|
277
|
+
reservations: null,
|
|
278
|
+
total_price: 0,
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
const result = await this.getApiService().fetchReservations(bookingSession);
|
|
282
|
+
if (result.error) {
|
|
283
|
+
console.error("Failed to fetch reservations");
|
|
284
|
+
return { reservations: [] };
|
|
285
|
+
}
|
|
286
|
+
return result.data || { reservations: [] };
|
|
287
|
+
},
|
|
288
|
+
});
|
|
289
|
+
this.handleCardValidationChange = (event) => {
|
|
290
|
+
event.stopPropagation();
|
|
291
|
+
const detail = event.detail;
|
|
292
|
+
if (detail.isValid) {
|
|
293
|
+
// Mirror regular form fields: clear external error when field becomes valid
|
|
294
|
+
switch (detail.elementType) {
|
|
295
|
+
case "cardNumber":
|
|
296
|
+
this.stripeController.cardError = "";
|
|
297
|
+
this.stripeController.cardNumberErrorExt = "";
|
|
298
|
+
break;
|
|
299
|
+
case "cardExpiry":
|
|
300
|
+
this.stripeController.cardExpiryErrorExt = "";
|
|
301
|
+
break;
|
|
302
|
+
case "cardCvc":
|
|
303
|
+
this.stripeController.cardCvcErrorExt = "";
|
|
304
|
+
break;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
else if (detail.elementType === "cardNumber") {
|
|
308
|
+
this.stripeController.cardError = detail.error;
|
|
309
|
+
}
|
|
310
|
+
this.requestUpdate();
|
|
311
|
+
};
|
|
312
|
+
this.handleCanMakePaymentChange = (event) => {
|
|
313
|
+
event.stopPropagation();
|
|
314
|
+
this.canMakePayment = event.detail;
|
|
315
|
+
};
|
|
316
|
+
this.handlePaymentMethodAuthorized = (event) => {
|
|
317
|
+
event.stopPropagation();
|
|
318
|
+
this.stripeController.setAuthorizedPayment(event.detail.paymentMethod, event.detail.event);
|
|
319
|
+
this.onFormSubmit(new Event("submit"));
|
|
320
|
+
};
|
|
321
|
+
this.onFormSubmit = async (e) => {
|
|
322
|
+
e.preventDefault();
|
|
323
|
+
e.stopPropagation();
|
|
324
|
+
// Guard must remain first: mutations below assume a single active submission
|
|
325
|
+
if (this.flowController.isProcessing) {
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
this.flowController.beginSubmission();
|
|
329
|
+
this.stripeController.clearAllErrors();
|
|
330
|
+
// Reset transaction IDs to avoid reporting stale IDs from a prior attempt.
|
|
331
|
+
// Preserve them when reusing a prior reservation (card-decline retry),
|
|
332
|
+
// since the same transaction is being completed.
|
|
333
|
+
if (!this.pendingClientSecret) {
|
|
334
|
+
this.transactionId = "";
|
|
335
|
+
this.userId = "";
|
|
336
|
+
}
|
|
337
|
+
try {
|
|
338
|
+
const isFormValid = this.validateForm();
|
|
339
|
+
let isCardValid = true;
|
|
340
|
+
if (this.paymentType === "stripe" &&
|
|
341
|
+
this.paymentMethod !== "google-pay" &&
|
|
342
|
+
this.paymentMethod !== "apple-pay") {
|
|
343
|
+
isCardValid = await this.stripeComponent.validateCardElements();
|
|
344
|
+
}
|
|
345
|
+
if (!isFormValid || !isCardValid) {
|
|
346
|
+
this.flowController.transition("idle");
|
|
347
|
+
this.dispatchPaymentFailure();
|
|
348
|
+
await this.updateComplete;
|
|
349
|
+
this.scrollToFirstError();
|
|
350
|
+
return;
|
|
351
|
+
}
|
|
352
|
+
if ((this.paymentMethod === "apple-pay" ||
|
|
353
|
+
this.paymentMethod === "google-pay") &&
|
|
354
|
+
!this.stripeController.authorizedPaymentMethod) {
|
|
355
|
+
const pr = this.stripeComponent.getPaymentRequest();
|
|
356
|
+
if (pr) {
|
|
357
|
+
const price = getTotalPrice(this.reservationsTask.value);
|
|
358
|
+
pr.update({
|
|
359
|
+
total: {
|
|
360
|
+
label: "Total",
|
|
361
|
+
amount: Math.round(price),
|
|
362
|
+
},
|
|
363
|
+
});
|
|
364
|
+
this.flowController.transition("idle"); // Return to idle so user can retry after dismissing payment sheet
|
|
365
|
+
pr.show();
|
|
366
|
+
return;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
// Crypto path: block transfer until MFA enrollment is complete
|
|
370
|
+
if (this.paymentType === "crypto") {
|
|
371
|
+
if (!this.coinbaseSession || !this.isMfaEnrolled) {
|
|
372
|
+
this.showCryptoAuthModal = true;
|
|
373
|
+
this.flowController.transition("auth_required");
|
|
374
|
+
return;
|
|
375
|
+
}
|
|
376
|
+
await this.syncEmailFromCoinbase();
|
|
377
|
+
const tokensAmount = String(this.getReservationsLoyaltyTotal("pay"));
|
|
378
|
+
this.pendingTransferAmount = tokensAmount;
|
|
379
|
+
// Check for a valid pending transfer from a previous attempt.
|
|
380
|
+
// If found (same amount, not stale, checksum OK), retry the API
|
|
381
|
+
// confirmation instead of initiating a new on-chain transfer.
|
|
382
|
+
const pendingTransfer = await this.cryptoTransferController.getValidPendingTransfer();
|
|
383
|
+
if (pendingTransfer) {
|
|
384
|
+
const retryResult = await this.cryptoTransferController.retryPendingTransfer(pendingTransfer);
|
|
385
|
+
if (retryResult !== "completed") {
|
|
386
|
+
this.flowController.transition("idle");
|
|
387
|
+
}
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
// Initiate a fresh on-chain transfer; the MFA listener will open the OTP modal
|
|
391
|
+
const transferResult = await this.startCryptoTransfer();
|
|
392
|
+
if (transferResult !== "completed") {
|
|
393
|
+
this.flowController.transition("idle");
|
|
394
|
+
}
|
|
395
|
+
return;
|
|
396
|
+
}
|
|
397
|
+
// Reuse the PaymentIntent from a prior attempt when retrying after a card
|
|
398
|
+
// decline: the first reservation PUT consumes the single-use booking
|
|
399
|
+
// session, but a declined PaymentIntent stays confirmable, so re-submit
|
|
400
|
+
// the corrected card to Stripe without re-running the reservation.
|
|
401
|
+
this.flowController.transition("confirming");
|
|
402
|
+
let clientSecret = this.pendingClientSecret;
|
|
403
|
+
if (!clientSecret) {
|
|
404
|
+
const confirmationResult = await this.confirmReservation();
|
|
405
|
+
if (!confirmationResult) {
|
|
406
|
+
this.flowController.transition("failed");
|
|
407
|
+
this.dispatchPaymentFailure();
|
|
408
|
+
return;
|
|
409
|
+
}
|
|
410
|
+
clientSecret = confirmationResult
|
|
411
|
+
.client_secret;
|
|
412
|
+
}
|
|
413
|
+
this.flowController.transition("processing_payment");
|
|
414
|
+
{
|
|
415
|
+
const customer = this.prepareCustomerData();
|
|
416
|
+
const data = this.reservationsTask.value;
|
|
417
|
+
const expectedAmount = getTotalPrice(data);
|
|
418
|
+
const paymentSuccess = await this.stripeController.processPayment(clientSecret, this.stripeComponent, this.paymentMethod, customer, expectedAmount);
|
|
419
|
+
if (!paymentSuccess) {
|
|
420
|
+
console.error("Payment processing failed");
|
|
421
|
+
this.flowController.transition("failed");
|
|
422
|
+
this.dispatchPaymentFailure();
|
|
423
|
+
return;
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
this.flowController.transition("polling");
|
|
427
|
+
const finalStatus = await this.checkTransactionStatus(this.userId);
|
|
428
|
+
if (finalStatus === "PAID") {
|
|
429
|
+
// PaymentIntent is consumed; drop it so a later submit cannot reuse it
|
|
430
|
+
this.pendingClientSecret = null;
|
|
431
|
+
this.flowController.transition("success");
|
|
432
|
+
this.redirectToConfirmation(true);
|
|
433
|
+
}
|
|
434
|
+
else {
|
|
435
|
+
console.error("Transaction failed with status:", finalStatus);
|
|
436
|
+
this.flowController.transition("failed");
|
|
437
|
+
this.redirectToConfirmation(false);
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
catch (error) {
|
|
441
|
+
console.error("Error during payment process:", error);
|
|
442
|
+
this.stripeController.cardError =
|
|
443
|
+
"An unexpected error occurred. Please try again.";
|
|
444
|
+
this.flowController.transition("failed");
|
|
445
|
+
this.dispatchPaymentFailure();
|
|
446
|
+
}
|
|
447
|
+
};
|
|
448
|
+
this.handleSendCode = async () => {
|
|
449
|
+
await this.cryptoAuthController.handleSendCode(this.walletEmail, () => this.validateWalletEmail(this.walletEmail), (error) => {
|
|
450
|
+
this.walletEmailError = error;
|
|
451
|
+
});
|
|
452
|
+
};
|
|
453
|
+
this.handleResendCode = async () => {
|
|
454
|
+
await this.cryptoAuthController.handleResendCode(this.walletEmail, this.codeSent, !!this.coinbaseSession);
|
|
455
|
+
};
|
|
456
|
+
this.handleLogin = async () => {
|
|
457
|
+
await this.cryptoAuthController.handleLogin(this.walletEmail);
|
|
458
|
+
};
|
|
459
|
+
this.startCryptoTransfer = async () => {
|
|
460
|
+
return this.cryptoTransferController.startTransfer();
|
|
461
|
+
};
|
|
462
|
+
this.handleMfaCodeSubmitted = async (e) => {
|
|
463
|
+
await this.cryptoTransferController.handleMfaCodeSubmitted(e.detail.code);
|
|
464
|
+
};
|
|
465
|
+
this.handleMfaResendRequested = async () => {
|
|
466
|
+
await this.cryptoTransferController.handleMfaResendRequested();
|
|
467
|
+
};
|
|
468
|
+
this.handleTransferCancelled = () => {
|
|
469
|
+
this.cryptoTransferController.handleTransferCancelled();
|
|
470
|
+
this.flowController.transition("idle");
|
|
471
|
+
};
|
|
472
|
+
}
|
|
473
|
+
static { this.styles = [
|
|
474
|
+
super.styles,
|
|
475
|
+
styles,
|
|
476
|
+
]; }
|
|
477
|
+
getPageProperties() {
|
|
478
|
+
return {
|
|
479
|
+
page: this.currentPage,
|
|
480
|
+
currency: this.currency,
|
|
481
|
+
locale: this.locale,
|
|
482
|
+
};
|
|
483
|
+
}
|
|
484
|
+
getApiService() {
|
|
485
|
+
if (!this.apiService) {
|
|
486
|
+
this.apiService = new PaymentApiService({
|
|
487
|
+
client: this.client,
|
|
488
|
+
distributorID: this.distributorID,
|
|
489
|
+
locale: this.locale,
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
else {
|
|
493
|
+
this.apiService.updateConfig({
|
|
494
|
+
client: this.client,
|
|
495
|
+
distributorID: this.distributorID,
|
|
496
|
+
locale: this.locale,
|
|
497
|
+
});
|
|
498
|
+
}
|
|
499
|
+
return this.apiService;
|
|
500
|
+
}
|
|
501
|
+
updated(changedProperties) {
|
|
502
|
+
super.updated(changedProperties);
|
|
503
|
+
if (getLocale() !== this.locale) {
|
|
504
|
+
setLocale(this.locale);
|
|
505
|
+
}
|
|
506
|
+
if (changedProperties.has("codeSent")) {
|
|
507
|
+
if (this.codeSent) {
|
|
508
|
+
this.cryptoAuthController.startOtpInactivityTimer(this.codeSent, !!this.coinbaseSession);
|
|
509
|
+
}
|
|
510
|
+
else {
|
|
511
|
+
this.cryptoAuthController.clearOtpInactivityTimer();
|
|
512
|
+
this.cryptoAuthController.showResend = false;
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
if (changedProperties.has("loyaltyPoints") ||
|
|
516
|
+
changedProperties.has("cdpProjectId")) {
|
|
517
|
+
const prevLoyalty = changedProperties.has("loyaltyPoints")
|
|
518
|
+
? changedProperties.get("loyaltyPoints")
|
|
519
|
+
: this.loyaltyPoints;
|
|
520
|
+
if (this.loyaltyPoints && this.cdpProjectId) {
|
|
521
|
+
this.initCoinbase(this.cdpProjectId).then(() => {
|
|
522
|
+
this.getUser()
|
|
523
|
+
.catch(() => { })
|
|
524
|
+
.finally(() => this.syncEmailFromCoinbase());
|
|
525
|
+
this.balanceTask.run();
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
else if (prevLoyalty && !this.loyaltyPoints) {
|
|
529
|
+
this.paymentType = "stripe";
|
|
530
|
+
this.coinbaseSession = undefined;
|
|
531
|
+
this.codeSent = false;
|
|
532
|
+
this.walletEmail = "";
|
|
533
|
+
this.walletEmailError = "";
|
|
534
|
+
this.cleanupCoinbase();
|
|
535
|
+
this.balanceTask.run();
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
if (changedProperties.has("mfaVerificationRequired")) {
|
|
539
|
+
if (this.mfaVerificationRequired && this.flowController.isProcessing) {
|
|
540
|
+
this.cryptoTransferController.openMfaVerification();
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
if (this.showCryptoAuthModal &&
|
|
544
|
+
this.coinbaseSession &&
|
|
545
|
+
this.isMfaEnrolled) {
|
|
546
|
+
this.showCryptoAuthModal = false;
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
firstUpdated() {
|
|
550
|
+
this.configTask.run();
|
|
551
|
+
this.countriesTask.run();
|
|
552
|
+
this.geolocationTask.run();
|
|
553
|
+
this.reservationsCheckTask.run();
|
|
554
|
+
this.reservationsTask.run();
|
|
555
|
+
this.updateComplete.then(() => {
|
|
556
|
+
const el = this.layoutElement;
|
|
557
|
+
if (el) {
|
|
558
|
+
this.layoutController.observe(el);
|
|
559
|
+
}
|
|
560
|
+
});
|
|
561
|
+
}
|
|
562
|
+
connectedCallback() {
|
|
563
|
+
super.connectedCallback();
|
|
564
|
+
// Recreate AbortController on reconnect so polling works after
|
|
565
|
+
// disconnect/reconnect cycles (e.g. route transitions).
|
|
566
|
+
if (this.abortController.signal.aborted) {
|
|
567
|
+
this.abortController = new AbortController();
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
disconnectedCallback() {
|
|
571
|
+
this.abortController.abort();
|
|
572
|
+
this.clearBalanceBackoff();
|
|
573
|
+
super.disconnectedCallback();
|
|
574
|
+
}
|
|
575
|
+
clearBalanceBackoff() {
|
|
576
|
+
if (this.balanceRetryTimerId != null) {
|
|
577
|
+
clearTimeout(this.balanceRetryTimerId);
|
|
578
|
+
this.balanceRetryTimerId = undefined;
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
hasReservations() {
|
|
582
|
+
return (this.reservationsTask.value?.reservations?.length ?? 0) > 0;
|
|
583
|
+
}
|
|
584
|
+
getReservationsLoyaltyTotal(field) {
|
|
585
|
+
const reservations = this.reservationsTask?.value?.reservations;
|
|
586
|
+
if (!reservations?.length)
|
|
587
|
+
return 0;
|
|
588
|
+
return reservations.reduce((sum, r) => {
|
|
589
|
+
const val = r.loyalty
|
|
590
|
+
? Number(Object.values(r.loyalty[field])[0] ?? 0)
|
|
591
|
+
: 0;
|
|
592
|
+
return sum + (isNaN(val) ? 0 : val);
|
|
593
|
+
}, 0);
|
|
594
|
+
}
|
|
595
|
+
formatEarnedTokens() {
|
|
596
|
+
if (!this.earnedTokensToIssue)
|
|
597
|
+
return null;
|
|
598
|
+
const numericValue = Number(this.earnedTokensToIssue);
|
|
599
|
+
if (Number.isNaN(numericValue) || numericValue <= 0)
|
|
600
|
+
return null;
|
|
601
|
+
return new Intl.NumberFormat(this.locale).format(numericValue);
|
|
602
|
+
}
|
|
603
|
+
handlePhoneCodeSelection(event) {
|
|
604
|
+
this.formController.handlePhoneCodeSelection(event.detail);
|
|
605
|
+
}
|
|
606
|
+
handleTermsChange(event) {
|
|
607
|
+
this.formController.handleTermsChange(event.detail.value);
|
|
608
|
+
}
|
|
609
|
+
handleFidaEmailAgreementChange(event) {
|
|
610
|
+
this.formController.marketing = event.detail.value;
|
|
611
|
+
this.requestUpdate();
|
|
612
|
+
}
|
|
613
|
+
isValidEmail(email) {
|
|
614
|
+
return isValidEmail(email);
|
|
615
|
+
}
|
|
616
|
+
handlePaymentTypeSelected(event) {
|
|
617
|
+
this.paymentType = event.detail.type;
|
|
618
|
+
if (this.paymentType === "crypto" &&
|
|
619
|
+
(!this.coinbaseSession || !this.isMfaEnrolled)) {
|
|
620
|
+
this.showCryptoAuthModal = true;
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
handlePaymentMethodSelected(event) {
|
|
624
|
+
this.paymentMethod = event.detail.method;
|
|
625
|
+
}
|
|
626
|
+
handleFormValueChange(fieldName, value) {
|
|
627
|
+
this.formController.handleValueChange(fieldName, value, this.flowController.submissionAttempts);
|
|
628
|
+
}
|
|
629
|
+
validateForm() {
|
|
630
|
+
const isValid = this.formController.validate(this.reservationsCheckTask.value, this.shouldShowBillingAddress(), this.paymentType, this.hasCryptoEmail());
|
|
631
|
+
this.stripeComponent?.updatePortals();
|
|
632
|
+
return isValid;
|
|
633
|
+
}
|
|
634
|
+
/**
|
|
635
|
+
* Scrolls to the first visible field that is currently in an error state.
|
|
636
|
+
* This improves UX by guiding the user to the problem immediately.
|
|
637
|
+
*/
|
|
638
|
+
scrollToFirstError() {
|
|
639
|
+
const root = this.renderRoot;
|
|
640
|
+
// Determine if Stripe has an error shown
|
|
641
|
+
const stripeHasError = Boolean(this.stripeController.cardError ||
|
|
642
|
+
this.stripeController.cardNumberErrorExt ||
|
|
643
|
+
this.stripeController.cardExpiryErrorExt ||
|
|
644
|
+
this.stripeController.cardCvcErrorExt);
|
|
645
|
+
const selectors = [
|
|
646
|
+
"coras-field[error]",
|
|
647
|
+
"coras-country-field[has-error]",
|
|
648
|
+
"coras-hotel-pickup-field[has-error]",
|
|
649
|
+
"coras-joined-fields[error]",
|
|
650
|
+
"coras-checkbox[error]",
|
|
651
|
+
];
|
|
652
|
+
if (stripeHasError) {
|
|
653
|
+
selectors.push("coras-stripe");
|
|
654
|
+
}
|
|
655
|
+
let target = null;
|
|
656
|
+
for (const sel of selectors) {
|
|
657
|
+
const el = root.querySelector(sel);
|
|
658
|
+
if (el) {
|
|
659
|
+
target = el;
|
|
660
|
+
break;
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
if (!target)
|
|
664
|
+
return;
|
|
665
|
+
target.scrollIntoView({
|
|
666
|
+
behavior: "smooth",
|
|
667
|
+
block: "center",
|
|
668
|
+
});
|
|
669
|
+
// Shadow DOM encapsulation requires explicit shadowRoot access for inner controls
|
|
670
|
+
try {
|
|
671
|
+
const shadowRoot = target
|
|
672
|
+
.shadowRoot;
|
|
673
|
+
if (shadowRoot) {
|
|
674
|
+
const focusable = shadowRoot.querySelector("input, select, textarea, button, [tabindex]");
|
|
675
|
+
if (focusable) {
|
|
676
|
+
focusable.focus({ preventScroll: true });
|
|
677
|
+
return;
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
catch {
|
|
682
|
+
// no-op: focusing is best-effort
|
|
683
|
+
}
|
|
684
|
+
target.focus({ preventScroll: true });
|
|
685
|
+
}
|
|
686
|
+
getFieldVisibility() {
|
|
687
|
+
const data = this.reservationsCheckTask.value;
|
|
688
|
+
// In preview with no booking session there are no requirements to drive the
|
|
689
|
+
// form, so show every general field — the studio brands the full form.
|
|
690
|
+
if (this.preview && !data?.general?.requirements?.length) {
|
|
691
|
+
return {
|
|
692
|
+
hasNameField: true,
|
|
693
|
+
hasFirstNameField: true,
|
|
694
|
+
hasSecondNameField: true,
|
|
695
|
+
hasPhoneField: true,
|
|
696
|
+
hasEmailField: true,
|
|
697
|
+
};
|
|
698
|
+
}
|
|
699
|
+
return this.formController.getFieldVisibility(data);
|
|
700
|
+
}
|
|
701
|
+
hasFirstNameField() {
|
|
702
|
+
return this.getFieldVisibility().hasFirstNameField;
|
|
703
|
+
}
|
|
704
|
+
hasSecondNameField() {
|
|
705
|
+
return this.getFieldVisibility().hasSecondNameField;
|
|
706
|
+
}
|
|
707
|
+
hasPhoneField() {
|
|
708
|
+
return this.getFieldVisibility().hasPhoneField;
|
|
709
|
+
}
|
|
710
|
+
hasEmailField() {
|
|
711
|
+
return this.getFieldVisibility().hasEmailField;
|
|
712
|
+
}
|
|
713
|
+
/**
|
|
714
|
+
* Determines if billing address fields should be displayed.
|
|
715
|
+
* Billing address is only shown for card payments (not Apple Pay, Google Pay, or crypto).
|
|
716
|
+
*/
|
|
717
|
+
shouldShowBillingAddress() {
|
|
718
|
+
if (this.paymentType === "crypto") {
|
|
719
|
+
return false;
|
|
720
|
+
}
|
|
721
|
+
return !(this.paymentMethod === "apple-pay" || this.paymentMethod === "google-pay");
|
|
722
|
+
}
|
|
723
|
+
renderContactDetailsEditable() {
|
|
724
|
+
return html `
|
|
725
|
+
<h2>${msg("Order details")}</h2>
|
|
726
|
+
<div class="fields-container">
|
|
727
|
+
${this.hasFirstNameField()
|
|
728
|
+
? this.renderField({ fieldName: "first_name" })
|
|
729
|
+
: nothing}
|
|
730
|
+
${this.hasSecondNameField()
|
|
731
|
+
? this.renderField({ fieldName: "second_name" })
|
|
732
|
+
: nothing}
|
|
733
|
+
${this.hasPhoneField()
|
|
734
|
+
? this.renderField({ fieldName: "phone" })
|
|
735
|
+
: nothing}
|
|
736
|
+
</div>
|
|
737
|
+
`;
|
|
738
|
+
}
|
|
739
|
+
renderActivityDetails() {
|
|
740
|
+
const data = this.reservationsCheckTask.value;
|
|
741
|
+
if (!data?.reservations || !data.reservations.length) {
|
|
742
|
+
return nothing;
|
|
743
|
+
}
|
|
744
|
+
const reservationSummaries = this.reservationsTask.value?.reservations || [];
|
|
745
|
+
return html `
|
|
746
|
+
<coras-activity-details
|
|
747
|
+
.reservationsCheck=${data}
|
|
748
|
+
.reservations=${reservationSummaries}
|
|
749
|
+
.formValues=${this.formController.formValues}
|
|
750
|
+
.formErrors=${this.formController.formErrors}
|
|
751
|
+
.submissionAttempts=${this.flowController.submissionAttempts}
|
|
752
|
+
.fieldsConfig=${FIELDS}
|
|
753
|
+
.countries=${this.countriesTask.value || []}
|
|
754
|
+
.selectedPhoneCode=${this.formController.selectedPhoneCode}
|
|
755
|
+
assets-url=${this.assetsURL}
|
|
756
|
+
@value-changed=${(e) => {
|
|
757
|
+
e.stopPropagation();
|
|
758
|
+
this.handleFormValueChange(e.detail.fieldName, e.detail.value);
|
|
759
|
+
}}
|
|
760
|
+
></coras-activity-details>
|
|
761
|
+
`;
|
|
762
|
+
}
|
|
763
|
+
validateWalletEmail(email) {
|
|
764
|
+
const error = validateWalletEmail(email);
|
|
765
|
+
this.walletEmailError = error;
|
|
766
|
+
return !error;
|
|
767
|
+
}
|
|
768
|
+
/**
|
|
769
|
+
* Checks if we have a valid email for crypto payments.
|
|
770
|
+
* Email is required for the reservation API.
|
|
771
|
+
* This checks for ANY email source (including user input).
|
|
772
|
+
*/
|
|
773
|
+
hasCryptoEmail() {
|
|
774
|
+
return !!(this.formController.formValues.email || this.coinbaseSession?.email);
|
|
775
|
+
}
|
|
776
|
+
renderCryptoWalletInfo() {
|
|
777
|
+
return nothing;
|
|
778
|
+
}
|
|
779
|
+
renderPaymentDetailsStep() {
|
|
780
|
+
const fidaAmount = this.getReservationsLoyaltyTotal("pay");
|
|
781
|
+
const formattedFidaAmount = new Intl.NumberFormat(this.locale).format(isNaN(fidaAmount) ? 0 : fidaAmount);
|
|
782
|
+
const termsLabel = this.paymentType === "crypto"
|
|
783
|
+
? msg("I confirm I have read and accept FIDA's Terms & Conditions")
|
|
784
|
+
: msg("I confirm I have read and accept Coras's Terms & Conditions");
|
|
785
|
+
if (this.paymentType === "crypto") {
|
|
786
|
+
const isLoggedIn = !!this.coinbaseSession;
|
|
787
|
+
const isFullyAuthenticated = isLoggedIn && this.isMfaEnrolled;
|
|
788
|
+
const balance = this.balanceTask.value;
|
|
789
|
+
const formattedBalance = balance != null ? this.formatTokenBalance(balance) : "0";
|
|
790
|
+
const currentBalance = Number(formattedBalance);
|
|
791
|
+
const insufficientBalance = balance === null || balance === 0n || currentBalance < fidaAmount;
|
|
792
|
+
return html `
|
|
793
|
+
${isLoggedIn && isFullyAuthenticated
|
|
794
|
+
? this.renderCryptoWalletInfo()
|
|
795
|
+
: nothing}
|
|
796
|
+
${this.renderBillingAddress()}
|
|
797
|
+
<div class="footer">
|
|
798
|
+
<div class="terms-and-button crypto-footer">
|
|
799
|
+
<div class="terms-container">
|
|
800
|
+
<coras-checkbox
|
|
801
|
+
?checked=${this.formController.termsAccepted}
|
|
802
|
+
?error=${this.formController.termsError}
|
|
803
|
+
label="${termsLabel}"
|
|
804
|
+
@value-changed=${this.handleTermsChange}
|
|
805
|
+
></coras-checkbox>
|
|
806
|
+
</div>
|
|
807
|
+
<div class="button-container">
|
|
808
|
+
<coras-button
|
|
809
|
+
type="submit"
|
|
810
|
+
data-testid="submit"
|
|
811
|
+
?loading=${this.flowController.isProcessing}
|
|
812
|
+
?disabled=${!this.hasReservations() ||
|
|
813
|
+
!isLoggedIn ||
|
|
814
|
+
(isFullyAuthenticated && insufficientBalance)}
|
|
815
|
+
>
|
|
816
|
+
${isFullyAuthenticated && insufficientBalance
|
|
817
|
+
? msg("Insufficient FIDA balance")
|
|
818
|
+
: html `${msg("Pay now with")} ${formattedFidaAmount} FIDA`}
|
|
819
|
+
</coras-button>
|
|
820
|
+
</div>
|
|
821
|
+
</div>
|
|
822
|
+
</div>
|
|
823
|
+
`;
|
|
824
|
+
}
|
|
825
|
+
return html `
|
|
826
|
+
${this.renderPaymentDetails()} ${this.renderBillingAddress()}
|
|
827
|
+
<div class="footer">
|
|
828
|
+
<div class="terms-and-button">
|
|
829
|
+
<div class="terms-container">
|
|
830
|
+
<coras-checkbox
|
|
831
|
+
?checked=${this.formController.termsAccepted}
|
|
832
|
+
?error=${this.formController.termsError}
|
|
833
|
+
label="${termsLabel}"
|
|
834
|
+
@value-changed=${this.handleTermsChange}
|
|
835
|
+
></coras-checkbox>
|
|
836
|
+
</div>
|
|
837
|
+
<div class="button-container">
|
|
838
|
+
<coras-button
|
|
839
|
+
type="submit"
|
|
840
|
+
data-testid="submit"
|
|
841
|
+
?loading=${this.flowController.isProcessing}
|
|
842
|
+
?disabled=${!this.hasReservations()}
|
|
843
|
+
>
|
|
844
|
+
${msg("Pay now")}
|
|
845
|
+
</coras-button>
|
|
846
|
+
</div>
|
|
847
|
+
</div>
|
|
848
|
+
</div>
|
|
849
|
+
`;
|
|
850
|
+
}
|
|
851
|
+
handleCryptoAuthCancelled() {
|
|
852
|
+
this.showCryptoAuthModal = false;
|
|
853
|
+
this._resetMfaPhoneState();
|
|
854
|
+
// Only switch away from crypto if user hasn't logged in yet.
|
|
855
|
+
// If they're logged in but closed the MFA modal, keep them on crypto
|
|
856
|
+
// — the pay button will remain disabled until MFA is enrolled.
|
|
857
|
+
if (!this.coinbaseSession) {
|
|
858
|
+
this.paymentType = "stripe";
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
_resetMfaPhoneState() {
|
|
862
|
+
this.cryptoAuthController.resetMfaPhoneState();
|
|
863
|
+
}
|
|
864
|
+
/**
|
|
865
|
+
* Syncs the MFA phone number to the payment form if the form phone is empty.
|
|
866
|
+
* Called after successful MFA enrollment so the form gets the number the user
|
|
867
|
+
* verified during SMS OTP setup.
|
|
868
|
+
*/
|
|
869
|
+
_syncMfaPhoneToFormIfEmpty() {
|
|
870
|
+
const formHasPhone = !!this.formController.formValues.phone &&
|
|
871
|
+
!!this.formController.selectedPhoneCode?.phoneCode;
|
|
872
|
+
if (formHasPhone)
|
|
873
|
+
return;
|
|
874
|
+
const mfaPhoneCode = this.cryptoAuthController.mfaSelectedPhoneCode ||
|
|
875
|
+
this.formController.selectedPhoneCode;
|
|
876
|
+
const mfaLocalNumber = this.cryptoAuthController.localPhoneNumber;
|
|
877
|
+
if (mfaPhoneCode && mfaLocalNumber) {
|
|
878
|
+
// Phone from MFA modal — sync back to the main form
|
|
879
|
+
this.formController.selectedPhoneCode = { ...mfaPhoneCode };
|
|
880
|
+
this.handleFormValueChange("phone", mfaLocalNumber);
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
renderCryptoAuthModalElement() {
|
|
884
|
+
if (!this.showCryptoAuthModal)
|
|
885
|
+
return nothing;
|
|
886
|
+
const formPhone = this.getFormPhoneNumber();
|
|
887
|
+
const maskedPhone = formPhone ? `******${formPhone.slice(-4)}` : "";
|
|
888
|
+
return html `
|
|
889
|
+
<coras-crypto-auth-modal
|
|
890
|
+
?open=${this.showCryptoAuthModal}
|
|
891
|
+
email=${this.walletEmail}
|
|
892
|
+
email-error=${this.walletEmailError}
|
|
893
|
+
?marketing=${this.formController.marketing}
|
|
894
|
+
?code-sent=${this.codeSent}
|
|
895
|
+
?is-logged-in=${!!this.coinbaseSession}
|
|
896
|
+
?is-mfa-enrolled=${this.isMfaEnrolled}
|
|
897
|
+
?mfa-enrollment-code-sent=${this.mfaEnrollmentCodeSent}
|
|
898
|
+
otp-error=${this.cryptoAuthController.otpError}
|
|
899
|
+
mfa-error=${this.cryptoAuthController.mfaError}
|
|
900
|
+
mfa-enrollment-error=${this.mfaEnrollmentError || ""}
|
|
901
|
+
?show-resend=${this.cryptoAuthController.showResend}
|
|
902
|
+
rate-limit-error=${this.cryptoAuthController.otpRateLimitError}
|
|
903
|
+
sms-rate-limit-error=${this.cryptoAuthController.smsRateLimitError}
|
|
904
|
+
form-phone=${formPhone || ""}
|
|
905
|
+
masked-phone=${maskedPhone}
|
|
906
|
+
phone-number-error=${this.cryptoAuthController.phoneNumberError || ""}
|
|
907
|
+
assets-url=${this.assetsURL}
|
|
908
|
+
?loading=${this.flowController.isProcessing}
|
|
909
|
+
?show-phone-input=${this.cryptoAuthController.showMfaPhoneInput}
|
|
910
|
+
.countries=${this.countriesTask.value || []}
|
|
911
|
+
.selectedPhoneCode=${this.cryptoAuthController.mfaSelectedPhoneCode ||
|
|
912
|
+
this.formController.selectedPhoneCode}
|
|
913
|
+
local-phone-number=${this.cryptoAuthController.localPhoneNumber}
|
|
914
|
+
@email-changed=${(e) => {
|
|
915
|
+
this.walletEmail = e.detail.value;
|
|
916
|
+
if (this.walletEmailError)
|
|
917
|
+
this.walletEmailError = "";
|
|
918
|
+
if (this.walletEmail && this.paymentType === "crypto") {
|
|
919
|
+
this.handleFormValueChange("email", this.walletEmail);
|
|
920
|
+
}
|
|
921
|
+
}}
|
|
922
|
+
@marketing-changed=${this.handleFidaEmailAgreementChange}
|
|
923
|
+
@send-code=${this.handleSendCode}
|
|
924
|
+
@verify-code=${(e) => {
|
|
925
|
+
this.cryptoAuthController.otpCode = e.detail.code || "";
|
|
926
|
+
if (this.cryptoAuthController.otpError)
|
|
927
|
+
this.cryptoAuthController.otpError = "";
|
|
928
|
+
this.cryptoAuthController.clearOtpInactivityTimer();
|
|
929
|
+
this.cryptoAuthController.showResend = false;
|
|
930
|
+
this.handleLogin();
|
|
931
|
+
}}
|
|
932
|
+
@resend-email-code=${this.handleResendCode}
|
|
933
|
+
@initiate-mfa-enrollment=${() => {
|
|
934
|
+
const formPhone = this.getFormPhoneNumber();
|
|
935
|
+
const hasFormPhone = !!formPhone && !this.cryptoAuthController.showMfaPhoneInput;
|
|
936
|
+
this.cryptoAuthController.handleMfaEnrollmentWithFormPhone(formPhone, hasFormPhone, this.formController.selectedPhoneCode?.phoneCode || "", (err) => {
|
|
937
|
+
this.mfaEnrollmentError = err;
|
|
938
|
+
});
|
|
939
|
+
}}
|
|
940
|
+
@verify-mfa-enrollment=${(e) => {
|
|
941
|
+
this.cryptoAuthController.mfaCode = e.detail.code || "";
|
|
942
|
+
if (this.cryptoAuthController.mfaError)
|
|
943
|
+
this.cryptoAuthController.mfaError = "";
|
|
944
|
+
this.cryptoAuthController.handleVerifyMfaEnrollment();
|
|
945
|
+
}}
|
|
946
|
+
@resend-mfa-code=${() => {
|
|
947
|
+
const formPhone = this.getFormPhoneNumber();
|
|
948
|
+
const hasFormPhone = !!formPhone && !this.cryptoAuthController.showMfaPhoneInput;
|
|
949
|
+
this.cryptoAuthController.handleMfaEnrollmentWithFormPhone(formPhone, hasFormPhone, this.formController.selectedPhoneCode?.phoneCode || "", (err) => {
|
|
950
|
+
this.mfaEnrollmentError = err;
|
|
951
|
+
});
|
|
952
|
+
}}
|
|
953
|
+
@phone-changed=${(e) => {
|
|
954
|
+
this.cryptoAuthController.handlePhoneEnrollmentChange(e.detail.value);
|
|
955
|
+
}}
|
|
956
|
+
@phone-code-selected=${(e) => {
|
|
957
|
+
this.cryptoAuthController.mfaSelectedPhoneCode = e.detail;
|
|
958
|
+
}}
|
|
959
|
+
@show-phone-input=${() => {
|
|
960
|
+
this.cryptoAuthController.showMfaPhoneInput = true;
|
|
961
|
+
this.cryptoAuthController.localPhoneNumber = "";
|
|
962
|
+
if (!this.cryptoAuthController.mfaSelectedPhoneCode) {
|
|
963
|
+
this.cryptoAuthController.mfaSelectedPhoneCode = this.formController
|
|
964
|
+
.selectedPhoneCode
|
|
965
|
+
? { ...this.formController.selectedPhoneCode }
|
|
966
|
+
: null;
|
|
967
|
+
}
|
|
968
|
+
}}
|
|
969
|
+
@back-to-email-input=${() => {
|
|
970
|
+
this.codeSent = false;
|
|
971
|
+
}}
|
|
972
|
+
@back-to-sms-prompt=${() => {
|
|
973
|
+
this.mfaEnrollmentCodeSent = false;
|
|
974
|
+
}}
|
|
975
|
+
@auth-cancelled=${this.handleCryptoAuthCancelled}
|
|
976
|
+
></coras-crypto-auth-modal>
|
|
977
|
+
`;
|
|
978
|
+
}
|
|
979
|
+
renderPaymentDetails() {
|
|
980
|
+
return html `
|
|
981
|
+
<div
|
|
982
|
+
class="payment-details-wrapper"
|
|
983
|
+
?hidden=${this.paymentMethod !== "card"}
|
|
984
|
+
>
|
|
985
|
+
<h2>${msg("Payment details")}</h2>
|
|
986
|
+
<div class="card-container">
|
|
987
|
+
<coras-stripe
|
|
988
|
+
stripe-key=${this.stripeKey}
|
|
989
|
+
locale=${this.locale}
|
|
990
|
+
currency=${this.currency}
|
|
991
|
+
country=${this.findCountryCode(this.getFieldValue("country")) ||
|
|
992
|
+
"US"}
|
|
993
|
+
external-error=${this.stripeController.cardError}
|
|
994
|
+
external-card-number-error=${this.stripeController
|
|
995
|
+
.cardNumberErrorExt}
|
|
996
|
+
external-card-expiry-error=${this.stripeController
|
|
997
|
+
.cardExpiryErrorExt}
|
|
998
|
+
external-card-cvc-error=${this.stripeController.cardCvcErrorExt}
|
|
999
|
+
@card-validation-changed=${this.handleCardValidationChange}
|
|
1000
|
+
@can-make-payment-changed=${this.handleCanMakePaymentChange}
|
|
1001
|
+
@payment-method-authorized=${this.handlePaymentMethodAuthorized}
|
|
1002
|
+
>
|
|
1003
|
+
</coras-stripe>
|
|
1004
|
+
</div>
|
|
1005
|
+
</div>
|
|
1006
|
+
`;
|
|
1007
|
+
}
|
|
1008
|
+
renderBillingAddress() {
|
|
1009
|
+
const showBillingAddress = this.shouldShowBillingAddress();
|
|
1010
|
+
const showEmail = this.hasEmailField();
|
|
1011
|
+
if (!showBillingAddress && !showEmail) {
|
|
1012
|
+
return nothing;
|
|
1013
|
+
}
|
|
1014
|
+
return html `
|
|
1015
|
+
<coras-billing-address
|
|
1016
|
+
.formValues=${this.formController.formValues}
|
|
1017
|
+
.formErrors=${this.formController.formErrors}
|
|
1018
|
+
.submissionAttempts=${this.flowController.submissionAttempts}
|
|
1019
|
+
.countries=${this.countriesTask.value || []}
|
|
1020
|
+
.fieldsConfig=${FIELDS}
|
|
1021
|
+
?showBillingAddress=${showBillingAddress}
|
|
1022
|
+
?showEmail=${showEmail}
|
|
1023
|
+
assets-url=${this.assetsURL}
|
|
1024
|
+
@value-changed=${(e) => {
|
|
1025
|
+
e.stopPropagation();
|
|
1026
|
+
this.handleFormValueChange(e.detail.fieldName, e.detail.value);
|
|
1027
|
+
}}
|
|
1028
|
+
></coras-billing-address>
|
|
1029
|
+
`;
|
|
1030
|
+
}
|
|
1031
|
+
getFieldValue(fieldName) {
|
|
1032
|
+
return this.formController.getFieldValue(fieldName);
|
|
1033
|
+
}
|
|
1034
|
+
/**
|
|
1035
|
+
* Finds the country code for a given country name
|
|
1036
|
+
*/
|
|
1037
|
+
findCountryCode(countryName) {
|
|
1038
|
+
const countriesValue = this.countriesTask.value;
|
|
1039
|
+
const countries = Array.isArray(countriesValue) ? countriesValue : [];
|
|
1040
|
+
return findCountryCodeUtil(countryName, countries);
|
|
1041
|
+
}
|
|
1042
|
+
/**
|
|
1043
|
+
* Returns the best available email from Coinbase auth sources when using FIDA (crypto).
|
|
1044
|
+
* Priority: explicitly entered walletEmail (from login form) > session email
|
|
1045
|
+
*/
|
|
1046
|
+
async getCoinbaseAuthEmail() {
|
|
1047
|
+
// 1) Email typed by the user into the FIDA login field
|
|
1048
|
+
if (this.walletEmail) {
|
|
1049
|
+
return this.walletEmail;
|
|
1050
|
+
}
|
|
1051
|
+
// 2) Email from the Coinbase session, if available
|
|
1052
|
+
if (this.coinbaseSession?.email) {
|
|
1053
|
+
return this.coinbaseSession.email;
|
|
1054
|
+
}
|
|
1055
|
+
return undefined;
|
|
1056
|
+
}
|
|
1057
|
+
/**
|
|
1058
|
+
* Sync email in formValues from Coinbase authentication sources.
|
|
1059
|
+
* Invoked after successful login, session restore, or when switching to crypto payments.
|
|
1060
|
+
*/
|
|
1061
|
+
async syncEmailFromCoinbase() {
|
|
1062
|
+
const coinbaseEmail = await this.getCoinbaseAuthEmail();
|
|
1063
|
+
if (!coinbaseEmail)
|
|
1064
|
+
return;
|
|
1065
|
+
// Only autofill if the email field is currently empty
|
|
1066
|
+
if (!this.formController.formValues.email) {
|
|
1067
|
+
this.handleFormValueChange("email", coinbaseEmail);
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
async handleCryptoLoginSuccess() {
|
|
1071
|
+
await this.syncEmailFromCoinbase();
|
|
1072
|
+
this.submitUserConsent();
|
|
1073
|
+
}
|
|
1074
|
+
async submitUserConsent() {
|
|
1075
|
+
try {
|
|
1076
|
+
const email = this.walletEmail;
|
|
1077
|
+
if (!email)
|
|
1078
|
+
return;
|
|
1079
|
+
const accessToken = await this.getCoinbaseAccessToken();
|
|
1080
|
+
if (!accessToken)
|
|
1081
|
+
return;
|
|
1082
|
+
await this.getApiService().submitUserConsent(email, {
|
|
1083
|
+
"Coinbase-Access-Token": accessToken,
|
|
1084
|
+
});
|
|
1085
|
+
}
|
|
1086
|
+
catch {
|
|
1087
|
+
// Fire-and-forget — consent failure should not block the login flow
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
/**
|
|
1091
|
+
* Prepares customer data from form values
|
|
1092
|
+
*/
|
|
1093
|
+
prepareCustomerData() {
|
|
1094
|
+
return prepareCustomerDataUtil(this.formController.formValues, this.formController.selectedPhoneCode, this.findCountryCode.bind(this), this.shouldShowBillingAddress());
|
|
1095
|
+
}
|
|
1096
|
+
/**
|
|
1097
|
+
* Prepares reservation data with requirements
|
|
1098
|
+
*/
|
|
1099
|
+
prepareReservationData() {
|
|
1100
|
+
const reservations = this.reservationsTask.value?.reservations;
|
|
1101
|
+
return prepareReservationData(Array.isArray(reservations) && reservations.length > 0
|
|
1102
|
+
? reservations
|
|
1103
|
+
: [], this.getFieldValue.bind(this));
|
|
1104
|
+
}
|
|
1105
|
+
/**
|
|
1106
|
+
* Prepares attendee data for the attendees field in the PUT request to /reservations
|
|
1107
|
+
*/
|
|
1108
|
+
prepareAttendeesData() {
|
|
1109
|
+
const reservations = this.reservationsTask.value?.reservations;
|
|
1110
|
+
return prepareAttendeesData(Array.isArray(reservations) && reservations.length > 0
|
|
1111
|
+
? reservations
|
|
1112
|
+
: [], this.reservationsCheckTask.value, this.getFieldValue.bind(this), this.formController.selectedPhoneCode);
|
|
1113
|
+
}
|
|
1114
|
+
/**
|
|
1115
|
+
* Confirms the reservation with the API
|
|
1116
|
+
*/
|
|
1117
|
+
async confirmReservation() {
|
|
1118
|
+
const customer = this.prepareCustomerData();
|
|
1119
|
+
const { reservations } = this.prepareReservationData();
|
|
1120
|
+
const { attendees, hasRequirements } = this.prepareAttendeesData();
|
|
1121
|
+
/* reservation data prepared */
|
|
1122
|
+
try {
|
|
1123
|
+
if (!reservations.length) {
|
|
1124
|
+
console.error("No reservations found");
|
|
1125
|
+
this.formController.formErrors = {
|
|
1126
|
+
...this.formController.formErrors,
|
|
1127
|
+
reservations: "At least one reservation is required",
|
|
1128
|
+
};
|
|
1129
|
+
return null;
|
|
1130
|
+
}
|
|
1131
|
+
const reservationsCheckData = this.reservationsCheckTask.value;
|
|
1132
|
+
if (reservationsCheckData?.reservations) {
|
|
1133
|
+
for (const reservation of reservationsCheckData.reservations) {
|
|
1134
|
+
if (reservation.id && reservation.requirements?.length) {
|
|
1135
|
+
const pickupRequirement = reservation.requirements.find((req) => req.field === "pickup_point");
|
|
1136
|
+
if (pickupRequirement) {
|
|
1137
|
+
const fieldName = `reservation_${reservation.id}_pickup_point`;
|
|
1138
|
+
const pickupId = this.getFieldValue(fieldName);
|
|
1139
|
+
if (pickupId) {
|
|
1140
|
+
const { error } = await this.getApiService().patchReservation(reservation.id, {
|
|
1141
|
+
pickup_id: pickupId,
|
|
1142
|
+
pickup_entry: null,
|
|
1143
|
+
});
|
|
1144
|
+
if (error) {
|
|
1145
|
+
console.error("Failed to update pickup_id for reservation");
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
}
|
|
1152
|
+
const phoneNumber = formatPhoneWithPlus(customer.phone);
|
|
1153
|
+
if (customer.phone && !phoneNumber) {
|
|
1154
|
+
// Validate phone format client-side before sending to the API
|
|
1155
|
+
this.formController.formErrors = {
|
|
1156
|
+
...this.formController.formErrors,
|
|
1157
|
+
phone: msg("Please enter a valid phone number"),
|
|
1158
|
+
};
|
|
1159
|
+
this.flowController.transition("idle");
|
|
1160
|
+
await this.updateComplete;
|
|
1161
|
+
this.scrollToFirstError();
|
|
1162
|
+
return null;
|
|
1163
|
+
}
|
|
1164
|
+
const bookingSession = getBookingSession();
|
|
1165
|
+
if (!bookingSession) {
|
|
1166
|
+
console.error("Cannot confirm reservation: booking session is missing.");
|
|
1167
|
+
return null;
|
|
1168
|
+
}
|
|
1169
|
+
const body = {
|
|
1170
|
+
first_name: customer.name.split(" ")[0] || "",
|
|
1171
|
+
second_name: customer.name.split(" ").slice(1).join(" ") || "",
|
|
1172
|
+
email: customer.email,
|
|
1173
|
+
phone_number: phoneNumber || "",
|
|
1174
|
+
reservations,
|
|
1175
|
+
attendees: hasRequirements && attendees.length > 0 ? attendees : null,
|
|
1176
|
+
payment_type: this.paymentType === "crypto" ? 1 : 0,
|
|
1177
|
+
payment_method_id: null,
|
|
1178
|
+
payment_method_data: null,
|
|
1179
|
+
products: null,
|
|
1180
|
+
id_number: null,
|
|
1181
|
+
wallet_address: null,
|
|
1182
|
+
transaction_hash: null,
|
|
1183
|
+
// Host-supplied custom data, stored by the API and returned on read.
|
|
1184
|
+
...(Object.keys(this.metadata).length > 0
|
|
1185
|
+
? { metadata: this.metadata }
|
|
1186
|
+
: {}),
|
|
1187
|
+
};
|
|
1188
|
+
const customHeaders = {};
|
|
1189
|
+
if (this.paymentType === "crypto") {
|
|
1190
|
+
const smartAccountAddress = this.coinbaseSession?.smartAccountAddress;
|
|
1191
|
+
if (smartAccountAddress) {
|
|
1192
|
+
body.wallet_address = smartAccountAddress;
|
|
1193
|
+
}
|
|
1194
|
+
if (this.transactionId) {
|
|
1195
|
+
body.transaction_hash = this.transactionId;
|
|
1196
|
+
}
|
|
1197
|
+
const accessToken = await this.getCoinbaseAccessToken();
|
|
1198
|
+
if (accessToken) {
|
|
1199
|
+
customHeaders["Coinbase-Access-Token"] = accessToken;
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
1202
|
+
const { data, error } = await this.getApiService().confirmReservation(body, bookingSession, customHeaders);
|
|
1203
|
+
if (error) {
|
|
1204
|
+
this.handleApiErrors(error);
|
|
1205
|
+
return null;
|
|
1206
|
+
}
|
|
1207
|
+
if (data) {
|
|
1208
|
+
const responseData = data;
|
|
1209
|
+
this.transactionId = responseData.transaction_id;
|
|
1210
|
+
this.userId = responseData.user_id;
|
|
1211
|
+
this.pendingClientSecret = responseData.client_secret ?? null;
|
|
1212
|
+
// Invalidate booking session so a page refresh cannot replay the reservation
|
|
1213
|
+
removeBookingSession();
|
|
1214
|
+
return responseData;
|
|
1215
|
+
}
|
|
1216
|
+
return null;
|
|
1217
|
+
}
|
|
1218
|
+
catch (error) {
|
|
1219
|
+
this.handleApiErrors(error);
|
|
1220
|
+
return null;
|
|
1221
|
+
}
|
|
1222
|
+
}
|
|
1223
|
+
async checkTransactionStatus(userId, maxAttempts = TRANSACTION_POLLING_MAX_ATTEMPTS, initialInterval = TRANSACTION_POLLING_INITIAL_INTERVAL_MS) {
|
|
1224
|
+
const { status, tokensToIssue } = await pollTransactionStatus(userId, maxAttempts, initialInterval, TRANSACTION_POLLING_MAX_INTERVAL_MS, this.client, this.distributorID, this.locale, (referenceId) => {
|
|
1225
|
+
this.referenceId = referenceId;
|
|
1226
|
+
}, this.abortController.signal);
|
|
1227
|
+
if (status === "PAID") {
|
|
1228
|
+
this.paymentSuccessful = true;
|
|
1229
|
+
this.earnedTokensToIssue = tokensToIssue;
|
|
1230
|
+
}
|
|
1231
|
+
else {
|
|
1232
|
+
this.paymentFailed = true;
|
|
1233
|
+
}
|
|
1234
|
+
return status;
|
|
1235
|
+
}
|
|
1236
|
+
/**
|
|
1237
|
+
* Sanitizes error objects to prevent leaking internal/SDK details to the user.
|
|
1238
|
+
* Only allows structured ApiError objects through; replaces unknown shapes.
|
|
1239
|
+
*/
|
|
1240
|
+
sanitizeError(error) {
|
|
1241
|
+
if (isApiError(error))
|
|
1242
|
+
return error;
|
|
1243
|
+
return { errors: {} };
|
|
1244
|
+
}
|
|
1245
|
+
/**
|
|
1246
|
+
* Handles API errors by mapping them to form fields
|
|
1247
|
+
*/
|
|
1248
|
+
handleApiErrors(error) {
|
|
1249
|
+
const sanitized = this.sanitizeError(error);
|
|
1250
|
+
const { attendees } = this.prepareAttendeesData();
|
|
1251
|
+
const reservations = this.reservationsTask.value?.reservations;
|
|
1252
|
+
const { formErrors, cardError } = mapApiErrorsToForm(sanitized, this.formController.formErrors, attendees, Array.isArray(reservations) ? reservations : []);
|
|
1253
|
+
this.formController.formErrors = formErrors;
|
|
1254
|
+
if (cardError) {
|
|
1255
|
+
this.stripeController.cardError = cardError;
|
|
1256
|
+
}
|
|
1257
|
+
this.updateComplete.then(() => this.scrollToFirstError());
|
|
1258
|
+
}
|
|
1259
|
+
handleTryAgain() {
|
|
1260
|
+
// Reset submit state so the user can re-submit
|
|
1261
|
+
this.flowController.retry();
|
|
1262
|
+
this.paymentFailed = false;
|
|
1263
|
+
this.formController.formErrors = {};
|
|
1264
|
+
this.stripeController.clearAllErrors();
|
|
1265
|
+
this.requestUpdate();
|
|
1266
|
+
}
|
|
1267
|
+
/**
|
|
1268
|
+
* Dispatches the coras:payment-status event with a failed status.
|
|
1269
|
+
* Use this for failure paths that occur before we have transaction details.
|
|
1270
|
+
*/
|
|
1271
|
+
dispatchPaymentFailure() {
|
|
1272
|
+
fireEvent(this, "coras:payment-status", {
|
|
1273
|
+
status: "failed",
|
|
1274
|
+
...(this.transactionId ? { reference: this.transactionId } : {}),
|
|
1275
|
+
});
|
|
1276
|
+
}
|
|
1277
|
+
/**
|
|
1278
|
+
* Handles payment confirmation
|
|
1279
|
+
*/
|
|
1280
|
+
redirectToConfirmation(success) {
|
|
1281
|
+
fireEvent(this, "coras:payment-status", {
|
|
1282
|
+
status: success ? "succeeded" : "failed",
|
|
1283
|
+
...(this.transactionId ? { reference: this.transactionId } : {}),
|
|
1284
|
+
});
|
|
1285
|
+
// Scroll to top while the form content is still in the DOM and the page is
|
|
1286
|
+
// scrollable. Doing this after the content swap may fail because the shorter
|
|
1287
|
+
// confirmation view can remove the overflow that makes scrolling possible.
|
|
1288
|
+
window.scrollTo({ top: 0, behavior: "instant" });
|
|
1289
|
+
if (success) {
|
|
1290
|
+
this.paymentSuccessful = true;
|
|
1291
|
+
this.userEmail = this.formController.formValues.email || "";
|
|
1292
|
+
}
|
|
1293
|
+
else {
|
|
1294
|
+
this.paymentFailed = true;
|
|
1295
|
+
}
|
|
1296
|
+
}
|
|
1297
|
+
renderField(options) {
|
|
1298
|
+
const { fieldName, customField, customType, borderless, suppressHelpText } = options;
|
|
1299
|
+
if (fieldName === "phone") {
|
|
1300
|
+
return this.renderPhoneField(fieldName);
|
|
1301
|
+
}
|
|
1302
|
+
const fieldConfig = getFieldConfig(fieldName, FIELDS, customField, customType);
|
|
1303
|
+
if (!fieldConfig)
|
|
1304
|
+
return null;
|
|
1305
|
+
const value = this.getFieldValue(fieldName);
|
|
1306
|
+
const error = this.formController.formErrors[fieldName] || "";
|
|
1307
|
+
const validated = this.flowController.submissionAttempts > 0;
|
|
1308
|
+
const hasError = validated && !!error;
|
|
1309
|
+
if (fieldName === "country" || customType === "country") {
|
|
1310
|
+
return html `
|
|
1311
|
+
<coras-country-field
|
|
1312
|
+
name="${fieldName}"
|
|
1313
|
+
label="${fieldConfig.label}"
|
|
1314
|
+
value="${value}"
|
|
1315
|
+
help-text="${fieldConfig.helpText}"
|
|
1316
|
+
error="${error}"
|
|
1317
|
+
?validated=${validated}
|
|
1318
|
+
?has-error=${hasError}
|
|
1319
|
+
autocomplete="${fieldConfig.autocomplete}"
|
|
1320
|
+
assets-url="${this.assetsURL}"
|
|
1321
|
+
.countries=${this.countriesTask.value || []}
|
|
1322
|
+
@value-changed=${(event) => {
|
|
1323
|
+
event.stopPropagation();
|
|
1324
|
+
this.handleFormValueChange(fieldName, event.detail.value);
|
|
1325
|
+
}}
|
|
1326
|
+
></coras-country-field>
|
|
1327
|
+
`;
|
|
1328
|
+
}
|
|
1329
|
+
return html `
|
|
1330
|
+
<coras-field
|
|
1331
|
+
type="${fieldConfig.type}"
|
|
1332
|
+
autocomplete="${fieldConfig.autocomplete}"
|
|
1333
|
+
name="${fieldName}"
|
|
1334
|
+
label="${fieldConfig.label}"
|
|
1335
|
+
value="${value}"
|
|
1336
|
+
?validated=${validated}
|
|
1337
|
+
?error=${hasError}
|
|
1338
|
+
help-text=${suppressHelpText
|
|
1339
|
+
? ""
|
|
1340
|
+
: hasError
|
|
1341
|
+
? error
|
|
1342
|
+
: fieldConfig.helpText}
|
|
1343
|
+
placeholder="${fieldConfig.placeholder}"
|
|
1344
|
+
?borderless=${borderless}
|
|
1345
|
+
@value-changed=${(event) => {
|
|
1346
|
+
event.stopPropagation();
|
|
1347
|
+
this.handleFormValueChange(fieldName, event.detail.value);
|
|
1348
|
+
}}
|
|
1349
|
+
></coras-field>
|
|
1350
|
+
`;
|
|
1351
|
+
}
|
|
1352
|
+
renderPhoneField(fieldName) {
|
|
1353
|
+
const fieldConfig = FIELDS[fieldName];
|
|
1354
|
+
const error = this.formController.formErrors[fieldName] || "";
|
|
1355
|
+
const validated = this.flowController.submissionAttempts > 0;
|
|
1356
|
+
const hasError = validated && !!error;
|
|
1357
|
+
return html `
|
|
1358
|
+
<coras-phone-field
|
|
1359
|
+
.countries=${this.countriesTask.value || []}
|
|
1360
|
+
.selectedPhoneCode=${this.formController.selectedPhoneCode}
|
|
1361
|
+
value=${this.formController.getFieldValue(fieldName)}
|
|
1362
|
+
name=${fieldName}
|
|
1363
|
+
label=${fieldConfig.label()}
|
|
1364
|
+
placeholder=${fieldConfig.placeholder()}
|
|
1365
|
+
?validated=${validated}
|
|
1366
|
+
?error=${hasError}
|
|
1367
|
+
error-text=${hasError ? error : ""}
|
|
1368
|
+
help-text=${fieldConfig.helpText()}
|
|
1369
|
+
@value-changed=${(event) => {
|
|
1370
|
+
event.stopPropagation();
|
|
1371
|
+
this.handleFormValueChange(fieldName, event.detail.value);
|
|
1372
|
+
}}
|
|
1373
|
+
@phone-code-selected=${this.handlePhoneCodeSelection}
|
|
1374
|
+
></coras-phone-field>
|
|
1375
|
+
`;
|
|
1376
|
+
}
|
|
1377
|
+
renderPaymentTypeSelector() {
|
|
1378
|
+
const data = this.reservationsTask.value;
|
|
1379
|
+
const payWithTokens = String(this.getReservationsLoyaltyTotal("pay"));
|
|
1380
|
+
const earnWithTokens = String(this.getReservationsLoyaltyTotal("earn"));
|
|
1381
|
+
const price = convertToLocaleCurrency({
|
|
1382
|
+
value: data?.total_price || 0,
|
|
1383
|
+
locale: this.locale,
|
|
1384
|
+
currency: this.currency,
|
|
1385
|
+
isSmallestCurrencyUnit: true,
|
|
1386
|
+
});
|
|
1387
|
+
const disablePay = !this.loyaltyPoints || !this.cryptoRpc;
|
|
1388
|
+
const isLoggedIn = !!this.coinbaseSession;
|
|
1389
|
+
const isFullyAuthenticated = isLoggedIn && this.isMfaEnrolled;
|
|
1390
|
+
const balance = this.balanceTask.value;
|
|
1391
|
+
const hasBalance = balance != null;
|
|
1392
|
+
const formattedBalance = hasBalance ? this.formatTokenBalance(balance) : "";
|
|
1393
|
+
const currentBalance = Number(formattedBalance || 0);
|
|
1394
|
+
const fidaAmount = Number(payWithTokens || 0);
|
|
1395
|
+
const insufficientBalance = !hasBalance || balance === 0n || currentBalance < fidaAmount;
|
|
1396
|
+
return html `
|
|
1397
|
+
<coras-payment-type-selector
|
|
1398
|
+
.currency=${this.currency}
|
|
1399
|
+
pay-with-tokens=${payWithTokens}
|
|
1400
|
+
earn-with-tokens=${earnWithTokens}
|
|
1401
|
+
.price=${price}
|
|
1402
|
+
selected-type=${this.paymentType}
|
|
1403
|
+
selected-method=${this.paymentMethod}
|
|
1404
|
+
assets-url="${this.assetsURL}"
|
|
1405
|
+
?disable-pay=${disablePay}
|
|
1406
|
+
?apple-pay-available=${this.canMakePayment.applePay}
|
|
1407
|
+
?google-pay-available=${this.canMakePayment.googlePay}
|
|
1408
|
+
?loyalty-points=${this.loyaltyPoints}
|
|
1409
|
+
?logged-in=${isFullyAuthenticated}
|
|
1410
|
+
balance=${formattedBalance}
|
|
1411
|
+
?insufficient-balance=${insufficientBalance}
|
|
1412
|
+
@payment-type-selected=${this.handlePaymentTypeSelected}
|
|
1413
|
+
@payment-method-selected=${this.handlePaymentMethodSelected}
|
|
1414
|
+
></coras-payment-type-selector>
|
|
1415
|
+
`;
|
|
1416
|
+
}
|
|
1417
|
+
renderPaymentForm() {
|
|
1418
|
+
return html `
|
|
1419
|
+
<form id="form" @submit=${this.onFormSubmit}>
|
|
1420
|
+
${this.renderContactDetailsEditable()}
|
|
1421
|
+
<hr class="section-divider" />
|
|
1422
|
+
${this.renderActivityDetails()} ${this.renderPaymentTypeSelector()}
|
|
1423
|
+
${this.renderPaymentDetailsStep()}
|
|
1424
|
+
</form>
|
|
1425
|
+
${this.renderCryptoAuthModalElement()}
|
|
1426
|
+
`;
|
|
1427
|
+
}
|
|
1428
|
+
getShortestExpirationSeconds() {
|
|
1429
|
+
return getShortestExpirationSeconds(this.reservationsTask.value?.reservations);
|
|
1430
|
+
}
|
|
1431
|
+
getTotalQuantity() {
|
|
1432
|
+
return getTotalQuantity(this.reservationsTask.value?.reservations);
|
|
1433
|
+
}
|
|
1434
|
+
getTotalPriceFormatted() {
|
|
1435
|
+
const taskValue = this.reservationsTask.value;
|
|
1436
|
+
const data = taskValue && "reservations" in taskValue ? taskValue : undefined;
|
|
1437
|
+
const price = getTotalPrice(data);
|
|
1438
|
+
return convertToLocaleCurrency({
|
|
1439
|
+
value: price,
|
|
1440
|
+
locale: this.locale,
|
|
1441
|
+
currency: this.currency,
|
|
1442
|
+
});
|
|
1443
|
+
}
|
|
1444
|
+
renderContent() {
|
|
1445
|
+
if (this.paymentSuccessful) {
|
|
1446
|
+
return this.renderSuccess();
|
|
1447
|
+
}
|
|
1448
|
+
if (this.paymentFailed) {
|
|
1449
|
+
return this.renderFailure();
|
|
1450
|
+
}
|
|
1451
|
+
return this.configTask.render({
|
|
1452
|
+
initial: () => html `<div class="loading">${msg("Loading...")}</div>`,
|
|
1453
|
+
pending: () => html `<div class="loading">${msg("Loading...")}</div>`,
|
|
1454
|
+
error: () => {
|
|
1455
|
+
this.showErrorModalOnce();
|
|
1456
|
+
return html ``;
|
|
1457
|
+
},
|
|
1458
|
+
complete: () => this.renderReservationsTask(),
|
|
1459
|
+
});
|
|
1460
|
+
}
|
|
1461
|
+
getLoyaltyAccountUrl() {
|
|
1462
|
+
if (!this.loyaltyPageUrl)
|
|
1463
|
+
return "#";
|
|
1464
|
+
const base = this.loyaltyPageUrl.replace(/\/+$/, "");
|
|
1465
|
+
return `${base}/${this.locale}/${this.currency}`;
|
|
1466
|
+
}
|
|
1467
|
+
renderSuccess() {
|
|
1468
|
+
const tokens = this.formatEarnedTokens();
|
|
1469
|
+
return html `
|
|
1470
|
+
<div class="confirmation-container">
|
|
1471
|
+
<coras-confirmation
|
|
1472
|
+
referenceId="${this.referenceId || this.transactionId}"
|
|
1473
|
+
userEmail="${this.userEmail}"
|
|
1474
|
+
locale="${this.locale}"
|
|
1475
|
+
.reservations="${this.reservationsTask.value?.reservations || []}"
|
|
1476
|
+
?loyalty="${this.paymentType === "crypto"}"
|
|
1477
|
+
></coras-confirmation>
|
|
1478
|
+
${this.loyaltyPoints && tokens
|
|
1479
|
+
? html `<div class="collect-fida-container">
|
|
1480
|
+
<coras-collect-fida
|
|
1481
|
+
tokens="${tokens}"
|
|
1482
|
+
account-url="${this.getLoyaltyAccountUrl()}"
|
|
1483
|
+
assets-url="${this.assetsURL}"
|
|
1484
|
+
></coras-collect-fida>
|
|
1485
|
+
</div>`
|
|
1486
|
+
: nothing}
|
|
1487
|
+
</div>
|
|
1488
|
+
`;
|
|
1489
|
+
}
|
|
1490
|
+
renderFailure() {
|
|
1491
|
+
return html `
|
|
1492
|
+
<div class="payment-error-container">
|
|
1493
|
+
<coras-alert
|
|
1494
|
+
variant="error"
|
|
1495
|
+
title="${msg("Sorry, your order was not successful")}"
|
|
1496
|
+
assets-url="${this.assetsURL}"
|
|
1497
|
+
>
|
|
1498
|
+
${msg("Your card has not been charged. If you want to try again, please click the button to go back to the same event")}
|
|
1499
|
+
<coras-button
|
|
1500
|
+
slot="action-below"
|
|
1501
|
+
@click=${this.handleTryAgain}
|
|
1502
|
+
data-testid="try-again"
|
|
1503
|
+
>
|
|
1504
|
+
${msg("Try again")}
|
|
1505
|
+
</coras-button>
|
|
1506
|
+
</coras-alert>
|
|
1507
|
+
</div>
|
|
1508
|
+
`;
|
|
1509
|
+
}
|
|
1510
|
+
renderReservationsTask() {
|
|
1511
|
+
// The check task gates the form: it surfaces API failures and supplies the
|
|
1512
|
+
// field requirements. Basket emptiness, though, is decided by the actual
|
|
1513
|
+
// reservations below — the check response only carries requirements, and a
|
|
1514
|
+
// basket of plain tickets returns no per-reservation entries.
|
|
1515
|
+
return this.reservationsCheckTask.render({
|
|
1516
|
+
pending: () => html `<div class="loading">${msg("Loading...")}</div>`,
|
|
1517
|
+
error: () => {
|
|
1518
|
+
this.showErrorModalOnce();
|
|
1519
|
+
return html ``;
|
|
1520
|
+
},
|
|
1521
|
+
complete: () => this.renderReservations(),
|
|
1522
|
+
});
|
|
1523
|
+
}
|
|
1524
|
+
renderReservations() {
|
|
1525
|
+
return this.reservationsTask.render({
|
|
1526
|
+
pending: () => html `<div class="loading">${msg("Loading...")}</div>`,
|
|
1527
|
+
complete: (data) => {
|
|
1528
|
+
// Nothing to check out: real customers are guided back to browse;
|
|
1529
|
+
// the branding preview renders the full form (with Pay now disabled).
|
|
1530
|
+
const hasCheckout = (data?.reservations?.length ?? 0) > 0;
|
|
1531
|
+
if (!hasCheckout && !this.preview) {
|
|
1532
|
+
return this.renderEmptyBasket();
|
|
1533
|
+
}
|
|
1534
|
+
return html `
|
|
1535
|
+
<div class="payment-form-container">${this.renderPaymentForm()}</div>
|
|
1536
|
+
`;
|
|
1537
|
+
},
|
|
1538
|
+
});
|
|
1539
|
+
}
|
|
1540
|
+
renderEmptyBasket() {
|
|
1541
|
+
return html `
|
|
1542
|
+
<div class="empty-basket-state">
|
|
1543
|
+
<coras-icon
|
|
1544
|
+
icon="shopping-basket"
|
|
1545
|
+
assets-url="${this.assetsURL}"
|
|
1546
|
+
></coras-icon>
|
|
1547
|
+
<h2>${msg("Your basket is empty")}</h2>
|
|
1548
|
+
<p>${msg("Add tickets to your basket to check out.")}</p>
|
|
1549
|
+
<coras-button
|
|
1550
|
+
variant="primary"
|
|
1551
|
+
data-testid="browse-events"
|
|
1552
|
+
@click=${() => this.dispatchPageUpdate({ page: "landing" })}
|
|
1553
|
+
>
|
|
1554
|
+
${msg("Browse events")}
|
|
1555
|
+
</coras-button>
|
|
1556
|
+
</div>
|
|
1557
|
+
`;
|
|
1558
|
+
}
|
|
1559
|
+
renderBottomDrawer() {
|
|
1560
|
+
if (this.paymentSuccessful || this.paymentFailed)
|
|
1561
|
+
return nothing;
|
|
1562
|
+
return html `
|
|
1563
|
+
<coras-bottom-drawer
|
|
1564
|
+
.open=${!this.layoutController.isBasketVisible}
|
|
1565
|
+
style="--bottom-drawer-padding-inline: 1rem; --bottom-drawer-padding-block: 1rem;"
|
|
1566
|
+
>
|
|
1567
|
+
<div class="drawer-collapsed-content">
|
|
1568
|
+
${this.renderMobileCollapsedContent()}
|
|
1569
|
+
</div>
|
|
1570
|
+
<div class="drawer-expanded-content">
|
|
1571
|
+
<coras-basket expanded></coras-basket>
|
|
1572
|
+
</div>
|
|
1573
|
+
</coras-bottom-drawer>
|
|
1574
|
+
`;
|
|
1575
|
+
}
|
|
1576
|
+
renderMobileCollapsedContent() {
|
|
1577
|
+
return html `
|
|
1578
|
+
${this.renderExpirationTimer()} ${this.renderMobileBasketSummary()}
|
|
1579
|
+
`;
|
|
1580
|
+
}
|
|
1581
|
+
renderExpirationTimer() {
|
|
1582
|
+
const exp = this.getShortestExpirationSeconds();
|
|
1583
|
+
if (exp <= 0)
|
|
1584
|
+
return nothing;
|
|
1585
|
+
return html `<div class="mobile-expiration-timer">
|
|
1586
|
+
<coras-expiration-timer
|
|
1587
|
+
assets-url="${this.assetsURL}"
|
|
1588
|
+
expiration-time="${exp}"
|
|
1589
|
+
></coras-expiration-timer>
|
|
1590
|
+
</div>`;
|
|
1591
|
+
}
|
|
1592
|
+
renderMobileBasketSummary() {
|
|
1593
|
+
return html `
|
|
1594
|
+
<div class="mobile-basket-summary">
|
|
1595
|
+
<div class="left">
|
|
1596
|
+
<span class="label">${msg("Total")}</span>
|
|
1597
|
+
<span class="value">${this.getTotalPriceFormatted()}</span>
|
|
1598
|
+
</div>
|
|
1599
|
+
<div class="right">
|
|
1600
|
+
<coras-icon
|
|
1601
|
+
icon="shopping-basket"
|
|
1602
|
+
assets-url="${this.assetsURL}"
|
|
1603
|
+
></coras-icon>
|
|
1604
|
+
<span class="count">(${this.getTotalQuantity()})</span>
|
|
1605
|
+
</div>
|
|
1606
|
+
</div>
|
|
1607
|
+
`;
|
|
1608
|
+
}
|
|
1609
|
+
/**
|
|
1610
|
+
* Gets the full phone number from the payment form contact details.
|
|
1611
|
+
* Returns the E.164 formatted phone or null if not available.
|
|
1612
|
+
*/
|
|
1613
|
+
getFormPhoneNumber() {
|
|
1614
|
+
const phoneCode = this.formController.selectedPhoneCode?.phoneCode;
|
|
1615
|
+
const phoneNumber = this.formController.formValues.phone;
|
|
1616
|
+
if (!phoneCode || !phoneNumber) {
|
|
1617
|
+
return null;
|
|
1618
|
+
}
|
|
1619
|
+
const cleanNumber = phoneNumber
|
|
1620
|
+
.replace(/^[+0]+/, "")
|
|
1621
|
+
.replace(/[\s\-()]/g, "");
|
|
1622
|
+
return `+${phoneCode}${cleanNumber}`;
|
|
1623
|
+
}
|
|
1624
|
+
recoverPendingTransfer() {
|
|
1625
|
+
return this.cryptoTransferController.recoverPendingTransfer();
|
|
1626
|
+
}
|
|
1627
|
+
/**
|
|
1628
|
+
* Renders the OTP verification modal for crypto payments
|
|
1629
|
+
*/
|
|
1630
|
+
renderTransferModal() {
|
|
1631
|
+
if (!this.cryptoTransferController.showTransferModal)
|
|
1632
|
+
return nothing;
|
|
1633
|
+
const formPhone = this.getFormPhoneNumber();
|
|
1634
|
+
const maskedPhone = formPhone ? `******${formPhone.slice(-4)}` : "";
|
|
1635
|
+
return html `
|
|
1636
|
+
<coras-transfer-modal
|
|
1637
|
+
?open=${this.cryptoTransferController.showTransferModal}
|
|
1638
|
+
amount=${this.pendingTransferAmount}
|
|
1639
|
+
masked-phone=${maskedPhone}
|
|
1640
|
+
modal-state=${this.cryptoTransferController.transferModalState}
|
|
1641
|
+
mfa-error=${this.cryptoTransferController.mfaVerificationError}
|
|
1642
|
+
?mfa-loading=${this.cryptoTransferController.mfaVerificationLoading}
|
|
1643
|
+
locale=${this.locale}
|
|
1644
|
+
assets-url=${this.assetsURL}
|
|
1645
|
+
@transfer-cancelled=${this.handleTransferCancelled}
|
|
1646
|
+
@mfa-code-submitted=${this.handleMfaCodeSubmitted}
|
|
1647
|
+
@mfa-resend-requested=${this.handleMfaResendRequested}
|
|
1648
|
+
></coras-transfer-modal>
|
|
1649
|
+
`;
|
|
1650
|
+
}
|
|
1651
|
+
render() {
|
|
1652
|
+
return html `
|
|
1653
|
+
<coras-layout with-basket>
|
|
1654
|
+
<slot name="navbar" slot="navbar"></slot>
|
|
1655
|
+
<div class="content">
|
|
1656
|
+
${this.renderContent()}
|
|
1657
|
+
${this.paymentSuccessful || this.paymentFailed
|
|
1658
|
+
? nothing
|
|
1659
|
+
: html `<coras-basket></coras-basket>`}
|
|
1660
|
+
</div>
|
|
1661
|
+
${this.renderErrorModal({
|
|
1662
|
+
assetsURL: this.assetsURL,
|
|
1663
|
+
buttonLabel: msg("Refresh the page"),
|
|
1664
|
+
onRetry: () => this.reservationsCheckTask.run(),
|
|
1665
|
+
onHelp: () => this.dispatchPageUpdate({ page: "help" }),
|
|
1666
|
+
})}
|
|
1667
|
+
${this.renderBottomDrawer()} ${this.renderTransferModal()}
|
|
1668
|
+
<slot name="footer" slot="footer"></slot>
|
|
1669
|
+
</coras-layout>
|
|
1670
|
+
`;
|
|
1671
|
+
}
|
|
1672
|
+
};
|
|
1673
|
+
__decorate([
|
|
1674
|
+
state()
|
|
1675
|
+
], CorasPaymentPage.prototype, "stripeKey", void 0);
|
|
1676
|
+
__decorate([
|
|
1677
|
+
property({ attribute: false })
|
|
1678
|
+
], CorasPaymentPage.prototype, "metadata", void 0);
|
|
1679
|
+
__decorate([
|
|
1680
|
+
property({ type: Boolean })
|
|
1681
|
+
], CorasPaymentPage.prototype, "preview", void 0);
|
|
1682
|
+
__decorate([
|
|
1683
|
+
state()
|
|
1684
|
+
], CorasPaymentPage.prototype, "cdpProjectId", void 0);
|
|
1685
|
+
__decorate([
|
|
1686
|
+
consume({ context: currentPageContext })
|
|
1687
|
+
], CorasPaymentPage.prototype, "currentPage", void 0);
|
|
1688
|
+
__decorate([
|
|
1689
|
+
query("coras-stripe")
|
|
1690
|
+
], CorasPaymentPage.prototype, "stripeComponent", void 0);
|
|
1691
|
+
__decorate([
|
|
1692
|
+
state()
|
|
1693
|
+
], CorasPaymentPage.prototype, "showCryptoAuthModal", void 0);
|
|
1694
|
+
__decorate([
|
|
1695
|
+
state()
|
|
1696
|
+
], CorasPaymentPage.prototype, "transactionId", void 0);
|
|
1697
|
+
__decorate([
|
|
1698
|
+
state()
|
|
1699
|
+
], CorasPaymentPage.prototype, "userId", void 0);
|
|
1700
|
+
__decorate([
|
|
1701
|
+
state()
|
|
1702
|
+
], CorasPaymentPage.prototype, "referenceId", void 0);
|
|
1703
|
+
__decorate([
|
|
1704
|
+
state()
|
|
1705
|
+
], CorasPaymentPage.prototype, "earnedTokensToIssue", void 0);
|
|
1706
|
+
__decorate([
|
|
1707
|
+
state()
|
|
1708
|
+
], CorasPaymentPage.prototype, "canMakePayment", void 0);
|
|
1709
|
+
__decorate([
|
|
1710
|
+
state()
|
|
1711
|
+
], CorasPaymentPage.prototype, "paymentType", void 0);
|
|
1712
|
+
__decorate([
|
|
1713
|
+
state()
|
|
1714
|
+
], CorasPaymentPage.prototype, "paymentMethod", void 0);
|
|
1715
|
+
__decorate([
|
|
1716
|
+
state()
|
|
1717
|
+
], CorasPaymentPage.prototype, "paymentSuccessful", void 0);
|
|
1718
|
+
__decorate([
|
|
1719
|
+
state()
|
|
1720
|
+
], CorasPaymentPage.prototype, "paymentFailed", void 0);
|
|
1721
|
+
__decorate([
|
|
1722
|
+
state()
|
|
1723
|
+
], CorasPaymentPage.prototype, "loyaltyPageUrl", void 0);
|
|
1724
|
+
__decorate([
|
|
1725
|
+
state()
|
|
1726
|
+
], CorasPaymentPage.prototype, "userEmail", void 0);
|
|
1727
|
+
__decorate([
|
|
1728
|
+
query("coras-layout")
|
|
1729
|
+
], CorasPaymentPage.prototype, "layoutElement", void 0);
|
|
1730
|
+
CorasPaymentPage = __decorate([
|
|
1731
|
+
localized()
|
|
1732
|
+
], CorasPaymentPage);
|
|
1733
|
+
export { CorasPaymentPage };
|