@coras-io/embed 0.5.1 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/README.md +15 -2
- package/dist/components/accordion/accordion-item/accordion-item.component.js +9 -3
- package/dist/components/accordion/accordion-item/accordion-item.styles.js +4 -0
- package/dist/components/accordion/accordion.component.js +8 -0
- package/dist/components/alert/alert.component.d.ts +1 -1
- package/dist/components/alert/alert.component.js +4 -3
- package/dist/components/attraction-card/base/attraction-card.mixin.d.ts +0 -2
- package/dist/components/attraction-card/base/attraction-card.mixin.js +0 -6
- package/dist/components/attraction-card/base/attraction-card.types.d.ts +0 -1
- package/dist/components/basket-mobile/basket-mobile.component.d.ts +14 -3
- package/dist/components/basket-mobile/basket-mobile.component.js +71 -15
- package/dist/components/better-carousel/better-carousel.component.d.ts +3 -5
- package/dist/components/better-carousel/better-carousel.component.js +13 -34
- package/dist/components/breadcrumbs/breadcrumb-item/breadcrumb-item.component.js +5 -12
- package/dist/components/breadcrumbs/breadcrumb-item/breadcrumb-item.styles.js +13 -5
- package/dist/components/breadcrumbs/breadcrumbs.component.d.ts +0 -1
- package/dist/components/breadcrumbs/breadcrumbs.component.js +5 -8
- package/dist/components/breadcrumbs/breadcrumbs.styles.js +8 -2
- package/dist/components/button/button.constants.d.ts +1 -2
- package/dist/components/button/button.constants.js +0 -1
- package/dist/components/calendar/base/calendar.mixin.js +5 -1
- package/dist/components/calendar/multi/multi.component.d.ts +2 -2
- package/dist/components/calendar/multi/multi.component.js +12 -19
- package/dist/components/carousel/carousel.component.js +9 -2
- package/dist/components/categories-tree/categories-tree.component.d.ts +5 -3
- package/dist/components/categories-tree/categories-tree.component.js +22 -21
- package/dist/components/checkbox/checkbox.component.js +5 -1
- package/dist/components/checkbox-group/checkbox-group.component.js +1 -1
- package/dist/components/checkbox-group/checkbox-group.styles.js +1 -1
- package/dist/components/chip/chip.component.js +8 -3
- package/dist/components/crypto-auth-modal/crypto-auth-modal.component.d.ts +6 -0
- package/dist/components/crypto-auth-modal/crypto-auth-modal.component.js +15 -1
- package/dist/components/currencies-list/currencies-list.component.js +0 -1
- package/dist/components/dialog/dialog.component.js +52 -21
- package/dist/components/drawer/drawer.component.d.ts +3 -2
- package/dist/components/drawer/drawer.component.js +13 -18
- package/dist/components/drawer/drawer.styles.js +5 -2
- package/dist/components/dropdown/dropdown.component.js +6 -9
- package/dist/components/expiration-timer/expiration-timer.component.d.ts +2 -3
- package/dist/components/expiration-timer/expiration-timer.component.js +10 -8
- package/dist/components/explore-card/explore-card.component.js +3 -1
- package/dist/components/explore-card/explore-card.styles.js +31 -0
- package/dist/components/filters-drawer/filters-drawer.component.js +1 -1
- package/dist/components/flag-icon/flag-icon.component.d.ts +4 -2
- package/dist/components/flag-icon/flag-icon.component.js +16 -4
- package/dist/components/icon/icon.component.js +15 -2
- package/dist/components/image/image.component.js +4 -3
- package/dist/components/image-viewer/image-viewer.component.js +6 -4
- package/dist/components/input-field/input-field.component.js +10 -6
- package/dist/components/layout/layout.styles.js +1 -1
- package/dist/components/locales-list/locales-list.component.js +0 -1
- package/dist/components/location-image/location-image.component.d.ts +4 -4
- package/dist/components/location-image/location-image.component.js +6 -7
- package/dist/components/locations-results/locations-results.component.d.ts +10 -0
- package/dist/components/locations-results/locations-results.component.js +22 -15
- package/dist/components/locations-results/locations-results.styles.js +4 -1
- package/dist/components/message-card/message-card.component.d.ts +1 -1
- package/dist/components/message-card/message-card.component.js +4 -3
- package/dist/components/mobile-menu-item/mobile-menu-item.component.d.ts +0 -1
- package/dist/components/mobile-menu-item/mobile-menu-item.component.js +14 -16
- package/dist/components/mobile-menu-item/mobile-menu-item.styles.js +9 -5
- package/dist/components/option-group/option-chip/option-chip.component.d.ts +4 -1
- package/dist/components/option-group/option-chip/option-chip.component.js +23 -10
- package/dist/components/option-group/option-group.component.d.ts +3 -1
- package/dist/components/option-group/option-group.component.js +10 -3
- package/dist/components/overlay/overlay.component.d.ts +0 -5
- package/dist/components/overlay/overlay.component.js +3 -15
- package/dist/components/phone-country-code/phone-country-code.component.d.ts +4 -0
- package/dist/components/phone-country-code/phone-country-code.component.js +37 -0
- package/dist/components/phone-country-codes/phone-country-codes.component.js +1 -1
- package/dist/components/phone-field/phone-field.component.js +2 -2
- package/dist/components/search-button/search-button.component.d.ts +1 -1
- package/dist/components/search-button/search-button.component.js +13 -7
- package/dist/components/seated-selector/seated-selector.component.js +3 -3
- package/dist/components/seats-io/seats-io.component.d.ts +3 -2
- package/dist/components/seats-io/seats-io.component.js +31 -13
- package/dist/components/seats-io/seats-io.constants.d.ts +0 -2
- package/dist/components/seats-io/seats-io.constants.js +0 -3
- package/dist/components/seats-io/seats-io.transform.d.ts +1 -6
- package/dist/components/seats-io/seats-io.transform.js +1 -20
- package/dist/components/select-list/select-list.component.js +7 -2
- package/dist/components/select-list/select-option/select-option.component.d.ts +3 -1
- package/dist/components/select-list/select-option/select-option.component.js +10 -3
- package/dist/components/tabs/tabs.component.d.ts +2 -0
- package/dist/components/tabs/tabs.component.js +59 -5
- package/dist/components/time-tag/time-tag.component.js +1 -1
- package/dist/containers/basket/basket.component.d.ts +1 -1
- package/dist/containers/basket/basket.component.js +21 -20
- package/dist/containers/navbar/navbar.component.d.ts +12 -8
- package/dist/containers/navbar/navbar.component.js +108 -62
- package/dist/containers/navbar/navbar.styles.js +23 -5
- package/dist/containers/navbar/navbar.utils.js +4 -4
- package/dist/contexts/basket/basket.provider.d.ts +3 -4
- package/dist/contexts/basket/basket.provider.js +46 -61
- package/dist/contexts/basket/basket.types.d.ts +0 -2
- package/dist/controllers/time-expiration.d.ts +15 -2
- package/dist/controllers/time-expiration.js +47 -17
- package/dist/core/api/client.d.ts +9 -0
- package/dist/core/api/client.js +26 -0
- package/dist/core/api/middlewares/booking-session/booking-session.constants.d.ts +0 -2
- package/dist/core/api/middlewares/booking-session/booking-session.constants.js +0 -2
- package/dist/core/api/middlewares/booking-session/booking-session.js +3 -12
- package/dist/core/api/middlewares/booking-session/booking-session.utils.d.ts +0 -1
- package/dist/core/api/middlewares/booking-session/booking-session.utils.js +6 -28
- package/dist/core/api/middlewares/error-handler/error-handler.js +5 -1
- package/dist/core/api/middlewares/retry/retry.constants.d.ts +3 -0
- package/dist/core/api/middlewares/retry/retry.constants.js +7 -0
- package/dist/core/api/middlewares/retry/retry.d.ts +2 -0
- package/dist/core/api/middlewares/retry/retry.js +48 -0
- package/dist/core/api/queries.d.ts +13 -38
- package/dist/core/api/queries.js +16 -99
- package/dist/core/events.d.ts +2 -4
- package/dist/core/i18n/date.d.ts +14 -5
- package/dist/core/i18n/date.js +47 -20
- package/dist/core/i18n/localization.js +10 -3
- package/dist/core/images/helpers.js +6 -5
- package/dist/core/images/srcset.js +2 -2
- package/dist/core/logger.d.ts +17 -0
- package/dist/core/logger.js +13 -0
- package/dist/core/types/api-schema.d.ts +7872 -0
- package/dist/core/types/seats-config.d.ts +5 -4
- package/dist/core/types/seats-config.js +10 -3
- package/dist/core/utils/crypto-address.d.ts +12 -0
- package/dist/core/utils/crypto-address.js +17 -0
- package/dist/core/utils/datetime.d.ts +13 -11
- package/dist/core/utils/datetime.js +41 -51
- package/dist/core/utils/loyalty.d.ts +8 -0
- package/dist/core/utils/loyalty.js +10 -0
- package/dist/core/utils/redaction.d.ts +9 -0
- package/dist/core/utils/redaction.js +58 -0
- package/dist/core/utils/time.js +2 -3
- package/dist/helpers/helpers.d.ts +6 -0
- package/dist/helpers/helpers.js +33 -16
- package/dist/locales/ar-SA.d.ts +38 -21
- package/dist/locales/ar-SA.js +38 -21
- package/dist/locales/da-DK.d.ts +38 -21
- package/dist/locales/da-DK.js +38 -21
- package/dist/locales/de-DE.d.ts +38 -21
- package/dist/locales/de-DE.js +38 -21
- package/dist/locales/en-IE.d.ts +38 -21
- package/dist/locales/en-IE.js +38 -21
- package/dist/locales/en-US.d.ts +38 -21
- package/dist/locales/en-US.js +38 -21
- package/dist/locales/es-ES.d.ts +38 -21
- package/dist/locales/es-ES.js +38 -21
- package/dist/locales/fr-FR.d.ts +38 -21
- package/dist/locales/fr-FR.js +38 -21
- package/dist/locales/fr-MA.d.ts +38 -21
- package/dist/locales/fr-MA.js +38 -21
- package/dist/locales/is-IS.d.ts +38 -21
- package/dist/locales/is-IS.js +38 -21
- package/dist/locales/it-IT.d.ts +38 -21
- package/dist/locales/it-IT.js +38 -21
- package/dist/locales/ms-MY.d.ts +38 -21
- package/dist/locales/ms-MY.js +38 -21
- package/dist/locales/nb-NO.d.ts +38 -21
- package/dist/locales/nb-NO.js +38 -21
- package/dist/locales/pl-PL.d.ts +38 -21
- package/dist/locales/pl-PL.js +38 -21
- package/dist/locales/pt-PT.d.ts +38 -21
- package/dist/locales/pt-PT.js +38 -21
- package/dist/locales/sv-SE.d.ts +38 -21
- package/dist/locales/sv-SE.js +38 -21
- package/dist/locales/th-TH.d.ts +38 -21
- package/dist/locales/th-TH.js +38 -21
- package/dist/locales/tr-TR.d.ts +38 -21
- package/dist/locales/tr-TR.js +38 -21
- package/dist/locales/zh-CN.d.ts +38 -21
- package/dist/locales/zh-CN.js +38 -21
- package/dist/locales/zh-HK.d.ts +38 -21
- package/dist/locales/zh-HK.js +38 -21
- package/dist/mixins/base.mixin.d.ts +3 -1
- package/dist/mixins/base.mixin.js +10 -7
- package/dist/mixins/coinbase.mixin.d.ts +13 -17
- package/dist/mixins/coinbase.mixin.js +251 -288
- package/dist/mixins/error-modal.mixin.js +8 -4
- package/dist/mixins/location-search/location-search.d.ts +13 -1
- package/dist/mixins/location-search/location-search.js +35 -27
- package/dist/mixins/overlay/overlay-mixin.js +39 -3
- package/dist/mixins/overlay/types.d.ts +1 -0
- package/dist/mixins/search-mixin/search-mixin.js +8 -5
- package/dist/sdk/diagnostics.js +2 -0
- package/dist/sdk/mount.d.ts +10 -0
- package/dist/sdk/mount.js +20 -1
- package/dist/sdk/page-registry.js +5 -0
- package/dist/sdk/params.d.ts +53 -0
- package/dist/sdk/params.js +180 -0
- package/dist/sdk/redaction.d.ts +1 -4
- package/dist/sdk/redaction.js +2 -41
- package/dist/sdk/types.d.ts +21 -7
- package/dist/sdk/url.d.ts +1 -1
- package/dist/sdk/url.js +12 -5
- package/dist/sdk/validation.d.ts +1 -26
- package/dist/sdk/validation.js +8 -145
- package/dist/styles/tokens.d.ts +1 -1
- package/dist/styles/tokens.generated.d.ts +1 -1
- package/dist/styles/tokens.generated.js +1 -1
- package/dist/views/chrome-only-page/chrome-only-page.component.d.ts +30 -0
- package/dist/views/chrome-only-page/chrome-only-page.component.js +24 -0
- package/dist/views/chrome-only-page/chrome-only-page.d.ts +8 -0
- package/dist/views/chrome-only-page/chrome-only-page.js +6 -0
- package/dist/views/chrome-only-page/chrome-only-page.styles.js +13 -0
- package/dist/views/details-page/details-page.component.d.ts +11 -4
- package/dist/views/details-page/details-page.component.js +263 -237
- package/dist/views/details-page/details-page.utilts.d.ts +63 -3
- package/dist/views/details-page/details-page.utilts.js +53 -5
- package/dist/views/details-page/partials/location-categories/location-categories.component.d.ts +29 -0
- package/dist/views/details-page/partials/location-categories/location-categories.component.js +149 -0
- package/dist/views/details-page/partials/location-categories/location-categories.d.ts +8 -0
- package/dist/views/details-page/partials/location-categories/location-categories.js +6 -0
- package/dist/views/details-page/partials/location-categories/location-categories.styles.js +35 -0
- package/dist/views/details-page/partials/location-highlights/location-highlights.component.d.ts +26 -0
- package/dist/views/details-page/partials/location-highlights/location-highlights.component.js +158 -0
- package/dist/views/details-page/partials/location-highlights/location-highlights.d.ts +8 -0
- package/dist/views/details-page/partials/location-highlights/location-highlights.js +6 -0
- package/dist/views/details-page/partials/location-highlights/location-highlights.styles.js +42 -0
- package/dist/views/details-page/partials/tour-description/tour-description.component.js +1 -4
- package/dist/views/help-page/help-page.component.d.ts +2 -0
- package/dist/views/help-page/help-page.component.js +37 -18
- package/dist/views/help-page/help-page.utils.js +6 -5
- package/dist/views/landing-page/landing-page.component.d.ts +5 -8
- package/dist/views/landing-page/landing-page.component.js +82 -97
- package/dist/views/payment-page/controllers/crypto-auth.controller.d.ts +10 -4
- package/dist/views/payment-page/controllers/crypto-auth.controller.js +53 -31
- package/dist/views/payment-page/controllers/crypto-transfer.controller.d.ts +9 -5
- package/dist/views/payment-page/controllers/crypto-transfer.controller.js +26 -39
- package/dist/views/payment-page/controllers/payment-flow.controller.d.ts +6 -1
- package/dist/views/payment-page/controllers/payment-flow.controller.js +1 -0
- package/dist/views/payment-page/controllers/stripe-payment.controller.d.ts +20 -2
- package/dist/views/payment-page/controllers/stripe-payment.controller.js +42 -19
- package/dist/views/payment-page/partials/activity-details/activity-details.component.d.ts +2 -0
- package/dist/views/payment-page/partials/activity-details/activity-details.component.js +6 -3
- package/dist/views/payment-page/partials/billing-address/billing-address.component.d.ts +2 -0
- package/dist/views/payment-page/partials/billing-address/billing-address.component.js +5 -1
- package/dist/views/payment-page/partials/confirmation/confirmation.component.js +2 -3
- package/dist/views/payment-page/partials/country-field/country-field.component.js +1 -1
- package/dist/views/payment-page/partials/payment-type-selector/payment-type-selector.component.js +3 -3
- package/dist/views/payment-page/partials/stripe/stripe.component.d.ts +2 -0
- package/dist/views/payment-page/partials/stripe/stripe.component.js +36 -7
- package/dist/views/payment-page/partials/stripe/stripe.utils.js +0 -3
- package/dist/views/payment-page/payment-page.component.d.ts +39 -6
- package/dist/views/payment-page/payment-page.component.js +302 -178
- package/dist/views/payment-page/payment-page.constants.d.ts +1 -27
- package/dist/views/payment-page/payment-page.constants.js +3 -30
- package/dist/views/payment-page/payment-page.types.d.ts +1 -19
- package/dist/views/payment-page/payment-page.utils.d.ts +22 -13
- package/dist/views/payment-page/payment-page.utils.js +57 -75
- package/dist/views/payment-page/services/payment-api.service.d.ts +16 -34
- package/dist/views/payment-page/services/payment-api.service.js +19 -27
- package/dist/views/search-page/search-page.component.d.ts +2 -0
- package/dist/views/search-page/search-page.component.js +39 -20
- package/dist/views/suggestion-widget/suggestion-widget.component.d.ts +1 -0
- package/dist/views/suggestion-widget/suggestion-widget.component.js +6 -5
- package/package.json +24 -20
- package/dist/components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.component.d.ts +0 -10
- package/dist/components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.component.js +0 -43
- package/dist/components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.d.ts +0 -8
- package/dist/components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.js +0 -6
- package/dist/components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.styles.js +0 -23
- package/dist/components/attraction-discovery/attraction-discovery.component.d.ts +0 -10
- package/dist/components/attraction-discovery/attraction-discovery.component.js +0 -52
- package/dist/components/attraction-discovery/attraction-discovery.constants.d.ts +0 -4
- package/dist/components/attraction-discovery/attraction-discovery.constants.js +0 -5
- package/dist/components/attraction-discovery/attraction-discovery.d.ts +0 -8
- package/dist/components/attraction-discovery/attraction-discovery.js +0 -6
- package/dist/components/attraction-discovery/attraction-discovery.styles.js +0 -193
- package/dist/components/basket-rewards/basket-rewards.component.d.ts +0 -10
- package/dist/components/basket-rewards/basket-rewards.component.js +0 -52
- package/dist/components/basket-rewards/basket-rewards.d.ts +0 -8
- package/dist/components/basket-rewards/basket-rewards.js +0 -6
- package/dist/components/basket-rewards/basket-rewards.styles.js +0 -18
- package/dist/components/filter-chip/filter-chip.component.d.ts +0 -12
- package/dist/components/filter-chip/filter-chip.component.js +0 -68
- package/dist/components/filter-chip/filter-chip.constants.d.ts +0 -2
- package/dist/components/filter-chip/filter-chip.constants.js +0 -2
- package/dist/components/filter-chip/filter-chip.d.ts +0 -8
- package/dist/components/filter-chip/filter-chip.js +0 -6
- package/dist/components/filter-chip/filter-chip.styles.d.ts +0 -2
- package/dist/components/filter-chip/filter-chip.styles.js +0 -162
- package/dist/components/image-carousel/image-carousel-item/image-carousel-item.component.d.ts +0 -10
- package/dist/components/image-carousel/image-carousel-item/image-carousel-item.component.js +0 -43
- package/dist/components/image-carousel/image-carousel-item/image-carousel-item.d.ts +0 -8
- package/dist/components/image-carousel/image-carousel-item/image-carousel-item.js +0 -6
- package/dist/components/image-carousel/image-carousel-item/image-carousel-item.styles.d.ts +0 -2
- package/dist/components/image-carousel/image-carousel-item/image-carousel-item.styles.js +0 -28
- package/dist/components/image-carousel/image-carousel.component.d.ts +0 -8
- package/dist/components/image-carousel/image-carousel.component.js +0 -36
- package/dist/components/image-carousel/image-carousel.d.ts +0 -8
- package/dist/components/image-carousel/image-carousel.js +0 -6
- package/dist/components/image-carousel/image-carousel.styles.d.ts +0 -2
- package/dist/components/image-carousel/image-carousel.styles.js +0 -72
- package/dist/components/itinerary/itinerary-item/itinerary-item.component.d.ts +0 -9
- package/dist/components/itinerary/itinerary-item/itinerary-item.component.js +0 -45
- package/dist/components/itinerary/itinerary-item/itinerary-item.d.ts +0 -8
- package/dist/components/itinerary/itinerary-item/itinerary-item.js +0 -6
- package/dist/components/itinerary/itinerary-item/itinerary-item.styles.d.ts +0 -2
- package/dist/components/itinerary/itinerary-item/itinerary-item.styles.js +0 -70
- package/dist/components/itinerary/itinerary.component.d.ts +0 -7
- package/dist/components/itinerary/itinerary.component.js +0 -23
- package/dist/components/itinerary/itinerary.d.ts +0 -8
- package/dist/components/itinerary/itinerary.js +0 -6
- package/dist/components/itinerary/itinerary.styles.d.ts +0 -2
- package/dist/components/itinerary/itinerary.styles.js +0 -15
- package/dist/components/marketing-tag/marketing-tag.component.d.ts +0 -5
- package/dist/components/marketing-tag/marketing-tag.component.js +0 -8
- package/dist/components/marketing-tag/marketing-tag.d.ts +0 -8
- package/dist/components/marketing-tag/marketing-tag.js +0 -6
- package/dist/components/marketing-tag/marketing-tag.styles.d.ts +0 -2
- package/dist/components/marketing-tag/marketing-tag.styles.js +0 -36
- package/dist/components/price/price.component.d.ts +0 -12
- package/dist/components/price/price.component.js +0 -38
- package/dist/components/price/price.d.ts +0 -8
- package/dist/components/price/price.js +0 -6
- package/dist/components/reviews/review/review.component.d.ts +0 -9
- package/dist/components/reviews/review/review.component.js +0 -41
- package/dist/components/reviews/review/review.d.ts +0 -8
- package/dist/components/reviews/review/review.js +0 -6
- package/dist/components/reviews/review/review.styles.d.ts +0 -2
- package/dist/components/reviews/review/review.styles.js +0 -45
- package/dist/components/reviews/reviews.component.d.ts +0 -9
- package/dist/components/reviews/reviews.component.js +0 -56
- package/dist/components/reviews/reviews.d.ts +0 -8
- package/dist/components/reviews/reviews.js +0 -6
- package/dist/components/reviews/reviews.styles.d.ts +0 -2
- package/dist/components/reviews/reviews.styles.js +0 -73
- package/dist/components/selected-tickets-preview/selected-tickets-preview.component.d.ts +0 -10
- package/dist/components/selected-tickets-preview/selected-tickets-preview.component.js +0 -51
- package/dist/components/selected-tickets-preview/selected-tickets-preview.d.ts +0 -8
- package/dist/components/selected-tickets-preview/selected-tickets-preview.js +0 -6
- package/dist/components/selected-tickets-preview/selected-tickets-preview.styles.d.ts +0 -2
- package/dist/components/selected-tickets-preview/selected-tickets-preview.styles.js +0 -89
- package/dist/components/tag/tag.component.d.ts +0 -8
- package/dist/components/tag/tag.component.js +0 -33
- package/dist/components/tag/tag.constants.d.ts +0 -1
- package/dist/components/tag/tag.constants.js +0 -1
- package/dist/components/tag/tag.d.ts +0 -8
- package/dist/components/tag/tag.js +0 -6
- package/dist/components/tag/tag.styles.d.ts +0 -2
- package/dist/components/tag/tag.styles.js +0 -56
- package/dist/components/tooltip/tooltip.component.d.ts +0 -19
- package/dist/components/tooltip/tooltip.component.js +0 -124
- package/dist/components/tooltip/tooltip.d.ts +0 -8
- package/dist/components/tooltip/tooltip.js +0 -6
- package/dist/components/tooltip/tooltip.styles.d.ts +0 -2
- package/dist/components/tooltip/tooltip.styles.js +0 -79
- package/dist/core/signals.d.ts +0 -2
- package/dist/core/signals.js +0 -3
- package/dist/core/storybook/argTypes.d.ts +0 -1
- package/dist/core/storybook/argTypes.js +0 -46
- package/dist/core/storybook/cssprops.d.ts +0 -30
- package/dist/core/storybook/cssprops.js +0 -46
- package/dist/core/storybook/demo.d.ts +0 -4
- package/dist/core/storybook/demo.js +0 -17
- package/dist/core/types/api-errors.d.ts +0 -8
- package/dist/core/types/api-errors.js +0 -1
- package/dist/styles/contrast-fixtures.d.ts +0 -5
- package/dist/styles/contrast-fixtures.js +0 -131
- package/dist/views/payment-page/domain/payment-mappers.d.ts +0 -7
- package/dist/views/payment-page/domain/payment-mappers.js +0 -7
- package/dist/views/payment-page/domain/payment-validators.d.ts +0 -6
- package/dist/views/payment-page/domain/payment-validators.js +0 -6
- package/dist/views/payment-page/domain/recovery-payload.d.ts +0 -8
- package/dist/views/payment-page/domain/recovery-payload.js +0 -7
- package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.component.d.ts +0 -22
- package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.component.js +0 -65
- package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.d.ts +0 -8
- package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.js +0 -6
- package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.styles.d.ts +0 -2
- package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.styles.js +0 -12
- package/dist/views/payment-page/payment-page.validation-schema.d.ts +0 -28
- package/dist/views/payment-page/payment-page.validation-schema.js +0 -42
- /package/dist/{components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.styles.d.ts → views/chrome-only-page/chrome-only-page.styles.d.ts} +0 -0
- /package/dist/{components/attraction-discovery/attraction-discovery.styles.d.ts → views/details-page/partials/location-categories/location-categories.styles.d.ts} +0 -0
- /package/dist/{components/basket-rewards/basket-rewards.styles.d.ts → views/details-page/partials/location-highlights/location-highlights.styles.d.ts} +0 -0
|
@@ -4,6 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
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
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
+
import { getLoyaltyAmount } from "../../core/utils/loyalty.js";
|
|
7
8
|
import { LitElement, html, nothing, } from "lit";
|
|
8
9
|
import { state, property } from "lit/decorators.js";
|
|
9
10
|
import { Task, TaskStatus } from "@lit/task";
|
|
@@ -12,11 +13,9 @@ import { classMap } from "lit/directives/class-map.js";
|
|
|
12
13
|
import { fireEvent } from "../../core/events.js";
|
|
13
14
|
import { map } from "lit/directives/map.js";
|
|
14
15
|
import { consume } from "@lit/context";
|
|
15
|
-
import {
|
|
16
|
-
import { isBasketDropdownOpen, isBasketMobileOpen, } from "../../core/signals.js";
|
|
17
|
-
import { formatISO, getDate, isAfter, isBefore, parseISO } from "date-fns";
|
|
16
|
+
import { formatISO, getDate, parseISO } from "date-fns";
|
|
18
17
|
import { capitalize } from "../../core/utils/text.js";
|
|
19
|
-
import { apiGet, apiPost
|
|
18
|
+
import { apiGet, apiPost } from "../../core/api/queries.js";
|
|
20
19
|
import "../../components/button/button.js";
|
|
21
20
|
import "../../components/attraction-header/attraction-header.js";
|
|
22
21
|
import "../../components/image-chip/image-chip.js";
|
|
@@ -49,14 +48,17 @@ import "../../components/breadcrumbs/breadcrumbs.js";
|
|
|
49
48
|
import "../../components/breadcrumbs/breadcrumb-item/breadcrumb-item.js";
|
|
50
49
|
import "./partials/theater-description/theater-description.js";
|
|
51
50
|
import "./partials/tour-description/tour-description.js";
|
|
51
|
+
import "./partials/location-highlights/location-highlights.js";
|
|
52
|
+
import "./partials/location-categories/location-categories.js";
|
|
52
53
|
import { PointsMixin } from "../../mixins/points/points.js";
|
|
53
54
|
import styles from "./details-page.styles.js";
|
|
54
55
|
import { BaseMixin } from "../../mixins/base.mixin.js";
|
|
55
56
|
import { ErrorModalMixin } from "../../mixins/error-modal.mixin.js";
|
|
56
57
|
import { currentPageContext } from "../../contexts/current-page.context.js";
|
|
57
58
|
import { convertToLocaleCurrency } from "../../core/currency/index.js";
|
|
58
|
-
import { calculateTotalPrice, formatDateWithTimezone, formatTicketDetails, getAvailabilityDays, getAvailabilitySummary, getCurrentMonth, getTicketsAmount, getTicketSelectorLabel, getTotalTicketsCount, groupAvailabilityByTime, isSingleDayAvailability,
|
|
59
|
-
import { formatDateTimeForDisplay
|
|
59
|
+
import { calculateTotalPrice, formatDateWithTimezone, formatTicketDetails, getAvailabilityDays, getAvailabilityRequestKey, getAvailabilitySummary, getBookingSessionExpiry, getCurrentMonth, getTicketsAmount, getTicketSelectorLabel, getTotalTicketsCount, groupAvailabilityByTime, isSingleDayAvailability, resolveAttractionLocation, scrollToTop, sumPricesAndFormat, } from "./details-page.utilts.js";
|
|
60
|
+
import { formatDateTimeForDisplay } from "../../core/utils/datetime.js";
|
|
61
|
+
import { APIError } from "../../core/api/api-error.js";
|
|
60
62
|
import { getBookingSession, storeBookingSession, } from "../../core/api/middlewares/booking-session/booking-session.utils.js";
|
|
61
63
|
import { BOOKING_SESSION_EXPIRES_HEADER } from "../../core/api/middlewares/booking-session/booking-session.constants.js";
|
|
62
64
|
import { formatDate } from "../../core/i18n/date.js";
|
|
@@ -66,6 +68,7 @@ import { addRecentlySelectedSearches } from "../../containers/navbar/navbar.util
|
|
|
66
68
|
import { filterMediaForGallery } from "../../core/images/filters.js";
|
|
67
69
|
import { readSeatsIoConfig } from "../../core/types/seats-config.js";
|
|
68
70
|
import { getApiLanguageCode } from "../../core/utils/locale.js";
|
|
71
|
+
import { safeUrl } from "@coras-io/brand-tokens";
|
|
69
72
|
const IMAGE_CAROUSEL_WIDTH = 480;
|
|
70
73
|
const IMAGE_CAROUSEL_HEIGHT = 320;
|
|
71
74
|
/**
|
|
@@ -73,7 +76,7 @@ const IMAGE_CAROUSEL_HEIGHT = 320;
|
|
|
73
76
|
* @fires coras:state-change
|
|
74
77
|
* @fires coras:reservation-created
|
|
75
78
|
*/
|
|
76
|
-
let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(PointsMixin(BaseMixin(
|
|
79
|
+
let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(PointsMixin(BaseMixin(LitElement))) {
|
|
77
80
|
constructor() {
|
|
78
81
|
super(...arguments);
|
|
79
82
|
this.attractionId = "";
|
|
@@ -87,12 +90,18 @@ let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(PointsMixi
|
|
|
87
90
|
this.shouldRenderOptions = false;
|
|
88
91
|
this.isBasketModalOpened = false;
|
|
89
92
|
this.selectedTimeOptions = {};
|
|
93
|
+
// Both derived from the attraction in willUpdate.
|
|
90
94
|
this.isSingleDayAvailability = false;
|
|
91
95
|
this.availabilityDays = [];
|
|
92
96
|
this.isReservationPreviewModalOpened = false;
|
|
93
97
|
this.selectedSectionId = undefined;
|
|
94
98
|
this.selectedTime = null;
|
|
95
99
|
this.hasAvailabilityError = false;
|
|
100
|
+
// The date and ticket mix the last availability run asked for. Options are
|
|
101
|
+
// rendered only while the current selection still matches it, so a date or
|
|
102
|
+
// ticket change made by the host, or while a check is in flight, cannot
|
|
103
|
+
// reserve against the previous response.
|
|
104
|
+
this.availabilityRequestKey = null;
|
|
96
105
|
this.loadingSelectionIds = new Set();
|
|
97
106
|
this.seatsFallback = false;
|
|
98
107
|
this.configTask = new Task(this, {
|
|
@@ -100,39 +109,58 @@ let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(PointsMixi
|
|
|
100
109
|
if (!client) {
|
|
101
110
|
return null;
|
|
102
111
|
}
|
|
103
|
-
const { data } = await
|
|
112
|
+
const { data } = await apiGet({
|
|
104
113
|
client,
|
|
105
114
|
distributorID,
|
|
106
115
|
locale,
|
|
107
116
|
endpoint: "/{api_version}/config",
|
|
108
|
-
})
|
|
117
|
+
});
|
|
109
118
|
return readSeatsIoConfig(data);
|
|
110
119
|
},
|
|
111
120
|
args: () => [this.client, this.locale, this.distributorID],
|
|
112
121
|
});
|
|
113
|
-
this.verifyDate = (
|
|
122
|
+
this.verifyDate = (firstInstanceDate, lastInstanceDate, timezone) => {
|
|
114
123
|
if (!this.date) {
|
|
115
|
-
this.updateDateParam({ date:
|
|
124
|
+
this.updateDateParam({ date: firstInstanceDate, timezone });
|
|
125
|
+
return;
|
|
116
126
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
127
|
+
// `date` is a calendar day while the instance dates are instants, so both
|
|
128
|
+
// are compared as the venue's calendar day. Comparing the day with the
|
|
129
|
+
// instant re-dispatched the same date on every load and could move a
|
|
130
|
+
// valid date when the first instance starts near midnight.
|
|
131
|
+
const toVenueDay = (dateString) => formatDateWithTimezone({
|
|
132
|
+
dateString,
|
|
133
|
+
timezone,
|
|
134
|
+
locale: this.locale,
|
|
135
|
+
formatString: "yyyy-MM-dd",
|
|
136
|
+
});
|
|
137
|
+
if (this.date < toVenueDay(firstInstanceDate) ||
|
|
138
|
+
this.date > toVenueDay(lastInstanceDate)) {
|
|
139
|
+
this.updateDateParam({ date: firstInstanceDate, timezone });
|
|
121
140
|
}
|
|
122
141
|
};
|
|
123
|
-
this.checkDateAvailability = (
|
|
142
|
+
this.checkDateAvailability = (data) => {
|
|
143
|
+
const firstInstanceDay = data.first_instance_date;
|
|
144
|
+
const timezone = data.attraction.timezone;
|
|
124
145
|
if (!this.date) {
|
|
125
146
|
this.updateDateParam({ date: firstInstanceDay, timezone });
|
|
126
147
|
return;
|
|
127
148
|
}
|
|
149
|
+
// Validate against the month the date is in, not the month the visitor
|
|
150
|
+
// has paged the calendar to.
|
|
151
|
+
const availabilityDays = getAvailabilityDays({
|
|
152
|
+
timezone,
|
|
153
|
+
salePeriods: data.attraction.sale_periods ?? null,
|
|
154
|
+
targetMonth: getCurrentMonth(this.date),
|
|
155
|
+
});
|
|
128
156
|
const dayOfMonth = String(getDate(parseISO(this.date)));
|
|
129
|
-
if (!
|
|
157
|
+
if (!availabilityDays.includes(dayOfMonth)) {
|
|
130
158
|
this.updateDateParam({ date: firstInstanceDay, timezone });
|
|
131
159
|
}
|
|
132
160
|
};
|
|
133
161
|
this.attractionTask = new Task(this, {
|
|
134
|
-
task: async ([locale, currency, attractionId]) => {
|
|
135
|
-
const
|
|
162
|
+
task: async ([locale, currency, attractionId], { signal }) => {
|
|
163
|
+
const { data } = await apiGet({
|
|
136
164
|
client: this.client,
|
|
137
165
|
distributorID: this.distributorID,
|
|
138
166
|
locale: locale,
|
|
@@ -144,36 +172,31 @@ let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(PointsMixi
|
|
|
144
172
|
currency: currency,
|
|
145
173
|
size: 0,
|
|
146
174
|
},
|
|
147
|
-
})
|
|
148
|
-
//
|
|
149
|
-
//
|
|
150
|
-
// would dereference `attraction` on it and throw. Fail the task instead
|
|
151
|
-
// the error modal is shown.
|
|
152
|
-
if (!
|
|
175
|
+
});
|
|
176
|
+
// An empty response has no attraction to render. Returning an empty
|
|
177
|
+
// object here would complete the task, so every render branch below
|
|
178
|
+
// would dereference `attraction` on it and throw. Fail the task instead
|
|
179
|
+
// so the error modal is shown.
|
|
180
|
+
if (!data) {
|
|
153
181
|
throw new Error("Attraction data not available");
|
|
154
182
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
timezone: result.data.attraction.timezone,
|
|
164
|
-
formatString: "yyyy-MM-dd",
|
|
165
|
-
}), this.currentMonth),
|
|
166
|
-
});
|
|
167
|
-
this.checkDateAvailability(result.data.first_instance_date, result.data.attraction.timezone);
|
|
183
|
+
// A superseded run (the visitor moved to another attraction while this
|
|
184
|
+
// one was in flight) must not correct the page date or record a recent
|
|
185
|
+
// search for the attraction that is no longer shown.
|
|
186
|
+
if (signal.aborted) {
|
|
187
|
+
return data;
|
|
188
|
+
}
|
|
189
|
+
this.verifyDate(data.first_instance_date, data.last_instance_date, data.attraction.timezone);
|
|
190
|
+
this.checkDateAvailability(data);
|
|
168
191
|
try {
|
|
169
192
|
addRecentlySelectedSearches({
|
|
170
193
|
type: "attraction",
|
|
171
194
|
value: attractionId,
|
|
172
|
-
name:
|
|
195
|
+
name: data.attraction.attraction_name,
|
|
173
196
|
});
|
|
174
197
|
}
|
|
175
198
|
catch { }
|
|
176
|
-
return
|
|
199
|
+
return data;
|
|
177
200
|
},
|
|
178
201
|
args: () => [this.locale, this.currency, this.attractionId],
|
|
179
202
|
});
|
|
@@ -184,7 +207,7 @@ let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(PointsMixi
|
|
|
184
207
|
if (bookingSession) {
|
|
185
208
|
return bookingSession;
|
|
186
209
|
}
|
|
187
|
-
const { data, response } = await
|
|
210
|
+
const { data, response } = await apiPost({
|
|
188
211
|
client: this.client,
|
|
189
212
|
distributorID: this.distributorID,
|
|
190
213
|
locale: this.locale,
|
|
@@ -195,31 +218,10 @@ let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(PointsMixi
|
|
|
195
218
|
analytics_id: null,
|
|
196
219
|
distributor_session_id: null,
|
|
197
220
|
},
|
|
198
|
-
})
|
|
221
|
+
});
|
|
199
222
|
if (data && data["booking-session"]) {
|
|
200
223
|
const newBookingSession = data["booking-session"];
|
|
201
|
-
|
|
202
|
-
if (expiresHeader) {
|
|
203
|
-
try {
|
|
204
|
-
const expirationDate = new Date(expiresHeader);
|
|
205
|
-
if (!isNaN(expirationDate.getTime())) {
|
|
206
|
-
storeBookingSession(this.distributorID, newBookingSession, expirationDate);
|
|
207
|
-
}
|
|
208
|
-
else {
|
|
209
|
-
const defaultExpiration = new Date(Date.now() + 20 * 60 * 1000);
|
|
210
|
-
storeBookingSession(this.distributorID, newBookingSession, defaultExpiration);
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
catch (error) {
|
|
214
|
-
console.warn("Failed to parse booking session expiration date:", error);
|
|
215
|
-
const defaultExpiration = new Date(Date.now() + 20 * 60 * 1000);
|
|
216
|
-
storeBookingSession(this.distributorID, newBookingSession, defaultExpiration);
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
else {
|
|
220
|
-
const defaultExpiration = new Date(Date.now() + 20 * 60 * 1000);
|
|
221
|
-
storeBookingSession(this.distributorID, newBookingSession, defaultExpiration);
|
|
222
|
-
}
|
|
224
|
+
storeBookingSession(this.distributorID, newBookingSession, getBookingSessionExpiry(response.headers.get(BOOKING_SESSION_EXPIRES_HEADER)));
|
|
223
225
|
return newBookingSession;
|
|
224
226
|
}
|
|
225
227
|
return undefined;
|
|
@@ -230,44 +232,54 @@ let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(PointsMixi
|
|
|
230
232
|
task: async () => {
|
|
231
233
|
const bookingSession = this.bookingSessionTask.value;
|
|
232
234
|
if (!bookingSession) {
|
|
235
|
+
this.hasAvailabilityError = true;
|
|
233
236
|
throw new Error("Booking session not available");
|
|
234
237
|
}
|
|
235
238
|
const apiResponse = this.attractionTask.value;
|
|
236
239
|
if (!apiResponse) {
|
|
240
|
+
this.hasAvailabilityError = true;
|
|
237
241
|
throw new Error("Attraction data not available");
|
|
238
242
|
}
|
|
239
|
-
const
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
243
|
+
const date = this.resolvedDate;
|
|
244
|
+
const selectedPriceTypes = this.selectedPriceTypes;
|
|
245
|
+
this.availabilityRequestKey = getAvailabilityRequestKey(date, selectedPriceTypes);
|
|
246
|
+
let data;
|
|
247
|
+
try {
|
|
248
|
+
({ data } = await apiPost({
|
|
249
|
+
client: this.client,
|
|
250
|
+
distributorID: this.distributorID,
|
|
251
|
+
locale: this.locale,
|
|
252
|
+
endpoint: "/{api_version}/availability/check",
|
|
253
|
+
bookingSession,
|
|
254
|
+
body: {
|
|
255
|
+
currency: this.currency,
|
|
256
|
+
language_code: getApiLanguageCode(this.locale),
|
|
257
|
+
attraction_id: this.attractionId,
|
|
258
|
+
date,
|
|
259
|
+
tickets: Object.entries(selectedPriceTypes).map(([key, value]) => ({
|
|
260
|
+
price_type_id: key,
|
|
261
|
+
number_of_tickets: value,
|
|
262
|
+
})),
|
|
263
|
+
},
|
|
264
|
+
}));
|
|
265
|
+
}
|
|
266
|
+
catch (error) {
|
|
267
|
+
// The availability alert is the error UI; the failed task only
|
|
268
|
+
// carries the API error code for the options area.
|
|
257
269
|
this.hasAvailabilityError = true;
|
|
270
|
+
throw error;
|
|
258
271
|
}
|
|
259
|
-
if (!
|
|
272
|
+
if (!data) {
|
|
260
273
|
this.hasAvailabilityError = true;
|
|
261
274
|
return [];
|
|
262
275
|
}
|
|
263
|
-
if (
|
|
264
|
-
|
|
265
|
-
0) {
|
|
276
|
+
if (data.length === 0 ||
|
|
277
|
+
data.filter((availability) => availability.available).length === 0) {
|
|
266
278
|
this.hasAvailabilityError = true;
|
|
267
279
|
}
|
|
268
|
-
const availableItems =
|
|
269
|
-
const
|
|
270
|
-
this.selectedTime =
|
|
280
|
+
const availableItems = data.filter((item) => item.available) || [];
|
|
281
|
+
const [firstTime] = groupAvailabilityByTime(availableItems, this.locale).keys();
|
|
282
|
+
this.selectedTime = firstTime ?? null;
|
|
271
283
|
availableItems.forEach((item) => {
|
|
272
284
|
if (item.selection_id) {
|
|
273
285
|
const languageEntries = Object.entries(item.languages_spoken || {});
|
|
@@ -277,13 +289,9 @@ let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(PointsMixi
|
|
|
277
289
|
const defaultLanguage = matchingLanguage
|
|
278
290
|
? matchingLanguage[0]
|
|
279
291
|
: languageEntries[0]?.[0];
|
|
280
|
-
const defaultTime = item.start_datetime;
|
|
281
292
|
this.selectedTimeOptions = {
|
|
282
293
|
...this.selectedTimeOptions,
|
|
283
|
-
[item.selection_id]: {
|
|
284
|
-
language: defaultLanguage,
|
|
285
|
-
time: defaultTime,
|
|
286
|
-
},
|
|
294
|
+
[item.selection_id]: { language: defaultLanguage },
|
|
287
295
|
};
|
|
288
296
|
}
|
|
289
297
|
}
|
|
@@ -315,31 +323,34 @@ let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(PointsMixi
|
|
|
315
323
|
instance_id: null,
|
|
316
324
|
tickets: this.buildSectionTickets(selection_id),
|
|
317
325
|
};
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
326
|
+
let data;
|
|
327
|
+
try {
|
|
328
|
+
({ data } = await apiPost({
|
|
329
|
+
client: this.client,
|
|
330
|
+
distributorID: this.distributorID,
|
|
331
|
+
locale: this.locale,
|
|
332
|
+
endpoint: "/{api_version}/reservations",
|
|
333
|
+
bookingSession,
|
|
334
|
+
body: {
|
|
335
|
+
attraction_id: this.attractionId,
|
|
336
|
+
currency: this.currency,
|
|
337
|
+
date: this.resolvedDate,
|
|
338
|
+
language_code: getApiLanguageCode(this.locale),
|
|
339
|
+
tour_language: language,
|
|
340
|
+
to_basket: true,
|
|
341
|
+
pickup_id: null,
|
|
342
|
+
pickup_entry: null,
|
|
343
|
+
content_indexed_at: null,
|
|
344
|
+
...reservationFields,
|
|
345
|
+
},
|
|
346
|
+
}));
|
|
347
|
+
}
|
|
348
|
+
catch (error) {
|
|
338
349
|
this.hasAvailabilityError = true;
|
|
339
|
-
|
|
350
|
+
throw error;
|
|
340
351
|
}
|
|
341
|
-
if (
|
|
342
|
-
const reservation =
|
|
352
|
+
if (data) {
|
|
353
|
+
const reservation = data;
|
|
343
354
|
fireEvent(this, "coras:reservation-created", {
|
|
344
355
|
...(reservation.reservation_id != null
|
|
345
356
|
? { reservationId: reservation.reservation_id }
|
|
@@ -352,21 +363,13 @@ let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(PointsMixi
|
|
|
352
363
|
: {}),
|
|
353
364
|
});
|
|
354
365
|
}
|
|
355
|
-
return
|
|
366
|
+
return data || {};
|
|
356
367
|
},
|
|
357
368
|
args: (language = "", selection_id = "", seated = null) => [language, selection_id, seated],
|
|
358
369
|
});
|
|
359
370
|
this.setCurrentMonth = (event) => {
|
|
360
371
|
event.stopPropagation();
|
|
361
372
|
this.currentMonth = event.detail.date;
|
|
362
|
-
const apiResponse = this.attractionTask.value;
|
|
363
|
-
if (apiResponse) {
|
|
364
|
-
this.availabilityDays = getAvailabilityDays({
|
|
365
|
-
timezone: apiResponse.attraction.timezone,
|
|
366
|
-
salePeriods: apiResponse.attraction.sale_periods ?? null,
|
|
367
|
-
targetMonth: this.currentMonth,
|
|
368
|
-
});
|
|
369
|
-
}
|
|
370
373
|
};
|
|
371
374
|
this.changeTicketNumberBy = (id, count, maxAmount) => {
|
|
372
375
|
const currentValue = getTicketsAmount(id, this.selectedPriceTypes, maxAmount);
|
|
@@ -379,11 +382,11 @@ let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(PointsMixi
|
|
|
379
382
|
...this.selectedPriceTypes,
|
|
380
383
|
[id]: newValue,
|
|
381
384
|
}).filter(([_key, value]) => value !== 0));
|
|
382
|
-
this.
|
|
385
|
+
this.clearAvailabilitySelection();
|
|
383
386
|
};
|
|
384
387
|
this.handleDateSelected = (event) => {
|
|
385
388
|
event.stopPropagation();
|
|
386
|
-
this.
|
|
389
|
+
this.clearAvailabilitySelection();
|
|
387
390
|
this.updateDateParam({ date: event.detail.date });
|
|
388
391
|
this.toggleCalendarDropdown();
|
|
389
392
|
};
|
|
@@ -463,9 +466,9 @@ let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(PointsMixi
|
|
|
463
466
|
if (!loyalty) {
|
|
464
467
|
return nothing;
|
|
465
468
|
}
|
|
466
|
-
const earnAmount =
|
|
467
|
-
const payAmount =
|
|
468
|
-
if (
|
|
469
|
+
const earnAmount = getLoyaltyAmount(loyalty, "earn");
|
|
470
|
+
const payAmount = getLoyaltyAmount(loyalty, "pay");
|
|
471
|
+
if (earnAmount <= 0 || payAmount <= 0) {
|
|
469
472
|
return nothing;
|
|
470
473
|
}
|
|
471
474
|
return html `
|
|
@@ -556,13 +559,6 @@ let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(PointsMixi
|
|
|
556
559
|
}
|
|
557
560
|
if (apiResponse.attraction_type === "TOUR") {
|
|
558
561
|
const response = apiResponse;
|
|
559
|
-
const priceTypes = response.price_types ?? [];
|
|
560
|
-
if (priceTypes.length > 0 &&
|
|
561
|
-
Object.keys(this.selectedPriceTypes).length === 0) {
|
|
562
|
-
const firstPriceTypeId = priceTypes[0].price_type_id;
|
|
563
|
-
const maxBookingSize = response.attraction.max_booking_size;
|
|
564
|
-
this.changeTicketNumberBy(firstPriceTypeId, 1, maxBookingSize);
|
|
565
|
-
}
|
|
566
562
|
return html `
|
|
567
563
|
<coras-tour-ticket-type-selector
|
|
568
564
|
assets-url="${this.assetsURL}"
|
|
@@ -575,13 +571,6 @@ let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(PointsMixi
|
|
|
575
571
|
}
|
|
576
572
|
if (apiResponse.attraction_type === "THEATER") {
|
|
577
573
|
const response = apiResponse;
|
|
578
|
-
const priceTypes = response.price_types ?? [];
|
|
579
|
-
if (priceTypes.length > 0 &&
|
|
580
|
-
Object.keys(this.selectedPriceTypes).length === 0) {
|
|
581
|
-
const firstPriceTypeId = priceTypes[0].price_type_id;
|
|
582
|
-
const maxBookingSize = response.attraction.max_tickets_per_order;
|
|
583
|
-
this.changeTicketNumberBy(firstPriceTypeId, 1, maxBookingSize);
|
|
584
|
-
}
|
|
585
574
|
return html `
|
|
586
575
|
<coras-tour-ticket-type-selector
|
|
587
576
|
assets-url="${this.assetsURL}"
|
|
@@ -615,7 +604,7 @@ let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(PointsMixi
|
|
|
615
604
|
assets-url="${this.assetsURL}"
|
|
616
605
|
slot="prefix"
|
|
617
606
|
icon="calendar"
|
|
618
|
-
label
|
|
607
|
+
label=${msg("Calendar")}
|
|
619
608
|
></coras-icon>
|
|
620
609
|
<span>${formatDate(date, this.locale, true)}</span>
|
|
621
610
|
</coras-button>
|
|
@@ -642,7 +631,7 @@ let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(PointsMixi
|
|
|
642
631
|
assets-url="${this.assetsURL}"
|
|
643
632
|
slot="prefix"
|
|
644
633
|
icon="calendar"
|
|
645
|
-
label
|
|
634
|
+
label=${msg("Calendar")}
|
|
646
635
|
></coras-icon>
|
|
647
636
|
<coras-icon
|
|
648
637
|
assets-url="${this.assetsURL}"
|
|
@@ -661,11 +650,13 @@ let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(PointsMixi
|
|
|
661
650
|
min-date=${formatDateWithTimezone({
|
|
662
651
|
dateString: apiResponse.first_instance_date,
|
|
663
652
|
timezone: apiResponse.attraction.timezone,
|
|
653
|
+
locale: this.locale,
|
|
664
654
|
formatString: "yyyy-MM",
|
|
665
655
|
})}
|
|
666
656
|
max-date=${formatDateWithTimezone({
|
|
667
657
|
dateString: apiResponse.last_instance_date,
|
|
668
658
|
timezone: apiResponse.attraction.timezone,
|
|
659
|
+
locale: this.locale,
|
|
669
660
|
formatString: "yyyy-MM",
|
|
670
661
|
})}
|
|
671
662
|
.selectedDates=${[date]}
|
|
@@ -742,14 +733,10 @@ let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(PointsMixi
|
|
|
742
733
|
</coras-dialog>
|
|
743
734
|
`;
|
|
744
735
|
};
|
|
745
|
-
this.
|
|
746
|
-
const currentOptions = this.selectedTimeOptions[id] || {};
|
|
736
|
+
this.handleLanguageChipClicked = (id, language) => {
|
|
747
737
|
this.selectedTimeOptions = {
|
|
748
738
|
...this.selectedTimeOptions,
|
|
749
|
-
[id]: {
|
|
750
|
-
...currentOptions,
|
|
751
|
-
[type]: value,
|
|
752
|
-
},
|
|
739
|
+
[id]: { language },
|
|
753
740
|
};
|
|
754
741
|
};
|
|
755
742
|
this.renderTourOptionChips = ({ selectionId, languagesSpoken, }) => {
|
|
@@ -759,35 +746,15 @@ let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(PointsMixi
|
|
|
759
746
|
return html `
|
|
760
747
|
<coras-option-chip
|
|
761
748
|
?selected=${isSelected}
|
|
762
|
-
@click=${() => this.
|
|
749
|
+
@click=${() => this.handleLanguageChipClicked(selectionId, key)}
|
|
763
750
|
>
|
|
764
751
|
${label}
|
|
765
752
|
</coras-option-chip>
|
|
766
753
|
`;
|
|
767
754
|
})}`;
|
|
768
755
|
};
|
|
769
|
-
this.renderTimeOptionChips = ({ selectionId, startDatetime, timezone, }) => {
|
|
770
|
-
if (!startDatetime) {
|
|
771
|
-
return nothing;
|
|
772
|
-
}
|
|
773
|
-
const formattedTime = formatTimeForDisplay({
|
|
774
|
-
dateTime: startDatetime,
|
|
775
|
-
timezone,
|
|
776
|
-
locale: this.locale,
|
|
777
|
-
});
|
|
778
|
-
const isSelected = this.selectedTimeOptions[selectionId]?.time === startDatetime;
|
|
779
|
-
return html `
|
|
780
|
-
<coras-option-chip
|
|
781
|
-
?selected=${isSelected}
|
|
782
|
-
@click=${() => this.handleTimeOptionChipClicked(selectionId, startDatetime, "time")}
|
|
783
|
-
>
|
|
784
|
-
${formattedTime}
|
|
785
|
-
</coras-option-chip>
|
|
786
|
-
`;
|
|
787
|
-
};
|
|
788
756
|
this.renderTourOptions = (items) => {
|
|
789
757
|
return html `${map(items, ({ name, languages_spoken, selection_id, prices, start_datetime, timezone, max_full_price, }) => {
|
|
790
|
-
const hasOnlyOneTimeOption = true;
|
|
791
758
|
const hasMultipleLanguages = Object.keys(languages_spoken || {}).length > 1;
|
|
792
759
|
return html `
|
|
793
760
|
<coras-attraction-option
|
|
@@ -802,27 +769,15 @@ let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(PointsMixi
|
|
|
802
769
|
locale: this.locale,
|
|
803
770
|
currency: this.currency,
|
|
804
771
|
})}
|
|
805
|
-
?show-time-options=${!hasOnlyOneTimeOption}
|
|
806
772
|
?show-language-options=${hasMultipleLanguages}
|
|
807
773
|
>
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
></coras-time-tag>`
|
|
816
|
-
: nothing}
|
|
817
|
-
${!hasOnlyOneTimeOption
|
|
818
|
-
? html `<coras-option-group slot="time-options">
|
|
819
|
-
${this.renderTimeOptionChips({
|
|
820
|
-
selectionId: selection_id,
|
|
821
|
-
startDatetime: start_datetime,
|
|
822
|
-
timezone,
|
|
823
|
-
})}
|
|
824
|
-
</coras-option-group>`
|
|
825
|
-
: nothing}
|
|
774
|
+
<coras-time-tag
|
|
775
|
+
slot="badge"
|
|
776
|
+
assets-url="${this.assetsURL}"
|
|
777
|
+
datetime=${start_datetime}
|
|
778
|
+
timezone=${timezone}
|
|
779
|
+
locale=${this.locale}
|
|
780
|
+
></coras-time-tag>
|
|
826
781
|
${hasMultipleLanguages
|
|
827
782
|
? html `<coras-option-group slot="language-options">
|
|
828
783
|
${this.renderTourOptionChips({
|
|
@@ -867,7 +822,7 @@ let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(PointsMixi
|
|
|
867
822
|
scrollToTop();
|
|
868
823
|
}
|
|
869
824
|
else {
|
|
870
|
-
|
|
825
|
+
this.openNavbarBasket();
|
|
871
826
|
scrollToTop();
|
|
872
827
|
}
|
|
873
828
|
this.shouldRenderOptions = false;
|
|
@@ -878,7 +833,9 @@ let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(PointsMixi
|
|
|
878
833
|
}
|
|
879
834
|
};
|
|
880
835
|
this.renderAvailabilityOptions = () => {
|
|
881
|
-
if (!this.shouldRenderOptions
|
|
836
|
+
if (!this.shouldRenderOptions ||
|
|
837
|
+
this.availabilityRequestKey !==
|
|
838
|
+
getAvailabilityRequestKey(this.resolvedDate, this.selectedPriceTypes)) {
|
|
882
839
|
return nothing;
|
|
883
840
|
}
|
|
884
841
|
return this.availabilityTask.render({
|
|
@@ -902,12 +859,11 @@ let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(PointsMixi
|
|
|
902
859
|
}
|
|
903
860
|
else {
|
|
904
861
|
const timeGroups = groupAvailabilityByTime([...value], this.locale);
|
|
905
|
-
const
|
|
906
|
-
|
|
907
|
-
? Array.from(timeGroups.get(this.selectedTime) || [])
|
|
862
|
+
const filteredOptions = this.selectedTime !== null
|
|
863
|
+
? [...(timeGroups.get(this.selectedTime)?.items ?? [])]
|
|
908
864
|
: [];
|
|
909
865
|
const seatedPerformance = this.findSeatedPerformance(filteredOptions);
|
|
910
|
-
const showTimePicker =
|
|
866
|
+
const showTimePicker = timeGroups.size > 1;
|
|
911
867
|
return html `
|
|
912
868
|
<div class="options">
|
|
913
869
|
${showTimePicker
|
|
@@ -916,10 +872,10 @@ let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(PointsMixi
|
|
|
916
872
|
${msg("Please select a performance time")}
|
|
917
873
|
</div>
|
|
918
874
|
<div class="performance-times">
|
|
919
|
-
${map(
|
|
875
|
+
${map(timeGroups, ([time, { label }]) => html `
|
|
920
876
|
<coras-performance-time
|
|
921
877
|
assets-url="${this.assetsURL}"
|
|
922
|
-
text="${
|
|
878
|
+
text="${label}"
|
|
923
879
|
?selected=${time === this.selectedTime}
|
|
924
880
|
@click=${() => {
|
|
925
881
|
this.selectedTime = time;
|
|
@@ -938,11 +894,14 @@ let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(PointsMixi
|
|
|
938
894
|
}
|
|
939
895
|
},
|
|
940
896
|
error: (error) => {
|
|
941
|
-
const
|
|
942
|
-
|
|
897
|
+
const body = error instanceof APIError
|
|
898
|
+
? error.response
|
|
899
|
+
: undefined;
|
|
900
|
+
if (body?.code === 37) {
|
|
943
901
|
return html `${msg("Please select the number of tickets.")}`;
|
|
944
902
|
}
|
|
945
|
-
|
|
903
|
+
// The availability alert already explains the failure.
|
|
904
|
+
return nothing;
|
|
946
905
|
},
|
|
947
906
|
});
|
|
948
907
|
};
|
|
@@ -1003,7 +962,7 @@ let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(PointsMixi
|
|
|
1003
962
|
currency: this.currency,
|
|
1004
963
|
});
|
|
1005
964
|
return {
|
|
1006
|
-
label: `${count} Tickets (${formattedUnitPrice} each)
|
|
965
|
+
label: msg(str `${count} Tickets (${formattedUnitPrice} each)`),
|
|
1007
966
|
price: formattedTotalTicketPrice,
|
|
1008
967
|
};
|
|
1009
968
|
})
|
|
@@ -1024,6 +983,11 @@ let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(PointsMixi
|
|
|
1024
983
|
currency: this.currency,
|
|
1025
984
|
});
|
|
1026
985
|
const attractionName = apiResponse.attraction.attraction_name;
|
|
986
|
+
// The seat map URL comes from the API; gate its scheme before it becomes
|
|
987
|
+
// an img source so a javascript: value cannot reach the DOM.
|
|
988
|
+
const seatMap = "seat_map" in apiResponse.attraction
|
|
989
|
+
? safeUrl(apiResponse.attraction.seat_map)
|
|
990
|
+
: "";
|
|
1027
991
|
return html `
|
|
1028
992
|
<coras-dialog
|
|
1029
993
|
?open=${this.isReservationPreviewModalOpened}
|
|
@@ -1063,14 +1027,9 @@ let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(PointsMixi
|
|
|
1063
1027
|
${msg("Add to basket")}
|
|
1064
1028
|
</coras-button>
|
|
1065
1029
|
|
|
1066
|
-
${
|
|
1067
|
-
apiResponse.attraction.seat_map
|
|
1030
|
+
${seatMap
|
|
1068
1031
|
? html `
|
|
1069
|
-
<img
|
|
1070
|
-
slot="image"
|
|
1071
|
-
src="${apiResponse.attraction.seat_map}"
|
|
1072
|
-
alt="${msg("Seat Map")}"
|
|
1073
|
-
/>
|
|
1032
|
+
<img slot="image" src="${seatMap}" alt="${msg("Seat Map")}" />
|
|
1074
1033
|
`
|
|
1075
1034
|
: nothing}
|
|
1076
1035
|
</coras-reservation-preview>
|
|
@@ -1192,7 +1151,11 @@ let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(PointsMixi
|
|
|
1192
1151
|
const title = msg("We're sorry, there are not enough tickets available for this event");
|
|
1193
1152
|
const description = msg("Please try a different date or number of tickets");
|
|
1194
1153
|
return html `
|
|
1195
|
-
<coras-alert
|
|
1154
|
+
<coras-alert
|
|
1155
|
+
assets-url=${this.assetsURL}
|
|
1156
|
+
variant="error"
|
|
1157
|
+
heading=${title}
|
|
1158
|
+
>
|
|
1196
1159
|
${description}
|
|
1197
1160
|
</coras-alert>
|
|
1198
1161
|
`;
|
|
@@ -1211,15 +1174,46 @@ let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(PointsMixi
|
|
|
1211
1174
|
date: this.date,
|
|
1212
1175
|
};
|
|
1213
1176
|
}
|
|
1177
|
+
willUpdate(changedProperties) {
|
|
1178
|
+
super.willUpdate(changedProperties);
|
|
1179
|
+
const attraction = this.attractionTask.value;
|
|
1180
|
+
this.isSingleDayAvailability = attraction
|
|
1181
|
+
? isSingleDayAvailability(attraction.attraction.sale_periods ?? null)
|
|
1182
|
+
: false;
|
|
1183
|
+
this.availabilityDays = attraction
|
|
1184
|
+
? getAvailabilityDays({
|
|
1185
|
+
timezone: attraction.attraction.timezone,
|
|
1186
|
+
salePeriods: attraction.attraction.sale_periods ?? null,
|
|
1187
|
+
targetMonth: getCurrentMonth(this.resolvedDate, this.currentMonth),
|
|
1188
|
+
})
|
|
1189
|
+
: [];
|
|
1190
|
+
this.selectDefaultTicket(attraction);
|
|
1191
|
+
}
|
|
1192
|
+
// One ticket of the first price type is preselected whenever nothing is
|
|
1193
|
+
// selected, so the availability check can run straight away.
|
|
1194
|
+
selectDefaultTicket(attraction) {
|
|
1195
|
+
const firstPriceType = attraction?.price_types?.[0];
|
|
1196
|
+
if (!firstPriceType || Object.keys(this.selectedPriceTypes).length > 0) {
|
|
1197
|
+
return;
|
|
1198
|
+
}
|
|
1199
|
+
const maxAmount = attraction.attraction_type === "TOUR"
|
|
1200
|
+
? attraction.attraction
|
|
1201
|
+
.max_booking_size
|
|
1202
|
+
: attraction.attraction
|
|
1203
|
+
.max_tickets_per_order;
|
|
1204
|
+
this.changeTicketNumberBy(firstPriceType.price_type_id, 1, maxAmount);
|
|
1205
|
+
}
|
|
1214
1206
|
updated(changedProperties) {
|
|
1215
1207
|
super.updated(changedProperties);
|
|
1216
1208
|
if (getLocale() !== this.locale) {
|
|
1217
|
-
|
|
1209
|
+
// `loadLocale` falls back on its own (see core/i18n/localization.ts), so
|
|
1210
|
+
// the returned promise does not reject; an unknown code throws synchronously.
|
|
1211
|
+
void setLocale(this.locale);
|
|
1218
1212
|
}
|
|
1219
1213
|
if (changedProperties.has("currency") || changedProperties.has("locale")) {
|
|
1220
1214
|
if (this.availabilityTask.status === TaskStatus.COMPLETE ||
|
|
1221
1215
|
this.availabilityTask.status === TaskStatus.ERROR) {
|
|
1222
|
-
this.availabilityTask.run();
|
|
1216
|
+
void this.availabilityTask.run();
|
|
1223
1217
|
}
|
|
1224
1218
|
}
|
|
1225
1219
|
if (changedProperties.has("attractionId")) {
|
|
@@ -1227,6 +1221,7 @@ let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(PointsMixi
|
|
|
1227
1221
|
}
|
|
1228
1222
|
}
|
|
1229
1223
|
resetAvailabilityState() {
|
|
1224
|
+
this.currentMonth = undefined;
|
|
1230
1225
|
this.shouldRenderOptions = false;
|
|
1231
1226
|
this.hasAvailabilityError = false;
|
|
1232
1227
|
this.selectedTime = null;
|
|
@@ -1241,6 +1236,7 @@ let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(PointsMixi
|
|
|
1241
1236
|
? formatDateWithTimezone({
|
|
1242
1237
|
dateString: date,
|
|
1243
1238
|
timezone,
|
|
1239
|
+
locale: this.locale,
|
|
1244
1240
|
formatString: "yyyy-MM-dd",
|
|
1245
1241
|
})
|
|
1246
1242
|
: formatISO(parseISO(date), {
|
|
@@ -1269,7 +1265,7 @@ let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(PointsMixi
|
|
|
1269
1265
|
scrollToTop();
|
|
1270
1266
|
}
|
|
1271
1267
|
else {
|
|
1272
|
-
|
|
1268
|
+
this.openNavbarBasket();
|
|
1273
1269
|
scrollToTop();
|
|
1274
1270
|
}
|
|
1275
1271
|
return true;
|
|
@@ -1296,6 +1292,7 @@ let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(PointsMixi
|
|
|
1296
1292
|
return formatDateWithTimezone({
|
|
1297
1293
|
dateString: apiResponse.first_instance_date,
|
|
1298
1294
|
timezone: apiResponse.attraction.timezone,
|
|
1295
|
+
locale: this.locale,
|
|
1299
1296
|
formatString: "yyyy-MM-dd",
|
|
1300
1297
|
});
|
|
1301
1298
|
}
|
|
@@ -1321,6 +1318,12 @@ let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(PointsMixi
|
|
|
1321
1318
|
toggleImageViewerModal() {
|
|
1322
1319
|
this.isImageViewerModalOpen = !this.isImageViewerModalOpen;
|
|
1323
1320
|
}
|
|
1321
|
+
clearAvailabilitySelection() {
|
|
1322
|
+
this.hasAvailabilityError = false;
|
|
1323
|
+
this.shouldRenderOptions = false;
|
|
1324
|
+
this.selectedTime = null;
|
|
1325
|
+
this.selectedSectionId = undefined;
|
|
1326
|
+
}
|
|
1324
1327
|
get isCheckingAvailability() {
|
|
1325
1328
|
return (this.bookingSessionTask.status === TaskStatus.PENDING ||
|
|
1326
1329
|
this.availabilityTask.status === TaskStatus.PENDING);
|
|
@@ -1336,18 +1339,10 @@ let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(PointsMixi
|
|
|
1336
1339
|
if (!apiResponse)
|
|
1337
1340
|
return nothing;
|
|
1338
1341
|
const { attraction } = apiResponse;
|
|
1339
|
-
const
|
|
1340
|
-
if (!
|
|
1342
|
+
const summary = resolveAttractionLocation(attraction.location);
|
|
1343
|
+
if (!summary)
|
|
1341
1344
|
return nothing;
|
|
1342
|
-
const cityName
|
|
1343
|
-
const citySlug = location.location_type === "city" ? location.slug : null;
|
|
1344
|
-
const country = location.location_type === "city"
|
|
1345
|
-
? location.parent_location
|
|
1346
|
-
: location.location_type === "country"
|
|
1347
|
-
? location
|
|
1348
|
-
: null;
|
|
1349
|
-
const countryName = country?.name;
|
|
1350
|
-
const countrySlug = country?.slug;
|
|
1345
|
+
const { cityName, citySlug, countryName, countrySlug } = summary;
|
|
1351
1346
|
const handleCountryClick = () => {
|
|
1352
1347
|
if (!countrySlug)
|
|
1353
1348
|
return;
|
|
@@ -1399,6 +1394,32 @@ let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(PointsMixi
|
|
|
1399
1394
|
</coras-breadcrumbs>
|
|
1400
1395
|
`;
|
|
1401
1396
|
}
|
|
1397
|
+
renderRelatedSections() {
|
|
1398
|
+
const apiResponse = this.attractionTask.value;
|
|
1399
|
+
if (!apiResponse)
|
|
1400
|
+
return nothing;
|
|
1401
|
+
const summary = resolveAttractionLocation(apiResponse.attraction.location);
|
|
1402
|
+
if (!summary)
|
|
1403
|
+
return nothing;
|
|
1404
|
+
const { cityName, citySlug, countryName, countrySlug, countryCode } = summary;
|
|
1405
|
+
const locationName = cityName || countryName;
|
|
1406
|
+
// Each section hides itself, and gives up its own spacing, when its
|
|
1407
|
+
// location has too little to show.
|
|
1408
|
+
return html `
|
|
1409
|
+
<coras-location-highlights
|
|
1410
|
+
country=${countrySlug}
|
|
1411
|
+
city=${citySlug}
|
|
1412
|
+
location-name=${locationName}
|
|
1413
|
+
exclude-id=${this.attractionId}
|
|
1414
|
+
></coras-location-highlights>
|
|
1415
|
+
<coras-location-categories
|
|
1416
|
+
country=${countrySlug}
|
|
1417
|
+
city=${citySlug}
|
|
1418
|
+
country-code=${countryCode}
|
|
1419
|
+
location-name=${locationName}
|
|
1420
|
+
></coras-location-categories>
|
|
1421
|
+
`;
|
|
1422
|
+
}
|
|
1402
1423
|
findSeatedPerformance(options) {
|
|
1403
1424
|
const apiResponse = this.attractionTask.value;
|
|
1404
1425
|
if (this.seatsFallback ||
|
|
@@ -1462,15 +1483,20 @@ let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(PointsMixi
|
|
|
1462
1483
|
</div>
|
|
1463
1484
|
`;
|
|
1464
1485
|
}
|
|
1486
|
+
// The navbar is a light-DOM child the SDK slots into the page (sdk/chrome.ts)
|
|
1487
|
+
// and picks the modal or dropdown for its own layout.
|
|
1488
|
+
openNavbarBasket() {
|
|
1489
|
+
this.querySelector("coras-navbar")?.openBasket();
|
|
1490
|
+
}
|
|
1465
1491
|
handleGoToBasketButtonClicked() {
|
|
1466
|
-
this.handleBasketModalToggle();
|
|
1492
|
+
void this.handleBasketModalToggle();
|
|
1467
1493
|
const isMobile = window.matchMedia("(max-width: 800px)").matches;
|
|
1468
1494
|
if (isMobile) {
|
|
1469
|
-
|
|
1495
|
+
this.openNavbarBasket();
|
|
1470
1496
|
scrollToTop();
|
|
1471
1497
|
}
|
|
1472
1498
|
else {
|
|
1473
|
-
|
|
1499
|
+
this.openNavbarBasket();
|
|
1474
1500
|
scrollToTop();
|
|
1475
1501
|
}
|
|
1476
1502
|
}
|
|
@@ -1513,6 +1539,7 @@ let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(PointsMixi
|
|
|
1513
1539
|
</div>
|
|
1514
1540
|
${this.renderAvailabilityOptions()}
|
|
1515
1541
|
<div class="description">${this.renderDescription()}</div>
|
|
1542
|
+
${this.renderRelatedSections()}
|
|
1516
1543
|
${this.isReservationPreviewModalOpened
|
|
1517
1544
|
? this.renderReservationPreviewModal()
|
|
1518
1545
|
: nothing}
|
|
@@ -1526,7 +1553,9 @@ let CorasDetailsPage = class CorasDetailsPage extends ErrorModalMixin(PointsMixi
|
|
|
1526
1553
|
${this.renderErrorModal({
|
|
1527
1554
|
assetsURL: this.assetsURL,
|
|
1528
1555
|
buttonLabel: msg("Refresh the page"),
|
|
1529
|
-
onRetry: () =>
|
|
1556
|
+
onRetry: () => {
|
|
1557
|
+
void this.attractionTask.run();
|
|
1558
|
+
},
|
|
1530
1559
|
onHelp: () => this.dispatchPageUpdate({ page: "help" }),
|
|
1531
1560
|
})}
|
|
1532
1561
|
<slot name="footer" slot="footer"></slot>
|
|
@@ -1567,12 +1596,6 @@ __decorate([
|
|
|
1567
1596
|
__decorate([
|
|
1568
1597
|
state()
|
|
1569
1598
|
], CorasDetailsPage.prototype, "selectedTimeOptions", void 0);
|
|
1570
|
-
__decorate([
|
|
1571
|
-
state()
|
|
1572
|
-
], CorasDetailsPage.prototype, "isSingleDayAvailability", void 0);
|
|
1573
|
-
__decorate([
|
|
1574
|
-
state()
|
|
1575
|
-
], CorasDetailsPage.prototype, "availabilityDays", void 0);
|
|
1576
1599
|
__decorate([
|
|
1577
1600
|
state()
|
|
1578
1601
|
], CorasDetailsPage.prototype, "isReservationPreviewModalOpened", void 0);
|
|
@@ -1585,6 +1608,9 @@ __decorate([
|
|
|
1585
1608
|
__decorate([
|
|
1586
1609
|
state()
|
|
1587
1610
|
], CorasDetailsPage.prototype, "hasAvailabilityError", void 0);
|
|
1611
|
+
__decorate([
|
|
1612
|
+
state()
|
|
1613
|
+
], CorasDetailsPage.prototype, "availabilityRequestKey", void 0);
|
|
1588
1614
|
__decorate([
|
|
1589
1615
|
state()
|
|
1590
1616
|
], CorasDetailsPage.prototype, "loadingSelectionIds", void 0);
|