@duffel/components 3.11.0 → 3.12.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/README.md +6 -3
- package/package.json +4 -3
- package/components/DuffelAncillaries/Counter.d.ts +0 -10
- package/components/DuffelAncillaries/DuffelAncillaries.d.ts +0 -3
- package/components/DuffelAncillaries/DuffelAncillariesCustomElement.d.ts +0 -12
- package/components/DuffelAncillaries/bags/BaggageSelectionCard.d.ts +0 -12
- package/components/DuffelAncillaries/bags/BaggageSelectionController.d.ts +0 -14
- package/components/DuffelAncillaries/bags/BaggageSelectionModal.d.ts +0 -12
- package/components/DuffelAncillaries/bags/BaggageSelectionModalBody.d.ts +0 -12
- package/components/DuffelAncillaries/bags/BaggageSelectionModalBodyPassenger.d.ts +0 -14
- package/components/DuffelAncillaries/bags/BaggageSelectionModalFooter.d.ts +0 -15
- package/components/DuffelAncillaries/bags/BaggageSelectionModalHeader.d.ts +0 -10
- package/components/DuffelAncillaries/bags/IncludedBaggageBanner.d.ts +0 -8
- package/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionCard.d.ts +0 -11
- package/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModal.d.ts +0 -12
- package/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalBody.d.ts +0 -8
- package/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalBodyListItem.d.ts +0 -4
- package/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalFooter.d.ts +0 -12
- package/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalHeader.d.ts +0 -2
- package/components/DuffelAncillaries/seats/Amenity.d.ts +0 -7
- package/components/DuffelAncillaries/seats/DeckSelect.d.ts +0 -15
- package/components/DuffelAncillaries/seats/Element.d.ts +0 -16
- package/components/DuffelAncillaries/seats/EmptyElement.d.ts +0 -2
- package/components/DuffelAncillaries/seats/ExitElement.d.ts +0 -6
- package/components/DuffelAncillaries/seats/Legend.d.ts +0 -13
- package/components/DuffelAncillaries/seats/Row.d.ts +0 -14
- package/components/DuffelAncillaries/seats/RowSection.d.ts +0 -18
- package/components/DuffelAncillaries/seats/SeatElement.d.ts +0 -14
- package/components/DuffelAncillaries/seats/SeatInfo.d.ts +0 -8
- package/components/DuffelAncillaries/seats/SeatMap.d.ts +0 -13
- package/components/DuffelAncillaries/seats/SeatMapUnavailable.d.ts +0 -2
- package/components/DuffelAncillaries/seats/SeatSelectionCard.d.ts +0 -13
- package/components/DuffelAncillaries/seats/SeatSelectionModal.d.ts +0 -15
- package/components/DuffelAncillaries/seats/SeatSelectionModalBody.d.ts +0 -4
- package/components/DuffelAncillaries/seats/SeatSelectionModalFooter.d.ts +0 -16
- package/components/DuffelAncillaries/seats/SeatSelectionModalHeader.d.ts +0 -11
- package/components/DuffelAncillaries/seats/SeatUnavailable.d.ts +0 -6
- package/components/DuffelCardForm/DuffelCardForm.d.ts +0 -4
- package/components/DuffelCardForm/DuffelCardFormCustomElement.d.ts +0 -34
- package/components/DuffelCardForm/lib/getIFrameEventListener.d.ts +0 -7
- package/components/DuffelCardForm/lib/getIFrameOriginForEnvironment.d.ts +0 -2
- package/components/DuffelCardForm/lib/getIframeURL.d.ts +0 -2
- package/components/DuffelCardForm/lib/getPathnameForIntent.d.ts +0 -2
- package/components/DuffelCardForm/lib/getTokenFromClientKey.d.ts +0 -1
- package/components/DuffelCardForm/lib/postMessageToCreateCardForTemporaryUse.d.ts +0 -1
- package/components/DuffelCardForm/lib/postMessageToSaveCard.d.ts +0 -1
- package/components/DuffelCardForm/lib/postMessageWithStyles.d.ts +0 -2
- package/components/DuffelCardForm/lib/types.d.ts +0 -154
- package/components/DuffelCardForm/lib/useDuffelCardFormActions.d.ts +0 -24
- package/components/DuffelNGSView/AirlineSelector.d.ts +0 -10
- package/components/DuffelNGSView/DuffelNGSView.d.ts +0 -14
- package/components/DuffelNGSView/FilterControl.d.ts +0 -20
- package/components/DuffelNGSView/FilterControls.d.ts +0 -13
- package/components/DuffelNGSView/NGSShelfInfoCard.d.ts +0 -7
- package/components/DuffelNGSView/NGSSliceFareCard.d.ts +0 -10
- package/components/DuffelNGSView/NGSTable.d.ts +0 -15
- package/components/DuffelNGSView/SliceSummary.d.ts +0 -7
- package/components/DuffelNGSView/SortingControl.d.ts +0 -23
- package/components/DuffelNGSView/StopsSelector.d.ts +0 -8
- package/components/DuffelNGSView/TimeRangeSelector.d.ts +0 -8
- package/components/DuffelNGSView/lib/deduplicate-mapped-offers-by-fare-brand.d.ts +0 -7
- package/components/DuffelNGSView/lib/does-slice-have-mixed-cabins.d.ts +0 -4
- package/components/DuffelNGSView/lib/filter-results.d.ts +0 -14
- package/components/DuffelNGSView/lib/get-initial-filter-values.d.ts +0 -4
- package/components/DuffelNGSView/lib/get-max-baggages-for-offer-slice.d.ts +0 -8
- package/components/DuffelNGSView/lib/getAirlines.d.ts +0 -4
- package/components/DuffelNGSView/lib/group-offers-for-ngs-view.d.ts +0 -6
- package/components/DuffelNGSView/lib/index.d.ts +0 -14
- package/components/DuffelNGSView/lib/sort-ngs-rows-by-duration.d.ts +0 -5
- package/components/DuffelNGSView/lib/sort-ngs-rows-by-recommended.d.ts +0 -2
- package/components/DuffelNGSView/lib/sort-ngs-rows-by-shelf-price.d.ts +0 -6
- package/components/DuffelNGSView/lib/useFilters.d.ts +0 -28
- package/components/DuffelPayments/DuffelPayments.d.ts +0 -11
- package/components/DuffelPayments/DuffelPaymentsCustomElement.d.ts +0 -13
- package/components/MapboxPlacesLookup/MapboxPlacesLookup.d.ts +0 -12
- package/components/MapboxPlacesLookup/MapboxPlacesLookupCustomElement.d.ts +0 -13
- package/components/MapboxPlacesLookup/lib/getPlacesFromMapboxClient.d.ts +0 -7
- package/components/OfferSlice/OfferSlice.d.ts +0 -7
- package/components/OfferSlice/OfferSliceConditions.d.ts +0 -7
- package/components/OfferSlice/OfferSliceDetailItem.d.ts +0 -7
- package/components/OfferSlice/OfferSliceDetailLayoverItem.d.ts +0 -8
- package/components/OfferSlice/OfferSliceDetailTravelItem.d.ts +0 -9
- package/components/OfferSlice/lib/getHighlightStyles.d.ts +0 -7
- package/components/OfferSliceModal/OfferSliceModal.d.ts +0 -7
- package/components/PlacesLookup/PlacesLookup.d.ts +0 -20
- package/components/Stays/StaysAmenities.d.ts +0 -9
- package/components/Stays/StaysAmenitiesCustomElement.d.ts +0 -12
- package/components/Stays/StaysCancellationTimeline/Policy.d.ts +0 -8
- package/components/Stays/StaysCancellationTimeline/StaysCancellationTimeline.d.ts +0 -12
- package/components/Stays/StaysCancellationTimeline/StaysCancellationTimelineDeposit.d.ts +0 -12
- package/components/Stays/StaysCancellationTimeline/StaysCancellationTimelineGuarantee.d.ts +0 -12
- package/components/Stays/StaysCancellationTimeline/StaysCancellationTimelinePayNow.d.ts +0 -12
- package/components/Stays/StaysCancellationTimeline/TimelineItem.d.ts +0 -15
- package/components/Stays/StaysCancellationTimeline/lib/isTimezoneDate.d.ts +0 -4
- package/components/Stays/StaysCancellationTimeline/lib/renderTimelineDateTime.d.ts +0 -1
- package/components/Stays/StaysRating.d.ts +0 -6
- package/components/Stays/StaysRatingCustomElement.d.ts +0 -14
- package/components/Stays/StaysRoomRateCard.d.ts +0 -13
- package/components/Stays/StaysRoomRateCardCustomElement.d.ts +0 -14
- package/components/Stays/StaysSummary.d.ts +0 -12
- package/components/Stays/StaysSummaryCustomElement.d.ts +0 -12
- package/components/Stays/lib/getRateLabel.d.ts +0 -2
- package/components/Stays/lib/types.d.ts +0 -29
- package/components/shared/AirlineLogo.d.ts +0 -8
- package/components/shared/AnimatedLoaderEllipsis.d.ts +0 -2
- package/components/shared/Button.d.ts +0 -23
- package/components/shared/Card.d.ts +0 -14
- package/components/shared/ErrorBoundary.d.ts +0 -13
- package/components/shared/FetchOfferErrorState.d.ts +0 -5
- package/components/shared/HSpace.d.ts +0 -28
- package/components/shared/Icon.d.ts +0 -98
- package/components/shared/IconButton.d.ts +0 -16
- package/components/shared/Modal.d.ts +0 -14
- package/components/shared/NonIdealState.d.ts +0 -4
- package/components/shared/RadioButton.d.ts +0 -7
- package/components/shared/SliceCarriersTitle.d.ts +0 -8
- package/components/shared/Stamp.d.ts +0 -7
- package/components/shared/Tabs.d.ts +0 -16
- package/components/shared/VSpace.d.ts +0 -14
- package/components/shared/WithComponentStyles.d.ts +0 -7
- package/custom-elements.d.ts +0 -12
- package/custom-elements.js +0 -70
- package/custom-elements.js.map +0 -7
- package/fixtures/offer-requests/orq_duplicates.d.ts +0 -2
- package/fixtures/passengers/mock_passengers.d.ts +0 -4
- package/functions/createThreeDSecureSession/client.d.ts +0 -43
- package/functions/createThreeDSecureSession/createThreeDSecureSession.d.ts +0 -25
- package/functions/createThreeDSecureSession/initEvervault.d.ts +0 -1
- package/functions/createThreeDSecureSession/loadEvervaultScript.d.ts +0 -1
- package/functions/hasService.d.ts +0 -3
- package/functions.d.ts +0 -10
- package/index.d.ts +0 -19
- package/index.js +0 -55
- package/index.js.map +0 -7
- package/lib/captureErrorInSentry.d.ts +0 -1
- package/lib/colors.d.ts +0 -31
- package/lib/compileCreateOrderPayload.d.ts +0 -13
- package/lib/convertDurationToString.d.ts +0 -1
- package/lib/createPriceFormatters.d.ts +0 -12
- package/lib/fetchFromDuffelAPI.d.ts +0 -8
- package/lib/fetchFromFixtures.d.ts +0 -3
- package/lib/formatAvailableServices.d.ts +0 -12
- package/lib/formatDate.d.ts +0 -2
- package/lib/formatSeatMaps.d.ts +0 -4
- package/lib/getAirlinesText.d.ts +0 -2
- package/lib/getBaggageServiceDescription.d.ts +0 -2
- package/lib/getCabinsForSegmentAndDeck.d.ts +0 -3
- package/lib/getCarriers.d.ts +0 -6
- package/lib/getCurrencyForSeatMaps.d.ts +0 -10
- package/lib/getCurrencyForServices.d.ts +0 -11
- package/lib/getDateObject.d.ts +0 -10
- package/lib/getDateString.d.ts +0 -73
- package/lib/getDayDiff.d.ts +0 -5
- package/lib/getDurationString.d.ts +0 -1
- package/lib/getFareBrandName.d.ts +0 -2
- package/lib/getFirstSeatElementMatchingCriteria.d.ts +0 -4
- package/lib/getLayoverOriginDestinationKey.d.ts +0 -1
- package/lib/getPassengerBySegmentList.d.ts +0 -7
- package/lib/getPassengerInitials.d.ts +0 -1
- package/lib/getPassengerMapById.d.ts +0 -4
- package/lib/getPassengerName.d.ts +0 -2
- package/lib/getRowNumber.d.ts +0 -2
- package/lib/getSegmentDates.d.ts +0 -5
- package/lib/getSegmentFlightNumber.d.ts +0 -2
- package/lib/getSegmentList.d.ts +0 -3
- package/lib/getServicePriceMapById.d.ts +0 -4
- package/lib/getSliceDetails.d.ts +0 -3
- package/lib/getSymbols.d.ts +0 -2
- package/lib/getTimeString.d.ts +0 -1
- package/lib/getTotalAmountForServices.d.ts +0 -4
- package/lib/getTotalQuantity.d.ts +0 -2
- package/lib/getTravelItem.d.ts +0 -3
- package/lib/hasAvailableSeatService.d.ts +0 -3
- package/lib/hasBaggageServiceOfSameMetadataTypeAlreadyBeenSelected.d.ts +0 -4
- package/lib/hasHighLuminance.d.ts +0 -1
- package/lib/hasService.d.ts +0 -2
- package/lib/hasWings.d.ts +0 -2
- package/lib/isAmenityElement.d.ts +0 -3
- package/lib/isBaggageService.d.ts +0 -3
- package/lib/isCancelForAnyReasonService.d.ts +0 -3
- package/lib/isFixtureOfferId.d.ts +0 -2
- package/lib/isISO8601Duration.d.ts +0 -2
- package/lib/isPayloadComplete.d.ts +0 -3
- package/lib/isSeatElement.d.ts +0 -3
- package/lib/isValidDateString.d.ts +0 -6
- package/lib/logging.d.ts +0 -46
- package/lib/moneyStringFormatter.d.ts +0 -8
- package/lib/offerIsExpired.d.ts +0 -2
- package/lib/retrieveOffer.d.ts +0 -3
- package/lib/retrieveOfferFromDuffelAPI.d.ts +0 -1
- package/lib/retrieveSeatMaps.d.ts +0 -3
- package/lib/retrieveSeatMapsFromDuffelAPI.d.ts +0 -1
- package/lib/setBodyScrollability.d.ts +0 -1
- package/lib/toUTCDate.d.ts +0 -1
- package/lib/validateProps.d.ts +0 -7
- package/lib/withPlural.d.ts +0 -1
- package/stories/AirlineLogo.stories.d.ts +0 -3
- package/stories/AirlineSelector.stories.d.ts +0 -3
- package/stories/BaggageSelectionModalHeader.stories.d.ts +0 -6
- package/stories/Button.stories.d.ts +0 -15
- package/stories/DuffelAncillaries.stories.d.ts +0 -24
- package/stories/DuffelCardForm.stories.d.ts +0 -7
- package/stories/DuffelNGSView.stories.d.ts +0 -8
- package/stories/DuffelPayments.stories.d.ts +0 -7
- package/stories/Icon.stories.d.ts +0 -3
- package/stories/IconButton.stories.d.ts +0 -8
- package/stories/MapboxPlacesLookup.stories.d.ts +0 -5
- package/stories/NGSShelfInfoCard.stories.d.ts +0 -3
- package/stories/NGSSliceFareCard.stories.d.ts +0 -3
- package/stories/OfferSlice.stories.d.ts +0 -5
- package/stories/OfferSliceModal.stories.d.ts +0 -6
- package/stories/PlacesLookup.stories.d.ts +0 -3
- package/stories/SeatMap.stories.d.ts +0 -4
- package/stories/SliceCarriersTitle.stories.d.ts +0 -10
- package/stories/SliceSummary.stories.d.ts +0 -5
- package/stories/StaysAmenities.stories.d.ts +0 -10
- package/stories/StaysCancellationTimeline.stories.d.ts +0 -122
- package/stories/StaysRating.stories.d.ts +0 -16
- package/stories/StaysRoomRateCard.stories.d.ts +0 -141
- package/stories/StaysSummary.stories.d.ts +0 -47
- package/tests/components/DuffelAncillaries.test.d.ts +0 -1
- package/tests/functions/createThreeDSecureSession.test.d.ts +0 -1
- package/tests/lib/convertDurationToString.test.d.ts +0 -1
- package/tests/lib/createPriceFormatters.test.d.ts +0 -1
- package/tests/lib/formatAvailableServices.test.d.ts +0 -1
- package/tests/lib/formatSeatMaps.test.d.ts +0 -1
- package/tests/lib/getAirlines.test.d.ts +0 -1
- package/tests/lib/getAirlinesText.test.d.ts +0 -1
- package/tests/lib/getCarriers.test.d.ts +0 -1
- package/tests/lib/getCurrencyForServices.test.d.ts +0 -1
- package/tests/lib/getDateObject.test.d.ts +0 -1
- package/tests/lib/getDateString.spec.d.ts +0 -1
- package/tests/lib/getDayDiff.test.d.ts +0 -1
- package/tests/lib/getDurationString.test.d.ts +0 -1
- package/tests/lib/getFareBrandName.test.d.ts +0 -1
- package/tests/lib/getLayoverOriginDestinationKey.test.d.ts +0 -1
- package/tests/lib/getRateLabel.spec.d.ts +0 -1
- package/tests/lib/getSegmentDates.d.ts +0 -1
- package/tests/lib/getSegmentDates.test.d.ts +0 -1
- package/tests/lib/getSegmentFlightNumber.test.d.ts +0 -1
- package/tests/lib/getSliceDetails.test.d.ts +0 -1
- package/tests/lib/getTimeString.test.d.ts +0 -1
- package/tests/lib/getTravelItem.test.d.ts +0 -1
- package/tests/lib/groupOffersForNGSView.test.d.ts +0 -1
- package/tests/lib/hasAvailableSeatService.test.d.ts +0 -1
- package/tests/lib/hasBaggageServiceOfSameMetadataTypeAlreadyBeenSelected.test.d.ts +0 -1
- package/tests/lib/isValidDateString.test.d.ts +0 -1
- package/tests/lib/logging.test.d.ts +0 -1
- package/tests/lib/moneyStringFormatter.test.d.ts +0 -1
- package/tests/lib/toUTCDate.test.d.ts +0 -1
- package/tests/lib/validateProps.test.d.ts +0 -5
- package/tsconfig.tsbuildinfo +0 -1
- package/types/CurrencyConversion.d.ts +0 -10
- package/types/DuffelAncillariesProps.d.ts +0 -115
- package/types/TravelDetails.d.ts +0 -77
- package/types/index.d.ts +0 -4
package/index.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../.yarn/berry/cache/classnames-npm-2.3.2-d2fdae468d-10c0.zip/node_modules/classnames/index.js", "../.yarn/__virtual__/@stripe-react-stripe-js-virtual-25ff75fca0/3/.yarn/berry/cache/@stripe-react-stripe-js-npm-2.1.0-2f15e96dd7-10c0.zip/node_modules/@stripe/react-stripe-js/dist/react-stripe.umd.js", "../../../.yarn/berry/cache/classnames-npm-2.5.1-c7273f3423-10c0.zip/node_modules/classnames/index.js", "../../../.yarn/berry/cache/react-is-npm-18.3.0-da422f699a-10c0.zip/node_modules/react-is/cjs/react-is.production.min.js", "../../../.yarn/berry/cache/react-is-npm-18.3.0-da422f699a-10c0.zip/node_modules/react-is/index.js", "../../../.yarn/berry/cache/duration-fns-npm-3.0.2-d94da6c53a-10c0.zip/node_modules/duration-fns/src/lib/units.ts", "../../../.yarn/berry/cache/duration-fns-npm-3.0.2-d94da6c53a-10c0.zip/node_modules/duration-fns/src/negate.ts", "../../../.yarn/berry/cache/duration-fns-npm-3.0.2-d94da6c53a-10c0.zip/node_modules/duration-fns/src/lib/numberUtils.ts", "../../../.yarn/berry/cache/duration-fns-npm-3.0.2-d94da6c53a-10c0.zip/node_modules/duration-fns/src/lib/parseISODuration.ts", "../../../.yarn/berry/cache/duration-fns-npm-3.0.2-d94da6c53a-10c0.zip/node_modules/duration-fns/src/lib/validate.ts", "../../../.yarn/berry/cache/duration-fns-npm-3.0.2-d94da6c53a-10c0.zip/node_modules/duration-fns/src/lib/cleanDurationObject.ts", "../../../.yarn/berry/cache/duration-fns-npm-3.0.2-d94da6c53a-10c0.zip/node_modules/duration-fns/src/parse.ts", "../../../.yarn/berry/cache/duration-fns-npm-3.0.2-d94da6c53a-10c0.zip/node_modules/duration-fns/src/toUnit.ts", "../../../.yarn/berry/cache/duration-fns-npm-3.0.2-d94da6c53a-10c0.zip/node_modules/duration-fns/src/isNegative.ts", "../../../.yarn/berry/cache/duration-fns-npm-3.0.2-d94da6c53a-10c0.zip/node_modules/duration-fns/src/abs.ts", "../../../.yarn/berry/cache/duration-fns-npm-3.0.2-d94da6c53a-10c0.zip/node_modules/duration-fns/src/lib/dateUtils.ts", "../../../.yarn/berry/cache/duration-fns-npm-3.0.2-d94da6c53a-10c0.zip/node_modules/duration-fns/src/apply.ts", "../../../.yarn/berry/cache/duration-fns-npm-3.0.2-d94da6c53a-10c0.zip/node_modules/duration-fns/src/between.ts", "../../../.yarn/berry/cache/duration-fns-npm-3.0.2-d94da6c53a-10c0.zip/node_modules/duration-fns/src/isZero.ts", "../../../.yarn/berry/cache/duration-fns-npm-3.0.2-d94da6c53a-10c0.zip/node_modules/duration-fns/src/normalize.ts", "../../../.yarn/berry/cache/duration-fns-npm-3.0.2-d94da6c53a-10c0.zip/node_modules/duration-fns/src/sum.ts", "../../../.yarn/berry/cache/duration-fns-npm-3.0.2-d94da6c53a-10c0.zip/node_modules/duration-fns/src/subtract.ts", "../../../.yarn/berry/cache/duration-fns-npm-3.0.2-d94da6c53a-10c0.zip/node_modules/duration-fns/src/lib/getUnitCount.ts", "../../../.yarn/berry/cache/duration-fns-npm-3.0.2-d94da6c53a-10c0.zip/node_modules/duration-fns/src/lib/checkAllUnitsNegative.ts", "../../../.yarn/berry/cache/duration-fns-npm-3.0.2-d94da6c53a-10c0.zip/node_modules/duration-fns/src/toString.ts", "../../../.yarn/berry/cache/duration-fns-npm-3.0.2-d94da6c53a-10c0.zip/node_modules/duration-fns/dist/types.js", "../../../.yarn/berry/cache/duration-fns-npm-3.0.2-d94da6c53a-10c0.zip/node_modules/duration-fns/src/index.ts", "../src/index.ts", "../../../.yarn/berry/cache/@sentry-utils-npm-7.119.2-1fefb3d015-10c0.zip/node_modules/@sentry/src/is.ts", "../../../.yarn/berry/cache/@sentry-utils-npm-7.119.2-1fefb3d015-10c0.zip/node_modules/@sentry/src/string.ts", "../../../.yarn/berry/cache/@sentry-utils-npm-7.119.2-1fefb3d015-10c0.zip/node_modules/@sentry/src/aggregate-errors.ts", "../../../.yarn/berry/cache/@sentry-utils-npm-7.119.2-1fefb3d015-10c0.zip/node_modules/@sentry/src/worldwide.ts", "../../../.yarn/berry/cache/@sentry-utils-npm-7.119.2-1fefb3d015-10c0.zip/node_modules/@sentry/src/browser.ts", "../../../.yarn/berry/cache/@sentry-utils-npm-7.119.2-1fefb3d015-10c0.zip/node_modules/@sentry/src/debug-build.ts", "../../../.yarn/berry/cache/@sentry-utils-npm-7.119.2-1fefb3d015-10c0.zip/node_modules/@sentry/src/logger.ts", "../../../.yarn/berry/cache/@sentry-utils-npm-7.119.2-1fefb3d015-10c0.zip/node_modules/@sentry/src/dsn.ts", "../../../.yarn/berry/cache/@sentry-utils-npm-7.119.2-1fefb3d015-10c0.zip/node_modules/@sentry/src/error.ts", "../../../.yarn/berry/cache/@sentry-utils-npm-7.119.2-1fefb3d015-10c0.zip/node_modules/@sentry/src/object.ts", "../../../.yarn/berry/cache/@sentry-utils-npm-7.119.2-1fefb3d015-10c0.zip/node_modules/@sentry/src/stacktrace.ts", "../../../.yarn/berry/cache/@sentry-utils-npm-7.119.2-1fefb3d015-10c0.zip/node_modules/@sentry/src/instrument/_handlers.ts", "../../../.yarn/berry/cache/@sentry-utils-npm-7.119.2-1fefb3d015-10c0.zip/node_modules/@sentry/src/instrument/console.ts", "../../../.yarn/berry/cache/@sentry-utils-npm-7.119.2-1fefb3d015-10c0.zip/node_modules/@sentry/src/misc.ts", "../../../.yarn/berry/cache/@sentry-utils-npm-7.119.2-1fefb3d015-10c0.zip/node_modules/@sentry/src/instrument/dom.ts", "../../../.yarn/berry/cache/@sentry-utils-npm-7.119.2-1fefb3d015-10c0.zip/node_modules/@sentry/src/supports.ts", "../../../.yarn/berry/cache/@sentry-utils-npm-7.119.2-1fefb3d015-10c0.zip/node_modules/@sentry/src/instrument/fetch.ts", "../../../.yarn/berry/cache/@sentry-utils-npm-7.119.2-1fefb3d015-10c0.zip/node_modules/@sentry/src/instrument/globalError.ts", "../../../.yarn/berry/cache/@sentry-utils-npm-7.119.2-1fefb3d015-10c0.zip/node_modules/@sentry/src/instrument/globalUnhandledRejection.ts", "../../../.yarn/berry/cache/@sentry-utils-npm-7.119.2-1fefb3d015-10c0.zip/node_modules/@sentry/src/vendor/supportsHistory.ts", "../../../.yarn/berry/cache/@sentry-utils-npm-7.119.2-1fefb3d015-10c0.zip/node_modules/@sentry/src/instrument/history.ts", "../../../.yarn/berry/cache/@sentry-utils-npm-7.119.2-1fefb3d015-10c0.zip/node_modules/@sentry/src/instrument/xhr.ts", "../../../.yarn/berry/cache/@sentry-utils-npm-7.119.2-1fefb3d015-10c0.zip/node_modules/@sentry/src/env.ts", "../../../.yarn/berry/cache/@sentry-utils-npm-7.119.2-1fefb3d015-10c0.zip/node_modules/@sentry/src/memo.ts", "../../../.yarn/berry/cache/@sentry-utils-npm-7.119.2-1fefb3d015-10c0.zip/node_modules/@sentry/src/normalize.ts", "../../../.yarn/berry/cache/@sentry-utils-npm-7.119.2-1fefb3d015-10c0.zip/node_modules/@sentry/src/syncpromise.ts", "../../../.yarn/berry/cache/@sentry-utils-npm-7.119.2-1fefb3d015-10c0.zip/node_modules/@sentry/src/promisebuffer.ts", "../../../.yarn/berry/cache/@sentry-utils-npm-7.119.2-1fefb3d015-10c0.zip/node_modules/@sentry/src/url.ts", "../../../.yarn/berry/cache/@sentry-utils-npm-7.119.2-1fefb3d015-10c0.zip/node_modules/@sentry/src/severity.ts", "../../../.yarn/berry/cache/@sentry-utils-npm-7.119.2-1fefb3d015-10c0.zip/node_modules/@sentry/src/time.ts", "../../../.yarn/berry/cache/@sentry-utils-npm-7.119.2-1fefb3d015-10c0.zip/node_modules/@sentry/src/baggage.ts", "../../../.yarn/berry/cache/@sentry-utils-npm-7.119.2-1fefb3d015-10c0.zip/node_modules/@sentry/src/tracing.ts", "../../../.yarn/berry/cache/@sentry-utils-npm-7.119.2-1fefb3d015-10c0.zip/node_modules/@sentry/src/envelope.ts", "../../../.yarn/berry/cache/@sentry-utils-npm-7.119.2-1fefb3d015-10c0.zip/node_modules/@sentry/src/clientreport.ts", "../../../.yarn/berry/cache/@sentry-utils-npm-7.119.2-1fefb3d015-10c0.zip/node_modules/@sentry/src/ratelimit.ts", "../../../.yarn/berry/cache/@sentry-utils-npm-7.119.2-1fefb3d015-10c0.zip/node_modules/@sentry/src/eventbuilder.ts", "../../../.yarn/berry/cache/@sentry-core-npm-7.119.2-7396165669-10c0.zip/node_modules/@sentry/src/debug-build.ts", "../../../.yarn/berry/cache/@sentry-core-npm-7.119.2-7396165669-10c0.zip/node_modules/@sentry/src/constants.ts", "../../../.yarn/berry/cache/@sentry-core-npm-7.119.2-7396165669-10c0.zip/node_modules/@sentry/src/eventProcessors.ts", "../../../.yarn/berry/cache/@sentry-core-npm-7.119.2-7396165669-10c0.zip/node_modules/@sentry/src/session.ts", "../../../.yarn/berry/cache/@sentry-core-npm-7.119.2-7396165669-10c0.zip/node_modules/@sentry/src/utils/spanUtils.ts", "../../../.yarn/berry/cache/@sentry-core-npm-7.119.2-7396165669-10c0.zip/node_modules/@sentry/src/utils/prepareEvent.ts", "../../../.yarn/berry/cache/@sentry-core-npm-7.119.2-7396165669-10c0.zip/node_modules/@sentry/src/exports.ts", "../../../.yarn/berry/cache/@sentry-core-npm-7.119.2-7396165669-10c0.zip/node_modules/@sentry/src/utils/getRootSpan.ts", "../../../.yarn/berry/cache/@sentry-core-npm-7.119.2-7396165669-10c0.zip/node_modules/@sentry/src/tracing/dynamicSamplingContext.ts", "../../../.yarn/berry/cache/@sentry-core-npm-7.119.2-7396165669-10c0.zip/node_modules/@sentry/src/utils/applyScopeDataToEvent.ts", "../../../.yarn/berry/cache/@sentry-core-npm-7.119.2-7396165669-10c0.zip/node_modules/@sentry/src/scope.ts", "../../../.yarn/berry/cache/@sentry-core-npm-7.119.2-7396165669-10c0.zip/node_modules/@sentry/src/version.ts", "../../../.yarn/berry/cache/@sentry-core-npm-7.119.2-7396165669-10c0.zip/node_modules/@sentry/src/hub.ts", "../../../.yarn/berry/cache/@sentry-core-npm-7.119.2-7396165669-10c0.zip/node_modules/@sentry/src/tracing/utils.ts", "../../../.yarn/berry/cache/@sentry-core-npm-7.119.2-7396165669-10c0.zip/node_modules/@sentry/src/tracing/errors.ts", "../../../.yarn/berry/cache/@sentry-core-npm-7.119.2-7396165669-10c0.zip/node_modules/@sentry/src/tracing/spanstatus.ts", "../../../.yarn/berry/cache/@sentry-core-npm-7.119.2-7396165669-10c0.zip/node_modules/@sentry/src/utils/hasTracingEnabled.ts", "../../../.yarn/berry/cache/@sentry-core-npm-7.119.2-7396165669-10c0.zip/node_modules/@sentry/src/tracing/trace.ts", "../../../.yarn/berry/cache/@sentry-core-npm-7.119.2-7396165669-10c0.zip/node_modules/@sentry/src/metrics/metric-summary.ts", "../../../.yarn/berry/cache/@sentry-core-npm-7.119.2-7396165669-10c0.zip/node_modules/@sentry/src/semanticAttributes.ts", "../../../.yarn/berry/cache/@sentry-core-npm-7.119.2-7396165669-10c0.zip/node_modules/@sentry/src/tracing/span.ts", "../../../.yarn/berry/cache/@sentry-core-npm-7.119.2-7396165669-10c0.zip/node_modules/@sentry/src/tracing/transaction.ts", "../../../.yarn/berry/cache/@sentry-core-npm-7.119.2-7396165669-10c0.zip/node_modules/@sentry/src/tracing/idletransaction.ts", "../../../.yarn/berry/cache/@sentry-core-npm-7.119.2-7396165669-10c0.zip/node_modules/@sentry/src/tracing/sampling.ts", "../../../.yarn/berry/cache/@sentry-core-npm-7.119.2-7396165669-10c0.zip/node_modules/@sentry/src/tracing/hubextensions.ts", "../../../.yarn/berry/cache/@sentry-core-npm-7.119.2-7396165669-10c0.zip/node_modules/@sentry/src/tracing/measurement.ts", "../../../.yarn/berry/cache/@sentry-core-npm-7.119.2-7396165669-10c0.zip/node_modules/@sentry/src/envelope.ts", "../../../.yarn/berry/cache/@sentry-core-npm-7.119.2-7396165669-10c0.zip/node_modules/@sentry/src/api.ts", "../../../.yarn/berry/cache/@sentry-core-npm-7.119.2-7396165669-10c0.zip/node_modules/@sentry/src/integration.ts", "../../../.yarn/berry/cache/@sentry-core-npm-7.119.2-7396165669-10c0.zip/node_modules/@sentry/src/metrics/utils.ts", "../../../.yarn/berry/cache/@sentry-core-npm-7.119.2-7396165669-10c0.zip/node_modules/@sentry/src/metrics/envelope.ts", "../../../.yarn/berry/cache/@sentry-core-npm-7.119.2-7396165669-10c0.zip/node_modules/@sentry/src/baseclient.ts", "../../../.yarn/berry/cache/@sentry-core-npm-7.119.2-7396165669-10c0.zip/node_modules/@sentry/src/sdk.ts", "../../../.yarn/berry/cache/@sentry-core-npm-7.119.2-7396165669-10c0.zip/node_modules/@sentry/src/transports/base.ts", "../../../.yarn/berry/cache/@sentry-core-npm-7.119.2-7396165669-10c0.zip/node_modules/@sentry/src/span.ts", "../../../.yarn/berry/cache/@sentry-core-npm-7.119.2-7396165669-10c0.zip/node_modules/@sentry/src/utils/sdkMetadata.ts", "../../../.yarn/berry/cache/@sentry-core-npm-7.119.2-7396165669-10c0.zip/node_modules/@sentry/src/integrations/inboundfilters.ts", "../../../.yarn/berry/cache/@sentry-core-npm-7.119.2-7396165669-10c0.zip/node_modules/@sentry/src/integrations/functiontostring.ts", "../../../.yarn/berry/cache/@sentry-core-npm-7.119.2-7396165669-10c0.zip/node_modules/@sentry/src/integrations/linkederrors.ts", "../../../.yarn/berry/cache/@sentry-core-npm-7.119.2-7396165669-10c0.zip/node_modules/@sentry/src/index.ts", "../../../.yarn/berry/cache/@sentry-internal-tracing-npm-7.119.2-926b283a7f-10c0.zip/node_modules/@sentry-internal/src/common/debug-build.ts", "../../../.yarn/berry/cache/@sentry-internal-tracing-npm-7.119.2-926b283a7f-10c0.zip/node_modules/@sentry-internal/src/browser/types.ts", "../../../.yarn/berry/cache/@sentry-internal-tracing-npm-7.119.2-926b283a7f-10c0.zip/node_modules/@sentry-internal/src/browser/backgroundtab.ts", "../../../.yarn/berry/cache/@sentry-internal-tracing-npm-7.119.2-926b283a7f-10c0.zip/node_modules/@sentry-internal/src/browser/web-vitals/lib/bindReporter.ts", "../../../.yarn/berry/cache/@sentry-internal-tracing-npm-7.119.2-926b283a7f-10c0.zip/node_modules/@sentry-internal/src/browser/web-vitals/lib/generateUniqueID.ts", "../../../.yarn/berry/cache/@sentry-internal-tracing-npm-7.119.2-926b283a7f-10c0.zip/node_modules/@sentry-internal/src/browser/web-vitals/lib/getNavigationEntry.ts", "../../../.yarn/berry/cache/@sentry-internal-tracing-npm-7.119.2-926b283a7f-10c0.zip/node_modules/@sentry-internal/src/browser/web-vitals/lib/getActivationStart.ts", "../../../.yarn/berry/cache/@sentry-internal-tracing-npm-7.119.2-926b283a7f-10c0.zip/node_modules/@sentry-internal/src/browser/web-vitals/lib/initMetric.ts", "../../../.yarn/berry/cache/@sentry-internal-tracing-npm-7.119.2-926b283a7f-10c0.zip/node_modules/@sentry-internal/src/browser/web-vitals/lib/observe.ts", "../../../.yarn/berry/cache/@sentry-internal-tracing-npm-7.119.2-926b283a7f-10c0.zip/node_modules/@sentry-internal/src/browser/web-vitals/lib/onHidden.ts", "../../../.yarn/berry/cache/@sentry-internal-tracing-npm-7.119.2-926b283a7f-10c0.zip/node_modules/@sentry-internal/src/browser/web-vitals/getCLS.ts", "../../../.yarn/berry/cache/@sentry-internal-tracing-npm-7.119.2-926b283a7f-10c0.zip/node_modules/@sentry-internal/src/browser/web-vitals/lib/getVisibilityWatcher.ts", "../../../.yarn/berry/cache/@sentry-internal-tracing-npm-7.119.2-926b283a7f-10c0.zip/node_modules/@sentry-internal/src/browser/web-vitals/getFID.ts", "../../../.yarn/berry/cache/@sentry-internal-tracing-npm-7.119.2-926b283a7f-10c0.zip/node_modules/@sentry-internal/src/browser/web-vitals/lib/polyfills/interactionCountPolyfill.ts", "../../../.yarn/berry/cache/@sentry-internal-tracing-npm-7.119.2-926b283a7f-10c0.zip/node_modules/@sentry-internal/src/browser/web-vitals/getINP.ts", "../../../.yarn/berry/cache/@sentry-internal-tracing-npm-7.119.2-926b283a7f-10c0.zip/node_modules/@sentry-internal/src/browser/web-vitals/getLCP.ts", "../../../.yarn/berry/cache/@sentry-internal-tracing-npm-7.119.2-926b283a7f-10c0.zip/node_modules/@sentry-internal/src/browser/web-vitals/onTTFB.ts", "../../../.yarn/berry/cache/@sentry-internal-tracing-npm-7.119.2-926b283a7f-10c0.zip/node_modules/@sentry-internal/src/browser/instrument.ts", "../../../.yarn/berry/cache/@sentry-internal-tracing-npm-7.119.2-926b283a7f-10c0.zip/node_modules/@sentry-internal/src/browser/metrics/utils.ts", "../../../.yarn/berry/cache/@sentry-internal-tracing-npm-7.119.2-926b283a7f-10c0.zip/node_modules/@sentry-internal/src/browser/metrics/index.ts", "../../../.yarn/berry/cache/@sentry-internal-tracing-npm-7.119.2-926b283a7f-10c0.zip/node_modules/@sentry-internal/src/common/fetch.ts", "../../../.yarn/berry/cache/@sentry-internal-tracing-npm-7.119.2-926b283a7f-10c0.zip/node_modules/@sentry-internal/src/browser/request.ts", "../../../.yarn/berry/cache/@sentry-internal-tracing-npm-7.119.2-926b283a7f-10c0.zip/node_modules/@sentry-internal/src/browser/router.ts", "../../../.yarn/berry/cache/@sentry-internal-tracing-npm-7.119.2-926b283a7f-10c0.zip/node_modules/@sentry-internal/src/browser/browsertracing.ts", "../../../.yarn/berry/cache/@sentry-browser-npm-7.119.2-f001b5b43a-10c0.zip/node_modules/src/helpers.ts", "../../../.yarn/berry/cache/@sentry-browser-npm-7.119.2-f001b5b43a-10c0.zip/node_modules/src/debug-build.ts", "../../../.yarn/berry/cache/@sentry-browser-npm-7.119.2-f001b5b43a-10c0.zip/node_modules/src/eventbuilder.ts", "../../../.yarn/berry/cache/@sentry-browser-npm-7.119.2-f001b5b43a-10c0.zip/node_modules/src/userfeedback.ts", "../../../.yarn/berry/cache/@sentry-browser-npm-7.119.2-f001b5b43a-10c0.zip/node_modules/src/client.ts", "../../../.yarn/berry/cache/@sentry-browser-npm-7.119.2-f001b5b43a-10c0.zip/node_modules/src/transports/utils.ts", "../../../.yarn/berry/cache/@sentry-browser-npm-7.119.2-f001b5b43a-10c0.zip/node_modules/src/transports/fetch.ts", "../../../.yarn/berry/cache/@sentry-browser-npm-7.119.2-f001b5b43a-10c0.zip/node_modules/src/transports/xhr.ts", "../../../.yarn/berry/cache/@sentry-browser-npm-7.119.2-f001b5b43a-10c0.zip/node_modules/src/stack-parsers.ts", "../../../.yarn/berry/cache/@sentry-browser-npm-7.119.2-f001b5b43a-10c0.zip/node_modules/src/integrations/breadcrumbs.ts", "../../../.yarn/berry/cache/@sentry-browser-npm-7.119.2-f001b5b43a-10c0.zip/node_modules/src/integrations/dedupe.ts", "../../../.yarn/berry/cache/@sentry-browser-npm-7.119.2-f001b5b43a-10c0.zip/node_modules/src/integrations/globalhandlers.ts", "../../../.yarn/berry/cache/@sentry-browser-npm-7.119.2-f001b5b43a-10c0.zip/node_modules/src/integrations/httpcontext.ts", "../../../.yarn/berry/cache/@sentry-browser-npm-7.119.2-f001b5b43a-10c0.zip/node_modules/src/integrations/linkederrors.ts", "../../../.yarn/berry/cache/@sentry-browser-npm-7.119.2-f001b5b43a-10c0.zip/node_modules/src/integrations/trycatch.ts", "../../../.yarn/berry/cache/@sentry-browser-npm-7.119.2-f001b5b43a-10c0.zip/node_modules/src/sdk.ts", "../../../.yarn/berry/cache/@sentry-browser-npm-7.119.2-f001b5b43a-10c0.zip/node_modules/src/index.ts", "../../../.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js", "../src/lib/captureErrorInSentry.ts", "../src/components/shared/ErrorBoundary.tsx", "../src/lib/logging.ts", "../src/components/shared/Icon.tsx", "../src/components/shared/Button.tsx", "../src/components/shared/NonIdealState.tsx", "../src/components/shared/FetchOfferErrorState.tsx", "../src/components/shared/WithComponentStyles.tsx", "../src/lib/getServicePriceMapById.ts", "../src/lib/getTotalAmountForServices.ts", "../src/lib/compileCreateOrderPayload.ts", "../src/lib/createPriceFormatters.ts", "../src/lib/isBaggageService.ts", "../src/lib/isCancelForAnyReasonService.ts", "../src/lib/formatAvailableServices.ts", "../src/lib/isSeatElement.ts", "../src/lib/formatSeatMaps.ts", "../src/lib/hasHighLuminance.ts", "../src/lib/isPayloadComplete.ts", "../src/lib/offerIsExpired.ts", "../src/lib/fetchFromDuffelAPI.ts", "../src/lib/fetchFromFixtures.ts", "../src/lib/isFixtureOfferId.ts", "../src/lib/retrieveOfferFromDuffelAPI.ts", "../src/lib/retrieveOffer.ts", "../src/lib/retrieveSeatMapsFromDuffelAPI.ts", "../src/lib/retrieveSeatMaps.ts", "../src/lib/validateProps.ts", "../src/components/DuffelAncillaries/DuffelAncillaries.tsx", "../src/components/shared/AnimatedLoaderEllipsis.tsx", "../src/components/shared/Stamp.tsx", "../src/lib/getCurrencyForServices.ts", "../src/lib/getTotalQuantity.ts", "../src/lib/hasService.ts", "../src/lib/moneyStringFormatter.ts", "../src/lib/withPlural.ts", "../src/components/DuffelAncillaries/bags/BaggageSelectionCard.tsx", "../src/components/shared/Card.tsx", "../src/lib/setBodyScrollability.ts", "../src/components/shared/Modal.tsx", "../src/components/shared/IconButton.tsx", "../src/lib/getPassengerMapById.ts", "../src/lib/getSegmentList.ts", "../src/components/DuffelAncillaries/bags/BaggageSelectionModal.tsx", "../src/lib/getPassengerName.ts", "../src/lib/getBaggageServiceDescription.ts", "../src/lib/hasBaggageServiceOfSameMetadataTypeAlreadyBeenSelected.ts", "../src/components/DuffelAncillaries/Counter.tsx", "../src/components/DuffelAncillaries/bags/BaggageSelectionController.tsx", "../src/components/DuffelAncillaries/bags/IncludedBaggageBanner.tsx", "../src/components/DuffelAncillaries/bags/BaggageSelectionModalBodyPassenger.tsx", "../src/components/DuffelAncillaries/bags/BaggageSelectionModalBody.tsx", "../src/components/DuffelAncillaries/bags/BaggageSelectionModalFooter.tsx", "../src/lib/formatDate.ts", "../src/components/DuffelAncillaries/bags/BaggageSelectionModalHeader.tsx", "../src/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionCard.tsx", "../src/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalBodyListItem.tsx", "../src/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalBody.tsx", "../src/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalFooter.tsx", "../src/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalHeader.tsx", "../src/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModal.tsx", "../src/lib/getFirstSeatElementMatchingCriteria.ts", "../src/lib/getCurrencyForSeatMaps.ts", "../src/lib/hasAvailableSeatService.ts", "../src/components/DuffelAncillaries/seats/SeatSelectionCard.tsx", "../src/lib/getPassengerBySegmentList.ts", "../src/components/DuffelAncillaries/seats/SeatSelectionModal.tsx", "../src/lib/getCabinsForSegmentAndDeck.ts", "../src/lib/getSymbols.ts", "../src/lib/hasWings.ts", "../src/components/DuffelAncillaries/seats/SeatMap.tsx", "../src/components/shared/Tabs.tsx", "../src/components/DuffelAncillaries/seats/DeckSelect.tsx", "../src/components/DuffelAncillaries/seats/Legend.tsx", "../src/lib/getRowNumber.ts", "../src/components/DuffelAncillaries/seats/RowSection.tsx", "../src/lib/isAmenityElement.ts", "../src/components/DuffelAncillaries/seats/Amenity.tsx", "../src/components/DuffelAncillaries/seats/EmptyElement.tsx", "../src/components/DuffelAncillaries/seats/ExitElement.tsx", "../src/lib/getPassengerInitials.ts", "../src/components/DuffelAncillaries/seats/SeatElement.tsx", "../src/components/DuffelAncillaries/seats/SeatInfo.tsx", "../src/components/DuffelAncillaries/seats/SeatUnavailable.tsx", "../src/components/DuffelAncillaries/seats/Element.tsx", "../src/components/DuffelAncillaries/seats/Row.tsx", "../src/components/DuffelAncillaries/seats/SeatMapUnavailable.tsx", "../src/components/DuffelAncillaries/seats/SeatSelectionModalBody.tsx", "../src/components/DuffelAncillaries/seats/SeatSelectionModalFooter.tsx", "../src/components/DuffelAncillaries/seats/SeatSelectionModalHeader.tsx", "../src/components/DuffelPayments/DuffelPayments.tsx", "../../../.yarn/berry/cache/@stripe-stripe-js-npm-1.54.2-a2f6a2f69c-10c0.zip/node_modules/@stripe/stripe-js/dist/stripe.esm.js", "../src/components/shared/HSpace.tsx", "../src/components/Stays/StaysCancellationTimeline/Policy.tsx", "../src/lib/isValidDateString.ts", "../src/lib/getDateObject.ts", "../src/lib/getDateString.ts", "../src/components/shared/VSpace.tsx", "../src/components/Stays/StaysCancellationTimeline/TimelineItem.tsx", "../src/components/Stays/StaysCancellationTimeline/lib/isTimezoneDate.ts", "../../../.yarn/berry/cache/date-fns-npm-4.1.0-764604ee0f-10c0.zip/node_modules/date-fns/locale/en-US/_lib/formatDistance.js", "../../../.yarn/berry/cache/date-fns-npm-4.1.0-764604ee0f-10c0.zip/node_modules/date-fns/locale/_lib/buildFormatLongFn.js", "../../../.yarn/berry/cache/date-fns-npm-4.1.0-764604ee0f-10c0.zip/node_modules/date-fns/locale/en-US/_lib/formatLong.js", "../../../.yarn/berry/cache/date-fns-npm-4.1.0-764604ee0f-10c0.zip/node_modules/date-fns/locale/en-US/_lib/formatRelative.js", "../../../.yarn/berry/cache/date-fns-npm-4.1.0-764604ee0f-10c0.zip/node_modules/date-fns/locale/_lib/buildLocalizeFn.js", "../../../.yarn/berry/cache/date-fns-npm-4.1.0-764604ee0f-10c0.zip/node_modules/date-fns/locale/en-US/_lib/localize.js", "../../../.yarn/berry/cache/date-fns-npm-4.1.0-764604ee0f-10c0.zip/node_modules/date-fns/locale/_lib/buildMatchFn.js", "../../../.yarn/berry/cache/date-fns-npm-4.1.0-764604ee0f-10c0.zip/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js", "../../../.yarn/berry/cache/date-fns-npm-4.1.0-764604ee0f-10c0.zip/node_modules/date-fns/locale/en-US/_lib/match.js", "../../../.yarn/berry/cache/date-fns-npm-4.1.0-764604ee0f-10c0.zip/node_modules/date-fns/locale/en-US.js", "../../../.yarn/berry/cache/date-fns-npm-4.1.0-764604ee0f-10c0.zip/node_modules/date-fns/_lib/defaultOptions.js", "../../../.yarn/berry/cache/date-fns-npm-4.1.0-764604ee0f-10c0.zip/node_modules/date-fns/constants.js", "../../../.yarn/berry/cache/date-fns-npm-4.1.0-764604ee0f-10c0.zip/node_modules/date-fns/constructFrom.js", "../../../.yarn/berry/cache/date-fns-npm-4.1.0-764604ee0f-10c0.zip/node_modules/date-fns/toDate.js", "../../../.yarn/berry/cache/date-fns-npm-4.1.0-764604ee0f-10c0.zip/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js", "../../../.yarn/berry/cache/date-fns-npm-4.1.0-764604ee0f-10c0.zip/node_modules/date-fns/_lib/normalizeDates.js", "../../../.yarn/berry/cache/date-fns-npm-4.1.0-764604ee0f-10c0.zip/node_modules/date-fns/startOfDay.js", "../../../.yarn/berry/cache/date-fns-npm-4.1.0-764604ee0f-10c0.zip/node_modules/date-fns/differenceInCalendarDays.js", "../../../.yarn/berry/cache/date-fns-npm-4.1.0-764604ee0f-10c0.zip/node_modules/date-fns/startOfYear.js", "../../../.yarn/berry/cache/date-fns-npm-4.1.0-764604ee0f-10c0.zip/node_modules/date-fns/getDayOfYear.js", "../../../.yarn/berry/cache/date-fns-npm-4.1.0-764604ee0f-10c0.zip/node_modules/date-fns/startOfWeek.js", "../../../.yarn/berry/cache/date-fns-npm-4.1.0-764604ee0f-10c0.zip/node_modules/date-fns/startOfISOWeek.js", "../../../.yarn/berry/cache/date-fns-npm-4.1.0-764604ee0f-10c0.zip/node_modules/date-fns/getISOWeekYear.js", "../../../.yarn/berry/cache/date-fns-npm-4.1.0-764604ee0f-10c0.zip/node_modules/date-fns/startOfISOWeekYear.js", "../../../.yarn/berry/cache/date-fns-npm-4.1.0-764604ee0f-10c0.zip/node_modules/date-fns/getISOWeek.js", "../../../.yarn/berry/cache/date-fns-npm-4.1.0-764604ee0f-10c0.zip/node_modules/date-fns/getWeekYear.js", "../../../.yarn/berry/cache/date-fns-npm-4.1.0-764604ee0f-10c0.zip/node_modules/date-fns/startOfWeekYear.js", "../../../.yarn/berry/cache/date-fns-npm-4.1.0-764604ee0f-10c0.zip/node_modules/date-fns/getWeek.js", "../../../.yarn/berry/cache/date-fns-npm-4.1.0-764604ee0f-10c0.zip/node_modules/date-fns/_lib/addLeadingZeros.js", "../../../.yarn/berry/cache/date-fns-npm-4.1.0-764604ee0f-10c0.zip/node_modules/date-fns/_lib/format/lightFormatters.js", "../../../.yarn/berry/cache/date-fns-npm-4.1.0-764604ee0f-10c0.zip/node_modules/date-fns/_lib/format/formatters.js", "../../../.yarn/berry/cache/date-fns-npm-4.1.0-764604ee0f-10c0.zip/node_modules/date-fns/_lib/format/longFormatters.js", "../../../.yarn/berry/cache/date-fns-npm-4.1.0-764604ee0f-10c0.zip/node_modules/date-fns/_lib/protectedTokens.js", "../../../.yarn/berry/cache/date-fns-npm-4.1.0-764604ee0f-10c0.zip/node_modules/date-fns/isDate.js", "../../../.yarn/berry/cache/date-fns-npm-4.1.0-764604ee0f-10c0.zip/node_modules/date-fns/isValid.js", "../../../.yarn/berry/cache/date-fns-npm-4.1.0-764604ee0f-10c0.zip/node_modules/date-fns/format.js", "../../../.yarn/berry/cache/date-fns-npm-4.1.0-764604ee0f-10c0.zip/node_modules/date-fns/getDefaultOptions.js", "../.yarn/__virtual__/date-fns-tz-virtual-9c4e18aaa0/3/.yarn/berry/cache/date-fns-tz-npm-3.2.0-fe150c9e17-10c0.zip/node_modules/date-fns-tz/dist/esm/_lib/tzIntlTimeZoneName/index.js", "../.yarn/__virtual__/date-fns-tz-virtual-9c4e18aaa0/3/.yarn/berry/cache/date-fns-tz-npm-3.2.0-fe150c9e17-10c0.zip/node_modules/date-fns-tz/dist/esm/_lib/tzTokenizeDate/index.js", "../.yarn/__virtual__/date-fns-tz-virtual-9c4e18aaa0/3/.yarn/berry/cache/date-fns-tz-npm-3.2.0-fe150c9e17-10c0.zip/node_modules/date-fns-tz/dist/esm/_lib/newDateUTC/index.js", "../.yarn/__virtual__/date-fns-tz-virtual-9c4e18aaa0/3/.yarn/berry/cache/date-fns-tz-npm-3.2.0-fe150c9e17-10c0.zip/node_modules/date-fns-tz/dist/esm/_lib/tzParseTimezone/index.js", "../.yarn/__virtual__/date-fns-tz-virtual-9c4e18aaa0/3/.yarn/berry/cache/date-fns-tz-npm-3.2.0-fe150c9e17-10c0.zip/node_modules/date-fns-tz/dist/esm/format/formatters/index.js", "../.yarn/__virtual__/date-fns-tz-virtual-9c4e18aaa0/3/.yarn/berry/cache/date-fns-tz-npm-3.2.0-fe150c9e17-10c0.zip/node_modules/date-fns-tz/dist/esm/_lib/getTimezoneOffsetInMilliseconds/index.js", "../.yarn/__virtual__/date-fns-tz-virtual-9c4e18aaa0/3/.yarn/berry/cache/date-fns-tz-npm-3.2.0-fe150c9e17-10c0.zip/node_modules/date-fns-tz/dist/esm/_lib/tzPattern/index.js", "../.yarn/__virtual__/date-fns-tz-virtual-9c4e18aaa0/3/.yarn/berry/cache/date-fns-tz-npm-3.2.0-fe150c9e17-10c0.zip/node_modules/date-fns-tz/dist/esm/toDate/index.js", "../.yarn/__virtual__/date-fns-tz-virtual-9c4e18aaa0/3/.yarn/berry/cache/date-fns-tz-npm-3.2.0-fe150c9e17-10c0.zip/node_modules/date-fns-tz/dist/esm/format/index.js", "../src/components/Stays/StaysCancellationTimeline/lib/renderTimelineDateTime.tsx", "../src/components/Stays/StaysCancellationTimeline/StaysCancellationTimelineDeposit.tsx", "../src/components/Stays/StaysCancellationTimeline/StaysCancellationTimelineGuarantee.tsx", "../src/components/Stays/StaysCancellationTimeline/StaysCancellationTimelinePayNow.tsx", "../src/components/Stays/StaysCancellationTimeline/StaysCancellationTimeline.tsx", "../src/components/Stays/StaysRating.tsx", "../src/components/Stays/lib/types.ts", "../src/components/Stays/StaysSummary.tsx", "../src/components/Stays/StaysAmenities.tsx", "../src/components/Stays/StaysRoomRateCard.tsx", "../src/components/Stays/lib/getRateLabel.ts", "../src/components/shared/RadioButton.tsx", "../src/components/DuffelNGSView/DuffelNGSView.tsx", "../src/components/shared/AirlineLogo.tsx", "../src/components/DuffelNGSView/FilterControl.tsx", "../src/components/DuffelNGSView/AirlineSelector.tsx", "../src/components/DuffelNGSView/StopsSelector.tsx", "../../../.yarn/berry/cache/@babel-runtime-npm-7.26.10-d01a90d446-10c0.zip/node_modules/@babel/runtime/helpers/esm/typeof.js", "../../../.yarn/berry/cache/@babel-runtime-npm-7.26.10-d01a90d446-10c0.zip/node_modules/@babel/runtime/helpers/esm/toPrimitive.js", "../../../.yarn/berry/cache/@babel-runtime-npm-7.26.10-d01a90d446-10c0.zip/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js", "../../../.yarn/berry/cache/@babel-runtime-npm-7.26.10-d01a90d446-10c0.zip/node_modules/@babel/runtime/helpers/esm/defineProperty.js", "../../../.yarn/berry/cache/@babel-runtime-npm-7.26.10-d01a90d446-10c0.zip/node_modules/@babel/runtime/helpers/esm/objectSpread2.js", "../../../.yarn/berry/cache/@babel-runtime-npm-7.26.10-d01a90d446-10c0.zip/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js", "../../../.yarn/berry/cache/@babel-runtime-npm-7.26.10-d01a90d446-10c0.zip/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js", "../../../.yarn/berry/cache/@babel-runtime-npm-7.26.10-d01a90d446-10c0.zip/node_modules/@babel/runtime/helpers/esm/iterableToArray.js", "../../../.yarn/berry/cache/@babel-runtime-npm-7.26.10-d01a90d446-10c0.zip/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js", "../../../.yarn/berry/cache/@babel-runtime-npm-7.26.10-d01a90d446-10c0.zip/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js", "../../../.yarn/berry/cache/@babel-runtime-npm-7.26.10-d01a90d446-10c0.zip/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js", "../../../.yarn/berry/cache/@babel-runtime-npm-7.26.10-d01a90d446-10c0.zip/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js", "../../../.yarn/berry/cache/@babel-runtime-npm-7.26.10-d01a90d446-10c0.zip/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js", "../../../.yarn/berry/cache/@babel-runtime-npm-7.26.10-d01a90d446-10c0.zip/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js", "../../../.yarn/berry/cache/@babel-runtime-npm-7.26.10-d01a90d446-10c0.zip/node_modules/@babel/runtime/helpers/esm/slicedToArray.js", "../.yarn/__virtual__/rc-slider-virtual-72b801cebc/3/.yarn/berry/cache/rc-slider-npm-10.6.2-4035332577-10c0.zip/node_modules/rc-slider/es/Slider.js", "../.yarn/__virtual__/rc-util-virtual-ac32eb3b99/3/.yarn/berry/cache/rc-util-npm-5.39.1-a4973e6604-10c0.zip/node_modules/rc-util/es/hooks/useEvent.js", "../.yarn/__virtual__/rc-util-virtual-ac32eb3b99/3/.yarn/berry/cache/rc-util-npm-5.39.1-a4973e6604-10c0.zip/node_modules/rc-util/es/hooks/useLayoutEffect.js", "../.yarn/__virtual__/rc-util-virtual-ac32eb3b99/3/.yarn/berry/cache/rc-util-npm-5.39.1-a4973e6604-10c0.zip/node_modules/rc-util/es/Dom/canUseDom.js", "../.yarn/__virtual__/rc-util-virtual-ac32eb3b99/3/.yarn/berry/cache/rc-util-npm-5.39.1-a4973e6604-10c0.zip/node_modules/rc-util/es/hooks/useState.js", "../.yarn/__virtual__/rc-util-virtual-ac32eb3b99/3/.yarn/berry/cache/rc-util-npm-5.39.1-a4973e6604-10c0.zip/node_modules/rc-util/es/hooks/useMergedState.js", "../.yarn/__virtual__/rc-util-virtual-ac32eb3b99/3/.yarn/berry/cache/rc-util-npm-5.39.1-a4973e6604-10c0.zip/node_modules/rc-util/es/warning.js", "../.yarn/__virtual__/rc-util-virtual-ac32eb3b99/3/.yarn/berry/cache/rc-util-npm-5.39.1-a4973e6604-10c0.zip/node_modules/rc-util/es/isEqual.js", "../../../.yarn/berry/cache/@babel-runtime-npm-7.26.10-d01a90d446-10c0.zip/node_modules/@babel/runtime/helpers/esm/extends.js", "../../../.yarn/berry/cache/@babel-runtime-npm-7.26.10-d01a90d446-10c0.zip/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js", "../../../.yarn/berry/cache/@babel-runtime-npm-7.26.10-d01a90d446-10c0.zip/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js", "../.yarn/__virtual__/rc-slider-virtual-72b801cebc/3/.yarn/berry/cache/rc-slider-npm-10.6.2-4035332577-10c0.zip/node_modules/rc-slider/es/Handles/index.js", "../.yarn/__virtual__/rc-slider-virtual-72b801cebc/3/.yarn/berry/cache/rc-slider-npm-10.6.2-4035332577-10c0.zip/node_modules/rc-slider/es/util.js", "../.yarn/__virtual__/rc-slider-virtual-72b801cebc/3/.yarn/berry/cache/rc-slider-npm-10.6.2-4035332577-10c0.zip/node_modules/rc-slider/es/Handles/Handle.js", "../.yarn/__virtual__/rc-util-virtual-ac32eb3b99/3/.yarn/berry/cache/rc-util-npm-5.39.1-a4973e6604-10c0.zip/node_modules/rc-util/es/KeyCode.js", "../.yarn/__virtual__/rc-slider-virtual-72b801cebc/3/.yarn/berry/cache/rc-slider-npm-10.6.2-4035332577-10c0.zip/node_modules/rc-slider/es/context.js", "../.yarn/__virtual__/rc-slider-virtual-72b801cebc/3/.yarn/berry/cache/rc-slider-npm-10.6.2-4035332577-10c0.zip/node_modules/rc-slider/es/Marks/index.js", "../.yarn/__virtual__/rc-slider-virtual-72b801cebc/3/.yarn/berry/cache/rc-slider-npm-10.6.2-4035332577-10c0.zip/node_modules/rc-slider/es/Marks/Mark.js", "../.yarn/__virtual__/rc-slider-virtual-72b801cebc/3/.yarn/berry/cache/rc-slider-npm-10.6.2-4035332577-10c0.zip/node_modules/rc-slider/es/Steps/index.js", "../.yarn/__virtual__/rc-slider-virtual-72b801cebc/3/.yarn/berry/cache/rc-slider-npm-10.6.2-4035332577-10c0.zip/node_modules/rc-slider/es/Steps/Dot.js", "../.yarn/__virtual__/rc-slider-virtual-72b801cebc/3/.yarn/berry/cache/rc-slider-npm-10.6.2-4035332577-10c0.zip/node_modules/rc-slider/es/Tracks/index.js", "../.yarn/__virtual__/rc-slider-virtual-72b801cebc/3/.yarn/berry/cache/rc-slider-npm-10.6.2-4035332577-10c0.zip/node_modules/rc-slider/es/Tracks/Track.js", "../.yarn/__virtual__/rc-util-virtual-ac32eb3b99/3/.yarn/berry/cache/rc-util-npm-5.39.1-a4973e6604-10c0.zip/node_modules/rc-util/es/ref.js", "../.yarn/__virtual__/rc-util-virtual-ac32eb3b99/3/.yarn/berry/cache/rc-util-npm-5.39.1-a4973e6604-10c0.zip/node_modules/rc-util/es/hooks/useMemo.js", "../.yarn/__virtual__/rc-slider-virtual-72b801cebc/3/.yarn/berry/cache/rc-slider-npm-10.6.2-4035332577-10c0.zip/node_modules/rc-slider/es/hooks/useDrag.js", "../.yarn/__virtual__/rc-slider-virtual-72b801cebc/3/.yarn/berry/cache/rc-slider-npm-10.6.2-4035332577-10c0.zip/node_modules/rc-slider/es/hooks/useOffset.js", "../.yarn/__virtual__/rc-slider-virtual-72b801cebc/3/.yarn/berry/cache/rc-slider-npm-10.6.2-4035332577-10c0.zip/node_modules/rc-slider/es/index.js", "../src/components/DuffelNGSView/TimeRangeSelector.tsx", "../src/components/DuffelNGSView/FilterControls.tsx", "../src/components/shared/SliceCarriersTitle.tsx", "../src/components/DuffelNGSView/NGSTable.tsx", "../src/components/DuffelNGSView/lib/index.ts", "../src/components/DuffelNGSView/lib/deduplicate-mapped-offers-by-fare-brand.ts", "../src/components/DuffelNGSView/lib/group-offers-for-ngs-view.ts", "../src/lib/isISO8601Duration.ts", "../src/lib/convertDurationToString.ts", "../src/lib/getTimeString.ts", "../src/components/DuffelNGSView/SliceSummary.tsx", "../src/lib/getDurationString.ts", "../src/components/OfferSlice/OfferSlice.tsx", "../src/components/OfferSliceModal/OfferSliceModal.tsx", "../src/components/DuffelNGSView/NGSShelfInfoCard.tsx", "../src/components/DuffelNGSView/NGSSliceFareCard.tsx", "../src/components/DuffelNGSView/lib/does-slice-have-mixed-cabins.ts", "../src/components/DuffelNGSView/lib/get-max-baggages-for-offer-slice.ts", "../src/components/DuffelNGSView/lib/sort-ngs-rows-by-shelf-price.ts", "../src/components/DuffelNGSView/lib/sort-ngs-rows-by-duration.ts", "../src/components/DuffelNGSView/lib/useFilters.ts", "../src/components/DuffelNGSView/lib/filter-results.ts", "../src/components/DuffelNGSView/lib/getAirlines.ts", "../src/components/DuffelNGSView/lib/get-initial-filter-values.ts", "../src/components/DuffelNGSView/SortingControl.tsx", "../src/components/DuffelNGSView/lib/sort-ngs-rows-by-recommended.ts", "../src/components/DuffelCardForm/DuffelCardForm.tsx", "../src/components/DuffelCardForm/lib/getIFrameEventListener.ts", "../src/components/DuffelCardForm/lib/getIFrameOriginForEnvironment.ts", "../src/components/DuffelCardForm/lib/getPathnameForIntent.ts", "../src/components/DuffelCardForm/lib/getTokenFromClientKey.ts", "../src/components/DuffelCardForm/lib/getIframeURL.ts", "../src/components/DuffelCardForm/lib/postMessageToCreateCardForTemporaryUse.ts", "../src/components/DuffelCardForm/lib/postMessageToSaveCard.ts", "../src/components/DuffelCardForm/lib/postMessageWithStyles.ts", "../src/components/DuffelCardForm/lib/useDuffelCardFormActions.ts", "../src/functions/createThreeDSecureSession/client.ts", "../src/functions/createThreeDSecureSession/initEvervault.ts", "../src/functions/createThreeDSecureSession/loadEvervaultScript.ts", "../src/functions/createThreeDSecureSession/createThreeDSecureSession.ts", "../src/functions/hasService.ts"],
|
|
4
|
-
"sourcesContent": ["/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\tvar nativeCodeString = '[native code]';\n\n\tfunction classNames() {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg)) {\n\t\t\t\tif (arg.length) {\n\t\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\t\tif (inner) {\n\t\t\t\t\t\tclasses.push(inner);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\t\t\tclasses.push(arg.toString());\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n", "(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :\n typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) :\n (global = global || self, factory(global.ReactStripe = {}, global.React));\n}(this, (function (exports, React) { 'use strict';\n\n React = React && Object.prototype.hasOwnProperty.call(React, 'default') ? React['default'] : React;\n\n function ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n }\n\n function _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n }\n\n function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n }\n\n function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n }\n\n function _slicedToArray(arr, i) {\n return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();\n }\n\n function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n }\n\n function _iterableToArrayLimit(arr, i) {\n var _i = arr && (typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]);\n\n if (_i == null) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n\n var _s, _e;\n\n try {\n for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n }\n\n function _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n }\n\n function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n }\n\n function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }\n\n function createCommonjsModule(fn, module) {\n \treturn module = { exports: {} }, fn(module, module.exports), module.exports;\n }\n\n /**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n var ReactPropTypesSecret_1 = ReactPropTypesSecret;\n\n function emptyFunction() {}\n\n function emptyFunctionWithReset() {}\n\n emptyFunctionWithReset.resetWarningCache = emptyFunction;\n\n var factoryWithThrowingShims = function () {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret_1) {\n // It is still safe when called from React.\n return;\n }\n\n var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types');\n err.name = 'Invariant Violation';\n throw err;\n }\n shim.isRequired = shim;\n\n function getShim() {\n return shim;\n }\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n\n var ReactPropTypes = {\n array: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n ReactPropTypes.PropTypes = ReactPropTypes;\n return ReactPropTypes;\n };\n\n var propTypes = createCommonjsModule(function (module) {\n /**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = factoryWithThrowingShims();\n }\n });\n\n var usePrevious = function usePrevious(value) {\n var ref = React.useRef(value);\n React.useEffect(function () {\n ref.current = value;\n }, [value]);\n return ref.current;\n };\n\n var isUnknownObject = function isUnknownObject(raw) {\n return raw !== null && _typeof(raw) === 'object';\n };\n var isPromise = function isPromise(raw) {\n return isUnknownObject(raw) && typeof raw.then === 'function';\n }; // We are using types to enforce the `stripe` prop in this lib,\n // but in an untyped integration `stripe` could be anything, so we need\n // to do some sanity validation to prevent type errors.\n\n var isStripe = function isStripe(raw) {\n return isUnknownObject(raw) && typeof raw.elements === 'function' && typeof raw.createToken === 'function' && typeof raw.createPaymentMethod === 'function' && typeof raw.confirmCardPayment === 'function';\n };\n\n var PLAIN_OBJECT_STR = '[object Object]';\n var isEqual = function isEqual(left, right) {\n if (!isUnknownObject(left) || !isUnknownObject(right)) {\n return left === right;\n }\n\n var leftArray = Array.isArray(left);\n var rightArray = Array.isArray(right);\n if (leftArray !== rightArray) return false;\n var leftPlainObject = Object.prototype.toString.call(left) === PLAIN_OBJECT_STR;\n var rightPlainObject = Object.prototype.toString.call(right) === PLAIN_OBJECT_STR;\n if (leftPlainObject !== rightPlainObject) return false; // not sure what sort of special object this is (regexp is one option), so\n // fallback to reference check.\n\n if (!leftPlainObject && !leftArray) return left === right;\n var leftKeys = Object.keys(left);\n var rightKeys = Object.keys(right);\n if (leftKeys.length !== rightKeys.length) return false;\n var keySet = {};\n\n for (var i = 0; i < leftKeys.length; i += 1) {\n keySet[leftKeys[i]] = true;\n }\n\n for (var _i = 0; _i < rightKeys.length; _i += 1) {\n keySet[rightKeys[_i]] = true;\n }\n\n var allKeys = Object.keys(keySet);\n\n if (allKeys.length !== leftKeys.length) {\n return false;\n }\n\n var l = left;\n var r = right;\n\n var pred = function pred(key) {\n return isEqual(l[key], r[key]);\n };\n\n return allKeys.every(pred);\n };\n\n var extractAllowedOptionsUpdates = function extractAllowedOptionsUpdates(options, prevOptions, immutableKeys) {\n if (!isUnknownObject(options)) {\n return null;\n }\n\n return Object.keys(options).reduce(function (newOptions, key) {\n var isUpdated = !isUnknownObject(prevOptions) || !isEqual(options[key], prevOptions[key]);\n\n if (immutableKeys.includes(key)) {\n if (isUpdated) {\n console.warn(\"Unsupported prop change: options.\".concat(key, \" is not a mutable property.\"));\n }\n\n return newOptions;\n }\n\n if (!isUpdated) {\n return newOptions;\n }\n\n return _objectSpread2(_objectSpread2({}, newOptions || {}), {}, _defineProperty({}, key, options[key]));\n }, null);\n };\n\n var INVALID_STRIPE_ERROR = 'Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.'; // We are using types to enforce the `stripe` prop in this lib, but in a real\n // integration `stripe` could be anything, so we need to do some sanity\n // validation to prevent type errors.\n\n var validateStripe = function validateStripe(maybeStripe) {\n if (maybeStripe === null || isStripe(maybeStripe)) {\n return maybeStripe;\n }\n\n throw new Error(INVALID_STRIPE_ERROR);\n };\n\n var parseStripeProp = function parseStripeProp(raw) {\n if (isPromise(raw)) {\n return {\n tag: 'async',\n stripePromise: Promise.resolve(raw).then(validateStripe)\n };\n }\n\n var stripe = validateStripe(raw);\n\n if (stripe === null) {\n return {\n tag: 'empty'\n };\n }\n\n return {\n tag: 'sync',\n stripe: stripe\n };\n };\n\n var ElementsContext = /*#__PURE__*/React.createContext(null);\n ElementsContext.displayName = 'ElementsContext';\n var parseElementsContext = function parseElementsContext(ctx, useCase) {\n if (!ctx) {\n throw new Error(\"Could not find Elements context; You need to wrap the part of your app that \".concat(useCase, \" in an <Elements> provider.\"));\n }\n\n return ctx;\n };\n var CartElementContext = /*#__PURE__*/React.createContext(null);\n CartElementContext.displayName = 'CartElementContext';\n var parseCartElementContext = function parseCartElementContext(ctx, useCase) {\n if (!ctx) {\n throw new Error(\"Could not find Elements context; You need to wrap the part of your app that \".concat(useCase, \" in an <Elements> provider.\"));\n }\n\n return ctx;\n };\n /**\n * The `Elements` provider allows you to use [Element components](https://stripe.com/docs/stripe-js/react#element-components) and access the [Stripe object](https://stripe.com/docs/js/initializing) in any nested component.\n * Render an `Elements` provider at the root of your React app so that it is available everywhere you need it.\n *\n * To use the `Elements` provider, call `loadStripe` from `@stripe/stripe-js` with your publishable key.\n * The `loadStripe` function will asynchronously load the Stripe.js script and initialize a `Stripe` object.\n * Pass the returned `Promise` to `Elements`.\n *\n * @docs https://stripe.com/docs/stripe-js/react#elements-provider\n */\n\n var Elements = function Elements(_ref) {\n var rawStripeProp = _ref.stripe,\n options = _ref.options,\n children = _ref.children;\n var parsed = React.useMemo(function () {\n return parseStripeProp(rawStripeProp);\n }, [rawStripeProp]);\n\n var _React$useState = React.useState(null),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n cart = _React$useState2[0],\n setCart = _React$useState2[1];\n\n var _React$useState3 = React.useState(null),\n _React$useState4 = _slicedToArray(_React$useState3, 2),\n cartState = _React$useState4[0],\n setCartState = _React$useState4[1]; // For a sync stripe instance, initialize into context\n\n\n var _React$useState5 = React.useState(function () {\n return {\n stripe: parsed.tag === 'sync' ? parsed.stripe : null,\n elements: parsed.tag === 'sync' ? parsed.stripe.elements(options) : null\n };\n }),\n _React$useState6 = _slicedToArray(_React$useState5, 2),\n ctx = _React$useState6[0],\n setContext = _React$useState6[1];\n\n React.useEffect(function () {\n var isMounted = true;\n\n var safeSetContext = function safeSetContext(stripe) {\n setContext(function (ctx) {\n // no-op if we already have a stripe instance (https://github.com/stripe/react-stripe-js/issues/296)\n if (ctx.stripe) return ctx;\n return {\n stripe: stripe,\n elements: stripe.elements(options)\n };\n });\n }; // For an async stripePromise, store it in context once resolved\n\n\n if (parsed.tag === 'async' && !ctx.stripe) {\n parsed.stripePromise.then(function (stripe) {\n if (stripe && isMounted) {\n // Only update Elements context if the component is still mounted\n // and stripe is not null. We allow stripe to be null to make\n // handling SSR easier.\n safeSetContext(stripe);\n }\n });\n } else if (parsed.tag === 'sync' && !ctx.stripe) {\n // Or, handle a sync stripe instance going from null -> populated\n safeSetContext(parsed.stripe);\n }\n\n return function () {\n isMounted = false;\n };\n }, [parsed, ctx, options]); // Warn on changes to stripe prop\n\n var prevStripe = usePrevious(rawStripeProp);\n React.useEffect(function () {\n if (prevStripe !== null && prevStripe !== rawStripeProp) {\n console.warn('Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.');\n }\n }, [prevStripe, rawStripeProp]); // Apply updates to elements when options prop has relevant changes\n\n var prevOptions = usePrevious(options);\n React.useEffect(function () {\n if (!ctx.elements) {\n return;\n }\n\n var updates = extractAllowedOptionsUpdates(options, prevOptions, ['clientSecret', 'fonts']);\n\n if (updates) {\n ctx.elements.update(updates);\n }\n }, [options, prevOptions, ctx.elements]); // Attach react-stripe-js version to stripe.js instance\n\n React.useEffect(function () {\n var anyStripe = ctx.stripe;\n\n if (!anyStripe || !anyStripe._registerWrapper || !anyStripe.registerAppInfo) {\n return;\n }\n\n anyStripe._registerWrapper({\n name: 'react-stripe-js',\n version: \"2.1.0\"\n });\n\n anyStripe.registerAppInfo({\n name: 'react-stripe-js',\n version: \"2.1.0\",\n url: 'https://stripe.com/docs/stripe-js/react'\n });\n }, [ctx.stripe]);\n return /*#__PURE__*/React.createElement(ElementsContext.Provider, {\n value: ctx\n }, /*#__PURE__*/React.createElement(CartElementContext.Provider, {\n value: {\n cart: cart,\n setCart: setCart,\n cartState: cartState,\n setCartState: setCartState\n }\n }, children));\n };\n Elements.propTypes = {\n stripe: propTypes.any,\n options: propTypes.object\n };\n var useElementsContextWithUseCase = function useElementsContextWithUseCase(useCaseMessage) {\n var ctx = React.useContext(ElementsContext);\n return parseElementsContext(ctx, useCaseMessage);\n };\n var useCartElementContextWithUseCase = function useCartElementContextWithUseCase(useCaseMessage) {\n var ctx = React.useContext(CartElementContext);\n return parseCartElementContext(ctx, useCaseMessage);\n };\n /**\n * @docs https://stripe.com/docs/stripe-js/react#useelements-hook\n */\n\n var useElements = function useElements() {\n var _useElementsContextWi = useElementsContextWithUseCase('calls useElements()'),\n elements = _useElementsContextWi.elements;\n\n return elements;\n };\n /**\n * @docs https://stripe.com/docs/stripe-js/react#usestripe-hook\n */\n\n var useStripe = function useStripe() {\n var _useElementsContextWi2 = useElementsContextWithUseCase('calls useStripe()'),\n stripe = _useElementsContextWi2.stripe;\n\n return stripe;\n };\n /**\n * @docs https://stripe.com/docs/payments/checkout/cart-element\n */\n\n var useCartElement = function useCartElement() {\n var _useCartElementContex = useCartElementContextWithUseCase('calls useCartElement()'),\n cart = _useCartElementContex.cart;\n\n return cart;\n };\n /**\n * @docs https://stripe.com/docs/payments/checkout/cart-element\n */\n\n var useCartElementState = function useCartElementState() {\n var _useCartElementContex2 = useCartElementContextWithUseCase('calls useCartElementState()'),\n cartState = _useCartElementContex2.cartState;\n\n return cartState;\n };\n /**\n * @docs https://stripe.com/docs/stripe-js/react#elements-consumer\n */\n\n var ElementsConsumer = function ElementsConsumer(_ref2) {\n var children = _ref2.children;\n var ctx = useElementsContextWithUseCase('mounts <ElementsConsumer>'); // Assert to satisfy the busted React.FC return type (it should be ReactNode)\n\n return children(ctx);\n };\n ElementsConsumer.propTypes = {\n children: propTypes.func.isRequired\n };\n\n var useAttachEvent = function useAttachEvent(element, event, cb) {\n var cbDefined = !!cb;\n var cbRef = React.useRef(cb); // In many integrations the callback prop changes on each render.\n // Using a ref saves us from calling element.on/.off every render.\n\n React.useEffect(function () {\n cbRef.current = cb;\n }, [cb]);\n React.useEffect(function () {\n if (!cbDefined || !element) {\n return function () {};\n }\n\n var decoratedCb = function decoratedCb() {\n if (cbRef.current) {\n cbRef.current.apply(cbRef, arguments);\n }\n };\n\n element.on(event, decoratedCb);\n return function () {\n element.off(event, decoratedCb);\n };\n }, [cbDefined, event, element, cbRef]);\n };\n\n var capitalized = function capitalized(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n };\n\n var createElementComponent = function createElementComponent(type, isServer) {\n var displayName = \"\".concat(capitalized(type), \"Element\");\n\n var ClientElement = function ClientElement(_ref) {\n var id = _ref.id,\n className = _ref.className,\n _ref$options = _ref.options,\n options = _ref$options === void 0 ? {} : _ref$options,\n onBlur = _ref.onBlur,\n onFocus = _ref.onFocus,\n onReady = _ref.onReady,\n onChange = _ref.onChange,\n onEscape = _ref.onEscape,\n onClick = _ref.onClick,\n onLoadError = _ref.onLoadError,\n onLoaderStart = _ref.onLoaderStart,\n onNetworksChange = _ref.onNetworksChange,\n onCheckout = _ref.onCheckout,\n onLineItemClick = _ref.onLineItemClick,\n onConfirm = _ref.onConfirm,\n onCancel = _ref.onCancel,\n onShippingAddressChange = _ref.onShippingAddressChange,\n onShippingRateChange = _ref.onShippingRateChange;\n\n var _useElementsContextWi = useElementsContextWithUseCase(\"mounts <\".concat(displayName, \">\")),\n elements = _useElementsContextWi.elements;\n\n var _React$useState = React.useState(null),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n element = _React$useState2[0],\n setElement = _React$useState2[1];\n\n var elementRef = React.useRef(null);\n var domNode = React.useRef(null);\n\n var _useCartElementContex = useCartElementContextWithUseCase(\"mounts <\".concat(displayName, \">\")),\n setCart = _useCartElementContex.setCart,\n setCartState = _useCartElementContex.setCartState; // For every event where the merchant provides a callback, call element.on\n // with that callback. If the merchant ever changes the callback, removes\n // the old callback with element.off and then call element.on with the new one.\n\n\n useAttachEvent(element, 'blur', onBlur);\n useAttachEvent(element, 'focus', onFocus);\n useAttachEvent(element, 'escape', onEscape);\n useAttachEvent(element, 'click', onClick);\n useAttachEvent(element, 'loaderror', onLoadError);\n useAttachEvent(element, 'loaderstart', onLoaderStart);\n useAttachEvent(element, 'networkschange', onNetworksChange);\n useAttachEvent(element, 'lineitemclick', onLineItemClick);\n useAttachEvent(element, 'confirm', onConfirm);\n useAttachEvent(element, 'cancel', onCancel);\n useAttachEvent(element, 'shippingaddresschange', onShippingAddressChange);\n useAttachEvent(element, 'shippingratechange', onShippingRateChange);\n var readyCallback;\n\n if (type === 'cart') {\n readyCallback = function readyCallback(event) {\n setCartState(event);\n onReady && onReady(event);\n };\n } else if (onReady) {\n if (type === 'expressCheckout') {\n // Passes through the event, which includes visible PM types\n readyCallback = onReady;\n } else {\n // For other Elements, pass through the Element itself.\n readyCallback = function readyCallback() {\n onReady(element);\n };\n }\n }\n\n useAttachEvent(element, 'ready', readyCallback);\n var changeCallback = type === 'cart' ? function (event) {\n setCartState(event);\n onChange && onChange(event);\n } : onChange;\n useAttachEvent(element, 'change', changeCallback);\n var checkoutCallback = type === 'cart' ? function (event) {\n setCartState(event);\n onCheckout && onCheckout(event);\n } : onCheckout;\n useAttachEvent(element, 'checkout', checkoutCallback);\n React.useLayoutEffect(function () {\n if (elementRef.current === null && elements && domNode.current !== null) {\n var newElement = elements.create(type, options);\n\n if (type === 'cart' && setCart) {\n // we know that elements.create return value must be of type StripeCartElement if type is 'cart',\n // we need to cast because typescript is not able to infer which overloaded method is used based off param type\n setCart(newElement);\n } // Store element in a ref to ensure it's _immediately_ available in cleanup hooks in StrictMode\n\n\n elementRef.current = newElement; // Store element in state to facilitate event listener attachment\n\n setElement(newElement);\n newElement.mount(domNode.current);\n }\n }, [elements, options, setCart]);\n var prevOptions = usePrevious(options);\n React.useEffect(function () {\n if (!elementRef.current) {\n return;\n }\n\n var updates = extractAllowedOptionsUpdates(options, prevOptions, ['paymentRequest']);\n\n if (updates) {\n elementRef.current.update(updates);\n }\n }, [options, prevOptions]);\n React.useLayoutEffect(function () {\n return function () {\n if (elementRef.current) {\n elementRef.current.destroy();\n elementRef.current = null;\n }\n };\n }, []);\n return /*#__PURE__*/React.createElement(\"div\", {\n id: id,\n className: className,\n ref: domNode\n });\n }; // Only render the Element wrapper in a server environment.\n\n\n var ServerElement = function ServerElement(props) {\n // Validate that we are in the right context by calling useElementsContextWithUseCase.\n useElementsContextWithUseCase(\"mounts <\".concat(displayName, \">\"));\n useCartElementContextWithUseCase(\"mounts <\".concat(displayName, \">\"));\n var id = props.id,\n className = props.className;\n return /*#__PURE__*/React.createElement(\"div\", {\n id: id,\n className: className\n });\n };\n\n var Element = isServer ? ServerElement : ClientElement;\n Element.propTypes = {\n id: propTypes.string,\n className: propTypes.string,\n onChange: propTypes.func,\n onBlur: propTypes.func,\n onFocus: propTypes.func,\n onReady: propTypes.func,\n onEscape: propTypes.func,\n onClick: propTypes.func,\n onLoadError: propTypes.func,\n onLoaderStart: propTypes.func,\n onNetworksChange: propTypes.func,\n onCheckout: propTypes.func,\n onLineItemClick: propTypes.func,\n onConfirm: propTypes.func,\n onCancel: propTypes.func,\n onShippingAddressChange: propTypes.func,\n onShippingRateChange: propTypes.func,\n options: propTypes.object\n };\n Element.displayName = displayName;\n Element.__elementType = type;\n return Element;\n };\n\n var isServer = typeof window === 'undefined';\n /**\n * Requires beta access:\n * Contact [Stripe support](https://support.stripe.com/) for more information.\n *\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var AuBankAccountElement = createElementComponent('auBankAccount', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var CardElement = createElementComponent('card', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var CardNumberElement = createElementComponent('cardNumber', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var CardExpiryElement = createElementComponent('cardExpiry', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var CardCvcElement = createElementComponent('cardCvc', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var FpxBankElement = createElementComponent('fpxBank', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var IbanElement = createElementComponent('iban', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var IdealBankElement = createElementComponent('idealBank', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var P24BankElement = createElementComponent('p24Bank', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var EpsBankElement = createElementComponent('epsBank', isServer);\n var PaymentElement = createElementComponent('payment', isServer);\n /**\n * Requires beta access:\n * Contact [Stripe support](https://support.stripe.com/) for more information.\n *\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var ExpressCheckoutElement = createElementComponent('expressCheckout', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var PaymentRequestButtonElement = createElementComponent('paymentRequestButton', isServer);\n /**\n * Requires beta access:\n * Contact [Stripe support](https://support.stripe.com/) for more information.\n *\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var LinkAuthenticationElement = createElementComponent('linkAuthentication', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var AddressElement = createElementComponent('address', isServer);\n /**\n * @deprecated\n * Use `AddressElement` instead.\n *\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var ShippingAddressElement = createElementComponent('shippingAddress', isServer);\n /**\n * Requires beta access:\n * Contact [Stripe support](https://support.stripe.com/) for more information.\n *\n * @docs https://stripe.com/docs/elements/cart-element\n */\n\n var CartElement = createElementComponent('cart', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var PaymentMethodMessagingElement = createElementComponent('paymentMethodMessaging', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var AffirmMessageElement = createElementComponent('affirmMessage', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var AfterpayClearpayMessageElement = createElementComponent('afterpayClearpayMessage', isServer);\n\n exports.AddressElement = AddressElement;\n exports.AffirmMessageElement = AffirmMessageElement;\n exports.AfterpayClearpayMessageElement = AfterpayClearpayMessageElement;\n exports.AuBankAccountElement = AuBankAccountElement;\n exports.CardCvcElement = CardCvcElement;\n exports.CardElement = CardElement;\n exports.CardExpiryElement = CardExpiryElement;\n exports.CardNumberElement = CardNumberElement;\n exports.CartElement = CartElement;\n exports.Elements = Elements;\n exports.ElementsConsumer = ElementsConsumer;\n exports.EpsBankElement = EpsBankElement;\n exports.ExpressCheckoutElement = ExpressCheckoutElement;\n exports.FpxBankElement = FpxBankElement;\n exports.IbanElement = IbanElement;\n exports.IdealBankElement = IdealBankElement;\n exports.LinkAuthenticationElement = LinkAuthenticationElement;\n exports.P24BankElement = P24BankElement;\n exports.PaymentElement = PaymentElement;\n exports.PaymentMethodMessagingElement = PaymentMethodMessagingElement;\n exports.PaymentRequestButtonElement = PaymentRequestButtonElement;\n exports.ShippingAddressElement = ShippingAddressElement;\n exports.useCartElement = useCartElement;\n exports.useCartElementState = useCartElementState;\n exports.useElements = useElements;\n exports.useStripe = useStripe;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n", "/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue(arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(null, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n", "/**\n * @license React\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var b=Symbol.for(\"react.element\"),c=Symbol.for(\"react.portal\"),d=Symbol.for(\"react.fragment\"),e=Symbol.for(\"react.strict_mode\"),f=Symbol.for(\"react.profiler\"),g=Symbol.for(\"react.provider\"),h=Symbol.for(\"react.context\"),k=Symbol.for(\"react.server_context\"),l=Symbol.for(\"react.forward_ref\"),m=Symbol.for(\"react.suspense\"),n=Symbol.for(\"react.suspense_list\"),p=Symbol.for(\"react.memo\"),q=Symbol.for(\"react.lazy\"),t=Symbol.for(\"react.offscreen\"),u;u=Symbol.for(\"react.module.reference\");\nfunction v(a){if(\"object\"===typeof a&&null!==a){var r=a.$$typeof;switch(r){case b:switch(a=a.type,a){case d:case f:case e:case m:case n:return a;default:switch(a=a&&a.$$typeof,a){case k:case h:case l:case q:case p:case g:return a;default:return r}}case c:return r}}}exports.ContextConsumer=h;exports.ContextProvider=g;exports.Element=b;exports.ForwardRef=l;exports.Fragment=d;exports.Lazy=q;exports.Memo=p;exports.Portal=c;exports.Profiler=f;exports.StrictMode=e;exports.Suspense=m;\nexports.SuspenseList=n;exports.isAsyncMode=function(){return!1};exports.isConcurrentMode=function(){return!1};exports.isContextConsumer=function(a){return v(a)===h};exports.isContextProvider=function(a){return v(a)===g};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===b};exports.isForwardRef=function(a){return v(a)===l};exports.isFragment=function(a){return v(a)===d};exports.isLazy=function(a){return v(a)===q};exports.isMemo=function(a){return v(a)===p};\nexports.isPortal=function(a){return v(a)===c};exports.isProfiler=function(a){return v(a)===f};exports.isStrictMode=function(a){return v(a)===e};exports.isSuspense=function(a){return v(a)===m};exports.isSuspenseList=function(a){return v(a)===n};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===d||a===f||a===e||a===m||a===n||a===t||\"object\"===typeof a&&null!==a&&(a.$$typeof===q||a.$$typeof===p||a.$$typeof===g||a.$$typeof===h||a.$$typeof===l||a.$$typeof===u||void 0!==a.getModuleId)?!0:!1};exports.typeOf=v;\n", "'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n", "// Durations defined by ISO 31-1\nconst MILLISECONDS_IN_A_SECOND = 1000;\nconst MILLISECONDS_IN_A_MINUTE = MILLISECONDS_IN_A_SECOND * 60;\nconst MILLISECONDS_IN_AN_HOUR = MILLISECONDS_IN_A_MINUTE * 60;\nconst MILLISECONDS_IN_A_DAY = MILLISECONDS_IN_AN_HOUR * 24;\n\n// Durations defined by common sense\nconst MILLISECONDS_IN_A_WEEK = MILLISECONDS_IN_A_DAY * 7;\nconst MILLISECONDS_IN_A_YEAR = MILLISECONDS_IN_A_DAY * 365;\nconst MILLISECONDS_IN_A_MONTH = MILLISECONDS_IN_A_YEAR / 12;\n\nexport const ZERO = Object.freeze({\n\tyears: 0 as number,\n\tmonths: 0 as number,\n\tweeks: 0 as number,\n\tdays: 0 as number,\n\thours: 0 as number,\n\tminutes: 0 as number,\n\tseconds: 0 as number,\n\tmilliseconds: 0 as number,\n});\n\nexport type UnitKey = keyof typeof ZERO;\n\nexport const UNITS_META_MAP_LITERAL = {\n\tyears: {\n\t\tmilliseconds: MILLISECONDS_IN_A_YEAR,\n\t\tmonths: 12,\n\t\tdateGetter: (date: Date) => date.getFullYear(),\n\t\tISOCharacter: 'Y',\n\t\tISOPrecision: 'period',\n\t},\n\tmonths: {\n\t\tmilliseconds: MILLISECONDS_IN_A_MONTH,\n\t\tmonths: 1,\n\t\tdateGetter: (date: Date) => date.getMonth(),\n\t\tISOCharacter: 'M',\n\t\tISOPrecision: 'period',\n\t},\n\tweeks: {\n\t\tmilliseconds: MILLISECONDS_IN_A_WEEK,\n\t\tdateGetter: () => 0,\n\t\tISOCharacter: 'W',\n\t\tISOPrecision: 'period',\n\t\tstringifyConvertTo: 'days',\n\t},\n\tdays: {\n\t\tmilliseconds: MILLISECONDS_IN_A_DAY,\n\t\tdateGetter: (date: Date) => date.getDate(),\n\t\tISOCharacter: 'D',\n\t\tISOPrecision: 'period',\n\t},\n\thours: {\n\t\tmilliseconds: MILLISECONDS_IN_AN_HOUR,\n\t\tdateGetter: (date: Date) => date.getHours(),\n\t\tISOCharacter: 'H',\n\t\tISOPrecision: 'time',\n\t},\n\tminutes: {\n\t\tmilliseconds: MILLISECONDS_IN_A_MINUTE,\n\t\tdateGetter: (date: Date) => date.getMinutes(),\n\t\tISOCharacter: 'M',\n\t\tISOPrecision: 'time',\n\t},\n\tseconds: {\n\t\tmilliseconds: MILLISECONDS_IN_A_SECOND,\n\t\tdateGetter: (date: Date) => date.getSeconds(),\n\t\tISOCharacter: 'S',\n\t\tISOPrecision: 'time',\n\t},\n\tmilliseconds: {\n\t\tmilliseconds: 1,\n\t\tdateGetter: (date: Date) => date.getMilliseconds(),\n\t\tstringifyConvertTo: 'seconds',\n\t},\n} as const;\n\ninterface Unit {\n\tmilliseconds: number;\n\tmonths?: number;\n\tdateGetter(date: Date): number;\n\tISOCharacter?: string;\n\tISOPrecision?: 'period' | 'time';\n\tstringifyConvertTo?: UnitKey;\n}\n\n// Re-export with a defined signature to allow for destructuring of optional\n// properties.\n//\n// The original `UNITS_MAP_LITERAL` is useful as TypeScript does not need a null\n// check when accessing an optional property that it knows is defined for the\n// specified unit (e.g. `UNITS_MAP_LITERAL.years.months`), whereas `UNITS_MAP`\n// needs the null check.\nexport const UNITS_META_MAP: { [key in UnitKey]: Unit } = UNITS_META_MAP_LITERAL;\n\n/**\n * All the keys of the `Duration` type, ordered from largest\n * to smallest.\n */\nexport const UNITS = Object.freeze([\n\t'years',\n\t'months',\n\t'weeks',\n\t'days',\n\t'hours',\n\t'minutes',\n\t'seconds',\n\t'milliseconds',\n] as const);\n\nexport const UNITS_META = Object.freeze(\n\tUNITS.map(unit => ({\n\t\t...UNITS_META_MAP[unit],\n\t\tunit,\n\t})),\n);\n", "import { UNITS } from './lib/units';\nimport { Duration, DurationInput } from './types';\nimport { parse } from './parse';\n\n/**\n * Gets the negative of the input duration.\n *\n * @example\n * negate({ days: -1 }) // { days: 1 }\n * negate({ days: -1, hours 2 }) // { days: 1, hours: -2 }\n */\nexport const negate = (duration: DurationInput): Duration => {\n\tconst output = { ...parse(duration) };\n\n\tUNITS.forEach(unit => {\n\t\toutput[unit] = output[unit] === 0\n\t\t\t? 0\n\t\t\t: -output[unit];\n\t});\n\n\treturn output;\n};\n", "/**\n * Returns `true` if the passed value less than `0`, or equal to `-0`.\n */\nexport const isNegativelySigned = (n: number): boolean =>\n\tn < 0 || Object.is(n, -0);\n", "import { Duration } from '../types';\nimport { ZERO, UnitKey } from './units';\nimport { negate } from '../negate';\nimport { isNegativelySigned } from './numberUtils';\n\nconst millisecondsPattern = '(?:[,.](\\\\d{1,3})\\\\d*)?';\n\nconst unitPattern = (unit: string) => `(?:(-?\\\\d+)${unit})?`;\n\nconst createDurationParser = (\n\tregex: RegExp,\n\tunitsOrder: UnitKey[],\n) => {\n\treturn (duration: string): Duration | null => {\n\t\tconst match = duration.match(regex);\n\n\t\tif (!match) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst isDurationNegative = match[1] === '-';\n\t\tconst unitStrings: (string | undefined)[] = match.slice(2);\n\n\t\t// Must have at least one unit match\n\t\tif (unitStrings.every(value => value === undefined)) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst unitNumbers = unitStrings.map((value, i) => {\n\t\t\tvalue = value ?? '0';\n\n\t\t\tconst isMilliseconds = i === unitStrings.length - 1;\n\n\t\t\treturn isMilliseconds\n\t\t\t\t// Pad the end of the millisecond values. For example, when taking the \"6\"\n\t\t\t\t// portion from the string \"PT3.6S\", we need to interpret that as \"600\n\t\t\t\t// milliseconds\".\n\t\t\t\t? Number(value.padEnd(3, '0'))\n\t\t\t\t: Number(value);\n\t\t});\n\n\t\tconst output = { ...ZERO };\n\n\t\tunitsOrder.forEach((unit, i) => {\n\t\t\toutput[unit] = unitNumbers[i];\n\t\t});\n\n\t\t// Milliseconds don't have their own minus symbol. It depends on the symbol\n\t\t// before the seconds value.\n\t\tif (isNegativelySigned(output.seconds)) {\n\t\t\toutput.milliseconds *= -1;\n\t\t}\n\n\t\treturn isDurationNegative\n\t\t\t? negate(output)\n\t\t\t: output;\n\t};\n};\n\n/**\n * Parse a duration string expressed in one of the following formats:\n *\n * - PYYYYMMDDThhmmss\n * - PYYYY-MM-DDThh:mm:ss\n */\nconst parseFullFormatISODuration = createDurationParser(\n\tnew RegExp([\n\t\t'^(-)?P',\n\t\t'(\\\\d{4})', '-?',\n\t\t'(\\\\d{2})', '-?',\n\t\t'(\\\\d{2})', 'T',\n\t\t'(\\\\d{2})', ':?',\n\t\t'(\\\\d{2})', ':?',\n\t\t'(\\\\d{2})', millisecondsPattern,\n\t\t'$',\n\t].join('')),\n\t[\n\t\t'years',\n\t\t'months',\n\t\t'days',\n\t\t'hours',\n\t\t'minutes',\n\t\t'seconds',\n\t\t'milliseconds',\n\t],\n);\n\n/**\n * Parse a duration string expressed via number and unit character pairs. For\n * example:\n *\n * - P6D\n * - P1Y2D\n * - P2DT6H2,5S\n */\nconst parseUnitsISODuration = createDurationParser(\n\tnew RegExp([\n\t\t'^(-)?P',\n\t\tunitPattern('Y'),\n\t\tunitPattern('M'),\n\t\tunitPattern('W'),\n\t\tunitPattern('D'),\n\t\t'(?:T',\n\t\tunitPattern('H'),\n\t\tunitPattern('M'),\n\t\tunitPattern(`${millisecondsPattern}S`),\n\t\t')?$',\n\t].join('')),\n\t[\n\t\t'years',\n\t\t'months',\n\t\t'weeks',\n\t\t'days',\n\t\t'hours',\n\t\t'minutes',\n\t\t'seconds',\n\t\t'milliseconds',\n\t],\n);\n\n/**\n * Parse an ISO 8601 duration string into an object.\n *\n * The units of duration are not normalized. For example, the string `\"P365D\"`\n * doesn't get converted to `{ years: 1 }` since not all years are the same\n * length.\n *\n * @example parseISODuration('P365D') // { days: 365 }\n */\nexport const parseISODuration = (duration: string): Duration => {\n\tconst output = (\n\t\tparseUnitsISODuration(duration) ||\n\t\tparseFullFormatISODuration(duration)\n\t);\n\n\tif (output === null) {\n\t\tthrow new SyntaxError(`Failed to parse duration. \"${duration}\" is not a valid ISO duration string.`);\n\t}\n\n\treturn output;\n};\n", "import { Duration } from '../types';\nimport { UNITS } from './units';\n\nexport const validate = (duration: Readonly<Duration>): void => {\n\t(Object.keys(duration) as (keyof Duration)[]).forEach(unit => {\n\t\tif (!UNITS.includes(unit)) {\n\t\t\tthrow new TypeError(`Unexpected property \"${unit}\" on Duration object.`);\n\t\t}\n\n\t\tif (!Number.isInteger(duration[unit])) {\n\t\t\tthrow new TypeError(`Property \"${unit}\" must be a an integer. Received ${duration[unit]}.`);\n\t\t}\n\t});\n};\n", "import { UNITS } from './units';\nimport { Duration } from '../types';\n\nexport const cleanDurationObject = (duration: Readonly<Duration>): Readonly<Duration> => {\n\tconst output = { ...duration };\n\n\tUNITS.forEach(key => {\n\t\t// Convert `-0` to `0`. Both values will evaluate as `true` here.\n\t\tif (output[key] === 0) {\n\t\t\toutput[key] = 0;\n\t\t}\n\t});\n\n\treturn output;\n};\n", "import { ZERO } from './lib/units';\nimport { Duration, DurationInput } from './types';\nimport { parseISODuration } from './lib/parseISODuration';\nimport { validate } from './lib/validate';\nimport { cleanDurationObject } from './lib/cleanDurationObject';\n\nconst baseParse = (duration: DurationInput): Duration => {\n\tif (typeof duration === 'string') {\n\t\treturn parseISODuration(duration);\n\t}\n\n\tif (typeof duration === 'number') {\n\t\treturn { ...ZERO, milliseconds: duration };\n\t}\n\n\treturn { ...ZERO, ...duration };\n};\n\n/**\n * Parse various duration formats to a simple suration object.\n */\nexport const parse = (duration: DurationInput): Duration => {\n\tconst output = baseParse(duration);\n\n\tvalidate(output);\n\n\treturn cleanDurationObject(output);\n};\n", "import { DurationInput } from './types';\nimport { parse } from './parse';\nimport { UNITS_META, UNITS_META_MAP } from './lib/units';\n\n/**\n * Convert the input value to milliseconds represented by a duration object.\n * If a number is passed this is returned verbatim as the number\n * of milliseconds.\n *\n * @example toMilliseconds({ days: 1 }) // 86400000\n */\nexport const toMilliseconds = (duration: DurationInput): number => {\n\tconst parsed = parse(duration);\n\n\treturn UNITS_META.reduce((total, { unit, milliseconds }) => {\n\t\treturn total + (parsed[unit] * milliseconds);\n\t}, 0);\n};\n\n/**\n * Convert the input value to the specificed unit.\n * @example toUnit({ minutes: 2 }, 'seconds') // 120\n */\nexport const toUnit = (\n\tduration: DurationInput,\n\tunit: keyof typeof UNITS_META_MAP,\n): number => {\n\treturn toMilliseconds(duration) / UNITS_META_MAP[unit].milliseconds;\n};\n\nconst createDurationConverter = (unit: keyof typeof UNITS_META_MAP) => {\n\treturn (duration: DurationInput): number => toUnit(duration, unit);\n};\n\n/**\n * Convert the input value to seconds.\n * @example toSeconds({ minutes: 2 }) // 120\n */\nexport const toSeconds = createDurationConverter('seconds');\n\n/**\n * Convert the input value to minutes.\n * @example toMinutes({ hours: 1, minutes: 10 }) // 70\n */\nexport const toMinutes = createDurationConverter('minutes');\n\n/**\n * Convert the input value to hours.\n * @example toHours({ days: 1 }) // 24\n */\nexport const toHours = createDurationConverter('hours');\n\n/**\n * Convert the input value to days.\n * @example toDays({ hours: 12 }) // 0.5\n */\nexport const toDays = createDurationConverter('days');\n\n/**\n * Convert the input value to weeks.\n * @example toWeeks({ days: 14 }) // 2\n */\nexport const toWeeks = createDurationConverter('weeks');\n\n/**\n * Convert the input value to months.\n * Note, this is a rough approximation as the length of a month is variable.\n *\n * @example toMonths({ months: 10, days: 365 }) // 11\n */\nexport const toMonths = createDurationConverter('months');\n\n/**\n * Convert the input value to years.\n * Note, this is a rough approximation as the length of a year is variable.\n *\n * @example toYears({ years: 10, days: 365 }) // 11\n */\nexport const toYears = createDurationConverter('years');\n", "import { DurationInput } from './types';\nimport { toMilliseconds } from './toUnit';\n\n/**\n * Returns `true` if a duration is negative overall.\n *\n * Note, this function performs implicit normalization, so ambiguous\n * units, like months, work with average values.\n *\n * @example\n * isNegative('P-1D') // true\n * isNegative({ days: 1, hours: -25 }) // true\n * isNegative({ days: 1, hours: -23 }) // false\n */\nexport const isNegative = (duration: DurationInput): boolean =>\n\ttoMilliseconds(duration) < 0;\n", "import { Duration, DurationInput } from './types';\nimport { isNegative } from './isNegative';\nimport { negate } from './negate';\nimport { parse } from './parse';\n\n/**\n * Get the absolute value of a duration.\n *\n * @example\n * abs({ days: -1, seconds: 1 })\n * // { days: 1, seconds: -1 }\n */\nexport const abs = (duration: DurationInput): Duration => {\n\tif (isNegative(duration)) {\n\t\treturn negate(duration);\n\t}\n\n\treturn parse(duration);\n};\n", "export const getDaysInMonth = (date: Date): number => {\n\tconst monthIndex = date.getMonth();\n\tconst lastDayOfMonth = new Date(0);\n\tlastDayOfMonth.setFullYear(date.getFullYear(), monthIndex + 1, 0);\n\tlastDayOfMonth.setHours(0, 0, 0, 0);\n\treturn lastDayOfMonth.getDate();\n};\n\nexport const addMonths = (date: Date, value: number): void => {\n\tconst desiredMonth = date.getMonth() + value;\n\tconst dateWithDesiredMonth = new Date(0);\n\tdateWithDesiredMonth.setFullYear(date.getFullYear(), desiredMonth, 1);\n\tdateWithDesiredMonth.setHours(0, 0, 0, 0);\n\tconst daysInMonth = getDaysInMonth(dateWithDesiredMonth);\n\t// Set the last day of the new month\n\t// if the original date was the last day of the longer month\n\tdate.setMonth(desiredMonth, Math.min(daysInMonth, date.getDate()));\n};\n", "import { DurationInput, DateInput } from './types';\nimport { addMonths } from './lib/dateUtils';\nimport { parse } from './parse';\n\n/**\n * Return a new date with the duration applied.\n *\n * @example\n * const newDate = apply('2020-01-01T00:00:00.000Z', { years: 2 })\n * newDate.toISOString() // '2022-01-01T00:00:00.000Z'\n */\nexport const apply = (\n\tdate: DateInput,\n\tduration: DurationInput,\n): Date => {\n\tconst parsedDate = new Date(date);\n\tconst {\n\t\tyears,\n\t\tmonths,\n\t\tweeks,\n\t\tdays,\n\t\thours,\n\t\tminutes,\n\t\tseconds,\n\t\tmilliseconds,\n\t} = parse(duration);\n\n\taddMonths(parsedDate, (years * 12) + months);\n\tparsedDate.setDate(parsedDate.getDate() + (weeks * 7) + days);\n\tparsedDate.setHours(\n\t\tparsedDate.getHours() + hours,\n\t\tparsedDate.getMinutes() + minutes,\n\t\tparsedDate.getSeconds() + seconds,\n\t\tparsedDate.getMilliseconds() + milliseconds,\n\t);\n\n\treturn parsedDate;\n};\n", "import { Duration, DateInput } from './types';\nimport { ZERO, UNITS_META } from './lib/units';\n\n/**\n * Gets the difference between two dates, expressed as a duration object.\n *\n * @example\n * between('2022-01-01', '2020-01-01') // { years: -2, months: 0, weeks: 0, ... }\n */\nexport const between = (date1: DateInput, date2: DateInput): Duration => {\n\tconst a = new Date(date1);\n\tconst b = new Date(date2);\n\tconst output: Duration = { ...ZERO };\n\n\tUNITS_META.forEach(({ unit, dateGetter }) => {\n\t\toutput[unit] = dateGetter(b) - dateGetter(a);\n\t});\n\n\treturn output;\n};\n", "import { DurationInput } from './types';\nimport { toMilliseconds } from './toUnit';\n\n/**\n * Returns `true` if all the units of the duration sum to zero.\n *\n * Note, this function performs implicit normalization, so ambiguous\n * units, like months, work with average values.\n *\n * @example\n * isZero('P0D') // true\n * isZero({ years: 0 }) // true\n * isZero({ days: 1, hours: -24 }) // true\n * isZero({ days: 1 }) // false\n */\nexport const isZero = (duration: DurationInput): boolean =>\n\ttoMilliseconds(duration) === 0;\n", "import { UNITS_META_MAP_LITERAL, ZERO, UnitKey } from './lib/units';\nimport { Duration, DurationInput, DateInput } from './types';\nimport { between } from './between';\nimport { apply } from './apply';\nimport { toMilliseconds, toMonths } from './toUnit';\nimport { parse } from './parse';\n\nconst createUnitsNormalizer = <T extends UnitKey>(\n\tkeys: T[],\n\tgetDivisor: (unit: T) => number,\n) => {\n\treturn (\n\t\tduration: Readonly<Duration>,\n\t\tremaining: number,\n\t) => {\n\t\tconst output = { ...duration };\n\n\t\tkeys.forEach(unit => {\n\t\t\tconst divisor = getDivisor(unit);\n\t\t\toutput[unit] = ~~(remaining / divisor);\n\t\t\tremaining -= output[unit] * divisor;\n\t\t});\n\n\t\treturn output;\n\t};\n};\n\nconst yearMonthNormalizer = createUnitsNormalizer(\n\t['years', 'months'],\n\tunit => UNITS_META_MAP_LITERAL[unit].months,\n);\n\nconst dayAndTimeNormalizer = createUnitsNormalizer(\n\t['days', 'hours', 'minutes', 'seconds', 'milliseconds'],\n\tunit => UNITS_META_MAP_LITERAL[unit].milliseconds,\n);\n\nconst baseNormalizer = (duration: DurationInput): Duration => {\n\tconst { years, months, weeks, days, ...rest } = parse(duration);\n\tlet output = { ...ZERO };\n\n\t// Normalize years and months between themselves.\n\t// They cannot be normalized with other units due to their variable length.\n\toutput = yearMonthNormalizer(\n\t\toutput,\n\t\ttoMonths({ years, months }),\n\t);\n\n\t// Normalize unambiguous units. It could be argued that `days` is ambiguous as\n\t// a day is not always 24 hours long, but the ISO 8601 spec says a day is 24 hours.\n\t// When not changing timezones, a day is consistently 24 hours, whereas months\n\t// and years are consistently irregular.\n\toutput = dayAndTimeNormalizer(\n\t\toutput,\n\t\ttoMilliseconds({ ...rest, days: days + (weeks * 7) }),\n\t);\n\n\treturn output;\n};\n\n/**\n * Convert a duration object or number of milliseconds into a complete\n * duration object that expresses the value in the most appropriate units.\n *\n * If a `referenceDate` argument is provided, the returned duration is normalized\n * relative to that date. This means each day, month and year has an unambiguous\n * duration, and the `normalize` function can safely convert between these units.\n *\n * @example\n * normalize({ milliseconds 4000 }) // { ..., seconds: 4, milliseconds: 0 }\n * normalize('P28DT24H') // { ..., days: 29 }\n * normalize('P28DT24H', '2018-02-01') // { ..., months: 1, days: 1 }\n * normalize('P28DT24H', '2016-02-01') // { ..., months: 1, days: 0 } (leap year)\n */\nexport const normalize = (\n\tduration: DurationInput,\n\treferenceDate?: DateInput,\n): Duration => {\n\tconst durationToNormalize = referenceDate != null\n\t\t// When using a reference date, `between` may give a result like this:\n\t\t// { years: 1, months: -11 }\n\t\t// Because of this, we pass that through `baseNormalizer` too.\n\t\t? between(referenceDate, apply(referenceDate, duration))\n\t\t: duration;\n\n\treturn baseNormalizer(durationToNormalize);\n};\n", "import { Duration, DurationInput } from './types';\nimport { UNITS, ZERO } from './lib/units';\nimport { parse } from './parse';\n\n/**\n * Sum durations.\n *\n * @example\n * sum({ days: 1 }, { days: 2, hours: 12 })\n * { days: 3, hours: 12 }\n */\nexport const sum = (...durations: DurationInput[]): Duration => {\n\tconst output = { ...ZERO };\n\n\tdurations.map(parse).forEach(duration => {\n\t\tUNITS.forEach(key => {\n\t\t\toutput[key] += duration[key];\n\t\t});\n\t});\n\n\treturn output;\n};\n", "import { Duration, DurationInput } from './types';\nimport { negate } from './negate';\nimport { sum } from './sum';\n\n/**\n * Subtract durations from the first duration argument.\n *\n * @example\n * subtract({ days: 1 }, { hours: 12 })\n * // { days: 1, hours: -12 }\n */\nexport const subtract = (\n\tduration: DurationInput,\n\t...durationsToSubtract: DurationInput[]\n): Duration =>\n\tsum(duration, ...durationsToSubtract.map(negate));\n", "import { UNITS } from './units';\nimport { DurationInput } from '../types';\nimport { parse } from '../parse';\n\nexport const getUnitCount = (duration: DurationInput): number => {\n\tconst parsed = { ...parse(duration) };\n\tlet count = 0;\n\n\tUNITS.forEach(unit => {\n\t\tif (parsed[unit] !== 0) {\n\t\t\tcount++;\n\t\t}\n\t});\n\n\treturn count;\n};\n", "import type { Duration, DurationInput } from '../types';\nimport { negate } from '../negate';\nimport { parse } from '../parse';\nimport { UNITS } from './units';\n\n/**\n * Get an indication of whether all of the non-zero units in a duration are\n * negative. If they are, return a positive representation of the duration,\n * with `isAllNegative` set to `true`.\n */\nexport const checkAllUnitsNegative = (duration: DurationInput): {\n\tisAllNegative: boolean\n\tmaybeAbsDuration: Duration\n} => {\n\tconst parsed = parse(duration);\n\tlet hasPositive = false;\n\tlet hasNegative = false;\n\n\tUNITS.forEach((unit) => {\n\t\tconst value = parsed[unit];\n\t\tif (value < 0) {\n\t\t\thasNegative = true;\n\t\t} else if (value > 0) {\n\t\t\thasPositive = true;\n\t\t}\n\t});\n\n\tif (hasNegative && !hasPositive) {\n\t\treturn {\n\t\t\tisAllNegative: true,\n\t\t\tmaybeAbsDuration: negate(parsed),\n\t\t};\n\t}\n\n\treturn {\n\t\tisAllNegative: false,\n\t\tmaybeAbsDuration: parsed,\n\t};\n};\n", "import { DurationInput } from './types';\nimport { isZero } from './isZero';\nimport { getUnitCount } from './lib/getUnitCount';\nimport { UNITS_META, UNITS_META_MAP } from './lib/units';\nimport { checkAllUnitsNegative } from './lib/checkAllUnitsNegative';\n\ninterface ToStringOptions {\n\tdecimalDelimiter: string;\n}\n\nconst joinComponents = (component: string[], delimiter: ToStringOptions['decimalDelimiter']) =>\n\tcomponent\n\t\t.join('')\n\t\t.replace(/\\./g, delimiter);\n\n/**\n * Stringify a duration into an ISO duration string.\n *\n * @example\n * toString({ years: 1, hours: 6 }) // 'P1YT6H'\n * toString(6000) // 'PT6S'\n */\nexport const toString = (\n\tduration: DurationInput,\n\toptions: Partial<ToStringOptions> = {},\n): string => {\n\tconst finalOptions: ToStringOptions = {\n\t\t// Commas are mentioned in the spec as the preferred decimal delimiter\n\t\tdecimalDelimiter: ',',\n\t\t...options,\n\t};\n\n\t// Zero values are a special case, since \"P\" is not a valid value.\n\t// At least one unit must be specified.\n\tif (isZero(duration)) {\n\t\treturn 'P0D';\n\t}\n\n\tconst {\n\t\tmaybeAbsDuration: parsed,\n\t\tisAllNegative,\n\t} = checkAllUnitsNegative(duration);\n\n\t// Weeks should not be included in the output, unless it is the only unit.\n\tif (getUnitCount(parsed) === 1 && parsed.weeks !== 0) {\n\t\treturn `P${parsed.weeks}W`;\n\t}\n\n\tconst components = {\n\t\tperiod: [] as string[],\n\t\ttime: [] as string[],\n\t};\n\n\t// Some units should be converted before stringifying.\n\t// For example, weeks should not be mixed with other units, and milliseconds\n\t// don't exist on ISO duration strings.\n\tUNITS_META.forEach(({ unit: fromUnit, stringifyConvertTo: toUnit }) => {\n\t\tif (toUnit == null) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst millisecondValue = parsed[fromUnit] * UNITS_META_MAP[fromUnit].milliseconds;\n\n\t\tparsed[toUnit] += millisecondValue / UNITS_META_MAP[toUnit].milliseconds;\n\t\tparsed[fromUnit] = 0;\n\t});\n\n\t// Push each non-zero unit to its relevant array\n\tUNITS_META.forEach(({ unit, ISOPrecision, ISOCharacter }) => {\n\t\tconst value = parsed[unit];\n\n\t\tif (ISOPrecision != null && value !== 0) {\n\t\t\tcomponents[ISOPrecision].push(`${value}${ISOCharacter}`);\n\t\t}\n\t});\n\n\t// Build output string\n\tlet output = `P${joinComponents(components.period, finalOptions.decimalDelimiter)}`;\n\n\tif (components.time.length) {\n\t\toutput += `T${joinComponents(components.time, finalOptions.decimalDelimiter)}`;\n\t}\n\n\t// Avoid \"P-1DT-1H\". Instead, output \"-P1DT1H\".\n\t// https://github.com/dlevs/duration-fns/issues/22\n\tif (isAllNegative) {\n\t\toutput = `-${output}`;\n\t}\n\n\treturn output;\n};\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map", "export * from './abs';\nexport * from './apply';\nexport * from './between';\nexport * from './isNegative';\nexport * from './isZero';\nexport * from './negate';\nexport * from './normalize';\nexport * from './parse';\nexport * from './subtract';\nexport * from './sum';\nexport * from './toString';\nexport * from './toUnit';\nexport * from './types';\nexport { UNITS } from './lib/units';\n", "/**\n * This file is the main entry point for the library -- `@duffel/components`.\n * If you'd like to expose other react components, please add them here.\n */\nexport * from \"./components/DuffelAncillaries/DuffelAncillaries\";\nexport * from \"./components/DuffelPayments/DuffelPayments\";\nexport * from \"./components/Stays/StaysCancellationTimeline/StaysCancellationTimeline\";\nexport * from \"./components/Stays/StaysRating\";\nexport * from \"./components/Stays/StaysSummary\";\nexport * from \"./components/Stays/StaysAmenities\";\nexport * from \"./components/Stays/StaysRoomRateCard\";\nexport * from \"./components/DuffelNGSView/DuffelNGSView\";\nexport * from \"./types\";\n\n/* --- DuffelCardForm --- */\nexport * from \"./components/DuffelCardForm/DuffelCardForm\";\nexport * from \"./components/DuffelCardForm/lib/types\";\nexport * from \"./components/DuffelCardForm/lib/useDuffelCardFormActions\";\n\n/* --- Functions --- */\nexport { createThreeDSecureSession } from \"./functions/createThreeDSecureSession/createThreeDSecureSession\";\nexport { hasService } from \"./functions/hasService\";\nexport { hasAvailableSeatService } from \"./lib/hasAvailableSeatService\";\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n\nimport type { ParameterizedString, PolymorphicEvent, Primitive } from '@sentry/types';\n\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst objectToString = Object.prototype.toString;\n\n/**\n * Checks whether given value's type is one of a few Error or Error-like\n * {@link isError}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isError(wat: unknown): wat is Error {\n switch (objectToString.call(wat)) {\n case '[object Error]':\n case '[object Exception]':\n case '[object DOMException]':\n return true;\n default:\n return isInstanceOf(wat, Error);\n }\n}\n/**\n * Checks whether given value is an instance of the given built-in class.\n *\n * @param wat The value to be checked\n * @param className\n * @returns A boolean representing the result.\n */\nfunction isBuiltin(wat: unknown, className: string): boolean {\n return objectToString.call(wat) === `[object ${className}]`;\n}\n\n/**\n * Checks whether given value's type is ErrorEvent\n * {@link isErrorEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isErrorEvent(wat: unknown): boolean {\n return isBuiltin(wat, 'ErrorEvent');\n}\n\n/**\n * Checks whether given value's type is DOMError\n * {@link isDOMError}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isDOMError(wat: unknown): boolean {\n return isBuiltin(wat, 'DOMError');\n}\n\n/**\n * Checks whether given value's type is DOMException\n * {@link isDOMException}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isDOMException(wat: unknown): boolean {\n return isBuiltin(wat, 'DOMException');\n}\n\n/**\n * Checks whether given value's type is a string\n * {@link isString}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isString(wat: unknown): wat is string {\n return isBuiltin(wat, 'String');\n}\n\n/**\n * Checks whether given string is parameterized\n * {@link isParameterizedString}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isParameterizedString(wat: unknown): wat is ParameterizedString {\n return (\n typeof wat === 'object' &&\n wat !== null &&\n '__sentry_template_string__' in wat &&\n '__sentry_template_values__' in wat\n );\n}\n\n/**\n * Checks whether given value is a primitive (undefined, null, number, boolean, string, bigint, symbol)\n * {@link isPrimitive}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isPrimitive(wat: unknown): wat is Primitive {\n return wat === null || isParameterizedString(wat) || (typeof wat !== 'object' && typeof wat !== 'function');\n}\n\n/**\n * Checks whether given value's type is an object literal, or a class instance.\n * {@link isPlainObject}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isPlainObject(wat: unknown): wat is Record<string, unknown> {\n return isBuiltin(wat, 'Object');\n}\n\n/**\n * Checks whether given value's type is an Event instance\n * {@link isEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isEvent(wat: unknown): wat is PolymorphicEvent {\n return typeof Event !== 'undefined' && isInstanceOf(wat, Event);\n}\n\n/**\n * Checks whether given value's type is an Element instance\n * {@link isElement}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isElement(wat: unknown): boolean {\n return typeof Element !== 'undefined' && isInstanceOf(wat, Element);\n}\n\n/**\n * Checks whether given value's type is an regexp\n * {@link isRegExp}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isRegExp(wat: unknown): wat is RegExp {\n return isBuiltin(wat, 'RegExp');\n}\n\n/**\n * Checks whether given value has a then function.\n * @param wat A value to be checked.\n */\nexport function isThenable(wat: any): wat is PromiseLike<any> {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return Boolean(wat && wat.then && typeof wat.then === 'function');\n}\n\n/**\n * Checks whether given value's type is a SyntheticEvent\n * {@link isSyntheticEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isSyntheticEvent(wat: unknown): boolean {\n return isPlainObject(wat) && 'nativeEvent' in wat && 'preventDefault' in wat && 'stopPropagation' in wat;\n}\n\n/**\n * Checks whether given value is NaN\n * {@link isNaN}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isNaN(wat: unknown): boolean {\n return typeof wat === 'number' && wat !== wat;\n}\n\n/**\n * Checks whether given value's type is an instance of provided constructor.\n * {@link isInstanceOf}.\n *\n * @param wat A value to be checked.\n * @param base A constructor to be used in a check.\n * @returns A boolean representing the result.\n */\nexport function isInstanceOf(wat: any, base: any): boolean {\n try {\n return wat instanceof base;\n } catch (_e) {\n return false;\n }\n}\n\ninterface VueViewModel {\n // Vue3\n __isVue?: boolean;\n // Vue2\n _isVue?: boolean;\n}\n/**\n * Checks whether given value's type is a Vue ViewModel.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isVueViewModel(wat: unknown): boolean {\n // Not using Object.prototype.toString because in Vue 3 it would read the instance's Symbol(Symbol.toStringTag) property.\n return !!(typeof wat === 'object' && wat !== null && ((wat as VueViewModel).__isVue || (wat as VueViewModel)._isVue));\n}\n", "import { isRegExp, isString, isVueViewModel } from './is';\n\nexport { escapeStringForRegex } from './vendor/escapeStringForRegex';\n\n/**\n * Truncates given string to the maximum characters count\n *\n * @param str An object that contains serializable values\n * @param max Maximum number of characters in truncated string (0 = unlimited)\n * @returns string Encoded\n */\nexport function truncate(str: string, max: number = 0): string {\n if (typeof str !== 'string' || max === 0) {\n return str;\n }\n return str.length <= max ? str : `${str.slice(0, max)}...`;\n}\n\n/**\n * This is basically just `trim_line` from\n * https://github.com/getsentry/sentry/blob/master/src/sentry/lang/javascript/processor.py#L67\n *\n * @param str An object that contains serializable values\n * @param max Maximum number of characters in truncated string\n * @returns string Encoded\n */\nexport function snipLine(line: string, colno: number): string {\n let newLine = line;\n const lineLength = newLine.length;\n if (lineLength <= 150) {\n return newLine;\n }\n if (colno > lineLength) {\n // eslint-disable-next-line no-param-reassign\n colno = lineLength;\n }\n\n let start = Math.max(colno - 60, 0);\n if (start < 5) {\n start = 0;\n }\n\n let end = Math.min(start + 140, lineLength);\n if (end > lineLength - 5) {\n end = lineLength;\n }\n if (end === lineLength) {\n start = Math.max(end - 140, 0);\n }\n\n newLine = newLine.slice(start, end);\n if (start > 0) {\n newLine = `'{snip} ${newLine}`;\n }\n if (end < lineLength) {\n newLine += ' {snip}';\n }\n\n return newLine;\n}\n\n/**\n * Join values in array\n * @param input array of values to be joined together\n * @param delimiter string to be placed in-between values\n * @returns Joined values\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function safeJoin(input: any[], delimiter?: string): string {\n if (!Array.isArray(input)) {\n return '';\n }\n\n const output = [];\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < input.length; i++) {\n const value = input[i];\n try {\n // This is a hack to fix a Vue3-specific bug that causes an infinite loop of\n // console warnings. This happens when a Vue template is rendered with\n // an undeclared variable, which we try to stringify, ultimately causing\n // Vue to issue another warning which repeats indefinitely.\n // see: https://github.com/getsentry/sentry-javascript/pull/8981\n if (isVueViewModel(value)) {\n output.push('[VueViewModel]');\n } else {\n output.push(String(value));\n }\n } catch (e) {\n output.push('[value cannot be serialized]');\n }\n }\n\n return output.join(delimiter);\n}\n\n/**\n * Checks if the given value matches a regex or string\n *\n * @param value The string to test\n * @param pattern Either a regex or a string against which `value` will be matched\n * @param requireExactStringMatch If true, `value` must match `pattern` exactly. If false, `value` will match\n * `pattern` if it contains `pattern`. Only applies to string-type patterns.\n */\nexport function isMatchingPattern(\n value: string,\n pattern: RegExp | string,\n requireExactStringMatch: boolean = false,\n): boolean {\n if (!isString(value)) {\n return false;\n }\n\n if (isRegExp(pattern)) {\n return pattern.test(value);\n }\n if (isString(pattern)) {\n return requireExactStringMatch ? value === pattern : value.includes(pattern);\n }\n\n return false;\n}\n\n/**\n * Test the given string against an array of strings and regexes. By default, string matching is done on a\n * substring-inclusion basis rather than a strict equality basis\n *\n * @param testString The string to test\n * @param patterns The patterns against which to test the string\n * @param requireExactStringMatch If true, `testString` must match one of the given string patterns exactly in order to\n * count. If false, `testString` will match a string pattern if it contains that pattern.\n * @returns\n */\nexport function stringMatchesSomePattern(\n testString: string,\n patterns: Array<string | RegExp> = [],\n requireExactStringMatch: boolean = false,\n): boolean {\n return patterns.some(pattern => isMatchingPattern(testString, pattern, requireExactStringMatch));\n}\n", "import type { Event, EventHint, Exception, ExtendedError, StackParser } from '@sentry/types';\n\nimport { isInstanceOf } from './is';\nimport { truncate } from './string';\n\n/**\n * Creates exceptions inside `event.exception.values` for errors that are nested on properties based on the `key` parameter.\n */\nexport function applyAggregateErrorsToEvent(\n exceptionFromErrorImplementation: (stackParser: StackParser, ex: Error) => Exception,\n parser: StackParser,\n maxValueLimit: number = 250,\n key: string,\n limit: number,\n event: Event,\n hint?: EventHint,\n): void {\n if (!event.exception || !event.exception.values || !hint || !isInstanceOf(hint.originalException, Error)) {\n return;\n }\n\n // Generally speaking the last item in `event.exception.values` is the exception originating from the original Error\n const originalException: Exception | undefined =\n event.exception.values.length > 0 ? event.exception.values[event.exception.values.length - 1] : undefined;\n\n // We only create exception grouping if there is an exception in the event.\n if (originalException) {\n event.exception.values = truncateAggregateExceptions(\n aggregateExceptionsFromError(\n exceptionFromErrorImplementation,\n parser,\n limit,\n hint.originalException as ExtendedError,\n key,\n event.exception.values,\n originalException,\n 0,\n ),\n maxValueLimit,\n );\n }\n}\n\nfunction aggregateExceptionsFromError(\n exceptionFromErrorImplementation: (stackParser: StackParser, ex: Error) => Exception,\n parser: StackParser,\n limit: number,\n error: ExtendedError,\n key: string,\n prevExceptions: Exception[],\n exception: Exception,\n exceptionId: number,\n): Exception[] {\n if (prevExceptions.length >= limit + 1) {\n return prevExceptions;\n }\n\n let newExceptions = [...prevExceptions];\n\n // Recursively call this function in order to walk down a chain of errors\n if (isInstanceOf(error[key], Error)) {\n applyExceptionGroupFieldsForParentException(exception, exceptionId);\n const newException = exceptionFromErrorImplementation(parser, error[key]);\n const newExceptionId = newExceptions.length;\n applyExceptionGroupFieldsForChildException(newException, key, newExceptionId, exceptionId);\n newExceptions = aggregateExceptionsFromError(\n exceptionFromErrorImplementation,\n parser,\n limit,\n error[key],\n key,\n [newException, ...newExceptions],\n newException,\n newExceptionId,\n );\n }\n\n // This will create exception grouping for AggregateErrors\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AggregateError\n if (Array.isArray(error.errors)) {\n error.errors.forEach((childError, i) => {\n if (isInstanceOf(childError, Error)) {\n applyExceptionGroupFieldsForParentException(exception, exceptionId);\n const newException = exceptionFromErrorImplementation(parser, childError);\n const newExceptionId = newExceptions.length;\n applyExceptionGroupFieldsForChildException(newException, `errors[${i}]`, newExceptionId, exceptionId);\n newExceptions = aggregateExceptionsFromError(\n exceptionFromErrorImplementation,\n parser,\n limit,\n childError,\n key,\n [newException, ...newExceptions],\n newException,\n newExceptionId,\n );\n }\n });\n }\n\n return newExceptions;\n}\n\nfunction applyExceptionGroupFieldsForParentException(exception: Exception, exceptionId: number): void {\n // Don't know if this default makes sense. The protocol requires us to set these values so we pick *some* default.\n exception.mechanism = exception.mechanism || { type: 'generic', handled: true };\n\n exception.mechanism = {\n ...exception.mechanism,\n ...(exception.type === 'AggregateError' && { is_exception_group: true }),\n exception_id: exceptionId,\n };\n}\n\nfunction applyExceptionGroupFieldsForChildException(\n exception: Exception,\n source: string,\n exceptionId: number,\n parentId: number | undefined,\n): void {\n // Don't know if this default makes sense. The protocol requires us to set these values so we pick *some* default.\n exception.mechanism = exception.mechanism || { type: 'generic', handled: true };\n\n exception.mechanism = {\n ...exception.mechanism,\n type: 'chained',\n source,\n exception_id: exceptionId,\n parent_id: parentId,\n };\n}\n\n/**\n * Truncate the message (exception.value) of all exceptions in the event.\n * Because this event processor is ran after `applyClientOptions`,\n * we need to truncate the message of the added exceptions here.\n */\nfunction truncateAggregateExceptions(exceptions: Exception[], maxValueLength: number): Exception[] {\n return exceptions.map(exception => {\n if (exception.value) {\n exception.value = truncate(exception.value, maxValueLength);\n }\n return exception;\n });\n}\n", "/**\n * NOTE: In order to avoid circular dependencies, if you add a function to this module and it needs to print something,\n * you must either a) use `console.log` rather than the logger, or b) put your function elsewhere.\n *\n * Note: This file was originally called `global.ts`, but was changed to unblock users which might be doing\n * string replaces with bundlers like Vite for `global` (would break imports that rely on importing from utils/src/global).\n *\n * Why worldwide?\n *\n * Why not?\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { Integration } from '@sentry/types';\n\nimport type { SdkSource } from './env';\n\n/** Internal global with common properties and Sentry extensions */\nexport interface InternalGlobal {\n navigator?: { userAgent?: string };\n console: Console;\n Sentry?: {\n Integrations?: Integration[];\n };\n onerror?: {\n (event: object | string, source?: string, lineno?: number, colno?: number, error?: Error): any;\n __SENTRY_INSTRUMENTED__?: true;\n __SENTRY_LOADER__?: true;\n };\n onunhandledrejection?: {\n (event: unknown): boolean;\n __SENTRY_INSTRUMENTED__?: true;\n __SENTRY_LOADER__?: true;\n };\n SENTRY_ENVIRONMENT?: string;\n SENTRY_DSN?: string;\n SENTRY_RELEASE?: {\n id?: string;\n };\n SENTRY_SDK_SOURCE?: SdkSource;\n /**\n * Debug IDs are indirectly injected by Sentry CLI or bundler plugins to directly reference a particular source map\n * for resolving of a source file. The injected code will place an entry into the record for each loaded bundle/JS\n * file.\n */\n _sentryDebugIds?: Record<string, string>;\n __SENTRY__: {\n globalEventProcessors: any;\n hub: any;\n logger: any;\n extensions?: {\n /** Extension methods for the hub, which are bound to the current Hub instance */\n // eslint-disable-next-line @typescript-eslint/ban-types\n [key: string]: Function;\n };\n };\n /**\n * Raw module metadata that is injected by bundler plugins.\n *\n * Keys are `error.stack` strings, values are the metadata.\n */\n _sentryModuleMetadata?: Record<string, any>;\n}\n\n// The code below for 'isGlobalObj' and 'GLOBAL_OBJ' was copied from core-js before modification\n// https://github.com/zloirock/core-js/blob/1b944df55282cdc99c90db5f49eb0b6eda2cc0a3/packages/core-js/internals/global.js\n// core-js has the following licence:\n//\n// Copyright (c) 2014-2022 Denis Pushkarev\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n/** Returns 'obj' if it's the global object, otherwise returns undefined */\nfunction isGlobalObj(obj: { Math?: Math }): any | undefined {\n return obj && obj.Math == Math ? obj : undefined;\n}\n\n/** Get's the global object for the current JavaScript runtime */\nexport const GLOBAL_OBJ: InternalGlobal =\n (typeof globalThis == 'object' && isGlobalObj(globalThis)) ||\n // eslint-disable-next-line no-restricted-globals\n (typeof window == 'object' && isGlobalObj(window)) ||\n (typeof self == 'object' && isGlobalObj(self)) ||\n (typeof global == 'object' && isGlobalObj(global)) ||\n (function (this: any) {\n return this;\n })() ||\n {};\n\n/**\n * @deprecated Use GLOBAL_OBJ instead or WINDOW from @sentry/browser. This will be removed in v8\n */\nexport function getGlobalObject<T>(): T & InternalGlobal {\n return GLOBAL_OBJ as T & InternalGlobal;\n}\n\n/**\n * Returns a global singleton contained in the global `__SENTRY__` object.\n *\n * If the singleton doesn't already exist in `__SENTRY__`, it will be created using the given factory\n * function and added to the `__SENTRY__` object.\n *\n * @param name name of the global singleton on __SENTRY__\n * @param creator creator Factory function to create the singleton if it doesn't already exist on `__SENTRY__`\n * @param obj (Optional) The global object on which to look for `__SENTRY__`, if not `GLOBAL_OBJ`'s return value\n * @returns the singleton\n */\nexport function getGlobalSingleton<T>(name: keyof InternalGlobal['__SENTRY__'], creator: () => T, obj?: unknown): T {\n const gbl = (obj || GLOBAL_OBJ) as InternalGlobal;\n const __SENTRY__ = (gbl.__SENTRY__ = gbl.__SENTRY__ || {});\n const singleton = __SENTRY__[name] || (__SENTRY__[name] = creator());\n return singleton;\n}\n", "import { isString } from './is';\nimport { getGlobalObject } from './worldwide';\n\n// eslint-disable-next-line deprecation/deprecation\nconst WINDOW = getGlobalObject<Window>();\n\nconst DEFAULT_MAX_STRING_LENGTH = 80;\n\ntype SimpleNode = {\n parentNode: SimpleNode;\n} | null;\n\n/**\n * Given a child DOM element, returns a query-selector statement describing that\n * and its ancestors\n * e.g. [HTMLElement] => body > div > input#foo.btn[name=baz]\n * @returns generated DOM path\n */\nexport function htmlTreeAsString(\n elem: unknown,\n options: string[] | { keyAttrs?: string[]; maxStringLength?: number } = {},\n): string {\n if (!elem) {\n return '<unknown>';\n }\n\n // try/catch both:\n // - accessing event.target (see getsentry/raven-js#838, #768)\n // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly\n // - can throw an exception in some circumstances.\n try {\n let currentElem = elem as SimpleNode;\n const MAX_TRAVERSE_HEIGHT = 5;\n const out = [];\n let height = 0;\n let len = 0;\n const separator = ' > ';\n const sepLength = separator.length;\n let nextStr;\n const keyAttrs = Array.isArray(options) ? options : options.keyAttrs;\n const maxStringLength = (!Array.isArray(options) && options.maxStringLength) || DEFAULT_MAX_STRING_LENGTH;\n\n while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) {\n nextStr = _htmlElementAsString(currentElem, keyAttrs);\n // bail out if\n // - nextStr is the 'html' element\n // - the length of the string that would be created exceeds maxStringLength\n // (ignore this limit if we are on the first iteration)\n if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= maxStringLength)) {\n break;\n }\n\n out.push(nextStr);\n\n len += nextStr.length;\n currentElem = currentElem.parentNode;\n }\n\n return out.reverse().join(separator);\n } catch (_oO) {\n return '<unknown>';\n }\n}\n\n/**\n * Returns a simple, query-selector representation of a DOM element\n * e.g. [HTMLElement] => input#foo.btn[name=baz]\n * @returns generated DOM path\n */\nfunction _htmlElementAsString(el: unknown, keyAttrs?: string[]): string {\n const elem = el as {\n tagName?: string;\n id?: string;\n className?: string;\n getAttribute(key: string): string;\n };\n\n const out = [];\n let className;\n let classes;\n let key;\n let attr;\n let i;\n\n if (!elem || !elem.tagName) {\n return '';\n }\n\n // @ts-expect-error WINDOW has HTMLElement\n if (WINDOW.HTMLElement) {\n // If using the component name annotation plugin, this value may be available on the DOM node\n if (elem instanceof HTMLElement && elem.dataset && elem.dataset['sentryComponent']) {\n return elem.dataset['sentryComponent'];\n }\n }\n\n out.push(elem.tagName.toLowerCase());\n\n // Pairs of attribute keys defined in `serializeAttribute` and their values on element.\n const keyAttrPairs =\n keyAttrs && keyAttrs.length\n ? keyAttrs.filter(keyAttr => elem.getAttribute(keyAttr)).map(keyAttr => [keyAttr, elem.getAttribute(keyAttr)])\n : null;\n\n if (keyAttrPairs && keyAttrPairs.length) {\n keyAttrPairs.forEach(keyAttrPair => {\n out.push(`[${keyAttrPair[0]}=\"${keyAttrPair[1]}\"]`);\n });\n } else {\n if (elem.id) {\n out.push(`#${elem.id}`);\n }\n\n // eslint-disable-next-line prefer-const\n className = elem.className;\n if (className && isString(className)) {\n classes = className.split(/\\s+/);\n for (i = 0; i < classes.length; i++) {\n out.push(`.${classes[i]}`);\n }\n }\n }\n const allowedAttrs = ['aria-label', 'type', 'name', 'title', 'alt'];\n for (i = 0; i < allowedAttrs.length; i++) {\n key = allowedAttrs[i];\n attr = elem.getAttribute(key);\n if (attr) {\n out.push(`[${key}=\"${attr}\"]`);\n }\n }\n return out.join('');\n}\n\n/**\n * A safe form of location.href\n */\nexport function getLocationHref(): string {\n try {\n return WINDOW.document.location.href;\n } catch (oO) {\n return '';\n }\n}\n\n/**\n * Gets a DOM element by using document.querySelector.\n *\n * This wrapper will first check for the existance of the function before\n * actually calling it so that we don't have to take care of this check,\n * every time we want to access the DOM.\n *\n * Reason: DOM/querySelector is not available in all environments.\n *\n * We have to cast to any because utils can be consumed by a variety of environments,\n * and we don't want to break TS users. If you know what element will be selected by\n * `document.querySelector`, specify it as part of the generic call. For example,\n * `const element = getDomElement<Element>('selector');`\n *\n * @param selector the selector string passed on to document.querySelector\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getDomElement<E = any>(selector: string): E | null {\n if (WINDOW.document && WINDOW.document.querySelector) {\n return WINDOW.document.querySelector(selector) as unknown as E;\n }\n return null;\n}\n\n/**\n * Given a DOM element, traverses up the tree until it finds the first ancestor node\n * that has the `data-sentry-component` attribute. This attribute is added at build-time\n * by projects that have the component name annotation plugin installed.\n *\n * @returns a string representation of the component for the provided DOM element, or `null` if not found\n */\nexport function getComponentName(elem: unknown): string | null {\n // @ts-expect-error WINDOW has HTMLElement\n if (!WINDOW.HTMLElement) {\n return null;\n }\n\n let currentElem = elem as SimpleNode;\n const MAX_TRAVERSE_HEIGHT = 5;\n for (let i = 0; i < MAX_TRAVERSE_HEIGHT; i++) {\n if (!currentElem) {\n return null;\n }\n\n if (currentElem instanceof HTMLElement && currentElem.dataset['sentryComponent']) {\n return currentElem.dataset['sentryComponent'];\n }\n\n currentElem = currentElem.parentNode;\n }\n\n return null;\n}\n", "declare const __DEBUG_BUILD__: boolean;\n\n/**\n * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.\n *\n * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.\n */\nexport const DEBUG_BUILD = __DEBUG_BUILD__;\n", "import type { ConsoleLevel } from '@sentry/types';\n\nimport { DEBUG_BUILD } from './debug-build';\nimport { GLOBAL_OBJ } from './worldwide';\n\n/** Prefix for logging strings */\nconst PREFIX = 'Sentry Logger ';\n\nexport const CONSOLE_LEVELS: readonly ConsoleLevel[] = [\n 'debug',\n 'info',\n 'warn',\n 'error',\n 'log',\n 'assert',\n 'trace',\n] as const;\n\ntype LoggerMethod = (...args: unknown[]) => void;\ntype LoggerConsoleMethods = Record<ConsoleLevel, LoggerMethod>;\n\n/** This may be mutated by the console instrumentation. */\nexport const originalConsoleMethods: {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key in ConsoleLevel]?: (...args: any[]) => void;\n} = {};\n\n/** JSDoc */\ninterface Logger extends LoggerConsoleMethods {\n disable(): void;\n enable(): void;\n isEnabled(): boolean;\n}\n\n/**\n * Temporarily disable sentry console instrumentations.\n *\n * @param callback The function to run against the original `console` messages\n * @returns The results of the callback\n */\nexport function consoleSandbox<T>(callback: () => T): T {\n if (!('console' in GLOBAL_OBJ)) {\n return callback();\n }\n\n const console = GLOBAL_OBJ.console as Console;\n const wrappedFuncs: Partial<LoggerConsoleMethods> = {};\n\n const wrappedLevels = Object.keys(originalConsoleMethods) as ConsoleLevel[];\n\n // Restore all wrapped console methods\n wrappedLevels.forEach(level => {\n const originalConsoleMethod = originalConsoleMethods[level] as LoggerMethod;\n wrappedFuncs[level] = console[level] as LoggerMethod | undefined;\n console[level] = originalConsoleMethod;\n });\n\n try {\n return callback();\n } finally {\n // Revert restoration to wrapped state\n wrappedLevels.forEach(level => {\n console[level] = wrappedFuncs[level] as LoggerMethod;\n });\n }\n}\n\nfunction makeLogger(): Logger {\n let enabled = false;\n const logger: Partial<Logger> = {\n enable: () => {\n enabled = true;\n },\n disable: () => {\n enabled = false;\n },\n isEnabled: () => enabled,\n };\n\n if (DEBUG_BUILD) {\n CONSOLE_LEVELS.forEach(name => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n logger[name] = (...args: any[]) => {\n if (enabled) {\n consoleSandbox(() => {\n GLOBAL_OBJ.console[name](`${PREFIX}[${name}]:`, ...args);\n });\n }\n };\n });\n } else {\n CONSOLE_LEVELS.forEach(name => {\n logger[name] = () => undefined;\n });\n }\n\n return logger as Logger;\n}\n\nexport const logger = makeLogger();\n", "import type { DsnComponents, DsnLike, DsnProtocol } from '@sentry/types';\n\nimport { DEBUG_BUILD } from './debug-build';\nimport { consoleSandbox, logger } from './logger';\n\n/** Regular expression used to parse a Dsn. */\nconst DSN_REGEX = /^(?:(\\w+):)\\/\\/(?:(\\w+)(?::(\\w+)?)?@)([\\w.-]+)(?::(\\d+))?\\/(.+)/;\n\nfunction isValidProtocol(protocol?: string): protocol is DsnProtocol {\n return protocol === 'http' || protocol === 'https';\n}\n\n/**\n * Renders the string representation of this Dsn.\n *\n * By default, this will render the public representation without the password\n * component. To get the deprecated private representation, set `withPassword`\n * to true.\n *\n * @param withPassword When set to true, the password will be included.\n */\nexport function dsnToString(dsn: DsnComponents, withPassword: boolean = false): string {\n const { host, path, pass, port, projectId, protocol, publicKey } = dsn;\n return (\n `${protocol}://${publicKey}${withPassword && pass ? `:${pass}` : ''}` +\n `@${host}${port ? `:${port}` : ''}/${path ? `${path}/` : path}${projectId}`\n );\n}\n\n/**\n * Parses a Dsn from a given string.\n *\n * @param str A Dsn as string\n * @returns Dsn as DsnComponents or undefined if @param str is not a valid DSN string\n */\nexport function dsnFromString(str: string): DsnComponents | undefined {\n const match = DSN_REGEX.exec(str);\n\n if (!match) {\n // This should be logged to the console\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.error(`Invalid Sentry Dsn: ${str}`);\n });\n return undefined;\n }\n\n const [protocol, publicKey, pass = '', host, port = '', lastPath] = match.slice(1);\n let path = '';\n let projectId = lastPath;\n\n const split = projectId.split('/');\n if (split.length > 1) {\n path = split.slice(0, -1).join('/');\n projectId = split.pop() as string;\n }\n\n if (projectId) {\n const projectMatch = projectId.match(/^\\d+/);\n if (projectMatch) {\n projectId = projectMatch[0];\n }\n }\n\n return dsnFromComponents({ host, pass, path, projectId, port, protocol: protocol as DsnProtocol, publicKey });\n}\n\nfunction dsnFromComponents(components: DsnComponents): DsnComponents {\n return {\n protocol: components.protocol,\n publicKey: components.publicKey || '',\n pass: components.pass || '',\n host: components.host,\n port: components.port || '',\n path: components.path || '',\n projectId: components.projectId,\n };\n}\n\nfunction validateDsn(dsn: DsnComponents): boolean {\n if (!DEBUG_BUILD) {\n return true;\n }\n\n const { port, projectId, protocol } = dsn;\n\n const requiredComponents: ReadonlyArray<keyof DsnComponents> = ['protocol', 'publicKey', 'host', 'projectId'];\n const hasMissingRequiredComponent = requiredComponents.find(component => {\n if (!dsn[component]) {\n logger.error(`Invalid Sentry Dsn: ${component} missing`);\n return true;\n }\n return false;\n });\n\n if (hasMissingRequiredComponent) {\n return false;\n }\n\n if (!projectId.match(/^\\d+$/)) {\n logger.error(`Invalid Sentry Dsn: Invalid projectId ${projectId}`);\n return false;\n }\n\n if (!isValidProtocol(protocol)) {\n logger.error(`Invalid Sentry Dsn: Invalid protocol ${protocol}`);\n return false;\n }\n\n if (port && isNaN(parseInt(port, 10))) {\n logger.error(`Invalid Sentry Dsn: Invalid port ${port}`);\n return false;\n }\n\n return true;\n}\n\n/**\n * Creates a valid Sentry Dsn object, identifying a Sentry instance and project.\n * @returns a valid DsnComponents object or `undefined` if @param from is an invalid DSN source\n */\nexport function makeDsn(from: DsnLike): DsnComponents | undefined {\n const components = typeof from === 'string' ? dsnFromString(from) : dsnFromComponents(from);\n if (!components || !validateDsn(components)) {\n return undefined;\n }\n return components;\n}\n", "import type { ConsoleLevel } from '@sentry/types';\n\n/** An error emitted by Sentry SDKs and related utilities. */\nexport class SentryError extends Error {\n /** Display name of this error instance. */\n public name: string;\n\n public logLevel: ConsoleLevel;\n\n public constructor(public message: string, logLevel: ConsoleLevel = 'warn') {\n super(message);\n\n this.name = new.target.prototype.constructor.name;\n // This sets the prototype to be `Error`, not `SentryError`. It's unclear why we do this, but commenting this line\n // out causes various (seemingly totally unrelated) playwright tests consistently time out. FYI, this makes\n // instances of `SentryError` fail `obj instanceof SentryError` checks.\n Object.setPrototypeOf(this, new.target.prototype);\n this.logLevel = logLevel;\n }\n}\n", "/* eslint-disable max-lines */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { WrappedFunction } from '@sentry/types';\n\nimport { htmlTreeAsString } from './browser';\nimport { DEBUG_BUILD } from './debug-build';\nimport { isElement, isError, isEvent, isInstanceOf, isPlainObject, isPrimitive } from './is';\nimport { logger } from './logger';\nimport { truncate } from './string';\n\n/**\n * Replace a method in an object with a wrapped version of itself.\n *\n * @param source An object that contains a method to be wrapped.\n * @param name The name of the method to be wrapped.\n * @param replacementFactory A higher-order function that takes the original version of the given method and returns a\n * wrapped version. Note: The function returned by `replacementFactory` needs to be a non-arrow function, in order to\n * preserve the correct value of `this`, and the original method must be called using `origMethod.call(this, <other\n * args>)` or `origMethod.apply(this, [<other args>])` (rather than being called directly), again to preserve `this`.\n * @returns void\n */\nexport function fill(source: { [key: string]: any }, name: string, replacementFactory: (...args: any[]) => any): void {\n if (!(name in source)) {\n return;\n }\n\n const original = source[name] as () => any;\n const wrapped = replacementFactory(original) as WrappedFunction;\n\n // Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work\n // otherwise it'll throw \"TypeError: Object.defineProperties called on non-object\"\n if (typeof wrapped === 'function') {\n markFunctionWrapped(wrapped, original);\n }\n\n source[name] = wrapped;\n}\n\n/**\n * Defines a non-enumerable property on the given object.\n *\n * @param obj The object on which to set the property\n * @param name The name of the property to be set\n * @param value The value to which to set the property\n */\nexport function addNonEnumerableProperty(obj: object, name: string, value: unknown): void {\n try {\n Object.defineProperty(obj, name, {\n // enumerable: false, // the default, so we can save on bundle size by not explicitly setting it\n value: value,\n writable: true,\n configurable: true,\n });\n } catch (o_O) {\n DEBUG_BUILD && logger.log(`Failed to add non-enumerable property \"${name}\" to object`, obj);\n }\n}\n\n/**\n * Remembers the original function on the wrapped function and\n * patches up the prototype.\n *\n * @param wrapped the wrapper function\n * @param original the original function that gets wrapped\n */\nexport function markFunctionWrapped(wrapped: WrappedFunction, original: WrappedFunction): void {\n try {\n const proto = original.prototype || {};\n wrapped.prototype = original.prototype = proto;\n addNonEnumerableProperty(wrapped, '__sentry_original__', original);\n } catch (o_O) {} // eslint-disable-line no-empty\n}\n\n/**\n * This extracts the original function if available. See\n * `markFunctionWrapped` for more information.\n *\n * @param func the function to unwrap\n * @returns the unwrapped version of the function if available.\n */\nexport function getOriginalFunction(func: WrappedFunction): WrappedFunction | undefined {\n return func.__sentry_original__;\n}\n\n/**\n * Encodes given object into url-friendly format\n *\n * @param object An object that contains serializable values\n * @returns string Encoded\n */\nexport function urlEncode(object: { [key: string]: any }): string {\n return Object.keys(object)\n .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(object[key])}`)\n .join('&');\n}\n\n/**\n * Transforms any `Error` or `Event` into a plain object with all of their enumerable properties, and some of their\n * non-enumerable properties attached.\n *\n * @param value Initial source that we have to transform in order for it to be usable by the serializer\n * @returns An Event or Error turned into an object - or the value argurment itself, when value is neither an Event nor\n * an Error.\n */\nexport function convertToPlainObject<V>(\n value: V,\n):\n | {\n [ownProps: string]: unknown;\n type: string;\n target: string;\n currentTarget: string;\n detail?: unknown;\n }\n | {\n [ownProps: string]: unknown;\n message: string;\n name: string;\n stack?: string;\n }\n | V {\n if (isError(value)) {\n return {\n message: value.message,\n name: value.name,\n stack: value.stack,\n ...getOwnProperties(value),\n };\n } else if (isEvent(value)) {\n const newObj: {\n [ownProps: string]: unknown;\n type: string;\n target: string;\n currentTarget: string;\n detail?: unknown;\n } = {\n type: value.type,\n target: serializeEventTarget(value.target),\n currentTarget: serializeEventTarget(value.currentTarget),\n ...getOwnProperties(value),\n };\n\n if (typeof CustomEvent !== 'undefined' && isInstanceOf(value, CustomEvent)) {\n newObj.detail = value.detail;\n }\n\n return newObj;\n } else {\n return value;\n }\n}\n\n/** Creates a string representation of the target of an `Event` object */\nfunction serializeEventTarget(target: unknown): string {\n try {\n return isElement(target) ? htmlTreeAsString(target) : Object.prototype.toString.call(target);\n } catch (_oO) {\n return '<unknown>';\n }\n}\n\n/** Filters out all but an object's own properties */\nfunction getOwnProperties(obj: unknown): { [key: string]: unknown } {\n if (typeof obj === 'object' && obj !== null) {\n const extractedProps: { [key: string]: unknown } = {};\n for (const property in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, property)) {\n extractedProps[property] = (obj as Record<string, unknown>)[property];\n }\n }\n return extractedProps;\n } else {\n return {};\n }\n}\n\n/**\n * Given any captured exception, extract its keys and create a sorted\n * and truncated list that will be used inside the event message.\n * eg. `Non-error exception captured with keys: foo, bar, baz`\n */\nexport function extractExceptionKeysForMessage(exception: Record<string, unknown>, maxLength: number = 40): string {\n const keys = Object.keys(convertToPlainObject(exception));\n keys.sort();\n\n if (!keys.length) {\n return '[object has no keys]';\n }\n\n if (keys[0].length >= maxLength) {\n return truncate(keys[0], maxLength);\n }\n\n for (let includedKeys = keys.length; includedKeys > 0; includedKeys--) {\n const serialized = keys.slice(0, includedKeys).join(', ');\n if (serialized.length > maxLength) {\n continue;\n }\n if (includedKeys === keys.length) {\n return serialized;\n }\n return truncate(serialized, maxLength);\n }\n\n return '';\n}\n\n/**\n * Given any object, return a new object having removed all fields whose value was `undefined`.\n * Works recursively on objects and arrays.\n *\n * Attention: This function keeps circular references in the returned object.\n */\nexport function dropUndefinedKeys<T>(inputValue: T): T {\n // This map keeps track of what already visited nodes map to.\n // Our Set - based memoBuilder doesn't work here because we want to the output object to have the same circular\n // references as the input object.\n const memoizationMap = new Map<unknown, unknown>();\n\n // This function just proxies `_dropUndefinedKeys` to keep the `memoBuilder` out of this function's API\n return _dropUndefinedKeys(inputValue, memoizationMap);\n}\n\nfunction _dropUndefinedKeys<T>(inputValue: T, memoizationMap: Map<unknown, unknown>): T {\n if (isPojo(inputValue)) {\n // If this node has already been visited due to a circular reference, return the object it was mapped to in the new object\n const memoVal = memoizationMap.get(inputValue);\n if (memoVal !== undefined) {\n return memoVal as T;\n }\n\n const returnValue: { [key: string]: any } = {};\n // Store the mapping of this value in case we visit it again, in case of circular data\n memoizationMap.set(inputValue, returnValue);\n\n for (const key of Object.keys(inputValue)) {\n if (typeof inputValue[key] !== 'undefined') {\n returnValue[key] = _dropUndefinedKeys(inputValue[key], memoizationMap);\n }\n }\n\n return returnValue as T;\n }\n\n if (Array.isArray(inputValue)) {\n // If this node has already been visited due to a circular reference, return the array it was mapped to in the new object\n const memoVal = memoizationMap.get(inputValue);\n if (memoVal !== undefined) {\n return memoVal as T;\n }\n\n const returnValue: unknown[] = [];\n // Store the mapping of this value in case we visit it again, in case of circular data\n memoizationMap.set(inputValue, returnValue);\n\n inputValue.forEach((item: unknown) => {\n returnValue.push(_dropUndefinedKeys(item, memoizationMap));\n });\n\n return returnValue as unknown as T;\n }\n\n return inputValue;\n}\n\nfunction isPojo(input: unknown): input is Record<string, unknown> {\n if (!isPlainObject(input)) {\n return false;\n }\n\n try {\n const name = (Object.getPrototypeOf(input) as { constructor: { name: string } }).constructor.name;\n return !name || name === 'Object';\n } catch {\n return true;\n }\n}\n\n/**\n * Ensure that something is an object.\n *\n * Turns `undefined` and `null` into `String`s and all other primitives into instances of their respective wrapper\n * classes (String, Boolean, Number, etc.). Acts as the identity function on non-primitives.\n *\n * @param wat The subject of the objectification\n * @returns A version of `wat` which can safely be used with `Object` class methods\n */\nexport function objectify(wat: unknown): typeof Object {\n let objectified;\n switch (true) {\n case wat === undefined || wat === null:\n objectified = new String(wat);\n break;\n\n // Though symbols and bigints do have wrapper classes (`Symbol` and `BigInt`, respectively), for whatever reason\n // those classes don't have constructors which can be used with the `new` keyword. We therefore need to cast each as\n // an object in order to wrap it.\n case typeof wat === 'symbol' || typeof wat === 'bigint':\n objectified = Object(wat);\n break;\n\n // this will catch the remaining primitives: `String`, `Number`, and `Boolean`\n case isPrimitive(wat):\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n objectified = new (wat as any).constructor(wat);\n break;\n\n // by process of elimination, at this point we know that `wat` must already be an object\n default:\n objectified = wat;\n break;\n }\n return objectified;\n}\n", "import type { StackFrame, StackLineParser, StackParser } from '@sentry/types';\n\nimport type { GetModuleFn } from './node-stack-trace';\nimport { filenameIsInApp, node } from './node-stack-trace';\n\nexport { filenameIsInApp };\n\nconst STACKTRACE_FRAME_LIMIT = 50;\n// Used to sanitize webpack (error: *) wrapped stack errors\nconst WEBPACK_ERROR_REGEXP = /\\(error: (.*)\\)/;\nconst STRIP_FRAME_REGEXP = /captureMessage|captureException/;\n\n/**\n * Creates a stack parser with the supplied line parsers\n *\n * StackFrames are returned in the correct order for Sentry Exception\n * frames and with Sentry SDK internal frames removed from the top and bottom\n *\n */\nexport function createStackParser(...parsers: StackLineParser[]): StackParser {\n const sortedParsers = parsers.sort((a, b) => a[0] - b[0]).map(p => p[1]);\n\n return (stack: string, skipFirst: number = 0): StackFrame[] => {\n const frames: StackFrame[] = [];\n const lines = stack.split('\\n');\n\n for (let i = skipFirst; i < lines.length; i++) {\n const line = lines[i];\n // Ignore lines over 1kb as they are unlikely to be stack frames.\n // Many of the regular expressions use backtracking which results in run time that increases exponentially with\n // input size. Huge strings can result in hangs/Denial of Service:\n // https://github.com/getsentry/sentry-javascript/issues/2286\n if (line.length > 1024) {\n continue;\n }\n\n // https://github.com/getsentry/sentry-javascript/issues/5459\n // Remove webpack (error: *) wrappers\n const cleanedLine = WEBPACK_ERROR_REGEXP.test(line) ? line.replace(WEBPACK_ERROR_REGEXP, '$1') : line;\n\n // https://github.com/getsentry/sentry-javascript/issues/7813\n // Skip Error: lines\n if (cleanedLine.match(/\\S*Error: /)) {\n continue;\n }\n\n for (const parser of sortedParsers) {\n const frame = parser(cleanedLine);\n\n if (frame) {\n frames.push(frame);\n break;\n }\n }\n\n if (frames.length >= STACKTRACE_FRAME_LIMIT) {\n break;\n }\n }\n\n return stripSentryFramesAndReverse(frames);\n };\n}\n\n/**\n * Gets a stack parser implementation from Options.stackParser\n * @see Options\n *\n * If options contains an array of line parsers, it is converted into a parser\n */\nexport function stackParserFromStackParserOptions(stackParser: StackParser | StackLineParser[]): StackParser {\n if (Array.isArray(stackParser)) {\n return createStackParser(...stackParser);\n }\n return stackParser;\n}\n\n/**\n * Removes Sentry frames from the top and bottom of the stack if present and enforces a limit of max number of frames.\n * Assumes stack input is ordered from top to bottom and returns the reverse representation so call site of the\n * function that caused the crash is the last frame in the array.\n * @hidden\n */\nexport function stripSentryFramesAndReverse(stack: ReadonlyArray<StackFrame>): StackFrame[] {\n if (!stack.length) {\n return [];\n }\n\n const localStack = Array.from(stack);\n\n // If stack starts with one of our API calls, remove it (starts, meaning it's the top of the stack - aka last call)\n if (/sentryWrapped/.test(localStack[localStack.length - 1].function || '')) {\n localStack.pop();\n }\n\n // Reversing in the middle of the procedure allows us to just pop the values off the stack\n localStack.reverse();\n\n // If stack ends with one of our internal API calls, remove it (ends, meaning it's the bottom of the stack - aka top-most call)\n if (STRIP_FRAME_REGEXP.test(localStack[localStack.length - 1].function || '')) {\n localStack.pop();\n\n // When using synthetic events, we will have a 2 levels deep stack, as `new Error('Sentry syntheticException')`\n // is produced within the hub itself, making it:\n //\n // Sentry.captureException()\n // getCurrentHub().captureException()\n //\n // instead of just the top `Sentry` call itself.\n // This forces us to possibly strip an additional frame in the exact same was as above.\n if (STRIP_FRAME_REGEXP.test(localStack[localStack.length - 1].function || '')) {\n localStack.pop();\n }\n }\n\n return localStack.slice(0, STACKTRACE_FRAME_LIMIT).map(frame => ({\n ...frame,\n filename: frame.filename || localStack[localStack.length - 1].filename,\n function: frame.function || '?',\n }));\n}\n\nconst defaultFunctionName = '<anonymous>';\n\n/**\n * Safely extract function name from itself\n */\nexport function getFunctionName(fn: unknown): string {\n try {\n if (!fn || typeof fn !== 'function') {\n return defaultFunctionName;\n }\n return fn.name || defaultFunctionName;\n } catch (e) {\n // Just accessing custom props in some Selenium environments\n // can cause a \"Permission denied\" exception (see raven-js#495).\n return defaultFunctionName;\n }\n}\n\n/**\n * Node.js stack line parser\n *\n * This is in @sentry/utils so it can be used from the Electron SDK in the browser for when `nodeIntegration == true`.\n * This allows it to be used without referencing or importing any node specific code which causes bundlers to complain\n */\nexport function nodeStackLineParser(getModule?: GetModuleFn): StackLineParser {\n return [90, node(getModule)];\n}\n", "import { DEBUG_BUILD } from '../debug-build';\nimport { logger } from '../logger';\nimport { getFunctionName } from '../stacktrace';\n\nexport type InstrumentHandlerType = 'console' | 'dom' | 'fetch' | 'history' | 'xhr' | 'error' | 'unhandledrejection';\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type InstrumentHandlerCallback = (data: any) => void;\n\n// We keep the handlers globally\nconst handlers: { [key in InstrumentHandlerType]?: InstrumentHandlerCallback[] } = {};\nconst instrumented: { [key in InstrumentHandlerType]?: boolean } = {};\n\n/** Add a handler function. */\nexport function addHandler(type: InstrumentHandlerType, handler: InstrumentHandlerCallback): void {\n handlers[type] = handlers[type] || [];\n (handlers[type] as InstrumentHandlerCallback[]).push(handler);\n}\n\n/**\n * Reset all instrumentation handlers.\n * This can be used by tests to ensure we have a clean slate of instrumentation handlers.\n */\nexport function resetInstrumentationHandlers(): void {\n Object.keys(handlers).forEach(key => {\n handlers[key as InstrumentHandlerType] = undefined;\n });\n}\n\n/** Maybe run an instrumentation function, unless it was already called. */\nexport function maybeInstrument(type: InstrumentHandlerType, instrumentFn: () => void): void {\n if (!instrumented[type]) {\n instrumentFn();\n instrumented[type] = true;\n }\n}\n\n/** Trigger handlers for a given instrumentation type. */\nexport function triggerHandlers(type: InstrumentHandlerType, data: unknown): void {\n const typeHandlers = type && handlers[type];\n if (!typeHandlers) {\n return;\n }\n\n for (const handler of typeHandlers) {\n try {\n handler(data);\n } catch (e) {\n DEBUG_BUILD &&\n logger.error(\n `Error while triggering instrumentation handler.\\nType: ${type}\\nName: ${getFunctionName(handler)}\\nError:`,\n e,\n );\n }\n }\n}\n", "/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/ban-types */\nimport type { ConsoleLevel, HandlerDataConsole } from '@sentry/types';\n\nimport { CONSOLE_LEVELS, originalConsoleMethods } from '../logger';\nimport { fill } from '../object';\nimport { GLOBAL_OBJ } from '../worldwide';\nimport { addHandler, maybeInstrument, triggerHandlers } from './_handlers';\n\n/**\n * Add an instrumentation handler for when a console.xxx method is called.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nexport function addConsoleInstrumentationHandler(handler: (data: HandlerDataConsole) => void): void {\n const type = 'console';\n addHandler(type, handler);\n maybeInstrument(type, instrumentConsole);\n}\n\nfunction instrumentConsole(): void {\n if (!('console' in GLOBAL_OBJ)) {\n return;\n }\n\n CONSOLE_LEVELS.forEach(function (level: ConsoleLevel): void {\n if (!(level in GLOBAL_OBJ.console)) {\n return;\n }\n\n fill(GLOBAL_OBJ.console, level, function (originalConsoleMethod: () => any): Function {\n originalConsoleMethods[level] = originalConsoleMethod;\n\n return function (...args: any[]): void {\n const handlerData: HandlerDataConsole = { args, level };\n triggerHandlers('console', handlerData);\n\n const log = originalConsoleMethods[level];\n log && log.apply(GLOBAL_OBJ.console, args);\n };\n });\n });\n}\n", "/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { Event, Exception, Mechanism, StackFrame } from '@sentry/types';\n\nimport { addNonEnumerableProperty } from './object';\nimport { snipLine } from './string';\nimport { GLOBAL_OBJ } from './worldwide';\n\ninterface CryptoInternal {\n getRandomValues(array: Uint8Array): Uint8Array;\n randomUUID?(): string;\n}\n\n/** An interface for common properties on global */\ninterface CryptoGlobal {\n msCrypto?: CryptoInternal;\n crypto?: CryptoInternal;\n}\n\n/**\n * UUID4 generator\n *\n * @returns string Generated UUID4.\n */\nexport function uuid4(): string {\n const gbl = GLOBAL_OBJ as typeof GLOBAL_OBJ & CryptoGlobal;\n const crypto = gbl.crypto || gbl.msCrypto;\n\n let getRandomByte = (): number => Math.random() * 16;\n try {\n if (crypto && crypto.randomUUID) {\n return crypto.randomUUID().replace(/-/g, '');\n }\n if (crypto && crypto.getRandomValues) {\n getRandomByte = () => {\n // crypto.getRandomValues might return undefined instead of the typed array\n // in old Chromium versions (e.g. 23.0.1235.0 (151422))\n // However, `typedArray` is still filled in-place.\n // @see https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues#typedarray\n const typedArray = new Uint8Array(1);\n crypto.getRandomValues(typedArray);\n return typedArray[0];\n };\n }\n } catch (_) {\n // some runtimes can crash invoking crypto\n // https://github.com/getsentry/sentry-javascript/issues/8935\n }\n\n // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523\n // Concatenating the following numbers as strings results in '10000000100040008000100000000000'\n return (([1e7] as unknown as string) + 1e3 + 4e3 + 8e3 + 1e11).replace(/[018]/g, c =>\n // eslint-disable-next-line no-bitwise\n ((c as unknown as number) ^ ((getRandomByte() & 15) >> ((c as unknown as number) / 4))).toString(16),\n );\n}\n\nfunction getFirstException(event: Event): Exception | undefined {\n return event.exception && event.exception.values ? event.exception.values[0] : undefined;\n}\n\n/**\n * Extracts either message or type+value from an event that can be used for user-facing logs\n * @returns event's description\n */\nexport function getEventDescription(event: Event): string {\n const { message, event_id: eventId } = event;\n if (message) {\n return message;\n }\n\n const firstException = getFirstException(event);\n if (firstException) {\n if (firstException.type && firstException.value) {\n return `${firstException.type}: ${firstException.value}`;\n }\n return firstException.type || firstException.value || eventId || '<unknown>';\n }\n return eventId || '<unknown>';\n}\n\n/**\n * Adds exception values, type and value to an synthetic Exception.\n * @param event The event to modify.\n * @param value Value of the exception.\n * @param type Type of the exception.\n * @hidden\n */\nexport function addExceptionTypeValue(event: Event, value?: string, type?: string): void {\n const exception = (event.exception = event.exception || {});\n const values = (exception.values = exception.values || []);\n const firstException = (values[0] = values[0] || {});\n if (!firstException.value) {\n firstException.value = value || '';\n }\n if (!firstException.type) {\n firstException.type = type || 'Error';\n }\n}\n\n/**\n * Adds exception mechanism data to a given event. Uses defaults if the second parameter is not passed.\n *\n * @param event The event to modify.\n * @param newMechanism Mechanism data to add to the event.\n * @hidden\n */\nexport function addExceptionMechanism(event: Event, newMechanism?: Partial<Mechanism>): void {\n const firstException = getFirstException(event);\n if (!firstException) {\n return;\n }\n\n const defaultMechanism = { type: 'generic', handled: true };\n const currentMechanism = firstException.mechanism;\n firstException.mechanism = { ...defaultMechanism, ...currentMechanism, ...newMechanism };\n\n if (newMechanism && 'data' in newMechanism) {\n const mergedData = { ...(currentMechanism && currentMechanism.data), ...newMechanism.data };\n firstException.mechanism.data = mergedData;\n }\n}\n\n// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\nconst SEMVER_REGEXP =\n /^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/;\n\n/**\n * Represents Semantic Versioning object\n */\ninterface SemVer {\n major?: number;\n minor?: number;\n patch?: number;\n prerelease?: string;\n buildmetadata?: string;\n}\n\n/**\n * Parses input into a SemVer interface\n * @param input string representation of a semver version\n */\nexport function parseSemver(input: string): SemVer {\n const match = input.match(SEMVER_REGEXP) || [];\n const major = parseInt(match[1], 10);\n const minor = parseInt(match[2], 10);\n const patch = parseInt(match[3], 10);\n return {\n buildmetadata: match[5],\n major: isNaN(major) ? undefined : major,\n minor: isNaN(minor) ? undefined : minor,\n patch: isNaN(patch) ? undefined : patch,\n prerelease: match[4],\n };\n}\n\n/**\n * This function adds context (pre/post/line) lines to the provided frame\n *\n * @param lines string[] containing all lines\n * @param frame StackFrame that will be mutated\n * @param linesOfContext number of context lines we want to add pre/post\n */\nexport function addContextToFrame(lines: string[], frame: StackFrame, linesOfContext: number = 5): void {\n // When there is no line number in the frame, attaching context is nonsensical and will even break grouping\n if (frame.lineno === undefined) {\n return;\n }\n\n const maxLines = lines.length;\n const sourceLine = Math.max(Math.min(maxLines - 1, frame.lineno - 1), 0);\n\n frame.pre_context = lines\n .slice(Math.max(0, sourceLine - linesOfContext), sourceLine)\n .map((line: string) => snipLine(line, 0));\n\n frame.context_line = snipLine(lines[Math.min(maxLines - 1, sourceLine)], frame.colno || 0);\n\n frame.post_context = lines\n .slice(Math.min(sourceLine + 1, maxLines), sourceLine + 1 + linesOfContext)\n .map((line: string) => snipLine(line, 0));\n}\n\n/**\n * Checks whether or not we've already captured the given exception (note: not an identical exception - the very object\n * in question), and marks it captured if not.\n *\n * This is useful because it's possible for an error to get captured by more than one mechanism. After we intercept and\n * record an error, we rethrow it (assuming we've intercepted it before it's reached the top-level global handlers), so\n * that we don't interfere with whatever effects the error might have had were the SDK not there. At that point, because\n * the error has been rethrown, it's possible for it to bubble up to some other code we've instrumented. If it's not\n * caught after that, it will bubble all the way up to the global handlers (which of course we also instrument). This\n * function helps us ensure that even if we encounter the same error more than once, we only record it the first time we\n * see it.\n *\n * Note: It will ignore primitives (always return `false` and not mark them as seen), as properties can't be set on\n * them. {@link: Object.objectify} can be used on exceptions to convert any that are primitives into their equivalent\n * object wrapper forms so that this check will always work. However, because we need to flag the exact object which\n * will get rethrown, and because that rethrowing happens outside of the event processing pipeline, the objectification\n * must be done before the exception captured.\n *\n * @param A thrown exception to check or flag as having been seen\n * @returns `true` if the exception has already been captured, `false` if not (with the side effect of marking it seen)\n */\nexport function checkOrSetAlreadyCaught(exception: unknown): boolean {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (exception && (exception as any).__sentry_captured__) {\n return true;\n }\n\n try {\n // set it this way rather than by assignment so that it's not ennumerable and therefore isn't recorded by the\n // `ExtraErrorData` integration\n addNonEnumerableProperty(exception as { [key: string]: unknown }, '__sentry_captured__', true);\n } catch (err) {\n // `exception` is a primitive, so we can't mark it seen\n }\n\n return false;\n}\n\n/**\n * Checks whether the given input is already an array, and if it isn't, wraps it in one.\n *\n * @param maybeArray Input to turn into an array, if necessary\n * @returns The input, if already an array, or an array with the input as the only element, if not\n */\nexport function arrayify<T = unknown>(maybeArray: T | T[]): T[] {\n return Array.isArray(maybeArray) ? maybeArray : [maybeArray];\n}\n", "// TODO(v8): Move everything in this file into the browser package. Nothing here is generic and we run risk of leaking browser types into non-browser packages.\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/ban-types */\nimport type { HandlerDataDom } from '@sentry/types';\n\nimport { uuid4 } from '../misc';\nimport { addNonEnumerableProperty, fill } from '../object';\nimport { GLOBAL_OBJ } from '../worldwide';\nimport { addHandler, maybeInstrument, triggerHandlers } from './_handlers';\n\ntype SentryWrappedTarget = HTMLElement & { _sentryId?: string };\n\ntype AddEventListener = (\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | AddEventListenerOptions,\n) => void;\ntype RemoveEventListener = (\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | EventListenerOptions,\n) => void;\n\ntype InstrumentedElement = Element & {\n __sentry_instrumentation_handlers__?: {\n [key in 'click' | 'keypress']?: {\n handler?: Function;\n /** The number of custom listeners attached to this element */\n refCount: number;\n };\n };\n};\n\nconst WINDOW = GLOBAL_OBJ as unknown as Window;\nconst DEBOUNCE_DURATION = 1000;\n\nlet debounceTimerID: number | undefined;\nlet lastCapturedEventType: string | undefined;\nlet lastCapturedEventTargetId: string | undefined;\n\n/**\n * Add an instrumentation handler for when a click or a keypress happens.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nexport function addClickKeypressInstrumentationHandler(handler: (data: HandlerDataDom) => void): void {\n const type = 'dom';\n addHandler(type, handler);\n maybeInstrument(type, instrumentDOM);\n}\n\n/** Exported for tests only. */\nexport function instrumentDOM(): void {\n if (!WINDOW.document) {\n return;\n }\n\n // Make it so that any click or keypress that is unhandled / bubbled up all the way to the document triggers our dom\n // handlers. (Normally we have only one, which captures a breadcrumb for each click or keypress.) Do this before\n // we instrument `addEventListener` so that we don't end up attaching this handler twice.\n const triggerDOMHandler = triggerHandlers.bind(null, 'dom');\n const globalDOMEventHandler = makeDOMEventHandler(triggerDOMHandler, true);\n WINDOW.document.addEventListener('click', globalDOMEventHandler, false);\n WINDOW.document.addEventListener('keypress', globalDOMEventHandler, false);\n\n // After hooking into click and keypress events bubbled up to `document`, we also hook into user-handled\n // clicks & keypresses, by adding an event listener of our own to any element to which they add a listener. That\n // way, whenever one of their handlers is triggered, ours will be, too. (This is needed because their handler\n // could potentially prevent the event from bubbling up to our global listeners. This way, our handler are still\n // guaranteed to fire at least once.)\n ['EventTarget', 'Node'].forEach((target: string) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const proto = (WINDOW as any)[target] && (WINDOW as any)[target].prototype;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, no-prototype-builtins\n if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) {\n return;\n }\n\n fill(proto, 'addEventListener', function (originalAddEventListener: AddEventListener): AddEventListener {\n return function (\n this: Element,\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | AddEventListenerOptions,\n ): AddEventListener {\n if (type === 'click' || type == 'keypress') {\n try {\n const el = this as InstrumentedElement;\n const handlers = (el.__sentry_instrumentation_handlers__ = el.__sentry_instrumentation_handlers__ || {});\n const handlerForType = (handlers[type] = handlers[type] || { refCount: 0 });\n\n if (!handlerForType.handler) {\n const handler = makeDOMEventHandler(triggerDOMHandler);\n handlerForType.handler = handler;\n originalAddEventListener.call(this, type, handler, options);\n }\n\n handlerForType.refCount++;\n } catch (e) {\n // Accessing dom properties is always fragile.\n // Also allows us to skip `addEventListenrs` calls with no proper `this` context.\n }\n }\n\n return originalAddEventListener.call(this, type, listener, options);\n };\n });\n\n fill(\n proto,\n 'removeEventListener',\n function (originalRemoveEventListener: RemoveEventListener): RemoveEventListener {\n return function (\n this: Element,\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | EventListenerOptions,\n ): () => void {\n if (type === 'click' || type == 'keypress') {\n try {\n const el = this as InstrumentedElement;\n const handlers = el.__sentry_instrumentation_handlers__ || {};\n const handlerForType = handlers[type];\n\n if (handlerForType) {\n handlerForType.refCount--;\n // If there are no longer any custom handlers of the current type on this element, we can remove ours, too.\n if (handlerForType.refCount <= 0) {\n originalRemoveEventListener.call(this, type, handlerForType.handler, options);\n handlerForType.handler = undefined;\n delete handlers[type]; // eslint-disable-line @typescript-eslint/no-dynamic-delete\n }\n\n // If there are no longer any custom handlers of any type on this element, cleanup everything.\n if (Object.keys(handlers).length === 0) {\n delete el.__sentry_instrumentation_handlers__;\n }\n }\n } catch (e) {\n // Accessing dom properties is always fragile.\n // Also allows us to skip `addEventListenrs` calls with no proper `this` context.\n }\n }\n\n return originalRemoveEventListener.call(this, type, listener, options);\n };\n },\n );\n });\n}\n\n/**\n * Check whether the event is similar to the last captured one. For example, two click events on the same button.\n */\nfunction isSimilarToLastCapturedEvent(event: Event): boolean {\n // If both events have different type, then user definitely performed two separate actions. e.g. click + keypress.\n if (event.type !== lastCapturedEventType) {\n return false;\n }\n\n try {\n // If both events have the same type, it's still possible that actions were performed on different targets.\n // e.g. 2 clicks on different buttons.\n if (!event.target || (event.target as SentryWrappedTarget)._sentryId !== lastCapturedEventTargetId) {\n return false;\n }\n } catch (e) {\n // just accessing `target` property can throw an exception in some rare circumstances\n // see: https://github.com/getsentry/sentry-javascript/issues/838\n }\n\n // If both events have the same type _and_ same `target` (an element which triggered an event, _not necessarily_\n // to which an event listener was attached), we treat them as the same action, as we want to capture\n // only one breadcrumb. e.g. multiple clicks on the same button, or typing inside a user input box.\n return true;\n}\n\n/**\n * Decide whether an event should be captured.\n * @param event event to be captured\n */\nfunction shouldSkipDOMEvent(eventType: string, target: SentryWrappedTarget | null): boolean {\n // We are only interested in filtering `keypress` events for now.\n if (eventType !== 'keypress') {\n return false;\n }\n\n if (!target || !target.tagName) {\n return true;\n }\n\n // Only consider keypress events on actual input elements. This will disregard keypresses targeting body\n // e.g.tabbing through elements, hotkeys, etc.\n if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable) {\n return false;\n }\n\n return true;\n}\n\n/**\n * Wraps addEventListener to capture UI breadcrumbs\n */\nfunction makeDOMEventHandler(\n handler: (data: HandlerDataDom) => void,\n globalListener: boolean = false,\n): (event: Event) => void {\n return (event: Event & { _sentryCaptured?: true }): void => {\n // It's possible this handler might trigger multiple times for the same\n // event (e.g. event propagation through node ancestors).\n // Ignore if we've already captured that event.\n if (!event || event['_sentryCaptured']) {\n return;\n }\n\n const target = getEventTarget(event);\n\n // We always want to skip _some_ events.\n if (shouldSkipDOMEvent(event.type, target)) {\n return;\n }\n\n // Mark event as \"seen\"\n addNonEnumerableProperty(event, '_sentryCaptured', true);\n\n if (target && !target._sentryId) {\n // Add UUID to event target so we can identify if\n addNonEnumerableProperty(target, '_sentryId', uuid4());\n }\n\n const name = event.type === 'keypress' ? 'input' : event.type;\n\n // If there is no last captured event, it means that we can safely capture the new event and store it for future comparisons.\n // If there is a last captured event, see if the new event is different enough to treat it as a unique one.\n // If that's the case, emit the previous event and store locally the newly-captured DOM event.\n if (!isSimilarToLastCapturedEvent(event)) {\n const handlerData: HandlerDataDom = { event, name, global: globalListener };\n handler(handlerData);\n lastCapturedEventType = event.type;\n lastCapturedEventTargetId = target ? target._sentryId : undefined;\n }\n\n // Start a new debounce timer that will prevent us from capturing multiple events that should be grouped together.\n clearTimeout(debounceTimerID);\n debounceTimerID = WINDOW.setTimeout(() => {\n lastCapturedEventTargetId = undefined;\n lastCapturedEventType = undefined;\n }, DEBOUNCE_DURATION);\n };\n}\n\nfunction getEventTarget(event: Event): SentryWrappedTarget | null {\n try {\n return event.target as SentryWrappedTarget | null;\n } catch (e) {\n // just accessing `target` property can throw an exception in some rare circumstances\n // see: https://github.com/getsentry/sentry-javascript/issues/838\n return null;\n }\n}\n", "import { DEBUG_BUILD } from './debug-build';\nimport { logger } from './logger';\nimport { getGlobalObject } from './worldwide';\n\n// eslint-disable-next-line deprecation/deprecation\nconst WINDOW = getGlobalObject<Window>();\n\ndeclare const EdgeRuntime: string | undefined;\n\nexport { supportsHistory } from './vendor/supportsHistory';\n\n/**\n * Tells whether current environment supports ErrorEvent objects\n * {@link supportsErrorEvent}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsErrorEvent(): boolean {\n try {\n new ErrorEvent('');\n return true;\n } catch (e) {\n return false;\n }\n}\n\n/**\n * Tells whether current environment supports DOMError objects\n * {@link supportsDOMError}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsDOMError(): boolean {\n try {\n // Chrome: VM89:1 Uncaught TypeError: Failed to construct 'DOMError':\n // 1 argument required, but only 0 present.\n // @ts-expect-error It really needs 1 argument, not 0.\n new DOMError('');\n return true;\n } catch (e) {\n return false;\n }\n}\n\n/**\n * Tells whether current environment supports DOMException objects\n * {@link supportsDOMException}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsDOMException(): boolean {\n try {\n new DOMException('');\n return true;\n } catch (e) {\n return false;\n }\n}\n\n/**\n * Tells whether current environment supports Fetch API\n * {@link supportsFetch}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsFetch(): boolean {\n if (!('fetch' in WINDOW)) {\n return false;\n }\n\n try {\n new Headers();\n new Request('http://www.example.com');\n new Response();\n return true;\n } catch (e) {\n return false;\n }\n}\n/**\n * isNativeFetch checks if the given function is a native implementation of fetch()\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function isNativeFetch(func: Function): boolean {\n return func && /^function fetch\\(\\)\\s+\\{\\s+\\[native code\\]\\s+\\}$/.test(func.toString());\n}\n\n/**\n * Tells whether current environment supports Fetch API natively\n * {@link supportsNativeFetch}.\n *\n * @returns true if `window.fetch` is natively implemented, false otherwise\n */\nexport function supportsNativeFetch(): boolean {\n if (typeof EdgeRuntime === 'string') {\n return true;\n }\n\n if (!supportsFetch()) {\n return false;\n }\n\n // Fast path to avoid DOM I/O\n // eslint-disable-next-line @typescript-eslint/unbound-method\n if (isNativeFetch(WINDOW.fetch)) {\n return true;\n }\n\n // window.fetch is implemented, but is polyfilled or already wrapped (e.g: by a chrome extension)\n // so create a \"pure\" iframe to see if that has native fetch\n let result = false;\n const doc = WINDOW.document;\n // eslint-disable-next-line deprecation/deprecation\n if (doc && typeof (doc.createElement as unknown) === 'function') {\n try {\n const sandbox = doc.createElement('iframe');\n sandbox.hidden = true;\n doc.head.appendChild(sandbox);\n if (sandbox.contentWindow && sandbox.contentWindow.fetch) {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n result = isNativeFetch(sandbox.contentWindow.fetch);\n }\n doc.head.removeChild(sandbox);\n } catch (err) {\n DEBUG_BUILD &&\n logger.warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', err);\n }\n }\n\n return result;\n}\n\n/**\n * Tells whether current environment supports ReportingObserver API\n * {@link supportsReportingObserver}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsReportingObserver(): boolean {\n return 'ReportingObserver' in WINDOW;\n}\n\n/**\n * Tells whether current environment supports Referrer Policy API\n * {@link supportsReferrerPolicy}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsReferrerPolicy(): boolean {\n // Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default'\n // (see https://caniuse.com/#feat=referrer-policy),\n // it doesn't. And it throws an exception instead of ignoring this parameter...\n // REF: https://github.com/getsentry/raven-js/issues/1233\n\n if (!supportsFetch()) {\n return false;\n }\n\n try {\n new Request('_', {\n referrerPolicy: 'origin' as ReferrerPolicy,\n });\n return true;\n } catch (e) {\n return false;\n }\n}\n", "/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/ban-types */\nimport type { HandlerDataFetch } from '@sentry/types';\n\nimport { fill } from '../object';\nimport { supportsNativeFetch } from '../supports';\nimport { GLOBAL_OBJ } from '../worldwide';\nimport { addHandler, maybeInstrument, triggerHandlers } from './_handlers';\n\ntype FetchResource = string | { toString(): string } | { url: string };\n\n/**\n * Add an instrumentation handler for when a fetch request happens.\n * The handler function is called once when the request starts and once when it ends,\n * which can be identified by checking if it has an `endTimestamp`.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nexport function addFetchInstrumentationHandler(handler: (data: HandlerDataFetch) => void): void {\n const type = 'fetch';\n addHandler(type, handler);\n maybeInstrument(type, instrumentFetch);\n}\n\nfunction instrumentFetch(): void {\n if (!supportsNativeFetch()) {\n return;\n }\n\n fill(GLOBAL_OBJ, 'fetch', function (originalFetch: () => void): () => void {\n return function (...args: any[]): void {\n const { method, url } = parseFetchArgs(args);\n\n const handlerData: HandlerDataFetch = {\n args,\n fetchData: {\n method,\n url,\n },\n startTimestamp: Date.now(),\n };\n\n triggerHandlers('fetch', {\n ...handlerData,\n });\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return originalFetch.apply(GLOBAL_OBJ, args).then(\n (response: Response) => {\n const finishedHandlerData: HandlerDataFetch = {\n ...handlerData,\n endTimestamp: Date.now(),\n response,\n };\n\n triggerHandlers('fetch', finishedHandlerData);\n return response;\n },\n (error: Error) => {\n const erroredHandlerData: HandlerDataFetch = {\n ...handlerData,\n endTimestamp: Date.now(),\n error,\n };\n\n triggerHandlers('fetch', erroredHandlerData);\n // NOTE: If you are a Sentry user, and you are seeing this stack frame,\n // it means the sentry.javascript SDK caught an error invoking your application code.\n // This is expected behavior and NOT indicative of a bug with sentry.javascript.\n throw error;\n },\n );\n };\n });\n}\n\nfunction hasProp<T extends string>(obj: unknown, prop: T): obj is Record<string, string> {\n return !!obj && typeof obj === 'object' && !!(obj as Record<string, string>)[prop];\n}\n\nfunction getUrlFromResource(resource: FetchResource): string {\n if (typeof resource === 'string') {\n return resource;\n }\n\n if (!resource) {\n return '';\n }\n\n if (hasProp(resource, 'url')) {\n return resource.url;\n }\n\n if (resource.toString) {\n return resource.toString();\n }\n\n return '';\n}\n\n/**\n * Parses the fetch arguments to find the used Http method and the url of the request.\n * Exported for tests only.\n */\nexport function parseFetchArgs(fetchArgs: unknown[]): { method: string; url: string } {\n if (fetchArgs.length === 0) {\n return { method: 'GET', url: '' };\n }\n\n if (fetchArgs.length === 2) {\n const [url, options] = fetchArgs as [FetchResource, object];\n\n return {\n url: getUrlFromResource(url),\n method: hasProp(options, 'method') ? String(options.method).toUpperCase() : 'GET',\n };\n }\n\n const arg = fetchArgs[0];\n return {\n url: getUrlFromResource(arg as FetchResource),\n method: hasProp(arg, 'method') ? String(arg.method).toUpperCase() : 'GET',\n };\n}\n", "import type { HandlerDataError } from '@sentry/types';\n\nimport { GLOBAL_OBJ } from '../worldwide';\nimport { addHandler, maybeInstrument, triggerHandlers } from './_handlers';\n\nlet _oldOnErrorHandler: (typeof GLOBAL_OBJ)['onerror'] | null = null;\n\n/**\n * Add an instrumentation handler for when an error is captured by the global error handler.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nexport function addGlobalErrorInstrumentationHandler(handler: (data: HandlerDataError) => void): void {\n const type = 'error';\n addHandler(type, handler);\n maybeInstrument(type, instrumentError);\n}\n\nfunction instrumentError(): void {\n _oldOnErrorHandler = GLOBAL_OBJ.onerror;\n\n GLOBAL_OBJ.onerror = function (\n msg: string | object,\n url?: string,\n line?: number,\n column?: number,\n error?: Error,\n ): boolean {\n const handlerData: HandlerDataError = {\n column,\n error,\n line,\n msg,\n url,\n };\n triggerHandlers('error', handlerData);\n\n if (_oldOnErrorHandler && !_oldOnErrorHandler.__SENTRY_LOADER__) {\n // eslint-disable-next-line prefer-rest-params\n return _oldOnErrorHandler.apply(this, arguments);\n }\n\n return false;\n };\n\n GLOBAL_OBJ.onerror.__SENTRY_INSTRUMENTED__ = true;\n}\n", "/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { HandlerDataUnhandledRejection } from '@sentry/types';\n\nimport { GLOBAL_OBJ } from '../worldwide';\nimport { addHandler, maybeInstrument, triggerHandlers } from './_handlers';\n\nlet _oldOnUnhandledRejectionHandler: (typeof GLOBAL_OBJ)['onunhandledrejection'] | null = null;\n\n/**\n * Add an instrumentation handler for when an unhandled promise rejection is captured.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nexport function addGlobalUnhandledRejectionInstrumentationHandler(\n handler: (data: HandlerDataUnhandledRejection) => void,\n): void {\n const type = 'unhandledrejection';\n addHandler(type, handler);\n maybeInstrument(type, instrumentUnhandledRejection);\n}\n\nfunction instrumentUnhandledRejection(): void {\n _oldOnUnhandledRejectionHandler = GLOBAL_OBJ.onunhandledrejection;\n\n GLOBAL_OBJ.onunhandledrejection = function (e: any): boolean {\n const handlerData: HandlerDataUnhandledRejection = e;\n triggerHandlers('unhandledrejection', handlerData);\n\n if (_oldOnUnhandledRejectionHandler && !_oldOnUnhandledRejectionHandler.__SENTRY_LOADER__) {\n // eslint-disable-next-line prefer-rest-params\n return _oldOnUnhandledRejectionHandler.apply(this, arguments);\n }\n\n return true;\n };\n\n GLOBAL_OBJ.onunhandledrejection.__SENTRY_INSTRUMENTED__ = true;\n}\n", "// Based on https://github.com/angular/angular.js/pull/13945/files\n// The MIT License\n\n// Copyright (c) 2010-2016 Google, Inc. http://angularjs.org\n\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nimport { getGlobalObject } from '../worldwide';\n\n// eslint-disable-next-line deprecation/deprecation\nconst WINDOW = getGlobalObject<Window>();\n\n/**\n * Tells whether current environment supports History API\n * {@link supportsHistory}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsHistory(): boolean {\n // NOTE: in Chrome App environment, touching history.pushState, *even inside\n // a try/catch block*, will cause Chrome to output an error to console.error\n // borrowed from: https://github.com/angular/angular.js/pull/13945/files\n /* eslint-disable @typescript-eslint/no-unsafe-member-access */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const chromeVar = (WINDOW as any).chrome;\n const isChromePackagedApp = chromeVar && chromeVar.app && chromeVar.app.runtime;\n /* eslint-enable @typescript-eslint/no-unsafe-member-access */\n const hasHistoryApi = 'history' in WINDOW && !!WINDOW.history.pushState && !!WINDOW.history.replaceState;\n\n return !isChromePackagedApp && hasHistoryApi;\n}\n", "// TODO(v8): Move everything in this file into the browser package. Nothing here is generic and we run risk of leaking browser types into non-browser packages.\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/ban-types */\nimport type { HandlerDataHistory } from '@sentry/types';\n\nimport { fill } from '../object';\nimport { supportsHistory } from '../supports';\nimport { GLOBAL_OBJ } from '../worldwide';\nimport { addHandler, maybeInstrument, triggerHandlers } from './_handlers';\n\nconst WINDOW = GLOBAL_OBJ as unknown as Window;\n\nlet lastHref: string | undefined;\n\n/**\n * Add an instrumentation handler for when a fetch request happens.\n * The handler function is called once when the request starts and once when it ends,\n * which can be identified by checking if it has an `endTimestamp`.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nexport function addHistoryInstrumentationHandler(handler: (data: HandlerDataHistory) => void): void {\n const type = 'history';\n addHandler(type, handler);\n maybeInstrument(type, instrumentHistory);\n}\n\nfunction instrumentHistory(): void {\n if (!supportsHistory()) {\n return;\n }\n\n const oldOnPopState = WINDOW.onpopstate;\n WINDOW.onpopstate = function (this: WindowEventHandlers, ...args: any[]): any {\n const to = WINDOW.location.href;\n // keep track of the current URL state, as we always receive only the updated state\n const from = lastHref;\n lastHref = to;\n const handlerData: HandlerDataHistory = { from, to };\n triggerHandlers('history', handlerData);\n if (oldOnPopState) {\n // Apparently this can throw in Firefox when incorrectly implemented plugin is installed.\n // https://github.com/getsentry/sentry-javascript/issues/3344\n // https://github.com/bugsnag/bugsnag-js/issues/469\n try {\n return oldOnPopState.apply(this, args);\n } catch (_oO) {\n // no-empty\n }\n }\n };\n\n function historyReplacementFunction(originalHistoryFunction: () => void): () => void {\n return function (this: History, ...args: any[]): void {\n const url = args.length > 2 ? args[2] : undefined;\n if (url) {\n // coerce to string (this is what pushState does)\n const from = lastHref;\n const to = String(url);\n // keep track of the current URL state, as we always receive only the updated state\n lastHref = to;\n const handlerData: HandlerDataHistory = { from, to };\n triggerHandlers('history', handlerData);\n }\n return originalHistoryFunction.apply(this, args);\n };\n }\n\n fill(WINDOW.history, 'pushState', historyReplacementFunction);\n fill(WINDOW.history, 'replaceState', historyReplacementFunction);\n}\n", "// TODO(v8): Move everything in this file into the browser package. Nothing here is generic and we run risk of leaking browser types into non-browser packages.\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/ban-types */\nimport type { HandlerDataXhr, SentryWrappedXMLHttpRequest, WrappedFunction } from '@sentry/types';\n\nimport { isString } from '../is';\nimport { fill } from '../object';\nimport { GLOBAL_OBJ } from '../worldwide';\nimport { addHandler, maybeInstrument, triggerHandlers } from './_handlers';\n\nconst WINDOW = GLOBAL_OBJ as unknown as Window;\n\nexport const SENTRY_XHR_DATA_KEY = '__sentry_xhr_v3__';\n\n/**\n * Add an instrumentation handler for when an XHR request happens.\n * The handler function is called once when the request starts and once when it ends,\n * which can be identified by checking if it has an `endTimestamp`.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nexport function addXhrInstrumentationHandler(handler: (data: HandlerDataXhr) => void): void {\n const type = 'xhr';\n addHandler(type, handler);\n maybeInstrument(type, instrumentXHR);\n}\n\n/** Exported only for tests. */\nexport function instrumentXHR(): void {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (!(WINDOW as any).XMLHttpRequest) {\n return;\n }\n\n const xhrproto = XMLHttpRequest.prototype;\n\n fill(xhrproto, 'open', function (originalOpen: () => void): () => void {\n return function (this: XMLHttpRequest & SentryWrappedXMLHttpRequest, ...args: any[]): void {\n const startTimestamp = Date.now();\n\n // open() should always be called with two or more arguments\n // But to be on the safe side, we actually validate this and bail out if we don't have a method & url\n const method = isString(args[0]) ? args[0].toUpperCase() : undefined;\n const url = parseUrl(args[1]);\n\n if (!method || !url) {\n return originalOpen.apply(this, args);\n }\n\n this[SENTRY_XHR_DATA_KEY] = {\n method,\n url,\n request_headers: {},\n };\n\n // if Sentry key appears in URL, don't capture it as a request\n if (method === 'POST' && url.match(/sentry_key/)) {\n this.__sentry_own_request__ = true;\n }\n\n const onreadystatechangeHandler: () => void = () => {\n // For whatever reason, this is not the same instance here as from the outer method\n const xhrInfo = this[SENTRY_XHR_DATA_KEY];\n\n if (!xhrInfo) {\n return;\n }\n\n if (this.readyState === 4) {\n try {\n // touching statusCode in some platforms throws\n // an exception\n xhrInfo.status_code = this.status;\n } catch (e) {\n /* do nothing */\n }\n\n const handlerData: HandlerDataXhr = {\n args: [method, url],\n endTimestamp: Date.now(),\n startTimestamp,\n xhr: this,\n };\n triggerHandlers('xhr', handlerData);\n }\n };\n\n if ('onreadystatechange' in this && typeof this.onreadystatechange === 'function') {\n fill(this, 'onreadystatechange', function (original: WrappedFunction): Function {\n return function (this: SentryWrappedXMLHttpRequest, ...readyStateArgs: any[]): void {\n onreadystatechangeHandler();\n return original.apply(this, readyStateArgs);\n };\n });\n } else {\n this.addEventListener('readystatechange', onreadystatechangeHandler);\n }\n\n // Intercepting `setRequestHeader` to access the request headers of XHR instance.\n // This will only work for user/library defined headers, not for the default/browser-assigned headers.\n // Request cookies are also unavailable for XHR, as `Cookie` header can't be defined by `setRequestHeader`.\n fill(this, 'setRequestHeader', function (original: WrappedFunction): Function {\n return function (this: SentryWrappedXMLHttpRequest, ...setRequestHeaderArgs: unknown[]): void {\n const [header, value] = setRequestHeaderArgs;\n\n const xhrInfo = this[SENTRY_XHR_DATA_KEY];\n\n if (xhrInfo && isString(header) && isString(value)) {\n xhrInfo.request_headers[header.toLowerCase()] = value;\n }\n\n return original.apply(this, setRequestHeaderArgs);\n };\n });\n\n return originalOpen.apply(this, args);\n };\n });\n\n fill(xhrproto, 'send', function (originalSend: () => void): () => void {\n return function (this: XMLHttpRequest & SentryWrappedXMLHttpRequest, ...args: any[]): void {\n const sentryXhrData = this[SENTRY_XHR_DATA_KEY];\n\n if (!sentryXhrData) {\n return originalSend.apply(this, args);\n }\n\n if (args[0] !== undefined) {\n sentryXhrData.body = args[0];\n }\n\n const handlerData: HandlerDataXhr = {\n args: [sentryXhrData.method, sentryXhrData.url],\n startTimestamp: Date.now(),\n xhr: this,\n };\n triggerHandlers('xhr', handlerData);\n\n return originalSend.apply(this, args);\n };\n });\n}\n\nfunction parseUrl(url: string | unknown): string | undefined {\n if (isString(url)) {\n return url;\n }\n\n try {\n // url can be a string or URL\n // but since URL is not available in IE11, we do not check for it,\n // but simply assume it is an URL and return `toString()` from it (which returns the full URL)\n // If that fails, we just return undefined\n return (url as URL).toString();\n } catch {} // eslint-disable-line no-empty\n\n return undefined;\n}\n", "/*\n * This module exists for optimizations in the build process through rollup and terser. We define some global\n * constants, which can be overridden during build. By guarding certain pieces of code with functions that return these\n * constants, we can control whether or not they appear in the final bundle. (Any code guarded by a false condition will\n * never run, and will hence be dropped during treeshaking.) The two primary uses for this are stripping out calls to\n * `logger` and preventing node-related code from appearing in browser bundles.\n *\n * Attention:\n * This file should not be used to define constants/flags that are intended to be used for tree-shaking conducted by\n * users. These flags should live in their respective packages, as we identified user tooling (specifically webpack)\n * having issues tree-shaking these constants across package boundaries.\n * An example for this is the __SENTRY_DEBUG__ constant. It is declared in each package individually because we want\n * users to be able to shake away expressions that it guards.\n */\n\ndeclare const __SENTRY_BROWSER_BUNDLE__: boolean | undefined;\n\nexport type SdkSource = 'npm' | 'cdn' | 'loader';\n\n/**\n * Figures out if we're building a browser bundle.\n *\n * @returns true if this is a browser bundle build.\n */\nexport function isBrowserBundle(): boolean {\n return typeof __SENTRY_BROWSER_BUNDLE__ !== 'undefined' && !!__SENTRY_BROWSER_BUNDLE__;\n}\n\n/**\n * Get source of SDK.\n */\nexport function getSDKSource(): SdkSource {\n // @ts-expect-error __SENTRY_SDK_SOURCE__ is injected by rollup during build process\n return __SENTRY_SDK_SOURCE__;\n}\n", "/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nexport type MemoFunc = [\n // memoize\n (obj: any) => boolean,\n // unmemoize\n (obj: any) => void,\n];\n\n/**\n * Helper to decycle json objects\n */\nexport function memoBuilder(): MemoFunc {\n const hasWeakSet = typeof WeakSet === 'function';\n const inner: any = hasWeakSet ? new WeakSet() : [];\n function memoize(obj: any): boolean {\n if (hasWeakSet) {\n if (inner.has(obj)) {\n return true;\n }\n inner.add(obj);\n return false;\n }\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < inner.length; i++) {\n const value = inner[i];\n if (value === obj) {\n return true;\n }\n }\n inner.push(obj);\n return false;\n }\n\n function unmemoize(obj: any): void {\n if (hasWeakSet) {\n inner.delete(obj);\n } else {\n for (let i = 0; i < inner.length; i++) {\n if (inner[i] === obj) {\n inner.splice(i, 1);\n break;\n }\n }\n }\n }\n return [memoize, unmemoize];\n}\n", "import type { Primitive } from '@sentry/types';\n\nimport { isNaN, isSyntheticEvent, isVueViewModel } from './is';\nimport type { MemoFunc } from './memo';\nimport { memoBuilder } from './memo';\nimport { convertToPlainObject } from './object';\nimport { getFunctionName } from './stacktrace';\n\ntype Prototype = { constructor: (...args: unknown[]) => unknown };\n// This is a hack to placate TS, relying on the fact that technically, arrays are objects with integer keys. Normally we\n// think of those keys as actual numbers, but `arr['0']` turns out to work just as well as `arr[0]`, and doing it this\n// way lets us use a single type in the places where behave as if we are only dealing with objects, even if some of them\n// might be arrays.\ntype ObjOrArray<T> = { [key: string]: T };\n\n/**\n * Recursively normalizes the given object.\n *\n * - Creates a copy to prevent original input mutation\n * - Skips non-enumerable properties\n * - When stringifying, calls `toJSON` if implemented\n * - Removes circular references\n * - Translates non-serializable values (`undefined`/`NaN`/functions) to serializable format\n * - Translates known global objects/classes to a string representations\n * - Takes care of `Error` object serialization\n * - Optionally limits depth of final output\n * - Optionally limits number of properties/elements included in any single object/array\n *\n * @param input The object to be normalized.\n * @param depth The max depth to which to normalize the object. (Anything deeper stringified whole.)\n * @param maxProperties The max number of elements or properties to be included in any single array or\n * object in the normallized output.\n * @returns A normalized version of the object, or `\"**non-serializable**\"` if any errors are thrown during normalization.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function normalize(input: unknown, depth: number = 100, maxProperties: number = +Infinity): any {\n try {\n // since we're at the outermost level, we don't provide a key\n return visit('', input, depth, maxProperties);\n } catch (err) {\n return { ERROR: `**non-serializable** (${err})` };\n }\n}\n\n/** JSDoc */\nexport function normalizeToSize<T>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n object: { [key: string]: any },\n // Default Node.js REPL depth\n depth: number = 3,\n // 100kB, as 200kB is max payload size, so half sounds reasonable\n maxSize: number = 100 * 1024,\n): T {\n const normalized = normalize(object, depth);\n\n if (jsonSize(normalized) > maxSize) {\n return normalizeToSize(object, depth - 1, maxSize);\n }\n\n return normalized as T;\n}\n\n/**\n * Visits a node to perform normalization on it\n *\n * @param key The key corresponding to the given node\n * @param value The node to be visited\n * @param depth Optional number indicating the maximum recursion depth\n * @param maxProperties Optional maximum number of properties/elements included in any single object/array\n * @param memo Optional Memo class handling decycling\n */\nfunction visit(\n key: string,\n value: unknown,\n depth: number = +Infinity,\n maxProperties: number = +Infinity,\n memo: MemoFunc = memoBuilder(),\n): Primitive | ObjOrArray<unknown> {\n const [memoize, unmemoize] = memo;\n\n // Get the simple cases out of the way first\n if (\n value == null || // this matches null and undefined -> eqeq not eqeqeq\n (['number', 'boolean', 'string'].includes(typeof value) && !isNaN(value))\n ) {\n return value as Primitive;\n }\n\n const stringified = stringifyValue(key, value);\n\n // Anything we could potentially dig into more (objects or arrays) will have come back as `\"[object XXXX]\"`.\n // Everything else will have already been serialized, so if we don't see that pattern, we're done.\n if (!stringified.startsWith('[object ')) {\n return stringified;\n }\n\n // From here on, we can assert that `value` is either an object or an array.\n\n // Do not normalize objects that we know have already been normalized. As a general rule, the\n // \"__sentry_skip_normalization__\" property should only be used sparingly and only should only be set on objects that\n // have already been normalized.\n if ((value as ObjOrArray<unknown>)['__sentry_skip_normalization__']) {\n return value as ObjOrArray<unknown>;\n }\n\n // We can set `__sentry_override_normalization_depth__` on an object to ensure that from there\n // We keep a certain amount of depth.\n // This should be used sparingly, e.g. we use it for the redux integration to ensure we get a certain amount of state.\n const remainingDepth =\n typeof (value as ObjOrArray<unknown>)['__sentry_override_normalization_depth__'] === 'number'\n ? ((value as ObjOrArray<unknown>)['__sentry_override_normalization_depth__'] as number)\n : depth;\n\n // We're also done if we've reached the max depth\n if (remainingDepth === 0) {\n // At this point we know `serialized` is a string of the form `\"[object XXXX]\"`. Clean it up so it's just `\"[XXXX]\"`.\n return stringified.replace('object ', '');\n }\n\n // If we've already visited this branch, bail out, as it's circular reference. If not, note that we're seeing it now.\n if (memoize(value)) {\n return '[Circular ~]';\n }\n\n // If the value has a `toJSON` method, we call it to extract more information\n const valueWithToJSON = value as unknown & { toJSON?: () => unknown };\n if (valueWithToJSON && typeof valueWithToJSON.toJSON === 'function') {\n try {\n const jsonValue = valueWithToJSON.toJSON();\n // We need to normalize the return value of `.toJSON()` in case it has circular references\n return visit('', jsonValue, remainingDepth - 1, maxProperties, memo);\n } catch (err) {\n // pass (The built-in `toJSON` failed, but we can still try to do it ourselves)\n }\n }\n\n // At this point we know we either have an object or an array, we haven't seen it before, and we're going to recurse\n // because we haven't yet reached the max depth. Create an accumulator to hold the results of visiting each\n // property/entry, and keep track of the number of items we add to it.\n const normalized = (Array.isArray(value) ? [] : {}) as ObjOrArray<unknown>;\n let numAdded = 0;\n\n // Before we begin, convert`Error` and`Event` instances into plain objects, since some of each of their relevant\n // properties are non-enumerable and otherwise would get missed.\n const visitable = convertToPlainObject(value as ObjOrArray<unknown>);\n\n for (const visitKey in visitable) {\n // Avoid iterating over fields in the prototype if they've somehow been exposed to enumeration.\n if (!Object.prototype.hasOwnProperty.call(visitable, visitKey)) {\n continue;\n }\n\n if (numAdded >= maxProperties) {\n normalized[visitKey] = '[MaxProperties ~]';\n break;\n }\n\n // Recursively visit all the child nodes\n const visitValue = visitable[visitKey];\n normalized[visitKey] = visit(visitKey, visitValue, remainingDepth - 1, maxProperties, memo);\n\n numAdded++;\n }\n\n // Once we've visited all the branches, remove the parent from memo storage\n unmemoize(value);\n\n // Return accumulated values\n return normalized;\n}\n\n/**\n * @deprecated This export will be removed in v8.\n */\nexport { visit as walk };\n\n/* eslint-disable complexity */\n/**\n * Stringify the given value. Handles various known special values and types.\n *\n * Not meant to be used on simple primitives which already have a string representation, as it will, for example, turn\n * the number 1231 into \"[Object Number]\", nor on `null`, as it will throw.\n *\n * @param value The value to stringify\n * @returns A stringified representation of the given value\n */\nfunction stringifyValue(\n key: unknown,\n // this type is a tiny bit of a cheat, since this function does handle NaN (which is technically a number), but for\n // our internal use, it'll do\n value: Exclude<unknown, string | number | boolean | null>,\n): string {\n try {\n if (key === 'domain' && value && typeof value === 'object' && (value as { _events: unknown })._events) {\n return '[Domain]';\n }\n\n if (key === 'domainEmitter') {\n return '[DomainEmitter]';\n }\n\n // It's safe to use `global`, `window`, and `document` here in this manner, as we are asserting using `typeof` first\n // which won't throw if they are not present.\n\n if (typeof global !== 'undefined' && value === global) {\n return '[Global]';\n }\n\n // eslint-disable-next-line no-restricted-globals\n if (typeof window !== 'undefined' && value === window) {\n return '[Window]';\n }\n\n // eslint-disable-next-line no-restricted-globals\n if (typeof document !== 'undefined' && value === document) {\n return '[Document]';\n }\n\n if (isVueViewModel(value)) {\n return '[VueViewModel]';\n }\n\n // React's SyntheticEvent thingy\n if (isSyntheticEvent(value)) {\n return '[SyntheticEvent]';\n }\n\n if (typeof value === 'number' && value !== value) {\n return '[NaN]';\n }\n\n if (typeof value === 'function') {\n return `[Function: ${getFunctionName(value)}]`;\n }\n\n if (typeof value === 'symbol') {\n return `[${String(value)}]`;\n }\n\n // stringified BigInts are indistinguishable from regular numbers, so we need to label them to avoid confusion\n if (typeof value === 'bigint') {\n return `[BigInt: ${String(value)}]`;\n }\n\n // Now that we've knocked out all the special cases and the primitives, all we have left are objects. Simply casting\n // them to strings means that instances of classes which haven't defined their `toStringTag` will just come out as\n // `\"[object Object]\"`. If we instead look at the constructor's name (which is the same as the name of the class),\n // we can make sure that only plain objects come out that way.\n const objName = getConstructorName(value);\n\n // Handle HTML Elements\n if (/^HTML(\\w*)Element$/.test(objName)) {\n return `[HTMLElement: ${objName}]`;\n }\n\n return `[object ${objName}]`;\n } catch (err) {\n return `**non-serializable** (${err})`;\n }\n}\n/* eslint-enable complexity */\n\nfunction getConstructorName(value: unknown): string {\n const prototype: Prototype | null = Object.getPrototypeOf(value);\n\n return prototype ? prototype.constructor.name : 'null prototype';\n}\n\n/** Calculates bytes size of input string */\nfunction utf8Length(value: string): number {\n // eslint-disable-next-line no-bitwise\n return ~-encodeURI(value).split(/%..|./).length;\n}\n\n/** Calculates bytes size of input object */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction jsonSize(value: any): number {\n return utf8Length(JSON.stringify(value));\n}\n\n/**\n * Normalizes URLs in exceptions and stacktraces to a base path so Sentry can fingerprint\n * across platforms and working directory.\n *\n * @param url The URL to be normalized.\n * @param basePath The application base path.\n * @returns The normalized URL.\n */\nexport function normalizeUrlToBase(url: string, basePath: string): string {\n const escapedBase = basePath\n // Backslash to forward\n .replace(/\\\\/g, '/')\n // Escape RegExp special characters\n .replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&');\n\n let newUrl = url;\n try {\n newUrl = decodeURI(url);\n } catch (_Oo) {\n // Sometime this breaks\n }\n return (\n newUrl\n .replace(/\\\\/g, '/')\n .replace(/webpack:\\/?/g, '') // Remove intermediate base path\n // eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor\n .replace(new RegExp(`(file://)?/*${escapedBase}/*`, 'ig'), 'app:///')\n );\n}\n", "/* eslint-disable @typescript-eslint/explicit-function-return-type */\n/* eslint-disable @typescript-eslint/typedef */\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { isThenable } from './is';\n\n/** SyncPromise internal states */\nconst enum States {\n /** Pending */\n PENDING = 0,\n /** Resolved / OK */\n RESOLVED = 1,\n /** Rejected / Error */\n REJECTED = 2,\n}\n\n// Overloads so we can call resolvedSyncPromise without arguments and generic argument\nexport function resolvedSyncPromise(): PromiseLike<void>;\nexport function resolvedSyncPromise<T>(value: T | PromiseLike<T>): PromiseLike<T>;\n\n/**\n * Creates a resolved sync promise.\n *\n * @param value the value to resolve the promise with\n * @returns the resolved sync promise\n */\nexport function resolvedSyncPromise<T>(value?: T | PromiseLike<T>): PromiseLike<T> {\n return new SyncPromise(resolve => {\n resolve(value);\n });\n}\n\n/**\n * Creates a rejected sync promise.\n *\n * @param value the value to reject the promise with\n * @returns the rejected sync promise\n */\nexport function rejectedSyncPromise<T = never>(reason?: any): PromiseLike<T> {\n return new SyncPromise((_, reject) => {\n reject(reason);\n });\n}\n\n/**\n * Thenable class that behaves like a Promise and follows it's interface\n * but is not async internally\n */\nclass SyncPromise<T> implements PromiseLike<T> {\n private _state: States;\n private _handlers: Array<[boolean, (value: T) => void, (reason: any) => any]>;\n private _value: any;\n\n public constructor(\n executor: (resolve: (value?: T | PromiseLike<T> | null) => void, reject: (reason?: any) => void) => void,\n ) {\n this._state = States.PENDING;\n this._handlers = [];\n\n try {\n executor(this._resolve, this._reject);\n } catch (e) {\n this._reject(e);\n }\n }\n\n /** JSDoc */\n public then<TResult1 = T, TResult2 = never>(\n onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null,\n onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null,\n ): PromiseLike<TResult1 | TResult2> {\n return new SyncPromise((resolve, reject) => {\n this._handlers.push([\n false,\n result => {\n if (!onfulfilled) {\n // TODO: ¯\\_(ツ)_/¯\n // TODO: FIXME\n resolve(result as any);\n } else {\n try {\n resolve(onfulfilled(result));\n } catch (e) {\n reject(e);\n }\n }\n },\n reason => {\n if (!onrejected) {\n reject(reason);\n } else {\n try {\n resolve(onrejected(reason));\n } catch (e) {\n reject(e);\n }\n }\n },\n ]);\n this._executeHandlers();\n });\n }\n\n /** JSDoc */\n public catch<TResult = never>(\n onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null,\n ): PromiseLike<T | TResult> {\n return this.then(val => val, onrejected);\n }\n\n /** JSDoc */\n public finally<TResult>(onfinally?: (() => void) | null): PromiseLike<TResult> {\n return new SyncPromise<TResult>((resolve, reject) => {\n let val: TResult | any;\n let isRejected: boolean;\n\n return this.then(\n value => {\n isRejected = false;\n val = value;\n if (onfinally) {\n onfinally();\n }\n },\n reason => {\n isRejected = true;\n val = reason;\n if (onfinally) {\n onfinally();\n }\n },\n ).then(() => {\n if (isRejected) {\n reject(val);\n return;\n }\n\n resolve(val as unknown as any);\n });\n });\n }\n\n /** JSDoc */\n private readonly _resolve = (value?: T | PromiseLike<T> | null) => {\n this._setResult(States.RESOLVED, value);\n };\n\n /** JSDoc */\n private readonly _reject = (reason?: any) => {\n this._setResult(States.REJECTED, reason);\n };\n\n /** JSDoc */\n private readonly _setResult = (state: States, value?: T | PromiseLike<T> | any) => {\n if (this._state !== States.PENDING) {\n return;\n }\n\n if (isThenable(value)) {\n void (value as PromiseLike<T>).then(this._resolve, this._reject);\n return;\n }\n\n this._state = state;\n this._value = value;\n\n this._executeHandlers();\n };\n\n /** JSDoc */\n private readonly _executeHandlers = () => {\n if (this._state === States.PENDING) {\n return;\n }\n\n const cachedHandlers = this._handlers.slice();\n this._handlers = [];\n\n cachedHandlers.forEach(handler => {\n if (handler[0]) {\n return;\n }\n\n if (this._state === States.RESOLVED) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n handler[1](this._value as unknown as any);\n }\n\n if (this._state === States.REJECTED) {\n handler[2](this._value);\n }\n\n handler[0] = true;\n });\n };\n}\n\nexport { SyncPromise };\n", "import { SentryError } from './error';\nimport { SyncPromise, rejectedSyncPromise, resolvedSyncPromise } from './syncpromise';\n\nexport interface PromiseBuffer<T> {\n // exposes the internal array so tests can assert on the state of it.\n // XXX: this really should not be public api.\n $: Array<PromiseLike<T>>;\n add(taskProducer: () => PromiseLike<T>): PromiseLike<T>;\n drain(timeout?: number): PromiseLike<boolean>;\n}\n\n/**\n * Creates an new PromiseBuffer object with the specified limit\n * @param limit max number of promises that can be stored in the buffer\n */\nexport function makePromiseBuffer<T>(limit?: number): PromiseBuffer<T> {\n const buffer: Array<PromiseLike<T>> = [];\n\n function isReady(): boolean {\n return limit === undefined || buffer.length < limit;\n }\n\n /**\n * Remove a promise from the queue.\n *\n * @param task Can be any PromiseLike<T>\n * @returns Removed promise.\n */\n function remove(task: PromiseLike<T>): PromiseLike<T> {\n return buffer.splice(buffer.indexOf(task), 1)[0];\n }\n\n /**\n * Add a promise (representing an in-flight action) to the queue, and set it to remove itself on fulfillment.\n *\n * @param taskProducer A function producing any PromiseLike<T>; In previous versions this used to be `task:\n * PromiseLike<T>`, but under that model, Promises were instantly created on the call-site and their executor\n * functions therefore ran immediately. Thus, even if the buffer was full, the action still happened. By\n * requiring the promise to be wrapped in a function, we can defer promise creation until after the buffer\n * limit check.\n * @returns The original promise.\n */\n function add(taskProducer: () => PromiseLike<T>): PromiseLike<T> {\n if (!isReady()) {\n return rejectedSyncPromise(new SentryError('Not adding Promise because buffer limit was reached.'));\n }\n\n // start the task and add its promise to the queue\n const task = taskProducer();\n if (buffer.indexOf(task) === -1) {\n buffer.push(task);\n }\n void task\n .then(() => remove(task))\n // Use `then(null, rejectionHandler)` rather than `catch(rejectionHandler)` so that we can use `PromiseLike`\n // rather than `Promise`. `PromiseLike` doesn't have a `.catch` method, making its polyfill smaller. (ES5 didn't\n // have promises, so TS has to polyfill when down-compiling.)\n .then(null, () =>\n remove(task).then(null, () => {\n // We have to add another catch here because `remove()` starts a new promise chain.\n }),\n );\n return task;\n }\n\n /**\n * Wait for all promises in the queue to resolve or for timeout to expire, whichever comes first.\n *\n * @param timeout The time, in ms, after which to resolve to `false` if the queue is still non-empty. Passing `0` (or\n * not passing anything) will make the promise wait as long as it takes for the queue to drain before resolving to\n * `true`.\n * @returns A promise which will resolve to `true` if the queue is already empty or drains before the timeout, and\n * `false` otherwise\n */\n function drain(timeout?: number): PromiseLike<boolean> {\n return new SyncPromise<boolean>((resolve, reject) => {\n let counter = buffer.length;\n\n if (!counter) {\n return resolve(true);\n }\n\n // wait for `timeout` ms and then resolve to `false` (if not cancelled first)\n const capturedSetTimeout = setTimeout(() => {\n if (timeout && timeout > 0) {\n resolve(false);\n }\n }, timeout);\n\n // if all promises resolve in time, cancel the timer and resolve to `true`\n buffer.forEach(item => {\n void resolvedSyncPromise(item).then(() => {\n if (!--counter) {\n clearTimeout(capturedSetTimeout);\n resolve(true);\n }\n }, reject);\n });\n });\n }\n\n return {\n $: buffer,\n add,\n drain,\n };\n}\n", "type PartialURL = {\n host?: string;\n path?: string;\n protocol?: string;\n relative?: string;\n search?: string;\n hash?: string;\n};\n\n/**\n * Parses string form of URL into an object\n * // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B\n * // intentionally using regex and not <a/> href parsing trick because React Native and other\n * // environments where DOM might not be available\n * @returns parsed URL object\n */\nexport function parseUrl(url: string): PartialURL {\n if (!url) {\n return {};\n }\n\n const match = url.match(/^(([^:/?#]+):)?(\\/\\/([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$/);\n\n if (!match) {\n return {};\n }\n\n // coerce to undefined values to empty string so we don't get 'undefined'\n const query = match[6] || '';\n const fragment = match[8] || '';\n return {\n host: match[4],\n path: match[5],\n protocol: match[2],\n search: query,\n hash: fragment,\n relative: match[5] + query + fragment, // everything minus origin\n };\n}\n\n/**\n * Strip the query string and fragment off of a given URL or path (if present)\n *\n * @param urlPath Full URL or path, including possible query string and/or fragment\n * @returns URL or path without query string or fragment\n */\nexport function stripUrlQueryAndFragment(urlPath: string): string {\n // eslint-disable-next-line no-useless-escape\n return urlPath.split(/[\\?#]/, 1)[0];\n}\n\n/**\n * Returns number of URL segments of a passed string URL.\n */\nexport function getNumberOfUrlSegments(url: string): number {\n // split at '/' or at '\\/' to split regex urls correctly\n return url.split(/\\\\?\\//).filter(s => s.length > 0 && s !== ',').length;\n}\n\n/**\n * Takes a URL object and returns a sanitized string which is safe to use as span description\n * see: https://develop.sentry.dev/sdk/data-handling/#structuring-data\n */\nexport function getSanitizedUrlString(url: PartialURL): string {\n const { protocol, host, path } = url;\n\n const filteredHost =\n (host &&\n host\n // Always filter out authority\n .replace(/^.*@/, '[filtered]:[filtered]@')\n // Don't show standard :80 (http) and :443 (https) ports to reduce the noise\n // TODO: Use new URL global if it exists\n .replace(/(:80)$/, '')\n .replace(/(:443)$/, '')) ||\n '';\n\n return `${protocol ? `${protocol}://` : ''}${filteredHost}${path}`;\n}\n", "/* eslint-disable deprecation/deprecation */\nimport type { Severity, SeverityLevel } from '@sentry/types';\n\n// Note: Ideally the `SeverityLevel` type would be derived from `validSeverityLevels`, but that would mean either\n//\n// a) moving `validSeverityLevels` to `@sentry/types`,\n// b) moving the`SeverityLevel` type here, or\n// c) importing `validSeverityLevels` from here into `@sentry/types`.\n//\n// Option A would make `@sentry/types` a runtime dependency of `@sentry/utils` (not good), and options B and C would\n// create a circular dependency between `@sentry/types` and `@sentry/utils` (also not good). So a TODO accompanying the\n// type, reminding anyone who changes it to change this list also, will have to do.\n\nexport const validSeverityLevels = ['fatal', 'error', 'warning', 'log', 'info', 'debug'];\n\n/**\n * Converts a string-based level into a member of the deprecated {@link Severity} enum.\n *\n * @deprecated `severityFromString` is deprecated. Please use `severityLevelFromString` instead.\n *\n * @param level String representation of Severity\n * @returns Severity\n */\nexport function severityFromString(level: Severity | SeverityLevel | string): Severity {\n return severityLevelFromString(level) as Severity;\n}\n\n/**\n * Converts a string-based level into a `SeverityLevel`, normalizing it along the way.\n *\n * @param level String representation of desired `SeverityLevel`.\n * @returns The `SeverityLevel` corresponding to the given string, or 'log' if the string isn't a valid level.\n */\nexport function severityLevelFromString(level: SeverityLevel | string): SeverityLevel {\n return (level === 'warn' ? 'warning' : validSeverityLevels.includes(level) ? level : 'log') as SeverityLevel;\n}\n", "import { GLOBAL_OBJ } from './worldwide';\n\nconst ONE_SECOND_IN_MS = 1000;\n\n/**\n * A partial definition of the [Performance Web API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Performance}\n * for accessing a high-resolution monotonic clock.\n */\ninterface Performance {\n /**\n * The millisecond timestamp at which measurement began, measured in Unix time.\n */\n timeOrigin: number;\n /**\n * Returns the current millisecond timestamp, where 0 represents the start of measurement.\n */\n now(): number;\n}\n\n/**\n * Returns a timestamp in seconds since the UNIX epoch using the Date API.\n *\n * TODO(v8): Return type should be rounded.\n */\nexport function dateTimestampInSeconds(): number {\n return Date.now() / ONE_SECOND_IN_MS;\n}\n\n/**\n * Returns a wrapper around the native Performance API browser implementation, or undefined for browsers that do not\n * support the API.\n *\n * Wrapping the native API works around differences in behavior from different browsers.\n */\nfunction createUnixTimestampInSecondsFunc(): () => number {\n const { performance } = GLOBAL_OBJ as typeof GLOBAL_OBJ & { performance?: Performance };\n if (!performance || !performance.now) {\n return dateTimestampInSeconds;\n }\n\n // Some browser and environments don't have a timeOrigin, so we fallback to\n // using Date.now() to compute the starting time.\n const approxStartingTimeOrigin = Date.now() - performance.now();\n const timeOrigin = performance.timeOrigin == undefined ? approxStartingTimeOrigin : performance.timeOrigin;\n\n // performance.now() is a monotonic clock, which means it starts at 0 when the process begins. To get the current\n // wall clock time (actual UNIX timestamp), we need to add the starting time origin and the current time elapsed.\n //\n // TODO: This does not account for the case where the monotonic clock that powers performance.now() drifts from the\n // wall clock time, which causes the returned timestamp to be inaccurate. We should investigate how to detect and\n // correct for this.\n // See: https://github.com/getsentry/sentry-javascript/issues/2590\n // See: https://github.com/mdn/content/issues/4713\n // See: https://dev.to/noamr/when-a-millisecond-is-not-a-millisecond-3h6\n return () => {\n return (timeOrigin + performance.now()) / ONE_SECOND_IN_MS;\n };\n}\n\n/**\n * Returns a timestamp in seconds since the UNIX epoch using either the Performance or Date APIs, depending on the\n * availability of the Performance API.\n *\n * BUG: Note that because of how browsers implement the Performance API, the clock might stop when the computer is\n * asleep. This creates a skew between `dateTimestampInSeconds` and `timestampInSeconds`. The\n * skew can grow to arbitrary amounts like days, weeks or months.\n * See https://github.com/getsentry/sentry-javascript/issues/2590.\n */\nexport const timestampInSeconds = createUnixTimestampInSecondsFunc();\n\n/**\n * Re-exported with an old name for backwards-compatibility.\n * TODO (v8): Remove this\n *\n * @deprecated Use `timestampInSeconds` instead.\n */\nexport const timestampWithMs = timestampInSeconds;\n\n/**\n * Internal helper to store what is the source of browserPerformanceTimeOrigin below. For debugging only.\n */\nexport let _browserPerformanceTimeOriginMode: string;\n\n/**\n * The number of milliseconds since the UNIX epoch. This value is only usable in a browser, and only when the\n * performance API is available.\n */\nexport const browserPerformanceTimeOrigin = ((): number | undefined => {\n // Unfortunately browsers may report an inaccurate time origin data, through either performance.timeOrigin or\n // performance.timing.navigationStart, which results in poor results in performance data. We only treat time origin\n // data as reliable if they are within a reasonable threshold of the current time.\n\n const { performance } = GLOBAL_OBJ as typeof GLOBAL_OBJ & Window;\n if (!performance || !performance.now) {\n _browserPerformanceTimeOriginMode = 'none';\n return undefined;\n }\n\n const threshold = 3600 * 1000;\n const performanceNow = performance.now();\n const dateNow = Date.now();\n\n // if timeOrigin isn't available set delta to threshold so it isn't used\n const timeOriginDelta = performance.timeOrigin\n ? Math.abs(performance.timeOrigin + performanceNow - dateNow)\n : threshold;\n const timeOriginIsReliable = timeOriginDelta < threshold;\n\n // While performance.timing.navigationStart is deprecated in favor of performance.timeOrigin, performance.timeOrigin\n // is not as widely supported. Namely, performance.timeOrigin is undefined in Safari as of writing.\n // Also as of writing, performance.timing is not available in Web Workers in mainstream browsers, so it is not always\n // a valid fallback. In the absence of an initial time provided by the browser, fallback to the current time from the\n // Date API.\n // eslint-disable-next-line deprecation/deprecation\n const navigationStart = performance.timing && performance.timing.navigationStart;\n const hasNavigationStart = typeof navigationStart === 'number';\n // if navigationStart isn't available set delta to threshold so it isn't used\n const navigationStartDelta = hasNavigationStart ? Math.abs(navigationStart + performanceNow - dateNow) : threshold;\n const navigationStartIsReliable = navigationStartDelta < threshold;\n\n if (timeOriginIsReliable || navigationStartIsReliable) {\n // Use the more reliable time origin\n if (timeOriginDelta <= navigationStartDelta) {\n _browserPerformanceTimeOriginMode = 'timeOrigin';\n return performance.timeOrigin;\n } else {\n _browserPerformanceTimeOriginMode = 'navigationStart';\n return navigationStart;\n }\n }\n\n // Either both timeOrigin and navigationStart are skewed or neither is available, fallback to Date.\n _browserPerformanceTimeOriginMode = 'dateNow';\n return dateNow;\n})();\n", "import type { DynamicSamplingContext } from '@sentry/types';\n\nimport { DEBUG_BUILD } from './debug-build';\nimport { isString } from './is';\nimport { logger } from './logger';\n\nexport const BAGGAGE_HEADER_NAME = 'baggage';\n\nexport const SENTRY_BAGGAGE_KEY_PREFIX = 'sentry-';\n\nexport const SENTRY_BAGGAGE_KEY_PREFIX_REGEX = /^sentry-/;\n\n/**\n * Max length of a serialized baggage string\n *\n * https://www.w3.org/TR/baggage/#limits\n */\nexport const MAX_BAGGAGE_STRING_LENGTH = 8192;\n\n/**\n * Takes a baggage header and turns it into Dynamic Sampling Context, by extracting all the \"sentry-\" prefixed values\n * from it.\n *\n * @param baggageHeader A very bread definition of a baggage header as it might appear in various frameworks.\n * @returns The Dynamic Sampling Context that was found on `baggageHeader`, if there was any, `undefined` otherwise.\n */\nexport function baggageHeaderToDynamicSamplingContext(\n // Very liberal definition of what any incoming header might look like\n baggageHeader: string | string[] | number | null | undefined | boolean,\n): Partial<DynamicSamplingContext> | undefined {\n if (!isString(baggageHeader) && !Array.isArray(baggageHeader)) {\n return undefined;\n }\n\n // Intermediary object to store baggage key value pairs of incoming baggage headers on.\n // It is later used to read Sentry-DSC-values from.\n let baggageObject: Readonly<Record<string, string>> = {};\n\n if (Array.isArray(baggageHeader)) {\n // Combine all baggage headers into one object containing the baggage values so we can later read the Sentry-DSC-values from it\n baggageObject = baggageHeader.reduce<Record<string, string>>((acc, curr) => {\n const currBaggageObject = baggageHeaderToObject(curr);\n for (const key of Object.keys(currBaggageObject)) {\n acc[key] = currBaggageObject[key];\n }\n return acc;\n }, {});\n } else {\n // Return undefined if baggage header is an empty string (technically an empty baggage header is not spec conform but\n // this is how we choose to handle it)\n if (!baggageHeader) {\n return undefined;\n }\n\n baggageObject = baggageHeaderToObject(baggageHeader);\n }\n\n // Read all \"sentry-\" prefixed values out of the baggage object and put it onto a dynamic sampling context object.\n const dynamicSamplingContext = Object.entries(baggageObject).reduce<Record<string, string>>((acc, [key, value]) => {\n if (key.match(SENTRY_BAGGAGE_KEY_PREFIX_REGEX)) {\n const nonPrefixedKey = key.slice(SENTRY_BAGGAGE_KEY_PREFIX.length);\n acc[nonPrefixedKey] = value;\n }\n return acc;\n }, {});\n\n // Only return a dynamic sampling context object if there are keys in it.\n // A keyless object means there were no sentry values on the header, which means that there is no DSC.\n if (Object.keys(dynamicSamplingContext).length > 0) {\n return dynamicSamplingContext as Partial<DynamicSamplingContext>;\n } else {\n return undefined;\n }\n}\n\n/**\n * Turns a Dynamic Sampling Object into a baggage header by prefixing all the keys on the object with \"sentry-\".\n *\n * @param dynamicSamplingContext The Dynamic Sampling Context to turn into a header. For convenience and compatibility\n * with the `getDynamicSamplingContext` method on the Transaction class ,this argument can also be `undefined`. If it is\n * `undefined` the function will return `undefined`.\n * @returns a baggage header, created from `dynamicSamplingContext`, or `undefined` either if `dynamicSamplingContext`\n * was `undefined`, or if `dynamicSamplingContext` didn't contain any values.\n */\nexport function dynamicSamplingContextToSentryBaggageHeader(\n // this also takes undefined for convenience and bundle size in other places\n dynamicSamplingContext?: Partial<DynamicSamplingContext>,\n): string | undefined {\n if (!dynamicSamplingContext) {\n return undefined;\n }\n\n // Prefix all DSC keys with \"sentry-\" and put them into a new object\n const sentryPrefixedDSC = Object.entries(dynamicSamplingContext).reduce<Record<string, string>>(\n (acc, [dscKey, dscValue]) => {\n if (dscValue) {\n acc[`${SENTRY_BAGGAGE_KEY_PREFIX}${dscKey}`] = dscValue;\n }\n return acc;\n },\n {},\n );\n\n return objectToBaggageHeader(sentryPrefixedDSC);\n}\n\n/**\n * Will parse a baggage header, which is a simple key-value map, into a flat object.\n *\n * @param baggageHeader The baggage header to parse.\n * @returns a flat object containing all the key-value pairs from `baggageHeader`.\n */\nfunction baggageHeaderToObject(baggageHeader: string): Record<string, string> {\n return baggageHeader\n .split(',')\n .map(baggageEntry => baggageEntry.split('=').map(keyOrValue => decodeURIComponent(keyOrValue.trim())))\n .reduce<Record<string, string>>((acc, [key, value]) => {\n acc[key] = value;\n return acc;\n }, {});\n}\n\n/**\n * Turns a flat object (key-value pairs) into a baggage header, which is also just key-value pairs.\n *\n * @param object The object to turn into a baggage header.\n * @returns a baggage header string, or `undefined` if the object didn't have any values, since an empty baggage header\n * is not spec compliant.\n */\nfunction objectToBaggageHeader(object: Record<string, string>): string | undefined {\n if (Object.keys(object).length === 0) {\n // An empty baggage header is not spec compliant: We return undefined.\n return undefined;\n }\n\n return Object.entries(object).reduce((baggageHeader, [objectKey, objectValue], currentIndex) => {\n const baggageEntry = `${encodeURIComponent(objectKey)}=${encodeURIComponent(objectValue)}`;\n const newBaggageHeader = currentIndex === 0 ? baggageEntry : `${baggageHeader},${baggageEntry}`;\n if (newBaggageHeader.length > MAX_BAGGAGE_STRING_LENGTH) {\n DEBUG_BUILD &&\n logger.warn(\n `Not adding key: ${objectKey} with val: ${objectValue} to baggage header due to exceeding baggage size limits.`,\n );\n return baggageHeader;\n } else {\n return newBaggageHeader;\n }\n }, '');\n}\n", "import type { PropagationContext, TraceparentData } from '@sentry/types';\n\nimport { baggageHeaderToDynamicSamplingContext } from './baggage';\nimport { uuid4 } from './misc';\n\n// eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor -- RegExp is used for readability here\nexport const TRACEPARENT_REGEXP = new RegExp(\n '^[ \\\\t]*' + // whitespace\n '([0-9a-f]{32})?' + // trace_id\n '-?([0-9a-f]{16})?' + // span_id\n '-?([01])?' + // sampled\n '[ \\\\t]*$', // whitespace\n);\n\n/**\n * Extract transaction context data from a `sentry-trace` header.\n *\n * @param traceparent Traceparent string\n *\n * @returns Object containing data from the header, or undefined if traceparent string is malformed\n */\nexport function extractTraceparentData(traceparent?: string): TraceparentData | undefined {\n if (!traceparent) {\n return undefined;\n }\n\n const matches = traceparent.match(TRACEPARENT_REGEXP);\n if (!matches) {\n return undefined;\n }\n\n let parentSampled: boolean | undefined;\n if (matches[3] === '1') {\n parentSampled = true;\n } else if (matches[3] === '0') {\n parentSampled = false;\n }\n\n return {\n traceId: matches[1],\n parentSampled,\n parentSpanId: matches[2],\n };\n}\n\n/**\n * Create tracing context from incoming headers.\n *\n * @deprecated Use `propagationContextFromHeaders` instead.\n */\n// TODO(v8): Remove this function\nexport function tracingContextFromHeaders(\n sentryTrace: Parameters<typeof extractTraceparentData>[0],\n baggage: Parameters<typeof baggageHeaderToDynamicSamplingContext>[0],\n): {\n traceparentData: ReturnType<typeof extractTraceparentData>;\n dynamicSamplingContext: ReturnType<typeof baggageHeaderToDynamicSamplingContext>;\n propagationContext: PropagationContext;\n} {\n const traceparentData = extractTraceparentData(sentryTrace);\n const dynamicSamplingContext = baggageHeaderToDynamicSamplingContext(baggage);\n\n const { traceId, parentSpanId, parentSampled } = traceparentData || {};\n\n if (!traceparentData) {\n return {\n traceparentData,\n dynamicSamplingContext: undefined,\n propagationContext: {\n traceId: traceId || uuid4(),\n spanId: uuid4().substring(16),\n },\n };\n } else {\n return {\n traceparentData,\n dynamicSamplingContext: dynamicSamplingContext || {}, // If we have traceparent data but no DSC it means we are not head of trace and we must freeze it\n propagationContext: {\n traceId: traceId || uuid4(),\n parentSpanId: parentSpanId || uuid4().substring(16),\n spanId: uuid4().substring(16),\n sampled: parentSampled,\n dsc: dynamicSamplingContext || {}, // If we have traceparent data but no DSC it means we are not head of trace and we must freeze it\n },\n };\n }\n}\n\n/**\n * Create a propagation context from incoming headers.\n */\nexport function propagationContextFromHeaders(\n sentryTrace: string | undefined,\n baggage: string | number | boolean | string[] | null | undefined,\n): PropagationContext {\n const traceparentData = extractTraceparentData(sentryTrace);\n const dynamicSamplingContext = baggageHeaderToDynamicSamplingContext(baggage);\n\n const { traceId, parentSpanId, parentSampled } = traceparentData || {};\n\n if (!traceparentData) {\n return {\n traceId: traceId || uuid4(),\n spanId: uuid4().substring(16),\n };\n } else {\n return {\n traceId: traceId || uuid4(),\n parentSpanId: parentSpanId || uuid4().substring(16),\n spanId: uuid4().substring(16),\n sampled: parentSampled,\n dsc: dynamicSamplingContext || {}, // If we have traceparent data but no DSC it means we are not head of trace and we must freeze it\n };\n }\n}\n\n/**\n * Create sentry-trace header from span context values.\n */\nexport function generateSentryTraceHeader(\n traceId: string = uuid4(),\n spanId: string = uuid4().substring(16),\n sampled?: boolean,\n): string {\n let sampledString = '';\n if (sampled !== undefined) {\n sampledString = sampled ? '-1' : '-0';\n }\n return `${traceId}-${spanId}${sampledString}`;\n}\n", "import type {\n Attachment,\n AttachmentItem,\n BaseEnvelopeHeaders,\n BaseEnvelopeItemHeaders,\n DataCategory,\n DsnComponents,\n Envelope,\n EnvelopeItemType,\n Event,\n EventEnvelopeHeaders,\n SdkInfo,\n SdkMetadata,\n TextEncoderInternal,\n} from '@sentry/types';\n\nimport { dsnToString } from './dsn';\nimport { normalize } from './normalize';\nimport { dropUndefinedKeys } from './object';\n\n/**\n * Creates an envelope.\n * Make sure to always explicitly provide the generic to this function\n * so that the envelope types resolve correctly.\n */\nexport function createEnvelope<E extends Envelope>(headers: E[0], items: E[1] = []): E {\n return [headers, items] as E;\n}\n\n/**\n * Add an item to an envelope.\n * Make sure to always explicitly provide the generic to this function\n * so that the envelope types resolve correctly.\n */\nexport function addItemToEnvelope<E extends Envelope>(envelope: E, newItem: E[1][number]): E {\n const [headers, items] = envelope;\n return [headers, [...items, newItem]] as unknown as E;\n}\n\n/**\n * Convenience function to loop through the items and item types of an envelope.\n * (This function was mostly created because working with envelope types is painful at the moment)\n *\n * If the callback returns true, the rest of the items will be skipped.\n */\nexport function forEachEnvelopeItem<E extends Envelope>(\n envelope: Envelope,\n callback: (envelopeItem: E[1][number], envelopeItemType: E[1][number][0]['type']) => boolean | void,\n): boolean {\n const envelopeItems = envelope[1];\n\n for (const envelopeItem of envelopeItems) {\n const envelopeItemType = envelopeItem[0].type;\n const result = callback(envelopeItem, envelopeItemType);\n\n if (result) {\n return true;\n }\n }\n\n return false;\n}\n\n/**\n * Returns true if the envelope contains any of the given envelope item types\n */\nexport function envelopeContainsItemType(envelope: Envelope, types: EnvelopeItemType[]): boolean {\n return forEachEnvelopeItem(envelope, (_, type) => types.includes(type));\n}\n\n/**\n * Encode a string to UTF8.\n */\nfunction encodeUTF8(input: string, textEncoder?: TextEncoderInternal): Uint8Array {\n const utf8 = textEncoder || new TextEncoder();\n return utf8.encode(input);\n}\n\n/**\n * Serializes an envelope.\n */\nexport function serializeEnvelope(envelope: Envelope, textEncoder?: TextEncoderInternal): string | Uint8Array {\n const [envHeaders, items] = envelope;\n\n // Initially we construct our envelope as a string and only convert to binary chunks if we encounter binary data\n let parts: string | Uint8Array[] = JSON.stringify(envHeaders);\n\n function append(next: string | Uint8Array): void {\n if (typeof parts === 'string') {\n parts = typeof next === 'string' ? parts + next : [encodeUTF8(parts, textEncoder), next];\n } else {\n parts.push(typeof next === 'string' ? encodeUTF8(next, textEncoder) : next);\n }\n }\n\n for (const item of items) {\n const [itemHeaders, payload] = item;\n\n append(`\\n${JSON.stringify(itemHeaders)}\\n`);\n\n if (typeof payload === 'string' || payload instanceof Uint8Array) {\n append(payload);\n } else {\n let stringifiedPayload: string;\n try {\n stringifiedPayload = JSON.stringify(payload);\n } catch (e) {\n // In case, despite all our efforts to keep `payload` circular-dependency-free, `JSON.strinify()` still\n // fails, we try again after normalizing it again with infinite normalization depth. This of course has a\n // performance impact but in this case a performance hit is better than throwing.\n stringifiedPayload = JSON.stringify(normalize(payload));\n }\n append(stringifiedPayload);\n }\n }\n\n return typeof parts === 'string' ? parts : concatBuffers(parts);\n}\n\nfunction concatBuffers(buffers: Uint8Array[]): Uint8Array {\n const totalLength = buffers.reduce((acc, buf) => acc + buf.length, 0);\n\n const merged = new Uint8Array(totalLength);\n let offset = 0;\n for (const buffer of buffers) {\n merged.set(buffer, offset);\n offset += buffer.length;\n }\n\n return merged;\n}\n\nexport interface TextDecoderInternal {\n decode(input?: Uint8Array): string;\n}\n\n/**\n * Parses an envelope\n */\nexport function parseEnvelope(\n env: string | Uint8Array,\n textEncoder: TextEncoderInternal,\n textDecoder: TextDecoderInternal,\n): Envelope {\n let buffer = typeof env === 'string' ? textEncoder.encode(env) : env;\n\n function readBinary(length: number): Uint8Array {\n const bin = buffer.subarray(0, length);\n // Replace the buffer with the remaining data excluding trailing newline\n buffer = buffer.subarray(length + 1);\n return bin;\n }\n\n function readJson<T>(): T {\n let i = buffer.indexOf(0xa);\n // If we couldn't find a newline, we must have found the end of the buffer\n if (i < 0) {\n i = buffer.length;\n }\n\n return JSON.parse(textDecoder.decode(readBinary(i))) as T;\n }\n\n const envelopeHeader = readJson<BaseEnvelopeHeaders>();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const items: [any, any][] = [];\n\n while (buffer.length) {\n const itemHeader = readJson<BaseEnvelopeItemHeaders>();\n const binaryLength = typeof itemHeader.length === 'number' ? itemHeader.length : undefined;\n\n items.push([itemHeader, binaryLength ? readBinary(binaryLength) : readJson()]);\n }\n\n return [envelopeHeader, items];\n}\n\n/**\n * Creates attachment envelope items\n */\nexport function createAttachmentEnvelopeItem(\n attachment: Attachment,\n textEncoder?: TextEncoderInternal,\n): AttachmentItem {\n const buffer = typeof attachment.data === 'string' ? encodeUTF8(attachment.data, textEncoder) : attachment.data;\n\n return [\n dropUndefinedKeys({\n type: 'attachment',\n length: buffer.length,\n filename: attachment.filename,\n content_type: attachment.contentType,\n attachment_type: attachment.attachmentType,\n }),\n buffer,\n ];\n}\n\nconst ITEM_TYPE_TO_DATA_CATEGORY_MAP: Record<EnvelopeItemType, DataCategory> = {\n session: 'session',\n sessions: 'session',\n attachment: 'attachment',\n transaction: 'transaction',\n event: 'error',\n client_report: 'internal',\n user_report: 'default',\n profile: 'profile',\n replay_event: 'replay',\n replay_recording: 'replay',\n check_in: 'monitor',\n feedback: 'feedback',\n span: 'span',\n statsd: 'metric_bucket',\n};\n\n/**\n * Maps the type of an envelope item to a data category.\n */\nexport function envelopeItemTypeToDataCategory(type: EnvelopeItemType): DataCategory {\n return ITEM_TYPE_TO_DATA_CATEGORY_MAP[type];\n}\n\n/** Extracts the minimal SDK info from the metadata or an events */\nexport function getSdkMetadataForEnvelopeHeader(metadataOrEvent?: SdkMetadata | Event): SdkInfo | undefined {\n if (!metadataOrEvent || !metadataOrEvent.sdk) {\n return;\n }\n const { name, version } = metadataOrEvent.sdk;\n return { name, version };\n}\n\n/**\n * Creates event envelope headers, based on event, sdk info and tunnel\n * Note: This function was extracted from the core package to make it available in Replay\n */\nexport function createEventEnvelopeHeaders(\n event: Event,\n sdkInfo: SdkInfo | undefined,\n tunnel: string | undefined,\n dsn?: DsnComponents,\n): EventEnvelopeHeaders {\n const dynamicSamplingContext = event.sdkProcessingMetadata && event.sdkProcessingMetadata.dynamicSamplingContext;\n return {\n event_id: event.event_id as string,\n sent_at: new Date().toISOString(),\n ...(sdkInfo && { sdk: sdkInfo }),\n ...(!!tunnel && dsn && { dsn: dsnToString(dsn) }),\n ...(dynamicSamplingContext && {\n trace: dropUndefinedKeys({ ...dynamicSamplingContext }),\n }),\n };\n}\n", "import type { ClientReport, ClientReportEnvelope, ClientReportItem } from '@sentry/types';\n\nimport { createEnvelope } from './envelope';\nimport { dateTimestampInSeconds } from './time';\n\n/**\n * Creates client report envelope\n * @param discarded_events An array of discard events\n * @param dsn A DSN that can be set on the header. Optional.\n */\nexport function createClientReportEnvelope(\n discarded_events: ClientReport['discarded_events'],\n dsn?: string,\n timestamp?: number,\n): ClientReportEnvelope {\n const clientReportItem: ClientReportItem = [\n { type: 'client_report' },\n {\n timestamp: timestamp || dateTimestampInSeconds(),\n discarded_events,\n },\n ];\n return createEnvelope<ClientReportEnvelope>(dsn ? { dsn } : {}, [clientReportItem]);\n}\n", "import type { DataCategory, TransportMakeRequestResponse } from '@sentry/types';\n\n// Intentionally keeping the key broad, as we don't know for sure what rate limit headers get returned from backend\nexport type RateLimits = Record<string, number>;\n\nexport const DEFAULT_RETRY_AFTER = 60 * 1000; // 60 seconds\n\n/**\n * Extracts Retry-After value from the request header or returns default value\n * @param header string representation of 'Retry-After' header\n * @param now current unix timestamp\n *\n */\nexport function parseRetryAfterHeader(header: string, now: number = Date.now()): number {\n const headerDelay = parseInt(`${header}`, 10);\n if (!isNaN(headerDelay)) {\n return headerDelay * 1000;\n }\n\n const headerDate = Date.parse(`${header}`);\n if (!isNaN(headerDate)) {\n return headerDate - now;\n }\n\n return DEFAULT_RETRY_AFTER;\n}\n\n/**\n * Gets the time that the given category is disabled until for rate limiting.\n * In case no category-specific limit is set but a general rate limit across all categories is active,\n * that time is returned.\n *\n * @return the time in ms that the category is disabled until or 0 if there's no active rate limit.\n */\nexport function disabledUntil(limits: RateLimits, dataCategory: DataCategory): number {\n return limits[dataCategory] || limits.all || 0;\n}\n\n/**\n * Checks if a category is rate limited\n */\nexport function isRateLimited(limits: RateLimits, dataCategory: DataCategory, now: number = Date.now()): boolean {\n return disabledUntil(limits, dataCategory) > now;\n}\n\n/**\n * Update ratelimits from incoming headers.\n *\n * @return the updated RateLimits object.\n */\nexport function updateRateLimits(\n limits: RateLimits,\n { statusCode, headers }: TransportMakeRequestResponse,\n now: number = Date.now(),\n): RateLimits {\n const updatedRateLimits: RateLimits = {\n ...limits,\n };\n\n // \"The name is case-insensitive.\"\n // https://developer.mozilla.org/en-US/docs/Web/API/Headers/get\n const rateLimitHeader = headers && headers['x-sentry-rate-limits'];\n const retryAfterHeader = headers && headers['retry-after'];\n\n if (rateLimitHeader) {\n /**\n * rate limit headers are of the form\n * <header>,<header>,..\n * where each <header> is of the form\n * <retry_after>: <categories>: <scope>: <reason_code>: <namespaces>\n * where\n * <retry_after> is a delay in seconds\n * <categories> is the event type(s) (error, transaction, etc) being rate limited and is of the form\n * <category>;<category>;...\n * <scope> is what's being limited (org, project, or key) - ignored by SDK\n * <reason_code> is an arbitrary string like \"org_quota\" - ignored by SDK\n * <namespaces> Semicolon-separated list of metric namespace identifiers. Defines which namespace(s) will be affected.\n * Only present if rate limit applies to the metric_bucket data category.\n */\n for (const limit of rateLimitHeader.trim().split(',')) {\n const [retryAfter, categories, , , namespaces] = limit.split(':', 5);\n const headerDelay = parseInt(retryAfter, 10);\n const delay = (!isNaN(headerDelay) ? headerDelay : 60) * 1000; // 60sec default\n if (!categories) {\n updatedRateLimits.all = now + delay;\n } else {\n for (const category of categories.split(';')) {\n if (category === 'metric_bucket') {\n // namespaces will be present when category === 'metric_bucket'\n if (!namespaces || namespaces.split(';').includes('custom')) {\n updatedRateLimits[category] = now + delay;\n }\n } else {\n updatedRateLimits[category] = now + delay;\n }\n }\n }\n }\n } else if (retryAfterHeader) {\n updatedRateLimits.all = now + parseRetryAfterHeader(retryAfterHeader, now);\n } else if (statusCode === 429) {\n updatedRateLimits.all = now + 60 * 1000;\n }\n\n return updatedRateLimits;\n}\n", "import type {\n Client,\n Event,\n EventHint,\n Exception,\n Extras,\n Hub,\n Mechanism,\n ParameterizedString,\n Severity,\n SeverityLevel,\n StackFrame,\n StackParser,\n} from '@sentry/types';\n\nimport { isError, isParameterizedString, isPlainObject } from './is';\nimport { addExceptionMechanism, addExceptionTypeValue } from './misc';\nimport { normalizeToSize } from './normalize';\nimport { extractExceptionKeysForMessage } from './object';\n\n/**\n * Extracts stack frames from the error.stack string\n */\nexport function parseStackFrames(stackParser: StackParser, error: Error): StackFrame[] {\n return stackParser(error.stack || '', 1);\n}\n\n/**\n * Extracts stack frames from the error and builds a Sentry Exception\n */\nexport function exceptionFromError(stackParser: StackParser, error: Error): Exception {\n const exception: Exception = {\n type: error.name || error.constructor.name,\n value: error.message,\n };\n\n const frames = parseStackFrames(stackParser, error);\n if (frames.length) {\n exception.stacktrace = { frames };\n }\n\n return exception;\n}\n\nfunction getMessageForObject(exception: object): string {\n if ('name' in exception && typeof exception.name === 'string') {\n let message = `'${exception.name}' captured as exception`;\n\n if ('message' in exception && typeof exception.message === 'string') {\n message += ` with message '${exception.message}'`;\n }\n\n return message;\n } else if ('message' in exception && typeof exception.message === 'string') {\n return exception.message;\n } else {\n // This will allow us to group events based on top-level keys\n // which is much better than creating new group when any key/value change\n return `Object captured as exception with keys: ${extractExceptionKeysForMessage(\n exception as Record<string, unknown>,\n )}`;\n }\n}\n\n/**\n * Builds and Event from a Exception\n *\n * TODO(v8): Remove getHub fallback\n * @hidden\n */\nexport function eventFromUnknownInput(\n // eslint-disable-next-line deprecation/deprecation\n getHubOrClient: (() => Hub) | Client | undefined,\n stackParser: StackParser,\n exception: unknown,\n hint?: EventHint,\n): Event {\n const client =\n typeof getHubOrClient === 'function'\n ? // eslint-disable-next-line deprecation/deprecation\n getHubOrClient().getClient()\n : getHubOrClient;\n\n let ex: unknown = exception;\n const providedMechanism: Mechanism | undefined =\n hint && hint.data && (hint.data as { mechanism: Mechanism }).mechanism;\n const mechanism: Mechanism = providedMechanism || {\n handled: true,\n type: 'generic',\n };\n\n let extras: Extras | undefined;\n\n if (!isError(exception)) {\n if (isPlainObject(exception)) {\n const normalizeDepth = client && client.getOptions().normalizeDepth;\n extras = { ['__serialized__']: normalizeToSize(exception as Record<string, unknown>, normalizeDepth) };\n\n const message = getMessageForObject(exception);\n ex = (hint && hint.syntheticException) || new Error(message);\n (ex as Error).message = message;\n } else {\n // This handles when someone does: `throw \"something awesome\";`\n // We use synthesized Error here so we can extract a (rough) stack trace.\n ex = (hint && hint.syntheticException) || new Error(exception as string);\n (ex as Error).message = exception as string;\n }\n mechanism.synthetic = true;\n }\n\n const event: Event = {\n exception: {\n values: [exceptionFromError(stackParser, ex as Error)],\n },\n };\n\n if (extras) {\n event.extra = extras;\n }\n\n addExceptionTypeValue(event, undefined, undefined);\n addExceptionMechanism(event, mechanism);\n\n return {\n ...event,\n event_id: hint && hint.event_id,\n };\n}\n\n/**\n * Builds and Event from a Message\n * @hidden\n */\nexport function eventFromMessage(\n stackParser: StackParser,\n message: ParameterizedString,\n // eslint-disable-next-line deprecation/deprecation\n level: Severity | SeverityLevel = 'info',\n hint?: EventHint,\n attachStacktrace?: boolean,\n): Event {\n const event: Event = {\n event_id: hint && hint.event_id,\n level,\n };\n\n if (attachStacktrace && hint && hint.syntheticException) {\n const frames = parseStackFrames(stackParser, hint.syntheticException);\n if (frames.length) {\n event.exception = {\n values: [\n {\n value: message,\n stacktrace: { frames },\n },\n ],\n };\n }\n }\n\n if (isParameterizedString(message)) {\n const { __sentry_template_string__, __sentry_template_values__ } = message;\n\n event.logentry = {\n message: __sentry_template_string__,\n params: __sentry_template_values__,\n };\n return event;\n }\n\n event.message = message;\n return event;\n}\n", "declare const __DEBUG_BUILD__: boolean;\n\n/**\n * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.\n *\n * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.\n */\nexport const DEBUG_BUILD = __DEBUG_BUILD__;\n", "export const DEFAULT_ENVIRONMENT = 'production';\n", "import type { Event, EventHint, EventProcessor } from '@sentry/types';\nimport { SyncPromise, getGlobalSingleton, isThenable, logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from './debug-build';\n\n/**\n * Returns the global event processors.\n * @deprecated Global event processors will be removed in v8.\n */\nexport function getGlobalEventProcessors(): EventProcessor[] {\n return getGlobalSingleton<EventProcessor[]>('globalEventProcessors', () => []);\n}\n\n/**\n * Add a EventProcessor to be kept globally.\n * @deprecated Use `addEventProcessor` instead. Global event processors will be removed in v8.\n */\nexport function addGlobalEventProcessor(callback: EventProcessor): void {\n // eslint-disable-next-line deprecation/deprecation\n getGlobalEventProcessors().push(callback);\n}\n\n/**\n * Process an array of event processors, returning the processed event (or `null` if the event was dropped).\n */\nexport function notifyEventProcessors(\n processors: EventProcessor[],\n event: Event | null,\n hint: EventHint,\n index: number = 0,\n): PromiseLike<Event | null> {\n return new SyncPromise<Event | null>((resolve, reject) => {\n const processor = processors[index];\n if (event === null || typeof processor !== 'function') {\n resolve(event);\n } else {\n const result = processor({ ...event }, hint) as Event | null;\n\n DEBUG_BUILD && processor.id && result === null && logger.log(`Event processor \"${processor.id}\" dropped event`);\n\n if (isThenable(result)) {\n void result\n .then(final => notifyEventProcessors(processors, final, hint, index + 1).then(resolve))\n .then(null, reject);\n } else {\n void notifyEventProcessors(processors, result, hint, index + 1)\n .then(resolve)\n .then(null, reject);\n }\n }\n });\n}\n", "import type { SerializedSession, Session, SessionContext, SessionStatus } from '@sentry/types';\nimport { dropUndefinedKeys, timestampInSeconds, uuid4 } from '@sentry/utils';\n/**\n * Creates a new `Session` object by setting certain default parameters. If optional @param context\n * is passed, the passed properties are applied to the session object.\n *\n * @param context (optional) additional properties to be applied to the returned session object\n *\n * @returns a new `Session` object\n */\nexport function makeSession(context?: Omit<SessionContext, 'started' | 'status'>): Session {\n // Both timestamp and started are in seconds since the UNIX epoch.\n const startingTime = timestampInSeconds();\n\n const session: Session = {\n sid: uuid4(),\n init: true,\n timestamp: startingTime,\n started: startingTime,\n duration: 0,\n status: 'ok',\n errors: 0,\n ignoreDuration: false,\n toJSON: () => sessionToJSON(session),\n };\n\n if (context) {\n updateSession(session, context);\n }\n\n return session;\n}\n\n/**\n * Updates a session object with the properties passed in the context.\n *\n * Note that this function mutates the passed object and returns void.\n * (Had to do this instead of returning a new and updated session because closing and sending a session\n * makes an update to the session after it was passed to the sending logic.\n * @see BaseClient.captureSession )\n *\n * @param session the `Session` to update\n * @param context the `SessionContext` holding the properties that should be updated in @param session\n */\n// eslint-disable-next-line complexity\nexport function updateSession(session: Session, context: SessionContext = {}): void {\n if (context.user) {\n if (!session.ipAddress && context.user.ip_address) {\n session.ipAddress = context.user.ip_address;\n }\n\n if (!session.did && !context.did) {\n session.did = context.user.id || context.user.email || context.user.username;\n }\n }\n\n session.timestamp = context.timestamp || timestampInSeconds();\n\n if (context.abnormal_mechanism) {\n session.abnormal_mechanism = context.abnormal_mechanism;\n }\n\n if (context.ignoreDuration) {\n session.ignoreDuration = context.ignoreDuration;\n }\n if (context.sid) {\n // Good enough uuid validation. — Kamil\n session.sid = context.sid.length === 32 ? context.sid : uuid4();\n }\n if (context.init !== undefined) {\n session.init = context.init;\n }\n if (!session.did && context.did) {\n session.did = `${context.did}`;\n }\n if (typeof context.started === 'number') {\n session.started = context.started;\n }\n if (session.ignoreDuration) {\n session.duration = undefined;\n } else if (typeof context.duration === 'number') {\n session.duration = context.duration;\n } else {\n const duration = session.timestamp - session.started;\n session.duration = duration >= 0 ? duration : 0;\n }\n if (context.release) {\n session.release = context.release;\n }\n if (context.environment) {\n session.environment = context.environment;\n }\n if (!session.ipAddress && context.ipAddress) {\n session.ipAddress = context.ipAddress;\n }\n if (!session.userAgent && context.userAgent) {\n session.userAgent = context.userAgent;\n }\n if (typeof context.errors === 'number') {\n session.errors = context.errors;\n }\n if (context.status) {\n session.status = context.status;\n }\n}\n\n/**\n * Closes a session by setting its status and updating the session object with it.\n * Internally calls `updateSession` to update the passed session object.\n *\n * Note that this function mutates the passed session (@see updateSession for explanation).\n *\n * @param session the `Session` object to be closed\n * @param status the `SessionStatus` with which the session was closed. If you don't pass a status,\n * this function will keep the previously set status, unless it was `'ok'` in which case\n * it is changed to `'exited'`.\n */\nexport function closeSession(session: Session, status?: Exclude<SessionStatus, 'ok'>): void {\n let context = {};\n if (status) {\n context = { status };\n } else if (session.status === 'ok') {\n context = { status: 'exited' };\n }\n\n updateSession(session, context);\n}\n\n/**\n * Serializes a passed session object to a JSON object with a slightly different structure.\n * This is necessary because the Sentry backend requires a slightly different schema of a session\n * than the one the JS SDKs use internally.\n *\n * @param session the session to be converted\n *\n * @returns a JSON object of the passed session\n */\nfunction sessionToJSON(session: Session): SerializedSession {\n return dropUndefinedKeys({\n sid: `${session.sid}`,\n init: session.init,\n // Make sure that sec is converted to ms for date constructor\n started: new Date(session.started * 1000).toISOString(),\n timestamp: new Date(session.timestamp * 1000).toISOString(),\n status: session.status,\n errors: session.errors,\n did: typeof session.did === 'number' || typeof session.did === 'string' ? `${session.did}` : undefined,\n duration: session.duration,\n abnormal_mechanism: session.abnormal_mechanism,\n attrs: {\n release: session.release,\n environment: session.environment,\n ip_address: session.ipAddress,\n user_agent: session.userAgent,\n },\n });\n}\n", "import type { Span, SpanJSON, SpanTimeInput, TraceContext } from '@sentry/types';\nimport { dropUndefinedKeys, generateSentryTraceHeader, timestampInSeconds } from '@sentry/utils';\nimport type { Span as SpanClass } from '../tracing/span';\n\n// These are aligned with OpenTelemetry trace flags\nexport const TRACE_FLAG_NONE = 0x0;\nexport const TRACE_FLAG_SAMPLED = 0x1;\n\n/**\n * Convert a span to a trace context, which can be sent as the `trace` context in an event.\n */\nexport function spanToTraceContext(span: Span): TraceContext {\n const { spanId: span_id, traceId: trace_id } = span.spanContext();\n const { data, op, parent_span_id, status, tags, origin } = spanToJSON(span);\n\n return dropUndefinedKeys({\n data,\n op,\n parent_span_id,\n span_id,\n status,\n tags,\n trace_id,\n origin,\n });\n}\n\n/**\n * Convert a Span to a Sentry trace header.\n */\nexport function spanToTraceHeader(span: Span): string {\n const { traceId, spanId } = span.spanContext();\n const sampled = spanIsSampled(span);\n return generateSentryTraceHeader(traceId, spanId, sampled);\n}\n\n/**\n * Convert a span time input intp a timestamp in seconds.\n */\nexport function spanTimeInputToSeconds(input: SpanTimeInput | undefined): number {\n if (typeof input === 'number') {\n return ensureTimestampInSeconds(input);\n }\n\n if (Array.isArray(input)) {\n // See {@link HrTime} for the array-based time format\n return input[0] + input[1] / 1e9;\n }\n\n if (input instanceof Date) {\n return ensureTimestampInSeconds(input.getTime());\n }\n\n return timestampInSeconds();\n}\n\n/**\n * Converts a timestamp to second, if it was in milliseconds, or keeps it as second.\n */\nfunction ensureTimestampInSeconds(timestamp: number): number {\n const isMs = timestamp > 9999999999;\n return isMs ? timestamp / 1000 : timestamp;\n}\n\n/**\n * Convert a span to a JSON representation.\n * Note that all fields returned here are optional and need to be guarded against.\n *\n * Note: Because of this, we currently have a circular type dependency (which we opted out of in package.json).\n * This is not avoidable as we need `spanToJSON` in `spanUtils.ts`, which in turn is needed by `span.ts` for backwards compatibility.\n * And `spanToJSON` needs the Span class from `span.ts` to check here.\n * TODO v8: When we remove the deprecated stuff from `span.ts`, we can remove the circular dependency again.\n */\nexport function spanToJSON(span: Span): Partial<SpanJSON> {\n if (spanIsSpanClass(span)) {\n return span.getSpanJSON();\n }\n\n // Fallback: We also check for `.toJSON()` here...\n // eslint-disable-next-line deprecation/deprecation\n if (typeof span.toJSON === 'function') {\n // eslint-disable-next-line deprecation/deprecation\n return span.toJSON();\n }\n\n return {};\n}\n\n/**\n * Sadly, due to circular dependency checks we cannot actually import the Span class here and check for instanceof.\n * :( So instead we approximate this by checking if it has the `getSpanJSON` method.\n */\nfunction spanIsSpanClass(span: Span): span is SpanClass {\n return typeof (span as SpanClass).getSpanJSON === 'function';\n}\n\n/**\n * Returns true if a span is sampled.\n * In most cases, you should just use `span.isRecording()` instead.\n * However, this has a slightly different semantic, as it also returns false if the span is finished.\n * So in the case where this distinction is important, use this method.\n */\nexport function spanIsSampled(span: Span): boolean {\n // We align our trace flags with the ones OpenTelemetry use\n // So we also check for sampled the same way they do.\n const { traceFlags } = span.spanContext();\n // eslint-disable-next-line no-bitwise\n return Boolean(traceFlags & TRACE_FLAG_SAMPLED);\n}\n", "import type {\n CaptureContext,\n Client,\n ClientOptions,\n Event,\n EventHint,\n Scope as ScopeInterface,\n ScopeContext,\n StackFrame,\n StackParser,\n} from '@sentry/types';\nimport { GLOBAL_OBJ, addExceptionMechanism, dateTimestampInSeconds, normalize, truncate, uuid4 } from '@sentry/utils';\n\nimport { DEFAULT_ENVIRONMENT } from '../constants';\nimport { getGlobalEventProcessors, notifyEventProcessors } from '../eventProcessors';\nimport { Scope, getGlobalScope } from '../scope';\nimport { applyScopeDataToEvent, mergeScopeData } from './applyScopeDataToEvent';\nimport { spanToJSON } from './spanUtils';\n\n/**\n * This type makes sure that we get either a CaptureContext, OR an EventHint.\n * It does not allow mixing them, which could lead to unexpected outcomes, e.g. this is disallowed:\n * { user: { id: '123' }, mechanism: { handled: false } }\n */\nexport type ExclusiveEventHintOrCaptureContext =\n | (CaptureContext & Partial<{ [key in keyof EventHint]: never }>)\n | (EventHint & Partial<{ [key in keyof ScopeContext]: never }>);\n\n/**\n * Adds common information to events.\n *\n * The information includes release and environment from `options`,\n * breadcrumbs and context (extra, tags and user) from the scope.\n *\n * Information that is already present in the event is never overwritten. For\n * nested objects, such as the context, keys are merged.\n *\n * Note: This also triggers callbacks for `addGlobalEventProcessor`, but not `beforeSend`.\n *\n * @param event The original event.\n * @param hint May contain additional information about the original exception.\n * @param scope A scope containing event metadata.\n * @returns A new event with more information.\n * @hidden\n */\nexport function prepareEvent(\n options: ClientOptions,\n event: Event,\n hint: EventHint,\n scope?: Scope,\n client?: Client,\n isolationScope?: Scope,\n): PromiseLike<Event | null> {\n const { normalizeDepth = 3, normalizeMaxBreadth = 1_000 } = options;\n const prepared: Event = {\n ...event,\n event_id: event.event_id || hint.event_id || uuid4(),\n timestamp: event.timestamp || dateTimestampInSeconds(),\n };\n const integrations = hint.integrations || options.integrations.map(i => i.name);\n\n applyClientOptions(prepared, options);\n applyIntegrationsMetadata(prepared, integrations);\n\n // Only put debug IDs onto frames for error events.\n if (event.type === undefined) {\n applyDebugIds(prepared, options.stackParser);\n }\n\n // If we have scope given to us, use it as the base for further modifications.\n // This allows us to prevent unnecessary copying of data if `captureContext` is not provided.\n const finalScope = getFinalScope(scope, hint.captureContext);\n\n if (hint.mechanism) {\n addExceptionMechanism(prepared, hint.mechanism);\n }\n\n const clientEventProcessors = client && client.getEventProcessors ? client.getEventProcessors() : [];\n\n // This should be the last thing called, since we want that\n // {@link Hub.addEventProcessor} gets the finished prepared event.\n // Merge scope data together\n const data = getGlobalScope().getScopeData();\n\n if (isolationScope) {\n const isolationData = isolationScope.getScopeData();\n mergeScopeData(data, isolationData);\n }\n\n if (finalScope) {\n const finalScopeData = finalScope.getScopeData();\n mergeScopeData(data, finalScopeData);\n }\n\n const attachments = [...(hint.attachments || []), ...data.attachments];\n if (attachments.length) {\n hint.attachments = attachments;\n }\n\n applyScopeDataToEvent(prepared, data);\n\n // TODO (v8): Update this order to be: Global > Client > Scope\n const eventProcessors = [\n ...clientEventProcessors,\n // eslint-disable-next-line deprecation/deprecation\n ...getGlobalEventProcessors(),\n // Run scope event processors _after_ all other processors\n ...data.eventProcessors,\n ];\n\n const result = notifyEventProcessors(eventProcessors, prepared, hint);\n\n return result.then(evt => {\n if (evt) {\n // We apply the debug_meta field only after all event processors have ran, so that if any event processors modified\n // file names (e.g.the RewriteFrames integration) the filename -> debug ID relationship isn't destroyed.\n // This should not cause any PII issues, since we're only moving data that is already on the event and not adding\n // any new data\n applyDebugMeta(evt);\n }\n\n if (typeof normalizeDepth === 'number' && normalizeDepth > 0) {\n return normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth);\n }\n return evt;\n });\n}\n\n/**\n * Enhances event using the client configuration.\n * It takes care of all \"static\" values like environment, release and `dist`,\n * as well as truncating overly long values.\n * @param event event instance to be enhanced\n */\nfunction applyClientOptions(event: Event, options: ClientOptions): void {\n const { environment, release, dist, maxValueLength = 250 } = options;\n\n if (!('environment' in event)) {\n event.environment = 'environment' in options ? environment : DEFAULT_ENVIRONMENT;\n }\n\n if (event.release === undefined && release !== undefined) {\n event.release = release;\n }\n\n if (event.dist === undefined && dist !== undefined) {\n event.dist = dist;\n }\n\n if (event.message) {\n event.message = truncate(event.message, maxValueLength);\n }\n\n const exception = event.exception && event.exception.values && event.exception.values[0];\n if (exception && exception.value) {\n exception.value = truncate(exception.value, maxValueLength);\n }\n\n const request = event.request;\n if (request && request.url) {\n request.url = truncate(request.url, maxValueLength);\n }\n}\n\nconst debugIdStackParserCache = new WeakMap<StackParser, Map<string, StackFrame[]>>();\n\n/**\n * Puts debug IDs into the stack frames of an error event.\n */\nexport function applyDebugIds(event: Event, stackParser: StackParser): void {\n const debugIdMap = GLOBAL_OBJ._sentryDebugIds;\n\n if (!debugIdMap) {\n return;\n }\n\n let debugIdStackFramesCache: Map<string, StackFrame[]>;\n const cachedDebugIdStackFrameCache = debugIdStackParserCache.get(stackParser);\n if (cachedDebugIdStackFrameCache) {\n debugIdStackFramesCache = cachedDebugIdStackFrameCache;\n } else {\n debugIdStackFramesCache = new Map<string, StackFrame[]>();\n debugIdStackParserCache.set(stackParser, debugIdStackFramesCache);\n }\n\n // Build a map of filename -> debug_id\n const filenameDebugIdMap = Object.keys(debugIdMap).reduce<Record<string, string>>((acc, debugIdStackTrace) => {\n let parsedStack: StackFrame[];\n const cachedParsedStack = debugIdStackFramesCache.get(debugIdStackTrace);\n if (cachedParsedStack) {\n parsedStack = cachedParsedStack;\n } else {\n parsedStack = stackParser(debugIdStackTrace);\n debugIdStackFramesCache.set(debugIdStackTrace, parsedStack);\n }\n\n for (let i = parsedStack.length - 1; i >= 0; i--) {\n const stackFrame = parsedStack[i];\n if (stackFrame.filename) {\n acc[stackFrame.filename] = debugIdMap[debugIdStackTrace];\n break;\n }\n }\n return acc;\n }, {});\n\n try {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n event!.exception!.values!.forEach(exception => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n exception.stacktrace!.frames!.forEach(frame => {\n if (frame.filename) {\n frame.debug_id = filenameDebugIdMap[frame.filename];\n }\n });\n });\n } catch (e) {\n // To save bundle size we're just try catching here instead of checking for the existence of all the different objects.\n }\n}\n\n/**\n * Moves debug IDs from the stack frames of an error event into the debug_meta field.\n */\nexport function applyDebugMeta(event: Event): void {\n // Extract debug IDs and filenames from the stack frames on the event.\n const filenameDebugIdMap: Record<string, string> = {};\n try {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n event.exception!.values!.forEach(exception => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n exception.stacktrace!.frames!.forEach(frame => {\n if (frame.debug_id) {\n if (frame.abs_path) {\n filenameDebugIdMap[frame.abs_path] = frame.debug_id;\n } else if (frame.filename) {\n filenameDebugIdMap[frame.filename] = frame.debug_id;\n }\n delete frame.debug_id;\n }\n });\n });\n } catch (e) {\n // To save bundle size we're just try catching here instead of checking for the existence of all the different objects.\n }\n\n if (Object.keys(filenameDebugIdMap).length === 0) {\n return;\n }\n\n // Fill debug_meta information\n event.debug_meta = event.debug_meta || {};\n event.debug_meta.images = event.debug_meta.images || [];\n const images = event.debug_meta.images;\n Object.keys(filenameDebugIdMap).forEach(filename => {\n images.push({\n type: 'sourcemap',\n code_file: filename,\n debug_id: filenameDebugIdMap[filename],\n });\n });\n}\n\n/**\n * This function adds all used integrations to the SDK info in the event.\n * @param event The event that will be filled with all integrations.\n */\nfunction applyIntegrationsMetadata(event: Event, integrationNames: string[]): void {\n if (integrationNames.length > 0) {\n event.sdk = event.sdk || {};\n event.sdk.integrations = [...(event.sdk.integrations || []), ...integrationNames];\n }\n}\n\n/**\n * Applies `normalize` function on necessary `Event` attributes to make them safe for serialization.\n * Normalized keys:\n * - `breadcrumbs.data`\n * - `user`\n * - `contexts`\n * - `extra`\n * @param event Event\n * @returns Normalized event\n */\nfunction normalizeEvent(event: Event | null, depth: number, maxBreadth: number): Event | null {\n if (!event) {\n return null;\n }\n\n const normalized: Event = {\n ...event,\n ...(event.breadcrumbs && {\n breadcrumbs: event.breadcrumbs.map(b => ({\n ...b,\n ...(b.data && {\n data: normalize(b.data, depth, maxBreadth),\n }),\n })),\n }),\n ...(event.user && {\n user: normalize(event.user, depth, maxBreadth),\n }),\n ...(event.contexts && {\n contexts: normalize(event.contexts, depth, maxBreadth),\n }),\n ...(event.extra && {\n extra: normalize(event.extra, depth, maxBreadth),\n }),\n };\n\n // event.contexts.trace stores information about a Transaction. Similarly,\n // event.spans[] stores information about child Spans. Given that a\n // Transaction is conceptually a Span, normalization should apply to both\n // Transactions and Spans consistently.\n // For now the decision is to skip normalization of Transactions and Spans,\n // so this block overwrites the normalized event to add back the original\n // Transaction information prior to normalization.\n if (event.contexts && event.contexts.trace && normalized.contexts) {\n normalized.contexts.trace = event.contexts.trace;\n\n // event.contexts.trace.data may contain circular/dangerous data so we need to normalize it\n if (event.contexts.trace.data) {\n normalized.contexts.trace.data = normalize(event.contexts.trace.data, depth, maxBreadth);\n }\n }\n\n // event.spans[].data may contain circular/dangerous data so we need to normalize it\n if (event.spans) {\n normalized.spans = event.spans.map(span => {\n const data = spanToJSON(span).data;\n\n if (data) {\n // This is a bit weird, as we generally have `Span` instances here, but to be safe we do not assume so\n // eslint-disable-next-line deprecation/deprecation\n span.data = normalize(data, depth, maxBreadth);\n }\n\n return span;\n });\n }\n\n return normalized;\n}\n\nfunction getFinalScope(scope: Scope | undefined, captureContext: CaptureContext | undefined): Scope | undefined {\n if (!captureContext) {\n return scope;\n }\n\n const finalScope = scope ? scope.clone() : new Scope();\n finalScope.update(captureContext);\n return finalScope;\n}\n\n/**\n * Parse either an `EventHint` directly, or convert a `CaptureContext` to an `EventHint`.\n * This is used to allow to update method signatures that used to accept a `CaptureContext` but should now accept an `EventHint`.\n */\nexport function parseEventHintOrCaptureContext(\n hint: ExclusiveEventHintOrCaptureContext | undefined,\n): EventHint | undefined {\n if (!hint) {\n return undefined;\n }\n\n // If you pass a Scope or `() => Scope` as CaptureContext, we just return this as captureContext\n if (hintIsScopeOrFunction(hint)) {\n return { captureContext: hint };\n }\n\n if (hintIsScopeContext(hint)) {\n return {\n captureContext: hint,\n };\n }\n\n return hint;\n}\n\nfunction hintIsScopeOrFunction(\n hint: CaptureContext | EventHint,\n): hint is ScopeInterface | ((scope: ScopeInterface) => ScopeInterface) {\n return hint instanceof Scope || typeof hint === 'function';\n}\n\ntype ScopeContextProperty = keyof ScopeContext;\nconst captureContextKeys: readonly ScopeContextProperty[] = [\n 'user',\n 'level',\n 'extra',\n 'contexts',\n 'tags',\n 'fingerprint',\n 'requestSession',\n 'propagationContext',\n] as const;\n\nfunction hintIsScopeContext(hint: Partial<ScopeContext> | EventHint): hint is Partial<ScopeContext> {\n return Object.keys(hint).some(key => captureContextKeys.includes(key as ScopeContextProperty));\n}\n", "import type {\n Breadcrumb,\n BreadcrumbHint,\n CaptureContext,\n CheckIn,\n Client,\n CustomSamplingContext,\n Event,\n EventHint,\n Extra,\n Extras,\n FinishedCheckIn,\n MonitorConfig,\n Primitive,\n Scope as ScopeInterface,\n Session,\n SessionContext,\n Severity,\n SeverityLevel,\n Span,\n TransactionContext,\n User,\n} from '@sentry/types';\nimport { GLOBAL_OBJ, isThenable, logger, timestampInSeconds, uuid4 } from '@sentry/utils';\n\nimport { DEFAULT_ENVIRONMENT } from './constants';\nimport { DEBUG_BUILD } from './debug-build';\nimport type { Hub } from './hub';\nimport { runWithAsyncContext } from './hub';\nimport { getCurrentHub, getIsolationScope } from './hub';\nimport type { Scope } from './scope';\nimport { closeSession, makeSession, updateSession } from './session';\nimport type { ExclusiveEventHintOrCaptureContext } from './utils/prepareEvent';\nimport { parseEventHintOrCaptureContext } from './utils/prepareEvent';\n\n/**\n * Captures an exception event and sends it to Sentry.\n *\n * @param exception The exception to capture.\n * @param hint Optional additional data to attach to the Sentry event.\n * @returns the id of the captured Sentry event.\n */\nexport function captureException(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n exception: any,\n hint?: ExclusiveEventHintOrCaptureContext,\n): string {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().captureException(exception, parseEventHintOrCaptureContext(hint));\n}\n\n/**\n * Captures a message event and sends it to Sentry.\n *\n * @param exception The exception to capture.\n * @param captureContext Define the level of the message or pass in additional data to attach to the message.\n * @returns the id of the captured message.\n */\nexport function captureMessage(\n message: string,\n // eslint-disable-next-line deprecation/deprecation\n captureContext?: CaptureContext | Severity | SeverityLevel,\n): string {\n // This is necessary to provide explicit scopes upgrade, without changing the original\n // arity of the `captureMessage(message, level)` method.\n const level = typeof captureContext === 'string' ? captureContext : undefined;\n const context = typeof captureContext !== 'string' ? { captureContext } : undefined;\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().captureMessage(message, level, context);\n}\n\n/**\n * Captures a manually created event and sends it to Sentry.\n *\n * @param exception The event to send to Sentry.\n * @param hint Optional additional data to attach to the Sentry event.\n * @returns the id of the captured event.\n */\nexport function captureEvent(event: Event, hint?: EventHint): string {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().captureEvent(event, hint);\n}\n\n/**\n * Callback to set context information onto the scope.\n * @param callback Callback function that receives Scope.\n *\n * @deprecated Use getCurrentScope() directly.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport function configureScope(callback: (scope: Scope) => void): ReturnType<Hub['configureScope']> {\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub().configureScope(callback);\n}\n\n/**\n * Records a new breadcrumb which will be attached to future events.\n *\n * Breadcrumbs will be added to subsequent events to provide more context on\n * user's actions prior to an error or crash.\n *\n * @param breadcrumb The breadcrumb to record.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport function addBreadcrumb(breadcrumb: Breadcrumb, hint?: BreadcrumbHint): ReturnType<Hub['addBreadcrumb']> {\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub().addBreadcrumb(breadcrumb, hint);\n}\n\n/**\n * Sets context data with the given name.\n * @param name of the context\n * @param context Any kind of data. This data will be normalized.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any, deprecation/deprecation\nexport function setContext(name: string, context: { [key: string]: any } | null): ReturnType<Hub['setContext']> {\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub().setContext(name, context);\n}\n\n/**\n * Set an object that will be merged sent as extra data with the event.\n * @param extras Extras object to merge into current context.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport function setExtras(extras: Extras): ReturnType<Hub['setExtras']> {\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub().setExtras(extras);\n}\n\n/**\n * Set key:value that will be sent as extra data with the event.\n * @param key String of extra\n * @param extra Any kind of data. This data will be normalized.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport function setExtra(key: string, extra: Extra): ReturnType<Hub['setExtra']> {\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub().setExtra(key, extra);\n}\n\n/**\n * Set an object that will be merged sent as tags data with the event.\n * @param tags Tags context object to merge into current context.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport function setTags(tags: { [key: string]: Primitive }): ReturnType<Hub['setTags']> {\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub().setTags(tags);\n}\n\n/**\n * Set key:value that will be sent as tags data with the event.\n *\n * Can also be used to unset a tag, by passing `undefined`.\n *\n * @param key String key of tag\n * @param value Value of tag\n */\n// eslint-disable-next-line deprecation/deprecation\nexport function setTag(key: string, value: Primitive): ReturnType<Hub['setTag']> {\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub().setTag(key, value);\n}\n\n/**\n * Updates user context information for future events.\n *\n * @param user User context object to be set in the current context. Pass `null` to unset the user.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport function setUser(user: User | null): ReturnType<Hub['setUser']> {\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub().setUser(user);\n}\n\n/**\n * Creates a new scope with and executes the given operation within.\n * The scope is automatically removed once the operation\n * finishes or throws.\n *\n * This is essentially a convenience function for:\n *\n * pushScope();\n * callback();\n * popScope();\n */\nexport function withScope<T>(callback: (scope: Scope) => T): T;\n/**\n * Set the given scope as the active scope in the callback.\n */\nexport function withScope<T>(scope: ScopeInterface | undefined, callback: (scope: Scope) => T): T;\n/**\n * Either creates a new active scope, or sets the given scope as active scope in the given callback.\n */\nexport function withScope<T>(\n ...rest: [callback: (scope: Scope) => T] | [scope: ScopeInterface | undefined, callback: (scope: Scope) => T]\n): T {\n // eslint-disable-next-line deprecation/deprecation\n const hub = getCurrentHub();\n\n // If a scope is defined, we want to make this the active scope instead of the default one\n if (rest.length === 2) {\n const [scope, callback] = rest;\n if (!scope) {\n // eslint-disable-next-line deprecation/deprecation\n return hub.withScope(callback);\n }\n\n // eslint-disable-next-line deprecation/deprecation\n return hub.withScope(() => {\n // eslint-disable-next-line deprecation/deprecation\n hub.getStackTop().scope = scope as Scope;\n return callback(scope as Scope);\n });\n }\n\n // eslint-disable-next-line deprecation/deprecation\n return hub.withScope(rest[0]);\n}\n\n/**\n * Attempts to fork the current isolation scope and the current scope based on the current async context strategy. If no\n * async context strategy is set, the isolation scope and the current scope will not be forked (this is currently the\n * case, for example, in the browser).\n *\n * Usage of this function in environments without async context strategy is discouraged and may lead to unexpected behaviour.\n *\n * This function is intended for Sentry SDK and SDK integration development. It is not recommended to be used in \"normal\"\n * applications directly because it comes with pitfalls. Use at your own risk!\n *\n * @param callback The callback in which the passed isolation scope is active. (Note: In environments without async\n * context strategy, the currently active isolation scope may change within execution of the callback.)\n * @returns The same value that `callback` returns.\n */\nexport function withIsolationScope<T>(callback: (isolationScope: Scope) => T): T {\n return runWithAsyncContext(() => {\n return callback(getIsolationScope());\n });\n}\n\n/**\n * Forks the current scope and sets the provided span as active span in the context of the provided callback.\n *\n * @param span Spans started in the context of the provided callback will be children of this span.\n * @param callback Execution context in which the provided span will be active. Is passed the newly forked scope.\n * @returns the value returned from the provided callback function.\n */\nexport function withActiveSpan<T>(span: Span, callback: (scope: Scope) => T): T {\n return withScope(scope => {\n // eslint-disable-next-line deprecation/deprecation\n scope.setSpan(span);\n return callback(scope);\n });\n}\n\n/**\n * Starts a new `Transaction` and returns it. This is the entry point to manual tracing instrumentation.\n *\n * A tree structure can be built by adding child spans to the transaction, and child spans to other spans. To start a\n * new child span within the transaction or any span, call the respective `.startChild()` method.\n *\n * Every child span must be finished before the transaction is finished, otherwise the unfinished spans are discarded.\n *\n * The transaction must be finished with a call to its `.end()` method, at which point the transaction with all its\n * finished child spans will be sent to Sentry.\n *\n * NOTE: This function should only be used for *manual* instrumentation. Auto-instrumentation should call\n * `startTransaction` directly on the hub.\n *\n * @param context Properties of the new `Transaction`.\n * @param customSamplingContext Information given to the transaction sampling function (along with context-dependent\n * default values). See {@link Options.tracesSampler}.\n *\n * @returns The transaction which was just started\n *\n * @deprecated Use `startSpan()`, `startSpanManual()` or `startInactiveSpan()` instead.\n */\nexport function startTransaction(\n context: TransactionContext,\n customSamplingContext?: CustomSamplingContext,\n // eslint-disable-next-line deprecation/deprecation\n): ReturnType<Hub['startTransaction']> {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().startTransaction({ ...context }, customSamplingContext);\n}\n\n/**\n * Create a cron monitor check in and send it to Sentry.\n *\n * @param checkIn An object that describes a check in.\n * @param upsertMonitorConfig An optional object that describes a monitor config. Use this if you want\n * to create a monitor automatically when sending a check in.\n */\nexport function captureCheckIn(checkIn: CheckIn, upsertMonitorConfig?: MonitorConfig): string {\n const scope = getCurrentScope();\n const client = getClient();\n if (!client) {\n DEBUG_BUILD && logger.warn('Cannot capture check-in. No client defined.');\n } else if (!client.captureCheckIn) {\n DEBUG_BUILD && logger.warn('Cannot capture check-in. Client does not support sending check-ins.');\n } else {\n return client.captureCheckIn(checkIn, upsertMonitorConfig, scope);\n }\n\n return uuid4();\n}\n\n/**\n * Wraps a callback with a cron monitor check in. The check in will be sent to Sentry when the callback finishes.\n *\n * @param monitorSlug The distinct slug of the monitor.\n * @param upsertMonitorConfig An optional object that describes a monitor config. Use this if you want\n * to create a monitor automatically when sending a check in.\n */\nexport function withMonitor<T>(\n monitorSlug: CheckIn['monitorSlug'],\n callback: () => T,\n upsertMonitorConfig?: MonitorConfig,\n): T {\n const checkInId = captureCheckIn({ monitorSlug, status: 'in_progress' }, upsertMonitorConfig);\n const now = timestampInSeconds();\n\n function finishCheckIn(status: FinishedCheckIn['status']): void {\n captureCheckIn({ monitorSlug, status, checkInId, duration: timestampInSeconds() - now });\n }\n\n let maybePromiseResult: T;\n try {\n maybePromiseResult = callback();\n } catch (e) {\n finishCheckIn('error');\n throw e;\n }\n\n if (isThenable(maybePromiseResult)) {\n Promise.resolve(maybePromiseResult).then(\n () => {\n finishCheckIn('ok');\n },\n () => {\n finishCheckIn('error');\n },\n );\n } else {\n finishCheckIn('ok');\n }\n\n return maybePromiseResult;\n}\n\n/**\n * Call `flush()` on the current client, if there is one. See {@link Client.flush}.\n *\n * @param timeout Maximum time in ms the client should wait to flush its event queue. Omitting this parameter will cause\n * the client to wait until all events are sent before resolving the promise.\n * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it\n * doesn't (or if there's no client defined).\n */\nexport async function flush(timeout?: number): Promise<boolean> {\n const client = getClient();\n if (client) {\n return client.flush(timeout);\n }\n DEBUG_BUILD && logger.warn('Cannot flush events. No client defined.');\n return Promise.resolve(false);\n}\n\n/**\n * Call `close()` on the current client, if there is one. See {@link Client.close}.\n *\n * @param timeout Maximum time in ms the client should wait to flush its event queue before shutting down. Omitting this\n * parameter will cause the client to wait until all events are sent before disabling itself.\n * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it\n * doesn't (or if there's no client defined).\n */\nexport async function close(timeout?: number): Promise<boolean> {\n const client = getClient();\n if (client) {\n return client.close(timeout);\n }\n DEBUG_BUILD && logger.warn('Cannot flush events and disable SDK. No client defined.');\n return Promise.resolve(false);\n}\n\n/**\n * This is the getter for lastEventId.\n *\n * @returns The last event id of a captured event.\n */\nexport function lastEventId(): string | undefined {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().lastEventId();\n}\n\n/**\n * Get the currently active client.\n */\nexport function getClient<C extends Client>(): C | undefined {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().getClient<C>();\n}\n\n/**\n * Returns true if Sentry has been properly initialized.\n */\nexport function isInitialized(): boolean {\n return !!getClient();\n}\n\n/**\n * Get the currently active scope.\n */\nexport function getCurrentScope(): Scope {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().getScope();\n}\n\n/**\n * Start a session on the current isolation scope.\n *\n * @param context (optional) additional properties to be applied to the returned session object\n *\n * @returns the new active session\n */\nexport function startSession(context?: SessionContext): Session {\n const client = getClient();\n const isolationScope = getIsolationScope();\n const currentScope = getCurrentScope();\n\n const { release, environment = DEFAULT_ENVIRONMENT } = (client && client.getOptions()) || {};\n\n // Will fetch userAgent if called from browser sdk\n const { userAgent } = GLOBAL_OBJ.navigator || {};\n\n const session = makeSession({\n release,\n environment,\n user: currentScope.getUser() || isolationScope.getUser(),\n ...(userAgent && { userAgent }),\n ...context,\n });\n\n // End existing session if there's one\n const currentSession = isolationScope.getSession();\n if (currentSession && currentSession.status === 'ok') {\n updateSession(currentSession, { status: 'exited' });\n }\n\n endSession();\n\n // Afterwards we set the new session on the scope\n isolationScope.setSession(session);\n\n // TODO (v8): Remove this and only use the isolation scope(?).\n // For v7 though, we can't \"soft-break\" people using getCurrentHub().getScope().setSession()\n currentScope.setSession(session);\n\n return session;\n}\n\n/**\n * End the session on the current isolation scope.\n */\nexport function endSession(): void {\n const isolationScope = getIsolationScope();\n const currentScope = getCurrentScope();\n\n const session = currentScope.getSession() || isolationScope.getSession();\n if (session) {\n closeSession(session);\n }\n _sendSessionUpdate();\n\n // the session is over; take it off of the scope\n isolationScope.setSession();\n\n // TODO (v8): Remove this and only use the isolation scope(?).\n // For v7 though, we can't \"soft-break\" people using getCurrentHub().getScope().setSession()\n currentScope.setSession();\n}\n\n/**\n * Sends the current Session on the scope\n */\nfunction _sendSessionUpdate(): void {\n const isolationScope = getIsolationScope();\n const currentScope = getCurrentScope();\n const client = getClient();\n // TODO (v8): Remove currentScope and only use the isolation scope(?).\n // For v7 though, we can't \"soft-break\" people using getCurrentHub().getScope().setSession()\n const session = currentScope.getSession() || isolationScope.getSession();\n if (session && client && client.captureSession) {\n client.captureSession(session);\n }\n}\n\n/**\n * Sends the current session on the scope to Sentry\n *\n * @param end If set the session will be marked as exited and removed from the scope.\n * Defaults to `false`.\n */\nexport function captureSession(end: boolean = false): void {\n // both send the update and pull the session from the scope\n if (end) {\n endSession();\n return;\n }\n\n // only send the update\n _sendSessionUpdate();\n}\n", "import type { Span } from '@sentry/types';\n\n/**\n * Returns the root span of a given span.\n *\n * As long as we use `Transaction`s internally, the returned root span\n * will be a `Transaction` but be aware that this might change in the future.\n *\n * If the given span has no root span or transaction, `undefined` is returned.\n */\nexport function getRootSpan(span: Span): Span | undefined {\n // TODO (v8): Remove this check and just return span\n // eslint-disable-next-line deprecation/deprecation\n return span.transaction;\n}\n", "import type { Client, DynamicSamplingContext, Scope, Span, Transaction } from '@sentry/types';\nimport { dropUndefinedKeys } from '@sentry/utils';\n\nimport { DEFAULT_ENVIRONMENT } from '../constants';\nimport { getClient, getCurrentScope } from '../exports';\nimport { getRootSpan } from '../utils/getRootSpan';\nimport { spanIsSampled, spanToJSON } from '../utils/spanUtils';\n\n/**\n * Creates a dynamic sampling context from a client.\n *\n * Dispatches the `createDsc` lifecycle hook as a side effect.\n */\nexport function getDynamicSamplingContextFromClient(\n trace_id: string,\n client: Client,\n scope?: Scope,\n): DynamicSamplingContext {\n const options = client.getOptions();\n\n const { publicKey: public_key } = client.getDsn() || {};\n // TODO(v8): Remove segment from User\n // eslint-disable-next-line deprecation/deprecation\n const { segment: user_segment } = (scope && scope.getUser()) || {};\n\n const dsc = dropUndefinedKeys({\n environment: options.environment || DEFAULT_ENVIRONMENT,\n release: options.release,\n user_segment,\n public_key,\n trace_id,\n }) as DynamicSamplingContext;\n\n client.emit && client.emit('createDsc', dsc);\n\n return dsc;\n}\n\n/**\n * A Span with a frozen dynamic sampling context.\n */\ntype TransactionWithV7FrozenDsc = Transaction & { _frozenDynamicSamplingContext?: DynamicSamplingContext };\n\n/**\n * Creates a dynamic sampling context from a span (and client and scope)\n *\n * @param span the span from which a few values like the root span name and sample rate are extracted.\n *\n * @returns a dynamic sampling context\n */\nexport function getDynamicSamplingContextFromSpan(span: Span): Readonly<Partial<DynamicSamplingContext>> {\n const client = getClient();\n if (!client) {\n return {};\n }\n\n // passing emit=false here to only emit later once the DSC is actually populated\n const dsc = getDynamicSamplingContextFromClient(spanToJSON(span).trace_id || '', client, getCurrentScope());\n\n // TODO (v8): Remove v7FrozenDsc as a Transaction will no longer have _frozenDynamicSamplingContext\n const txn = getRootSpan(span) as TransactionWithV7FrozenDsc | undefined;\n if (!txn) {\n return dsc;\n }\n\n // TODO (v8): Remove v7FrozenDsc as a Transaction will no longer have _frozenDynamicSamplingContext\n // For now we need to avoid breaking users who directly created a txn with a DSC, where this field is still set.\n // @see Transaction class constructor\n const v7FrozenDsc = txn && txn._frozenDynamicSamplingContext;\n if (v7FrozenDsc) {\n return v7FrozenDsc;\n }\n\n // TODO (v8): Replace txn.metadata with txn.attributes[]\n // We can't do this yet because attributes aren't always set yet.\n // eslint-disable-next-line deprecation/deprecation\n const { sampleRate: maybeSampleRate, source } = txn.metadata;\n if (maybeSampleRate != null) {\n dsc.sample_rate = `${maybeSampleRate}`;\n }\n\n // We don't want to have a transaction name in the DSC if the source is \"url\" because URLs might contain PII\n const jsonSpan = spanToJSON(txn);\n\n // after JSON conversion, txn.name becomes jsonSpan.description\n if (source && source !== 'url') {\n dsc.transaction = jsonSpan.description;\n }\n\n dsc.sampled = String(spanIsSampled(txn));\n\n client.emit && client.emit('createDsc', dsc);\n\n return dsc;\n}\n", "import type { Breadcrumb, Event, ScopeData, Span } from '@sentry/types';\nimport { arrayify, dropUndefinedKeys } from '@sentry/utils';\nimport { getDynamicSamplingContextFromSpan } from '../tracing/dynamicSamplingContext';\nimport { getRootSpan } from './getRootSpan';\nimport { spanToJSON, spanToTraceContext } from './spanUtils';\n\n/**\n * Applies data from the scope to the event and runs all event processors on it.\n */\nexport function applyScopeDataToEvent(event: Event, data: ScopeData): void {\n const { fingerprint, span, breadcrumbs, sdkProcessingMetadata } = data;\n\n // Apply general data\n applyDataToEvent(event, data);\n\n // We want to set the trace context for normal events only if there isn't already\n // a trace context on the event. There is a product feature in place where we link\n // errors with transaction and it relies on that.\n if (span) {\n applySpanToEvent(event, span);\n }\n\n applyFingerprintToEvent(event, fingerprint);\n applyBreadcrumbsToEvent(event, breadcrumbs);\n applySdkMetadataToEvent(event, sdkProcessingMetadata);\n}\n\n/** Merge data of two scopes together. */\nexport function mergeScopeData(data: ScopeData, mergeData: ScopeData): void {\n const {\n extra,\n tags,\n user,\n contexts,\n level,\n sdkProcessingMetadata,\n breadcrumbs,\n fingerprint,\n eventProcessors,\n attachments,\n propagationContext,\n // eslint-disable-next-line deprecation/deprecation\n transactionName,\n span,\n } = mergeData;\n\n mergeAndOverwriteScopeData(data, 'extra', extra);\n mergeAndOverwriteScopeData(data, 'tags', tags);\n mergeAndOverwriteScopeData(data, 'user', user);\n mergeAndOverwriteScopeData(data, 'contexts', contexts);\n mergeAndOverwriteScopeData(data, 'sdkProcessingMetadata', sdkProcessingMetadata);\n\n if (level) {\n data.level = level;\n }\n\n if (transactionName) {\n // eslint-disable-next-line deprecation/deprecation\n data.transactionName = transactionName;\n }\n\n if (span) {\n data.span = span;\n }\n\n if (breadcrumbs.length) {\n data.breadcrumbs = [...data.breadcrumbs, ...breadcrumbs];\n }\n\n if (fingerprint.length) {\n data.fingerprint = [...data.fingerprint, ...fingerprint];\n }\n\n if (eventProcessors.length) {\n data.eventProcessors = [...data.eventProcessors, ...eventProcessors];\n }\n\n if (attachments.length) {\n data.attachments = [...data.attachments, ...attachments];\n }\n\n data.propagationContext = { ...data.propagationContext, ...propagationContext };\n}\n\n/**\n * Merges certain scope data. Undefined values will overwrite any existing values.\n * Exported only for tests.\n */\nexport function mergeAndOverwriteScopeData<\n Prop extends 'extra' | 'tags' | 'user' | 'contexts' | 'sdkProcessingMetadata',\n Data extends ScopeData,\n>(data: Data, prop: Prop, mergeVal: Data[Prop]): void {\n if (mergeVal && Object.keys(mergeVal).length) {\n // Clone object\n data[prop] = { ...data[prop] };\n for (const key in mergeVal) {\n if (Object.prototype.hasOwnProperty.call(mergeVal, key)) {\n data[prop][key] = mergeVal[key];\n }\n }\n }\n}\n\n/** Exported only for tests */\nexport function mergeArray<Prop extends 'breadcrumbs' | 'fingerprint'>(\n event: Event,\n prop: Prop,\n mergeVal: ScopeData[Prop],\n): void {\n const prevVal = event[prop];\n // If we are not merging any new values,\n // we only need to proceed if there was an empty array before (as we want to replace it with undefined)\n if (!mergeVal.length && (!prevVal || prevVal.length)) {\n return;\n }\n\n const merged = [...(prevVal || []), ...mergeVal] as ScopeData[Prop];\n event[prop] = merged.length ? merged : undefined;\n}\n\nfunction applyDataToEvent(event: Event, data: ScopeData): void {\n const {\n extra,\n tags,\n user,\n contexts,\n level,\n // eslint-disable-next-line deprecation/deprecation\n transactionName,\n } = data;\n\n const cleanedExtra = dropUndefinedKeys(extra);\n if (cleanedExtra && Object.keys(cleanedExtra).length) {\n event.extra = { ...cleanedExtra, ...event.extra };\n }\n\n const cleanedTags = dropUndefinedKeys(tags);\n if (cleanedTags && Object.keys(cleanedTags).length) {\n event.tags = { ...cleanedTags, ...event.tags };\n }\n\n const cleanedUser = dropUndefinedKeys(user);\n if (cleanedUser && Object.keys(cleanedUser).length) {\n event.user = { ...cleanedUser, ...event.user };\n }\n\n const cleanedContexts = dropUndefinedKeys(contexts);\n if (cleanedContexts && Object.keys(cleanedContexts).length) {\n event.contexts = { ...cleanedContexts, ...event.contexts };\n }\n\n if (level) {\n event.level = level;\n }\n\n if (transactionName) {\n event.transaction = transactionName;\n }\n}\n\nfunction applyBreadcrumbsToEvent(event: Event, breadcrumbs: Breadcrumb[]): void {\n const mergedBreadcrumbs = [...(event.breadcrumbs || []), ...breadcrumbs];\n event.breadcrumbs = mergedBreadcrumbs.length ? mergedBreadcrumbs : undefined;\n}\n\nfunction applySdkMetadataToEvent(event: Event, sdkProcessingMetadata: ScopeData['sdkProcessingMetadata']): void {\n event.sdkProcessingMetadata = {\n ...event.sdkProcessingMetadata,\n ...sdkProcessingMetadata,\n };\n}\n\nfunction applySpanToEvent(event: Event, span: Span): void {\n event.contexts = { trace: spanToTraceContext(span), ...event.contexts };\n const rootSpan = getRootSpan(span);\n if (rootSpan) {\n event.sdkProcessingMetadata = {\n dynamicSamplingContext: getDynamicSamplingContextFromSpan(span),\n ...event.sdkProcessingMetadata,\n };\n const transactionName = spanToJSON(rootSpan).description;\n if (transactionName) {\n event.tags = { transaction: transactionName, ...event.tags };\n }\n }\n}\n\n/**\n * Applies fingerprint from the scope to the event if there's one,\n * uses message if there's one instead or get rid of empty fingerprint\n */\nfunction applyFingerprintToEvent(event: Event, fingerprint: ScopeData['fingerprint'] | undefined): void {\n // Make sure it's an array first and we actually have something in place\n event.fingerprint = event.fingerprint ? arrayify(event.fingerprint) : [];\n\n // If we have something on the scope, then merge it with event\n if (fingerprint) {\n event.fingerprint = event.fingerprint.concat(fingerprint);\n }\n\n // If we have no data at all, remove empty array default\n if (event.fingerprint && !event.fingerprint.length) {\n delete event.fingerprint;\n }\n}\n", "/* eslint-disable max-lines */\nimport type {\n Attachment,\n Breadcrumb,\n CaptureContext,\n Client,\n Context,\n Contexts,\n Event,\n EventHint,\n EventProcessor,\n Extra,\n Extras,\n Primitive,\n PropagationContext,\n RequestSession,\n Scope as ScopeInterface,\n ScopeContext,\n ScopeData,\n Session,\n Severity,\n SeverityLevel,\n Span,\n Transaction,\n User,\n} from '@sentry/types';\nimport { dateTimestampInSeconds, isPlainObject, logger, uuid4 } from '@sentry/utils';\n\nimport { getGlobalEventProcessors, notifyEventProcessors } from './eventProcessors';\nimport { updateSession } from './session';\nimport { applyScopeDataToEvent } from './utils/applyScopeDataToEvent';\n\n/**\n * Default value for maximum number of breadcrumbs added to an event.\n */\nconst DEFAULT_MAX_BREADCRUMBS = 100;\n\n/**\n * The global scope is kept in this module.\n * When accessing this via `getGlobalScope()` we'll make sure to set one if none is currently present.\n */\nlet globalScope: ScopeInterface | undefined;\n\n/**\n * Holds additional event information. {@link Scope.applyToEvent} will be\n * called by the client before an event will be sent.\n */\nexport class Scope implements ScopeInterface {\n /** Flag if notifying is happening. */\n protected _notifyingListeners: boolean;\n\n /** Callback for client to receive scope changes. */\n protected _scopeListeners: Array<(scope: Scope) => void>;\n\n /** Callback list that will be called after {@link applyToEvent}. */\n protected _eventProcessors: EventProcessor[];\n\n /** Array of breadcrumbs. */\n protected _breadcrumbs: Breadcrumb[];\n\n /** User */\n protected _user: User;\n\n /** Tags */\n protected _tags: { [key: string]: Primitive };\n\n /** Extra */\n protected _extra: Extras;\n\n /** Contexts */\n protected _contexts: Contexts;\n\n /** Attachments */\n protected _attachments: Attachment[];\n\n /** Propagation Context for distributed tracing */\n protected _propagationContext: PropagationContext;\n\n /**\n * A place to stash data which is needed at some point in the SDK's event processing pipeline but which shouldn't get\n * sent to Sentry\n */\n protected _sdkProcessingMetadata: { [key: string]: unknown };\n\n /** Fingerprint */\n protected _fingerprint?: string[];\n\n /** Severity */\n // eslint-disable-next-line deprecation/deprecation\n protected _level?: Severity | SeverityLevel;\n\n /**\n * Transaction Name\n */\n protected _transactionName?: string;\n\n /** Span */\n protected _span?: Span;\n\n /** Session */\n protected _session?: Session;\n\n /** Request Mode Session Status */\n protected _requestSession?: RequestSession;\n\n /** The client on this scope */\n protected _client?: Client;\n\n // NOTE: Any field which gets added here should get added not only to the constructor but also to the `clone` method.\n\n public constructor() {\n this._notifyingListeners = false;\n this._scopeListeners = [];\n this._eventProcessors = [];\n this._breadcrumbs = [];\n this._attachments = [];\n this._user = {};\n this._tags = {};\n this._extra = {};\n this._contexts = {};\n this._sdkProcessingMetadata = {};\n this._propagationContext = generatePropagationContext();\n }\n\n /**\n * Inherit values from the parent scope.\n * @deprecated Use `scope.clone()` and `new Scope()` instead.\n */\n public static clone(scope?: Scope): Scope {\n return scope ? scope.clone() : new Scope();\n }\n\n /**\n * Clone this scope instance.\n */\n public clone(): Scope {\n const newScope = new Scope();\n newScope._breadcrumbs = [...this._breadcrumbs];\n newScope._tags = { ...this._tags };\n newScope._extra = { ...this._extra };\n newScope._contexts = { ...this._contexts };\n newScope._user = this._user;\n newScope._level = this._level;\n newScope._span = this._span;\n newScope._session = this._session;\n newScope._transactionName = this._transactionName;\n newScope._fingerprint = this._fingerprint;\n newScope._eventProcessors = [...this._eventProcessors];\n newScope._requestSession = this._requestSession;\n newScope._attachments = [...this._attachments];\n newScope._sdkProcessingMetadata = { ...this._sdkProcessingMetadata };\n newScope._propagationContext = { ...this._propagationContext };\n newScope._client = this._client;\n\n return newScope;\n }\n\n /** Update the client on the scope. */\n public setClient(client: Client | undefined): void {\n this._client = client;\n }\n\n /**\n * Get the client assigned to this scope.\n *\n * It is generally recommended to use the global function `Sentry.getClient()` instead, unless you know what you are doing.\n */\n public getClient(): Client | undefined {\n return this._client;\n }\n\n /**\n * Add internal on change listener. Used for sub SDKs that need to store the scope.\n * @hidden\n */\n public addScopeListener(callback: (scope: Scope) => void): void {\n this._scopeListeners.push(callback);\n }\n\n /**\n * @inheritDoc\n */\n public addEventProcessor(callback: EventProcessor): this {\n this._eventProcessors.push(callback);\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setUser(user: User | null): this {\n // If null is passed we want to unset everything, but still define keys,\n // so that later down in the pipeline any existing values are cleared.\n this._user = user || {\n email: undefined,\n id: undefined,\n ip_address: undefined,\n segment: undefined,\n username: undefined,\n };\n\n if (this._session) {\n updateSession(this._session, { user });\n }\n\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public getUser(): User | undefined {\n return this._user;\n }\n\n /**\n * @inheritDoc\n */\n public getRequestSession(): RequestSession | undefined {\n return this._requestSession;\n }\n\n /**\n * @inheritDoc\n */\n public setRequestSession(requestSession?: RequestSession): this {\n this._requestSession = requestSession;\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setTags(tags: { [key: string]: Primitive }): this {\n this._tags = {\n ...this._tags,\n ...tags,\n };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setTag(key: string, value: Primitive): this {\n this._tags = { ...this._tags, [key]: value };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setExtras(extras: Extras): this {\n this._extra = {\n ...this._extra,\n ...extras,\n };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setExtra(key: string, extra: Extra): this {\n this._extra = { ...this._extra, [key]: extra };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setFingerprint(fingerprint: string[]): this {\n this._fingerprint = fingerprint;\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setLevel(\n // eslint-disable-next-line deprecation/deprecation\n level: Severity | SeverityLevel,\n ): this {\n this._level = level;\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * Sets the transaction name on the scope for future events.\n */\n public setTransactionName(name?: string): this {\n this._transactionName = name;\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setContext(key: string, context: Context | null): this {\n if (context === null) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete this._contexts[key];\n } else {\n this._contexts[key] = context;\n }\n\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * Sets the Span on the scope.\n * @param span Span\n * @deprecated Instead of setting a span on a scope, use `startSpan()`/`startSpanManual()` instead.\n */\n public setSpan(span?: Span): this {\n this._span = span;\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * Returns the `Span` if there is one.\n * @deprecated Use `getActiveSpan()` instead.\n */\n public getSpan(): Span | undefined {\n return this._span;\n }\n\n /**\n * Returns the `Transaction` attached to the scope (if there is one).\n * @deprecated You should not rely on the transaction, but just use `startSpan()` APIs instead.\n */\n public getTransaction(): Transaction | undefined {\n // Often, this span (if it exists at all) will be a transaction, but it's not guaranteed to be. Regardless, it will\n // have a pointer to the currently-active transaction.\n const span = this._span;\n // Cannot replace with getRootSpan because getRootSpan returns a span, not a transaction\n // Also, this method will be removed anyway.\n // eslint-disable-next-line deprecation/deprecation\n return span && span.transaction;\n }\n\n /**\n * @inheritDoc\n */\n public setSession(session?: Session): this {\n if (!session) {\n delete this._session;\n } else {\n this._session = session;\n }\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public getSession(): Session | undefined {\n return this._session;\n }\n\n /**\n * @inheritDoc\n */\n public update(captureContext?: CaptureContext): this {\n if (!captureContext) {\n return this;\n }\n\n const scopeToMerge = typeof captureContext === 'function' ? captureContext(this) : captureContext;\n\n if (scopeToMerge instanceof Scope) {\n const scopeData = scopeToMerge.getScopeData();\n\n this._tags = { ...this._tags, ...scopeData.tags };\n this._extra = { ...this._extra, ...scopeData.extra };\n this._contexts = { ...this._contexts, ...scopeData.contexts };\n if (scopeData.user && Object.keys(scopeData.user).length) {\n this._user = scopeData.user;\n }\n if (scopeData.level) {\n this._level = scopeData.level;\n }\n if (scopeData.fingerprint.length) {\n this._fingerprint = scopeData.fingerprint;\n }\n if (scopeToMerge.getRequestSession()) {\n this._requestSession = scopeToMerge.getRequestSession();\n }\n if (scopeData.propagationContext) {\n this._propagationContext = scopeData.propagationContext;\n }\n } else if (isPlainObject(scopeToMerge)) {\n const scopeContext = captureContext as ScopeContext;\n this._tags = { ...this._tags, ...scopeContext.tags };\n this._extra = { ...this._extra, ...scopeContext.extra };\n this._contexts = { ...this._contexts, ...scopeContext.contexts };\n if (scopeContext.user) {\n this._user = scopeContext.user;\n }\n if (scopeContext.level) {\n this._level = scopeContext.level;\n }\n if (scopeContext.fingerprint) {\n this._fingerprint = scopeContext.fingerprint;\n }\n if (scopeContext.requestSession) {\n this._requestSession = scopeContext.requestSession;\n }\n if (scopeContext.propagationContext) {\n this._propagationContext = scopeContext.propagationContext;\n }\n }\n\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public clear(): this {\n this._breadcrumbs = [];\n this._tags = {};\n this._extra = {};\n this._user = {};\n this._contexts = {};\n this._level = undefined;\n this._transactionName = undefined;\n this._fingerprint = undefined;\n this._requestSession = undefined;\n this._span = undefined;\n this._session = undefined;\n this._notifyScopeListeners();\n this._attachments = [];\n this._propagationContext = generatePropagationContext();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public addBreadcrumb(breadcrumb: Breadcrumb, maxBreadcrumbs?: number): this {\n const maxCrumbs = typeof maxBreadcrumbs === 'number' ? maxBreadcrumbs : DEFAULT_MAX_BREADCRUMBS;\n\n // No data has been changed, so don't notify scope listeners\n if (maxCrumbs <= 0) {\n return this;\n }\n\n const mergedBreadcrumb = {\n timestamp: dateTimestampInSeconds(),\n ...breadcrumb,\n };\n\n const breadcrumbs = this._breadcrumbs;\n breadcrumbs.push(mergedBreadcrumb);\n this._breadcrumbs = breadcrumbs.length > maxCrumbs ? breadcrumbs.slice(-maxCrumbs) : breadcrumbs;\n\n this._notifyScopeListeners();\n\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public getLastBreadcrumb(): Breadcrumb | undefined {\n return this._breadcrumbs[this._breadcrumbs.length - 1];\n }\n\n /**\n * @inheritDoc\n */\n public clearBreadcrumbs(): this {\n this._breadcrumbs = [];\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public addAttachment(attachment: Attachment): this {\n this._attachments.push(attachment);\n return this;\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `getScopeData()` instead.\n */\n public getAttachments(): Attachment[] {\n const data = this.getScopeData();\n\n return data.attachments;\n }\n\n /**\n * @inheritDoc\n */\n public clearAttachments(): this {\n this._attachments = [];\n return this;\n }\n\n /** @inheritDoc */\n public getScopeData(): ScopeData {\n const {\n _breadcrumbs,\n _attachments,\n _contexts,\n _tags,\n _extra,\n _user,\n _level,\n _fingerprint,\n _eventProcessors,\n _propagationContext,\n _sdkProcessingMetadata,\n _transactionName,\n _span,\n } = this;\n\n return {\n breadcrumbs: _breadcrumbs,\n attachments: _attachments,\n contexts: _contexts,\n tags: _tags,\n extra: _extra,\n user: _user,\n level: _level,\n fingerprint: _fingerprint || [],\n eventProcessors: _eventProcessors,\n propagationContext: _propagationContext,\n sdkProcessingMetadata: _sdkProcessingMetadata,\n transactionName: _transactionName,\n span: _span,\n };\n }\n\n /**\n * Applies data from the scope to the event and runs all event processors on it.\n *\n * @param event Event\n * @param hint Object containing additional information about the original exception, for use by the event processors.\n * @hidden\n * @deprecated Use `applyScopeDataToEvent()` directly\n */\n public applyToEvent(\n event: Event,\n hint: EventHint = {},\n additionalEventProcessors: EventProcessor[] = [],\n ): PromiseLike<Event | null> {\n applyScopeDataToEvent(event, this.getScopeData());\n\n // TODO (v8): Update this order to be: Global > Client > Scope\n const eventProcessors: EventProcessor[] = [\n ...additionalEventProcessors,\n // eslint-disable-next-line deprecation/deprecation\n ...getGlobalEventProcessors(),\n ...this._eventProcessors,\n ];\n\n return notifyEventProcessors(eventProcessors, event, hint);\n }\n\n /**\n * Add data which will be accessible during event processing but won't get sent to Sentry\n */\n public setSDKProcessingMetadata(newData: { [key: string]: unknown }): this {\n this._sdkProcessingMetadata = { ...this._sdkProcessingMetadata, ...newData };\n\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setPropagationContext(context: PropagationContext): this {\n this._propagationContext = context;\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public getPropagationContext(): PropagationContext {\n return this._propagationContext;\n }\n\n /**\n * Capture an exception for this scope.\n *\n * @param exception The exception to capture.\n * @param hint Optinal additional data to attach to the Sentry event.\n * @returns the id of the captured Sentry event.\n */\n public captureException(exception: unknown, hint?: EventHint): string {\n const eventId = hint && hint.event_id ? hint.event_id : uuid4();\n\n if (!this._client) {\n logger.warn('No client configured on scope - will not capture exception!');\n return eventId;\n }\n\n const syntheticException = new Error('Sentry syntheticException');\n\n this._client.captureException(\n exception,\n {\n originalException: exception,\n syntheticException,\n ...hint,\n event_id: eventId,\n },\n this,\n );\n\n return eventId;\n }\n\n /**\n * Capture a message for this scope.\n *\n * @param message The message to capture.\n * @param level An optional severity level to report the message with.\n * @param hint Optional additional data to attach to the Sentry event.\n * @returns the id of the captured message.\n */\n public captureMessage(message: string, level?: SeverityLevel, hint?: EventHint): string {\n const eventId = hint && hint.event_id ? hint.event_id : uuid4();\n\n if (!this._client) {\n logger.warn('No client configured on scope - will not capture message!');\n return eventId;\n }\n\n const syntheticException = new Error(message);\n\n this._client.captureMessage(\n message,\n level,\n {\n originalException: message,\n syntheticException,\n ...hint,\n event_id: eventId,\n },\n this,\n );\n\n return eventId;\n }\n\n /**\n * Captures a manually created event for this scope and sends it to Sentry.\n *\n * @param exception The event to capture.\n * @param hint Optional additional data to attach to the Sentry event.\n * @returns the id of the captured event.\n */\n public captureEvent(event: Event, hint?: EventHint): string {\n const eventId = hint && hint.event_id ? hint.event_id : uuid4();\n\n if (!this._client) {\n logger.warn('No client configured on scope - will not capture event!');\n return eventId;\n }\n\n this._client.captureEvent(event, { ...hint, event_id: eventId }, this);\n\n return eventId;\n }\n\n /**\n * This will be called on every set call.\n */\n protected _notifyScopeListeners(): void {\n // We need this check for this._notifyingListeners to be able to work on scope during updates\n // If this check is not here we'll produce endless recursion when something is done with the scope\n // during the callback.\n if (!this._notifyingListeners) {\n this._notifyingListeners = true;\n this._scopeListeners.forEach(callback => {\n callback(this);\n });\n this._notifyingListeners = false;\n }\n }\n}\n\n/**\n * Get the global scope.\n * This scope is applied to _all_ events.\n */\nexport function getGlobalScope(): ScopeInterface {\n if (!globalScope) {\n globalScope = new Scope();\n }\n\n return globalScope;\n}\n\n/**\n * This is mainly needed for tests.\n * DO NOT USE this, as this is an internal API and subject to change.\n * @hidden\n */\nexport function setGlobalScope(scope: ScopeInterface | undefined): void {\n globalScope = scope;\n}\n\nfunction generatePropagationContext(): PropagationContext {\n return {\n traceId: uuid4(),\n spanId: uuid4().substring(16),\n };\n}\n", "export const SDK_VERSION = '7.119.2';\n", "/* eslint-disable max-lines */\nimport type {\n Breadcrumb,\n BreadcrumbHint,\n Client,\n CustomSamplingContext,\n Event,\n EventHint,\n Extra,\n Extras,\n Hub as HubInterface,\n Integration,\n IntegrationClass,\n Primitive,\n Session,\n SessionContext,\n Severity,\n SeverityLevel,\n Transaction,\n TransactionContext,\n User,\n} from '@sentry/types';\nimport {\n GLOBAL_OBJ,\n consoleSandbox,\n dateTimestampInSeconds,\n getGlobalSingleton,\n isThenable,\n logger,\n uuid4,\n} from '@sentry/utils';\n\nimport { DEFAULT_ENVIRONMENT } from './constants';\nimport { DEBUG_BUILD } from './debug-build';\nimport { Scope } from './scope';\nimport { closeSession, makeSession, updateSession } from './session';\nimport { SDK_VERSION } from './version';\n\n/**\n * API compatibility version of this hub.\n *\n * WARNING: This number should only be increased when the global interface\n * changes and new methods are introduced.\n *\n * @hidden\n */\nexport const API_VERSION = parseFloat(SDK_VERSION);\n\n/**\n * Default maximum number of breadcrumbs added to an event. Can be overwritten\n * with {@link Options.maxBreadcrumbs}.\n */\nconst DEFAULT_BREADCRUMBS = 100;\n\nexport interface RunWithAsyncContextOptions {\n /** Whether to reuse an existing async context if one exists. Defaults to false. */\n reuseExisting?: boolean;\n}\n\n/**\n * @private Private API with no semver guarantees!\n *\n * Strategy used to track async context.\n */\nexport interface AsyncContextStrategy {\n /**\n * Gets the current async context. Returns undefined if there is no current async context.\n */\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub: () => Hub | undefined;\n /**\n * Runs the supplied callback in its own async context.\n */\n runWithAsyncContext<T>(callback: () => T, options: RunWithAsyncContextOptions): T;\n}\n\n/**\n * A layer in the process stack.\n * @hidden\n */\nexport interface Layer {\n client?: Client;\n scope: Scope;\n}\n\n/**\n * An object that contains a hub and maintains a scope stack.\n * @hidden\n */\nexport interface Carrier {\n __SENTRY__?: {\n // eslint-disable-next-line deprecation/deprecation\n hub?: Hub;\n acs?: AsyncContextStrategy;\n /**\n * Extra Hub properties injected by various SDKs\n */\n integrations?: Integration[];\n extensions?: {\n /** Extension methods for the hub, which are bound to the current Hub instance */\n // eslint-disable-next-line @typescript-eslint/ban-types\n [key: string]: Function;\n };\n };\n}\n\n/**\n * @deprecated The `Hub` class will be removed in version 8 of the SDK in favour of `Scope` and `Client` objects.\n *\n * If you previously used the `Hub` class directly, replace it with `Scope` and `Client` objects. More information:\n * - [Multiple Sentry Instances](https://docs.sentry.io/platforms/javascript/best-practices/multiple-sentry-instances/)\n * - [Browser Extensions](https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/)\n *\n * Some of our APIs are typed with the Hub class instead of the interface (e.g. `getCurrentHub`). Most of them are deprecated\n * themselves and will also be removed in version 8. More information:\n * - [Migration Guide](https://github.com/getsentry/sentry-javascript/blob/develop/MIGRATION.md#deprecate-hub)\n */\n// eslint-disable-next-line deprecation/deprecation\nexport class Hub implements HubInterface {\n /** Is a {@link Layer}[] containing the client and scope */\n private readonly _stack: Layer[];\n\n /** Contains the last event id of a captured event. */\n private _lastEventId?: string;\n\n private _isolationScope: Scope;\n\n /**\n * Creates a new instance of the hub, will push one {@link Layer} into the\n * internal stack on creation.\n *\n * @param client bound to the hub.\n * @param scope bound to the hub.\n * @param version number, higher number means higher priority.\n *\n * @deprecated Instantiation of Hub objects is deprecated and the constructor will be removed in version 8 of the SDK.\n *\n * If you are currently using the Hub for multi-client use like so:\n *\n * ```\n * // OLD\n * const hub = new Hub();\n * hub.bindClient(client);\n * makeMain(hub)\n * ```\n *\n * instead initialize the client as follows:\n *\n * ```\n * // NEW\n * Sentry.withIsolationScope(() => {\n * Sentry.setCurrentClient(client);\n * client.init();\n * });\n * ```\n *\n * If you are using the Hub to capture events like so:\n *\n * ```\n * // OLD\n * const client = new Client();\n * const hub = new Hub(client);\n * hub.captureException()\n * ```\n *\n * instead capture isolated events as follows:\n *\n * ```\n * // NEW\n * const client = new Client();\n * const scope = new Scope();\n * scope.setClient(client);\n * scope.captureException();\n * ```\n */\n public constructor(\n client?: Client,\n scope?: Scope,\n isolationScope?: Scope,\n private readonly _version: number = API_VERSION,\n ) {\n let assignedScope;\n if (!scope) {\n assignedScope = new Scope();\n assignedScope.setClient(client);\n } else {\n assignedScope = scope;\n }\n\n let assignedIsolationScope;\n if (!isolationScope) {\n assignedIsolationScope = new Scope();\n assignedIsolationScope.setClient(client);\n } else {\n assignedIsolationScope = isolationScope;\n }\n\n this._stack = [{ scope: assignedScope }];\n\n if (client) {\n // eslint-disable-next-line deprecation/deprecation\n this.bindClient(client);\n }\n\n this._isolationScope = assignedIsolationScope;\n }\n\n /**\n * Checks if this hub's version is older than the given version.\n *\n * @param version A version number to compare to.\n * @return True if the given version is newer; otherwise false.\n *\n * @deprecated This will be removed in v8.\n */\n public isOlderThan(version: number): boolean {\n return this._version < version;\n }\n\n /**\n * This binds the given client to the current scope.\n * @param client An SDK client (client) instance.\n *\n * @deprecated Use `initAndBind()` directly, or `setCurrentClient()` and/or `client.init()` instead.\n */\n public bindClient(client?: Client): void {\n // eslint-disable-next-line deprecation/deprecation\n const top = this.getStackTop();\n top.client = client;\n top.scope.setClient(client);\n // eslint-disable-next-line deprecation/deprecation\n if (client && client.setupIntegrations) {\n // eslint-disable-next-line deprecation/deprecation\n client.setupIntegrations();\n }\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `withScope` instead.\n */\n public pushScope(): Scope {\n // We want to clone the content of prev scope\n // eslint-disable-next-line deprecation/deprecation\n const scope = this.getScope().clone();\n // eslint-disable-next-line deprecation/deprecation\n this.getStack().push({\n // eslint-disable-next-line deprecation/deprecation\n client: this.getClient(),\n scope,\n });\n return scope;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `withScope` instead.\n */\n public popScope(): boolean {\n // eslint-disable-next-line deprecation/deprecation\n if (this.getStack().length <= 1) return false;\n // eslint-disable-next-line deprecation/deprecation\n return !!this.getStack().pop();\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `Sentry.withScope()` instead.\n */\n public withScope<T>(callback: (scope: Scope) => T): T {\n // eslint-disable-next-line deprecation/deprecation\n const scope = this.pushScope();\n\n let maybePromiseResult: T;\n try {\n maybePromiseResult = callback(scope);\n } catch (e) {\n // eslint-disable-next-line deprecation/deprecation\n this.popScope();\n throw e;\n }\n\n if (isThenable(maybePromiseResult)) {\n // @ts-expect-error - isThenable returns the wrong type\n return maybePromiseResult.then(\n res => {\n // eslint-disable-next-line deprecation/deprecation\n this.popScope();\n return res;\n },\n e => {\n // eslint-disable-next-line deprecation/deprecation\n this.popScope();\n throw e;\n },\n );\n }\n\n // eslint-disable-next-line deprecation/deprecation\n this.popScope();\n return maybePromiseResult;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `Sentry.getClient()` instead.\n */\n public getClient<C extends Client>(): C | undefined {\n // eslint-disable-next-line deprecation/deprecation\n return this.getStackTop().client as C;\n }\n\n /**\n * Returns the scope of the top stack.\n *\n * @deprecated Use `Sentry.getCurrentScope()` instead.\n */\n public getScope(): Scope {\n // eslint-disable-next-line deprecation/deprecation\n return this.getStackTop().scope;\n }\n\n /**\n * @deprecated Use `Sentry.getIsolationScope()` instead.\n */\n public getIsolationScope(): Scope {\n return this._isolationScope;\n }\n\n /**\n * Returns the scope stack for domains or the process.\n * @deprecated This will be removed in v8.\n */\n public getStack(): Layer[] {\n return this._stack;\n }\n\n /**\n * Returns the topmost scope layer in the order domain > local > process.\n * @deprecated This will be removed in v8.\n */\n public getStackTop(): Layer {\n return this._stack[this._stack.length - 1];\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `Sentry.captureException()` instead.\n */\n public captureException(exception: unknown, hint?: EventHint): string {\n const eventId = (this._lastEventId = hint && hint.event_id ? hint.event_id : uuid4());\n const syntheticException = new Error('Sentry syntheticException');\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().captureException(exception, {\n originalException: exception,\n syntheticException,\n ...hint,\n event_id: eventId,\n });\n\n return eventId;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `Sentry.captureMessage()` instead.\n */\n public captureMessage(\n message: string,\n // eslint-disable-next-line deprecation/deprecation\n level?: Severity | SeverityLevel,\n hint?: EventHint,\n ): string {\n const eventId = (this._lastEventId = hint && hint.event_id ? hint.event_id : uuid4());\n const syntheticException = new Error(message);\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().captureMessage(message, level, {\n originalException: message,\n syntheticException,\n ...hint,\n event_id: eventId,\n });\n\n return eventId;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `Sentry.captureEvent()` instead.\n */\n public captureEvent(event: Event, hint?: EventHint): string {\n const eventId = hint && hint.event_id ? hint.event_id : uuid4();\n if (!event.type) {\n this._lastEventId = eventId;\n }\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().captureEvent(event, { ...hint, event_id: eventId });\n return eventId;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated This will be removed in v8.\n */\n public lastEventId(): string | undefined {\n return this._lastEventId;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `Sentry.addBreadcrumb()` instead.\n */\n public addBreadcrumb(breadcrumb: Breadcrumb, hint?: BreadcrumbHint): void {\n // eslint-disable-next-line deprecation/deprecation\n const { scope, client } = this.getStackTop();\n\n if (!client) return;\n\n const { beforeBreadcrumb = null, maxBreadcrumbs = DEFAULT_BREADCRUMBS } =\n (client.getOptions && client.getOptions()) || {};\n\n if (maxBreadcrumbs <= 0) return;\n\n const timestamp = dateTimestampInSeconds();\n const mergedBreadcrumb = { timestamp, ...breadcrumb };\n const finalBreadcrumb = beforeBreadcrumb\n ? (consoleSandbox(() => beforeBreadcrumb(mergedBreadcrumb, hint)) as Breadcrumb | null)\n : mergedBreadcrumb;\n\n if (finalBreadcrumb === null) return;\n\n if (client.emit) {\n client.emit('beforeAddBreadcrumb', finalBreadcrumb, hint);\n }\n\n // TODO(v8): I know this comment doesn't make much sense because the hub will be deprecated but I still wanted to\n // write it down. In theory, we would have to add the breadcrumbs to the isolation scope here, however, that would\n // duplicate all of the breadcrumbs. There was the possibility of adding breadcrumbs to both, the isolation scope\n // and the normal scope, and deduplicating it down the line in the event processing pipeline. However, that would\n // have been very fragile, because the breadcrumb objects would have needed to keep their identity all throughout\n // the event processing pipeline.\n // In the new implementation, the top level `Sentry.addBreadcrumb()` should ONLY write to the isolation scope.\n\n scope.addBreadcrumb(finalBreadcrumb, maxBreadcrumbs);\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `Sentry.setUser()` instead.\n */\n public setUser(user: User | null): void {\n // TODO(v8): The top level `Sentry.setUser()` function should write ONLY to the isolation scope.\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().setUser(user);\n // eslint-disable-next-line deprecation/deprecation\n this.getIsolationScope().setUser(user);\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `Sentry.setTags()` instead.\n */\n public setTags(tags: { [key: string]: Primitive }): void {\n // TODO(v8): The top level `Sentry.setTags()` function should write ONLY to the isolation scope.\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().setTags(tags);\n // eslint-disable-next-line deprecation/deprecation\n this.getIsolationScope().setTags(tags);\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `Sentry.setExtras()` instead.\n */\n public setExtras(extras: Extras): void {\n // TODO(v8): The top level `Sentry.setExtras()` function should write ONLY to the isolation scope.\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().setExtras(extras);\n // eslint-disable-next-line deprecation/deprecation\n this.getIsolationScope().setExtras(extras);\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `Sentry.setTag()` instead.\n */\n public setTag(key: string, value: Primitive): void {\n // TODO(v8): The top level `Sentry.setTag()` function should write ONLY to the isolation scope.\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().setTag(key, value);\n // eslint-disable-next-line deprecation/deprecation\n this.getIsolationScope().setTag(key, value);\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `Sentry.setExtra()` instead.\n */\n public setExtra(key: string, extra: Extra): void {\n // TODO(v8): The top level `Sentry.setExtra()` function should write ONLY to the isolation scope.\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().setExtra(key, extra);\n // eslint-disable-next-line deprecation/deprecation\n this.getIsolationScope().setExtra(key, extra);\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `Sentry.setContext()` instead.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public setContext(name: string, context: { [key: string]: any } | null): void {\n // TODO(v8): The top level `Sentry.setContext()` function should write ONLY to the isolation scope.\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().setContext(name, context);\n // eslint-disable-next-line deprecation/deprecation\n this.getIsolationScope().setContext(name, context);\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `getScope()` directly.\n */\n public configureScope(callback: (scope: Scope) => void): void {\n // eslint-disable-next-line deprecation/deprecation\n const { scope, client } = this.getStackTop();\n if (client) {\n callback(scope);\n }\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line deprecation/deprecation\n public run(callback: (hub: Hub) => void): void {\n // eslint-disable-next-line deprecation/deprecation\n const oldHub = makeMain(this);\n try {\n callback(this);\n } finally {\n // eslint-disable-next-line deprecation/deprecation\n makeMain(oldHub);\n }\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `Sentry.getClient().getIntegrationByName()` instead.\n */\n public getIntegration<T extends Integration>(integration: IntegrationClass<T>): T | null {\n // eslint-disable-next-line deprecation/deprecation\n const client = this.getClient();\n if (!client) return null;\n try {\n // eslint-disable-next-line deprecation/deprecation\n return client.getIntegration(integration);\n } catch (_oO) {\n DEBUG_BUILD && logger.warn(`Cannot retrieve integration ${integration.id} from the current Hub`);\n return null;\n }\n }\n\n /**\n * Starts a new `Transaction` and returns it. This is the entry point to manual tracing instrumentation.\n *\n * A tree structure can be built by adding child spans to the transaction, and child spans to other spans. To start a\n * new child span within the transaction or any span, call the respective `.startChild()` method.\n *\n * Every child span must be finished before the transaction is finished, otherwise the unfinished spans are discarded.\n *\n * The transaction must be finished with a call to its `.end()` method, at which point the transaction with all its\n * finished child spans will be sent to Sentry.\n *\n * @param context Properties of the new `Transaction`.\n * @param customSamplingContext Information given to the transaction sampling function (along with context-dependent\n * default values). See {@link Options.tracesSampler}.\n *\n * @returns The transaction which was just started\n *\n * @deprecated Use `startSpan()`, `startSpanManual()` or `startInactiveSpan()` instead.\n */\n public startTransaction(context: TransactionContext, customSamplingContext?: CustomSamplingContext): Transaction {\n const result = this._callExtensionMethod<Transaction>('startTransaction', context, customSamplingContext);\n\n if (DEBUG_BUILD && !result) {\n // eslint-disable-next-line deprecation/deprecation\n const client = this.getClient();\n if (!client) {\n logger.warn(\n \"Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'\",\n );\n } else {\n logger.warn(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':\nSentry.addTracingExtensions();\nSentry.init({...});\n`);\n }\n }\n\n return result;\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `spanToTraceHeader()` instead.\n */\n public traceHeaders(): { [key: string]: string } {\n return this._callExtensionMethod<{ [key: string]: string }>('traceHeaders');\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use top level `captureSession` instead.\n */\n public captureSession(endSession: boolean = false): void {\n // both send the update and pull the session from the scope\n if (endSession) {\n // eslint-disable-next-line deprecation/deprecation\n return this.endSession();\n }\n\n // only send the update\n this._sendSessionUpdate();\n }\n\n /**\n * @inheritDoc\n * @deprecated Use top level `endSession` instead.\n */\n public endSession(): void {\n // eslint-disable-next-line deprecation/deprecation\n const layer = this.getStackTop();\n const scope = layer.scope;\n const session = scope.getSession();\n if (session) {\n closeSession(session);\n }\n this._sendSessionUpdate();\n\n // the session is over; take it off of the scope\n scope.setSession();\n }\n\n /**\n * @inheritDoc\n * @deprecated Use top level `startSession` instead.\n */\n public startSession(context?: SessionContext): Session {\n // eslint-disable-next-line deprecation/deprecation\n const { scope, client } = this.getStackTop();\n const { release, environment = DEFAULT_ENVIRONMENT } = (client && client.getOptions()) || {};\n\n // Will fetch userAgent if called from browser sdk\n const { userAgent } = GLOBAL_OBJ.navigator || {};\n\n const session = makeSession({\n release,\n environment,\n user: scope.getUser(),\n ...(userAgent && { userAgent }),\n ...context,\n });\n\n // End existing session if there's one\n const currentSession = scope.getSession && scope.getSession();\n if (currentSession && currentSession.status === 'ok') {\n updateSession(currentSession, { status: 'exited' });\n }\n // eslint-disable-next-line deprecation/deprecation\n this.endSession();\n\n // Afterwards we set the new session on the scope\n scope.setSession(session);\n\n return session;\n }\n\n /**\n * Returns if default PII should be sent to Sentry and propagated in ourgoing requests\n * when Tracing is used.\n *\n * @deprecated Use top-level `getClient().getOptions().sendDefaultPii` instead. This function\n * only unnecessarily increased API surface but only wrapped accessing the option.\n */\n public shouldSendDefaultPii(): boolean {\n // eslint-disable-next-line deprecation/deprecation\n const client = this.getClient();\n const options = client && client.getOptions();\n return Boolean(options && options.sendDefaultPii);\n }\n\n /**\n * Sends the current Session on the scope\n */\n private _sendSessionUpdate(): void {\n // eslint-disable-next-line deprecation/deprecation\n const { scope, client } = this.getStackTop();\n\n const session = scope.getSession();\n if (session && client && client.captureSession) {\n client.captureSession(session);\n }\n }\n\n /**\n * Calls global extension method and binding current instance to the function call\n */\n // @ts-expect-error Function lacks ending return statement and return type does not include 'undefined'. ts(2366)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _callExtensionMethod<T>(method: string, ...args: any[]): T {\n const carrier = getMainCarrier();\n const sentry = carrier.__SENTRY__;\n if (sentry && sentry.extensions && typeof sentry.extensions[method] === 'function') {\n return sentry.extensions[method].apply(this, args);\n }\n DEBUG_BUILD && logger.warn(`Extension method ${method} couldn't be found, doing nothing.`);\n }\n}\n\n/**\n * Returns the global shim registry.\n *\n * FIXME: This function is problematic, because despite always returning a valid Carrier,\n * it has an optional `__SENTRY__` property, which then in turn requires us to always perform an unnecessary check\n * at the call-site. We always access the carrier through this function, so we can guarantee that `__SENTRY__` is there.\n **/\nexport function getMainCarrier(): Carrier {\n GLOBAL_OBJ.__SENTRY__ = GLOBAL_OBJ.__SENTRY__ || {\n extensions: {},\n hub: undefined,\n };\n return GLOBAL_OBJ;\n}\n\n/**\n * Replaces the current main hub with the passed one on the global object\n *\n * @returns The old replaced hub\n *\n * @deprecated Use `setCurrentClient()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport function makeMain(hub: Hub): Hub {\n const registry = getMainCarrier();\n const oldHub = getHubFromCarrier(registry);\n setHubOnCarrier(registry, hub);\n return oldHub;\n}\n\n/**\n * Returns the default hub instance.\n *\n * If a hub is already registered in the global carrier but this module\n * contains a more recent version, it replaces the registered version.\n * Otherwise, the currently registered hub will be returned.\n *\n * @deprecated Use the respective replacement method directly instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport function getCurrentHub(): Hub {\n // Get main carrier (global for every environment)\n const registry = getMainCarrier();\n\n if (registry.__SENTRY__ && registry.__SENTRY__.acs) {\n const hub = registry.__SENTRY__.acs.getCurrentHub();\n\n if (hub) {\n return hub;\n }\n }\n\n // Return hub that lives on a global object\n return getGlobalHub(registry);\n}\n\n/**\n * Get the currently active isolation scope.\n * The isolation scope is active for the current exection context,\n * meaning that it will remain stable for the same Hub.\n */\nexport function getIsolationScope(): Scope {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().getIsolationScope();\n}\n\n// eslint-disable-next-line deprecation/deprecation\nfunction getGlobalHub(registry: Carrier = getMainCarrier()): Hub {\n // If there's no hub, or its an old API, assign a new one\n\n if (\n !hasHubOnCarrier(registry) ||\n // eslint-disable-next-line deprecation/deprecation\n getHubFromCarrier(registry).isOlderThan(API_VERSION)\n ) {\n // eslint-disable-next-line deprecation/deprecation\n setHubOnCarrier(registry, new Hub());\n }\n\n // Return hub that lives on a global object\n return getHubFromCarrier(registry);\n}\n\n/**\n * @private Private API with no semver guarantees!\n *\n * If the carrier does not contain a hub, a new hub is created with the global hub client and scope.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport function ensureHubOnCarrier(carrier: Carrier, parent: Hub = getGlobalHub()): void {\n // If there's no hub on current domain, or it's an old API, assign a new one\n if (\n !hasHubOnCarrier(carrier) ||\n // eslint-disable-next-line deprecation/deprecation\n getHubFromCarrier(carrier).isOlderThan(API_VERSION)\n ) {\n // eslint-disable-next-line deprecation/deprecation\n const client = parent.getClient();\n // eslint-disable-next-line deprecation/deprecation\n const scope = parent.getScope();\n // eslint-disable-next-line deprecation/deprecation\n const isolationScope = parent.getIsolationScope();\n // eslint-disable-next-line deprecation/deprecation\n setHubOnCarrier(carrier, new Hub(client, scope.clone(), isolationScope.clone()));\n }\n}\n\n/**\n * @private Private API with no semver guarantees!\n *\n * Sets the global async context strategy\n */\nexport function setAsyncContextStrategy(strategy: AsyncContextStrategy | undefined): void {\n // Get main carrier (global for every environment)\n const registry = getMainCarrier();\n registry.__SENTRY__ = registry.__SENTRY__ || {};\n registry.__SENTRY__.acs = strategy;\n}\n\n/**\n * Runs the supplied callback in its own async context. Async Context strategies are defined per SDK.\n *\n * @param callback The callback to run in its own async context\n * @param options Options to pass to the async context strategy\n * @returns The result of the callback\n */\nexport function runWithAsyncContext<T>(callback: () => T, options: RunWithAsyncContextOptions = {}): T {\n const registry = getMainCarrier();\n\n if (registry.__SENTRY__ && registry.__SENTRY__.acs) {\n return registry.__SENTRY__.acs.runWithAsyncContext(callback, options);\n }\n\n // if there was no strategy, fallback to just calling the callback\n return callback();\n}\n\n/**\n * This will tell whether a carrier has a hub on it or not\n * @param carrier object\n */\nfunction hasHubOnCarrier(carrier: Carrier): boolean {\n return !!(carrier && carrier.__SENTRY__ && carrier.__SENTRY__.hub);\n}\n\n/**\n * This will create a new {@link Hub} and add to the passed object on\n * __SENTRY__.hub.\n * @param carrier object\n * @hidden\n */\n// eslint-disable-next-line deprecation/deprecation\nexport function getHubFromCarrier(carrier: Carrier): Hub {\n // eslint-disable-next-line deprecation/deprecation\n return getGlobalSingleton<Hub>('hub', () => new Hub(), carrier);\n}\n\n/**\n * This will set passed {@link Hub} on the passed object's __SENTRY__.hub attribute\n * @param carrier object\n * @param hub Hub\n * @returns A boolean indicating success or failure\n */\n// eslint-disable-next-line deprecation/deprecation\nexport function setHubOnCarrier(carrier: Carrier, hub: Hub): boolean {\n if (!carrier) return false;\n const __SENTRY__ = (carrier.__SENTRY__ = carrier.__SENTRY__ || {});\n __SENTRY__.hub = hub;\n return true;\n}\n", "import type { Transaction } from '@sentry/types';\nimport { extractTraceparentData as _extractTraceparentData } from '@sentry/utils';\n\nimport type { Hub } from '../hub';\nimport { getCurrentHub } from '../hub';\n\n/**\n * Grabs active transaction off scope.\n *\n * @deprecated You should not rely on the transaction, but just use `startSpan()` APIs instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport function getActiveTransaction<T extends Transaction>(maybeHub?: Hub): T | undefined {\n // eslint-disable-next-line deprecation/deprecation\n const hub = maybeHub || getCurrentHub();\n // eslint-disable-next-line deprecation/deprecation\n const scope = hub.getScope();\n // eslint-disable-next-line deprecation/deprecation\n return scope.getTransaction() as T | undefined;\n}\n\n// so it can be used in manual instrumentation without necessitating a hard dependency on @sentry/utils\nexport { stripUrlQueryAndFragment } from '@sentry/utils';\n\n/**\n * The `extractTraceparentData` function and `TRACEPARENT_REGEXP` constant used\n * to be declared in this file. It was later moved into `@sentry/utils` as part of a\n * move to remove `@sentry/tracing` dependencies from `@sentry/node` (`extractTraceparentData`\n * is the only tracing function used by `@sentry/node`).\n *\n * These exports are kept here for backwards compatability's sake.\n *\n * See https://github.com/getsentry/sentry-javascript/issues/4642 for more details.\n *\n * @deprecated Import this function from `@sentry/utils` instead\n */\nexport const extractTraceparentData = _extractTraceparentData;\n", "import {\n addGlobalErrorInstrumentationHandler,\n addGlobalUnhandledRejectionInstrumentationHandler,\n logger,\n} from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../debug-build';\nimport type { SpanStatusType } from './spanstatus';\nimport { getActiveTransaction } from './utils';\n\nlet errorsInstrumented = false;\n\n/**\n * Configures global error listeners\n */\nexport function registerErrorInstrumentation(): void {\n if (errorsInstrumented) {\n return;\n }\n\n errorsInstrumented = true;\n addGlobalErrorInstrumentationHandler(errorCallback);\n addGlobalUnhandledRejectionInstrumentationHandler(errorCallback);\n}\n\n/**\n * If an error or unhandled promise occurs, we mark the active transaction as failed\n */\nfunction errorCallback(): void {\n // eslint-disable-next-line deprecation/deprecation\n const activeTransaction = getActiveTransaction();\n if (activeTransaction) {\n const status: SpanStatusType = 'internal_error';\n DEBUG_BUILD && logger.log(`[Tracing] Transaction: ${status} -> Global error occured`);\n activeTransaction.setStatus(status);\n }\n}\n\n// The function name will be lost when bundling but we need to be able to identify this listener later to maintain the\n// node.js default exit behaviour\nerrorCallback.tag = 'sentry_tracingErrorCallback';\n", "import type { Span } from '@sentry/types';\n\n/** The status of an Span.\n *\n * @deprecated Use string literals - if you require type casting, cast to SpanStatusType type\n */\nexport enum SpanStatus {\n /** The operation completed successfully. */\n Ok = 'ok',\n /** Deadline expired before operation could complete. */\n DeadlineExceeded = 'deadline_exceeded',\n /** 401 Unauthorized (actually does mean unauthenticated according to RFC 7235) */\n Unauthenticated = 'unauthenticated',\n /** 403 Forbidden */\n PermissionDenied = 'permission_denied',\n /** 404 Not Found. Some requested entity (file or directory) was not found. */\n NotFound = 'not_found',\n /** 429 Too Many Requests */\n ResourceExhausted = 'resource_exhausted',\n /** Client specified an invalid argument. 4xx. */\n InvalidArgument = 'invalid_argument',\n /** 501 Not Implemented */\n Unimplemented = 'unimplemented',\n /** 503 Service Unavailable */\n Unavailable = 'unavailable',\n /** Other/generic 5xx. */\n InternalError = 'internal_error',\n /** Unknown. Any non-standard HTTP status code. */\n UnknownError = 'unknown_error',\n /** The operation was cancelled (typically by the user). */\n Cancelled = 'cancelled',\n /** Already exists (409) */\n AlreadyExists = 'already_exists',\n /** Operation was rejected because the system is not in a state required for the operation's */\n FailedPrecondition = 'failed_precondition',\n /** The operation was aborted, typically due to a concurrency issue. */\n Aborted = 'aborted',\n /** Operation was attempted past the valid range. */\n OutOfRange = 'out_of_range',\n /** Unrecoverable data loss or corruption */\n DataLoss = 'data_loss',\n}\n\nexport type SpanStatusType =\n /** The operation completed successfully. */\n | 'ok'\n /** Deadline expired before operation could complete. */\n | 'deadline_exceeded'\n /** 401 Unauthorized (actually does mean unauthenticated according to RFC 7235) */\n | 'unauthenticated'\n /** 403 Forbidden */\n | 'permission_denied'\n /** 404 Not Found. Some requested entity (file or directory) was not found. */\n | 'not_found'\n /** 429 Too Many Requests */\n | 'resource_exhausted'\n /** Client specified an invalid argument. 4xx. */\n | 'invalid_argument'\n /** 501 Not Implemented */\n | 'unimplemented'\n /** 503 Service Unavailable */\n | 'unavailable'\n /** Other/generic 5xx. */\n | 'internal_error'\n /** Unknown. Any non-standard HTTP status code. */\n | 'unknown_error'\n /** The operation was cancelled (typically by the user). */\n | 'cancelled'\n /** Already exists (409) */\n | 'already_exists'\n /** Operation was rejected because the system is not in a state required for the operation's */\n | 'failed_precondition'\n /** The operation was aborted, typically due to a concurrency issue. */\n | 'aborted'\n /** Operation was attempted past the valid range. */\n | 'out_of_range'\n /** Unrecoverable data loss or corruption */\n | 'data_loss';\n\n/**\n * Converts a HTTP status code into a {@link SpanStatusType}.\n *\n * @param httpStatus The HTTP response status code.\n * @returns The span status or unknown_error.\n */\nexport function getSpanStatusFromHttpCode(httpStatus: number): SpanStatusType {\n if (httpStatus < 400 && httpStatus >= 100) {\n return 'ok';\n }\n\n if (httpStatus >= 400 && httpStatus < 500) {\n switch (httpStatus) {\n case 401:\n return 'unauthenticated';\n case 403:\n return 'permission_denied';\n case 404:\n return 'not_found';\n case 409:\n return 'already_exists';\n case 413:\n return 'failed_precondition';\n case 429:\n return 'resource_exhausted';\n default:\n return 'invalid_argument';\n }\n }\n\n if (httpStatus >= 500 && httpStatus < 600) {\n switch (httpStatus) {\n case 501:\n return 'unimplemented';\n case 503:\n return 'unavailable';\n case 504:\n return 'deadline_exceeded';\n default:\n return 'internal_error';\n }\n }\n\n return 'unknown_error';\n}\n\n/**\n * Converts a HTTP status code into a {@link SpanStatusType}.\n *\n * @deprecated Use {@link spanStatusFromHttpCode} instead.\n * This export will be removed in v8 as the signature contains a typo.\n *\n * @param httpStatus The HTTP response status code.\n * @returns The span status or unknown_error.\n */\nexport const spanStatusfromHttpCode = getSpanStatusFromHttpCode;\n\n/**\n * Sets the Http status attributes on the current span based on the http code.\n * Additionally, the span's status is updated, depending on the http code.\n */\nexport function setHttpStatus(span: Span, httpStatus: number): void {\n // TODO (v8): Remove these calls\n // Relay does not require us to send the status code as a tag\n // For now, just because users might expect it to land as a tag we keep sending it.\n // Same with data.\n // In v8, we replace both, simply with\n // span.setAttribute('http.response.status_code', httpStatus);\n\n // eslint-disable-next-line deprecation/deprecation\n span.setTag('http.status_code', String(httpStatus));\n // eslint-disable-next-line deprecation/deprecation\n span.setData('http.response.status_code', httpStatus);\n\n const spanStatus = getSpanStatusFromHttpCode(httpStatus);\n if (spanStatus !== 'unknown_error') {\n span.setStatus(spanStatus);\n }\n}\n", "import type { Options } from '@sentry/types';\n\nimport { getClient } from '../exports';\n\n// Treeshakable guard to remove all code related to tracing\ndeclare const __SENTRY_TRACING__: boolean | undefined;\n\n/**\n * Determines if tracing is currently enabled.\n *\n * Tracing is enabled when at least one of `tracesSampleRate` and `tracesSampler` is defined in the SDK config.\n */\nexport function hasTracingEnabled(\n maybeOptions?: Pick<Options, 'tracesSampleRate' | 'tracesSampler' | 'enableTracing'> | undefined,\n): boolean {\n if (typeof __SENTRY_TRACING__ === 'boolean' && !__SENTRY_TRACING__) {\n return false;\n }\n\n const client = getClient();\n const options = maybeOptions || (client && client.getOptions());\n return !!options && (options.enableTracing || 'tracesSampleRate' in options || 'tracesSampler' in options);\n}\n", "import type { Scope, Span, SpanTimeInput, StartSpanOptions, TransactionContext } from '@sentry/types';\n\nimport { addNonEnumerableProperty, dropUndefinedKeys, logger, tracingContextFromHeaders } from '@sentry/utils';\nimport { getDynamicSamplingContextFromSpan } from '.';\n\nimport { DEBUG_BUILD } from '../debug-build';\nimport { getCurrentScope, withScope } from '../exports';\nimport type { Hub } from '../hub';\nimport { runWithAsyncContext } from '../hub';\nimport { getIsolationScope } from '../hub';\nimport { getCurrentHub } from '../hub';\nimport type { Scope as ScopeClass } from '../scope';\nimport { handleCallbackErrors } from '../utils/handleCallbackErrors';\nimport { hasTracingEnabled } from '../utils/hasTracingEnabled';\nimport { spanIsSampled, spanTimeInputToSeconds, spanToJSON } from '../utils/spanUtils';\n\n/**\n * Wraps a function with a transaction/span and finishes the span after the function is done.\n *\n * Note that if you have not enabled tracing extensions via `addTracingExtensions`\n * or you didn't set `tracesSampleRate`, this function will not generate spans\n * and the `span` returned from the callback will be undefined.\n *\n * This function is meant to be used internally and may break at any time. Use at your own risk.\n *\n * @internal\n * @private\n *\n * @deprecated Use `startSpan` instead.\n */\nexport function trace<T>(\n context: TransactionContext,\n callback: (span?: Span) => T,\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n onError: (error: unknown, span?: Span) => void = () => {},\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n afterFinish: () => void = () => {},\n): T {\n // eslint-disable-next-line deprecation/deprecation\n const hub = getCurrentHub();\n const scope = getCurrentScope();\n // eslint-disable-next-line deprecation/deprecation\n const parentSpan = scope.getSpan();\n\n const spanContext = normalizeContext(context);\n const activeSpan = createChildSpanOrTransaction(hub, {\n parentSpan,\n spanContext,\n forceTransaction: false,\n scope,\n });\n\n // eslint-disable-next-line deprecation/deprecation\n scope.setSpan(activeSpan);\n\n return handleCallbackErrors(\n () => callback(activeSpan),\n error => {\n activeSpan && activeSpan.setStatus('internal_error');\n onError(error, activeSpan);\n },\n () => {\n activeSpan && activeSpan.end();\n // eslint-disable-next-line deprecation/deprecation\n scope.setSpan(parentSpan);\n afterFinish();\n },\n );\n}\n\n/**\n * Wraps a function with a transaction/span and finishes the span after the function is done.\n * The created span is the active span and will be used as parent by other spans created inside the function\n * and can be accessed via `Sentry.getSpan()`, as long as the function is executed while the scope is active.\n *\n * If you want to create a span that is not set as active, use {@link startInactiveSpan}.\n *\n * Note that if you have not enabled tracing extensions via `addTracingExtensions`\n * or you didn't set `tracesSampleRate`, this function will not generate spans\n * and the `span` returned from the callback will be undefined.\n */\nexport function startSpan<T>(context: StartSpanOptions, callback: (span: Span | undefined) => T): T {\n const spanContext = normalizeContext(context);\n\n return runWithAsyncContext(() => {\n return withScope(context.scope, scope => {\n // eslint-disable-next-line deprecation/deprecation\n const hub = getCurrentHub();\n // eslint-disable-next-line deprecation/deprecation\n const parentSpan = scope.getSpan();\n\n const shouldSkipSpan = context.onlyIfParent && !parentSpan;\n const activeSpan = shouldSkipSpan\n ? undefined\n : createChildSpanOrTransaction(hub, {\n parentSpan,\n spanContext,\n forceTransaction: context.forceTransaction,\n scope,\n });\n\n return handleCallbackErrors(\n () => callback(activeSpan),\n () => {\n // Only update the span status if it hasn't been changed yet\n if (activeSpan) {\n const { status } = spanToJSON(activeSpan);\n if (!status || status === 'ok') {\n activeSpan.setStatus('internal_error');\n }\n }\n },\n () => activeSpan && activeSpan.end(),\n );\n });\n });\n}\n\n/**\n * @deprecated Use {@link startSpan} instead.\n */\nexport const startActiveSpan = startSpan;\n\n/**\n * Similar to `Sentry.startSpan`. Wraps a function with a transaction/span, but does not finish the span\n * after the function is done automatically. You'll have to call `span.end()` manually.\n *\n * The created span is the active span and will be used as parent by other spans created inside the function\n * and can be accessed via `Sentry.getActiveSpan()`, as long as the function is executed while the scope is active.\n *\n * Note that if you have not enabled tracing extensions via `addTracingExtensions`\n * or you didn't set `tracesSampleRate`, this function will not generate spans\n * and the `span` returned from the callback will be undefined.\n */\nexport function startSpanManual<T>(\n context: StartSpanOptions,\n callback: (span: Span | undefined, finish: () => void) => T,\n): T {\n const spanContext = normalizeContext(context);\n\n return runWithAsyncContext(() => {\n return withScope(context.scope, scope => {\n // eslint-disable-next-line deprecation/deprecation\n const hub = getCurrentHub();\n // eslint-disable-next-line deprecation/deprecation\n const parentSpan = scope.getSpan();\n\n const shouldSkipSpan = context.onlyIfParent && !parentSpan;\n const activeSpan = shouldSkipSpan\n ? undefined\n : createChildSpanOrTransaction(hub, {\n parentSpan,\n spanContext,\n forceTransaction: context.forceTransaction,\n scope,\n });\n\n function finishAndSetSpan(): void {\n activeSpan && activeSpan.end();\n }\n\n return handleCallbackErrors(\n () => callback(activeSpan, finishAndSetSpan),\n () => {\n // Only update the span status if it hasn't been changed yet, and the span is not yet finished\n if (activeSpan && activeSpan.isRecording()) {\n const { status } = spanToJSON(activeSpan);\n if (!status || status === 'ok') {\n activeSpan.setStatus('internal_error');\n }\n }\n },\n );\n });\n });\n}\n\n/**\n * Creates a span. This span is not set as active, so will not get automatic instrumentation spans\n * as children or be able to be accessed via `Sentry.getSpan()`.\n *\n * If you want to create a span that is set as active, use {@link startSpan}.\n *\n * Note that if you have not enabled tracing extensions via `addTracingExtensions`\n * or you didn't set `tracesSampleRate` or `tracesSampler`, this function will not generate spans\n * and the `span` returned from the callback will be undefined.\n */\nexport function startInactiveSpan(context: StartSpanOptions): Span | undefined {\n if (!hasTracingEnabled()) {\n return undefined;\n }\n\n const spanContext = normalizeContext(context);\n // eslint-disable-next-line deprecation/deprecation\n const hub = getCurrentHub();\n const parentSpan = context.scope\n ? // eslint-disable-next-line deprecation/deprecation\n context.scope.getSpan()\n : getActiveSpan();\n\n const shouldSkipSpan = context.onlyIfParent && !parentSpan;\n\n if (shouldSkipSpan) {\n return undefined;\n }\n\n const scope = context.scope || getCurrentScope();\n\n // Even though we don't actually want to make this span active on the current scope,\n // we need to make it active on a temporary scope that we use for event processing\n // as otherwise, it won't pick the correct span for the event when processing it\n const temporaryScope = (scope as ScopeClass).clone();\n\n return createChildSpanOrTransaction(hub, {\n parentSpan,\n spanContext,\n forceTransaction: context.forceTransaction,\n scope: temporaryScope,\n });\n}\n\n/**\n * Returns the currently active span.\n */\nexport function getActiveSpan(): Span | undefined {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentScope().getSpan();\n}\n\ninterface ContinueTrace {\n /**\n * Continue a trace from `sentry-trace` and `baggage` values.\n * These values can be obtained from incoming request headers,\n * or in the browser from `<meta name=\"sentry-trace\">` and `<meta name=\"baggage\">` HTML tags.\n *\n * @deprecated Use the version of this function taking a callback as second parameter instead:\n *\n * ```\n * Sentry.continueTrace(sentryTrace: '...', baggage: '...' }, () => {\n * // ...\n * })\n * ```\n *\n */\n ({\n sentryTrace,\n baggage,\n }: {\n // eslint-disable-next-line deprecation/deprecation\n sentryTrace: Parameters<typeof tracingContextFromHeaders>[0];\n // eslint-disable-next-line deprecation/deprecation\n baggage: Parameters<typeof tracingContextFromHeaders>[1];\n }): Partial<TransactionContext>;\n\n /**\n * Continue a trace from `sentry-trace` and `baggage` values.\n * These values can be obtained from incoming request headers, or in the browser from `<meta name=\"sentry-trace\">`\n * and `<meta name=\"baggage\">` HTML tags.\n *\n * Spans started with `startSpan`, `startSpanManual` and `startInactiveSpan`, within the callback will automatically\n * be attached to the incoming trace.\n *\n * Deprecation notice: In the next major version of the SDK the provided callback will not receive a transaction\n * context argument.\n */\n <V>(\n {\n sentryTrace,\n baggage,\n }: {\n // eslint-disable-next-line deprecation/deprecation\n sentryTrace: Parameters<typeof tracingContextFromHeaders>[0];\n // eslint-disable-next-line deprecation/deprecation\n baggage: Parameters<typeof tracingContextFromHeaders>[1];\n },\n // TODO(v8): Remove parameter from this callback.\n callback: (transactionContext: Partial<TransactionContext>) => V,\n ): V;\n}\n\nexport const continueTrace: ContinueTrace = <V>(\n {\n sentryTrace,\n baggage,\n }: {\n // eslint-disable-next-line deprecation/deprecation\n sentryTrace: Parameters<typeof tracingContextFromHeaders>[0];\n // eslint-disable-next-line deprecation/deprecation\n baggage: Parameters<typeof tracingContextFromHeaders>[1];\n },\n callback?: (transactionContext: Partial<TransactionContext>) => V,\n): V | Partial<TransactionContext> => {\n // TODO(v8): Change this function so it doesn't do anything besides setting the propagation context on the current scope:\n /*\n return withScope((scope) => {\n const propagationContext = propagationContextFromHeaders(sentryTrace, baggage);\n scope.setPropagationContext(propagationContext);\n return callback();\n })\n */\n\n const currentScope = getCurrentScope();\n\n // eslint-disable-next-line deprecation/deprecation\n const { traceparentData, dynamicSamplingContext, propagationContext } = tracingContextFromHeaders(\n sentryTrace,\n baggage,\n );\n\n currentScope.setPropagationContext(propagationContext);\n\n if (DEBUG_BUILD && traceparentData) {\n logger.log(`[Tracing] Continuing trace ${traceparentData.traceId}.`);\n }\n\n const transactionContext: Partial<TransactionContext> = {\n ...traceparentData,\n metadata: dropUndefinedKeys({\n dynamicSamplingContext,\n }),\n };\n\n if (!callback) {\n return transactionContext;\n }\n\n return runWithAsyncContext(() => {\n return callback(transactionContext);\n });\n};\n\nfunction createChildSpanOrTransaction(\n // eslint-disable-next-line deprecation/deprecation\n hub: Hub,\n {\n parentSpan,\n spanContext,\n forceTransaction,\n scope,\n }: {\n parentSpan: Span | undefined;\n spanContext: TransactionContext;\n forceTransaction?: boolean;\n scope: Scope;\n },\n): Span | undefined {\n if (!hasTracingEnabled()) {\n return undefined;\n }\n\n const isolationScope = getIsolationScope();\n\n let span: Span | undefined;\n if (parentSpan && !forceTransaction) {\n // eslint-disable-next-line deprecation/deprecation\n span = parentSpan.startChild(spanContext);\n } else if (parentSpan) {\n // If we forced a transaction but have a parent span, make sure to continue from the parent span, not the scope\n const dsc = getDynamicSamplingContextFromSpan(parentSpan);\n const { traceId, spanId: parentSpanId } = parentSpan.spanContext();\n const sampled = spanIsSampled(parentSpan);\n\n // eslint-disable-next-line deprecation/deprecation\n span = hub.startTransaction({\n traceId,\n parentSpanId,\n parentSampled: sampled,\n ...spanContext,\n metadata: {\n dynamicSamplingContext: dsc,\n // eslint-disable-next-line deprecation/deprecation\n ...spanContext.metadata,\n },\n });\n } else {\n const { traceId, dsc, parentSpanId, sampled } = {\n ...isolationScope.getPropagationContext(),\n ...scope.getPropagationContext(),\n };\n\n // eslint-disable-next-line deprecation/deprecation\n span = hub.startTransaction({\n traceId,\n parentSpanId,\n parentSampled: sampled,\n ...spanContext,\n metadata: {\n dynamicSamplingContext: dsc,\n // eslint-disable-next-line deprecation/deprecation\n ...spanContext.metadata,\n },\n });\n }\n\n // We always set this as active span on the scope\n // In the case of this being an inactive span, we ensure to pass a detached scope in here in the first place\n // But by having this here, we can ensure that the lookup through `getCapturedScopesOnSpan` results in the correct scope & span combo\n // eslint-disable-next-line deprecation/deprecation\n scope.setSpan(span);\n\n setCapturedScopesOnSpan(span, scope, isolationScope);\n\n return span;\n}\n\n/**\n * This converts StartSpanOptions to TransactionContext.\n * For the most part (for now) we accept the same options,\n * but some of them need to be transformed.\n *\n * Eventually the StartSpanOptions will be more aligned with OpenTelemetry.\n */\nfunction normalizeContext(context: StartSpanOptions): TransactionContext {\n if (context.startTime) {\n const ctx: TransactionContext & { startTime?: SpanTimeInput } = { ...context };\n ctx.startTimestamp = spanTimeInputToSeconds(context.startTime);\n delete ctx.startTime;\n return ctx;\n }\n\n return context;\n}\n\nconst SCOPE_ON_START_SPAN_FIELD = '_sentryScope';\nconst ISOLATION_SCOPE_ON_START_SPAN_FIELD = '_sentryIsolationScope';\n\ntype SpanWithScopes = Span & {\n [SCOPE_ON_START_SPAN_FIELD]?: Scope;\n [ISOLATION_SCOPE_ON_START_SPAN_FIELD]?: Scope;\n};\n\nfunction setCapturedScopesOnSpan(span: Span | undefined, scope: Scope, isolationScope: Scope): void {\n if (span) {\n addNonEnumerableProperty(span, ISOLATION_SCOPE_ON_START_SPAN_FIELD, isolationScope);\n addNonEnumerableProperty(span, SCOPE_ON_START_SPAN_FIELD, scope);\n }\n}\n\n/**\n * Grabs the scope and isolation scope off a span that were active when the span was started.\n */\nexport function getCapturedScopesOnSpan(span: Span): { scope?: Scope; isolationScope?: Scope } {\n return {\n scope: (span as SpanWithScopes)[SCOPE_ON_START_SPAN_FIELD],\n isolationScope: (span as SpanWithScopes)[ISOLATION_SCOPE_ON_START_SPAN_FIELD],\n };\n}\n", "import type { MeasurementUnit, Span } from '@sentry/types';\nimport type { MetricSummary } from '@sentry/types';\nimport type { Primitive } from '@sentry/types';\nimport { dropUndefinedKeys } from '@sentry/utils';\nimport { getActiveSpan } from '../tracing';\nimport type { MetricType } from './types';\n\n/**\n * key: bucketKey\n * value: [exportKey, MetricSummary]\n */\ntype MetricSummaryStorage = Map<string, [string, MetricSummary]>;\n\nlet SPAN_METRIC_SUMMARY: WeakMap<Span, MetricSummaryStorage> | undefined;\n\nfunction getMetricStorageForSpan(span: Span): MetricSummaryStorage | undefined {\n return SPAN_METRIC_SUMMARY ? SPAN_METRIC_SUMMARY.get(span) : undefined;\n}\n\n/**\n * Fetches the metric summary if it exists for the passed span\n */\nexport function getMetricSummaryJsonForSpan(span: Span): Record<string, Array<MetricSummary>> | undefined {\n const storage = getMetricStorageForSpan(span);\n\n if (!storage) {\n return undefined;\n }\n const output: Record<string, Array<MetricSummary>> = {};\n\n for (const [, [exportKey, summary]] of storage) {\n if (!output[exportKey]) {\n output[exportKey] = [];\n }\n\n output[exportKey].push(dropUndefinedKeys(summary));\n }\n\n return output;\n}\n\n/**\n * Updates the metric summary on the currently active span\n */\nexport function updateMetricSummaryOnActiveSpan(\n metricType: MetricType,\n sanitizedName: string,\n value: number,\n unit: MeasurementUnit,\n tags: Record<string, Primitive>,\n bucketKey: string,\n): void {\n const span = getActiveSpan();\n if (span) {\n const storage = getMetricStorageForSpan(span) || new Map<string, [string, MetricSummary]>();\n\n const exportKey = `${metricType}:${sanitizedName}@${unit}`;\n const bucketItem = storage.get(bucketKey);\n\n if (bucketItem) {\n const [, summary] = bucketItem;\n storage.set(bucketKey, [\n exportKey,\n {\n min: Math.min(summary.min, value),\n max: Math.max(summary.max, value),\n count: (summary.count += 1),\n sum: (summary.sum += value),\n tags: summary.tags,\n },\n ]);\n } else {\n storage.set(bucketKey, [\n exportKey,\n {\n min: value,\n max: value,\n count: 1,\n sum: value,\n tags,\n },\n ]);\n }\n\n if (!SPAN_METRIC_SUMMARY) {\n SPAN_METRIC_SUMMARY = new WeakMap();\n }\n\n SPAN_METRIC_SUMMARY.set(span, storage);\n }\n}\n", "/**\n * Use this attribute to represent the source of a span.\n * Should be one of: custom, url, route, view, component, task, unknown\n *\n */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_SOURCE = 'sentry.source';\n\n/**\n * Use this attribute to represent the sample rate used for a span.\n */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE = 'sentry.sample_rate';\n\n/**\n * Use this attribute to represent the operation of a span.\n */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_OP = 'sentry.op';\n\n/**\n * Use this attribute to represent the origin of a span.\n */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN = 'sentry.origin';\n\n/**\n * The id of the profile that this span occured in.\n */\nexport const SEMANTIC_ATTRIBUTE_PROFILE_ID = 'profile_id';\n", "/* eslint-disable max-lines */\nimport type {\n Instrumenter,\n Measurements,\n Primitive,\n Span as SpanInterface,\n SpanAttributeValue,\n SpanAttributes,\n SpanContext,\n SpanContextData,\n SpanJSON,\n SpanOrigin,\n SpanTimeInput,\n TraceContext,\n Transaction,\n} from '@sentry/types';\nimport { dropUndefinedKeys, logger, timestampInSeconds, uuid4 } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../debug-build';\nimport { getMetricSummaryJsonForSpan } from '../metrics/metric-summary';\nimport {\n SEMANTIC_ATTRIBUTE_PROFILE_ID,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n} from '../semanticAttributes';\nimport { getRootSpan } from '../utils/getRootSpan';\nimport {\n TRACE_FLAG_NONE,\n TRACE_FLAG_SAMPLED,\n spanTimeInputToSeconds,\n spanToJSON,\n spanToTraceContext,\n spanToTraceHeader,\n} from '../utils/spanUtils';\nimport type { SpanStatusType } from './spanstatus';\nimport { setHttpStatus } from './spanstatus';\n\n/**\n * Keeps track of finished spans for a given transaction\n * @internal\n * @hideconstructor\n * @hidden\n */\nexport class SpanRecorder {\n public spans: Span[];\n\n private readonly _maxlen: number;\n\n public constructor(maxlen: number = 1000) {\n this._maxlen = maxlen;\n this.spans = [];\n }\n\n /**\n * This is just so that we don't run out of memory while recording a lot\n * of spans. At some point we just stop and flush out the start of the\n * trace tree (i.e.the first n spans with the smallest\n * start_timestamp).\n */\n public add(span: Span): void {\n if (this.spans.length > this._maxlen) {\n // eslint-disable-next-line deprecation/deprecation\n span.spanRecorder = undefined;\n } else {\n this.spans.push(span);\n }\n }\n}\n\n/**\n * Span contains all data about a span\n */\nexport class Span implements SpanInterface {\n /**\n * Tags for the span.\n * @deprecated Use `spanToJSON(span).atttributes` instead.\n */\n public tags: { [key: string]: Primitive };\n\n /**\n * Data for the span.\n * @deprecated Use `spanToJSON(span).atttributes` instead.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public data: { [key: string]: any };\n\n /**\n * List of spans that were finalized\n *\n * @deprecated This property will no longer be public. Span recording will be handled internally.\n */\n public spanRecorder?: SpanRecorder;\n\n /**\n * @inheritDoc\n * @deprecated Use top level `Sentry.getRootSpan()` instead\n */\n public transaction?: Transaction;\n\n /**\n * The instrumenter that created this span.\n *\n * TODO (v8): This can probably be replaced by an `instanceOf` check of the span class.\n * the instrumenter can only be sentry or otel so we can check the span instance\n * to verify which one it is and remove this field entirely.\n *\n * @deprecated This field will be removed.\n */\n public instrumenter: Instrumenter;\n\n protected _traceId: string;\n protected _spanId: string;\n protected _parentSpanId?: string | undefined;\n protected _sampled: boolean | undefined;\n protected _name?: string | undefined;\n protected _attributes: SpanAttributes;\n /** Epoch timestamp in seconds when the span started. */\n protected _startTime: number;\n /** Epoch timestamp in seconds when the span ended. */\n protected _endTime?: number | undefined;\n /** Internal keeper of the status */\n protected _status?: SpanStatusType | string | undefined;\n protected _exclusiveTime?: number;\n\n protected _measurements: Measurements;\n\n private _logMessage?: string;\n\n /**\n * You should never call the constructor manually, always use `Sentry.startTransaction()`\n * or call `startChild()` on an existing span.\n * @internal\n * @hideconstructor\n * @hidden\n */\n public constructor(spanContext: SpanContext = {}) {\n this._traceId = spanContext.traceId || uuid4();\n this._spanId = spanContext.spanId || uuid4().substring(16);\n this._startTime = spanContext.startTimestamp || timestampInSeconds();\n // eslint-disable-next-line deprecation/deprecation\n this.tags = spanContext.tags ? { ...spanContext.tags } : {};\n // eslint-disable-next-line deprecation/deprecation\n this.data = spanContext.data ? { ...spanContext.data } : {};\n // eslint-disable-next-line deprecation/deprecation\n this.instrumenter = spanContext.instrumenter || 'sentry';\n\n this._attributes = {};\n this.setAttributes({\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: spanContext.origin || 'manual',\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: spanContext.op,\n ...spanContext.attributes,\n });\n\n // eslint-disable-next-line deprecation/deprecation\n this._name = spanContext.name || spanContext.description;\n\n if (spanContext.parentSpanId) {\n this._parentSpanId = spanContext.parentSpanId;\n }\n // We want to include booleans as well here\n if ('sampled' in spanContext) {\n this._sampled = spanContext.sampled;\n }\n if (spanContext.status) {\n this._status = spanContext.status;\n }\n if (spanContext.endTimestamp) {\n this._endTime = spanContext.endTimestamp;\n }\n if (spanContext.exclusiveTime !== undefined) {\n this._exclusiveTime = spanContext.exclusiveTime;\n }\n this._measurements = spanContext.measurements ? { ...spanContext.measurements } : {};\n }\n\n // This rule conflicts with another eslint rule :(\n /* eslint-disable @typescript-eslint/member-ordering */\n\n /**\n * An alias for `description` of the Span.\n * @deprecated Use `spanToJSON(span).description` instead.\n */\n public get name(): string {\n return this._name || '';\n }\n\n /**\n * Update the name of the span.\n * @deprecated Use `spanToJSON(span).description` instead.\n */\n public set name(name: string) {\n this.updateName(name);\n }\n\n /**\n * Get the description of the Span.\n * @deprecated Use `spanToJSON(span).description` instead.\n */\n public get description(): string | undefined {\n return this._name;\n }\n\n /**\n * Get the description of the Span.\n * @deprecated Use `spanToJSON(span).description` instead.\n */\n public set description(description: string | undefined) {\n this._name = description;\n }\n\n /**\n * The ID of the trace.\n * @deprecated Use `spanContext().traceId` instead.\n */\n public get traceId(): string {\n return this._traceId;\n }\n\n /**\n * The ID of the trace.\n * @deprecated You cannot update the traceId of a span after span creation.\n */\n public set traceId(traceId: string) {\n this._traceId = traceId;\n }\n\n /**\n * The ID of the span.\n * @deprecated Use `spanContext().spanId` instead.\n */\n public get spanId(): string {\n return this._spanId;\n }\n\n /**\n * The ID of the span.\n * @deprecated You cannot update the spanId of a span after span creation.\n */\n public set spanId(spanId: string) {\n this._spanId = spanId;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `startSpan` functions instead.\n */\n public set parentSpanId(string) {\n this._parentSpanId = string;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `spanToJSON(span).parent_span_id` instead.\n */\n public get parentSpanId(): string | undefined {\n return this._parentSpanId;\n }\n\n /**\n * Was this span chosen to be sent as part of the sample?\n * @deprecated Use `isRecording()` instead.\n */\n public get sampled(): boolean | undefined {\n return this._sampled;\n }\n\n /**\n * Was this span chosen to be sent as part of the sample?\n * @deprecated You cannot update the sampling decision of a span after span creation.\n */\n public set sampled(sampled: boolean | undefined) {\n this._sampled = sampled;\n }\n\n /**\n * Attributes for the span.\n * @deprecated Use `spanToJSON(span).atttributes` instead.\n */\n public get attributes(): SpanAttributes {\n return this._attributes;\n }\n\n /**\n * Attributes for the span.\n * @deprecated Use `setAttributes()` instead.\n */\n public set attributes(attributes: SpanAttributes) {\n this._attributes = attributes;\n }\n\n /**\n * Timestamp in seconds (epoch time) indicating when the span started.\n * @deprecated Use `spanToJSON()` instead.\n */\n public get startTimestamp(): number {\n return this._startTime;\n }\n\n /**\n * Timestamp in seconds (epoch time) indicating when the span started.\n * @deprecated In v8, you will not be able to update the span start time after creation.\n */\n public set startTimestamp(startTime: number) {\n this._startTime = startTime;\n }\n\n /**\n * Timestamp in seconds when the span ended.\n * @deprecated Use `spanToJSON()` instead.\n */\n public get endTimestamp(): number | undefined {\n return this._endTime;\n }\n\n /**\n * Timestamp in seconds when the span ended.\n * @deprecated Set the end time via `span.end()` instead.\n */\n public set endTimestamp(endTime: number | undefined) {\n this._endTime = endTime;\n }\n\n /**\n * The status of the span.\n *\n * @deprecated Use `spanToJSON().status` instead to get the status.\n */\n public get status(): SpanStatusType | string | undefined {\n return this._status;\n }\n\n /**\n * The status of the span.\n *\n * @deprecated Use `.setStatus()` instead to set or update the status.\n */\n public set status(status: SpanStatusType | string | undefined) {\n this._status = status;\n }\n\n /**\n * Operation of the span\n *\n * @deprecated Use `spanToJSON().op` to read the op instead.\n */\n public get op(): string | undefined {\n return this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP] as string | undefined;\n }\n\n /**\n * Operation of the span\n *\n * @deprecated Use `startSpan()` functions to set or `span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'op')\n * to update the span instead.\n */\n public set op(op: string | undefined) {\n this.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, op);\n }\n\n /**\n * The origin of the span, giving context about what created the span.\n *\n * @deprecated Use `spanToJSON().origin` to read the origin instead.\n */\n public get origin(): SpanOrigin | undefined {\n return this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] as SpanOrigin | undefined;\n }\n\n /**\n * The origin of the span, giving context about what created the span.\n *\n * @deprecated Use `startSpan()` functions to set the origin instead.\n */\n public set origin(origin: SpanOrigin | undefined) {\n this.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, origin);\n }\n\n /* eslint-enable @typescript-eslint/member-ordering */\n\n /** @inheritdoc */\n public spanContext(): SpanContextData {\n const { _spanId: spanId, _traceId: traceId, _sampled: sampled } = this;\n return {\n spanId,\n traceId,\n traceFlags: sampled ? TRACE_FLAG_SAMPLED : TRACE_FLAG_NONE,\n };\n }\n\n /**\n * Creates a new `Span` while setting the current `Span.id` as `parentSpanId`.\n * Also the `sampled` decision will be inherited.\n *\n * @deprecated Use `startSpan()`, `startSpanManual()` or `startInactiveSpan()` instead.\n */\n public startChild(\n spanContext?: Pick<SpanContext, Exclude<keyof SpanContext, 'sampled' | 'traceId' | 'parentSpanId'>>,\n ): SpanInterface {\n const childSpan = new Span({\n ...spanContext,\n parentSpanId: this._spanId,\n sampled: this._sampled,\n traceId: this._traceId,\n });\n\n // eslint-disable-next-line deprecation/deprecation\n childSpan.spanRecorder = this.spanRecorder;\n // eslint-disable-next-line deprecation/deprecation\n if (childSpan.spanRecorder) {\n // eslint-disable-next-line deprecation/deprecation\n childSpan.spanRecorder.add(childSpan);\n }\n\n const rootSpan = getRootSpan(this);\n // TODO: still set span.transaction here until we have a more permanent solution\n // Probably similarly to the weakmap we hold in node-experimental\n // eslint-disable-next-line deprecation/deprecation\n childSpan.transaction = rootSpan as Transaction;\n\n if (DEBUG_BUILD && rootSpan) {\n const opStr = (spanContext && spanContext.op) || '< unknown op >';\n const nameStr = spanToJSON(childSpan).description || '< unknown name >';\n const idStr = rootSpan.spanContext().spanId;\n\n const logMessage = `[Tracing] Starting '${opStr}' span on transaction '${nameStr}' (${idStr}).`;\n logger.log(logMessage);\n this._logMessage = logMessage;\n }\n\n return childSpan;\n }\n\n /**\n * Sets the tag attribute on the current span.\n *\n * Can also be used to unset a tag, by passing `undefined`.\n *\n * @param key Tag key\n * @param value Tag value\n * @deprecated Use `setAttribute()` instead.\n */\n public setTag(key: string, value: Primitive): this {\n // eslint-disable-next-line deprecation/deprecation\n this.tags = { ...this.tags, [key]: value };\n return this;\n }\n\n /**\n * Sets the data attribute on the current span\n * @param key Data key\n * @param value Data value\n * @deprecated Use `setAttribute()` instead.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public setData(key: string, value: any): this {\n // eslint-disable-next-line deprecation/deprecation\n this.data = { ...this.data, [key]: value };\n return this;\n }\n\n /** @inheritdoc */\n public setAttribute(key: string, value: SpanAttributeValue | undefined): void {\n if (value === undefined) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete this._attributes[key];\n } else {\n this._attributes[key] = value;\n }\n }\n\n /** @inheritdoc */\n public setAttributes(attributes: SpanAttributes): void {\n Object.keys(attributes).forEach(key => this.setAttribute(key, attributes[key]));\n }\n\n /**\n * @inheritDoc\n */\n public setStatus(value: SpanStatusType): this {\n this._status = value;\n return this;\n }\n\n /**\n * @inheritDoc\n * @deprecated Use top-level `setHttpStatus()` instead.\n */\n public setHttpStatus(httpStatus: number): this {\n setHttpStatus(this, httpStatus);\n return this;\n }\n\n /**\n * @inheritdoc\n *\n * @deprecated Use `.updateName()` instead.\n */\n public setName(name: string): void {\n this.updateName(name);\n }\n\n /**\n * @inheritDoc\n */\n public updateName(name: string): this {\n this._name = name;\n return this;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `spanToJSON(span).status === 'ok'` instead.\n */\n public isSuccess(): boolean {\n return this._status === 'ok';\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `.end()` instead.\n */\n public finish(endTimestamp?: number): void {\n return this.end(endTimestamp);\n }\n\n /** @inheritdoc */\n public end(endTimestamp?: SpanTimeInput): void {\n // If already ended, skip\n if (this._endTime) {\n return;\n }\n const rootSpan = getRootSpan(this);\n if (\n DEBUG_BUILD &&\n // Don't call this for transactions\n rootSpan &&\n rootSpan.spanContext().spanId !== this._spanId\n ) {\n const logMessage = this._logMessage;\n if (logMessage) {\n logger.log((logMessage as string).replace('Starting', 'Finishing'));\n }\n }\n\n this._endTime = spanTimeInputToSeconds(endTimestamp);\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `spanToTraceHeader()` instead.\n */\n public toTraceparent(): string {\n return spanToTraceHeader(this);\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `spanToJSON()` or access the fields directly instead.\n */\n public toContext(): SpanContext {\n return dropUndefinedKeys({\n data: this._getData(),\n description: this._name,\n endTimestamp: this._endTime,\n // eslint-disable-next-line deprecation/deprecation\n op: this.op,\n parentSpanId: this._parentSpanId,\n sampled: this._sampled,\n spanId: this._spanId,\n startTimestamp: this._startTime,\n status: this._status,\n // eslint-disable-next-line deprecation/deprecation\n tags: this.tags,\n traceId: this._traceId,\n });\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Update the fields directly instead.\n */\n public updateWithContext(spanContext: SpanContext): this {\n // eslint-disable-next-line deprecation/deprecation\n this.data = spanContext.data || {};\n // eslint-disable-next-line deprecation/deprecation\n this._name = spanContext.name || spanContext.description;\n this._endTime = spanContext.endTimestamp;\n // eslint-disable-next-line deprecation/deprecation\n this.op = spanContext.op;\n this._parentSpanId = spanContext.parentSpanId;\n this._sampled = spanContext.sampled;\n this._spanId = spanContext.spanId || this._spanId;\n this._startTime = spanContext.startTimestamp || this._startTime;\n this._status = spanContext.status;\n // eslint-disable-next-line deprecation/deprecation\n this.tags = spanContext.tags || {};\n this._traceId = spanContext.traceId || this._traceId;\n\n return this;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `spanToTraceContext()` util function instead.\n */\n public getTraceContext(): TraceContext {\n return spanToTraceContext(this);\n }\n\n /**\n * Get JSON representation of this span.\n *\n * @hidden\n * @internal This method is purely for internal purposes and should not be used outside\n * of SDK code. If you need to get a JSON representation of a span,\n * use `spanToJSON(span)` instead.\n */\n public getSpanJSON(): SpanJSON {\n return dropUndefinedKeys({\n data: this._getData(),\n description: this._name,\n op: this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP] as string | undefined,\n parent_span_id: this._parentSpanId,\n span_id: this._spanId,\n start_timestamp: this._startTime,\n status: this._status,\n // eslint-disable-next-line deprecation/deprecation\n tags: Object.keys(this.tags).length > 0 ? this.tags : undefined,\n timestamp: this._endTime,\n trace_id: this._traceId,\n origin: this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] as SpanOrigin | undefined,\n _metrics_summary: getMetricSummaryJsonForSpan(this),\n profile_id: this._attributes[SEMANTIC_ATTRIBUTE_PROFILE_ID] as string | undefined,\n exclusive_time: this._exclusiveTime,\n measurements: Object.keys(this._measurements).length > 0 ? this._measurements : undefined,\n });\n }\n\n /** @inheritdoc */\n public isRecording(): boolean {\n return !this._endTime && !!this._sampled;\n }\n\n /**\n * Convert the object to JSON.\n * @deprecated Use `spanToJSON(span)` instead.\n */\n public toJSON(): SpanJSON {\n return this.getSpanJSON();\n }\n\n /**\n * Get the merged data for this span.\n * For now, this combines `data` and `attributes` together,\n * until eventually we can ingest `attributes` directly.\n */\n private _getData():\n | {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any;\n }\n | undefined {\n // eslint-disable-next-line deprecation/deprecation\n const { data, _attributes: attributes } = this;\n\n const hasData = Object.keys(data).length > 0;\n const hasAttributes = Object.keys(attributes).length > 0;\n\n if (!hasData && !hasAttributes) {\n return undefined;\n }\n\n if (hasData && hasAttributes) {\n return {\n ...data,\n ...attributes,\n };\n }\n\n return hasData ? data : attributes;\n }\n}\n", "import type {\n Context,\n Contexts,\n DynamicSamplingContext,\n MeasurementUnit,\n SpanTimeInput,\n Transaction as TransactionInterface,\n TransactionContext,\n TransactionEvent,\n TransactionMetadata,\n} from '@sentry/types';\nimport { dropUndefinedKeys, logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../debug-build';\nimport type { Hub } from '../hub';\nimport { getCurrentHub } from '../hub';\nimport { getMetricSummaryJsonForSpan } from '../metrics/metric-summary';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE } from '../semanticAttributes';\nimport { spanTimeInputToSeconds, spanToJSON, spanToTraceContext } from '../utils/spanUtils';\nimport { getDynamicSamplingContextFromSpan } from './dynamicSamplingContext';\nimport { Span as SpanClass, SpanRecorder } from './span';\nimport { getCapturedScopesOnSpan } from './trace';\n\n/** JSDoc */\nexport class Transaction extends SpanClass implements TransactionInterface {\n /**\n * The reference to the current hub.\n */\n // eslint-disable-next-line deprecation/deprecation\n public _hub: Hub;\n\n protected _name: string;\n\n private _contexts: Contexts;\n\n private _trimEnd?: boolean | undefined;\n\n // DO NOT yet remove this property, it is used in a hack for v7 backwards compatibility.\n private _frozenDynamicSamplingContext: Readonly<Partial<DynamicSamplingContext>> | undefined;\n\n private _metadata: Partial<TransactionMetadata>;\n\n /**\n * This constructor should never be called manually. Those instrumenting tracing should use\n * `Sentry.startTransaction()`, and internal methods should use `hub.startTransaction()`.\n * @internal\n * @hideconstructor\n * @hidden\n *\n * @deprecated Transactions will be removed in v8. Use spans instead.\n */\n // eslint-disable-next-line deprecation/deprecation\n public constructor(transactionContext: TransactionContext, hub?: Hub) {\n super(transactionContext);\n this._contexts = {};\n\n // eslint-disable-next-line deprecation/deprecation\n this._hub = hub || getCurrentHub();\n\n this._name = transactionContext.name || '';\n\n this._metadata = {\n // eslint-disable-next-line deprecation/deprecation\n ...transactionContext.metadata,\n };\n\n this._trimEnd = transactionContext.trimEnd;\n\n // this is because transactions are also spans, and spans have a transaction pointer\n // TODO (v8): Replace this with another way to set the root span\n // eslint-disable-next-line deprecation/deprecation\n this.transaction = this;\n\n // If Dynamic Sampling Context is provided during the creation of the transaction, we freeze it as it usually means\n // there is incoming Dynamic Sampling Context. (Either through an incoming request, a baggage meta-tag, or other means)\n const incomingDynamicSamplingContext = this._metadata.dynamicSamplingContext;\n if (incomingDynamicSamplingContext) {\n // We shallow copy this in case anything writes to the original reference of the passed in `dynamicSamplingContext`\n this._frozenDynamicSamplingContext = { ...incomingDynamicSamplingContext };\n }\n }\n\n // This sadly conflicts with the getter/setter ordering :(\n /* eslint-disable @typescript-eslint/member-ordering */\n\n /**\n * Getter for `name` property.\n * @deprecated Use `spanToJSON(span).description` instead.\n */\n public get name(): string {\n return this._name;\n }\n\n /**\n * Setter for `name` property, which also sets `source` as custom.\n * @deprecated Use `updateName()` and `setMetadata()` instead.\n */\n public set name(newName: string) {\n // eslint-disable-next-line deprecation/deprecation\n this.setName(newName);\n }\n\n /**\n * Get the metadata for this transaction.\n * @deprecated Use `spanGetMetadata(transaction)` instead.\n */\n public get metadata(): TransactionMetadata {\n // We merge attributes in for backwards compatibility\n return {\n // Defaults\n // eslint-disable-next-line deprecation/deprecation\n source: 'custom',\n spanMetadata: {},\n\n // Legacy metadata\n ...this._metadata,\n\n // From attributes\n ...(this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] && {\n source: this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] as TransactionMetadata['source'],\n }),\n ...(this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE] && {\n sampleRate: this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE] as TransactionMetadata['sampleRate'],\n }),\n };\n }\n\n /**\n * Update the metadata for this transaction.\n * @deprecated Use `spanGetMetadata(transaction)` instead.\n */\n public set metadata(metadata: TransactionMetadata) {\n this._metadata = metadata;\n }\n\n /* eslint-enable @typescript-eslint/member-ordering */\n\n /**\n * Setter for `name` property, which also sets `source` on the metadata.\n *\n * @deprecated Use `.updateName()` and `.setAttribute()` instead.\n */\n public setName(name: string, source: TransactionMetadata['source'] = 'custom'): void {\n this._name = name;\n this.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, source);\n }\n\n /** @inheritdoc */\n public updateName(name: string): this {\n this._name = name;\n return this;\n }\n\n /**\n * Attaches SpanRecorder to the span itself\n * @param maxlen maximum number of spans that can be recorded\n */\n public initSpanRecorder(maxlen: number = 1000): void {\n // eslint-disable-next-line deprecation/deprecation\n if (!this.spanRecorder) {\n // eslint-disable-next-line deprecation/deprecation\n this.spanRecorder = new SpanRecorder(maxlen);\n }\n // eslint-disable-next-line deprecation/deprecation\n this.spanRecorder.add(this);\n }\n\n /**\n * Set the context of a transaction event.\n * @deprecated Use either `.setAttribute()`, or set the context on the scope before creating the transaction.\n */\n public setContext(key: string, context: Context | null): void {\n if (context === null) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete this._contexts[key];\n } else {\n this._contexts[key] = context;\n }\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use top-level `setMeasurement()` instead.\n */\n public setMeasurement(name: string, value: number, unit: MeasurementUnit = ''): void {\n this._measurements[name] = { value, unit };\n }\n\n /**\n * Store metadata on this transaction.\n * @deprecated Use attributes or store data on the scope instead.\n */\n public setMetadata(newMetadata: Partial<TransactionMetadata>): void {\n this._metadata = { ...this._metadata, ...newMetadata };\n }\n\n /**\n * @inheritDoc\n */\n public end(endTimestamp?: SpanTimeInput): string | undefined {\n const timestampInS = spanTimeInputToSeconds(endTimestamp);\n const transaction = this._finishTransaction(timestampInS);\n if (!transaction) {\n return undefined;\n }\n // eslint-disable-next-line deprecation/deprecation\n return this._hub.captureEvent(transaction);\n }\n\n /**\n * @inheritDoc\n */\n public toContext(): TransactionContext {\n // eslint-disable-next-line deprecation/deprecation\n const spanContext = super.toContext();\n\n return dropUndefinedKeys({\n ...spanContext,\n name: this._name,\n trimEnd: this._trimEnd,\n });\n }\n\n /**\n * @inheritDoc\n */\n public updateWithContext(transactionContext: TransactionContext): this {\n // eslint-disable-next-line deprecation/deprecation\n super.updateWithContext(transactionContext);\n\n this._name = transactionContext.name || '';\n this._trimEnd = transactionContext.trimEnd;\n\n return this;\n }\n\n /**\n * @inheritdoc\n *\n * @experimental\n *\n * @deprecated Use top-level `getDynamicSamplingContextFromSpan` instead.\n */\n public getDynamicSamplingContext(): Readonly<Partial<DynamicSamplingContext>> {\n return getDynamicSamplingContextFromSpan(this);\n }\n\n /**\n * Override the current hub with a new one.\n * Used if you want another hub to finish the transaction.\n *\n * @internal\n */\n // eslint-disable-next-line deprecation/deprecation\n public setHub(hub: Hub): void {\n this._hub = hub;\n }\n\n /**\n * Get the profile id of the transaction.\n */\n public getProfileId(): string | undefined {\n if (this._contexts !== undefined && this._contexts['profile'] !== undefined) {\n return this._contexts['profile'].profile_id as string;\n }\n return undefined;\n }\n\n /**\n * Finish the transaction & prepare the event to send to Sentry.\n */\n protected _finishTransaction(endTimestamp?: number): TransactionEvent | undefined {\n // This transaction is already finished, so we should not flush it again.\n if (this._endTime !== undefined) {\n return undefined;\n }\n\n if (!this._name) {\n DEBUG_BUILD && logger.warn('Transaction has no name, falling back to `<unlabeled transaction>`.');\n this._name = '<unlabeled transaction>';\n }\n\n // just sets the end timestamp\n super.end(endTimestamp);\n\n // eslint-disable-next-line deprecation/deprecation\n const client = this._hub.getClient();\n if (client && client.emit) {\n client.emit('finishTransaction', this);\n }\n\n if (this._sampled !== true) {\n // At this point if `sampled !== true` we want to discard the transaction.\n DEBUG_BUILD && logger.log('[Tracing] Discarding transaction because its trace was not chosen to be sampled.');\n\n if (client) {\n client.recordDroppedEvent('sample_rate', 'transaction');\n }\n\n return undefined;\n }\n\n // eslint-disable-next-line deprecation/deprecation\n const finishedSpans = this.spanRecorder\n ? // eslint-disable-next-line deprecation/deprecation\n this.spanRecorder.spans.filter(span => span !== this && spanToJSON(span).timestamp)\n : [];\n\n if (this._trimEnd && finishedSpans.length > 0) {\n const endTimes = finishedSpans.map(span => spanToJSON(span).timestamp).filter(Boolean) as number[];\n this._endTime = endTimes.reduce((prev, current) => {\n return prev > current ? prev : current;\n });\n }\n\n const { scope: capturedSpanScope, isolationScope: capturedSpanIsolationScope } = getCapturedScopesOnSpan(this);\n\n // eslint-disable-next-line deprecation/deprecation\n const { metadata } = this;\n // eslint-disable-next-line deprecation/deprecation\n const { source } = metadata;\n\n const transaction: TransactionEvent = {\n contexts: {\n ...this._contexts,\n // We don't want to override trace context\n trace: spanToTraceContext(this),\n },\n // TODO: Pass spans serialized via `spanToJSON()` here instead in v8.\n spans: finishedSpans,\n start_timestamp: this._startTime,\n // eslint-disable-next-line deprecation/deprecation\n tags: this.tags,\n timestamp: this._endTime,\n transaction: this._name,\n type: 'transaction',\n sdkProcessingMetadata: {\n ...metadata,\n capturedSpanScope,\n capturedSpanIsolationScope,\n ...dropUndefinedKeys({\n dynamicSamplingContext: getDynamicSamplingContextFromSpan(this),\n }),\n },\n _metrics_summary: getMetricSummaryJsonForSpan(this),\n ...(source && {\n transaction_info: {\n source,\n },\n }),\n };\n\n const hasMeasurements = Object.keys(this._measurements).length > 0;\n\n if (hasMeasurements) {\n DEBUG_BUILD &&\n logger.log(\n '[Measurements] Adding measurements to transaction',\n JSON.stringify(this._measurements, undefined, 2),\n );\n transaction.measurements = this._measurements;\n }\n\n // eslint-disable-next-line deprecation/deprecation\n DEBUG_BUILD && logger.log(`[Tracing] Finishing ${this.op} transaction: ${this._name}.`);\n\n return transaction;\n }\n}\n", "/* eslint-disable max-lines */\nimport type { SpanTimeInput, TransactionContext } from '@sentry/types';\nimport { logger, timestampInSeconds } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../debug-build';\nimport type { Hub } from '../hub';\nimport { spanTimeInputToSeconds, spanToJSON } from '../utils/spanUtils';\nimport type { Span } from './span';\nimport { SpanRecorder } from './span';\nimport { Transaction } from './transaction';\n\nexport const TRACING_DEFAULTS = {\n idleTimeout: 1000,\n finalTimeout: 30000,\n heartbeatInterval: 5000,\n};\n\nconst FINISH_REASON_TAG = 'finishReason';\n\nconst IDLE_TRANSACTION_FINISH_REASONS = [\n 'heartbeatFailed',\n 'idleTimeout',\n 'documentHidden',\n 'finalTimeout',\n 'externalFinish',\n 'cancelled',\n];\n\n/**\n * @inheritDoc\n */\nexport class IdleTransactionSpanRecorder extends SpanRecorder {\n public constructor(\n private readonly _pushActivity: (id: string) => void,\n private readonly _popActivity: (id: string) => void,\n public transactionSpanId: string,\n maxlen?: number,\n ) {\n super(maxlen);\n }\n\n /**\n * @inheritDoc\n */\n public add(span: Span): void {\n // We should make sure we do not push and pop activities for\n // the transaction that this span recorder belongs to.\n if (span.spanContext().spanId !== this.transactionSpanId) {\n // We patch span.end() to pop an activity after setting an endTimestamp.\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const originalEnd = span.end;\n span.end = (...rest: unknown[]) => {\n this._popActivity(span.spanContext().spanId);\n return originalEnd.apply(span, rest);\n };\n\n // We should only push new activities if the span does not have an end timestamp.\n if (spanToJSON(span).timestamp === undefined) {\n this._pushActivity(span.spanContext().spanId);\n }\n }\n\n super.add(span);\n }\n}\n\nexport type BeforeFinishCallback = (transactionSpan: IdleTransaction, endTimestamp: number) => void;\n\n/**\n * An IdleTransaction is a transaction that automatically finishes. It does this by tracking child spans as activities.\n * You can have multiple IdleTransactions active, but if the `onScope` option is specified, the idle transaction will\n * put itself on the scope on creation.\n */\nexport class IdleTransaction extends Transaction {\n // Activities store a list of active spans\n public activities: Record<string, boolean>;\n // Track state of activities in previous heartbeat\n private _prevHeartbeatString: string | undefined;\n\n // Amount of times heartbeat has counted. Will cause transaction to finish after 3 beats.\n private _heartbeatCounter: number;\n\n // We should not use heartbeat if we finished a transaction\n private _finished: boolean;\n\n // Idle timeout was canceled and we should finish the transaction with the last span end.\n private _idleTimeoutCanceledPermanently: boolean;\n\n private readonly _beforeFinishCallbacks: BeforeFinishCallback[];\n\n /**\n * Timer that tracks Transaction idleTimeout\n */\n private _idleTimeoutID: ReturnType<typeof setTimeout> | undefined;\n\n private _finishReason: (typeof IDLE_TRANSACTION_FINISH_REASONS)[number];\n\n private _autoFinishAllowed: boolean;\n\n /**\n * @deprecated Transactions will be removed in v8. Use spans instead.\n */\n public constructor(\n transactionContext: TransactionContext,\n // eslint-disable-next-line deprecation/deprecation\n private readonly _idleHub: Hub,\n /**\n * The time to wait in ms until the idle transaction will be finished. This timer is started each time\n * there are no active spans on this transaction.\n */\n private readonly _idleTimeout: number = TRACING_DEFAULTS.idleTimeout,\n /**\n * The final value in ms that a transaction cannot exceed\n */\n private readonly _finalTimeout: number = TRACING_DEFAULTS.finalTimeout,\n private readonly _heartbeatInterval: number = TRACING_DEFAULTS.heartbeatInterval,\n // Whether or not the transaction should put itself on the scope when it starts and pop itself off when it ends\n private readonly _onScope: boolean = false,\n /**\n * When set to `true`, will disable the idle timeout (`_idleTimeout` option) and heartbeat mechanisms (`_heartbeatInterval`\n * option) until the `sendAutoFinishSignal()` method is called. The final timeout mechanism (`_finalTimeout` option)\n * will not be affected by this option, meaning the transaction will definitely be finished when the final timeout is\n * reached, no matter what this option is configured to.\n *\n * Defaults to `false`.\n */\n delayAutoFinishUntilSignal: boolean = false,\n ) {\n super(transactionContext, _idleHub);\n\n this.activities = {};\n this._heartbeatCounter = 0;\n this._finished = false;\n this._idleTimeoutCanceledPermanently = false;\n this._beforeFinishCallbacks = [];\n this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[4];\n this._autoFinishAllowed = !delayAutoFinishUntilSignal;\n\n if (_onScope) {\n // We set the transaction here on the scope so error events pick up the trace\n // context and attach it to the error.\n DEBUG_BUILD && logger.log(`Setting idle transaction on scope. Span ID: ${this.spanContext().spanId}`);\n // eslint-disable-next-line deprecation/deprecation\n _idleHub.getScope().setSpan(this);\n }\n\n if (!delayAutoFinishUntilSignal) {\n this._restartIdleTimeout();\n }\n\n setTimeout(() => {\n if (!this._finished) {\n this.setStatus('deadline_exceeded');\n this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[3];\n this.end();\n }\n }, this._finalTimeout);\n }\n\n /** {@inheritDoc} */\n public end(endTimestamp?: SpanTimeInput): string | undefined {\n const endTimestampInS = spanTimeInputToSeconds(endTimestamp);\n\n this._finished = true;\n this.activities = {};\n\n // eslint-disable-next-line deprecation/deprecation\n if (this.op === 'ui.action.click') {\n this.setAttribute(FINISH_REASON_TAG, this._finishReason);\n }\n\n // eslint-disable-next-line deprecation/deprecation\n if (this.spanRecorder) {\n DEBUG_BUILD &&\n // eslint-disable-next-line deprecation/deprecation\n logger.log('[Tracing] finishing IdleTransaction', new Date(endTimestampInS * 1000).toISOString(), this.op);\n\n for (const callback of this._beforeFinishCallbacks) {\n callback(this, endTimestampInS);\n }\n\n // eslint-disable-next-line deprecation/deprecation\n this.spanRecorder.spans = this.spanRecorder.spans.filter((span: Span) => {\n // If we are dealing with the transaction itself, we just return it\n if (span.spanContext().spanId === this.spanContext().spanId) {\n return true;\n }\n\n // We cancel all pending spans with status \"cancelled\" to indicate the idle transaction was finished early\n if (!spanToJSON(span).timestamp) {\n span.setStatus('cancelled');\n span.end(endTimestampInS);\n DEBUG_BUILD &&\n logger.log('[Tracing] cancelling span since transaction ended early', JSON.stringify(span, undefined, 2));\n }\n\n const { start_timestamp: startTime, timestamp: endTime } = spanToJSON(span);\n const spanStartedBeforeTransactionFinish = startTime && startTime < endTimestampInS;\n\n // Add a delta with idle timeout so that we prevent false positives\n const timeoutWithMarginOfError = (this._finalTimeout + this._idleTimeout) / 1000;\n const spanEndedBeforeFinalTimeout = endTime && startTime && endTime - startTime < timeoutWithMarginOfError;\n\n if (DEBUG_BUILD) {\n const stringifiedSpan = JSON.stringify(span, undefined, 2);\n if (!spanStartedBeforeTransactionFinish) {\n logger.log('[Tracing] discarding Span since it happened after Transaction was finished', stringifiedSpan);\n } else if (!spanEndedBeforeFinalTimeout) {\n logger.log('[Tracing] discarding Span since it finished after Transaction final timeout', stringifiedSpan);\n }\n }\n\n return spanStartedBeforeTransactionFinish && spanEndedBeforeFinalTimeout;\n });\n\n DEBUG_BUILD && logger.log('[Tracing] flushing IdleTransaction');\n } else {\n DEBUG_BUILD && logger.log('[Tracing] No active IdleTransaction');\n }\n\n // if `this._onScope` is `true`, the transaction put itself on the scope when it started\n if (this._onScope) {\n // eslint-disable-next-line deprecation/deprecation\n const scope = this._idleHub.getScope();\n // eslint-disable-next-line deprecation/deprecation\n if (scope.getTransaction() === this) {\n // eslint-disable-next-line deprecation/deprecation\n scope.setSpan(undefined);\n }\n }\n\n return super.end(endTimestamp);\n }\n\n /**\n * Register a callback function that gets executed before the transaction finishes.\n * Useful for cleanup or if you want to add any additional spans based on current context.\n *\n * This is exposed because users have no other way of running something before an idle transaction\n * finishes.\n */\n public registerBeforeFinishCallback(callback: BeforeFinishCallback): void {\n this._beforeFinishCallbacks.push(callback);\n }\n\n /**\n * @inheritDoc\n */\n public initSpanRecorder(maxlen?: number): void {\n // eslint-disable-next-line deprecation/deprecation\n if (!this.spanRecorder) {\n const pushActivity = (id: string): void => {\n if (this._finished) {\n return;\n }\n this._pushActivity(id);\n };\n const popActivity = (id: string): void => {\n if (this._finished) {\n return;\n }\n this._popActivity(id);\n };\n\n // eslint-disable-next-line deprecation/deprecation\n this.spanRecorder = new IdleTransactionSpanRecorder(pushActivity, popActivity, this.spanContext().spanId, maxlen);\n\n // Start heartbeat so that transactions do not run forever.\n DEBUG_BUILD && logger.log('Starting heartbeat');\n this._pingHeartbeat();\n }\n // eslint-disable-next-line deprecation/deprecation\n this.spanRecorder.add(this);\n }\n\n /**\n * Cancels the existing idle timeout, if there is one.\n * @param restartOnChildSpanChange Default is `true`.\n * If set to false the transaction will end\n * with the last child span.\n */\n public cancelIdleTimeout(\n endTimestamp?: Parameters<IdleTransaction['end']>[0],\n {\n restartOnChildSpanChange,\n }: {\n restartOnChildSpanChange?: boolean;\n } = {\n restartOnChildSpanChange: true,\n },\n ): void {\n this._idleTimeoutCanceledPermanently = restartOnChildSpanChange === false;\n if (this._idleTimeoutID) {\n clearTimeout(this._idleTimeoutID);\n this._idleTimeoutID = undefined;\n\n if (Object.keys(this.activities).length === 0 && this._idleTimeoutCanceledPermanently) {\n this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[5];\n this.end(endTimestamp);\n }\n }\n }\n\n /**\n * Temporary method used to externally set the transaction's `finishReason`\n *\n * ** WARNING**\n * This is for the purpose of experimentation only and will be removed in the near future, do not use!\n *\n * @internal\n *\n */\n public setFinishReason(reason: string): void {\n this._finishReason = reason;\n }\n\n /**\n * Permits the IdleTransaction to automatically end itself via the idle timeout and heartbeat mechanisms when the `delayAutoFinishUntilSignal` option was set to `true`.\n */\n public sendAutoFinishSignal(): void {\n if (!this._autoFinishAllowed) {\n DEBUG_BUILD && logger.log('[Tracing] Received finish signal for idle transaction.');\n this._restartIdleTimeout();\n this._autoFinishAllowed = true;\n }\n }\n\n /**\n * Restarts idle timeout, if there is no running idle timeout it will start one.\n */\n private _restartIdleTimeout(endTimestamp?: Parameters<IdleTransaction['end']>[0]): void {\n this.cancelIdleTimeout();\n this._idleTimeoutID = setTimeout(() => {\n if (!this._finished && Object.keys(this.activities).length === 0) {\n this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[1];\n this.end(endTimestamp);\n }\n }, this._idleTimeout);\n }\n\n /**\n * Start tracking a specific activity.\n * @param spanId The span id that represents the activity\n */\n private _pushActivity(spanId: string): void {\n this.cancelIdleTimeout(undefined, { restartOnChildSpanChange: !this._idleTimeoutCanceledPermanently });\n DEBUG_BUILD && logger.log(`[Tracing] pushActivity: ${spanId}`);\n this.activities[spanId] = true;\n DEBUG_BUILD && logger.log('[Tracing] new activities count', Object.keys(this.activities).length);\n }\n\n /**\n * Remove an activity from usage\n * @param spanId The span id that represents the activity\n */\n private _popActivity(spanId: string): void {\n if (this.activities[spanId]) {\n DEBUG_BUILD && logger.log(`[Tracing] popActivity ${spanId}`);\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete this.activities[spanId];\n DEBUG_BUILD && logger.log('[Tracing] new activities count', Object.keys(this.activities).length);\n }\n\n if (Object.keys(this.activities).length === 0) {\n const endTimestamp = timestampInSeconds();\n if (this._idleTimeoutCanceledPermanently) {\n if (this._autoFinishAllowed) {\n this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[5];\n this.end(endTimestamp);\n }\n } else {\n // We need to add the timeout here to have the real endtimestamp of the transaction\n // Remember timestampInSeconds is in seconds, timeout is in ms\n this._restartIdleTimeout(endTimestamp + this._idleTimeout / 1000);\n }\n }\n }\n\n /**\n * Checks when entries of this.activities are not changing for 3 beats.\n * If this occurs we finish the transaction.\n */\n private _beat(): void {\n // We should not be running heartbeat if the idle transaction is finished.\n if (this._finished) {\n return;\n }\n\n const heartbeatString = Object.keys(this.activities).join('');\n\n if (heartbeatString === this._prevHeartbeatString) {\n this._heartbeatCounter++;\n } else {\n this._heartbeatCounter = 1;\n }\n\n this._prevHeartbeatString = heartbeatString;\n\n if (this._heartbeatCounter >= 3) {\n if (this._autoFinishAllowed) {\n DEBUG_BUILD && logger.log('[Tracing] Transaction finished because of no change for 3 heart beats');\n this.setStatus('deadline_exceeded');\n this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[0];\n this.end();\n }\n } else {\n this._pingHeartbeat();\n }\n }\n\n /**\n * Pings the heartbeat\n */\n private _pingHeartbeat(): void {\n DEBUG_BUILD && logger.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`);\n setTimeout(() => {\n this._beat();\n }, this._heartbeatInterval);\n }\n}\n", "import type { Options, SamplingContext } from '@sentry/types';\nimport { isNaN, logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../debug-build';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE } from '../semanticAttributes';\nimport { hasTracingEnabled } from '../utils/hasTracingEnabled';\nimport { spanToJSON } from '../utils/spanUtils';\nimport type { Transaction } from './transaction';\n\n/**\n * Makes a sampling decision for the given transaction and stores it on the transaction.\n *\n * Called every time a transaction is created. Only transactions which emerge with a `sampled` value of `true` will be\n * sent to Sentry.\n *\n * This method muttes the given `transaction` and will set the `sampled` value on it.\n * It returns the same transaction, for convenience.\n */\nexport function sampleTransaction<T extends Transaction>(\n transaction: T,\n options: Pick<Options, 'tracesSampleRate' | 'tracesSampler' | 'enableTracing'>,\n samplingContext: SamplingContext,\n): T {\n // nothing to do if tracing is not enabled\n if (!hasTracingEnabled(options)) {\n // eslint-disable-next-line deprecation/deprecation\n transaction.sampled = false;\n return transaction;\n }\n\n // if the user has forced a sampling decision by passing a `sampled` value in their transaction context, go with that\n // eslint-disable-next-line deprecation/deprecation\n if (transaction.sampled !== undefined) {\n // eslint-disable-next-line deprecation/deprecation\n transaction.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, Number(transaction.sampled));\n return transaction;\n }\n\n // we would have bailed already if neither `tracesSampler` nor `tracesSampleRate` nor `enableTracing` were defined, so one of these should\n // work; prefer the hook if so\n let sampleRate;\n if (typeof options.tracesSampler === 'function') {\n sampleRate = options.tracesSampler(samplingContext);\n transaction.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, Number(sampleRate));\n } else if (samplingContext.parentSampled !== undefined) {\n sampleRate = samplingContext.parentSampled;\n } else if (typeof options.tracesSampleRate !== 'undefined') {\n sampleRate = options.tracesSampleRate;\n transaction.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, Number(sampleRate));\n } else {\n // When `enableTracing === true`, we use a sample rate of 100%\n sampleRate = 1;\n transaction.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, sampleRate);\n }\n\n // Since this is coming from the user (or from a function provided by the user), who knows what we might get. (The\n // only valid values are booleans or numbers between 0 and 1.)\n if (!isValidSampleRate(sampleRate)) {\n DEBUG_BUILD && logger.warn('[Tracing] Discarding transaction because of invalid sample rate.');\n // eslint-disable-next-line deprecation/deprecation\n transaction.sampled = false;\n return transaction;\n }\n\n // if the function returned 0 (or false), or if `tracesSampleRate` is 0, it's a sign the transaction should be dropped\n if (!sampleRate) {\n DEBUG_BUILD &&\n logger.log(\n `[Tracing] Discarding transaction because ${\n typeof options.tracesSampler === 'function'\n ? 'tracesSampler returned 0 or false'\n : 'a negative sampling decision was inherited or tracesSampleRate is set to 0'\n }`,\n );\n // eslint-disable-next-line deprecation/deprecation\n transaction.sampled = false;\n return transaction;\n }\n\n // Now we roll the dice. Math.random is inclusive of 0, but not of 1, so strict < is safe here. In case sampleRate is\n // a boolean, the < comparison will cause it to be automatically cast to 1 if it's true and 0 if it's false.\n // eslint-disable-next-line deprecation/deprecation\n transaction.sampled = Math.random() < (sampleRate as number | boolean);\n\n // if we're not going to keep it, we're done\n // eslint-disable-next-line deprecation/deprecation\n if (!transaction.sampled) {\n DEBUG_BUILD &&\n logger.log(\n `[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(\n sampleRate,\n )})`,\n );\n return transaction;\n }\n\n DEBUG_BUILD &&\n // eslint-disable-next-line deprecation/deprecation\n logger.log(`[Tracing] starting ${transaction.op} transaction - ${spanToJSON(transaction).description}`);\n return transaction;\n}\n\n/**\n * Checks the given sample rate to make sure it is valid type and value (a boolean, or a number between 0 and 1).\n */\nexport function isValidSampleRate(rate: unknown): boolean {\n // we need to check NaN explicitly because it's of type 'number' and therefore wouldn't get caught by this typecheck\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (isNaN(rate) || !(typeof rate === 'number' || typeof rate === 'boolean')) {\n DEBUG_BUILD &&\n logger.warn(\n `[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(\n rate,\n )} of type ${JSON.stringify(typeof rate)}.`,\n );\n return false;\n }\n\n // in case sampleRate is a boolean, it will get automatically cast to 1 if it's true and 0 if it's false\n if (rate < 0 || rate > 1) {\n DEBUG_BUILD &&\n logger.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${rate}.`);\n return false;\n }\n return true;\n}\n", "import type { ClientOptions, CustomSamplingContext, TransactionContext } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../debug-build';\nimport type { Hub } from '../hub';\nimport { getMainCarrier } from '../hub';\nimport { spanToTraceHeader } from '../utils/spanUtils';\nimport { registerErrorInstrumentation } from './errors';\nimport { IdleTransaction } from './idletransaction';\nimport { sampleTransaction } from './sampling';\nimport { Transaction } from './transaction';\n\n/** Returns all trace headers that are currently on the top scope. */\n// eslint-disable-next-line deprecation/deprecation\nfunction traceHeaders(this: Hub): { [key: string]: string } {\n // eslint-disable-next-line deprecation/deprecation\n const scope = this.getScope();\n // eslint-disable-next-line deprecation/deprecation\n const span = scope.getSpan();\n\n return span\n ? {\n 'sentry-trace': spanToTraceHeader(span),\n }\n : {};\n}\n\n/**\n * Creates a new transaction and adds a sampling decision if it doesn't yet have one.\n *\n * The Hub.startTransaction method delegates to this method to do its work, passing the Hub instance in as `this`, as if\n * it had been called on the hub directly. Exists as a separate function so that it can be injected into the class as an\n * \"extension method.\"\n *\n * @param this: The Hub starting the transaction\n * @param transactionContext: Data used to configure the transaction\n * @param CustomSamplingContext: Optional data to be provided to the `tracesSampler` function (if any)\n *\n * @returns The new transaction\n *\n * @see {@link Hub.startTransaction}\n */\nfunction _startTransaction(\n // eslint-disable-next-line deprecation/deprecation\n this: Hub,\n transactionContext: TransactionContext,\n customSamplingContext?: CustomSamplingContext,\n): Transaction {\n // eslint-disable-next-line deprecation/deprecation\n const client = this.getClient();\n const options: Partial<ClientOptions> = (client && client.getOptions()) || {};\n\n const configInstrumenter = options.instrumenter || 'sentry';\n const transactionInstrumenter = transactionContext.instrumenter || 'sentry';\n\n if (configInstrumenter !== transactionInstrumenter) {\n DEBUG_BUILD &&\n logger.error(\n `A transaction was started with instrumenter=\\`${transactionInstrumenter}\\`, but the SDK is configured with the \\`${configInstrumenter}\\` instrumenter.\nThe transaction will not be sampled. Please use the ${configInstrumenter} instrumentation to start transactions.`,\n );\n\n // eslint-disable-next-line deprecation/deprecation\n transactionContext.sampled = false;\n }\n\n // eslint-disable-next-line deprecation/deprecation\n let transaction = new Transaction(transactionContext, this);\n transaction = sampleTransaction(transaction, options, {\n name: transactionContext.name,\n parentSampled: transactionContext.parentSampled,\n transactionContext,\n attributes: {\n // eslint-disable-next-line deprecation/deprecation\n ...transactionContext.data,\n ...transactionContext.attributes,\n },\n ...customSamplingContext,\n });\n if (transaction.isRecording()) {\n transaction.initSpanRecorder(options._experiments && (options._experiments.maxSpans as number));\n }\n if (client && client.emit) {\n client.emit('startTransaction', transaction);\n }\n return transaction;\n}\n\n/**\n * Create new idle transaction.\n */\nexport function startIdleTransaction(\n // eslint-disable-next-line deprecation/deprecation\n hub: Hub,\n transactionContext: TransactionContext,\n idleTimeout: number,\n finalTimeout: number,\n onScope?: boolean,\n customSamplingContext?: CustomSamplingContext,\n heartbeatInterval?: number,\n delayAutoFinishUntilSignal: boolean = false,\n): IdleTransaction {\n // eslint-disable-next-line deprecation/deprecation\n const client = hub.getClient();\n const options: Partial<ClientOptions> = (client && client.getOptions()) || {};\n\n // eslint-disable-next-line deprecation/deprecation\n let transaction = new IdleTransaction(\n transactionContext,\n hub,\n idleTimeout,\n finalTimeout,\n heartbeatInterval,\n onScope,\n delayAutoFinishUntilSignal,\n );\n transaction = sampleTransaction(transaction, options, {\n name: transactionContext.name,\n parentSampled: transactionContext.parentSampled,\n transactionContext,\n attributes: {\n // eslint-disable-next-line deprecation/deprecation\n ...transactionContext.data,\n ...transactionContext.attributes,\n },\n ...customSamplingContext,\n });\n if (transaction.isRecording()) {\n transaction.initSpanRecorder(options._experiments && (options._experiments.maxSpans as number));\n }\n if (client && client.emit) {\n client.emit('startTransaction', transaction);\n }\n return transaction;\n}\n\n/**\n * Adds tracing extensions to the global hub.\n */\nexport function addTracingExtensions(): void {\n const carrier = getMainCarrier();\n if (!carrier.__SENTRY__) {\n return;\n }\n carrier.__SENTRY__.extensions = carrier.__SENTRY__.extensions || {};\n if (!carrier.__SENTRY__.extensions.startTransaction) {\n carrier.__SENTRY__.extensions.startTransaction = _startTransaction;\n }\n if (!carrier.__SENTRY__.extensions.traceHeaders) {\n carrier.__SENTRY__.extensions.traceHeaders = traceHeaders;\n }\n\n registerErrorInstrumentation();\n}\n", "import type { MeasurementUnit } from '@sentry/types';\n\nimport { getActiveTransaction } from './utils';\n\n/**\n * Adds a measurement to the current active transaction.\n */\nexport function setMeasurement(name: string, value: number, unit: MeasurementUnit): void {\n // eslint-disable-next-line deprecation/deprecation\n const transaction = getActiveTransaction();\n if (transaction) {\n // eslint-disable-next-line deprecation/deprecation\n transaction.setMeasurement(name, value, unit);\n }\n}\n", "import type {\n DsnComponents,\n Event,\n EventEnvelope,\n EventItem,\n SdkInfo,\n SdkMetadata,\n Session,\n SessionAggregates,\n SessionEnvelope,\n SessionItem,\n} from '@sentry/types';\nimport {\n createEnvelope,\n createEventEnvelopeHeaders,\n dsnToString,\n getSdkMetadataForEnvelopeHeader,\n} from '@sentry/utils';\n\n/**\n * Apply SdkInfo (name, version, packages, integrations) to the corresponding event key.\n * Merge with existing data if any.\n **/\nfunction enhanceEventWithSdkInfo(event: Event, sdkInfo?: SdkInfo): Event {\n if (!sdkInfo) {\n return event;\n }\n event.sdk = event.sdk || {};\n event.sdk.name = event.sdk.name || sdkInfo.name;\n event.sdk.version = event.sdk.version || sdkInfo.version;\n event.sdk.integrations = [...(event.sdk.integrations || []), ...(sdkInfo.integrations || [])];\n event.sdk.packages = [...(event.sdk.packages || []), ...(sdkInfo.packages || [])];\n return event;\n}\n\n/** Creates an envelope from a Session */\nexport function createSessionEnvelope(\n session: Session | SessionAggregates,\n dsn?: DsnComponents,\n metadata?: SdkMetadata,\n tunnel?: string,\n): SessionEnvelope {\n const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata);\n const envelopeHeaders = {\n sent_at: new Date().toISOString(),\n ...(sdkInfo && { sdk: sdkInfo }),\n ...(!!tunnel && dsn && { dsn: dsnToString(dsn) }),\n };\n\n const envelopeItem: SessionItem =\n 'aggregates' in session ? [{ type: 'sessions' }, session] : [{ type: 'session' }, session.toJSON()];\n\n return createEnvelope<SessionEnvelope>(envelopeHeaders, [envelopeItem]);\n}\n\n/**\n * Create an Envelope from an event.\n */\nexport function createEventEnvelope(\n event: Event,\n dsn?: DsnComponents,\n metadata?: SdkMetadata,\n tunnel?: string,\n): EventEnvelope {\n const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata);\n\n /*\n Note: Due to TS, event.type may be `replay_event`, theoretically.\n In practice, we never call `createEventEnvelope` with `replay_event` type,\n and we'd have to adjut a looot of types to make this work properly.\n We want to avoid casting this around, as that could lead to bugs (e.g. when we add another type)\n So the safe choice is to really guard against the replay_event type here.\n */\n const eventType = event.type && event.type !== 'replay_event' ? event.type : 'event';\n\n enhanceEventWithSdkInfo(event, metadata && metadata.sdk);\n\n const envelopeHeaders = createEventEnvelopeHeaders(event, sdkInfo, tunnel, dsn);\n\n // Prevent this data (which, if it exists, was used in earlier steps in the processing pipeline) from being sent to\n // sentry. (Note: Our use of this property comes and goes with whatever we might be debugging, whatever hacks we may\n // have temporarily added, etc. Even if we don't happen to be using it at some point in the future, let's not get rid\n // of this `delete`, lest we miss putting it back in the next time the property is in use.)\n delete event.sdkProcessingMetadata;\n\n const eventItem: EventItem = [{ type: eventType }, event];\n return createEnvelope<EventEnvelope>(envelopeHeaders, [eventItem]);\n}\n", "import type { ClientOptions, DsnComponents, DsnLike, SdkInfo } from '@sentry/types';\nimport { dsnToString, makeDsn, urlEncode } from '@sentry/utils';\n\nconst SENTRY_API_VERSION = '7';\n\n/** Returns the prefix to construct Sentry ingestion API endpoints. */\nfunction getBaseApiEndpoint(dsn: DsnComponents): string {\n const protocol = dsn.protocol ? `${dsn.protocol}:` : '';\n const port = dsn.port ? `:${dsn.port}` : '';\n return `${protocol}//${dsn.host}${port}${dsn.path ? `/${dsn.path}` : ''}/api/`;\n}\n\n/** Returns the ingest API endpoint for target. */\nfunction _getIngestEndpoint(dsn: DsnComponents): string {\n return `${getBaseApiEndpoint(dsn)}${dsn.projectId}/envelope/`;\n}\n\n/** Returns a URL-encoded string with auth config suitable for a query string. */\nfunction _encodedAuth(dsn: DsnComponents, sdkInfo: SdkInfo | undefined): string {\n return urlEncode({\n // We send only the minimum set of required information. See\n // https://github.com/getsentry/sentry-javascript/issues/2572.\n sentry_key: dsn.publicKey,\n sentry_version: SENTRY_API_VERSION,\n ...(sdkInfo && { sentry_client: `${sdkInfo.name}/${sdkInfo.version}` }),\n });\n}\n\n/**\n * Returns the envelope endpoint URL with auth in the query string.\n *\n * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.\n */\nexport function getEnvelopeEndpointWithUrlEncodedAuth(\n dsn: DsnComponents,\n // TODO (v8): Remove `tunnelOrOptions` in favor of `options`, and use the substitute code below\n // options: ClientOptions = {} as ClientOptions,\n tunnelOrOptions: string | ClientOptions = {} as ClientOptions,\n): string {\n // TODO (v8): Use this code instead\n // const { tunnel, _metadata = {} } = options;\n // return tunnel ? tunnel : `${_getIngestEndpoint(dsn)}?${_encodedAuth(dsn, _metadata.sdk)}`;\n\n const tunnel = typeof tunnelOrOptions === 'string' ? tunnelOrOptions : tunnelOrOptions.tunnel;\n const sdkInfo =\n typeof tunnelOrOptions === 'string' || !tunnelOrOptions._metadata ? undefined : tunnelOrOptions._metadata.sdk;\n\n return tunnel ? tunnel : `${_getIngestEndpoint(dsn)}?${_encodedAuth(dsn, sdkInfo)}`;\n}\n\n/** Returns the url to the report dialog endpoint. */\nexport function getReportDialogEndpoint(\n dsnLike: DsnLike,\n dialogOptions: {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any;\n user?: { name?: string; email?: string };\n },\n): string {\n const dsn = makeDsn(dsnLike);\n if (!dsn) {\n return '';\n }\n\n const endpoint = `${getBaseApiEndpoint(dsn)}embed/error-page/`;\n\n let encodedOptions = `dsn=${dsnToString(dsn)}`;\n for (const key in dialogOptions) {\n if (key === 'dsn') {\n continue;\n }\n\n if (key === 'onClose') {\n continue;\n }\n\n if (key === 'user') {\n const user = dialogOptions.user;\n if (!user) {\n continue;\n }\n if (user.name) {\n encodedOptions += `&name=${encodeURIComponent(user.name)}`;\n }\n if (user.email) {\n encodedOptions += `&email=${encodeURIComponent(user.email)}`;\n }\n } else {\n encodedOptions += `&${encodeURIComponent(key)}=${encodeURIComponent(dialogOptions[key] as string)}`;\n }\n }\n\n return `${endpoint}?${encodedOptions}`;\n}\n", "import type {\n Client,\n Event,\n EventHint,\n Integration,\n IntegrationClass,\n IntegrationFn,\n IntegrationFnResult,\n Options,\n} from '@sentry/types';\nimport { arrayify, logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from './debug-build';\nimport { addGlobalEventProcessor } from './eventProcessors';\nimport { getClient } from './exports';\nimport { getCurrentHub } from './hub';\n\ndeclare module '@sentry/types' {\n interface Integration {\n isDefaultInstance?: boolean;\n }\n}\n\nexport const installedIntegrations: string[] = [];\n\n/** Map of integrations assigned to a client */\nexport type IntegrationIndex = {\n [key: string]: Integration;\n};\n\n/**\n * Remove duplicates from the given array, preferring the last instance of any duplicate. Not guaranteed to\n * preseve the order of integrations in the array.\n *\n * @private\n */\nfunction filterDuplicates(integrations: Integration[]): Integration[] {\n const integrationsByName: { [key: string]: Integration } = {};\n\n integrations.forEach(currentInstance => {\n const { name } = currentInstance;\n\n const existingInstance = integrationsByName[name];\n\n // We want integrations later in the array to overwrite earlier ones of the same type, except that we never want a\n // default instance to overwrite an existing user instance\n if (existingInstance && !existingInstance.isDefaultInstance && currentInstance.isDefaultInstance) {\n return;\n }\n\n integrationsByName[name] = currentInstance;\n });\n\n return Object.keys(integrationsByName).map(k => integrationsByName[k]);\n}\n\n/** Gets integrations to install */\nexport function getIntegrationsToSetup(options: Pick<Options, 'defaultIntegrations' | 'integrations'>): Integration[] {\n const defaultIntegrations = options.defaultIntegrations || [];\n const userIntegrations = options.integrations;\n\n // We flag default instances, so that later we can tell them apart from any user-created instances of the same class\n defaultIntegrations.forEach(integration => {\n integration.isDefaultInstance = true;\n });\n\n let integrations: Integration[];\n\n if (Array.isArray(userIntegrations)) {\n integrations = [...defaultIntegrations, ...userIntegrations];\n } else if (typeof userIntegrations === 'function') {\n integrations = arrayify(userIntegrations(defaultIntegrations));\n } else {\n integrations = defaultIntegrations;\n }\n\n const finalIntegrations = filterDuplicates(integrations);\n\n // The `Debug` integration prints copies of the `event` and `hint` which will be passed to `beforeSend` or\n // `beforeSendTransaction`. It therefore has to run after all other integrations, so that the changes of all event\n // processors will be reflected in the printed values. For lack of a more elegant way to guarantee that, we therefore\n // locate it and, assuming it exists, pop it out of its current spot and shove it onto the end of the array.\n const debugIndex = findIndex(finalIntegrations, integration => integration.name === 'Debug');\n if (debugIndex !== -1) {\n const [debugInstance] = finalIntegrations.splice(debugIndex, 1);\n finalIntegrations.push(debugInstance);\n }\n\n return finalIntegrations;\n}\n\n/**\n * Given a list of integration instances this installs them all. When `withDefaults` is set to `true` then all default\n * integrations are added unless they were already provided before.\n * @param integrations array of integration instances\n * @param withDefault should enable default integrations\n */\nexport function setupIntegrations(client: Client, integrations: Integration[]): IntegrationIndex {\n const integrationIndex: IntegrationIndex = {};\n\n integrations.forEach(integration => {\n // guard against empty provided integrations\n if (integration) {\n setupIntegration(client, integration, integrationIndex);\n }\n });\n\n return integrationIndex;\n}\n\n/**\n * Execute the `afterAllSetup` hooks of the given integrations.\n */\nexport function afterSetupIntegrations(client: Client, integrations: Integration[]): void {\n for (const integration of integrations) {\n // guard against empty provided integrations\n if (integration && integration.afterAllSetup) {\n integration.afterAllSetup(client);\n }\n }\n}\n\n/** Setup a single integration. */\nexport function setupIntegration(client: Client, integration: Integration, integrationIndex: IntegrationIndex): void {\n if (integrationIndex[integration.name]) {\n DEBUG_BUILD && logger.log(`Integration skipped because it was already installed: ${integration.name}`);\n return;\n }\n integrationIndex[integration.name] = integration;\n\n // `setupOnce` is only called the first time\n if (installedIntegrations.indexOf(integration.name) === -1) {\n // eslint-disable-next-line deprecation/deprecation\n integration.setupOnce(addGlobalEventProcessor, getCurrentHub);\n installedIntegrations.push(integration.name);\n }\n\n // `setup` is run for each client\n if (integration.setup && typeof integration.setup === 'function') {\n integration.setup(client);\n }\n\n if (client.on && typeof integration.preprocessEvent === 'function') {\n const callback = integration.preprocessEvent.bind(integration) as typeof integration.preprocessEvent;\n client.on('preprocessEvent', (event, hint) => callback(event, hint, client));\n }\n\n if (client.addEventProcessor && typeof integration.processEvent === 'function') {\n const callback = integration.processEvent.bind(integration) as typeof integration.processEvent;\n\n const processor = Object.assign((event: Event, hint: EventHint) => callback(event, hint, client), {\n id: integration.name,\n });\n\n client.addEventProcessor(processor);\n }\n\n DEBUG_BUILD && logger.log(`Integration installed: ${integration.name}`);\n}\n\n/** Add an integration to the current hub's client. */\nexport function addIntegration(integration: Integration): void {\n const client = getClient();\n\n if (!client || !client.addIntegration) {\n DEBUG_BUILD && logger.warn(`Cannot add integration \"${integration.name}\" because no SDK Client is available.`);\n return;\n }\n\n client.addIntegration(integration);\n}\n\n// Polyfill for Array.findIndex(), which is not supported in ES5\nfunction findIndex<T>(arr: T[], callback: (item: T) => boolean): number {\n for (let i = 0; i < arr.length; i++) {\n if (callback(arr[i]) === true) {\n return i;\n }\n }\n\n return -1;\n}\n\n/**\n * Convert a new integration function to the legacy class syntax.\n * In v8, we can remove this and instead export the integration functions directly.\n *\n * @deprecated This will be removed in v8!\n */\nexport function convertIntegrationFnToClass<Fn extends IntegrationFn>(\n name: string,\n fn: Fn,\n): IntegrationClass<Integration> {\n return Object.assign(\n function ConvertedIntegration(...args: Parameters<Fn>): Integration {\n return fn(...args);\n },\n { id: name },\n ) as unknown as IntegrationClass<Integration>;\n}\n\n/**\n * Define an integration function that can be used to create an integration instance.\n * Note that this by design hides the implementation details of the integration, as they are considered internal.\n */\nexport function defineIntegration<Fn extends IntegrationFn>(fn: Fn): (...args: Parameters<Fn>) => IntegrationFnResult {\n return fn;\n}\n", "import type { MeasurementUnit, MetricBucketItem, Primitive } from '@sentry/types';\nimport { dropUndefinedKeys } from '@sentry/utils';\nimport type { MetricType } from './types';\n\n/**\n * Generate bucket key from metric properties.\n */\nexport function getBucketKey(\n metricType: MetricType,\n name: string,\n unit: MeasurementUnit,\n tags: Record<string, string>,\n): string {\n const stringifiedTags = Object.entries(dropUndefinedKeys(tags)).sort((a, b) => a[0].localeCompare(b[0]));\n return `${metricType}${name}${unit}${stringifiedTags}`;\n}\n\n/* eslint-disable no-bitwise */\n/**\n * Simple hash function for strings.\n */\nexport function simpleHash(s: string): number {\n let rv = 0;\n for (let i = 0; i < s.length; i++) {\n const c = s.charCodeAt(i);\n rv = (rv << 5) - rv + c;\n rv &= rv;\n }\n return rv >>> 0;\n}\n/* eslint-enable no-bitwise */\n\n/**\n * Serialize metrics buckets into a string based on statsd format.\n *\n * Example of format:\n * metric.name@second:1:1.2|d|#a:value,b:anothervalue|T12345677\n * Segments:\n * name: metric.name\n * unit: second\n * value: [1, 1.2]\n * type of metric: d (distribution)\n * tags: { a: value, b: anothervalue }\n * timestamp: 12345677\n */\nexport function serializeMetricBuckets(metricBucketItems: MetricBucketItem[]): string {\n let out = '';\n for (const item of metricBucketItems) {\n const tagEntries = Object.entries(item.tags);\n const maybeTags = tagEntries.length > 0 ? `|#${tagEntries.map(([key, value]) => `${key}:${value}`).join(',')}` : '';\n out += `${item.name}@${item.unit}:${item.metric}|${item.metricType}${maybeTags}|T${item.timestamp}\\n`;\n }\n return out;\n}\n\n/** Sanitizes units */\nexport function sanitizeUnit(unit: string): string {\n return unit.replace(/[^\\w]+/gi, '_');\n}\n\n/** Sanitizes metric keys */\nexport function sanitizeMetricKey(key: string): string {\n return key.replace(/[^\\w\\-.]+/gi, '_');\n}\n\nfunction sanitizeTagKey(key: string): string {\n return key.replace(/[^\\w\\-./]+/gi, '');\n}\n\nconst tagValueReplacements: [string, string][] = [\n ['\\n', '\\\\n'],\n ['\\r', '\\\\r'],\n ['\\t', '\\\\t'],\n ['\\\\', '\\\\\\\\'],\n ['|', '\\\\u{7c}'],\n [',', '\\\\u{2c}'],\n];\n\nfunction getCharOrReplacement(input: string): string {\n for (const [search, replacement] of tagValueReplacements) {\n if (input === search) {\n return replacement;\n }\n }\n\n return input;\n}\n\nfunction sanitizeTagValue(value: string): string {\n return [...value].reduce((acc, char) => acc + getCharOrReplacement(char), '');\n}\n\n/**\n * Sanitizes tags.\n */\nexport function sanitizeTags(unsanitizedTags: Record<string, Primitive>): Record<string, string> {\n const tags: Record<string, string> = {};\n for (const key in unsanitizedTags) {\n if (Object.prototype.hasOwnProperty.call(unsanitizedTags, key)) {\n const sanitizedKey = sanitizeTagKey(key);\n tags[sanitizedKey] = sanitizeTagValue(String(unsanitizedTags[key]));\n }\n }\n return tags;\n}\n", "import type { DsnComponents, MetricBucketItem, SdkMetadata, StatsdEnvelope, StatsdItem } from '@sentry/types';\nimport { createEnvelope, dsnToString } from '@sentry/utils';\nimport { serializeMetricBuckets } from './utils';\n\n/**\n * Create envelope from a metric aggregate.\n */\nexport function createMetricEnvelope(\n metricBucketItems: Array<MetricBucketItem>,\n dsn?: DsnComponents,\n metadata?: SdkMetadata,\n tunnel?: string,\n): StatsdEnvelope {\n const headers: StatsdEnvelope[0] = {\n sent_at: new Date().toISOString(),\n };\n\n if (metadata && metadata.sdk) {\n headers.sdk = {\n name: metadata.sdk.name,\n version: metadata.sdk.version,\n };\n }\n\n if (!!tunnel && dsn) {\n headers.dsn = dsnToString(dsn);\n }\n\n const item = createMetricEnvelopeItem(metricBucketItems);\n return createEnvelope<StatsdEnvelope>(headers, [item]);\n}\n\nfunction createMetricEnvelopeItem(metricBucketItems: MetricBucketItem[]): StatsdItem {\n const payload = serializeMetricBuckets(metricBucketItems);\n const metricHeaders: StatsdItem[0] = {\n type: 'statsd',\n length: payload.length,\n };\n return [metricHeaders, payload];\n}\n", "/* eslint-disable max-lines */\nimport type {\n Breadcrumb,\n BreadcrumbHint,\n Client,\n ClientOptions,\n DataCategory,\n DsnComponents,\n DynamicSamplingContext,\n Envelope,\n ErrorEvent,\n Event,\n EventDropReason,\n EventHint,\n EventProcessor,\n FeedbackEvent,\n Integration,\n IntegrationClass,\n MetricBucketItem,\n MetricsAggregator,\n Outcome,\n ParameterizedString,\n SdkMetadata,\n Session,\n SessionAggregates,\n Severity,\n SeverityLevel,\n StartSpanOptions,\n Transaction,\n TransactionEvent,\n Transport,\n TransportMakeRequestResponse,\n} from '@sentry/types';\nimport {\n SentryError,\n SyncPromise,\n addItemToEnvelope,\n checkOrSetAlreadyCaught,\n createAttachmentEnvelopeItem,\n isParameterizedString,\n isPlainObject,\n isPrimitive,\n isThenable,\n logger,\n makeDsn,\n rejectedSyncPromise,\n resolvedSyncPromise,\n} from '@sentry/utils';\n\nimport { getEnvelopeEndpointWithUrlEncodedAuth } from './api';\nimport { DEBUG_BUILD } from './debug-build';\nimport { createEventEnvelope, createSessionEnvelope } from './envelope';\nimport { getClient } from './exports';\nimport { getIsolationScope } from './hub';\nimport type { IntegrationIndex } from './integration';\nimport { afterSetupIntegrations } from './integration';\nimport { setupIntegration, setupIntegrations } from './integration';\nimport { createMetricEnvelope } from './metrics/envelope';\nimport type { Scope } from './scope';\nimport { updateSession } from './session';\nimport { getDynamicSamplingContextFromClient } from './tracing/dynamicSamplingContext';\nimport { prepareEvent } from './utils/prepareEvent';\n\nconst ALREADY_SEEN_ERROR = \"Not capturing exception because it's already been captured.\";\n\n/**\n * Base implementation for all JavaScript SDK clients.\n *\n * Call the constructor with the corresponding options\n * specific to the client subclass. To access these options later, use\n * {@link Client.getOptions}.\n *\n * If a Dsn is specified in the options, it will be parsed and stored. Use\n * {@link Client.getDsn} to retrieve the Dsn at any moment. In case the Dsn is\n * invalid, the constructor will throw a {@link SentryException}. Note that\n * without a valid Dsn, the SDK will not send any events to Sentry.\n *\n * Before sending an event, it is passed through\n * {@link BaseClient._prepareEvent} to add SDK information and scope data\n * (breadcrumbs and context). To add more custom information, override this\n * method and extend the resulting prepared event.\n *\n * To issue automatically created events (e.g. via instrumentation), use\n * {@link Client.captureEvent}. It will prepare the event and pass it through\n * the callback lifecycle. To issue auto-breadcrumbs, use\n * {@link Client.addBreadcrumb}.\n *\n * @example\n * class NodeClient extends BaseClient<NodeOptions> {\n * public constructor(options: NodeOptions) {\n * super(options);\n * }\n *\n * // ...\n * }\n */\nexport abstract class BaseClient<O extends ClientOptions> implements Client<O> {\n /**\n * A reference to a metrics aggregator\n *\n * @experimental Note this is alpha API. It may experience breaking changes in the future.\n */\n public metricsAggregator?: MetricsAggregator;\n\n /** Options passed to the SDK. */\n protected readonly _options: O;\n\n /** The client Dsn, if specified in options. Without this Dsn, the SDK will be disabled. */\n protected readonly _dsn?: DsnComponents;\n\n protected readonly _transport?: Transport;\n\n /** Array of set up integrations. */\n protected _integrations: IntegrationIndex;\n\n /** Indicates whether this client's integrations have been set up. */\n protected _integrationsInitialized: boolean;\n\n /** Number of calls being processed */\n protected _numProcessing: number;\n\n protected _eventProcessors: EventProcessor[];\n\n /** Holds flushable */\n private _outcomes: { [key: string]: number };\n\n // eslint-disable-next-line @typescript-eslint/ban-types\n private _hooks: Record<string, Function[]>;\n\n /**\n * Initializes this client instance.\n *\n * @param options Options for the client.\n */\n protected constructor(options: O) {\n this._options = options;\n this._integrations = {};\n this._integrationsInitialized = false;\n this._numProcessing = 0;\n this._outcomes = {};\n this._hooks = {};\n this._eventProcessors = [];\n\n if (options.dsn) {\n this._dsn = makeDsn(options.dsn);\n } else {\n DEBUG_BUILD && logger.warn('No DSN provided, client will not send events.');\n }\n\n if (this._dsn) {\n const url = getEnvelopeEndpointWithUrlEncodedAuth(this._dsn, options);\n this._transport = options.transport({\n tunnel: this._options.tunnel,\n recordDroppedEvent: this.recordDroppedEvent.bind(this),\n ...options.transportOptions,\n url,\n });\n }\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n public captureException(exception: any, hint?: EventHint, scope?: Scope): string | undefined {\n // ensure we haven't captured this very object before\n if (checkOrSetAlreadyCaught(exception)) {\n DEBUG_BUILD && logger.log(ALREADY_SEEN_ERROR);\n return;\n }\n\n let eventId: string | undefined = hint && hint.event_id;\n\n this._process(\n this.eventFromException(exception, hint)\n .then(event => this._captureEvent(event, hint, scope))\n .then(result => {\n eventId = result;\n }),\n );\n\n return eventId;\n }\n\n /**\n * @inheritDoc\n */\n public captureMessage(\n message: ParameterizedString,\n // eslint-disable-next-line deprecation/deprecation\n level?: Severity | SeverityLevel,\n hint?: EventHint,\n scope?: Scope,\n ): string | undefined {\n let eventId: string | undefined = hint && hint.event_id;\n\n const eventMessage = isParameterizedString(message) ? message : String(message);\n\n const promisedEvent = isPrimitive(message)\n ? this.eventFromMessage(eventMessage, level, hint)\n : this.eventFromException(message, hint);\n\n this._process(\n promisedEvent\n .then(event => this._captureEvent(event, hint, scope))\n .then(result => {\n eventId = result;\n }),\n );\n\n return eventId;\n }\n\n /**\n * @inheritDoc\n */\n public captureEvent(event: Event, hint?: EventHint, scope?: Scope): string | undefined {\n // ensure we haven't captured this very object before\n if (hint && hint.originalException && checkOrSetAlreadyCaught(hint.originalException)) {\n DEBUG_BUILD && logger.log(ALREADY_SEEN_ERROR);\n return;\n }\n\n let eventId: string | undefined = hint && hint.event_id;\n\n const sdkProcessingMetadata = event.sdkProcessingMetadata || {};\n const capturedSpanScope: Scope | undefined = sdkProcessingMetadata.capturedSpanScope;\n\n this._process(\n this._captureEvent(event, hint, capturedSpanScope || scope).then(result => {\n eventId = result;\n }),\n );\n\n return eventId;\n }\n\n /**\n * @inheritDoc\n */\n public captureSession(session: Session): void {\n if (!(typeof session.release === 'string')) {\n DEBUG_BUILD && logger.warn('Discarded session because of missing or non-string release');\n } else {\n this.sendSession(session);\n // After sending, we set init false to indicate it's not the first occurrence\n updateSession(session, { init: false });\n }\n }\n\n /**\n * @inheritDoc\n */\n public getDsn(): DsnComponents | undefined {\n return this._dsn;\n }\n\n /**\n * @inheritDoc\n */\n public getOptions(): O {\n return this._options;\n }\n\n /**\n * @see SdkMetadata in @sentry/types\n *\n * @return The metadata of the SDK\n */\n public getSdkMetadata(): SdkMetadata | undefined {\n return this._options._metadata;\n }\n\n /**\n * @inheritDoc\n */\n public getTransport(): Transport | undefined {\n return this._transport;\n }\n\n /**\n * @inheritDoc\n */\n public flush(timeout?: number): PromiseLike<boolean> {\n const transport = this._transport;\n if (transport) {\n if (this.metricsAggregator) {\n this.metricsAggregator.flush();\n }\n return this._isClientDoneProcessing(timeout).then(clientFinished => {\n return transport.flush(timeout).then(transportFlushed => clientFinished && transportFlushed);\n });\n } else {\n return resolvedSyncPromise(true);\n }\n }\n\n /**\n * @inheritDoc\n */\n public close(timeout?: number): PromiseLike<boolean> {\n return this.flush(timeout).then(result => {\n this.getOptions().enabled = false;\n if (this.metricsAggregator) {\n this.metricsAggregator.close();\n }\n return result;\n });\n }\n\n /** Get all installed event processors. */\n public getEventProcessors(): EventProcessor[] {\n return this._eventProcessors;\n }\n\n /** @inheritDoc */\n public addEventProcessor(eventProcessor: EventProcessor): void {\n this._eventProcessors.push(eventProcessor);\n }\n\n /**\n * This is an internal function to setup all integrations that should run on the client.\n * @deprecated Use `client.init()` instead.\n */\n public setupIntegrations(forceInitialize?: boolean): void {\n if ((forceInitialize && !this._integrationsInitialized) || (this._isEnabled() && !this._integrationsInitialized)) {\n this._setupIntegrations();\n }\n }\n\n /** @inheritdoc */\n public init(): void {\n if (this._isEnabled()) {\n this._setupIntegrations();\n }\n }\n\n /**\n * Gets an installed integration by its `id`.\n *\n * @returns The installed integration or `undefined` if no integration with that `id` was installed.\n * @deprecated Use `getIntegrationByName()` instead.\n */\n public getIntegrationById(integrationId: string): Integration | undefined {\n return this.getIntegrationByName(integrationId);\n }\n\n /**\n * Gets an installed integration by its name.\n *\n * @returns The installed integration or `undefined` if no integration with that `name` was installed.\n */\n public getIntegrationByName<T extends Integration = Integration>(integrationName: string): T | undefined {\n return this._integrations[integrationName] as T | undefined;\n }\n\n /**\n * Returns the client's instance of the given integration class, it any.\n * @deprecated Use `getIntegrationByName()` instead.\n */\n public getIntegration<T extends Integration>(integration: IntegrationClass<T>): T | null {\n try {\n return (this._integrations[integration.id] as T) || null;\n } catch (_oO) {\n DEBUG_BUILD && logger.warn(`Cannot retrieve integration ${integration.id} from the current Client`);\n return null;\n }\n }\n\n /**\n * @inheritDoc\n */\n public addIntegration(integration: Integration): void {\n const isAlreadyInstalled = this._integrations[integration.name];\n\n // This hook takes care of only installing if not already installed\n setupIntegration(this, integration, this._integrations);\n // Here we need to check manually to make sure to not run this multiple times\n if (!isAlreadyInstalled) {\n afterSetupIntegrations(this, [integration]);\n }\n }\n\n /**\n * @inheritDoc\n */\n public sendEvent(event: Event, hint: EventHint = {}): void {\n this.emit('beforeSendEvent', event, hint);\n\n let env = createEventEnvelope(event, this._dsn, this._options._metadata, this._options.tunnel);\n\n for (const attachment of hint.attachments || []) {\n env = addItemToEnvelope(\n env,\n createAttachmentEnvelopeItem(\n attachment,\n this._options.transportOptions && this._options.transportOptions.textEncoder,\n ),\n );\n }\n\n const promise = this._sendEnvelope(env);\n if (promise) {\n promise.then(sendResponse => this.emit('afterSendEvent', event, sendResponse), null);\n }\n }\n\n /**\n * @inheritDoc\n */\n public sendSession(session: Session | SessionAggregates): void {\n const env = createSessionEnvelope(session, this._dsn, this._options._metadata, this._options.tunnel);\n\n // _sendEnvelope should not throw\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this._sendEnvelope(env);\n }\n\n /**\n * @inheritDoc\n */\n public recordDroppedEvent(reason: EventDropReason, category: DataCategory, eventOrCount?: Event | number): void {\n if (this._options.sendClientReports) {\n // TODO v9: We do not need the `event` passed as third argument anymore, and can possibly remove this overload\n // If event is passed as third argument, we assume this is a count of 1\n const count = typeof eventOrCount === 'number' ? eventOrCount : 1;\n\n // We want to track each category (error, transaction, session, replay_event) separately\n // but still keep the distinction between different type of outcomes.\n // We could use nested maps, but it's much easier to read and type this way.\n // A correct type for map-based implementation if we want to go that route\n // would be `Partial<Record<SentryRequestType, Partial<Record<Outcome, number>>>>`\n // With typescript 4.1 we could even use template literal types\n const key = `${reason}:${category}`;\n DEBUG_BUILD && logger.log(`Recording outcome: \"${key}\"${count > 1 ? ` (${count} times)` : ''}`);\n this._outcomes[key] = (this._outcomes[key] || 0) + count;\n }\n }\n\n /**\n * @inheritDoc\n */\n public captureAggregateMetrics(metricBucketItems: Array<MetricBucketItem>): void {\n DEBUG_BUILD && logger.log(`Flushing aggregated metrics, number of metrics: ${metricBucketItems.length}`);\n const metricsEnvelope = createMetricEnvelope(\n metricBucketItems,\n this._dsn,\n this._options._metadata,\n this._options.tunnel,\n );\n\n // _sendEnvelope should not throw\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this._sendEnvelope(metricsEnvelope);\n }\n\n // Keep on() & emit() signatures in sync with types' client.ts interface\n /* eslint-disable @typescript-eslint/unified-signatures */\n\n /** @inheritdoc */\n public on(hook: 'startTransaction', callback: (transaction: Transaction) => void): void;\n\n /** @inheritdoc */\n public on(hook: 'finishTransaction', callback: (transaction: Transaction) => void): void;\n\n /** @inheritdoc */\n public on(hook: 'beforeEnvelope', callback: (envelope: Envelope) => void): void;\n\n /** @inheritdoc */\n public on(hook: 'beforeSendEvent', callback: (event: Event, hint?: EventHint) => void): void;\n\n /** @inheritdoc */\n public on(hook: 'preprocessEvent', callback: (event: Event, hint?: EventHint) => void): void;\n\n /** @inheritdoc */\n public on(\n hook: 'afterSendEvent',\n callback: (event: Event, sendResponse: TransportMakeRequestResponse | void) => void,\n ): void;\n\n /** @inheritdoc */\n public on(hook: 'beforeAddBreadcrumb', callback: (breadcrumb: Breadcrumb, hint?: BreadcrumbHint) => void): void;\n\n /** @inheritdoc */\n public on(hook: 'createDsc', callback: (dsc: DynamicSamplingContext) => void): void;\n\n /** @inheritdoc */\n public on(hook: 'otelSpanEnd', callback: (otelSpan: unknown, mutableOptions: { drop: boolean }) => void): void;\n\n /** @inheritdoc */\n public on(\n hook: 'beforeSendFeedback',\n callback: (feedback: FeedbackEvent, options?: { includeReplay: boolean }) => void,\n ): void;\n\n /** @inheritdoc */\n public on(hook: 'startPageLoadSpan', callback: (options: StartSpanOptions) => void): void;\n\n /** @inheritdoc */\n public on(hook: 'startNavigationSpan', callback: (options: StartSpanOptions) => void): void;\n\n /** @inheritdoc */\n public on(hook: string, callback: unknown): void {\n if (!this._hooks[hook]) {\n this._hooks[hook] = [];\n }\n\n // @ts-expect-error We assue the types are correct\n this._hooks[hook].push(callback);\n }\n\n /** @inheritdoc */\n public emit(hook: 'startTransaction', transaction: Transaction): void;\n\n /** @inheritdoc */\n public emit(hook: 'finishTransaction', transaction: Transaction): void;\n\n /** @inheritdoc */\n public emit(hook: 'beforeEnvelope', envelope: Envelope): void;\n\n /** @inheritdoc */\n public emit(hook: 'beforeSendEvent', event: Event, hint?: EventHint): void;\n\n /** @inheritdoc */\n public emit(hook: 'preprocessEvent', event: Event, hint?: EventHint): void;\n\n /** @inheritdoc */\n public emit(hook: 'afterSendEvent', event: Event, sendResponse: TransportMakeRequestResponse | void): void;\n\n /** @inheritdoc */\n public emit(hook: 'beforeAddBreadcrumb', breadcrumb: Breadcrumb, hint?: BreadcrumbHint): void;\n\n /** @inheritdoc */\n public emit(hook: 'createDsc', dsc: DynamicSamplingContext): void;\n\n /** @inheritdoc */\n public emit(hook: 'otelSpanEnd', otelSpan: unknown, mutableOptions: { drop: boolean }): void;\n\n /** @inheritdoc */\n public emit(hook: 'beforeSendFeedback', feedback: FeedbackEvent, options?: { includeReplay: boolean }): void;\n\n /** @inheritdoc */\n public emit(hook: 'startPageLoadSpan', options: StartSpanOptions): void;\n\n /** @inheritdoc */\n public emit(hook: 'startNavigationSpan', options: StartSpanOptions): void;\n\n /** @inheritdoc */\n public emit(hook: string, ...rest: unknown[]): void {\n if (this._hooks[hook]) {\n this._hooks[hook].forEach(callback => callback(...rest));\n }\n }\n\n /* eslint-enable @typescript-eslint/unified-signatures */\n\n /** Setup integrations for this client. */\n protected _setupIntegrations(): void {\n const { integrations } = this._options;\n this._integrations = setupIntegrations(this, integrations);\n afterSetupIntegrations(this, integrations);\n\n // TODO v8: We don't need this flag anymore\n this._integrationsInitialized = true;\n }\n\n /** Updates existing session based on the provided event */\n protected _updateSessionFromEvent(session: Session, event: Event): void {\n let crashed = false;\n let errored = false;\n const exceptions = event.exception && event.exception.values;\n\n if (exceptions) {\n errored = true;\n\n for (const ex of exceptions) {\n const mechanism = ex.mechanism;\n if (mechanism && mechanism.handled === false) {\n crashed = true;\n break;\n }\n }\n }\n\n // A session is updated and that session update is sent in only one of the two following scenarios:\n // 1. Session with non terminal status and 0 errors + an error occurred -> Will set error count to 1 and send update\n // 2. Session with non terminal status and 1 error + a crash occurred -> Will set status crashed and send update\n const sessionNonTerminal = session.status === 'ok';\n const shouldUpdateAndSend = (sessionNonTerminal && session.errors === 0) || (sessionNonTerminal && crashed);\n\n if (shouldUpdateAndSend) {\n updateSession(session, {\n ...(crashed && { status: 'crashed' }),\n errors: session.errors || Number(errored || crashed),\n });\n this.captureSession(session);\n }\n }\n\n /**\n * Determine if the client is finished processing. Returns a promise because it will wait `timeout` ms before saying\n * \"no\" (resolving to `false`) in order to give the client a chance to potentially finish first.\n *\n * @param timeout The time, in ms, after which to resolve to `false` if the client is still busy. Passing `0` (or not\n * passing anything) will make the promise wait as long as it takes for processing to finish before resolving to\n * `true`.\n * @returns A promise which will resolve to `true` if processing is already done or finishes before the timeout, and\n * `false` otherwise\n */\n protected _isClientDoneProcessing(timeout?: number): PromiseLike<boolean> {\n return new SyncPromise(resolve => {\n let ticked: number = 0;\n const tick: number = 1;\n\n const interval = setInterval(() => {\n if (this._numProcessing == 0) {\n clearInterval(interval);\n resolve(true);\n } else {\n ticked += tick;\n if (timeout && ticked >= timeout) {\n clearInterval(interval);\n resolve(false);\n }\n }\n }, tick);\n });\n }\n\n /** Determines whether this SDK is enabled and a transport is present. */\n protected _isEnabled(): boolean {\n return this.getOptions().enabled !== false && this._transport !== undefined;\n }\n\n /**\n * Adds common information to events.\n *\n * The information includes release and environment from `options`,\n * breadcrumbs and context (extra, tags and user) from the scope.\n *\n * Information that is already present in the event is never overwritten. For\n * nested objects, such as the context, keys are merged.\n *\n * @param event The original event.\n * @param hint May contain additional information about the original exception.\n * @param scope A scope containing event metadata.\n * @returns A new event with more information.\n */\n protected _prepareEvent(\n event: Event,\n hint: EventHint,\n scope?: Scope,\n isolationScope = getIsolationScope(),\n ): PromiseLike<Event | null> {\n const options = this.getOptions();\n const integrations = Object.keys(this._integrations);\n if (!hint.integrations && integrations.length > 0) {\n hint.integrations = integrations;\n }\n\n this.emit('preprocessEvent', event, hint);\n\n return prepareEvent(options, event, hint, scope, this, isolationScope).then(evt => {\n if (evt === null) {\n return evt;\n }\n\n const propagationContext = {\n ...isolationScope.getPropagationContext(),\n ...(scope ? scope.getPropagationContext() : undefined),\n };\n\n const trace = evt.contexts && evt.contexts.trace;\n if (!trace && propagationContext) {\n const { traceId: trace_id, spanId, parentSpanId, dsc } = propagationContext;\n evt.contexts = {\n trace: {\n trace_id,\n span_id: spanId,\n parent_span_id: parentSpanId,\n },\n ...evt.contexts,\n };\n\n const dynamicSamplingContext = dsc ? dsc : getDynamicSamplingContextFromClient(trace_id, this, scope);\n\n evt.sdkProcessingMetadata = {\n dynamicSamplingContext,\n ...evt.sdkProcessingMetadata,\n };\n }\n return evt;\n });\n }\n\n /**\n * Processes the event and logs an error in case of rejection\n * @param event\n * @param hint\n * @param scope\n */\n protected _captureEvent(event: Event, hint: EventHint = {}, scope?: Scope): PromiseLike<string | undefined> {\n return this._processEvent(event, hint, scope).then(\n finalEvent => {\n return finalEvent.event_id;\n },\n reason => {\n if (DEBUG_BUILD) {\n // If something's gone wrong, log the error as a warning. If it's just us having used a `SentryError` for\n // control flow, log just the message (no stack) as a log-level log.\n const sentryError = reason as SentryError;\n if (sentryError.logLevel === 'log') {\n logger.log(sentryError.message);\n } else {\n logger.warn(sentryError);\n }\n }\n return undefined;\n },\n );\n }\n\n /**\n * Processes an event (either error or message) and sends it to Sentry.\n *\n * This also adds breadcrumbs and context information to the event. However,\n * platform specific meta data (such as the User's IP address) must be added\n * by the SDK implementor.\n *\n *\n * @param event The event to send to Sentry.\n * @param hint May contain additional information about the original exception.\n * @param scope A scope containing event metadata.\n * @returns A SyncPromise that resolves with the event or rejects in case event was/will not be send.\n */\n protected _processEvent(event: Event, hint: EventHint, scope?: Scope): PromiseLike<Event> {\n const options = this.getOptions();\n const { sampleRate } = options;\n\n const isTransaction = isTransactionEvent(event);\n const isError = isErrorEvent(event);\n const eventType = event.type || 'error';\n const beforeSendLabel = `before send for type \\`${eventType}\\``;\n\n // 1.0 === 100% events are sent\n // 0.0 === 0% events are sent\n // Sampling for transaction happens somewhere else\n if (isError && typeof sampleRate === 'number' && Math.random() > sampleRate) {\n this.recordDroppedEvent('sample_rate', 'error', event);\n return rejectedSyncPromise(\n new SentryError(\n `Discarding event because it's not included in the random sample (sampling rate = ${sampleRate})`,\n 'log',\n ),\n );\n }\n\n const dataCategory: DataCategory = eventType === 'replay_event' ? 'replay' : eventType;\n\n const sdkProcessingMetadata = event.sdkProcessingMetadata || {};\n const capturedSpanIsolationScope: Scope | undefined = sdkProcessingMetadata.capturedSpanIsolationScope;\n\n return this._prepareEvent(event, hint, scope, capturedSpanIsolationScope)\n .then(prepared => {\n if (prepared === null) {\n this.recordDroppedEvent('event_processor', dataCategory, event);\n throw new SentryError('An event processor returned `null`, will not send event.', 'log');\n }\n\n const isInternalException = hint.data && (hint.data as { __sentry__: boolean }).__sentry__ === true;\n if (isInternalException) {\n return prepared;\n }\n\n const result = processBeforeSend(options, prepared, hint);\n return _validateBeforeSendResult(result, beforeSendLabel);\n })\n .then(processedEvent => {\n if (processedEvent === null) {\n this.recordDroppedEvent('before_send', dataCategory, event);\n if (isTransaction) {\n const spans = event.spans || [];\n // the transaction itself counts as one span, plus all the child spans that are added\n const spanCount = 1 + spans.length;\n this.recordDroppedEvent('before_send', 'span', spanCount);\n }\n throw new SentryError(`${beforeSendLabel} returned \\`null\\`, will not send event.`, 'log');\n }\n\n const session = scope && scope.getSession();\n if (!isTransaction && session) {\n this._updateSessionFromEvent(session, processedEvent);\n }\n\n if (isTransaction) {\n const spanCountBefore =\n (processedEvent.sdkProcessingMetadata && processedEvent.sdkProcessingMetadata.spanCountBeforeProcessing) ||\n 0;\n const spanCountAfter = processedEvent.spans ? processedEvent.spans.length : 0;\n\n const droppedSpanCount = spanCountBefore - spanCountAfter;\n if (droppedSpanCount > 0) {\n this.recordDroppedEvent('before_send', 'span', droppedSpanCount);\n }\n }\n\n // None of the Sentry built event processor will update transaction name,\n // so if the transaction name has been changed by an event processor, we know\n // it has to come from custom event processor added by a user\n const transactionInfo = processedEvent.transaction_info;\n if (isTransaction && transactionInfo && processedEvent.transaction !== event.transaction) {\n const source = 'custom';\n processedEvent.transaction_info = {\n ...transactionInfo,\n source,\n };\n }\n\n this.sendEvent(processedEvent, hint);\n return processedEvent;\n })\n .then(null, reason => {\n if (reason instanceof SentryError) {\n throw reason;\n }\n\n this.captureException(reason, {\n data: {\n __sentry__: true,\n },\n originalException: reason,\n });\n throw new SentryError(\n `Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\\nReason: ${reason}`,\n );\n });\n }\n\n /**\n * Occupies the client with processing and event\n */\n protected _process<T>(promise: PromiseLike<T>): void {\n this._numProcessing++;\n void promise.then(\n value => {\n this._numProcessing--;\n return value;\n },\n reason => {\n this._numProcessing--;\n return reason;\n },\n );\n }\n\n /**\n * @inheritdoc\n */\n protected _sendEnvelope(envelope: Envelope): PromiseLike<void | TransportMakeRequestResponse> | void {\n this.emit('beforeEnvelope', envelope);\n\n if (this._isEnabled() && this._transport) {\n return this._transport.send(envelope).then(null, reason => {\n DEBUG_BUILD && logger.error('Error while sending event:', reason);\n });\n } else {\n DEBUG_BUILD && logger.error('Transport disabled');\n }\n }\n\n /**\n * Clears outcomes on this client and returns them.\n */\n protected _clearOutcomes(): Outcome[] {\n const outcomes = this._outcomes;\n this._outcomes = {};\n return Object.keys(outcomes).map(key => {\n const [reason, category] = key.split(':') as [EventDropReason, DataCategory];\n return {\n reason,\n category,\n quantity: outcomes[key],\n };\n });\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n public abstract eventFromException(_exception: any, _hint?: EventHint): PromiseLike<Event>;\n\n /**\n * @inheritDoc\n */\n public abstract eventFromMessage(\n _message: ParameterizedString,\n // eslint-disable-next-line deprecation/deprecation\n _level?: Severity | SeverityLevel,\n _hint?: EventHint,\n ): PromiseLike<Event>;\n}\n\n/**\n * Verifies that return value of configured `beforeSend` or `beforeSendTransaction` is of expected type, and returns the value if so.\n */\nfunction _validateBeforeSendResult(\n beforeSendResult: PromiseLike<Event | null> | Event | null,\n beforeSendLabel: string,\n): PromiseLike<Event | null> | Event | null {\n const invalidValueError = `${beforeSendLabel} must return \\`null\\` or a valid event.`;\n if (isThenable(beforeSendResult)) {\n return beforeSendResult.then(\n event => {\n if (!isPlainObject(event) && event !== null) {\n throw new SentryError(invalidValueError);\n }\n return event;\n },\n e => {\n throw new SentryError(`${beforeSendLabel} rejected with ${e}`);\n },\n );\n } else if (!isPlainObject(beforeSendResult) && beforeSendResult !== null) {\n throw new SentryError(invalidValueError);\n }\n return beforeSendResult;\n}\n\n/**\n * Process the matching `beforeSendXXX` callback.\n */\nfunction processBeforeSend(\n options: ClientOptions,\n event: Event,\n hint: EventHint,\n): PromiseLike<Event | null> | Event | null {\n const { beforeSend, beforeSendTransaction } = options;\n\n if (isErrorEvent(event) && beforeSend) {\n return beforeSend(event, hint);\n }\n\n if (isTransactionEvent(event) && beforeSendTransaction) {\n if (event.spans) {\n // We store the # of spans before processing in SDK metadata,\n // so we can compare it afterwards to determine how many spans were dropped\n const spanCountBefore = event.spans.length;\n event.sdkProcessingMetadata = {\n ...event.sdkProcessingMetadata,\n spanCountBeforeProcessing: spanCountBefore,\n };\n }\n return beforeSendTransaction(event, hint);\n }\n\n return event;\n}\n\nfunction isErrorEvent(event: Event): event is ErrorEvent {\n return event.type === undefined;\n}\n\nfunction isTransactionEvent(event: Event): event is TransactionEvent {\n return event.type === 'transaction';\n}\n\n/**\n * Add an event processor to the current client.\n * This event processor will run for all events processed by this client.\n */\nexport function addEventProcessor(callback: EventProcessor): void {\n const client = getClient();\n\n if (!client || !client.addEventProcessor) {\n return;\n }\n\n client.addEventProcessor(callback);\n}\n", "import type { Client, ClientOptions } from '@sentry/types';\nimport { consoleSandbox, logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from './debug-build';\nimport { getCurrentScope } from './exports';\nimport { getCurrentHub } from './hub';\n\n/** A class object that can instantiate Client objects. */\nexport type ClientClass<F extends Client, O extends ClientOptions> = new (options: O) => F;\n\n/**\n * Internal function to create a new SDK client instance. The client is\n * installed and then bound to the current scope.\n *\n * @param clientClass The client class to instantiate.\n * @param options Options to pass to the client.\n */\nexport function initAndBind<F extends Client, O extends ClientOptions>(\n clientClass: ClientClass<F, O>,\n options: O,\n): void {\n if (options.debug === true) {\n if (DEBUG_BUILD) {\n logger.enable();\n } else {\n // use `console.warn` rather than `logger.warn` since by non-debug bundles have all `logger.x` statements stripped\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn('[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.');\n });\n }\n }\n const scope = getCurrentScope();\n scope.update(options.initialScope);\n\n const client = new clientClass(options);\n setCurrentClient(client);\n initializeClient(client);\n}\n\n/**\n * Make the given client the current client.\n */\nexport function setCurrentClient(client: Client): void {\n // eslint-disable-next-line deprecation/deprecation\n const hub = getCurrentHub();\n // eslint-disable-next-line deprecation/deprecation\n const top = hub.getStackTop();\n top.client = client;\n top.scope.setClient(client);\n}\n\n/**\n * Initialize the client for the current scope.\n * Make sure to call this after `setCurrentClient()`.\n */\nfunction initializeClient(client: Client): void {\n if (client.init) {\n client.init();\n // TODO v8: Remove this fallback\n // eslint-disable-next-line deprecation/deprecation\n } else if (client.setupIntegrations) {\n // eslint-disable-next-line deprecation/deprecation\n client.setupIntegrations();\n }\n}\n", "import type {\n Envelope,\n EnvelopeItem,\n EnvelopeItemType,\n Event,\n EventDropReason,\n EventItem,\n InternalBaseTransportOptions,\n Transport,\n TransportMakeRequestResponse,\n TransportRequestExecutor,\n} from '@sentry/types';\nimport type { PromiseBuffer, RateLimits } from '@sentry/utils';\nimport {\n SentryError,\n createEnvelope,\n envelopeItemTypeToDataCategory,\n forEachEnvelopeItem,\n isRateLimited,\n logger,\n makePromiseBuffer,\n resolvedSyncPromise,\n serializeEnvelope,\n updateRateLimits,\n} from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../debug-build';\n\nexport const DEFAULT_TRANSPORT_BUFFER_SIZE = 30;\n\n/**\n * Creates an instance of a Sentry `Transport`\n *\n * @param options\n * @param makeRequest\n */\nexport function createTransport(\n options: InternalBaseTransportOptions,\n makeRequest: TransportRequestExecutor,\n buffer: PromiseBuffer<void | TransportMakeRequestResponse> = makePromiseBuffer(\n options.bufferSize || DEFAULT_TRANSPORT_BUFFER_SIZE,\n ),\n): Transport {\n let rateLimits: RateLimits = {};\n const flush = (timeout?: number): PromiseLike<boolean> => buffer.drain(timeout);\n\n function send(envelope: Envelope): PromiseLike<void | TransportMakeRequestResponse> {\n const filteredEnvelopeItems: EnvelopeItem[] = [];\n\n // Drop rate limited items from envelope\n forEachEnvelopeItem(envelope, (item, type) => {\n const dataCategory = envelopeItemTypeToDataCategory(type);\n if (isRateLimited(rateLimits, dataCategory)) {\n const event: Event | undefined = getEventForEnvelopeItem(item, type);\n options.recordDroppedEvent('ratelimit_backoff', dataCategory, event);\n } else {\n filteredEnvelopeItems.push(item);\n }\n });\n\n // Skip sending if envelope is empty after filtering out rate limited events\n if (filteredEnvelopeItems.length === 0) {\n return resolvedSyncPromise();\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const filteredEnvelope: Envelope = createEnvelope(envelope[0], filteredEnvelopeItems as any);\n\n // Creates client report for each item in an envelope\n const recordEnvelopeLoss = (reason: EventDropReason): void => {\n forEachEnvelopeItem(filteredEnvelope, (item, type) => {\n const event: Event | undefined = getEventForEnvelopeItem(item, type);\n options.recordDroppedEvent(reason, envelopeItemTypeToDataCategory(type), event);\n });\n };\n\n const requestTask = (): PromiseLike<void | TransportMakeRequestResponse> =>\n makeRequest({ body: serializeEnvelope(filteredEnvelope, options.textEncoder) }).then(\n response => {\n // We don't want to throw on NOK responses, but we want to at least log them\n if (response.statusCode !== undefined && (response.statusCode < 200 || response.statusCode >= 300)) {\n DEBUG_BUILD && logger.warn(`Sentry responded with status code ${response.statusCode} to sent event.`);\n }\n\n rateLimits = updateRateLimits(rateLimits, response);\n return response;\n },\n error => {\n recordEnvelopeLoss('network_error');\n throw error;\n },\n );\n\n return buffer.add(requestTask).then(\n result => result,\n error => {\n if (error instanceof SentryError) {\n DEBUG_BUILD && logger.error('Skipped sending event because buffer is full.');\n recordEnvelopeLoss('queue_overflow');\n return resolvedSyncPromise();\n } else {\n throw error;\n }\n },\n );\n }\n\n // We use this to identifify if the transport is the base transport\n // TODO (v8): Remove this again as we'll no longer need it\n send.__sentry__baseTransport__ = true;\n\n return {\n send,\n flush,\n };\n}\n\nfunction getEventForEnvelopeItem(item: Envelope[1][number], type: EnvelopeItemType): Event | undefined {\n if (type !== 'event' && type !== 'transaction') {\n return undefined;\n }\n\n return Array.isArray(item) ? (item as EventItem)[1] : undefined;\n}\n", "import type { DsnComponents, SpanEnvelope, SpanItem } from '@sentry/types';\nimport type { Span } from '@sentry/types';\nimport { createEnvelope, dsnToString } from '@sentry/utils';\n\n/**\n * Create envelope from Span item.\n */\nexport function createSpanEnvelope(spans: Span[], dsn?: DsnComponents): SpanEnvelope {\n const headers: SpanEnvelope[0] = {\n sent_at: new Date().toISOString(),\n };\n\n if (dsn) {\n headers.dsn = dsnToString(dsn);\n }\n\n const items = spans.map(createSpanItem);\n return createEnvelope<SpanEnvelope>(headers, items);\n}\n\nfunction createSpanItem(span: Span): SpanItem {\n const spanHeaders: SpanItem[0] = {\n type: 'span',\n };\n return [spanHeaders, span];\n}\n", "import type { Options } from '@sentry/types';\nimport { SDK_VERSION } from '../version';\n\n/**\n * A builder for the SDK metadata in the options for the SDK initialization.\n *\n * Note: This function is identical to `buildMetadata` in Remix and NextJS and SvelteKit.\n * We don't extract it for bundle size reasons.\n * @see https://github.com/getsentry/sentry-javascript/pull/7404\n * @see https://github.com/getsentry/sentry-javascript/pull/4196\n *\n * If you make changes to this function consider updating the others as well.\n *\n * @param options SDK options object that gets mutated\n * @param names list of package names\n */\nexport function applySdkMetadata(options: Options, name: string, names = [name], source = 'npm'): void {\n const metadata = options._metadata || {};\n\n if (!metadata.sdk) {\n metadata.sdk = {\n name: `sentry.javascript.${name}`,\n packages: names.map(name => ({\n name: `${source}:@sentry/${name}`,\n version: SDK_VERSION,\n })),\n version: SDK_VERSION,\n };\n }\n\n options._metadata = metadata;\n}\n", "import type { Client, Event, EventHint, Integration, IntegrationClass, IntegrationFn, StackFrame } from '@sentry/types';\nimport { getEventDescription, logger, stringMatchesSomePattern } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../debug-build';\nimport { convertIntegrationFnToClass, defineIntegration } from '../integration';\n\n// \"Script error.\" is hard coded into browsers for errors that it can't read.\n// this is the result of a script being pulled in from an external domain and CORS.\nconst DEFAULT_IGNORE_ERRORS = [\n /^Script error\\.?$/,\n /^Javascript error: Script error\\.? on line 0$/,\n /^ResizeObserver loop completed with undelivered notifications.$/,\n /^Cannot redefine property: googletag$/,\n];\n\nconst DEFAULT_IGNORE_TRANSACTIONS = [\n /^.*\\/healthcheck$/,\n /^.*\\/healthy$/,\n /^.*\\/live$/,\n /^.*\\/ready$/,\n /^.*\\/heartbeat$/,\n /^.*\\/health$/,\n /^.*\\/healthz$/,\n];\n\n/** Options for the InboundFilters integration */\nexport interface InboundFiltersOptions {\n allowUrls: Array<string | RegExp>;\n denyUrls: Array<string | RegExp>;\n ignoreErrors: Array<string | RegExp>;\n ignoreTransactions: Array<string | RegExp>;\n ignoreInternal: boolean;\n disableErrorDefaults: boolean;\n disableTransactionDefaults: boolean;\n}\n\nconst INTEGRATION_NAME = 'InboundFilters';\nconst _inboundFiltersIntegration = ((options: Partial<InboundFiltersOptions> = {}) => {\n return {\n name: INTEGRATION_NAME,\n // TODO v8: Remove this\n setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function\n processEvent(event, _hint, client) {\n const clientOptions = client.getOptions();\n const mergedOptions = _mergeOptions(options, clientOptions);\n return _shouldDropEvent(event, mergedOptions) ? null : event;\n },\n };\n}) satisfies IntegrationFn;\n\nexport const inboundFiltersIntegration = defineIntegration(_inboundFiltersIntegration);\n\n/**\n * Inbound filters configurable by the user.\n * @deprecated Use `inboundFiltersIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport const InboundFilters = convertIntegrationFnToClass(\n INTEGRATION_NAME,\n inboundFiltersIntegration,\n) as IntegrationClass<Integration & { preprocessEvent: (event: Event, hint: EventHint, client: Client) => void }> & {\n new (\n options?: Partial<{\n allowUrls: Array<string | RegExp>;\n denyUrls: Array<string | RegExp>;\n ignoreErrors: Array<string | RegExp>;\n ignoreTransactions: Array<string | RegExp>;\n ignoreInternal: boolean;\n disableErrorDefaults: boolean;\n disableTransactionDefaults: boolean;\n }>,\n ): Integration;\n};\n\nfunction _mergeOptions(\n internalOptions: Partial<InboundFiltersOptions> = {},\n clientOptions: Partial<InboundFiltersOptions> = {},\n): Partial<InboundFiltersOptions> {\n return {\n allowUrls: [...(internalOptions.allowUrls || []), ...(clientOptions.allowUrls || [])],\n denyUrls: [...(internalOptions.denyUrls || []), ...(clientOptions.denyUrls || [])],\n ignoreErrors: [\n ...(internalOptions.ignoreErrors || []),\n ...(clientOptions.ignoreErrors || []),\n ...(internalOptions.disableErrorDefaults ? [] : DEFAULT_IGNORE_ERRORS),\n ],\n ignoreTransactions: [\n ...(internalOptions.ignoreTransactions || []),\n ...(clientOptions.ignoreTransactions || []),\n ...(internalOptions.disableTransactionDefaults ? [] : DEFAULT_IGNORE_TRANSACTIONS),\n ],\n ignoreInternal: internalOptions.ignoreInternal !== undefined ? internalOptions.ignoreInternal : true,\n };\n}\n\nfunction _shouldDropEvent(event: Event, options: Partial<InboundFiltersOptions>): boolean {\n if (options.ignoreInternal && _isSentryError(event)) {\n DEBUG_BUILD &&\n logger.warn(`Event dropped due to being internal Sentry Error.\\nEvent: ${getEventDescription(event)}`);\n return true;\n }\n if (_isIgnoredError(event, options.ignoreErrors)) {\n DEBUG_BUILD &&\n logger.warn(\n `Event dropped due to being matched by \\`ignoreErrors\\` option.\\nEvent: ${getEventDescription(event)}`,\n );\n return true;\n }\n if (_isIgnoredTransaction(event, options.ignoreTransactions)) {\n DEBUG_BUILD &&\n logger.warn(\n `Event dropped due to being matched by \\`ignoreTransactions\\` option.\\nEvent: ${getEventDescription(event)}`,\n );\n return true;\n }\n if (_isDeniedUrl(event, options.denyUrls)) {\n DEBUG_BUILD &&\n logger.warn(\n `Event dropped due to being matched by \\`denyUrls\\` option.\\nEvent: ${getEventDescription(\n event,\n )}.\\nUrl: ${_getEventFilterUrl(event)}`,\n );\n return true;\n }\n if (!_isAllowedUrl(event, options.allowUrls)) {\n DEBUG_BUILD &&\n logger.warn(\n `Event dropped due to not being matched by \\`allowUrls\\` option.\\nEvent: ${getEventDescription(\n event,\n )}.\\nUrl: ${_getEventFilterUrl(event)}`,\n );\n return true;\n }\n return false;\n}\n\nfunction _isIgnoredError(event: Event, ignoreErrors?: Array<string | RegExp>): boolean {\n // If event.type, this is not an error\n if (event.type || !ignoreErrors || !ignoreErrors.length) {\n return false;\n }\n\n return _getPossibleEventMessages(event).some(message => stringMatchesSomePattern(message, ignoreErrors));\n}\n\nfunction _isIgnoredTransaction(event: Event, ignoreTransactions?: Array<string | RegExp>): boolean {\n if (event.type !== 'transaction' || !ignoreTransactions || !ignoreTransactions.length) {\n return false;\n }\n\n const name = event.transaction;\n return name ? stringMatchesSomePattern(name, ignoreTransactions) : false;\n}\n\nfunction _isDeniedUrl(event: Event, denyUrls?: Array<string | RegExp>): boolean {\n // TODO: Use Glob instead?\n if (!denyUrls || !denyUrls.length) {\n return false;\n }\n const url = _getEventFilterUrl(event);\n return !url ? false : stringMatchesSomePattern(url, denyUrls);\n}\n\nfunction _isAllowedUrl(event: Event, allowUrls?: Array<string | RegExp>): boolean {\n // TODO: Use Glob instead?\n if (!allowUrls || !allowUrls.length) {\n return true;\n }\n const url = _getEventFilterUrl(event);\n return !url ? true : stringMatchesSomePattern(url, allowUrls);\n}\n\nfunction _getPossibleEventMessages(event: Event): string[] {\n const possibleMessages: string[] = [];\n\n if (event.message) {\n possibleMessages.push(event.message);\n }\n\n let lastException;\n try {\n // @ts-expect-error Try catching to save bundle size\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n lastException = event.exception.values[event.exception.values.length - 1];\n } catch (e) {\n // try catching to save bundle size checking existence of variables\n }\n\n if (lastException) {\n if (lastException.value) {\n possibleMessages.push(lastException.value);\n if (lastException.type) {\n possibleMessages.push(`${lastException.type}: ${lastException.value}`);\n }\n }\n }\n\n if (DEBUG_BUILD && possibleMessages.length === 0) {\n logger.error(`Could not extract message for event ${getEventDescription(event)}`);\n }\n\n return possibleMessages;\n}\n\nfunction _isSentryError(event: Event): boolean {\n try {\n // @ts-expect-error can't be a sentry error if undefined\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return event.exception.values[0].type === 'SentryError';\n } catch (e) {\n // ignore\n }\n return false;\n}\n\nfunction _getLastValidUrl(frames: StackFrame[] = []): string | null {\n for (let i = frames.length - 1; i >= 0; i--) {\n const frame = frames[i];\n\n if (frame && frame.filename !== '<anonymous>' && frame.filename !== '[native code]') {\n return frame.filename || null;\n }\n }\n\n return null;\n}\n\nfunction _getEventFilterUrl(event: Event): string | null {\n try {\n let frames;\n try {\n // @ts-expect-error we only care about frames if the whole thing here is defined\n frames = event.exception.values[0].stacktrace.frames;\n } catch (e) {\n // ignore\n }\n return frames ? _getLastValidUrl(frames) : null;\n } catch (oO) {\n DEBUG_BUILD && logger.error(`Cannot extract url for event ${getEventDescription(event)}`);\n return null;\n }\n}\n", "import type { Client, Integration, IntegrationClass, IntegrationFn, WrappedFunction } from '@sentry/types';\nimport { getOriginalFunction } from '@sentry/utils';\nimport { getClient } from '../exports';\nimport { convertIntegrationFnToClass, defineIntegration } from '../integration';\n\nlet originalFunctionToString: () => void;\n\nconst INTEGRATION_NAME = 'FunctionToString';\n\nconst SETUP_CLIENTS = new WeakMap<Client, boolean>();\n\nconst _functionToStringIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n originalFunctionToString = Function.prototype.toString;\n\n // intrinsics (like Function.prototype) might be immutable in some environments\n // e.g. Node with --frozen-intrinsics, XS (an embedded JavaScript engine) or SES (a JavaScript proposal)\n try {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n Function.prototype.toString = function (this: WrappedFunction, ...args: any[]): string {\n const originalFunction = getOriginalFunction(this);\n const context =\n SETUP_CLIENTS.has(getClient() as Client) && originalFunction !== undefined ? originalFunction : this;\n return originalFunctionToString.apply(context, args);\n };\n } catch {\n // ignore errors here, just don't patch this\n }\n },\n setup(client) {\n SETUP_CLIENTS.set(client, true);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Patch toString calls to return proper name for wrapped functions.\n *\n * ```js\n * Sentry.init({\n * integrations: [\n * functionToStringIntegration(),\n * ],\n * });\n * ```\n */\nexport const functionToStringIntegration = defineIntegration(_functionToStringIntegration);\n\n/**\n * Patch toString calls to return proper name for wrapped functions.\n *\n * @deprecated Use `functionToStringIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport const FunctionToString = convertIntegrationFnToClass(\n INTEGRATION_NAME,\n functionToStringIntegration,\n) as IntegrationClass<Integration & { setupOnce: () => void }>;\n\n// eslint-disable-next-line deprecation/deprecation\nexport type FunctionToString = typeof FunctionToString;\n", "import type { Client, Event, EventHint, Integration, IntegrationClass, IntegrationFn } from '@sentry/types';\nimport { applyAggregateErrorsToEvent, exceptionFromError } from '@sentry/utils';\nimport { convertIntegrationFnToClass, defineIntegration } from '../integration';\n\ninterface LinkedErrorsOptions {\n key?: string;\n limit?: number;\n}\n\nconst DEFAULT_KEY = 'cause';\nconst DEFAULT_LIMIT = 5;\n\nconst INTEGRATION_NAME = 'LinkedErrors';\n\nconst _linkedErrorsIntegration = ((options: LinkedErrorsOptions = {}) => {\n const limit = options.limit || DEFAULT_LIMIT;\n const key = options.key || DEFAULT_KEY;\n\n return {\n name: INTEGRATION_NAME,\n // TODO v8: Remove this\n setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function\n preprocessEvent(event, hint, client) {\n const options = client.getOptions();\n\n applyAggregateErrorsToEvent(\n exceptionFromError,\n options.stackParser,\n options.maxValueLength,\n key,\n limit,\n event,\n hint,\n );\n },\n };\n}) satisfies IntegrationFn;\n\nexport const linkedErrorsIntegration = defineIntegration(_linkedErrorsIntegration);\n\n/**\n * Adds SDK info to an event.\n * @deprecated Use `linkedErrorsIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport const LinkedErrors = convertIntegrationFnToClass(INTEGRATION_NAME, linkedErrorsIntegration) as IntegrationClass<\n Integration & { preprocessEvent: (event: Event, hint: EventHint, client: Client) => void }\n> & { new (options?: { key?: string; limit?: number }): Integration };\n", "export type { ClientClass } from './sdk';\nexport type { AsyncContextStrategy, Carrier, Layer, RunWithAsyncContextOptions } from './hub';\nexport type { OfflineStore, OfflineTransportOptions } from './transports/offline';\nexport type { ServerRuntimeClientOptions } from './server-runtime-client';\nexport type { RequestDataIntegrationOptions } from './integrations/requestdata';\nexport type { IntegrationIndex } from './integration';\n\nexport * from './tracing';\nexport * from './semanticAttributes';\nexport { createEventEnvelope, createSessionEnvelope } from './envelope';\nexport {\n addBreadcrumb,\n captureCheckIn,\n withMonitor,\n captureException,\n captureEvent,\n captureMessage,\n close,\n // eslint-disable-next-line deprecation/deprecation\n configureScope,\n flush,\n lastEventId,\n // eslint-disable-next-line deprecation/deprecation\n startTransaction,\n setContext,\n setExtra,\n setExtras,\n setTag,\n setTags,\n setUser,\n withScope,\n withIsolationScope,\n getClient,\n isInitialized,\n getCurrentScope,\n startSession,\n endSession,\n captureSession,\n withActiveSpan,\n} from './exports';\nexport {\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub,\n getIsolationScope,\n getHubFromCarrier,\n // eslint-disable-next-line deprecation/deprecation\n Hub,\n // eslint-disable-next-line deprecation/deprecation\n makeMain,\n getMainCarrier,\n runWithAsyncContext,\n setHubOnCarrier,\n ensureHubOnCarrier,\n setAsyncContextStrategy,\n} from './hub';\nexport { makeSession, closeSession, updateSession } from './session';\nexport { SessionFlusher } from './sessionflusher';\nexport { Scope, getGlobalScope, setGlobalScope } from './scope';\nexport {\n notifyEventProcessors,\n // eslint-disable-next-line deprecation/deprecation\n addGlobalEventProcessor,\n} from './eventProcessors';\nexport { getEnvelopeEndpointWithUrlEncodedAuth, getReportDialogEndpoint } from './api';\nexport { BaseClient, addEventProcessor } from './baseclient';\nexport { ServerRuntimeClient } from './server-runtime-client';\nexport { initAndBind, setCurrentClient } from './sdk';\nexport { createTransport } from './transports/base';\nexport { makeOfflineTransport } from './transports/offline';\nexport { makeMultiplexedTransport } from './transports/multiplexed';\nexport { SDK_VERSION } from './version';\nexport {\n getIntegrationsToSetup,\n addIntegration,\n defineIntegration,\n // eslint-disable-next-line deprecation/deprecation\n convertIntegrationFnToClass,\n} from './integration';\nexport { applyScopeDataToEvent, mergeScopeData } from './utils/applyScopeDataToEvent';\nexport { prepareEvent } from './utils/prepareEvent';\nexport { createCheckInEnvelope } from './checkin';\nexport { createSpanEnvelope } from './span';\nexport { hasTracingEnabled } from './utils/hasTracingEnabled';\nexport { isSentryRequestUrl } from './utils/isSentryRequestUrl';\nexport { handleCallbackErrors } from './utils/handleCallbackErrors';\nexport { parameterize } from './utils/parameterize';\nexport { spanToTraceHeader, spanToJSON, spanIsSampled, spanToTraceContext } from './utils/spanUtils';\nexport { getRootSpan } from './utils/getRootSpan';\nexport { applySdkMetadata } from './utils/sdkMetadata';\nexport { DEFAULT_ENVIRONMENT } from './constants';\n/* eslint-disable deprecation/deprecation */\nexport { ModuleMetadata } from './integrations/metadata';\nexport { RequestData } from './integrations/requestdata';\nexport { InboundFilters } from './integrations/inboundfilters';\nexport { FunctionToString } from './integrations/functiontostring';\nexport { LinkedErrors } from './integrations/linkederrors';\n/* eslint-enable deprecation/deprecation */\nimport * as INTEGRATIONS from './integrations';\nexport { functionToStringIntegration } from './integrations/functiontostring';\nexport { inboundFiltersIntegration } from './integrations/inboundfilters';\nexport { linkedErrorsIntegration } from './integrations/linkederrors';\nexport { moduleMetadataIntegration } from './integrations/metadata';\nexport { requestDataIntegration } from './integrations/requestdata';\nexport { metrics } from './metrics/exports';\n\n/** @deprecated Import the integration function directly, e.g. `inboundFiltersIntegration()` instead of `new Integrations.InboundFilter(). */\nconst Integrations = INTEGRATIONS;\n\n// eslint-disable-next-line deprecation/deprecation\nexport { Integrations };\n", "declare const __DEBUG_BUILD__: boolean;\n\n/**\n * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.\n *\n * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.\n */\nexport const DEBUG_BUILD = __DEBUG_BUILD__;\n", "import { GLOBAL_OBJ } from '@sentry/utils';\n\nexport const WINDOW = GLOBAL_OBJ as typeof GLOBAL_OBJ &\n // document is not available in all browser environments (webworkers). We make it optional so you have to explicitly check for it\n Omit<Window, 'document'> &\n Partial<Pick<Window, 'document'>>;\n", "import type { IdleTransaction, SpanStatusType } from '@sentry/core';\nimport { getActiveTransaction, spanToJSON } from '@sentry/core';\nimport { logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../common/debug-build';\nimport { WINDOW } from './types';\n\n/**\n * Add a listener that cancels and finishes a transaction when the global\n * document is hidden.\n */\nexport function registerBackgroundTabDetection(): void {\n if (WINDOW.document) {\n WINDOW.document.addEventListener('visibilitychange', () => {\n // eslint-disable-next-line deprecation/deprecation\n const activeTransaction = getActiveTransaction() as IdleTransaction;\n if (WINDOW.document!.hidden && activeTransaction) {\n const statusType: SpanStatusType = 'cancelled';\n\n const { op, status } = spanToJSON(activeTransaction);\n\n DEBUG_BUILD &&\n logger.log(`[Tracing] Transaction: ${statusType} -> since tab moved to the background, op: ${op}`);\n // We should not set status if it is already set, this prevent important statuses like\n // error or data loss from being overwritten on transaction.\n if (!status) {\n activeTransaction.setStatus(statusType);\n }\n // TODO: Can we rewrite this to an attribute?\n // eslint-disable-next-line deprecation/deprecation\n activeTransaction.setTag('visibilitychange', 'document.hidden');\n activeTransaction.end();\n }\n });\n } else {\n DEBUG_BUILD && logger.warn('[Tracing] Could not set up background tab detection due to lack of global document');\n }\n}\n", "/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Metric, ReportCallback } from '../types';\n\nexport const bindReporter = (\n callback: ReportCallback,\n metric: Metric,\n reportAllChanges?: boolean,\n): ((forceReport?: boolean) => void) => {\n let prevValue: number;\n let delta: number;\n return (forceReport?: boolean) => {\n if (metric.value >= 0) {\n if (forceReport || reportAllChanges) {\n delta = metric.value - (prevValue || 0);\n\n // Report the metric if there's a non-zero delta or if no previous\n // value exists (which can happen in the case of the document becoming\n // hidden when the metric value is 0).\n // See: https://github.com/GoogleChrome/web-vitals/issues/14\n if (delta || prevValue === undefined) {\n prevValue = metric.value;\n metric.delta = delta;\n callback(metric);\n }\n }\n }\n };\n};\n", "/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Performantly generate a unique, 30-char string by combining a version\n * number, the current timestamp with a 13-digit number integer.\n * @return {string}\n */\nexport const generateUniqueID = (): string => {\n return `v3-${Date.now()}-${Math.floor(Math.random() * (9e12 - 1)) + 1e12}`;\n};\n", "/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { WINDOW } from '../../types';\nimport type { NavigationTimingPolyfillEntry } from '../types';\n\nconst getNavigationEntryFromPerformanceTiming = (): NavigationTimingPolyfillEntry => {\n // eslint-disable-next-line deprecation/deprecation\n const timing = WINDOW.performance.timing;\n // eslint-disable-next-line deprecation/deprecation\n const type = WINDOW.performance.navigation.type;\n\n const navigationEntry: { [key: string]: number | string } = {\n entryType: 'navigation',\n startTime: 0,\n type: type == 2 ? 'back_forward' : type === 1 ? 'reload' : 'navigate',\n };\n\n for (const key in timing) {\n if (key !== 'navigationStart' && key !== 'toJSON') {\n // eslint-disable-next-line deprecation/deprecation\n navigationEntry[key] = Math.max((timing[key as keyof PerformanceTiming] as number) - timing.navigationStart, 0);\n }\n }\n return navigationEntry as unknown as NavigationTimingPolyfillEntry;\n};\n\nexport const getNavigationEntry = (): PerformanceNavigationTiming | NavigationTimingPolyfillEntry | undefined => {\n if (WINDOW.__WEB_VITALS_POLYFILL__) {\n return (\n WINDOW.performance &&\n ((performance.getEntriesByType && performance.getEntriesByType('navigation')[0]) ||\n getNavigationEntryFromPerformanceTiming())\n );\n } else {\n return WINDOW.performance && performance.getEntriesByType && performance.getEntriesByType('navigation')[0];\n }\n};\n", "/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getNavigationEntry } from './getNavigationEntry';\n\nexport const getActivationStart = (): number => {\n const navEntry = getNavigationEntry();\n return (navEntry && navEntry.activationStart) || 0;\n};\n", "/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { WINDOW } from '../../types';\nimport type { Metric } from '../types';\nimport { generateUniqueID } from './generateUniqueID';\nimport { getActivationStart } from './getActivationStart';\nimport { getNavigationEntry } from './getNavigationEntry';\n\nexport const initMetric = (name: Metric['name'], value?: number): Metric => {\n const navEntry = getNavigationEntry();\n let navigationType: Metric['navigationType'] = 'navigate';\n\n if (navEntry) {\n if ((WINDOW.document && WINDOW.document.prerendering) || getActivationStart() > 0) {\n navigationType = 'prerender';\n } else {\n navigationType = navEntry.type.replace(/_/g, '-') as Metric['navigationType'];\n }\n }\n\n return {\n name,\n value: typeof value === 'undefined' ? -1 : value,\n rating: 'good', // Will be updated if the value changes.\n delta: 0,\n entries: [],\n id: generateUniqueID(),\n navigationType,\n };\n};\n", "/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { FirstInputPolyfillEntry, NavigationTimingPolyfillEntry, PerformancePaintTiming } from '../types';\n\nexport interface PerformanceEntryHandler {\n (entry: PerformanceEntry): void;\n}\n\ninterface PerformanceEntryMap {\n event: PerformanceEventTiming[];\n paint: PerformancePaintTiming[];\n 'layout-shift': LayoutShift[];\n 'largest-contentful-paint': LargestContentfulPaint[];\n 'first-input': PerformanceEventTiming[] | FirstInputPolyfillEntry[];\n navigation: PerformanceNavigationTiming[] | NavigationTimingPolyfillEntry[];\n resource: PerformanceResourceTiming[];\n longtask: PerformanceEntry[];\n}\n\n/**\n * Takes a performance entry type and a callback function, and creates a\n * `PerformanceObserver` instance that will observe the specified entry type\n * with buffering enabled and call the callback _for each entry_.\n *\n * This function also feature-detects entry support and wraps the logic in a\n * try/catch to avoid errors in unsupporting browsers.\n */\nexport const observe = <K extends keyof PerformanceEntryMap>(\n type: K,\n callback: (entries: PerformanceEntryMap[K]) => void,\n opts?: PerformanceObserverInit,\n): PerformanceObserver | undefined => {\n try {\n if (PerformanceObserver.supportedEntryTypes.includes(type)) {\n const po = new PerformanceObserver(list => {\n callback(list.getEntries() as PerformanceEntryMap[K]);\n });\n po.observe(\n Object.assign(\n {\n type,\n buffered: true,\n },\n opts || {},\n ) as PerformanceObserverInit,\n );\n return po;\n }\n } catch (e) {\n // Do nothing.\n }\n return;\n};\n", "/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { WINDOW } from '../../types';\n\nexport interface OnHiddenCallback {\n (event: Event): void;\n}\n\nexport const onHidden = (cb: OnHiddenCallback, once?: boolean): void => {\n const onHiddenOrPageHide = (event: Event): void => {\n if (event.type === 'pagehide' || WINDOW.document!.visibilityState === 'hidden') {\n cb(event);\n if (once) {\n removeEventListener('visibilitychange', onHiddenOrPageHide, true);\n removeEventListener('pagehide', onHiddenOrPageHide, true);\n }\n }\n };\n\n if (WINDOW.document) {\n addEventListener('visibilitychange', onHiddenOrPageHide, true);\n // Some browsers have buggy implementations of visibilitychange,\n // so we use pagehide in addition, just to be safe.\n addEventListener('pagehide', onHiddenOrPageHide, true);\n }\n};\n", "/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { bindReporter } from './lib/bindReporter';\nimport { initMetric } from './lib/initMetric';\nimport { observe } from './lib/observe';\nimport { onHidden } from './lib/onHidden';\nimport type { CLSMetric, ReportCallback, StopListening } from './types';\n\n/**\n * Calculates the [CLS](https://web.dev/cls/) value for the current page and\n * calls the `callback` function once the value is ready to be reported, along\n * with all `layout-shift` performance entries that were used in the metric\n * value calculation. The reported value is a `double` (corresponding to a\n * [layout shift score](https://web.dev/cls/#layout-shift-score)).\n *\n * If the `reportAllChanges` configuration option is set to `true`, the\n * `callback` function will be called as soon as the value is initially\n * determined as well as any time the value changes throughout the page\n * lifespan.\n *\n * _**Important:** CLS should be continually monitored for changes throughout\n * the entire lifespan of a page—including if the user returns to the page after\n * it's been hidden/backgrounded. However, since browsers often [will not fire\n * additional callbacks once the user has backgrounded a\n * page](https://developer.chrome.com/blog/page-lifecycle-api/#advice-hidden),\n * `callback` is always called when the page's visibility state changes to\n * hidden. As a result, the `callback` function might be called multiple times\n * during the same page load._\n */\nexport const onCLS = (\n onReport: ReportCallback,\n options: { reportAllChanges?: boolean } = {},\n): StopListening | undefined => {\n const metric = initMetric('CLS', 0);\n let report: ReturnType<typeof bindReporter>;\n\n let sessionValue = 0;\n let sessionEntries: PerformanceEntry[] = [];\n\n // const handleEntries = (entries: Metric['entries']) => {\n const handleEntries = (entries: LayoutShift[]): void => {\n entries.forEach(entry => {\n // Only count layout shifts without recent user input.\n if (!entry.hadRecentInput) {\n const firstSessionEntry = sessionEntries[0];\n const lastSessionEntry = sessionEntries[sessionEntries.length - 1];\n\n // If the entry occurred less than 1 second after the previous entry and\n // less than 5 seconds after the first entry in the session, include the\n // entry in the current session. Otherwise, start a new session.\n if (\n sessionValue &&\n sessionEntries.length !== 0 &&\n entry.startTime - lastSessionEntry.startTime < 1000 &&\n entry.startTime - firstSessionEntry.startTime < 5000\n ) {\n sessionValue += entry.value;\n sessionEntries.push(entry);\n } else {\n sessionValue = entry.value;\n sessionEntries = [entry];\n }\n\n // If the current session value is larger than the current CLS value,\n // update CLS and the entries contributing to it.\n if (sessionValue > metric.value) {\n metric.value = sessionValue;\n metric.entries = sessionEntries;\n if (report) {\n report();\n }\n }\n }\n });\n };\n\n const po = observe('layout-shift', handleEntries);\n if (po) {\n report = bindReporter(onReport, metric, options.reportAllChanges);\n\n const stopListening = (): void => {\n handleEntries(po.takeRecords() as CLSMetric['entries']);\n report(true);\n };\n\n onHidden(stopListening);\n\n return stopListening;\n }\n\n return;\n};\n", "/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { WINDOW } from '../../types';\nimport { onHidden } from './onHidden';\n\nlet firstHiddenTime = -1;\n\nconst initHiddenTime = (): void => {\n // If the document is hidden and not prerendering, assume it was always\n // hidden and the page was loaded in the background.\n if (WINDOW.document && WINDOW.document.visibilityState) {\n firstHiddenTime = WINDOW.document.visibilityState === 'hidden' && !WINDOW.document.prerendering ? 0 : Infinity;\n }\n};\n\nconst trackChanges = (): void => {\n // Update the time if/when the document becomes hidden.\n onHidden(({ timeStamp }) => {\n firstHiddenTime = timeStamp;\n }, true);\n};\n\nexport const getVisibilityWatcher = (): {\n readonly firstHiddenTime: number;\n} => {\n if (firstHiddenTime < 0) {\n // If the document is hidden when this code runs, assume it was hidden\n // since navigation start. This isn't a perfect heuristic, but it's the\n // best we can do until an API is available to support querying past\n // visibilityState.\n initHiddenTime();\n trackChanges();\n }\n return {\n get firstHiddenTime() {\n return firstHiddenTime;\n },\n };\n};\n", "/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { bindReporter } from './lib/bindReporter';\nimport { getVisibilityWatcher } from './lib/getVisibilityWatcher';\nimport { initMetric } from './lib/initMetric';\nimport { observe } from './lib/observe';\nimport { onHidden } from './lib/onHidden';\nimport type { FIDMetric, PerformanceEventTiming, ReportCallback } from './types';\n\n/**\n * Calculates the [FID](https://web.dev/fid/) value for the current page and\n * calls the `callback` function once the value is ready, along with the\n * relevant `first-input` performance entry used to determine the value. The\n * reported value is a `DOMHighResTimeStamp`.\n *\n * _**Important:** since FID is only reported after the user interacts with the\n * page, it's possible that it will not be reported for some page loads._\n */\nexport const onFID = (onReport: ReportCallback): void => {\n const visibilityWatcher = getVisibilityWatcher();\n const metric = initMetric('FID');\n // eslint-disable-next-line prefer-const\n let report: ReturnType<typeof bindReporter>;\n\n const handleEntry = (entry: PerformanceEventTiming): void => {\n // Only report if the page wasn't hidden prior to the first input.\n if (entry.startTime < visibilityWatcher.firstHiddenTime) {\n metric.value = entry.processingStart - entry.startTime;\n metric.entries.push(entry);\n report(true);\n }\n };\n\n const handleEntries = (entries: FIDMetric['entries']): void => {\n (entries as PerformanceEventTiming[]).forEach(handleEntry);\n };\n\n const po = observe('first-input', handleEntries);\n report = bindReporter(onReport, metric);\n\n if (po) {\n onHidden(() => {\n handleEntries(po.takeRecords() as FIDMetric['entries']);\n po.disconnect();\n }, true);\n }\n};\n", "/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Metric } from '../../types';\nimport { observe } from '../observe';\n\ndeclare global {\n interface Performance {\n interactionCount: number;\n }\n}\n\nlet interactionCountEstimate = 0;\nlet minKnownInteractionId = Infinity;\nlet maxKnownInteractionId = 0;\n\nconst updateEstimate = (entries: Metric['entries']): void => {\n (entries as PerformanceEventTiming[]).forEach(e => {\n if (e.interactionId) {\n minKnownInteractionId = Math.min(minKnownInteractionId, e.interactionId);\n maxKnownInteractionId = Math.max(maxKnownInteractionId, e.interactionId);\n\n interactionCountEstimate = maxKnownInteractionId ? (maxKnownInteractionId - minKnownInteractionId) / 7 + 1 : 0;\n }\n });\n};\n\nlet po: PerformanceObserver | undefined;\n\n/**\n * Returns the `interactionCount` value using the native API (if available)\n * or the polyfill estimate in this module.\n */\nexport const getInteractionCount = (): number => {\n return po ? interactionCountEstimate : performance.interactionCount || 0;\n};\n\n/**\n * Feature detects native support or initializes the polyfill if needed.\n */\nexport const initInteractionCountPolyfill = (): void => {\n if ('interactionCount' in performance || po) return;\n\n po = observe('event', updateEstimate, {\n type: 'event',\n buffered: true,\n durationThreshold: 0,\n } as PerformanceObserverInit);\n};\n", "/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { bindReporter } from './lib/bindReporter';\nimport { initMetric } from './lib/initMetric';\nimport { observe } from './lib/observe';\nimport { onHidden } from './lib/onHidden';\nimport { getInteractionCount, initInteractionCountPolyfill } from './lib/polyfills/interactionCountPolyfill';\nimport type { ReportCallback, ReportOpts } from './types';\nimport type { INPMetric } from './types/inp';\n\ninterface Interaction {\n id: number;\n latency: number;\n entries: PerformanceEventTiming[];\n}\n\n/**\n * Returns the interaction count since the last bfcache restore (or for the\n * full page lifecycle if there were no bfcache restores).\n */\nconst getInteractionCountForNavigation = (): number => {\n return getInteractionCount();\n};\n\n// To prevent unnecessary memory usage on pages with lots of interactions,\n// store at most 10 of the longest interactions to consider as INP candidates.\nconst MAX_INTERACTIONS_TO_CONSIDER = 10;\n\n// A list of longest interactions on the page (by latency) sorted so the\n// longest one is first. The list is as most MAX_INTERACTIONS_TO_CONSIDER long.\nconst longestInteractionList: Interaction[] = [];\n\n// A mapping of longest interactions by their interaction ID.\n// This is used for faster lookup.\nconst longestInteractionMap: { [interactionId: string]: Interaction } = {};\n\n/**\n * Takes a performance entry and adds it to the list of worst interactions\n * if its duration is long enough to make it among the worst. If the\n * entry is part of an existing interaction, it is merged and the latency\n * and entries list is updated as needed.\n */\nconst processEntry = (entry: PerformanceEventTiming): void => {\n // The least-long of the 10 longest interactions.\n const minLongestInteraction = longestInteractionList[longestInteractionList.length - 1];\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const existingInteraction = longestInteractionMap[entry.interactionId!];\n\n // Only process the entry if it's possibly one of the ten longest,\n // or if it's part of an existing interaction.\n if (\n existingInteraction ||\n longestInteractionList.length < MAX_INTERACTIONS_TO_CONSIDER ||\n entry.duration > minLongestInteraction.latency\n ) {\n // If the interaction already exists, update it. Otherwise create one.\n if (existingInteraction) {\n existingInteraction.entries.push(entry);\n existingInteraction.latency = Math.max(existingInteraction.latency, entry.duration);\n } else {\n const interaction = {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n id: entry.interactionId!,\n latency: entry.duration,\n entries: [entry],\n };\n longestInteractionMap[interaction.id] = interaction;\n longestInteractionList.push(interaction);\n }\n\n // Sort the entries by latency (descending) and keep only the top ten.\n longestInteractionList.sort((a, b) => b.latency - a.latency);\n longestInteractionList.splice(MAX_INTERACTIONS_TO_CONSIDER).forEach(i => {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete longestInteractionMap[i.id];\n });\n }\n};\n\n/**\n * Returns the estimated p98 longest interaction based on the stored\n * interaction candidates and the interaction count for the current page.\n */\nconst estimateP98LongestInteraction = (): Interaction => {\n const candidateInteractionIndex = Math.min(\n longestInteractionList.length - 1,\n Math.floor(getInteractionCountForNavigation() / 50),\n );\n\n return longestInteractionList[candidateInteractionIndex];\n};\n\n/**\n * Calculates the [INP](https://web.dev/responsiveness/) value for the current\n * page and calls the `callback` function once the value is ready, along with\n * the `event` performance entries reported for that interaction. The reported\n * value is a `DOMHighResTimeStamp`.\n *\n * A custom `durationThreshold` configuration option can optionally be passed to\n * control what `event-timing` entries are considered for INP reporting. The\n * default threshold is `40`, which means INP scores of less than 40 are\n * reported as 0. Note that this will not affect your 75th percentile INP value\n * unless that value is also less than 40 (well below the recommended\n * [good](https://web.dev/inp/#what-is-a-good-inp-score) threshold).\n *\n * If the `reportAllChanges` configuration option is set to `true`, the\n * `callback` function will be called as soon as the value is initially\n * determined as well as any time the value changes throughout the page\n * lifespan.\n *\n * _**Important:** INP should be continually monitored for changes throughout\n * the entire lifespan of a page—including if the user returns to the page after\n * it's been hidden/backgrounded. However, since browsers often [will not fire\n * additional callbacks once the user has backgrounded a\n * page](https://developer.chrome.com/blog/page-lifecycle-api/#advice-hidden),\n * `callback` is always called when the page's visibility state changes to\n * hidden. As a result, the `callback` function might be called multiple times\n * during the same page load._\n */\nexport const onINP = (onReport: ReportCallback, opts?: ReportOpts): void => {\n // Set defaults\n // eslint-disable-next-line no-param-reassign\n opts = opts || {};\n\n // https://web.dev/inp/#what's-a-%22good%22-inp-value\n // const thresholds = [200, 500];\n\n // TODO(philipwalton): remove once the polyfill is no longer needed.\n initInteractionCountPolyfill();\n\n const metric = initMetric('INP');\n // eslint-disable-next-line prefer-const\n let report: ReturnType<typeof bindReporter>;\n\n const handleEntries = (entries: INPMetric['entries']): void => {\n entries.forEach(entry => {\n if (entry.interactionId) {\n processEntry(entry);\n }\n\n // Entries of type `first-input` don't currently have an `interactionId`,\n // so to consider them in INP we have to first check that an existing\n // entry doesn't match the `duration` and `startTime`.\n // Note that this logic assumes that `event` entries are dispatched\n // before `first-input` entries. This is true in Chrome but it is not\n // true in Firefox; however, Firefox doesn't support interactionId, so\n // it's not an issue at the moment.\n // TODO(philipwalton): remove once crbug.com/1325826 is fixed.\n if (entry.entryType === 'first-input') {\n const noMatchingEntry = !longestInteractionList.some(interaction => {\n return interaction.entries.some(prevEntry => {\n return entry.duration === prevEntry.duration && entry.startTime === prevEntry.startTime;\n });\n });\n if (noMatchingEntry) {\n processEntry(entry);\n }\n }\n });\n\n const inp = estimateP98LongestInteraction();\n\n if (inp && inp.latency !== metric.value) {\n metric.value = inp.latency;\n metric.entries = inp.entries;\n report();\n }\n };\n\n const po = observe('event', handleEntries, {\n // Event Timing entries have their durations rounded to the nearest 8ms,\n // so a duration of 40ms would be any event that spans 2.5 or more frames\n // at 60Hz. This threshold is chosen to strike a balance between usefulness\n // and performance. Running this callback for any interaction that spans\n // just one or two frames is likely not worth the insight that could be\n // gained.\n durationThreshold: opts.durationThreshold || 40,\n } as PerformanceObserverInit);\n\n report = bindReporter(onReport, metric, opts.reportAllChanges);\n\n if (po) {\n // Also observe entries of type `first-input`. This is useful in cases\n // where the first interaction is less than the `durationThreshold`.\n po.observe({ type: 'first-input', buffered: true });\n\n onHidden(() => {\n handleEntries(po.takeRecords() as INPMetric['entries']);\n\n // If the interaction count shows that there were interactions but\n // none were captured by the PerformanceObserver, report a latency of 0.\n if (metric.value < 0 && getInteractionCountForNavigation() > 0) {\n metric.value = 0;\n metric.entries = [];\n }\n\n report(true);\n });\n }\n};\n", "/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { WINDOW } from '../types';\nimport { bindReporter } from './lib/bindReporter';\nimport { getActivationStart } from './lib/getActivationStart';\nimport { getVisibilityWatcher } from './lib/getVisibilityWatcher';\nimport { initMetric } from './lib/initMetric';\nimport { observe } from './lib/observe';\nimport { onHidden } from './lib/onHidden';\nimport type { LCPMetric, ReportCallback, StopListening } from './types';\n\nconst reportedMetricIDs: Record<string, boolean> = {};\n\n/**\n * Calculates the [LCP](https://web.dev/lcp/) value for the current page and\n * calls the `callback` function once the value is ready (along with the\n * relevant `largest-contentful-paint` performance entry used to determine the\n * value). The reported value is a `DOMHighResTimeStamp`.\n */\nexport const onLCP = (onReport: ReportCallback): StopListening | undefined => {\n const visibilityWatcher = getVisibilityWatcher();\n const metric = initMetric('LCP');\n let report: ReturnType<typeof bindReporter>;\n\n const handleEntries = (entries: LCPMetric['entries']): void => {\n const lastEntry = entries[entries.length - 1] as LargestContentfulPaint;\n if (lastEntry) {\n // The startTime attribute returns the value of the renderTime if it is\n // not 0, and the value of the loadTime otherwise. The activationStart\n // reference is used because LCP should be relative to page activation\n // rather than navigation start if the page was prerendered.\n const value = Math.max(lastEntry.startTime - getActivationStart(), 0);\n\n // Only report if the page wasn't hidden prior to LCP.\n if (value < visibilityWatcher.firstHiddenTime) {\n metric.value = value;\n metric.entries = [lastEntry];\n report();\n }\n }\n };\n\n const po = observe('largest-contentful-paint', handleEntries);\n\n if (po) {\n report = bindReporter(onReport, metric);\n\n const stopListening = (): void => {\n if (!reportedMetricIDs[metric.id]) {\n handleEntries(po.takeRecords() as LCPMetric['entries']);\n po.disconnect();\n reportedMetricIDs[metric.id] = true;\n report(true);\n }\n };\n\n // Stop listening after input. Note: while scrolling is an input that\n // stop LCP observation, it's unreliable since it can be programmatically\n // generated. See: https://github.com/GoogleChrome/web-vitals/issues/75\n ['keydown', 'click'].forEach(type => {\n if (WINDOW.document) {\n addEventListener(type, stopListening, { once: true, capture: true });\n }\n });\n\n onHidden(stopListening, true);\n\n return stopListening;\n }\n\n return;\n};\n", "/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { WINDOW } from '../types';\nimport { bindReporter } from './lib/bindReporter';\nimport { getActivationStart } from './lib/getActivationStart';\nimport { getNavigationEntry } from './lib/getNavigationEntry';\nimport { initMetric } from './lib/initMetric';\nimport type { ReportCallback, ReportOpts } from './types';\nimport type { TTFBMetric } from './types/ttfb';\n\n/**\n * Runs in the next task after the page is done loading and/or prerendering.\n * @param callback\n */\nconst whenReady = (callback: () => void): void => {\n if (!WINDOW.document) {\n return;\n }\n\n if (WINDOW.document.prerendering) {\n addEventListener('prerenderingchange', () => whenReady(callback), true);\n } else if (WINDOW.document.readyState !== 'complete') {\n addEventListener('load', () => whenReady(callback), true);\n } else {\n // Queue a task so the callback runs after `loadEventEnd`.\n setTimeout(callback, 0);\n }\n};\n\n/**\n * Calculates the [TTFB](https://web.dev/time-to-first-byte/) value for the\n * current page and calls the `callback` function once the page has loaded,\n * along with the relevant `navigation` performance entry used to determine the\n * value. The reported value is a `DOMHighResTimeStamp`.\n *\n * Note, this function waits until after the page is loaded to call `callback`\n * in order to ensure all properties of the `navigation` entry are populated.\n * This is useful if you want to report on other metrics exposed by the\n * [Navigation Timing API](https://w3c.github.io/navigation-timing/). For\n * example, the TTFB metric starts from the page's [time\n * origin](https://www.w3.org/TR/hr-time-2/#sec-time-origin), which means it\n * includes time spent on DNS lookup, connection negotiation, network latency,\n * and server processing time.\n */\nexport const onTTFB = (onReport: ReportCallback, opts?: ReportOpts): void => {\n // Set defaults\n // eslint-disable-next-line no-param-reassign\n opts = opts || {};\n\n // https://web.dev/ttfb/#what-is-a-good-ttfb-score\n // const thresholds = [800, 1800];\n\n const metric = initMetric('TTFB');\n const report = bindReporter(onReport, metric, opts.reportAllChanges);\n\n whenReady(() => {\n const navEntry = getNavigationEntry() as TTFBMetric['entries'][number];\n\n if (navEntry) {\n // The activationStart reference is used because TTFB should be\n // relative to page activation rather than navigation start if the\n // page was prerendered. But in cases where `activationStart` occurs\n // after the first byte is received, this time should be clamped at 0.\n metric.value = Math.max(navEntry.responseStart - getActivationStart(), 0);\n\n // In some cases the value reported is negative or is larger\n // than the current page time. Ignore these cases:\n // https://github.com/GoogleChrome/web-vitals/issues/137\n // https://github.com/GoogleChrome/web-vitals/issues/162\n if (metric.value < 0 || metric.value > performance.now()) return;\n\n metric.entries = [navEntry];\n\n report(true);\n }\n });\n};\n", "import { getFunctionName, logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../common/debug-build';\nimport { onCLS } from './web-vitals/getCLS';\nimport { onFID } from './web-vitals/getFID';\nimport { onINP } from './web-vitals/getINP';\nimport { onLCP } from './web-vitals/getLCP';\nimport { observe } from './web-vitals/lib/observe';\nimport { onTTFB } from './web-vitals/onTTFB';\n\ntype InstrumentHandlerTypePerformanceObserver =\n | 'longtask'\n | 'event'\n | 'navigation'\n | 'paint'\n | 'resource'\n | 'first-input';\n\ntype InstrumentHandlerTypeMetric = 'cls' | 'lcp' | 'fid' | 'ttfb' | 'inp';\n\n// We provide this here manually instead of relying on a global, as this is not available in non-browser environements\n// And we do not want to expose such types\ninterface PerformanceEntry {\n readonly duration: number;\n readonly entryType: string;\n readonly name: string;\n readonly startTime: number;\n toJSON(): Record<string, unknown>;\n}\ninterface PerformanceEventTiming extends PerformanceEntry {\n processingStart: number;\n processingEnd: number;\n duration: number;\n cancelable?: boolean;\n target?: unknown | null;\n interactionId?: number;\n}\n\ninterface Metric {\n /**\n * The name of the metric (in acronym form).\n */\n name: 'CLS' | 'FCP' | 'FID' | 'INP' | 'LCP' | 'TTFB';\n\n /**\n * The current value of the metric.\n */\n value: number;\n\n /**\n * The rating as to whether the metric value is within the \"good\",\n * \"needs improvement\", or \"poor\" thresholds of the metric.\n */\n rating: 'good' | 'needs-improvement' | 'poor';\n\n /**\n * The delta between the current value and the last-reported value.\n * On the first report, `delta` and `value` will always be the same.\n */\n delta: number;\n\n /**\n * A unique ID representing this particular metric instance. This ID can\n * be used by an analytics tool to dedupe multiple values sent for the same\n * metric instance, or to group multiple deltas together and calculate a\n * total. It can also be used to differentiate multiple different metric\n * instances sent from the same page, which can happen if the page is\n * restored from the back/forward cache (in that case new metrics object\n * get created).\n */\n id: string;\n\n /**\n * Any performance entries relevant to the metric value calculation.\n * The array may also be empty if the metric value was not based on any\n * entries (e.g. a CLS value of 0 given no layout shifts).\n */\n entries: PerformanceEntry[];\n\n /**\n * The type of navigation\n *\n * Navigation Timing API (or `undefined` if the browser doesn't\n * support that API). For pages that are restored from the bfcache, this\n * value will be 'back-forward-cache'.\n */\n navigationType: 'navigate' | 'reload' | 'back-forward' | 'back-forward-cache' | 'prerender';\n}\n\ntype InstrumentHandlerType = InstrumentHandlerTypeMetric | InstrumentHandlerTypePerformanceObserver;\n\ntype StopListening = undefined | void | (() => void);\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype InstrumentHandlerCallback = (data: any) => void;\n\ntype CleanupHandlerCallback = () => void;\n\nconst handlers: { [key in InstrumentHandlerType]?: InstrumentHandlerCallback[] } = {};\nconst instrumented: { [key in InstrumentHandlerType]?: boolean } = {};\n\nlet _previousCls: Metric | undefined;\nlet _previousFid: Metric | undefined;\nlet _previousLcp: Metric | undefined;\nlet _previousTtfb: Metric | undefined;\nlet _previousInp: Metric | undefined;\n\n/**\n * Add a callback that will be triggered when a CLS metric is available.\n * Returns a cleanup callback which can be called to remove the instrumentation handler.\n *\n * Pass `stopOnCallback = true` to stop listening for CLS when the cleanup callback is called.\n * This will lead to the CLS being finalized and frozen.\n */\nexport function addClsInstrumentationHandler(\n callback: (data: { metric: Metric }) => void,\n stopOnCallback = false,\n): CleanupHandlerCallback {\n return addMetricObserver('cls', callback, instrumentCls, _previousCls, stopOnCallback);\n}\n\n/**\n * Add a callback that will be triggered when a LCP metric is available.\n * Returns a cleanup callback which can be called to remove the instrumentation handler.\n *\n * Pass `stopOnCallback = true` to stop listening for LCP when the cleanup callback is called.\n * This will lead to the LCP being finalized and frozen.\n */\nexport function addLcpInstrumentationHandler(\n callback: (data: { metric: Metric }) => void,\n stopOnCallback = false,\n): CleanupHandlerCallback {\n return addMetricObserver('lcp', callback, instrumentLcp, _previousLcp, stopOnCallback);\n}\n\n/**\n * Add a callback that will be triggered when a FID metric is available.\n */\nexport function addTtfbInstrumentationHandler(callback: (data: { metric: Metric }) => void): CleanupHandlerCallback {\n return addMetricObserver('ttfb', callback, instrumentTtfb, _previousTtfb);\n}\n\n/**\n * Add a callback that will be triggered when a FID metric is available.\n * Returns a cleanup callback which can be called to remove the instrumentation handler.\n */\nexport function addFidInstrumentationHandler(callback: (data: { metric: Metric }) => void): CleanupHandlerCallback {\n return addMetricObserver('fid', callback, instrumentFid, _previousFid);\n}\n\n/**\n * Add a callback that will be triggered when a INP metric is available.\n * Returns a cleanup callback which can be called to remove the instrumentation handler.\n */\nexport function addInpInstrumentationHandler(\n callback: (data: { metric: Omit<Metric, 'entries'> & { entries: PerformanceEventTiming[] } }) => void,\n): CleanupHandlerCallback {\n return addMetricObserver('inp', callback, instrumentInp, _previousInp);\n}\n\nexport function addPerformanceInstrumentationHandler(\n type: 'event' | 'first-input',\n callback: (data: { entries: ((PerformanceEntry & { target?: unknown | null }) | PerformanceEventTiming)[] }) => void,\n): CleanupHandlerCallback;\nexport function addPerformanceInstrumentationHandler(\n type: InstrumentHandlerTypePerformanceObserver,\n callback: (data: { entries: PerformanceEntry[] }) => void,\n): CleanupHandlerCallback;\n\n/**\n * Add a callback that will be triggered when a performance observer is triggered,\n * and receives the entries of the observer.\n * Returns a cleanup callback which can be called to remove the instrumentation handler.\n */\nexport function addPerformanceInstrumentationHandler(\n type: InstrumentHandlerTypePerformanceObserver,\n callback: (data: { entries: PerformanceEntry[] }) => void,\n): CleanupHandlerCallback {\n addHandler(type, callback);\n\n if (!instrumented[type]) {\n instrumentPerformanceObserver(type);\n instrumented[type] = true;\n }\n\n return getCleanupCallback(type, callback);\n}\n\n/** Trigger all handlers of a given type. */\nfunction triggerHandlers(type: InstrumentHandlerType, data: unknown): void {\n const typeHandlers = handlers[type];\n\n if (!typeHandlers || !typeHandlers.length) {\n return;\n }\n\n for (const handler of typeHandlers) {\n try {\n handler(data);\n } catch (e) {\n DEBUG_BUILD &&\n logger.error(\n `Error while triggering instrumentation handler.\\nType: ${type}\\nName: ${getFunctionName(handler)}\\nError:`,\n e,\n );\n }\n }\n}\n\nfunction instrumentCls(): StopListening {\n return onCLS(\n metric => {\n triggerHandlers('cls', {\n metric,\n });\n _previousCls = metric;\n },\n { reportAllChanges: true },\n );\n}\n\nfunction instrumentFid(): void {\n return onFID(metric => {\n triggerHandlers('fid', {\n metric,\n });\n _previousFid = metric;\n });\n}\n\nfunction instrumentLcp(): StopListening {\n return onLCP(metric => {\n triggerHandlers('lcp', {\n metric,\n });\n _previousLcp = metric;\n });\n}\n\nfunction instrumentTtfb(): StopListening {\n return onTTFB(metric => {\n triggerHandlers('ttfb', {\n metric,\n });\n _previousTtfb = metric;\n });\n}\n\nfunction instrumentInp(): void {\n return onINP(metric => {\n triggerHandlers('inp', {\n metric,\n });\n _previousInp = metric;\n });\n}\n\nfunction addMetricObserver(\n type: InstrumentHandlerTypeMetric,\n callback: InstrumentHandlerCallback,\n instrumentFn: () => StopListening,\n previousValue: Metric | undefined,\n stopOnCallback = false,\n): CleanupHandlerCallback {\n addHandler(type, callback);\n\n let stopListening: StopListening | undefined;\n\n if (!instrumented[type]) {\n stopListening = instrumentFn();\n instrumented[type] = true;\n }\n\n if (previousValue) {\n callback({ metric: previousValue });\n }\n\n return getCleanupCallback(type, callback, stopOnCallback ? stopListening : undefined);\n}\n\nfunction instrumentPerformanceObserver(type: InstrumentHandlerTypePerformanceObserver): void {\n const options: PerformanceObserverInit = {};\n\n // Special per-type options we want to use\n if (type === 'event') {\n options.durationThreshold = 0;\n }\n\n observe(\n type,\n entries => {\n triggerHandlers(type, { entries });\n },\n options,\n );\n}\n\nfunction addHandler(type: InstrumentHandlerType, handler: InstrumentHandlerCallback): void {\n handlers[type] = handlers[type] || [];\n (handlers[type] as InstrumentHandlerCallback[]).push(handler);\n}\n\n// Get a callback which can be called to remove the instrumentation handler\nfunction getCleanupCallback(\n type: InstrumentHandlerType,\n callback: InstrumentHandlerCallback,\n stopListening: StopListening,\n): CleanupHandlerCallback {\n return () => {\n if (stopListening) {\n stopListening();\n }\n\n const typeHandlers = handlers[type];\n\n if (!typeHandlers) {\n return;\n }\n\n const index = typeHandlers.indexOf(callback);\n if (index !== -1) {\n typeHandlers.splice(index, 1);\n }\n };\n}\n", "import type { Transaction } from '@sentry/core';\nimport type { Span, SpanContext } from '@sentry/types';\n\n/**\n * Checks if a given value is a valid measurement value.\n */\nexport function isMeasurementValue(value: unknown): value is number {\n return typeof value === 'number' && isFinite(value);\n}\n\n/**\n * Helper function to start child on transactions. This function will make sure that the transaction will\n * use the start timestamp of the created child span if it is earlier than the transactions actual\n * start timestamp.\n *\n * Note: this will not be possible anymore in v8,\n * unless we do some special handling for browser here...\n */\nexport function _startChild(transaction: Transaction, { startTimestamp, ...ctx }: SpanContext): Span {\n // eslint-disable-next-line deprecation/deprecation\n if (startTimestamp && transaction.startTimestamp > startTimestamp) {\n // eslint-disable-next-line deprecation/deprecation\n transaction.startTimestamp = startTimestamp;\n }\n\n // eslint-disable-next-line deprecation/deprecation\n return transaction.startChild({\n startTimestamp,\n ...ctx,\n });\n}\n", "/* eslint-disable max-lines */\nimport type { IdleTransaction, Transaction } from '@sentry/core';\nimport {\n Span,\n getActiveTransaction,\n getClient,\n hasTracingEnabled,\n isValidSampleRate,\n setMeasurement,\n} from '@sentry/core';\nimport type { ClientOptions, Measurements, SpanContext, TransactionContext } from '@sentry/types';\nimport { browserPerformanceTimeOrigin, getComponentName, htmlTreeAsString, logger, parseUrl } from '@sentry/utils';\n\nimport { spanToJSON } from '@sentry/core';\nimport { DEBUG_BUILD } from '../../common/debug-build';\nimport {\n addClsInstrumentationHandler,\n addFidInstrumentationHandler,\n addInpInstrumentationHandler,\n addLcpInstrumentationHandler,\n addPerformanceInstrumentationHandler,\n addTtfbInstrumentationHandler,\n} from '../instrument';\nimport { WINDOW } from '../types';\nimport { getVisibilityWatcher } from '../web-vitals/lib/getVisibilityWatcher';\nimport type {\n InteractionRouteNameMapping,\n NavigatorDeviceMemory,\n NavigatorNetworkInformation,\n} from '../web-vitals/types';\nimport { _startChild, isMeasurementValue } from './utils';\n\nimport { createSpanEnvelope } from '@sentry/core';\nimport { getNavigationEntry } from '../web-vitals/lib/getNavigationEntry';\n\nconst MAX_INT_AS_BYTES = 2147483647;\n\n/**\n * Converts from milliseconds to seconds\n * @param time time in ms\n */\nfunction msToSec(time: number): number {\n return time / 1000;\n}\n\nfunction getBrowserPerformanceAPI(): Performance | undefined {\n // @ts-expect-error we want to make sure all of these are available, even if TS is sure they are\n return WINDOW && WINDOW.addEventListener && WINDOW.performance;\n}\n\nlet _performanceCursor: number = 0;\n\nlet _measurements: Measurements = {};\nlet _lcpEntry: LargestContentfulPaint | undefined;\nlet _clsEntry: LayoutShift | undefined;\n\n/**\n * Start tracking web vitals.\n * The callback returned by this function can be used to stop tracking & ensure all measurements are final & captured.\n *\n * @returns A function that forces web vitals collection\n */\nexport function startTrackingWebVitals(): () => void {\n const performance = getBrowserPerformanceAPI();\n if (performance && browserPerformanceTimeOrigin) {\n // @ts-expect-error we want to make sure all of these are available, even if TS is sure they are\n if (performance.mark) {\n WINDOW.performance.mark('sentry-tracing-init');\n }\n const fidCallback = _trackFID();\n const clsCallback = _trackCLS();\n const lcpCallback = _trackLCP();\n const ttfbCallback = _trackTtfb();\n\n return (): void => {\n fidCallback();\n clsCallback();\n lcpCallback();\n ttfbCallback();\n };\n }\n\n return () => undefined;\n}\n\n/**\n * Start tracking long tasks.\n */\nexport function startTrackingLongTasks(): void {\n addPerformanceInstrumentationHandler('longtask', ({ entries }) => {\n for (const entry of entries) {\n // eslint-disable-next-line deprecation/deprecation\n const transaction = getActiveTransaction() as IdleTransaction | undefined;\n if (!transaction) {\n return;\n }\n const startTime = msToSec((browserPerformanceTimeOrigin as number) + entry.startTime);\n const duration = msToSec(entry.duration);\n\n // eslint-disable-next-line deprecation/deprecation\n transaction.startChild({\n description: 'Main UI thread blocked',\n op: 'ui.long-task',\n origin: 'auto.ui.browser.metrics',\n startTimestamp: startTime,\n endTimestamp: startTime + duration,\n });\n }\n });\n}\n\n/**\n * Start tracking interaction events.\n */\nexport function startTrackingInteractions(): void {\n addPerformanceInstrumentationHandler('event', ({ entries }) => {\n for (const entry of entries) {\n // eslint-disable-next-line deprecation/deprecation\n const transaction = getActiveTransaction() as IdleTransaction | undefined;\n if (!transaction) {\n return;\n }\n\n if (entry.name === 'click') {\n const startTime = msToSec((browserPerformanceTimeOrigin as number) + entry.startTime);\n const duration = msToSec(entry.duration);\n\n const span: SpanContext = {\n description: htmlTreeAsString(entry.target),\n op: `ui.interaction.${entry.name}`,\n origin: 'auto.ui.browser.metrics',\n startTimestamp: startTime,\n endTimestamp: startTime + duration,\n };\n\n const componentName = getComponentName(entry.target);\n if (componentName) {\n span.attributes = { 'ui.component_name': componentName };\n }\n\n // eslint-disable-next-line deprecation/deprecation\n transaction.startChild(span);\n }\n }\n });\n}\n\n/**\n * Start tracking INP webvital events.\n */\nexport function startTrackingINP(\n interactionIdtoRouteNameMapping: InteractionRouteNameMapping,\n interactionsSampleRate: number,\n): () => void {\n const performance = getBrowserPerformanceAPI();\n if (performance && browserPerformanceTimeOrigin) {\n const inpCallback = _trackINP(interactionIdtoRouteNameMapping, interactionsSampleRate);\n\n return (): void => {\n inpCallback();\n };\n }\n\n return () => undefined;\n}\n\n/** Starts tracking the Cumulative Layout Shift on the current page. */\nfunction _trackCLS(): () => void {\n return addClsInstrumentationHandler(({ metric }) => {\n const entry = metric.entries[metric.entries.length - 1];\n if (!entry) {\n return;\n }\n\n DEBUG_BUILD && logger.log('[Measurements] Adding CLS');\n _measurements['cls'] = { value: metric.value, unit: '' };\n _clsEntry = entry as LayoutShift;\n }, true);\n}\n\n/** Starts tracking the Largest Contentful Paint on the current page. */\nfunction _trackLCP(): () => void {\n return addLcpInstrumentationHandler(({ metric }) => {\n const entry = metric.entries[metric.entries.length - 1];\n if (!entry) {\n return;\n }\n\n DEBUG_BUILD && logger.log('[Measurements] Adding LCP');\n _measurements['lcp'] = { value: metric.value, unit: 'millisecond' };\n _lcpEntry = entry as LargestContentfulPaint;\n }, true);\n}\n\n/** Starts tracking the First Input Delay on the current page. */\nfunction _trackFID(): () => void {\n return addFidInstrumentationHandler(({ metric }) => {\n const entry = metric.entries[metric.entries.length - 1];\n if (!entry) {\n return;\n }\n\n const timeOrigin = msToSec(browserPerformanceTimeOrigin as number);\n const startTime = msToSec(entry.startTime);\n DEBUG_BUILD && logger.log('[Measurements] Adding FID');\n _measurements['fid'] = { value: metric.value, unit: 'millisecond' };\n _measurements['mark.fid'] = { value: timeOrigin + startTime, unit: 'second' };\n });\n}\n\nfunction _trackTtfb(): () => void {\n return addTtfbInstrumentationHandler(({ metric }) => {\n const entry = metric.entries[metric.entries.length - 1];\n if (!entry) {\n return;\n }\n\n DEBUG_BUILD && logger.log('[Measurements] Adding TTFB');\n _measurements['ttfb'] = { value: metric.value, unit: 'millisecond' };\n });\n}\n\nconst INP_ENTRY_MAP: Record<string, 'click' | 'hover' | 'drag' | 'press'> = {\n click: 'click',\n pointerdown: 'click',\n pointerup: 'click',\n mousedown: 'click',\n mouseup: 'click',\n touchstart: 'click',\n touchend: 'click',\n mouseover: 'hover',\n mouseout: 'hover',\n mouseenter: 'hover',\n mouseleave: 'hover',\n pointerover: 'hover',\n pointerout: 'hover',\n pointerenter: 'hover',\n pointerleave: 'hover',\n dragstart: 'drag',\n dragend: 'drag',\n drag: 'drag',\n dragenter: 'drag',\n dragleave: 'drag',\n dragover: 'drag',\n drop: 'drag',\n keydown: 'press',\n keyup: 'press',\n keypress: 'press',\n input: 'press',\n};\n\n/** Starts tracking the Interaction to Next Paint on the current page. */\nfunction _trackINP(\n interactionIdToRouteNameMapping: InteractionRouteNameMapping,\n interactionsSampleRate: number,\n): () => void {\n return addInpInstrumentationHandler(({ metric }) => {\n if (metric.value === undefined) {\n return;\n }\n const entry = metric.entries.find(\n entry => entry.duration === metric.value && INP_ENTRY_MAP[entry.name] !== undefined,\n );\n const client = getClient();\n if (!entry || !client) {\n return;\n }\n const interactionType = INP_ENTRY_MAP[entry.name];\n const options = client.getOptions();\n /** Build the INP span, create an envelope from the span, and then send the envelope */\n const startTime = msToSec((browserPerformanceTimeOrigin as number) + entry.startTime);\n const duration = msToSec(metric.value);\n const interaction =\n entry.interactionId !== undefined ? interactionIdToRouteNameMapping[entry.interactionId] : undefined;\n if (interaction === undefined) {\n return;\n }\n const { routeName, parentContext, activeTransaction, user, replayId } = interaction;\n const userDisplay = user !== undefined ? user.email || user.id || user.ip_address : undefined;\n // eslint-disable-next-line deprecation/deprecation\n const profileId = activeTransaction !== undefined ? activeTransaction.getProfileId() : undefined;\n const span = new Span({\n startTimestamp: startTime,\n endTimestamp: startTime + duration,\n op: `ui.interaction.${interactionType}`,\n name: htmlTreeAsString(entry.target),\n attributes: {\n release: options.release,\n environment: options.environment,\n transaction: routeName,\n ...(userDisplay !== undefined && userDisplay !== '' ? { user: userDisplay } : {}),\n ...(profileId !== undefined ? { profile_id: profileId } : {}),\n ...(replayId !== undefined ? { replay_id: replayId } : {}),\n },\n exclusiveTime: metric.value,\n measurements: {\n inp: { value: metric.value, unit: 'millisecond' },\n },\n });\n\n /** Check to see if the span should be sampled */\n const sampleRate = getSampleRate(parentContext, options, interactionsSampleRate);\n\n if (!sampleRate) {\n return;\n }\n\n if (Math.random() < (sampleRate as number | boolean)) {\n const envelope = span ? createSpanEnvelope([span], client.getDsn()) : undefined;\n const transport = client && client.getTransport();\n if (transport && envelope) {\n transport.send(envelope).then(null, reason => {\n DEBUG_BUILD && logger.error('Error while sending interaction:', reason);\n });\n }\n return;\n }\n });\n}\n\n/** Add performance related spans to a transaction */\nexport function addPerformanceEntries(transaction: Transaction): void {\n const performance = getBrowserPerformanceAPI();\n if (!performance || !WINDOW.performance.getEntries || !browserPerformanceTimeOrigin) {\n // Gatekeeper if performance API not available\n return;\n }\n\n DEBUG_BUILD && logger.log('[Tracing] Adding & adjusting spans using Performance API');\n const timeOrigin = msToSec(browserPerformanceTimeOrigin);\n\n const performanceEntries = performance.getEntries();\n\n const { op, start_timestamp: transactionStartTime } = spanToJSON(transaction);\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n performanceEntries.slice(_performanceCursor).forEach((entry: Record<string, any>) => {\n const startTime = msToSec(entry.startTime);\n const duration = msToSec(entry.duration);\n\n // eslint-disable-next-line deprecation/deprecation\n if (transaction.op === 'navigation' && transactionStartTime && timeOrigin + startTime < transactionStartTime) {\n return;\n }\n\n switch (entry.entryType) {\n case 'navigation': {\n _addNavigationSpans(transaction, entry, timeOrigin);\n break;\n }\n case 'mark':\n case 'paint':\n case 'measure': {\n _addMeasureSpans(transaction, entry, startTime, duration, timeOrigin);\n\n // capture web vitals\n const firstHidden = getVisibilityWatcher();\n // Only report if the page wasn't hidden prior to the web vital.\n const shouldRecord = entry.startTime < firstHidden.firstHiddenTime;\n\n if (entry.name === 'first-paint' && shouldRecord) {\n DEBUG_BUILD && logger.log('[Measurements] Adding FP');\n _measurements['fp'] = { value: entry.startTime, unit: 'millisecond' };\n }\n if (entry.name === 'first-contentful-paint' && shouldRecord) {\n DEBUG_BUILD && logger.log('[Measurements] Adding FCP');\n _measurements['fcp'] = { value: entry.startTime, unit: 'millisecond' };\n }\n break;\n }\n case 'resource': {\n _addResourceSpans(transaction, entry, entry.name as string, startTime, duration, timeOrigin);\n break;\n }\n default:\n // Ignore other entry types.\n }\n });\n\n _performanceCursor = Math.max(performanceEntries.length - 1, 0);\n\n _trackNavigator(transaction);\n\n // Measurements are only available for pageload transactions\n if (op === 'pageload') {\n _addTtfbRequestTimeToMeasurements(_measurements);\n\n ['fcp', 'fp', 'lcp'].forEach(name => {\n if (!_measurements[name] || !transactionStartTime || timeOrigin >= transactionStartTime) {\n return;\n }\n // The web vitals, fcp, fp, lcp, and ttfb, all measure relative to timeOrigin.\n // Unfortunately, timeOrigin is not captured within the transaction span data, so these web vitals will need\n // to be adjusted to be relative to transaction.startTimestamp.\n const oldValue = _measurements[name].value;\n const measurementTimestamp = timeOrigin + msToSec(oldValue);\n\n // normalizedValue should be in milliseconds\n const normalizedValue = Math.abs((measurementTimestamp - transactionStartTime) * 1000);\n const delta = normalizedValue - oldValue;\n\n DEBUG_BUILD && logger.log(`[Measurements] Normalized ${name} from ${oldValue} to ${normalizedValue} (${delta})`);\n _measurements[name].value = normalizedValue;\n });\n\n const fidMark = _measurements['mark.fid'];\n if (fidMark && _measurements['fid']) {\n // create span for FID\n _startChild(transaction, {\n description: 'first input delay',\n endTimestamp: fidMark.value + msToSec(_measurements['fid'].value),\n op: 'ui.action',\n origin: 'auto.ui.browser.metrics',\n startTimestamp: fidMark.value,\n });\n\n // Delete mark.fid as we don't want it to be part of final payload\n delete _measurements['mark.fid'];\n }\n\n // If FCP is not recorded we should not record the cls value\n // according to the new definition of CLS.\n if (!('fcp' in _measurements)) {\n delete _measurements.cls;\n }\n\n Object.keys(_measurements).forEach(measurementName => {\n setMeasurement(measurementName, _measurements[measurementName].value, _measurements[measurementName].unit);\n });\n\n _tagMetricInfo(transaction);\n }\n\n _lcpEntry = undefined;\n _clsEntry = undefined;\n _measurements = {};\n}\n\n/** Create measure related spans */\nexport function _addMeasureSpans(\n transaction: Transaction,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n entry: Record<string, any>,\n startTime: number,\n duration: number,\n timeOrigin: number,\n): number {\n const measureStartTimestamp = timeOrigin + startTime;\n const measureEndTimestamp = measureStartTimestamp + duration;\n\n _startChild(transaction, {\n description: entry.name as string,\n endTimestamp: measureEndTimestamp,\n op: entry.entryType as string,\n origin: 'auto.resource.browser.metrics',\n startTimestamp: measureStartTimestamp,\n });\n\n return measureStartTimestamp;\n}\n\n/** Instrument navigation entries */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _addNavigationSpans(transaction: Transaction, entry: Record<string, any>, timeOrigin: number): void {\n ['unloadEvent', 'redirect', 'domContentLoadedEvent', 'loadEvent', 'connect'].forEach(event => {\n _addPerformanceNavigationTiming(transaction, entry, event, timeOrigin);\n });\n _addPerformanceNavigationTiming(transaction, entry, 'secureConnection', timeOrigin, 'TLS/SSL', 'connectEnd');\n _addPerformanceNavigationTiming(transaction, entry, 'fetch', timeOrigin, 'cache', 'domainLookupStart');\n _addPerformanceNavigationTiming(transaction, entry, 'domainLookup', timeOrigin, 'DNS');\n _addRequest(transaction, entry, timeOrigin);\n}\n\n/** Create performance navigation related spans */\nfunction _addPerformanceNavigationTiming(\n transaction: Transaction,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n entry: Record<string, any>,\n event: string,\n timeOrigin: number,\n description?: string,\n eventEnd?: string,\n): void {\n const end = eventEnd ? (entry[eventEnd] as number | undefined) : (entry[`${event}End`] as number | undefined);\n const start = entry[`${event}Start`] as number | undefined;\n if (!start || !end) {\n return;\n }\n _startChild(transaction, {\n op: 'browser',\n origin: 'auto.browser.browser.metrics',\n description: description || event,\n startTimestamp: timeOrigin + msToSec(start),\n endTimestamp: timeOrigin + msToSec(end),\n });\n}\n\n/** Create request and response related spans */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _addRequest(transaction: Transaction, entry: Record<string, any>, timeOrigin: number): void {\n if (entry.responseEnd) {\n // It is possible that we are collecting these metrics when the page hasn't finished loading yet, for example when the HTML slowly streams in.\n // In this case, ie. when the document request hasn't finished yet, `entry.responseEnd` will be 0.\n // In order not to produce faulty spans, where the end timestamp is before the start timestamp, we will only collect\n // these spans when the responseEnd value is available. The backend (Relay) would drop the entire transaction if it contained faulty spans.\n _startChild(transaction, {\n op: 'browser',\n origin: 'auto.browser.browser.metrics',\n description: 'request',\n startTimestamp: timeOrigin + msToSec(entry.requestStart as number),\n endTimestamp: timeOrigin + msToSec(entry.responseEnd as number),\n });\n\n _startChild(transaction, {\n op: 'browser',\n origin: 'auto.browser.browser.metrics',\n description: 'response',\n startTimestamp: timeOrigin + msToSec(entry.responseStart as number),\n endTimestamp: timeOrigin + msToSec(entry.responseEnd as number),\n });\n }\n}\n\nexport interface ResourceEntry extends Record<string, unknown> {\n initiatorType?: string;\n transferSize?: number;\n encodedBodySize?: number;\n decodedBodySize?: number;\n renderBlockingStatus?: string;\n}\n\n/** Create resource-related spans */\nexport function _addResourceSpans(\n transaction: Transaction,\n entry: ResourceEntry,\n resourceUrl: string,\n startTime: number,\n duration: number,\n timeOrigin: number,\n): void {\n // we already instrument based on fetch and xhr, so we don't need to\n // duplicate spans here.\n if (entry.initiatorType === 'xmlhttprequest' || entry.initiatorType === 'fetch') {\n return;\n }\n\n const parsedUrl = parseUrl(resourceUrl);\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const data: Record<string, any> = {};\n setResourceEntrySizeData(data, entry, 'transferSize', 'http.response_transfer_size');\n setResourceEntrySizeData(data, entry, 'encodedBodySize', 'http.response_content_length');\n setResourceEntrySizeData(data, entry, 'decodedBodySize', 'http.decoded_response_content_length');\n\n if ('renderBlockingStatus' in entry) {\n data['resource.render_blocking_status'] = entry.renderBlockingStatus;\n }\n if (parsedUrl.protocol) {\n data['url.scheme'] = parsedUrl.protocol.split(':').pop(); // the protocol returned by parseUrl includes a :, but OTEL spec does not, so we remove it.\n }\n\n if (parsedUrl.host) {\n data['server.address'] = parsedUrl.host;\n }\n\n data['url.same_origin'] = resourceUrl.includes(WINDOW.location.origin);\n\n const startTimestamp = timeOrigin + startTime;\n const endTimestamp = startTimestamp + duration;\n\n _startChild(transaction, {\n description: resourceUrl.replace(WINDOW.location.origin, ''),\n endTimestamp,\n op: entry.initiatorType ? `resource.${entry.initiatorType}` : 'resource.other',\n origin: 'auto.resource.browser.metrics',\n startTimestamp,\n data,\n });\n}\n\n/**\n * Capture the information of the user agent.\n */\nfunction _trackNavigator(transaction: Transaction): void {\n const navigator = WINDOW.navigator as null | (Navigator & NavigatorNetworkInformation & NavigatorDeviceMemory);\n if (!navigator) {\n return;\n }\n\n // track network connectivity\n const connection = navigator.connection;\n if (connection) {\n if (connection.effectiveType) {\n // TODO: Can we rewrite this to an attribute?\n // eslint-disable-next-line deprecation/deprecation\n transaction.setTag('effectiveConnectionType', connection.effectiveType);\n }\n\n if (connection.type) {\n // TODO: Can we rewrite this to an attribute?\n // eslint-disable-next-line deprecation/deprecation\n transaction.setTag('connectionType', connection.type);\n }\n\n if (isMeasurementValue(connection.rtt)) {\n _measurements['connection.rtt'] = { value: connection.rtt, unit: 'millisecond' };\n }\n }\n\n if (isMeasurementValue(navigator.deviceMemory)) {\n // TODO: Can we rewrite this to an attribute?\n // eslint-disable-next-line deprecation/deprecation\n transaction.setTag('deviceMemory', `${navigator.deviceMemory} GB`);\n }\n\n if (isMeasurementValue(navigator.hardwareConcurrency)) {\n // TODO: Can we rewrite this to an attribute?\n // eslint-disable-next-line deprecation/deprecation\n transaction.setTag('hardwareConcurrency', String(navigator.hardwareConcurrency));\n }\n}\n\n/** Add LCP / CLS data to transaction to allow debugging */\nfunction _tagMetricInfo(transaction: Transaction): void {\n if (_lcpEntry) {\n DEBUG_BUILD && logger.log('[Measurements] Adding LCP Data');\n\n // Capture Properties of the LCP element that contributes to the LCP.\n\n if (_lcpEntry.element) {\n // TODO: Can we rewrite this to an attribute?\n // eslint-disable-next-line deprecation/deprecation\n transaction.setTag('lcp.element', htmlTreeAsString(_lcpEntry.element));\n }\n\n if (_lcpEntry.id) {\n // TODO: Can we rewrite this to an attribute?\n // eslint-disable-next-line deprecation/deprecation\n transaction.setTag('lcp.id', _lcpEntry.id);\n }\n\n if (_lcpEntry.url) {\n // Trim URL to the first 200 characters.\n // TODO: Can we rewrite this to an attribute?\n // eslint-disable-next-line deprecation/deprecation\n transaction.setTag('lcp.url', _lcpEntry.url.trim().slice(0, 200));\n }\n\n // TODO: Can we rewrite this to an attribute?\n // eslint-disable-next-line deprecation/deprecation\n transaction.setTag('lcp.size', _lcpEntry.size);\n }\n\n // See: https://developer.mozilla.org/en-US/docs/Web/API/LayoutShift\n if (_clsEntry && _clsEntry.sources) {\n DEBUG_BUILD && logger.log('[Measurements] Adding CLS Data');\n _clsEntry.sources.forEach((source, index) =>\n // TODO: Can we rewrite this to an attribute?\n // eslint-disable-next-line deprecation/deprecation\n transaction.setTag(`cls.source.${index + 1}`, htmlTreeAsString(source.node)),\n );\n }\n}\n\nfunction setResourceEntrySizeData(\n data: Record<string, unknown>,\n entry: ResourceEntry,\n key: keyof Pick<ResourceEntry, 'transferSize' | 'encodedBodySize' | 'decodedBodySize'>,\n dataKey: 'http.response_transfer_size' | 'http.response_content_length' | 'http.decoded_response_content_length',\n): void {\n const entryVal = entry[key];\n if (entryVal != null && entryVal < MAX_INT_AS_BYTES) {\n data[dataKey] = entryVal;\n }\n}\n\n/**\n * Add ttfb request time information to measurements.\n *\n * ttfb information is added via vendored web vitals library.\n */\nfunction _addTtfbRequestTimeToMeasurements(_measurements: Measurements): void {\n const navEntry = getNavigationEntry();\n if (!navEntry) {\n return;\n }\n\n const { responseStart, requestStart } = navEntry;\n\n if (requestStart <= responseStart) {\n DEBUG_BUILD && logger.log('[Measurements] Adding TTFB Request Time');\n _measurements['ttfb.requestTime'] = {\n value: responseStart - requestStart,\n unit: 'millisecond',\n };\n }\n}\n\n/** Taken from @sentry/core sampling.ts */\nfunction getSampleRate(\n transactionContext: TransactionContext | undefined,\n options: ClientOptions,\n interactionsSampleRate: number,\n): number | boolean {\n if (!hasTracingEnabled(options)) {\n return false;\n }\n let sampleRate;\n if (transactionContext !== undefined && typeof options.tracesSampler === 'function') {\n sampleRate = options.tracesSampler({\n transactionContext,\n name: transactionContext.name,\n parentSampled: transactionContext.parentSampled,\n attributes: {\n // eslint-disable-next-line deprecation/deprecation\n ...transactionContext.data,\n ...transactionContext.attributes,\n },\n location: WINDOW.location,\n });\n } else if (transactionContext !== undefined && transactionContext.sampled !== undefined) {\n sampleRate = transactionContext.sampled;\n } else if (typeof options.tracesSampleRate !== 'undefined') {\n sampleRate = options.tracesSampleRate;\n } else {\n sampleRate = 1;\n }\n if (!isValidSampleRate(sampleRate)) {\n DEBUG_BUILD && logger.warn('[Tracing] Discarding interaction span because of invalid sample rate.');\n return false;\n }\n if (sampleRate === true) {\n return interactionsSampleRate;\n } else if (sampleRate === false) {\n return 0;\n }\n return sampleRate * interactionsSampleRate;\n}\n", "import {\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n getClient,\n getCurrentScope,\n getDynamicSamplingContextFromClient,\n getDynamicSamplingContextFromSpan,\n getIsolationScope,\n hasTracingEnabled,\n setHttpStatus,\n spanToTraceHeader,\n startInactiveSpan,\n} from '@sentry/core';\nimport type { Client, HandlerDataFetch, Scope, Span, SpanOrigin } from '@sentry/types';\nimport {\n BAGGAGE_HEADER_NAME,\n dynamicSamplingContextToSentryBaggageHeader,\n generateSentryTraceHeader,\n isInstanceOf,\n parseUrl,\n} from '@sentry/utils';\n\ntype PolymorphicRequestHeaders =\n | Record<string, string | undefined>\n | Array<[string, string]>\n // the below is not preicsely the Header type used in Request, but it'll pass duck-typing\n | {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any;\n append: (key: string, value: string) => void;\n get: (key: string) => string | null | undefined;\n };\n\n/**\n * Create and track fetch request spans for usage in combination with `addInstrumentationHandler`.\n *\n * @returns Span if a span was created, otherwise void.\n */\nexport function instrumentFetchRequest(\n handlerData: HandlerDataFetch,\n shouldCreateSpan: (url: string) => boolean,\n shouldAttachHeaders: (url: string) => boolean,\n spans: Record<string, Span>,\n spanOrigin: SpanOrigin = 'auto.http.browser',\n): Span | undefined {\n if (!hasTracingEnabled() || !handlerData.fetchData) {\n return undefined;\n }\n\n const shouldCreateSpanResult = shouldCreateSpan(handlerData.fetchData.url);\n\n if (handlerData.endTimestamp && shouldCreateSpanResult) {\n const spanId = handlerData.fetchData.__span;\n if (!spanId) return;\n\n const span = spans[spanId];\n if (span) {\n endSpan(span, handlerData);\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete spans[spanId];\n }\n return undefined;\n }\n\n const scope = getCurrentScope();\n const client = getClient();\n\n const { method, url } = handlerData.fetchData;\n\n const fullUrl = getFullURL(url);\n const host = fullUrl ? parseUrl(fullUrl).host : undefined;\n\n const span = shouldCreateSpanResult\n ? startInactiveSpan({\n name: `${method} ${url}`,\n onlyIfParent: true,\n attributes: {\n url,\n type: 'fetch',\n 'http.method': method,\n 'http.url': fullUrl,\n 'server.address': host,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: spanOrigin,\n },\n op: 'http.client',\n })\n : undefined;\n\n if (span) {\n handlerData.fetchData.__span = span.spanContext().spanId;\n spans[span.spanContext().spanId] = span;\n }\n\n if (shouldAttachHeaders(handlerData.fetchData.url) && client) {\n const request: string | Request = handlerData.args[0];\n\n // In case the user hasn't set the second argument of a fetch call we default it to `{}`.\n handlerData.args[1] = handlerData.args[1] || {};\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const options: { [key: string]: any } = handlerData.args[1];\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n options.headers = addTracingHeadersToFetchRequest(request, client, scope, options, span);\n }\n\n return span;\n}\n\n/**\n * Adds sentry-trace and baggage headers to the various forms of fetch headers\n */\nexport function addTracingHeadersToFetchRequest(\n request: string | unknown, // unknown is actually type Request but we can't export DOM types from this package,\n client: Client,\n scope: Scope,\n options: {\n headers?:\n | {\n [key: string]: string[] | string | undefined;\n }\n | PolymorphicRequestHeaders;\n },\n requestSpan?: Span,\n): PolymorphicRequestHeaders | undefined {\n // eslint-disable-next-line deprecation/deprecation\n const span = requestSpan || scope.getSpan();\n\n const isolationScope = getIsolationScope();\n\n const { traceId, spanId, sampled, dsc } = {\n ...isolationScope.getPropagationContext(),\n ...scope.getPropagationContext(),\n };\n\n const sentryTraceHeader = span ? spanToTraceHeader(span) : generateSentryTraceHeader(traceId, spanId, sampled);\n\n const sentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader(\n dsc ||\n (span ? getDynamicSamplingContextFromSpan(span) : getDynamicSamplingContextFromClient(traceId, client, scope)),\n );\n\n const headers =\n options.headers ||\n (typeof Request !== 'undefined' && isInstanceOf(request, Request) ? (request as Request).headers : undefined);\n\n if (!headers) {\n return { 'sentry-trace': sentryTraceHeader, baggage: sentryBaggageHeader };\n } else if (typeof Headers !== 'undefined' && isInstanceOf(headers, Headers)) {\n const newHeaders = new Headers(headers as Headers);\n\n newHeaders.append('sentry-trace', sentryTraceHeader);\n\n if (sentryBaggageHeader) {\n // If the same header is appended multiple times the browser will merge the values into a single request header.\n // Its therefore safe to simply push a \"baggage\" entry, even though there might already be another baggage header.\n newHeaders.append(BAGGAGE_HEADER_NAME, sentryBaggageHeader);\n }\n\n return newHeaders as PolymorphicRequestHeaders;\n } else if (Array.isArray(headers)) {\n const newHeaders = [...headers, ['sentry-trace', sentryTraceHeader]];\n\n if (sentryBaggageHeader) {\n // If there are multiple entries with the same key, the browser will merge the values into a single request header.\n // Its therefore safe to simply push a \"baggage\" entry, even though there might already be another baggage header.\n newHeaders.push([BAGGAGE_HEADER_NAME, sentryBaggageHeader]);\n }\n\n return newHeaders as PolymorphicRequestHeaders;\n } else {\n const existingBaggageHeader = 'baggage' in headers ? headers.baggage : undefined;\n const newBaggageHeaders: string[] = [];\n\n if (Array.isArray(existingBaggageHeader)) {\n newBaggageHeaders.push(...existingBaggageHeader);\n } else if (existingBaggageHeader) {\n newBaggageHeaders.push(existingBaggageHeader);\n }\n\n if (sentryBaggageHeader) {\n newBaggageHeaders.push(sentryBaggageHeader);\n }\n\n return {\n ...(headers as Exclude<typeof headers, Headers>),\n 'sentry-trace': sentryTraceHeader,\n baggage: newBaggageHeaders.length > 0 ? newBaggageHeaders.join(',') : undefined,\n };\n }\n}\n\nfunction getFullURL(url: string): string | undefined {\n try {\n const parsed = new URL(url);\n return parsed.href;\n } catch {\n return undefined;\n }\n}\n\nfunction endSpan(span: Span, handlerData: HandlerDataFetch): void {\n if (handlerData.response) {\n setHttpStatus(span, handlerData.response.status);\n\n const contentLength =\n handlerData.response && handlerData.response.headers && handlerData.response.headers.get('content-length');\n\n if (contentLength) {\n const contentLengthNum = parseInt(contentLength);\n if (contentLengthNum > 0) {\n span.setAttribute('http.response_content_length', contentLengthNum);\n }\n }\n } else if (handlerData.error) {\n span.setStatus('internal_error');\n }\n span.end();\n}\n", "/* eslint-disable max-lines */\nimport {\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n getClient,\n getCurrentScope,\n getDynamicSamplingContextFromClient,\n getDynamicSamplingContextFromSpan,\n getIsolationScope,\n hasTracingEnabled,\n setHttpStatus,\n spanToJSON,\n spanToTraceHeader,\n startInactiveSpan,\n} from '@sentry/core';\nimport type { HandlerDataXhr, SentryWrappedXMLHttpRequest, Span } from '@sentry/types';\nimport {\n BAGGAGE_HEADER_NAME,\n SENTRY_XHR_DATA_KEY,\n addFetchInstrumentationHandler,\n addXhrInstrumentationHandler,\n browserPerformanceTimeOrigin,\n dynamicSamplingContextToSentryBaggageHeader,\n generateSentryTraceHeader,\n parseUrl,\n stringMatchesSomePattern,\n} from '@sentry/utils';\n\nimport { instrumentFetchRequest } from '../common/fetch';\nimport { addPerformanceInstrumentationHandler } from './instrument';\nimport { WINDOW } from './types';\n\nexport const DEFAULT_TRACE_PROPAGATION_TARGETS = ['localhost', /^\\/(?!\\/)/];\n\n/** Options for Request Instrumentation */\nexport interface RequestInstrumentationOptions {\n /**\n * @deprecated Will be removed in v8.\n * Use `shouldCreateSpanForRequest` to control span creation and `tracePropagationTargets` to control\n * trace header attachment.\n */\n tracingOrigins: Array<string | RegExp>;\n\n /**\n * List of strings and/or regexes used to determine which outgoing requests will have `sentry-trace` and `baggage`\n * headers attached.\n *\n * @deprecated Use the top-level `tracePropagationTargets` option in `Sentry.init` instead.\n * This option will be removed in v8.\n *\n * Default: ['localhost', /^\\//] @see {DEFAULT_TRACE_PROPAGATION_TARGETS}\n */\n tracePropagationTargets: Array<string | RegExp>;\n\n /**\n * Flag to disable patching all together for fetch requests.\n *\n * Default: true\n */\n traceFetch: boolean;\n\n /**\n * Flag to disable patching all together for xhr requests.\n *\n * Default: true\n */\n traceXHR: boolean;\n\n /**\n * If true, Sentry will capture http timings and add them to the corresponding http spans.\n *\n * Default: true\n */\n enableHTTPTimings: boolean;\n\n /**\n * This function will be called before creating a span for a request with the given url.\n * Return false if you don't want a span for the given url.\n *\n * Default: (url: string) => true\n */\n shouldCreateSpanForRequest?(this: void, url: string): boolean;\n}\n\nexport const defaultRequestInstrumentationOptions: RequestInstrumentationOptions = {\n traceFetch: true,\n traceXHR: true,\n enableHTTPTimings: true,\n // TODO (v8): Remove this property\n tracingOrigins: DEFAULT_TRACE_PROPAGATION_TARGETS,\n tracePropagationTargets: DEFAULT_TRACE_PROPAGATION_TARGETS,\n};\n\n/** Registers span creators for xhr and fetch requests */\nexport function instrumentOutgoingRequests(_options?: Partial<RequestInstrumentationOptions>): void {\n const {\n traceFetch,\n traceXHR,\n // eslint-disable-next-line deprecation/deprecation\n tracePropagationTargets,\n // eslint-disable-next-line deprecation/deprecation\n tracingOrigins,\n shouldCreateSpanForRequest,\n enableHTTPTimings,\n } = {\n traceFetch: defaultRequestInstrumentationOptions.traceFetch,\n traceXHR: defaultRequestInstrumentationOptions.traceXHR,\n ..._options,\n };\n\n const shouldCreateSpan =\n typeof shouldCreateSpanForRequest === 'function' ? shouldCreateSpanForRequest : (_: string) => true;\n\n // TODO(v8) Remove tracingOrigins here\n // The only reason we're passing it in here is because this instrumentOutgoingRequests function is publicly exported\n // and we don't want to break the API. We can remove it in v8.\n const shouldAttachHeadersWithTargets = (url: string): boolean =>\n shouldAttachHeaders(url, tracePropagationTargets || tracingOrigins);\n\n const spans: Record<string, Span> = {};\n\n if (traceFetch) {\n addFetchInstrumentationHandler(handlerData => {\n const createdSpan = instrumentFetchRequest(handlerData, shouldCreateSpan, shouldAttachHeadersWithTargets, spans);\n // We cannot use `window.location` in the generic fetch instrumentation,\n // but we need it for reliable `server.address` attribute.\n // so we extend this in here\n if (createdSpan) {\n const fullUrl = getFullURL(handlerData.fetchData.url);\n const host = fullUrl ? parseUrl(fullUrl).host : undefined;\n createdSpan.setAttributes({\n 'http.url': fullUrl,\n 'server.address': host,\n });\n }\n\n if (enableHTTPTimings && createdSpan) {\n addHTTPTimings(createdSpan);\n }\n });\n }\n\n if (traceXHR) {\n addXhrInstrumentationHandler(handlerData => {\n const createdSpan = xhrCallback(handlerData, shouldCreateSpan, shouldAttachHeadersWithTargets, spans);\n if (enableHTTPTimings && createdSpan) {\n addHTTPTimings(createdSpan);\n }\n });\n }\n}\n\nfunction isPerformanceResourceTiming(entry: PerformanceEntry): entry is PerformanceResourceTiming {\n return (\n entry.entryType === 'resource' &&\n 'initiatorType' in entry &&\n typeof (entry as PerformanceResourceTiming).nextHopProtocol === 'string' &&\n (entry.initiatorType === 'fetch' || entry.initiatorType === 'xmlhttprequest')\n );\n}\n\n/**\n * Creates a temporary observer to listen to the next fetch/xhr resourcing timings,\n * so that when timings hit their per-browser limit they don't need to be removed.\n *\n * @param span A span that has yet to be finished, must contain `url` on data.\n */\nfunction addHTTPTimings(span: Span): void {\n const { url } = spanToJSON(span).data || {};\n\n if (!url || typeof url !== 'string') {\n return;\n }\n\n const cleanup = addPerformanceInstrumentationHandler('resource', ({ entries }) => {\n entries.forEach(entry => {\n if (isPerformanceResourceTiming(entry) && entry.name.endsWith(url)) {\n const spanData = resourceTimingEntryToSpanData(entry);\n spanData.forEach(data => span.setAttribute(...data));\n // In the next tick, clean this handler up\n // We have to wait here because otherwise this cleans itself up before it is fully done\n setTimeout(cleanup);\n }\n });\n });\n}\n\n/**\n * Converts ALPN protocol ids to name and version.\n *\n * (https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids)\n * @param nextHopProtocol PerformanceResourceTiming.nextHopProtocol\n */\nexport function extractNetworkProtocol(nextHopProtocol: string): { name: string; version: string } {\n let name = 'unknown';\n let version = 'unknown';\n let _name = '';\n for (const char of nextHopProtocol) {\n // http/1.1 etc.\n if (char === '/') {\n [name, version] = nextHopProtocol.split('/');\n break;\n }\n // h2, h3 etc.\n if (!isNaN(Number(char))) {\n name = _name === 'h' ? 'http' : _name;\n version = nextHopProtocol.split(_name)[1];\n break;\n }\n _name += char;\n }\n if (_name === nextHopProtocol) {\n // webrtc, ftp, etc.\n name = _name;\n }\n return { name, version };\n}\n\nfunction getAbsoluteTime(time: number = 0): number {\n return ((browserPerformanceTimeOrigin || performance.timeOrigin) + time) / 1000;\n}\n\nfunction resourceTimingEntryToSpanData(resourceTiming: PerformanceResourceTiming): [string, string | number][] {\n const { name, version } = extractNetworkProtocol(resourceTiming.nextHopProtocol);\n\n const timingSpanData: [string, string | number][] = [];\n\n timingSpanData.push(['network.protocol.version', version], ['network.protocol.name', name]);\n\n if (!browserPerformanceTimeOrigin) {\n return timingSpanData;\n }\n return [\n ...timingSpanData,\n ['http.request.redirect_start', getAbsoluteTime(resourceTiming.redirectStart)],\n ['http.request.fetch_start', getAbsoluteTime(resourceTiming.fetchStart)],\n ['http.request.domain_lookup_start', getAbsoluteTime(resourceTiming.domainLookupStart)],\n ['http.request.domain_lookup_end', getAbsoluteTime(resourceTiming.domainLookupEnd)],\n ['http.request.connect_start', getAbsoluteTime(resourceTiming.connectStart)],\n ['http.request.secure_connection_start', getAbsoluteTime(resourceTiming.secureConnectionStart)],\n ['http.request.connection_end', getAbsoluteTime(resourceTiming.connectEnd)],\n ['http.request.request_start', getAbsoluteTime(resourceTiming.requestStart)],\n ['http.request.response_start', getAbsoluteTime(resourceTiming.responseStart)],\n ['http.request.response_end', getAbsoluteTime(resourceTiming.responseEnd)],\n ];\n}\n\n/**\n * A function that determines whether to attach tracing headers to a request.\n * This was extracted from `instrumentOutgoingRequests` to make it easier to test shouldAttachHeaders.\n * We only export this fuction for testing purposes.\n */\nexport function shouldAttachHeaders(url: string, tracePropagationTargets: (string | RegExp)[] | undefined): boolean {\n return stringMatchesSomePattern(url, tracePropagationTargets || DEFAULT_TRACE_PROPAGATION_TARGETS);\n}\n\n/**\n * Create and track xhr request spans\n *\n * @returns Span if a span was created, otherwise void.\n */\n// eslint-disable-next-line complexity\nexport function xhrCallback(\n handlerData: HandlerDataXhr,\n shouldCreateSpan: (url: string) => boolean,\n shouldAttachHeaders: (url: string) => boolean,\n spans: Record<string, Span>,\n): Span | undefined {\n const xhr = handlerData.xhr;\n const sentryXhrData = xhr && xhr[SENTRY_XHR_DATA_KEY];\n\n if (!hasTracingEnabled() || !xhr || xhr.__sentry_own_request__ || !sentryXhrData) {\n return undefined;\n }\n\n const shouldCreateSpanResult = shouldCreateSpan(sentryXhrData.url);\n\n // check first if the request has finished and is tracked by an existing span which should now end\n if (handlerData.endTimestamp && shouldCreateSpanResult) {\n const spanId = xhr.__sentry_xhr_span_id__;\n if (!spanId) return;\n\n const span = spans[spanId];\n if (span && sentryXhrData.status_code !== undefined) {\n setHttpStatus(span, sentryXhrData.status_code);\n span.end();\n\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete spans[spanId];\n }\n return undefined;\n }\n\n const scope = getCurrentScope();\n const isolationScope = getIsolationScope();\n\n const fullUrl = getFullURL(sentryXhrData.url);\n const host = fullUrl ? parseUrl(fullUrl).host : undefined;\n\n const span = shouldCreateSpanResult\n ? startInactiveSpan({\n name: `${sentryXhrData.method} ${sentryXhrData.url}`,\n onlyIfParent: true,\n attributes: {\n type: 'xhr',\n 'http.method': sentryXhrData.method,\n 'http.url': fullUrl,\n url: sentryXhrData.url,\n 'server.address': host,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.browser',\n },\n op: 'http.client',\n })\n : undefined;\n\n if (span) {\n xhr.__sentry_xhr_span_id__ = span.spanContext().spanId;\n spans[xhr.__sentry_xhr_span_id__] = span;\n }\n\n const client = getClient();\n\n if (xhr.setRequestHeader && shouldAttachHeaders(sentryXhrData.url) && client) {\n const { traceId, spanId, sampled, dsc } = {\n ...isolationScope.getPropagationContext(),\n ...scope.getPropagationContext(),\n };\n\n const sentryTraceHeader = span ? spanToTraceHeader(span) : generateSentryTraceHeader(traceId, spanId, sampled);\n\n const sentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader(\n dsc ||\n (span ? getDynamicSamplingContextFromSpan(span) : getDynamicSamplingContextFromClient(traceId, client, scope)),\n );\n\n setHeaderOnXhr(xhr, sentryTraceHeader, sentryBaggageHeader);\n }\n\n return span;\n}\n\nfunction setHeaderOnXhr(\n xhr: SentryWrappedXMLHttpRequest,\n sentryTraceHeader: string,\n sentryBaggageHeader: string | undefined,\n): void {\n try {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n xhr.setRequestHeader!('sentry-trace', sentryTraceHeader);\n if (sentryBaggageHeader) {\n // From MDN: \"If this method is called several times with the same header, the values are merged into one single request header.\"\n // We can therefore simply set a baggage header without checking what was there before\n // https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/setRequestHeader\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n xhr.setRequestHeader!(BAGGAGE_HEADER_NAME, sentryBaggageHeader);\n }\n } catch (_) {\n // Error: InvalidStateError: Failed to execute 'setRequestHeader' on 'XMLHttpRequest': The object's state must be OPENED.\n }\n}\n\nfunction getFullURL(url: string): string | undefined {\n try {\n // By adding a base URL to new URL(), this will also work for relative urls\n // If `url` is a full URL, the base URL is ignored anyhow\n const parsed = new URL(url, WINDOW.location.origin);\n return parsed.href;\n } catch {\n return undefined;\n }\n}\n", "import type { Transaction, TransactionContext } from '@sentry/types';\nimport { addHistoryInstrumentationHandler, browserPerformanceTimeOrigin, logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../common/debug-build';\nimport { WINDOW } from './types';\n\n/**\n * Default function implementing pageload and navigation transactions\n */\nexport function instrumentRoutingWithDefaults<T extends Transaction>(\n customStartTransaction: (context: TransactionContext) => T | undefined,\n startTransactionOnPageLoad: boolean = true,\n startTransactionOnLocationChange: boolean = true,\n): void {\n if (!WINDOW || !WINDOW.location) {\n DEBUG_BUILD && logger.warn('Could not initialize routing instrumentation due to invalid location');\n return;\n }\n\n let startingUrl: string | undefined = WINDOW.location.href;\n\n let activeTransaction: T | undefined;\n if (startTransactionOnPageLoad) {\n activeTransaction = customStartTransaction({\n name: WINDOW.location.pathname,\n // pageload should always start at timeOrigin (and needs to be in s, not ms)\n startTimestamp: browserPerformanceTimeOrigin ? browserPerformanceTimeOrigin / 1000 : undefined,\n op: 'pageload',\n origin: 'auto.pageload.browser',\n metadata: { source: 'url' },\n });\n }\n\n if (startTransactionOnLocationChange) {\n addHistoryInstrumentationHandler(({ to, from }) => {\n /**\n * This early return is there to account for some cases where a navigation transaction starts right after\n * long-running pageload. We make sure that if `from` is undefined and a valid `startingURL` exists, we don't\n * create an uneccessary navigation transaction.\n *\n * This was hard to duplicate, but this behavior stopped as soon as this fix was applied. This issue might also\n * only be caused in certain development environments where the usage of a hot module reloader is causing\n * errors.\n */\n if (from === undefined && startingUrl && startingUrl.indexOf(to) !== -1) {\n startingUrl = undefined;\n return;\n }\n\n if (from !== to) {\n startingUrl = undefined;\n if (activeTransaction) {\n DEBUG_BUILD && logger.log(`[Tracing] Finishing current transaction with op: ${activeTransaction.op}`);\n // If there's an open transaction on the scope, we need to finish it before creating an new one.\n activeTransaction.end();\n }\n activeTransaction = customStartTransaction({\n name: WINDOW.location.pathname,\n op: 'navigation',\n origin: 'auto.navigation.browser',\n metadata: { source: 'url' },\n });\n }\n });\n }\n}\n", "/* eslint-disable max-lines */\nimport type { Hub, IdleTransaction } from '@sentry/core';\nimport { getClient, getCurrentScope } from '@sentry/core';\nimport {\n SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,\n TRACING_DEFAULTS,\n addTracingExtensions,\n getActiveTransaction,\n startIdleTransaction,\n} from '@sentry/core';\nimport type { EventProcessor, Integration, Transaction, TransactionContext, TransactionSource } from '@sentry/types';\nimport { getDomElement, logger, propagationContextFromHeaders } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../common/debug-build';\nimport { registerBackgroundTabDetection } from './backgroundtab';\nimport { addPerformanceInstrumentationHandler } from './instrument';\nimport {\n addPerformanceEntries,\n startTrackingINP,\n startTrackingInteractions,\n startTrackingLongTasks,\n startTrackingWebVitals,\n} from './metrics';\nimport type { RequestInstrumentationOptions } from './request';\nimport { defaultRequestInstrumentationOptions, instrumentOutgoingRequests } from './request';\nimport { instrumentRoutingWithDefaults } from './router';\nimport { WINDOW } from './types';\nimport type { InteractionRouteNameMapping } from './web-vitals/types';\n\nexport const BROWSER_TRACING_INTEGRATION_ID = 'BrowserTracing';\n\n/** Options for Browser Tracing integration */\nexport interface BrowserTracingOptions extends RequestInstrumentationOptions {\n /**\n * The time to wait in ms until the transaction will be finished during an idle state. An idle state is defined\n * by a moment where there are no in-progress spans.\n *\n * The transaction will use the end timestamp of the last finished span as the endtime for the transaction.\n * If there are still active spans when this the `idleTimeout` is set, the `idleTimeout` will get reset.\n * Time is in ms.\n *\n * Default: 1000\n */\n idleTimeout: number;\n\n /**\n * The max duration for a transaction. If a transaction duration hits the `finalTimeout` value, it\n * will be finished.\n * Time is in ms.\n *\n * Default: 30000\n */\n finalTimeout: number;\n\n /**\n * The heartbeat interval. If no new spans are started or open spans are finished within 3 heartbeats,\n * the transaction will be finished.\n * Time is in ms.\n *\n * Default: 5000\n */\n heartbeatInterval: number;\n\n /**\n * Flag to enable/disable creation of `navigation` transaction on history changes.\n *\n * Default: true\n */\n startTransactionOnLocationChange: boolean;\n\n /**\n * Flag to enable/disable creation of `pageload` transaction on first pageload.\n *\n * Default: true\n */\n startTransactionOnPageLoad: boolean;\n\n /**\n * Flag Transactions where tabs moved to background with \"cancelled\". Browser background tab timing is\n * not suited towards doing precise measurements of operations. By default, we recommend that this option\n * be enabled as background transactions can mess up your statistics in nondeterministic ways.\n *\n * Default: true\n */\n markBackgroundTransactions: boolean;\n\n /**\n * If true, Sentry will capture long tasks and add them to the corresponding transaction.\n *\n * Default: true\n */\n enableLongTask: boolean;\n\n /**\n * If true, Sentry will capture INP web vitals as standalone spans .\n *\n * Default: false\n */\n enableInp: boolean;\n\n /**\n * Sample rate to determine interaction span sampling.\n * interactionsSampleRate is applied on top of the global tracesSampleRate.\n * ie a tracesSampleRate of 0.1 and interactionsSampleRate of 0.5 will result in a 0.05 sample rate for interactions.\n *\n * Default: 1\n */\n interactionsSampleRate: number;\n\n /**\n * _metricOptions allows the user to send options to change how metrics are collected.\n *\n * _metricOptions is currently experimental.\n *\n * Default: undefined\n */\n _metricOptions?: Partial<{\n /**\n * @deprecated This property no longer has any effect and will be removed in v8.\n */\n _reportAllChanges: boolean;\n }>;\n\n /**\n * _experiments allows the user to send options to define how this integration works.\n * Note that the `enableLongTask` options is deprecated in favor of the option at the top level, and will be removed in v8.\n *\n * TODO (v8): Remove enableLongTask\n *\n * Default: undefined\n */\n _experiments: Partial<{\n enableLongTask: boolean;\n enableInteractions: boolean;\n // eslint-disable-next-line deprecation/deprecation\n onStartRouteTransaction: (t: Transaction | undefined, ctx: TransactionContext, getCurrentHub: () => Hub) => void;\n }>;\n\n /**\n * beforeNavigate is called before a pageload/navigation transaction is created and allows users to modify transaction\n * context data, or drop the transaction entirely (by setting `sampled = false` in the context).\n *\n * Note: For legacy reasons, transactions can also be dropped by returning `undefined`.\n *\n * @param context: The context data which will be passed to `startTransaction` by default\n *\n * @returns A (potentially) modified context object, with `sampled = false` if the transaction should be dropped.\n */\n beforeNavigate?(this: void, context: TransactionContext): TransactionContext | undefined;\n\n /**\n * Instrumentation that creates routing change transactions. By default creates\n * pageload and navigation transactions.\n */\n routingInstrumentation<T extends Transaction>(\n this: void,\n customStartTransaction: (context: TransactionContext) => T | undefined,\n startTransactionOnPageLoad?: boolean,\n startTransactionOnLocationChange?: boolean,\n ): void;\n}\n\nconst DEFAULT_BROWSER_TRACING_OPTIONS: BrowserTracingOptions = {\n ...TRACING_DEFAULTS,\n markBackgroundTransactions: true,\n routingInstrumentation: instrumentRoutingWithDefaults,\n startTransactionOnLocationChange: true,\n startTransactionOnPageLoad: true,\n enableLongTask: true,\n enableInp: false,\n interactionsSampleRate: 1,\n _experiments: {},\n ...defaultRequestInstrumentationOptions,\n};\n\n/** We store up to 10 interaction candidates max to cap memory usage. This is the same cap as getINP from web-vitals */\nconst MAX_INTERACTIONS = 10;\n\n/**\n * The Browser Tracing integration automatically instruments browser pageload/navigation\n * actions as transactions, and captures requests, metrics and errors as spans.\n *\n * The integration can be configured with a variety of options, and can be extended to use\n * any routing library. This integration uses {@see IdleTransaction} to create transactions.\n *\n * @deprecated Use `browserTracingIntegration()` instead.\n */\nexport class BrowserTracing implements Integration {\n // This class currently doesn't have a static `id` field like the other integration classes, because it prevented\n // @sentry/tracing from being treeshaken. Tree shakers do not like static fields, because they behave like side effects.\n // TODO: Come up with a better plan, than using static fields on integration classes, and use that plan on all\n // integrations.\n\n /** Browser Tracing integration options */\n public options: BrowserTracingOptions;\n\n /**\n * @inheritDoc\n */\n public name: string;\n\n // eslint-disable-next-line deprecation/deprecation\n private _getCurrentHub?: () => Hub;\n\n private _collectWebVitals: () => void;\n\n private _hasSetTracePropagationTargets: boolean;\n private _interactionIdToRouteNameMapping: InteractionRouteNameMapping;\n private _latestRoute: {\n name: string | undefined;\n context: TransactionContext | undefined;\n };\n\n public constructor(_options?: Partial<BrowserTracingOptions>) {\n this.name = BROWSER_TRACING_INTEGRATION_ID;\n this._hasSetTracePropagationTargets = false;\n\n addTracingExtensions();\n\n if (DEBUG_BUILD) {\n this._hasSetTracePropagationTargets = !!(\n _options &&\n // eslint-disable-next-line deprecation/deprecation\n (_options.tracePropagationTargets || _options.tracingOrigins)\n );\n }\n\n this.options = {\n ...DEFAULT_BROWSER_TRACING_OPTIONS,\n ..._options,\n };\n\n // Special case: enableLongTask can be set in _experiments\n // TODO (v8): Remove this in v8\n if (this.options._experiments.enableLongTask !== undefined) {\n this.options.enableLongTask = this.options._experiments.enableLongTask;\n }\n\n // TODO (v8): remove this block after tracingOrigins is removed\n // Set tracePropagationTargets to tracingOrigins if specified by the user\n // In case both are specified, tracePropagationTargets takes precedence\n // eslint-disable-next-line deprecation/deprecation\n if (_options && !_options.tracePropagationTargets && _options.tracingOrigins) {\n // eslint-disable-next-line deprecation/deprecation\n this.options.tracePropagationTargets = _options.tracingOrigins;\n }\n\n this._collectWebVitals = startTrackingWebVitals();\n /** Stores a mapping of interactionIds from PerformanceEventTimings to the origin interaction path */\n this._interactionIdToRouteNameMapping = {};\n\n if (this.options.enableInp) {\n startTrackingINP(this._interactionIdToRouteNameMapping, this.options.interactionsSampleRate);\n }\n if (this.options.enableLongTask) {\n startTrackingLongTasks();\n }\n if (this.options._experiments.enableInteractions) {\n startTrackingInteractions();\n }\n\n this._latestRoute = {\n name: undefined,\n context: undefined,\n };\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line deprecation/deprecation\n public setupOnce(_: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n this._getCurrentHub = getCurrentHub;\n const hub = getCurrentHub();\n // eslint-disable-next-line deprecation/deprecation\n const client = hub.getClient();\n const clientOptions = client && client.getOptions();\n\n const {\n routingInstrumentation: instrumentRouting,\n startTransactionOnLocationChange,\n startTransactionOnPageLoad,\n markBackgroundTransactions,\n traceFetch,\n traceXHR,\n shouldCreateSpanForRequest,\n enableHTTPTimings,\n _experiments,\n } = this.options;\n\n const clientOptionsTracePropagationTargets = clientOptions && clientOptions.tracePropagationTargets;\n // There are three ways to configure tracePropagationTargets:\n // 1. via top level client option `tracePropagationTargets`\n // 2. via BrowserTracing option `tracePropagationTargets`\n // 3. via BrowserTracing option `tracingOrigins` (deprecated)\n //\n // To avoid confusion, favour top level client option `tracePropagationTargets`, and fallback to\n // BrowserTracing option `tracePropagationTargets` and then `tracingOrigins` (deprecated).\n // This is done as it minimizes bundle size (we don't have to have undefined checks).\n //\n // If both 1 and either one of 2 or 3 are set (from above), we log out a warning.\n // eslint-disable-next-line deprecation/deprecation\n const tracePropagationTargets = clientOptionsTracePropagationTargets || this.options.tracePropagationTargets;\n if (DEBUG_BUILD && this._hasSetTracePropagationTargets && clientOptionsTracePropagationTargets) {\n logger.warn(\n '[Tracing] The `tracePropagationTargets` option was set in the BrowserTracing integration and top level `Sentry.init`. The top level `Sentry.init` value is being used.',\n );\n }\n\n instrumentRouting(\n (context: TransactionContext) => {\n const transaction = this._createRouteTransaction(context);\n\n this.options._experiments.onStartRouteTransaction &&\n this.options._experiments.onStartRouteTransaction(transaction, context, getCurrentHub);\n\n return transaction;\n },\n startTransactionOnPageLoad,\n startTransactionOnLocationChange,\n );\n\n if (markBackgroundTransactions) {\n registerBackgroundTabDetection();\n }\n\n if (_experiments.enableInteractions) {\n this._registerInteractionListener();\n }\n\n if (this.options.enableInp) {\n this._registerInpInteractionListener();\n }\n\n instrumentOutgoingRequests({\n traceFetch,\n traceXHR,\n tracePropagationTargets,\n shouldCreateSpanForRequest,\n enableHTTPTimings,\n });\n }\n\n /** Create routing idle transaction. */\n private _createRouteTransaction(context: TransactionContext): Transaction | undefined {\n if (!this._getCurrentHub) {\n DEBUG_BUILD &&\n logger.warn(`[Tracing] Did not create ${context.op} transaction because _getCurrentHub is invalid.`);\n return undefined;\n }\n\n const hub = this._getCurrentHub();\n\n const { beforeNavigate, idleTimeout, finalTimeout, heartbeatInterval } = this.options;\n\n const isPageloadTransaction = context.op === 'pageload';\n\n let expandedContext: TransactionContext;\n if (isPageloadTransaction) {\n const sentryTrace = isPageloadTransaction ? getMetaContent('sentry-trace') : '';\n const baggage = isPageloadTransaction ? getMetaContent('baggage') : undefined;\n const { traceId, dsc, parentSpanId, sampled } = propagationContextFromHeaders(sentryTrace, baggage);\n expandedContext = {\n traceId,\n parentSpanId,\n parentSampled: sampled,\n ...context,\n metadata: {\n // eslint-disable-next-line deprecation/deprecation\n ...context.metadata,\n dynamicSamplingContext: dsc,\n },\n trimEnd: true,\n };\n } else {\n expandedContext = {\n trimEnd: true,\n ...context,\n };\n }\n\n const modifiedContext = typeof beforeNavigate === 'function' ? beforeNavigate(expandedContext) : expandedContext;\n\n // For backwards compatibility reasons, beforeNavigate can return undefined to \"drop\" the transaction (prevent it\n // from being sent to Sentry).\n const finalContext = modifiedContext === undefined ? { ...expandedContext, sampled: false } : modifiedContext;\n\n // If `beforeNavigate` set a custom name, record that fact\n // eslint-disable-next-line deprecation/deprecation\n finalContext.metadata =\n finalContext.name !== expandedContext.name\n ? // eslint-disable-next-line deprecation/deprecation\n { ...finalContext.metadata, source: 'custom' }\n : // eslint-disable-next-line deprecation/deprecation\n finalContext.metadata;\n\n this._latestRoute.name = finalContext.name;\n this._latestRoute.context = finalContext;\n\n // eslint-disable-next-line deprecation/deprecation\n if (finalContext.sampled === false) {\n DEBUG_BUILD && logger.log(`[Tracing] Will not send ${finalContext.op} transaction because of beforeNavigate.`);\n }\n\n DEBUG_BUILD && logger.log(`[Tracing] Starting ${finalContext.op} transaction on scope`);\n\n const { location } = WINDOW;\n\n const idleTransaction = startIdleTransaction(\n hub,\n finalContext,\n idleTimeout,\n finalTimeout,\n true,\n { location }, // for use in the tracesSampler\n heartbeatInterval,\n isPageloadTransaction, // should wait for finish signal if it's a pageload transaction\n );\n\n if (isPageloadTransaction) {\n if (WINDOW.document) {\n WINDOW.document.addEventListener('readystatechange', () => {\n if (['interactive', 'complete'].includes(WINDOW.document!.readyState)) {\n idleTransaction.sendAutoFinishSignal();\n }\n });\n\n if (['interactive', 'complete'].includes(WINDOW.document.readyState)) {\n idleTransaction.sendAutoFinishSignal();\n }\n }\n }\n\n idleTransaction.registerBeforeFinishCallback(transaction => {\n this._collectWebVitals();\n addPerformanceEntries(transaction);\n });\n\n return idleTransaction as Transaction;\n }\n\n /** Start listener for interaction transactions */\n private _registerInteractionListener(): void {\n let inflightInteractionTransaction: IdleTransaction | undefined;\n const registerInteractionTransaction = (): void => {\n const { idleTimeout, finalTimeout, heartbeatInterval } = this.options;\n const op = 'ui.action.click';\n\n // eslint-disable-next-line deprecation/deprecation\n const currentTransaction = getActiveTransaction();\n if (currentTransaction && currentTransaction.op && ['navigation', 'pageload'].includes(currentTransaction.op)) {\n DEBUG_BUILD &&\n logger.warn(\n `[Tracing] Did not create ${op} transaction because a pageload or navigation transaction is in progress.`,\n );\n return undefined;\n }\n\n if (inflightInteractionTransaction) {\n inflightInteractionTransaction.setFinishReason('interactionInterrupted');\n inflightInteractionTransaction.end();\n inflightInteractionTransaction = undefined;\n }\n\n if (!this._getCurrentHub) {\n DEBUG_BUILD && logger.warn(`[Tracing] Did not create ${op} transaction because _getCurrentHub is invalid.`);\n return undefined;\n }\n\n if (!this._latestRoute.name) {\n DEBUG_BUILD && logger.warn(`[Tracing] Did not create ${op} transaction because _latestRouteName is missing.`);\n return undefined;\n }\n\n const hub = this._getCurrentHub();\n const { location } = WINDOW;\n\n const context: TransactionContext = {\n name: this._latestRoute.name,\n op,\n trimEnd: true,\n data: {\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: this._latestRoute.context\n ? getSource(this._latestRoute.context)\n : undefined || 'url',\n },\n };\n\n inflightInteractionTransaction = startIdleTransaction(\n hub,\n context,\n idleTimeout,\n finalTimeout,\n true,\n { location }, // for use in the tracesSampler\n heartbeatInterval,\n );\n };\n\n ['click'].forEach(type => {\n if (WINDOW.document) {\n addEventListener(type, registerInteractionTransaction, { once: false, capture: true });\n }\n });\n }\n\n /** Creates a listener on interaction entries, and maps interactionIds to the origin path of the interaction */\n private _registerInpInteractionListener(): void {\n const handleEntries = ({ entries }: { entries: PerformanceEntry[] }): void => {\n const client = getClient();\n // We need to get the replay, user, and activeTransaction from the current scope\n // so that we can associate replay id, profile id, and a user display to the span\n const replay =\n client !== undefined && client.getIntegrationByName !== undefined\n ? (client.getIntegrationByName('Replay') as Integration & { getReplayId: () => string })\n : undefined;\n const replayId = replay !== undefined ? replay.getReplayId() : undefined;\n // eslint-disable-next-line deprecation/deprecation\n const activeTransaction = getActiveTransaction();\n const currentScope = getCurrentScope();\n const user = currentScope !== undefined ? currentScope.getUser() : undefined;\n entries.forEach(entry => {\n if (isPerformanceEventTiming(entry)) {\n const interactionId = entry.interactionId;\n if (interactionId === undefined) {\n return;\n }\n const existingInteraction = this._interactionIdToRouteNameMapping[interactionId];\n const duration = entry.duration;\n const startTime = entry.startTime;\n const keys = Object.keys(this._interactionIdToRouteNameMapping);\n const minInteractionId =\n keys.length > 0\n ? keys.reduce((a, b) => {\n return this._interactionIdToRouteNameMapping[a].duration <\n this._interactionIdToRouteNameMapping[b].duration\n ? a\n : b;\n })\n : undefined;\n // For a first input event to be considered, we must check that an interaction event does not already exist with the same duration and start time.\n // This is also checked in the web-vitals library.\n if (entry.entryType === 'first-input') {\n const matchingEntry = keys\n .map(key => this._interactionIdToRouteNameMapping[key])\n .some(interaction => {\n return interaction.duration === duration && interaction.startTime === startTime;\n });\n if (matchingEntry) {\n return;\n }\n }\n // Interactions with an id of 0 and are not first-input are not valid.\n if (!interactionId) {\n return;\n }\n // If the interaction already exists, we want to use the duration of the longest entry, since that is what the INP metric uses.\n if (existingInteraction) {\n existingInteraction.duration = Math.max(existingInteraction.duration, duration);\n } else if (\n keys.length < MAX_INTERACTIONS ||\n minInteractionId === undefined ||\n duration > this._interactionIdToRouteNameMapping[minInteractionId].duration\n ) {\n // If the interaction does not exist, we want to add it to the mapping if there is space, or if the duration is longer than the shortest entry.\n const routeName = this._latestRoute.name;\n const parentContext = this._latestRoute.context;\n if (routeName && parentContext) {\n if (minInteractionId && Object.keys(this._interactionIdToRouteNameMapping).length >= MAX_INTERACTIONS) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete this._interactionIdToRouteNameMapping[minInteractionId];\n }\n this._interactionIdToRouteNameMapping[interactionId] = {\n routeName,\n duration,\n parentContext,\n user,\n activeTransaction,\n replayId,\n startTime,\n };\n }\n }\n }\n });\n };\n addPerformanceInstrumentationHandler('event', handleEntries);\n addPerformanceInstrumentationHandler('first-input', handleEntries);\n }\n}\n\n/** Returns the value of a meta tag */\nexport function getMetaContent(metaName: string): string | undefined {\n // Can't specify generic to `getDomElement` because tracing can be used\n // in a variety of environments, have to disable `no-unsafe-member-access`\n // as a result.\n const metaTag = getDomElement(`meta[name=${metaName}]`);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return metaTag ? metaTag.getAttribute('content') : undefined;\n}\n\nfunction getSource(context: TransactionContext): TransactionSource | undefined {\n const sourceFromAttributes = context.attributes && context.attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE];\n // eslint-disable-next-line deprecation/deprecation\n const sourceFromData = context.data && context.data[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE];\n // eslint-disable-next-line deprecation/deprecation\n const sourceFromMetadata = context.metadata && context.metadata.source;\n\n return sourceFromAttributes || sourceFromData || sourceFromMetadata;\n}\n\nfunction isPerformanceEventTiming(entry: PerformanceEntry): entry is PerformanceEventTiming {\n return 'duration' in entry;\n}\n", "import type { browserTracingIntegration } from '@sentry-internal/tracing';\nimport { BrowserTracing } from '@sentry-internal/tracing';\nimport { captureException, withScope } from '@sentry/core';\nimport type { DsnLike, Integration, Mechanism, WrappedFunction } from '@sentry/types';\nimport {\n GLOBAL_OBJ,\n addExceptionMechanism,\n addExceptionTypeValue,\n addNonEnumerableProperty,\n getOriginalFunction,\n markFunctionWrapped,\n} from '@sentry/utils';\n\nexport const WINDOW = GLOBAL_OBJ as typeof GLOBAL_OBJ & Window;\n\nlet ignoreOnError: number = 0;\n\n/**\n * @hidden\n */\nexport function shouldIgnoreOnError(): boolean {\n return ignoreOnError > 0;\n}\n\n/**\n * @hidden\n */\nexport function ignoreNextOnError(): void {\n // onerror should trigger before setTimeout\n ignoreOnError++;\n setTimeout(() => {\n ignoreOnError--;\n });\n}\n\n/**\n * Instruments the given function and sends an event to Sentry every time the\n * function throws an exception.\n *\n * @param fn A function to wrap. It is generally safe to pass an unbound function, because the returned wrapper always\n * has a correct `this` context.\n * @returns The wrapped function.\n * @hidden\n */\nexport function wrap(\n fn: WrappedFunction,\n options: {\n mechanism?: Mechanism;\n } = {},\n before?: WrappedFunction,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): any {\n // for future readers what this does is wrap a function and then create\n // a bi-directional wrapping between them.\n //\n // example: wrapped = wrap(original);\n // original.__sentry_wrapped__ -> wrapped\n // wrapped.__sentry_original__ -> original\n\n if (typeof fn !== 'function') {\n return fn;\n }\n\n try {\n // if we're dealing with a function that was previously wrapped, return\n // the original wrapper.\n const wrapper = fn.__sentry_wrapped__;\n if (wrapper) {\n if (typeof wrapper === 'function') {\n return wrapper;\n } else {\n // If we find that the `__sentry_wrapped__` function is not a function at the time of accessing it, it means\n // that something messed with it. In that case we want to return the originally passed function.\n return fn;\n }\n }\n\n // We don't wanna wrap it twice\n if (getOriginalFunction(fn)) {\n return fn;\n }\n } catch (e) {\n // Just accessing custom props in some Selenium environments\n // can cause a \"Permission denied\" exception (see raven-js#495).\n // Bail on wrapping and return the function as-is (defers to window.onerror).\n return fn;\n }\n\n /* eslint-disable prefer-rest-params */\n // It is important that `sentryWrapped` is not an arrow function to preserve the context of `this`\n const sentryWrapped: WrappedFunction = function (this: unknown): void {\n const args = Array.prototype.slice.call(arguments);\n\n try {\n if (before && typeof before === 'function') {\n before.apply(this, arguments);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n const wrappedArguments = args.map((arg: any) => wrap(arg, options));\n\n // Attempt to invoke user-land function\n // NOTE: If you are a Sentry user, and you are seeing this stack frame, it\n // means the sentry.javascript SDK caught an error invoking your application code. This\n // is expected behavior and NOT indicative of a bug with sentry.javascript.\n return fn.apply(this, wrappedArguments);\n } catch (ex) {\n ignoreNextOnError();\n\n withScope(scope => {\n scope.addEventProcessor(event => {\n if (options.mechanism) {\n addExceptionTypeValue(event, undefined, undefined);\n addExceptionMechanism(event, options.mechanism);\n }\n\n event.extra = {\n ...event.extra,\n arguments: args,\n };\n\n return event;\n });\n\n captureException(ex);\n });\n\n throw ex;\n }\n };\n /* eslint-enable prefer-rest-params */\n\n // Accessing some objects may throw\n // ref: https://github.com/getsentry/sentry-javascript/issues/1168\n try {\n for (const property in fn) {\n if (Object.prototype.hasOwnProperty.call(fn, property)) {\n sentryWrapped[property] = fn[property];\n }\n }\n } catch (_oO) {} // eslint-disable-line no-empty\n\n // Signal that this function has been wrapped/filled already\n // for both debugging and to prevent it to being wrapped/filled twice\n markFunctionWrapped(sentryWrapped, fn);\n\n addNonEnumerableProperty(fn, '__sentry_wrapped__', sentryWrapped);\n\n // Restore original function name (not all browsers allow that)\n try {\n const descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, 'name') as PropertyDescriptor;\n if (descriptor.configurable) {\n Object.defineProperty(sentryWrapped, 'name', {\n get(): string {\n return fn.name;\n },\n });\n }\n // eslint-disable-next-line no-empty\n } catch (_oO) {}\n\n return sentryWrapped;\n}\n\n/**\n * All properties the report dialog supports\n *\n * @deprecated This type will be removed in the next major version of the Sentry SDK. `showReportDialog` will still be around, however the `eventId` option will now be required.\n */\nexport interface ReportDialogOptions {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any;\n eventId?: string;\n dsn?: DsnLike;\n user?: {\n email?: string;\n name?: string;\n };\n lang?: string;\n title?: string;\n subtitle?: string;\n subtitle2?: string;\n labelName?: string;\n labelEmail?: string;\n labelComments?: string;\n labelClose?: string;\n labelSubmit?: string;\n errorGeneric?: string;\n errorFormEntry?: string;\n successMessage?: string;\n /** Callback after reportDialog showed up */\n onLoad?(this: void): void;\n /** Callback after reportDialog closed */\n onClose?(this: void): void;\n}\n\n/**\n * This is a slim shim of `browserTracingIntegration` for the CDN bundles.\n * Since the actual functional integration uses a different code from `BrowserTracing`,\n * we want to avoid shipping both of them in the CDN bundles, as that would blow up the size.\n * Instead, we provide a functional integration with the same API, but the old implementation.\n * This means that it's not possible to register custom routing instrumentation, but that's OK for now.\n * We also don't expose the utilities for this anyhow in the CDN bundles.\n * For users that need custom routing in CDN bundles, they have to continue using `new BrowserTracing()` until v8.\n */\nexport function bundleBrowserTracingIntegration(\n options: Parameters<typeof browserTracingIntegration>[0] = {},\n): Integration {\n // Migrate some options from the old integration to the new one\n // eslint-disable-next-line deprecation/deprecation\n const opts: ConstructorParameters<typeof BrowserTracing>[0] = options;\n\n if (typeof options.markBackgroundSpan === 'boolean') {\n opts.markBackgroundTransactions = options.markBackgroundSpan;\n }\n\n if (typeof options.instrumentPageLoad === 'boolean') {\n opts.startTransactionOnPageLoad = options.instrumentPageLoad;\n }\n\n if (typeof options.instrumentNavigation === 'boolean') {\n opts.startTransactionOnLocationChange = options.instrumentNavigation;\n }\n\n // eslint-disable-next-line deprecation/deprecation\n return new BrowserTracing(opts);\n}\n", "declare const __DEBUG_BUILD__: boolean;\n\n/**\n * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.\n *\n * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.\n */\nexport const DEBUG_BUILD = __DEBUG_BUILD__;\n", "import { getClient } from '@sentry/core';\nimport type {\n Event,\n EventHint,\n Exception,\n ParameterizedString,\n Severity,\n SeverityLevel,\n StackFrame,\n StackParser,\n} from '@sentry/types';\nimport {\n addExceptionMechanism,\n addExceptionTypeValue,\n extractExceptionKeysForMessage,\n isDOMError,\n isDOMException,\n isError,\n isErrorEvent,\n isEvent,\n isParameterizedString,\n isPlainObject,\n normalizeToSize,\n resolvedSyncPromise,\n} from '@sentry/utils';\n\ntype Prototype = { constructor: (...args: unknown[]) => unknown };\n\n/**\n * This function creates an exception from a JavaScript Error\n */\nexport function exceptionFromError(stackParser: StackParser, ex: Error): Exception {\n // Get the frames first since Opera can lose the stack if we touch anything else first\n const frames = parseStackFrames(stackParser, ex);\n\n const exception: Exception = {\n type: ex && ex.name,\n value: extractMessage(ex),\n };\n\n if (frames.length) {\n exception.stacktrace = { frames };\n }\n\n if (exception.type === undefined && exception.value === '') {\n exception.value = 'Unrecoverable error caught';\n }\n\n return exception;\n}\n\n/**\n * @hidden\n */\nexport function eventFromPlainObject(\n stackParser: StackParser,\n exception: Record<string, unknown>,\n syntheticException?: Error,\n isUnhandledRejection?: boolean,\n): Event {\n const client = getClient();\n const normalizeDepth = client && client.getOptions().normalizeDepth;\n\n const event: Event = {\n exception: {\n values: [\n {\n type: isEvent(exception) ? exception.constructor.name : isUnhandledRejection ? 'UnhandledRejection' : 'Error',\n value: getNonErrorObjectExceptionValue(exception, { isUnhandledRejection }),\n },\n ],\n },\n extra: {\n __serialized__: normalizeToSize(exception, normalizeDepth),\n },\n };\n\n if (syntheticException) {\n const frames = parseStackFrames(stackParser, syntheticException);\n if (frames.length) {\n // event.exception.values[0] has been set above\n (event.exception as { values: Exception[] }).values[0].stacktrace = { frames };\n }\n }\n\n return event;\n}\n\n/**\n * @hidden\n */\nexport function eventFromError(stackParser: StackParser, ex: Error): Event {\n return {\n exception: {\n values: [exceptionFromError(stackParser, ex)],\n },\n };\n}\n\n/** Parses stack frames from an error */\nexport function parseStackFrames(\n stackParser: StackParser,\n ex: Error & { framesToPop?: number; stacktrace?: string },\n): StackFrame[] {\n // Access and store the stacktrace property before doing ANYTHING\n // else to it because Opera is not very good at providing it\n // reliably in other circumstances.\n const stacktrace = ex.stacktrace || ex.stack || '';\n\n const popSize = getPopSize(ex);\n\n try {\n return stackParser(stacktrace, popSize);\n } catch (e) {\n // no-empty\n }\n\n return [];\n}\n\n// Based on our own mapping pattern - https://github.com/getsentry/sentry/blob/9f08305e09866c8bd6d0c24f5b0aabdd7dd6c59c/src/sentry/lang/javascript/errormapping.py#L83-L108\nconst reactMinifiedRegexp = /Minified React error #\\d+;/i;\n\nfunction getPopSize(ex: Error & { framesToPop?: number }): number {\n if (ex) {\n if (typeof ex.framesToPop === 'number') {\n return ex.framesToPop;\n }\n\n if (reactMinifiedRegexp.test(ex.message)) {\n return 1;\n }\n }\n\n return 0;\n}\n\n/**\n * There are cases where stacktrace.message is an Event object\n * https://github.com/getsentry/sentry-javascript/issues/1949\n * In this specific case we try to extract stacktrace.message.error.message\n */\nfunction extractMessage(ex: Error & { message: { error?: Error } }): string {\n const message = ex && ex.message;\n if (!message) {\n return 'No error message';\n }\n if (message.error && typeof message.error.message === 'string') {\n return message.error.message;\n }\n return message;\n}\n\n/**\n * Creates an {@link Event} from all inputs to `captureException` and non-primitive inputs to `captureMessage`.\n * @hidden\n */\nexport function eventFromException(\n stackParser: StackParser,\n exception: unknown,\n hint?: EventHint,\n attachStacktrace?: boolean,\n): PromiseLike<Event> {\n const syntheticException = (hint && hint.syntheticException) || undefined;\n const event = eventFromUnknownInput(stackParser, exception, syntheticException, attachStacktrace);\n addExceptionMechanism(event); // defaults to { type: 'generic', handled: true }\n event.level = 'error';\n if (hint && hint.event_id) {\n event.event_id = hint.event_id;\n }\n return resolvedSyncPromise(event);\n}\n\n/**\n * Builds and Event from a Message\n * @hidden\n */\nexport function eventFromMessage(\n stackParser: StackParser,\n message: ParameterizedString,\n // eslint-disable-next-line deprecation/deprecation\n level: Severity | SeverityLevel = 'info',\n hint?: EventHint,\n attachStacktrace?: boolean,\n): PromiseLike<Event> {\n const syntheticException = (hint && hint.syntheticException) || undefined;\n const event = eventFromString(stackParser, message, syntheticException, attachStacktrace);\n event.level = level;\n if (hint && hint.event_id) {\n event.event_id = hint.event_id;\n }\n return resolvedSyncPromise(event);\n}\n\n/**\n * @hidden\n */\nexport function eventFromUnknownInput(\n stackParser: StackParser,\n exception: unknown,\n syntheticException?: Error,\n attachStacktrace?: boolean,\n isUnhandledRejection?: boolean,\n): Event {\n let event: Event;\n\n if (isErrorEvent(exception as ErrorEvent) && (exception as ErrorEvent).error) {\n // If it is an ErrorEvent with `error` property, extract it to get actual Error\n const errorEvent = exception as ErrorEvent;\n return eventFromError(stackParser, errorEvent.error as Error);\n }\n\n // If it is a `DOMError` (which is a legacy API, but still supported in some browsers) then we just extract the name\n // and message, as it doesn't provide anything else. According to the spec, all `DOMExceptions` should also be\n // `Error`s, but that's not the case in IE11, so in that case we treat it the same as we do a `DOMError`.\n //\n // https://developer.mozilla.org/en-US/docs/Web/API/DOMError\n // https://developer.mozilla.org/en-US/docs/Web/API/DOMException\n // https://webidl.spec.whatwg.org/#es-DOMException-specialness\n if (isDOMError(exception) || isDOMException(exception as DOMException)) {\n const domException = exception as DOMException;\n\n if ('stack' in (exception as Error)) {\n event = eventFromError(stackParser, exception as Error);\n } else {\n const name = domException.name || (isDOMError(domException) ? 'DOMError' : 'DOMException');\n const message = domException.message ? `${name}: ${domException.message}` : name;\n event = eventFromString(stackParser, message, syntheticException, attachStacktrace);\n addExceptionTypeValue(event, message);\n }\n if ('code' in domException) {\n // eslint-disable-next-line deprecation/deprecation\n event.tags = { ...event.tags, 'DOMException.code': `${domException.code}` };\n }\n\n return event;\n }\n if (isError(exception)) {\n // we have a real Error object, do nothing\n return eventFromError(stackParser, exception);\n }\n if (isPlainObject(exception) || isEvent(exception)) {\n // If it's a plain object or an instance of `Event` (the built-in JS kind, not this SDK's `Event` type), serialize\n // it manually. This will allow us to group events based on top-level keys which is much better than creating a new\n // group on any key/value change.\n const objectException = exception as Record<string, unknown>;\n event = eventFromPlainObject(stackParser, objectException, syntheticException, isUnhandledRejection);\n addExceptionMechanism(event, {\n synthetic: true,\n });\n return event;\n }\n\n // If none of previous checks were valid, then it means that it's not:\n // - an instance of DOMError\n // - an instance of DOMException\n // - an instance of Event\n // - an instance of Error\n // - a valid ErrorEvent (one with an error property)\n // - a plain Object\n //\n // So bail out and capture it as a simple message:\n event = eventFromString(stackParser, exception as string, syntheticException, attachStacktrace);\n addExceptionTypeValue(event, `${exception}`, undefined);\n addExceptionMechanism(event, {\n synthetic: true,\n });\n\n return event;\n}\n\n/**\n * @hidden\n */\nexport function eventFromString(\n stackParser: StackParser,\n message: ParameterizedString,\n syntheticException?: Error,\n attachStacktrace?: boolean,\n): Event {\n const event: Event = {};\n\n if (attachStacktrace && syntheticException) {\n const frames = parseStackFrames(stackParser, syntheticException);\n if (frames.length) {\n event.exception = {\n values: [{ value: message, stacktrace: { frames } }],\n };\n }\n }\n\n if (isParameterizedString(message)) {\n const { __sentry_template_string__, __sentry_template_values__ } = message;\n\n event.logentry = {\n message: __sentry_template_string__,\n params: __sentry_template_values__,\n };\n return event;\n }\n\n event.message = message;\n return event;\n}\n\nfunction getNonErrorObjectExceptionValue(\n exception: Record<string, unknown>,\n { isUnhandledRejection }: { isUnhandledRejection?: boolean },\n): string {\n const keys = extractExceptionKeysForMessage(exception);\n const captureType = isUnhandledRejection ? 'promise rejection' : 'exception';\n\n // Some ErrorEvent instances do not have an `error` property, which is why they are not handled before\n // We still want to try to get a decent message for these cases\n if (isErrorEvent(exception)) {\n return `Event \\`ErrorEvent\\` captured as ${captureType} with message \\`${exception.message}\\``;\n }\n\n if (isEvent(exception)) {\n const className = getObjectClassName(exception);\n return `Event \\`${className}\\` (type=${exception.type}) captured as ${captureType}`;\n }\n\n return `Object captured as ${captureType} with keys: ${keys}`;\n}\n\nfunction getObjectClassName(obj: unknown): string | undefined | void {\n try {\n const prototype: Prototype | null = Object.getPrototypeOf(obj);\n return prototype ? prototype.constructor.name : undefined;\n } catch (e) {\n // ignore errors here\n }\n}\n", "import type { DsnComponents, EventEnvelope, SdkMetadata, UserFeedback, UserFeedbackItem } from '@sentry/types';\nimport { createEnvelope, dsnToString } from '@sentry/utils';\n\n/**\n * Creates an envelope from a user feedback.\n */\nexport function createUserFeedbackEnvelope(\n feedback: UserFeedback,\n {\n metadata,\n tunnel,\n dsn,\n }: {\n metadata: SdkMetadata | undefined;\n tunnel: string | undefined;\n dsn: DsnComponents | undefined;\n },\n): EventEnvelope {\n const headers: EventEnvelope[0] = {\n event_id: feedback.event_id,\n sent_at: new Date().toISOString(),\n ...(metadata &&\n metadata.sdk && {\n sdk: {\n name: metadata.sdk.name,\n version: metadata.sdk.version,\n },\n }),\n ...(!!tunnel && !!dsn && { dsn: dsnToString(dsn) }),\n };\n const item = createUserFeedbackEnvelopeItem(feedback);\n\n return createEnvelope(headers, [item]);\n}\n\nfunction createUserFeedbackEnvelopeItem(feedback: UserFeedback): UserFeedbackItem {\n const feedbackHeaders: UserFeedbackItem[0] = {\n type: 'user_report',\n };\n return [feedbackHeaders, feedback];\n}\n", "import type { Scope } from '@sentry/core';\nimport { applySdkMetadata } from '@sentry/core';\nimport { BaseClient } from '@sentry/core';\nimport type {\n BrowserClientProfilingOptions,\n BrowserClientReplayOptions,\n ClientOptions,\n Event,\n EventHint,\n Options,\n ParameterizedString,\n Severity,\n SeverityLevel,\n UserFeedback,\n} from '@sentry/types';\nimport { createClientReportEnvelope, dsnToString, getSDKSource, logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from './debug-build';\nimport { eventFromException, eventFromMessage } from './eventbuilder';\nimport { WINDOW } from './helpers';\nimport type { BrowserTransportOptions } from './transports/types';\nimport { createUserFeedbackEnvelope } from './userfeedback';\n\n/**\n * Configuration options for the Sentry Browser SDK.\n * @see @sentry/types Options for more information.\n */\nexport type BrowserOptions = Options<BrowserTransportOptions> &\n BrowserClientReplayOptions &\n BrowserClientProfilingOptions;\n\n/**\n * Configuration options for the Sentry Browser SDK Client class\n * @see BrowserClient for more information.\n */\nexport type BrowserClientOptions = ClientOptions<BrowserTransportOptions> &\n BrowserClientReplayOptions &\n BrowserClientProfilingOptions;\n\n/**\n * The Sentry Browser SDK Client.\n *\n * @see BrowserOptions for documentation on configuration options.\n * @see SentryClient for usage documentation.\n */\nexport class BrowserClient extends BaseClient<BrowserClientOptions> {\n /**\n * Creates a new Browser SDK instance.\n *\n * @param options Configuration options for this SDK.\n */\n public constructor(options: BrowserClientOptions) {\n const sdkSource = WINDOW.SENTRY_SDK_SOURCE || getSDKSource();\n applySdkMetadata(options, 'browser', ['browser'], sdkSource);\n\n super(options);\n\n if (options.sendClientReports && WINDOW.document) {\n WINDOW.document.addEventListener('visibilitychange', () => {\n if (WINDOW.document.visibilityState === 'hidden') {\n this._flushOutcomes();\n }\n });\n }\n }\n\n /**\n * @inheritDoc\n */\n public eventFromException(exception: unknown, hint?: EventHint): PromiseLike<Event> {\n return eventFromException(this._options.stackParser, exception, hint, this._options.attachStacktrace);\n }\n\n /**\n * @inheritDoc\n */\n public eventFromMessage(\n message: ParameterizedString,\n // eslint-disable-next-line deprecation/deprecation\n level: Severity | SeverityLevel = 'info',\n hint?: EventHint,\n ): PromiseLike<Event> {\n return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace);\n }\n\n /**\n * Sends user feedback to Sentry.\n */\n public captureUserFeedback(feedback: UserFeedback): void {\n if (!this._isEnabled()) {\n DEBUG_BUILD && logger.warn('SDK not enabled, will not capture user feedback.');\n return;\n }\n\n const envelope = createUserFeedbackEnvelope(feedback, {\n metadata: this.getSdkMetadata(),\n dsn: this.getDsn(),\n tunnel: this.getOptions().tunnel,\n });\n\n // _sendEnvelope should not throw\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this._sendEnvelope(envelope);\n }\n\n /**\n * @inheritDoc\n */\n protected _prepareEvent(event: Event, hint: EventHint, scope?: Scope): PromiseLike<Event | null> {\n event.platform = event.platform || 'javascript';\n return super._prepareEvent(event, hint, scope);\n }\n\n /**\n * Sends client reports as an envelope.\n */\n private _flushOutcomes(): void {\n const outcomes = this._clearOutcomes();\n\n if (outcomes.length === 0) {\n DEBUG_BUILD && logger.log('No outcomes to send');\n return;\n }\n\n // This is really the only place where we want to check for a DSN and only send outcomes then\n if (!this._dsn) {\n DEBUG_BUILD && logger.log('No dsn provided, will not send outcomes');\n return;\n }\n\n DEBUG_BUILD && logger.log('Sending outcomes:', outcomes);\n\n const envelope = createClientReportEnvelope(outcomes, this._options.tunnel && dsnToString(this._dsn));\n\n // _sendEnvelope should not throw\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this._sendEnvelope(envelope);\n }\n}\n", "import { isNativeFetch, logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../debug-build';\nimport { WINDOW } from '../helpers';\n\nlet cachedFetchImpl: FetchImpl | undefined = undefined;\n\nexport type FetchImpl = typeof fetch;\n\n/**\n * A special usecase for incorrectly wrapped Fetch APIs in conjunction with ad-blockers.\n * Whenever someone wraps the Fetch API and returns the wrong promise chain,\n * this chain becomes orphaned and there is no possible way to capture it's rejections\n * other than allowing it bubble up to this very handler. eg.\n *\n * const f = window.fetch;\n * window.fetch = function () {\n * const p = f.apply(this, arguments);\n *\n * p.then(function() {\n * console.log('hi.');\n * });\n *\n * return p;\n * }\n *\n * `p.then(function () { ... })` is producing a completely separate promise chain,\n * however, what's returned is `p` - the result of original `fetch` call.\n *\n * This mean, that whenever we use the Fetch API to send our own requests, _and_\n * some ad-blocker blocks it, this orphaned chain will _always_ reject,\n * effectively causing another event to be captured.\n * This makes a whole process become an infinite loop, which we need to somehow\n * deal with, and break it in one way or another.\n *\n * To deal with this issue, we are making sure that we _always_ use the real\n * browser Fetch API, instead of relying on what `window.fetch` exposes.\n * The only downside to this would be missing our own requests as breadcrumbs,\n * but because we are already not doing this, it should be just fine.\n *\n * Possible failed fetch error messages per-browser:\n *\n * Chrome: Failed to fetch\n * Edge: Failed to Fetch\n * Firefox: NetworkError when attempting to fetch resource\n * Safari: resource blocked by content blocker\n */\nexport function getNativeFetchImplementation(): FetchImpl {\n if (cachedFetchImpl) {\n return cachedFetchImpl;\n }\n\n /* eslint-disable @typescript-eslint/unbound-method */\n\n // Fast path to avoid DOM I/O\n if (isNativeFetch(WINDOW.fetch)) {\n return (cachedFetchImpl = WINDOW.fetch.bind(WINDOW));\n }\n\n const document = WINDOW.document;\n let fetchImpl = WINDOW.fetch;\n // eslint-disable-next-line deprecation/deprecation\n if (document && typeof document.createElement === 'function') {\n try {\n const sandbox = document.createElement('iframe');\n sandbox.hidden = true;\n document.head.appendChild(sandbox);\n const contentWindow = sandbox.contentWindow;\n if (contentWindow && contentWindow.fetch) {\n fetchImpl = contentWindow.fetch;\n }\n document.head.removeChild(sandbox);\n } catch (e) {\n DEBUG_BUILD && logger.warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', e);\n }\n }\n\n return (cachedFetchImpl = fetchImpl.bind(WINDOW));\n /* eslint-enable @typescript-eslint/unbound-method */\n}\n\n/** Clears cached fetch impl */\nexport function clearCachedFetchImplementation(): void {\n cachedFetchImpl = undefined;\n}\n", "import { createTransport } from '@sentry/core';\nimport type { Transport, TransportMakeRequestResponse, TransportRequest } from '@sentry/types';\nimport { rejectedSyncPromise } from '@sentry/utils';\n\nimport type { BrowserTransportOptions } from './types';\nimport type { FetchImpl } from './utils';\nimport { clearCachedFetchImplementation, getNativeFetchImplementation } from './utils';\n\n/**\n * Creates a Transport that uses the Fetch API to send events to Sentry.\n */\nexport function makeFetchTransport(\n options: BrowserTransportOptions,\n nativeFetch: FetchImpl = getNativeFetchImplementation(),\n): Transport {\n let pendingBodySize = 0;\n let pendingCount = 0;\n\n function makeRequest(request: TransportRequest): PromiseLike<TransportMakeRequestResponse> {\n const requestSize = request.body.length;\n pendingBodySize += requestSize;\n pendingCount++;\n\n const requestOptions: RequestInit = {\n body: request.body,\n method: 'POST',\n referrerPolicy: 'origin',\n headers: options.headers,\n // Outgoing requests are usually cancelled when navigating to a different page, causing a \"TypeError: Failed to\n // fetch\" error and sending a \"network_error\" client-outcome - in Chrome, the request status shows \"(cancelled)\".\n // The `keepalive` flag keeps outgoing requests alive, even when switching pages. We want this since we're\n // frequently sending events right before the user is switching pages (eg. whenfinishing navigation transactions).\n // Gotchas:\n // - `keepalive` isn't supported by Firefox\n // - As per spec (https://fetch.spec.whatwg.org/#http-network-or-cache-fetch):\n // If the sum of contentLength and inflightKeepaliveBytes is greater than 64 kibibytes, then return a network error.\n // We will therefore only activate the flag when we're below that limit.\n // There is also a limit of requests that can be open at the same time, so we also limit this to 15\n // See https://github.com/getsentry/sentry-javascript/pull/7553 for details\n keepalive: pendingBodySize <= 60_000 && pendingCount < 15,\n ...options.fetchOptions,\n };\n\n try {\n return nativeFetch(options.url, requestOptions).then(response => {\n pendingBodySize -= requestSize;\n pendingCount--;\n return {\n statusCode: response.status,\n headers: {\n 'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'),\n 'retry-after': response.headers.get('Retry-After'),\n },\n };\n });\n } catch (e) {\n clearCachedFetchImplementation();\n pendingBodySize -= requestSize;\n pendingCount--;\n return rejectedSyncPromise(e);\n }\n }\n\n return createTransport(options, makeRequest);\n}\n", "import { createTransport } from '@sentry/core';\nimport type { Transport, TransportMakeRequestResponse, TransportRequest } from '@sentry/types';\nimport { SyncPromise } from '@sentry/utils';\n\nimport type { BrowserTransportOptions } from './types';\n\n/**\n * The DONE ready state for XmlHttpRequest\n *\n * Defining it here as a constant b/c XMLHttpRequest.DONE is not always defined\n * (e.g. during testing, it is `undefined`)\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/readyState}\n */\nconst XHR_READYSTATE_DONE = 4;\n\n/**\n * Creates a Transport that uses the XMLHttpRequest API to send events to Sentry.\n */\nexport function makeXHRTransport(options: BrowserTransportOptions): Transport {\n function makeRequest(request: TransportRequest): PromiseLike<TransportMakeRequestResponse> {\n return new SyncPromise((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n\n xhr.onerror = reject;\n\n xhr.onreadystatechange = (): void => {\n if (xhr.readyState === XHR_READYSTATE_DONE) {\n resolve({\n statusCode: xhr.status,\n headers: {\n 'x-sentry-rate-limits': xhr.getResponseHeader('X-Sentry-Rate-Limits'),\n 'retry-after': xhr.getResponseHeader('Retry-After'),\n },\n });\n }\n };\n\n xhr.open('POST', options.url);\n\n for (const header in options.headers) {\n if (Object.prototype.hasOwnProperty.call(options.headers, header)) {\n xhr.setRequestHeader(header, options.headers[header]);\n }\n }\n\n xhr.send(request.body);\n });\n }\n\n return createTransport(options, makeRequest);\n}\n", "// This was originally forked from https://github.com/csnover/TraceKit, and was largely\n// re - written as part of raven - js.\n//\n// This code was later copied to the JavaScript mono - repo and further modified and\n// refactored over the years.\n\n// Copyright (c) 2013 Onur Can Cakmak onur.cakmak@gmail.com and all TraceKit contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files(the 'Software'), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify,\n// merge, publish, distribute, sublicense, and / or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be included in all copies\n// or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n// PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE\n// OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nimport type { StackFrame, StackLineParser, StackLineParserFn } from '@sentry/types';\nimport { createStackParser } from '@sentry/utils';\n\n// global reference to slice\nconst UNKNOWN_FUNCTION = '?';\n\nconst OPERA10_PRIORITY = 10;\nconst OPERA11_PRIORITY = 20;\nconst CHROME_PRIORITY = 30;\nconst WINJS_PRIORITY = 40;\nconst GECKO_PRIORITY = 50;\n\nfunction createFrame(filename: string, func: string, lineno?: number, colno?: number): StackFrame {\n const frame: StackFrame = {\n filename,\n function: func,\n in_app: true, // All browser frames are considered in_app\n };\n\n if (lineno !== undefined) {\n frame.lineno = lineno;\n }\n\n if (colno !== undefined) {\n frame.colno = colno;\n }\n\n return frame;\n}\n\n// Chromium based browsers: Chrome, Brave, new Opera, new Edge\nconst chromeRegex =\n /^\\s*at (?:(.+?\\)(?: \\[.+\\])?|.*?) ?\\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\\/)?.*?)(?::(\\d+))?(?::(\\d+))?\\)?\\s*$/i;\nconst chromeEvalRegex = /\\((\\S*)(?::(\\d+))(?::(\\d+))\\)/;\n\n// We cannot call this variable `chrome` because it can conflict with global `chrome` variable in certain environments\n// See: https://github.com/getsentry/sentry-javascript/issues/6880\nconst chromeStackParserFn: StackLineParserFn = line => {\n const parts = chromeRegex.exec(line);\n\n if (parts) {\n const isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line\n\n if (isEval) {\n const subMatch = chromeEvalRegex.exec(parts[2]);\n\n if (subMatch) {\n // throw out eval line/column and use top-most line/column number\n parts[2] = subMatch[1]; // url\n parts[3] = subMatch[2]; // line\n parts[4] = subMatch[3]; // column\n }\n }\n\n // Kamil: One more hack won't hurt us right? Understanding and adding more rules on top of these regexps right now\n // would be way too time consuming. (TODO: Rewrite whole RegExp to be more readable)\n const [func, filename] = extractSafariExtensionDetails(parts[1] || UNKNOWN_FUNCTION, parts[2]);\n\n return createFrame(filename, func, parts[3] ? +parts[3] : undefined, parts[4] ? +parts[4] : undefined);\n }\n\n return;\n};\n\nexport const chromeStackLineParser: StackLineParser = [CHROME_PRIORITY, chromeStackParserFn];\n\n// gecko regex: `(?:bundle|\\d+\\.js)`: `bundle` is for react native, `\\d+\\.js` also but specifically for ram bundles because it\n// generates filenames without a prefix like `file://` the filenames in the stacktrace are just 42.js\n// We need this specific case for now because we want no other regex to match.\nconst geckoREgex =\n /^\\s*(.*?)(?:\\((.*?)\\))?(?:^|@)?((?:[-a-z]+)?:\\/.*?|\\[native code\\]|[^@]*(?:bundle|\\d+\\.js)|\\/[\\w\\-. /=]+)(?::(\\d+))?(?::(\\d+))?\\s*$/i;\nconst geckoEvalRegex = /(\\S+) line (\\d+)(?: > eval line \\d+)* > eval/i;\n\nconst gecko: StackLineParserFn = line => {\n const parts = geckoREgex.exec(line);\n\n if (parts) {\n const isEval = parts[3] && parts[3].indexOf(' > eval') > -1;\n if (isEval) {\n const subMatch = geckoEvalRegex.exec(parts[3]);\n\n if (subMatch) {\n // throw out eval line/column and use top-most line number\n parts[1] = parts[1] || 'eval';\n parts[3] = subMatch[1];\n parts[4] = subMatch[2];\n parts[5] = ''; // no column when eval\n }\n }\n\n let filename = parts[3];\n let func = parts[1] || UNKNOWN_FUNCTION;\n [func, filename] = extractSafariExtensionDetails(func, filename);\n\n return createFrame(filename, func, parts[4] ? +parts[4] : undefined, parts[5] ? +parts[5] : undefined);\n }\n\n return;\n};\n\nexport const geckoStackLineParser: StackLineParser = [GECKO_PRIORITY, gecko];\n\nconst winjsRegex = /^\\s*at (?:((?:\\[object object\\])?.+) )?\\(?((?:[-a-z]+):.*?):(\\d+)(?::(\\d+))?\\)?\\s*$/i;\n\nconst winjs: StackLineParserFn = line => {\n const parts = winjsRegex.exec(line);\n\n return parts\n ? createFrame(parts[2], parts[1] || UNKNOWN_FUNCTION, +parts[3], parts[4] ? +parts[4] : undefined)\n : undefined;\n};\n\nexport const winjsStackLineParser: StackLineParser = [WINJS_PRIORITY, winjs];\n\nconst opera10Regex = / line (\\d+).*script (?:in )?(\\S+)(?:: in function (\\S+))?$/i;\n\nconst opera10: StackLineParserFn = line => {\n const parts = opera10Regex.exec(line);\n return parts ? createFrame(parts[2], parts[3] || UNKNOWN_FUNCTION, +parts[1]) : undefined;\n};\n\nexport const opera10StackLineParser: StackLineParser = [OPERA10_PRIORITY, opera10];\n\nconst opera11Regex =\n / line (\\d+), column (\\d+)\\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\\(.*\\))? in (.*):\\s*$/i;\n\nconst opera11: StackLineParserFn = line => {\n const parts = opera11Regex.exec(line);\n return parts ? createFrame(parts[5], parts[3] || parts[4] || UNKNOWN_FUNCTION, +parts[1], +parts[2]) : undefined;\n};\n\nexport const opera11StackLineParser: StackLineParser = [OPERA11_PRIORITY, opera11];\n\nexport const defaultStackLineParsers = [chromeStackLineParser, geckoStackLineParser, winjsStackLineParser];\n\nexport const defaultStackParser = createStackParser(...defaultStackLineParsers);\n\n/**\n * Safari web extensions, starting version unknown, can produce \"frames-only\" stacktraces.\n * What it means, is that instead of format like:\n *\n * Error: wat\n * at function@url:row:col\n * at function@url:row:col\n * at function@url:row:col\n *\n * it produces something like:\n *\n * function@url:row:col\n * function@url:row:col\n * function@url:row:col\n *\n * Because of that, it won't be captured by `chrome` RegExp and will fall into `Gecko` branch.\n * This function is extracted so that we can use it in both places without duplicating the logic.\n * Unfortunately \"just\" changing RegExp is too complicated now and making it pass all tests\n * and fix this case seems like an impossible, or at least way too time-consuming task.\n */\nconst extractSafariExtensionDetails = (func: string, filename: string): [string, string] => {\n const isSafariExtension = func.indexOf('safari-extension') !== -1;\n const isSafariWebExtension = func.indexOf('safari-web-extension') !== -1;\n\n return isSafariExtension || isSafariWebExtension\n ? [\n func.indexOf('@') !== -1 ? func.split('@')[0] : UNKNOWN_FUNCTION,\n isSafariExtension ? `safari-extension:${filename}` : `safari-web-extension:${filename}`,\n ]\n : [func, filename];\n};\n", "/* eslint-disable max-lines */\nimport { addBreadcrumb, convertIntegrationFnToClass, defineIntegration, getClient } from '@sentry/core';\nimport type {\n Client,\n Event as SentryEvent,\n HandlerDataConsole,\n HandlerDataDom,\n HandlerDataFetch,\n HandlerDataHistory,\n HandlerDataXhr,\n Integration,\n IntegrationClass,\n IntegrationFn,\n} from '@sentry/types';\nimport type {\n Breadcrumb,\n FetchBreadcrumbData,\n FetchBreadcrumbHint,\n XhrBreadcrumbData,\n XhrBreadcrumbHint,\n} from '@sentry/types/build/types/breadcrumb';\nimport {\n SENTRY_XHR_DATA_KEY,\n addClickKeypressInstrumentationHandler,\n addConsoleInstrumentationHandler,\n addFetchInstrumentationHandler,\n addHistoryInstrumentationHandler,\n addXhrInstrumentationHandler,\n getComponentName,\n getEventDescription,\n htmlTreeAsString,\n logger,\n parseUrl,\n safeJoin,\n severityLevelFromString,\n} from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../debug-build';\nimport { WINDOW } from '../helpers';\n\ninterface BreadcrumbsOptions {\n console: boolean;\n dom:\n | boolean\n | {\n serializeAttribute?: string | string[];\n maxStringLength?: number;\n };\n fetch: boolean;\n history: boolean;\n sentry: boolean;\n xhr: boolean;\n}\n\n/** maxStringLength gets capped to prevent 100 breadcrumbs exceeding 1MB event payload size */\nconst MAX_ALLOWED_STRING_LENGTH = 1024;\n\nconst INTEGRATION_NAME = 'Breadcrumbs';\n\nconst _breadcrumbsIntegration = ((options: Partial<BreadcrumbsOptions> = {}) => {\n const _options = {\n console: true,\n dom: true,\n fetch: true,\n history: true,\n sentry: true,\n xhr: true,\n ...options,\n };\n\n return {\n name: INTEGRATION_NAME,\n // TODO v8: Remove this\n setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function\n setup(client) {\n if (_options.console) {\n addConsoleInstrumentationHandler(_getConsoleBreadcrumbHandler(client));\n }\n if (_options.dom) {\n addClickKeypressInstrumentationHandler(_getDomBreadcrumbHandler(client, _options.dom));\n }\n if (_options.xhr) {\n addXhrInstrumentationHandler(_getXhrBreadcrumbHandler(client));\n }\n if (_options.fetch) {\n addFetchInstrumentationHandler(_getFetchBreadcrumbHandler(client));\n }\n if (_options.history) {\n addHistoryInstrumentationHandler(_getHistoryBreadcrumbHandler(client));\n }\n if (_options.sentry && client.on) {\n client.on('beforeSendEvent', _getSentryBreadcrumbHandler(client));\n }\n },\n };\n}) satisfies IntegrationFn;\n\nexport const breadcrumbsIntegration = defineIntegration(_breadcrumbsIntegration);\n\n/**\n * Default Breadcrumbs instrumentations\n *\n * @deprecated Use `breadcrumbsIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport const Breadcrumbs = convertIntegrationFnToClass(INTEGRATION_NAME, breadcrumbsIntegration) as IntegrationClass<\n Integration & { setup: (client: Client) => void }\n> & {\n new (\n options?: Partial<{\n console: boolean;\n dom:\n | boolean\n | {\n serializeAttribute?: string | string[];\n maxStringLength?: number;\n };\n fetch: boolean;\n history: boolean;\n sentry: boolean;\n xhr: boolean;\n }>,\n ): Integration;\n};\n\n/**\n * Adds a breadcrumb for Sentry events or transactions if this option is enabled.\n */\nfunction _getSentryBreadcrumbHandler(client: Client): (event: SentryEvent) => void {\n return function addSentryBreadcrumb(event: SentryEvent): void {\n if (getClient() !== client) {\n return;\n }\n\n addBreadcrumb(\n {\n category: `sentry.${event.type === 'transaction' ? 'transaction' : 'event'}`,\n event_id: event.event_id,\n level: event.level,\n message: getEventDescription(event),\n },\n {\n event,\n },\n );\n };\n}\n\n/**\n * A HOC that creaes a function that creates breadcrumbs from DOM API calls.\n * This is a HOC so that we get access to dom options in the closure.\n */\nfunction _getDomBreadcrumbHandler(\n client: Client,\n dom: BreadcrumbsOptions['dom'],\n): (handlerData: HandlerDataDom) => void {\n return function _innerDomBreadcrumb(handlerData: HandlerDataDom): void {\n if (getClient() !== client) {\n return;\n }\n\n let target;\n let componentName;\n let keyAttrs = typeof dom === 'object' ? dom.serializeAttribute : undefined;\n\n let maxStringLength =\n typeof dom === 'object' && typeof dom.maxStringLength === 'number' ? dom.maxStringLength : undefined;\n if (maxStringLength && maxStringLength > MAX_ALLOWED_STRING_LENGTH) {\n DEBUG_BUILD &&\n logger.warn(\n `\\`dom.maxStringLength\\` cannot exceed ${MAX_ALLOWED_STRING_LENGTH}, but a value of ${maxStringLength} was configured. Sentry will use ${MAX_ALLOWED_STRING_LENGTH} instead.`,\n );\n maxStringLength = MAX_ALLOWED_STRING_LENGTH;\n }\n\n if (typeof keyAttrs === 'string') {\n keyAttrs = [keyAttrs];\n }\n\n // Accessing event.target can throw (see getsentry/raven-js#838, #768)\n try {\n const event = handlerData.event as Event | Node;\n const element = _isEvent(event) ? event.target : event;\n\n target = htmlTreeAsString(element, { keyAttrs, maxStringLength });\n componentName = getComponentName(element);\n } catch (e) {\n target = '<unknown>';\n }\n\n if (target.length === 0) {\n return;\n }\n\n const breadcrumb: Breadcrumb = {\n category: `ui.${handlerData.name}`,\n message: target,\n };\n\n if (componentName) {\n breadcrumb.data = { 'ui.component_name': componentName };\n }\n\n addBreadcrumb(breadcrumb, {\n event: handlerData.event,\n name: handlerData.name,\n global: handlerData.global,\n });\n };\n}\n\n/**\n * Creates breadcrumbs from console API calls\n */\nfunction _getConsoleBreadcrumbHandler(client: Client): (handlerData: HandlerDataConsole) => void {\n return function _consoleBreadcrumb(handlerData: HandlerDataConsole): void {\n if (getClient() !== client) {\n return;\n }\n\n const breadcrumb = {\n category: 'console',\n data: {\n arguments: handlerData.args,\n logger: 'console',\n },\n level: severityLevelFromString(handlerData.level),\n message: safeJoin(handlerData.args, ' '),\n };\n\n if (handlerData.level === 'assert') {\n if (handlerData.args[0] === false) {\n breadcrumb.message = `Assertion failed: ${safeJoin(handlerData.args.slice(1), ' ') || 'console.assert'}`;\n breadcrumb.data.arguments = handlerData.args.slice(1);\n } else {\n // Don't capture a breadcrumb for passed assertions\n return;\n }\n }\n\n addBreadcrumb(breadcrumb, {\n input: handlerData.args,\n level: handlerData.level,\n });\n };\n}\n\n/**\n * Creates breadcrumbs from XHR API calls\n */\nfunction _getXhrBreadcrumbHandler(client: Client): (handlerData: HandlerDataXhr) => void {\n return function _xhrBreadcrumb(handlerData: HandlerDataXhr): void {\n if (getClient() !== client) {\n return;\n }\n\n const { startTimestamp, endTimestamp } = handlerData;\n\n const sentryXhrData = handlerData.xhr[SENTRY_XHR_DATA_KEY];\n\n // We only capture complete, non-sentry requests\n if (!startTimestamp || !endTimestamp || !sentryXhrData) {\n return;\n }\n\n const { method, url, status_code, body } = sentryXhrData;\n\n const data: XhrBreadcrumbData = {\n method,\n url,\n status_code,\n };\n\n const hint: XhrBreadcrumbHint = {\n xhr: handlerData.xhr,\n input: body,\n startTimestamp,\n endTimestamp,\n };\n\n addBreadcrumb(\n {\n category: 'xhr',\n data,\n type: 'http',\n },\n hint,\n );\n };\n}\n\n/**\n * Creates breadcrumbs from fetch API calls\n */\nfunction _getFetchBreadcrumbHandler(client: Client): (handlerData: HandlerDataFetch) => void {\n return function _fetchBreadcrumb(handlerData: HandlerDataFetch): void {\n if (getClient() !== client) {\n return;\n }\n\n const { startTimestamp, endTimestamp } = handlerData;\n\n // We only capture complete fetch requests\n if (!endTimestamp) {\n return;\n }\n\n if (handlerData.fetchData.url.match(/sentry_key/) && handlerData.fetchData.method === 'POST') {\n // We will not create breadcrumbs for fetch requests that contain `sentry_key` (internal sentry requests)\n return;\n }\n\n if (handlerData.error) {\n const data: FetchBreadcrumbData = handlerData.fetchData;\n const hint: FetchBreadcrumbHint = {\n data: handlerData.error,\n input: handlerData.args,\n startTimestamp,\n endTimestamp,\n };\n\n addBreadcrumb(\n {\n category: 'fetch',\n data,\n level: 'error',\n type: 'http',\n },\n hint,\n );\n } else {\n const response = handlerData.response as Response | undefined;\n const data: FetchBreadcrumbData = {\n ...handlerData.fetchData,\n status_code: response && response.status,\n };\n const hint: FetchBreadcrumbHint = {\n input: handlerData.args,\n response,\n startTimestamp,\n endTimestamp,\n };\n addBreadcrumb(\n {\n category: 'fetch',\n data,\n type: 'http',\n },\n hint,\n );\n }\n };\n}\n\n/**\n * Creates breadcrumbs from history API calls\n */\nfunction _getHistoryBreadcrumbHandler(client: Client): (handlerData: HandlerDataHistory) => void {\n return function _historyBreadcrumb(handlerData: HandlerDataHistory): void {\n if (getClient() !== client) {\n return;\n }\n\n let from: string | undefined = handlerData.from;\n let to: string | undefined = handlerData.to;\n const parsedLoc = parseUrl(WINDOW.location.href);\n let parsedFrom = from ? parseUrl(from) : undefined;\n const parsedTo = parseUrl(to);\n\n // Initial pushState doesn't provide `from` information\n if (!parsedFrom || !parsedFrom.path) {\n parsedFrom = parsedLoc;\n }\n\n // Use only the path component of the URL if the URL matches the current\n // document (almost all the time when using pushState)\n if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host) {\n to = parsedTo.relative;\n }\n if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host) {\n from = parsedFrom.relative;\n }\n\n addBreadcrumb({\n category: 'navigation',\n data: {\n from,\n to,\n },\n });\n };\n}\n\nfunction _isEvent(event: unknown): event is Event {\n return !!event && !!(event as Record<string, unknown>).target;\n}\n", "import { convertIntegrationFnToClass, defineIntegration } from '@sentry/core';\nimport type { Event, Exception, Integration, IntegrationClass, IntegrationFn, StackFrame } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../debug-build';\n\nconst INTEGRATION_NAME = 'Dedupe';\n\nconst _dedupeIntegration = (() => {\n let previousEvent: Event | undefined;\n\n return {\n name: INTEGRATION_NAME,\n // TODO v8: Remove this\n setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function\n processEvent(currentEvent) {\n // We want to ignore any non-error type events, e.g. transactions or replays\n // These should never be deduped, and also not be compared against as _previousEvent.\n if (currentEvent.type) {\n return currentEvent;\n }\n\n // Juuust in case something goes wrong\n try {\n if (_shouldDropEvent(currentEvent, previousEvent)) {\n DEBUG_BUILD && logger.warn('Event dropped due to being a duplicate of previously captured event.');\n return null;\n }\n } catch (_oO) {} // eslint-disable-line no-empty\n\n return (previousEvent = currentEvent);\n },\n };\n}) satisfies IntegrationFn;\n\nexport const dedupeIntegration = defineIntegration(_dedupeIntegration);\n\n/**\n * Deduplication filter.\n * @deprecated Use `dedupeIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport const Dedupe = convertIntegrationFnToClass(INTEGRATION_NAME, dedupeIntegration) as IntegrationClass<\n Integration & { processEvent: (event: Event) => Event }\n>;\n\nfunction _shouldDropEvent(currentEvent: Event, previousEvent?: Event): boolean {\n if (!previousEvent) {\n return false;\n }\n\n if (_isSameMessageEvent(currentEvent, previousEvent)) {\n return true;\n }\n\n if (_isSameExceptionEvent(currentEvent, previousEvent)) {\n return true;\n }\n\n return false;\n}\n\nfunction _isSameMessageEvent(currentEvent: Event, previousEvent: Event): boolean {\n const currentMessage = currentEvent.message;\n const previousMessage = previousEvent.message;\n\n // If neither event has a message property, they were both exceptions, so bail out\n if (!currentMessage && !previousMessage) {\n return false;\n }\n\n // If only one event has a stacktrace, but not the other one, they are not the same\n if ((currentMessage && !previousMessage) || (!currentMessage && previousMessage)) {\n return false;\n }\n\n if (currentMessage !== previousMessage) {\n return false;\n }\n\n if (!_isSameFingerprint(currentEvent, previousEvent)) {\n return false;\n }\n\n if (!_isSameStacktrace(currentEvent, previousEvent)) {\n return false;\n }\n\n return true;\n}\n\nfunction _isSameExceptionEvent(currentEvent: Event, previousEvent: Event): boolean {\n const previousException = _getExceptionFromEvent(previousEvent);\n const currentException = _getExceptionFromEvent(currentEvent);\n\n if (!previousException || !currentException) {\n return false;\n }\n\n if (previousException.type !== currentException.type || previousException.value !== currentException.value) {\n return false;\n }\n\n if (!_isSameFingerprint(currentEvent, previousEvent)) {\n return false;\n }\n\n if (!_isSameStacktrace(currentEvent, previousEvent)) {\n return false;\n }\n\n return true;\n}\n\nfunction _isSameStacktrace(currentEvent: Event, previousEvent: Event): boolean {\n let currentFrames = _getFramesFromEvent(currentEvent);\n let previousFrames = _getFramesFromEvent(previousEvent);\n\n // If neither event has a stacktrace, they are assumed to be the same\n if (!currentFrames && !previousFrames) {\n return true;\n }\n\n // If only one event has a stacktrace, but not the other one, they are not the same\n if ((currentFrames && !previousFrames) || (!currentFrames && previousFrames)) {\n return false;\n }\n\n currentFrames = currentFrames as StackFrame[];\n previousFrames = previousFrames as StackFrame[];\n\n // If number of frames differ, they are not the same\n if (previousFrames.length !== currentFrames.length) {\n return false;\n }\n\n // Otherwise, compare the two\n for (let i = 0; i < previousFrames.length; i++) {\n const frameA = previousFrames[i];\n const frameB = currentFrames[i];\n\n if (\n frameA.filename !== frameB.filename ||\n frameA.lineno !== frameB.lineno ||\n frameA.colno !== frameB.colno ||\n frameA.function !== frameB.function\n ) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction _isSameFingerprint(currentEvent: Event, previousEvent: Event): boolean {\n let currentFingerprint = currentEvent.fingerprint;\n let previousFingerprint = previousEvent.fingerprint;\n\n // If neither event has a fingerprint, they are assumed to be the same\n if (!currentFingerprint && !previousFingerprint) {\n return true;\n }\n\n // If only one event has a fingerprint, but not the other one, they are not the same\n if ((currentFingerprint && !previousFingerprint) || (!currentFingerprint && previousFingerprint)) {\n return false;\n }\n\n currentFingerprint = currentFingerprint as string[];\n previousFingerprint = previousFingerprint as string[];\n\n // Otherwise, compare the two\n try {\n return !!(currentFingerprint.join('') === previousFingerprint.join(''));\n } catch (_oO) {\n return false;\n }\n}\n\nfunction _getExceptionFromEvent(event: Event): Exception | undefined {\n return event.exception && event.exception.values && event.exception.values[0];\n}\n\nfunction _getFramesFromEvent(event: Event): StackFrame[] | undefined {\n const exception = event.exception;\n\n if (exception) {\n try {\n // @ts-expect-error Object could be undefined\n return exception.values[0].stacktrace.frames;\n } catch (_oO) {\n return undefined;\n }\n }\n return undefined;\n}\n", "/* eslint-disable @typescript-eslint/no-unsafe-member-access */\nimport { captureEvent, convertIntegrationFnToClass, defineIntegration, getClient } from '@sentry/core';\nimport type {\n Client,\n Event,\n Integration,\n IntegrationClass,\n IntegrationFn,\n Primitive,\n StackParser,\n} from '@sentry/types';\nimport {\n addGlobalErrorInstrumentationHandler,\n addGlobalUnhandledRejectionInstrumentationHandler,\n getLocationHref,\n isErrorEvent,\n isPrimitive,\n isString,\n logger,\n} from '@sentry/utils';\n\nimport type { BrowserClient } from '../client';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { eventFromUnknownInput } from '../eventbuilder';\nimport { shouldIgnoreOnError } from '../helpers';\n\ntype GlobalHandlersIntegrationsOptionKeys = 'onerror' | 'onunhandledrejection';\n\ntype GlobalHandlersIntegrations = Record<GlobalHandlersIntegrationsOptionKeys, boolean>;\n\nconst INTEGRATION_NAME = 'GlobalHandlers';\n\nconst _globalHandlersIntegration = ((options: Partial<GlobalHandlersIntegrations> = {}) => {\n const _options = {\n onerror: true,\n onunhandledrejection: true,\n ...options,\n };\n\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n Error.stackTraceLimit = 50;\n },\n setup(client) {\n if (_options.onerror) {\n _installGlobalOnErrorHandler(client);\n globalHandlerLog('onerror');\n }\n if (_options.onunhandledrejection) {\n _installGlobalOnUnhandledRejectionHandler(client);\n globalHandlerLog('onunhandledrejection');\n }\n },\n };\n}) satisfies IntegrationFn;\n\nexport const globalHandlersIntegration = defineIntegration(_globalHandlersIntegration);\n\n/**\n * Global handlers.\n * @deprecated Use `globalHandlersIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport const GlobalHandlers = convertIntegrationFnToClass(\n INTEGRATION_NAME,\n globalHandlersIntegration,\n) as IntegrationClass<Integration & { setup: (client: Client) => void }> & {\n new (options?: Partial<GlobalHandlersIntegrations>): Integration;\n};\n\nfunction _installGlobalOnErrorHandler(client: Client): void {\n addGlobalErrorInstrumentationHandler(data => {\n const { stackParser, attachStacktrace } = getOptions();\n\n if (getClient() !== client || shouldIgnoreOnError()) {\n return;\n }\n\n const { msg, url, line, column, error } = data;\n\n const event =\n error === undefined && isString(msg)\n ? _eventFromIncompleteOnError(msg, url, line, column)\n : _enhanceEventWithInitialFrame(\n eventFromUnknownInput(stackParser, error || msg, undefined, attachStacktrace, false),\n url,\n line,\n column,\n );\n\n event.level = 'error';\n\n captureEvent(event, {\n originalException: error,\n mechanism: {\n handled: false,\n type: 'onerror',\n },\n });\n });\n}\n\nfunction _installGlobalOnUnhandledRejectionHandler(client: Client): void {\n addGlobalUnhandledRejectionInstrumentationHandler(e => {\n const { stackParser, attachStacktrace } = getOptions();\n\n if (getClient() !== client || shouldIgnoreOnError()) {\n return;\n }\n\n const error = _getUnhandledRejectionError(e as unknown);\n\n const event = isPrimitive(error)\n ? _eventFromRejectionWithPrimitive(error)\n : eventFromUnknownInput(stackParser, error, undefined, attachStacktrace, true);\n\n event.level = 'error';\n\n captureEvent(event, {\n originalException: error,\n mechanism: {\n handled: false,\n type: 'onunhandledrejection',\n },\n });\n });\n}\n\nfunction _getUnhandledRejectionError(error: unknown): unknown {\n if (isPrimitive(error)) {\n return error;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const e = error as any;\n\n // dig the object of the rejection out of known event types\n try {\n // PromiseRejectionEvents store the object of the rejection under 'reason'\n // see https://developer.mozilla.org/en-US/docs/Web/API/PromiseRejectionEvent\n if ('reason' in e) {\n return e.reason;\n }\n\n // something, somewhere, (likely a browser extension) effectively casts PromiseRejectionEvents\n // to CustomEvents, moving the `promise` and `reason` attributes of the PRE into\n // the CustomEvent's `detail` attribute, since they're not part of CustomEvent's spec\n // see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent and\n // https://github.com/getsentry/sentry-javascript/issues/2380\n else if ('detail' in e && 'reason' in e.detail) {\n return e.detail.reason;\n }\n } catch {} // eslint-disable-line no-empty\n\n return error;\n}\n\n/**\n * Create an event from a promise rejection where the `reason` is a primitive.\n *\n * @param reason: The `reason` property of the promise rejection\n * @returns An Event object with an appropriate `exception` value\n */\nfunction _eventFromRejectionWithPrimitive(reason: Primitive): Event {\n return {\n exception: {\n values: [\n {\n type: 'UnhandledRejection',\n // String() is needed because the Primitive type includes symbols (which can't be automatically stringified)\n value: `Non-Error promise rejection captured with value: ${String(reason)}`,\n },\n ],\n },\n };\n}\n\n/**\n * This function creates a stack from an old, error-less onerror handler.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _eventFromIncompleteOnError(msg: any, url: any, line: any, column: any): Event {\n const ERROR_TYPES_RE =\n /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;\n\n // If 'message' is ErrorEvent, get real message from inside\n let message = isErrorEvent(msg) ? msg.message : msg;\n let name = 'Error';\n\n const groups = message.match(ERROR_TYPES_RE);\n if (groups) {\n name = groups[1];\n message = groups[2];\n }\n\n const event = {\n exception: {\n values: [\n {\n type: name,\n value: message,\n },\n ],\n },\n };\n\n return _enhanceEventWithInitialFrame(event, url, line, column);\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _enhanceEventWithInitialFrame(event: Event, url: any, line: any, column: any): Event {\n // event.exception\n const e = (event.exception = event.exception || {});\n // event.exception.values\n const ev = (e.values = e.values || []);\n // event.exception.values[0]\n const ev0 = (ev[0] = ev[0] || {});\n // event.exception.values[0].stacktrace\n const ev0s = (ev0.stacktrace = ev0.stacktrace || {});\n // event.exception.values[0].stacktrace.frames\n const ev0sf = (ev0s.frames = ev0s.frames || []);\n\n const colno = isNaN(parseInt(column, 10)) ? undefined : column;\n const lineno = isNaN(parseInt(line, 10)) ? undefined : line;\n const filename = isString(url) && url.length > 0 ? url : getLocationHref();\n\n // event.exception.values[0].stacktrace.frames\n if (ev0sf.length === 0) {\n ev0sf.push({\n colno,\n filename,\n function: '?',\n in_app: true,\n lineno,\n });\n }\n\n return event;\n}\n\nfunction globalHandlerLog(type: string): void {\n DEBUG_BUILD && logger.log(`Global Handler attached: ${type}`);\n}\n\nfunction getOptions(): { stackParser: StackParser; attachStacktrace?: boolean } {\n const client = getClient<BrowserClient>();\n const options = (client && client.getOptions()) || {\n stackParser: () => [],\n attachStacktrace: false,\n };\n return options;\n}\n", "import { convertIntegrationFnToClass, defineIntegration } from '@sentry/core';\nimport type { Event, Integration, IntegrationClass, IntegrationFn } from '@sentry/types';\n\nimport { WINDOW } from '../helpers';\n\nconst INTEGRATION_NAME = 'HttpContext';\n\nconst _httpContextIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n // TODO v8: Remove this\n setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function\n preprocessEvent(event) {\n // if none of the information we want exists, don't bother\n if (!WINDOW.navigator && !WINDOW.location && !WINDOW.document) {\n return;\n }\n\n // grab as much info as exists and add it to the event\n const url = (event.request && event.request.url) || (WINDOW.location && WINDOW.location.href);\n const { referrer } = WINDOW.document || {};\n const { userAgent } = WINDOW.navigator || {};\n\n const headers = {\n ...(event.request && event.request.headers),\n ...(referrer && { Referer: referrer }),\n ...(userAgent && { 'User-Agent': userAgent }),\n };\n const request = { ...event.request, ...(url && { url }), headers };\n\n event.request = request;\n },\n };\n}) satisfies IntegrationFn;\n\nexport const httpContextIntegration = defineIntegration(_httpContextIntegration);\n\n/**\n * HttpContext integration collects information about HTTP request headers.\n * @deprecated Use `httpContextIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport const HttpContext = convertIntegrationFnToClass(INTEGRATION_NAME, httpContextIntegration) as IntegrationClass<\n Integration & { preprocessEvent: (event: Event) => void }\n>;\n", "import { convertIntegrationFnToClass, defineIntegration } from '@sentry/core';\nimport type { Client, Event, EventHint, Integration, IntegrationClass, IntegrationFn } from '@sentry/types';\nimport { applyAggregateErrorsToEvent } from '@sentry/utils';\nimport { exceptionFromError } from '../eventbuilder';\n\ninterface LinkedErrorsOptions {\n key?: string;\n limit?: number;\n}\n\nconst DEFAULT_KEY = 'cause';\nconst DEFAULT_LIMIT = 5;\n\nconst INTEGRATION_NAME = 'LinkedErrors';\n\nconst _linkedErrorsIntegration = ((options: LinkedErrorsOptions = {}) => {\n const limit = options.limit || DEFAULT_LIMIT;\n const key = options.key || DEFAULT_KEY;\n\n return {\n name: INTEGRATION_NAME,\n // TODO v8: Remove this\n setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function\n preprocessEvent(event, hint, client) {\n const options = client.getOptions();\n\n applyAggregateErrorsToEvent(\n // This differs from the LinkedErrors integration in core by using a different exceptionFromError function\n exceptionFromError,\n options.stackParser,\n options.maxValueLength,\n key,\n limit,\n event,\n hint,\n );\n },\n };\n}) satisfies IntegrationFn;\n\nexport const linkedErrorsIntegration = defineIntegration(_linkedErrorsIntegration);\n\n/**\n * Aggregrate linked errors in an event.\n * @deprecated Use `linkedErrorsIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport const LinkedErrors = convertIntegrationFnToClass(INTEGRATION_NAME, linkedErrorsIntegration) as IntegrationClass<\n Integration & { preprocessEvent: (event: Event, hint: EventHint, client: Client) => void }\n> & { new (options?: { key?: string; limit?: number }): Integration };\n", "import { convertIntegrationFnToClass, defineIntegration } from '@sentry/core';\nimport type { Integration, IntegrationClass, IntegrationFn, WrappedFunction } from '@sentry/types';\nimport { fill, getFunctionName, getOriginalFunction } from '@sentry/utils';\n\nimport { WINDOW, wrap } from '../helpers';\n\nconst DEFAULT_EVENT_TARGET = [\n 'EventTarget',\n 'Window',\n 'Node',\n 'ApplicationCache',\n 'AudioTrackList',\n 'BroadcastChannel',\n 'ChannelMergerNode',\n 'CryptoOperation',\n 'EventSource',\n 'FileReader',\n 'HTMLUnknownElement',\n 'IDBDatabase',\n 'IDBRequest',\n 'IDBTransaction',\n 'KeyOperation',\n 'MediaController',\n 'MessagePort',\n 'ModalWindow',\n 'Notification',\n 'SVGElementInstance',\n 'Screen',\n 'SharedWorker',\n 'TextTrack',\n 'TextTrackCue',\n 'TextTrackList',\n 'WebSocket',\n 'WebSocketWorker',\n 'Worker',\n 'XMLHttpRequest',\n 'XMLHttpRequestEventTarget',\n 'XMLHttpRequestUpload',\n];\n\nconst INTEGRATION_NAME = 'TryCatch';\n\ntype XMLHttpRequestProp = 'onload' | 'onerror' | 'onprogress' | 'onreadystatechange';\n\ninterface TryCatchOptions {\n setTimeout: boolean;\n setInterval: boolean;\n requestAnimationFrame: boolean;\n XMLHttpRequest: boolean;\n eventTarget: boolean | string[];\n}\n\nconst _browserApiErrorsIntegration = ((options: Partial<TryCatchOptions> = {}) => {\n const _options = {\n XMLHttpRequest: true,\n eventTarget: true,\n requestAnimationFrame: true,\n setInterval: true,\n setTimeout: true,\n ...options,\n };\n\n return {\n name: INTEGRATION_NAME,\n // TODO: This currently only works for the first client this is setup\n // We may want to adjust this to check for client etc.\n setupOnce() {\n if (_options.setTimeout) {\n fill(WINDOW, 'setTimeout', _wrapTimeFunction);\n }\n\n if (_options.setInterval) {\n fill(WINDOW, 'setInterval', _wrapTimeFunction);\n }\n\n if (_options.requestAnimationFrame) {\n fill(WINDOW, 'requestAnimationFrame', _wrapRAF);\n }\n\n if (_options.XMLHttpRequest && 'XMLHttpRequest' in WINDOW) {\n fill(XMLHttpRequest.prototype, 'send', _wrapXHR);\n }\n\n const eventTargetOption = _options.eventTarget;\n if (eventTargetOption) {\n const eventTarget = Array.isArray(eventTargetOption) ? eventTargetOption : DEFAULT_EVENT_TARGET;\n eventTarget.forEach(_wrapEventTarget);\n }\n },\n };\n}) satisfies IntegrationFn;\n\nexport const browserApiErrorsIntegration = defineIntegration(_browserApiErrorsIntegration);\n\n/**\n * Wrap timer functions and event targets to catch errors and provide better meta data.\n * @deprecated Use `browserApiErrorsIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport const TryCatch = convertIntegrationFnToClass(\n INTEGRATION_NAME,\n browserApiErrorsIntegration,\n) as IntegrationClass<Integration> & {\n new (options?: {\n setTimeout: boolean;\n setInterval: boolean;\n requestAnimationFrame: boolean;\n XMLHttpRequest: boolean;\n eventTarget: boolean | string[];\n }): Integration;\n};\n\nfunction _wrapTimeFunction(original: () => void): () => number {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return function (this: any, ...args: any[]): number {\n const originalCallback = args[0];\n args[0] = wrap(originalCallback, {\n mechanism: {\n data: { function: getFunctionName(original) },\n handled: false,\n type: 'instrument',\n },\n });\n return original.apply(this, args);\n };\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _wrapRAF(original: any): (callback: () => void) => any {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return function (this: any, callback: () => void): () => void {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return original.apply(this, [\n wrap(callback, {\n mechanism: {\n data: {\n function: 'requestAnimationFrame',\n handler: getFunctionName(original),\n },\n handled: false,\n type: 'instrument',\n },\n }),\n ]);\n };\n}\n\nfunction _wrapXHR(originalSend: () => void): () => void {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return function (this: XMLHttpRequest, ...args: any[]): void {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const xhr = this;\n const xmlHttpRequestProps: XMLHttpRequestProp[] = ['onload', 'onerror', 'onprogress', 'onreadystatechange'];\n\n xmlHttpRequestProps.forEach(prop => {\n if (prop in xhr && typeof xhr[prop] === 'function') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n fill(xhr, prop, function (original: WrappedFunction): () => any {\n const wrapOptions = {\n mechanism: {\n data: {\n function: prop,\n handler: getFunctionName(original),\n },\n handled: false,\n type: 'instrument',\n },\n };\n\n // If Instrument integration has been called before TryCatch, get the name of original function\n const originalFunction = getOriginalFunction(original);\n if (originalFunction) {\n wrapOptions.mechanism.data.handler = getFunctionName(originalFunction);\n }\n\n // Otherwise wrap directly\n return wrap(original, wrapOptions);\n });\n }\n });\n\n return originalSend.apply(this, args);\n };\n}\n\nfunction _wrapEventTarget(target: string): void {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const globalObject = WINDOW as { [key: string]: any };\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const proto = globalObject[target] && globalObject[target].prototype;\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, no-prototype-builtins\n if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) {\n return;\n }\n\n fill(proto, 'addEventListener', function (original: VoidFunction,): (\n eventName: string,\n fn: EventListenerObject,\n options?: boolean | AddEventListenerOptions,\n ) => void {\n return function (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this: any,\n eventName: string,\n fn: EventListenerObject,\n options?: boolean | AddEventListenerOptions,\n ): (eventName: string, fn: EventListenerObject, capture?: boolean, secure?: boolean) => void {\n try {\n if (typeof fn.handleEvent === 'function') {\n // ESlint disable explanation:\n // First, it is generally safe to call `wrap` with an unbound function. Furthermore, using `.bind()` would\n // introduce a bug here, because bind returns a new function that doesn't have our\n // flags(like __sentry_original__) attached. `wrap` checks for those flags to avoid unnecessary wrapping.\n // Without those flags, every call to addEventListener wraps the function again, causing a memory leak.\n // eslint-disable-next-line @typescript-eslint/unbound-method\n fn.handleEvent = wrap(fn.handleEvent, {\n mechanism: {\n data: {\n function: 'handleEvent',\n handler: getFunctionName(fn),\n target,\n },\n handled: false,\n type: 'instrument',\n },\n });\n }\n } catch (err) {\n // can sometimes get 'Permission denied to access property \"handle Event'\n }\n\n return original.apply(this, [\n eventName,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n wrap(fn as any as WrappedFunction, {\n mechanism: {\n data: {\n function: 'addEventListener',\n handler: getFunctionName(fn),\n target,\n },\n handled: false,\n type: 'instrument',\n },\n }),\n options,\n ]);\n };\n });\n\n fill(\n proto,\n 'removeEventListener',\n function (\n originalRemoveEventListener: () => void,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ): (this: any, eventName: string, fn: EventListenerObject, options?: boolean | EventListenerOptions) => () => void {\n return function (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this: any,\n eventName: string,\n fn: EventListenerObject,\n options?: boolean | EventListenerOptions,\n ): () => void {\n /**\n * There are 2 possible scenarios here:\n *\n * 1. Someone passes a callback, which was attached prior to Sentry initialization, or by using unmodified\n * method, eg. `document.addEventListener.call(el, name, handler). In this case, we treat this function\n * as a pass-through, and call original `removeEventListener` with it.\n *\n * 2. Someone passes a callback, which was attached after Sentry was initialized, which means that it was using\n * our wrapped version of `addEventListener`, which internally calls `wrap` helper.\n * This helper \"wraps\" whole callback inside a try/catch statement, and attached appropriate metadata to it,\n * in order for us to make a distinction between wrapped/non-wrapped functions possible.\n * If a function was wrapped, it has additional property of `__sentry_wrapped__`, holding the handler.\n *\n * When someone adds a handler prior to initialization, and then do it again, but after,\n * then we have to detach both of them. Otherwise, if we'd detach only wrapped one, it'd be impossible\n * to get rid of the initial handler and it'd stick there forever.\n */\n const wrappedEventHandler = fn as unknown as WrappedFunction;\n try {\n const originalEventHandler = wrappedEventHandler && wrappedEventHandler.__sentry_wrapped__;\n if (originalEventHandler) {\n originalRemoveEventListener.call(this, eventName, originalEventHandler, options);\n }\n } catch (e) {\n // ignore, accessing __sentry_wrapped__ will throw in some Selenium environments\n }\n return originalRemoveEventListener.call(this, eventName, wrappedEventHandler, options);\n };\n },\n );\n}\n", "import type { Hub } from '@sentry/core';\nimport { functionToStringIntegration, inboundFiltersIntegration } from '@sentry/core';\nimport {\n captureSession,\n getClient,\n getCurrentHub,\n getIntegrationsToSetup,\n getReportDialogEndpoint,\n initAndBind,\n startSession,\n} from '@sentry/core';\nimport type { Integration, Options, UserFeedback } from '@sentry/types';\nimport {\n addHistoryInstrumentationHandler,\n logger,\n stackParserFromStackParserOptions,\n supportsFetch,\n} from '@sentry/utils';\n\nimport type { BrowserClientOptions, BrowserOptions } from './client';\nimport { BrowserClient } from './client';\nimport { DEBUG_BUILD } from './debug-build';\nimport type { ReportDialogOptions } from './helpers';\nimport { WINDOW, wrap as internalWrap } from './helpers';\nimport { breadcrumbsIntegration } from './integrations/breadcrumbs';\nimport { dedupeIntegration } from './integrations/dedupe';\nimport { globalHandlersIntegration } from './integrations/globalhandlers';\nimport { httpContextIntegration } from './integrations/httpcontext';\nimport { linkedErrorsIntegration } from './integrations/linkederrors';\nimport { browserApiErrorsIntegration } from './integrations/trycatch';\nimport { defaultStackParser } from './stack-parsers';\nimport { makeFetchTransport, makeXHRTransport } from './transports';\n\n/** @deprecated Use `getDefaultIntegrations(options)` instead. */\nexport const defaultIntegrations = [\n inboundFiltersIntegration(),\n functionToStringIntegration(),\n browserApiErrorsIntegration(),\n breadcrumbsIntegration(),\n globalHandlersIntegration(),\n linkedErrorsIntegration(),\n dedupeIntegration(),\n httpContextIntegration(),\n];\n\n/** Get the default integrations for the browser SDK. */\nexport function getDefaultIntegrations(_options: Options): Integration[] {\n // We return a copy of the defaultIntegrations here to avoid mutating this\n return [\n // eslint-disable-next-line deprecation/deprecation\n ...defaultIntegrations,\n ];\n}\n\n/**\n * A magic string that build tooling can leverage in order to inject a release value into the SDK.\n */\ndeclare const __SENTRY_RELEASE__: string | undefined;\n\n/**\n * The Sentry Browser SDK Client.\n *\n * To use this SDK, call the {@link init} function as early as possible when\n * loading the web page. To set context information or send manual events, use\n * the provided methods.\n *\n * @example\n *\n * ```\n *\n * import { init } from '@sentry/browser';\n *\n * init({\n * dsn: '__DSN__',\n * // ...\n * });\n * ```\n *\n * @example\n * ```\n *\n * import { configureScope } from '@sentry/browser';\n * configureScope((scope: Scope) => {\n * scope.setExtra({ battery: 0.7 });\n * scope.setTag({ user_mode: 'admin' });\n * scope.setUser({ id: '4711' });\n * });\n * ```\n *\n * @example\n * ```\n *\n * import { addBreadcrumb } from '@sentry/browser';\n * addBreadcrumb({\n * message: 'My Breadcrumb',\n * // ...\n * });\n * ```\n *\n * @example\n *\n * ```\n *\n * import * as Sentry from '@sentry/browser';\n * Sentry.captureMessage('Hello, world!');\n * Sentry.captureException(new Error('Good bye'));\n * Sentry.captureEvent({\n * message: 'Manual',\n * stacktrace: [\n * // ...\n * ],\n * });\n * ```\n *\n * @see {@link BrowserOptions} for documentation on configuration options.\n */\nexport function init(options: BrowserOptions = {}): void {\n if (options.defaultIntegrations === undefined) {\n options.defaultIntegrations = getDefaultIntegrations(options);\n }\n if (options.release === undefined) {\n // This allows build tooling to find-and-replace __SENTRY_RELEASE__ to inject a release value\n if (typeof __SENTRY_RELEASE__ === 'string') {\n options.release = __SENTRY_RELEASE__;\n }\n\n // This supports the variable that sentry-webpack-plugin injects\n if (WINDOW.SENTRY_RELEASE && WINDOW.SENTRY_RELEASE.id) {\n options.release = WINDOW.SENTRY_RELEASE.id;\n }\n }\n if (options.autoSessionTracking === undefined) {\n options.autoSessionTracking = true;\n }\n if (options.sendClientReports === undefined) {\n options.sendClientReports = true;\n }\n\n const clientOptions: BrowserClientOptions = {\n ...options,\n stackParser: stackParserFromStackParserOptions(options.stackParser || defaultStackParser),\n integrations: getIntegrationsToSetup(options),\n transport: options.transport || (supportsFetch() ? makeFetchTransport : makeXHRTransport),\n };\n\n initAndBind(BrowserClient, clientOptions);\n\n if (options.autoSessionTracking) {\n startSessionTracking();\n }\n}\n\ntype NewReportDialogOptions = ReportDialogOptions & { eventId: string }; // eslint-disable-line\n\ninterface ShowReportDialogFunction {\n /**\n * Present the user with a report dialog.\n *\n * @param options Everything is optional, we try to fetch all info need from the global scope.\n */\n (options: NewReportDialogOptions): void;\n\n /**\n * Present the user with a report dialog.\n *\n * @param options Everything is optional, we try to fetch all info need from the global scope.\n *\n * @deprecated Please always pass an `options` argument with `eventId`. The `hub` argument will not be used in the next version of the SDK.\n */\n // eslint-disable-next-line deprecation/deprecation\n (options?: ReportDialogOptions, hub?: Hub): void;\n}\n\nexport const showReportDialog: ShowReportDialogFunction = (\n // eslint-disable-next-line deprecation/deprecation\n options: ReportDialogOptions = {},\n // eslint-disable-next-line deprecation/deprecation\n hub: Hub = getCurrentHub(),\n) => {\n // doesn't work without a document (React Native)\n if (!WINDOW.document) {\n DEBUG_BUILD && logger.error('Global document not defined in showReportDialog call');\n return;\n }\n\n // eslint-disable-next-line deprecation/deprecation\n const { client, scope } = hub.getStackTop();\n const dsn = options.dsn || (client && client.getDsn());\n if (!dsn) {\n DEBUG_BUILD && logger.error('DSN not configured for showReportDialog call');\n return;\n }\n\n if (scope) {\n options.user = {\n ...scope.getUser(),\n ...options.user,\n };\n }\n\n if (!options.eventId) {\n // eslint-disable-next-line deprecation/deprecation\n options.eventId = hub.lastEventId();\n }\n\n const script = WINDOW.document.createElement('script');\n script.async = true;\n script.crossOrigin = 'anonymous';\n script.src = getReportDialogEndpoint(dsn, options);\n\n if (options.onLoad) {\n script.onload = options.onLoad;\n }\n\n const { onClose } = options;\n if (onClose) {\n const reportDialogClosedMessageHandler = (event: MessageEvent): void => {\n if (event.data === '__sentry_reportdialog_closed__') {\n try {\n onClose();\n } finally {\n WINDOW.removeEventListener('message', reportDialogClosedMessageHandler);\n }\n }\n };\n WINDOW.addEventListener('message', reportDialogClosedMessageHandler);\n }\n\n const injectionPoint = WINDOW.document.head || WINDOW.document.body;\n if (injectionPoint) {\n injectionPoint.appendChild(script);\n } else {\n DEBUG_BUILD && logger.error('Not injecting report dialog. No injection point found in HTML');\n }\n};\n\n/**\n * This function is here to be API compatible with the loader.\n * @hidden\n */\nexport function forceLoad(): void {\n // Noop\n}\n\n/**\n * This function is here to be API compatible with the loader.\n * @hidden\n */\nexport function onLoad(callback: () => void): void {\n callback();\n}\n\n/**\n * Wrap code within a try/catch block so the SDK is able to capture errors.\n *\n * @deprecated This function will be removed in v8.\n * It is not part of Sentry's official API and it's easily replaceable by using a try/catch block\n * and calling Sentry.captureException.\n *\n * @param fn A function to wrap.\n *\n * @returns The result of wrapped function call.\n */\n// TODO(v8): Remove this function\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function wrap(fn: (...args: any) => any): any {\n return internalWrap(fn)();\n}\n\n/**\n * Enable automatic Session Tracking for the initial page load.\n */\nfunction startSessionTracking(): void {\n if (typeof WINDOW.document === 'undefined') {\n DEBUG_BUILD && logger.warn('Session tracking in non-browser environment with @sentry/browser is not supported.');\n return;\n }\n\n // The session duration for browser sessions does not track a meaningful\n // concept that can be used as a metric.\n // Automatically captured sessions are akin to page views, and thus we\n // discard their duration.\n startSession({ ignoreDuration: true });\n captureSession();\n\n // We want to create a session for every navigation as well\n addHistoryInstrumentationHandler(({ from, to }) => {\n // Don't create an additional session for the initial route or if the location did not change\n if (from !== undefined && from !== to) {\n startSession({ ignoreDuration: true });\n captureSession();\n }\n });\n}\n\n/**\n * Captures user feedback and sends it to Sentry.\n */\nexport function captureUserFeedback(feedback: UserFeedback): void {\n const client = getClient<BrowserClient>();\n if (client) {\n client.captureUserFeedback(feedback);\n }\n}\n", "export * from './exports';\n\nimport { Integrations as CoreIntegrations } from '@sentry/core';\n\nimport { WINDOW } from './helpers';\nimport * as BrowserIntegrations from './integrations';\n\nlet windowIntegrations = {};\n\n// This block is needed to add compatibility with the integrations packages when used with a CDN\nif (WINDOW.Sentry && WINDOW.Sentry.Integrations) {\n windowIntegrations = WINDOW.Sentry.Integrations;\n}\n\n/** @deprecated Import the integration function directly, e.g. `inboundFiltersIntegration()` instead of `new Integrations.InboundFilter(). */\nconst INTEGRATIONS = {\n ...windowIntegrations,\n // eslint-disable-next-line deprecation/deprecation\n ...CoreIntegrations,\n ...BrowserIntegrations,\n};\n\n// eslint-disable-next-line deprecation/deprecation\nexport { INTEGRATIONS as Integrations };\n\nexport {\n // eslint-disable-next-line deprecation/deprecation\n InternalReplay as Replay,\n internalReplayIntegration as replayIntegration,\n internalGetReplay as getReplay,\n} from '@sentry/replay';\nexport type {\n InternalReplayEventType as ReplayEventType,\n InternalReplayEventWithTime as ReplayEventWithTime,\n InternalReplayBreadcrumbFrame as ReplayBreadcrumbFrame,\n InternalReplayBreadcrumbFrameEvent as ReplayBreadcrumbFrameEvent,\n InternalReplayOptionFrameEvent as ReplayOptionFrameEvent,\n InternalReplayFrame as ReplayFrame,\n InternalReplayFrameEvent as ReplayFrameEvent,\n InternalReplaySpanFrame as ReplaySpanFrame,\n InternalReplaySpanFrameEvent as ReplaySpanFrameEvent,\n} from '@sentry/replay';\n\nexport {\n // eslint-disable-next-line deprecation/deprecation\n ReplayCanvas,\n replayCanvasIntegration,\n} from '@sentry-internal/replay-canvas';\n\nexport {\n // eslint-disable-next-line deprecation/deprecation\n Feedback,\n feedbackIntegration,\n sendFeedback,\n} from '@sentry-internal/feedback';\n\nexport {\n captureConsoleIntegration,\n dedupeIntegration,\n debugIntegration,\n extraErrorDataIntegration,\n reportingObserverIntegration,\n rewriteFramesIntegration,\n sessionTimingIntegration,\n httpClientIntegration,\n contextLinesIntegration,\n} from '@sentry/integrations';\n\nexport {\n // eslint-disable-next-line deprecation/deprecation\n BrowserTracing,\n defaultRequestInstrumentationOptions,\n instrumentOutgoingRequests,\n browserTracingIntegration,\n startBrowserTracingNavigationSpan,\n startBrowserTracingPageLoadSpan,\n} from '@sentry-internal/tracing';\nexport type { RequestInstrumentationOptions } from '@sentry-internal/tracing';\nexport {\n addTracingExtensions,\n setMeasurement,\n // eslint-disable-next-line deprecation/deprecation\n extractTraceparentData,\n // eslint-disable-next-line deprecation/deprecation\n getActiveTransaction,\n // eslint-disable-next-line deprecation/deprecation\n spanStatusfromHttpCode,\n getSpanStatusFromHttpCode,\n setHttpStatus,\n // eslint-disable-next-line deprecation/deprecation\n trace,\n makeMultiplexedTransport,\n // eslint-disable-next-line deprecation/deprecation\n ModuleMetadata,\n moduleMetadataIntegration,\n} from '@sentry/core';\nexport type { SpanStatusType } from '@sentry/core';\nexport type { Span } from '@sentry/types';\nexport { makeBrowserOfflineTransport } from './transports/offline';\nexport { onProfilingStartRouteTransaction } from './profiling/hubextensions';\nexport {\n // eslint-disable-next-line deprecation/deprecation\n BrowserProfilingIntegration,\n browserProfilingIntegration,\n} from './profiling/integration';\n", "// This const is used for nothing except to make this file identifiable via its content.\n// We search for \"_sentry_release_injection_file\" in the plugin to determine for sure that the file we look at is the release injection file.\n\n// _sentry_release_injection_file\n\n var _global =\n typeof window !== 'undefined' ?\n window :\n typeof global !== 'undefined' ?\n global :\n typeof self !== 'undefined' ?\n self :\n {};\n\n _global.SENTRY_RELEASE={id:\"3.11.0\"};", "import * as Sentry from \"@sentry/browser\";\n\nlet hasSentryInitiated = false;\nfunction initiateSentry() {\n Sentry.init({\n dsn: \"https://903950caba7d4802afe6c1e985ad5ebd@o128085.ingest.sentry.io/4504854496149504\",\n\n /**\n * The release identifier used when uploading respective source maps. Specify\n * this value to allow Sentry to resolve the correct source maps when\n * processing events.\n */\n release: process.env.COMPONENT_VERSION,\n\n /**\n * List of integrations that should be installed after SDK was initialized.\n * Accepts either a list of integrations or a function that receives\n * default integrations and returns a new, updated list.\n */\n integrations: [new Sentry.BrowserTracing()],\n\n /**\n * Sample rate to determine trace sampling.\n *\n * 0.0 = 0% chance of a given trace being sent (send no traces) 1.0 = 100% chance of a given trace being sent (send\n * all traces)\n *\n * Tracing is enabled if either this or `tracesSampler` is defined. If both are defined, `tracesSampleRate` is\n * ignored.\n */\n tracesSampleRate: 1,\n });\n hasSentryInitiated = true;\n}\n\nexport const captureErrorInSentry = (error: Error) => {\n if (!hasSentryInitiated) {\n initiateSentry();\n }\n\n return Sentry.captureException(error);\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { captureErrorInSentry } from \"@lib/captureErrorInSentry\";\nimport React from \"react\";\nimport { Button } from \"./Button\";\nimport { NonIdealState } from \"./NonIdealState\";\n\nexport class ErrorBoundary extends React.Component<{\n children: React.ReactNode | React.ReactNode[];\n}> {\n state = { hasError: false };\n\n static getDerivedStateFromError() {\n // Update state so the next render will show the fallback UI.\n return { hasError: true };\n }\n\n componentDidCatch(error: Error) {\n // You can also log the error to an error reporting service\n captureErrorInSentry(error);\n }\n\n render() {\n if (this.state.hasError) {\n return (\n <NonIdealState>\n <p style={{ marginBlock: \"0\" }} className=\"p1--semibold\">\n We ran into an error\n </p>\n <p\n className=\"p1--regular\"\n style={{\n color: \"var(--GREY-600)\",\n marginBlock: \"12px\",\n textAlign: \"center\",\n }}\n >\n Please try reloading. If the problem persists reach out to our\n support team.\n </p>\n <div>\n <Button\n variant=\"outlined\"\n iconBefore=\"autorenew\"\n onClick={() => location.reload()}\n >\n Try again\n </Button>\n </div>\n </NonIdealState>\n );\n }\n\n return this.props.children;\n }\n}\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import * as Sentry from \"@sentry/browser\";\n\nconst MESSAGE_PREFIX = \"[Duffel Ancillaries] \";\nconst LOCAL_STORAGE_KEY = \"duffel-ancillaries-logger-state\";\nlet LOG_INITIALISED = false;\n\nconst storeLoggerState = (shouldLog: boolean) => {\n localStorage.setItem(LOCAL_STORAGE_KEY, shouldLog.toString());\n};\n\nconst shouldLog = () => localStorage.getItem(LOCAL_STORAGE_KEY) === \"true\";\n\n/**\n * The functions in this file are used to enable logging.\n *\n * Usage:\n *\n * In your app's outermost container, import the LogContext and wrap your app in it:\n *\n * ```jsx\n * import { LogContext, initializeLogger } from '@lib/logging'\n *\n * const logger = initializeLogger(props.debugMode || false)\n *\n * <LogContext.Provider value={logger}>\n * ...\n * </LogContext.Provider>\n * ```\n *\n * Then in your components nested within the above container, import the useLog hook and use it:\n *\n * import { useLog } from '@lib/logging'\n *\n * const { log, logGroup } = useLog()\n * log('This is a log message')\n * logGroup('These messages will be grouped together', ['This is a log message', 'This is another log message'])\n */\nconst initializeLogger = (debugMode: boolean): void => {\n storeLoggerState(debugMode);\n if (debugMode && !LOG_INITIALISED) {\n // eslint-disable-next-line\n console.info(\n MESSAGE_PREFIX,\n `\\n\\nDebug mode is enabled. Information about your setup will be printed to the console.\n \n If you do not want to enable debug mode (for example in a production environment), pass \"debug: false\" when initializing this component.\n \n Learn more about the Ancillaries component:\n http://duffel.com/docs/guides/ancillaries-component`,\n );\n }\n LOG_INITIALISED = true;\n};\n\n/**\n * Log a message to the console. Messages will be prefixed with \"[Duffel Ancillaries]\".\n * @param message The message to print to the console.\n */\nconst log = (message: any) => {\n if (shouldLog()) {\n // eslint-disable-next-line\n console.info(MESSAGE_PREFIX, message);\n } else {\n Sentry.addBreadcrumb({\n category: \"log\",\n message,\n });\n }\n};\n\n/**\n * Log a series of messages to the console inside a collapsible group.\n * @param groupName The name of the group of messages. This will be prefixed with \"[Duffel Ancillaries]\".\n * @param messages An array of messages to print to the console, inside the group.\n */\nfunction logGroup(groupName: string, messages: any[]): void;\n\n/**\n * Log a series of messages to the console inside a collapsible group.\n * @param groupName The name of the group of messages. This will be prefixed with \"[Duffel Ancillaries]\".\n * @param object An object to print to the console, inside the group.\n */\nfunction logGroup(groupName: string, object: { [key: string]: any }): void;\n\n// Overloaded function implementation.\n// https://www.typescriptlang.org/docs/handbook/2/functions.html#function-overloads\nfunction logGroup(\n groupName: string,\n messagesOrObject: any[] | { [key: string]: any },\n): void {\n let transformedMessagesOrObject = [];\n if (Array.isArray(messagesOrObject)) {\n transformedMessagesOrObject = messagesOrObject;\n } else {\n transformedMessagesOrObject = Object.entries(messagesOrObject).map(\n ([key, value]) => ({ property: key, value }),\n );\n }\n\n if (shouldLog()) {\n // eslint-disable-next-line\n console.groupCollapsed(MESSAGE_PREFIX, groupName);\n\n transformedMessagesOrObject.forEach((message) => {\n // eslint-disable-next-line\n console.info(message);\n });\n\n // eslint-disable-next-line\n console.groupEnd();\n } else {\n Sentry.addBreadcrumb({\n category: \"log.group\",\n message: groupName,\n data: messagesOrObject,\n });\n }\n}\n\nexport { initializeLogger, log, logGroup };\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { Color } from \"@lib/colors\";\nimport { log } from \"@lib/logging\";\nimport * as React from \"react\";\n\n/* eslint-disable react/no-unknown-property */\n/* eslint sort-keys: \"error\" */\nexport const ICON_MAP = {\n accessible: (\n <path d=\"M12 6C11.45 6 10.9792 5.80417 10.5875 5.4125C10.1958 5.02083 10 4.55 10 4C10 3.45 10.1958 2.97917 10.5875 2.5875C10.9792 2.19583 11.45 2 12 2C12.55 2 13.0208 2.19583 13.4125 2.5875C13.8042 2.97917 14 3.45 14 4C14 4.55 13.8042 5.02083 13.4125 5.4125C13.0208 5.80417 12.55 6 12 6ZM17 22V17H12C11.45 17 10.9792 16.8042 10.5875 16.4125C10.1958 16.0208 10 15.55 10 15V9C10 8.45 10.1958 7.97917 10.5875 7.5875C10.9792 7.19583 11.45 7 12 7C12.4 7 12.7458 7.0875 13.0375 7.2625C13.3292 7.4375 13.6417 7.71667 13.975 8.1C14.8917 9.2 15.7208 9.95417 16.4625 10.3625C17.2042 10.7708 18.05 10.9833 19 11V13C18.1167 13 17.225 12.8083 16.325 12.425C15.425 12.0417 14.65 11.5833 14 11.05V14.5H17C17.55 14.5 18.0208 14.6958 18.4125 15.0875C18.8042 15.4792 19 15.95 19 16.5V22H17ZM10 22C8.61667 22 7.4375 21.5125 6.4625 20.5375C5.4875 19.5625 5 18.3833 5 17C5 15.8 5.37917 14.7417 6.1375 13.825C6.89583 12.9083 7.85 12.3333 9 12.1V14.15C8.41667 14.3833 7.9375 14.7542 7.5625 15.2625C7.1875 15.7708 7 16.35 7 17C7 17.8333 7.29167 18.5417 7.875 19.125C8.45833 19.7083 9.16667 20 10 20C10.65 20 11.2292 19.8125 11.7375 19.4375C12.2458 19.0625 12.6167 18.5833 12.85 18H14.9C14.6667 19.15 14.0917 20.1042 13.175 20.8625C12.2583 21.6208 11.2 22 10 22Z\" />\n ),\n add: (\n <path d=\"M18 13h-5v5c0 .55-.45 1-1 1s-1-.45-1-1v-5H6c-.55 0-1-.45-1-1s.45-1 1-1h5V6c0-.55.45-1 1-1s1 .45 1 1v5h5c.55 0 1 .45 1 1s-.45 1-1 1z\" />\n ),\n airline_seat_flat: (\n <path d=\"M9.5999 14.4V7.19995H17.9999C18.9999 7.19995 19.8499 7.54995 20.5499 8.24995C21.2499 8.94995 21.5999 9.79995 21.5999 10.8V14.4H9.5999ZM2.3999 17.4V15.6H21.5999V17.4H2.3999ZM5.3999 14.4C4.56657 14.4 3.85824 14.1083 3.2749 13.525C2.69157 12.9416 2.3999 12.2333 2.3999 11.4C2.3999 10.5666 2.69157 9.85828 3.2749 9.27495C3.85824 8.69162 4.56657 8.39995 5.3999 8.39995C6.23324 8.39995 6.94157 8.69162 7.5249 9.27495C8.10824 9.85828 8.3999 10.5666 8.3999 11.4C8.3999 12.2333 8.10824 12.9416 7.5249 13.525C6.94157 14.1083 6.23324 14.4 5.3999 14.4ZM5.3999 12.6C5.7399 12.6 6.0249 12.485 6.2549 12.255C6.4849 12.025 6.5999 11.74 6.5999 11.4C6.5999 11.06 6.4849 10.775 6.2549 10.545C6.0249 10.315 5.7399 10.2 5.3999 10.2C5.0599 10.2 4.7749 10.315 4.5449 10.545C4.3149 10.775 4.1999 11.06 4.1999 11.4C4.1999 11.74 4.3149 12.025 4.5449 12.255C4.7749 12.485 5.0599 12.6 5.3999 12.6ZM11.3999 12.6H19.7999V10.8C19.7999 10.305 19.6237 9.8812 19.2712 9.5287C18.9187 9.1762 18.4949 8.99995 17.9999 8.99995H11.3999V12.6Z\" />\n ),\n airline_seat_individual_suite: (\n <path d=\"M9.5999 14.4V7.19995H17.9999C18.9999 7.19995 19.8499 7.54995 20.5499 8.24995C21.2499 8.94995 21.5999 9.79995 21.5999 10.8V14.4H9.5999ZM2.3999 17.4V15.6H21.5999V17.4H2.3999ZM5.3999 14.4C4.56657 14.4 3.85824 14.1083 3.2749 13.525C2.69157 12.9416 2.3999 12.2333 2.3999 11.4C2.3999 10.5666 2.69157 9.85828 3.2749 9.27495C3.85824 8.69162 4.56657 8.39995 5.3999 8.39995C6.23324 8.39995 6.94157 8.69162 7.5249 9.27495C8.10824 9.85828 8.3999 10.5666 8.3999 11.4C8.3999 12.2333 8.10824 12.9416 7.5249 13.525C6.94157 14.1083 6.23324 14.4 5.3999 14.4ZM5.3999 12.6C5.7399 12.6 6.0249 12.485 6.2549 12.255C6.4849 12.025 6.5999 11.74 6.5999 11.4C6.5999 11.06 6.4849 10.775 6.2549 10.545C6.0249 10.315 5.7399 10.2 5.3999 10.2C5.0599 10.2 4.7749 10.315 4.5449 10.545C4.3149 10.775 4.1999 11.06 4.1999 11.4C4.1999 11.74 4.3149 12.025 4.5449 12.255C4.7749 12.485 5.0599 12.6 5.3999 12.6ZM11.3999 12.6H19.7999V10.8C19.7999 10.305 19.6237 9.8812 19.2712 9.5287C18.9187 9.1762 18.4949 8.99995 17.9999 8.99995H11.3999V12.6Z\" />\n ),\n airline_seat_legroom_extra: (\n <path d=\"M13.1999 16.8001H4.1999C3.6999 16.8001 3.2749 16.6238 2.9249 16.2713C2.5749 15.9188 2.3999 15.4951 2.3999 15.0001V3.6001H4.1999V15.0001H13.1999V16.8001ZM17.5499 20.4001L14.4999 13.8001H7.7999C7.13324 13.8001 6.56657 13.5668 6.0999 13.1001C5.63324 12.6334 5.3999 12.0668 5.3999 11.4001V3.6001H10.7999V9.6001H14.6749C15.0268 9.6001 15.3481 9.69176 15.6388 9.8751C15.9295 10.0584 16.1416 10.3084 16.2749 10.6251L18.9249 16.4001L19.9999 15.8751C20.3999 15.6751 20.8041 15.6501 21.2124 15.8001C21.6207 15.9501 21.9082 16.2334 22.0749 16.6501C22.2249 17.0334 22.2249 17.4126 22.0749 17.7876C21.9249 18.1626 21.6666 18.4418 21.2999 18.6251L17.5499 20.4001Z\" />\n ),\n airline_seat_recline_extra: (\n <path d=\"M8.1001 6.5999C7.51676 6.5999 7.02093 6.39574 6.6126 5.9874C6.20426 5.57907 6.0001 5.08324 6.0001 4.4999C6.0001 3.91657 6.20426 3.42074 6.6126 3.0124C7.02093 2.60407 7.51676 2.3999 8.1001 2.3999C8.68343 2.3999 9.17926 2.60407 9.5876 3.0124C9.99593 3.42074 10.2001 3.91657 10.2001 4.4999C10.2001 5.08324 9.99593 5.57907 9.5876 5.9874C9.17926 6.39574 8.68343 6.5999 8.1001 6.5999ZM14.4001 19.1999H7.4751C7.04176 19.1999 6.65843 19.0666 6.3251 18.7999C5.99176 18.5332 5.78343 18.1832 5.7001 17.7499L3.6001 7.1999H5.4251L7.5251 17.3999H14.4001V19.1999ZM18.9001 20.3999L16.5001 16.1999H10.5501C9.98343 16.1999 9.48343 16.0249 9.0501 15.6749C8.61676 15.3249 8.33343 14.8749 8.2001 14.3249L7.2001 9.7249C7.06676 9.0749 7.19176 8.4874 7.5751 7.9624C7.95843 7.4374 8.4751 7.1749 9.1251 7.1749C9.6751 7.1749 10.1459 7.33324 10.5376 7.6499C10.9293 7.96657 11.1834 8.3749 11.3001 8.8749L12.4251 13.7999H16.8251C17.1418 13.7999 17.4376 13.8791 17.7126 14.0374C17.9876 14.1957 18.2084 14.4166 18.3751 14.6999L21.0001 19.1999L18.9001 20.3999Z\" />\n ),\n airline_seat_recline_normal: (\n <path d=\"M15.7872 20.9781H7.98301C7.44588 20.9781 6.9811 20.7797 6.58866 20.3829C6.19622 19.985 6 19.5139 6 18.9694V6.53741H7.61138V18.9694C7.61138 19.0528 7.65251 19.1367 7.73476 19.221C7.81701 19.3044 7.89976 19.3461 7.98301 19.3461H15.7872V20.9781ZM11.3901 6.0974C10.7083 6.0974 10.135 5.8568 9.6702 5.37559C9.20542 4.89438 8.97302 4.31875 8.97302 3.64867C8.97302 2.95851 9.21087 2.37785 9.68655 1.90669C10.1612 1.43553 10.7291 1.19995 11.3901 1.19995C12.0709 1.19995 12.6437 1.44106 13.1085 1.92327C13.5723 2.40447 13.8042 2.97961 13.8042 3.64867C13.8042 4.33984 13.5668 4.92101 13.0922 5.39217C12.6175 5.86232 12.0501 6.0974 11.3901 6.0974ZM17.5829 22.7999V17.8392H11.7617C11.0185 17.8392 10.3887 17.5775 9.87236 17.0541C9.35605 16.5307 9.09789 15.8923 9.09789 15.1388V9.33122C9.09789 8.66215 9.31443 8.10761 9.7475 7.66759C10.1816 7.22758 10.7291 7.00757 11.3901 7.00757C12.0293 7.00757 12.5709 7.24867 13.0149 7.73088C13.4588 8.21209 13.6808 8.79777 13.6808 9.48794V15.4538H17.2737C17.8108 15.4538 18.2751 15.6421 18.6666 16.0189C19.059 16.3956 19.2349 16.8557 19.1943 17.3992V22.7999H17.5829Z\" />\n ),\n airline_stops: (\n <path d=\"M9.5496 18.3504V17.0496H11.3496C11.4496 14.6832 10.6288 12.7084 8.8872 11.1252C7.1456 9.542 5.0664 8.7504 2.6496 8.7504V7.4496C4.7168 7.4496 6.6044 7.9956 8.3124 9.0876C10.0204 10.1796 11.2496 11.6836 12 13.5996C12.5168 12.2836 13.3168 11.1296 14.4 10.1376C15.4832 9.1456 16.7164 8.2496 18.0996 7.4496H14.0496V6.15H20.1504V12.1248H18.8496V8.5248C17.0168 9.5248 15.5004 10.7456 14.3004 12.1872C13.1004 13.6288 12.5504 15.2496 12.6504 17.0496H14.4504V18.3504H9.5496Z\" />\n ),\n airplane_ticket: (\n <path d=\"M4.2 18.6996C3.8336 18.6996 3.5252 18.5704 3.2748 18.312C3.0252 18.0544 2.9004 17.7504 2.9004 17.4V14.1996C3.4164 14.0996 3.8456 13.8456 4.188 13.4376C4.5296 13.0296 4.7004 12.5504 4.7004 12C4.7004 11.4496 4.5296 10.9704 4.188 10.5624C3.8456 10.1544 3.4164 9.9004 2.9004 9.8004V6.6C2.9004 6.2496 3.0252 5.9456 3.2748 5.688C3.5252 5.4296 3.8336 5.3004 4.2 5.3004H19.8C20.1664 5.3004 20.4748 5.4296 20.7252 5.688C20.9748 5.9456 21.0996 6.2496 21.0996 6.6V17.4C21.0996 17.7504 20.9748 18.0544 20.7252 18.312C20.4748 18.5704 20.1664 18.6996 19.8 18.6996H4.2ZM4.2 17.4H19.8V6.6H4.2V8.8752C4.7336 9.192 5.1668 9.6252 5.4996 10.1748C5.8332 10.7252 6 11.3336 6 12C6 12.6664 5.8332 13.2748 5.4996 13.8252C5.1668 14.3748 4.7336 14.808 4.2 15.1248V17.4ZM9.0996 15.3L17.2752 13.1004C17.5088 13.0332 17.688 12.908 17.8128 12.7248C17.9376 12.5416 17.9752 12.3416 17.9256 12.1248C17.8584 11.908 17.7248 11.7416 17.5248 11.6256C17.3248 11.5088 17.1164 11.4836 16.8996 11.55L14.5752 12.2004L10.8 8.7L9.6744 9L11.9256 12.8748L9.5256 13.5252L8.3496 12.6L7.65 12.7752L9.0996 15.3Z\" />\n ),\n apartment: (\n <path d=\"M3.8496 19.9752V7.2744H7.4496V3.6744H15.9504V10.8744H20.1504V19.9752H13.4496V16.3752H10.5504V19.9752H3.8496ZM5.1504 18.6744H7.4496V16.3752H5.1504V18.6744ZM5.1504 14.7744H7.4496V12.4752H5.1504V14.7744ZM5.1504 10.8744H7.4496V8.5752H5.1504V10.8744ZM8.7504 14.7744H11.0496V12.4752H8.7504V14.7744ZM8.7504 10.8744H11.0496V8.5752H8.7504V10.8744ZM8.7504 7.2744H11.0496V4.9752H8.7504V7.2744ZM12.3504 14.7744H14.6496V12.4752H12.3504V14.7744ZM12.3504 10.8744H14.6496V8.5752H12.3504V10.8744ZM12.3504 7.2744H14.6496V4.9752H12.3504V7.2744ZM16.5504 18.6744H18.8496V16.3752H16.5504V18.6744ZM16.5504 14.7744H18.8496V12.4752H16.5504V14.7744Z\" />\n ),\n arrow_downward: (\n <path d=\"M11 4V16.175L5.4 10.575L4 12L12 20L20 12L18.6 10.575L13 16.175V4H11Z\" />\n ),\n arrow_drop_down: (\n <path d=\"M11.475 14.475L7.85 10.85C7.8 10.8 7.7625 10.7458 7.7375 10.6875C7.7125 10.6292 7.7 10.5667 7.7 10.5C7.7 10.3667 7.74583 10.25 7.8375 10.15C7.92917 10.05 8.05 10 8.2 10H15.8C15.95 10 16.0708 10.05 16.1625 10.15C16.2542 10.25 16.3 10.3667 16.3 10.5C16.3 10.5333 16.25 10.65 16.15 10.85L12.525 14.475C12.4417 14.5583 12.3583 14.6167 12.275 14.65C12.1917 14.6833 12.1 14.7 12 14.7C11.9 14.7 11.8083 14.6833 11.725 14.65C11.6417 14.6167 11.5583 14.5583 11.475 14.475Z\" />\n ),\n arrow_forward: (\n <path d=\"M5 13h11.17l-4.88 4.88c-.39.39-.39 1.03 0 1.42.39.39 1.02.39 1.41 0l6.59-6.59c.39-.39.39-1.02 0-1.41l-6.58-6.6c-.39-.39-1.02-.39-1.41 0-.39.39-.39 1.02 0 1.41L16.17 11H5c-.55 0-1 .45-1 1s.45 1 1 1z\" />\n ),\n arrow_left: (\n <path d=\"M9 19L2 12L9 5L10.425 6.4L5.825 11H22V13H5.825L10.4 17.6L9 19Z\" />\n ),\n arrow_right: (\n <path d=\"M15 19L13.6 17.6L18.2 13H2V11H18.2L13.6 6.4L15 5L22 12L15 19Z\" />\n ),\n arrow_upward: (\n <path d=\"M11 20V7.825L5.4 13.425L4 12L12 4L20 12L18.6 13.425L13 7.825V20H11Z\" />\n ),\n atm: (\n <path d=\"M10.375 15V10.5H8.125V9H14.125V10.5H11.875V15H10.375ZM2 15V10C2 9.71667 2.09583 9.47917 2.2875 9.2875C2.47917 9.09583 2.71667 9 3 9H6C6.28333 9 6.52083 9.09583 6.7125 9.2875C6.90417 9.47917 7 9.71667 7 10V15H5.5V13.5H3.5V15H2ZM3.5 12H5.5V10.5H3.5V12ZM15.5 15V10C15.5 9.71667 15.5958 9.47917 15.7875 9.2875C15.9792 9.09583 16.2167 9 16.5 9H21C21.2833 9 21.5208 9.09583 21.7125 9.2875C21.9042 9.47917 22 9.71667 22 10V15H20.5V10.5H19.5V14H18V10.5H17V15H15.5Z\" />\n ),\n autorenew: (\n <path d=\"M5.69728 14.4104C5.49326 13.9833 5.32604 13.5257 5.19562 13.0374C5.06521 12.5492 5 12.0367 5 11.5C5 9.56481 5.69083 7.91679 7.07249 6.55591C8.45416 5.19504 10.147 4.53946 12.1511 4.58918H12.7613L11.0742 2.92359L12.0097 2L15.2869 5.23549L12.0097 8.47099L11.0742 7.54739L12.7613 5.88181H12.1511C10.5021 5.84866 9.11624 6.38632 7.99347 7.49479C6.87069 8.60326 6.30931 9.93833 6.30931 11.5C6.30931 11.8455 6.33804 12.1824 6.3955 12.5106C6.45296 12.8389 6.53915 13.1573 6.65407 13.4658L5.69728 14.4104ZM11.9903 21L8.71309 17.7645L11.9903 14.529L12.9258 15.4526L11.2387 17.1182H11.8489C13.4979 17.1513 14.8838 16.6137 16.0065 15.5052C17.1293 14.3967 17.6907 13.0617 17.6907 11.5C17.6907 11.1545 17.662 10.8176 17.6045 10.4894C17.547 10.1611 17.4609 9.84273 17.3459 9.53421L18.3027 8.58959C18.5067 9.01665 18.674 9.47431 18.8044 9.96256C18.9348 10.4508 19 10.9633 19 11.5C19 13.4186 18.3092 15.0625 16.9275 16.4317C15.5458 17.8008 13.853 18.4605 11.8489 18.4108H11.2387L12.9258 20.0764L11.9903 21Z\" />\n ),\n bakery_dining: (\n <path d=\"M6.30001 16.5252H7.80001V15.3H16.2V16.5252H17.7V12.5496C17.7 12.2 17.5876 11.8792 17.3628 11.5872C17.138 11.296 16.8504 11.1004 16.5 11.0004V9.42481C16.5 8.97521 16.3416 8.59601 16.0248 8.28721C15.708 7.97921 15.3248 7.82521 14.8752 7.82521H12.0504C12.0168 7.82521 11.996 7.83361 11.988 7.85041C11.9792 7.86641 11.9832 7.89121 12 7.92481C12.0168 7.89121 12.0208 7.86641 12.012 7.85041C12.004 7.83361 11.9832 7.82521 11.9496 7.82521H9.12481C8.65841 7.82521 8.27081 7.97921 7.96201 8.28721C7.65401 8.59601 7.50001 8.97521 7.50001 9.42481V11.0004C7.14961 11.1004 6.86201 11.296 6.63721 11.5872C6.41241 11.8792 6.30001 12.2 6.30001 12.5496V16.5252ZM7.80001 13.8V12.6H16.2V13.8H7.80001ZM9.00001 11.1V9.62521C9.00001 9.52521 9.02921 9.44601 9.08761 9.38761C9.14601 9.32921 9.21681 9.30001 9.30001 9.30001H10.95C11.0332 9.30001 11.104 9.32921 11.1624 9.38761C11.2208 9.44601 11.25 9.52521 11.25 9.62521V11.1H9.00001ZM12.75 11.1V9.62521C12.75 9.52521 12.7792 9.44601 12.8376 9.38761C12.896 9.32921 12.9668 9.30001 13.05 9.30001H14.7C14.7832 9.30001 14.854 9.32921 14.9124 9.38761C14.9708 9.44601 15 9.52521 15 9.62521V11.1H12.75ZM4.50001 21.0996C4.05041 21.0996 3.67121 20.9456 3.36241 20.6376C3.05441 20.3288 2.90041 19.9496 2.90041 19.5V4.50001C2.90041 4.05041 3.05441 3.67121 3.36241 3.36241C3.67121 3.05441 4.05041 2.90041 4.50001 2.90041H19.5C19.9496 2.90041 20.3288 3.05441 20.6376 3.36241C20.9456 3.67121 21.0996 4.05041 21.0996 4.50001V19.5C21.0996 19.9496 20.9456 20.3288 20.6376 20.6376C20.3288 20.9456 19.9496 21.0996 19.5 21.0996H4.50001ZM4.50001 19.8H19.5C19.5664 19.8 19.6332 19.7668 19.7004 19.7004C19.7668 19.6332 19.8 19.5664 19.8 19.5V4.50001C19.8 4.43361 19.7668 4.36681 19.7004 4.29961C19.6332 4.23321 19.5664 4.20001 19.5 4.20001H4.50001C4.43361 4.20001 4.36681 4.23321 4.29961 4.29961C4.23321 4.36681 4.20001 4.43361 4.20001 4.50001V19.5C4.20001 19.5664 4.23321 19.6332 4.29961 19.7004C4.36681 19.7668 4.43361 19.8 4.50001 19.8Z\" />\n ),\n bassinet: (\n <>\n <path d=\"M19 12C19 14.1217 18.1571 16.1566 16.6569 17.6569C15.1566 19.1571 13.1217 20 11 20C8.87827 20 6.84344 19.1571 5.34315 17.6569C3.84286 16.1566 3 14.1217 3 12L11 12H19Z\" />\n <path d=\"M16.1347 5.86529L11 11V4C12.0506 4 13.0909 4.20693 14.0615 4.60896C14.8136 4.92052 15.5125 5.34451 16.1347 5.86529ZM16.8602 6.55405L12.4142 11H18.9373C18.8482 10.293 18.6649 9.59962 18.391 8.93853C18.0264 8.05823 17.5077 7.25087 16.8602 6.55405Z\" />\n </>\n ),\n bedroom_parent: (\n <path d=\"M6.30001 16.5252H7.80001V15.3H16.2V16.5252H17.7V12.5496C17.7 12.2 17.5876 11.8792 17.3628 11.5872C17.138 11.296 16.8504 11.1004 16.5 11.0004V9.42481C16.5 8.97521 16.3416 8.59601 16.0248 8.28721C15.708 7.97921 15.3248 7.82521 14.8752 7.82521H12.0504C12.0168 7.82521 11.996 7.83361 11.988 7.85041C11.9792 7.86641 11.9832 7.89121 12 7.92481C12.0168 7.89121 12.0208 7.86641 12.012 7.85041C12.004 7.83361 11.9832 7.82521 11.9496 7.82521H9.12481C8.65841 7.82521 8.27081 7.97921 7.96201 8.28721C7.65401 8.59601 7.50001 8.97521 7.50001 9.42481V11.0004C7.14961 11.1004 6.86201 11.296 6.63721 11.5872C6.41241 11.8792 6.30001 12.2 6.30001 12.5496V16.5252ZM7.80001 13.8V12.6H16.2V13.8H7.80001ZM9.00001 11.1V9.62521C9.00001 9.52521 9.02921 9.44601 9.08761 9.38761C9.14601 9.32921 9.21681 9.30001 9.30001 9.30001H10.95C11.0332 9.30001 11.104 9.32921 11.1624 9.38761C11.2208 9.44601 11.25 9.52521 11.25 9.62521V11.1H9.00001ZM12.75 11.1V9.62521C12.75 9.52521 12.7792 9.44601 12.8376 9.38761C12.896 9.32921 12.9668 9.30001 13.05 9.30001H14.7C14.7832 9.30001 14.854 9.32921 14.9124 9.38761C14.9708 9.44601 15 9.52521 15 9.62521V11.1H12.75ZM4.50001 21.0996C4.05041 21.0996 3.67121 20.9456 3.36241 20.6376C3.05441 20.3288 2.90041 19.9496 2.90041 19.5V4.50001C2.90041 4.05041 3.05441 3.67121 3.36241 3.36241C3.67121 3.05441 4.05041 2.90041 4.50001 2.90041H19.5C19.9496 2.90041 20.3288 3.05441 20.6376 3.36241C20.9456 3.67121 21.0996 4.05041 21.0996 4.50001V19.5C21.0996 19.9496 20.9456 20.3288 20.6376 20.6376C20.3288 20.9456 19.9496 21.0996 19.5 21.0996H4.50001ZM4.50001 19.8H19.5C19.5664 19.8 19.6332 19.7668 19.7004 19.7004C19.7668 19.6332 19.8 19.5664 19.8 19.5V4.50001C19.8 4.43361 19.7668 4.36681 19.7004 4.29961C19.6332 4.23321 19.5664 4.20001 19.5 4.20001H4.50001C4.43361 4.20001 4.36681 4.23321 4.29961 4.29961C4.23321 4.36681 4.20001 4.43361 4.20001 4.50001V19.5C4.20001 19.5664 4.23321 19.6332 4.29961 19.7004C4.36681 19.7668 4.43361 19.8 4.50001 19.8Z\" />\n ),\n brunch_dining: (\n <path d=\"M3.15 21.2256C2.9836 21.2256 2.842 21.1672 2.7252 21.0504C2.6084 20.9336 2.55 20.792 2.55 20.6256V19.9248H15.75V20.6256C15.75 20.792 15.6916 20.9336 15.5748 21.0504C15.458 21.1672 15.3164 21.2256 15.15 21.2256H3.15ZM2.55 17.9256V17.2248C2.55 17.0584 2.6084 16.9168 2.7252 16.8C2.842 16.6832 2.9836 16.6248 3.15 16.6248H7.35V15.2496H10.95V16.6248H15.15C15.3164 16.6248 15.458 16.6832 15.5748 16.8C15.6916 16.9168 15.75 17.0584 15.75 17.2248V17.9256H2.55ZM18.2496 21.2256V14.9748C17.6336 14.7252 17.1544 14.2836 16.812 13.65C16.4704 13.0164 16.2996 12.3664 16.2996 11.7V3.02521H21.45V11.7C21.45 12.3664 21.2792 13.0164 20.9376 13.65C20.596 14.2836 20.1336 14.7252 19.5504 14.9748V19.9248H21.45V21.2256H18.2496ZM17.6004 8.70001H20.1504V4.32481H17.6004V8.70001ZM18.9 13.8504C19.2832 13.6664 19.5872 13.3788 19.812 12.9876C20.0376 12.5956 20.1504 12.1664 20.1504 11.7V9.99961H17.6004V11.7C17.6004 12.1664 17.7212 12.5956 17.9628 12.9876C18.2044 13.3788 18.5168 13.6664 18.9 13.8504Z\" />\n ),\n cabin_bag: (\n <path d=\"M7.3077 20.5C6.81058 20.5 6.38502 20.323 6.03102 19.969C5.67701 19.615 5.5 19.1894 5.5 18.6923V8.25007C5.5 7.76417 5.67019 7.35103 6.01057 7.01065C6.35096 6.67027 6.7641 6.50007 7.25 6.50007H9.25V3.6924C9.25 3.43631 9.33622 3.22166 9.50865 3.04842C9.68108 2.87519 9.89773 2.78857 10.1586 2.78857H13.8414C14.1022 2.78857 14.3189 2.87519 14.4913 3.04842C14.6637 3.22166 14.75 3.43631 14.75 3.6924V6.50007H16.6922C17.1894 6.50007 17.6149 6.67708 17.9689 7.0311C18.3229 7.3851 18.5 7.81066 18.5 8.30777V18.6923C18.5 19.1894 18.3229 19.615 17.9689 19.969C17.6149 20.323 17.1894 20.5 16.6922 20.5C16.6922 20.7507 16.6074 20.9608 16.4377 21.1303C16.2681 21.2999 16.0578 21.3846 15.807 21.3846C15.5561 21.3846 15.3461 21.2999 15.1769 21.1303C15.0077 20.9608 14.923 20.7507 14.923 20.5H9.0769C9.0769 20.7513 8.99206 20.9615 8.82237 21.1308C8.65271 21.3 8.44246 21.3846 8.19162 21.3846C7.94079 21.3846 7.73076 21.2999 7.56153 21.1303C7.39231 20.9608 7.3077 20.7507 7.3077 20.5ZM10.4423 6.50007H13.5577V3.98085H10.4423V6.50007ZM7.3077 19H16.6922C16.782 19 16.8557 18.9712 16.9134 18.9135C16.9711 18.8558 17 18.7821 17 18.6923V8.30777C17 8.21802 16.9711 8.1443 16.9134 8.0866C16.8557 8.0289 16.782 8.00005 16.6922 8.00005H7.3077C7.21795 8.00005 7.14423 8.0289 7.08652 8.0866C7.02882 8.1443 6.99997 8.21802 6.99997 8.30777V18.6923C6.99997 18.7821 7.02882 18.8558 7.08652 18.9135C7.14423 18.9712 7.21795 19 7.3077 19ZM8.15382 17.1539C8.15382 17.3261 8.21009 17.4685 8.32262 17.5811C8.43514 17.6937 8.57744 17.75 8.74952 17.75C8.92161 17.75 9.06407 17.6937 9.1769 17.5811C9.28972 17.4685 9.34613 17.3261 9.34613 17.1539V9.8462C9.34613 9.67398 9.28986 9.53157 9.17732 9.41897C9.06481 9.30637 8.92251 9.25007 8.75043 9.25007C8.57834 9.25007 8.43588 9.30637 8.32305 9.41897C8.21023 9.53157 8.15382 9.67398 8.15382 9.8462V17.1539ZM11.4038 17.1539C11.4038 17.3261 11.4601 17.4685 11.5726 17.5811C11.6851 17.6937 11.8274 17.75 11.9995 17.75C12.1716 17.75 12.3141 17.6937 12.4269 17.5811C12.5397 17.4685 12.5961 17.3261 12.5961 17.1539V9.8462C12.5961 9.67398 12.5399 9.53157 12.4273 9.41897C12.3148 9.30637 12.1725 9.25007 12.0004 9.25007C11.8283 9.25007 11.6859 9.30637 11.5731 9.41897C11.4602 9.53157 11.4038 9.67398 11.4038 9.8462V17.1539ZM14.6538 17.1539C14.6538 17.3261 14.7101 17.4685 14.8226 17.5811C14.9351 17.6937 15.0774 17.75 15.2495 17.75C15.4216 17.75 15.5641 17.6937 15.6769 17.5811C15.7897 17.4685 15.8461 17.3261 15.8461 17.1539V9.8462C15.8461 9.67398 15.7899 9.53157 15.6773 9.41897C15.5648 9.30637 15.4225 9.25007 15.2504 9.25007C15.0783 9.25007 14.9359 9.30637 14.823 9.41897C14.7102 9.53157 14.6538 9.67398 14.6538 9.8462V17.1539Z\" />\n ),\n calendar_month: (\n <path d=\"M5.69999 21.099C5.25039 21.099 4.87119 20.941 4.56239 20.625C4.25439 20.3082 4.10039 19.933 4.10039 19.4994V6.89943C4.10039 6.46583 4.25439 6.09103 4.56239 5.77503C4.87119 5.45823 5.25039 5.29983 5.69999 5.29983H7.89959V2.77383H9.22559V5.29983H14.7996V2.77383H16.1004V5.29983H18.3C18.7496 5.29983 19.1288 5.45823 19.4376 5.77503C19.7456 6.09103 19.8996 6.46583 19.8996 6.89943V19.4994C19.8996 19.933 19.7456 20.3082 19.4376 20.625C19.1288 20.941 18.7496 21.099 18.3 21.099H5.69999ZM5.69999 19.7994H18.3C18.3664 19.7994 18.4332 19.7662 18.5004 19.6998C18.5668 19.6326 18.6 19.5658 18.6 19.4994V11.0994H5.39999V19.4994C5.39999 19.5658 5.43319 19.6326 5.49959 19.6998C5.56679 19.7662 5.63359 19.7994 5.69999 19.7994ZM5.39999 9.79983H18.6V6.89943C18.6 6.83303 18.5668 6.76623 18.5004 6.69903C18.4332 6.63263 18.3664 6.59943 18.3 6.59943H5.69999C5.63359 6.59943 5.56679 6.63263 5.49959 6.69903C5.43319 6.76623 5.39999 6.83303 5.39999 6.89943V9.79983ZM12 14.4738C11.7832 14.4738 11.6 14.399 11.4504 14.2494C11.3 14.0998 11.2248 13.9166 11.2248 13.6998C11.2248 13.483 11.3 13.2954 11.4504 13.137C11.6 12.9786 11.7832 12.8994 12 12.8994C12.2168 12.8994 12.4 12.9786 12.5496 13.137C12.7 13.2954 12.7752 13.4746 12.7752 13.6746C12.7752 13.8914 12.7 14.079 12.5496 14.2374C12.4 14.395 12.2168 14.4738 12 14.4738ZM8.09999 14.4738C7.88319 14.4738 7.69999 14.399 7.55039 14.2494C7.39999 14.0998 7.32479 13.9166 7.32479 13.6998C7.32479 13.483 7.39999 13.2954 7.55039 13.137C7.69999 12.9786 7.88319 12.8994 8.09999 12.8994C8.31679 12.8994 8.49999 12.9786 8.64959 13.137C8.79999 13.2954 8.87519 13.4746 8.87519 13.6746C8.87519 13.8914 8.79999 14.079 8.64959 14.2374C8.49999 14.395 8.31679 14.4738 8.09999 14.4738ZM15.9 14.4738C15.6832 14.4738 15.5 14.399 15.3504 14.2494C15.2 14.0998 15.1248 13.9166 15.1248 13.6998C15.1248 13.483 15.2 13.2954 15.3504 13.137C15.5 12.9786 15.6832 12.8994 15.9 12.8994C16.1168 12.8994 16.3 12.9786 16.4496 13.137C16.6 13.2954 16.6752 13.4746 16.6752 13.6746C16.6752 13.8914 16.6 14.079 16.4496 14.2374C16.3 14.395 16.1168 14.4738 15.9 14.4738ZM12 17.9994C11.7832 17.9994 11.6 17.9242 11.4504 17.7738C11.3 17.6242 11.2248 17.441 11.2248 17.2242C11.2248 17.0074 11.3 16.8198 11.4504 16.6614C11.6 16.5038 11.7832 16.425 12 16.425C12.2168 16.425 12.4 16.5038 12.5496 16.6614C12.7 16.8198 12.7752 16.999 12.7752 17.199C12.7752 17.4158 12.7 17.6034 12.5496 17.7618C12.4 17.9202 12.2168 17.9994 12 17.9994ZM8.09999 17.9994C7.88319 17.9994 7.69999 17.9242 7.55039 17.7738C7.39999 17.6242 7.32479 17.441 7.32479 17.2242C7.32479 17.0074 7.39999 16.8198 7.55039 16.6614C7.69999 16.5038 7.88319 16.425 8.09999 16.425C8.31679 16.425 8.49999 16.5038 8.64959 16.6614C8.79999 16.8198 8.87519 16.999 8.87519 17.199C8.87519 17.4158 8.79999 17.6034 8.64959 17.7618C8.49999 17.9202 8.31679 17.9994 8.09999 17.9994ZM15.9 17.9994C15.6832 17.9994 15.5 17.9242 15.3504 17.7738C15.2 17.6242 15.1248 17.441 15.1248 17.2242C15.1248 17.0074 15.2 16.8198 15.3504 16.6614C15.5 16.5038 15.6832 16.425 15.9 16.425C16.1168 16.425 16.3 16.5038 16.4496 16.6614C16.6 16.8198 16.6752 16.999 16.6752 17.199C16.6752 17.4158 16.6 17.6034 16.4496 17.7618C16.3 17.9202 16.1168 17.9994 15.9 17.9994Z\" />\n ),\n carry_on_bag_inactive: (\n <path d=\"M15.6 13.0499L13.8 11.2499V8.9999H11.55L9.75 7.1999H13.8V4.1999C13.305 4.1999 12.8813 4.02365 12.5288 3.67115C12.1763 3.31865 12 2.8949 12 2.3999H15.6V13.0499ZM19.2 21.7749L18.375 20.9249C18.1583 21.5082 17.7958 21.9666 17.2875 22.2999C16.7792 22.6332 16.2167 22.7999 15.6 22.7999C14.872 22.7999 14.2233 22.5791 13.654 22.1374C13.0847 21.6957 12.75 21.1166 12.65 20.3999H7.8C7.305 20.3999 6.88125 20.2237 6.52875 19.8712C6.17625 19.5187 6 19.0949 6 18.5999V8.9999C6 8.93324 6.00417 8.86657 6.0125 8.7999C6.02083 8.73324 6.03333 8.66657 6.05 8.5999L2.25 4.7999L3.525 3.5249L20.475 20.4999L19.2 21.7749ZM9 18.5999V11.5499L7.8 10.3499V18.5999H9ZM15.6 20.9999C15.9333 20.9999 16.2167 20.8832 16.45 20.6499C16.6833 20.4166 16.8 20.1332 16.8 19.7999C16.8 19.4666 16.6833 19.1832 16.45 18.9499C16.2167 18.7166 15.9333 18.5999 15.6 18.5999C15.2667 18.5999 14.9833 18.7166 14.75 18.9499C14.5167 19.1832 14.4 19.4666 14.4 19.7999C14.4 20.1332 14.5167 20.4166 14.75 20.6499C14.9833 20.8832 15.2667 20.9999 15.6 20.9999ZM10.8 18.5999H12.85C12.9667 18.3666 13.1042 18.1499 13.2625 17.9499C13.4208 17.7499 13.6 17.5666 13.8 17.3999V16.3499L10.8 13.3499V18.5999Z\" />\n ),\n check: (\n <path d=\"M10.3333 15.8646L7 12.5313L8.0625 11.4688L10.3333 13.7396L15.9375 8.13544L17 9.19794L10.3333 15.8646Z\" />\n ),\n check_circle: (\n <path d=\"M10.6 16.6L17.65 9.55L16.25 8.15L10.6 13.8L7.75 10.95L6.35 12.35L10.6 16.6ZM12 22C10.6167 22 9.31667 21.7373 8.1 21.212C6.88333 20.6873 5.825 19.975 4.925 19.075C4.025 18.175 3.31267 17.1167 2.788 15.9C2.26267 14.6833 2 13.3833 2 12C2 10.6167 2.26267 9.31667 2.788 8.1C3.31267 6.88333 4.025 5.825 4.925 4.925C5.825 4.025 6.88333 3.31233 8.1 2.787C9.31667 2.26233 10.6167 2 12 2C13.3833 2 14.6833 2.26233 15.9 2.787C17.1167 3.31233 18.175 4.025 19.075 4.925C19.975 5.825 20.6873 6.88333 21.212 8.1C21.7373 9.31667 22 10.6167 22 12C22 13.3833 21.7373 14.6833 21.212 15.9C20.6873 17.1167 19.975 18.175 19.075 19.075C18.175 19.975 17.1167 20.6873 15.9 21.212C14.6833 21.7373 13.3833 22 12 22ZM12 20C14.2167 20 16.1043 19.221 17.663 17.663C19.221 16.1043 20 14.2167 20 12C20 9.78333 19.221 7.89567 17.663 6.337C16.1043 4.779 14.2167 4 12 4C9.78333 4 7.896 4.779 6.338 6.337C4.77933 7.89567 4 9.78333 4 12C4 14.2167 4.77933 16.1043 6.338 17.663C7.896 19.221 9.78333 20 12 20Z\" />\n ),\n check_large: (\n <path d=\"M9.54961 18.0001L3.84961 12.3001L5.27461 10.8751L9.54961 15.1501L18.7246 5.9751L20.1496 7.4001L9.54961 18.0001Z\" />\n ),\n check_small: (\n <path d=\"M9.99946 16.1273L6.35026 12.4769L7.27426 11.5517L9.99946 14.2769L16.7255 7.55209L17.6495 8.47609L9.99946 16.1273Z\" />\n ),\n checked_bag: (\n <path d=\"M22 19H2V21H22V19M4 15C4 15.5 4.2 16 4.6 16.4C5 16.8 5.5 17 6 17V6C5.5 6 5 6.2 4.6 6.6C4.2 7 4 7.5 4 8V15M13.5 6H10.5C10.5 5.6 10.6 5.2 10.9 4.9C11.2 4.6 11.5 4.5 12 4.5C12.4 4.5 12.8 4.6 13.1 4.9C13.3 5.2 13.5 5.6 13.5 6M7 6V17H17V6H15C15 5.2 14.7 4.5 14.1 3.9S12.8 3 12 3C11.2 3 10.5 3.3 9.9 3.9C9.3 4.5 9 5.2 9 6H7M18 17C18.5 17 19 16.8 19.4 16.4C19.8 16 20 15.5 20 15V8C20 7.5 19.8 7 19.4 6.6C19 6.2 18.5 6 18 6V17Z\" />\n ),\n chevron: (\n <path d=\"M5 13H16.17L11.29 17.88C10.9 18.27 10.9 18.91 11.29 19.3C11.68 19.69 12.31 19.69 12.7 19.3L19.29 12.71C19.68 12.32 19.68 11.69 19.29 11.3L12.71 4.7C12.32 4.31 11.69 4.31 11.3 4.7C10.91 5.09 10.91 5.72 11.3 6.11L16.17 11H5C4.45 11 4 11.45 4 12C4 12.55 4.45 13 5 13Z\" />\n ),\n child_care: (\n <path d=\"M14.5 11.75C14.15 11.75 13.8542 11.6292 13.6125 11.3875C13.3708 11.1458 13.25 10.85 13.25 10.5C13.25 10.15 13.3708 9.85417 13.6125 9.6125C13.8542 9.37083 14.15 9.25 14.5 9.25C14.85 9.25 15.1458 9.37083 15.3875 9.6125C15.6292 9.85417 15.75 10.15 15.75 10.5C15.75 10.85 15.6292 11.1458 15.3875 11.3875C15.1458 11.6292 14.85 11.75 14.5 11.75ZM9.5 11.75C9.15 11.75 8.85417 11.6292 8.6125 11.3875C8.37083 11.1458 8.25 10.85 8.25 10.5C8.25 10.15 8.37083 9.85417 8.6125 9.6125C8.85417 9.37083 9.15 9.25 9.5 9.25C9.85 9.25 10.1458 9.37083 10.3875 9.6125C10.6292 9.85417 10.75 10.15 10.75 10.5C10.75 10.85 10.6292 11.1458 10.3875 11.3875C10.1458 11.6292 9.85 11.75 9.5 11.75ZM12 17C11 17 10.0958 16.725 9.2875 16.175C8.47917 15.625 7.88333 14.9 7.5 14H16.5C16.1167 14.9 15.5208 15.625 14.7125 16.175C13.9042 16.725 13 17 12 17ZM12 21C10.75 21 9.57917 20.7625 8.4875 20.2875C7.39583 19.8125 6.44583 19.1708 5.6375 18.3625C4.82917 17.5542 4.1875 16.6042 3.7125 15.5125C3.2375 14.4208 3 13.25 3 12C3 10.75 3.2375 9.57917 3.7125 8.4875C4.1875 7.39583 4.82917 6.44583 5.6375 5.6375C6.44583 4.82917 7.39583 4.1875 8.4875 3.7125C9.57917 3.2375 10.75 3 12 3C13.25 3 14.4208 3.2375 15.5125 3.7125C16.6042 4.1875 17.5542 4.82917 18.3625 5.6375C19.1708 6.44583 19.8125 7.39583 20.2875 8.4875C20.7625 9.57917 21 10.75 21 12C21 13.25 20.7625 14.4208 20.2875 15.5125C19.8125 16.6042 19.1708 17.5542 18.3625 18.3625C17.5542 19.1708 16.6042 19.8125 15.5125 20.2875C14.4208 20.7625 13.25 21 12 21ZM12 19C13.9333 19 15.5833 18.3167 16.95 16.95C18.3167 15.5833 19 13.9333 19 12C19 10.0667 18.3167 8.41667 16.95 7.05C15.5833 5.68333 13.9333 5 12 5H11.7C11.6 5 11.5 5.01667 11.4 5.05C11.3 5.15 11.2333 5.25833 11.2 5.375C11.1667 5.49167 11.15 5.61667 11.15 5.75C11.15 6.1 11.2708 6.39583 11.5125 6.6375C11.7542 6.87917 12.05 7 12.4 7C12.55 7 12.6875 6.975 12.8125 6.925C12.9375 6.875 13.0667 6.85 13.2 6.85C13.4 6.85 13.5667 6.925 13.7 7.075C13.8333 7.225 13.9 7.4 13.9 7.6C13.9 7.98333 13.7208 8.22917 13.3625 8.3375C13.0042 8.44583 12.6833 8.5 12.4 8.5C11.65 8.5 11.0042 8.22917 10.4625 7.6875C9.92083 7.14583 9.65 6.5 9.65 5.75V5.6C9.65 5.55 9.65833 5.48333 9.675 5.4C8.29167 5.9 7.16667 6.74167 6.3 7.925C5.43333 9.10833 5 10.4667 5 12C5 13.9333 5.68333 15.5833 7.05 16.95C8.41667 18.3167 10.0667 19 12 19Z\" />\n ),\n close: (\n <path d=\"M18.3 5.71c-.39-.39-1.02-.39-1.41 0L12 10.59 7.11 5.7c-.39-.39-1.02-.39-1.41 0-.39.39-.39 1.02 0 1.41L10.59 12 5.7 16.89c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L12 13.41l4.89 4.89c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4z\" />\n ),\n closet: (\n <path d=\"M12 4C11.0717 4 10.1815 4.36875 9.52513 5.02513C8.86875 5.6815 8.5 6.57174 8.5 7.5H10.5C10.5 7.10218 10.658 6.72064 10.9393 6.43934C11.2206 6.15804 11.6022 6 12 6C12.3978 6 12.7794 6.15804 13.0607 6.43934C13.342 6.72064 13.5 7.10218 13.5 7.5C13.5 7.89782 13.342 8.27936 13.0607 8.56066C12.7794 8.84196 12.3978 9 12 9C11.45 9 11 9.45 11 10V11.75L2.4 18.2C2.23209 18.3259 2.10807 18.5015 2.04549 18.7018C1.98291 18.9022 1.98495 19.1171 2.05132 19.3162C2.11769 19.5153 2.24502 19.6885 2.41529 19.8112C2.58556 19.934 2.79012 20 3 20H21C21.2099 20 21.4144 19.934 21.5847 19.8112C21.755 19.6885 21.8823 19.5153 21.9487 19.3162C22.0151 19.1171 22.0171 18.9022 21.9545 18.7018C21.8919 18.5015 21.7679 18.3259 21.6 18.2L13 11.75V10.85C13.7216 10.6349 14.3546 10.1927 14.805 9.58919C15.2554 8.98569 15.4991 8.25303 15.5 7.5C15.5 6.57174 15.1313 5.6815 14.4749 5.02513C13.8185 4.36875 12.9283 4 12 4ZM12 13.5L18 18H6L12 13.5Z\" />\n ),\n concierge: (\n <path d=\"M10 22V20H23V22H10ZM11 19C11 17.65 11.425 16.4708 12.275 15.4625C13.125 14.4542 14.2 13.8333 15.5 13.6V12.975C15.5 12.6917 15.5958 12.4542 15.7875 12.2625C15.9792 12.0708 16.2167 11.975 16.5 11.975C16.7833 11.975 17.0208 12.0708 17.2125 12.2625C17.4042 12.4542 17.5 12.6917 17.5 12.975V13.6C18.7833 13.8333 19.8542 14.4542 20.7125 15.4625C21.5708 16.4708 22 17.65 22 19H11ZM13.625 16.975H19.325C19.0083 16.525 18.6042 16.1625 18.1125 15.8875C17.6208 15.6125 17.0833 15.475 16.5 15.475C15.9 15.475 15.35 15.6125 14.85 15.8875C14.35 16.1625 13.9417 16.525 13.625 16.975ZM1 13V2H7V3.45L14 1.5L22 4V5C22 5.83333 21.7083 6.54167 21.125 7.125C20.5417 7.70833 19.8333 8 19 8H17V8.6C17 9.01667 16.8792 9.39583 16.6375 9.7375C16.3958 10.0792 16.0833 10.325 15.7 10.475L8.95 13H1ZM3 11H5V4H3V11ZM7 11H8.6L14.4 8.875C14.5833 8.80833 14.7292 8.69583 14.8375 8.5375C14.9458 8.37917 15 8.2 15 8H13.225L10.3 8.95L9.7 7.05L12.825 6H19C19.15 6 19.3375 5.94583 19.5625 5.8375C19.7875 5.72917 19.9 5.6 19.9 5.45L13.95 3.6L7 5.5V11Z\" />\n ),\n credit_card: (\n <path d=\"M4 20C3.45 20 2.97933 19.8043 2.588 19.413C2.196 19.021 2 18.55 2 18V6C2 5.45 2.196 4.97933 2.588 4.588C2.97933 4.196 3.45 4 4 4H20C20.55 4 21.021 4.196 21.413 4.588C21.8043 4.97933 22 5.45 22 6V18C22 18.55 21.8043 19.021 21.413 19.413C21.021 19.8043 20.55 20 20 20H4ZM4 8V12H20V8H4Z\" />\n ),\n currency_exchange: (\n <path d=\"M12 21.6C10.1761 21.6 8.52211 21.1381 7.03805 20.2142C5.554 19.2896 4.40979 18.0507 3.60543 16.4974V19.5968H2.4V14.4696H7.50108V15.6821H4.53371C5.2134 17.1108 6.22182 18.2524 7.55896 19.1069C8.89609 19.9614 10.3764 20.3887 12 20.3887C13.1286 20.3887 14.1916 20.1791 15.1889 19.7601C16.1854 19.3403 17.0588 18.7654 17.809 18.0354C18.5584 17.3054 19.1572 16.443 19.6054 15.4483C20.0544 14.4543 20.3018 13.3825 20.3478 12.2326H21.5533C21.5228 13.5376 21.2487 14.7571 20.7307 15.8912C20.2128 17.0254 19.5286 18.0156 18.6783 18.8619C17.8279 19.709 16.8306 20.3771 15.6864 20.8663C14.5429 21.3554 13.3141 21.6 12 21.6ZM11.4201 17.9649V16.8934C11.1418 16.8315 10.7167 16.6529 10.1446 16.3576C9.57245 16.0624 9.13206 15.4565 8.82338 14.5401L9.93642 14.0502C9.99801 14.1128 10.1757 14.4275 10.4696 14.9942C10.7634 15.5616 11.3199 15.8454 12.1391 15.8454C12.5569 15.8454 12.9821 15.7208 13.4147 15.4718C13.8473 15.2235 14.0636 14.8119 14.0636 14.237C14.0636 13.7866 13.9167 13.4294 13.6228 13.1655C13.329 12.9015 12.8266 12.6372 12.1158 12.3725C11.5904 12.186 10.9645 11.9143 10.2381 11.5571C9.51161 11.1999 9.14838 10.5318 9.14838 9.55274C9.14838 9.53783 9.24485 9.18476 9.43778 8.49353C9.6307 7.80231 10.2993 7.34 11.4435 7.10661V6.03509H12.6033V7.08312C13.3913 7.2233 13.9437 7.50703 14.2606 7.93429C14.5774 8.36155 14.7744 8.65273 14.8516 8.80783L13.8321 9.25075C13.7549 9.11057 13.5809 8.88911 13.3101 8.58637C13.0392 8.28363 12.6255 8.13226 12.069 8.13226C11.7292 8.13226 11.3507 8.24486 10.9337 8.47005C10.5159 8.69524 10.3071 9.04868 10.3071 9.53037C10.3071 9.98075 10.4811 10.3223 10.8291 10.5549C11.1771 10.7883 11.7685 11.0448 12.6033 11.3244C13.6391 11.6816 14.3348 12.101 14.6902 12.5827C15.0457 13.0644 15.2234 13.6158 15.2234 14.237C15.2234 14.8119 15.1035 15.2742 14.8639 15.6239C14.6242 15.9729 14.3496 16.2447 14.0402 16.4393C13.7315 16.6332 13.434 16.761 13.1476 16.8229C12.8619 16.8856 12.6727 16.9169 12.5799 16.9169V17.9649H11.4201ZM2.44675 11.7674C2.49276 10.4311 2.77473 9.19222 3.29266 8.05061C3.8106 6.90901 4.50254 5.9184 5.36849 5.07878C6.23369 4.24066 7.23469 3.58448 8.37148 3.11024C9.50753 2.63675 10.717 2.4 12 2.4C13.8091 2.4 15.4631 2.86194 16.962 3.78581C18.4616 4.71043 19.6058 5.965 20.3946 7.54953V4.40322H21.6V9.53037H16.4989V8.31793H19.4663C18.8014 6.91982 17.8004 5.78604 16.4633 4.9166C15.1262 4.04642 13.6384 3.61132 12 3.61132C10.887 3.61132 9.83587 3.82086 8.84675 4.23992C7.85688 4.65972 6.98314 5.2309 6.22553 5.95344C5.46866 6.67524 4.86205 7.5335 4.40571 8.52821C3.94936 9.52217 3.69818 10.6019 3.65218 11.7674H2.44675Z\" />\n ),\n dinner_dining: (\n <path d=\"M4.05 20.1252L2.7504 18.8256H21.2256L19.9248 20.1252H4.05ZM4.0248 17.25C4.1248 17.0332 4.2664 16.8164 4.4496 16.5996C4.6336 16.3828 4.8588 16.1664 5.1252 15.9504V9.4248H3.9252V8.5248H5.1252V7.2504H3.9252V6.3504H5.1252V5.0496H3.9252V4.1496H9.6252C10.1748 4.1496 10.6664 4.354 11.1 4.7628C11.5336 5.1708 11.7504 5.7 11.7504 6.3504H20.4252V7.2504H11.7504C11.7504 7.8832 11.5336 8.404 11.1 8.8128C10.6664 9.2208 10.1748 9.4248 9.6252 9.4248H8.4252V15.2496C8.7748 15.3328 9.108 15.4456 9.4248 15.588C9.7416 15.7296 10.0332 15.9168 10.2996 16.1496C10.5164 15.0496 11.0832 14.1416 12 13.4256C12.9168 12.7088 13.9752 12.3504 15.1752 12.3504C16.5584 12.3504 17.7376 12.792 18.7128 13.6752C19.6872 14.5584 20.1996 15.6584 20.25 16.9752V17.25H4.0248ZM11.8248 15.9504H18.6C18.4336 15.3336 18.0296 14.796 17.388 14.3376C16.7464 13.8792 16.0088 13.65 15.1752 13.65C14.3416 13.65 13.6164 13.8752 12.9996 14.3256C12.3828 14.7752 11.9912 15.3168 11.8248 15.9504ZM8.4252 6.3504H10.4496V5.3496C10.4496 5.2832 10.4164 5.2168 10.35 5.1504C10.2836 5.0832 10.2088 5.0496 10.1256 5.0496H8.4252V6.3504ZM8.4252 8.5248H10.1256C10.2088 8.5248 10.2836 8.4956 10.35 8.4372C10.4164 8.3788 10.4496 8.308 10.4496 8.2248V7.2504H8.4252V8.5248ZM6.0252 6.3504H7.5252V5.0496H6.0252V6.3504ZM6.0252 8.5248H7.5252V7.2504H6.0252V8.5248ZM6.0252 15.5004C6.258 15.3836 6.4956 15.3 6.738 15.2496C6.9796 15.2 7.242 15.1584 7.5252 15.1248V9.4248H6.0252V15.5004Z\" />\n ),\n exit_row: (\n <path d=\"M20 11H6.83001L9.71001 8.12001C10.1 7.73001 10.1 7.10001 9.71001 6.71001C9.32001 6.32001 8.69001 6.32001 8.30001 6.71001L3.71001 11.3C3.32001 11.69 3.32001 12.32 3.71001 12.71L8.30001 17.3C8.69001 17.69 9.32001 17.69 9.71001 17.3C10.1 16.91 10.1 16.28 9.71001 15.89L6.83001 13H20C20.55 13 21 12.55 21 12C21 11.45 20.55 11 20 11Z\" />\n ),\n exit_row_right: (\n <path d=\"M4 11H17.17L14.29 8.12001C13.9 7.73001 13.9 7.10001 14.29 6.71001C14.68 6.32001 15.31 6.32001 15.7 6.71001L20.29 11.3C20.68 11.69 20.68 12.32 20.29 12.71L15.7 17.3C15.31 17.69 14.68 17.69 14.29 17.3C13.9 16.91 13.9 16.28 14.29 15.89L17.17 13H4C3.45 13 3 12.55 3 12C3 11.45 3.45 11 4 11Z\" />\n ),\n expand_content: <path d=\"M5 19V13H7V17H11V19H5ZM17 11V7H13V5H19V11H17Z\" />,\n fitness_center: (\n <path d=\"M11.4 19.9L9.99998 18.5L13.55 14.95L5.04998 6.45001L1.49998 10L0.0999756 8.60001L1.49998 7.15001L0.0999756 5.75001L2.19998 3.65001L0.799976 2.20001L2.19998 0.800006L3.64998 2.20001L5.74998 0.100006L7.14998 1.50001L8.59998 0.100006L9.99998 1.50001L6.44998 5.05001L14.95 13.55L18.5 10L19.9 11.4L18.5 12.85L19.9 14.25L17.8 16.35L19.2 17.8L17.8 19.2L16.35 17.8L14.25 19.9L12.85 18.5L11.4 19.9Z\" />\n ),\n flight: (\n <path d=\"M2.7252 8.6496L3.6 8.6496L5.1504 10.7496L11.0496 10.7496L8.7252 2.6496L10.0752 2.6496L14.7 10.7496L20.1 10.7496C20.4504 10.7496 20.7464 10.8704 20.988 11.112C21.2296 11.3536 21.3504 11.6496 21.3504 12C21.3504 12.3504 21.2296 12.6464 20.988 12.888C20.7464 13.1296 20.4504 13.2504 20.1 13.2504L14.7 13.2504L10.0752 21.3504L8.7252 21.3504L11.0496 13.2504L5.1744 13.2504L3.6 15.3504L2.7252 15.3504L3.8748 12L2.7252 8.6496Z\" />\n ),\n flight_class: (\n <path d=\"M14.2596 12.5C13.7737 12.5 13.3606 12.3298 13.0202 11.9894C12.6798 11.649 12.5096 11.2359 12.5096 10.75V6.25C12.5096 5.7641 12.6798 5.35096 13.0202 5.01058C13.3606 4.67019 13.7737 4.5 14.2596 4.5H15.75C16.2359 4.5 16.649 4.67019 16.9894 5.01058C17.3298 5.35096 17.5 5.7641 17.5 6.25V10.75C17.5 11.2359 17.3298 11.649 16.9894 11.9894C16.649 12.3298 16.2359 12.5 15.75 12.5H14.2596ZM14.2596 11H15.75C15.8205 11 15.8798 10.9759 15.9278 10.9279C15.9759 10.8798 16 10.8205 16 10.75V6.25C16 6.17948 15.9759 6.12018 15.9278 6.0721C15.8798 6.02402 15.8205 5.99998 15.75 5.99998H14.2596C14.1891 5.99998 14.1298 6.02402 14.0817 6.0721C14.0336 6.12018 14.0096 6.17948 14.0096 6.25V10.75C14.0096 10.8205 14.0336 10.8798 14.0817 10.9279C14.1298 10.9759 14.1891 11 14.2596 11ZM9.5673 17.5C9.21345 17.5 8.89678 17.398 8.6173 17.1942C8.33782 16.9903 8.14423 16.7198 8.03655 16.3827L5.5 8.02883V4.5H6.99997V7.99998L9.49997 16H17.7596V17.5H9.5673ZM8.25 20.5V19H17.75V20.5H8.25ZM14.2596 5.99998H16H14.0096H14.2596Z\" />\n ),\n flight_landing: (\n <path d=\"M3.84961 20.151V18.8502H20.1504V20.151H3.84961ZM18.45 15.3006L3.84961 11.2254V6.35098L4.89961 6.67498L5.64961 8.97538L9.84961 10.1502V2.72578L11.2752 3.20098L13.8996 11.301L19.2 12.7758C19.4664 12.8422 19.6912 12.9922 19.8744 13.2258C20.0584 13.4586 20.1504 13.7254 20.1504 14.0262C20.1504 14.4758 19.9752 14.8338 19.6248 15.1002C19.2752 15.3674 18.8836 15.4342 18.45 15.3006Z\" />\n ),\n flight_takeoff: (\n <path d=\"M3.77521 20.1498V18.849H20.0748V20.1498H3.77521ZM5.45041 15.2742L2.94961 11.0994L4.05001 10.8246L5.90041 12.399L10.05 11.2998L6.27481 4.89902L7.72561 4.62422L14.1 10.1994L19.4004 8.77382C19.75 8.67462 20.0832 8.72062 20.4 8.91182C20.7168 9.10382 20.9252 9.37462 21.0252 9.72422C21.1084 10.0746 21.0624 10.4038 20.8872 10.7118C20.7128 11.0198 20.4504 11.2242 20.1 11.325L5.45041 15.2742Z\" />\n ),\n galley: (\n <path d=\"M20 3H4v10c0 2.21 1.79 4 4 4h6c2.21 0 4-1.79 4-4v-3h2c1.11 0 2-.9 2-2V5c0-1.11-.89-2-2-2zm0 5h-2V5h2v3zM4 19h16v2H4z\" />\n ),\n hearing: (\n <path d=\"M17 22C15.9667 22 15.1208 21.7417 14.4625 21.225C13.8042 20.7083 13.3 19.95 12.95 18.95C12.6667 18.1167 12.3958 17.5333 12.1375 17.2C11.8792 16.8667 11.2833 16.3333 10.35 15.6C9.31667 14.7667 8.5 13.825 7.9 12.775C7.3 11.725 7 10.4667 7 9.00001C7 7.01668 7.67083 5.35418 9.0125 4.01251C10.3542 2.67085 12.0167 2.00001 14 2.00001C15.9833 2.00001 17.6458 2.67085 18.9875 4.01251C20.3292 5.35418 21 7.01668 21 9.00001H19C19 7.58335 18.5208 6.39585 17.5625 5.43751C16.6042 4.47918 15.4167 4.00001 14 4.00001C12.5833 4.00001 11.3958 4.47918 10.4375 5.43751C9.47917 6.39585 9 7.58335 9 9.00001C9 10.1333 9.225 11.1 9.675 11.9C10.125 12.7 10.7667 13.4167 11.6 14.05C12.4667 14.6833 13.1417 15.3 13.625 15.9C14.1083 16.5 14.4667 17.15 14.7 17.85C14.9333 18.5833 15.2125 19.125 15.5375 19.475C15.8625 19.825 16.35 20 17 20C17.55 20 18.0208 19.8042 18.4125 19.4125C18.8042 19.0208 19 18.55 19 18H21C21 19.1 20.6083 20.0417 19.825 20.825C19.0417 21.6083 18.1 22 17 22ZM6.2 16.75C5.21667 15.75 4.4375 14.5875 3.8625 13.2625C3.2875 11.9375 3 10.5167 3 9.00001C3 7.46668 3.2875 6.03335 3.8625 4.70001C4.4375 3.36668 5.21667 2.20001 6.2 1.20001L7.65 2.60001C6.81667 3.43335 6.16667 4.39585 5.7 5.48751C5.23333 6.57918 5 7.75001 5 9.00001C5 10.2333 5.23333 11.3917 5.7 12.475C6.16667 13.5583 6.81667 14.5167 7.65 15.35L6.2 16.75ZM14 11.5C13.3 11.5 12.7083 11.2542 12.225 10.7625C11.7417 10.2708 11.5 9.68335 11.5 9.00001C11.5 8.30001 11.7417 7.70835 12.225 7.22501C12.7083 6.74168 13.3 6.50001 14 6.50001C14.7 6.50001 15.2917 6.74168 15.775 7.22501C16.2583 7.70835 16.5 8.30001 16.5 9.00001C16.5 9.68335 16.2583 10.2708 15.775 10.7625C15.2917 11.2542 14.7 11.5 14 11.5Z\" />\n ),\n image_not_supported: (\n <path d=\"M21.9,21.9l-8.49-8.49l0,0L3.59,3.59l0,0L2.1,2.1L0.69,3.51L3,5.83V19c0,1.1,0.9,2,2,2h13.17l2.31,2.31L21.9,21.9z M5,18 l3.5-4.5l2.5,3.01L12.17,15l3,3H5z M21,18.17L5.83,3H19c1.1,0,2,0.9,2,2V18.17z\" />\n ),\n info_outline: (\n <path d=\"M11 17H13V11H11V17ZM12 9C12.2833 9 12.521 8.904 12.713 8.712C12.9043 8.52067 13 8.28333 13 8C13 7.71667 12.9043 7.479 12.713 7.287C12.521 7.09567 12.2833 7 12 7C11.7167 7 11.4793 7.09567 11.288 7.287C11.096 7.479 11 7.71667 11 8C11 8.28333 11.096 8.52067 11.288 8.712C11.4793 8.904 11.7167 9 12 9ZM12 22C10.6167 22 9.31667 21.7373 8.1 21.212C6.88333 20.6873 5.825 19.975 4.925 19.075C4.025 18.175 3.31267 17.1167 2.788 15.9C2.26267 14.6833 2 13.3833 2 12C2 10.6167 2.26267 9.31667 2.788 8.1C3.31267 6.88333 4.025 5.825 4.925 4.925C5.825 4.025 6.88333 3.31233 8.1 2.787C9.31667 2.26233 10.6167 2 12 2C13.3833 2 14.6833 2.26233 15.9 2.787C17.1167 3.31233 18.175 4.025 19.075 4.925C19.975 5.825 20.6873 6.88333 21.212 8.1C21.7373 9.31667 22 10.6167 22 12C22 13.3833 21.7373 14.6833 21.212 15.9C20.6873 17.1167 19.975 18.175 19.075 19.075C18.175 19.975 17.1167 20.6873 15.9 21.212C14.6833 21.7373 13.3833 22 12 22ZM12 20C14.2167 20 16.1043 19.221 17.663 17.663C19.221 16.1043 20 14.2167 20 12C20 9.78333 19.221 7.89567 17.663 6.337C16.1043 4.779 14.2167 4 12 4C9.78333 4 7.896 4.779 6.338 6.337C4.77933 7.89567 4 9.78333 4 12C4 14.2167 4.77933 16.1043 6.338 17.663C7.896 19.221 9.78333 20 12 20Z\" />\n ),\n laundry: (\n <path d=\"M3.125 9L0.125 3.8L6.725 0H8C8.26667 0.8 8.58333 1.5 8.95 2.1C9.31667 2.7 10 3 11 3C12 3 12.6833 2.7 13.05 2.1C13.4167 1.5 13.7333 0.8 14 0H15.275L21.85 3.825L18.875 9L17 7.975V12.775L15.425 14.15C15.375 14.1833 15.3083 14.225 15.225 14.275C15.1417 14.325 15.0667 14.3667 15 14.4V4.575L18.125 6.3L19.125 4.55L15.3 2.325C14.9 3.14167 14.3125 3.79167 13.5375 4.275C12.7625 4.75833 11.9167 5 11 5C10.0833 5 9.2375 4.75833 8.4625 4.275C7.6875 3.79167 7.1 3.14167 6.7 2.325L2.85 4.55L3.875 6.3L7 4.575V10.5C6.65 10.5333 6.30833 10.5875 5.975 10.6625C5.64167 10.7375 5.31667 10.8417 5 10.975V7.975L3.125 9ZM3.65 16.375L2.35 14.85L4.525 13C4.90833 12.6667 5.34583 12.4125 5.8375 12.2375C6.32917 12.0625 6.84167 11.975 7.375 11.975C7.90833 11.975 8.41667 12.0625 8.9 12.2375C9.38333 12.4125 9.81667 12.6667 10.2 13L13.1 15.475C13.3 15.6417 13.5375 15.7708 13.8125 15.8625C14.0875 15.9542 14.3667 16 14.65 16C14.95 16 15.2292 15.9583 15.4875 15.875C15.7458 15.7917 15.975 15.6583 16.175 15.475L18.35 13.6L19.65 15.15L17.475 17C17.0917 17.3333 16.6583 17.5833 16.175 17.75C15.6917 17.9167 15.1833 18 14.65 18C14.1167 18 13.6042 17.9167 13.1125 17.75C12.6208 17.5833 12.1833 17.3333 11.8 17L8.9 14.525C8.7 14.3583 8.47083 14.2292 8.2125 14.1375C7.95417 14.0458 7.675 14 7.375 14C7.09167 14 6.8125 14.0458 6.5375 14.1375C6.2625 14.2292 6.025 14.3583 5.825 14.525L3.65 16.375Z\" />\n ),\n lavatory: (\n <path d=\"M5.5 22v-7.5H4V9c0-1.1.9-2 2-2h3c1.1 0 2 .9 2 2v5.5H9.5V22h-4zM18 22v-6h3l-2.54-7.63C18.18 7.55 17.42 7 16.56 7h-.12c-.86 0-1.63.55-1.9 1.37L12 16h3v6h3zM7.5 6c1.11 0 2-.89 2-2s-.89-2-2-2-2 .89-2 2 .89 2 2 2zm9 0c1.11 0 2-.89 2-2s-.89-2-2-2-2 .89-2 2 .89 2 2 2z\" />\n ),\n lie_flat_seat: (\n <path d=\"M6.16667 12.8333C6.81667 12.8333 7.45834 12.5833 7.95001 12.0833C8.91667 11.0916 8.90001 9.51659 7.91667 8.54992C7.42501 8.07492 6.79167 7.83325 6.16667 7.83325C5.51667 7.83325 4.87501 8.08325 4.38334 8.58325C3.41667 9.57492 3.43334 11.1499 4.41667 12.1166C4.90834 12.5916 5.54167 12.8333 6.16667 12.8333ZM5.57501 9.74992C5.73334 9.59159 5.94167 9.49992 6.16667 9.49992C6.38334 9.49992 6.59167 9.58325 6.75001 9.73325C7.08334 10.0583 7.08334 10.5749 6.76667 10.9083C6.60001 11.0749 6.39167 11.1666 6.16667 11.1666C5.95001 11.1666 5.74167 11.0833 5.58334 10.9333C5.25001 10.5999 5.25001 10.0833 5.57501 9.74992ZM17 7.83325H9.50001V12.8333H20.3333V11.1666C20.3333 9.32492 18.8417 7.83325 17 7.83325ZM11.1667 11.1666V9.49992H17C17.9167 9.49992 18.6667 10.2499 18.6667 11.1666H11.1667ZM3.66667 15.3333H8.66667V16.9999H15.3333V15.3333H20.3333V13.6666H3.66667V15.3333Z\" />\n ),\n local_bar: (\n <path d=\"M6 21V19H11V14L3 5V3H21V5L13 14V19H18V21H6ZM7.45 7H16.55L18.35 5H5.65L7.45 7ZM12 12.1L14.775 9H9.225L12 12.1Z\" />\n ),\n local_parking: (\n <path d=\"M6 21V3H13C14.6667 3 16.0833 3.58333 17.25 4.75C18.4167 5.91667 19 7.33333 19 9C19 10.6667 18.4167 12.0833 17.25 13.25C16.0833 14.4167 14.6667 15 13 15H10V21H6ZM10 11H13.2C13.75 11 14.2208 10.8042 14.6125 10.4125C15.0042 10.0208 15.2 9.55 15.2 9C15.2 8.45 15.0042 7.97917 14.6125 7.5875C14.2208 7.19583 13.75 7 13.2 7H10V11Z\" />\n ),\n loyalty: (\n <path d=\"M13 17.5L16.5 14C16.6833 13.8167 16.8293 13.6 16.938 13.35C17.046 13.1 17.1 12.8333 17.1 12.55C17.1 11.9833 16.9 11.5 16.5 11.1C16.1 10.7 15.6167 10.5 15.05 10.5C14.7333 10.5 14.421 10.5917 14.113 10.775C13.8043 10.9583 13.4333 11.2667 13 11.7C12.5 11.2333 12.1083 10.9167 11.825 10.75C11.5417 10.5833 11.25 10.5 10.95 10.5C10.3833 10.5 9.9 10.7 9.5 11.1C9.1 11.5 8.9 11.9833 8.9 12.55C8.9 12.8333 8.954 13.1 9.062 13.35C9.17067 13.6 9.31667 13.8167 9.5 14L13 17.5ZM12.85 22C12.5667 22 12.3 21.9457 12.05 21.837C11.8 21.729 11.5833 21.5833 11.4 21.4L2.6 12.6C2.41667 12.4167 2.271 12.2 2.163 11.95C2.05433 11.7 2 11.4333 2 11.15V4C2 3.45 2.196 2.979 2.588 2.587C2.97933 2.19567 3.45 2 4 2H11.15C11.4333 2 11.7 2.054 11.95 2.162C12.2 2.27067 12.4167 2.41667 12.6 2.6L21.4 11.425C21.7833 11.8083 21.975 12.279 21.975 12.837C21.975 13.3957 21.7833 13.8667 21.4 14.25L14.25 21.4C14.0667 21.5833 13.8543 21.729 13.613 21.837C13.371 21.9457 13.1167 22 12.85 22ZM6.5 8C6.91667 8 7.27067 7.854 7.562 7.562C7.854 7.27067 8 6.91667 8 6.5C8 6.08333 7.854 5.72933 7.562 5.438C7.27067 5.146 6.91667 5 6.5 5C6.08333 5 5.72933 5.146 5.438 5.438C5.146 5.72933 5 6.08333 5 6.5C5 6.91667 5.146 7.27067 5.438 7.562C5.72933 7.854 6.08333 8 6.5 8Z\" />\n ),\n luggage: (\n <path d=\"M7.5 19.8996C7.0664 19.8996 6.6912 19.754 6.3744 19.4628C6.0584 19.1708 5.9004 18.808 5.9004 18.3744V7.97521C5.9004 7.55841 6.0544 7.20841 6.3624 6.92521C6.6712 6.64201 7.0336 6.50041 7.4496 6.50041H9.8496V4.29961C9.8496 3.99961 9.9332 3.74161 10.1004 3.52561C10.2668 3.30881 10.4832 3.20041 10.7496 3.20041H13.2504C13.5168 3.20041 13.7332 3.30881 13.8996 3.52561C14.0668 3.74161 14.1504 3.99961 14.1504 4.29961V6.50041H16.5C16.9336 6.50041 17.3088 6.65881 17.6256 6.97561C17.9416 7.29161 18.0996 7.67481 18.0996 8.12521V18.3504C18.0996 18.7664 17.9416 19.1288 17.6256 19.4376C17.3088 19.7456 16.9336 19.8996 16.5 19.8996V20.0256C16.5 20.292 16.404 20.5168 16.212 20.7C16.0208 20.8832 15.8 20.9748 15.5496 20.9748C15.3168 20.9748 15.1044 20.8832 14.9124 20.7C14.7212 20.5168 14.6256 20.292 14.6256 20.0256V19.8996H9.3744V20.0496C9.3744 20.3 9.2828 20.5168 9.0996 20.7C8.9164 20.8832 8.6916 20.9748 8.4252 20.9748C8.1748 20.9748 7.958 20.8832 7.7748 20.7C7.5916 20.5168 7.5 20.3 7.5 20.0496V19.8996ZM10.7496 6.50041H13.2504V4.07521H10.7496V6.50041ZM7.5 18.6H16.5C16.5832 18.6 16.654 18.5708 16.7124 18.5124C16.7708 18.454 16.8 18.3832 16.8 18.3V8.10001C16.8 8.01681 16.7708 7.94601 16.7124 7.88761C16.654 7.82921 16.5832 7.80001 16.5 7.80001H7.5C7.4168 7.80001 7.346 7.82921 7.2876 7.88761C7.2292 7.94601 7.2 8.01681 7.2 8.10001V18.3C7.2 18.3832 7.2292 18.454 7.2876 18.5124C7.346 18.5708 7.4168 18.6 7.5 18.6ZM8.55 17.1504H9.45V9.24961H8.55V17.1504ZM11.55 17.1504H12.45V9.24961H11.55V17.1504ZM14.55 17.1504H15.45V9.24961H14.55V17.1504Z\" />\n ),\n meeting_room: (\n <path d=\"M3 21V19H5V3H15V4H19V19H21V21H17V6H15V21H3ZM11 13C11.2833 13 11.5208 12.9042 11.7125 12.7125C11.9042 12.5208 12 12.2833 12 12C12 11.7167 11.9042 11.4792 11.7125 11.2875C11.5208 11.0958 11.2833 11 11 11C10.7167 11 10.4792 11.0958 10.2875 11.2875C10.0958 11.4792 10 11.7167 10 12C10 12.2833 10.0958 12.5208 10.2875 12.7125C10.4792 12.9042 10.7167 13 11 13ZM7 19H13V5H7V19Z\" />\n ),\n minus: (\n <path d=\"M18 13H6c-.55 0-1-.45-1-1s.45-1 1-1h12c.55 0 1 .45 1 1s-.45 1-1 1z\" />\n ),\n no_airplane: (\n <path d=\"M14.6674 10.0001V2.66675C14.6674 1.56008 13.7741 0.666748 12.6674 0.666748C11.5607 0.666748 10.6674 1.56008 10.6674 2.66675V7.57341L21.1074 18.0134L25.3341 19.3334V16.6667L14.6674 10.0001ZM1.33407 5.02675L7.9874 11.6801L0.000732422 16.6667V19.3334L10.6674 16.0001V23.3334L8.00073 25.3334V27.3334L12.6674 26.0001L17.3341 27.3334V25.3334L14.6674 23.3334V18.3601L22.3074 26.0001L24.0007 24.3067L3.0274 3.33341L1.33407 5.02675Z\" />\n ),\n no_bag: (\n <path d=\"M16.8992 6.12037H14.9392V3.18101C14.9385 2.92148 14.8351 2.67278 14.6516 2.48926C14.4681 2.30574 14.2194 2.20234 13.9599 2.20166H10.0399C9.78034 2.20234 9.53163 2.30574 9.34811 2.48926C9.16459 2.67278 9.06119 2.92148 9.06051 3.18101V6.12037H8.20711L8.34715 6.25804L14.3973 12.0871V9.06102H15.9676V13.6L17.3022 14.8859L18.8592 16.4748V8.08037C18.8579 7.56096 18.6509 7.06322 18.2836 6.69594C17.9164 6.32867 17.4186 6.12173 16.8992 6.12037ZM5.14051 8.09559L3.77173 6.71825L5.00821 5.48945L7.16586 7.6606L13.9581 14.4953L15.8932 16.4426L19.7441 20.3175L20.2279 20.8043L18.9914 22.0331L17.635 20.6683C17.4035 20.7625 17.154 20.8126 16.8992 20.8133C16.904 20.945 16.8822 21.0763 16.8351 21.1993C16.788 21.3224 16.7166 21.4347 16.6251 21.5296C16.5336 21.6244 16.424 21.6999 16.3027 21.7514C16.1814 21.8029 16.051 21.8295 15.9192 21.8295C15.7874 21.8295 15.657 21.8029 15.5357 21.7514C15.4145 21.6999 15.3048 21.6244 15.2133 21.5296C15.1219 21.4347 15.0504 21.3224 15.0034 21.1993C14.9563 21.0763 14.9344 20.945 14.9392 20.8133H9.06051C9.06529 20.945 9.04348 21.0763 8.99638 21.1993C8.94929 21.3224 8.87787 21.4347 8.7864 21.5296C8.69492 21.6244 8.58527 21.6999 8.46399 21.7514C8.34271 21.8029 8.21229 21.8295 8.08051 21.8295C7.94874 21.8295 7.81832 21.8029 7.69703 21.7514C7.57575 21.6999 7.4661 21.6244 7.37463 21.5296C7.28316 21.4347 7.21174 21.3224 7.16464 21.1993C7.11754 21.0763 7.09573 20.945 7.10051 20.8133C6.58222 20.8119 6.08545 20.6059 5.71835 20.24C5.35126 19.8741 5.14357 19.378 5.14051 18.8597V8.09559ZM14.8632 17.8791L14.3973 17.4103V17.8791H14.8632ZM9.596 12.579V17.8791H8.03083V11.004L9.596 12.579ZM10.5302 3.67134H13.4695V6.12295H10.5302V3.67134Z\" />\n ),\n no_seat: (\n <>\n <path d=\"M25.1667 21.9733L23.4733 23.6667L2.5 2.69333L4.19333 1L7.16667 3.97333L16.5267 13.3333L19.1933 16L24.5 21.3067L25.1667 21.9733Z\" />\n <path d=\"M7.16667 24H3.16667V16H19.1933L24.5 21.3067V24H20.5V20H7.16667V24ZM27.1667 9.33333H23.1667V13.3333H27.1667V9.33333ZM4.5 9.33333H0.5V13.3333H4.5V9.33333ZM20.3333 13.3333H20.5V2.66667C20.5 1.2 19.3 0 17.8333 0H9.83333C9.05784 0 8.3569 0.335483 7.86848 0.868484L20.3333 13.3333ZM16.5267 13.3333L7.16667 3.97333V13.3333H16.5267Z\" />\n </>\n ),\n no_stroller: (\n <path d=\"M5.00002 20C4.45002 20 3.97919 19.8042 3.58752 19.4125C3.19586 19.0208 3.00002 18.55 3.00002 18C3.00002 17.45 3.19586 16.9792 3.58752 16.5875C3.97919 16.1958 4.45002 16 5.00002 16C5.55002 16 6.02086 16.1958 6.41252 16.5875C6.80419 16.9792 7.00002 17.45 7.00002 18C7.00002 18.55 6.80419 19.0208 6.41252 19.4125C6.02086 19.8042 5.55002 20 5.00002 20ZM16 12.175L14 10.175V6.64999L12.4 8.54999L10.975 7.14999L15.2 2.17499C15.5334 1.79165 15.9084 1.49999 16.325 1.29999C16.7417 1.09999 17.1834 0.999988 17.65 0.999988C18.5834 0.999988 19.375 1.32499 20.025 1.97499C20.675 2.62499 21 3.41665 21 4.34999V4.99999H19V4.34999C19 3.96665 18.8709 3.64582 18.6125 3.38749C18.3542 3.12915 18.0334 2.99999 17.65 2.99999C17.4834 2.99999 17.325 3.03332 17.175 3.09999C17.025 3.16665 16.8917 3.26665 16.775 3.39999L16 4.27499V12.175ZM14 13L15.4 14.4C15.2167 14.5833 15.0084 14.7292 14.775 14.8375C14.5417 14.9458 14.2834 15 14 15H6.42502C5.99169 15 5.68752 14.8083 5.51252 14.425C5.33752 14.0417 5.39169 13.6833 5.67502 13.35L8.37502 10.175L0.400024 2.22499L1.80002 0.799988L20.2 19.2L18.775 20.6L9.77502 11.6L8.60002 13H14ZM15 20C14.45 20 13.9792 19.8042 13.5875 19.4125C13.1959 19.0208 13 18.55 13 18C13 17.45 13.1959 16.9792 13.5875 16.5875C13.9792 16.1958 14.45 16 15 16C15.55 16 16.0209 16.1958 16.4125 16.5875C16.8042 16.9792 17 17.45 17 18C17 18.55 16.8042 19.0208 16.4125 19.4125C16.0209 19.8042 15.55 20 15 20ZM9.90002 6.07499L8.47502 4.64999L9.85002 3.04999C9.71669 3.01665 9.57502 2.99999 9.42502 2.99999H9.00002C8.66669 2.99999 8.34586 3.02499 8.03752 3.07499C7.72919 3.12499 7.41669 3.19165 7.10002 3.27499L5.52502 1.69999C6.07502 1.46665 6.64169 1.29165 7.22502 1.17499C7.80836 1.05832 8.40002 0.999988 9.00002 0.999988C9.75002 0.999988 10.4875 1.09165 11.2125 1.27499C11.9375 1.45832 12.6334 1.73332 13.3 2.09999L9.90002 6.07499Z\" />\n ),\n north_east: (\n <path d=\"M4.69999 19.3C4.51665 19.1167 4.42499 18.8833 4.42499 18.6C4.42499 18.3167 4.51665 18.0833 4.69999 17.9L15.6 7H9.99999C9.71665 7 9.47915 6.90417 9.28749 6.7125C9.09582 6.52083 8.99999 6.28333 8.99999 6C8.99999 5.71667 9.09582 5.47917 9.28749 5.2875C9.47915 5.09583 9.71665 5 9.99999 5H18C18.2833 5 18.5208 5.09583 18.7125 5.2875C18.9042 5.47917 19 5.71667 19 6V14C19 14.2833 18.9042 14.5208 18.7125 14.7125C18.5208 14.9042 18.2833 15 18 15C17.7167 15 17.4792 14.9042 17.2875 14.7125C17.0958 14.5208 17 14.2833 17 14V8.4L6.09999 19.3C5.91665 19.4833 5.68332 19.575 5.39999 19.575C5.11665 19.575 4.88332 19.4833 4.69999 19.3Z\" />\n ),\n pet_supplies: (\n <path d=\"M9.5 22C8.51667 22 7.6875 21.6625 7.0125 20.9875C6.3375 20.3125 6 19.4833 6 18.5C6 18.35 6.02083 18.2333 6.0625 18.15C6.10417 18.0667 6.1 18 6.05 17.95C6 17.9 5.93333 17.8958 5.85 17.9375C5.76667 17.9792 5.65 18 5.5 18C4.51667 18 3.6875 17.6625 3.0125 16.9875C2.3375 16.3125 2 15.4833 2 14.5C2 13.5167 2.3375 12.6875 3.0125 12.0125C3.6875 11.3375 4.51667 11 5.5 11C5.88333 11 6.23333 11.05 6.55 11.15C6.86667 11.25 7.16667 11.4 7.45 11.6L11.6 7.45C11.4 7.16667 11.25 6.86667 11.15 6.55C11.05 6.23333 11 5.88333 11 5.5C11 4.51667 11.3375 3.6875 12.0125 3.0125C12.6875 2.3375 13.5167 2 14.5 2C15.4833 2 16.3125 2.3375 16.9875 3.0125C17.6625 3.6875 18 4.51667 18 5.5C18 5.65 17.9792 5.76667 17.9375 5.85C17.8958 5.93333 17.9 6 17.95 6.05C18 6.1 18.0667 6.10417 18.15 6.0625C18.2333 6.02083 18.35 6 18.5 6C19.4833 6 20.3125 6.3375 20.9875 7.0125C21.6625 7.6875 22 8.51667 22 9.5C22 10.4833 21.6625 11.3125 20.9875 11.9875C20.3125 12.6625 19.4833 13 18.5 13C18.1167 13 17.7667 12.95 17.45 12.85C17.1333 12.75 16.8333 12.6 16.55 12.4L12.4 16.55C12.6 16.8333 12.75 17.1333 12.85 17.45C12.95 17.7667 13 18.1167 13 18.5C13 19.4833 12.6625 20.3125 11.9875 20.9875C11.3125 21.6625 10.4833 22 9.5 22ZM9.5 20C9.93333 20 10.2917 19.8583 10.575 19.575C10.8583 19.2917 11 18.9333 11 18.5C11 18.35 10.9792 18.2042 10.9375 18.0625C10.8958 17.9208 10.8333 17.7833 10.75 17.65C10.4667 17.25 10.35 16.8208 10.4 16.3625C10.45 15.9042 10.65 15.5 11 15.15L15.15 11C15.5 10.65 15.9042 10.45 16.3625 10.4C16.8208 10.35 17.25 10.4667 17.65 10.75C17.7833 10.8333 17.9208 10.8958 18.0625 10.9375C18.2042 10.9792 18.35 11 18.5 11C18.9333 11 19.2917 10.8583 19.575 10.575C19.8583 10.2917 20 9.93333 20 9.5C20 9.06667 19.8583 8.70833 19.575 8.425C19.2917 8.14167 18.9333 8 18.5 8C17.9167 8 17.5083 7.97083 17.275 7.9125C17.0417 7.85417 16.8 7.7 16.55 7.45C16.3 7.2 16.1458 6.95833 16.0875 6.725C16.0292 6.49167 16 6.08333 16 5.5C16 5.06667 15.8583 4.70833 15.575 4.425C15.2917 4.14167 14.9333 4 14.5 4C14.0667 4 13.7083 4.14167 13.425 4.425C13.1417 4.70833 13 5.06667 13 5.5C13 5.68333 13.0167 5.8375 13.05 5.9625C13.0833 6.0875 13.15 6.21667 13.25 6.35C13.5333 6.75 13.65 7.17917 13.6 7.6375C13.55 8.09583 13.35 8.5 13 8.85L8.85 13C8.5 13.35 8.09583 13.55 7.6375 13.6C7.17917 13.65 6.75 13.5333 6.35 13.25C6.21667 13.1667 6.07917 13.1042 5.9375 13.0625C5.79583 13.0208 5.65 13 5.5 13C5.06667 13 4.70833 13.1417 4.425 13.425C4.14167 13.7083 4 14.0667 4 14.5C4 14.9333 4.14167 15.2917 4.425 15.575C4.70833 15.8583 5.06667 16 5.5 16C6.08333 16 6.49167 16.0292 6.725 16.0875C6.95833 16.1458 7.2 16.3 7.45 16.55C7.7 16.8 7.85417 17.0417 7.9125 17.275C7.97083 17.5083 8 17.9167 8 18.5C8 18.9333 8.14167 19.2917 8.425 19.575C8.70833 19.8583 9.06667 20 9.5 20Z\" />\n ),\n pool: (\n <path d=\"M2 21V19C2.63333 19 3.10833 18.8333 3.425 18.5C3.74167 18.1667 4.36667 18 5.3 18C6.23333 18 6.875 18.1667 7.225 18.5C7.575 18.8333 8.05 19 8.65 19C9.25 19 9.725 18.8333 10.075 18.5C10.425 18.1667 11.0667 18 12 18C12.9333 18 13.575 18.1667 13.925 18.5C14.275 18.8333 14.75 19 15.35 19C15.95 19 16.425 18.8333 16.775 18.5C17.125 18.1667 17.7667 18 18.7 18C19.6333 18 20.2583 18.1667 20.575 18.5C20.8917 18.8333 21.3667 19 22 19V21C21.0167 21 20.3708 20.8333 20.0625 20.5C19.7542 20.1667 19.3 20 18.7 20C18.1 20 17.625 20.1667 17.275 20.5C16.925 20.8333 16.2833 21 15.35 21C14.4167 21 13.775 20.8333 13.425 20.5C13.075 20.1667 12.6 20 12 20C11.4 20 10.925 20.1667 10.575 20.5C10.225 20.8333 9.58333 21 8.65 21C7.71667 21 7.075 20.8333 6.725 20.5C6.375 20.1667 5.9 20 5.3 20C4.7 20 4.24583 20.1667 3.9375 20.5C3.62917 20.8333 2.98333 21 2 21ZM2 16.5V14.5C2.63333 14.5 3.10833 14.3333 3.425 14C3.74167 13.6667 4.36667 13.5 5.3 13.5C6.23333 13.5 6.87917 13.6667 7.2375 14C7.59583 14.3333 8.06667 14.5 8.65 14.5C9.25 14.5 9.725 14.3333 10.075 14C10.425 13.6667 11.0667 13.5 12 13.5C12.9333 13.5 13.575 13.6667 13.925 14C14.275 14.3333 14.75 14.5 15.35 14.5C15.95 14.5 16.425 14.3333 16.775 14C17.125 13.6667 17.7667 13.5 18.7 13.5C19.6333 13.5 20.2583 13.6667 20.575 14C20.8917 14.3333 21.3667 14.5 22 14.5V16.5C21.0167 16.5 20.3708 16.3333 20.0625 16C19.7542 15.6667 19.3 15.5 18.7 15.5C18.1 15.5 17.6375 15.6667 17.3125 16C16.9875 16.3333 16.3333 16.5 15.35 16.5C14.4 16.5 13.7542 16.3333 13.4125 16C13.0708 15.6667 12.6 15.5 12 15.5C11.3667 15.5 10.8958 15.6667 10.5875 16C10.2792 16.3333 9.63333 16.5 8.65 16.5C7.66667 16.5 7.0125 16.3333 6.6875 16C6.3625 15.6667 5.9 15.5 5.3 15.5C4.7 15.5 4.24583 15.6667 3.9375 16C3.62917 16.3333 2.98333 16.5 2 16.5ZM6.9 11.4L10.225 8.075L9.225 7.075C8.675 6.525 8.09167 6.125 7.475 5.875C6.85833 5.625 6.1 5.5 5.2 5.5V3C6.45 3 7.48333 3.1375 8.3 3.4125C9.11667 3.6875 9.91667 4.21667 10.7 5L17.1 11.4C16.8167 11.5833 16.5417 11.7292 16.275 11.8375C16.0083 11.9458 15.7 12 15.35 12C14.75 12 14.275 11.8333 13.925 11.5C13.575 11.1667 12.9333 11 12 11C11.0667 11 10.425 11.1667 10.075 11.5C9.725 11.8333 9.25 12 8.65 12C8.3 12 7.99167 11.9458 7.725 11.8375C7.45833 11.7292 7.18333 11.5833 6.9 11.4ZM16.7 3C17.4 3 17.9917 3.24583 18.475 3.7375C18.9583 4.22917 19.2 4.81667 19.2 5.5C19.2 6.2 18.9583 6.79167 18.475 7.275C17.9917 7.75833 17.4 8 16.7 8C16 8 15.4083 7.75833 14.925 7.275C14.4417 6.79167 14.2 6.2 14.2 5.5C14.2 4.81667 14.4417 4.22917 14.925 3.7375C15.4083 3.24583 16 3 16.7 3Z\" />\n ),\n refund: (\n <path d=\"M12 22.2996C10.0336 22.2996 8.25039 21.804 6.65039 20.8128C5.05039 19.8208 3.81679 18.4916 2.94959 16.8252V20.1504H1.64999V14.6496H7.14959V15.9504H3.95039C4.68319 17.4832 5.77039 18.708 7.21199 19.6248C8.65359 20.5416 10.2496 21 12 21C13.2168 21 14.3628 20.7752 15.438 20.3256C16.5124 19.8752 17.454 19.2584 18.2628 18.4752C19.0708 17.692 19.7164 16.7668 20.1996 15.6996C20.6836 14.6332 20.9504 13.4832 21 12.2496H22.2996C22.2668 13.6496 21.9712 14.958 21.4128 16.1748C20.8544 17.3916 20.1168 18.454 19.2 19.362C18.2832 20.2708 17.208 20.9876 15.9744 21.5124C14.7416 22.0372 13.4168 22.2996 12 22.2996ZM11.3748 18.3996V17.25C11.0748 17.1836 10.6164 16.992 9.99959 16.6752C9.38279 16.3584 8.90799 15.7084 8.57519 14.7252L9.77519 14.1996C9.84159 14.2668 10.0332 14.6044 10.35 15.2124C10.6668 15.8212 11.2668 16.1256 12.15 16.1256C12.6004 16.1256 13.0588 15.992 13.5252 15.7248C13.9916 15.4584 14.2248 15.0168 14.2248 14.4C14.2248 13.9168 14.0664 13.5336 13.7496 13.2504C13.4328 12.9672 12.8912 12.6836 12.1248 12.3996C11.5584 12.1996 10.8836 11.908 10.1004 11.5248C9.31719 11.1416 8.92559 10.4248 8.92559 9.37439C8.92559 9.35839 9.02959 8.97959 9.23759 8.23799C9.44559 7.49639 10.1664 7.00039 11.4 6.74999V5.60039H12.6504V6.72479C13.5 6.87519 14.0956 7.17959 14.4372 7.63799C14.7788 8.09639 14.9912 8.40879 15.0744 8.57519L13.9752 9.05039C13.892 8.89999 13.7044 8.66239 13.4124 8.33759C13.1204 8.01279 12.6744 7.85039 12.0744 7.85039C11.708 7.85039 11.3 7.97119 10.8504 8.21279C10.4 8.45439 10.1748 8.83359 10.1748 9.35039C10.1748 9.83359 10.3624 10.2 10.7376 10.4496C11.1128 10.7 11.7504 10.9752 12.6504 11.2752C13.7672 11.6584 14.5172 12.1084 14.9004 12.6252C15.2836 13.142 15.4752 13.7336 15.4752 14.4C15.4752 15.0168 15.346 15.5128 15.0876 15.888C14.8292 16.2624 14.5332 16.554 14.1996 16.7628C13.8668 16.9708 13.546 17.108 13.2372 17.1744C12.9292 17.2416 12.7252 17.2752 12.6252 17.2752V18.3996H11.3748ZM1.70039 11.7504C1.74999 10.3168 2.05399 8.98759 2.61239 7.76279C3.17079 6.53799 3.91679 5.47519 4.85039 4.57439C5.78319 3.67519 6.86239 2.97119 8.08799 2.46239C9.31279 1.95439 10.6168 1.70039 12 1.70039C13.9504 1.70039 15.7336 2.19599 17.3496 3.18719C18.9664 4.17919 20.2 5.52519 21.0504 7.22519V3.84959H22.35V9.35039H16.8504V8.04959H20.0496C19.3328 6.54959 18.2536 5.33319 16.812 4.40039C15.3704 3.46679 13.7664 2.99999 12 2.99999C10.8 2.99999 9.66679 3.22479 8.60039 3.67439C7.53319 4.12479 6.59119 4.73759 5.77439 5.51279C4.95839 6.28719 4.30439 7.20799 3.81239 8.27519C3.32039 9.34159 3.04959 10.5 2.99999 11.7504H1.70039Z\" />\n ),\n restaurant: (\n <path d=\"M7 22V12.85C6.15 12.6167 5.4375 12.15 4.8625 11.45C4.2875 10.75 4 9.93333 4 9V2H6V9H7V2H9V9H10V2H12V9C12 9.93333 11.7125 10.75 11.1375 11.45C10.5625 12.15 9.85 12.6167 9 12.85V22H7ZM17 22V14H14V7C14 5.61667 14.4875 4.4375 15.4625 3.4625C16.4375 2.4875 17.6167 2 19 2V22H17Z\" />\n ),\n room_service: (\n <path d=\"M2 19V17H22V19H2ZM3 16V15C3 12.8667 3.65417 10.9833 4.9625 9.35C6.27083 7.71667 7.95 6.68333 10 6.25V6C10 5.45 10.1958 4.97917 10.5875 4.5875C10.9792 4.19583 11.45 4 12 4C12.55 4 13.0208 4.19583 13.4125 4.5875C13.8042 4.97917 14 5.45 14 6V6.25C16.0667 6.68333 17.75 7.71667 19.05 9.35C20.35 10.9833 21 12.8667 21 15V16H3ZM5.05 14H18.95C18.7167 12.2667 17.9417 10.8333 16.625 9.7C15.3083 8.56667 13.7667 8 12 8C10.2333 8 8.69583 8.56667 7.3875 9.7C6.07917 10.8333 5.3 12.2667 5.05 14Z\" />\n ),\n seat: (\n <path d=\"M7.59 5.41012C6.81 4.63012 6.81 3.36012 7.59 2.58012C8.37 1.80012 9.64 1.80012 10.42 2.58012C11.2 3.36012 11.2 4.63012 10.42 5.41012C9.63 6.20012 8.37 6.20012 7.59 5.41012ZM6 16.0001V8.00012C6 7.45012 5.55 7.00012 5 7.00012C4.45 7.00012 4 7.45012 4 8.00012V16.0001C4 18.7601 6.24 21.0001 9 21.0001H14C14.55 21.0001 15 20.5501 15 20.0001C15 19.4501 14.55 19.0001 14 19.0001H9C7.34 19.0001 6 17.6601 6 16.0001ZM19.28 19.3501L15.51 15.5801C15.14 15.2101 14.63 15.0001 14.1 15.0001H11.5V11.3201C12.59 12.2101 14.16 13.0201 15.7 13.3401C16.37 13.4801 17 12.9801 17 12.3001C17 11.7701 16.61 11.3401 16.08 11.2501C14.66 11.0101 13.2 10.2401 12.33 9.28012L10.93 7.73012C10.74 7.52012 10.5 7.35012 10.24 7.23012C9.95 7.09012 9.62 7.00012 9.28 7.00012H9.25C8.01 7.00012 7 8.01012 7 9.25012V15.0001C7 16.6601 8.34 18.0001 10 18.0001H15.07L17.85 20.7801C18.24 21.1701 18.89 21.1701 19.28 20.7801C19.68 20.3901 19.68 19.7501 19.28 19.3501Z\" />\n ),\n seat_paid_indicator: (\n <path d=\"M11.7686 0.731368C12.7766 -0.276576 14.5 0.437294 14.5 1.86274V10.8C14.5 12.5673 13.0673 14 11.3 14H2.36274C0.937294 14 0.223427 12.2766 1.23137 11.2686L11.7686 0.731368Z\" />\n ),\n shield_with_moon: (\n <path d=\"M12.525 15.75C13.0814 15.75 13.6269 15.6408 14.1615 15.4222C14.6961 15.2036 15.166 14.8757 15.5711 14.4385C15.6749 14.3244 15.7032 14.2033 15.6557 14.0751C15.6083 13.9469 15.5077 13.8629 15.3538 13.8232C14.7269 13.6783 14.1477 13.4183 13.6163 13.0433C13.0849 12.6683 12.6474 12.1789 12.3038 11.5751C11.9769 11.0046 11.7682 10.393 11.6778 9.74048C11.5874 9.08791 11.6589 8.45458 11.8923 7.84048C11.9525 7.68663 11.9301 7.55586 11.8249 7.44817C11.7198 7.34049 11.5916 7.30332 11.4403 7.33665C10.4442 7.59177 9.65927 8.1142 9.08555 8.90395C8.51185 9.69368 8.225 10.5591 8.225 11.5001C8.225 12.6796 8.64519 13.6828 9.48558 14.5097C10.3259 15.3366 11.3391 15.75 12.525 15.75ZM12 21.4808C9.83716 20.8911 8.04646 19.618 6.62787 17.6616C5.20929 15.7052 4.5 13.518 4.5 11.1001V5.34625L12 2.53857L19.5 5.34625V11.1001C19.5 13.518 18.7907 15.7052 17.3721 17.6616C15.9535 19.618 14.1628 20.8911 12 21.4808ZM12 19.9001C13.7333 19.3501 15.1666 18.2501 16.3 16.6001C17.4333 14.9501 18 13.1167 18 11.1001V6.37507L12 4.1347L5.99997 6.37507V11.1001C5.99997 13.1167 6.56664 14.9501 7.69997 16.6001C8.83331 18.2501 10.2666 19.3501 12 19.9001Z\" />\n ),\n shopfront: (\n <path d=\"M3.44169 24C2.85311 24 2.35274 23.7684 1.94056 23.3051C1.52836 22.8419 1.32226 22.2796 1.32226 21.6181V10.5823C0.799276 10.1582 0.418175 9.57007 0.178961 8.81775C-0.0602524 8.06547 -0.0596523 7.26924 0.180762 6.42907L1.41133 1.89967C1.57544 1.33001 1.85381 0.870996 2.24645 0.522611C2.63907 0.174204 3.10812 0 3.6536 0H20.3251C20.8669 0 21.3336 0.165285 21.7251 0.495852C22.1166 0.826396 22.3988 1.28552 22.5716 1.87322L23.8192 6.42907C24.0597 7.27089 24.0603 8.06664 23.821 8.81632C23.5818 9.56601 23.2007 10.1636 22.6777 10.6091V21.6181C22.6777 22.2796 22.4716 22.8419 22.0594 23.3051C21.6473 23.7684 21.1469 24 20.5583 24H3.44169ZM14.6927 9.6564C15.3887 9.6564 15.9059 9.42334 16.2443 8.95724C16.5826 8.49116 16.7207 7.99064 16.6586 7.45566L15.9135 1.95246H12.8687V7.43686C12.8687 8.03356 13.0477 8.55266 13.4057 8.99416C13.7636 9.43565 14.1927 9.6564 14.6927 9.6564ZM9.18021 9.6564C9.7573 9.6564 10.2268 9.43565 10.5886 8.99416C10.9504 8.55266 11.1313 8.03356 11.1313 7.43686V1.95246H8.08649L7.34736 7.50932C7.28687 7.99331 7.42697 8.47215 7.76768 8.94583C8.1084 9.41954 8.57924 9.6564 9.18021 9.6564ZM3.73063 9.6564C4.20349 9.6564 4.60648 9.47284 4.93962 9.10573C5.27276 8.73862 5.47833 8.2794 5.55633 7.72805L6.30263 1.95246H3.59092C3.45559 1.95246 3.34713 1.986 3.26554 2.05308C3.18393 2.12018 3.12521 2.22084 3.08939 2.35505L1.87984 6.86788C1.69913 7.53078 1.77793 8.16126 2.11624 8.75931C2.45458 9.35737 2.9927 9.6564 3.73063 9.6564ZM20.2694 9.6564C20.9412 9.6564 21.468 9.37101 21.8497 8.80024C22.2314 8.22947 22.3216 7.58535 22.1202 6.86788L20.8796 2.32822C20.8397 2.19401 20.779 2.09783 20.6975 2.03968C20.6159 1.98153 20.5094 1.95246 20.378 1.95246H17.7033L18.4425 7.72805C18.5213 8.27377 18.7272 8.73159 19.0604 9.10151C19.3935 9.47143 19.7965 9.6564 20.2694 9.6564ZM3.44169 22.0476H20.5583C20.6698 22.0476 20.7613 22.0073 20.833 21.9268C20.9046 21.8463 20.9404 21.7434 20.9404 21.6181V11.4961C20.8115 11.5444 20.6943 11.5753 20.5888 11.5887C20.4833 11.6021 20.3768 11.6088 20.2692 11.6088C19.7168 11.6088 19.2309 11.4952 18.8115 11.268C18.3921 11.0407 17.9909 10.6766 17.6079 10.1757C17.2727 10.6122 16.8688 10.9602 16.396 11.2197C15.9233 11.4791 15.3839 11.6088 14.7778 11.6088C14.2565 11.6088 13.7684 11.4858 13.3134 11.2398C12.8585 10.9938 12.4249 10.6391 12.0125 10.1757C11.6288 10.6391 11.1942 10.9938 10.7086 11.2398C10.2231 11.4858 9.73901 11.6088 9.25649 11.6088C8.71371 11.6088 8.19715 11.4995 7.7068 11.2807C7.21646 11.062 6.78501 10.6936 6.41247 10.1757C5.87752 10.7768 5.39472 11.166 4.96408 11.3431C4.53342 11.5203 4.12242 11.6088 3.73106 11.6088C3.62182 11.6088 3.51006 11.6021 3.39577 11.5887C3.28149 11.5753 3.16941 11.5444 3.05955 11.4961V21.6181C3.05955 21.7434 3.09538 21.8463 3.16703 21.9268C3.23868 22.0073 3.33024 22.0476 3.44169 22.0476Z\" />\n ),\n shopping_bag: (\n <path d=\"M6.9 21.0996C6.4504 21.0996 6.0712 20.9456 5.7624 20.6376C5.4544 20.3288 5.3004 19.9496 5.3004 19.5V8.7C5.3004 8.2504 5.4544 7.8712 5.7624 7.5624C6.0712 7.2544 6.4504 7.1004 6.9 7.1004H8.6496V6.45C8.6496 5.5332 8.9456 4.7248 9.5376 4.0248C10.1296 3.3248 10.8836 2.95 11.7996 2.9004C12.7828 2.85 13.6204 3.154 14.3124 3.8124C15.0044 4.4708 15.3504 5.2832 15.3504 6.2496V7.1004H17.1C17.5496 7.1004 17.9288 7.2544 18.2376 7.5624C18.5456 7.8712 18.6996 8.2504 18.6996 8.7V19.5C18.6996 19.9496 18.5456 20.3288 18.2376 20.6376C17.9288 20.9456 17.5496 21.0996 17.1 21.0996H6.9ZM6.9 19.8H17.1C17.1664 19.8 17.2332 19.7668 17.3004 19.7004C17.3668 19.6332 17.4 19.5664 17.4 19.5V8.7C17.4 8.6336 17.3668 8.5668 17.3004 8.4996C17.2332 8.4332 17.1664 8.4 17.1 8.4H15.3504V10.1496C15.3504 10.3336 15.2876 10.488 15.162 10.6128C15.0372 10.7376 14.8832 10.8 14.7 10.8C14.5168 10.8 14.3628 10.7376 14.238 10.6128C14.1124 10.488 14.0496 10.3336 14.0496 10.1496V8.4H9.9504V10.1496C9.9504 10.3336 9.8876 10.488 9.762 10.6128C9.6372 10.7376 9.4832 10.8 9.3 10.8C9.1168 10.8 8.9628 10.7376 8.838 10.6128C8.7124 10.488 8.6496 10.3336 8.6496 10.1496V8.4H6.9C6.8336 8.4 6.7668 8.4332 6.6996 8.4996C6.6332 8.5668 6.6 8.6336 6.6 8.7V19.5C6.6 19.5664 6.6332 19.6332 6.6996 19.7004C6.7668 19.7668 6.8336 19.8 6.9 19.8ZM9.9504 7.1004H14.0496V6.2496C14.0496 5.6832 13.8496 5.2 13.4496 4.8C13.0496 4.4 12.5664 4.2 12 4.2C11.4168 4.2 10.9292 4.4 10.5372 4.8C10.146 5.2 9.9504 5.6832 9.9504 6.2496V7.1004Z\" />\n ),\n spa: (\n <path d=\"M12 22C10.7833 21.85 9.575 21.5208 8.375 21.0125C7.175 20.5042 6.10417 19.775 5.1625 18.825C4.22083 17.875 3.45833 16.675 2.875 15.225C2.29167 13.775 2 12.0333 2 10V9H3C3.85 9 4.725 9.10833 5.625 9.325C6.525 9.54167 7.36667 9.86667 8.15 10.3C8.35 8.86667 8.80417 7.39583 9.5125 5.8875C10.2208 4.37917 11.05 3.08333 12 2C12.95 3.08333 13.7792 4.37917 14.4875 5.8875C15.1958 7.39583 15.65 8.86667 15.85 10.3C16.6333 9.86667 17.475 9.54167 18.375 9.325C19.275 9.10833 20.15 9 21 9H22V10C22 12.0333 21.7083 13.775 21.125 15.225C20.5417 16.675 19.7792 17.875 18.8375 18.825C17.8958 19.775 16.8292 20.5042 15.6375 21.0125C14.4458 21.5208 13.2333 21.85 12 22ZM11.95 19.95C11.7667 17.1833 10.9458 15.0917 9.4875 13.675C8.02917 12.2583 6.21667 11.3833 4.05 11.05C4.23333 13.9 5.07917 16.025 6.5875 17.425C8.09583 18.825 9.88333 19.6667 11.95 19.95ZM12 13.6C12.25 13.2333 12.5542 12.8542 12.9125 12.4625C13.2708 12.0708 13.6167 11.7333 13.95 11.45C13.9167 10.5 13.7292 9.50833 13.3875 8.475C13.0458 7.44167 12.5833 6.43333 12 5.45C11.4167 6.43333 10.9542 7.44167 10.6125 8.475C10.2708 9.50833 10.0833 10.5 10.05 11.45C10.3833 11.7333 10.7333 12.0708 11.1 12.4625C11.4667 12.8542 11.7667 13.2333 12 13.6ZM13.95 19.5C14.5667 19.3 15.2083 19.0083 15.875 18.625C16.5417 18.2417 17.1625 17.7208 17.7375 17.0625C18.3125 16.4042 18.8042 15.5833 19.2125 14.6C19.6208 13.6167 19.8667 12.4333 19.95 11.05C18.3833 11.2833 17.0083 11.8042 15.825 12.6125C14.6417 13.4208 13.7333 14.45 13.1 15.7C13.3 16.2333 13.4708 16.8167 13.6125 17.45C13.7542 18.0833 13.8667 18.7667 13.95 19.5Z\" />\n ),\n stairs: (\n <path d=\"M19,3H5C3.9,3,3,3.9,3,5v14c0,1.1,0.9,2,2,2h14c1.1,0,2-0.9,2-2V5C21,3.9,20.1,3,19,3z M18,8h-2.42v3.33H13v3.33h-2.58 V18H6v-2h2.42v-3.33H11V9.33h2.58V6H18V8z\" />\n ),\n star: (\n <path d=\"M5.825 22L8.15 14.4L2 10H9.6L12 2L14.4 10H22L15.85 14.4L18.175 22L12 17.3L5.825 22Z\" />\n ),\n unfold_more: (\n <path d=\"M12 20.0256L8.2752 16.2996L9.1752 15.3996L12 18.2256L14.8248 15.3996L15.7248 16.2996L12 20.0256ZM9.1752 8.55L8.2752 7.65L12 3.9252L15.7248 7.65L14.8248 8.55L12 5.7504L9.1752 8.55Z\" />\n ),\n wallet: (\n <path d=\"M5 21C4.45 21 3.97917 20.8042 3.5875 20.4125C3.19583 20.0208 3 19.55 3 19V5C3 4.45 3.19583 3.97917 3.5875 3.5875C3.97917 3.19583 4.45 3 5 3H19C19.55 3 20.0208 3.19583 20.4125 3.5875C20.8042 3.97917 21 4.45 21 5V7.5H19V5H5V19H19V16.5H21V19C21 19.55 20.8042 20.0208 20.4125 20.4125C20.0208 20.8042 19.55 21 19 21H5ZM13 17C12.45 17 11.9792 16.8042 11.5875 16.4125C11.1958 16.0208 11 15.55 11 15V9C11 8.45 11.1958 7.97917 11.5875 7.5875C11.9792 7.19583 12.45 7 13 7H20C20.55 7 21.0208 7.19583 21.4125 7.5875C21.8042 7.97917 22 8.45 22 9V15C22 15.55 21.8042 16.0208 21.4125 16.4125C21.0208 16.8042 20.55 17 20 17H13ZM20 15V9H13V15H20ZM16 13.5C16.4167 13.5 16.7708 13.3542 17.0625 13.0625C17.3542 12.7708 17.5 12.4167 17.5 12C17.5 11.5833 17.3542 11.2292 17.0625 10.9375C16.7708 10.6458 16.4167 10.5 16 10.5C15.5833 10.5 15.2292 10.6458 14.9375 10.9375C14.6458 11.2292 14.5 11.5833 14.5 12C14.5 12.4167 14.6458 12.7708 14.9375 13.0625C15.2292 13.3542 15.5833 13.5 16 13.5Z\" />\n ),\n warning: (\n <path d=\"M20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12ZM8.21071 9.25592L10.9548 12L8.21071 14.7441L9.38922 15.9226L12.1333 13.1785L14.8774 15.9226L16.0559 14.7441L13.3118 12L16.0559 9.25592L14.8774 8.07741L12.1333 10.8215L9.38922 8.07741L8.21071 9.25592Z\" />\n ),\n wifi: (\n <path d=\"M2.83333 9.50005L4.49999 11.1667C8.64166 7.02505 15.3583 7.02505 19.5 11.1667L21.1667 9.50005C16.1083 4.44172 7.89999 4.44172 2.83333 9.50005ZM9.49999 16.1667L12 18.6667L14.5 16.1667C13.125 14.7834 10.8833 14.7834 9.49999 16.1667ZM6.16666 12.8334L7.83333 14.5C10.1333 12.2 13.8667 12.2 16.1667 14.5L17.8333 12.8334C14.6167 9.61672 9.39166 9.61672 6.16666 12.8334Z\" />\n ),\n};\n/* eslint-enable */\n\nexport type IconName = keyof typeof ICON_MAP;\n\nconst getIconPath = (name: IconName) => {\n if (!(name in ICON_MAP)) {\n log(`The icon \"${name}\" is missing from ICON_MAP`);\n return null;\n }\n return ICON_MAP[name];\n};\n\ninterface IconProps {\n name: IconName;\n className?: string;\n color?: Color;\n size?: number;\n onClick?: (event: React.MouseEvent<SVGSVGElement, MouseEvent>) => void;\n\n ml?: string;\n viewBox?: string;\n style?: React.CSSProperties;\n}\n\nexport const Icon: React.FunctionComponent<IconProps> = ({\n name,\n size,\n className,\n viewBox,\n color,\n style,\n}) => (\n <svg\n className={className}\n width={size || 24}\n height={size || 24}\n viewBox={viewBox || \"0 0 24 24\"}\n aria-label={name}\n data-testid={name}\n style={{\n display: \"block\",\n fill: `var(${color})` || \"currentColor\",\n ...style,\n }}\n >\n {getIconPath(name)}\n </svg>\n);\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { Icon, IconName } from \"@components/shared/Icon\";\nimport classNames from \"classnames\";\nimport * as React from \"react\";\n\nconst BUTTON_VARIANTS = {\n primary: \"button--primary\",\n outlined: \"button--outlined\",\n destructive: \"button--destructive\",\n};\ntype ButtonVariants = keyof typeof BUTTON_VARIANTS;\n\nconst BUTTON_SIZES = {\n 32: \"button--32\",\n 40: \"button--40\",\n 48: \"button--48\",\n};\n\ntype ButtonSizes = keyof typeof BUTTON_SIZES;\n\ntype NativeButtonProps = React.DetailedHTMLProps<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n>;\n\nexport interface ButtonProps\n extends Pick<\n NativeButtonProps,\n \"id\" | \"onClick\" | \"disabled\" | \"children\" | \"className\" | \"type\"\n > {\n \"data-testid\"?: string;\n iconBefore?: IconName;\n variant?: ButtonVariants;\n size?: ButtonSizes;\n}\n\nexport const Button: React.FC<ButtonProps> = ({\n iconBefore,\n variant = \"primary\",\n size = 40,\n children,\n className,\n type = \"button\",\n ...nativeButtonProps\n}) => (\n <button\n type={type}\n className={classNames(\n \"button\",\n BUTTON_VARIANTS[variant],\n BUTTON_SIZES[size],\n className,\n )}\n {...nativeButtonProps}\n >\n {iconBefore && (\n <Icon\n className=\"duffel-button__icon duffel-button__icon--before\"\n name={iconBefore}\n />\n )}\n {children}\n </button>\n);\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import React from \"react\";\n\nexport const NonIdealState: React.FC<\n React.PropsWithChildren<{ style?: React.CSSProperties }>\n> = ({ style, children }) => (\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n border: \"dashed 1px var(--GREY-300)\",\n borderRadius: \"4px\",\n paddingBlock: \"32px\",\n ...style,\n }}\n >\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n maxWidth: \"470px\",\n }}\n >\n {children}\n </div>\n </div>\n);\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import * as React from \"react\";\nimport { Button } from \"./Button\";\nimport { NonIdealState } from \"./NonIdealState\";\n\nexport const FetchOfferErrorState: React.FC<{\n height: string;\n message: string;\n}> = ({ height, message }) => (\n <NonIdealState style={{ minHeight: height }}>\n <p style={{ marginBlock: \"0\" }} className=\"p1--semibold\">\n Failed to load extras\n </p>\n <p\n className=\"p2--regular\"\n style={{\n color: \"var(--GREY-600)\",\n marginBlock: \"12px\",\n textAlign: \"center\",\n }}\n >\n {message\n ? message\n : \"Please try reloading. If the problem persists reach out to our support team.\"}\n </p>\n <div>\n <Button\n variant=\"outlined\"\n onClick={() => location.reload()}\n iconBefore=\"autorenew\"\n >\n Try again\n </Button>\n </div>\n </NonIdealState>\n);\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import * as React from \"react\";\n\nconst COMPONENT_CDN = process.env.COMPONENT_CDN || \"\";\nexport const hrefToComponentStyles = `${COMPONENT_CDN}/global.css`;\n\ntype WithComponentStylesProps = {\n children?: React.ReactNode;\n};\n\nexport const WithComponentStyles: React.FC<WithComponentStylesProps> = ({\n children,\n}) => (\n <>\n <link rel=\"stylesheet\" href={hrefToComponentStyles}></link>\n <div className=\"duffel-components\">{children}</div>\n </>\n);\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { OfferAvailableService } from \"@duffel/api/types\";\n\nexport type ServicePriceMapById = Record<\n OfferAvailableService[\"id\"],\n Pick<OfferAvailableService, \"total_amount\" | \"total_currency\">\n>;\n\nexport const getServicePriceMapById = (\n availableServices: OfferAvailableService[],\n): ServicePriceMapById =>\n availableServices.reduce(\n (all, { id, total_amount, total_currency }) => ({\n [id]: {\n total_amount,\n total_currency,\n },\n ...all,\n }),\n {} as ServicePriceMapById,\n );\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { CreateOrder, Offer, SeatMap } from \"@duffel/api/types\";\nimport { captureErrorInSentry } from \"./captureErrorInSentry\";\nimport {\n ServicePriceMapById,\n getServicePriceMapById,\n} from \"./getServicePriceMapById\";\n\nexport const getTotalAmountForServices = (\n offer: Offer,\n selectedServices: CreateOrder[\"services\"],\n seatMaps?: SeatMap[],\n): number => {\n if (!offer || !selectedServices || selectedServices.length === 0) return 0;\n const servicePriceMap = getServicePriceMapById(offer.available_services);\n return getTotalAmountForServicesWithPriceMap(\n servicePriceMap,\n selectedServices,\n seatMaps,\n );\n};\n\nexport const getTotalAmountForServicesWithPriceMap = (\n servicePriceMap: ServicePriceMapById,\n selectedServices: CreateOrder[\"services\"],\n seatMaps?: SeatMap[],\n) =>\n (selectedServices || []).reduce(\n (total, { quantity, id }) => {\n let newTotal = total;\n\n if (id in servicePriceMap) {\n newTotal += quantity * +servicePriceMap[id].total_amount;\n } else if (seatMaps) {\n newTotal += quantity * getTotalAmountFromSeatMaps(id, seatMaps);\n } else {\n captureErrorInSentry(\n new Error(\n `The service id (${id}) provided could not be found in neither the offer nor the seat maps.`,\n ),\n );\n }\n\n return newTotal;\n },\n\n 0,\n );\n\nconst getTotalAmountFromSeatMaps = (serviceId: string, seatMaps: SeatMap[]) => {\n for (const seatMap of seatMaps) {\n for (const cabin of seatMap.cabins) {\n for (const row of cabin.rows) {\n for (const section of row.sections) {\n for (const element of section.elements) {\n if (\n element.type === \"seat\" &&\n Array.isArray(element.available_services)\n ) {\n const serviceMatch = element.available_services.find(\n (service) => service.id === serviceId,\n );\n if (serviceMatch) return +serviceMatch.total_amount;\n }\n }\n }\n }\n }\n }\n return 0;\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { CreateOrder, Offer, SeatMap } from \"@duffel/api/types\";\nimport { getTotalAmountForServices } from \"./getTotalAmountForServices\";\nimport { DuffelAncillariesProps } from \"src/types\";\n\ninterface CompileCreateOrderPayloadInput {\n offer: Offer;\n passengers: DuffelAncillariesProps[\"passengers\"];\n baggageSelectedServices: CreateOrder[\"services\"];\n seatSelectedServices: CreateOrder[\"services\"];\n cfarSelectedServices: CreateOrder[\"services\"];\n seatMaps?: SeatMap[];\n}\n\nexport const compileCreateOrderPayload = ({\n baggageSelectedServices,\n seatSelectedServices,\n cfarSelectedServices,\n offer,\n seatMaps,\n passengers,\n}: CompileCreateOrderPayloadInput): Partial<CreateOrder> => {\n const selectedServicesWithInformation = [\n ...(baggageSelectedServices ? baggageSelectedServices : []),\n ...(seatSelectedServices ? seatSelectedServices : []),\n ...(cfarSelectedServices ? cfarSelectedServices : []),\n ];\n\n const totalAmountWithServices =\n +offer.total_amount +\n getTotalAmountForServices(offer, selectedServicesWithInformation, seatMaps);\n\n return {\n ...(offer && { selected_offers: [offer.id] }),\n passengers,\n services: filterServicesForPayload(selectedServicesWithInformation),\n ...(offer && {\n payments: [\n {\n type: \"balance\",\n amount: `${totalAmountWithServices}`,\n currency: offer.total_currency,\n },\n ],\n }),\n type: \"instant\",\n metadata: { source: `duffel-ancillaries@${process.env.COMPONENT_VERSION}` },\n };\n};\n\nconst filterServicesForPayload = (\n selectedServices: CreateOrder[\"services\"],\n): CreateOrder[\"services\"] => {\n if (!Array.isArray(selectedServices)) return [];\n return selectedServices\n .filter(({ quantity }) => quantity > 0)\n .map(({ id, quantity }) => ({ id, quantity }));\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import {\n DuffelAncillariesMarkup,\n DuffelAncillariesMarkupDefinition,\n DuffelAncillariesPriceFormatters,\n} from \"../types/DuffelAncillariesProps\";\n\nconst convertMarkupIntoPriceFormatter = (\n markup: DuffelAncillariesMarkupDefinition,\n) => {\n return (amount: number, currency: string) => {\n const { rate, amount: markupAmount } = markup;\n const newAmount = amount * (1 + rate) + markupAmount;\n return { amount: newAmount, currency };\n };\n};\n\nconst errorMessage =\n \"You cannot supply both markup and priceFormatters for the same service.\";\n\n/**\n * Creates price formatters from the markup and priceFormatters passed in.\n * Throws an error if both are supplied.\n * If neither are supplied, the priceFormatters will be undefined.\n *\n * @param markup The markup to be applied to the prices of the available services of an offer.\n * @param priceFormatters Price formatters to apply to the prices of the available services of an offer.\n * @returns\n */\nconst createPriceFormatters = (\n markup?: DuffelAncillariesMarkup,\n priceFormatters?: DuffelAncillariesPriceFormatters,\n): DuffelAncillariesPriceFormatters => {\n const formatters: DuffelAncillariesPriceFormatters = {};\n\n if (priceFormatters) {\n if (priceFormatters.bags) {\n formatters.bags = priceFormatters.bags;\n }\n if (priceFormatters.seats) {\n formatters.seats = priceFormatters.seats;\n }\n if (priceFormatters.cancel_for_any_reason) {\n formatters.cancel_for_any_reason = priceFormatters.cancel_for_any_reason;\n }\n }\n\n // Markup takes precedence over priceFormatters.\n if (markup) {\n if (markup.bags) {\n if (priceFormatters && priceFormatters.bags) {\n throw new Error(errorMessage);\n }\n formatters.bags = convertMarkupIntoPriceFormatter(markup.bags);\n }\n if (markup.seats) {\n if (priceFormatters && priceFormatters.seats) {\n throw new Error(errorMessage);\n }\n formatters.seats = convertMarkupIntoPriceFormatter(markup.seats);\n }\n if (markup.cancel_for_any_reason) {\n if (priceFormatters && priceFormatters.cancel_for_any_reason) {\n throw new Error(errorMessage);\n }\n formatters.cancel_for_any_reason = convertMarkupIntoPriceFormatter(\n markup.cancel_for_any_reason,\n );\n }\n }\n return formatters;\n};\n\nexport { createPriceFormatters };\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import {\n OfferAvailableService,\n OfferAvailableServiceBaggage,\n} from \"@duffel/api/types\";\n\nexport const isBaggageService = (\n service: OfferAvailableService,\n): service is OfferAvailableServiceBaggage => service.type === \"baggage\";\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import {\n OfferAvailableService,\n OfferAvailableServiceCFAR,\n} from \"@duffel/api/types\";\n\nexport const isCancelForAnyReasonService = (\n service: OfferAvailableService,\n): service is OfferAvailableServiceCFAR =>\n service.type === \"cancel_for_any_reason\";\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { Offer } from \"@duffel/api/types\";\nimport { DuffelAncillariesPriceFormatters } from \"../types/DuffelAncillariesProps\";\nimport { isBaggageService } from \"./isBaggageService\";\nimport { isCancelForAnyReasonService } from \"./isCancelForAnyReasonService\";\n\nconst multipleCurrenciesErrorMessage = (\n label: string,\n currencies: Set<string>,\n) => {\n return `${label} must all have the same currency, but they have ${\n currencies.size\n } different currencies (${[...currencies].join(\n \", \",\n )}). Check the price formatters passed into the component's render function.`;\n};\n\n/**\n * Formats the prices of the available services of an offer according to the\n * priceFormatters passed in.\n *\n * @param offer An offer from the Duffel API\n * @param priceFormatters Optional price formatting functions. If not passed in, the offer will be returned unchanged.\n * @returns An offer with the prices of its available services formatted according to the priceFormatters passed in.\n */\nconst formatAvailableServices = (\n offer: Offer,\n priceFormatters?: DuffelAncillariesPriceFormatters,\n): Offer => {\n // If no custom formatters were passed in, don't do anything.\n if (!priceFormatters) {\n return offer;\n }\n\n const availableServices = offer.available_services || [];\n\n const foundCurrencies = new Set<string>();\n\n const formatters = {\n baggage: priceFormatters?.bags,\n cancel_for_any_reason: priceFormatters?.cancel_for_any_reason,\n };\n\n const servicesWithFormattedPrices = availableServices.map((service) => {\n const serviceWithFormattedPrices = { ...service };\n\n if (service.type in formatters && formatters[service.type]) {\n let { total_amount, total_currency } = service;\n\n if (isBaggageService(service)) {\n const { amount, currency } = formatters[service.type]!(\n +service.total_amount,\n service.total_currency,\n service,\n );\n\n total_amount = amount.toString();\n if (currency) {\n total_currency = currency;\n }\n }\n\n if (isCancelForAnyReasonService(service)) {\n const { amount, currency } = formatters[service.type]!(\n +service.total_amount,\n service.total_currency,\n service,\n );\n\n total_amount = amount.toString();\n if (currency) {\n total_currency = currency;\n }\n }\n\n // Guard against different currencies being passed in for different services.\n foundCurrencies.add(total_currency);\n if (foundCurrencies.size > 1) {\n throw new Error(\n multipleCurrenciesErrorMessage(service.type, foundCurrencies),\n );\n }\n\n serviceWithFormattedPrices.total_amount = total_amount;\n serviceWithFormattedPrices.total_currency = total_currency;\n }\n return serviceWithFormattedPrices;\n });\n return { ...offer, available_services: servicesWithFormattedPrices };\n};\n\nexport { formatAvailableServices };\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import {\n SeatMapCabinRowSectionElement,\n SeatMapCabinRowSectionElementSeat,\n} from \"@duffel/api/types\";\n\nexport function isSeatElement(\n element: SeatMapCabinRowSectionElement,\n): element is SeatMapCabinRowSectionElementSeat {\n return element.type === \"seat\" || element.type === \"restricted_seat_general\";\n}\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { SeatMap, SeatMapCabinRowSectionElement } from \"@duffel/api/types\";\nimport { DuffelAncillariesPriceFormatterForSeats } from \"../types/DuffelAncillariesProps\";\nimport { isSeatElement } from \"./isSeatElement\";\n\nconst multipleCurrenciesErrorMessage = (currencies: Set<string>) => {\n return `Seats must all have the same currency, but they have ${\n currencies.size\n } different currencies (${[...currencies].join(\n \", \",\n )}). Check the price formatters passed into the component's render function.`;\n};\n\nconst formatElement = (\n element: SeatMapCabinRowSectionElement,\n priceFormatter: DuffelAncillariesPriceFormatterForSeats,\n foundCurrencies: Set<string>,\n) => {\n const formattedElement = { ...element };\n if (\n isSeatElement(formattedElement) &&\n formattedElement.available_services.length > 0\n ) {\n const formattedServices = formattedElement.available_services.map(\n (service) => {\n const formattedService = { ...service };\n const { amount, currency } = priceFormatter(\n +service.total_amount,\n service.total_currency,\n service,\n );\n\n formattedService.total_amount = amount.toString();\n\n // Guard against different currencies being passed in for different seats.\n if (currency) {\n formattedService.total_currency = currency;\n foundCurrencies.add(currency);\n if (foundCurrencies.size > 1) {\n throw new Error(multipleCurrenciesErrorMessage(foundCurrencies));\n }\n }\n\n return formattedService;\n },\n );\n formattedElement.available_services = formattedServices;\n }\n return formattedElement;\n};\n\nconst formatSeatMaps = (\n seatMaps: SeatMap[],\n priceFormatter?: DuffelAncillariesPriceFormatterForSeats,\n): SeatMap[] => {\n // If a custom formatter wasn't passed in, don't do anything.\n if (!priceFormatter) {\n return seatMaps;\n }\n\n const foundCurrencies = new Set<string>();\n\n const formattedSeatMaps: SeatMap[] = seatMaps.map((seatMap) => {\n const formattedCabins = seatMap.cabins.map((cabin) => {\n const formattedRows = cabin.rows.map((row) => {\n const formattedSections = row.sections.map((section) => {\n const formattedElements = section.elements.map((element) => {\n return formatElement(element, priceFormatter, foundCurrencies);\n });\n return { ...section, elements: formattedElements };\n });\n return { ...row, sections: formattedSections };\n });\n return { ...cabin, rows: formattedRows };\n });\n return { ...seatMap, cabins: formattedCabins };\n });\n\n return formattedSeatMaps;\n};\n\nexport { formatSeatMaps };\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "/*\n * Use relative-luminance to determine whether the color is dark enough or not.\n * See also: https://www.w3.org/WAI/GL/wiki/Relative_luminance\n */\nexport const hasHighLuminance = (accentColor: string) => {\n const rgb = accentColor.split(\", \").map((x) => parseInt(x));\n const luminance = (0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2]) / 255;\n return luminance > 0.5;\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { CreateOrder } from \"@duffel/api/types\";\n\nexport const isPayloadComplete = (\n payload: Partial<CreateOrder>,\n): payload is CreateOrder =>\n \"selected_offers\" in payload &&\n \"passengers\" in payload &&\n \"services\" in payload &&\n \"payments\" in payload &&\n \"type\" in payload &&\n \"metadata\" in payload;\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { Offer } from \"@duffel/api/types\";\n\nexport const offerIsExpired = (offer: Offer) => {\n return offer.expires_at && new Date(offer.expires_at) < new Date();\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { logGroup } from \"./logging\";\n\nexport interface ErrorResponse extends Response {\n data: { meta: any; errors: any[] };\n}\nexport const isErrorResponse = (response: any): response is ErrorResponse => {\n return \"data\" in response && Array.isArray(response.data.errors);\n};\n\nconst DUFFEL_API_URL = process.env.DUFFEL_API_URL;\nconst COMPONENT_VERSION = process.env.COMPONENT_VERSION;\n\nexport async function fetchFromDuffelAPI(\n withClientKey: string,\n path: string,\n method = \"GET\",\n body?: string,\n) {\n logGroup(\"Making request to the Duffel API\", { path, method });\n const fullUrl = `${DUFFEL_API_URL}/ancillaries-component/${path}`;\n let response: Response | null = null;\n try {\n response = await fetch(fullUrl, {\n method,\n body,\n headers: {\n \"Duffel-Version\": \"v2\",\n Authorization: `Bearer ${withClientKey}`,\n \"User-Agent\": `Duffel/ancillaries-component@${COMPONENT_VERSION}`,\n },\n });\n } catch (error) {\n logGroup(\"Failed to make request to the Duffel API\", { error });\n throw error;\n }\n\n const data = await response.json();\n if (Array.isArray(data.errors)) {\n logGroup(\"Request to the Duffel API failed\", {\n operation: `${method} ${fullUrl}`,\n method,\n request_id: data?.meta?.request_id,\n errors: data.errors,\n status: response.status,\n });\n throw { ...response, data };\n } else {\n logGroup(\"Request to the Duffel succeeded\", {\n request_id: data?.meta?.request_id,\n });\n }\n\n return data;\n}\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { Offer, SeatMap } from \"@duffel/api/types\";\n\nconst COMPONENT_CDN = process.env.COMPONENT_CDN;\n\nexport const importFromOfferFixtures = async (\n offerId: string,\n): Promise<Offer> =>\n await (\n await fetch(COMPONENT_CDN + `/fixtures/offers/${offerId}.json`)\n ).json();\n\nexport const importFromSeatMapsFixtures = async (\n offerId: string,\n): Promise<SeatMap[]> =>\n await (\n await fetch(COMPONENT_CDN + `/fixtures/seat-maps/${offerId}.json`)\n ).json();\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { Offer } from \"@duffel/api/types\";\n\nexport const isFixtureOfferId = (offerId: Offer[\"id\"]): boolean =>\n offerId.startsWith(\"fixture_off_\");\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { fetchFromDuffelAPI } from \"./fetchFromDuffelAPI\";\n\nexport async function retrieveOfferFromDuffelAPI(\n offer_id: string,\n client_key: string,\n) {\n const getOfferResponse = await fetchFromDuffelAPI(\n client_key,\n `offers/${offer_id}?return_available_services=true`,\n );\n\n return getOfferResponse.data;\n}\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { Offer } from \"@duffel/api/types\";\nimport { captureErrorInSentry } from \"./captureErrorInSentry\";\nimport { isErrorResponse } from \"./fetchFromDuffelAPI\";\nimport { importFromOfferFixtures } from \"./fetchFromFixtures\";\nimport { isFixtureOfferId } from \"./isFixtureOfferId\";\nimport { retrieveOfferFromDuffelAPI } from \"./retrieveOfferFromDuffelAPI\";\n\nexport async function retrieveOffer(\n offer_id: string,\n client_key: string | null,\n onError: (error: string) => void,\n setIsLoading: (isLoading: boolean) => void,\n onOfferReady: (offer: Offer) => void,\n) {\n setIsLoading(true);\n const useFixture = isFixtureOfferId(offer_id);\n offer_id = useFixture ? offer_id.replace(\"fixture_\", \"\") : offer_id;\n\n if (useFixture) {\n return importFromOfferFixtures(offer_id).then((offer) => {\n setIsLoading(false);\n onOfferReady(offer);\n });\n }\n\n if (!client_key) {\n throw new Error(\n \"Attempted to retrieve seat maps but the client key is missing.\",\n );\n }\n\n try {\n const data = await retrieveOfferFromDuffelAPI(offer_id, client_key);\n onOfferReady(data);\n } catch (error) {\n let message = \"An unknown error occurred while retrieving the offer.\";\n if (error instanceof Error) {\n message = error.message;\n if (error.message.includes(\"Load failed\")) {\n message = \"The Duffel API is not available. Please try again later.\";\n }\n } else if (isErrorResponse(error)) {\n if (error.status === 404) {\n message =\n \"The offer you are looking for does not exist or has expired.\";\n }\n }\n\n if (isErrorResponse(error) && error.status >= 500 && error.status < 600) {\n captureErrorInSentry(new Error(message));\n }\n onError(message);\n } finally {\n setIsLoading(false);\n }\n}\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { fetchFromDuffelAPI } from \"./fetchFromDuffelAPI\";\n\nexport async function retrieveSeatMapsFromDuffelAPI(\n offer_id: string,\n client_key: string,\n) {\n const getSeatMapResponse = await fetchFromDuffelAPI(\n client_key,\n `offers/${offer_id}/seat_maps`,\n );\n\n return getSeatMapResponse.data;\n}\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { SeatMap } from \"@duffel/api/types\";\nimport { captureErrorInSentry } from \"./captureErrorInSentry\";\nimport { isErrorResponse } from \"./fetchFromDuffelAPI\";\nimport { importFromSeatMapsFixtures } from \"./fetchFromFixtures\";\nimport { isFixtureOfferId } from \"./isFixtureOfferId\";\nimport { retrieveSeatMapsFromDuffelAPI } from \"./retrieveSeatMapsFromDuffelAPI\";\n\nexport async function retrieveSeatMaps(\n offer_id: string,\n client_key: string | null,\n onError: () => void,\n setIsLoading: (isLoading: boolean) => void,\n onSeatMapReady: (seatMaps: SeatMap[]) => void,\n) {\n setIsLoading(true);\n\n const useFixture = isFixtureOfferId(offer_id);\n offer_id = useFixture ? offer_id.replace(\"fixture_\", \"\") : offer_id;\n\n if (useFixture) {\n return importFromSeatMapsFixtures(offer_id).then((seatMaps) => {\n setIsLoading(false);\n onSeatMapReady(seatMaps);\n });\n }\n\n if (!client_key) {\n throw new Error(\n \"Attemptted to retrieve seat maps but the client key is missing.\",\n );\n }\n\n try {\n const data = await retrieveSeatMapsFromDuffelAPI(offer_id, client_key);\n onSeatMapReady(data);\n } catch (error) {\n let message = \"An unknown error occurred while retrieving the seat maps.\";\n\n if (error instanceof Error) {\n message = error.message;\n if (error.message.includes(\"Load failed\")) {\n message = \"The Duffel API is not available. Please try again later.\";\n }\n } else if (isErrorResponse(error)) {\n message =\n error.data.errors[0]?.message ||\n \"Received an unknown error from the Duffel API.\";\n }\n\n captureErrorInSentry(new Error(message));\n onError();\n } finally {\n setIsLoading(false);\n }\n}\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import {\n DuffelAncillariesProps,\n DuffelAncillariesPropsWithClientKeyAndOfferId,\n DuffelAncillariesPropsWithOfferIdForFixture,\n DuffelAncillariesPropsWithOffersAndSeatMaps,\n DuffelAncillariesPropWithOfferAndClientKey,\n} from \"../types/DuffelAncillariesProps\";\n\nexport const areDuffelAncillariesPropsValid = (props: DuffelAncillariesProps) =>\n hasCommonRequiredProps(props) &&\n (isDuffelAncillariesPropsWithOfferIdForFixture(props) ||\n isDuffelAncillariesPropsWithClientKeyAndOfferId(props) ||\n isDuffelAncillariesPropsWithOfferAndSeatMaps(props) ||\n isDuffelAncillariesPropsWithOfferAndClientKey(props));\n\nexport const hasCommonRequiredProps = (props: DuffelAncillariesProps) =>\n \"onPayloadReady\" in props && \"passengers\" in props && \"services\" in props;\n\nexport const isDuffelAncillariesPropsWithOfferIdForFixture = (\n props: DuffelAncillariesProps,\n): props is DuffelAncillariesPropsWithOfferIdForFixture =>\n \"offer_id\" in props && props.offer_id.startsWith(\"fixture_\");\n\nexport const isDuffelAncillariesPropsWithClientKeyAndOfferId = (\n props: DuffelAncillariesProps,\n): props is DuffelAncillariesPropsWithClientKeyAndOfferId =>\n \"offer_id\" in props && \"client_key\" in props;\n\nexport const isDuffelAncillariesPropsWithOfferAndSeatMaps = (\n props: DuffelAncillariesProps,\n): props is DuffelAncillariesPropsWithOffersAndSeatMaps =>\n \"offer\" in props && \"seat_maps\" in props;\n\nexport const isDuffelAncillariesPropsWithOfferAndClientKey = (\n props: DuffelAncillariesProps,\n): props is DuffelAncillariesPropWithOfferAndClientKey =>\n \"offer\" in props && \"client_key\" in props;\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { ErrorBoundary } from \"@components/shared/ErrorBoundary\";\nimport { FetchOfferErrorState } from \"@components/shared/FetchOfferErrorState\";\nimport { WithComponentStyles } from \"@components/shared/WithComponentStyles\";\nimport {\n CreateOrder,\n CreateOrderService,\n Offer,\n SeatMap,\n} from \"@duffel/api/types\";\nimport { compileCreateOrderPayload } from \"@lib/compileCreateOrderPayload\";\nimport { createPriceFormatters } from \"@lib/createPriceFormatters\";\nimport { formatAvailableServices } from \"@lib/formatAvailableServices\";\nimport { formatSeatMaps } from \"@lib/formatSeatMaps\";\nimport { hasHighLuminance } from \"@lib/hasHighLuminance\";\nimport { isPayloadComplete } from \"@lib/isPayloadComplete\";\nimport { initializeLogger, logGroup } from \"@lib/logging\";\nimport { offerIsExpired } from \"@lib/offerIsExpired\";\nimport { retrieveOffer } from \"@lib/retrieveOffer\";\nimport { retrieveSeatMaps } from \"@lib/retrieveSeatMaps\";\nimport {\n areDuffelAncillariesPropsValid,\n isDuffelAncillariesPropsWithClientKeyAndOfferId,\n isDuffelAncillariesPropsWithOfferAndClientKey,\n isDuffelAncillariesPropsWithOfferAndSeatMaps,\n isDuffelAncillariesPropsWithOfferIdForFixture,\n} from \"@lib/validateProps\";\nimport * as Sentry from \"@sentry/browser\";\nimport * as React from \"react\";\nimport {\n DuffelAncillariesProps,\n WithBaggageServiceInformation,\n WithSeatServiceInformation,\n WithServiceInformation,\n} from \"../../types/DuffelAncillariesProps\";\nimport { BaggageSelectionCard } from \"./bags/BaggageSelectionCard\";\nimport { CfarSelectionCard } from \"./cancel_for_any_reason/CfarSelectionCard\";\nimport { SeatSelectionCard } from \"./seats/SeatSelectionCard\";\n\nexport const DuffelAncillaries: React.FC<DuffelAncillariesProps> = (props) => {\n initializeLogger(props.debug || false);\n\n logGroup(\"Properties passed into the component:\", props);\n\n if (!areDuffelAncillariesPropsValid(props)) {\n throw new Error(\n `The props (${Object.keys(\n props,\n )}) passed to DuffelAncillaries are invalid. ` +\n \"`onPayloadReady`, `passengers` and `services` are always required. \" +\n \"Then, depending on your use case you may have one of the following combinations of required props: \" +\n \"`offer_id` and `client_key`, `offer` and `seat_maps` or `offer` and `client_key`.\" +\n \"Please refer to the documentation for more information and working examples: \" +\n \"https://duffel.com/docs/guides/ancillaries-component\",\n );\n }\n if (props.services.length === 0) {\n throw new Error(\n `You must provide at least one service in the \"services\" prop. Valid services: [\"bags\", \"seats\", \"cancel_for_any_reason\"]`,\n );\n }\n\n const isPropsWithOfferIdForFixture =\n isDuffelAncillariesPropsWithOfferIdForFixture(props);\n\n const isPropsWithClientKeyAndOfferId =\n isDuffelAncillariesPropsWithClientKeyAndOfferId(props);\n\n const isPropsWithOfferAndSeatMaps =\n isDuffelAncillariesPropsWithOfferAndSeatMaps(props);\n\n const isPropsWithOfferAndClientKey =\n isDuffelAncillariesPropsWithOfferAndClientKey(props);\n\n const shouldRetrieveSeatMaps =\n props.services.includes(\"seats\") &&\n !(\"seat_maps\" in props) &&\n (isPropsWithOfferIdForFixture ||\n isPropsWithClientKeyAndOfferId ||\n isPropsWithOfferAndClientKey);\n\n const [passengers, setPassengers] = React.useState<CreateOrder[\"passengers\"]>(\n props.passengers,\n );\n\n const [offer, setOffer] = React.useState<Offer | undefined>(\n (props as any).offer,\n );\n\n const [isOfferLoading, setIsOfferLoading] = React.useState(\n isPropsWithClientKeyAndOfferId,\n );\n\n const [seatMaps, setSeatMaps] = React.useState<SeatMap[] | undefined>(\n isPropsWithOfferAndSeatMaps ? props.seat_maps : undefined,\n );\n const [isSeatMapLoading, setIsSeatMapLoading] = React.useState(\n shouldRetrieveSeatMaps,\n );\n\n const [error, setError] = React.useState<null | string>(null);\n\n const [baggageSelectedServices, setBaggageSelectedServices] = React.useState<\n WithBaggageServiceInformation<CreateOrderService>[]\n >(props.defaultBaggageSelectedServices || []);\n const [seatSelectedServices, setSeatSelectedServices] = React.useState<\n WithSeatServiceInformation<CreateOrderService>[]\n >(props.defaultSeatSelectedServices || []);\n const [cfarSelectedServices, setCfarSelectedServices] = React.useState<\n WithServiceInformation<CreateOrderService>[]\n >([]);\n\n const priceFormatters = createPriceFormatters(\n props.markup,\n props.priceFormatters,\n );\n\n const updateOffer = (offer: Offer) => {\n const expiryErrorMessage = \"This offer has expired.\";\n if (offerIsExpired(offer)) {\n setError(expiryErrorMessage);\n return;\n } else {\n const msUntilExpiry = new Date(offer?.expires_at)?.getTime() - Date.now();\n\n // Only show the expiry error message if the offer expires in less than a day,\n // to prevent buffer overflows when showing offers for fixtures, which expire in\n // years.\n const milisecondsInOneDay = 1000 * 60 * 60 * 24;\n if (msUntilExpiry < milisecondsInOneDay) {\n setTimeout(() => setError(expiryErrorMessage), msUntilExpiry);\n }\n }\n\n const offerWithFormattedServices = formatAvailableServices(\n offer,\n priceFormatters,\n );\n setOffer(offerWithFormattedServices);\n };\n\n const updateSeatMaps = (seatMaps: SeatMap[]) => {\n const formattedSeatMaps = formatSeatMaps(seatMaps, priceFormatters.seats);\n setSeatMaps(formattedSeatMaps);\n };\n\n React.useEffect(() => {\n // whenever the props change, we'll set the sentry context to thse values\n // so that we can see them in the sentry logs and better support the users of the component library\n Sentry.setContext(\"props\", {\n \"props.services\": props.services,\n \"props.passengers.length\": (props as any).passengers.length,\n \"props.offer_id\": (props as any).offer_id,\n \"props.client_key\": (props as any).client_key,\n \"props.offer?.id\": (props as any).offer?.id,\n \"props.seat_maps?.[0]?.id\": (props as any).seat_maps?.[0]?.id,\n });\n\n if (isPropsWithClientKeyAndOfferId || isPropsWithOfferIdForFixture) {\n retrieveOffer(\n props.offer_id,\n !isPropsWithOfferIdForFixture ? props.client_key : null,\n setError,\n setIsOfferLoading,\n (offer) => {\n updateOffer(offer);\n\n if (offer.passengers.length !== passengers.length) {\n throw new Error(\n `The number of passengers given to \\`duffel-ancillaries\\` (${props.passengers.length}) doesn't match ` +\n `the number of passengers on the given offer (${offer.passengers.length}).`,\n );\n }\n\n if (isPropsWithOfferIdForFixture) {\n // There's no way the component users will know the passenger IDs for the fixture offer\n // so we'll need to add them here\n setPassengers(\n props.passengers.map((passenger, index) => ({\n ...passenger,\n id: offer.passengers[index].id,\n })),\n );\n }\n },\n );\n }\n\n if (shouldRetrieveSeatMaps) {\n retrieveSeatMaps(\n isPropsWithClientKeyAndOfferId || isPropsWithOfferIdForFixture\n ? props.offer_id\n : props.offer.id,\n !isPropsWithOfferIdForFixture ? props.client_key : null,\n () => updateSeatMaps([]),\n setIsSeatMapLoading,\n updateSeatMaps,\n );\n }\n\n if (isPropsWithOfferAndClientKey) {\n updateOffer(props.offer);\n }\n\n if (isPropsWithOfferAndSeatMaps) {\n updateOffer(props.offer);\n updateSeatMaps(props.seat_maps);\n }\n }, [\n // `as any` is needed here because the list\n // of dependencies is different for each combination of props.\n // To satisfy typescript, we'd need to conditionally assign\n // the dependencies to the hook after checking its type,\n // however that is not possible in a react hook.\n (props as any).offer_id,\n (props as any).client_key,\n (props as any).offer?.id,\n (props as any).seat_maps?.[0]?.id,\n ]);\n\n React.useEffect(() => {\n if (!offer) return;\n\n const createOrderPayload = compileCreateOrderPayload({\n baggageSelectedServices,\n seatSelectedServices,\n cfarSelectedServices,\n offer,\n passengers,\n seatMaps,\n });\n\n if (isPayloadComplete(createOrderPayload)) {\n const metadata = {\n offer_total_amount: offer.total_amount,\n offer_total_currency: offer.total_currency,\n offer_tax_amount: offer.tax_amount,\n offer_tax_currency: offer.tax_currency,\n baggage_services: baggageSelectedServices,\n seat_services: seatSelectedServices,\n cancel_for_any_reason_services: cfarSelectedServices,\n };\n\n logGroup(\"Payload ready\", {\n \"Order creation payload\": createOrderPayload,\n \"Services metadata\": metadata,\n });\n\n props.onPayloadReady(createOrderPayload, metadata);\n }\n }, [baggageSelectedServices, seatSelectedServices, cfarSelectedServices]);\n\n if (!areDuffelAncillariesPropsValid(props)) {\n return null;\n }\n\n const nonIdealStateHeight = `${\n // 72 (card height) + 32 gap between cards\n 72 * props.services.length + 32 * (props.services.length - 1)\n }px`;\n\n const duffelComponentsStyle = {\n // Adding inline styles here to avoid the cards jumping down\n // before the css is loaded duet to the missing \"row gap\".\n display: \"flex\",\n width: \"100%\",\n flexDirection: \"column\",\n rowGap: \"12px\",\n ...(props.styles?.accentColor && {\n \"--ACCENT\": props.styles.accentColor,\n }),\n ...(props.styles?.accentColor &&\n hasHighLuminance(props.styles.accentColor) && {\n \"--SECONDARY\": \"var(--GREY-900)\",\n \"--TERTIARY\": \"var(--GREY-400)\",\n }),\n ...(props.styles?.fontFamily && {\n \"--FONT-FAMILY\": props.styles.fontFamily,\n }),\n ...(props.styles?.buttonCornerRadius && {\n \"--BUTTON-RADIUS\": props.styles.buttonCornerRadius,\n }),\n // `as any` is needed here is needed because we want to set css variables\n // that are not part of the css properties type\n } as any;\n\n const state = {\n isOfferLoading,\n isSeatMapLoading,\n baggageSelectedServices,\n seatSelectedServices,\n cfarSelectedServices,\n offer,\n seatMaps,\n error,\n };\n\n logGroup(\"Component's internal state:\", state);\n\n return (\n <WithComponentStyles>\n <div style={duffelComponentsStyle}>\n <ErrorBoundary>\n {error && (\n <FetchOfferErrorState\n height={nonIdealStateHeight}\n message={error}\n />\n )}\n\n {!error &&\n props.services.map((ancillaryName) => {\n if (ancillaryName === \"bags\")\n return (\n <BaggageSelectionCard\n key=\"bags\"\n isLoading={isOfferLoading}\n offer={offer}\n passengers={passengers}\n selectedServices={baggageSelectedServices}\n setSelectedServices={setBaggageSelectedServices}\n />\n );\n\n if (ancillaryName === \"seats\")\n return (\n <SeatSelectionCard\n key=\"seats\"\n isLoading={isOfferLoading || isSeatMapLoading}\n seatMaps={seatMaps}\n offer={offer}\n passengers={passengers}\n selectedServices={seatSelectedServices}\n setSelectedServices={setSeatSelectedServices}\n />\n );\n\n if (ancillaryName === \"cancel_for_any_reason\")\n return (\n <CfarSelectionCard\n key=\"cancel_for_any_reason\"\n isLoading={isOfferLoading}\n offer={offer}\n selectedServices={cfarSelectedServices}\n setSelectedServices={setCfarSelectedServices}\n />\n );\n })}\n </ErrorBoundary>\n </div>\n </WithComponentStyles>\n );\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import * as React from \"react\";\n\nexport const AnimatedLoaderEllipsis: React.FC = () => (\n <span className=\"textual-loading-indicator\" aria-hidden=\"true\" />\n);\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import React from \"react\";\n\nexport interface StampProps {\n backgroundColor: React.CSSProperties[\"backgroundColor\"];\n color: React.CSSProperties[\"color\"];\n children: React.ReactNode;\n}\n\nexport const Stamp: React.FC<StampProps> = ({\n backgroundColor,\n color,\n children,\n}) => (\n <div\n style={{\n backgroundColor,\n color,\n padding: \"2px 8px\",\n whiteSpace: \"nowrap\",\n borderRadius: \"4px\",\n fontWeight: \"600\",\n fontSize: \"14px\",\n lineHeight: \"20px\",\n textAlign: \"center\",\n }}\n >\n {children}\n </div>\n);\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { Offer } from \"@duffel/api/types\";\n\n/**\n *\n * Returns the currency of the first service of the given type in the offer.\n *\n * @param offer An offer\n * @returns A string representing the currency of the services in the offer.\n * @throws If there are no services, or none of the services are of the given type.\n */\nconst getCurrencyForServices = (offer: Offer, serviceType: string): string => {\n if (offer.available_services.length === 0) {\n throw new Error(\"No services available\");\n }\n const firstService = offer.available_services.find(\n (service) => service.type === serviceType,\n );\n if (!firstService) {\n throw new Error(`No ${serviceType} services available`);\n }\n return firstService.total_currency;\n};\n\nexport { getCurrencyForServices };\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { CreateOrder } from \"@duffel/api/types\";\n\nexport const getTotalQuantity = (\n fromSelectedServices: CreateOrder[\"services\"],\n) =>\n (fromSelectedServices || []).reduce(\n (total, { quantity }) => total + quantity,\n 0,\n );\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { Offer, OfferAvailableService } from \"@duffel/api/types\";\nimport { isBaggageService } from \"./isBaggageService\";\nimport { isCancelForAnyReasonService } from \"./isCancelForAnyReasonService\";\n\nconst checkFunctionsMap = {\n baggage: isBaggageService,\n cancel_for_any_reason: isCancelForAnyReasonService,\n};\n\nexport const hasService = (\n offer: Offer | undefined,\n type: OfferAvailableService[\"type\"],\n) => {\n const checkFunction = checkFunctionsMap[type];\n if (!checkFunction) throw new Error(`Unknown service type: ${type}`);\n\n return (\n offer &&\n Array.isArray(offer.available_services) &&\n offer.available_services.some(\n (service) => checkFunction(service) && service.maximum_quantity > 0,\n )\n );\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "/**\n * Return a function to format a number into a money amount for a given currency\n *\n * @param currency The ISO-4217 currency code to be used by the formatter\n */\nexport const moneyStringFormatter = (\n currency: string,\n locale = \"en-GB\",\n options: { [option: string]: string } = {},\n) => {\n return (value: number) => {\n try {\n const formatter = new Intl.NumberFormat(locale, {\n style: \"currency\",\n currency,\n ...options,\n });\n const numberFormatted = formatter.format(value);\n const signFormatted =\n options &&\n options[\"signDisplay\"] &&\n (options[\"signDisplay\"] === \"always\" ||\n (options[\"signDisplay\"] === \"exceptZero\" && value !== 0))\n ? numberFormatted.replace(/^([+-])/, \"$1 \")\n : numberFormatted;\n\n return signFormatted;\n } catch (error) {\n // If the currency is not supported by the browser, we return the value with the currency code.\n // This allows us to support made-up currencies, like \"1000 Duffel Points\"\n return `${value} ${currency}`;\n }\n };\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "export const withPlural = (\n totalQuantity: number,\n singular: string,\n plural: string,\n) => {\n if (totalQuantity == 1) return `${totalQuantity} ${singular}`;\n else return `${totalQuantity} ${plural}`;\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { AnimatedLoaderEllipsis } from \"@components/shared/AnimatedLoaderEllipsis\";\nimport { Stamp } from \"@components/shared/Stamp\";\nimport { CreateOrder, CreateOrderService, Offer } from \"@duffel/api/types\";\nimport { getCurrencyForServices } from \"@lib/getCurrencyForServices\";\nimport { getTotalAmountForServices } from \"@lib/getTotalAmountForServices\";\nimport { getTotalQuantity } from \"@lib/getTotalQuantity\";\nimport { hasService } from \"@lib/hasService\";\nimport { moneyStringFormatter } from \"@lib/moneyStringFormatter\";\nimport { withPlural } from \"@lib/withPlural\";\nimport React from \"react\";\nimport { WithBaggageServiceInformation } from \"src/types\";\nimport { Card } from \"../../shared/Card\";\nimport { BaggageSelectionModal } from \"./BaggageSelectionModal\";\n\nexport interface BaggageSelectionCardProps {\n isLoading: boolean;\n offer?: Offer;\n passengers: CreateOrder[\"passengers\"];\n selectedServices: WithBaggageServiceInformation<CreateOrderService>[];\n setSelectedServices: (\n selectedServices: WithBaggageServiceInformation<CreateOrderService>[],\n ) => void;\n}\n\nexport const BaggageSelectionCard: React.FC<BaggageSelectionCardProps> = ({\n isLoading,\n offer,\n passengers,\n selectedServices,\n setSelectedServices,\n}) => {\n const [isOpen, setIsOpen] = React.useState(false);\n\n const containsBaggageService = hasService(offer, \"baggage\");\n const totalQuantity = getTotalQuantity(selectedServices);\n const isBaggageAdded = totalQuantity > 0;\n\n const totalAmount = getTotalAmountForServices(offer!, selectedServices);\n\n let currencyToUse = offer?.base_currency || \"\";\n if (containsBaggageService) {\n currencyToUse = getCurrencyForServices(offer!, \"baggage\");\n }\n\n const totalAmountFormatted = offer\n ? moneyStringFormatter(currencyToUse)(totalAmount)\n : \"0\";\n\n const copy =\n containsBaggageService && isBaggageAdded\n ? `${withPlural(\n totalQuantity,\n \"bag\",\n \"bags\",\n )} added for ${totalAmountFormatted}`\n : \"Add any extra baggage you need for your trip\";\n\n return (\n <>\n <Card\n buttonTitle=\"Select extra baggage\"\n title=\"Extra baggage\"\n copy={copy}\n icon=\"cabin_bag\"\n onClick={containsBaggageService ? () => setIsOpen(true) : null}\n isLoading={isLoading}\n disabled={!isLoading && !containsBaggageService}\n isSelected={isBaggageAdded}\n >\n {isLoading && (\n <Stamp color=\"var(--GREY-900)\" backgroundColor=\"var(--GREY-100)\">\n Loading\n <AnimatedLoaderEllipsis />\n </Stamp>\n )}\n {!isLoading && !containsBaggageService && (\n <Stamp color=\"var(--GREY-700)\" backgroundColor=\"var(--GREY-200)\">\n Not available\n </Stamp>\n )}\n </Card>\n\n <BaggageSelectionModal\n isOpen={Boolean(isOpen && offer)}\n offer={offer}\n passengers={passengers}\n onClose={(newSelectedServices) => {\n // We need to do a deep copy here because otherwise the modal changing the quantity\n // will affect the selected services regardless of whether it's saved or not\n const newSelectedServicesDeepCopy = JSON.parse(\n JSON.stringify(newSelectedServices),\n );\n setSelectedServices(newSelectedServicesDeepCopy);\n setIsOpen(false);\n }}\n selectedServices={selectedServices}\n />\n </>\n );\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { Icon, IconName } from \"@components/shared/Icon\";\nimport classNames from \"classnames\";\nimport * as React from \"react\";\n\nexport interface CardProps {\n buttonTitle: string;\n title: string;\n icon: IconName;\n onClick?: (() => void) | null;\n children: React.ReactNode;\n copy: string;\n isLoading?: boolean;\n disabled?: boolean;\n isSelected?: boolean;\n}\n\nexport const Card: React.FC<CardProps> = ({\n buttonTitle,\n title,\n icon,\n copy,\n onClick,\n children,\n isLoading,\n disabled,\n isSelected,\n}) => {\n const hasChildren = React.Children.toArray(children).length > 0;\n\n return (\n <button\n type=\"button\"\n title={buttonTitle}\n {...(onClick && { onClick })}\n disabled={disabled}\n className={classNames(\n \"ancillary-card\",\n isLoading && \"ancillary-card--loading\",\n )}\n // We are using inline styles here because\n // we don't want the cards to appear unstyled\n // before the CSS stylesheet loads.\n // This is important for this component since it\n // be on visible on the page when it loads.\n style={{\n cursor: \"pointer\",\n background: \"transparent\",\n color: \"var(--GREY-900)\",\n border: \"solid 1px rgba(226, 226, 232, 1)\",\n display: \"flex\",\n rowGap: \"4px\",\n padding: \"20px\",\n borderRadius: \"8px\",\n justifyContent: \"space-between\",\n flexWrap: \"wrap\",\n flexDirection: \"column\",\n width: \"100%\",\n boxSizing: \"border-box\",\n fontSize: \"16px\",\n fontWeight: \"400\",\n lineHeight: \"24px\",\n letterSpacing: \"0em\",\n transition:\n \"border-color 0.3s var(--TRANSITION-CUBIC-BEZIER) background-color 0.3s var(--TRANSITION-CUBIC-BEZIER)\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"flex-start\",\n marginBlock: \"0\",\n textAlign: \"start\",\n marginTop: \"2px\",\n columnGap: \"12px\",\n width: \"100%\",\n }}\n >\n <div>\n {isSelected ? (\n <Icon name=\"check\" className=\"ancillary-card__selected-icon\" />\n ) : (\n <Icon name={icon} />\n )}\n </div>\n\n <div\n style={{\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"start\",\n width: \"100%\",\n }}\n >\n <p\n className=\"p1--semibold\"\n style={{\n marginBlock: \"0\",\n }}\n >\n {title}\n </p>\n <div className=\"ancillary-card__children\">\n {hasChildren ? (\n children\n ) : (\n <Icon\n name=\"expand_content\"\n className=\"ancillary-card__expand-icon\"\n />\n )}\n </div>\n </div>\n </div>\n <p\n className=\"p1--regular\"\n style={{\n textAlign: \"start\",\n color: \"var(--GREY-600)\",\n marginLeft: \"34px\",\n marginBlock: \"0\",\n }}\n >\n {copy}\n </p>\n </button>\n );\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "export const setBodyScrollability = (shouldScroll: boolean) => {\n if (shouldScroll) {\n document.body.style.overflow = \"\";\n } else {\n document.body.style.overflow = \"hidden\";\n }\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { setBodyScrollability } from \"@lib/setBodyScrollability\";\nimport classNames from \"classnames\";\nimport * as React from \"react\";\nimport { IconButton } from \"./IconButton\";\n\nexport interface ModalProps {\n onClose: () => void;\n isOpen: boolean;\n children: React.ReactNode;\n}\n\nexport const Modal: React.FC<ModalProps> = ({ children, onClose, isOpen }) => {\n React.useEffect(() => {\n setBodyScrollability(!isOpen);\n return () => setBodyScrollability(true);\n }, [isOpen]);\n\n return (\n <div\n className={classNames(\"modal\", isOpen && \"modal--open\")}\n // setting inline style to avoid modal content to flash unstyled before stylesheet is loaded\n style={{ opacity: 0 }}\n >\n <div role=\"presentation\" className={\"modal--content\"}>\n {children}\n\n <IconButton\n icon=\"close\"\n onClick={onClose}\n title=\"Close modal\"\n className=\"modal--close-button\"\n />\n </div>\n </div>\n );\n};\n\ninterface ModalBodyProps {\n tall?: boolean;\n noPadding?: boolean;\n children: React.ReactNode;\n}\nexport const ModalBody: React.FC<ModalBodyProps> = ({\n children,\n tall,\n noPadding,\n}) => (\n <div\n className={classNames(\n \"modal-body\",\n noPadding && \"modal-body--no-padding\",\n tall && \"modal-body--tall\",\n )}\n >\n {children}\n </div>\n);\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import classNames from \"classnames\";\nimport * as React from \"react\";\nimport { Icon, IconName } from \"./Icon\";\n\nconst ICON_BUTTON_VARIANTS = {\n primary: \"icon-button--primary\",\n outlined: \"icon-button--outlined\",\n};\n\ntype IconButtonVariants = keyof typeof ICON_BUTTON_VARIANTS;\n\ntype NativeButtonProps = React.DetailedHTMLProps<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n>;\n\nexport interface IconButtonProps\n extends Pick<NativeButtonProps, \"id\" | \"onClick\" | \"disabled\" | \"className\"> {\n \"data-testid\"?: string;\n icon: IconName;\n title: string;\n variant?: IconButtonVariants;\n}\n\nexport const IconButton: React.FC<IconButtonProps> = ({\n icon,\n variant = \"primary\",\n className,\n ...nativeButtonProps\n}) => (\n <button\n type=\"button\"\n className={classNames(\n \"icon-button\",\n ICON_BUTTON_VARIANTS[variant],\n className,\n )}\n {...nativeButtonProps}\n >\n <Icon name={icon} />\n </button>\n);\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { CreateOrder, CreateOrderPassenger } from \"@duffel/api/types\";\n\nexport type PassengerMapById = Record<\n CreateOrderPassenger[\"id\"],\n CreateOrderPassenger\n>;\n\nexport const getPassengerMapById = (\n passengers: CreateOrder[\"passengers\"],\n): PassengerMapById =>\n passengers.reduce(\n (all, passenger) => ({ [passenger.id]: passenger, ...all }),\n {} as PassengerMapById,\n );\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { Offer, OfferSliceSegment } from \"@duffel/api/types\";\n\nexport const getSegmentList = (offer: Offer) =>\n offer.slices.reduce(\n (accumulator, slice) => [...accumulator, ...slice.segments],\n new Array<OfferSliceSegment>(),\n );\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { Modal } from \"@components/shared/Modal\";\nimport { CreateOrder, CreateOrderService, Offer } from \"@duffel/api/types\";\nimport { getCurrencyForServices } from \"@lib/getCurrencyForServices\";\nimport { getPassengerMapById } from \"@lib/getPassengerMapById\";\nimport { getSegmentList } from \"@lib/getSegmentList\";\nimport { getServicePriceMapById } from \"@lib/getServicePriceMapById\";\nimport { hasService } from \"@lib/hasService\";\nimport React, { useState } from \"react\";\nimport { WithBaggageServiceInformation } from \"src/types\";\nimport { BaggageSelectionModalBody } from \"./BaggageSelectionModalBody\";\nimport { BaggageSelectionModalFooter } from \"./BaggageSelectionModalFooter\";\nimport { BaggageSelectionModalHeader } from \"./BaggageSelectionModalHeader\";\n\nexport interface BaggageSelectionModalProps {\n isOpen: boolean;\n offer?: Offer;\n passengers: CreateOrder[\"passengers\"];\n selectedServices: WithBaggageServiceInformation<CreateOrderService>[];\n onClose: (\n selectedServices: WithBaggageServiceInformation<CreateOrderService>[],\n ) => void;\n}\n\nexport const BaggageSelectionModal: React.FC<BaggageSelectionModalProps> = ({\n isOpen,\n offer,\n passengers,\n onClose,\n selectedServices,\n}) => {\n const [currentSegmentIndex, setCurrentSegmentIndex] = useState(0);\n\n const [selectedServicesState, setSelectedServicesState] =\n React.useState(selectedServices);\n\n if (!offer) return null;\n\n const segments = getSegmentList(offer);\n const currentSegment = segments[currentSegmentIndex];\n\n const passengerMapById = getPassengerMapById(passengers);\n const servicePricesMap = getServicePriceMapById(offer.available_services);\n\n let currencyToUse = offer.base_currency;\n if (hasService(offer, \"baggage\")) {\n currencyToUse = getCurrencyForServices(offer, \"baggage\");\n }\n\n return (\n <Modal isOpen={isOpen} onClose={() => onClose(selectedServices)}>\n <BaggageSelectionModalHeader\n segmentCount={segments.length}\n currentSegment={currentSegment}\n currentSegmentIndex={currentSegmentIndex}\n setCurrentSegmentIndex={(index) => setCurrentSegmentIndex(index)}\n />\n <BaggageSelectionModalBody\n offer={offer}\n selectedServices={selectedServicesState}\n passengersById={passengerMapById}\n segment={currentSegment}\n setSelectedServices={setSelectedServicesState}\n />\n <BaggageSelectionModalFooter\n currency={currencyToUse}\n selectedServices={selectedServicesState}\n servicePrices={servicePricesMap}\n isFirstSegment={currentSegmentIndex === 0}\n isLastSegment={currentSegmentIndex + 1 === segments.length}\n onNextSegmentButtonClicked={() =>\n setCurrentSegmentIndex(currentSegmentIndex + 1)\n }\n onPreviousSegmentButtonClicked={() =>\n setCurrentSegmentIndex(currentSegmentIndex - 1)\n }\n onClose={() => onClose(selectedServicesState)}\n />\n </Modal>\n );\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { CreateOrderPassenger, OfferPassenger } from \"@duffel/api/types\";\n\nexport const getPassengerName = (\n createOrderPayloadPassenger: CreateOrderPassenger,\n offerPassenger: OfferPassenger | undefined,\n fallbackIndex: number,\n): string => {\n if (!createOrderPayloadPassenger) {\n return `Passenger ${fallbackIndex}`;\n }\n\n if (\n createOrderPayloadPassenger.given_name &&\n createOrderPayloadPassenger.family_name\n ) {\n return `${createOrderPayloadPassenger.given_name} ${createOrderPayloadPassenger.family_name}`;\n }\n\n if (createOrderPayloadPassenger.given_name) {\n return createOrderPayloadPassenger.given_name;\n }\n\n if (createOrderPayloadPassenger.family_name) {\n return createOrderPayloadPassenger.family_name;\n }\n\n if (offerPassenger?.given_name && offerPassenger?.family_name) {\n return `${offerPassenger.given_name} ${offerPassenger.family_name}`;\n }\n\n if (offerPassenger?.given_name) {\n return offerPassenger.given_name;\n }\n\n if (offerPassenger?.family_name) {\n return offerPassenger.family_name;\n }\n\n return `Passenger ${fallbackIndex}`;\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { OfferAvailableServiceBaggageMetadata } from \"@duffel/api/types\";\nimport { captureErrorInSentry } from \"@lib/captureErrorInSentry\";\n\nexport const getBaggageServiceDescription = (\n metadata: OfferAvailableServiceBaggageMetadata,\n) => {\n if (!metadata) {\n captureErrorInSentry(\n new Error(\"getBaggageServiceDescription was not given any metadata\"),\n );\n return null;\n }\n\n if (\n !metadata.maximum_weight_kg &&\n !metadata.maximum_length_cm &&\n !metadata.maximum_height_cm &&\n !metadata.maximum_depth_cm\n ) {\n return null;\n }\n\n const hasAllDimensions =\n metadata.maximum_length_cm &&\n metadata.maximum_height_cm &&\n metadata.maximum_depth_cm;\n\n let dimensionsLabel = \"\";\n if (hasAllDimensions) {\n dimensionsLabel = ` / ${metadata.maximum_height_cm} x ${metadata.maximum_length_cm} x ${metadata.maximum_depth_cm} cm`;\n }\n\n let weightLabel = \"\";\n if (metadata.maximum_weight_kg) {\n weightLabel = `Up to ${metadata.maximum_weight_kg}kg`;\n }\n\n return `${weightLabel}${dimensionsLabel}`;\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import {\n CreateOrderService,\n OfferAvailableServiceBaggage,\n} from \"@duffel/api/types\";\nimport { WithBaggageServiceInformation } from \"src/types\";\n\nexport function hasBaggageServiceOfSameMetadataTypeAlreadyBeenSelected(\n selectedServices: WithBaggageServiceInformation<CreateOrderService>[],\n availableService: OfferAvailableServiceBaggage,\n) {\n const selectedServiceMap: Record<string, string[]> = {};\n for (const service of selectedServices) {\n for (const key of getMetadataServiceUniquenessKey(service)) {\n if (!(key in selectedServiceMap)) {\n selectedServiceMap[key] = [service.id];\n } else {\n selectedServiceMap[key].push(service.id);\n }\n }\n }\n\n const availableServiceKeys =\n getMetadataServiceUniquenessKeyFromAvailableService(availableService);\n\n return availableServiceKeys.some((availableServiceKey) => {\n if (\n selectedServiceMap[availableServiceKey]?.includes(availableService.id)\n ) {\n // if the selected service is the one on the counter, don't disable it\n // the max quantity will be availableService.maximum_quantity\n return false;\n } else {\n return availableServiceKey in selectedServiceMap;\n }\n });\n}\n\n/**\n * Creates a unique key for a selected service based on its type, segmentId and passengerId\n */\nfunction getMetadataServiceUniquenessKey(\n service: WithBaggageServiceInformation<CreateOrderService>,\n) {\n const keys: string[] = [];\n for (const segmentId of service.serviceInformation.segmentIds) {\n for (const passengerId of service.serviceInformation.passengerIds) {\n keys.push(\n [service.serviceInformation.type, segmentId, passengerId].join(\":\"),\n );\n }\n }\n\n return keys;\n}\n\n/**\n * Creates a unique key for an avaialable service based on its type, segmentId and passengerId\n */\nfunction getMetadataServiceUniquenessKeyFromAvailableService(\n service: OfferAvailableServiceBaggage,\n) {\n const keys: string[] = [];\n for (const segmentId of service.segment_ids) {\n for (const passengerId of service.passenger_ids) {\n keys.push([service.metadata.type, segmentId, passengerId].join(\":\"));\n }\n }\n\n return keys;\n}\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { IconButton } from \"@components/shared/IconButton\";\nimport * as React from \"react\";\n\ninterface CounterProps {\n id: string;\n min: number;\n max: number;\n value: number;\n onChange: (value: number) => void;\n}\n\nexport const Counter: React.FC<CounterProps> = ({\n id,\n min,\n max,\n value,\n onChange,\n}) => (\n <div className=\"counter\" id={id}>\n <IconButton\n icon=\"minus\"\n title=\"Remove one\"\n id={`${id}-minus`}\n data-testid={`${id}-minus`}\n variant=\"outlined\"\n disabled={value <= min}\n onClick={() => onChange(Math.max(value - 1, min))}\n />\n <div className=\"counter__count-label\">{value}</div>\n <IconButton\n icon=\"add\"\n title=\"Add one\"\n id={`${id}-plus`}\n data-testid={`${id}-plus`}\n variant=\"outlined\"\n disabled={value >= max}\n onClick={() => onChange(Math.min(value + 1, max))}\n />\n </div>\n);\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import {\n CreateOrderService,\n OfferAvailableServiceBaggage,\n} from \"@duffel/api/types\";\nimport { getBaggageServiceDescription } from \"@lib/getBaggageServiceDescription\";\nimport { hasBaggageServiceOfSameMetadataTypeAlreadyBeenSelected } from \"@lib/hasBaggageServiceOfSameMetadataTypeAlreadyBeenSelected\";\nimport { moneyStringFormatter } from \"@lib/moneyStringFormatter\";\nimport React from \"react\";\nimport { WithBaggageServiceInformation } from \"src/types\";\nimport { Counter } from \"../Counter\";\n\ninterface BaggageSelectionControllerProps {\n segmentId: string;\n passengerId: string;\n availableService: OfferAvailableServiceBaggage;\n selectedServices: WithBaggageServiceInformation<CreateOrderService>[];\n quantity: number;\n onQuantityChanged: (quantity: number) => void;\n}\n\nexport const BaggageSelectionController: React.FC<\n BaggageSelectionControllerProps\n> = ({\n passengerId,\n availableService,\n quantity,\n onQuantityChanged,\n selectedServices,\n}) => {\n const serviceName =\n availableService.metadata.type === \"carry_on\" ? \"Cabin bag\" : \"Checked bag\";\n\n const servicePrice = moneyStringFormatter(availableService.total_currency)(\n +availableService.total_amount,\n );\n const serviceDescription = getBaggageServiceDescription(\n availableService.metadata,\n );\n\n const shouldDisableController =\n hasBaggageServiceOfSameMetadataTypeAlreadyBeenSelected(\n selectedServices,\n availableService,\n );\n\n return (\n <div\n style={{\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n }}\n >\n <div>\n <p style={{ margin: 0 }} className=\"p2--regular\">\n {serviceName}\n <span\n style={{\n marginInline: \"4px\",\n color: \"var(--GREY-400)\",\n }}\n >\n \u2022\n </span>\n <span\n className=\"p2--semibold\"\n data-testid={`price-label--${availableService.id}--${passengerId}`}\n >\n {servicePrice}\n </span>\n </p>\n <p\n style={{ margin: 0, color: \"var(--GREY-600)\" }}\n className=\"p3--regular\"\n >\n {serviceDescription}\n </p>\n </div>\n <Counter\n id={`counter--${availableService.id}--${passengerId}`}\n min={0}\n value={quantity}\n onChange={onQuantityChanged}\n max={shouldDisableController ? 0 : availableService.maximum_quantity}\n />\n </div>\n );\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { OfferSliceSegmentPassengerBaggage } from \"@duffel/api/types\";\nimport { withPlural } from \"@lib/withPlural\";\nimport React from \"react\";\n\ninterface IncludedBaggageBannerProps {\n includedBaggage: OfferSliceSegmentPassengerBaggage[];\n}\n\nexport const IncludedBaggageBanner: React.FC<IncludedBaggageBannerProps> = ({\n includedBaggage,\n}) => {\n const { carryOnBagsQuantity, checkedBagsQuantity } = includedBaggage.reduce(\n (sum, { type, quantity }) => ({\n carryOnBagsQuantity:\n sum.carryOnBagsQuantity + (type === \"carry_on\" ? quantity : 0),\n checkedBagsQuantity:\n sum.checkedBagsQuantity + (type === \"checked\" ? quantity : 0),\n }),\n {\n carryOnBagsQuantity: 0,\n checkedBagsQuantity: 0,\n },\n );\n\n const baggageLabelStringArray = new Array<string>();\n if (carryOnBagsQuantity > 0) {\n baggageLabelStringArray.push(\n withPlural(carryOnBagsQuantity, \"cabin bag\", \"cabin bags\"),\n );\n }\n if (checkedBagsQuantity > 0) {\n baggageLabelStringArray.push(\n withPlural(checkedBagsQuantity, \"checked bag\", \"checked bags\"),\n );\n }\n\n return (\n <div\n style={{\n marginBlock: \"8px\",\n padding: \"8px 12px\",\n color: ` var(--GREEN-300)`,\n backgroundColor: ` var(--GREEN-100)`,\n borderRadius: \"6px\",\n }}\n className=\"p2--regular\"\n >\n {baggageLabelStringArray.join(\" and \")} included with ticket\n </div>\n );\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import {\n CreateOrderService,\n OfferAvailableServiceBaggage,\n OfferSliceSegmentPassengerBaggage,\n} from \"@duffel/api/types\";\nimport React from \"react\";\nimport { WithBaggageServiceInformation } from \"src/types\";\nimport { BaggageSelectionController } from \"./BaggageSelectionController\";\nimport { IncludedBaggageBanner } from \"./IncludedBaggageBanner\";\n\nexport interface BaggageSelectionModalBodyPassengerProps {\n segmentId: string;\n passengerId: string;\n passengerName: string;\n includedBaggage: OfferSliceSegmentPassengerBaggage[];\n passengerServicesForSegment: OfferAvailableServiceBaggage[];\n selectedServices: WithBaggageServiceInformation<CreateOrderService>[];\n setSelectedServices: (\n selectedServices: WithBaggageServiceInformation<CreateOrderService>[],\n ) => void;\n}\n\nexport const BaggageSelectionModalBodyPassenger: React.FC<\n BaggageSelectionModalBodyPassengerProps\n> = ({\n segmentId,\n passengerId,\n passengerName,\n includedBaggage,\n passengerServicesForSegment,\n selectedServices,\n setSelectedServices,\n}) => {\n const hasIncludedBaggage = includedBaggage.reduce(\n (sum, bag) => sum + bag.quantity,\n 0,\n );\n\n return (\n <div style={{ marginTop: \"24px\" }}>\n <h3 style={{ margin: 0 }} className=\"p1--semibold\">\n {passengerName}\n </h3>\n {hasIncludedBaggage ? (\n <IncludedBaggageBanner includedBaggage={includedBaggage} />\n ) : null}\n\n <div style={{ display: \"flex\", rowGap: \"8px\", flexDirection: \"column\" }}>\n {passengerServicesForSegment.map((availableService) => (\n <BaggageSelectionController\n key={availableService.id}\n passengerId={passengerId}\n segmentId={segmentId}\n availableService={availableService}\n selectedServices={selectedServices}\n quantity={\n selectedServices.find(({ id }) => id == availableService.id)\n ?.quantity || 0\n }\n onQuantityChanged={(newQuantity) =>\n onBaggageQuantityChanged(\n newQuantity,\n passengerName,\n availableService,\n selectedServices,\n setSelectedServices,\n )\n }\n />\n ))}\n </div>\n\n {passengerServicesForSegment.length === 0 && (\n <p style={{ color: `var(--GREY-700)`, margin: 0 }}>\n Extra baggage is not available for this passenger on this flight\n </p>\n )}\n </div>\n );\n};\n\nconst onBaggageQuantityChanged = (\n newQuantity: number,\n passengerName: string,\n availableService: OfferAvailableServiceBaggage,\n selectedServices: WithBaggageServiceInformation<CreateOrderService>[],\n setSelectedServices: (\n selectedServices: WithBaggageServiceInformation<CreateOrderService>[],\n ) => void,\n) => {\n // check if the service which had its quantity changed is already in the list\n const changedServiceIndex = selectedServices.findIndex(\n ({ id }) => availableService.id === id,\n );\n\n // create a copy of the existing list of selected services\n const newSelectedServices = Array.from(selectedServices);\n\n // if the service is not in the list, add it\n if (changedServiceIndex < 0) {\n newSelectedServices.push({\n id: availableService.id,\n quantity: newQuantity,\n serviceInformation: {\n segmentIds: availableService.segment_ids,\n passengerIds: availableService.passenger_ids,\n passengerName,\n total_amount: availableService.total_amount,\n total_currency: availableService.total_currency,\n ...availableService.metadata,\n },\n });\n } else {\n // if the service is in the list, update its quantity\n newSelectedServices[changedServiceIndex].quantity = newQuantity;\n }\n\n // remove any services with a quantity of 0\n // and update the list of selected services\n setSelectedServices(\n newSelectedServices.filter(({ quantity }) => quantity !== 0),\n );\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { ModalBody } from \"@components/shared/Modal\";\nimport { getPassengerName } from \"@lib/getPassengerName\";\nimport React from \"react\";\n\nimport {\n CreateOrderPassenger,\n CreateOrderService,\n Offer,\n OfferAvailableServiceBaggage,\n OfferSliceSegment,\n} from \"@duffel/api/types\";\nimport { WithBaggageServiceInformation } from \"src/types\";\nimport { BaggageSelectionModalBodyPassenger } from \"./BaggageSelectionModalBodyPassenger\";\n\nexport interface BaggageSelectionModalBodyProps {\n offer: Offer;\n segment: OfferSliceSegment;\n passengersById: Record<CreateOrderPassenger[\"id\"], CreateOrderPassenger>;\n selectedServices: WithBaggageServiceInformation<CreateOrderService>[];\n setSelectedServices: (\n selectedServices: WithBaggageServiceInformation<CreateOrderService>[],\n ) => void;\n}\n\nexport const BaggageSelectionModalBody: React.FC<\n BaggageSelectionModalBodyProps\n> = ({\n offer,\n segment,\n passengersById,\n selectedServices,\n setSelectedServices,\n}) => (\n <ModalBody>\n {segment.passengers.map(({ passenger_id, baggages }, index) => (\n <BaggageSelectionModalBodyPassenger\n key={passenger_id}\n segmentId={segment.id}\n passengerId={passenger_id}\n passengerName={getPassengerName(\n passengersById[passenger_id],\n offer.passengers.find(({ id }) => id === passenger_id),\n index + 1,\n )}\n includedBaggage={baggages}\n passengerServicesForSegment={\n offer.available_services.filter(\n ({ type, passenger_ids, segment_ids }) =>\n type === \"baggage\" &&\n passenger_ids.includes(passenger_id) &&\n segment_ids.includes(segment.id),\n ) as OfferAvailableServiceBaggage[]\n }\n selectedServices={selectedServices}\n setSelectedServices={setSelectedServices}\n />\n ))}\n </ModalBody>\n);\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { Button } from \"@components/shared/Button\";\nimport { CreateOrder } from \"@duffel/api/types\";\nimport { ServicePriceMapById } from \"@lib/getServicePriceMapById\";\nimport { getTotalAmountForServicesWithPriceMap } from \"@lib/getTotalAmountForServices\";\nimport { getTotalQuantity } from \"@lib/getTotalQuantity\";\nimport { moneyStringFormatter } from \"@lib/moneyStringFormatter\";\nimport { withPlural } from \"@lib/withPlural\";\nimport React from \"react\";\n\nexport interface BaggageSelectionModalFooterProps {\n currency: string;\n selectedServices: CreateOrder[\"services\"];\n servicePrices: ServicePriceMapById;\n\n isFirstSegment: boolean;\n isLastSegment: boolean;\n\n onNextSegmentButtonClicked: () => void;\n onPreviousSegmentButtonClicked: () => void;\n onClose: () => void;\n}\n\nexport const BaggageSelectionModalFooter: React.FC<\n BaggageSelectionModalFooterProps\n> = ({\n selectedServices,\n servicePrices,\n currency,\n isFirstSegment,\n isLastSegment,\n onNextSegmentButtonClicked,\n onPreviousSegmentButtonClicked,\n onClose,\n}) => {\n const totalQuantity = getTotalQuantity(selectedServices);\n const totalAmount = getTotalAmountForServicesWithPriceMap(\n servicePrices,\n selectedServices,\n );\n const totalAmountLabel = moneyStringFormatter(currency)(totalAmount);\n const isOneWay = isFirstSegment && isFirstSegment;\n\n return (\n <div style={{ padding: \"16px 24px 24px\" }}>\n <div className=\"flex--space-between\">\n <div>\n Price for {withPlural(totalQuantity, \"extra bag\", \"extra bags\")}\n </div>\n <div className=\"h3--semibold\" data-testid=\"baggage-total-amount-label\">\n + {totalAmountLabel}\n </div>\n </div>\n\n <div\n style={\n isOneWay\n ? { marginTop: \"16px\", display: \"grid\" }\n : {\n marginTop: \"16px\",\n display: \"grid\",\n columnGap: \"12px\",\n gridTemplateColumns: \"repeat(2, 1fr)\",\n }\n }\n >\n {!isOneWay && (\n <Button\n size={48}\n variant=\"outlined\"\n disabled={isFirstSegment}\n onClick={() => onPreviousSegmentButtonClicked()}\n >\n Back\n </Button>\n )}\n <Button\n size={48}\n data-testid=\"confirm-selection-for-baggage\"\n onClick={() =>\n isLastSegment ? onClose() : onNextSegmentButtonClicked()\n }\n >\n {isLastSegment ? \"Confirm\" : \"Next\"}\n </Button>\n </div>\n </div>\n );\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { captureErrorInSentry } from \"./captureErrorInSentry\";\n\nexport const formatDateString = (dateString: string) => {\n const date = new Date(dateString);\n if (!isNaN(date.valueOf())) return formatDate(date);\n else {\n captureErrorInSentry(\n new Error(\n `formatDateString attempted to parse an invalid date string: ${dateString}`,\n ),\n );\n }\n};\n\nexport const formatDate = (date: Date) => {\n const { format } = new Intl.DateTimeFormat(undefined, {\n dateStyle: \"medium\",\n });\n return format(date);\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { OfferSliceSegment } from \"@duffel/api/types\";\nimport { formatDateString } from \"@lib/formatDate\";\nimport React from \"react\";\n\nexport interface BaggageSelectionModalHeaderProps {\n segmentCount: number;\n currentSegmentIndex: number;\n currentSegment: OfferSliceSegment;\n setCurrentSegmentIndex: (index: number) => void;\n}\n\nexport const BaggageSelectionModalHeader: React.FC<\n BaggageSelectionModalHeaderProps\n> = ({\n segmentCount,\n currentSegmentIndex,\n currentSegment,\n setCurrentSegmentIndex,\n}) => (\n <div style={{ padding: \"24px 24px 16px\" }}>\n {segmentCount > 1 && (\n <div style={{ display: \"flex\", columnGap: \"4px\" }}>\n {Array(segmentCount)\n .fill(0)\n .map((_, index) =>\n index === currentSegmentIndex ? (\n <ActiveSegment key={`segment_${index}`} />\n ) : (\n <InactiveSegment\n key={`segment_${index}`}\n onClick={() => setCurrentSegmentIndex(index)}\n />\n ),\n )}\n </div>\n )}\n <h2\n className=\"h3--semibold\"\n style={segmentCount > 1 ? { marginTop: \"12px\" } : {}}\n >\n Flight to {currentSegment.destination.iata_code}\n <span\n className=\"p2--regular\"\n style={{\n color: \"var(--GREY-600)\",\n marginLeft: \"8px\",\n }}\n >\n {formatDateString(currentSegment.departing_at)}\n </span>\n </h2>\n </div>\n);\n\nconst InactiveSegment: React.FC<{\n style?: React.CSSProperties;\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n}> = ({ onClick, style }) => (\n <button\n type=\"button\"\n onClick={onClick}\n style={{\n border: \"none\",\n width: \"4px\",\n height: \"4px\",\n padding: \"0\",\n borderRadius: \"4px\",\n backgroundColor:\n \"var(--TERTIARY, rgba(var(--ACCENT), var(--ACCENT-LIGHT-200)))\",\n transition: \"background-color 0.3s var(--TRANSITION-CUBIC-BEZIER)\",\n ...style,\n }}\n />\n);\n\nconst ActiveSegment = () => (\n <InactiveSegment\n onClick={undefined}\n style={{\n backgroundColor: \"var(--SECONDARY, rgb(var(--ACCENT)))\",\n }}\n />\n);\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { AnimatedLoaderEllipsis } from \"@components/shared/AnimatedLoaderEllipsis\";\nimport { Stamp } from \"@components/shared/Stamp\";\nimport { CreateOrderService, Offer } from \"@duffel/api/types\";\nimport { getCurrencyForServices } from \"@lib/getCurrencyForServices\";\nimport { getTotalAmountForServices } from \"@lib/getTotalAmountForServices\";\nimport { getTotalQuantity } from \"@lib/getTotalQuantity\";\nimport { hasService } from \"@lib/hasService\";\nimport { isCancelForAnyReasonService } from \"@lib/isCancelForAnyReasonService\";\nimport { moneyStringFormatter } from \"@lib/moneyStringFormatter\";\nimport React from \"react\";\nimport { WithServiceInformation } from \"src/types\";\nimport { Card } from \"../../shared/Card\";\nimport { CfarSelectionModal } from \"./CfarSelectionModal\";\n\nexport interface CfarSelectionCardProps {\n isLoading: boolean;\n offer?: Offer;\n selectedServices: WithServiceInformation<CreateOrderService>[];\n setSelectedServices: (\n selectedServices: WithServiceInformation<CreateOrderService>[],\n ) => void;\n}\n\nexport const CfarSelectionCard: React.FC<CfarSelectionCardProps> = ({\n isLoading,\n offer,\n selectedServices,\n setSelectedServices,\n}) => {\n const [isOpen, setIsOpen] = React.useState(false);\n\n const containsCfarService = hasService(offer, \"cancel_for_any_reason\");\n const totalQuantity = getTotalQuantity(selectedServices);\n const isCfarAdded = totalQuantity > 0;\n\n let currencyToUse = offer?.base_currency || \"\";\n if (containsCfarService) {\n currencyToUse = getCurrencyForServices(offer!, \"cancel_for_any_reason\");\n }\n\n const totalAmount = getTotalAmountForServices(offer!, selectedServices);\n const totalAmountFormatted = offer\n ? moneyStringFormatter(currencyToUse)(totalAmount)\n : \"0\";\n\n const cfarService = offer?.available_services.find(\n isCancelForAnyReasonService,\n );\n\n const copy =\n containsCfarService && isCfarAdded\n ? `Your trip is protected for ${totalAmountFormatted}`\n : `Protect your purchase if you decide to cancel`;\n\n return (\n <>\n <Card\n buttonTitle=\"Add cancel for any reason\"\n title=\"Cancel for any reason\"\n copy={copy}\n icon=\"shield_with_moon\"\n onClick={containsCfarService ? () => setIsOpen(true) : null}\n isLoading={isLoading}\n disabled={!isLoading && !containsCfarService}\n isSelected={isCfarAdded}\n >\n {isLoading && (\n <Stamp color=\"var(--GREY-900)\" backgroundColor=\"var(--GREY-100)\">\n Loading\n <AnimatedLoaderEllipsis />\n </Stamp>\n )}\n {!isLoading && !containsCfarService && (\n <Stamp color=\"var(--GREY-700)\" backgroundColor=\"var(--GREY-200)\">\n Not available\n </Stamp>\n )}\n </Card>\n\n <CfarSelectionModal\n isOpen={Boolean(isOpen && offer && cfarService)}\n offerCurrency={offer?.base_currency}\n service={cfarService}\n onClose={(newSelectedServices) => {\n setIsOpen(false);\n setSelectedServices(newSelectedServices);\n }}\n selectedServices={selectedServices}\n />\n </>\n );\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { Icon } from \"@components/shared/Icon\";\nimport React, { ReactNode } from \"react\";\n\nexport const CfarSelectionModalBodyListItem: React.FC<{\n children: ReactNode;\n}> = ({ children }) => (\n <li className=\"cfar-modal-list-item\">\n <Icon name=\"check\" />\n <p>{children}</p>\n </li>\n);\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { Icon } from \"@components/shared//Icon\";\nimport { ModalBody } from \"@components/shared/Modal\";\nimport { moneyStringFormatter } from \"@lib/moneyStringFormatter\";\nimport React from \"react\";\nimport { CfarSelectionModalBodyListItem } from \"./CfarSelectionModalBodyListItem\";\nimport { Offer, OfferAvailableServiceCFAR } from \"@duffel/api/types\";\n\nexport interface CfarSelectionModalBodyProps {\n offerCurrency: Offer[\"base_currency\"];\n service: OfferAvailableServiceCFAR;\n}\n\nexport const CfarSelectionModalBody: React.FC<CfarSelectionModalBodyProps> = ({\n offerCurrency,\n service,\n}) => (\n <ModalBody>\n <ul style={{ padding: 0 }}>\n <CfarSelectionModalBodyListItem>\n Cancel your trip for any reason\n </CfarSelectionModalBodyListItem>\n\n <CfarSelectionModalBodyListItem>\n Guaranteed refund of{\" \"}\n {moneyStringFormatter(offerCurrency)(+service.metadata.refund_amount)}\n </CfarSelectionModalBodyListItem>\n\n <CfarSelectionModalBodyListItem>\n Redeemable up to 24 hours before first flight departure\n </CfarSelectionModalBodyListItem>\n </ul>\n <a\n href={service.metadata.terms_and_conditions_url}\n rel=\"noopener noreferrer\"\n target=\"_blank\"\n className=\"p2--regular\"\n style={{\n color: \"var(--GREY-600)\",\n }}\n >\n Terms and conditions\n <Icon\n name=\"north_east\"\n size={16}\n style={{\n display: \"inline\",\n verticalAlign: \"middle\",\n marginLeft: \"4px\",\n }}\n />\n </a>\n </ModalBody>\n);\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { Button } from \"@components/shared/Button\";\nimport { Icon } from \"@components/shared/Icon\";\nimport {\n CreateOrderService,\n OfferAvailableServiceCFAR,\n} from \"@duffel/api/types\";\nimport { moneyStringFormatter } from \"@lib/moneyStringFormatter\";\nimport React from \"react\";\nimport { WithServiceInformation } from \"src/types\";\n\nexport interface CfarSelectionModalFooterProps {\n service: OfferAvailableServiceCFAR;\n selectedServices: WithServiceInformation<CreateOrderService>[];\n onAddCfarService: () => void;\n onRemoveCfarService: () => void;\n onClose: () => void;\n}\n\nexport const CfarSelectionModalFooter: React.FC<\n CfarSelectionModalFooterProps\n> = ({\n service,\n selectedServices,\n onAddCfarService,\n onRemoveCfarService,\n onClose,\n}) => {\n const serviceIncluded = selectedServices.some(({ id }) => id == service.id);\n const formattedPrice = moneyStringFormatter(service.total_currency)(\n +service.total_amount,\n );\n\n return (\n <div className=\"cfar-modal-footer\">\n <Button\n size={48}\n variant={serviceIncluded ? \"destructive\" : \"outlined\"}\n onClick={serviceIncluded ? onRemoveCfarService : onClose}\n >\n {serviceIncluded ? \"Remove protection\" : \"Don\u2019t protect trip\"}\n </Button>\n\n {!serviceIncluded && (\n <Button\n size={48}\n data-testid=\"confirm-selection-for-cfar\"\n onClick={onAddCfarService}\n >\n Add protection for {formattedPrice}\n </Button>\n )}\n\n {serviceIncluded && <ProtectedTripBanner />}\n </div>\n );\n};\n\nconst ProtectedTripBanner: React.FC = () => (\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n columnGap: \"8px\",\n backgroundColor: \"var(--GREY-100)\",\n padding: \"var(--space-12)\",\n borderRadius: \"var(--BUTTON-RADIUS)\",\n }}\n >\n <Icon\n size={20}\n name=\"shield_with_moon\"\n style={{ fill: \"var(--SECONDARY, rgb(var(--ACCENT)))\" }}\n />\n Your trip is protected\n </div>\n);\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import React from \"react\";\n\nexport const CfarSelectionModalHeader: React.FC = () => (\n <div style={{ padding: \"24px 24px 16px\" }}>\n <h2 className=\"h3--semibold\" style={{ marginBlock: 0 }}>\n Cancel for any reason\n </h2>\n </div>\n);\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { Modal } from \"@components/shared/Modal\";\nimport {\n CreateOrderService,\n Offer,\n OfferAvailableServiceCFAR,\n} from \"@duffel/api/types\";\nimport React from \"react\";\nimport { WithServiceInformation } from \"src/types\";\nimport { CfarSelectionModalBody } from \"./CfarSelectionModalBody\";\nimport { CfarSelectionModalFooter } from \"./CfarSelectionModalFooter\";\nimport { CfarSelectionModalHeader } from \"./CfarSelectionModalHeader\";\n\nexport interface CfarSelectionModalProps {\n isOpen: boolean;\n offerCurrency?: Offer[\"base_currency\"];\n service?: OfferAvailableServiceCFAR;\n selectedServices: WithServiceInformation<CreateOrderService>[];\n onClose: (\n selectedServices: WithServiceInformation<CreateOrderService>[],\n ) => void;\n}\n\nexport const CfarSelectionModal: React.FC<CfarSelectionModalProps> = ({\n isOpen,\n offerCurrency,\n service,\n onClose,\n selectedServices,\n}) => {\n return (\n <Modal isOpen={isOpen} onClose={() => onClose(selectedServices)}>\n <CfarSelectionModalHeader />\n {service && offerCurrency && (\n <>\n <CfarSelectionModalBody\n service={service}\n offerCurrency={offerCurrency}\n />\n <CfarSelectionModalFooter\n service={service}\n selectedServices={selectedServices}\n onAddCfarService={() =>\n onClose([\n {\n id: service.id,\n quantity: 1,\n serviceInformation: {\n type: \"cancel_for_any_reason\",\n total_amount: service.total_amount,\n total_currency: service.total_currency,\n ...service.metadata,\n },\n },\n ])\n }\n onRemoveCfarService={() => onClose([])}\n onClose={() => onClose(selectedServices)}\n />\n </>\n )}\n </Modal>\n );\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { SeatMap, SeatMapCabinRowSectionElement } from \"@duffel/api/types\";\n\nconst getFirstSeatElementMatchingCriteria = (\n seatMaps: SeatMap[],\n matcher: (element: SeatMapCabinRowSectionElement) => boolean,\n) => {\n for (const seatMap of seatMaps) {\n for (const cabin of seatMap.cabins) {\n for (const row of cabin.rows) {\n for (const section of row.sections) {\n for (const element of section.elements) {\n if (matcher(element)) {\n return element;\n }\n }\n }\n }\n }\n }\n};\n\nexport { getFirstSeatElementMatchingCriteria };\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { SeatMap, SeatMapCabinRowSectionElementSeat } from \"@duffel/api/types\";\nimport { getFirstSeatElementMatchingCriteria } from \"./getFirstSeatElementMatchingCriteria\";\n\n/**\n *\n * Returns the currency of the first service of the given seat maps.\n *\n * @param seatMaps[] Array of seat maps\n * @returns A string representing the currency of the seat maps in the offer.\n */\nconst getCurrencyForSeatMaps = (seatMaps: SeatMap[]): string | undefined => {\n const firstElementWithServices:\n | SeatMapCabinRowSectionElementSeat\n | undefined = getFirstSeatElementMatchingCriteria(\n seatMaps,\n (element) =>\n element.type === \"seat\" && element.available_services.length > 0,\n ) as SeatMapCabinRowSectionElementSeat;\n return firstElementWithServices?.available_services[0]?.total_currency;\n};\n\nexport { getCurrencyForSeatMaps };\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { SeatMap } from \"@duffel/api/types\";\n\nexport function hasAvailableSeatService(seatMaps?: SeatMap[]): boolean {\n if (!Array.isArray(seatMaps) || seatMaps.length === 0) return false;\n\n for (const seatMap of seatMaps) {\n for (const cabin of seatMap.cabins) {\n for (const rows of cabin.rows) {\n for (const section of rows.sections) {\n for (const element of section.elements) {\n if (\n element.type === \"seat\" &&\n element.available_services.length > 0\n ) {\n return true;\n }\n }\n }\n }\n }\n }\n\n return false;\n}\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { AnimatedLoaderEllipsis } from \"@components/shared/AnimatedLoaderEllipsis\";\nimport { Stamp } from \"@components/shared/Stamp\";\nimport {\n CreateOrder,\n CreateOrderService,\n Offer,\n SeatMap,\n} from \"@duffel/api/types\";\nimport { getCurrencyForSeatMaps } from \"@lib/getCurrencyForSeatMaps\";\nimport { getTotalAmountForServices } from \"@lib/getTotalAmountForServices\";\nimport { getTotalQuantity } from \"@lib/getTotalQuantity\";\nimport { hasAvailableSeatService } from \"@lib/hasAvailableSeatService\";\nimport { moneyStringFormatter } from \"@lib/moneyStringFormatter\";\nimport { withPlural } from \"@lib/withPlural\";\nimport React from \"react\";\nimport { WithSeatServiceInformation } from \"src/types\";\nimport { Card } from \"../../shared/Card\";\nimport { SeatSelectionModal } from \"./SeatSelectionModal\";\n\nexport interface SeatSelectionCardProps {\n isLoading: boolean;\n offer?: Offer;\n seatMaps?: SeatMap[];\n passengers: CreateOrder[\"passengers\"];\n selectedServices: WithSeatServiceInformation<CreateOrderService>[];\n setSelectedServices: (\n selectedServices: WithSeatServiceInformation<CreateOrderService>[],\n ) => void;\n}\n\nexport const SeatSelectionCard: React.FC<SeatSelectionCardProps> = ({\n isLoading,\n offer,\n seatMaps,\n passengers,\n selectedServices,\n setSelectedServices,\n}) => {\n const [isOpen, setIsOpen] = React.useState(false);\n\n const containsSeatService = hasAvailableSeatService(seatMaps);\n const totalQuantity = getTotalQuantity(selectedServices);\n const areSeatsAdded = totalQuantity > 0;\n\n const totalAmount = getTotalAmountForServices(\n offer!,\n selectedServices,\n seatMaps,\n );\n let currencyToUse = offer?.base_currency ?? \"\";\n if (seatMaps) {\n currencyToUse = getCurrencyForSeatMaps(seatMaps) ?? currencyToUse;\n }\n\n const totalAmountFormatted = offer\n ? moneyStringFormatter(currencyToUse)(totalAmount)\n : \"0\";\n\n const copy =\n containsSeatService && areSeatsAdded\n ? `${withPlural(\n totalQuantity,\n \"seat\",\n \"seats\",\n )} selected for ${totalAmountFormatted}`\n : \"Specify where on the plane you\u2019d like to sit\";\n\n return (\n <>\n <Card\n buttonTitle=\"Select seats\"\n title=\"Seat selection\"\n copy={copy}\n icon=\"flight_class\"\n onClick={containsSeatService ? () => setIsOpen(true) : null}\n isLoading={isLoading}\n disabled={!isLoading && !containsSeatService}\n isSelected={areSeatsAdded}\n >\n {isLoading && (\n <Stamp color=\"var(--GREY-900)\" backgroundColor=\"var(--GREY-100)\">\n Loading\n <AnimatedLoaderEllipsis />\n </Stamp>\n )}\n {!isLoading && !containsSeatService && (\n <Stamp color=\"var(--GREY-700)\" backgroundColor=\"var(--GREY-200)\">\n Not available\n </Stamp>\n )}\n </Card>\n\n <SeatSelectionModal\n isOpen={Boolean(offer && seatMaps && isOpen)}\n seatMaps={seatMaps}\n offer={offer}\n passengers={passengers}\n selectedServices={selectedServices}\n onClose={(services) => {\n setSelectedServices(services);\n setIsOpen(false);\n }}\n />\n </>\n );\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { OfferSliceSegment } from \"@duffel/api/types\";\n\nexport const getPassengerBySegmentList = (segments: OfferSliceSegment[]) =>\n segments.flatMap((segment) =>\n segment.passengers.map((passenger, passengerIndex) => ({\n passenger,\n passengerIndex,\n segment,\n })),\n );\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { Modal } from \"@components/shared/Modal\";\nimport {\n CreateOrder,\n CreateOrderService,\n Offer,\n SeatMap,\n} from \"@duffel/api/types\";\nimport { getCurrencyForSeatMaps } from \"@lib/getCurrencyForSeatMaps\";\nimport { getPassengerBySegmentList } from \"@lib/getPassengerBySegmentList\";\nimport { getPassengerMapById } from \"@lib/getPassengerMapById\";\nimport { getPassengerName } from \"@lib/getPassengerName\";\nimport { getSegmentList } from \"@lib/getSegmentList\";\nimport { getServicePriceMapById } from \"@lib/getServicePriceMapById\";\nimport React from \"react\";\nimport { WithSeatServiceInformation } from \"src/types\";\nimport { SeatSelectionModalBody } from \"./SeatSelectionModalBody\";\nimport { SeatSelectionModalFooter } from \"./SeatSelectionModalFooter\";\nimport { SeatSelectionModalHeader } from \"./SeatSelectionModalHeader\";\n\ntype CreateOrderServiceWithInformation =\n WithSeatServiceInformation<CreateOrderService>;\n\nexport interface SeatSelectionModalProps {\n isOpen: boolean;\n offer?: Offer;\n seatMaps?: SeatMap[];\n selectedServices: CreateOrderServiceWithInformation[];\n passengers: CreateOrder[\"passengers\"];\n onClose: (selectedServices: CreateOrderServiceWithInformation[]) => void;\n}\n\nexport const SeatSelectionModal: React.FC<SeatSelectionModalProps> = ({\n isOpen,\n offer,\n passengers,\n seatMaps,\n selectedServices,\n onClose,\n}) => {\n const [currentPermutationIndex, setCurrentPermutationIndex] =\n React.useState(0);\n\n const [selectedServicesState, setSelectedServicesState] =\n React.useState<CreateOrderServiceWithInformation[]>(selectedServices);\n const selectedServicesStateMap = selectedServicesState.reduce(\n (all, service) => ({ ...all, [service.id]: service }),\n {} as Record<string, CreateOrderServiceWithInformation>,\n );\n\n if (!offer || !seatMaps) return null;\n\n const segments = getSegmentList(offer);\n const passengerMapById = getPassengerMapById(passengers);\n const servicePricesMap = getServicePriceMapById(offer.available_services);\n const segmentAndPassengerPermutations = getPassengerBySegmentList(segments);\n const {\n passenger: { passenger_id: currentPassengerId },\n passengerIndex: currentPassengerIndex,\n segment: { id: currentSegmentId },\n } = segmentAndPassengerPermutations[currentPermutationIndex];\n\n const currentSegment = segments.find(({ id }) => id === currentSegmentId)!;\n const currentPassenger = passengerMapById[currentPassengerId];\n const currentSeatMap = seatMaps.find(\n (seatMap) => seatMap.segment_id === currentSegmentId,\n )!;\n\n const currentPassengerName = getPassengerName(\n currentPassenger,\n offer.passengers[currentPassengerIndex],\n currentPassengerIndex + 1,\n );\n\n const onSeatToggle = (\n seatServiceToToggle: CreateOrderServiceWithInformation,\n ) => {\n let newSeatServices = new Array<CreateOrderServiceWithInformation>();\n\n for (const selectedServiceFromState of selectedServicesState) {\n const hasClickedSeatToToggleOff =\n selectedServiceFromState.id === seatServiceToToggle.id &&\n seatServiceToToggle.quantity === 0;\n\n const isSelectedServiceFromStateForTheSameSegmentAndPassengerPermutation =\n selectedServiceFromState.serviceInformation?.segmentId ===\n currentSegmentId &&\n selectedServiceFromState.serviceInformation?.passengerId ===\n currentPassengerId;\n\n if (\n !hasClickedSeatToToggleOff &&\n !isSelectedServiceFromStateForTheSameSegmentAndPassengerPermutation\n ) {\n newSeatServices = [...newSeatServices, selectedServiceFromState];\n }\n }\n\n if (seatServiceToToggle.quantity > 0) {\n newSeatServices = [...newSeatServices, seatServiceToToggle];\n }\n\n setSelectedServicesState(newSeatServices);\n };\n\n const currencyToUse =\n getCurrencyForSeatMaps(seatMaps) ?? offer.total_currency;\n\n return (\n <Modal isOpen={isOpen} onClose={() => onClose(selectedServices)}>\n <SeatSelectionModalHeader\n segmentAndPassengerPermutationsCount={\n segmentAndPassengerPermutations.length\n }\n currentSegment={currentSegment}\n currentPassengerName={currentPassengerName}\n currentSegmentAndPassengerPermutationsIndex={currentPermutationIndex}\n setCurrentSegmentAndPassengerPermutationsIndex={\n setCurrentPermutationIndex\n }\n />\n <SeatSelectionModalBody\n selectedServicesMap={selectedServicesStateMap}\n seatMap={currentSeatMap}\n onSeatToggled={onSeatToggle}\n currentPassengerId={currentPassengerId}\n currentPassengerName={currentPassengerName}\n currentSegmentId={currentSegmentId}\n />\n <SeatSelectionModalFooter\n seatMaps={seatMaps}\n currency={currencyToUse}\n selectedServices={selectedServicesState}\n servicePrices={servicePricesMap}\n isFirstSegment={currentPermutationIndex === 0}\n isLastSegment={\n currentPermutationIndex + 1 === segmentAndPassengerPermutations.length\n }\n onNextSegmentButtonClicked={() => {\n setCurrentPermutationIndex(currentPermutationIndex + 1);\n }}\n onPreviousSegmentButtonClicked={() => {\n setCurrentPermutationIndex(currentPermutationIndex - 1);\n }}\n onClose={() => onClose(selectedServicesState)}\n />\n </Modal>\n );\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { SeatMap } from \"@duffel/api/types\";\n\nexport const getCabinsForSegmentAndDeck = (forDeck: number, seatMap: SeatMap) =>\n seatMap.cabins.filter((cabin) => cabin.deck === forDeck);\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import {\n SeatMapCabin,\n SeatMapCabinRowSectionElementAmenity,\n} from \"@duffel/api/types\";\n\nexport const getSymbols = (\n cabins: SeatMapCabin[],\n): Set<SeatMapCabinRowSectionElementAmenity> => {\n const results: Set<SeatMapCabinRowSectionElementAmenity> = new Set();\n for (const cabin of cabins) {\n for (const row of cabin.rows) {\n for (const section of row.sections) {\n for (const element of section.elements) {\n if (\n element.type !== \"seat\" &&\n element.type !== \"empty\" &&\n element.type !== \"restricted_seat_general\"\n ) {\n results.add(element.type);\n }\n }\n }\n }\n }\n return results;\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { SeatMapCabin } from \"@duffel/api/types\";\n\nexport const hasWings = (cabin: SeatMapCabin, rowIndex: number) =>\n Boolean(\n cabin.wings &&\n cabin.wings.first_row_index <= rowIndex &&\n cabin.wings.last_row_index >= rowIndex,\n );\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { CreateOrderService, SeatMap as SeatMapType } from \"@duffel/api/types\";\nimport { getCabinsForSegmentAndDeck } from \"@lib/getCabinsForSegmentAndDeck\";\nimport { getSymbols } from \"@lib/getSymbols\";\nimport { hasWings } from \"@lib/hasWings\";\nimport classNames from \"classnames\";\nimport * as React from \"react\";\nimport { WithSeatServiceInformation } from \"src/types\";\nimport { DeckSelect } from \"./DeckSelect\";\nimport { Legend } from \"./Legend\";\nimport { Row } from \"./Row\";\nimport { SeatMapUnavailable } from \"./SeatMapUnavailable\";\n\nexport interface SeatMapProps {\n seatMap: SeatMapType;\n selectedServicesMap: Record<\n string,\n WithSeatServiceInformation<CreateOrderService>\n >;\n onSeatToggled: (\n seatService: WithSeatServiceInformation<CreateOrderService>,\n ) => void;\n currentPassengerId: string;\n currentPassengerName: string;\n currentSegmentId: string;\n}\n\nexport const SeatMap: React.FC<SeatMapProps> = ({\n seatMap,\n onSeatToggled,\n selectedServicesMap,\n currentPassengerId,\n currentPassengerName,\n currentSegmentId,\n}) => {\n const [selectedDeck, setSelectedDeck] = React.useState(0);\n\n if (!seatMap || !seatMap.cabins || !seatMap.cabins.length) {\n return <SeatMapUnavailable />;\n }\n\n const cabins = getCabinsForSegmentAndDeck(selectedDeck, seatMap);\n const hasMultipleDecks = cabins.length !== seatMap.cabins.length;\n const anyHasWings = seatMap.cabins.some((cabin) => cabin.wings);\n\n if (!cabins || !cabins.length) {\n return <SeatMapUnavailable />;\n }\n\n const symbols = getSymbols(cabins);\n\n return (\n <div\n className={classNames(\"seat-map\", {\n \"seat-map--wings\": anyHasWings,\n })}\n >\n {hasMultipleDecks && (\n <DeckSelect\n value={selectedDeck}\n setValue={(value) => {\n setSelectedDeck(value);\n }}\n />\n )}\n <div className=\"seat-map__legend-container\">\n <Legend symbols={symbols} />\n </div>\n {cabins.map((cabin, cabinIndex) => (\n <div\n key={`cabin-${cabinIndex}`}\n className=\"seat-map__map-container\"\n style={{ \"--CABIN-AISLES\": cabin.aisles } as React.CSSProperties}\n >\n {cabin.rows.map((row, rowIndex) => (\n <Row\n key={rowIndex}\n row={row}\n hasWings={hasWings(cabin, rowIndex)}\n onSeatToggled={onSeatToggled}\n selectedServicesMap={selectedServicesMap}\n currentPassengerId={currentPassengerId}\n currentPassengerName={currentPassengerName}\n currentSegmentId={currentSegmentId}\n />\n ))}\n </div>\n ))}\n </div>\n );\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import classNames from \"classnames\";\nimport React from \"react\";\n\nexport interface TabsProps {\n /**\n * The currently selected tab option\n */\n value: string;\n\n /**\n * Callback for when a new tab option is selected\n */\n onChange: (value: string) => void;\n\n /**\n * The options you want to render on the tabs\n */\n options: string[];\n}\n\nexport const Tabs: React.FC<TabsProps> = ({ value, onChange, options }) => (\n <div className=\"seat-map__tab-select\">\n {options.map((option) => (\n <button\n key={option}\n type=\"button\"\n className={classNames(\"seat-map__tab-select-option\", {\n \"seat-map__tab-select-option--selected\": option === value,\n })}\n onClick={() => value !== option && onChange(option)}\n >\n {option}\n </button>\n ))}\n </div>\n);\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { Tabs } from \"@components/shared/Tabs\";\nimport * as React from \"react\";\n\nexport interface DeckSelectProps {\n /**\n * The currently selected deck number\n */\n value: number;\n /**\n * What to do when the user selects a deck\n */\n setValue: (value: number) => void;\n}\n\n/**\n * The deck selection component for the seat map.\n */\nexport const DeckSelect: React.FC<DeckSelectProps> = ({ value, setValue }) => {\n const options = [\"Lower deck\", \"Upper deck\"];\n return (\n <Tabs\n options={options}\n value={options[value]}\n onChange={(item) => setValue(options.indexOf(item))}\n />\n );\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { Icon, IconName } from \"@components/shared/Icon\";\nimport { SeatMapCabinRowSectionElementAmenity } from \"@duffel/api/types\";\nimport * as React from \"react\";\n\nexport interface LegendProps {\n /**\n * The set of additional symbols to display\n */\n symbols: Set<SeatMapCabinRowSectionElementAmenity>;\n}\n\n/**\n * The legend for the seat map.\n */\nexport const Legend: React.FC<LegendProps> = ({ symbols }) => (\n <div className=\"seat-map__legend\">\n <span className=\"seat-map__legend-item\">\n <span\n className=\"seat-map__legend-seat seat-map__legend-seat--fee-payable\"\n aria-label=\"Additional cost for seat\"\n >\n <Icon\n name=\"seat_paid_indicator\"\n className=\"seat-map__legend-seat--fee-payable-indicator\"\n size={12}\n />\n </span>\n Additional Cost\n </span>\n <span className=\"seat-map__legend-item\">\n <span\n className=\"seat-map__legend-seat seat-map__legend-seat--included\"\n aria-label=\"Included seat\"\n />\n Included\n </span>\n <span className=\"seat-map__legend-item\">\n <span\n className=\"seat-map__legend-seat seat-map__legend-seat--selected\"\n aria-label=\"Selected seat\"\n />\n Selected\n </span>\n <span className=\"seat-map__legend-item\">\n <span className=\"seat-map__legend-seat\" aria-label=\"Unavailable seat\">\n <Icon name=\"close\" size={14} />\n </span>\n Unavailable/Restricted\n </span>\n {[...symbols].map((symbol) => (\n <span\n key={symbol}\n className=\"seat-map__legend-item seat-map__legend-item--symbol\"\n >\n <Icon name={symbol as IconName} size={20} />\n {symbol.split(\"_\")[0]}\n </span>\n ))}\n </div>\n);\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import {\n SeatMapCabinRow,\n SeatMapCabinRowSectionElementSeat,\n} from \"@duffel/api/types\";\n\nexport const getRowNumber = (row: SeatMapCabinRow): string | null => {\n const seats = Object.values(row.sections)\n .map((section) => section.elements)\n .reduce((acc, val) => acc.concat(val), [])\n .filter(\n (element) => element.type === \"seat\",\n ) as SeatMapCabinRowSectionElementSeat[];\n\n return seats.length > 0\n ? seats[0].designator.substring(0, seats[0].designator.length - 1)\n : null;\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import {\n CreateOrderService,\n SeatMapCabinRow,\n SeatMapCabinRowSection,\n} from \"@duffel/api/types\";\nimport classNames from \"classnames\";\nimport * as React from \"react\";\nimport { WithSeatServiceInformation } from \"src/types\";\nimport { Element } from \"./Element\";\nimport { EmptyElement } from \"./EmptyElement\";\n\ninterface RowSectionProps {\n row: SeatMapCabinRow;\n rowNumber: string | null;\n hasWings: boolean;\n section: SeatMapCabinRowSection;\n sectionIndex: number;\n selectedServicesMap: Record<\n string,\n WithSeatServiceInformation<CreateOrderService>\n >;\n onSeatToggled: (\n seatService: WithSeatServiceInformation<CreateOrderService>,\n ) => void;\n currentPassengerId: string;\n currentPassengerName: string;\n currentSegmentId: string;\n}\n\nexport const RowSection: React.FC<RowSectionProps> = ({\n row,\n rowNumber,\n hasWings,\n section,\n sectionIndex,\n onSeatToggled,\n selectedServicesMap,\n currentPassengerId,\n currentPassengerName,\n currentSegmentId,\n}) => {\n const rowLength = Object.keys(row.sections).length;\n const isOneSectionRow = rowLength === 1;\n\n return (\n <React.Fragment key={sectionIndex}>\n <div\n className={classNames(\"map-section\", {\n \"map-section--left\": sectionIndex === 0,\n \"map-section--right\": !isOneSectionRow\n ? sectionIndex === rowLength - 1\n : false,\n \"map-section--wing\": hasWings,\n })}\n >\n {section.elements.length > 0 ? (\n section.elements.map((element, elementIndex) => (\n <React.Fragment key={elementIndex}>\n <Element\n sectionIndex={sectionIndex}\n elementIndex={elementIndex}\n element={element}\n selectedServicesMap={selectedServicesMap}\n onSeatToggled={onSeatToggled}\n currentPassengerId={currentPassengerId}\n currentSegmentId={currentSegmentId}\n currentPassengerName={currentPassengerName}\n />\n </React.Fragment>\n ))\n ) : (\n <EmptyElement />\n )}\n </div>\n {(sectionIndex < rowLength - 1 ||\n (isOneSectionRow && sectionIndex < rowLength)) && (\n <span className=\"map-section__aisle\">{rowNumber}</span>\n )}\n {isOneSectionRow && sectionIndex === row.sections.length - 1 && (\n <EmptyElement />\n )}\n </React.Fragment>\n );\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { SeatMapCabinRowSectionElement } from \"@duffel/api/types\";\n\nexport function isAmenityElement(element: SeatMapCabinRowSectionElement) {\n return (\n element.type === \"bassinet\" ||\n element.type === \"lavatory\" ||\n element.type === \"closet\" ||\n element.type === \"galley\" ||\n element.type === \"stairs\"\n );\n}\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { Icon, IconName } from \"@components/shared/Icon\";\nimport { SeatMapCabinRowSectionElementAmenity } from \"@duffel/api/types\";\nimport classNames from \"classnames\";\nimport * as React from \"react\";\n\nconst amenitiesWithoutWrapper = [\"bassinet\", \"exit_row\"];\n\nexport interface AmenityProps {\n type: SeatMapCabinRowSectionElementAmenity;\n}\n\nexport const Amenity: React.FC<AmenityProps> = ({ type }) => (\n <div\n className={classNames(\"map-element map-element--amenity\", {\n \"map-element--wrapped\": !amenitiesWithoutWrapper.includes(type),\n })}\n aria-label={type.toString()}\n >\n <Icon name={type as IconName} size={16} />\n </div>\n);\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import * as React from \"react\";\n\nexport const EmptyElement: React.FC = () => (\n <span className=\"map-element map-element--empty\" />\n);\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { Icon } from \"@components/shared/Icon\";\nimport classNames from \"classnames\";\nimport * as React from \"react\";\n\ninterface ExitElementProps {\n isRight: boolean;\n}\n\nexport const ExitElement: React.FC<ExitElementProps> = ({ isRight }) => (\n <div\n className={classNames(\"map-element map-element--exit\", {\n \"map-element--exit--right\": isRight,\n })}\n >\n {isRight ? <Icon name=\"exit_row_right\" /> : <Icon name=\"exit_row\" />}\n </div>\n);\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "export const getPassengerInitials = (passengerName = \"\") =>\n passengerName\n .split(\" \")\n .map((partOfTheName) => partOfTheName[0])\n .slice(0, 2)\n .join(\"\");\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { Icon } from \"@components/shared/Icon\";\nimport {\n CreateOrderService,\n SeatMapCabinRowSectionElementSeat,\n} from \"@duffel/api/types\";\nimport { getPassengerInitials } from \"@lib/getPassengerInitials\";\nimport { moneyStringFormatter } from \"@lib/moneyStringFormatter\";\nimport classNames from \"classnames\";\nimport * as React from \"react\";\nimport { SeatInfo } from \"./SeatInfo\";\nimport { SeatUnavailable } from \"./SeatUnavailable\";\nimport { WithSeatServiceInformation } from \"src/types\";\n\ninterface SeatElementProps {\n element: SeatMapCabinRowSectionElementSeat;\n currentSegmentId: string;\n currentPassengerId: string;\n currentPassengerName: string;\n onSeatToggled: (\n seatService: WithSeatServiceInformation<CreateOrderService>,\n ) => void;\n selectedServicesMap: Record<\n string,\n WithSeatServiceInformation<CreateOrderService>\n >;\n}\n\nexport const SeatElement: React.FC<SeatElementProps> = ({\n element,\n currentPassengerId,\n currentSegmentId,\n currentPassengerName,\n onSeatToggled,\n selectedServicesMap,\n}) => {\n const seatServiceFromElement = element.available_services.find(\n (service) => service.passenger_id === currentPassengerId,\n );\n const isRestrictedSeat = element.type === \"restricted_seat_general\";\n\n if (!seatServiceFromElement || isRestrictedSeat)\n return <SeatUnavailable seat={element} />;\n\n const selectedServiceFromMap = Object.values(selectedServicesMap).find(\n (service) =>\n service.serviceInformation?.designator === element.designator &&\n service.serviceInformation?.segmentId === currentSegmentId,\n );\n\n const isSeatSelected = selectedServiceFromMap != undefined;\n\n const seatLabel = isSeatSelected\n ? getPassengerInitials(\n selectedServiceFromMap.serviceInformation?.passengerName,\n )\n : element.designator.charAt(element.designator.length - 1);\n\n const isFeePayable =\n !isNaN(+seatServiceFromElement?.total_amount) &&\n +seatServiceFromElement?.total_amount !== 0;\n\n const isSeatSelectionAvaiable =\n !isSeatSelected &&\n seatServiceFromElement.passenger_id === currentPassengerId;\n\n const isActionable =\n !isSeatSelected ||\n (isSeatSelected &&\n currentSegmentId ===\n selectedServiceFromMap.serviceInformation?.segmentId &&\n currentPassengerId ===\n selectedServiceFromMap.serviceInformation?.passengerId);\n\n const seatClassName = classNames(\"map-element\", \"map-element__seat\", {\n \"map-element--available\": isSeatSelectionAvaiable,\n \"map-element--selected\": isSeatSelected,\n \"map-element--actionable\": isActionable,\n });\n\n const priceLabel = moneyStringFormatter(\n seatServiceFromElement.total_currency,\n )(+seatServiceFromElement.total_amount);\n\n const isSeatInfoDisplayed =\n isSeatSelected &&\n currentSegmentId === selectedServiceFromMap.serviceInformation?.segmentId &&\n currentPassengerId ===\n selectedServiceFromMap.serviceInformation?.passengerId;\n\n return (\n <>\n <button\n type=\"button\"\n data-testid={`seat-${element.designator}`}\n id={element.designator}\n className={seatClassName}\n onClick={() => {\n if (!isActionable) return;\n onSeatToggled({\n quantity: isSeatSelected ? 0 : 1,\n id: seatServiceFromElement.id,\n serviceInformation: {\n type: \"seat\",\n segmentId: currentSegmentId,\n passengerId: currentPassengerId,\n passengerName: currentPassengerName,\n designator: element.designator,\n disclosures: element.disclosures,\n total_amount: seatServiceFromElement.total_amount,\n total_currency: seatServiceFromElement.total_currency,\n },\n });\n }}\n aria-label={`${element.designator} ${\n element.name || \"Seat\"\n } ${priceLabel}`}\n >\n {isFeePayable && (\n <Icon\n name=\"seat_paid_indicator\"\n className=\"map-element--fee-payable\"\n size={16}\n />\n )}\n {seatLabel}\n </button>\n {isSeatInfoDisplayed && (\n <SeatInfo seat={element} service={seatServiceFromElement} />\n )}\n </>\n );\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import {\n SeatMapCabinRowSectionAvailableService,\n SeatMapCabinRowSectionElementSeat,\n} from \"@duffel/api/types\";\nimport { moneyStringFormatter } from \"@lib/moneyStringFormatter\";\nimport * as React from \"react\";\n\nexport interface SeatInfoProps {\n seat: SeatMapCabinRowSectionElementSeat | null;\n service: SeatMapCabinRowSectionAvailableService | undefined;\n}\n\nexport const SeatInfo: React.FC<SeatInfoProps> = ({ seat, service }) => {\n const price = service\n ? moneyStringFormatter(service.total_currency)(+service.total_amount)\n : \"\";\n\n return (\n <div className=\"seat-info\">\n <div className=\"seat-info__details\">\n <strong>{seat?.designator}</strong>\n <span>{seat?.name || \"Seat\"} </span>\n <strong>{price}</strong>\n </div>\n {seat?.disclosures.map((disclosure, index) => (\n <div key={index} className=\"seat-info__disclosure\">\n {disclosure}\n </div>\n ))}\n </div>\n );\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { Icon } from \"@components/shared/Icon\";\nimport { SeatMapCabinRowSectionElementSeat } from \"@duffel/api/types\";\nimport * as React from \"react\";\n\nexport const SeatUnavailable: React.FC<{\n seat: SeatMapCabinRowSectionElementSeat;\n}> = ({ seat }) => (\n <span\n className=\"map-element map-element__seat\"\n aria-label={`${seat.designator} ${seat.name || \"Seat\"} Unavailable`}\n >\n <Icon name=\"close\" size={14} />\n </span>\n);\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import {\n CreateOrderService,\n SeatMapCabinRowSectionElement,\n} from \"@duffel/api/types\";\nimport { isAmenityElement } from \"@lib/isAmenityElement\";\nimport { isSeatElement } from \"@lib/isSeatElement\";\nimport * as React from \"react\";\nimport { WithSeatServiceInformation } from \"src/types\";\nimport { Amenity } from \"./Amenity\";\nimport { EmptyElement } from \"./EmptyElement\";\nimport { ExitElement } from \"./ExitElement\";\nimport { SeatElement } from \"./SeatElement\";\n\ninterface ElementProps {\n sectionIndex: number;\n elementIndex: number;\n element: SeatMapCabinRowSectionElement;\n selectedServicesMap: Record<\n string,\n WithSeatServiceInformation<CreateOrderService>\n >;\n onSeatToggled: (\n seatService: WithSeatServiceInformation<CreateOrderService>,\n ) => void;\n currentPassengerId: string;\n currentSegmentId: string;\n currentPassengerName: string;\n}\n\nexport const Element: React.FC<ElementProps> = ({\n element,\n elementIndex,\n sectionIndex,\n onSeatToggled,\n selectedServicesMap,\n currentPassengerId,\n currentSegmentId,\n currentPassengerName,\n}) => {\n return (\n <>\n {isSeatElement(element) ? (\n <SeatElement\n currentSegmentId={currentSegmentId}\n currentPassengerId={currentPassengerId}\n currentPassengerName={currentPassengerName}\n selectedServicesMap={selectedServicesMap}\n key={elementIndex}\n element={element}\n onSeatToggled={onSeatToggled}\n />\n ) : element.type === \"empty\" ? (\n <EmptyElement key={elementIndex} />\n ) : element.type === \"exit_row\" ? (\n <ExitElement key={elementIndex} isRight={sectionIndex > 0} />\n ) : isAmenityElement(element) ? (\n <Amenity key={elementIndex} type={element.type} />\n ) : null}\n </>\n );\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { CreateOrderService, SeatMapCabinRow } from \"@duffel/api/types\";\nimport { getRowNumber } from \"@lib/getRowNumber\";\nimport * as React from \"react\";\nimport { WithSeatServiceInformation } from \"src/types\";\nimport { RowSection } from \"./RowSection\";\n\nexport interface RowProps {\n row: SeatMapCabinRow;\n hasWings: boolean;\n selectedServicesMap: Record<\n string,\n WithSeatServiceInformation<CreateOrderService>\n >;\n onSeatToggled: (\n seatService: WithSeatServiceInformation<CreateOrderService>,\n ) => void;\n currentPassengerId: string;\n currentPassengerName: string;\n currentSegmentId: string;\n}\n\nexport const Row: React.FC<RowProps> = ({\n row,\n hasWings,\n onSeatToggled,\n selectedServicesMap,\n currentPassengerId,\n currentPassengerName,\n currentSegmentId,\n}) => {\n const rowNumber = getRowNumber(row);\n\n return (\n <>\n {row.sections.map((section, sectionIndex) => (\n <RowSection\n key={sectionIndex}\n row={row}\n rowNumber={rowNumber}\n hasWings={hasWings}\n section={section}\n sectionIndex={sectionIndex}\n selectedServicesMap={selectedServicesMap}\n onSeatToggled={onSeatToggled}\n currentPassengerId={currentPassengerId}\n currentPassengerName={currentPassengerName}\n currentSegmentId={currentSegmentId}\n />\n ))}\n </>\n );\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { NonIdealState } from \"@components/shared/NonIdealState\";\nimport * as React from \"react\";\n\nexport const SeatMapUnavailable: React.FC = () => (\n <NonIdealState>\n <p style={{ marginBlock: \"0\" }} className=\"p1--semibold\">\n Seat selection unavailable\n </p>\n <p\n className=\"p1--regular\"\n style={{\n color: \"var(--GREY-600)\",\n marginBlock: \"12px\",\n textAlign: \"center\",\n }}\n >\n Unfortunately seat selection is not available for this flight. A seat will\n be allocated by the airline.\n </p>\n </NonIdealState>\n);\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { ModalBody } from \"@components/shared/Modal\";\nimport React from \"react\";\nimport { SeatMap, SeatMapProps } from \"./SeatMap\";\n\nexport type SeatSelectionModalBodyProps = SeatMapProps;\n\nexport const SeatSelectionModalBody: React.FC<SeatSelectionModalBodyProps> = (\n props,\n) => (\n <ModalBody>\n <SeatMap {...props} />\n </ModalBody>\n);\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { Button } from \"@components/shared/Button\";\nimport { ServicePriceMapById } from \"@lib/getServicePriceMapById\";\nimport { getTotalAmountForServicesWithPriceMap } from \"@lib/getTotalAmountForServices\";\nimport { getTotalQuantity } from \"@lib/getTotalQuantity\";\nimport { moneyStringFormatter } from \"@lib/moneyStringFormatter\";\nimport { withPlural } from \"@lib/withPlural\";\nimport React from \"react\";\nimport { CreateOrder, SeatMap } from \"@duffel/api/types\";\n\nexport interface SeatSelectionModalFooterProps {\n currency: string;\n selectedServices: CreateOrder[\"services\"];\n servicePrices: ServicePriceMapById;\n\n isFirstSegment: boolean;\n isLastSegment: boolean;\n\n onNextSegmentButtonClicked: () => void;\n onPreviousSegmentButtonClicked: () => void;\n onClose: () => void;\n seatMaps: SeatMap[];\n}\n\nexport const SeatSelectionModalFooter: React.FC<\n SeatSelectionModalFooterProps\n> = ({\n selectedServices,\n servicePrices,\n currency,\n isFirstSegment,\n isLastSegment,\n onNextSegmentButtonClicked,\n onPreviousSegmentButtonClicked,\n onClose,\n seatMaps,\n}) => {\n const totalQuantity = getTotalQuantity(selectedServices);\n const totalAmount = getTotalAmountForServicesWithPriceMap(\n servicePrices,\n selectedServices,\n seatMaps,\n );\n const totalAmountLabel = moneyStringFormatter(currency)(totalAmount);\n const isOneWay = isFirstSegment && isLastSegment;\n\n return (\n <div style={{ padding: \"16px 24px 24px\" }}>\n <div className=\"flex--space-between\">\n <div>Price for {withPlural(totalQuantity, \"seat\", \"seats\")}</div>\n <div className=\"h3--semibold\">+ {totalAmountLabel}</div>\n </div>\n\n <div\n style={\n isOneWay\n ? { marginTop: \"16px\", display: \"grid\" }\n : {\n marginTop: \"16px\",\n display: \"grid\",\n columnGap: \"12px\",\n gridTemplateColumns: \"repeat(2, 1fr)\",\n }\n }\n >\n {!isOneWay && (\n <Button\n size={48}\n disabled={isFirstSegment}\n variant=\"outlined\"\n onClick={() => onPreviousSegmentButtonClicked()}\n >\n Back\n </Button>\n )}\n\n <Button\n size={48}\n data-testid=\"confirm-selection-for-seats\"\n onClick={() =>\n isLastSegment ? onClose() : onNextSegmentButtonClicked()\n }\n >\n {isLastSegment ? \"Confirm\" : \"Next\"}\n </Button>\n </div>\n </div>\n );\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { OfferSliceSegment } from \"@duffel/api/types\";\nimport { formatDateString } from \"@lib/formatDate\";\nimport React from \"react\";\n\nexport interface SeatSelectionModalHeaderProps {\n segmentAndPassengerPermutationsCount: number;\n currentSegment: OfferSliceSegment;\n currentPassengerName: string;\n\n currentSegmentAndPassengerPermutationsIndex: number;\n setCurrentSegmentAndPassengerPermutationsIndex: (index: number) => void;\n}\n\nexport const SeatSelectionModalHeader: React.FC<\n SeatSelectionModalHeaderProps\n> = ({\n segmentAndPassengerPermutationsCount,\n currentSegmentAndPassengerPermutationsIndex,\n currentSegment,\n currentPassengerName,\n setCurrentSegmentAndPassengerPermutationsIndex,\n}) => (\n <div style={{ padding: \"24px 24px 16px\" }}>\n {segmentAndPassengerPermutationsCount > 1 && (\n <div style={{ display: \"flex\", columnGap: \"4px\" }}>\n {Array(segmentAndPassengerPermutationsCount)\n .fill(0)\n .map((_, index) =>\n index === currentSegmentAndPassengerPermutationsIndex ? (\n <ActiveSegment key={`segment_${index}`} />\n ) : (\n <InactiveSegment\n key={`segment_${index}`}\n onClick={() =>\n setCurrentSegmentAndPassengerPermutationsIndex(index)\n }\n />\n ),\n )}\n </div>\n )}\n <h2\n className=\"h3--semibold\"\n style={\n segmentAndPassengerPermutationsCount > 1\n ? { marginBlock: \"12px 0px\" }\n : {}\n }\n >\n Flight to {currentSegment.destination.iata_code}\n <span\n className=\"p2--regular\"\n style={{\n color: \"var(--GREY-600)\",\n marginLeft: \"8px\",\n }}\n >\n {formatDateString(currentSegment.departing_at)}\n </span>\n </h2>\n <p\n className=\"h3--semibold\"\n style={{ color: `var(--GREY-600)`, marginBlock: \"0 4px\" }}\n >\n {currentPassengerName}\n </p>\n </div>\n);\n\nconst InactiveSegment: React.FC<{\n style?: React.CSSProperties;\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n}> = ({ onClick, style }) => (\n <button\n type=\"button\"\n onClick={onClick}\n style={{\n border: \"none\",\n width: \"4px\",\n height: \"4px\",\n padding: \"0\",\n borderRadius: \"4px\",\n backgroundColor:\n \"var(--TERTIARY, rgba(var(--ACCENT), var(--ACCENT-LIGHT-200)))\",\n transition: \"background-color 0.3s var(--TRANSITION-CUBIC-BEZIER)\",\n ...style,\n }}\n />\n);\n\nconst ActiveSegment = () => (\n <InactiveSegment\n onClick={undefined}\n style={{\n backgroundColor: \"var(--SECONDARY, rgb(var(--ACCENT)))\",\n }}\n />\n);\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { ErrorBoundary } from \"@components/shared/ErrorBoundary\";\nimport { hasHighLuminance } from \"@lib/hasHighLuminance\";\nimport { initializeLogger } from \"@lib/logging\";\nimport {\n CardElement,\n Elements,\n useElements,\n useStripe,\n} from \"@stripe/react-stripe-js\";\nimport { StripeCardElement, StripeError, loadStripe } from \"@stripe/stripe-js\";\nimport * as React from \"react\";\nimport { CustomStyles } from \"../../types\";\nimport { Button } from \"../shared/Button\";\nimport { WithComponentStyles } from \"@components/shared/WithComponentStyles\";\n\nconst STRIPE_CARD_ELEMENT = \"card\";\nconst COMPONENT_VERSION = process.env.COMPONENT_VERSION;\n\nexport interface DuffelPaymentsProps {\n paymentIntentClientToken: string;\n onSuccessfulPayment: () => void;\n onFailedPayment: (error: StripeError) => void;\n\n styles?: CustomStyles;\n debug?: boolean;\n}\n\nconst CARD_ELEMENT_STYLE_BASE = {\n color: \"var(--GREY-900)\",\n fontFamily:\n '\"-apple-system\", \"BlinkMacSystemFont\", \"Segoe UI\", \"Roboto\", \"Oxygen\", \"Ubuntu\", \"Cantarell\", \"Fira Sans\", \"Droid Sans\", \"Helvetica Neue\", \"sans-serif\"',\n fontSmoothing: \"antialiased\",\n fontSize: \"16px\",\n \"::placeholder\": {\n color: \"#ababb4\",\n },\n};\n\nconst CARD_ELEMENT_STYLE_INVALID = {\n color: \"#ef4444\",\n iconColor: \"#ef4444\",\n};\n\nconst CardPaymentComponent: React.FC<DuffelPaymentsProps> = ({\n styles,\n paymentIntentClientToken,\n onSuccessfulPayment,\n onFailedPayment,\n}) => {\n const [cardElement, setCardElement] =\n React.useState<StripeCardElement | null>(null);\n const [isComplete, setIsComplete] = React.useState<boolean>(false);\n const [isInvalid, setIsInvalid] = React.useState<boolean>(false);\n const [isProcessing, setIsProcessing] = React.useState<boolean>(false);\n const [errorMessage, setErrorMessage] = React.useState<string>(\"\");\n const stripe = useStripe();\n const elements = useElements();\n\n React.useEffect(() => {\n if (elements && !cardElement) {\n const maybeCard = elements?.getElement(STRIPE_CARD_ELEMENT);\n maybeCard && setCardElement(maybeCard as StripeCardElement);\n }\n }, [elements, cardElement]);\n\n React.useEffect(() => {\n if (cardElement) {\n cardElement.on(\"change\", (event) => {\n const { error, complete } = event;\n\n if (error) {\n setIsInvalid(true);\n setErrorMessage(error.message);\n } else {\n setIsInvalid(false);\n }\n complete ? setIsComplete(true) : setIsComplete(false);\n });\n }\n }, [cardElement]);\n\n // User is responsible for handling outcome of payment.\n const handleSubmit = async (\n e: React.MouseEvent<HTMLFormElement, MouseEvent>,\n ) => {\n e.preventDefault();\n if (!stripe || !elements) {\n return;\n }\n\n if (cardElement) {\n setIsProcessing(true);\n const decodedDuffelPaymentIntentClientToken = atob(\n paymentIntentClientToken,\n );\n const parsedDuffelPaymentIntentClientToken = JSON.parse(\n decodedDuffelPaymentIntentClientToken,\n );\n const { client_secret: clientSecret } =\n parsedDuffelPaymentIntentClientToken;\n\n const result = await stripe.confirmCardPayment(clientSecret, {\n payment_method: {\n card: cardElement,\n metadata: {\n duffel_components_version:\n COMPONENT_VERSION || \"failed-to-get-version\",\n },\n },\n });\n\n setIsProcessing(false);\n if (result.error) {\n const { error } = result;\n onFailedPayment(error);\n } else {\n onSuccessfulPayment();\n }\n }\n };\n\n return paymentIntentClientToken ? (\n <div className=\"card-payment__container\">\n <form onSubmit={handleSubmit}>\n {isProcessing && (\n <div\n className=\"card-payment--in-progress\"\n aria-live=\"polite\"\n aria-busy=\"true\"\n />\n )}\n <CardElement\n className=\"card-details\"\n options={{\n style: {\n base: {\n ...CARD_ELEMENT_STYLE_BASE,\n ...(styles?.fontFamily && {\n fontFamily: styles.fontFamily,\n }),\n },\n invalid: { ...CARD_ELEMENT_STYLE_INVALID },\n },\n }}\n />\n <div className=\"card-payment__container--invalid\" role=\"alert\">\n {isInvalid && errorMessage}\n </div>\n <Button\n className=\"card-payment__pay-button\"\n type=\"submit\"\n disabled={!isComplete || isProcessing}\n aria-label=\"Pay\"\n >\n {isProcessing ? \"Processing...\" : \"Pay\"}\n </Button>\n </form>\n </div>\n ) : null;\n};\n\nexport const DuffelPayments: React.FC<DuffelPaymentsProps> = (props) => {\n const [stripe, setStripe] = React.useState<Promise<any> | null>(null);\n initializeLogger(props.debug || false);\n\n const decodedDuffelPaymentIntentClientToken = atob(\n props.paymentIntentClientToken,\n );\n\n let parsedDuffelPaymentIntentClientToken;\n\n try {\n parsedDuffelPaymentIntentClientToken = JSON.parse(\n decodedDuffelPaymentIntentClientToken,\n );\n } catch (error) {\n throw new Error(\"Invalid Duffel payment intent client token provided\");\n }\n\n const { publishable_key: duffelPublishableKey } =\n parsedDuffelPaymentIntentClientToken;\n\n React.useEffect(() => {\n if (!stripe && duffelPublishableKey) {\n const stripe = loadStripe(duffelPublishableKey);\n stripe && setStripe(stripe);\n }\n }, [stripe, duffelPublishableKey]);\n\n const duffelComponentsStyle: React.CSSProperties = {\n ...(props.styles?.accentColor && {\n \"--ACCENT\": props.styles.accentColor,\n }),\n ...(props.styles?.accentColor &&\n hasHighLuminance(props.styles.accentColor) && {\n \"--SECONDARY\": \"black\",\n \"--TERTIARY\": \"grey\",\n }),\n ...(props.styles?.fontFamily && {\n \"--FONT-FAMILY\": props.styles.fontFamily,\n }),\n ...(props.styles?.buttonCornerRadius && {\n \"--BUTTON-RADIUS\": props.styles.buttonCornerRadius,\n }),\n // `as any` is needed here is needed because we want to set css variables\n // that are not part of the css properties type\n } as any;\n\n return (\n <WithComponentStyles>\n <div style={duffelComponentsStyle}>\n <ErrorBoundary>\n <Elements stripe={stripe}>\n <CardPaymentComponent {...props} />\n </Elements>\n </ErrorBoundary>\n </div>\n </WithComponentStyles>\n );\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "var V3_URL = 'https://js.stripe.com/v3';\nvar V3_URL_REGEX = /^https:\\/\\/js\\.stripe\\.com\\/v3\\/?(\\?.*)?$/;\nvar EXISTING_SCRIPT_MESSAGE = 'loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used';\nvar findScript = function findScript() {\n var scripts = document.querySelectorAll(\"script[src^=\\\"\".concat(V3_URL, \"\\\"]\"));\n\n for (var i = 0; i < scripts.length; i++) {\n var script = scripts[i];\n\n if (!V3_URL_REGEX.test(script.src)) {\n continue;\n }\n\n return script;\n }\n\n return null;\n};\n\nvar injectScript = function injectScript(params) {\n var queryString = params && !params.advancedFraudSignals ? '?advancedFraudSignals=false' : '';\n var script = document.createElement('script');\n script.src = \"\".concat(V3_URL).concat(queryString);\n var headOrBody = document.head || document.body;\n\n if (!headOrBody) {\n throw new Error('Expected document.body not to be null. Stripe.js requires a <body> element.');\n }\n\n headOrBody.appendChild(script);\n return script;\n};\n\nvar registerWrapper = function registerWrapper(stripe, startTime) {\n if (!stripe || !stripe._registerWrapper) {\n return;\n }\n\n stripe._registerWrapper({\n name: 'stripe-js',\n version: \"1.54.2\",\n startTime: startTime\n });\n};\n\nvar stripePromise = null;\nvar loadScript = function loadScript(params) {\n // Ensure that we only attempt to load Stripe.js at most once\n if (stripePromise !== null) {\n return stripePromise;\n }\n\n stripePromise = new Promise(function (resolve, reject) {\n if (typeof window === 'undefined' || typeof document === 'undefined') {\n // Resolve to null when imported server side. This makes the module\n // safe to import in an isomorphic code base.\n resolve(null);\n return;\n }\n\n if (window.Stripe && params) {\n console.warn(EXISTING_SCRIPT_MESSAGE);\n }\n\n if (window.Stripe) {\n resolve(window.Stripe);\n return;\n }\n\n try {\n var script = findScript();\n\n if (script && params) {\n console.warn(EXISTING_SCRIPT_MESSAGE);\n } else if (!script) {\n script = injectScript(params);\n }\n\n script.addEventListener('load', function () {\n if (window.Stripe) {\n resolve(window.Stripe);\n } else {\n reject(new Error('Stripe.js not available'));\n }\n });\n script.addEventListener('error', function () {\n reject(new Error('Failed to load Stripe.js'));\n });\n } catch (error) {\n reject(error);\n return;\n }\n });\n return stripePromise;\n};\nvar initStripe = function initStripe(maybeStripe, args, startTime) {\n if (maybeStripe === null) {\n return null;\n }\n\n var stripe = maybeStripe.apply(undefined, args);\n registerWrapper(stripe, startTime);\n return stripe;\n}; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\n// own script injection.\n\nvar stripePromise$1 = Promise.resolve().then(function () {\n return loadScript(null);\n});\nvar loadCalled = false;\nstripePromise$1[\"catch\"](function (err) {\n if (!loadCalled) {\n console.warn(err);\n }\n});\nvar loadStripe = function loadStripe() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n loadCalled = true;\n var startTime = Date.now();\n return stripePromise$1.then(function (maybeStripe) {\n return initStripe(maybeStripe, args, startTime);\n });\n};\n\nexport { loadStripe };\n", "import * as React from \"react\";\nimport classNames from \"classnames\";\n\ntype DivProps = JSX.IntrinsicElements[\"div\"];\nexport interface HSpaceProps extends DivProps {\n /**\n * A space-delimited list of class names to pass along to a child element.\n */\n className?: string;\n\n /**\n * The vertical spacing between each child element\n */\n space: 0 | 4 | 8 | 12 | 16;\n\n /**\n * If you'd like all children inside your horizontal space container\n * to be vertically aligned to the center of the div, you can set `alignCenter` to `true`\n *\n * Default: `false`\n */\n alignCenter?: boolean;\n\n /**\n * If you'd like all children inside your horizontal space container\n * to be spread out from one another, you can set `spaceBetween` to `true`\n *\n * Default: `false`\n */\n spaceBetween?: boolean;\n}\nexport const HSpace: React.FC<HSpaceProps> = ({\n className,\n space,\n alignCenter,\n spaceBetween,\n ...divProps\n}) => (\n <div\n className={classNames(\n \"h-space\",\n alignCenter && \"hspace--align-center\",\n spaceBetween && \"hspace--space-between\",\n `h-space--${space}`,\n className,\n )}\n {...divProps}\n ></div>\n);\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { HSpace } from \"@components/shared/HSpace\";\nimport { Icon, IconName } from \"@components/shared/Icon\";\nimport { Color } from \"@lib/colors\";\nimport * as React from \"react\";\n\nexport const Policy: React.FC<\n React.PropsWithChildren<{\n iconName: IconName;\n iconColor: Color;\n label?: string;\n }>\n> = ({ iconName, iconColor, label, children }) => (\n <HSpace space={8}>\n <div className=\"u-paddingTop2\">\n <Icon size={16} name={iconName} color={iconColor} />\n </div>\n <p style={{ color: \"var(--GREY-600)\" }}>\n {label && (\n <>\n <span style={{ fontWeight: \"medium\", color: \"var(--GREY-900)\" }}>\n {label}\n </span>{\" \"}\n \u2014{\" \"}\n </>\n )}\n {children}\n </p>\n </HSpace>\n);\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "/**\n * Checks if a string can be parsed into a JS date object\n *\n * @param date The string to be checked\n */\nexport const isValidDateString = (date: string) => !isNaN(Date.parse(date));\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { isValidDateString } from \"./isValidDateString\";\n\n/**\n * Creates JS date object based on an ISO string.\n * It adds a safe times to date only strings so it can be safely used by Intl\n * without breaking based on locale.\n *\n * This function return null if the string cannot be parsed into a Date\n *\n * @param fromISO The ISO-8601 date string to be converted into a JS date object\n */\nexport const getDateObject = (fromISO: string): Date | null => {\n if (!isValidDateString(fromISO)) return null;\n\n if (fromISO.match(/([0-1]?[0-9]|2[0-3]):[0-5][0-9]/)) {\n return new Date(fromISO);\n } else {\n if (fromISO.includes(\"/\")) {\n return new Date(`${fromISO} 12:00:00 UTC`);\n } else {\n return new Date(`${fromISO}T12:00:00Z`);\n }\n }\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { getDateObject } from \"./getDateObject\";\n\nconst formats = {\n short: {\n year: \"numeric\",\n month: \"numeric\",\n day: \"numeric\",\n },\n shortWithTime: {\n year: \"numeric\",\n month: \"numeric\",\n day: \"numeric\",\n hour: \"numeric\",\n minute: \"numeric\",\n },\n medium: {\n year: \"numeric\",\n month: \"short\",\n day: \"numeric\",\n },\n mediumNoYear: {\n month: \"short\",\n day: \"numeric\",\n },\n mediumWithTime: {\n year: \"numeric\",\n month: \"short\",\n day: \"numeric\",\n hour: \"numeric\",\n minute: \"numeric\",\n },\n mediumWithTimeAndTimezone: {\n year: \"numeric\",\n month: \"short\",\n day: \"numeric\",\n hour: \"numeric\",\n minute: \"numeric\",\n timeZoneName: \"short\",\n hour12: true,\n },\n long: {\n weekday: \"short\",\n year: \"numeric\",\n month: \"short\",\n day: \"numeric\",\n },\n longNoYear: {\n weekday: \"short\",\n month: \"short\",\n day: \"numeric\",\n },\n longWithTime: {\n weekday: \"short\",\n year: \"numeric\",\n month: \"short\",\n day: \"numeric\",\n hour: \"numeric\",\n minute: \"numeric\",\n hour12: false,\n },\n timeOnlyWithTimezone: {\n hour: \"numeric\",\n minute: \"numeric\",\n hour12: true,\n timeZoneName: \"short\",\n },\n timeOnly: {\n hour: \"numeric\",\n minute: \"numeric\",\n hour12: true,\n },\n} as const;\n\nexport type DateTimeDisplayFormat = keyof typeof formats;\n\nexport const getDateString = (\n original: Date | string | null,\n format: DateTimeDisplayFormat,\n locale = \"en-GB\",\n) => {\n if (!original) return \"\";\n const date =\n typeof original === \"string\" ? getDateObject(original) : original;\n if (!date) return \"\";\n return new Intl.DateTimeFormat(locale, formats[format]).format(date);\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import * as React from \"react\";\nimport classNames from \"classnames\";\n\ntype DivProps = JSX.IntrinsicElements[\"div\"];\nexport interface VSpaceProps extends DivProps {\n /**\n * A space-delimited list of class names to pass along to a child element.\n */\n className?: string;\n\n /**\n * The vertical spacing between each child element\n */\n space: 0 | 4 | 8 | 12 | 16 | 24;\n}\nexport const VSpace: React.FC<VSpaceProps> = ({\n className,\n space,\n ...divProps\n}) => (\n <div\n className={classNames(\"v-space\", `v-space--${space}`, className)}\n {...divProps}\n ></div>\n);\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import * as React from \"react\";\nimport classNames from \"classnames\";\nimport { VSpace } from \"@components/shared/VSpace\";\nimport { HSpace } from \"@components/shared/HSpace\";\nimport { Color } from \"@lib/colors\";\n\nexport interface TimelineItemProps {\n label?: string | React.ReactNode;\n description?: string;\n dot?: boolean;\n dotColor?: Color;\n lineColorLeft?: Color;\n lineColorRight?: Color;\n size?: \"extra-small\" | \"small\" | \"medium\" | \"large\" | \"extra-large\";\n tooltip?: string | boolean;\n aboveDot?: React.ReactNode;\n date?: string;\n}\n\nexport const TimelineItem = React.forwardRef<HTMLDivElement, TimelineItemProps>(\n (\n {\n label,\n description,\n dot = true,\n dotColor,\n lineColorLeft = \"var(--GREY-300)\",\n lineColorRight = \"var(--GREY-300)\",\n tooltip,\n size,\n aboveDot,\n date,\n },\n ref,\n ) => {\n return (\n <VSpace\n space={12}\n className={classNames(\"timeline-item-container\", {\n \"timeline-item-container--extra-small\": size === \"extra-small\",\n \"timeline-item-container--small\": size === \"small\",\n \"timeline-item-container--large\": size === \"large\",\n \"timeline-item-container--extra-large\": size === \"extra-large\",\n })}\n ref={ref}\n >\n {tooltip && (\n <div className=\"timeline-item-tooltip\">\n Today\n <div className=\"timeline-item-tooltip-arrow\" />\n </div>\n )}\n <HSpace space={0}>\n <div\n className=\"timeline-item-line\"\n style={{ backgroundColor: `var(${lineColorLeft})` }}\n />\n {aboveDot && (\n <div className=\"timeline-item-above-dot\">{aboveDot}</div>\n )}\n {dot && (\n <div\n className=\"timeline-item-dot\"\n style={dotColor ? { backgroundColor: `var(${dotColor})` } : {}}\n />\n )}\n {label && (\n <VSpace space={0} className=\"timeline-item\">\n {date && (\n <p style={{ textAlign: \"center\", color: \"var(--GREY-600)\" }}>\n {date}\n </p>\n )}\n <p style={{ textAlign: \"center\", fontWeight: \"medium\" }}>\n {label}\n </p>\n <p style={{ textAlign: \"center\" }}>{description}</p>\n </VSpace>\n )}\n <div\n className=\"timeline-item-line\"\n style={{\n backgroundColor: `var(${lineColorRight})`,\n left: dot ? \"calc(50% + 8px)\" : \"50%\",\n width: dot ? \"calc(50% - 8px)\" : \"50%\",\n }}\n />\n </HSpace>\n </VSpace>\n );\n },\n);\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "/**\n * Checks if an ISO string is a timezoned date.\n */\n\nimport { isValidDateString } from \"@lib/isValidDateString\";\n\nexport const isTimezoneDate = (date: string) => {\n if (!isValidDateString(date)) {\n return false;\n }\n\n return (\n date.endsWith(\"Z\") || date.endsWith(\"+00:00\") || date.endsWith(\"-00:00\")\n );\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "const formatDistanceLocale = {\n lessThanXSeconds: {\n one: \"less than a second\",\n other: \"less than {{count}} seconds\",\n },\n\n xSeconds: {\n one: \"1 second\",\n other: \"{{count}} seconds\",\n },\n\n halfAMinute: \"half a minute\",\n\n lessThanXMinutes: {\n one: \"less than a minute\",\n other: \"less than {{count}} minutes\",\n },\n\n xMinutes: {\n one: \"1 minute\",\n other: \"{{count}} minutes\",\n },\n\n aboutXHours: {\n one: \"about 1 hour\",\n other: \"about {{count}} hours\",\n },\n\n xHours: {\n one: \"1 hour\",\n other: \"{{count}} hours\",\n },\n\n xDays: {\n one: \"1 day\",\n other: \"{{count}} days\",\n },\n\n aboutXWeeks: {\n one: \"about 1 week\",\n other: \"about {{count}} weeks\",\n },\n\n xWeeks: {\n one: \"1 week\",\n other: \"{{count}} weeks\",\n },\n\n aboutXMonths: {\n one: \"about 1 month\",\n other: \"about {{count}} months\",\n },\n\n xMonths: {\n one: \"1 month\",\n other: \"{{count}} months\",\n },\n\n aboutXYears: {\n one: \"about 1 year\",\n other: \"about {{count}} years\",\n },\n\n xYears: {\n one: \"1 year\",\n other: \"{{count}} years\",\n },\n\n overXYears: {\n one: \"over 1 year\",\n other: \"over {{count}} years\",\n },\n\n almostXYears: {\n one: \"almost 1 year\",\n other: \"almost {{count}} years\",\n },\n};\n\nexport const formatDistance = (token, count, options) => {\n let result;\n\n const tokenValue = formatDistanceLocale[token];\n if (typeof tokenValue === \"string\") {\n result = tokenValue;\n } else if (count === 1) {\n result = tokenValue.one;\n } else {\n result = tokenValue.other.replace(\"{{count}}\", count.toString());\n }\n\n if (options?.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return \"in \" + result;\n } else {\n return result + \" ago\";\n }\n }\n\n return result;\n};\n", "export function buildFormatLongFn(args) {\n return (options = {}) => {\n // TODO: Remove String()\n const width = options.width ? String(options.width) : args.defaultWidth;\n const format = args.formats[width] || args.formats[args.defaultWidth];\n return format;\n };\n}\n", "import { buildFormatLongFn } from \"../../_lib/buildFormatLongFn.js\";\n\nconst dateFormats = {\n full: \"EEEE, MMMM do, y\",\n long: \"MMMM do, y\",\n medium: \"MMM d, y\",\n short: \"MM/dd/yyyy\",\n};\n\nconst timeFormats = {\n full: \"h:mm:ss a zzzz\",\n long: \"h:mm:ss a z\",\n medium: \"h:mm:ss a\",\n short: \"h:mm a\",\n};\n\nconst dateTimeFormats = {\n full: \"{{date}} 'at' {{time}}\",\n long: \"{{date}} 'at' {{time}}\",\n medium: \"{{date}}, {{time}}\",\n short: \"{{date}}, {{time}}\",\n};\n\nexport const formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: \"full\",\n }),\n\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: \"full\",\n }),\n\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: \"full\",\n }),\n};\n", "const formatRelativeLocale = {\n lastWeek: \"'last' eeee 'at' p\",\n yesterday: \"'yesterday at' p\",\n today: \"'today at' p\",\n tomorrow: \"'tomorrow at' p\",\n nextWeek: \"eeee 'at' p\",\n other: \"P\",\n};\n\nexport const formatRelative = (token, _date, _baseDate, _options) =>\n formatRelativeLocale[token];\n", "/**\n * The localize function argument callback which allows to convert raw value to\n * the actual type.\n *\n * @param value - The value to convert\n *\n * @returns The converted value\n */\n\n/**\n * The map of localized values for each width.\n */\n\n/**\n * The index type of the locale unit value. It types conversion of units of\n * values that don't start at 0 (i.e. quarters).\n */\n\n/**\n * Converts the unit value to the tuple of values.\n */\n\n/**\n * The tuple of localized era values. The first element represents BC,\n * the second element represents AD.\n */\n\n/**\n * The tuple of localized quarter values. The first element represents Q1.\n */\n\n/**\n * The tuple of localized day values. The first element represents Sunday.\n */\n\n/**\n * The tuple of localized month values. The first element represents January.\n */\n\nexport function buildLocalizeFn(args) {\n return (value, options) => {\n const context = options?.context ? String(options.context) : \"standalone\";\n\n let valuesArray;\n if (context === \"formatting\" && args.formattingValues) {\n const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;\n const width = options?.width ? String(options.width) : defaultWidth;\n\n valuesArray =\n args.formattingValues[width] || args.formattingValues[defaultWidth];\n } else {\n const defaultWidth = args.defaultWidth;\n const width = options?.width ? String(options.width) : args.defaultWidth;\n\n valuesArray = args.values[width] || args.values[defaultWidth];\n }\n const index = args.argumentCallback ? args.argumentCallback(value) : value;\n\n // @ts-expect-error - For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!\n return valuesArray[index];\n };\n}\n", "import { buildLocalizeFn } from \"../../_lib/buildLocalizeFn.js\";\n\nconst eraValues = {\n narrow: [\"B\", \"A\"],\n abbreviated: [\"BC\", \"AD\"],\n wide: [\"Before Christ\", \"Anno Domini\"],\n};\n\nconst quarterValues = {\n narrow: [\"1\", \"2\", \"3\", \"4\"],\n abbreviated: [\"Q1\", \"Q2\", \"Q3\", \"Q4\"],\n wide: [\"1st quarter\", \"2nd quarter\", \"3rd quarter\", \"4th quarter\"],\n};\n\n// Note: in English, the names of days of the week and months are capitalized.\n// If you are making a new locale based on this one, check if the same is true for the language you're working on.\n// Generally, formatted dates should look like they are in the middle of a sentence,\n// e.g. in Spanish language the weekdays and months should be in the lowercase.\nconst monthValues = {\n narrow: [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"],\n abbreviated: [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n ],\n\n wide: [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n ],\n};\n\nconst dayValues = {\n narrow: [\"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"],\n short: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],\n abbreviated: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n wide: [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n ],\n};\n\nconst dayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n};\n\nconst formattingDayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n};\n\nconst ordinalNumber = (dirtyNumber, _options) => {\n const number = Number(dirtyNumber);\n\n // If ordinal numbers depend on context, for example,\n // if they are different for different grammatical genders,\n // use `options.unit`.\n //\n // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',\n // 'day', 'hour', 'minute', 'second'.\n\n const rem100 = number % 100;\n if (rem100 > 20 || rem100 < 10) {\n switch (rem100 % 10) {\n case 1:\n return number + \"st\";\n case 2:\n return number + \"nd\";\n case 3:\n return number + \"rd\";\n }\n }\n return number + \"th\";\n};\n\nexport const localize = {\n ordinalNumber,\n\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: \"wide\",\n }),\n\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: \"wide\",\n argumentCallback: (quarter) => quarter - 1,\n }),\n\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: \"wide\",\n }),\n\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: \"wide\",\n }),\n\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: \"wide\",\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: \"wide\",\n }),\n};\n", "export function buildMatchFn(args) {\n return (string, options = {}) => {\n const width = options.width;\n\n const matchPattern =\n (width && args.matchPatterns[width]) ||\n args.matchPatterns[args.defaultMatchWidth];\n const matchResult = string.match(matchPattern);\n\n if (!matchResult) {\n return null;\n }\n const matchedString = matchResult[0];\n\n const parsePatterns =\n (width && args.parsePatterns[width]) ||\n args.parsePatterns[args.defaultParseWidth];\n\n const key = Array.isArray(parsePatterns)\n ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString))\n : // [TODO] -- I challenge you to fix the type\n findKey(parsePatterns, (pattern) => pattern.test(matchedString));\n\n let value;\n\n value = args.valueCallback ? args.valueCallback(key) : key;\n value = options.valueCallback\n ? // [TODO] -- I challenge you to fix the type\n options.valueCallback(value)\n : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n\nfunction findKey(object, predicate) {\n for (const key in object) {\n if (\n Object.prototype.hasOwnProperty.call(object, key) &&\n predicate(object[key])\n ) {\n return key;\n }\n }\n return undefined;\n}\n\nfunction findIndex(array, predicate) {\n for (let key = 0; key < array.length; key++) {\n if (predicate(array[key])) {\n return key;\n }\n }\n return undefined;\n}\n", "export function buildMatchPatternFn(args) {\n return (string, options = {}) => {\n const matchResult = string.match(args.matchPattern);\n if (!matchResult) return null;\n const matchedString = matchResult[0];\n\n const parseResult = string.match(args.parsePattern);\n if (!parseResult) return null;\n let value = args.valueCallback\n ? args.valueCallback(parseResult[0])\n : parseResult[0];\n\n // [TODO] I challenge you to fix the type\n value = options.valueCallback ? options.valueCallback(value) : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n", "import { buildMatchFn } from \"../../_lib/buildMatchFn.js\";\nimport { buildMatchPatternFn } from \"../../_lib/buildMatchPatternFn.js\";\n\nconst matchOrdinalNumberPattern = /^(\\d+)(th|st|nd|rd)?/i;\nconst parseOrdinalNumberPattern = /\\d+/i;\n\nconst matchEraPatterns = {\n narrow: /^(b|a)/i,\n abbreviated: /^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,\n wide: /^(before christ|before common era|anno domini|common era)/i,\n};\nconst parseEraPatterns = {\n any: [/^b/i, /^(a|c)/i],\n};\n\nconst matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^q[1234]/i,\n wide: /^[1234](th|st|nd|rd)? quarter/i,\n};\nconst parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i],\n};\n\nconst matchMonthPatterns = {\n narrow: /^[jfmasond]/i,\n abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,\n wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i,\n};\nconst parseMonthPatterns = {\n narrow: [\n /^j/i,\n /^f/i,\n /^m/i,\n /^a/i,\n /^m/i,\n /^j/i,\n /^j/i,\n /^a/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n\n any: [\n /^ja/i,\n /^f/i,\n /^mar/i,\n /^ap/i,\n /^may/i,\n /^jun/i,\n /^jul/i,\n /^au/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n};\n\nconst matchDayPatterns = {\n narrow: /^[smtwf]/i,\n short: /^(su|mo|tu|we|th|fr|sa)/i,\n abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,\n wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i,\n};\nconst parseDayPatterns = {\n narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],\n any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],\n};\n\nconst matchDayPeriodPatterns = {\n narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,\n any: /^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i,\n};\nconst parseDayPeriodPatterns = {\n any: {\n am: /^a/i,\n pm: /^p/i,\n midnight: /^mi/i,\n noon: /^no/i,\n morning: /morning/i,\n afternoon: /afternoon/i,\n evening: /evening/i,\n night: /night/i,\n },\n};\n\nexport const match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: (value) => parseInt(value, 10),\n }),\n\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseEraPatterns,\n defaultParseWidth: \"any\",\n }),\n\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: \"any\",\n valueCallback: (index) => index + 1,\n }),\n\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: \"any\",\n }),\n\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseDayPatterns,\n defaultParseWidth: \"any\",\n }),\n\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: \"any\",\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: \"any\",\n }),\n};\n", "import { formatDistance } from \"./en-US/_lib/formatDistance.js\";\nimport { formatLong } from \"./en-US/_lib/formatLong.js\";\nimport { formatRelative } from \"./en-US/_lib/formatRelative.js\";\nimport { localize } from \"./en-US/_lib/localize.js\";\nimport { match } from \"./en-US/_lib/match.js\";\n\n/**\n * @category Locales\n * @summary English locale (United States).\n * @language English\n * @iso-639-2 eng\n * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)\n * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)\n */\nexport const enUS = {\n code: \"en-US\",\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 0 /* Sunday */,\n firstWeekContainsDate: 1,\n },\n};\n\n// Fallback for modularized imports:\nexport default enUS;\n", "let defaultOptions = {};\n\nexport function getDefaultOptions() {\n return defaultOptions;\n}\n\nexport function setDefaultOptions(newOptions) {\n defaultOptions = newOptions;\n}\n", "/**\n * @module constants\n * @summary Useful constants\n * @description\n * Collection of useful date constants.\n *\n * The constants could be imported from `date-fns/constants`:\n *\n * ```ts\n * import { maxTime, minTime } from \"./constants/date-fns/constants\";\n *\n * function isAllowedTime(time) {\n * return time <= maxTime && time >= minTime;\n * }\n * ```\n */\n\n/**\n * @constant\n * @name daysInWeek\n * @summary Days in 1 week.\n */\nexport const daysInWeek = 7;\n\n/**\n * @constant\n * @name daysInYear\n * @summary Days in 1 year.\n *\n * @description\n * How many days in a year.\n *\n * One years equals 365.2425 days according to the formula:\n *\n * > Leap year occurs every 4 years, except for years that are divisible by 100 and not divisible by 400.\n * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days\n */\nexport const daysInYear = 365.2425;\n\n/**\n * @constant\n * @name maxTime\n * @summary Maximum allowed time.\n *\n * @example\n * import { maxTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = 8640000000000001 <= maxTime;\n * //=> false\n *\n * new Date(8640000000000001);\n * //=> Invalid Date\n */\nexport const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;\n\n/**\n * @constant\n * @name minTime\n * @summary Minimum allowed time.\n *\n * @example\n * import { minTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = -8640000000000001 >= minTime;\n * //=> false\n *\n * new Date(-8640000000000001)\n * //=> Invalid Date\n */\nexport const minTime = -maxTime;\n\n/**\n * @constant\n * @name millisecondsInWeek\n * @summary Milliseconds in 1 week.\n */\nexport const millisecondsInWeek = 604800000;\n\n/**\n * @constant\n * @name millisecondsInDay\n * @summary Milliseconds in 1 day.\n */\nexport const millisecondsInDay = 86400000;\n\n/**\n * @constant\n * @name millisecondsInMinute\n * @summary Milliseconds in 1 minute\n */\nexport const millisecondsInMinute = 60000;\n\n/**\n * @constant\n * @name millisecondsInHour\n * @summary Milliseconds in 1 hour\n */\nexport const millisecondsInHour = 3600000;\n\n/**\n * @constant\n * @name millisecondsInSecond\n * @summary Milliseconds in 1 second\n */\nexport const millisecondsInSecond = 1000;\n\n/**\n * @constant\n * @name minutesInYear\n * @summary Minutes in 1 year.\n */\nexport const minutesInYear = 525600;\n\n/**\n * @constant\n * @name minutesInMonth\n * @summary Minutes in 1 month.\n */\nexport const minutesInMonth = 43200;\n\n/**\n * @constant\n * @name minutesInDay\n * @summary Minutes in 1 day.\n */\nexport const minutesInDay = 1440;\n\n/**\n * @constant\n * @name minutesInHour\n * @summary Minutes in 1 hour.\n */\nexport const minutesInHour = 60;\n\n/**\n * @constant\n * @name monthsInQuarter\n * @summary Months in 1 quarter.\n */\nexport const monthsInQuarter = 3;\n\n/**\n * @constant\n * @name monthsInYear\n * @summary Months in 1 year.\n */\nexport const monthsInYear = 12;\n\n/**\n * @constant\n * @name quartersInYear\n * @summary Quarters in 1 year\n */\nexport const quartersInYear = 4;\n\n/**\n * @constant\n * @name secondsInHour\n * @summary Seconds in 1 hour.\n */\nexport const secondsInHour = 3600;\n\n/**\n * @constant\n * @name secondsInMinute\n * @summary Seconds in 1 minute.\n */\nexport const secondsInMinute = 60;\n\n/**\n * @constant\n * @name secondsInDay\n * @summary Seconds in 1 day.\n */\nexport const secondsInDay = secondsInHour * 24;\n\n/**\n * @constant\n * @name secondsInWeek\n * @summary Seconds in 1 week.\n */\nexport const secondsInWeek = secondsInDay * 7;\n\n/**\n * @constant\n * @name secondsInYear\n * @summary Seconds in 1 year.\n */\nexport const secondsInYear = secondsInDay * daysInYear;\n\n/**\n * @constant\n * @name secondsInMonth\n * @summary Seconds in 1 month\n */\nexport const secondsInMonth = secondsInYear / 12;\n\n/**\n * @constant\n * @name secondsInQuarter\n * @summary Seconds in 1 quarter.\n */\nexport const secondsInQuarter = secondsInMonth * 3;\n\n/**\n * @constant\n * @name constructFromSymbol\n * @summary Symbol enabling Date extensions to inherit properties from the reference date.\n *\n * The symbol is used to enable the `constructFrom` function to construct a date\n * using a reference date and a value. It allows to transfer extra properties\n * from the reference date to the new date. It's useful for extensions like\n * [`TZDate`](https://github.com/date-fns/tz) that accept a time zone as\n * a constructor argument.\n */\nexport const constructFromSymbol = Symbol.for(\"constructDateFrom\");\n", "import { constructFromSymbol } from \"./constants.js\";\n\n/**\n * @name constructFrom\n * @category Generic Helpers\n * @summary Constructs a date using the reference date and the value\n *\n * @description\n * The function constructs a new date using the constructor from the reference\n * date and the given value. It helps to build generic functions that accept\n * date extensions.\n *\n * It defaults to `Date` if the passed reference date is a number or a string.\n *\n * Starting from v3.7.0, it allows to construct a date using `[Symbol.for(\"constructDateFrom\")]`\n * enabling to transfer extra properties from the reference date to the new date.\n * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)\n * that accept a time zone as a constructor argument.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The reference date to take constructor from\n * @param value - The value to create the date\n *\n * @returns Date initialized using the given date and value\n *\n * @example\n * import { constructFrom } from \"./constructFrom/date-fns\";\n *\n * // A function that clones a date preserving the original type\n * function cloneDate<DateType extends Date>(date: DateType): DateType {\n * return constructFrom(\n * date, // Use constructor from the given date\n * date.getTime() // Use the date value to create a new date\n * );\n * }\n */\nexport function constructFrom(date, value) {\n if (typeof date === \"function\") return date(value);\n\n if (date && typeof date === \"object\" && constructFromSymbol in date)\n return date[constructFromSymbol](value);\n\n if (date instanceof Date) return new date.constructor(value);\n\n return new Date(value);\n}\n\n// Fallback for modularized imports:\nexport default constructFrom;\n", "import { constructFrom } from \"./constructFrom.js\";\n\n/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * Starting from v3.7.0, it clones a date using `[Symbol.for(\"constructDateFrom\")]`\n * enabling to transfer extra properties from the reference date to the new date.\n * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)\n * that accept a time zone as a constructor argument.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param argument - The value to convert\n *\n * @returns The parsed date in the local time zone\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nexport function toDate(argument, context) {\n // [TODO] Get rid of `toDate` or `constructFrom`?\n return constructFrom(context || argument, argument);\n}\n\n// Fallback for modularized imports:\nexport default toDate;\n", "import { toDate } from \"../toDate.js\";\n\n/**\n * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.\n * They usually appear for dates that denote time before the timezones were introduced\n * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891\n * and GMT+01:00:00 after that date)\n *\n * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,\n * which would lead to incorrect calculations.\n *\n * This function returns the timezone offset in milliseconds that takes seconds in account.\n */\nexport function getTimezoneOffsetInMilliseconds(date) {\n const _date = toDate(date);\n const utcDate = new Date(\n Date.UTC(\n _date.getFullYear(),\n _date.getMonth(),\n _date.getDate(),\n _date.getHours(),\n _date.getMinutes(),\n _date.getSeconds(),\n _date.getMilliseconds(),\n ),\n );\n utcDate.setUTCFullYear(_date.getFullYear());\n return +date - +utcDate;\n}\n", "import { constructFrom } from \"../constructFrom.js\";\n\nexport function normalizeDates(context, ...dates) {\n const normalize = constructFrom.bind(\n null,\n context || dates.find((date) => typeof date === \"object\"),\n );\n return dates.map(normalize);\n}\n", "import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link startOfDay} function options.\n */\n\n/**\n * @name startOfDay\n * @category Day Helpers\n * @summary Return the start of a day for the given date.\n *\n * @description\n * Return the start of a day for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - The options\n *\n * @returns The start of a day\n *\n * @example\n * // The start of a day for 2 September 2014 11:55:00:\n * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 00:00:00\n */\nexport function startOfDay(date, options) {\n const _date = toDate(date, options?.in);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfDay;\n", "import { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.js\";\nimport { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { millisecondsInDay } from \"./constants.js\";\nimport { startOfDay } from \"./startOfDay.js\";\n\n/**\n * The {@link differenceInCalendarDays} function options.\n */\n\n/**\n * @name differenceInCalendarDays\n * @category Day Helpers\n * @summary Get the number of calendar days between the given dates.\n *\n * @description\n * Get the number of calendar days between the given dates. This means that the times are removed\n * from the dates and then the difference in days is calculated.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - The options object\n *\n * @returns The number of calendar days\n *\n * @example\n * // How many calendar days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInCalendarDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 366\n * // How many calendar days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInCalendarDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 1\n */\nexport function differenceInCalendarDays(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n\n const laterStartOfDay = startOfDay(laterDate_);\n const earlierStartOfDay = startOfDay(earlierDate_);\n\n const laterTimestamp =\n +laterStartOfDay - getTimezoneOffsetInMilliseconds(laterStartOfDay);\n const earlierTimestamp =\n +earlierStartOfDay - getTimezoneOffsetInMilliseconds(earlierStartOfDay);\n\n // Round the number of days to the nearest integer because the number of\n // milliseconds in a day is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay);\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarDays;\n", "import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link startOfYear} function options.\n */\n\n/**\n * @name startOfYear\n * @category Year Helpers\n * @summary Return the start of a year for the given date.\n *\n * @description\n * Return the start of a year for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - The options\n *\n * @returns The start of a year\n *\n * @example\n * // The start of a year for 2 September 2014 11:55:00:\n * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))\n * //=> Wed Jan 01 2014 00:00:00\n */\nexport function startOfYear(date, options) {\n const date_ = toDate(date, options?.in);\n date_.setFullYear(date_.getFullYear(), 0, 1);\n date_.setHours(0, 0, 0, 0);\n return date_;\n}\n\n// Fallback for modularized imports:\nexport default startOfYear;\n", "import { differenceInCalendarDays } from \"./differenceInCalendarDays.js\";\nimport { startOfYear } from \"./startOfYear.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getDayOfYear} function options.\n */\n\n/**\n * @name getDayOfYear\n * @category Day Helpers\n * @summary Get the day of the year of the given date.\n *\n * @description\n * Get the day of the year of the given date.\n *\n * @param date - The given date\n * @param options - The options\n *\n * @returns The day of year\n *\n * @example\n * // Which day of the year is 2 July 2014?\n * const result = getDayOfYear(new Date(2014, 6, 2))\n * //=> 183\n */\nexport function getDayOfYear(date, options) {\n const _date = toDate(date, options?.in);\n const diff = differenceInCalendarDays(_date, startOfYear(_date));\n const dayOfYear = diff + 1;\n return dayOfYear;\n}\n\n// Fallback for modularized imports:\nexport default getDayOfYear;\n", "import { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link startOfWeek} function options.\n */\n\n/**\n * @name startOfWeek\n * @category Week Helpers\n * @summary Return the start of a week for the given date.\n *\n * @description\n * Return the start of a week for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week\n *\n * @example\n * // The start of a week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfWeek(date, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date, options?.in);\n const day = _date.getDay();\n const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n\n _date.setDate(_date.getDate() - diff);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeek;\n", "import { startOfWeek } from \"./startOfWeek.js\";\n\n/**\n * The {@link startOfISOWeek} function options.\n */\n\n/**\n * @name startOfISOWeek\n * @category ISO Week Helpers\n * @summary Return the start of an ISO week for the given date.\n *\n * @description\n * Return the start of an ISO week for the given date.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of an ISO week\n *\n * @example\n * // The start of an ISO week for 2 September 2014 11:55:00:\n * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfISOWeek(date, options) {\n return startOfWeek(date, { ...options, weekStartsOn: 1 });\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeek;\n", "import { constructFrom } from \"./constructFrom.js\";\nimport { startOfISOWeek } from \"./startOfISOWeek.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getISOWeekYear} function options.\n */\n\n/**\n * @name getISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Get the ISO week-numbering year of the given date.\n *\n * @description\n * Get the ISO week-numbering year of the given date,\n * which always starts 3 days before the year's first Thursday.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param date - The given date\n *\n * @returns The ISO week-numbering year\n *\n * @example\n * // Which ISO-week numbering year is 2 January 2005?\n * const result = getISOWeekYear(new Date(2005, 0, 2))\n * //=> 2004\n */\nexport function getISOWeekYear(date, options) {\n const _date = toDate(date, options?.in);\n const year = _date.getFullYear();\n\n const fourthOfJanuaryOfNextYear = constructFrom(_date, 0);\n fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);\n fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);\n\n const fourthOfJanuaryOfThisYear = constructFrom(_date, 0);\n fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);\n fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);\n\n if (_date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (_date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getISOWeekYear;\n", "import { constructFrom } from \"./constructFrom.js\";\nimport { getISOWeekYear } from \"./getISOWeekYear.js\";\nimport { startOfISOWeek } from \"./startOfISOWeek.js\";\n\n/**\n * The {@link startOfISOWeekYear} function options.\n */\n\n/**\n * @name startOfISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Return the start of an ISO week-numbering year for the given date.\n *\n * @description\n * Return the start of an ISO week-numbering year,\n * which always starts 3 days before the year's first Thursday.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of an ISO week-numbering year\n *\n * @example\n * // The start of an ISO week-numbering year for 2 July 2005:\n * const result = startOfISOWeekYear(new Date(2005, 6, 2))\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfISOWeekYear(date, options) {\n const year = getISOWeekYear(date, options);\n const fourthOfJanuary = constructFrom(options?.in || date, 0);\n fourthOfJanuary.setFullYear(year, 0, 4);\n fourthOfJanuary.setHours(0, 0, 0, 0);\n return startOfISOWeek(fourthOfJanuary);\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeekYear;\n", "import { millisecondsInWeek } from \"./constants.js\";\nimport { startOfISOWeek } from \"./startOfISOWeek.js\";\nimport { startOfISOWeekYear } from \"./startOfISOWeekYear.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getISOWeek} function options.\n */\n\n/**\n * @name getISOWeek\n * @category ISO Week Helpers\n * @summary Get the ISO week of the given date.\n *\n * @description\n * Get the ISO week of the given date.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param date - The given date\n * @param options - The options\n *\n * @returns The ISO week\n *\n * @example\n * // Which week of the ISO-week numbering year is 2 January 2005?\n * const result = getISOWeek(new Date(2005, 0, 2))\n * //=> 53\n */\nexport function getISOWeek(date, options) {\n const _date = toDate(date, options?.in);\n const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date);\n\n // Round the number of weeks to the nearest integer because the number of\n // milliseconds in a week is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getISOWeek;\n", "import { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { constructFrom } from \"./constructFrom.js\";\nimport { startOfWeek } from \"./startOfWeek.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getWeekYear} function options.\n */\n\n/**\n * @name getWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Get the local week-numbering year of the given date.\n *\n * @description\n * Get the local week-numbering year of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @param date - The given date\n * @param options - An object with options.\n *\n * @returns The local week-numbering year\n *\n * @example\n * // Which week numbering year is 26 December 2004 with the default settings?\n * const result = getWeekYear(new Date(2004, 11, 26))\n * //=> 2005\n *\n * @example\n * // Which week numbering year is 26 December 2004 if week starts on Saturday?\n * const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })\n * //=> 2004\n *\n * @example\n * // Which week numbering year is 26 December 2004 if the first week contains 4 January?\n * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })\n * //=> 2004\n */\nexport function getWeekYear(date, options) {\n const _date = toDate(date, options?.in);\n const year = _date.getFullYear();\n\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const firstWeekOfNextYear = constructFrom(options?.in || date, 0);\n firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);\n firstWeekOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);\n\n const firstWeekOfThisYear = constructFrom(options?.in || date, 0);\n firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);\n firstWeekOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);\n\n if (+_date >= +startOfNextYear) {\n return year + 1;\n } else if (+_date >= +startOfThisYear) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getWeekYear;\n", "import { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { constructFrom } from \"./constructFrom.js\";\nimport { getWeekYear } from \"./getWeekYear.js\";\nimport { startOfWeek } from \"./startOfWeek.js\";\n\n/**\n * The {@link startOfWeekYear} function options.\n */\n\n/**\n * @name startOfWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Return the start of a local week-numbering year for the given date.\n *\n * @description\n * Return the start of a local week-numbering year.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week-numbering year\n *\n * @example\n * // The start of an a week-numbering year for 2 July 2005 with default settings:\n * const result = startOfWeekYear(new Date(2005, 6, 2))\n * //=> Sun Dec 26 2004 00:00:00\n *\n * @example\n * // The start of a week-numbering year for 2 July 2005\n * // if Monday is the first day of week\n * // and 4 January is always in the first week of the year:\n * const result = startOfWeekYear(new Date(2005, 6, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfWeekYear(date, options) {\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const year = getWeekYear(date, options);\n const firstWeek = constructFrom(options?.in || date, 0);\n firstWeek.setFullYear(year, 0, firstWeekContainsDate);\n firstWeek.setHours(0, 0, 0, 0);\n const _date = startOfWeek(firstWeek, options);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeekYear;\n", "import { millisecondsInWeek } from \"./constants.js\";\nimport { startOfWeek } from \"./startOfWeek.js\";\nimport { startOfWeekYear } from \"./startOfWeekYear.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getWeek} function options.\n */\n\n/**\n * @name getWeek\n * @category Week Helpers\n * @summary Get the local week index of the given date.\n *\n * @description\n * Get the local week index of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @param date - The given date\n * @param options - An object with options\n *\n * @returns The week\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005 with default options?\n * const result = getWeek(new Date(2005, 0, 2))\n * //=> 2\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005,\n * // if Monday is the first day of the week,\n * // and the first week of the year always contains 4 January?\n * const result = getWeek(new Date(2005, 0, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> 53\n */\nexport function getWeek(date, options) {\n const _date = toDate(date, options?.in);\n const diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options);\n\n // Round the number of weeks to the nearest integer because the number of\n // milliseconds in a week is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getWeek;\n", "export function addLeadingZeros(number, targetLength) {\n const sign = number < 0 ? \"-\" : \"\";\n const output = Math.abs(number).toString().padStart(targetLength, \"0\");\n return sign + output;\n}\n", "import { addLeadingZeros } from \"../addLeadingZeros.js\";\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | |\n * | d | Day of month | D | |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | m | Minute | M | Month |\n * | s | Second | S | Fraction of second |\n * | y | Year (abs) | Y | |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n */\n\nexport const lightFormatters = {\n // Year\n y(date, token) {\n // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens\n // | Year | y | yy | yyy | yyyy | yyyyy |\n // |----------|-------|----|-------|-------|-------|\n // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\n\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return addLeadingZeros(token === \"yy\" ? year % 100 : year, token.length);\n },\n\n // Month\n M(date, token) {\n const month = date.getMonth();\n return token === \"M\" ? String(month + 1) : addLeadingZeros(month + 1, 2);\n },\n\n // Day of the month\n d(date, token) {\n return addLeadingZeros(date.getDate(), token.length);\n },\n\n // AM or PM\n a(date, token) {\n const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return dayPeriodEnumValue.toUpperCase();\n case \"aaa\":\n return dayPeriodEnumValue;\n case \"aaaaa\":\n return dayPeriodEnumValue[0];\n case \"aaaa\":\n default:\n return dayPeriodEnumValue === \"am\" ? \"a.m.\" : \"p.m.\";\n }\n },\n\n // Hour [1-12]\n h(date, token) {\n return addLeadingZeros(date.getHours() % 12 || 12, token.length);\n },\n\n // Hour [0-23]\n H(date, token) {\n return addLeadingZeros(date.getHours(), token.length);\n },\n\n // Minute\n m(date, token) {\n return addLeadingZeros(date.getMinutes(), token.length);\n },\n\n // Second\n s(date, token) {\n return addLeadingZeros(date.getSeconds(), token.length);\n },\n\n // Fraction of second\n S(date, token) {\n const numberOfDigits = token.length;\n const milliseconds = date.getMilliseconds();\n const fractionalSeconds = Math.trunc(\n milliseconds * Math.pow(10, numberOfDigits - 3),\n );\n return addLeadingZeros(fractionalSeconds, token.length);\n },\n};\n", "import { getDayOfYear } from \"../../getDayOfYear.js\";\nimport { getISOWeek } from \"../../getISOWeek.js\";\nimport { getISOWeekYear } from \"../../getISOWeekYear.js\";\nimport { getWeek } from \"../../getWeek.js\";\nimport { getWeekYear } from \"../../getWeekYear.js\";\n\nimport { addLeadingZeros } from \"../addLeadingZeros.js\";\nimport { lightFormatters } from \"./lightFormatters.js\";\n\nconst dayPeriodEnum = {\n am: \"am\",\n pm: \"pm\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n};\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O | Timezone (GMT) |\n * | p! | Long localized time | P! | Long localized date |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n * - `P` is long localized date format\n * - `p` is long localized time format\n */\n\nexport const formatters = {\n // Era\n G: function (date, token, localize) {\n const era = date.getFullYear() > 0 ? 1 : 0;\n switch (token) {\n // AD, BC\n case \"G\":\n case \"GG\":\n case \"GGG\":\n return localize.era(era, { width: \"abbreviated\" });\n // A, B\n case \"GGGGG\":\n return localize.era(era, { width: \"narrow\" });\n // Anno Domini, Before Christ\n case \"GGGG\":\n default:\n return localize.era(era, { width: \"wide\" });\n }\n },\n\n // Year\n y: function (date, token, localize) {\n // Ordinal number\n if (token === \"yo\") {\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return localize.ordinalNumber(year, { unit: \"year\" });\n }\n\n return lightFormatters.y(date, token);\n },\n\n // Local week-numbering year\n Y: function (date, token, localize, options) {\n const signedWeekYear = getWeekYear(date, options);\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;\n\n // Two digit year\n if (token === \"YY\") {\n const twoDigitYear = weekYear % 100;\n return addLeadingZeros(twoDigitYear, 2);\n }\n\n // Ordinal number\n if (token === \"Yo\") {\n return localize.ordinalNumber(weekYear, { unit: \"year\" });\n }\n\n // Padding\n return addLeadingZeros(weekYear, token.length);\n },\n\n // ISO week-numbering year\n R: function (date, token) {\n const isoWeekYear = getISOWeekYear(date);\n\n // Padding\n return addLeadingZeros(isoWeekYear, token.length);\n },\n\n // Extended year. This is a single number designating the year of this calendar system.\n // The main difference between `y` and `u` localizers are B.C. years:\n // | Year | `y` | `u` |\n // |------|-----|-----|\n // | AC 1 | 1 | 1 |\n // | BC 1 | 1 | 0 |\n // | BC 2 | 2 | -1 |\n // Also `yy` always returns the last two digits of a year,\n // while `uu` pads single digit years to 2 characters and returns other years unchanged.\n u: function (date, token) {\n const year = date.getFullYear();\n return addLeadingZeros(year, token.length);\n },\n\n // Quarter\n Q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"Q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"QQ\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"Qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"QQQ\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"QQQQQ\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"QQQQ\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone quarter\n q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"qq\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"qqq\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"qqqqq\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"qqqq\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // Month\n M: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n case \"M\":\n case \"MM\":\n return lightFormatters.M(date, token);\n // 1st, 2nd, ..., 12th\n case \"Mo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"MMM\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // J, F, ..., D\n case \"MMMMM\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // January, February, ..., December\n case \"MMMM\":\n default:\n return localize.month(month, { width: \"wide\", context: \"formatting\" });\n }\n },\n\n // Stand-alone month\n L: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n // 1, 2, ..., 12\n case \"L\":\n return String(month + 1);\n // 01, 02, ..., 12\n case \"LL\":\n return addLeadingZeros(month + 1, 2);\n // 1st, 2nd, ..., 12th\n case \"Lo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"LLL\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // J, F, ..., D\n case \"LLLLL\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // January, February, ..., December\n case \"LLLL\":\n default:\n return localize.month(month, { width: \"wide\", context: \"standalone\" });\n }\n },\n\n // Local week of year\n w: function (date, token, localize, options) {\n const week = getWeek(date, options);\n\n if (token === \"wo\") {\n return localize.ordinalNumber(week, { unit: \"week\" });\n }\n\n return addLeadingZeros(week, token.length);\n },\n\n // ISO week of year\n I: function (date, token, localize) {\n const isoWeek = getISOWeek(date);\n\n if (token === \"Io\") {\n return localize.ordinalNumber(isoWeek, { unit: \"week\" });\n }\n\n return addLeadingZeros(isoWeek, token.length);\n },\n\n // Day of the month\n d: function (date, token, localize) {\n if (token === \"do\") {\n return localize.ordinalNumber(date.getDate(), { unit: \"date\" });\n }\n\n return lightFormatters.d(date, token);\n },\n\n // Day of year\n D: function (date, token, localize) {\n const dayOfYear = getDayOfYear(date);\n\n if (token === \"Do\") {\n return localize.ordinalNumber(dayOfYear, { unit: \"dayOfYear\" });\n }\n\n return addLeadingZeros(dayOfYear, token.length);\n },\n\n // Day of week\n E: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n switch (token) {\n // Tue\n case \"E\":\n case \"EE\":\n case \"EEE\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"EEEEE\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"EEEEEE\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"EEEE\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Local day of week\n e: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (Nth day of week with current locale or weekStartsOn)\n case \"e\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"ee\":\n return addLeadingZeros(localDayOfWeek, 2);\n // 1st, 2nd, ..., 7th\n case \"eo\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"eee\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"eeeee\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"eeeeee\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"eeee\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone local day of week\n c: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (same as in `e`)\n case \"c\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"cc\":\n return addLeadingZeros(localDayOfWeek, token.length);\n // 1st, 2nd, ..., 7th\n case \"co\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"ccc\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // T\n case \"ccccc\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // Tu\n case \"cccccc\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"standalone\",\n });\n // Tuesday\n case \"cccc\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // ISO day of week\n i: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;\n switch (token) {\n // 2\n case \"i\":\n return String(isoDayOfWeek);\n // 02\n case \"ii\":\n return addLeadingZeros(isoDayOfWeek, token.length);\n // 2nd\n case \"io\":\n return localize.ordinalNumber(isoDayOfWeek, { unit: \"day\" });\n // Tue\n case \"iii\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"iiiii\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"iiiiii\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"iiii\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM or PM\n a: function (date, token, localize) {\n const hours = date.getHours();\n const dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"aaa\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"aaaaa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"aaaa\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM, PM, midnight, noon\n b: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours === 12) {\n dayPeriodEnumValue = dayPeriodEnum.noon;\n } else if (hours === 0) {\n dayPeriodEnumValue = dayPeriodEnum.midnight;\n } else {\n dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n }\n\n switch (token) {\n case \"b\":\n case \"bb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"bbb\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"bbbbb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"bbbb\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // in the morning, in the afternoon, in the evening, at night\n B: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours >= 17) {\n dayPeriodEnumValue = dayPeriodEnum.evening;\n } else if (hours >= 12) {\n dayPeriodEnumValue = dayPeriodEnum.afternoon;\n } else if (hours >= 4) {\n dayPeriodEnumValue = dayPeriodEnum.morning;\n } else {\n dayPeriodEnumValue = dayPeriodEnum.night;\n }\n\n switch (token) {\n case \"B\":\n case \"BB\":\n case \"BBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"BBBBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"BBBB\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Hour [1-12]\n h: function (date, token, localize) {\n if (token === \"ho\") {\n let hours = date.getHours() % 12;\n if (hours === 0) hours = 12;\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return lightFormatters.h(date, token);\n },\n\n // Hour [0-23]\n H: function (date, token, localize) {\n if (token === \"Ho\") {\n return localize.ordinalNumber(date.getHours(), { unit: \"hour\" });\n }\n\n return lightFormatters.H(date, token);\n },\n\n // Hour [0-11]\n K: function (date, token, localize) {\n const hours = date.getHours() % 12;\n\n if (token === \"Ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Hour [1-24]\n k: function (date, token, localize) {\n let hours = date.getHours();\n if (hours === 0) hours = 24;\n\n if (token === \"ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Minute\n m: function (date, token, localize) {\n if (token === \"mo\") {\n return localize.ordinalNumber(date.getMinutes(), { unit: \"minute\" });\n }\n\n return lightFormatters.m(date, token);\n },\n\n // Second\n s: function (date, token, localize) {\n if (token === \"so\") {\n return localize.ordinalNumber(date.getSeconds(), { unit: \"second\" });\n }\n\n return lightFormatters.s(date, token);\n },\n\n // Fraction of second\n S: function (date, token) {\n return lightFormatters.S(date, token);\n },\n\n // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)\n X: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n if (timezoneOffset === 0) {\n return \"Z\";\n }\n\n switch (token) {\n // Hours and optional minutes\n case \"X\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XX`\n case \"XXXX\":\n case \"XX\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XXX`\n case \"XXXXX\":\n case \"XXX\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)\n x: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n switch (token) {\n // Hours and optional minutes\n case \"x\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xx`\n case \"xxxx\":\n case \"xx\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xxx`\n case \"xxxxx\":\n case \"xxx\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (GMT)\n O: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"O\":\n case \"OO\":\n case \"OOO\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"OOOO\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (specific non-location)\n z: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"z\":\n case \"zz\":\n case \"zzz\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"zzzz\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Seconds timestamp\n t: function (date, token, _localize) {\n const timestamp = Math.trunc(+date / 1000);\n return addLeadingZeros(timestamp, token.length);\n },\n\n // Milliseconds timestamp\n T: function (date, token, _localize) {\n return addLeadingZeros(+date, token.length);\n },\n};\n\nfunction formatTimezoneShort(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = Math.trunc(absOffset / 60);\n const minutes = absOffset % 60;\n if (minutes === 0) {\n return sign + String(hours);\n }\n return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);\n}\n\nfunction formatTimezoneWithOptionalMinutes(offset, delimiter) {\n if (offset % 60 === 0) {\n const sign = offset > 0 ? \"-\" : \"+\";\n return sign + addLeadingZeros(Math.abs(offset) / 60, 2);\n }\n return formatTimezone(offset, delimiter);\n}\n\nfunction formatTimezone(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);\n const minutes = addLeadingZeros(absOffset % 60, 2);\n return sign + hours + delimiter + minutes;\n}\n", "const dateLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"P\":\n return formatLong.date({ width: \"short\" });\n case \"PP\":\n return formatLong.date({ width: \"medium\" });\n case \"PPP\":\n return formatLong.date({ width: \"long\" });\n case \"PPPP\":\n default:\n return formatLong.date({ width: \"full\" });\n }\n};\n\nconst timeLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"p\":\n return formatLong.time({ width: \"short\" });\n case \"pp\":\n return formatLong.time({ width: \"medium\" });\n case \"ppp\":\n return formatLong.time({ width: \"long\" });\n case \"pppp\":\n default:\n return formatLong.time({ width: \"full\" });\n }\n};\n\nconst dateTimeLongFormatter = (pattern, formatLong) => {\n const matchResult = pattern.match(/(P+)(p+)?/) || [];\n const datePattern = matchResult[1];\n const timePattern = matchResult[2];\n\n if (!timePattern) {\n return dateLongFormatter(pattern, formatLong);\n }\n\n let dateTimeFormat;\n\n switch (datePattern) {\n case \"P\":\n dateTimeFormat = formatLong.dateTime({ width: \"short\" });\n break;\n case \"PP\":\n dateTimeFormat = formatLong.dateTime({ width: \"medium\" });\n break;\n case \"PPP\":\n dateTimeFormat = formatLong.dateTime({ width: \"long\" });\n break;\n case \"PPPP\":\n default:\n dateTimeFormat = formatLong.dateTime({ width: \"full\" });\n break;\n }\n\n return dateTimeFormat\n .replace(\"{{date}}\", dateLongFormatter(datePattern, formatLong))\n .replace(\"{{time}}\", timeLongFormatter(timePattern, formatLong));\n};\n\nexport const longFormatters = {\n p: timeLongFormatter,\n P: dateTimeLongFormatter,\n};\n", "const dayOfYearTokenRE = /^D+$/;\nconst weekYearTokenRE = /^Y+$/;\n\nconst throwTokens = [\"D\", \"DD\", \"YY\", \"YYYY\"];\n\nexport function isProtectedDayOfYearToken(token) {\n return dayOfYearTokenRE.test(token);\n}\n\nexport function isProtectedWeekYearToken(token) {\n return weekYearTokenRE.test(token);\n}\n\nexport function warnOrThrowProtectedError(token, format, input) {\n const _message = message(token, format, input);\n console.warn(_message);\n if (throwTokens.includes(token)) throw new RangeError(_message);\n}\n\nfunction message(token, format, input) {\n const subject = token[0] === \"Y\" ? \"years\" : \"days of the month\";\n return `Use \\`${token.toLowerCase()}\\` instead of \\`${token}\\` (in \\`${format}\\`) for formatting ${subject} to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;\n}\n", "/**\n * @name isDate\n * @category Common Helpers\n * @summary Is the given value a date?\n *\n * @description\n * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.\n *\n * @param value - The value to check\n *\n * @returns True if the given value is a date\n *\n * @example\n * // For a valid date:\n * const result = isDate(new Date())\n * //=> true\n *\n * @example\n * // For an invalid date:\n * const result = isDate(new Date(NaN))\n * //=> true\n *\n * @example\n * // For some value:\n * const result = isDate('2014-02-31')\n * //=> false\n *\n * @example\n * // For an object:\n * const result = isDate({})\n * //=> false\n */\nexport function isDate(value) {\n return (\n value instanceof Date ||\n (typeof value === \"object\" &&\n Object.prototype.toString.call(value) === \"[object Date]\")\n );\n}\n\n// Fallback for modularized imports:\nexport default isDate;\n", "import { isDate } from \"./isDate.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * @name isValid\n * @category Common Helpers\n * @summary Is the given date valid?\n *\n * @description\n * Returns false if argument is Invalid Date and true otherwise.\n * Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)\n * Invalid Date is a Date, whose time value is NaN.\n *\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @param date - The date to check\n *\n * @returns The date is valid\n *\n * @example\n * // For the valid date:\n * const result = isValid(new Date(2014, 1, 31))\n * //=> true\n *\n * @example\n * // For the value, convertible into a date:\n * const result = isValid(1393804800000)\n * //=> true\n *\n * @example\n * // For the invalid date:\n * const result = isValid(new Date(''))\n * //=> false\n */\nexport function isValid(date) {\n return !((!isDate(date) && typeof date !== \"number\") || isNaN(+toDate(date)));\n}\n\n// Fallback for modularized imports:\nexport default isValid;\n", "import { defaultLocale } from \"./_lib/defaultLocale.js\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { formatters } from \"./_lib/format/formatters.js\";\nimport { longFormatters } from \"./_lib/format/longFormatters.js\";\nimport {\n isProtectedDayOfYearToken,\n isProtectedWeekYearToken,\n warnOrThrowProtectedError,\n} from \"./_lib/protectedTokens.js\";\nimport { isValid } from \"./isValid.js\";\nimport { toDate } from \"./toDate.js\";\n\n// Rexports of internal for libraries to use.\n// See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874\nexport { formatters, longFormatters };\n\n// This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\nconst formattingTokensRegExp =\n /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\n\n// This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\nconst longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\n\nconst escapedStringRegExp = /^'([^]*?)'?$/;\nconst doubleQuoteRegExp = /''/g;\nconst unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n\nexport { format as formatDate };\n\n/**\n * The {@link format} function options.\n */\n\n/**\n * @name format\n * @alias formatDate\n * @category Common Helpers\n * @summary Format the date.\n *\n * @description\n * Return the formatted date string in the given format. The result may vary by locale.\n *\n * > \u26A0\uFE0F Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * The characters wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n * (see the last example)\n *\n * Format of the string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 7 below the table).\n *\n * Accepted patterns:\n * | Unit | Pattern | Result examples | Notes |\n * |---------------------------------|---------|-----------------------------------|-------|\n * | Era | G..GGG | AD, BC | |\n * | | GGGG | Anno Domini, Before Christ | 2 |\n * | | GGGGG | A, B | |\n * | Calendar year | y | 44, 1, 1900, 2017 | 5 |\n * | | yo | 44th, 1st, 0th, 17th | 5,7 |\n * | | yy | 44, 01, 00, 17 | 5 |\n * | | yyy | 044, 001, 1900, 2017 | 5 |\n * | | yyyy | 0044, 0001, 1900, 2017 | 5 |\n * | | yyyyy | ... | 3,5 |\n * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |\n * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |\n * | | YY | 44, 01, 00, 17 | 5,8 |\n * | | YYY | 044, 001, 1900, 2017 | 5 |\n * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |\n * | | YYYYY | ... | 3,5 |\n * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |\n * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |\n * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |\n * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |\n * | | RRRRR | ... | 3,5,7 |\n * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |\n * | | uu | -43, 01, 1900, 2017 | 5 |\n * | | uuu | -043, 001, 1900, 2017 | 5 |\n * | | uuuu | -0043, 0001, 1900, 2017 | 5 |\n * | | uuuuu | ... | 3,5 |\n * | Quarter (formatting) | Q | 1, 2, 3, 4 | |\n * | | Qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | QQ | 01, 02, 03, 04 | |\n * | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |\n * | | qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | qq | 01, 02, 03, 04 | |\n * | | qqq | Q1, Q2, Q3, Q4 | |\n * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | qqqqq | 1, 2, 3, 4 | 4 |\n * | Month (formatting) | M | 1, 2, ..., 12 | |\n * | | Mo | 1st, 2nd, ..., 12th | 7 |\n * | | MM | 01, 02, ..., 12 | |\n * | | MMM | Jan, Feb, ..., Dec | |\n * | | MMMM | January, February, ..., December | 2 |\n * | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | L | 1, 2, ..., 12 | |\n * | | Lo | 1st, 2nd, ..., 12th | 7 |\n * | | LL | 01, 02, ..., 12 | |\n * | | LLL | Jan, Feb, ..., Dec | |\n * | | LLLL | January, February, ..., December | 2 |\n * | | LLLLL | J, F, ..., D | |\n * | Local week of year | w | 1, 2, ..., 53 | |\n * | | wo | 1st, 2nd, ..., 53th | 7 |\n * | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | I | 1, 2, ..., 53 | 7 |\n * | | Io | 1st, 2nd, ..., 53th | 7 |\n * | | II | 01, 02, ..., 53 | 7 |\n * | Day of month | d | 1, 2, ..., 31 | |\n * | | do | 1st, 2nd, ..., 31st | 7 |\n * | | dd | 01, 02, ..., 31 | |\n * | Day of year | D | 1, 2, ..., 365, 366 | 9 |\n * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |\n * | | DD | 01, 02, ..., 365, 366 | 9 |\n * | | DDD | 001, 002, ..., 365, 366 | |\n * | | DDDD | ... | 3 |\n * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | EEEEE | M, T, W, T, F, S, S | |\n * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |\n * | | io | 1st, 2nd, ..., 7th | 7 |\n * | | ii | 01, 02, ..., 07 | 7 |\n * | | iii | Mon, Tue, Wed, ..., Sun | 7 |\n * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |\n * | | iiiii | M, T, W, T, F, S, S | 7 |\n * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |\n * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |\n * | | eo | 2nd, 3rd, ..., 1st | 7 |\n * | | ee | 02, 03, ..., 01 | |\n * | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | eeeee | M, T, W, T, F, S, S | |\n * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |\n * | | co | 2nd, 3rd, ..., 1st | 7 |\n * | | cc | 02, 03, ..., 01 | |\n * | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | ccccc | M, T, W, T, F, S, S | |\n * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | a..aa | AM, PM | |\n * | | aaa | am, pm | |\n * | | aaaa | a.m., p.m. | 2 |\n * | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |\n * | | bbb | am, pm, noon, midnight | |\n * | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | bbbbb | a, p, n, mi | |\n * | Flexible day period | B..BBB | at night, in the morning, ... | |\n * | | BBBB | at night, in the morning, ... | 2 |\n * | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |\n * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |\n * | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |\n * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |\n * | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |\n * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |\n * | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |\n * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |\n * | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | m | 0, 1, ..., 59 | |\n * | | mo | 0th, 1st, ..., 59th | 7 |\n * | | mm | 00, 01, ..., 59 | |\n * | Second | s | 0, 1, ..., 59 | |\n * | | so | 0th, 1st, ..., 59th | 7 |\n * | | ss | 00, 01, ..., 59 | |\n * | Fraction of second | S | 0, 1, ..., 9 | |\n * | | SS | 00, 01, ..., 99 | |\n * | | SSS | 000, 001, ..., 999 | |\n * | | SSSS | ... | 3 |\n * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |\n * | | XX | -0800, +0530, Z | |\n * | | XXX | -08:00, +05:30, Z | |\n * | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |\n * | | xx | -0800, +0530, +0000 | |\n * | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |\n * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |\n * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |\n * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |\n * | Seconds timestamp | t | 512969520 | 7 |\n * | | tt | ... | 3,7 |\n * | Milliseconds timestamp | T | 512969520900 | 7 |\n * | | TT | ... | 3,7 |\n * | Long localized date | P | 04/29/1453 | 7 |\n * | | PP | Apr 29, 1453 | 7 |\n * | | PPP | April 29th, 1453 | 7 |\n * | | PPPP | Friday, April 29th, 1453 | 2,7 |\n * | Long localized time | p | 12:00 AM | 7 |\n * | | pp | 12:00:00 AM | 7 |\n * | | ppp | 12:00:00 AM GMT+2 | 7 |\n * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |\n * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |\n * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |\n * | | PPPppp | April 29th, 1453 at ... | 7 |\n * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)\n * the output will be the same as default pattern for this unit, usually\n * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units\n * are marked with \"2\" in the last column of the table.\n *\n * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`\n *\n * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`\n *\n * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).\n * The output will be padded with zeros to match the length of the pattern.\n *\n * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`\n *\n * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 5. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` always returns the last two digits of a year,\n * while `uu` pads single digit years to 2 characters and returns other years unchanged:\n *\n * | Year | `yy` | `uu` |\n * |------|------|------|\n * | 1 | 01 | 01 |\n * | 14 | 14 | 14 |\n * | 376 | 76 | 376 |\n * | 1453 | 53 | 1453 |\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)\n * and [getWeekYear](https://date-fns.org/docs/getWeekYear)).\n *\n * 6. Specific non-location timezones are currently unavailable in `date-fns`,\n * so right now these tokens fall back to GMT timezones.\n *\n * 7. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `t`: seconds timestamp\n * - `T`: milliseconds timestamp\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * @param date - The original date\n * @param format - The string of tokens\n * @param options - An object with options\n *\n * @returns The formatted date string\n *\n * @throws `date` must not be Invalid Date\n * @throws `options.locale` must contain `localize` property\n * @throws `options.locale` must contain `formatLong` property\n * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws format string contains an unescaped latin alphabet character\n *\n * @example\n * // Represent 11 February 2014 in middle-endian format:\n * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')\n * //=> '02/11/2014'\n *\n * @example\n * // Represent 2 July 2014 in Esperanto:\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = format(new Date(2014, 6, 2), \"do 'de' MMMM yyyy\", {\n * locale: eoLocale\n * })\n * //=> '2-a de julio 2014'\n *\n * @example\n * // Escape string by single quote characters:\n * const result = format(new Date(2014, 6, 2, 15), \"h 'o''clock'\")\n * //=> \"3 o'clock\"\n */\nexport function format(date, formatStr, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const originalDate = toDate(date, options?.in);\n\n if (!isValid(originalDate)) {\n throw new RangeError(\"Invalid time value\");\n }\n\n let parts = formatStr\n .match(longFormattingTokensRegExp)\n .map((substring) => {\n const firstCharacter = substring[0];\n if (firstCharacter === \"p\" || firstCharacter === \"P\") {\n const longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong);\n }\n return substring;\n })\n .join(\"\")\n .match(formattingTokensRegExp)\n .map((substring) => {\n // Replace two single quote characters with one single quote character\n if (substring === \"''\") {\n return { isToken: false, value: \"'\" };\n }\n\n const firstCharacter = substring[0];\n if (firstCharacter === \"'\") {\n return { isToken: false, value: cleanEscapedString(substring) };\n }\n\n if (formatters[firstCharacter]) {\n return { isToken: true, value: substring };\n }\n\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError(\n \"Format string contains an unescaped latin alphabet character `\" +\n firstCharacter +\n \"`\",\n );\n }\n\n return { isToken: false, value: substring };\n });\n\n // invoke localize preprocessor (only for french locales at the moment)\n if (locale.localize.preprocessor) {\n parts = locale.localize.preprocessor(originalDate, parts);\n }\n\n const formatterOptions = {\n firstWeekContainsDate,\n weekStartsOn,\n locale,\n };\n\n return parts\n .map((part) => {\n if (!part.isToken) return part.value;\n\n const token = part.value;\n\n if (\n (!options?.useAdditionalWeekYearTokens &&\n isProtectedWeekYearToken(token)) ||\n (!options?.useAdditionalDayOfYearTokens &&\n isProtectedDayOfYearToken(token))\n ) {\n warnOrThrowProtectedError(token, formatStr, String(date));\n }\n\n const formatter = formatters[token[0]];\n return formatter(originalDate, token, locale.localize, formatterOptions);\n })\n .join(\"\");\n}\n\nfunction cleanEscapedString(input) {\n const matched = input.match(escapedStringRegExp);\n\n if (!matched) {\n return input;\n }\n\n return matched[1].replace(doubleQuoteRegExp, \"'\");\n}\n\n// Fallback for modularized imports:\nexport default format;\n", "import { getDefaultOptions as getInternalDefaultOptions } from \"./_lib/defaultOptions.js\";\n\n/**\n * @name getDefaultOptions\n * @category Common Helpers\n * @summary Get default options.\n * @pure false\n *\n * @description\n * Returns an object that contains defaults for\n * `options.locale`, `options.weekStartsOn` and `options.firstWeekContainsDate`\n * arguments for all functions.\n *\n * You can change these with [setDefaultOptions](https://date-fns.org/docs/setDefaultOptions).\n *\n * @returns The default options\n *\n * @example\n * const result = getDefaultOptions()\n * //=> {}\n *\n * @example\n * setDefaultOptions({ weekStarsOn: 1, firstWeekContainsDate: 4 })\n * const result = getDefaultOptions()\n * //=> { weekStarsOn: 1, firstWeekContainsDate: 4 }\n */\nexport function getDefaultOptions() {\n return Object.assign({}, getInternalDefaultOptions());\n}\n\n// Fallback for modularized imports:\nexport default getDefaultOptions;\n", "import { getDefaultOptions } from 'date-fns';\n/**\n * Returns the formatted time zone name of the provided `timeZone` or the current\n * system time zone if omitted, accounting for DST according to the UTC value of\n * the date.\n */\nexport function tzIntlTimeZoneName(length, date, options) {\n const defaultOptions = getDefaultOptions();\n const dtf = getDTF(length, options.timeZone, options.locale ?? defaultOptions.locale);\n return 'formatToParts' in dtf ? partsTimeZone(dtf, date) : hackyTimeZone(dtf, date);\n}\nfunction partsTimeZone(dtf, date) {\n const formatted = dtf.formatToParts(date);\n for (let i = formatted.length - 1; i >= 0; --i) {\n if (formatted[i].type === 'timeZoneName') {\n return formatted[i].value;\n }\n }\n return undefined;\n}\nfunction hackyTimeZone(dtf, date) {\n const formatted = dtf.format(date).replace(/\\u200E/g, '');\n const tzNameMatch = / [\\w-+ ]+$/.exec(formatted);\n return tzNameMatch ? tzNameMatch[0].substr(1) : '';\n}\n// If a locale has been provided `en-US` is used as a fallback in case it is an\n// invalid locale, otherwise the locale is left undefined to use the system locale.\nfunction getDTF(length, timeZone, locale) {\n return new Intl.DateTimeFormat(locale ? [locale.code, 'en-US'] : undefined, {\n timeZone: timeZone,\n timeZoneName: length,\n });\n}\n", "/**\n * Returns the [year, month, day, hour, minute, seconds] tokens of the provided\n * `date` as it will be rendered in the `timeZone`.\n */\nexport function tzTokenizeDate(date, timeZone) {\n const dtf = getDateTimeFormat(timeZone);\n return 'formatToParts' in dtf ? partsOffset(dtf, date) : hackyOffset(dtf, date);\n}\nconst typeToPos = {\n year: 0,\n month: 1,\n day: 2,\n hour: 3,\n minute: 4,\n second: 5,\n};\nfunction partsOffset(dtf, date) {\n try {\n const formatted = dtf.formatToParts(date);\n const filled = [];\n for (let i = 0; i < formatted.length; i++) {\n const pos = typeToPos[formatted[i].type];\n if (pos !== undefined) {\n filled[pos] = parseInt(formatted[i].value, 10);\n }\n }\n return filled;\n }\n catch (error) {\n if (error instanceof RangeError) {\n return [NaN];\n }\n throw error;\n }\n}\nfunction hackyOffset(dtf, date) {\n const formatted = dtf.format(date);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const parsed = /(\\d+)\\/(\\d+)\\/(\\d+),? (\\d+):(\\d+):(\\d+)/.exec(formatted);\n // const [, fMonth, fDay, fYear, fHour, fMinute, fSecond] = parsed\n // return [fYear, fMonth, fDay, fHour, fMinute, fSecond]\n return [\n parseInt(parsed[3], 10),\n parseInt(parsed[1], 10),\n parseInt(parsed[2], 10),\n parseInt(parsed[4], 10),\n parseInt(parsed[5], 10),\n parseInt(parsed[6], 10),\n ];\n}\n// Get a cached Intl.DateTimeFormat instance for the IANA `timeZone`. This can be used\n// to get deterministic local date/time output according to the `en-US` locale which\n// can be used to extract local time parts as necessary.\nconst dtfCache = {};\n// New browsers use `hourCycle`, IE and Chrome <73 does not support it and uses `hour12`\nconst testDateFormatted = new Intl.DateTimeFormat('en-US', {\n hourCycle: 'h23',\n timeZone: 'America/New_York',\n year: 'numeric',\n month: '2-digit',\n day: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n}).format(new Date('2014-06-25T04:00:00.123Z'));\nconst hourCycleSupported = testDateFormatted === '06/25/2014, 00:00:00' ||\n testDateFormatted === '\u200E06\u200E/\u200E25\u200E/\u200E2014\u200E \u200E00\u200E:\u200E00\u200E:\u200E00';\nfunction getDateTimeFormat(timeZone) {\n if (!dtfCache[timeZone]) {\n dtfCache[timeZone] = hourCycleSupported\n ? new Intl.DateTimeFormat('en-US', {\n hourCycle: 'h23',\n timeZone: timeZone,\n year: 'numeric',\n month: 'numeric',\n day: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n })\n : new Intl.DateTimeFormat('en-US', {\n hour12: false,\n timeZone: timeZone,\n year: 'numeric',\n month: 'numeric',\n day: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n });\n }\n return dtfCache[timeZone];\n}\n", "/**\n * Use instead of `new Date(Date.UTC(...))` to support years below 100 which doesn't work\n * otherwise due to the nature of the\n * [`Date` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years.\n *\n * For `Date.UTC(...)`, use `newDateUTC(...).getTime()`.\n */\nexport function newDateUTC(fullYear, month, day, hour, minute, second, millisecond) {\n const utcDate = new Date(0);\n utcDate.setUTCFullYear(fullYear, month, day);\n utcDate.setUTCHours(hour, minute, second, millisecond);\n return utcDate;\n}\n", "import { tzTokenizeDate } from '../tzTokenizeDate/index.js';\nimport { newDateUTC } from '../newDateUTC/index.js';\nconst MILLISECONDS_IN_HOUR = 3600000;\nconst MILLISECONDS_IN_MINUTE = 60000;\nconst patterns = {\n timezone: /([Z+-].*)$/,\n timezoneZ: /^(Z)$/,\n timezoneHH: /^([+-]\\d{2})$/,\n timezoneHHMM: /^([+-])(\\d{2}):?(\\d{2})$/,\n};\n// Parse constious time zone offset formats to an offset in milliseconds\nexport function tzParseTimezone(timezoneString, date, isUtcDate) {\n // Empty string\n if (!timezoneString) {\n return 0;\n }\n // Z\n let token = patterns.timezoneZ.exec(timezoneString);\n if (token) {\n return 0;\n }\n let hours;\n let absoluteOffset;\n // \u00B1hh\n token = patterns.timezoneHH.exec(timezoneString);\n if (token) {\n hours = parseInt(token[1], 10);\n if (!validateTimezone(hours)) {\n return NaN;\n }\n return -(hours * MILLISECONDS_IN_HOUR);\n }\n // \u00B1hh:mm or \u00B1hhmm\n token = patterns.timezoneHHMM.exec(timezoneString);\n if (token) {\n hours = parseInt(token[2], 10);\n const minutes = parseInt(token[3], 10);\n if (!validateTimezone(hours, minutes)) {\n return NaN;\n }\n absoluteOffset = Math.abs(hours) * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE;\n return token[1] === '+' ? -absoluteOffset : absoluteOffset;\n }\n // IANA time zone\n if (isValidTimezoneIANAString(timezoneString)) {\n date = new Date(date || Date.now());\n const utcDate = isUtcDate ? date : toUtcDate(date);\n const offset = calcOffset(utcDate, timezoneString);\n const fixedOffset = isUtcDate ? offset : fixOffset(date, offset, timezoneString);\n return -fixedOffset;\n }\n return NaN;\n}\nfunction toUtcDate(date) {\n return newDateUTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());\n}\nfunction calcOffset(date, timezoneString) {\n const tokens = tzTokenizeDate(date, timezoneString);\n // ms dropped because it's not provided by tzTokenizeDate\n const asUTC = newDateUTC(tokens[0], tokens[1] - 1, tokens[2], tokens[3] % 24, tokens[4], tokens[5], 0).getTime();\n let asTS = date.getTime();\n const over = asTS % 1000;\n asTS -= over >= 0 ? over : 1000 + over;\n return asUTC - asTS;\n}\nfunction fixOffset(date, offset, timezoneString) {\n const localTS = date.getTime();\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - offset;\n // Test whether the zone matches the offset for this ts\n const o2 = calcOffset(new Date(utcGuess), timezoneString);\n // If so, offset didn't change, and we're done\n if (offset === o2) {\n return offset;\n }\n // If not, change the ts by the difference in the offset\n utcGuess -= o2 - offset;\n // If that gives us the local time we want, we're done\n const o3 = calcOffset(new Date(utcGuess), timezoneString);\n if (o2 === o3) {\n return o2;\n }\n // If it's different, we're in a hole time. The offset has changed, but we don't adjust the time\n return Math.max(o2, o3);\n}\nfunction validateTimezone(hours, minutes) {\n return -23 <= hours && hours <= 23 && (minutes == null || (0 <= minutes && minutes <= 59));\n}\nconst validIANATimezoneCache = {};\nfunction isValidTimezoneIANAString(timeZoneString) {\n if (validIANATimezoneCache[timeZoneString])\n return true;\n try {\n new Intl.DateTimeFormat(undefined, { timeZone: timeZoneString });\n validIANATimezoneCache[timeZoneString] = true;\n return true;\n }\n catch (error) {\n return false;\n }\n}\n", "import { tzIntlTimeZoneName } from '../../_lib/tzIntlTimeZoneName/index.js';\nimport { tzParseTimezone } from '../../_lib/tzParseTimezone/index.js';\nconst MILLISECONDS_IN_MINUTE = 60 * 1000;\nexport const formatters = {\n // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)\n X: function (date, token, options) {\n const timezoneOffset = getTimeZoneOffset(options.timeZone, date);\n if (timezoneOffset === 0) {\n return 'Z';\n }\n switch (token) {\n // Hours and optional minutes\n case 'X':\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n // Hours, minutes and optional seconds without `:` delimeter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XX`\n case 'XXXX':\n case 'XX': // Hours and minutes without `:` delimeter\n return formatTimezone(timezoneOffset);\n // Hours, minutes and optional seconds with `:` delimeter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XXX`\n case 'XXXXX':\n case 'XXX': // Hours and minutes with `:` delimeter\n default:\n return formatTimezone(timezoneOffset, ':');\n }\n },\n // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)\n x: function (date, token, options) {\n const timezoneOffset = getTimeZoneOffset(options.timeZone, date);\n switch (token) {\n // Hours and optional minutes\n case 'x':\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n // Hours, minutes and optional seconds without `:` delimeter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xx`\n case 'xxxx':\n case 'xx': // Hours and minutes without `:` delimeter\n return formatTimezone(timezoneOffset);\n // Hours, minutes and optional seconds with `:` delimeter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xxx`\n case 'xxxxx':\n case 'xxx': // Hours and minutes with `:` delimeter\n default:\n return formatTimezone(timezoneOffset, ':');\n }\n },\n // Timezone (GMT)\n O: function (date, token, options) {\n const timezoneOffset = getTimeZoneOffset(options.timeZone, date);\n switch (token) {\n // Short\n case 'O':\n case 'OO':\n case 'OOO':\n return 'GMT' + formatTimezoneShort(timezoneOffset, ':');\n // Long\n case 'OOOO':\n default:\n return 'GMT' + formatTimezone(timezoneOffset, ':');\n }\n },\n // Timezone (specific non-location)\n z: function (date, token, options) {\n switch (token) {\n // Short\n case 'z':\n case 'zz':\n case 'zzz':\n return tzIntlTimeZoneName('short', date, options);\n // Long\n case 'zzzz':\n default:\n return tzIntlTimeZoneName('long', date, options);\n }\n },\n};\nfunction getTimeZoneOffset(timeZone, originalDate) {\n const timeZoneOffset = timeZone\n ? tzParseTimezone(timeZone, originalDate, true) / MILLISECONDS_IN_MINUTE\n : originalDate?.getTimezoneOffset() ?? 0;\n if (Number.isNaN(timeZoneOffset)) {\n throw new RangeError('Invalid time zone specified: ' + timeZone);\n }\n return timeZoneOffset;\n}\nfunction addLeadingZeros(number, targetLength) {\n const sign = number < 0 ? '-' : '';\n let output = Math.abs(number).toString();\n while (output.length < targetLength) {\n output = '0' + output;\n }\n return sign + output;\n}\nfunction formatTimezone(offset, delimiter = '') {\n const sign = offset > 0 ? '-' : '+';\n const absOffset = Math.abs(offset);\n const hours = addLeadingZeros(Math.floor(absOffset / 60), 2);\n const minutes = addLeadingZeros(Math.floor(absOffset % 60), 2);\n return sign + hours + delimiter + minutes;\n}\nfunction formatTimezoneWithOptionalMinutes(offset, delimiter) {\n if (offset % 60 === 0) {\n const sign = offset > 0 ? '-' : '+';\n return sign + addLeadingZeros(Math.abs(offset) / 60, 2);\n }\n return formatTimezone(offset, delimiter);\n}\nfunction formatTimezoneShort(offset, delimiter = '') {\n const sign = offset > 0 ? '-' : '+';\n const absOffset = Math.abs(offset);\n const hours = Math.floor(absOffset / 60);\n const minutes = absOffset % 60;\n if (minutes === 0) {\n return sign + String(hours);\n }\n return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);\n}\n", "/**\n * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.\n * They usually appear for dates that denote time before the timezones were introduced\n * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891\n * and GMT+01:00:00 after that date)\n *\n * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,\n * which would lead to incorrect calculations.\n *\n * This function returns the timezone offset in milliseconds that takes seconds in account.\n */\nexport function getTimezoneOffsetInMilliseconds(date) {\n const utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));\n utcDate.setUTCFullYear(date.getFullYear());\n return +date - +utcDate;\n}\n", "/** Regex to identify the presence of a time zone specifier in a date string */\nexport const tzPattern = /(Z|[+-]\\d{2}(?::?\\d{2})?| UTC| [a-zA-Z]+\\/[a-zA-Z_]+(?:\\/[a-zA-Z_]+)?)$/;\n", "import { getTimezoneOffsetInMilliseconds } from '../_lib/getTimezoneOffsetInMilliseconds/index.js';\nimport { tzParseTimezone } from '../_lib/tzParseTimezone/index.js';\nimport { tzPattern } from '../_lib/tzPattern/index.js';\nconst MILLISECONDS_IN_HOUR = 3600000;\nconst MILLISECONDS_IN_MINUTE = 60000;\nconst DEFAULT_ADDITIONAL_DIGITS = 2;\nconst patterns = {\n dateTimePattern: /^([0-9W+-]+)(T| )(.*)/,\n datePattern: /^([0-9W+-]+)(.*)/,\n plainTime: /:/,\n // year tokens\n YY: /^(\\d{2})$/,\n YYY: [\n /^([+-]\\d{2})$/, // 0 additional digits\n /^([+-]\\d{3})$/, // 1 additional digit\n /^([+-]\\d{4})$/, // 2 additional digits\n ],\n YYYY: /^(\\d{4})/,\n YYYYY: [\n /^([+-]\\d{4})/, // 0 additional digits\n /^([+-]\\d{5})/, // 1 additional digit\n /^([+-]\\d{6})/, // 2 additional digits\n ],\n // date tokens\n MM: /^-(\\d{2})$/,\n DDD: /^-?(\\d{3})$/,\n MMDD: /^-?(\\d{2})-?(\\d{2})$/,\n Www: /^-?W(\\d{2})$/,\n WwwD: /^-?W(\\d{2})-?(\\d{1})$/,\n HH: /^(\\d{2}([.,]\\d*)?)$/,\n HHMM: /^(\\d{2}):?(\\d{2}([.,]\\d*)?)$/,\n HHMMSS: /^(\\d{2}):?(\\d{2}):?(\\d{2}([.,]\\d*)?)$/,\n // time zone tokens (to identify the presence of a tz)\n timeZone: tzPattern,\n};\n/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If an argument is a string, the function tries to parse it.\n * Function accepts complete ISO 8601 formats as well as partial implementations.\n * ISO 8601: http://en.wikipedia.org/wiki/ISO_8601\n * If the function cannot parse the string or the values are invalid, it returns Invalid Date.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n * All *date-fns* functions will throw `RangeError` if `options.additionalDigits` is not 0, 1, 2 or undefined.\n *\n * @param argument the value to convert\n * @param options the object with options. See [Options]{@link https://date-fns.org/docs/Options}\n * @param {0|1|2} [options.additionalDigits=2] - the additional number of digits in the extended year format\n * @param {string} [options.timeZone=''] - used to specify the IANA time zone offset of a date String.\n *\n * @returns the parsed date in the local time zone\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2\n *\n * @example\n * // Convert string '2014-02-11T11:30:30' to date:\n * const result = toDate('2014-02-11T11:30:30')\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert string '+02014101' to date,\n * // if the additional number of digits in the extended year format is 1:\n * const result = toDate('+02014101', {additionalDigits: 1})\n * //=> Fri Apr 11 2014 00:00:00\n */\nexport function toDate(argument, options = {}) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n if (argument === null) {\n return new Date(NaN);\n }\n const additionalDigits = options.additionalDigits == null ? DEFAULT_ADDITIONAL_DIGITS : Number(options.additionalDigits);\n if (additionalDigits !== 2 && additionalDigits !== 1 && additionalDigits !== 0) {\n throw new RangeError('additionalDigits must be 0, 1 or 2');\n }\n // Clone the date\n if (argument instanceof Date ||\n (typeof argument === 'object' && Object.prototype.toString.call(argument) === '[object Date]')) {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new Date(argument.getTime());\n }\n else if (typeof argument === 'number' ||\n Object.prototype.toString.call(argument) === '[object Number]') {\n return new Date(argument);\n }\n else if (!(Object.prototype.toString.call(argument) === '[object String]')) {\n return new Date(NaN);\n }\n const dateStrings = splitDateString(argument);\n const { year, restDateString } = parseYear(dateStrings.date, additionalDigits);\n const date = parseDate(restDateString, year);\n if (date === null || isNaN(date.getTime())) {\n return new Date(NaN);\n }\n if (date) {\n const timestamp = date.getTime();\n let time = 0;\n let offset;\n if (dateStrings.time) {\n time = parseTime(dateStrings.time);\n if (time === null || isNaN(time)) {\n return new Date(NaN);\n }\n }\n if (dateStrings.timeZone || options.timeZone) {\n offset = tzParseTimezone(dateStrings.timeZone || options.timeZone, new Date(timestamp + time));\n if (isNaN(offset)) {\n return new Date(NaN);\n }\n }\n else {\n // get offset accurate to hour in time zones that change offset\n offset = getTimezoneOffsetInMilliseconds(new Date(timestamp + time));\n offset = getTimezoneOffsetInMilliseconds(new Date(timestamp + time + offset));\n }\n return new Date(timestamp + time + offset);\n }\n else {\n return new Date(NaN);\n }\n}\nfunction splitDateString(dateString) {\n const dateStrings = {};\n let parts = patterns.dateTimePattern.exec(dateString);\n let timeString;\n if (!parts) {\n parts = patterns.datePattern.exec(dateString);\n if (parts) {\n dateStrings.date = parts[1];\n timeString = parts[2];\n }\n else {\n dateStrings.date = null;\n timeString = dateString;\n }\n }\n else {\n dateStrings.date = parts[1];\n timeString = parts[3];\n }\n if (timeString) {\n const token = patterns.timeZone.exec(timeString);\n if (token) {\n dateStrings.time = timeString.replace(token[1], '');\n dateStrings.timeZone = token[1].trim();\n }\n else {\n dateStrings.time = timeString;\n }\n }\n return dateStrings;\n}\nfunction parseYear(dateString, additionalDigits) {\n if (dateString) {\n const patternYYY = patterns.YYY[additionalDigits];\n const patternYYYYY = patterns.YYYYY[additionalDigits];\n // YYYY or \u00B1YYYYY\n let token = patterns.YYYY.exec(dateString) || patternYYYYY.exec(dateString);\n if (token) {\n const yearString = token[1];\n return {\n year: parseInt(yearString, 10),\n restDateString: dateString.slice(yearString.length),\n };\n }\n // YY or \u00B1YYY\n token = patterns.YY.exec(dateString) || patternYYY.exec(dateString);\n if (token) {\n const centuryString = token[1];\n return {\n year: parseInt(centuryString, 10) * 100,\n restDateString: dateString.slice(centuryString.length),\n };\n }\n }\n // Invalid ISO-formatted year\n return {\n year: null,\n };\n}\nfunction parseDate(dateString, year) {\n // Invalid ISO-formatted year\n if (year === null) {\n return null;\n }\n let date;\n let month;\n let week;\n // YYYY\n if (!dateString || !dateString.length) {\n date = new Date(0);\n date.setUTCFullYear(year);\n return date;\n }\n // YYYY-MM\n let token = patterns.MM.exec(dateString);\n if (token) {\n date = new Date(0);\n month = parseInt(token[1], 10) - 1;\n if (!validateDate(year, month)) {\n return new Date(NaN);\n }\n date.setUTCFullYear(year, month);\n return date;\n }\n // YYYY-DDD or YYYYDDD\n token = patterns.DDD.exec(dateString);\n if (token) {\n date = new Date(0);\n const dayOfYear = parseInt(token[1], 10);\n if (!validateDayOfYearDate(year, dayOfYear)) {\n return new Date(NaN);\n }\n date.setUTCFullYear(year, 0, dayOfYear);\n return date;\n }\n // yyyy-MM-dd or YYYYMMDD\n token = patterns.MMDD.exec(dateString);\n if (token) {\n date = new Date(0);\n month = parseInt(token[1], 10) - 1;\n const day = parseInt(token[2], 10);\n if (!validateDate(year, month, day)) {\n return new Date(NaN);\n }\n date.setUTCFullYear(year, month, day);\n return date;\n }\n // YYYY-Www or YYYYWww\n token = patterns.Www.exec(dateString);\n if (token) {\n week = parseInt(token[1], 10) - 1;\n if (!validateWeekDate(week)) {\n return new Date(NaN);\n }\n return dayOfISOWeekYear(year, week);\n }\n // YYYY-Www-D or YYYYWwwD\n token = patterns.WwwD.exec(dateString);\n if (token) {\n week = parseInt(token[1], 10) - 1;\n const dayOfWeek = parseInt(token[2], 10) - 1;\n if (!validateWeekDate(week, dayOfWeek)) {\n return new Date(NaN);\n }\n return dayOfISOWeekYear(year, week, dayOfWeek);\n }\n // Invalid ISO-formatted date\n return null;\n}\nfunction parseTime(timeString) {\n let hours;\n let minutes;\n // hh\n let token = patterns.HH.exec(timeString);\n if (token) {\n hours = parseFloat(token[1].replace(',', '.'));\n if (!validateTime(hours)) {\n return NaN;\n }\n return (hours % 24) * MILLISECONDS_IN_HOUR;\n }\n // hh:mm or hhmm\n token = patterns.HHMM.exec(timeString);\n if (token) {\n hours = parseInt(token[1], 10);\n minutes = parseFloat(token[2].replace(',', '.'));\n if (!validateTime(hours, minutes)) {\n return NaN;\n }\n return (hours % 24) * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE;\n }\n // hh:mm:ss or hhmmss\n token = patterns.HHMMSS.exec(timeString);\n if (token) {\n hours = parseInt(token[1], 10);\n minutes = parseInt(token[2], 10);\n const seconds = parseFloat(token[3].replace(',', '.'));\n if (!validateTime(hours, minutes, seconds)) {\n return NaN;\n }\n return (hours % 24) * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE + seconds * 1000;\n }\n // Invalid ISO-formatted time\n return null;\n}\nfunction dayOfISOWeekYear(isoWeekYear, week, day) {\n week = week || 0;\n day = day || 0;\n const date = new Date(0);\n date.setUTCFullYear(isoWeekYear, 0, 4);\n const fourthOfJanuaryDay = date.getUTCDay() || 7;\n const diff = week * 7 + day + 1 - fourthOfJanuaryDay;\n date.setUTCDate(date.getUTCDate() + diff);\n return date;\n}\n// Validation functions\nconst DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nconst DAYS_IN_MONTH_LEAP_YEAR = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nfunction isLeapYearIndex(year) {\n return year % 400 === 0 || (year % 4 === 0 && year % 100 !== 0);\n}\nfunction validateDate(year, month, date) {\n if (month < 0 || month > 11) {\n return false;\n }\n if (date != null) {\n if (date < 1) {\n return false;\n }\n const isLeapYear = isLeapYearIndex(year);\n if (isLeapYear && date > DAYS_IN_MONTH_LEAP_YEAR[month]) {\n return false;\n }\n if (!isLeapYear && date > DAYS_IN_MONTH[month]) {\n return false;\n }\n }\n return true;\n}\nfunction validateDayOfYearDate(year, dayOfYear) {\n if (dayOfYear < 1) {\n return false;\n }\n const isLeapYear = isLeapYearIndex(year);\n if (isLeapYear && dayOfYear > 366) {\n return false;\n }\n if (!isLeapYear && dayOfYear > 365) {\n return false;\n }\n return true;\n}\nfunction validateWeekDate(week, day) {\n if (week < 0 || week > 52) {\n return false;\n }\n if (day != null && (day < 0 || day > 6)) {\n return false;\n }\n return true;\n}\nfunction validateTime(hours, minutes, seconds) {\n if (hours < 0 || hours >= 25) {\n return false;\n }\n if (minutes != null && (minutes < 0 || minutes >= 60)) {\n return false;\n }\n if (seconds != null && (seconds < 0 || seconds >= 60)) {\n return false;\n }\n return true;\n}\n", "import { format as dateFnsFormat } from 'date-fns/format';\nimport { formatters } from './formatters/index.js';\nimport { toDate } from '../toDate/index.js';\nconst tzFormattingTokensRegExp = /([xXOz]+)|''|'(''|[^'])+('|$)/g;\n/**\n * @name format\n * @category Common Helpers\n * @summary Format the date.\n *\n * @description\n * Return the formatted date string in the given format. The result may consty by locale.\n *\n * > \u26A0\uFE0F Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://git.io/fxCyr\n *\n * The characters wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n * (see the last example)\n *\n * Format of the string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 7 below the table).\n *\n * Accepted patterns:\n * | Unit | Pattern | Result examples | Notes |\n * |---------------------------------|---------|-----------------------------------|-------|\n * | Era | G..GGG | AD, BC | |\n * | | GGGG | Anno Domini, Before Christ | 2 |\n * | | GGGGG | A, B | |\n * | Calendar year | y | 44, 1, 1900, 2017 | 5 |\n * | | yo | 44th, 1st, 0th, 17th | 5,7 |\n * | | yy | 44, 01, 00, 17 | 5 |\n * | | yyy | 044, 001, 1900, 2017 | 5 |\n * | | yyyy | 0044, 0001, 1900, 2017 | 5 |\n * | | yyyyy | ... | 3,5 |\n * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |\n * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |\n * | | YY | 44, 01, 00, 17 | 5,8 |\n * | | YYY | 044, 001, 1900, 2017 | 5 |\n * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |\n * | | YYYYY | ... | 3,5 |\n * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |\n * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |\n * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |\n * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |\n * | | RRRRR | ... | 3,5,7 |\n * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |\n * | | uu | -43, 01, 1900, 2017 | 5 |\n * | | uuu | -043, 001, 1900, 2017 | 5 |\n * | | uuuu | -0043, 0001, 1900, 2017 | 5 |\n * | | uuuuu | ... | 3,5 |\n * | Quarter (formatting) | Q | 1, 2, 3, 4 | |\n * | | Qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | QQ | 01, 02, 03, 04 | |\n * | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |\n * | | qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | qq | 01, 02, 03, 04 | |\n * | | qqq | Q1, Q2, Q3, Q4 | |\n * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | qqqqq | 1, 2, 3, 4 | 4 |\n * | Month (formatting) | M | 1, 2, ..., 12 | |\n * | | Mo | 1st, 2nd, ..., 12th | 7 |\n * | | MM | 01, 02, ..., 12 | |\n * | | MMM | Jan, Feb, ..., Dec | |\n * | | MMMM | January, February, ..., December | 2 |\n * | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | L | 1, 2, ..., 12 | |\n * | | Lo | 1st, 2nd, ..., 12th | 7 |\n * | | LL | 01, 02, ..., 12 | |\n * | | LLL | Jan, Feb, ..., Dec | |\n * | | LLLL | January, February, ..., December | 2 |\n * | | LLLLL | J, F, ..., D | |\n * | Local week of year | w | 1, 2, ..., 53 | |\n * | | wo | 1st, 2nd, ..., 53th | 7 |\n * | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | I | 1, 2, ..., 53 | 7 |\n * | | Io | 1st, 2nd, ..., 53th | 7 |\n * | | II | 01, 02, ..., 53 | 7 |\n * | Day of month | d | 1, 2, ..., 31 | |\n * | | do | 1st, 2nd, ..., 31st | 7 |\n * | | dd | 01, 02, ..., 31 | |\n * | Day of year | D | 1, 2, ..., 365, 366 | 8 |\n * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |\n * | | DD | 01, 02, ..., 365, 366 | 8 |\n * | | DDD | 001, 002, ..., 365, 366 | |\n * | | DDDD | ... | 3 |\n * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Su | |\n * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | EEEEE | M, T, W, T, F, S, S | |\n * | | EEEEEE | Mo, Tu, We, Th, Fr, Su, Sa | |\n * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |\n * | | io | 1st, 2nd, ..., 7th | 7 |\n * | | ii | 01, 02, ..., 07 | 7 |\n * | | iii | Mon, Tue, Wed, ..., Su | 7 |\n * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |\n * | | iiiii | M, T, W, T, F, S, S | 7 |\n * | | iiiiii | Mo, Tu, We, Th, Fr, Su, Sa | 7 |\n * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |\n * | | eo | 2nd, 3rd, ..., 1st | 7 |\n * | | ee | 02, 03, ..., 01 | |\n * | | eee | Mon, Tue, Wed, ..., Su | |\n * | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | eeeee | M, T, W, T, F, S, S | |\n * | | eeeeee | Mo, Tu, We, Th, Fr, Su, Sa | |\n * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |\n * | | co | 2nd, 3rd, ..., 1st | 7 |\n * | | cc | 02, 03, ..., 01 | |\n * | | ccc | Mon, Tue, Wed, ..., Su | |\n * | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | ccccc | M, T, W, T, F, S, S | |\n * | | cccccc | Mo, Tu, We, Th, Fr, Su, Sa | |\n * | AM, PM | a..aaa | AM, PM | |\n * | | aaaa | a.m., p.m. | 2 |\n * | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | b..bbb | AM, PM, noon, midnight | |\n * | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | bbbbb | a, p, n, mi | |\n * | Flexible day period | B..BBB | at night, in the morning, ... | |\n * | | BBBB | at night, in the morning, ... | 2 |\n * | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |\n * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |\n * | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |\n * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |\n * | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |\n * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |\n * | | KK | 1, 2, ..., 11, 0 | |\n * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |\n * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |\n * | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | m | 0, 1, ..., 59 | |\n * | | mo | 0th, 1st, ..., 59th | 7 |\n * | | mm | 00, 01, ..., 59 | |\n * | Second | s | 0, 1, ..., 59 | |\n * | | so | 0th, 1st, ..., 59th | 7 |\n * | | ss | 00, 01, ..., 59 | |\n * | Fraction of second | S | 0, 1, ..., 9 | |\n * | | SS | 00, 01, ..., 99 | |\n * | | SSS | 000, 0001, ..., 999 | |\n * | | SSSS | ... | 3 |\n * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |\n * | | XX | -0800, +0530, Z | |\n * | | XXX | -08:00, +05:30, Z | |\n * | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |\n * | | xx | -0800, +0530, +0000 | |\n * | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |\n * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |\n * | Timezone (specific non-locat.) | z...zzz | PDT, EST, CEST | 6 |\n * | | zzzz | Pacific Daylight Time | 2,6 |\n * | Seconds timestamp | t | 512969520 | 7 |\n * | | tt | ... | 3,7 |\n * | Milliseconds timestamp | T | 512969520900 | 7 |\n * | | TT | ... | 3,7 |\n * | Long localized date | P | 05/29/1453 | 7 |\n * | | PP | May 29, 1453 | 7 |\n * | | PPP | May 29th, 1453 | 7 |\n * | | PPPP | Sunday, May 29th, 1453 | 2,7 |\n * | Long localized time | p | 12:00 AM | 7 |\n * | | pp | 12:00:00 AM | 7 |\n * | | ppp | 12:00:00 AM GMT+2 | 7 |\n * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |\n * | Combination of date and time | Pp | 05/29/1453, 12:00 AM | 7 |\n * | | PPpp | May 29, 1453, 12:00:00 AM | 7 |\n * | | PPPppp | May 29th, 1453 at ... | 7 |\n * | | PPPPpppp| Sunday, May 29th, 1453 at ... | 2,7 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)\n * the output will be the same as default pattern for this unit, usually\n * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units\n * are marked with \"2\" in the last column of the table.\n *\n * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`\n *\n * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`\n *\n * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).\n * The output will be padded with zeros to match the length of the pattern.\n *\n * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`\n *\n * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 5. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` always returns the last two digits of a year,\n * while `uu` pads single digit years to 2 characters and returns other years unchanged:\n *\n * | Year | `yy` | `uu` |\n * |------|------|------|\n * | 1 | 01 | 01 |\n * | 14 | 14 | 14 |\n * | 376 | 76 | 376 |\n * | 1453 | 53 | 1453 |\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [getISOWeekYear]{@link https://date-fns.org/docs/getISOWeekYear}\n * and [getWeekYear]{@link https://date-fns.org/docs/getWeekYear}).\n *\n * 6. Specific non-location timezones are created using the Intl browser API. The output is determined by the\n * preferred standard of the current locale (en-US by default) which may not always give the expected result.\n * For this reason it is recommended to supply a `locale` in the format options when formatting a time zone name.\n *\n * 7. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `t`: seconds timestamp\n * - `T`: milliseconds timestamp\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 8. These tokens are often confused with others. See: https://git.io/fxCyr\n *\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole\n * library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The second argument is now required for the sake of explicitness.\n *\n * ```javascript\n * // Before v2.0.0\n * format(new Date(2016, 0, 1))\n *\n * // v2.0.0 onward\n * format(new Date(2016, 0, 1), \"yyyy-MM-dd'T'HH:mm:ss.SSSxxx\")\n * ```\n *\n * - New format string API for `format` function\n * which is based on [Unicode Technical Standard\n * #35](https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table). See [this\n * post](https://blog.date-fns.org/post/unicode-tokens-in-date-fns-v2-sreatyki91jg) for more details.\n *\n * - Characters are now escaped using single quote symbols (`'`) instead of square brackets.\n *\n * @param date the original date\n * @param formatStr the string of tokens\n * @param options the object with options. See [Options]{@link https://date-fns.org/docs/Options}\n * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link\n * https://date-fns.org/docs/toDate}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See\n * [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {Boolean} [options.awareOfUnicodeTokens=false] - if true, allows usage of Unicode tokens causes confusion:\n * - Some of the day of year tokens (`D`, `DD`) that are confused with the day of month tokens (`d`, `dd`).\n * - Some of the local week-numbering year tokens (`YY`, `YYYY`) that are confused with the calendar year tokens\n * (`yy`, `yyyy`). See: https://git.io/fxCyr\n * @param {String} [options.timeZone=''] - used to specify the IANA time zone offset of a date String.\n * @param {Date|Number} [options.originalDate] - can be used to pass the original unmodified date to `format` to\n * improve correctness of the replaced timezone token close to the DST threshold.\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2\n * @throws {RangeError} `options.locale` must contain `localize` property\n * @throws {RangeError} `options.locale` must contain `formatLong` property\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7\n * @throws {RangeError} `options.awareOfUnicodeTokens` must be set to `true` to use `XX` token; see:\n * https://git.io/fxCyr\n *\n * @example\n * // Represent 11 February 2014 in middle-endian format:\n * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')\n * //=> '02/11/2014'\n *\n * @example\n * // Represent 2 July 2014 in Esperanto:\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = format(new Date(2014, 6, 2), \"do 'de' MMMM yyyy\", {\n * locale: eoLocale\n * })\n * //=> '2-a de julio 2014'\n *\n * @example\n * // Escape string by single quote characters:\n * const result = format(new Date(2014, 6, 2, 15), \"h 'o''clock'\")\n * //=> \"3 o'clock\"\n */\nexport function format(date, formatStr, options = {}) {\n formatStr = String(formatStr);\n const matches = formatStr.match(tzFormattingTokensRegExp);\n if (matches) {\n const d = toDate(options.originalDate || date, options);\n // Work through each match and replace the tz token in the format string with the quoted\n // formatted time zone so the remaining tokens can be filled in by date-fns#format.\n formatStr = matches.reduce(function (result, token) {\n if (token[0] === \"'\") {\n return result; // This is a quoted portion, matched only to ensure we don't match inside it\n }\n const pos = result.indexOf(token);\n const precededByQuotedSection = result[pos - 1] === \"'\";\n const replaced = result.replace(token, \"'\" + formatters[token[0]](d, token, options) + \"'\");\n // If the replacement results in two adjoining quoted strings, the back to back quotes\n // are removed, so it doesn't look like an escaped quote.\n return precededByQuotedSection\n ? replaced.substring(0, pos - 1) + replaced.substring(pos + 1)\n : replaced;\n }, formatStr);\n }\n return dateFnsFormat(date, formatStr, options);\n}\n", "import { getDateString } from \"@lib/getDateString\";\nimport { isTimezoneDate } from \"./isTimezoneDate\";\nimport { format } from \"date-fns-tz\";\n\nexport const renderTimelineDateTime = (\n date: string,\n showTime = true,\n\n /**\n * The timezone of `date` if a designator is not included. If not provided,\n * the date is assumed to be in a timezone local to the timeline event (e.g\n * flight departure).\n */\n dateTimeZone?: string,\n) => {\n const dateHasTimezoneDesignator = isTimezoneDate(date);\n\n return (\n <div style={!showTime ? { marginTop: \"var(--space-20)\" } : undefined}>\n <p\n style={{\n color: \"var(--GREY-600)\",\n fontWeight: \"medium\",\n fontSize: \"12px\",\n lineHeight: \"20px\",\n }}\n >\n {getDateString(date, \"medium\")}\n </p>\n {showTime && (\n <p\n style={{\n color: \"var(--GREY-600)\",\n fontSize: \"12px\",\n lineHeight: \"20px\",\n }}\n >\n {getDateString(\n date,\n dateHasTimezoneDesignator ? \"timeOnlyWithTimezone\" : \"timeOnly\",\n )}\n {!dateHasTimezoneDesignator &&\n (dateTimeZone\n ? ` ${format(new Date(date), \"z\", { timeZone: dateTimeZone })}`\n : \" local\")}\n </p>\n )}\n </div>\n );\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import * as React from \"react\";\nimport { Policy } from \"./Policy\";\nimport { getDateString } from \"@lib/getDateString\";\nimport { moneyStringFormatter } from \"@lib/moneyStringFormatter\";\nimport { VSpace } from \"@components/shared/VSpace\";\nimport { HSpace } from \"@components/shared/HSpace\";\nimport { TimelineItem } from \"./TimelineItem\";\nimport { renderTimelineDateTime } from \"./lib/renderTimelineDateTime\";\nimport { StaysRateCancellationTimeline } from \"@duffel/api/types\";\nimport { Color } from \"@lib/colors\";\n\ninterface StaysCancellationTimelineDepositProps {\n cancellationTimeline: StaysRateCancellationTimeline[];\n totalAmount: string;\n bookingDate: string;\n checkInDate: string;\n checkInAfterTime?: string;\n}\n\nconst FullRefundPolicy: React.FC<{\n before: string;\n refundAmount: string;\n currency: string;\n}> = ({ before }) => (\n <Policy\n iconName=\"check_large\"\n iconColor=\"--GREEN-700\"\n label={\"Deposit refundable\"}\n >\n You may cancel for free before{\" \"}\n {getDateString(before, \"mediumWithTimeAndTimezone\")}.\n </Policy>\n);\n\nconst PartialRefundPolicy: React.FC<{\n cancellationTimeline: StaysRateCancellationTimeline;\n totalAmount: string;\n}> = ({ cancellationTimeline, totalAmount }) => (\n <Policy\n iconName=\"check_large\"\n iconColor=\"--YELLOW-700\"\n label=\"Deposit partially refundable\"\n >\n If you cancel before{\" \"}\n {getDateString(cancellationTimeline.before, \"mediumWithTimeAndTimezone\")},\n your deposit will be refunded minus a cancellation fee of{\" \"}\n {moneyStringFormatter(cancellationTimeline.currency)(\n +totalAmount - +cancellationTimeline.refund_amount,\n )}\n .\n </Policy>\n);\n\nconst OnlyNoRefundPolicy: React.FC = () => {\n return (\n <Policy label=\"Non refundable\" iconName=\"close\" iconColor=\"--PINK-700\">\n Your deposit is non-refundable. If you cancel this booking, you will not\n be refunded your deposit.\n </Policy>\n );\n};\n\nconst NoRefundPolicy: React.FC<{\n afterDate: string;\n hasFreeCancellation: boolean;\n}> = ({ afterDate, hasFreeCancellation }) => {\n return (\n <Policy\n label=\"Deposit non refundable\"\n iconName=\"close\"\n iconColor=\"--PINK-700\"\n >\n From the {getDateString(afterDate, \"mediumWithTimeAndTimezone\")} onwards,{\" \"}\n {hasFreeCancellation\n ? \"you will not be refunded your deposit if you cancel.\"\n : \"your deposit will not be refunded and full payment will be required.\"}\n </Policy>\n );\n};\n\nexport const StaysCancellationTimelineDeposit: React.FC<\n StaysCancellationTimelineDepositProps\n> = ({\n cancellationTimeline,\n totalAmount,\n checkInDate,\n checkInAfterTime,\n bookingDate,\n}) => {\n const checkInDateTime = `${checkInDate}${\n checkInAfterTime ? `T${checkInAfterTime}` : \"\"\n }`;\n const hasFreeCancellation =\n cancellationTimeline.length > 0 &&\n cancellationTimeline[0].refund_amount === totalAmount;\n return (\n <>\n <VSpace space={8}>\n {cancellationTimeline.map((timelineItem) => {\n if (+timelineItem.refund_amount === 0) {\n // We don't expect the amount to ever be 0, and we are handling no-refund case\n // separately outside of this mapping\n return null;\n }\n\n if (timelineItem.refund_amount === totalAmount) {\n return (\n <FullRefundPolicy\n key={timelineItem.before}\n before={timelineItem.before}\n refundAmount={timelineItem.refund_amount}\n currency={timelineItem.currency}\n />\n );\n }\n\n return (\n <PartialRefundPolicy\n key={timelineItem.before}\n cancellationTimeline={timelineItem}\n totalAmount={totalAmount}\n />\n );\n })}\n\n {cancellationTimeline.length ? (\n <NoRefundPolicy\n afterDate={\n cancellationTimeline[cancellationTimeline.length - 1].before\n }\n hasFreeCancellation={hasFreeCancellation}\n />\n ) : (\n <OnlyNoRefundPolicy />\n )}\n </VSpace>\n\n {cancellationTimeline.length > 0 && (\n <>\n <div className=\"stays-cancellation-timeline-divider\" />\n\n <HSpace\n space={0}\n className=\"u-paddingVertical24\"\n style={{ justifyContent: \"center\" }}\n >\n {cancellationTimeline.map((timelineItem, index) => {\n const currentColor: Color =\n timelineItem.refund_amount === totalAmount\n ? \"--GREEN-700\"\n : \"--YELLOW-700\";\n\n let prevColor: Color;\n if (index === 0) {\n prevColor = \"--GREY-300\";\n } else if (\n cancellationTimeline[index - 1].refund_amount === totalAmount\n ) {\n prevColor = \"--GREEN-700\";\n } else {\n prevColor = \"--YELLOW-700\";\n }\n\n const timelineSize =\n cancellationTimeline.length === 1 ? \"extra-large\" : \"large\";\n\n return (\n <>\n {/* This is the start of the current section of the timeline - will have a dot and date above it */}\n <TimelineItem\n key={timelineItem.before}\n lineColorLeft={prevColor}\n lineColorRight={currentColor}\n dotColor={currentColor}\n size=\"extra-small\"\n label={index === 0 ? \"Booking\" : undefined}\n aboveDot={renderTimelineDateTime(\n index === 0\n ? bookingDate\n : cancellationTimeline[index - 1].before,\n )}\n />\n {/* This is the main section of the line. Won't have a dot*/}\n <TimelineItem\n key={timelineItem.before + \"-line\"}\n lineColorLeft={currentColor}\n lineColorRight={currentColor}\n label={\n timelineItem.refund_amount === totalAmount\n ? \"Deposit refund\"\n : \"Deposit partially refundable\"\n }\n dot={false}\n size={timelineSize}\n description={moneyStringFormatter(timelineItem.currency)(\n +timelineItem.refund_amount,\n )}\n />\n\n {/*\n This is the last timeline - ends the last section with a dot and connect with the red section\n towards the check-in date. The assumption here is that there will always be a time period between\n the last cancellation deadline and the check in date.\n */}\n {index === cancellationTimeline.length - 1 && (\n <>\n <TimelineItem\n key={timelineItem.before + \"-end\"}\n lineColorLeft={currentColor}\n lineColorRight=\"--PINK-700\"\n dotColor=\"--PINK-700\"\n size=\"small\"\n aboveDot={renderTimelineDateTime(timelineItem.before)}\n />\n <TimelineItem\n key={timelineItem.before + \"-end\"}\n lineColorLeft=\"--PINK-700\"\n lineColorRight=\"--PINK-700\"\n dot={false}\n label=\"No refund\"\n />\n <TimelineItem\n key=\"end\"\n lineColorLeft=\"--PINK-700\"\n label={\n <>\n Check-in\n <br />\n at the hotel\n </>\n }\n size=\"small\"\n aboveDot={renderTimelineDateTime(\n checkInDateTime,\n Boolean(checkInAfterTime),\n )}\n />\n </>\n )}\n </>\n );\n })}\n </HSpace>\n </>\n )}\n </>\n );\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import * as React from \"react\";\nimport { Policy } from \"./Policy\";\nimport { StaysRateCancellationTimeline } from \"@duffel/api/types\";\nimport { getDateString } from \"@lib/getDateString\";\nimport { moneyStringFormatter } from \"@lib/moneyStringFormatter\";\nimport { VSpace } from \"@components/shared/VSpace\";\nimport { HSpace } from \"@components/shared/HSpace\";\nimport { TimelineItem } from \"./TimelineItem\";\nimport { renderTimelineDateTime } from \"./lib/renderTimelineDateTime\";\nimport { Color } from \"@lib/colors\";\n\ninterface StaysCancellationTimelineGuaranteeProps {\n cancellationTimeline: StaysRateCancellationTimeline[];\n totalAmount: string;\n bookingDate: string;\n checkInDate: string;\n checkInAfterTime?: string;\n}\n\nconst FullRefundPolicy: React.FC<{\n before: string;\n}> = ({ before }) => {\n return (\n <Policy\n iconName=\"check_large\"\n iconColor=\"--GREEN-700\"\n label=\"Free cancellation\"\n >\n You may cancel for free before{\" \"}\n {getDateString(before, \"mediumWithTimeAndTimezone\")}. No payment will be\n required.\n </Policy>\n );\n};\n\nconst PartialRefundPolicy: React.FC<{\n cancellationTimeline: StaysRateCancellationTimeline;\n totalAmount: string;\n}> = ({ cancellationTimeline, totalAmount }) => (\n <Policy\n iconName=\"check_large\"\n iconColor=\"--YELLOW-700\"\n label=\"Reduced penalty if cancelled\"\n >\n If you cancel before{\" \"}\n {getDateString(cancellationTimeline.before, \"mediumWithTimeAndTimezone\")}, a\n cancellation fee of{\" \"}\n {moneyStringFormatter(cancellationTimeline.currency)(\n +totalAmount - +cancellationTimeline.refund_amount,\n )}{\" \"}\n will apply.\n </Policy>\n);\n\nconst OnlyNoRefundPolicy: React.FC = () => (\n <Policy\n label=\"Full penalty if cancelled\"\n iconName=\"close\"\n iconColor=\"--PINK-700\"\n >\n If you cancel this booking at any time, the full payment amount will be\n charged as a cancellation fee.\n </Policy>\n);\n\nconst NoRefundPolicy: React.FC<{\n afterDate: string;\n hasFreeCancellation?: boolean;\n}> = ({ afterDate, hasFreeCancellation }) => (\n <Policy\n label={\n hasFreeCancellation ? \"Cancellation fee\" : \"Full penalty if cancelled\"\n }\n iconName=\"close\"\n iconColor=\"--PINK-700\"\n >\n If you cancel after {getDateString(afterDate, \"mediumWithTimeAndTimezone\")},\n a cancellation fee will {hasFreeCancellation ? \"apply\" : \"be charged\"}.\n </Policy>\n);\n\nexport const StaysCancellationTimelineGuarantee: React.FC<\n StaysCancellationTimelineGuaranteeProps\n> = ({\n cancellationTimeline,\n totalAmount,\n checkInDate,\n checkInAfterTime,\n bookingDate,\n}) => {\n const checkInDateTime = `${checkInDate}${\n checkInAfterTime ? `T${checkInAfterTime}` : \"\"\n }`;\n const hasFreeCancellation =\n cancellationTimeline.length > 0 &&\n cancellationTimeline[0].refund_amount === totalAmount;\n return (\n <>\n <VSpace space={8}>\n {cancellationTimeline.map((timelineItem) => {\n if (+timelineItem.refund_amount === 0) {\n // We don't expect the amount to ever be 0, and we are handling no-refund case\n // separately outside of this mapping\n return null;\n }\n\n if (timelineItem.refund_amount === totalAmount) {\n return (\n <FullRefundPolicy\n key={timelineItem.before}\n before={timelineItem.before}\n />\n );\n }\n\n return (\n <PartialRefundPolicy\n key={timelineItem.before}\n cancellationTimeline={timelineItem}\n totalAmount={totalAmount}\n />\n );\n })}\n\n {cancellationTimeline.length ? (\n <NoRefundPolicy\n afterDate={\n cancellationTimeline[cancellationTimeline.length - 1].before\n }\n hasFreeCancellation={hasFreeCancellation}\n />\n ) : (\n <OnlyNoRefundPolicy />\n )}\n </VSpace>\n\n {cancellationTimeline.length > 0 && (\n <>\n <div className=\"stays-cancellation-timeline-divider\" />\n\n <HSpace\n space={0}\n className=\"u-paddingVertical24\"\n style={{ justifyContent: \"center\" }}\n >\n {cancellationTimeline.map((timelineItem, index) => {\n const currentColor: Color =\n timelineItem.refund_amount === totalAmount\n ? \"--GREEN-700\"\n : \"--YELLOW-700\";\n\n let prevColor: Color;\n if (index === 0) {\n prevColor = \"--GREY-300\";\n } else if (\n cancellationTimeline[index - 1].refund_amount === totalAmount\n ) {\n prevColor = \"--GREEN-700\";\n } else {\n prevColor = \"--YELLOW-700\";\n }\n\n const timelineSize =\n cancellationTimeline.length === 1 ? \"extra-large\" : \"large\";\n\n return (\n <>\n {/* This is the start of the current section of the timeline - will have a dot and date above it */}\n <TimelineItem\n key={timelineItem.before}\n lineColorLeft={prevColor}\n lineColorRight={currentColor}\n dotColor={currentColor}\n size=\"extra-small\"\n label={index === 0 ? \"Booking\" : undefined}\n aboveDot={renderTimelineDateTime(\n index === 0\n ? bookingDate\n : cancellationTimeline[index - 1].before,\n )}\n />\n {/* This is the main section of the line. Won't have a dot*/}\n <TimelineItem\n key={timelineItem.before + \"-line\"}\n lineColorLeft={currentColor}\n lineColorRight={currentColor}\n label={\n timelineItem.refund_amount === totalAmount\n ? \"Free cancellation\"\n : \"Reduced penalty\"\n }\n dot={false}\n size={timelineSize}\n description={moneyStringFormatter(timelineItem.currency)(\n +timelineItem.refund_amount,\n )}\n />\n\n {/*\n This is the last timeline - ends the last section with a dot and connect with the red section\n towards the check-in date. The assumption here is that there will always be a time period between\n the last cancellation deadline and the check in date.\n */}\n {index === cancellationTimeline.length - 1 && (\n <>\n <TimelineItem\n key={timelineItem.before + \"-end\"}\n lineColorLeft={currentColor}\n lineColorRight=\"--PINK-700\"\n dotColor=\"--PINK-700\"\n size=\"small\"\n aboveDot={renderTimelineDateTime(timelineItem.before)}\n />\n <TimelineItem\n key={timelineItem.before + \"-end\"}\n lineColorLeft=\"--PINK-700\"\n lineColorRight=\"--PINK-700\"\n dot={false}\n label={\n hasFreeCancellation\n ? \"Cancellation fee\"\n : \"Full penalty\"\n }\n />\n <TimelineItem\n key=\"end\"\n lineColorLeft=\"--PINK-700\"\n label={\n <>\n Check-in\n <br />\n at the hotel\n </>\n }\n size=\"small\"\n aboveDot={renderTimelineDateTime(\n checkInDateTime,\n Boolean(checkInAfterTime),\n )}\n />\n </>\n )}\n </>\n );\n })}\n </HSpace>\n </>\n )}\n </>\n );\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import * as React from \"react\";\nimport { Policy } from \"./Policy\";\nimport { moneyStringFormatter } from \"@lib/moneyStringFormatter\";\nimport { getDateString } from \"@lib/getDateString\";\nimport { HSpace } from \"@components/shared/HSpace\";\nimport { TimelineItem } from \"./TimelineItem\";\nimport { StaysRateCancellationTimeline } from \"@duffel/api/types\";\nimport { VSpace } from \"@components/shared/VSpace\";\nimport { renderTimelineDateTime } from \"./lib/renderTimelineDateTime\";\nimport { Color } from \"@lib/colors\";\n\ninterface StaysCancellationTimelinePayNowProps {\n cancellationTimeline: StaysRateCancellationTimeline[];\n totalAmount: string;\n bookingDate: string;\n checkInDate: string;\n checkInAfterTime?: string;\n}\n\nconst FullRefundPolicy: React.FC<{\n before: string;\n refundAmount: string;\n currency: string;\n}> = ({ before, refundAmount, currency }) => (\n <Policy\n iconName=\"check_large\"\n iconColor=\"--GREEN-700\"\n label=\"Fully refundable\"\n >\n You may cancel for free before{\" \"}\n {getDateString(before, \"mediumWithTimeAndTimezone\")}. You will be receive a\n full refund of {moneyStringFormatter(currency)(+refundAmount)}.\n </Policy>\n);\n\nconst PartialRefundPolicy: React.FC<{\n cancellationTimeline: StaysRateCancellationTimeline;\n totalAmount: string;\n}> = ({ cancellationTimeline, totalAmount }) => {\n return (\n <Policy\n iconName=\"check_large\"\n iconColor=\"--YELLOW-700\"\n label=\"Refundable for a fee\"\n >\n If you cancel before{\" \"}\n {getDateString(cancellationTimeline.before, \"mediumWithTimeAndTimezone\")},\n you will be receive a partial refund of{\" \"}\n {moneyStringFormatter(cancellationTimeline.currency)(\n +cancellationTimeline.refund_amount,\n )}\n . A cancellation fee of{\" \"}\n {moneyStringFormatter(cancellationTimeline.currency)(\n +totalAmount - +cancellationTimeline.refund_amount,\n )}{\" \"}\n will be retained.\n </Policy>\n );\n};\n\nconst OnlyNoRefundPolicy: React.FC = () => (\n <Policy label=\"Non refundable\" iconName=\"close\" iconColor=\"--PINK-700\">\n You have chosen a non-refundable rate. If you cancel this booking, you will\n not receive any refund.\n </Policy>\n);\n\nconst NoRefundPolicy: React.FC<{\n afterDate: string;\n}> = ({ afterDate }) => {\n return (\n <Policy label=\"No refund\" iconName=\"close\" iconColor=\"--PINK-700\">\n From the {getDateString(afterDate, \"mediumWithTimeAndTimezone\")} onwards,\n you won't be able to get any refund for cancelling this booking.\n </Policy>\n );\n};\n\nexport const StaysCancellationTimelinePayNow: React.FC<\n StaysCancellationTimelinePayNowProps\n> = ({\n cancellationTimeline,\n totalAmount,\n checkInDate,\n checkInAfterTime,\n bookingDate,\n}) => {\n const checkInDateTime = `${checkInDate}${\n checkInAfterTime ? `T${checkInAfterTime}` : \"\"\n }`;\n return (\n <>\n <VSpace space={8}>\n {cancellationTimeline.map((timelineItem) => {\n if (+timelineItem.refund_amount === 0) {\n // We don't expect the amount to ever be 0, and we are handling no-refund case\n // separately outside of this mapping\n return null;\n }\n\n if (timelineItem.refund_amount === totalAmount) {\n return (\n <FullRefundPolicy\n key={timelineItem.before}\n before={timelineItem.before}\n refundAmount={timelineItem.refund_amount}\n currency={timelineItem.currency}\n />\n );\n }\n\n return (\n <PartialRefundPolicy\n key={timelineItem.before}\n cancellationTimeline={timelineItem}\n totalAmount={totalAmount}\n />\n );\n })}\n\n {cancellationTimeline.length ? (\n <NoRefundPolicy\n afterDate={\n cancellationTimeline[cancellationTimeline.length - 1].before\n }\n />\n ) : (\n <OnlyNoRefundPolicy />\n )}\n </VSpace>\n\n {cancellationTimeline.length > 0 && (\n <>\n <div className=\"stays-cancellation-timeline-divider\" />\n\n <HSpace\n space={0}\n className=\"u-paddingVertical24\"\n style={{ justifyContent: \"center\" }}\n >\n {cancellationTimeline.map((timelineItem, index) => {\n const currentColor: Color =\n timelineItem.refund_amount === totalAmount\n ? \"--GREEN-700\"\n : \"--YELLOW-700\";\n\n let prevColor: Color;\n if (index === 0) {\n prevColor = \"--GREY-300\";\n } else if (\n cancellationTimeline[index - 1].refund_amount === totalAmount\n ) {\n prevColor = \"--GREEN-700\";\n } else {\n prevColor = \"--YELLOW-700\";\n }\n\n const timelineSize =\n cancellationTimeline.length === 1 ? \"extra-large\" : \"large\";\n\n return (\n <>\n {/* This is the start of the current section of the timeline - will have a dot and date above it */}\n <TimelineItem\n key={timelineItem.before}\n lineColorLeft={prevColor}\n lineColorRight={currentColor}\n dotColor={currentColor}\n size=\"extra-small\"\n label={index === 0 ? \"Booking\" : undefined}\n aboveDot={renderTimelineDateTime(\n index === 0\n ? bookingDate\n : cancellationTimeline[index - 1].before,\n )}\n />\n {/* This is the main section of the line. Won't have a dot*/}\n <TimelineItem\n key={timelineItem.before + \"-line\"}\n lineColorLeft={currentColor}\n lineColorRight={currentColor}\n label={\n timelineItem.refund_amount === totalAmount\n ? \"Full refund\"\n : \"Partial refund\"\n }\n dot={false}\n size={timelineSize}\n description={moneyStringFormatter(timelineItem.currency)(\n +timelineItem.refund_amount,\n )}\n />\n\n {/*\n This is the last timeline - ends the last section with a dot and connect with the red section\n towards the check-in date. The assumption here is that there will always be a time period between\n the last cancellation deadline and the check in date.\n */}\n {index === cancellationTimeline.length - 1 && (\n <>\n <TimelineItem\n key={timelineItem.before + \"-end\"}\n lineColorLeft={currentColor}\n lineColorRight=\"--PINK-700\"\n dotColor=\"--PINK-700\"\n size=\"small\"\n aboveDot={renderTimelineDateTime(timelineItem.before)}\n />\n <TimelineItem\n key={timelineItem.before + \"-end\"}\n lineColorLeft=\"--PINK-700\"\n lineColorRight=\"--PINK-700\"\n dot={false}\n label=\"No refund\"\n />\n <TimelineItem\n key=\"end\"\n lineColorLeft=\"--PINK-700\"\n label={\n <>\n Check-in\n <br />\n at the hotel\n </>\n }\n size=\"small\"\n aboveDot={renderTimelineDateTime(\n checkInDateTime,\n Boolean(checkInAfterTime),\n )}\n />\n </>\n )}\n </>\n );\n })}\n </HSpace>\n </>\n )}\n </>\n );\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import * as React from \"react\";\nimport { StaysCancellationTimelineDeposit } from \"./StaysCancellationTimelineDeposit\";\nimport { StaysCancellationTimelineGuarantee } from \"./StaysCancellationTimelineGuarantee\";\nimport { StaysCancellationTimelinePayNow } from \"./StaysCancellationTimelinePayNow\";\nimport { VSpace } from \"@components/shared/VSpace\";\nimport { StaysRate, StaysRateCancellationTimeline } from \"@duffel/api/types\";\nimport { WithComponentStyles } from \"@components/shared/WithComponentStyles\";\n\nexport interface StaysCancellationTimelineProps {\n paymentType?: StaysRate[\"payment_type\"];\n cancellationTimeline: StaysRateCancellationTimeline[];\n totalAmount: string;\n bookingDate: string;\n checkInDate: string;\n checkInAfterTime?: string;\n}\n\nexport const StaysCancellationTimeline: React.FC<\n StaysCancellationTimelineProps\n> = ({ paymentType, ...props }) => {\n return (\n <WithComponentStyles>\n <VSpace space={24} className=\"duffel-components\" data-selector=\"fs-show\">\n {(paymentType === \"pay_now\" || !paymentType) && (\n <StaysCancellationTimelinePayNow {...props} />\n )}\n {paymentType === \"deposit\" && (\n <StaysCancellationTimelineDeposit {...props} />\n )}\n {paymentType === \"guarantee\" && (\n <StaysCancellationTimelineGuarantee {...props} />\n )}\n </VSpace>\n </WithComponentStyles>\n );\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import * as React from \"react\";\nimport { HSpace } from \"@components/shared/HSpace\";\nimport { Icon } from \"@components/shared/Icon\";\nimport { WithComponentStyles } from \"@components/shared/WithComponentStyles\";\n\nexport interface StaysRatingProps {\n rating: number;\n small?: boolean;\n}\n\nexport const StaysRating: React.FC<StaysRatingProps> = ({ rating, small }) => (\n <WithComponentStyles>\n <HSpace space={0} className=\"duffel-components\">\n {Array.from({ length: rating }).map((_, index) => (\n <Icon\n key={index}\n name=\"star\"\n color=\"--YELLOW-600\"\n size={small ? 8 : 12}\n />\n ))}\n </HSpace>\n </WithComponentStyles>\n);\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { IconName } from \"@components/shared/Icon\";\nimport { StaysRoomRate } from \"@duffel/api/types\";\n\nexport const LOYALTY_PROGRAMS_NAME_MAP = {\n wyndham_rewards: \"Wyndham Rewards\",\n choice_privileges: \"Choice Privileges\",\n marriott_bonvoy: \"Marriott Bonvoy\",\n best_western_rewards: \"Best Western Rewards\",\n world_of_hyatt: \"World of Hyatt\",\n hilton_honors: \"Hilton Honors\",\n ihg_one_rewards: \"IHG One Rewards\",\n leaders_club: \"Leaders Club\",\n stash_rewards: \"Stash Rewards\",\n omni_select_guest: \"Omni Select Guest\",\n i_prefer: \"I Prefer\",\n accor_live_limitless: \"Accor Live Limitless\",\n my_6: \"My 6\",\n jumeirah_one: \"Jumeirah One\",\n global_hotel_alliance_discovery: \"Global Hotel Alliance Discovery\",\n duffel_hotel_group_rewards: \"Duffel Hotel Group Rewards\",\n};\n\nexport const SOURCE_NAME_MAP = {\n bookingcom: \"Booking.com\",\n expedia: \"Expedia\",\n priceline: \"Priceline\",\n travelport: \"Travelport\",\n duffel_hotel_group: \"Duffel Hotel Group\",\n};\n\nexport const getBoardTypeLabel = (boardType: StaysRoomRate[\"board_type\"]) => {\n switch (boardType) {\n case \"room_only\":\n return \"Room only, no meals\";\n case \"breakfast\":\n return \"Breakfast included\";\n case \"half_board\":\n return \"Half board\";\n case \"full_board\":\n return \"Full board\";\n case \"all_inclusive\":\n return \"All inclusive\";\n default:\n return boardType;\n }\n};\n\nexport const boardTypeIcon = (\n boardType: StaysRoomRate[\"board_type\"],\n): IconName => {\n switch (boardType) {\n case \"room_only\":\n return \"bedroom_parent\";\n case \"breakfast\":\n return \"bakery_dining\";\n case \"half_board\":\n return \"bakery_dining\";\n case \"full_board\":\n return \"brunch_dining\";\n case \"all_inclusive\":\n return \"brunch_dining\";\n default:\n return boardType;\n }\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { StaysAccommodation, StaysBooking } from \"@duffel/api/types\";\nimport { StaysRating } from \"./StaysRating\";\nimport { boardTypeIcon, getBoardTypeLabel } from \"./lib/types\";\nimport { VSpace } from \"@components/shared/VSpace\";\nimport { HSpace } from \"@components/shared/HSpace\";\nimport { Icon } from \"@components/shared/Icon\";\nimport { LOYALTY_PROGRAMS_NAME_MAP } from \"./lib/types\";\nimport { getDateString } from \"@lib/getDateString\";\nimport { WithComponentStyles } from \"@components/shared/WithComponentStyles\";\n\nexport interface StaysSummaryProps {\n accommodation: StaysAccommodation;\n checkInDate: Date;\n checkOutDate: Date;\n numRooms?: number;\n\n supportedLoyaltyProgramme?: StaysBooking[\"supported_loyalty_programme\"];\n loyaltyProgrammeAccountNumber?: string | null;\n accommodationSpecialRequests?: string | null;\n}\n\nexport const StaysSummary: React.FC<\n React.PropsWithChildren<StaysSummaryProps>\n> = ({\n accommodation,\n checkInDate,\n checkOutDate,\n numRooms,\n supportedLoyaltyProgramme,\n loyaltyProgrammeAccountNumber,\n accommodationSpecialRequests,\n children,\n}) => (\n <WithComponentStyles>\n <VSpace space={24} className=\"duffel-components stays-summary-container\">\n <HSpace space={16}>\n <div\n className=\"stays-summary-photo\"\n style={\n accommodation.photos && accommodation.photos.length > 0\n ? { backgroundImage: `url(${accommodation.photos[0].url})` }\n : { backgroundColor: \"var(--GREY-100)\" }\n }\n >\n {(accommodation.photos?.length ?? 0) === 0 && (\n <Icon name=\"image_not_supported\" color=\"--GREY-200\" size={30} />\n )}\n </div>\n <VSpace space={4}>\n {accommodation.rating && (\n <StaysRating rating={accommodation.rating} />\n )}\n <p className=\"stays-summary-text--large\">{accommodation.name}</p>\n <p className=\"stays-summary-text--small\">\n {accommodation.location.address.line_one},{\" \"}\n {accommodation.location.address.region ??\n accommodation.location.address.city_name ??\n accommodation.location.address.country_code}\n {accommodation.location.address.postal_code &&\n `, ${accommodation.location.address.postal_code}`}\n </p>\n </VSpace>\n </HSpace>\n <VSpace space={8}>\n <HSpace space={8} alignCenter>\n {numRooms && <p className=\"stays-summary-stamp\">{numRooms}x</p>}\n <p>{accommodation.rooms[0].name}</p>\n </HSpace>\n {accommodation.rooms.length &&\n accommodation.rooms[0].rates.length &&\n accommodation.rooms[0].rates[0].board_type && (\n <HSpace space={12} alignCenter>\n <Icon\n name={boardTypeIcon(accommodation.rooms[0].rates[0].board_type)}\n size={20}\n color=\"--GREY-700\"\n />\n\n <p>\n {getBoardTypeLabel(accommodation.rooms[0].rates[0].board_type)}\n </p>\n </HSpace>\n )}\n </VSpace>\n <div className=\"stays-summary-times\">\n <div>\n <p className=\"stays-summary-text--small\">Check in</p>\n <p className=\"stays-summary-text--large\">\n {getDateString(checkInDate, \"longNoYear\").replace(\",\", \"\")}\n </p>\n {accommodation.check_in_information && (\n <p className=\"stays-summary-text--small\">\n from {accommodation.check_in_information?.check_in_after_time}\n </p>\n )}\n </div>\n <div className=\"stays-summary-divider\" />\n <div>\n <p className=\"stays-summary-text--small\">Check out</p>\n <p className=\"stays-summary-text--large\">\n {getDateString(checkOutDate, \"longNoYear\").replace(\",\", \"\")}\n </p>\n {accommodation.check_in_information && (\n <p className=\"stays-summary-text--small\">\n until {accommodation.check_in_information.check_out_before_time}\n </p>\n )}\n </div>\n </div>\n {supportedLoyaltyProgramme && loyaltyProgrammeAccountNumber && (\n <VSpace space={8}>\n <p className=\"stays-summary-text--small\">Loyalty number</p>\n <p>\n {LOYALTY_PROGRAMS_NAME_MAP[supportedLoyaltyProgramme]},{\" \"}\n {loyaltyProgrammeAccountNumber}\n </p>\n </VSpace>\n )}\n {accommodationSpecialRequests && (\n <VSpace space={8}>\n <p className=\"stays-summary-text--small\">Special requests</p>\n <p>{accommodationSpecialRequests}</p>\n </VSpace>\n )}\n {children}\n </VSpace>\n </WithComponentStyles>\n);\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import * as React from \"react\";\nimport { HSpace } from \"@components/shared/HSpace\";\nimport { Icon, IconName } from \"@components/shared/Icon\";\nimport { StaysAccommodation, StaysAmenity } from \"@duffel/api/types\";\nimport { hrefToComponentStyles } from \"@components/shared/WithComponentStyles\";\n\nexport const amenityIcon = (type: StaysAmenity[\"type\"]): IconName => {\n switch (type) {\n case \"adult_only\":\n return \"no_stroller\";\n case \"accessibility_hearing\":\n return \"hearing\";\n case \"accessibility_mobility\":\n return \"accessible\";\n case \"cash_machine\":\n return \"atm\";\n case \"spa\":\n return \"spa\";\n case \"pool\":\n return \"pool\";\n case \"childcare_service\":\n return \"child_care\";\n case \"laundry\":\n return \"laundry\";\n case \"pets_allowed\":\n return \"pet_supplies\";\n case \"room_service\":\n return \"room_service\";\n case \"wifi\":\n return \"wifi\";\n case \"gym\":\n return \"fitness_center\";\n case \"parking\":\n return \"local_parking\";\n case \"business_centre\":\n return \"meeting_room\";\n case \"restaurant\":\n return \"restaurant\";\n case \"lounge\":\n return \"local_bar\";\n case \"24_hour_front_desk\":\n case \"concierge\":\n return \"concierge\";\n default:\n return \"check_circle\";\n }\n};\n\nexport interface StaysAmenitiesProps {\n amenities: StaysAccommodation[\"amenities\"];\n}\n\nexport const StaysAmenities: React.FC<StaysAmenitiesProps> = ({\n amenities,\n}) => (\n <>\n {/* This component doesn't use WithComponentStyles because we don't want to wrap it in a div */}\n <link rel=\"stylesheet\" href={hrefToComponentStyles}></link>\n {amenities?.map((amenity) => (\n <HSpace\n key={amenity.type}\n space={4}\n alignCenter\n className=\"duffel-components\"\n >\n <Icon name={amenityIcon(amenity.type)} size={16} />\n <p className=\"amenities__text\">{amenity.description}</p>\n </HSpace>\n ))}\n </>\n);\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import classNames from \"classnames\";\nimport * as React from \"react\";\nimport {\n LOYALTY_PROGRAMS_NAME_MAP,\n SOURCE_NAME_MAP,\n boardTypeIcon,\n getBoardTypeLabel,\n} from \"./lib/types\";\nimport { moneyStringFormatter } from \"@lib/moneyStringFormatter\";\nimport { getDateString } from \"@lib/getDateString\";\nimport { getRateLabel } from \"./lib/getRateLabel\";\nimport { HSpace } from \"@components/shared/HSpace\";\nimport { Icon, IconName } from \"@components/shared/Icon\";\nimport { VSpace } from \"@components/shared/VSpace\";\nimport {\n StaysRateCancellationTimeline,\n StaysRoomRate,\n} from \"@duffel/api/types\";\nimport { RadioButton } from \"@components/shared/RadioButton\";\nimport { withPlural } from \"@lib/withPlural\";\nimport { WithComponentStyles } from \"@components/shared/WithComponentStyles\";\n\nexport interface StaysRoomRateCardProps {\n rate: StaysRoomRate;\n searchNumberOfRooms: number;\n numberOfNights: number;\n selected: boolean;\n onSelectRate: (rateId: string) => void;\n\n hidePaymentMethod?: boolean;\n hideSource?: boolean;\n}\n\nexport const StaysRoomRateCard: React.FC<StaysRoomRateCardProps> = ({\n numberOfNights,\n searchNumberOfRooms,\n rate,\n selected,\n onSelectRate,\n hidePaymentMethod = false,\n hideSource = false,\n}) => {\n const earliestCancellation: StaysRateCancellationTimeline | undefined =\n rate.cancellation_timeline[0];\n\n const quantityOfRoomsAvailable: number =\n rate.quantity_available != null && !isNaN(rate.quantity_available)\n ? rate.quantity_available\n : searchNumberOfRooms;\n\n return (\n <WithComponentStyles>\n <button\n onClick={() => onSelectRate(rate.id)}\n className={classNames(\n \"duffel-components\",\n \"stays-room-rate-card__container\",\n selected && \"stays-room-rate-card__container--selected\",\n )}\n >\n <VSpace className=\"stays-room-rate-card__content\" space={12}>\n <HSpace space={0} spaceBetween>\n <p className=\"stays-room-rate-card__text--medium\">\n {!earliestCancellation && \"Non-refundable\"}\n {earliestCancellation &&\n rate.total_amount === earliestCancellation.refund_amount &&\n \"Fully refundable\"}\n {earliestCancellation &&\n rate.total_amount !== earliestCancellation.refund_amount &&\n \"Partially refundable\"}\n {rate.board_type === \"breakfast\" && \" with breakfast\"}\n {rate.board_type === \"all_inclusive\" && \" all inclusive\"}\n </p>\n </HSpace>\n <VSpace space={8}>\n {rate.board_type && (\n <StayResultRoomRateItem\n icon={boardTypeIcon(rate.board_type)}\n label={getBoardTypeLabel(rate.board_type)}\n />\n )}\n\n {earliestCancellation ? (\n <StayResultRoomRateItem\n icon=\"refund\"\n label={\n rate.total_amount === earliestCancellation.refund_amount ? (\n `Free cancellation until ${getDateString(\n earliestCancellation.before,\n \"medium\",\n )}`\n ) : (\n <>\n Cancellation available (from{\" \"}\n {moneyStringFormatter(earliestCancellation.currency)(\n +rate.total_amount -\n +earliestCancellation.refund_amount,\n )}{\" \"}\n fee)\n </>\n )\n }\n />\n ) : (\n <StayResultRoomRateItem icon=\"close\" label=\"Non-refundable\" />\n )}\n\n {!hidePaymentMethod &&\n rate.available_payment_methods.map((paymentMethod) => (\n <StayResultRoomRateItem\n key={paymentMethod}\n icon={paymentMethod === \"card\" ? \"credit_card\" : \"wallet\"}\n label={getRateLabel(paymentMethod, rate.payment_type)}\n />\n ))}\n\n {rate.supported_loyalty_programme && (\n <StayResultRoomRateItem\n icon=\"loyalty\"\n label={\n LOYALTY_PROGRAMS_NAME_MAP[rate.supported_loyalty_programme]\n }\n />\n )}\n {!hideSource && (\n <StayResultRoomRateItem\n icon=\"shopfront\"\n label={`Sourced from ${SOURCE_NAME_MAP[rate.source]}`}\n />\n )}\n </VSpace>\n </VSpace>\n <VSpace space={8} className=\"stays-room-rate-card__footer\">\n {quantityOfRoomsAvailable && (\n <p className=\"stays-room-rate-card__text--small\">\n At least {withPlural(quantityOfRoomsAvailable, \"room\", \"rooms\")}{\" \"}\n available\n </p>\n )}\n <VSpace space={4}>\n <p className=\"stays-room-rate-card__text--small\">\n {moneyStringFormatter(rate.total_currency)(+rate.total_amount)}{\" \"}\n for {withPlural(numberOfNights, \"night\", \"nights\")}\n </p>\n\n {rate.due_at_accommodation_amount &&\n +rate.due_at_accommodation_amount > 0 && (\n <p className=\"stays-room-rate-card__text--small\">\n <i>\n +{\" \"}\n {moneyStringFormatter(rate.due_at_accommodation_currency)(\n +rate.due_at_accommodation_amount,\n )}{\" \"}\n at accommodation\n </i>\n </p>\n )}\n </VSpace>\n <HSpace space={8} spaceBetween>\n <p className=\"stays-room-rate-card__text--large\">\n {moneyStringFormatter(rate.total_currency)(\n +rate.total_amount / numberOfNights,\n )}\n <span className=\"stays-room-rate-card__text--small\">/night</span>\n </p>\n <RadioButton checked={selected} value={rate.id} />\n </HSpace>\n </VSpace>\n </button>\n </WithComponentStyles>\n );\n};\n\nconst StayResultRoomRateItem: React.FC<{\n icon: IconName;\n label: string | React.ReactNode;\n}> = ({ icon, label }) => (\n <HSpace space={8}>\n <Icon name={icon} size={16} color=\"--GREY-600\" className=\"u-marginTop2\" />\n <p className=\"stays-room-rate-card__item-label\">{label}</p>\n </HSpace>\n);\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { StaysRate } from \"@duffel/api/types\";\n\nexport const getRateLabel = (\n paymentMethod: StaysRate[\"available_payment_methods\"][number],\n paymentType: StaysRate[\"payment_type\"],\n): string | undefined => {\n if (paymentMethod === \"balance\") {\n return \"Pay now with Duffel Balance\";\n }\n\n if (paymentMethod === \"card\" && paymentType === \"pay_now\") {\n return \"Pay now with card\";\n }\n\n if (paymentMethod === \"card\" && paymentType === \"guarantee\") {\n return \"Card payment at accommodation\";\n }\n\n if (paymentMethod === \"card\" && paymentType === \"deposit\") {\n return \"Pay deposit with card\";\n }\n\n // fallback\n return \"Pay with card\";\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import classNames from \"classnames\";\nimport * as React from \"react\";\nimport { HSpace } from \"./HSpace\";\nimport { Icon } from \"./Icon\";\n\nexport interface RadioButtonProps {\n value: string;\n checked?: boolean;\n className?: string;\n}\n\nexport const RadioButton: React.FC<RadioButtonProps> = ({\n value,\n checked = false,\n className,\n}) => {\n const inputId = `radio-${value}`;\n return (\n <div className={className}>\n <input\n id={inputId}\n type=\"radio\"\n value={value}\n checked={checked}\n className=\"radio__input\"\n />\n <label\n className=\"radio__container\"\n htmlFor={inputId}\n aria-checked={checked}\n data-testid={value}\n >\n <HSpace space={12}>\n <div\n className={classNames(\"radio\", {\n [\"radio--is-checked\"]: checked,\n })}\n >\n {checked && <Icon name=\"check\" size={18} />}\n </div>\n </HSpace>\n </label>\n </div>\n );\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { Icon } from \"@components/shared/Icon\";\nimport { NonIdealState } from \"@components/shared/NonIdealState\";\nimport { WithComponentStyles } from \"@components/shared/WithComponentStyles\";\nimport { OfferRequest } from \"@duffel/api/types\";\nimport { getDateString } from \"@lib/getDateString\";\nimport classNames from \"classnames\";\nimport * as React from \"react\";\nimport { FilterControls } from \"./FilterControls\";\nimport { NGSTable } from \"./NGSTable\";\nimport { NGSOfferRow } from \"./lib/group-offers-for-ngs-view\";\nimport { sortNGSRowsByDuration } from \"./lib/sort-ngs-rows-by-duration\";\nimport {\n SortDirection,\n sortNGSRowsByShelfPrice,\n} from \"./lib/sort-ngs-rows-by-shelf-price\";\nimport { useFilters } from \"./lib/useFilters\";\nimport { SortOption, SortingControl } from \"./SortingControl\";\nimport { NGSShelf } from \"./lib\";\nimport { sortNGSRowsByRecommended } from \"./lib/sort-ngs-rows-by-recommended\";\n\nfunction getSortShelfAndDirection(\n sortOption: SortOption,\n): [NGSShelf, \"asc\" | \"desc\"] {\n const [shelf, direction] = sortOption.split(\"-\");\n return [parseInt(shelf), direction as SortDirection];\n}\n\nfunction getDurationSortDirection(sortOption: SortOption) {\n return sortOption.split(\"-\")[1] as SortDirection;\n}\n\nexport function useSort() {\n const [sortOption, setSortOption] = React.useState<SortOption>(\"recommended\");\n\n function sortingFunction(rows: NGSOfferRow[]) {\n if (sortOption === \"recommended\") {\n return sortNGSRowsByRecommended(rows);\n } else if (sortOption.startsWith(\"duration\")) {\n const direction = getDurationSortDirection(sortOption);\n return sortNGSRowsByDuration(rows, direction);\n } else {\n const [shelf, direction] = getSortShelfAndDirection(sortOption);\n return sortNGSRowsByShelfPrice(rows, shelf, direction);\n }\n }\n\n return {\n sortOption,\n setSortOption,\n sortingFunction,\n };\n}\n\n/*\n\nsetSortDuration(null);\nif (shelf === sortShelf) {\n setSortDirection(sortDirection === \"asc\" ? \"desc\" : \"asc\");\n} else if (selectedColumn === shelf) {\n setSortShelf(shelf);\n}\n\nsetSortShelf(null);\n\n\n*/\n\nexport interface DuffelNGSViewProps {\n offerRequest: OfferRequest;\n onSelect: (offerId: string) => void;\n}\n\nexport const DuffelNGSView: React.FC<DuffelNGSViewProps> = ({\n offerRequest,\n onSelect,\n}) => {\n const [selectedSliceKeys, setSelectedSliceKeys] = React.useState<string[]>(\n [],\n );\n const [selectedOwner, setSelectedOwner] = React.useState<string | undefined>(\n undefined,\n );\n\n const [selectedColumn, setSelectedColumn] = React.useState<NGSShelf | null>(\n null,\n );\n\n const {\n airlinesFilterOptions,\n airlinesFilter,\n timesFilter,\n stopsFilter,\n setAirlinesFilter,\n setTimesFilter,\n setStopsFilter,\n clearFilters,\n filteredOffers,\n } = useFilters(offerRequest, selectedSliceKeys);\n\n const { sortOption, setSortOption, sortingFunction } = useSort();\n\n const numSlices = offerRequest.slices.length;\n const currentSlice =\n selectedSliceKeys.length > 0\n ? offerRequest.slices[selectedSliceKeys.length]\n : offerRequest.slices[0];\n\n if (offerRequest.offers.length === 0) {\n return <NonIdealState>There are no results</NonIdealState>;\n }\n\n return (\n <div className=\"duffel-ngs-view\">\n <WithComponentStyles>\n {currentSlice && (\n <div className=\"h-space h-space--4 hspace--space-between\">\n <div>\n <div className=\"duffel-ngs-view_breadcrumbs\">\n {offerRequest.slices.map((slice, index) => (\n <>\n <button\n key={index}\n className={classNames(\n \"duffel-ngs-view_breadcrumb\",\n index < selectedSliceKeys.length &&\n \"duffel-ngs-view_breadcrumb--clickable\",\n index === selectedSliceKeys.length &&\n \"duffel-ngs-view_breadcrumb--selected\",\n )}\n onClick={() => {\n if (index < selectedSliceKeys.length) {\n const newSliceKeys = selectedSliceKeys.slice(\n 0,\n index - 1,\n );\n setSelectedSliceKeys(newSliceKeys);\n if (newSliceKeys.length === 0) {\n setSelectedOwner(undefined);\n }\n\n clearFilters();\n }\n }}\n >\n {slice.origin.iata_code} - {slice.destination.iata_code}\n </button>\n {index < numSlices - 1 && (\n <Icon name=\"arrow_right\" size={12} color=\"--GREY-500\" />\n )}\n </>\n ))}\n </div>\n <h3 className=\"duffel-ngs-view_heading\">\n {numSlices === 2 &&\n `${selectedSliceKeys.length === 0 ? \"Outbound\" : \"Inbound\"} flight to ${currentSlice.destination.name}`}\n {numSlices !== 2 &&\n `Flight to ${currentSlice.destination.name}`}\n </h3>\n <h4 className=\"duffel-ngs-view_subheading\">\n {getDateString(currentSlice.departure_date, \"long\")}\n </h4>\n </div>\n </div>\n )}\n\n {offerRequest.offers.length > 0 && (\n <>\n <div className=\"h-space h-space--8 hspace--justify-end margin-b-12\">\n <FilterControls\n {...{\n selectedOwner,\n airlines: airlinesFilterOptions,\n airlinesFilter,\n setAirlinesFilter,\n timesFilter,\n setTimesFilter,\n stopsFilter,\n setStopsFilter,\n }}\n />\n <SortingControl\n selected={sortOption}\n onChange={(sortingOption) => {\n setSortOption(sortingOption);\n if (\n !sortingOption.startsWith(\"duration\") &&\n sortingOption !== \"recommended\"\n ) {\n const shelf = parseInt(sortingOption.split(\"-\")[0]);\n setSelectedColumn(shelf);\n }\n }}\n />\n </div>\n <NGSTable\n selectedColumn={selectedColumn}\n setSelectedColumn={setSelectedColumn}\n offers={filteredOffers}\n sliceIndex={selectedSliceKeys.length}\n previousSliceKeys={selectedSliceKeys}\n onSelect={(offerId, sliceKey, offer) => {\n window.scrollTo(0, 0);\n if (selectedSliceKeys.length == numSlices - 1) {\n onSelect(offerId);\n } else {\n setSelectedOwner(offer.owner ? offer.owner.name : undefined);\n setSelectedSliceKeys([...selectedSliceKeys, sliceKey]);\n clearFilters();\n }\n }}\n sortingFunction={sortingFunction}\n />\n </>\n )}\n </WithComponentStyles>\n </div>\n );\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { captureErrorInSentry } from \"@lib/captureErrorInSentry\";\nimport * as React from \"react\";\n\ninterface AirlineLogoProps {\n name: string;\n iataCode: string | null;\n size?: number;\n}\n\nconst hasManualOverride = [\"TA\"];\nconst getFallbackLogoUrl = (iataCode: string | null) =>\n `https://www.gstatic.com/flights/airline_logos/70px/${\n iataCode || \"missing\"\n }.png`;\n\nconst getSrcForIataCode = (iataCode: string | null, airlineName: string) => {\n if (!iataCode) {\n captureErrorInSentry(\n new Error(\n `iataCode is passed as \"null\" value for airline ${airlineName}`,\n ),\n );\n return getFallbackLogoUrl(\"ZZ\");\n }\n\n if (hasManualOverride.includes(iataCode)) {\n return getFallbackLogoUrl(iataCode);\n }\n\n return `https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/${iataCode}.svg`;\n};\n\nexport const AirlineLogo: React.FC<AirlineLogoProps> = ({\n name,\n iataCode,\n size = 32,\n}) => {\n const [src, setSrc] = React.useState(getSrcForIataCode(iataCode, name));\n React.useEffect(() => {\n setSrc(getSrcForIataCode(iataCode, name));\n }, [iataCode]);\n\n return (\n <React.Fragment>\n {/* disabling eslint here because using next/legacy/image made the svg disappear on the airline show page */}\n <img\n alt={name}\n title={name}\n height={size}\n width={size}\n src={src}\n onError={() => setSrc(getFallbackLogoUrl(iataCode))}\n />\n </React.Fragment>\n );\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { Icon } from \"@components/shared/Icon\";\nimport classNames from \"classnames\";\nimport React from \"react\";\n\ninterface FilterControlProps {\n target: React.ReactNode;\n children: (closePopover: () => void) => React.ReactNode;\n disabled?: boolean;\n popoverWidth?: string;\n popoverMaxHeigh?: string;\n targetWidth: string;\n}\n\nexport const FilterControl: React.FC<FilterControlProps> = ({\n target,\n children,\n disabled,\n popoverWidth,\n popoverMaxHeigh,\n targetWidth,\n}) => {\n const [isPopoverOpen, setIsPopoverOpen] = React.useState(false);\n\n const closePopover = () => setIsPopoverOpen(false);\n\n return (\n <div className=\"filter-control\">\n <button\n style={{ minWidth: targetWidth }}\n onClick={() => setIsPopoverOpen(!isPopoverOpen)}\n className=\"filter-control__target\"\n disabled={disabled}\n >\n <span>{target}</span>\n <Icon name=\"arrow_drop_down\" size={24} />\n </button>\n {isPopoverOpen && (\n <>\n {/**\n * Disabling jsx-a11y/click-events-have-key-events because it expects a keyboard listener.\n * Instead the esc key listener to close is added to options in the popover through `children`\n * */}\n {/* eslint-disable-next-line */}\n <div className=\"filter-control__backdrop\" onClick={closePopover} />\n <div\n className=\"filter-control__popover\"\n style={{\n ...(popoverWidth && { width: popoverWidth }),\n ...(popoverMaxHeigh && { maxHeight: popoverMaxHeigh }),\n }}\n >\n {children(closePopover)}\n </div>\n </>\n )}\n </div>\n );\n};\n\ninterface FilterControlOptionProps {\n children: React.ReactNode;\n className?: string;\n isSelected: boolean;\n onClick: React.MouseEventHandler<HTMLButtonElement>;\n onKeyDown: React.KeyboardEventHandler<HTMLButtonElement>;\n onDoubleClick?: React.MouseEventHandler<HTMLButtonElement>;\n}\n\nexport const FilterControlOption: React.FC<FilterControlOptionProps> = ({\n className,\n children,\n isSelected,\n onClick,\n onKeyDown,\n onDoubleClick,\n}) => (\n <button\n onClick={onClick}\n className={classNames(\n \"filter-control__option\",\n isSelected && \"filter-control__option--selected\",\n className,\n )}\n onKeyDown={onKeyDown}\n onDoubleClick={onDoubleClick}\n >\n {children}\n {isSelected && <Icon name=\"check\" size={24} color=\"--GREY-900\" />}\n </button>\n);\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { AirlineLogo } from \"@components/shared/AirlineLogo\";\nimport React from \"react\";\nimport { FilterControl, FilterControlOption } from \"./FilterControl\";\nimport { Filters } from \"./lib/filter-results\";\n\ntype FilterAirline = Filters[\"airlines\"][number];\n\nfunction isOptionSelected(\n airline: FilterAirline,\n selectedAirlines: Filters[\"airlines\"],\n) {\n return selectedAirlines.some(\n (selectedAirline) => selectedAirline.iata_code === airline.iata_code,\n );\n}\n\nfunction getSelectLabel(\n selected: Filters[\"airlines\"],\n options: Filters[\"airlines\"],\n) {\n if (selected.length === options.length) return \"All airlines\";\n if (selected.length === 1) return selected[0].name;\n if (selected.length === 2)\n return `Airlines: ${selected.map(({ iata_code }) => iata_code).join(\", \")}`;\n\n return `${selected.length} airlines`;\n}\n\nexport interface AirlineSelectorProps {\n options: Filters[\"airlines\"];\n selected: Filters[\"airlines\"];\n onChange: (airlines: Filters[\"airlines\"]) => void;\n disabled?: boolean;\n targetLabel?: string;\n}\n\nfunction removeFromSelected(\n option: FilterAirline,\n selectedAirlines: Filters[\"airlines\"],\n) {\n if (selectedAirlines.length === 1) return selectedAirlines;\n return selectedAirlines.filter(\n (selected) => selected.iata_code != option.iata_code,\n );\n}\n\nfunction addToSelected(\n option: FilterAirline,\n selectedAirlines: Filters[\"airlines\"],\n) {\n return [option, ...selectedAirlines];\n}\n\nexport const AirlineSelector: React.FC<AirlineSelectorProps> = ({\n options,\n selected,\n onChange,\n disabled,\n targetLabel,\n}) => {\n return (\n <FilterControl\n targetWidth=\"148px\"\n popoverMaxHeigh=\"235px\"\n disabled={disabled}\n target={targetLabel || getSelectLabel(selected, options)}\n >\n {(onClose) => (\n <>\n <div className=\"h-space h-space--8 margin-b-12\">\n <button\n className=\"filter-control__target hspace--justify-center padding-inline-8 width-100\"\n disabled={selected.length === options.length}\n onClick={() => onChange(options)}\n >\n Select all\n </button>\n <button\n className=\"filter-control__target hspace--justify-center padding-inline-8 width-100\"\n disabled={selected.length === 0}\n onClick={() => onChange([])}\n >\n Unselect all\n </button>\n </div>\n {options.map((option, index) => {\n const isSelected = isOptionSelected(option, selected);\n return (\n <Option\n key={option.iata_code}\n {...option}\n isSelected={isSelected}\n onClick={() => {\n const newState = isSelected\n ? removeFromSelected(option, selected)\n : addToSelected(option, selected);\n\n onChange(newState);\n }}\n onDoubleClick={() => {\n onChange([option]);\n }}\n onKeyDown={(e) => {\n console.log(e.key);\n if (\n e.key === \"Escape\" ||\n (e.key === \"Tab\" && index === options.length - 1)\n ) {\n onClose();\n }\n }}\n />\n );\n })}\n </>\n )}\n </FilterControl>\n );\n};\n\ntype OptionProps = FilterAirline & {\n isSelected: boolean;\n onClick: (option: FilterAirline) => void;\n onKeyDown: React.KeyboardEventHandler<HTMLButtonElement>;\n onDoubleClick: React.MouseEventHandler<HTMLButtonElement>;\n};\n\nconst Option: React.FC<OptionProps> = ({\n name,\n iata_code,\n isSelected,\n onClick,\n onKeyDown,\n onDoubleClick,\n}) => (\n <FilterControlOption\n isSelected={isSelected}\n className=\"airline-selector__option\"\n onClick={() => onClick({ name, iata_code })}\n onKeyDown={onKeyDown}\n onDoubleClick={onDoubleClick}\n >\n <AirlineLogo name={name} iataCode={iata_code} size={16} />\n <span>{name}</span>\n </FilterControlOption>\n);\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import React from \"react\";\nimport { FilterControl, FilterControlOption } from \"./FilterControl\";\nimport { Filters } from \"./lib/filter-results\";\n\nconst OPTIONS: Array<Filters[\"stops\"]> = [\n \"direct-only\",\n \"1-stop-at-most\",\n \"2-stops-at-most\",\n \"any\",\n];\n\nfunction getLabel(stopsOption: Filters[\"stops\"]) {\n if (stopsOption === \"direct-only\") {\n return \"Direct only\";\n }\n if (stopsOption === \"1-stop-at-most\") {\n return \"1 stop at most\";\n }\n if (stopsOption === \"2-stops-at-most\") {\n return \"2 stops at most\";\n }\n if (stopsOption === \"any\") {\n return \"Any number of stops\";\n }\n}\n\ninterface StopsSelectorProps {\n selected: Filters[\"stops\"];\n onChange: (stopFilter: Filters[\"stops\"]) => void;\n}\n\nexport const StopsSelector: React.FC<StopsSelectorProps> = ({\n selected,\n onChange,\n}) => {\n return (\n <FilterControl target={getLabel(selected)} targetWidth=\"178px\">\n {(onClose) =>\n OPTIONS.map((option, index) => (\n <FilterControlOption\n isSelected={option === selected}\n key={option}\n onClick={() => onChange(option)}\n onKeyDown={(e) => {\n if (\n e.key === \"Escape\" ||\n (e.key === \"Tab\" && index === OPTIONS.length - 1)\n ) {\n onClose();\n }\n }}\n >\n <span>{getLabel(option)}</span>\n </FilterControlOption>\n ))\n }\n </FilterControl>\n );\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };", "import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };", "import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nexport { toPropertyKey as default };", "import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nexport { _defineProperty as default };", "import defineProperty from \"./defineProperty.js\";\nfunction ownKeys(e, r) {\n var t = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var o = Object.getOwnPropertySymbols(e);\n r && (o = o.filter(function (r) {\n return Object.getOwnPropertyDescriptor(e, r).enumerable;\n })), t.push.apply(t, o);\n }\n return t;\n}\nfunction _objectSpread2(e) {\n for (var r = 1; r < arguments.length; r++) {\n var t = null != arguments[r] ? arguments[r] : {};\n r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {\n defineProperty(e, r, t[r]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {\n Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n });\n }\n return e;\n}\nexport { _objectSpread2 as default };", "function _arrayLikeToArray(r, a) {\n (null == a || a > r.length) && (a = r.length);\n for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];\n return n;\n}\nexport { _arrayLikeToArray as default };", "import arrayLikeToArray from \"./arrayLikeToArray.js\";\nfunction _arrayWithoutHoles(r) {\n if (Array.isArray(r)) return arrayLikeToArray(r);\n}\nexport { _arrayWithoutHoles as default };", "function _iterableToArray(r) {\n if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r);\n}\nexport { _iterableToArray as default };", "import arrayLikeToArray from \"./arrayLikeToArray.js\";\nfunction _unsupportedIterableToArray(r, a) {\n if (r) {\n if (\"string\" == typeof r) return arrayLikeToArray(r, a);\n var t = {}.toString.call(r).slice(8, -1);\n return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? arrayLikeToArray(r, a) : void 0;\n }\n}\nexport { _unsupportedIterableToArray as default };", "function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nexport { _nonIterableSpread as default };", "import arrayWithoutHoles from \"./arrayWithoutHoles.js\";\nimport iterableToArray from \"./iterableToArray.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableSpread from \"./nonIterableSpread.js\";\nfunction _toConsumableArray(r) {\n return arrayWithoutHoles(r) || iterableToArray(r) || unsupportedIterableToArray(r) || nonIterableSpread();\n}\nexport { _toConsumableArray as default };", "function _arrayWithHoles(r) {\n if (Array.isArray(r)) return r;\n}\nexport { _arrayWithHoles as default };", "function _iterableToArrayLimit(r, l) {\n var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n if (null != t) {\n var e,\n n,\n i,\n u,\n a = [],\n f = !0,\n o = !1;\n try {\n if (i = (t = t.call(r)).next, 0 === l) {\n if (Object(t) !== t) return;\n f = !1;\n } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n } catch (r) {\n o = !0, n = r;\n } finally {\n try {\n if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return;\n } finally {\n if (o) throw n;\n }\n }\n return a;\n }\n}\nexport { _iterableToArrayLimit as default };", "function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nexport { _nonIterableRest as default };", "import arrayWithHoles from \"./arrayWithHoles.js\";\nimport iterableToArrayLimit from \"./iterableToArrayLimit.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableRest from \"./nonIterableRest.js\";\nfunction _slicedToArray(r, e) {\n return arrayWithHoles(r) || iterableToArrayLimit(r, e) || unsupportedIterableToArray(r, e) || nonIterableRest();\n}\nexport { _slicedToArray as default };", "import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport cls from 'classnames';\nimport useMergedState from \"rc-util/es/hooks/useMergedState\";\nimport isEqual from \"rc-util/es/isEqual\";\nimport warning from \"rc-util/es/warning\";\nimport * as React from 'react';\nimport Handles from \"./Handles\";\nimport Marks from \"./Marks\";\nimport Steps from \"./Steps\";\nimport Tracks from \"./Tracks\";\nimport SliderContext from \"./context\";\nimport useDrag from \"./hooks/useDrag\";\nimport useOffset from \"./hooks/useOffset\";\n\n/**\n * New:\n * - click mark to update range value\n * - handleRender\n * - Fix handle with count not correct\n * - Fix pushable not work in some case\n * - No more FindDOMNode\n * - Move all position related style into inline style\n * - Key: up is plus, down is minus\n * - fix Key with step = null not align with marks\n * - Change range should not trigger onChange\n * - keyboard support pushable\n */\n\nvar Slider = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var _props$prefixCls = props.prefixCls,\n prefixCls = _props$prefixCls === void 0 ? 'rc-slider' : _props$prefixCls,\n className = props.className,\n style = props.style,\n classNames = props.classNames,\n styles = props.styles,\n _props$disabled = props.disabled,\n disabled = _props$disabled === void 0 ? false : _props$disabled,\n _props$keyboard = props.keyboard,\n keyboard = _props$keyboard === void 0 ? true : _props$keyboard,\n autoFocus = props.autoFocus,\n onFocus = props.onFocus,\n onBlur = props.onBlur,\n _props$min = props.min,\n min = _props$min === void 0 ? 0 : _props$min,\n _props$max = props.max,\n max = _props$max === void 0 ? 100 : _props$max,\n _props$step = props.step,\n step = _props$step === void 0 ? 1 : _props$step,\n value = props.value,\n defaultValue = props.defaultValue,\n range = props.range,\n count = props.count,\n onChange = props.onChange,\n onBeforeChange = props.onBeforeChange,\n onAfterChange = props.onAfterChange,\n onChangeComplete = props.onChangeComplete,\n _props$allowCross = props.allowCross,\n allowCross = _props$allowCross === void 0 ? true : _props$allowCross,\n _props$pushable = props.pushable,\n pushable = _props$pushable === void 0 ? false : _props$pushable,\n draggableTrack = props.draggableTrack,\n reverse = props.reverse,\n vertical = props.vertical,\n _props$included = props.included,\n included = _props$included === void 0 ? true : _props$included,\n startPoint = props.startPoint,\n trackStyle = props.trackStyle,\n handleStyle = props.handleStyle,\n railStyle = props.railStyle,\n dotStyle = props.dotStyle,\n activeDotStyle = props.activeDotStyle,\n marks = props.marks,\n dots = props.dots,\n handleRender = props.handleRender,\n activeHandleRender = props.activeHandleRender,\n _props$tabIndex = props.tabIndex,\n tabIndex = _props$tabIndex === void 0 ? 0 : _props$tabIndex,\n ariaLabelForHandle = props.ariaLabelForHandle,\n ariaLabelledByForHandle = props.ariaLabelledByForHandle,\n ariaValueTextFormatterForHandle = props.ariaValueTextFormatterForHandle;\n var handlesRef = React.useRef(null);\n var containerRef = React.useRef(null);\n var direction = React.useMemo(function () {\n if (vertical) {\n return reverse ? 'ttb' : 'btt';\n }\n return reverse ? 'rtl' : 'ltr';\n }, [reverse, vertical]);\n\n // ============================ Range =============================\n var mergedMin = React.useMemo(function () {\n return isFinite(min) ? min : 0;\n }, [min]);\n var mergedMax = React.useMemo(function () {\n return isFinite(max) ? max : 100;\n }, [max]);\n\n // ============================= Step =============================\n var mergedStep = React.useMemo(function () {\n return step !== null && step <= 0 ? 1 : step;\n }, [step]);\n\n // ============================= Push =============================\n var mergedPush = React.useMemo(function () {\n if (typeof pushable === 'boolean') {\n return pushable ? mergedStep : false;\n }\n return pushable >= 0 ? pushable : false;\n }, [pushable, mergedStep]);\n\n // ============================ Marks =============================\n var markList = React.useMemo(function () {\n return Object.keys(marks || {}).map(function (key) {\n var mark = marks[key];\n var markObj = {\n value: Number(key)\n };\n if (mark && _typeof(mark) === 'object' && ! /*#__PURE__*/React.isValidElement(mark) && ('label' in mark || 'style' in mark)) {\n markObj.style = mark.style;\n markObj.label = mark.label;\n } else {\n markObj.label = mark;\n }\n return markObj;\n }).filter(function (_ref) {\n var label = _ref.label;\n return label || typeof label === 'number';\n }).sort(function (a, b) {\n return a.value - b.value;\n });\n }, [marks]);\n\n // ============================ Format ============================\n var _useOffset = useOffset(mergedMin, mergedMax, mergedStep, markList, allowCross, mergedPush),\n _useOffset2 = _slicedToArray(_useOffset, 2),\n formatValue = _useOffset2[0],\n offsetValues = _useOffset2[1];\n\n // ============================ Values ============================\n var _useMergedState = useMergedState(defaultValue, {\n value: value\n }),\n _useMergedState2 = _slicedToArray(_useMergedState, 2),\n mergedValue = _useMergedState2[0],\n setValue = _useMergedState2[1];\n var rawValues = React.useMemo(function () {\n var valueList = mergedValue === null || mergedValue === undefined ? [] : Array.isArray(mergedValue) ? mergedValue : [mergedValue];\n var _valueList = _slicedToArray(valueList, 1),\n _valueList$ = _valueList[0],\n val0 = _valueList$ === void 0 ? mergedMin : _valueList$;\n var returnValues = mergedValue === null ? [] : [val0];\n\n // Format as range\n if (range) {\n returnValues = _toConsumableArray(valueList);\n\n // When count provided or value is `undefined`, we fill values\n if (count || mergedValue === undefined) {\n var pointCount = count >= 0 ? count + 1 : 2;\n returnValues = returnValues.slice(0, pointCount);\n\n // Fill with count\n while (returnValues.length < pointCount) {\n var _returnValues;\n returnValues.push((_returnValues = returnValues[returnValues.length - 1]) !== null && _returnValues !== void 0 ? _returnValues : mergedMin);\n }\n }\n returnValues.sort(function (a, b) {\n return a - b;\n });\n }\n\n // Align in range\n returnValues.forEach(function (val, index) {\n returnValues[index] = formatValue(val);\n });\n return returnValues;\n }, [mergedValue, range, mergedMin, count, formatValue]);\n\n // =========================== onChange ===========================\n var rawValuesRef = React.useRef(rawValues);\n rawValuesRef.current = rawValues;\n var getTriggerValue = function getTriggerValue(triggerValues) {\n return range ? triggerValues : triggerValues[0];\n };\n var triggerChange = function triggerChange(nextValues) {\n // Order first\n var cloneNextValues = _toConsumableArray(nextValues).sort(function (a, b) {\n return a - b;\n });\n\n // Trigger event if needed\n if (onChange && !isEqual(cloneNextValues, rawValuesRef.current, true)) {\n onChange(getTriggerValue(cloneNextValues));\n }\n\n // We set this later since it will re-render component immediately\n setValue(cloneNextValues);\n };\n var finishChange = function finishChange() {\n var finishValue = getTriggerValue(rawValuesRef.current);\n onAfterChange === null || onAfterChange === void 0 || onAfterChange(finishValue);\n warning(!onAfterChange, '[rc-slider] `onAfterChange` is deprecated. Please use `onChangeComplete` instead.');\n onChangeComplete === null || onChangeComplete === void 0 || onChangeComplete(finishValue);\n };\n var _useDrag = useDrag(containerRef, direction, rawValues, mergedMin, mergedMax, formatValue, triggerChange, finishChange, offsetValues),\n _useDrag2 = _slicedToArray(_useDrag, 4),\n draggingIndex = _useDrag2[0],\n draggingValue = _useDrag2[1],\n cacheValues = _useDrag2[2],\n onStartDrag = _useDrag2[3];\n var changeToCloseValue = function changeToCloseValue(newValue, e) {\n if (!disabled) {\n var valueIndex = 0;\n var valueDist = mergedMax - mergedMin;\n rawValues.forEach(function (val, index) {\n var dist = Math.abs(newValue - val);\n if (dist <= valueDist) {\n valueDist = dist;\n valueIndex = index;\n }\n });\n\n // Create new values\n var cloneNextValues = _toConsumableArray(rawValues);\n cloneNextValues[valueIndex] = newValue;\n\n // Fill value to match default 2\n if (range && !rawValues.length && count === undefined) {\n cloneNextValues.push(newValue);\n }\n onBeforeChange === null || onBeforeChange === void 0 || onBeforeChange(getTriggerValue(cloneNextValues));\n triggerChange(cloneNextValues);\n if (e) {\n var _document$activeEleme, _document$activeEleme2;\n (_document$activeEleme = document.activeElement) === null || _document$activeEleme === void 0 || (_document$activeEleme2 = _document$activeEleme.blur) === null || _document$activeEleme2 === void 0 || _document$activeEleme2.call(_document$activeEleme);\n handlesRef.current.focus(valueIndex);\n onStartDrag(e, valueIndex, cloneNextValues);\n }\n }\n };\n\n // ============================ Click =============================\n var onSliderMouseDown = function onSliderMouseDown(e) {\n e.preventDefault();\n var _containerRef$current = containerRef.current.getBoundingClientRect(),\n width = _containerRef$current.width,\n height = _containerRef$current.height,\n left = _containerRef$current.left,\n top = _containerRef$current.top,\n bottom = _containerRef$current.bottom,\n right = _containerRef$current.right;\n var clientX = e.clientX,\n clientY = e.clientY;\n var percent;\n switch (direction) {\n case 'btt':\n percent = (bottom - clientY) / height;\n break;\n case 'ttb':\n percent = (clientY - top) / height;\n break;\n case 'rtl':\n percent = (right - clientX) / width;\n break;\n default:\n percent = (clientX - left) / width;\n }\n var nextValue = mergedMin + percent * (mergedMax - mergedMin);\n changeToCloseValue(formatValue(nextValue), e);\n };\n\n // =========================== Keyboard ===========================\n var _React$useState = React.useState(null),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n keyboardValue = _React$useState2[0],\n setKeyboardValue = _React$useState2[1];\n var onHandleOffsetChange = function onHandleOffsetChange(offset, valueIndex) {\n if (!disabled) {\n var next = offsetValues(rawValues, offset, valueIndex);\n onBeforeChange === null || onBeforeChange === void 0 || onBeforeChange(getTriggerValue(rawValues));\n triggerChange(next.values);\n setKeyboardValue(next.value);\n }\n };\n React.useEffect(function () {\n if (keyboardValue !== null) {\n var valueIndex = rawValues.indexOf(keyboardValue);\n if (valueIndex >= 0) {\n handlesRef.current.focus(valueIndex);\n }\n }\n setKeyboardValue(null);\n }, [keyboardValue]);\n\n // ============================= Drag =============================\n var mergedDraggableTrack = React.useMemo(function () {\n if (draggableTrack && mergedStep === null) {\n if (process.env.NODE_ENV !== 'production') {\n warning(false, '`draggableTrack` is not supported when `step` is `null`.');\n }\n return false;\n }\n return draggableTrack;\n }, [draggableTrack, mergedStep]);\n var onStartMove = function onStartMove(e, valueIndex) {\n onStartDrag(e, valueIndex);\n onBeforeChange === null || onBeforeChange === void 0 || onBeforeChange(getTriggerValue(rawValuesRef.current));\n };\n\n // Auto focus for updated handle\n var dragging = draggingIndex !== -1;\n React.useEffect(function () {\n if (!dragging) {\n var valueIndex = rawValues.lastIndexOf(draggingValue);\n handlesRef.current.focus(valueIndex);\n }\n }, [dragging]);\n\n // =========================== Included ===========================\n var sortedCacheValues = React.useMemo(function () {\n return _toConsumableArray(cacheValues).sort(function (a, b) {\n return a - b;\n });\n }, [cacheValues]);\n\n // Provide a range values with included [min, max]\n // Used for Track, Mark & Dot\n var _React$useMemo = React.useMemo(function () {\n if (!range) {\n return [mergedMin, sortedCacheValues[0]];\n }\n return [sortedCacheValues[0], sortedCacheValues[sortedCacheValues.length - 1]];\n }, [sortedCacheValues, range, mergedMin]),\n _React$useMemo2 = _slicedToArray(_React$useMemo, 2),\n includedStart = _React$useMemo2[0],\n includedEnd = _React$useMemo2[1];\n\n // ============================= Refs =============================\n React.useImperativeHandle(ref, function () {\n return {\n focus: function focus() {\n handlesRef.current.focus(0);\n },\n blur: function blur() {\n var _containerRef$current2;\n var _document = document,\n activeElement = _document.activeElement;\n if ((_containerRef$current2 = containerRef.current) !== null && _containerRef$current2 !== void 0 && _containerRef$current2.contains(activeElement)) {\n activeElement === null || activeElement === void 0 || activeElement.blur();\n }\n }\n };\n });\n\n // ========================== Auto Focus ==========================\n React.useEffect(function () {\n if (autoFocus) {\n handlesRef.current.focus(0);\n }\n }, []);\n\n // =========================== Context ============================\n var context = React.useMemo(function () {\n return {\n min: mergedMin,\n max: mergedMax,\n direction: direction,\n disabled: disabled,\n keyboard: keyboard,\n step: mergedStep,\n included: included,\n includedStart: includedStart,\n includedEnd: includedEnd,\n range: range,\n tabIndex: tabIndex,\n ariaLabelForHandle: ariaLabelForHandle,\n ariaLabelledByForHandle: ariaLabelledByForHandle,\n ariaValueTextFormatterForHandle: ariaValueTextFormatterForHandle,\n styles: styles || {},\n classNames: classNames || {}\n };\n }, [mergedMin, mergedMax, direction, disabled, keyboard, mergedStep, included, includedStart, includedEnd, range, tabIndex, ariaLabelForHandle, ariaLabelledByForHandle, ariaValueTextFormatterForHandle, styles, classNames]);\n\n // ============================ Render ============================\n return /*#__PURE__*/React.createElement(SliderContext.Provider, {\n value: context\n }, /*#__PURE__*/React.createElement(\"div\", {\n ref: containerRef,\n className: cls(prefixCls, className, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-disabled\"), disabled), \"\".concat(prefixCls, \"-vertical\"), vertical), \"\".concat(prefixCls, \"-horizontal\"), !vertical), \"\".concat(prefixCls, \"-with-marks\"), markList.length)),\n style: style,\n onMouseDown: onSliderMouseDown\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: cls(\"\".concat(prefixCls, \"-rail\"), classNames === null || classNames === void 0 ? void 0 : classNames.rail),\n style: _objectSpread(_objectSpread({}, railStyle), styles === null || styles === void 0 ? void 0 : styles.rail)\n }), /*#__PURE__*/React.createElement(Tracks, {\n prefixCls: prefixCls,\n style: trackStyle,\n values: sortedCacheValues,\n startPoint: startPoint,\n onStartMove: mergedDraggableTrack ? onStartMove : undefined\n }), /*#__PURE__*/React.createElement(Steps, {\n prefixCls: prefixCls,\n marks: markList,\n dots: dots,\n style: dotStyle,\n activeStyle: activeDotStyle\n }), /*#__PURE__*/React.createElement(Handles, {\n ref: handlesRef,\n prefixCls: prefixCls,\n style: handleStyle,\n values: cacheValues,\n draggingIndex: draggingIndex,\n onStartMove: onStartMove,\n onOffsetChange: onHandleOffsetChange,\n onFocus: onFocus,\n onBlur: onBlur,\n handleRender: handleRender,\n activeHandleRender: activeHandleRender,\n onChangeComplete: finishChange\n }), /*#__PURE__*/React.createElement(Marks, {\n prefixCls: prefixCls,\n marks: markList,\n onClick: changeToCloseValue\n })));\n});\nif (process.env.NODE_ENV !== 'production') {\n Slider.displayName = 'Slider';\n}\nexport default Slider;", "import * as React from 'react';\nexport default function useEvent(callback) {\n var fnRef = React.useRef();\n fnRef.current = callback;\n var memoFn = React.useCallback(function () {\n var _fnRef$current;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return (_fnRef$current = fnRef.current) === null || _fnRef$current === void 0 ? void 0 : _fnRef$current.call.apply(_fnRef$current, [fnRef].concat(args));\n }, []);\n return memoFn;\n}", "import * as React from 'react';\nimport canUseDom from \"../Dom/canUseDom\";\n\n/**\n * Wrap `React.useLayoutEffect` which will not throw warning message in test env\n */\nvar useInternalLayoutEffect = process.env.NODE_ENV !== 'test' && canUseDom() ? React.useLayoutEffect : React.useEffect;\nvar useLayoutEffect = function useLayoutEffect(callback, deps) {\n var firstMountRef = React.useRef(true);\n useInternalLayoutEffect(function () {\n return callback(firstMountRef.current);\n }, deps);\n\n // We tell react that first mount has passed\n useInternalLayoutEffect(function () {\n firstMountRef.current = false;\n return function () {\n firstMountRef.current = true;\n };\n }, []);\n};\nexport var useLayoutUpdateEffect = function useLayoutUpdateEffect(callback, deps) {\n useLayoutEffect(function (firstMount) {\n if (!firstMount) {\n return callback();\n }\n }, deps);\n};\nexport default useLayoutEffect;", "export default function canUseDom() {\n return !!(typeof window !== 'undefined' && window.document && window.document.createElement);\n}", "import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\n/**\n * Same as React.useState but `setState` accept `ignoreDestroy` param to not to setState after destroyed.\n * We do not make this auto is to avoid real memory leak.\n * Developer should confirm it's safe to ignore themselves.\n */\nexport default function useSafeState(defaultValue) {\n var destroyRef = React.useRef(false);\n var _React$useState = React.useState(defaultValue),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n value = _React$useState2[0],\n setValue = _React$useState2[1];\n React.useEffect(function () {\n destroyRef.current = false;\n return function () {\n destroyRef.current = true;\n };\n }, []);\n function safeSetState(updater, ignoreDestroy) {\n if (ignoreDestroy && destroyRef.current) {\n return;\n }\n setValue(updater);\n }\n return [value, safeSetState];\n}", "import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport useEvent from \"./useEvent\";\nimport { useLayoutUpdateEffect } from \"./useLayoutEffect\";\nimport useState from \"./useState\";\n/** We only think `undefined` is empty */\nfunction hasValue(value) {\n return value !== undefined;\n}\n\n/**\n * Similar to `useState` but will use props value if provided.\n * Note that internal use rc-util `useState` hook.\n */\nexport default function useMergedState(defaultStateValue, option) {\n var _ref = option || {},\n defaultValue = _ref.defaultValue,\n value = _ref.value,\n onChange = _ref.onChange,\n postState = _ref.postState;\n\n // ======================= Init =======================\n var _useState = useState(function () {\n if (hasValue(value)) {\n return value;\n } else if (hasValue(defaultValue)) {\n return typeof defaultValue === 'function' ? defaultValue() : defaultValue;\n } else {\n return typeof defaultStateValue === 'function' ? defaultStateValue() : defaultStateValue;\n }\n }),\n _useState2 = _slicedToArray(_useState, 2),\n innerValue = _useState2[0],\n setInnerValue = _useState2[1];\n var mergedValue = value !== undefined ? value : innerValue;\n var postMergedValue = postState ? postState(mergedValue) : mergedValue;\n\n // ====================== Change ======================\n var onChangeFn = useEvent(onChange);\n var _useState3 = useState([mergedValue]),\n _useState4 = _slicedToArray(_useState3, 2),\n prevValue = _useState4[0],\n setPrevValue = _useState4[1];\n useLayoutUpdateEffect(function () {\n var prev = prevValue[0];\n if (innerValue !== prev) {\n onChangeFn(innerValue, prev);\n }\n }, [prevValue]);\n\n // Sync value back to `undefined` when it from control to un-control\n useLayoutUpdateEffect(function () {\n if (!hasValue(value)) {\n setInnerValue(value);\n }\n }, [value]);\n\n // ====================== Update ======================\n var triggerChange = useEvent(function (updater, ignoreDestroy) {\n setInnerValue(updater, ignoreDestroy);\n setPrevValue([mergedValue], ignoreDestroy);\n });\n return [postMergedValue, triggerChange];\n}", "/* eslint-disable no-console */\nvar warned = {};\nvar preWarningFns = [];\n\n/**\n * Pre warning enable you to parse content before console.error.\n * Modify to null will prevent warning.\n */\nexport var preMessage = function preMessage(fn) {\n preWarningFns.push(fn);\n};\n\n/**\n * Warning if condition not match.\n * @param valid Condition\n * @param message Warning message\n * @example\n * ```js\n * warning(false, 'some error'); // print some error\n * warning(true, 'some error'); // print nothing\n * warning(1 === 2, 'some error'); // print some error\n * ```\n */\nexport function warning(valid, message) {\n if (process.env.NODE_ENV !== 'production' && !valid && console !== undefined) {\n var finalMessage = preWarningFns.reduce(function (msg, preMessageFn) {\n return preMessageFn(msg !== null && msg !== void 0 ? msg : '', 'warning');\n }, message);\n if (finalMessage) {\n console.error(\"Warning: \".concat(finalMessage));\n }\n }\n}\n\n/** @see Similar to {@link warning} */\nexport function note(valid, message) {\n if (process.env.NODE_ENV !== 'production' && !valid && console !== undefined) {\n var finalMessage = preWarningFns.reduce(function (msg, preMessageFn) {\n return preMessageFn(msg !== null && msg !== void 0 ? msg : '', 'note');\n }, message);\n if (finalMessage) {\n console.warn(\"Note: \".concat(finalMessage));\n }\n }\n}\nexport function resetWarned() {\n warned = {};\n}\nexport function call(method, valid, message) {\n if (!valid && !warned[message]) {\n method(false, message);\n warned[message] = true;\n }\n}\n\n/** @see Same as {@link warning}, but only warn once for the same message */\nexport function warningOnce(valid, message) {\n call(warning, valid, message);\n}\n\n/** @see Same as {@link warning}, but only warn once for the same message */\nexport function noteOnce(valid, message) {\n call(note, valid, message);\n}\nwarningOnce.preMessage = preMessage;\nwarningOnce.resetWarned = resetWarned;\nwarningOnce.noteOnce = noteOnce;\nexport default warningOnce;", "import _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport warning from \"./warning\";\n\n/**\n * Deeply compares two object literals.\n * @param obj1 object 1\n * @param obj2 object 2\n * @param shallow shallow compare\n * @returns\n */\nfunction isEqual(obj1, obj2) {\n var shallow = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n // https://github.com/mapbox/mapbox-gl-js/pull/5979/files#diff-fde7145050c47cc3a306856efd5f9c3016e86e859de9afbd02c879be5067e58f\n var refSet = new Set();\n function deepEqual(a, b) {\n var level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n var circular = refSet.has(a);\n warning(!circular, 'Warning: There may be circular references');\n if (circular) {\n return false;\n }\n if (a === b) {\n return true;\n }\n if (shallow && level > 1) {\n return false;\n }\n refSet.add(a);\n var newLevel = level + 1;\n if (Array.isArray(a)) {\n if (!Array.isArray(b) || a.length !== b.length) {\n return false;\n }\n for (var i = 0; i < a.length; i++) {\n if (!deepEqual(a[i], b[i], newLevel)) {\n return false;\n }\n }\n return true;\n }\n if (a && b && _typeof(a) === 'object' && _typeof(b) === 'object') {\n var keys = Object.keys(a);\n if (keys.length !== Object.keys(b).length) {\n return false;\n }\n return keys.every(function (key) {\n return deepEqual(a[key], b[key], newLevel);\n });\n }\n // other\n return false;\n }\n return deepEqual(obj1, obj2);\n}\nexport default isEqual;", "function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };", "function _objectWithoutPropertiesLoose(r, e) {\n if (null == r) return {};\n var t = {};\n for (var n in r) if ({}.hasOwnProperty.call(r, n)) {\n if (-1 !== e.indexOf(n)) continue;\n t[n] = r[n];\n }\n return t;\n}\nexport { _objectWithoutPropertiesLoose as default };", "import objectWithoutPropertiesLoose from \"./objectWithoutPropertiesLoose.js\";\nfunction _objectWithoutProperties(e, t) {\n if (null == e) return {};\n var o,\n r,\n i = objectWithoutPropertiesLoose(e, t);\n if (Object.getOwnPropertySymbols) {\n var n = Object.getOwnPropertySymbols(e);\n for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);\n }\n return i;\n}\nexport { _objectWithoutProperties as default };", "import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"prefixCls\", \"style\", \"onStartMove\", \"onOffsetChange\", \"values\", \"handleRender\", \"activeHandleRender\", \"draggingIndex\", \"onFocus\"];\nimport * as React from 'react';\nimport { getIndex } from \"../util\";\nimport Handle from \"./Handle\";\nvar Handles = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var prefixCls = props.prefixCls,\n style = props.style,\n onStartMove = props.onStartMove,\n onOffsetChange = props.onOffsetChange,\n values = props.values,\n handleRender = props.handleRender,\n activeHandleRender = props.activeHandleRender,\n draggingIndex = props.draggingIndex,\n onFocus = props.onFocus,\n restProps = _objectWithoutProperties(props, _excluded);\n var handlesRef = React.useRef({});\n React.useImperativeHandle(ref, function () {\n return {\n focus: function focus(index) {\n var _handlesRef$current$i;\n (_handlesRef$current$i = handlesRef.current[index]) === null || _handlesRef$current$i === void 0 || _handlesRef$current$i.focus();\n }\n };\n });\n\n // =========================== Active ===========================\n var _React$useState = React.useState(-1),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n activeIndex = _React$useState2[0],\n setActiveIndex = _React$useState2[1];\n var onHandleFocus = function onHandleFocus(e, index) {\n setActiveIndex(index);\n onFocus === null || onFocus === void 0 || onFocus(e);\n };\n var onHandleMouseEnter = function onHandleMouseEnter(e, index) {\n setActiveIndex(index);\n };\n\n // =========================== Render ===========================\n // Handle Props\n var handleProps = _objectSpread({\n prefixCls: prefixCls,\n onStartMove: onStartMove,\n onOffsetChange: onOffsetChange,\n render: handleRender,\n onFocus: onHandleFocus,\n onMouseEnter: onHandleMouseEnter\n }, restProps);\n return /*#__PURE__*/React.createElement(React.Fragment, null, values.map(function (value, index) {\n return /*#__PURE__*/React.createElement(Handle, _extends({\n ref: function ref(node) {\n if (!node) {\n delete handlesRef.current[index];\n } else {\n handlesRef.current[index] = node;\n }\n },\n dragging: draggingIndex === index,\n style: getIndex(style, index),\n key: index,\n value: value,\n valueIndex: index\n }, handleProps));\n }), activeHandleRender && /*#__PURE__*/React.createElement(Handle, _extends({\n key: \"a11y\"\n }, handleProps, {\n value: values[activeIndex],\n valueIndex: null,\n dragging: draggingIndex !== -1,\n render: activeHandleRender,\n style: {\n pointerEvents: 'none'\n },\n tabIndex: null,\n \"aria-hidden\": true\n })));\n});\nif (process.env.NODE_ENV !== 'production') {\n Handles.displayName = 'Handles';\n}\nexport default Handles;", "export function getOffset(value, min, max) {\n return (value - min) / (max - min);\n}\nexport function getDirectionStyle(direction, value, min, max) {\n var offset = getOffset(value, min, max);\n var positionStyle = {};\n switch (direction) {\n case 'rtl':\n positionStyle.right = \"\".concat(offset * 100, \"%\");\n positionStyle.transform = 'translateX(50%)';\n break;\n case 'btt':\n positionStyle.bottom = \"\".concat(offset * 100, \"%\");\n positionStyle.transform = 'translateY(50%)';\n break;\n case 'ttb':\n positionStyle.top = \"\".concat(offset * 100, \"%\");\n positionStyle.transform = 'translateY(-50%)';\n break;\n default:\n positionStyle.left = \"\".concat(offset * 100, \"%\");\n positionStyle.transform = 'translateX(-50%)';\n break;\n }\n return positionStyle;\n}\n\n/** Return index value if is list or return value directly */\nexport function getIndex(value, index) {\n return Array.isArray(value) ? value[index] : value;\n}", "import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"prefixCls\", \"value\", \"valueIndex\", \"onStartMove\", \"style\", \"render\", \"dragging\", \"onOffsetChange\", \"onChangeComplete\", \"onFocus\", \"onMouseEnter\"];\nimport cls from 'classnames';\nimport KeyCode from \"rc-util/es/KeyCode\";\nimport * as React from 'react';\nimport SliderContext from \"../context\";\nimport { getDirectionStyle, getIndex } from \"../util\";\nvar Handle = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var prefixCls = props.prefixCls,\n value = props.value,\n valueIndex = props.valueIndex,\n onStartMove = props.onStartMove,\n style = props.style,\n render = props.render,\n dragging = props.dragging,\n onOffsetChange = props.onOffsetChange,\n onChangeComplete = props.onChangeComplete,\n onFocus = props.onFocus,\n onMouseEnter = props.onMouseEnter,\n restProps = _objectWithoutProperties(props, _excluded);\n var _React$useContext = React.useContext(SliderContext),\n min = _React$useContext.min,\n max = _React$useContext.max,\n direction = _React$useContext.direction,\n disabled = _React$useContext.disabled,\n keyboard = _React$useContext.keyboard,\n range = _React$useContext.range,\n tabIndex = _React$useContext.tabIndex,\n ariaLabelForHandle = _React$useContext.ariaLabelForHandle,\n ariaLabelledByForHandle = _React$useContext.ariaLabelledByForHandle,\n ariaValueTextFormatterForHandle = _React$useContext.ariaValueTextFormatterForHandle,\n styles = _React$useContext.styles,\n classNames = _React$useContext.classNames;\n var handlePrefixCls = \"\".concat(prefixCls, \"-handle\");\n\n // ============================ Events ============================\n var onInternalStartMove = function onInternalStartMove(e) {\n if (!disabled) {\n onStartMove(e, valueIndex);\n }\n };\n var onInternalFocus = function onInternalFocus(e) {\n onFocus === null || onFocus === void 0 || onFocus(e, valueIndex);\n };\n var onInternalMouseEnter = function onInternalMouseEnter(e) {\n onMouseEnter(e, valueIndex);\n };\n\n // =========================== Keyboard ===========================\n var onKeyDown = function onKeyDown(e) {\n if (!disabled && keyboard) {\n var offset = null;\n\n // Change the value\n switch (e.which || e.keyCode) {\n case KeyCode.LEFT:\n offset = direction === 'ltr' || direction === 'btt' ? -1 : 1;\n break;\n case KeyCode.RIGHT:\n offset = direction === 'ltr' || direction === 'btt' ? 1 : -1;\n break;\n\n // Up is plus\n case KeyCode.UP:\n offset = direction !== 'ttb' ? 1 : -1;\n break;\n\n // Down is minus\n case KeyCode.DOWN:\n offset = direction !== 'ttb' ? -1 : 1;\n break;\n case KeyCode.HOME:\n offset = 'min';\n break;\n case KeyCode.END:\n offset = 'max';\n break;\n case KeyCode.PAGE_UP:\n offset = 2;\n break;\n case KeyCode.PAGE_DOWN:\n offset = -2;\n break;\n }\n if (offset !== null) {\n e.preventDefault();\n onOffsetChange(offset, valueIndex);\n }\n }\n };\n var handleKeyUp = function handleKeyUp(e) {\n switch (e.which || e.keyCode) {\n case KeyCode.LEFT:\n case KeyCode.RIGHT:\n case KeyCode.UP:\n case KeyCode.DOWN:\n case KeyCode.HOME:\n case KeyCode.END:\n case KeyCode.PAGE_UP:\n case KeyCode.PAGE_DOWN:\n onChangeComplete === null || onChangeComplete === void 0 || onChangeComplete();\n break;\n }\n };\n\n // ============================ Offset ============================\n var positionStyle = getDirectionStyle(direction, value, min, max);\n\n // ============================ Render ============================\n var divProps = {};\n if (valueIndex !== null) {\n var _getIndex;\n divProps = {\n tabIndex: disabled ? null : getIndex(tabIndex, valueIndex),\n role: 'slider',\n 'aria-valuemin': min,\n 'aria-valuemax': max,\n 'aria-valuenow': value,\n 'aria-disabled': disabled,\n 'aria-label': getIndex(ariaLabelForHandle, valueIndex),\n 'aria-labelledby': getIndex(ariaLabelledByForHandle, valueIndex),\n 'aria-valuetext': (_getIndex = getIndex(ariaValueTextFormatterForHandle, valueIndex)) === null || _getIndex === void 0 ? void 0 : _getIndex(value),\n 'aria-orientation': direction === 'ltr' || direction === 'rtl' ? 'horizontal' : 'vertical',\n onMouseDown: onInternalStartMove,\n onTouchStart: onInternalStartMove,\n onFocus: onInternalFocus,\n onMouseEnter: onInternalMouseEnter,\n onKeyDown: onKeyDown,\n onKeyUp: handleKeyUp\n };\n }\n var handleNode = /*#__PURE__*/React.createElement(\"div\", _extends({\n ref: ref,\n className: cls(handlePrefixCls, _defineProperty(_defineProperty({}, \"\".concat(handlePrefixCls, \"-\").concat(valueIndex + 1), valueIndex !== null && range), \"\".concat(handlePrefixCls, \"-dragging\"), dragging), classNames.handle),\n style: _objectSpread(_objectSpread(_objectSpread({}, positionStyle), style), styles.handle)\n }, divProps, restProps));\n\n // Customize\n if (render) {\n handleNode = render(handleNode, {\n index: valueIndex,\n prefixCls: prefixCls,\n value: value,\n dragging: dragging\n });\n }\n return handleNode;\n});\nif (process.env.NODE_ENV !== 'production') {\n Handle.displayName = 'Handle';\n}\nexport default Handle;", "/**\n * @ignore\n * some key-codes definition and utils from closure-library\n * @author yiminghe@gmail.com\n */\n\nvar KeyCode = {\n /**\n * MAC_ENTER\n */\n MAC_ENTER: 3,\n /**\n * BACKSPACE\n */\n BACKSPACE: 8,\n /**\n * TAB\n */\n TAB: 9,\n /**\n * NUMLOCK on FF/Safari Mac\n */\n NUM_CENTER: 12,\n // NUMLOCK on FF/Safari Mac\n /**\n * ENTER\n */\n ENTER: 13,\n /**\n * SHIFT\n */\n SHIFT: 16,\n /**\n * CTRL\n */\n CTRL: 17,\n /**\n * ALT\n */\n ALT: 18,\n /**\n * PAUSE\n */\n PAUSE: 19,\n /**\n * CAPS_LOCK\n */\n CAPS_LOCK: 20,\n /**\n * ESC\n */\n ESC: 27,\n /**\n * SPACE\n */\n SPACE: 32,\n /**\n * PAGE_UP\n */\n PAGE_UP: 33,\n // also NUM_NORTH_EAST\n /**\n * PAGE_DOWN\n */\n PAGE_DOWN: 34,\n // also NUM_SOUTH_EAST\n /**\n * END\n */\n END: 35,\n // also NUM_SOUTH_WEST\n /**\n * HOME\n */\n HOME: 36,\n // also NUM_NORTH_WEST\n /**\n * LEFT\n */\n LEFT: 37,\n // also NUM_WEST\n /**\n * UP\n */\n UP: 38,\n // also NUM_NORTH\n /**\n * RIGHT\n */\n RIGHT: 39,\n // also NUM_EAST\n /**\n * DOWN\n */\n DOWN: 40,\n // also NUM_SOUTH\n /**\n * PRINT_SCREEN\n */\n PRINT_SCREEN: 44,\n /**\n * INSERT\n */\n INSERT: 45,\n // also NUM_INSERT\n /**\n * DELETE\n */\n DELETE: 46,\n // also NUM_DELETE\n /**\n * ZERO\n */\n ZERO: 48,\n /**\n * ONE\n */\n ONE: 49,\n /**\n * TWO\n */\n TWO: 50,\n /**\n * THREE\n */\n THREE: 51,\n /**\n * FOUR\n */\n FOUR: 52,\n /**\n * FIVE\n */\n FIVE: 53,\n /**\n * SIX\n */\n SIX: 54,\n /**\n * SEVEN\n */\n SEVEN: 55,\n /**\n * EIGHT\n */\n EIGHT: 56,\n /**\n * NINE\n */\n NINE: 57,\n /**\n * QUESTION_MARK\n */\n QUESTION_MARK: 63,\n // needs localization\n /**\n * A\n */\n A: 65,\n /**\n * B\n */\n B: 66,\n /**\n * C\n */\n C: 67,\n /**\n * D\n */\n D: 68,\n /**\n * E\n */\n E: 69,\n /**\n * F\n */\n F: 70,\n /**\n * G\n */\n G: 71,\n /**\n * H\n */\n H: 72,\n /**\n * I\n */\n I: 73,\n /**\n * J\n */\n J: 74,\n /**\n * K\n */\n K: 75,\n /**\n * L\n */\n L: 76,\n /**\n * M\n */\n M: 77,\n /**\n * N\n */\n N: 78,\n /**\n * O\n */\n O: 79,\n /**\n * P\n */\n P: 80,\n /**\n * Q\n */\n Q: 81,\n /**\n * R\n */\n R: 82,\n /**\n * S\n */\n S: 83,\n /**\n * T\n */\n T: 84,\n /**\n * U\n */\n U: 85,\n /**\n * V\n */\n V: 86,\n /**\n * W\n */\n W: 87,\n /**\n * X\n */\n X: 88,\n /**\n * Y\n */\n Y: 89,\n /**\n * Z\n */\n Z: 90,\n /**\n * META\n */\n META: 91,\n // WIN_KEY_LEFT\n /**\n * WIN_KEY_RIGHT\n */\n WIN_KEY_RIGHT: 92,\n /**\n * CONTEXT_MENU\n */\n CONTEXT_MENU: 93,\n /**\n * NUM_ZERO\n */\n NUM_ZERO: 96,\n /**\n * NUM_ONE\n */\n NUM_ONE: 97,\n /**\n * NUM_TWO\n */\n NUM_TWO: 98,\n /**\n * NUM_THREE\n */\n NUM_THREE: 99,\n /**\n * NUM_FOUR\n */\n NUM_FOUR: 100,\n /**\n * NUM_FIVE\n */\n NUM_FIVE: 101,\n /**\n * NUM_SIX\n */\n NUM_SIX: 102,\n /**\n * NUM_SEVEN\n */\n NUM_SEVEN: 103,\n /**\n * NUM_EIGHT\n */\n NUM_EIGHT: 104,\n /**\n * NUM_NINE\n */\n NUM_NINE: 105,\n /**\n * NUM_MULTIPLY\n */\n NUM_MULTIPLY: 106,\n /**\n * NUM_PLUS\n */\n NUM_PLUS: 107,\n /**\n * NUM_MINUS\n */\n NUM_MINUS: 109,\n /**\n * NUM_PERIOD\n */\n NUM_PERIOD: 110,\n /**\n * NUM_DIVISION\n */\n NUM_DIVISION: 111,\n /**\n * F1\n */\n F1: 112,\n /**\n * F2\n */\n F2: 113,\n /**\n * F3\n */\n F3: 114,\n /**\n * F4\n */\n F4: 115,\n /**\n * F5\n */\n F5: 116,\n /**\n * F6\n */\n F6: 117,\n /**\n * F7\n */\n F7: 118,\n /**\n * F8\n */\n F8: 119,\n /**\n * F9\n */\n F9: 120,\n /**\n * F10\n */\n F10: 121,\n /**\n * F11\n */\n F11: 122,\n /**\n * F12\n */\n F12: 123,\n /**\n * NUMLOCK\n */\n NUMLOCK: 144,\n /**\n * SEMICOLON\n */\n SEMICOLON: 186,\n // needs localization\n /**\n * DASH\n */\n DASH: 189,\n // needs localization\n /**\n * EQUALS\n */\n EQUALS: 187,\n // needs localization\n /**\n * COMMA\n */\n COMMA: 188,\n // needs localization\n /**\n * PERIOD\n */\n PERIOD: 190,\n // needs localization\n /**\n * SLASH\n */\n SLASH: 191,\n // needs localization\n /**\n * APOSTROPHE\n */\n APOSTROPHE: 192,\n // needs localization\n /**\n * SINGLE_QUOTE\n */\n SINGLE_QUOTE: 222,\n // needs localization\n /**\n * OPEN_SQUARE_BRACKET\n */\n OPEN_SQUARE_BRACKET: 219,\n // needs localization\n /**\n * BACKSLASH\n */\n BACKSLASH: 220,\n // needs localization\n /**\n * CLOSE_SQUARE_BRACKET\n */\n CLOSE_SQUARE_BRACKET: 221,\n // needs localization\n /**\n * WIN_KEY\n */\n WIN_KEY: 224,\n /**\n * MAC_FF_META\n */\n MAC_FF_META: 224,\n // Firefox (Gecko) fires this for the meta key instead of 91\n /**\n * WIN_IME\n */\n WIN_IME: 229,\n // ======================== Function ========================\n /**\n * whether text and modified key is entered at the same time.\n */\n isTextModifyingKeyEvent: function isTextModifyingKeyEvent(e) {\n var keyCode = e.keyCode;\n if (e.altKey && !e.ctrlKey || e.metaKey ||\n // Function keys don't generate text\n keyCode >= KeyCode.F1 && keyCode <= KeyCode.F12) {\n return false;\n }\n\n // The following keys are quite harmless, even in combination with\n // CTRL, ALT or SHIFT.\n switch (keyCode) {\n case KeyCode.ALT:\n case KeyCode.CAPS_LOCK:\n case KeyCode.CONTEXT_MENU:\n case KeyCode.CTRL:\n case KeyCode.DOWN:\n case KeyCode.END:\n case KeyCode.ESC:\n case KeyCode.HOME:\n case KeyCode.INSERT:\n case KeyCode.LEFT:\n case KeyCode.MAC_FF_META:\n case KeyCode.META:\n case KeyCode.NUMLOCK:\n case KeyCode.NUM_CENTER:\n case KeyCode.PAGE_DOWN:\n case KeyCode.PAGE_UP:\n case KeyCode.PAUSE:\n case KeyCode.PRINT_SCREEN:\n case KeyCode.RIGHT:\n case KeyCode.SHIFT:\n case KeyCode.UP:\n case KeyCode.WIN_KEY:\n case KeyCode.WIN_KEY_RIGHT:\n return false;\n default:\n return true;\n }\n },\n /**\n * whether character is entered.\n */\n isCharacterKey: function isCharacterKey(keyCode) {\n if (keyCode >= KeyCode.ZERO && keyCode <= KeyCode.NINE) {\n return true;\n }\n if (keyCode >= KeyCode.NUM_ZERO && keyCode <= KeyCode.NUM_MULTIPLY) {\n return true;\n }\n if (keyCode >= KeyCode.A && keyCode <= KeyCode.Z) {\n return true;\n }\n\n // Safari sends zero key code for non-latin characters.\n if (window.navigator.userAgent.indexOf('WebKit') !== -1 && keyCode === 0) {\n return true;\n }\n switch (keyCode) {\n case KeyCode.SPACE:\n case KeyCode.QUESTION_MARK:\n case KeyCode.NUM_PLUS:\n case KeyCode.NUM_MINUS:\n case KeyCode.NUM_PERIOD:\n case KeyCode.NUM_DIVISION:\n case KeyCode.SEMICOLON:\n case KeyCode.DASH:\n case KeyCode.EQUALS:\n case KeyCode.COMMA:\n case KeyCode.PERIOD:\n case KeyCode.SLASH:\n case KeyCode.APOSTROPHE:\n case KeyCode.SINGLE_QUOTE:\n case KeyCode.OPEN_SQUARE_BRACKET:\n case KeyCode.BACKSLASH:\n case KeyCode.CLOSE_SQUARE_BRACKET:\n return true;\n default:\n return false;\n }\n }\n};\nexport default KeyCode;", "import * as React from 'react';\nvar SliderContext = /*#__PURE__*/React.createContext({\n min: 0,\n max: 0,\n direction: 'ltr',\n step: 1,\n includedStart: 0,\n includedEnd: 0,\n tabIndex: 0,\n keyboard: true,\n styles: {},\n classNames: {}\n});\nexport default SliderContext;", "import * as React from 'react';\nimport Mark from \"./Mark\";\nvar Marks = function Marks(props) {\n var prefixCls = props.prefixCls,\n marks = props.marks,\n onClick = props.onClick;\n var markPrefixCls = \"\".concat(prefixCls, \"-mark\");\n\n // Not render mark if empty\n if (!marks.length) {\n return null;\n }\n return /*#__PURE__*/React.createElement(\"div\", {\n className: markPrefixCls\n }, marks.map(function (_ref) {\n var value = _ref.value,\n style = _ref.style,\n label = _ref.label;\n return /*#__PURE__*/React.createElement(Mark, {\n key: value,\n prefixCls: markPrefixCls,\n style: style,\n value: value,\n onClick: onClick\n }, label);\n }));\n};\nexport default Marks;", "import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport SliderContext from \"../context\";\nimport { getDirectionStyle } from \"../util\";\nvar Mark = function Mark(props) {\n var prefixCls = props.prefixCls,\n style = props.style,\n children = props.children,\n value = props.value,\n _onClick = props.onClick;\n var _React$useContext = React.useContext(SliderContext),\n min = _React$useContext.min,\n max = _React$useContext.max,\n direction = _React$useContext.direction,\n includedStart = _React$useContext.includedStart,\n includedEnd = _React$useContext.includedEnd,\n included = _React$useContext.included;\n var textCls = \"\".concat(prefixCls, \"-text\");\n\n // ============================ Offset ============================\n var positionStyle = getDirectionStyle(direction, value, min, max);\n return /*#__PURE__*/React.createElement(\"span\", {\n className: classNames(textCls, _defineProperty({}, \"\".concat(textCls, \"-active\"), included && includedStart <= value && value <= includedEnd)),\n style: _objectSpread(_objectSpread({}, positionStyle), style),\n onMouseDown: function onMouseDown(e) {\n e.stopPropagation();\n },\n onClick: function onClick() {\n _onClick(value);\n }\n }, children);\n};\nexport default Mark;", "import * as React from 'react';\nimport SliderContext from \"../context\";\nimport Dot from \"./Dot\";\nvar Steps = function Steps(props) {\n var prefixCls = props.prefixCls,\n marks = props.marks,\n dots = props.dots,\n style = props.style,\n activeStyle = props.activeStyle;\n var _React$useContext = React.useContext(SliderContext),\n min = _React$useContext.min,\n max = _React$useContext.max,\n step = _React$useContext.step;\n var stepDots = React.useMemo(function () {\n var dotSet = new Set();\n\n // Add marks\n marks.forEach(function (mark) {\n dotSet.add(mark.value);\n });\n\n // Fill dots\n if (dots && step !== null) {\n var current = min;\n while (current <= max) {\n dotSet.add(current);\n current += step;\n }\n }\n return Array.from(dotSet);\n }, [min, max, step, dots, marks]);\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-step\")\n }, stepDots.map(function (dotValue) {\n return /*#__PURE__*/React.createElement(Dot, {\n prefixCls: prefixCls,\n key: dotValue,\n value: dotValue,\n style: style,\n activeStyle: activeStyle\n });\n }));\n};\nexport default Steps;", "import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport SliderContext from \"../context\";\nimport { getDirectionStyle } from \"../util\";\nvar Dot = function Dot(props) {\n var prefixCls = props.prefixCls,\n value = props.value,\n style = props.style,\n activeStyle = props.activeStyle;\n var _React$useContext = React.useContext(SliderContext),\n min = _React$useContext.min,\n max = _React$useContext.max,\n direction = _React$useContext.direction,\n included = _React$useContext.included,\n includedStart = _React$useContext.includedStart,\n includedEnd = _React$useContext.includedEnd;\n var dotClassName = \"\".concat(prefixCls, \"-dot\");\n var active = included && includedStart <= value && value <= includedEnd;\n\n // ============================ Offset ============================\n var mergedStyle = _objectSpread(_objectSpread({}, getDirectionStyle(direction, value, min, max)), typeof style === 'function' ? style(value) : style);\n if (active) {\n mergedStyle = _objectSpread(_objectSpread({}, mergedStyle), typeof activeStyle === 'function' ? activeStyle(value) : activeStyle);\n }\n return /*#__PURE__*/React.createElement(\"span\", {\n className: classNames(dotClassName, _defineProperty({}, \"\".concat(dotClassName, \"-active\"), active)),\n style: mergedStyle\n });\n};\nexport default Dot;", "import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport cls from 'classnames';\nimport * as React from 'react';\nimport SliderContext from \"../context\";\nimport { getIndex } from \"../util\";\nimport Track from \"./Track\";\nvar Tracks = function Tracks(props) {\n var prefixCls = props.prefixCls,\n style = props.style,\n values = props.values,\n startPoint = props.startPoint,\n onStartMove = props.onStartMove;\n var _React$useContext = React.useContext(SliderContext),\n included = _React$useContext.included,\n range = _React$useContext.range,\n min = _React$useContext.min,\n styles = _React$useContext.styles,\n classNames = _React$useContext.classNames;\n\n // =========================== List ===========================\n var trackList = React.useMemo(function () {\n if (!range) {\n // null value do not have track\n if (values.length === 0) {\n return [];\n }\n var startValue = startPoint !== null && startPoint !== void 0 ? startPoint : min;\n var endValue = values[0];\n return [{\n start: Math.min(startValue, endValue),\n end: Math.max(startValue, endValue)\n }];\n }\n\n // Multiple\n var list = [];\n for (var i = 0; i < values.length - 1; i += 1) {\n list.push({\n start: values[i],\n end: values[i + 1]\n });\n }\n return list;\n }, [values, range, startPoint, min]);\n if (!included) {\n return null;\n }\n\n // ========================== Render ==========================\n var tracksNode = classNames.tracks || styles.tracks ? /*#__PURE__*/React.createElement(Track, {\n index: null,\n prefixCls: prefixCls,\n start: trackList[0].start,\n end: trackList[trackList.length - 1].end,\n replaceCls: cls(classNames.tracks, \"\".concat(prefixCls, \"-tracks\")),\n style: styles.tracks\n }) : null;\n return /*#__PURE__*/React.createElement(React.Fragment, null, tracksNode, trackList.map(function (_ref, index) {\n var start = _ref.start,\n end = _ref.end;\n return /*#__PURE__*/React.createElement(Track, {\n index: index,\n prefixCls: prefixCls,\n style: _objectSpread(_objectSpread({}, getIndex(style, index)), styles.track),\n start: start,\n end: end,\n key: index,\n onStartMove: onStartMove\n });\n }));\n};\nexport default Tracks;", "import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport cls from 'classnames';\nimport * as React from 'react';\nimport SliderContext from \"../context\";\nimport { getOffset } from \"../util\";\nvar Track = function Track(props) {\n var prefixCls = props.prefixCls,\n style = props.style,\n start = props.start,\n end = props.end,\n index = props.index,\n onStartMove = props.onStartMove,\n replaceCls = props.replaceCls;\n var _React$useContext = React.useContext(SliderContext),\n direction = _React$useContext.direction,\n min = _React$useContext.min,\n max = _React$useContext.max,\n disabled = _React$useContext.disabled,\n range = _React$useContext.range,\n classNames = _React$useContext.classNames;\n var trackPrefixCls = \"\".concat(prefixCls, \"-track\");\n var offsetStart = getOffset(start, min, max);\n var offsetEnd = getOffset(end, min, max);\n\n // ============================ Events ============================\n var onInternalStartMove = function onInternalStartMove(e) {\n if (!disabled && onStartMove) {\n onStartMove(e, -1);\n }\n };\n\n // ============================ Render ============================\n var positionStyle = {};\n switch (direction) {\n case 'rtl':\n positionStyle.right = \"\".concat(offsetStart * 100, \"%\");\n positionStyle.width = \"\".concat(offsetEnd * 100 - offsetStart * 100, \"%\");\n break;\n case 'btt':\n positionStyle.bottom = \"\".concat(offsetStart * 100, \"%\");\n positionStyle.height = \"\".concat(offsetEnd * 100 - offsetStart * 100, \"%\");\n break;\n case 'ttb':\n positionStyle.top = \"\".concat(offsetStart * 100, \"%\");\n positionStyle.height = \"\".concat(offsetEnd * 100 - offsetStart * 100, \"%\");\n break;\n default:\n positionStyle.left = \"\".concat(offsetStart * 100, \"%\");\n positionStyle.width = \"\".concat(offsetEnd * 100 - offsetStart * 100, \"%\");\n }\n var className = replaceCls || cls(trackPrefixCls, _defineProperty(_defineProperty({}, \"\".concat(trackPrefixCls, \"-\").concat(index + 1), index !== null && range), \"\".concat(prefixCls, \"-track-draggable\"), onStartMove), classNames.track);\n return /*#__PURE__*/React.createElement(\"div\", {\n className: className,\n style: _objectSpread(_objectSpread({}, positionStyle), style),\n onMouseDown: onInternalStartMove,\n onTouchStart: onInternalStartMove\n });\n};\nexport default Track;", "import _typeof from \"@babel/runtime/helpers/esm/typeof\";\n/* eslint-disable no-param-reassign */\n\nimport { isValidElement } from 'react';\nimport { ForwardRef, isFragment, isMemo } from 'react-is';\nimport useMemo from \"./hooks/useMemo\";\nexport function fillRef(ref, node) {\n if (typeof ref === 'function') {\n ref(node);\n } else if (_typeof(ref) === 'object' && ref && 'current' in ref) {\n ref.current = node;\n }\n}\n\n/**\n * Merge refs into one ref function to support ref passing.\n */\nexport function composeRef() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n var refList = refs.filter(function (ref) {\n return ref;\n });\n if (refList.length <= 1) {\n return refList[0];\n }\n return function (node) {\n refs.forEach(function (ref) {\n fillRef(ref, node);\n });\n };\n}\nexport function useComposeRef() {\n for (var _len2 = arguments.length, refs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n refs[_key2] = arguments[_key2];\n }\n return useMemo(function () {\n return composeRef.apply(void 0, refs);\n }, refs, function (prev, next) {\n return prev.length !== next.length || prev.every(function (ref, i) {\n return ref !== next[i];\n });\n });\n}\nexport function supportRef(nodeOrComponent) {\n var _type$prototype, _nodeOrComponent$prot;\n var type = isMemo(nodeOrComponent) ? nodeOrComponent.type.type : nodeOrComponent.type;\n\n // Function component node\n if (typeof type === 'function' && !((_type$prototype = type.prototype) !== null && _type$prototype !== void 0 && _type$prototype.render) && type.$$typeof !== ForwardRef) {\n return false;\n }\n\n // Class component\n if (typeof nodeOrComponent === 'function' && !((_nodeOrComponent$prot = nodeOrComponent.prototype) !== null && _nodeOrComponent$prot !== void 0 && _nodeOrComponent$prot.render) && nodeOrComponent.$$typeof !== ForwardRef) {\n return false;\n }\n return true;\n}\nexport function supportNodeRef(node) {\n if (! /*#__PURE__*/isValidElement(node)) {\n return false;\n }\n if (isFragment(node)) {\n return false;\n }\n return supportRef(node);\n}\n/* eslint-enable */", "import * as React from 'react';\nexport default function useMemo(getValue, condition, shouldUpdate) {\n var cacheRef = React.useRef({});\n if (!('value' in cacheRef.current) || shouldUpdate(cacheRef.current.condition, condition)) {\n cacheRef.current.value = getValue();\n cacheRef.current.condition = condition;\n }\n return cacheRef.current.value;\n}", "import _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport { useEvent } from 'rc-util';\nimport * as React from 'react';\nfunction getPosition(e) {\n var obj = 'touches' in e ? e.touches[0] : e;\n return {\n pageX: obj.pageX,\n pageY: obj.pageY\n };\n}\nfunction useDrag(containerRef, direction, rawValues, min, max, formatValue, triggerChange, finishChange, offsetValues) {\n var _React$useState = React.useState(null),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n draggingValue = _React$useState2[0],\n setDraggingValue = _React$useState2[1];\n var _React$useState3 = React.useState(-1),\n _React$useState4 = _slicedToArray(_React$useState3, 2),\n draggingIndex = _React$useState4[0],\n setDraggingIndex = _React$useState4[1];\n var _React$useState5 = React.useState(rawValues),\n _React$useState6 = _slicedToArray(_React$useState5, 2),\n cacheValues = _React$useState6[0],\n setCacheValues = _React$useState6[1];\n var _React$useState7 = React.useState(rawValues),\n _React$useState8 = _slicedToArray(_React$useState7, 2),\n originValues = _React$useState8[0],\n setOriginValues = _React$useState8[1];\n var mouseMoveEventRef = React.useRef(null);\n var mouseUpEventRef = React.useRef(null);\n React.useLayoutEffect(function () {\n if (draggingIndex === -1) {\n setCacheValues(rawValues);\n }\n }, [rawValues, draggingIndex]);\n\n // Clean up event\n React.useEffect(function () {\n return function () {\n document.removeEventListener('mousemove', mouseMoveEventRef.current);\n document.removeEventListener('mouseup', mouseUpEventRef.current);\n document.removeEventListener('touchmove', mouseMoveEventRef.current);\n document.removeEventListener('touchend', mouseUpEventRef.current);\n };\n }, []);\n var flushValues = function flushValues(nextValues, nextValue) {\n // Perf: Only update state when value changed\n if (cacheValues.some(function (val, i) {\n return val !== nextValues[i];\n })) {\n if (nextValue !== undefined) {\n setDraggingValue(nextValue);\n }\n setCacheValues(nextValues);\n triggerChange(nextValues);\n }\n };\n var updateCacheValue = useEvent(function (valueIndex, offsetPercent) {\n // Basic point offset\n\n if (valueIndex === -1) {\n // >>>> Dragging on the track\n var startValue = originValues[0];\n var endValue = originValues[originValues.length - 1];\n var maxStartOffset = min - startValue;\n var maxEndOffset = max - endValue;\n\n // Get valid offset\n var offset = offsetPercent * (max - min);\n offset = Math.max(offset, maxStartOffset);\n offset = Math.min(offset, maxEndOffset);\n\n // Use first value to revert back of valid offset (like steps marks)\n var formatStartValue = formatValue(startValue + offset);\n offset = formatStartValue - startValue;\n var cloneCacheValues = originValues.map(function (val) {\n return val + offset;\n });\n flushValues(cloneCacheValues);\n } else {\n // >>>> Dragging on the handle\n var offsetDist = (max - min) * offsetPercent;\n\n // Always start with the valueIndex origin value\n var cloneValues = _toConsumableArray(cacheValues);\n cloneValues[valueIndex] = originValues[valueIndex];\n var next = offsetValues(cloneValues, offsetDist, valueIndex, 'dist');\n flushValues(next.values, next.value);\n }\n });\n var onStartMove = function onStartMove(e, valueIndex, startValues) {\n e.stopPropagation();\n\n // \u5982\u679C\u662F\u70B9\u51FB track \u89E6\u53D1\u7684\uFF0C\u9700\u8981\u4F20\u5165\u53D8\u5316\u540E\u7684\u521D\u59CB\u503C\uFF0C\u800C\u4E0D\u80FD\u76F4\u63A5\u7528 rawValues\n var initialValues = startValues || rawValues;\n var originValue = initialValues[valueIndex];\n setDraggingIndex(valueIndex);\n setDraggingValue(originValue);\n setOriginValues(initialValues);\n var _getPosition = getPosition(e),\n startX = _getPosition.pageX,\n startY = _getPosition.pageY;\n\n // Moving\n var onMouseMove = function onMouseMove(event) {\n event.preventDefault();\n var _getPosition2 = getPosition(event),\n moveX = _getPosition2.pageX,\n moveY = _getPosition2.pageY;\n var offsetX = moveX - startX;\n var offsetY = moveY - startY;\n var _containerRef$current = containerRef.current.getBoundingClientRect(),\n width = _containerRef$current.width,\n height = _containerRef$current.height;\n var offSetPercent;\n switch (direction) {\n case 'btt':\n offSetPercent = -offsetY / height;\n break;\n case 'ttb':\n offSetPercent = offsetY / height;\n break;\n case 'rtl':\n offSetPercent = -offsetX / width;\n break;\n default:\n offSetPercent = offsetX / width;\n }\n updateCacheValue(valueIndex, offSetPercent);\n };\n\n // End\n var onMouseUp = function onMouseUp(event) {\n event.preventDefault();\n document.removeEventListener('mouseup', onMouseUp);\n document.removeEventListener('mousemove', onMouseMove);\n document.removeEventListener('touchend', onMouseUp);\n document.removeEventListener('touchmove', onMouseMove);\n mouseMoveEventRef.current = null;\n mouseUpEventRef.current = null;\n setDraggingIndex(-1);\n finishChange();\n };\n document.addEventListener('mouseup', onMouseUp);\n document.addEventListener('mousemove', onMouseMove);\n document.addEventListener('touchend', onMouseUp);\n document.addEventListener('touchmove', onMouseMove);\n mouseMoveEventRef.current = onMouseMove;\n mouseUpEventRef.current = onMouseUp;\n };\n\n // Only return cache value when it mapping with rawValues\n var returnValues = React.useMemo(function () {\n var sourceValues = _toConsumableArray(rawValues).sort(function (a, b) {\n return a - b;\n });\n var targetValues = _toConsumableArray(cacheValues).sort(function (a, b) {\n return a - b;\n });\n return sourceValues.every(function (val, index) {\n return val === targetValues[index];\n }) ? cacheValues : rawValues;\n }, [rawValues, cacheValues]);\n return [draggingIndex, draggingValue, returnValues, onStartMove];\n}\nexport default useDrag;", "import _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport * as React from 'react';\n\n/** Format the value in the range of [min, max] */\n\n/** Format value align with step */\n\n/** Format value align with step & marks */\n\nexport default function useOffset(min, max, step, markList, allowCross, pushable) {\n var formatRangeValue = React.useCallback(function (val) {\n return Math.max(min, Math.min(max, val));\n }, [min, max]);\n var formatStepValue = React.useCallback(function (val) {\n if (step !== null) {\n var stepValue = min + Math.round((formatRangeValue(val) - min) / step) * step;\n\n // Cut number in case to be like 0.30000000000000004\n var getDecimal = function getDecimal(num) {\n return (String(num).split('.')[1] || '').length;\n };\n var maxDecimal = Math.max(getDecimal(step), getDecimal(max), getDecimal(min));\n var fixedValue = Number(stepValue.toFixed(maxDecimal));\n return min <= fixedValue && fixedValue <= max ? fixedValue : null;\n }\n return null;\n }, [step, min, max, formatRangeValue]);\n var formatValue = React.useCallback(function (val) {\n var formatNextValue = formatRangeValue(val);\n\n // List align values\n var alignValues = markList.map(function (mark) {\n return mark.value;\n });\n if (step !== null) {\n alignValues.push(formatStepValue(val));\n }\n\n // min & max\n alignValues.push(min, max);\n\n // Align with marks\n var closeValue = alignValues[0];\n var closeDist = max - min;\n alignValues.forEach(function (alignValue) {\n var dist = Math.abs(formatNextValue - alignValue);\n if (dist <= closeDist) {\n closeValue = alignValue;\n closeDist = dist;\n }\n });\n return closeValue;\n }, [min, max, markList, step, formatRangeValue, formatStepValue]);\n\n // ========================== Offset ==========================\n // Single Value\n var offsetValue = function offsetValue(values, offset, valueIndex) {\n var mode = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'unit';\n if (typeof offset === 'number') {\n var nextValue;\n var originValue = values[valueIndex];\n\n // Only used for `dist` mode\n var targetDistValue = originValue + offset;\n\n // Compare next step value & mark value which is best match\n var potentialValues = [];\n markList.forEach(function (mark) {\n potentialValues.push(mark.value);\n });\n\n // Min & Max\n potentialValues.push(min, max);\n\n // In case origin value is align with mark but not with step\n potentialValues.push(formatStepValue(originValue));\n\n // Put offset step value also\n var sign = offset > 0 ? 1 : -1;\n if (mode === 'unit') {\n potentialValues.push(formatStepValue(originValue + sign * step));\n } else {\n potentialValues.push(formatStepValue(targetDistValue));\n }\n\n // Find close one\n potentialValues = potentialValues.filter(function (val) {\n return val !== null;\n })\n // Remove reverse value\n .filter(function (val) {\n return offset < 0 ? val <= originValue : val >= originValue;\n });\n if (mode === 'unit') {\n // `unit` mode can not contain itself\n potentialValues = potentialValues.filter(function (val) {\n return val !== originValue;\n });\n }\n var compareValue = mode === 'unit' ? originValue : targetDistValue;\n nextValue = potentialValues[0];\n var valueDist = Math.abs(nextValue - compareValue);\n potentialValues.forEach(function (potentialValue) {\n var dist = Math.abs(potentialValue - compareValue);\n if (dist < valueDist) {\n nextValue = potentialValue;\n valueDist = dist;\n }\n });\n\n // Out of range will back to range\n if (nextValue === undefined) {\n return offset < 0 ? min : max;\n }\n\n // `dist` mode\n if (mode === 'dist') {\n return nextValue;\n }\n\n // `unit` mode may need another round\n if (Math.abs(offset) > 1) {\n var cloneValues = _toConsumableArray(values);\n cloneValues[valueIndex] = nextValue;\n return offsetValue(cloneValues, offset - sign, valueIndex, mode);\n }\n return nextValue;\n } else if (offset === 'min') {\n return min;\n } else if (offset === 'max') {\n return max;\n }\n };\n\n /** Same as `offsetValue` but return `changed` mark to tell value changed */\n var offsetChangedValue = function offsetChangedValue(values, offset, valueIndex) {\n var mode = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'unit';\n var originValue = values[valueIndex];\n var nextValue = offsetValue(values, offset, valueIndex, mode);\n return {\n value: nextValue,\n changed: nextValue !== originValue\n };\n };\n var needPush = function needPush(dist) {\n return pushable === null && dist === 0 || typeof pushable === 'number' && dist < pushable;\n };\n\n // Values\n var offsetValues = function offsetValues(values, offset, valueIndex) {\n var mode = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'unit';\n var nextValues = values.map(formatValue);\n var originValue = nextValues[valueIndex];\n var nextValue = offsetValue(nextValues, offset, valueIndex, mode);\n nextValues[valueIndex] = nextValue;\n if (allowCross === false) {\n // >>>>> Allow Cross\n var pushNum = pushable || 0;\n\n // ============ AllowCross ===============\n if (valueIndex > 0 && nextValues[valueIndex - 1] !== originValue) {\n nextValues[valueIndex] = Math.max(nextValues[valueIndex], nextValues[valueIndex - 1] + pushNum);\n }\n if (valueIndex < nextValues.length - 1 && nextValues[valueIndex + 1] !== originValue) {\n nextValues[valueIndex] = Math.min(nextValues[valueIndex], nextValues[valueIndex + 1] - pushNum);\n }\n } else if (typeof pushable === 'number' || pushable === null) {\n // >>>>> Pushable\n // =============== Push ==================\n\n // >>>>>> Basic push\n // End values\n for (var i = valueIndex + 1; i < nextValues.length; i += 1) {\n var changed = true;\n while (needPush(nextValues[i] - nextValues[i - 1]) && changed) {\n var _offsetChangedValue = offsetChangedValue(nextValues, 1, i);\n nextValues[i] = _offsetChangedValue.value;\n changed = _offsetChangedValue.changed;\n }\n }\n\n // Start values\n for (var _i = valueIndex; _i > 0; _i -= 1) {\n var _changed = true;\n while (needPush(nextValues[_i] - nextValues[_i - 1]) && _changed) {\n var _offsetChangedValue2 = offsetChangedValue(nextValues, -1, _i - 1);\n nextValues[_i - 1] = _offsetChangedValue2.value;\n _changed = _offsetChangedValue2.changed;\n }\n }\n\n // >>>>> Revert back to safe push range\n // End to Start\n for (var _i2 = nextValues.length - 1; _i2 > 0; _i2 -= 1) {\n var _changed2 = true;\n while (needPush(nextValues[_i2] - nextValues[_i2 - 1]) && _changed2) {\n var _offsetChangedValue3 = offsetChangedValue(nextValues, -1, _i2 - 1);\n nextValues[_i2 - 1] = _offsetChangedValue3.value;\n _changed2 = _offsetChangedValue3.changed;\n }\n }\n\n // Start to End\n for (var _i3 = 0; _i3 < nextValues.length - 1; _i3 += 1) {\n var _changed3 = true;\n while (needPush(nextValues[_i3 + 1] - nextValues[_i3]) && _changed3) {\n var _offsetChangedValue4 = offsetChangedValue(nextValues, 1, _i3 + 1);\n nextValues[_i3 + 1] = _offsetChangedValue4.value;\n _changed3 = _offsetChangedValue4.changed;\n }\n }\n }\n return {\n value: nextValues[valueIndex],\n values: nextValues\n };\n };\n return [formatValue, offsetValues];\n}", "import Slider from \"./Slider\";\nexport default Slider;", "import Slider from \"rc-slider\";\nimport React from \"react\";\nimport { FilterControl } from \"./FilterControl\";\nimport { Filters } from \"./lib/filter-results\";\n\ntype Range = Filters[\"times\"][\"departure\"];\n\nconst targetLabelConectors = {\n before: \" before \",\n after: \" after \",\n between: \" between \",\n};\n\nfunction getTargetLabel(selectedRange: Filters[\"times\"]) {\n const [departureStart, departureEnd] = selectedRange.departure;\n const isDepartureChanged = departureStart !== 0 || departureEnd !== 1440;\n\n const [arrivalStart, arrivalEnd] = selectedRange.arrival;\n const isArrivalChanged = arrivalStart !== 0 || arrivalEnd !== 1440;\n\n if (isDepartureChanged && isArrivalChanged) {\n return \"Departure and arrival times\";\n }\n\n if (isDepartureChanged) {\n return getSliderLabel(\n \"Departing\",\n selectedRange.departure,\n targetLabelConectors,\n );\n }\n\n if (isArrivalChanged) {\n return getSliderLabel(\n \"Arriving\",\n selectedRange.arrival,\n targetLabelConectors,\n );\n }\n\n return \"Any time\";\n}\n\nconst sliderMarks = [0, 360, 720, 1080, 1440].reduce(\n (marks, minutes) => ({\n ...marks,\n [minutes.toString()]: transformMinutesToTimeString(minutes),\n }),\n {},\n);\n\nfunction getSliderLabel(\n prefix: string,\n range: Range,\n connectors = {\n before: \": Before \",\n after: \": After \",\n between: \": \",\n },\n) {\n const [start, end] = range;\n\n if (start === 0 && end === 1440) return `${prefix}: Any time`;\n if (start === 0)\n return `${prefix}${connectors.before}${transformMinutesToTimeString(end)}`;\n if (end === 1440)\n return `${prefix}${connectors.after}${transformMinutesToTimeString(start)}`;\n\n return `${prefix}${connectors.between}${transformMinutesToTimeString(start)} - ${transformMinutesToTimeString(end)}`;\n}\n\nfunction transformMinutesToTimeString(minutes: number) {\n if (minutes === 1440) return \"23:59\";\n\n const hours = Math.floor(minutes / 60);\n const mins = minutes % 60;\n\n const hoursString = hours.toString().padStart(2, \"0\");\n const minsString = mins.toString().padStart(2, \"0\");\n\n return `${hoursString}:${minsString}`;\n}\n\ninterface TimeRangeSelectorProps {\n selected: Filters[\"times\"];\n onChange: (stopFilter: Filters[\"times\"]) => void;\n}\n\nexport const TimeRangeSelector: React.FC<TimeRangeSelectorProps> = ({\n selected,\n onChange,\n}) => {\n return (\n <FilterControl target={getTargetLabel(selected)} targetWidth=\"220px\">\n {() => (\n <div className=\"padding-8 v-space v-space--24\">\n <div className=\"v-space \">\n <p className=\"font-size-14\">\n {getSliderLabel(\"Departure time\", selected.departure)}\n </p>\n <div className=\"padding-12\">\n <Slider\n className=\"time-range-slider\"\n range\n min={0}\n max={1440}\n step={30}\n allowCross={false}\n value={selected.departure}\n onChange={(value) =>\n onChange({ ...selected, departure: value as Range })\n }\n marks={sliderMarks}\n />\n </div>\n </div>\n <div className=\"v-space v-space--8\">\n <p className=\"font-size-14\">\n {getSliderLabel(\"Arrival time\", selected.arrival)}\n </p>\n <div className=\"padding-12\">\n <Slider\n className=\"time-range-slider\"\n range\n min={0}\n max={1440}\n step={30}\n allowCross={false}\n value={selected.arrival}\n onChange={(value) =>\n onChange({ ...selected, arrival: value as Range })\n }\n marks={sliderMarks}\n />\n </div>\n </div>\n </div>\n )}\n </FilterControl>\n );\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { AirlineSelector } from \"./AirlineSelector\";\nimport { StopsSelector } from \"./StopsSelector\";\nimport { TimeRangeSelector } from \"./TimeRangeSelector\";\nimport { Filters } from \"./lib/filter-results\";\n\ninterface FilterControlsProps {\n selectedOwner?: string;\n airlines: Filters[\"airlines\"];\n airlinesFilter: Filters[\"airlines\"];\n setAirlinesFilter: (airlines: Filters[\"airlines\"]) => void;\n timesFilter: Filters[\"times\"];\n setTimesFilter: (times: Filters[\"times\"]) => void;\n stopsFilter: Filters[\"stops\"];\n setStopsFilter: (stops: Filters[\"stops\"]) => void;\n}\n\nexport const FilterControls: React.FC<FilterControlsProps> = ({\n selectedOwner,\n airlines,\n airlinesFilter,\n setAirlinesFilter,\n timesFilter,\n setTimesFilter,\n stopsFilter,\n setStopsFilter,\n}) => {\n return (\n <div className=\"h-space h-space--8\">\n <AirlineSelector\n targetLabel={selectedOwner}\n disabled={selectedOwner !== undefined}\n options={airlines}\n selected={airlinesFilter}\n onChange={setAirlinesFilter}\n />\n\n <StopsSelector selected={stopsFilter} onChange={setStopsFilter} />\n <TimeRangeSelector selected={timesFilter} onChange={setTimesFilter} />\n </div>\n );\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { OfferSlice, OfferSliceSegment } from \"@duffel/api/types\";\nimport * as React from \"react\";\nimport { AirlineLogo } from \"./AirlineLogo\";\nimport { HSpace } from \"./HSpace\";\n\nexport interface SliceCarriersTitleProps {\n slice: OfferSlice;\n}\n\nexport const SliceCarriersTitle: React.FC<SliceCarriersTitleProps> = ({\n slice,\n}) => {\n const marketingCarriers = slice.segments.map(\n ({ marketing_carrier }) => marketing_carrier,\n );\n const operatingCarriers = slice.segments.map(\n ({ operating_carrier }) => operating_carrier,\n );\n\n const firstMarketingCarrier = marketingCarriers[0];\n const marketingCarrierNamesSet = new Set<string>(\n marketingCarriers.map(({ name }) => name),\n );\n const operatingCarrierNamesSet = new Set<string>(\n operatingCarriers.map(({ name }) => name),\n );\n\n const marketingCarriersLabel = Array.from(marketingCarrierNamesSet).join(\n \" & \",\n );\n\n const operatingCarriersLabel = Array.from(operatingCarrierNamesSet)\n .filter((name) => !marketingCarrierNamesSet.has(name))\n .join(\" & \");\n\n const isPartialOperarion = Array.from(operatingCarrierNamesSet).some((name) =>\n marketingCarrierNamesSet.has(name),\n );\n\n return (\n <HSpace space={8}>\n <AirlineLogo\n size={20}\n name={firstMarketingCarrier.name}\n iataCode={firstMarketingCarrier.iata_code}\n />\n <div className=\"slice-carriers-title\">\n {marketingCarriersLabel}{\" \"}\n {operatingCarriersLabel && (\n <span className=\"slice-carriers-title__operating-carrier\">\n ({isPartialOperarion && \"partially \"}operated by{\" \"}\n {operatingCarriersLabel})\n </span>\n )}\n <span className=\"slice-carriers-title__operating-carrier\">\n {\" \"}\n \u00B7{\" \"}\n {slice.segments\n .map(\n (segment) =>\n segment.marketing_carrier.iata_code +\n segment.marketing_carrier_flight_number,\n )\n .join(\", \")}\n </span>\n </div>\n </HSpace>\n );\n};\n\nexport function getSegmentCarriersTitle(segment: OfferSliceSegment) {\n const marketingCarrier = segment.marketing_carrier;\n const operatingCarrier = segment.operating_carrier;\n\n const isOperatedByMarketingCarrier =\n marketingCarrier.name === operatingCarrier.name;\n\n return `${marketingCarrier.name}${\n isOperatedByMarketingCarrier ? \"\" : ` operated by ${operatingCarrier.name} `\n }`;\n}\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { Icon } from \"@components/shared/Icon\";\nimport { SliceCarriersTitle } from \"@components/shared/SliceCarriersTitle\";\nimport { moneyStringFormatter } from \"@lib/moneyStringFormatter\";\nimport classNames from \"classnames\";\nimport * as React from \"react\";\nimport { NGSShelf, NGS_SHELF_INFO, NGS_SHELVES } from \"./lib\";\nimport {\n NGSOfferRow,\n getNGSSliceKey,\n groupOffersForNGSView,\n} from \"./lib/group-offers-for-ngs-view\";\n\nimport { OfferSliceModal } from \"@components/OfferSliceModal/OfferSliceModal\";\nimport { NonIdealState } from \"@components/shared/NonIdealState\";\nimport { OfferRequest, OfferSlice } from \"@duffel/api/types\";\nimport { NGSShelfInfoCard } from \"./NGSShelfInfoCard\";\nimport { NGSSliceFareCard } from \"./NGSSliceFareCard\";\nimport { SliceSummary } from \"./SliceSummary\";\nimport {\n getCheapestOffer,\n getFareBrandNameForOffer,\n} from \"./lib/deduplicate-mapped-offers-by-fare-brand\";\nimport { doOffersHaveMixedCabin } from \"./lib/does-slice-have-mixed-cabins\";\nimport { getCheapestOfferAmount } from \"./lib/sort-ngs-rows-by-shelf-price\";\n\nexport interface NGSTableProps {\n offers: OfferRequest[\"offers\"];\n sliceIndex: number;\n previousSliceKeys: string[]; // For filtering the current set of offers\n onSelect: (\n offerId: string,\n sliceKey: string,\n offer: OfferRequest[\"offers\"][number],\n ) => void;\n sortingFunction: (rows: NGSOfferRow[]) => NGSOfferRow[];\n selectedColumn: NGSShelf | null;\n setSelectedColumn: (shelf: NGSShelf | null) => void;\n}\n\ntype OfferPosition = {\n row: number;\n shelf: NGSShelf;\n};\n\nexport const NGSTable: React.FC<NGSTableProps> = ({\n offers,\n sliceIndex,\n onSelect,\n previousSliceKeys,\n sortingFunction,\n selectedColumn,\n setSelectedColumn,\n}) => {\n const [expandedOffer, setExpandedOffer] =\n React.useState<OfferPosition | null>(null);\n const [isOfferSliceModalOpen, setIsOfferSliceModalOpen] =\n React.useState<boolean>(false);\n const [offerSliceModalSlice, setOfferSliceModalSlice] =\n React.useState<OfferSlice>(offers[0]?.slices[sliceIndex]);\n\n React.useEffect(() => {\n setSelectedColumn(null);\n setExpandedOffer(null);\n setIsOfferSliceModalOpen(false);\n }, [previousSliceKeys]);\n\n const rows = groupOffersForNGSView(offers, sliceIndex, previousSliceKeys);\n const sortedRows = sortingFunction(rows);\n\n if (offers.length === 0) {\n return (\n <NonIdealState>There are no offers matching your filters.</NonIdealState>\n );\n }\n\n let tripType = \"\";\n if (offers[0].slices.length == 1) tripType = \"One-way\";\n if (\n offers[0].slices.length == 2 &&\n offers[0].slices[0].origin.iata_code ===\n offers[0].slices[1].destination.iata_code\n ) {\n tripType = \"Roundtrip\";\n }\n\n return (\n <div className=\"ngs-table\">\n <table className=\"ngs-table_table\">\n <thead>\n <tr className=\"ngs-table_table-header\">\n <th className=\"ngs-table_th ngs-table_th--sticky\"></th>\n {NGS_SHELVES.map((shelf) => (\n <th\n key={shelf}\n onClick={() => {\n setSelectedColumn(shelf);\n setExpandedOffer(null);\n }}\n className=\"ngs-table_th--sticky\"\n >\n <div\n className={classNames(\n \"ngs-table_column-header\",\n selectedColumn === shelf &&\n \"ngs-table_column-header--selected\",\n )}\n >\n <Icon\n name={NGS_SHELF_INFO[shelf].icon}\n size={14}\n color={\n selectedColumn === shelf ? \"--GREY-900\" : \"--GREY-500\"\n }\n className=\"ngs-table_shelf-icon\"\n />\n {NGS_SHELF_INFO[shelf].short_title}\n {selectedColumn === shelf && (\n <Icon\n name=\"unfold_more\"\n size={12}\n color=\"--GREY-900\"\n className=\"ngs-table_sort-icon\"\n />\n )}\n <NGSShelfInfoCard\n ngs_shelf={shelf}\n className={classNames(\n \"ngs-table_column-header-tooltip\",\n +shelf >= 3 && \"ngs-table_column-header-tooltip--left\",\n )}\n />\n </div>\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {sortedRows.map((row, index) => (\n <>\n <tr key={index}>\n <td className=\"ngs-table_slice-info\">\n <SliceCarriersTitle slice={row[\"slice\"]} />\n <SliceSummary slice={row[\"slice\"]} />\n <button\n onClick={() => {\n setOfferSliceModalSlice(row[\"slice\"]);\n setIsOfferSliceModalOpen(true);\n }}\n className=\"ngs-table_slice-details-button\"\n >\n View details\n </button>\n </td>\n {NGS_SHELVES.map((shelf) => (\n <td\n key={shelf}\n onClick={() => {\n if (\n expandedOffer?.row === index &&\n expandedOffer?.shelf === shelf\n ) {\n setExpandedOffer(null);\n } else {\n setSelectedColumn(shelf);\n setExpandedOffer({ row: index, shelf });\n }\n }}\n className={classNames(\n \"ngs-table_table-data\",\n selectedColumn === shelf &&\n \"ngs-table_table-data--selected\",\n expandedOffer?.row === index &&\n expandedOffer?.shelf === shelf &&\n \"ngs-table_table-data--expanded\",\n )}\n >\n {row[shelf] ? (\n <div>\n <p className=\"ngs-table_table-data--details\">\n {getFareBrandNameForOffer(\n getCheapestOffer(row[shelf]!),\n sliceIndex,\n )}\n </p>\n <p>\n {moneyStringFormatter(row[shelf]![0].total_currency)(\n getCheapestOfferAmount(row[shelf])!,\n )}\n </p>\n <p className=\"ngs-table_table-data--details\">\n {tripType}\n </p>\n {doOffersHaveMixedCabin(\n [getCheapestOffer(row[shelf]!)],\n sliceIndex,\n ) && (\n <div className=\"ngs-slice-fare-card_mixed-cabins\">\n <Icon name=\"info_outline\" size={12} />\n Multiple cabins\n </div>\n )}\n </div>\n ) : (\n \"-\"\n )}\n </td>\n ))}\n </tr>\n {expandedOffer?.row === index &&\n expandedOffer.shelf &&\n sortedRows[index][expandedOffer.shelf] && (\n <tr>\n <td colSpan={6} className=\"ngs-table_expanded\">\n <div>\n {sortedRows[index][expandedOffer.shelf]?.map(\n (offer) => (\n <NGSSliceFareCard\n key={offer.id}\n offer={offer}\n sliceIndex={sliceIndex}\n onSelect={() =>\n onSelect(\n offer.id,\n getNGSSliceKey(\n offer.slices[sliceIndex],\n offer.owner.iata_code,\n true,\n ),\n offer,\n )\n }\n />\n ),\n )}\n </div>\n </td>\n </tr>\n )}\n </>\n ))}\n </tbody>\n </table>\n <OfferSliceModal\n slice={offerSliceModalSlice}\n isOpen={isOfferSliceModalOpen}\n onClose={() => setIsOfferSliceModalOpen(false)}\n />\n </div>\n );\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { IconName } from \"@components/shared/Icon\";\nimport { OfferSlice, SeatType } from \"@duffel/api/types\";\nexport const NGS_SHELVES = [1, 2, 3, 4, 5] as const;\nexport type NGSShelf = OfferSlice[\"ngs_shelf\"];\ntype ShelfInfo = {\n short_title: string;\n full_title: string;\n description: string;\n icon: IconName;\n};\n\nexport const NGS_SHELF_INFO: Record<\n NonNullable<OfferSlice[\"ngs_shelf\"]>,\n ShelfInfo\n> = {\n 1: {\n short_title: \"Basic\",\n full_title: \"Basic Economy\",\n description:\n \"Basic economy seats without seat selection, flexible change/cancellation options or checked baggage.\",\n icon: \"carry_on_bag_inactive\",\n },\n 2: {\n short_title: \"Standard\",\n full_title: \"Standard Economy\",\n description:\n \"Economy seats that allow seat selection, flexible change/cancellation options and checked baggage.\",\n icon: \"airline_seat_recline_normal\",\n },\n 3: {\n short_title: \"Plus\",\n full_title: \"Plus\",\n description:\n \"Preferred seating that offers more comfort to passengers, such as additional legroom, width or having the middle seat free for the row.\",\n icon: \"airline_seat_legroom_extra\",\n },\n 4: {\n short_title: \"Premium\",\n full_title: \"Premium\",\n description:\n \"Premium seating with additional legroom and recline. Seats shall be typically situated in the premium economy cabin or higher.\",\n icon: \"airline_seat_recline_extra\",\n },\n 5: {\n short_title: \"Luxury\",\n full_title: \"Luxury\",\n description:\n \"Luxury seating with additional legroom and reclines to a lie flat position. Seats shall be typically situated in business class or higher.\",\n icon: \"airline_seat_flat\",\n },\n};\n\nexport const SEAT_ICONS_MAP: Record<SeatType, IconName> = {\n standard: \"airline_seat_recline_normal\",\n extra_legroom: \"airline_seat_legroom_extra\",\n skycouch: \"airline_seat_recline_extra\",\n recliner: \"airline_seat_recline_extra\",\n angle_flat: \"airline_seat_recline_extra\",\n full_flat: \"airline_seat_flat\",\n private_suite: \"airline_seat_individual_suite\",\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import {\n Offer,\n OfferRequest,\n OfferSliceSegmentPassenger,\n} from \"@duffel/api/types\";\nimport { NGSOfferRow } from \"./group-offers-for-ngs-view\";\nimport { NGS_SHELVES } from \".\";\n\n// Deduplicate fare brands (only show the cheapest offer within fare brand)\nexport const deduplicateMappedOffersByFareBrand = (\n offersMap: Record<string, NGSOfferRow>,\n sliceIndex?: number,\n) => {\n Object.entries(offersMap).map(([sliceKey, row]) => {\n const deduplicatedRow: NGSOfferRow = {\n slice: row.slice,\n 1: null,\n 2: null,\n 3: null,\n 4: null,\n 5: null,\n };\n NGS_SHELVES.map((shelf) => {\n if (row[shelf]) {\n deduplicatedRow[shelf] = groupByFareBrandName(row[shelf]!, sliceIndex)\n .map((offers) => getCheapestOffer(offers))\n .flat();\n }\n });\n offersMap[sliceKey] = deduplicatedRow;\n });\n return offersMap;\n};\n\nexport const getFareBrandNameForOffer = (\n offer: Omit<Offer, \"available_services\">,\n sliceIndex?: number,\n): string => {\n // Cabin class can vary within a slice across passengers and segments. Here we\n // make a list of all cabin classes present in the slice.\n const cabinClasses = offer.slices[sliceIndex || 0].segments\n .flatMap((segment) => segment.passengers)\n .reduce<OfferSliceSegmentPassenger[\"cabin_class\"][]>(\n (cabinClasses, passenger) => {\n if (cabinClasses.includes(passenger.cabin_class)) {\n return cabinClasses;\n }\n return [...cabinClasses, passenger.cabin_class];\n },\n [],\n );\n\n const fareBrandName =\n offer.slices[sliceIndex || 0].fare_brand_name || cabinClasses.join(\"/\");\n return fareBrandName\n .replace(/_/g, \" \")\n .replace(/\\b\\w/g, (c) => c.toUpperCase());\n};\n\nexport const getCheapestOffer = (offers: OfferRequest[\"offers\"]) =>\n offers.find(\n (offer) =>\n +offer.total_amount ==\n Math.min(...offers.map((offer) => +offer.total_amount)),\n )!;\n\nexport const groupByFareBrandName = (\n offers: OfferRequest[\"offers\"],\n sliceIndex?: number,\n) => {\n const groupedResult: { [key: string]: OfferRequest[\"offers\"] } =\n offers.reduce(\n (\n previous: { [key: string]: OfferRequest[\"offers\"] },\n current: Omit<Offer, \"available_services\">,\n ) => {\n const key = getFareBrandNameForOffer(current, sliceIndex);\n if (!previous[key]) {\n previous[key] = [];\n }\n\n previous[key].push(current);\n return previous;\n },\n {},\n );\n return Object.values(groupedResult);\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { OfferRequest, OfferSlice } from \"@duffel/api/types\";\nimport { NGSShelf } from \".\";\nimport { deduplicateMappedOffersByFareBrand } from \"./deduplicate-mapped-offers-by-fare-brand\";\n\nexport type NGSOfferRow = Record<\"slice\", OfferSlice> &\n Record<NonNullable<NGSShelf>, OfferRequest[\"offers\"] | null>;\n\nexport const getNGSSliceKey = (\n slice: OfferSlice,\n ownerId: string | null,\n includeFareBrand?: boolean,\n): string => {\n const flightNumbers = slice.segments\n .map((segment) => segment.marketing_carrier_flight_number)\n .join(\"-\");\n return `${ownerId}-${flightNumbers}${includeFareBrand ? `-${slice.fare_brand_name}` : \"\"}`;\n};\n\nconst filterOffersThatMatchCurrentSlice = (\n offers: OfferRequest[\"offers\"],\n previousSliceKeys: string[],\n) => {\n const filteredOffers = previousSliceKeys.length > 0 ? [] : offers;\n if (previousSliceKeys.length > 0) {\n for (const offer of offers) {\n let match = true;\n for (const [index, sliceKey] of previousSliceKeys.entries()) {\n if (\n sliceKey !==\n getNGSSliceKey(offer.slices[index], offer.owner.iata_code, true)\n ) {\n match = false;\n break;\n }\n }\n if (match) {\n filteredOffers.push(offer);\n }\n }\n }\n return filteredOffers;\n};\n\nexport const groupOffersForNGSView = (\n offers: OfferRequest[\"offers\"],\n sliceIndex: number,\n previousSliceKeys: string[],\n): NGSOfferRow[] => {\n // Only display offers where previous slices match the current selection\n const filteredOffers = filterOffersThatMatchCurrentSlice(\n offers,\n previousSliceKeys,\n );\n\n const offersMap: Record<string, NGSOfferRow> = {};\n filteredOffers.forEach((offer) => {\n if (sliceIndex > offer.slices.length) {\n throw new Error(\n \"Attempted to call `groupOffersForNGSView` with an invalid slice index\",\n );\n }\n\n const slice = offer.slices[sliceIndex];\n const sliceKey = getNGSSliceKey(slice, offer.owner.iata_code);\n\n if (slice.ngs_shelf === null) {\n throw new Error(\n \"Attempted to call `groupOffersForNGSView` with an invalid ngs_shelf\",\n );\n }\n\n if (offersMap[sliceKey]) {\n if (offersMap[sliceKey][slice.ngs_shelf]) {\n offersMap[sliceKey][slice.ngs_shelf]?.push(offer);\n } else {\n offersMap[sliceKey][slice.ngs_shelf] = [offer];\n }\n } else {\n offersMap[sliceKey] = {\n slice: offer.slices[sliceIndex],\n 1: null,\n 2: null,\n 3: null,\n 4: null,\n 5: null,\n [slice.ngs_shelf]: [offer],\n };\n }\n });\n\n return Object.values(\n deduplicateMappedOffersByFareBrand(offersMap, sliceIndex),\n );\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "export const iso8601DurationRegex =\n /P(?:([.,\\d]+)D)?T(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?/i;\n\nexport const isISO8601Duration = (durationString: string) => {\n return durationString.match(iso8601DurationRegex);\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { isISO8601Duration } from \"./isISO8601Duration\";\n\nexport function convertDurationToString(duration: string): string {\n const matches = isISO8601Duration(duration);\n if (!matches) return duration;\n\n const daysString = matches[1] && matches[1] !== \"0\" ? `${matches[1]}d` : \"\";\n const hoursString =\n matches[2] && matches[2] !== \"0\"\n ? `${matches[2].toString().padStart(2, \"0\")}h`\n : \"\";\n const minutesString =\n matches[3] && matches[3] !== \"0\"\n ? `${matches[3].toString().padStart(2, \"0\")}m`\n : \"\";\n\n return `${daysString} ${hoursString} ${minutesString}`.trim();\n}\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "export const getTimeString = (original: Date | string, locale = \"en-GB\") => {\n const date = typeof original === \"string\" ? new Date(original) : original;\n return new Intl.DateTimeFormat(locale, {\n hour: \"numeric\",\n minute: \"numeric\",\n hour12: false,\n }).format(date);\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { Icon } from \"@components/shared/Icon\";\nimport { OfferSlice } from \"@duffel/api/types\";\nimport { convertDurationToString } from \"@lib/convertDurationToString\";\nimport { getTimeString } from \"@lib/getTimeString\";\nimport { withPlural } from \"@lib/withPlural\";\nimport classNames from \"classnames\";\nimport React from \"react\";\n\nexport interface SliceSummaryProps {\n slice: OfferSlice;\n}\n\nexport const SliceSummary: React.FC<SliceSummaryProps> = ({ slice }) => {\n const firstSegment = slice.segments[0];\n const lastSegment = slice.segments[slice.segments.length - 1];\n\n const segmentsAndStops = slice.segments.flatMap((segment, index) => {\n const stops = (segment.stops || []).map((stop) => stop.airport.iata_code!);\n if (index == 0) {\n // we use origins to identify the stop, so we ignore first segment since\n // it's origin is already shown in the first `SliceSummaryTimeAndPlace`\n return stops;\n } else {\n return [segment.origin.iata_code!, ...stops];\n }\n });\n\n return (\n <div className=\"slice-summary\">\n <SliceSummaryTimeAndPlace\n time={getTimeString(firstSegment.departing_at)}\n place={firstSegment.origin.iata_code!}\n alignment=\"end\"\n />\n <SliceStopsAndDurationOverview\n duration={convertDurationToString(slice.duration!)}\n stops={segmentsAndStops}\n />\n <Icon name=\"flight\" size={20} className=\"slice-summary__plane\" />\n <SliceSummaryTimeAndPlace\n time={getTimeString(lastSegment.arriving_at)}\n place={lastSegment.destination.iata_code!}\n alignment=\"start\"\n />\n </div>\n );\n};\n\nconst SliceSummaryTimeAndPlace: React.FC<{\n time: string;\n place: string;\n alignment: \"start\" | \"end\";\n}> = ({ time, place, alignment }) => (\n <div\n className={classNames(\n \"slice-summary__time-and-place\",\n `slice-summary__time-and-place--align-${alignment}`,\n )}\n >\n <div className=\"slice-summary__time\">{time}</div>\n <div className=\"slice-summary__place\">{place}</div>\n </div>\n);\n\nconst SliceStopsAndDurationOverview: React.FC<{\n duration: string;\n stops: string[];\n}> = ({ duration, stops }) => {\n return (\n <div>\n <p className=\"slice-summary__duration\">{duration}</p>\n\n <div\n className=\"slice-summary__flight-line-container\"\n style={{\n gridTemplateColumns:\n stops.length === 0\n ? \"1fr\"\n : `auto repeat(${stops.length}, 20px auto)`,\n }}\n >\n {stops.length === 0 ? (\n <div\n className={classNames(\n \"slice-summary__flight-line-color\",\n \"slice-summary__flight-line-color--full-width\",\n )}\n />\n ) : (\n <>\n {new Array(stops.length + 1).fill(0).map((_value, index, all) => (\n <React.Fragment key={index}>\n <div className=\"slice-summary__flight-line-color\" />\n {index !== all.length - 1 && (\n <div className=\"slice-summary__flight-line-dot\" />\n )}\n </React.Fragment>\n ))}\n </>\n )}\n </div>\n\n <p className=\"slice-summary__stops\">\n {stops.length === 0\n ? \"Direct\"\n : `${withPlural(stops.length, \"stop\", \"stops\")}, ${stops.join(\", \")}`}\n </p>\n </div>\n );\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "const MS = 1000;\nconst MS_PER_MINUTE = MS * 60;\nconst MS_PER_HOUR = MS_PER_MINUTE * 60;\nconst MS_PER_DAY = MS_PER_HOUR * 24;\n\nexport function getDurationString(\n start: Date | string,\n end: Date | string,\n format?: \"long\",\n): string {\n let startDate: Date = typeof start === \"string\" ? new Date(start) : start;\n let prefix = \"\";\n\n let endDate = new Date();\n if (end) {\n if (typeof end === \"string\") {\n endDate = new Date(end);\n } else {\n endDate = end;\n }\n }\n\n // If the end date is before the start date, this usually indicates an error\n // But we still want to make sure we show that to the user nicely\n if (endDate < startDate) {\n const temp = startDate;\n startDate = endDate;\n endDate = temp;\n prefix = \"-\";\n }\n\n const diff = endDate.valueOf() - startDate.valueOf();\n\n const days = Math.floor(diff / MS_PER_DAY);\n const hours = Math.floor((diff - days * MS_PER_DAY) / MS_PER_HOUR);\n const minutes = Math.floor(\n (diff - days * MS_PER_DAY - hours * MS_PER_HOUR) / MS_PER_MINUTE,\n );\n\n let daysString = \"\";\n let hoursString = \"\";\n let minutesString = \"\";\n\n let suffix = \"\";\n\n if (format !== \"long\") {\n daysString = days ? `${days}d` : \"\";\n hoursString = hours ? `${hours.toString().padStart(2, \"0\")}h` : \"\";\n minutesString = minutes ? `${minutes.toString().padStart(2, \"0\")}m` : \"\";\n } else {\n if (days >= 1) {\n daysString = `${days}d`;\n }\n\n if (hours >= 1) {\n hoursString = `${hours.toString()}h`;\n }\n\n if (minutes >= 1) {\n minutesString = `${minutes.toString()}m`;\n }\n\n suffix = end < start ? \"earlier\" : \"later\";\n }\n\n return format !== \"long\"\n ? prefix + `${daysString} ${hoursString} ${minutesString}`.trim()\n : `${daysString} ${hoursString} ${minutesString} ${suffix}`.trim();\n}\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { Icon, IconName } from \"@components/shared/Icon\";\nimport { getSegmentCarriersTitle } from \"@components/shared/SliceCarriersTitle\";\nimport { OfferSlice as OfferSliceType } from \"@duffel/api/types\";\nimport { convertDurationToString } from \"@lib/convertDurationToString\";\nimport { getDateString } from \"@lib/getDateString\";\nimport { getDurationString } from \"@lib/getDurationString\";\nimport { getTimeString } from \"@lib/getTimeString\";\nimport { withPlural } from \"@lib/withPlural\";\nimport classNames from \"classnames\";\nimport React from \"react\";\n\nexport interface OfferSliceProps {\n slice: OfferSliceType;\n}\n\nexport const OfferSlice: React.FC<OfferSliceProps> = ({ slice }) => {\n const firstSegment = slice.segments[0];\n const lastSegment = slice.segments[slice.segments.length - 1];\n\n const startDate = getDateString(firstSegment.departing_at!, \"long\");\n const endDate = getDateString(lastSegment.departing_at!, \"long\");\n const endsOnDifferentDate = startDate != endDate;\n\n return (\n <div>\n {/* start date */}\n <OfferSliceRow\n withGreyBackground\n icon=\"calendar_month\"\n dottedLine=\"after\"\n >\n {startDate}\n </OfferSliceRow>\n\n {/* segments information */}\n {slice.segments.map((segment, index) => {\n const isLast = index === slice.segments.length - 1;\n return (\n <>\n <OfferSliceRow\n dottedLine=\"before\"\n icon=\"flight_takeoff\"\n time={getTimeString(segment.departing_at)}\n >\n Depart from {segment.origin.name} ({segment.origin.iata_code})\n </OfferSliceRow>\n\n <OfferSliceRow compact>\n {[\n convertDurationToString(segment.duration!),\n getSegmentCarriersTitle(segment),\n `${segment.marketing_carrier.iata_code}${segment.marketing_carrier_flight_number}`,\n segment.aircraft?.name,\n segment.passengers[0].cabin_class_marketing_name ||\n segment.passengers[0].cabin_class,\n ].join(\" \u00B7 \")}\n </OfferSliceRow>\n\n {segment.stops && segment.stops.length > 0 && (\n <OfferSliceRow compactCallout>\n <p>\n {withPlural(segment.stops.length, \"stop\", \"stops\")}:{\" \"}\n {segment.stops\n .map(\n (stop) =>\n `${convertDurationToString(stop.duration)} in ${stop.airport.iata_code}`,\n )\n .join(\",\")}\n </p>\n </OfferSliceRow>\n )}\n\n <OfferSliceRow\n icon=\"flight_landing\"\n time={getTimeString(segment.arriving_at)}\n >\n Arrive at {segment.destination.name} (\n {segment.destination.iata_code})\n </OfferSliceRow>\n\n {!isLast && (\n <OfferSliceRow\n dottedLine=\"both\"\n withGreyBackground\n icon=\"airline_stops\"\n >\n {getDurationString(\n segment.arriving_at,\n slice.segments[index + 1].departing_at,\n )}{\" \"}\n Layover at {segment.destination.name} (\n {segment.destination.iata_code})\n </OfferSliceRow>\n )}\n </>\n );\n })}\n\n {/* end date, if not the same */}\n {endsOnDifferentDate && (\n <OfferSliceRow\n withGreyBackground\n icon=\"calendar_month\"\n dottedLine=\"before\"\n >\n {endDate}\n </OfferSliceRow>\n )}\n </div>\n );\n};\n\ntype OfferSliceRow = React.PropsWithChildren<{\n time?: string;\n icon?: IconName;\n withGreyBackground?: boolean;\n compact?: boolean;\n compactCallout?: boolean;\n dottedLine?: \"before\" | \"after\" | \"both\";\n}>;\n\nconst OfferSliceRow: React.FC<OfferSliceRow> = ({\n time,\n icon,\n withGreyBackground,\n compact,\n dottedLine,\n compactCallout,\n children,\n}) => (\n <div\n className={classNames(\n \"offer-slice__row\",\n withGreyBackground && \"offer-slice__row--grey-background\",\n compact && \"offer-slice__row--compact\",\n compactCallout && `offer-slice__row--compact-callout`,\n )}\n >\n <div className=\"offer-slice__row-time\">{time && <span>{time}</span>}</div>\n <div\n className={classNames(\n \"offer-slice__row-icon-container\",\n !icon && \"offer-slice__row-icon-container--no-icon\",\n dottedLine && `offer-slice__row-icon-container--dotted-${dottedLine}`,\n )}\n >\n {icon && <Icon color=\"--GREY-600\" size={16} name={icon} />}\n </div>\n <div>{children}</div>\n </div>\n);\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { SliceSummary } from \"@components/DuffelNGSView/SliceSummary\";\nimport { OfferSlice, OfferSliceProps } from \"@components/OfferSlice/OfferSlice\";\nimport { Modal, ModalBody, ModalProps } from \"@components/shared/Modal\";\nimport { SliceCarriersTitle } from \"@components/shared/SliceCarriersTitle\";\nimport { VSpace } from \"@components/shared/VSpace\";\n\ninterface OfferSliceModalProps extends Pick<ModalProps, \"isOpen\" | \"onClose\"> {\n slice: OfferSliceProps[\"slice\"];\n}\n\nexport const OfferSliceModal: React.FC<OfferSliceModalProps> = ({\n slice,\n ...modalProps\n}) => {\n return (\n <Modal {...modalProps}>\n <div className=\"offer-slice-modal-title offer-slice-modal-padding\">\n Flight Details\n </div>\n <hr className=\"offer-slice-modal-divider\" />\n <ModalBody tall noPadding>\n <VSpace space={24} className=\"offer-slice-modal-padding\">\n <SliceCarriersTitle slice={slice} />\n <SliceSummary slice={slice} />\n </VSpace>\n <OfferSlice slice={slice} />\n <div className=\"offer-slice-modal-footer\" />\n </ModalBody>\n </Modal>\n );\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import * as React from \"react\";\nimport { NGSShelf, NGS_SHELF_INFO } from \"./lib\";\nimport { Icon } from \"@components/shared/Icon\";\nimport classNames from \"classnames\";\n\nexport interface NGSShelfInfoCardProps {\n ngs_shelf: NGSShelf;\n className?: string;\n}\n\nexport const NGSShelfInfoCard: React.FC<NGSShelfInfoCardProps> = ({\n ngs_shelf,\n className,\n}) => {\n if (!ngs_shelf) return null;\n const shelfInfo = NGS_SHELF_INFO[ngs_shelf];\n\n if (!shelfInfo) return null;\n\n return (\n <div className={classNames(\"ngs-shelf-info-card_container\", className)}>\n <Icon name={shelfInfo.icon} size={24} />\n <h3 className=\"ngs-shelf-info-card_title\">{shelfInfo.full_title}</h3>\n <p className=\"ngs-shelf-info-card_text\">{shelfInfo.description}</p>\n </div>\n );\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { Button } from \"@components/shared/Button\";\nimport { Icon } from \"@components/shared/Icon\";\nimport { Offer } from \"@duffel/api/types\";\nimport { moneyStringFormatter } from \"@lib/moneyStringFormatter\";\nimport classNames from \"classnames\";\nimport * as React from \"react\";\nimport { NGS_SHELF_INFO } from \"./lib\";\nimport { getFareBrandNameForOffer } from \"./lib/deduplicate-mapped-offers-by-fare-brand\";\nimport { doesSliceHaveMixedCabins } from \"./lib/does-slice-have-mixed-cabins\";\nimport { getMaxBaggagesForOfferSlice } from \"./lib/get-max-baggages-for-offer-slice\";\n\nexport interface NGSSliceFareCardProps {\n offer: Omit<Offer, \"available_services\">;\n sliceIndex: number;\n\n onSelect?: () => void;\n\n className?: string;\n}\n\nexport const NGSSliceFareCard: React.FC<NGSSliceFareCardProps> = ({\n offer,\n sliceIndex,\n onSelect,\n className,\n}) => {\n if (sliceIndex >= offer.slices.length) {\n throw new Error(\n \"Attempted to create `NGSSliceFareCard` with invalid slice index\",\n );\n }\n\n const slice = offer.slices[sliceIndex];\n const shelfInfo = NGS_SHELF_INFO[slice.ngs_shelf!];\n\n const brandName = getFareBrandNameForOffer(offer, sliceIndex);\n\n // A null property indicates the API can't provide the information for this\n // slice, so we default to using the offer condition.\n const changeBeforeDepartureCondition = slice.conditions\n .change_before_departure\n ? slice.conditions.change_before_departure\n : offer.conditions.change_before_departure;\n const refundBeforeDepartureCondition = slice.conditions\n .refund_before_departure\n ? slice.conditions.refund_before_departure\n : offer.conditions.refund_before_departure;\n\n const checkedBagItems = getMaxBaggagesForOfferSlice(slice, \"checked\");\n const carryOnBagItems = getMaxBaggagesForOfferSlice(slice, \"carry_on\");\n\n return (\n <button\n className={classNames(\"ngs-slice-fare-card_container\", className)}\n onClick={() => {\n onSelect && onSelect();\n }}\n >\n <div>\n <div className=\"ngs-slice-fare-card_header\">\n <div>\n <span>{shelfInfo.short_title}</span>\n <h4 className=\"ngs-slice-fare-card_title\">{brandName}</h4>\n {doesSliceHaveMixedCabins(slice) && (\n <div className=\"ngs-slice-fare-card_mixed-cabins margin-t-8\">\n <Icon name=\"info_outline\" size={12} />\n Multiple cabins\n <div className=\"ngs-slice-fare-card_mixed-cabins-popover\">\n {slice.segments.map((segment, index) => (\n <p key={`slice_${index}`}>\n {segment.origin.iata_code} \u2192{\" \"}\n {segment.destination.iata_code}\n <span className=\"margin-x-12\">|</span>\n {segment.passengers[0].cabin_class_marketing_name}\n </p>\n ))}\n </div>\n </div>\n )}\n </div>\n <Icon name={shelfInfo.icon} color=\"--GREY-900\" />\n </div>\n <div>\n {changeBeforeDepartureCondition && (\n <div className=\"ngs-slice-fare-card_item\">\n <Icon\n name={\n changeBeforeDepartureCondition.allowed\n ? \"currency_exchange\"\n : \"close\"\n }\n color=\"--GREY-600\"\n size={20}\n />\n Changeable\n {changeBeforeDepartureCondition.allowed &&\n changeBeforeDepartureCondition.penalty_currency &&\n changeBeforeDepartureCondition.penalty_amount\n ? ` (${moneyStringFormatter(\n changeBeforeDepartureCondition.penalty_currency,\n )(+changeBeforeDepartureCondition.penalty_amount)})`\n : \"\"}\n </div>\n )}\n {refundBeforeDepartureCondition && (\n <div className=\"ngs-slice-fare-card_item\">\n <Icon\n name={\n refundBeforeDepartureCondition.allowed\n ? \"airplane_ticket\"\n : \"close\"\n }\n color=\"--GREY-600\"\n size={20}\n />\n Refundable\n {refundBeforeDepartureCondition.allowed &&\n refundBeforeDepartureCondition.penalty_currency &&\n refundBeforeDepartureCondition.penalty_amount\n ? ` (${moneyStringFormatter(\n refundBeforeDepartureCondition.penalty_currency,\n )(+refundBeforeDepartureCondition.penalty_amount)})`\n : \"\"}\n </div>\n )}\n <div className=\"ngs-slice-fare-card_item\">\n <Icon\n name={carryOnBagItems.length > 0 ? \"shopping_bag\" : \"close\"}\n color=\"--GREY-600\"\n size={20}\n />\n Carry-on bag\n </div>\n <div className=\"ngs-slice-fare-card_item\">\n <Icon\n name={checkedBagItems.length > 0 ? \"luggage\" : \"close\"}\n color=\"--GREY-600\"\n size={20}\n />\n Checked bag\n </div>\n {slice.conditions.advance_seat_selection !== null && (\n <div className=\"ngs-slice-fare-card_item\">\n <Icon\n name={\n slice.conditions.advance_seat_selection\n ? \"check_small\"\n : \"close\"\n }\n color=\"--GREY-600\"\n size={20}\n />\n Seat selection\n </div>\n )}\n {slice.conditions.priority_boarding !== null && (\n <div className=\"ngs-slice-fare-card_item\">\n <Icon\n name={\n slice.conditions.priority_boarding ? \"check_small\" : \"close\"\n }\n color=\"--GREY-600\"\n size={20}\n />\n Priority boarding\n </div>\n )}\n {slice.conditions.priority_check_in !== null && (\n <div className=\"ngs-slice-fare-card_item\">\n <Icon\n name={\n slice.conditions.priority_check_in ? \"check_small\" : \"close\"\n }\n color=\"--GREY-600\"\n size={20}\n />\n Priority check-in\n </div>\n )}\n </div>\n </div>\n <div className=\"ngs-slice-fare-card_footer\">\n <span className=\"ngs-slice-fare-card_price\">\n {moneyStringFormatter(offer.total_currency)(+offer.total_amount)}\n </span>\n <div>\n <Button size={32} className=\"ngs-slice-fare-card_button\">\n Select\n </Button>\n </div>\n </div>\n </button>\n );\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { OfferRequest, OfferSlice } from \"@duffel/api/types\";\n\nexport function doesSliceHaveMixedCabins(slice: OfferSlice) {\n const cabinMarketingNames = new Set<string>();\n for (const segment of slice.segments) {\n cabinMarketingNames.add(segment.passengers[0].cabin_class_marketing_name);\n }\n\n return cabinMarketingNames.size > 1;\n}\n\nexport function doOffersHaveMixedCabin(\n offer: OfferRequest[\"offers\"] | null,\n sliceIndex: number = 0,\n) {\n if (offer === null) {\n return false;\n }\n\n return offer.some((offer) =>\n doesSliceHaveMixedCabins(offer.slices[sliceIndex]),\n );\n}\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import {\n OfferAvailableServiceBaggageMetadata,\n OfferSlice,\n OfferSliceSegmentPassenger,\n} from \"@duffel/api/types\";\n\nconst getBaggagesQuantity = (\n baggages: OfferSliceSegmentPassenger[\"baggages\"],\n type: OfferAvailableServiceBaggageMetadata[\"type\"],\n): number => {\n return baggages\n .filter((baggage) => baggage.type === type)\n .reduce((quantity, baggage) => {\n return quantity + baggage.quantity;\n }, 0);\n};\n\n/**\n * Returns the passenger baggages object with the largest quantity of baggages\n * of a specified type for a slice. Baggage quantity can (very occasionally)\n * vary across passengers and segments in a slice, so the 'max' baggages can\n * be used as the baseline for a slice.\n */\nexport const getMaxBaggagesForOfferSlice = (\n offerSlice: OfferSlice,\n type: OfferAvailableServiceBaggageMetadata[\"type\"],\n): OfferSliceSegmentPassenger[\"baggages\"] => {\n let maxBaggages = offerSlice.segments[0].passengers[0].baggages.filter(\n (baggage) => baggage.type === type,\n );\n let maxBaggagesQuantity = getBaggagesQuantity(maxBaggages, type);\n\n offerSlice.segments.forEach((segment) => {\n segment.passengers\n .filter((passenger) => passenger.baggages.length > 0)\n .forEach((passenger) => {\n const baggagesQuantity = getBaggagesQuantity(passenger.baggages, type);\n\n if (baggagesQuantity > maxBaggagesQuantity) {\n maxBaggages = passenger.baggages;\n maxBaggagesQuantity = getBaggagesQuantity(maxBaggages, type);\n }\n });\n });\n\n // The API will always return a checked baggage item even if the quantity is\n // 0, so here we filter them out\n return maxBaggages.filter((baggages) => baggages.quantity > 0);\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { OfferRequest } from \"@duffel/api/types\";\nimport { NGSShelf } from \".\";\nimport { NGSOfferRow } from \"./group-offers-for-ngs-view\";\n\nexport type SortDirection = \"asc\" | \"desc\";\n\nexport const getCheapestOfferAmount = (\n offers: OfferRequest[\"offers\"] | null,\n) => (offers ? Math.min(...offers.map((offer) => +offer.total_amount)) : null);\n\nexport const sortNGSRowsByShelfPrice = (\n rows: NGSOfferRow[],\n sortShelf: NGSShelf,\n sortDirection: SortDirection,\n): NGSOfferRow[] => {\n const sortedRows = [...rows].sort((a, b) => {\n const aAmount = +(getCheapestOfferAmount(a[sortShelf!]) || 0);\n const bAmount = +(getCheapestOfferAmount(b[sortShelf!]) || 0);\n if (aAmount && bAmount) {\n return sortDirection === \"asc\" ? aAmount - bAmount : bAmount - aAmount;\n }\n if (aAmount) return -1;\n if (bAmount) return 1;\n return 0;\n });\n\n return sortedRows;\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { NGSOfferRow } from \"./group-offers-for-ngs-view\";\nimport { parse, toMinutes } from \"duration-fns\";\n\ntype DurationSortDirection = \"asc\" | \"desc\";\nexport type DurationSort = DurationSortDirection | null;\n\nexport const sortNGSRowsByDuration = (\n rows: NGSOfferRow[],\n sortDirection: DurationSortDirection,\n): NGSOfferRow[] =>\n rows.sort((aRow, bRow) => {\n if (aRow.slice.duration === null || bRow.slice.duration === null) return 0;\n\n const aParsedDuration = parse(aRow.slice.duration);\n const bParsedDuration = parse(bRow.slice.duration);\n\n const aDurationInMinutes = toMinutes(aParsedDuration);\n const bDurationInMinutes = toMinutes(bParsedDuration);\n\n if (sortDirection === \"asc\") {\n return aDurationInMinutes - bDurationInMinutes;\n } else {\n return bDurationInMinutes - aDurationInMinutes;\n }\n });\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { useState } from \"react\";\nimport { Filters, filterResults } from \"./filter-results\";\nimport { OfferRequest } from \"@duffel/api/types\";\nimport { getInitialFilterValues } from \"./get-initial-filter-values\";\n\nexport function useFilters(\n offerRequest: OfferRequest,\n selectedSliceKeys: string[],\n) {\n const initialFilterValues = getInitialFilterValues(offerRequest);\n\n const [airlinesFilter, setAirlinesFilter] = useState<Filters[\"airlines\"]>(\n initialFilterValues.airlines,\n );\n\n const [timesFilter, setTimesFilter] = useState<Filters[\"times\"]>(\n initialFilterValues.times,\n );\n\n const [stopsFilter, setStopsFilter] = useState<Filters[\"stops\"]>(\n initialFilterValues.stops,\n );\n\n function clearFilters() {\n setAirlinesFilter(initialFilterValues.airlines);\n setTimesFilter(initialFilterValues.times);\n setStopsFilter(initialFilterValues.stops);\n }\n\n const filteredOffers = filterResults(\n offerRequest.offers,\n selectedSliceKeys.length > 0 ? selectedSliceKeys.length : 0,\n {\n airlines: airlinesFilter,\n times: timesFilter,\n stops: stopsFilter,\n },\n );\n\n return {\n airlinesFilterOptions: initialFilterValues.airlines,\n airlinesFilter,\n timesFilter,\n stopsFilter,\n setAirlinesFilter,\n setTimesFilter,\n setStopsFilter,\n clearFilters,\n filteredOffers,\n };\n}\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { OfferSlice } from \"@duffel/api/types\";\nimport { NGSTableProps } from \"../NGSTable\";\n\nexport interface Filters {\n airlines: Array<{ iata_code: string; name: string }>;\n stops: \"direct-only\" | \"1-stop-at-most\" | \"2-stops-at-most\" | \"any\";\n times: {\n departure: [number, number];\n arrival: [number, number];\n };\n}\n\nexport function filterResults(\n offers: NGSTableProps[\"offers\"],\n currentSliceIndex: number,\n filters: Filters,\n) {\n return offers.filter((offer) => {\n const currentOfferSlice = offer.slices[currentSliceIndex];\n return [\n isMatchOnAirlines(offer, filters.airlines) &&\n isMatchOnStops(currentOfferSlice, filters.stops) &&\n isMatchOnTimes(currentOfferSlice, filters.times),\n ].every((isTrue) => isTrue);\n });\n}\nfunction isMatchOnAirlines(\n offer: NGSTableProps[\"offers\"][number],\n airlines: Filters[\"airlines\"],\n) {\n return airlines.some(\n (airline) => offer.owner.iata_code === airline.iata_code,\n );\n}\n\nfunction isMatchOnStops(\n currentOfferSlice: OfferSlice,\n stops: Filters[\"stops\"],\n) {\n const sliceStops =\n currentOfferSlice.segments.length -\n 1 +\n currentOfferSlice.segments.reduce(\n (stopCount, segment) => stopCount + (segment.stops?.length || 0),\n 0,\n );\n\n switch (stops) {\n case \"direct-only\":\n return sliceStops === 0;\n case \"1-stop-at-most\":\n return sliceStops <= 1;\n case \"2-stops-at-most\":\n return sliceStops <= 2;\n case \"any\":\n return true;\n }\n}\n\nfunction isMatchOnTimes(\n currentOfferSlice: OfferSlice,\n times: Filters[\"times\"],\n) {\n const firstSegment = currentOfferSlice.segments[0];\n const lastSegment =\n currentOfferSlice.segments[currentOfferSlice.segments.length - 1];\n\n const sliceDepartureTime = new Date(firstSegment.departing_at);\n const sliceArrivalTime = new Date(lastSegment.arriving_at);\n\n const [departureRangeStart, departureRangeEnd] = times.departure;\n const [arrivalRangeStart, arrivalRangeEnd] = times.arrival;\n\n const sliceDepartureTimeInMinutes =\n transformDateToMinutes(sliceDepartureTime);\n\n const sliceArrivalTimeInMinutes = transformDateToMinutes(sliceArrivalTime);\n\n return (\n sliceDepartureTimeInMinutes >= departureRangeStart &&\n sliceDepartureTimeInMinutes <= departureRangeEnd &&\n sliceArrivalTimeInMinutes >= arrivalRangeStart &&\n sliceArrivalTimeInMinutes <= arrivalRangeEnd\n );\n}\n\nfunction transformDateToMinutes(date: Date) {\n return date.getHours() * 60 + date.getMinutes();\n}\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { OfferRequest } from \"@duffel/api/types\";\nimport { Filters } from \"./filter-results\";\n\nexport function getAirlines(offerRequest: OfferRequest): Filters[\"airlines\"] {\n const airlines: Filters[\"airlines\"] = [];\n const insertedAirlines = new Set<string>();\n\n for (const offer of offerRequest.offers) {\n const owner = offer.owner;\n if (owner.iata_code === null) continue;\n\n if (!insertedAirlines.has(owner.iata_code)) {\n airlines.push({\n iata_code: owner.iata_code,\n name: owner.name,\n });\n insertedAirlines.add(owner.iata_code);\n }\n }\n return airlines.sort((a, b) => a.name.localeCompare(b.name));\n}\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { OfferRequest } from \"@duffel/api/booking/OfferRequests/OfferRequestsTypes\";\nimport { Filters } from \"./filter-results\";\nimport { getAirlines } from \"./getAirlines\";\n\nexport function getInitialFilterValues(offerRequest: OfferRequest): Filters {\n return {\n airlines: getAirlines(offerRequest),\n stops: \"any\",\n times: {\n departure: [0, 1440],\n arrival: [0, 1440],\n },\n };\n}\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import React from \"react\";\nimport { FilterControl, FilterControlOption } from \"./FilterControl\";\n\nconst OPTIONS = {\n \"duration-asc\": \"Duration Shortest to Longest\",\n \"duration-desc\": \"Duration Longest to Shortest\",\n\n \"1-asc\": \"Price (Basic) Low to High\",\n \"1-desc\": \"Price (Basic) High to Low\",\n\n \"2-asc\": \"Price (Standard) Low to High\",\n \"2-desc\": \"Price (Standard) High to Low\",\n\n \"3-asc\": \"Price (Plus) Low to High\",\n \"3-desc\": \"Price (Plus) High to Low\",\n\n \"4-asc\": \"Price (Premium) Low to High\",\n \"4-desc\": \"Price (Premium) High to Low\",\n\n \"5-asc\": \"Price (Luxury) Low to High\",\n \"5-desc\": \"Price (Luxury) High to Low\",\n\n recommended: \"Recommended\",\n} as const;\n\nexport type SortOption = keyof typeof OPTIONS;\n\nconst OPTION_KEYS = Object.keys(OPTIONS) as SortOption[];\n\nfunction getLabel(stopsOption: SortOption) {\n return OPTIONS[stopsOption];\n}\n\ninterface StopsSelectorProps {\n selected: SortOption;\n onChange: (stopFilter: SortOption) => void;\n}\n\nexport const SortingControl: React.FC<StopsSelectorProps> = ({\n selected,\n onChange,\n}) => {\n return (\n <FilterControl\n target={`Sort by: ${getLabel(selected)}`}\n popoverWidth={\"300px\"}\n targetWidth=\"285px\"\n >\n {(onClose) =>\n OPTION_KEYS.map((option, index) => (\n <FilterControlOption\n isSelected={option === selected}\n key={option}\n onClick={() => {\n onChange(option);\n onClose();\n }}\n onKeyDown={(e) => {\n if (\n e.key === \"Escape\" ||\n (e.key === \"Tab\" && index === OPTION_KEYS.length - 1)\n ) {\n onClose();\n }\n }}\n >\n <span>{getLabel(option)}</span>\n </FilterControlOption>\n ))\n }\n </FilterControl>\n );\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { NGSOfferRow } from \"./group-offers-for-ngs-view\";\nimport { parse, toMinutes } from \"duration-fns\";\nimport { getCheapestOfferAmount } from \"./sort-ngs-rows-by-shelf-price\";\n\nconst getAmountForRecommendedSort = (row: NGSOfferRow): number => {\n // Use cheapest fare in the standard shelf if it exists\n if (row[2] && row[2].length > 0) return getCheapestOfferAmount(row[2])!;\n // If it doesn\u2019t exist use the price of the shelf above (and do this until there are no shelves left to use).\n if (row[3] && row[3].length > 0) return getCheapestOfferAmount(row[3])!;\n if (row[4] && row[4].length > 0) return getCheapestOfferAmount(row[4])!;\n if (row[5] && row[5].length > 0) return getCheapestOfferAmount(row[5])!;\n // If there is nothing in shelf 2-5 then use shelf 1 but with 2 * the price.\n return 2 * (getCheapestOfferAmount(row[1]) || 0);\n};\n\n// Sort by the product of the duration and the price of the cheapest fare in the standard shelf (ideally)\nexport const sortNGSRowsByRecommended = (rows: NGSOfferRow[]): NGSOfferRow[] =>\n rows.sort((aRow, bRow) => {\n if (aRow.slice.duration === null || bRow.slice.duration === null) return 0;\n\n const aParsedDuration = parse(aRow.slice.duration);\n const bParsedDuration = parse(bRow.slice.duration);\n\n const aDurationInMinutes = toMinutes(aParsedDuration);\n const bDurationInMinutes = toMinutes(bParsedDuration);\n\n const aCheapestOfferAmount = getAmountForRecommendedSort(aRow);\n const bCheapestOfferAmount = getAmountForRecommendedSort(bRow);\n\n const aProduct = aDurationInMinutes * aCheapestOfferAmount;\n const bProduct = bDurationInMinutes * bCheapestOfferAmount;\n\n return aProduct - bProduct;\n });\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import * as React from \"react\";\nimport { getIFrameEventListener } from \"./lib/getIFrameEventListener\";\nimport { getIframeURL } from \"./lib/getIframeURL\";\nimport { postMessageToCreateCardForTemporaryUse } from \"./lib/postMessageToCreateCardForTemporaryUse\";\nimport { postMessageToSaveCard } from \"./lib/postMessageToSaveCard\";\nimport { postMessageWithStyles } from \"./lib/postMessageWithStyles\";\nimport { DuffelCardFormProps } from \"./lib/types\";\nimport { DuffelCardFormActions } from \"./lib/useDuffelCardFormActions\";\n\nexport const DuffelCardForm = React.forwardRef<\n DuffelCardFormActions,\n DuffelCardFormProps\n>(\n (\n {\n tokenProxyEnvironment = \"production\",\n clientKey,\n styles,\n intent,\n savedCardData,\n onValidateSuccess,\n onValidateFailure,\n onCreateCardForTemporaryUseSuccess,\n onCreateCardForTemporaryUseFailure,\n onSaveCardSuccess,\n onSaveCardFailure,\n onSecurityPolicyViolation,\n },\n ref,\n ) => {\n // Validates required props\n if (!clientKey) {\n throw new Error(\n \"Attempted to render `DuffelCardForm` without a clientKey.\",\n );\n }\n if (!intent) {\n throw new Error(\n \"Attempted to render `DuffelCardForm` without an `intent`. Make sure your provide one of the following: `create-card-for-temporary-use`, `save-card`, `use-saved-card`.\",\n );\n }\n if (intent == \"to-use-saved-card\" && !savedCardData) {\n throw new Error(\n \"Attempted to render `DuffelCardForm`to use a saved card but the `cardId` prop is missing. Make sure you provide the id of the saved card you'd like to use.\",\n );\n }\n\n // Post message with ref functions\n React.useImperativeHandle(\n ref,\n () => {\n return {\n saveCard: () => postMessageToSaveCard(iFrameReference, iFrameURL),\n createCardForTemporaryUse: () =>\n postMessageToCreateCardForTemporaryUse(iFrameReference, iFrameURL),\n };\n },\n [],\n );\n\n const intentsToUseSavedCard = intent === \"to-use-saved-card\";\n const defaultIframeHeight = intentsToUseSavedCard ? \"68px\" : \"838px\";\n\n // Component state\n // 838px is the height of the iframe content without any styles applied.\n // Setting it to this height, prevents a big jump in height once the iframe is loaded.\n const [iFrameHeight, setIFrameHeight] = React.useState(defaultIframeHeight);\n const [isLoading, setIsLoading] = React.useState(true);\n const iFrameReference = React.useRef<HTMLIFrameElement>(null);\n\n // Sets the iframe src\n const iFrameURL = getIframeURL(\n tokenProxyEnvironment,\n intent,\n clientKey,\n savedCardData,\n );\n\n // Register event listeners to the window to listen to messages from the iframe.\n React.useEffect(() => {\n const iFrameEventListener = getIFrameEventListener(iFrameURL, {\n postMessageWithStyles: () => {\n postMessageWithStyles(iFrameReference, iFrameURL, styles);\n },\n setIFrameHeight: (height: number) => {\n setIFrameHeight(`${height}px`);\n setIsLoading(false);\n },\n onValidateSuccess,\n onValidateFailure,\n onCreateCardForTemporaryUseSuccess,\n onCreateCardForTemporaryUseFailure,\n onSaveCardSuccess,\n onSaveCardFailure,\n onSecurityPolicyViolation,\n });\n\n window.addEventListener(\"message\", iFrameEventListener);\n return () => window.removeEventListener(\"message\", iFrameEventListener);\n }, []);\n\n return (\n <>\n {isLoading && (\n <div\n style={{\n height: iFrameHeight,\n width: \"100%\",\n fontFamily: \"inherit\",\n padding: \"1rem\",\n gap: \"8px\",\n display: \"flex\",\n justifyContent: intentsToUseSavedCard ? \"flex-start\" : \"center\",\n alignItems: \"center\",\n }}\n >\n <img\n height=\"20px\"\n src=\"https://assets.duffel.com/img/spinner.gif\"\n alt=\"spinner\"\n />\n <span>Preparing payment...</span>\n </div>\n )}\n <iframe\n ref={iFrameReference}\n title=\"Card Payment Form\"\n src={iFrameURL.href}\n style={{\n width: \"100%\",\n border: \"none\",\n height: iFrameHeight,\n visibility: isLoading ? \"hidden\" : \"visible\",\n position: isLoading ? \"absolute\" : \"static\",\n pointerEvents: isLoading ? \"none\" : \"auto\",\n }}\n />\n </>\n );\n },\n);\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { DuffelCardFormProps } from \"./types\";\n\ntype Inputs = {\n setIFrameHeight: (height: number) => void;\n postMessageWithStyles: () => void;\n} & Pick<\n DuffelCardFormProps,\n | \"onValidateSuccess\"\n | \"onValidateFailure\"\n | \"onCreateCardForTemporaryUseSuccess\"\n | \"onCreateCardForTemporaryUseFailure\"\n | \"onSaveCardSuccess\"\n | \"onSaveCardFailure\"\n | \"onSecurityPolicyViolation\"\n>;\n\nexport function getIFrameEventListener(\n iFrameURL: URL,\n {\n postMessageWithStyles,\n setIFrameHeight,\n onValidateSuccess,\n onValidateFailure,\n onCreateCardForTemporaryUseSuccess,\n onCreateCardForTemporaryUseFailure,\n onSaveCardSuccess,\n onSaveCardFailure,\n onSecurityPolicyViolation,\n }: Inputs,\n) {\n return function iFrameEventListener(event: MessageEvent) {\n if (\n !iFrameURL.origin?.startsWith(event.origin) ||\n !event.data ||\n !event.data.type\n ) {\n return;\n }\n\n const eventType = event?.data?.type;\n\n switch (eventType) {\n case \"iframe-loaded\":\n postMessageWithStyles();\n return;\n\n case \"content-height-ready\":\n setIFrameHeight(event.data.height);\n return;\n\n case \"validate-success\":\n if (onValidateSuccess) {\n onValidateSuccess();\n } else {\n console.warn(\"`onValidateSuccess` not implemented\");\n }\n return;\n\n case \"validate-failure\":\n if (onValidateFailure) {\n onValidateFailure();\n } else {\n console.warn(\"`onValidateFailure` not implemented\");\n }\n return;\n\n case \"create-card-for-temporary-use-success\":\n if (onCreateCardForTemporaryUseSuccess) {\n onCreateCardForTemporaryUseSuccess(event.data.data);\n } else {\n console.warn(\"`onCreateCardForTemporaryUseSuccess` not implemented\");\n }\n return;\n\n case \"create-card-for-temporary-use-failure\":\n if (onCreateCardForTemporaryUseFailure) {\n onCreateCardForTemporaryUseFailure(event.data.error);\n } else {\n console.warn(\"`onCreateCardForTemporaryUseFailure` not implemented\");\n }\n return;\n\n case \"save-card-success\":\n if (onSaveCardSuccess) {\n onSaveCardSuccess(event.data.data);\n } else {\n console.warn(\"`onSaveCardSuccess` not implemented\");\n }\n return;\n\n case \"save-card-failure\":\n if (onSaveCardFailure) {\n onSaveCardFailure(event.data.error);\n } else {\n console.warn(\"`onSaveCardFailure` not implemented\");\n }\n return;\n\n case \"security-policy-violation\":\n if (onSecurityPolicyViolation) {\n onSecurityPolicyViolation(event.data.data);\n } else {\n console.warn(\"`onSecurityPolicyViolation` not implemented\");\n }\n return;\n\n case \"load\":\n return;\n\n default:\n // eslint-disable-next-line\n console.log(`Unknown event type: ${eventType}`);\n return;\n }\n };\n}\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { DuffelCardFormProps } from \"./types\";\n\nexport function getIFrameOriginForEnvironment(\n tokenProxyEnvironment: DuffelCardFormProps[\"tokenProxyEnvironment\"],\n): string {\n let origin = \"https://api.duffel.cards\";\n if (tokenProxyEnvironment === \"staging\") {\n origin = \"https://api.staging.duffel.cards\";\n } else if (tokenProxyEnvironment === \"development\") {\n origin = \"https://localhost:8000\";\n }\n\n return origin;\n}\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { DuffelCardFormIntent } from \"./types\";\n\nexport function getPathnameForIntent(intent: DuffelCardFormIntent): string {\n switch (intent) {\n case \"to-use-saved-card\":\n return `/vault/use_saved_card`;\n case \"to-save-card\":\n return `/vault/save_card`;\n case \"to-create-card-for-temporary-use\":\n return `/vault/create_card_for_temporary_use`;\n default:\n if (!intent) {\n throw new Error(\n \"Attempted to call `getPathnameForIntent` without an intent.\",\n );\n } else {\n throw new Error(\n `Attempted to call \\`getPathnameForIntent\\` but the intent \"${intent}\" is unknown.`,\n );\n }\n }\n}\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "export function getTokenFromClientKey(clientKey: string): string {\n if (!clientKey) throw new Error(\"The client key is missing.\");\n\n if (clientKey.split(\".\").length !== 3) {\n throw new Error(\n \"Invalid clientKey attribute in DuffelCardForm. It must be a valid JWT.\",\n );\n }\n\n const payloadString = clientKey.split(\".\")[1];\n\n try {\n const payload = JSON.parse(atob(payloadString));\n return payload.token;\n } catch (error) {\n throw new Error(\n \"Invalid clientKey attribute in DuffelCardForm. It was not possible to read the payload.\",\n );\n }\n}\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { getIFrameOriginForEnvironment } from \"./getIFrameOriginForEnvironment\";\nimport { getPathnameForIntent } from \"./getPathnameForIntent\";\nimport { getTokenFromClientKey } from \"./getTokenFromClientKey\";\nimport { DuffelCardFormProps } from \"./types\";\n\nexport function getIframeURL(\n tokenProxyEnvironment: DuffelCardFormProps[\"tokenProxyEnvironment\"],\n intent: DuffelCardFormProps[\"intent\"],\n clientKey: DuffelCardFormProps[\"clientKey\"],\n savedCardData: DuffelCardFormProps[\"savedCardData\"],\n) {\n const iFrameOrigin = getIFrameOriginForEnvironment(tokenProxyEnvironment);\n const iframeURL = new URL(iFrameOrigin);\n\n iframeURL.pathname = getPathnameForIntent(intent);\n\n iframeURL.searchParams.set(\"token\", getTokenFromClientKey(clientKey));\n\n if (savedCardData) {\n iframeURL.searchParams.set(\"card_id\", savedCardData.id);\n iframeURL.searchParams.set(\"card_brand\", savedCardData.brand);\n }\n\n return iframeURL;\n}\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "export function postMessageToCreateCardForTemporaryUse(\n iFrameReference: React.RefObject<HTMLIFrameElement>,\n baseUrl: URL,\n) {\n if (!iFrameReference.current) {\n throw new Error(\n \"Attempted to call `postMessageToStoreCardForTemporaryUse` with empty iFrameReference\",\n );\n }\n\n const iFrame = iFrameReference.current;\n if (!iFrame.contentWindow) {\n throw new Error(\n \"Attempted to call `postMessageToStoreCardForTemporaryUse` but the iFrame contentWindow is null\",\n );\n }\n\n iFrame.contentWindow.postMessage(\n { type: \"create-card-for-temporary-use\" },\n baseUrl.origin,\n );\n}\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "export function postMessageToSaveCard(\n iFrameReference: React.RefObject<HTMLIFrameElement>,\n baseUrl: URL,\n) {\n if (!iFrameReference.current) {\n throw new Error(\n \"Attempted to call `postMessageToSaveCard` with empty iFrameReference\",\n );\n }\n\n const iFrame = iFrameReference.current;\n if (!iFrame.contentWindow) {\n throw new Error(\n \"Attempted to call `postMessageToSaveCard` but the iFrame contentWindow is null\",\n );\n }\n\n iFrame.contentWindow.postMessage({ type: \"save-card\" }, baseUrl.origin);\n}\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { DuffelCardFormStyles } from \"./types\";\n\nexport function postMessageWithStyles(\n iFrameReference: React.RefObject<HTMLIFrameElement>,\n baseUrl: URL,\n styles: DuffelCardFormStyles | undefined,\n) {\n if (!iFrameReference.current) {\n throw new Error(\n \"Attempted to call `postMessageWithStyles` with empty iFrameReference\",\n );\n }\n\n const iFrame = iFrameReference.current;\n if (!iFrame.contentWindow) {\n throw new Error(\n \"Attempted to call `postMessageWithStyles` but the iFrame contentWindow is null\",\n );\n }\n\n iFrame.contentWindow.postMessage(\n { type: \"apply-styles\", styles },\n baseUrl.origin,\n );\n}\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import React from \"react\";\n\nexport interface DuffelCardFormActions {\n saveCard: () => void;\n createCardForTemporaryUse: () => void;\n}\n\nexport interface UseDuffelCardFormActionsHook {\n /**\n * The ref you should pass to the DuffelCardForm component.\n */\n ref: React.RefObject<DuffelCardFormActions>;\n\n /**\n * Call this function to tell the component to save the card.\n */\n saveCard: () => void;\n\n /**\n * Call this function to tell the component to create a card for temporary use.\n */\n createCardForTemporaryUse: () => void;\n}\n\n/**\n * This hook abstracts the ref for convenience and readability.\n * Add `ref` to the `DuffelCardForm` `ref` prop and call the functions to trigger the actions you'd like.\n */\nexport function useDuffelCardFormActions(): UseDuffelCardFormActionsHook {\n const ref = React.useRef<DuffelCardFormActions>(null);\n\n return {\n ref,\n saveCard: () => {\n if (ref.current) {\n ref.current.saveCard();\n } else {\n console.warn(\"Attempted to save card, but ref is null\");\n }\n },\n createCardForTemporaryUse: () => {\n if (ref.current) {\n ref.current.createCardForTemporaryUse();\n } else {\n console.warn(\n \"Attempted to create card for temporary use, but ref is null\",\n );\n }\n },\n };\n}\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "type ThreeDSSessionStatus =\n | \"client_action_required\"\n | \"ready_for_payment\"\n | \"expired\"\n | \"failed\";\n\nexport interface ThreeDSecureSession {\n /**\n * The card ID used for the 3DS session.\n */\n id: string;\n\n /**\n * Whether the 3DS session was created in live mode. This field will be set to `true` if the card was created in live mode, or `false` if it was created in test mode.\n */\n live_mode: boolean;\n\n /**\n * The resource (offer, order, order change..) ID that the 3DS session is for.\n */\n resource_id: string;\n\n /**\n * The status of the 3DS session.\n * - `client_action_required` - The 3DS session requires the UI Component to be initailised. This is the initial state when the payment is eligible for SCA and requires a 3DS challenge.\n * - `ready_for_payment` - The 3DS session is ready to be used on a payment object as part of a order creation/payment request. This is the initial state if the card or the supplier does not support 3DS.\n * - `failed` - The 3DS session was not authenticated to proceed with the payment. Payment should not be attempted. Cardholder should try again, possibly with a different card. Additionally, this is the initial state if the cardholder details are invalid.\n * - `expired` - The 3DS session has expired. A new session should be created if needed.\n */\n status: ThreeDSSessionStatus;\n\n /**\n * Used to initiate the UI component when `status` is `challenge_required`.\n */\n client_id: string | null;\n}\n\nconst getAPIHeaders = (clientKey: string) => ({\n \"Duffel-Version\": \"v2\",\n \"Content-Type\": \"application/json\",\n Authorization: `Bearer ${clientKey}`,\n \"User-Agent\": `Duffel/three-d-secure-function@${process.env.COMPONENT_VERSION}`,\n});\n\ninterface Service {\n id: string;\n quantity: number;\n}\n\ninterface create3DSSessionPayload {\n card_id: string;\n resource_id: string;\n services?: Array<Service>;\n cardholder_present: boolean | null;\n exception: string;\n}\n\nexport const createClient = (duffelUrl: string, clientKey: string) => {\n const create3DSSessionInDuffelAPI = async (\n data: create3DSSessionPayload,\n ): Promise<ThreeDSecureSession> => {\n const response = await fetch(`${duffelUrl}/three_d_secure_sessions`, {\n method: \"POST\",\n headers: getAPIHeaders(clientKey),\n body: JSON.stringify({ data }),\n });\n\n const responseData = await response.json();\n if (response.status !== 201) {\n throw responseData;\n }\n\n return responseData[\"data\"];\n };\n\n const refresh3DSSessionInDuffelAPI = async (\n sessionID: string,\n isFirstAttempt = true,\n ): Promise<ThreeDSecureSession> => {\n const response = await fetch(\n `${duffelUrl}/three_d_secure_sessions/${sessionID}/actions/refresh`,\n {\n method: \"POST\",\n headers: getAPIHeaders(clientKey),\n },\n );\n\n const responseData = await response.json();\n if (response.status >= 500) {\n if (!isFirstAttempt) {\n throw responseData;\n } else {\n return refresh3DSSessionInDuffelAPI(sessionID, false);\n }\n }\n\n return responseData[\"data\"];\n };\n\n return { create3DSSessionInDuffelAPI, refresh3DSSessionInDuffelAPI };\n};\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "export function initEvervault(\n sessionID: string,\n teamID: string,\n appID: string,\n) {\n // @ts-expect-error - We don't have Evervault defined as it comes from a CDN and types are not available.\n const evervault = new Evervault(teamID, appID);\n const threeDSecure = evervault.ui.threeDSecure(sessionID);\n threeDSecure.mount();\n return threeDSecure;\n}\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "const SCRIPT_ID = \"evervault-script\";\n\nexport function loadEvervaultScript(): Promise<void> {\n return new Promise((resolve) => {\n // check if it's loaded. If it is, don't load it again\n if (document.getElementById(SCRIPT_ID)) return resolve();\n\n const script = document.createElement(\"script\");\n script.id = SCRIPT_ID;\n script.type = \"text/javascript\";\n script.src = \"https://js.evervault.com/v2\";\n script.onload = () => {\n console.log(\"Evervault script loaded\");\n resolve();\n };\n\n document.body.appendChild(script);\n });\n}\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { ThreeDSecureSession, createClient } from \"./client\";\nimport { initEvervault } from \"./initEvervault\";\nimport { loadEvervaultScript } from \"./loadEvervaultScript\";\n\nconst DEFAULT_ENVIRONMENT_CONFIGURATION = {\n duffelUrl: \"https://api.duffel.com\",\n evervaultCredentials: {\n teamID: \"team_a22f3ea22207\",\n appID: \"app_d1d607aedf2d\",\n },\n};\n\nconst TEST_ENVIRONMENT_CONFIGURATION = {\n duffelUrl: \"https://api.duffel.com\",\n evervaultCredentials: {\n teamID: \"team_a22f3ea22207\",\n appID: \"app_152d304a3d98\",\n },\n};\n\n/**\n * @param clientKey - The client key used to authenticate with the Duffel API.\n * @param cardId - The card ID used for the 3DS session.\n * @param resourceId - The resource (offer, order, order change) ID that the 3DS session is for.\n * @param services - Include all services that are being added, empty if no services are being added. This is required when services are also being purchased to ensure an accurate total amount to be authorised. If no services, it should be an empty array.\n * @param cardholderPresent - Whether the cardholder was present when the 3DS session was created. If you are collecting card details offline, for example an agent interface for entering card details received from the traveller over the phone, then you must specify the cardholder as not present. This can be null if there is an exception.\n * @param exception - The name of the exception used to opt out of authenticating the payment with the card issuer\n */\ntype CreateThreeDSecureSessionFn = (\n clientKey: string,\n cardId: string,\n resourceId: string,\n services: Array<{ id: string; quantity: number }>,\n cardholderPresent: boolean | null,\n exception?: string,\n environmentConfiguration?: Partial<typeof DEFAULT_ENVIRONMENT_CONFIGURATION>,\n) => Promise<ThreeDSecureSession>;\n\nconst GENERIC_ERROR_MESSAGE = \"Failed to create 3DS session\";\n\nexport const createThreeDSecureSession: CreateThreeDSecureSessionFn = async (\n clientKey,\n cardId,\n resourceId,\n services,\n cardholderPresent,\n exception = \"\",\n environmentConfiguration = {},\n) => {\n let env: typeof DEFAULT_ENVIRONMENT_CONFIGURATION = {\n ...DEFAULT_ENVIRONMENT_CONFIGURATION,\n ...environmentConfiguration,\n };\n\n // We want to load the Evervault script\n // onto the page as soon as this file is loaded.\n await loadEvervaultScript();\n\n return new Promise((resolve, reject) => {\n const client = createClient(env.duffelUrl, clientKey);\n\n client\n .create3DSSessionInDuffelAPI({\n card_id: cardId,\n resource_id: resourceId,\n services: services,\n cardholder_present: cardholderPresent,\n exception: exception,\n })\n .then((threeDSSession) => {\n if (!threeDSSession) {\n reject(new Error(GENERIC_ERROR_MESSAGE));\n return;\n }\n\n if (threeDSSession.live_mode === false) {\n env = {\n ...TEST_ENVIRONMENT_CONFIGURATION,\n ...environmentConfiguration,\n };\n }\n\n if (threeDSSession.status === \"ready_for_payment\") {\n resolve(threeDSSession);\n return;\n }\n\n if (threeDSSession.client_id === null) {\n reject(new Error(GENERIC_ERROR_MESSAGE));\n return;\n }\n\n const threeDSecure = initEvervault(\n threeDSSession.client_id,\n env.evervaultCredentials.teamID,\n env.evervaultCredentials.appID,\n );\n\n threeDSecure.on(\"failure\", () => {\n client\n .refresh3DSSessionInDuffelAPI(threeDSSession.id)\n .then(reject)\n .catch(reject);\n });\n\n threeDSecure.on(\"error\", () => {\n client\n .refresh3DSSessionInDuffelAPI(threeDSSession.id)\n .then(() => {\n reject(new Error(GENERIC_ERROR_MESSAGE));\n })\n .catch(() => {\n reject(new Error(GENERIC_ERROR_MESSAGE));\n });\n });\n\n threeDSecure.on(\"success\", () => {\n client\n .refresh3DSSessionInDuffelAPI(threeDSSession.id)\n .then(resolve)\n .catch((error) => {\n reject(error);\n });\n });\n })\n .catch(reject);\n });\n};\n\nexport default { createThreeDSecureSession };\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";", "import { Offer, SeatMap } from \"@duffel/api/types\";\nimport { hasAvailableSeatService } from \"../lib/hasAvailableSeatService\";\n\nexport function hasService(offer: Offer, seatMaps?: SeatMap[]) {\n const offerHasService =\n offer &&\n Array.isArray(offer.available_services) &&\n offer.available_services.some((service) => service.maximum_quantity > 0);\n\n return offerHasService || hasAvailableSeatService(seatMaps);\n}\n;\nimport \"/Users/igordepaula/.yarn/berry/cache/@sentry-bundler-plugin-core-npm-0.7.2-054e3436fd-10c0.zip/node_modules/@sentry/bundler-plugin-core/sentry-release-injection-file.js\";"],
|
|
5
|
-
"mappings": "yoBAAA,IAAAA,GAAAC,GAAA,CAAAC,GAAAC,KAAA,EAOC,UAAY,CACZ,aAEA,IAAIC,EAAS,CAAC,EAAE,eACZC,EAAmB,gBAEvB,SAASC,GAAa,CAGrB,QAFIC,EAAU,CAAC,EAENC,EAAI,EAAGA,EAAI,UAAU,OAAQA,IAAK,CAC1C,IAAIC,EAAM,UAAUD,CAAC,EACrB,GAAKC,EAEL,KAAIC,EAAU,OAAOD,EAErB,GAAIC,IAAY,UAAYA,IAAY,SACvCH,EAAQ,KAAKE,CAAG,UACN,MAAM,QAAQA,CAAG,GAC3B,GAAIA,EAAI,OAAQ,CACf,IAAIE,EAAQL,EAAW,MAAM,KAAMG,CAAG,EAClCE,GACHJ,EAAQ,KAAKI,CAAK,CAEpB,UACUD,IAAY,SAAU,CAChC,GAAID,EAAI,WAAa,OAAO,UAAU,UAAY,CAACA,EAAI,SAAS,SAAS,EAAE,SAAS,eAAe,EAAG,CACrGF,EAAQ,KAAKE,EAAI,SAAS,CAAC,EAC3B,QACD,CAEA,QAASG,KAAOH,EACXL,EAAO,KAAKK,EAAKG,CAAG,GAAKH,EAAIG,CAAG,GACnCL,EAAQ,KAAKK,CAAG,CAGnB,EACD,CAEA,OAAOL,EAAQ,KAAK,GAAG,CACxB,CAEI,OAAOJ,GAAW,KAAeA,GAAO,SAC3CG,EAAW,QAAUA,EACrBH,GAAO,QAAUG,GACP,OAAO,QAAW,YAAc,OAAO,OAAO,KAAQ,UAAY,OAAO,IAEnF,OAAO,aAAc,CAAC,EAAG,UAAY,CACpC,OAAOA,CACR,CAAC,EAED,OAAO,WAAaA,CAEtB,GAAE,IC3DF,IAAA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C,EAAsB,CAM7D,OAJED,GACA,MAAM,QAAQA,EAAM,kBAAkB,GACtCA,EAAM,mBAAmB,KAAME,GAAYA,EAAQ,iBAAmB,CAAC,GAE/CC,GAAwBF,CAAQ,CAC5D",
|
|
6
|
-
"names": ["require_classnames", "__commonJSMin", "exports", "module", "hasOwn", "nativeCodeString", "classNames", "classes", "i", "arg", "argType", "inner", "key", "require_react_stripe_umd", "__commonJSMin", "exports", "module", "global", "factory", "React", "ownKeys", "object", "enumerableOnly", "keys", "symbols", "sym", "_objectSpread2", "target", "i", "source", "key", "_defineProperty", "_typeof", "obj", "value", "_slicedToArray", "arr", "_arrayWithHoles", "_iterableToArrayLimit", "_unsupportedIterableToArray", "_nonIterableRest", "_i", "_arr", "_n", "_d", "_s", "_e", "err", "o", "minLen", "_arrayLikeToArray", "n", "len", "arr2", "createCommonjsModule", "fn", "ReactPropTypesSecret", "ReactPropTypesSecret_1", "emptyFunction", "emptyFunctionWithReset", "factoryWithThrowingShims", "shim", "props", "propName", "componentName", "location", "propFullName", "secret", "getShim", "ReactPropTypes", "propTypes", "usePrevious", "ref", "isUnknownObject", "raw", "isPromise", "isStripe", "PLAIN_OBJECT_STR", "isEqual", "left", "right", "leftArray", "rightArray", "leftPlainObject", "rightPlainObject", "leftKeys", "rightKeys", "keySet", "allKeys", "l", "r", "pred", "extractAllowedOptionsUpdates", "options", "prevOptions", "immutableKeys", "newOptions", "isUpdated", "INVALID_STRIPE_ERROR", "validateStripe", "maybeStripe", "parseStripeProp", "stripe", "ElementsContext", "parseElementsContext", "ctx", "useCase", "CartElementContext", "parseCartElementContext", "Elements", "_ref", "rawStripeProp", "children", "parsed", "_React$useState", "_React$useState2", "cart", "setCart", "_React$useState3", "_React$useState4", "cartState", "setCartState", "_React$useState5", "_React$useState6", "setContext", "isMounted", "safeSetContext", "prevStripe", "updates", "anyStripe", "useElementsContextWithUseCase", "useCaseMessage", "useCartElementContextWithUseCase", "useElements", "_useElementsContextWi", "elements", "useStripe", "_useElementsContextWi2", "useCartElement", "_useCartElementContex", "useCartElementState", "_useCartElementContex2", "ElementsConsumer", "_ref2", "useAttachEvent", "element", "event", "cb", "cbDefined", "cbRef", "decoratedCb", "capitalized", "str", "createElementComponent", "type", "isServer", "displayName", "ClientElement", "id", "className", "_ref$options", "onBlur", "onFocus", "onReady", "onChange", "onEscape", "onClick", "onLoadError", "onLoaderStart", "onNetworksChange", "onCheckout", "onLineItemClick", "onConfirm", "onCancel", "onShippingAddressChange", "onShippingRateChange", "setElement", "elementRef", "domNode", "readyCallback", "changeCallback", "checkoutCallback", "newElement", "ServerElement", "Element", "AuBankAccountElement", "CardElement", "CardNumberElement", "CardExpiryElement", "CardCvcElement", "FpxBankElement", "IbanElement", "IdealBankElement", "P24BankElement", "EpsBankElement", "PaymentElement", "ExpressCheckoutElement", "PaymentRequestButtonElement", "LinkAuthenticationElement", "AddressElement", "ShippingAddressElement", "CartElement", "PaymentMethodMessagingElement", "AffirmMessageElement", "AfterpayClearpayMessageElement", "require_classnames", "__commonJSMin", "exports", "module", "hasOwn", "classNames", "classes", "i", "arg", "appendClass", "parseValue", "key", "value", "newClass", "require_react_is_production_min", "__commonJSMin", "exports", "b", "c", "d", "e", "f", "g", "h", "k", "l", "m", "n", "p", "q", "t", "u", "v", "a", "r", "require_react_is", "__commonJSMin", "exports", "module", "MILLISECONDS_IN_A_SECOND", "MILLISECONDS_IN_A_MINUTE", "MILLISECONDS_IN_AN_HOUR", "MILLISECONDS_IN_A_DAY", "MILLISECONDS_IN_A_WEEK", "MILLISECONDS_IN_A_YEAR", "MILLISECONDS_IN_A_MONTH", "exports", "date", "unit", "__assign", "units_1", "parse_1", "negate", "duration", "output", "__assign", "unit", "exports", "isNegativelySigned", "n", "exports", "units_1", "negate_1", "numberUtils_1", "millisecondsPattern", "unitPattern", "unit", "createDurationParser", "regex", "unitsOrder", "duration", "match", "isDurationNegative", "unitStrings", "value", "unitNumbers", "i", "isMilliseconds", "output", "__assign", "parseFullFormatISODuration", "parseUnitsISODuration", "parseISODuration", "exports", "units_1", "validate", "duration", "unit", "exports", "units_1", "cleanDurationObject", "duration", "output", "__assign", "key", "exports", "units_1", "parseISODuration_1", "validate_1", "cleanDurationObject_1", "baseParse", "duration", "__assign", "parse", "output", "exports", "parse_1", "units_1", "toMilliseconds", "duration", "parsed", "total", "_a", "unit", "milliseconds", "exports", "toUnit", "createDurationConverter", "toUnit_1", "isNegative", "duration", "exports", "isNegative_1", "negate_1", "parse_1", "abs", "duration", "exports", "getDaysInMonth", "date", "monthIndex", "lastDayOfMonth", "exports", "addMonths", "value", "desiredMonth", "dateWithDesiredMonth", "daysInMonth", "dateUtils_1", "parse_1", "apply", "date", "duration", "parsedDate", "_a", "years", "months", "weeks", "days", "hours", "minutes", "seconds", "milliseconds", "exports", "units_1", "between", "date1", "date2", "a", "b", "output", "__assign", "_a", "unit", "dateGetter", "exports", "toUnit_1", "isZero", "duration", "exports", "units_1", "between_1", "apply_1", "toUnit_1", "parse_1", "createUnitsNormalizer", "keys", "getDivisor", "duration", "remaining", "output", "__assign", "unit", "divisor", "yearMonthNormalizer", "dayAndTimeNormalizer", "baseNormalizer", "_a", "years", "months", "weeks", "days", "rest", "__rest", "normalize", "referenceDate", "durationToNormalize", "exports", "units_1", "parse_1", "sum", "durations", "_i", "output", "__assign", "duration", "key", "exports", "negate_1", "sum_1", "subtract", "duration", "durationsToSubtract", "_i", "__spreadArray", "exports", "units_1", "parse_1", "getUnitCount", "duration", "parsed", "__assign", "count", "unit", "exports", "negate_1", "parse_1", "units_1", "checkAllUnitsNegative", "duration", "parsed", "hasPositive", "hasNegative", "unit", "value", "exports", "isZero_1", "getUnitCount_1", "units_1", "checkAllUnitsNegative_1", "joinComponents", "component", "delimiter", "toString", "duration", "options", "finalOptions", "__assign", "_a", "parsed", "isAllNegative", "components", "fromUnit", "toUnit", "millisecondValue", "unit", "ISOPrecision", "ISOCharacter", "value", "output", "exports", "require_types", "__commonJSMin", "exports", "__exportStar", "exports", "units_1", "index_exports", "__export", "DuffelAncillaries", "DuffelCardForm", "DuffelNGSView", "DuffelPayments", "StaysAmenities", "StaysCancellationTimeline", "StaysRating", "StaysRoomRateCard", "StaysSummary", "amenityIcon", "createThreeDSecureSession", "hasAvailableSeatService", "hasService", "useDuffelCardFormActions", "useSort", "__toCommonJS", "objectToString", "isError", "wat", "isInstanceOf", "isBuiltin", "className", "isErrorEvent", "isDOMError", "isDOMException", "isString", "isParameterizedString", "isPrimitive", "isPlainObject", "isEvent", "isElement", "isRegExp", "isThenable", "isSyntheticEvent", "isNaN", "base", "isVueViewModel", "truncate", "str", "max", "safeJoin", "input", "delimiter", "output", "i", "value", "isVueViewModel", "isMatchingPattern", "pattern", "requireExactStringMatch", "isString", "isRegExp", "stringMatchesSomePattern", "testString", "patterns", "applyAggregateErrorsToEvent", "exceptionFromErrorImplementation", "parser", "maxValueLimit", "key", "limit", "event", "hint", "isInstanceOf", "originalException", "truncateAggregateExceptions", "aggregateExceptionsFromError", "error", "prevExceptions", "exception", "exceptionId", "newExceptions", "applyExceptionGroupFieldsForParentException", "newException", "newExceptionId", "applyExceptionGroupFieldsForChildException", "childError", "i", "source", "parentId", "exceptions", "maxValueLength", "truncate", "isGlobalObj", "obj", "GLOBAL_OBJ", "getGlobalObject", "getGlobalSingleton", "name", "creator", "gbl", "__SENTRY__", "WINDOW", "getGlobalObject", "DEFAULT_MAX_STRING_LENGTH", "htmlTreeAsString", "elem", "options", "currentElem", "MAX_TRAVERSE_HEIGHT", "out", "height", "len", "separator", "sepLength", "nextStr", "keyAttrs", "maxStringLength", "_htmlElementAsString", "el", "className", "classes", "key", "attr", "i", "keyAttrPairs", "keyAttr", "keyAttrPair", "isString", "allowedAttrs", "getLocationHref", "getDomElement", "selector", "getComponentName", "DEBUG_BUILD", "PREFIX", "CONSOLE_LEVELS", "originalConsoleMethods", "consoleSandbox", "callback", "GLOBAL_OBJ", "console", "wrappedFuncs", "wrappedLevels", "level", "originalConsoleMethod", "makeLogger", "enabled", "logger", "DEBUG_BUILD", "name", "args", "DSN_REGEX", "isValidProtocol", "protocol", "dsnToString", "dsn", "withPassword", "host", "path", "pass", "port", "projectId", "publicKey", "dsnFromString", "str", "match", "consoleSandbox", "lastPath", "split", "projectMatch", "dsnFromComponents", "components", "validateDsn", "DEBUG_BUILD", "component", "logger", "makeDsn", "from", "SentryError", "message", "logLevel", "fill", "source", "name", "replacementFactory", "original", "wrapped", "markFunctionWrapped", "addNonEnumerableProperty", "obj", "value", "DEBUG_BUILD", "logger", "proto", "getOriginalFunction", "func", "urlEncode", "object", "key", "convertToPlainObject", "isError", "getOwnProperties", "isEvent", "newObj", "serializeEventTarget", "isInstanceOf", "target", "isElement", "htmlTreeAsString", "extractedProps", "property", "extractExceptionKeysForMessage", "exception", "maxLength", "keys", "truncate", "includedKeys", "serialized", "dropUndefinedKeys", "inputValue", "_dropUndefinedKeys", "memoizationMap", "isPojo", "memoVal", "returnValue", "item", "input", "isPlainObject", "STACKTRACE_FRAME_LIMIT", "WEBPACK_ERROR_REGEXP", "STRIP_FRAME_REGEXP", "createStackParser", "parsers", "sortedParsers", "a", "b", "p", "stack", "skipFirst", "frames", "lines", "line", "cleanedLine", "parser", "frame", "stripSentryFramesAndReverse", "stackParserFromStackParserOptions", "stackParser", "localStack", "defaultFunctionName", "getFunctionName", "fn", "handlers", "instrumented", "addHandler", "type", "handler", "maybeInstrument", "type", "instrumentFn", "instrumented", "triggerHandlers", "data", "typeHandlers", "handlers", "handler", "e", "DEBUG_BUILD", "logger", "getFunctionName", "addConsoleInstrumentationHandler", "handler", "type", "addHandler", "maybeInstrument", "instrumentConsole", "GLOBAL_OBJ", "CONSOLE_LEVELS", "level", "fill", "originalConsoleMethod", "originalConsoleMethods", "args", "triggerHandlers", "log", "uuid4", "gbl", "GLOBAL_OBJ", "crypto", "getRandomByte", "typedArray", "c", "getFirstException", "event", "getEventDescription", "message", "eventId", "firstException", "addExceptionTypeValue", "value", "type", "exception", "values", "addExceptionMechanism", "newMechanism", "defaultMechanism", "currentMechanism", "mergedData", "checkOrSetAlreadyCaught", "exception", "addNonEnumerableProperty", "arrayify", "maybeArray", "WINDOW", "GLOBAL_OBJ", "DEBOUNCE_DURATION", "debounceTimerID", "lastCapturedEventType", "lastCapturedEventTargetId", "addClickKeypressInstrumentationHandler", "handler", "addHandler", "maybeInstrument", "instrumentDOM", "triggerDOMHandler", "triggerHandlers", "globalDOMEventHandler", "makeDOMEventHandler", "target", "proto", "fill", "originalAddEventListener", "type", "listener", "options", "el", "handlers", "handlerForType", "originalRemoveEventListener", "isSimilarToLastCapturedEvent", "event", "shouldSkipDOMEvent", "eventType", "globalListener", "getEventTarget", "addNonEnumerableProperty", "uuid4", "name", "WINDOW", "getGlobalObject", "supportsFetch", "WINDOW", "isNativeFetch", "func", "supportsNativeFetch", "result", "doc", "sandbox", "err", "DEBUG_BUILD", "logger", "addFetchInstrumentationHandler", "handler", "type", "addHandler", "maybeInstrument", "instrumentFetch", "supportsNativeFetch", "fill", "GLOBAL_OBJ", "originalFetch", "args", "method", "url", "parseFetchArgs", "handlerData", "triggerHandlers", "response", "finishedHandlerData", "error", "erroredHandlerData", "hasProp", "obj", "prop", "getUrlFromResource", "resource", "fetchArgs", "options", "arg", "_oldOnErrorHandler", "addGlobalErrorInstrumentationHandler", "handler", "type", "addHandler", "maybeInstrument", "instrumentError", "GLOBAL_OBJ", "msg", "url", "line", "column", "error", "triggerHandlers", "_oldOnUnhandledRejectionHandler", "addGlobalUnhandledRejectionInstrumentationHandler", "handler", "type", "addHandler", "maybeInstrument", "instrumentUnhandledRejection", "GLOBAL_OBJ", "triggerHandlers", "WINDOW", "getGlobalObject", "supportsHistory", "chromeVar", "isChromePackagedApp", "hasHistoryApi", "WINDOW", "GLOBAL_OBJ", "lastHref", "addHistoryInstrumentationHandler", "handler", "type", "addHandler", "maybeInstrument", "instrumentHistory", "supportsHistory", "oldOnPopState", "args", "to", "from", "triggerHandlers", "historyReplacementFunction", "originalHistoryFunction", "url", "fill", "WINDOW", "GLOBAL_OBJ", "SENTRY_XHR_DATA_KEY", "addXhrInstrumentationHandler", "handler", "addHandler", "maybeInstrument", "instrumentXHR", "xhrproto", "fill", "originalOpen", "args", "startTimestamp", "method", "isString", "url", "parseUrl", "onreadystatechangeHandler", "xhrInfo", "handlerData", "triggerHandlers", "original", "readyStateArgs", "setRequestHeaderArgs", "header", "value", "originalSend", "sentryXhrData", "getSDKSource", "memoBuilder", "hasWeakSet", "inner", "memoize", "obj", "i", "unmemoize", "normalize", "input", "depth", "maxProperties", "visit", "err", "normalizeToSize", "object", "maxSize", "normalized", "jsonSize", "key", "value", "memo", "memoBuilder", "memoize", "unmemoize", "isNaN", "stringified", "stringifyValue", "remainingDepth", "valueWithToJSON", "jsonValue", "numAdded", "visitable", "convertToPlainObject", "visitKey", "visitValue", "isVueViewModel", "isSyntheticEvent", "getFunctionName", "objName", "getConstructorName", "prototype", "utf8Length", "States", "RESOLVED", "REJECTED", "resolvedSyncPromise", "value", "SyncPromise", "resolve", "rejectedSyncPromise", "reason", "_", "reject", "_SyncPromise", "executor", "e", "onfulfilled", "onrejected", "result", "val", "onfinally", "isRejected", "state", "isThenable", "cachedHandlers", "handler", "makePromiseBuffer", "limit", "buffer", "isReady", "remove", "task", "add", "taskProducer", "rejectedSyncPromise", "SentryError", "drain", "timeout", "SyncPromise", "resolve", "reject", "counter", "capturedSetTimeout", "item", "resolvedSyncPromise", "parseUrl", "url", "match", "query", "fragment", "validSeverityLevels", "severityLevelFromString", "level", "validSeverityLevels", "ONE_SECOND_IN_MS", "dateTimestampInSeconds", "createUnixTimestampInSecondsFunc", "performance", "GLOBAL_OBJ", "approxStartingTimeOrigin", "timeOrigin", "timestampInSeconds", "_browserPerformanceTimeOriginMode", "browserPerformanceTimeOrigin", "performance", "GLOBAL_OBJ", "threshold", "performanceNow", "dateNow", "timeOriginDelta", "timeOriginIsReliable", "navigationStart", "navigationStartDelta", "navigationStartIsReliable", "BAGGAGE_HEADER_NAME", "SENTRY_BAGGAGE_KEY_PREFIX", "SENTRY_BAGGAGE_KEY_PREFIX_REGEX", "MAX_BAGGAGE_STRING_LENGTH", "baggageHeaderToDynamicSamplingContext", "baggageHeader", "isString", "baggageObject", "acc", "curr", "currBaggageObject", "baggageHeaderToObject", "key", "dynamicSamplingContext", "value", "nonPrefixedKey", "dynamicSamplingContextToSentryBaggageHeader", "sentryPrefixedDSC", "dscKey", "dscValue", "objectToBaggageHeader", "baggageEntry", "keyOrValue", "object", "objectKey", "objectValue", "currentIndex", "newBaggageHeader", "DEBUG_BUILD", "logger", "TRACEPARENT_REGEXP", "extractTraceparentData", "traceparent", "matches", "parentSampled", "propagationContextFromHeaders", "sentryTrace", "baggage", "traceparentData", "extractTraceparentData", "dynamicSamplingContext", "baggageHeaderToDynamicSamplingContext", "traceId", "parentSpanId", "parentSampled", "uuid4", "generateSentryTraceHeader", "spanId", "sampled", "sampledString", "createEnvelope", "headers", "items", "addItemToEnvelope", "envelope", "newItem", "forEachEnvelopeItem", "callback", "envelopeItems", "envelopeItem", "envelopeItemType", "encodeUTF8", "input", "textEncoder", "serializeEnvelope", "envelope", "envHeaders", "items", "parts", "append", "next", "item", "itemHeaders", "payload", "stringifiedPayload", "normalize", "concatBuffers", "buffers", "totalLength", "acc", "buf", "merged", "offset", "buffer", "createAttachmentEnvelopeItem", "attachment", "textEncoder", "buffer", "encodeUTF8", "dropUndefinedKeys", "ITEM_TYPE_TO_DATA_CATEGORY_MAP", "envelopeItemTypeToDataCategory", "type", "getSdkMetadataForEnvelopeHeader", "metadataOrEvent", "name", "version", "createEventEnvelopeHeaders", "event", "sdkInfo", "tunnel", "dsn", "dynamicSamplingContext", "dsnToString", "createClientReportEnvelope", "discarded_events", "dsn", "timestamp", "clientReportItem", "dateTimestampInSeconds", "createEnvelope", "parseRetryAfterHeader", "header", "now", "headerDelay", "headerDate", "disabledUntil", "limits", "dataCategory", "isRateLimited", "updateRateLimits", "statusCode", "headers", "updatedRateLimits", "rateLimitHeader", "retryAfterHeader", "limit", "retryAfter", "categories", "namespaces", "delay", "category", "parseStackFrames", "stackParser", "error", "exceptionFromError", "exception", "frames", "DEBUG_BUILD", "DEFAULT_ENVIRONMENT", "getGlobalEventProcessors", "getGlobalSingleton", "addGlobalEventProcessor", "callback", "notifyEventProcessors", "processors", "event", "hint", "index", "SyncPromise", "resolve", "reject", "processor", "result", "DEBUG_BUILD", "logger", "isThenable", "final", "makeSession", "context", "startingTime", "timestampInSeconds", "session", "uuid4", "sessionToJSON", "updateSession", "duration", "closeSession", "status", "dropUndefinedKeys", "TRACE_FLAG_NONE", "TRACE_FLAG_SAMPLED", "spanToTraceContext", "span", "span_id", "trace_id", "data", "op", "parent_span_id", "status", "tags", "origin", "spanToJSON", "dropUndefinedKeys", "spanToTraceHeader", "traceId", "spanId", "sampled", "spanIsSampled", "generateSentryTraceHeader", "spanTimeInputToSeconds", "input", "ensureTimestampInSeconds", "timestampInSeconds", "timestamp", "spanIsSpanClass", "traceFlags", "prepareEvent", "options", "event", "hint", "scope", "client", "isolationScope", "normalizeDepth", "normalizeMaxBreadth", "prepared", "uuid4", "dateTimestampInSeconds", "integrations", "i", "applyClientOptions", "applyIntegrationsMetadata", "applyDebugIds", "finalScope", "getFinalScope", "addExceptionMechanism", "clientEventProcessors", "data", "getGlobalScope", "isolationData", "mergeScopeData", "finalScopeData", "attachments", "applyScopeDataToEvent", "eventProcessors", "getGlobalEventProcessors", "notifyEventProcessors", "evt", "applyDebugMeta", "normalizeEvent", "environment", "release", "dist", "maxValueLength", "DEFAULT_ENVIRONMENT", "truncate", "exception", "request", "debugIdStackParserCache", "stackParser", "debugIdMap", "GLOBAL_OBJ", "debugIdStackFramesCache", "cachedDebugIdStackFrameCache", "filenameDebugIdMap", "acc", "debugIdStackTrace", "parsedStack", "cachedParsedStack", "stackFrame", "frame", "images", "filename", "integrationNames", "depth", "maxBreadth", "normalized", "b", "normalize", "span", "spanToJSON", "captureContext", "Scope", "parseEventHintOrCaptureContext", "hintIsScopeOrFunction", "hintIsScopeContext", "captureContextKeys", "key", "captureException", "exception", "hint", "getCurrentHub", "parseEventHintOrCaptureContext", "captureEvent", "event", "hint", "getCurrentHub", "addBreadcrumb", "breadcrumb", "hint", "getCurrentHub", "setContext", "name", "context", "withScope", "rest", "hub", "getCurrentHub", "scope", "callback", "getClient", "getCurrentHub", "getCurrentScope", "getCurrentHub", "startSession", "context", "client", "getClient", "isolationScope", "getIsolationScope", "currentScope", "release", "environment", "DEFAULT_ENVIRONMENT", "userAgent", "GLOBAL_OBJ", "session", "makeSession", "currentSession", "updateSession", "endSession", "closeSession", "_sendSessionUpdate", "captureSession", "end", "getRootSpan", "span", "getDynamicSamplingContextFromClient", "trace_id", "client", "scope", "options", "public_key", "user_segment", "dsc", "dropUndefinedKeys", "DEFAULT_ENVIRONMENT", "getDynamicSamplingContextFromSpan", "span", "getClient", "spanToJSON", "getCurrentScope", "txn", "getRootSpan", "v7FrozenDsc", "maybeSampleRate", "source", "jsonSpan", "spanIsSampled", "applyScopeDataToEvent", "event", "data", "fingerprint", "span", "breadcrumbs", "sdkProcessingMetadata", "applyDataToEvent", "applySpanToEvent", "applyFingerprintToEvent", "applyBreadcrumbsToEvent", "applySdkMetadataToEvent", "mergeScopeData", "mergeData", "extra", "tags", "user", "contexts", "level", "eventProcessors", "attachments", "propagationContext", "transactionName", "mergeAndOverwriteScopeData", "prop", "mergeVal", "key", "cleanedExtra", "dropUndefinedKeys", "cleanedTags", "cleanedUser", "cleanedContexts", "mergedBreadcrumbs", "spanToTraceContext", "rootSpan", "getRootSpan", "getDynamicSamplingContextFromSpan", "spanToJSON", "arrayify", "DEFAULT_MAX_BREADCRUMBS", "globalScope", "Scope", "_Scope", "generatePropagationContext", "scope", "newScope", "client", "callback", "user", "updateSession", "requestSession", "tags", "key", "value", "extras", "extra", "fingerprint", "level", "name", "context", "span", "session", "captureContext", "scopeToMerge", "scopeData", "isPlainObject", "scopeContext", "breadcrumb", "maxBreadcrumbs", "maxCrumbs", "mergedBreadcrumb", "dateTimestampInSeconds", "breadcrumbs", "attachment", "_breadcrumbs", "_attachments", "_contexts", "_tags", "_extra", "_user", "_level", "_fingerprint", "_eventProcessors", "_propagationContext", "_sdkProcessingMetadata", "_transactionName", "_span", "event", "hint", "additionalEventProcessors", "applyScopeDataToEvent", "eventProcessors", "getGlobalEventProcessors", "notifyEventProcessors", "newData", "exception", "eventId", "uuid4", "logger", "syntheticException", "message", "getGlobalScope", "generatePropagationContext", "uuid4", "SDK_VERSION", "API_VERSION", "SDK_VERSION", "DEFAULT_BREADCRUMBS", "Hub", "client", "scope", "isolationScope", "_version", "assignedScope", "Scope", "assignedIsolationScope", "version", "top", "callback", "maybePromiseResult", "e", "isThenable", "res", "exception", "hint", "eventId", "uuid4", "syntheticException", "message", "level", "event", "breadcrumb", "beforeBreadcrumb", "maxBreadcrumbs", "mergedBreadcrumb", "dateTimestampInSeconds", "finalBreadcrumb", "consoleSandbox", "user", "tags", "extras", "key", "value", "extra", "name", "context", "oldHub", "makeMain", "integration", "DEBUG_BUILD", "logger", "customSamplingContext", "result", "endSession", "session", "closeSession", "release", "environment", "DEFAULT_ENVIRONMENT", "userAgent", "GLOBAL_OBJ", "makeSession", "currentSession", "updateSession", "options", "method", "args", "sentry", "getMainCarrier", "hub", "registry", "getHubFromCarrier", "setHubOnCarrier", "getCurrentHub", "getGlobalHub", "getIsolationScope", "hasHubOnCarrier", "hasHubOnCarrier", "carrier", "getHubFromCarrier", "getGlobalSingleton", "Hub", "setHubOnCarrier", "hub", "__SENTRY__", "getActiveTransaction", "maybeHub", "getCurrentHub", "errorsInstrumented", "registerErrorInstrumentation", "addGlobalErrorInstrumentationHandler", "errorCallback", "addGlobalUnhandledRejectionInstrumentationHandler", "activeTransaction", "getActiveTransaction", "status", "DEBUG_BUILD", "logger", "SpanStatus", "DeadlineExceeded", "Unauthenticated", "PermissionDenied", "NotFound", "ResourceExhausted", "InvalidArgument", "Unimplemented", "Unavailable", "InternalError", "UnknownError", "Cancelled", "AlreadyExists", "FailedPrecondition", "Aborted", "OutOfRange", "DataLoss", "getSpanStatusFromHttpCode", "httpStatus", "setHttpStatus", "span", "httpStatus", "spanStatus", "getSpanStatusFromHttpCode", "hasTracingEnabled", "maybeOptions", "client", "getClient", "options", "startInactiveSpan", "context", "hasTracingEnabled", "spanContext", "normalizeContext", "hub", "getCurrentHub", "parentSpan", "getActiveSpan", "temporaryScope", "getCurrentScope", "createChildSpanOrTransaction", "createChildSpanOrTransaction", "hub", "parentSpan", "spanContext", "forceTransaction", "scope", "hasTracingEnabled", "isolationScope", "getIsolationScope", "span", "dsc", "getDynamicSamplingContextFromSpan", "traceId", "parentSpanId", "sampled", "spanIsSampled", "setCapturedScopesOnSpan", "normalizeContext", "context", "ctx", "spanTimeInputToSeconds", "SCOPE_ON_START_SPAN_FIELD", "ISOLATION_SCOPE_ON_START_SPAN_FIELD", "addNonEnumerableProperty", "getCapturedScopesOnSpan", "SPAN_METRIC_SUMMARY", "getMetricStorageForSpan", "span", "getMetricSummaryJsonForSpan", "storage", "output", "exportKey", "summary", "dropUndefinedKeys", "SEMANTIC_ATTRIBUTE_SENTRY_SOURCE", "SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE", "SEMANTIC_ATTRIBUTE_SENTRY_OP", "SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN", "SEMANTIC_ATTRIBUTE_PROFILE_ID", "SpanRecorder", "maxlen", "span", "Span", "_Span", "spanContext", "uuid4", "timestampInSeconds", "SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN", "SEMANTIC_ATTRIBUTE_SENTRY_OP", "name", "description", "traceId", "spanId", "string", "sampled", "attributes", "startTime", "endTime", "status", "op", "origin", "TRACE_FLAG_SAMPLED", "TRACE_FLAG_NONE", "childSpan", "rootSpan", "getRootSpan", "DEBUG_BUILD", "opStr", "nameStr", "spanToJSON", "idStr", "logMessage", "logger", "key", "value", "httpStatus", "setHttpStatus", "endTimestamp", "spanTimeInputToSeconds", "spanToTraceHeader", "dropUndefinedKeys", "spanToTraceContext", "getMetricSummaryJsonForSpan", "SEMANTIC_ATTRIBUTE_PROFILE_ID", "data", "hasData", "hasAttributes", "Transaction", "SpanClass", "transactionContext", "hub", "getCurrentHub", "incomingDynamicSamplingContext", "newName", "SEMANTIC_ATTRIBUTE_SENTRY_SOURCE", "SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE", "metadata", "name", "source", "maxlen", "SpanRecorder", "key", "context", "value", "unit", "newMetadata", "endTimestamp", "timestampInS", "spanTimeInputToSeconds", "transaction", "spanContext", "dropUndefinedKeys", "getDynamicSamplingContextFromSpan", "DEBUG_BUILD", "logger", "client", "finishedSpans", "span", "spanToJSON", "endTimes", "prev", "current", "capturedSpanScope", "capturedSpanIsolationScope", "getCapturedScopesOnSpan", "spanToTraceContext", "getMetricSummaryJsonForSpan", "TRACING_DEFAULTS", "FINISH_REASON_TAG", "IDLE_TRANSACTION_FINISH_REASONS", "IdleTransactionSpanRecorder", "SpanRecorder", "_pushActivity", "_popActivity", "transactionSpanId", "maxlen", "span", "originalEnd", "rest", "spanToJSON", "IdleTransaction", "Transaction", "transactionContext", "_idleHub", "_idleTimeout", "_finalTimeout", "_heartbeatInterval", "_onScope", "delayAutoFinishUntilSignal", "DEBUG_BUILD", "logger", "endTimestamp", "endTimestampInS", "spanTimeInputToSeconds", "callback", "startTime", "endTime", "spanStartedBeforeTransactionFinish", "timeoutWithMarginOfError", "spanEndedBeforeFinalTimeout", "stringifiedSpan", "scope", "pushActivity", "id", "popActivity", "restartOnChildSpanChange", "reason", "spanId", "timestampInSeconds", "heartbeatString", "sampleTransaction", "transaction", "options", "samplingContext", "hasTracingEnabled", "SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE", "sampleRate", "isValidSampleRate", "DEBUG_BUILD", "logger", "spanToJSON", "rate", "isNaN", "traceHeaders", "span", "spanToTraceHeader", "_startTransaction", "transactionContext", "customSamplingContext", "client", "options", "configInstrumenter", "transactionInstrumenter", "DEBUG_BUILD", "logger", "transaction", "Transaction", "sampleTransaction", "startIdleTransaction", "hub", "idleTimeout", "finalTimeout", "onScope", "heartbeatInterval", "delayAutoFinishUntilSignal", "IdleTransaction", "addTracingExtensions", "carrier", "getMainCarrier", "registerErrorInstrumentation", "setMeasurement", "name", "value", "unit", "transaction", "getActiveTransaction", "enhanceEventWithSdkInfo", "event", "sdkInfo", "createSessionEnvelope", "session", "dsn", "metadata", "tunnel", "getSdkMetadataForEnvelopeHeader", "envelopeHeaders", "dsnToString", "envelopeItem", "createEnvelope", "createEventEnvelope", "eventType", "createEventEnvelopeHeaders", "SENTRY_API_VERSION", "getBaseApiEndpoint", "dsn", "protocol", "port", "_getIngestEndpoint", "_encodedAuth", "sdkInfo", "urlEncode", "getEnvelopeEndpointWithUrlEncodedAuth", "tunnelOrOptions", "tunnel", "installedIntegrations", "filterDuplicates", "integrations", "integrationsByName", "currentInstance", "name", "existingInstance", "k", "getIntegrationsToSetup", "options", "defaultIntegrations", "userIntegrations", "integration", "arrayify", "finalIntegrations", "debugIndex", "findIndex", "debugInstance", "setupIntegrations", "client", "integrationIndex", "setupIntegration", "afterSetupIntegrations", "DEBUG_BUILD", "logger", "addGlobalEventProcessor", "getCurrentHub", "callback", "event", "hint", "processor", "findIndex", "arr", "callback", "i", "convertIntegrationFnToClass", "name", "fn", "args", "serializeMetricBuckets", "metricBucketItems", "out", "item", "tagEntries", "maybeTags", "key", "value", "createMetricEnvelope", "metricBucketItems", "dsn", "metadata", "tunnel", "headers", "dsnToString", "item", "createMetricEnvelopeItem", "createEnvelope", "payload", "serializeMetricBuckets", "ALREADY_SEEN_ERROR", "BaseClient", "options", "makeDsn", "DEBUG_BUILD", "logger", "url", "getEnvelopeEndpointWithUrlEncodedAuth", "exception", "hint", "scope", "checkOrSetAlreadyCaught", "eventId", "event", "result", "message", "level", "eventMessage", "isParameterizedString", "promisedEvent", "isPrimitive", "capturedSpanScope", "session", "updateSession", "timeout", "transport", "clientFinished", "transportFlushed", "resolvedSyncPromise", "eventProcessor", "forceInitialize", "integrationId", "integrationName", "integration", "isAlreadyInstalled", "setupIntegration", "afterSetupIntegrations", "env", "createEventEnvelope", "attachment", "addItemToEnvelope", "createAttachmentEnvelopeItem", "promise", "sendResponse", "createSessionEnvelope", "reason", "category", "eventOrCount", "count", "key", "metricBucketItems", "metricsEnvelope", "createMetricEnvelope", "hook", "callback", "rest", "integrations", "setupIntegrations", "crashed", "errored", "exceptions", "ex", "mechanism", "sessionNonTerminal", "SyncPromise", "resolve", "ticked", "tick", "interval", "isolationScope", "getIsolationScope", "prepareEvent", "evt", "propagationContext", "trace_id", "spanId", "parentSpanId", "dsc", "dynamicSamplingContext", "getDynamicSamplingContextFromClient", "finalEvent", "sentryError", "sampleRate", "isTransaction", "isTransactionEvent", "isError", "isErrorEvent", "eventType", "beforeSendLabel", "rejectedSyncPromise", "SentryError", "dataCategory", "capturedSpanIsolationScope", "prepared", "processBeforeSend", "_validateBeforeSendResult", "processedEvent", "spanCount", "spanCountBefore", "spanCountAfter", "droppedSpanCount", "transactionInfo", "source", "value", "envelope", "outcomes", "beforeSendResult", "invalidValueError", "isThenable", "isPlainObject", "e", "beforeSend", "beforeSendTransaction", "initAndBind", "clientClass", "options", "DEBUG_BUILD", "logger", "consoleSandbox", "getCurrentScope", "client", "setCurrentClient", "initializeClient", "top", "getCurrentHub", "DEFAULT_TRANSPORT_BUFFER_SIZE", "createTransport", "options", "makeRequest", "buffer", "makePromiseBuffer", "rateLimits", "flush", "timeout", "send", "envelope", "filteredEnvelopeItems", "forEachEnvelopeItem", "item", "type", "dataCategory", "envelopeItemTypeToDataCategory", "isRateLimited", "event", "getEventForEnvelopeItem", "resolvedSyncPromise", "filteredEnvelope", "createEnvelope", "recordEnvelopeLoss", "reason", "requestTask", "serializeEnvelope", "response", "DEBUG_BUILD", "logger", "updateRateLimits", "error", "result", "SentryError", "createSpanEnvelope", "spans", "dsn", "headers", "dsnToString", "items", "createSpanItem", "createEnvelope", "span", "applySdkMetadata", "options", "name", "names", "source", "metadata", "SDK_VERSION", "DEFAULT_IGNORE_ERRORS", "DEFAULT_IGNORE_TRANSACTIONS", "INTEGRATION_NAME", "_inboundFiltersIntegration", "options", "event", "_hint", "client", "clientOptions", "mergedOptions", "_mergeOptions", "_shouldDropEvent", "inboundFiltersIntegration", "InboundFilters", "convertIntegrationFnToClass", "internalOptions", "_isSentryError", "DEBUG_BUILD", "logger", "getEventDescription", "_isIgnoredError", "_isIgnoredTransaction", "_isDeniedUrl", "_getEventFilterUrl", "_isAllowedUrl", "ignoreErrors", "_getPossibleEventMessages", "message", "stringMatchesSomePattern", "ignoreTransactions", "name", "denyUrls", "url", "allowUrls", "possibleMessages", "lastException", "_getLastValidUrl", "frames", "i", "frame", "originalFunctionToString", "INTEGRATION_NAME", "SETUP_CLIENTS", "_functionToStringIntegration", "args", "originalFunction", "getOriginalFunction", "context", "getClient", "client", "functionToStringIntegration", "FunctionToString", "convertIntegrationFnToClass", "DEFAULT_KEY", "DEFAULT_LIMIT", "INTEGRATION_NAME", "_linkedErrorsIntegration", "options", "limit", "key", "event", "hint", "client", "applyAggregateErrorsToEvent", "exceptionFromError", "linkedErrorsIntegration", "LinkedErrors", "convertIntegrationFnToClass", "Integrations", "INTEGRATIONS", "DEBUG_BUILD", "WINDOW", "GLOBAL_OBJ", "registerBackgroundTabDetection", "WINDOW", "activeTransaction", "getActiveTransaction", "statusType", "op", "status", "spanToJSON", "DEBUG_BUILD", "logger", "bindReporter", "callback", "metric", "reportAllChanges", "prevValue", "delta", "forceReport", "generateUniqueID", "getNavigationEntryFromPerformanceTiming", "timing", "WINDOW", "type", "navigationEntry", "key", "getNavigationEntry", "getActivationStart", "navEntry", "getNavigationEntry", "initMetric", "name", "value", "navEntry", "getNavigationEntry", "navigationType", "WINDOW", "getActivationStart", "generateUniqueID", "observe", "type", "callback", "opts", "po", "list", "onHidden", "cb", "once", "onHiddenOrPageHide", "event", "WINDOW", "onCLS", "onReport", "options", "metric", "initMetric", "report", "sessionValue", "sessionEntries", "handleEntries", "entries", "entry", "firstSessionEntry", "lastSessionEntry", "po", "observe", "bindReporter", "stopListening", "onHidden", "firstHiddenTime", "initHiddenTime", "WINDOW", "trackChanges", "onHidden", "timeStamp", "getVisibilityWatcher", "onFID", "onReport", "visibilityWatcher", "getVisibilityWatcher", "metric", "initMetric", "report", "handleEntry", "entry", "handleEntries", "entries", "po", "observe", "bindReporter", "onHidden", "interactionCountEstimate", "minKnownInteractionId", "maxKnownInteractionId", "updateEstimate", "entries", "e", "po", "getInteractionCount", "initInteractionCountPolyfill", "observe", "getInteractionCountForNavigation", "getInteractionCount", "MAX_INTERACTIONS_TO_CONSIDER", "longestInteractionList", "longestInteractionMap", "processEntry", "entry", "minLongestInteraction", "existingInteraction", "interaction", "a", "b", "i", "estimateP98LongestInteraction", "candidateInteractionIndex", "onINP", "onReport", "opts", "initInteractionCountPolyfill", "metric", "initMetric", "report", "handleEntries", "entries", "prevEntry", "inp", "po", "observe", "bindReporter", "onHidden", "reportedMetricIDs", "onLCP", "onReport", "visibilityWatcher", "getVisibilityWatcher", "metric", "initMetric", "report", "handleEntries", "entries", "lastEntry", "value", "getActivationStart", "po", "observe", "bindReporter", "stopListening", "type", "WINDOW", "onHidden", "whenReady", "callback", "WINDOW", "onTTFB", "onReport", "opts", "metric", "initMetric", "report", "bindReporter", "navEntry", "getNavigationEntry", "getActivationStart", "handlers", "instrumented", "_previousCls", "_previousFid", "_previousLcp", "_previousTtfb", "_previousInp", "addClsInstrumentationHandler", "callback", "stopOnCallback", "addMetricObserver", "instrumentCls", "addLcpInstrumentationHandler", "instrumentLcp", "addTtfbInstrumentationHandler", "instrumentTtfb", "addFidInstrumentationHandler", "instrumentFid", "addInpInstrumentationHandler", "instrumentInp", "addPerformanceInstrumentationHandler", "type", "addHandler", "instrumentPerformanceObserver", "getCleanupCallback", "triggerHandlers", "data", "typeHandlers", "handler", "e", "DEBUG_BUILD", "logger", "getFunctionName", "onCLS", "metric", "onFID", "onLCP", "onTTFB", "onINP", "instrumentFn", "previousValue", "stopListening", "options", "observe", "entries", "index", "isMeasurementValue", "value", "_startChild", "transaction", "startTimestamp", "ctx", "MAX_INT_AS_BYTES", "msToSec", "time", "getBrowserPerformanceAPI", "WINDOW", "_performanceCursor", "_measurements", "_lcpEntry", "_clsEntry", "startTrackingWebVitals", "performance", "browserPerformanceTimeOrigin", "fidCallback", "_trackFID", "clsCallback", "_trackCLS", "lcpCallback", "_trackLCP", "ttfbCallback", "_trackTtfb", "startTrackingLongTasks", "addPerformanceInstrumentationHandler", "entries", "entry", "transaction", "getActiveTransaction", "startTime", "duration", "startTrackingInteractions", "span", "htmlTreeAsString", "componentName", "getComponentName", "startTrackingINP", "interactionIdtoRouteNameMapping", "interactionsSampleRate", "inpCallback", "_trackINP", "addClsInstrumentationHandler", "metric", "DEBUG_BUILD", "logger", "addLcpInstrumentationHandler", "addFidInstrumentationHandler", "timeOrigin", "addTtfbInstrumentationHandler", "INP_ENTRY_MAP", "interactionIdToRouteNameMapping", "addInpInstrumentationHandler", "client", "getClient", "interactionType", "options", "interaction", "routeName", "parentContext", "activeTransaction", "user", "replayId", "userDisplay", "profileId", "Span", "sampleRate", "getSampleRate", "envelope", "createSpanEnvelope", "transport", "reason", "addPerformanceEntries", "performanceEntries", "op", "transactionStartTime", "spanToJSON", "_addNavigationSpans", "_addMeasureSpans", "firstHidden", "getVisibilityWatcher", "shouldRecord", "_addResourceSpans", "_trackNavigator", "_addTtfbRequestTimeToMeasurements", "name", "oldValue", "measurementTimestamp", "normalizedValue", "delta", "fidMark", "_startChild", "measurementName", "setMeasurement", "_tagMetricInfo", "measureStartTimestamp", "measureEndTimestamp", "event", "_addPerformanceNavigationTiming", "_addRequest", "description", "eventEnd", "end", "start", "resourceUrl", "parsedUrl", "parseUrl", "data", "setResourceEntrySizeData", "startTimestamp", "endTimestamp", "navigator", "connection", "isMeasurementValue", "source", "index", "key", "dataKey", "entryVal", "navEntry", "getNavigationEntry", "responseStart", "requestStart", "transactionContext", "hasTracingEnabled", "isValidSampleRate", "instrumentFetchRequest", "handlerData", "shouldCreateSpan", "shouldAttachHeaders", "spans", "spanOrigin", "hasTracingEnabled", "shouldCreateSpanResult", "spanId", "span", "endSpan", "scope", "getCurrentScope", "client", "getClient", "method", "url", "fullUrl", "getFullURL", "host", "parseUrl", "startInactiveSpan", "SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN", "request", "options", "addTracingHeadersToFetchRequest", "requestSpan", "isolationScope", "getIsolationScope", "traceId", "sampled", "dsc", "sentryTraceHeader", "spanToTraceHeader", "generateSentryTraceHeader", "sentryBaggageHeader", "dynamicSamplingContextToSentryBaggageHeader", "getDynamicSamplingContextFromSpan", "getDynamicSamplingContextFromClient", "headers", "isInstanceOf", "newHeaders", "BAGGAGE_HEADER_NAME", "existingBaggageHeader", "newBaggageHeaders", "setHttpStatus", "contentLength", "contentLengthNum", "DEFAULT_TRACE_PROPAGATION_TARGETS", "defaultRequestInstrumentationOptions", "instrumentOutgoingRequests", "_options", "traceFetch", "traceXHR", "tracePropagationTargets", "tracingOrigins", "shouldCreateSpanForRequest", "enableHTTPTimings", "shouldCreateSpan", "_", "shouldAttachHeadersWithTargets", "url", "shouldAttachHeaders", "spans", "addFetchInstrumentationHandler", "handlerData", "createdSpan", "instrumentFetchRequest", "fullUrl", "getFullURL", "host", "parseUrl", "addHTTPTimings", "addXhrInstrumentationHandler", "xhrCallback", "isPerformanceResourceTiming", "entry", "span", "spanToJSON", "cleanup", "addPerformanceInstrumentationHandler", "entries", "resourceTimingEntryToSpanData", "data", "extractNetworkProtocol", "nextHopProtocol", "name", "version", "_name", "char", "getAbsoluteTime", "time", "browserPerformanceTimeOrigin", "resourceTiming", "timingSpanData", "stringMatchesSomePattern", "xhr", "sentryXhrData", "SENTRY_XHR_DATA_KEY", "hasTracingEnabled", "shouldCreateSpanResult", "spanId", "setHttpStatus", "scope", "getCurrentScope", "isolationScope", "getIsolationScope", "startInactiveSpan", "SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN", "client", "getClient", "traceId", "sampled", "dsc", "sentryTraceHeader", "spanToTraceHeader", "generateSentryTraceHeader", "sentryBaggageHeader", "dynamicSamplingContextToSentryBaggageHeader", "getDynamicSamplingContextFromSpan", "getDynamicSamplingContextFromClient", "setHeaderOnXhr", "BAGGAGE_HEADER_NAME", "WINDOW", "instrumentRoutingWithDefaults", "customStartTransaction", "startTransactionOnPageLoad", "startTransactionOnLocationChange", "WINDOW", "DEBUG_BUILD", "logger", "startingUrl", "activeTransaction", "browserPerformanceTimeOrigin", "addHistoryInstrumentationHandler", "to", "from", "BROWSER_TRACING_INTEGRATION_ID", "DEFAULT_BROWSER_TRACING_OPTIONS", "TRACING_DEFAULTS", "instrumentRoutingWithDefaults", "defaultRequestInstrumentationOptions", "MAX_INTERACTIONS", "BrowserTracing", "_options", "addTracingExtensions", "DEBUG_BUILD", "startTrackingWebVitals", "startTrackingINP", "startTrackingLongTasks", "startTrackingInteractions", "_", "getCurrentHub", "client", "clientOptions", "instrumentRouting", "startTransactionOnLocationChange", "startTransactionOnPageLoad", "markBackgroundTransactions", "traceFetch", "traceXHR", "shouldCreateSpanForRequest", "enableHTTPTimings", "_experiments", "clientOptionsTracePropagationTargets", "tracePropagationTargets", "logger", "context", "transaction", "registerBackgroundTabDetection", "instrumentOutgoingRequests", "hub", "beforeNavigate", "idleTimeout", "finalTimeout", "heartbeatInterval", "isPageloadTransaction", "expandedContext", "sentryTrace", "getMetaContent", "baggage", "traceId", "dsc", "parentSpanId", "sampled", "propagationContextFromHeaders", "modifiedContext", "finalContext", "location", "WINDOW", "idleTransaction", "startIdleTransaction", "addPerformanceEntries", "inflightInteractionTransaction", "registerInteractionTransaction", "op", "currentTransaction", "getActiveTransaction", "SEMANTIC_ATTRIBUTE_SENTRY_SOURCE", "getSource", "type", "handleEntries", "entries", "getClient", "replay", "replayId", "activeTransaction", "currentScope", "getCurrentScope", "user", "entry", "isPerformanceEventTiming", "interactionId", "existingInteraction", "duration", "startTime", "keys", "minInteractionId", "a", "b", "key", "interaction", "routeName", "parentContext", "addPerformanceInstrumentationHandler", "metaName", "metaTag", "getDomElement", "sourceFromAttributes", "sourceFromData", "sourceFromMetadata", "WINDOW", "GLOBAL_OBJ", "ignoreOnError", "shouldIgnoreOnError", "ignoreNextOnError", "wrap", "fn", "options", "before", "wrapper", "getOriginalFunction", "sentryWrapped", "args", "wrappedArguments", "arg", "ex", "withScope", "scope", "event", "addExceptionTypeValue", "addExceptionMechanism", "captureException", "property", "markFunctionWrapped", "addNonEnumerableProperty", "DEBUG_BUILD", "exceptionFromError", "stackParser", "ex", "frames", "parseStackFrames", "exception", "extractMessage", "eventFromPlainObject", "syntheticException", "isUnhandledRejection", "client", "getClient", "normalizeDepth", "event", "isEvent", "getNonErrorObjectExceptionValue", "normalizeToSize", "eventFromError", "stacktrace", "popSize", "getPopSize", "reactMinifiedRegexp", "message", "eventFromException", "hint", "attachStacktrace", "eventFromUnknownInput", "addExceptionMechanism", "resolvedSyncPromise", "eventFromMessage", "level", "eventFromString", "isErrorEvent", "isDOMError", "isDOMException", "domException", "name", "addExceptionTypeValue", "isError", "isPlainObject", "isParameterizedString", "__sentry_template_string__", "__sentry_template_values__", "keys", "extractExceptionKeysForMessage", "captureType", "getObjectClassName", "obj", "prototype", "createUserFeedbackEnvelope", "feedback", "metadata", "tunnel", "dsn", "headers", "dsnToString", "item", "createUserFeedbackEnvelopeItem", "createEnvelope", "BrowserClient", "BaseClient", "options", "sdkSource", "WINDOW", "getSDKSource", "applySdkMetadata", "exception", "hint", "eventFromException", "message", "level", "eventFromMessage", "feedback", "DEBUG_BUILD", "logger", "envelope", "createUserFeedbackEnvelope", "event", "scope", "outcomes", "createClientReportEnvelope", "dsnToString", "cachedFetchImpl", "getNativeFetchImplementation", "isNativeFetch", "WINDOW", "document", "fetchImpl", "sandbox", "contentWindow", "e", "DEBUG_BUILD", "logger", "clearCachedFetchImplementation", "makeFetchTransport", "options", "nativeFetch", "getNativeFetchImplementation", "pendingBodySize", "pendingCount", "makeRequest", "request", "requestSize", "requestOptions", "response", "e", "clearCachedFetchImplementation", "rejectedSyncPromise", "createTransport", "XHR_READYSTATE_DONE", "makeXHRTransport", "options", "makeRequest", "request", "SyncPromise", "resolve", "reject", "xhr", "header", "createTransport", "UNKNOWN_FUNCTION", "CHROME_PRIORITY", "WINJS_PRIORITY", "GECKO_PRIORITY", "createFrame", "filename", "func", "lineno", "colno", "frame", "chromeRegex", "chromeEvalRegex", "chromeStackParserFn", "line", "parts", "subMatch", "extractSafariExtensionDetails", "UNKNOWN_FUNCTION", "chromeStackLineParser", "geckoREgex", "geckoEvalRegex", "gecko", "geckoStackLineParser", "winjsRegex", "winjs", "winjsStackLineParser", "defaultStackLineParsers", "chromeStackLineParser", "geckoStackLineParser", "winjsStackLineParser", "defaultStackParser", "createStackParser", "extractSafariExtensionDetails", "func", "filename", "isSafariExtension", "isSafariWebExtension", "UNKNOWN_FUNCTION", "MAX_ALLOWED_STRING_LENGTH", "INTEGRATION_NAME", "_breadcrumbsIntegration", "options", "_options", "client", "addConsoleInstrumentationHandler", "_getConsoleBreadcrumbHandler", "addClickKeypressInstrumentationHandler", "_getDomBreadcrumbHandler", "addXhrInstrumentationHandler", "_getXhrBreadcrumbHandler", "addFetchInstrumentationHandler", "_getFetchBreadcrumbHandler", "addHistoryInstrumentationHandler", "_getHistoryBreadcrumbHandler", "_getSentryBreadcrumbHandler", "breadcrumbsIntegration", "Breadcrumbs", "convertIntegrationFnToClass", "event", "getClient", "addBreadcrumb", "getEventDescription", "dom", "handlerData", "target", "componentName", "keyAttrs", "maxStringLength", "DEBUG_BUILD", "logger", "element", "_isEvent", "htmlTreeAsString", "getComponentName", "breadcrumb", "severityLevelFromString", "safeJoin", "startTimestamp", "endTimestamp", "sentryXhrData", "SENTRY_XHR_DATA_KEY", "method", "url", "status_code", "body", "data", "hint", "response", "from", "to", "parsedLoc", "parseUrl", "WINDOW", "parsedFrom", "parsedTo", "INTEGRATION_NAME", "_dedupeIntegration", "previousEvent", "currentEvent", "_shouldDropEvent", "DEBUG_BUILD", "logger", "dedupeIntegration", "Dedupe", "convertIntegrationFnToClass", "_isSameMessageEvent", "_isSameExceptionEvent", "currentMessage", "previousMessage", "_isSameFingerprint", "_isSameStacktrace", "previousException", "_getExceptionFromEvent", "currentException", "currentFrames", "_getFramesFromEvent", "previousFrames", "i", "frameA", "frameB", "currentFingerprint", "previousFingerprint", "event", "exception", "INTEGRATION_NAME", "_globalHandlersIntegration", "options", "_options", "client", "_installGlobalOnErrorHandler", "globalHandlerLog", "_installGlobalOnUnhandledRejectionHandler", "globalHandlersIntegration", "GlobalHandlers", "convertIntegrationFnToClass", "addGlobalErrorInstrumentationHandler", "data", "stackParser", "attachStacktrace", "getOptions", "getClient", "shouldIgnoreOnError", "msg", "url", "line", "column", "error", "event", "isString", "_eventFromIncompleteOnError", "_enhanceEventWithInitialFrame", "eventFromUnknownInput", "captureEvent", "addGlobalUnhandledRejectionInstrumentationHandler", "e", "_getUnhandledRejectionError", "isPrimitive", "_eventFromRejectionWithPrimitive", "reason", "ERROR_TYPES_RE", "message", "isErrorEvent", "name", "groups", "ev", "ev0", "ev0s", "ev0sf", "colno", "lineno", "filename", "getLocationHref", "type", "DEBUG_BUILD", "logger", "INTEGRATION_NAME", "_httpContextIntegration", "event", "WINDOW", "url", "referrer", "userAgent", "headers", "request", "httpContextIntegration", "HttpContext", "convertIntegrationFnToClass", "DEFAULT_KEY", "DEFAULT_LIMIT", "INTEGRATION_NAME", "_linkedErrorsIntegration", "options", "limit", "key", "event", "hint", "client", "applyAggregateErrorsToEvent", "exceptionFromError", "linkedErrorsIntegration", "LinkedErrors", "convertIntegrationFnToClass", "DEFAULT_EVENT_TARGET", "INTEGRATION_NAME", "_browserApiErrorsIntegration", "options", "_options", "fill", "WINDOW", "_wrapTimeFunction", "_wrapRAF", "_wrapXHR", "eventTargetOption", "_wrapEventTarget", "browserApiErrorsIntegration", "TryCatch", "convertIntegrationFnToClass", "original", "args", "originalCallback", "wrap", "getFunctionName", "callback", "originalSend", "xhr", "prop", "wrapOptions", "originalFunction", "getOriginalFunction", "target", "globalObject", "proto", "eventName", "fn", "originalRemoveEventListener", "wrappedEventHandler", "originalEventHandler", "defaultIntegrations", "inboundFiltersIntegration", "functionToStringIntegration", "browserApiErrorsIntegration", "breadcrumbsIntegration", "globalHandlersIntegration", "linkedErrorsIntegration", "dedupeIntegration", "httpContextIntegration", "getDefaultIntegrations", "_options", "init", "options", "WINDOW", "clientOptions", "stackParserFromStackParserOptions", "defaultStackParser", "getIntegrationsToSetup", "supportsFetch", "makeFetchTransport", "makeXHRTransport", "initAndBind", "BrowserClient", "startSessionTracking", "startSessionTracking", "WINDOW", "DEBUG_BUILD", "logger", "startSession", "captureSession", "addHistoryInstrumentationHandler", "from", "to", "windowIntegrations", "WINDOW", "INTEGRATIONS", "CoreIntegrations", "BrowserIntegrations", "_global", "hasSentryInitiated", "initiateSentry", "init", "BrowserTracing", "captureErrorInSentry", "error", "captureException", "import_react", "MESSAGE_PREFIX", "LOCAL_STORAGE_KEY", "LOG_INITIALISED", "storeLoggerState", "shouldLog", "initializeLogger", "debugMode", "log", "message", "addBreadcrumb", "logGroup", "groupName", "messagesOrObject", "transformedMessagesOrObject", "key", "value", "import_jsx_runtime", "ICON_MAP", "getIconPath", "name", "log", "Icon", "size", "className", "viewBox", "color", "style", "import_classnames", "import_jsx_runtime", "BUTTON_VARIANTS", "BUTTON_SIZES", "Button", "iconBefore", "variant", "size", "children", "className", "type", "nativeButtonProps", "classNames", "Icon", "import_jsx_runtime", "NonIdealState", "style", "children", "import_jsx_runtime", "ErrorBoundary", "React", "error", "captureErrorInSentry", "NonIdealState", "Button", "import_jsx_runtime", "FetchOfferErrorState", "height", "message", "NonIdealState", "Button", "import_jsx_runtime", "COMPONENT_CDN", "hrefToComponentStyles", "WithComponentStyles", "children", "getServicePriceMapById", "availableServices", "all", "id", "total_amount", "total_currency", "getTotalAmountForServices", "offer", "selectedServices", "seatMaps", "servicePriceMap", "getServicePriceMapById", "getTotalAmountForServicesWithPriceMap", "total", "quantity", "id", "newTotal", "getTotalAmountFromSeatMaps", "captureErrorInSentry", "serviceId", "seatMap", "cabin", "row", "section", "element", "serviceMatch", "service", "compileCreateOrderPayload", "baggageSelectedServices", "seatSelectedServices", "cfarSelectedServices", "offer", "seatMaps", "passengers", "selectedServicesWithInformation", "totalAmountWithServices", "getTotalAmountForServices", "filterServicesForPayload", "selectedServices", "quantity", "id", "convertMarkupIntoPriceFormatter", "markup", "amount", "currency", "rate", "markupAmount", "errorMessage", "createPriceFormatters", "priceFormatters", "formatters", "isBaggageService", "service", "isCancelForAnyReasonService", "service", "multipleCurrenciesErrorMessage", "label", "currencies", "formatAvailableServices", "offer", "priceFormatters", "availableServices", "foundCurrencies", "formatters", "servicesWithFormattedPrices", "service", "serviceWithFormattedPrices", "total_amount", "total_currency", "isBaggageService", "amount", "currency", "isCancelForAnyReasonService", "isSeatElement", "element", "multipleCurrenciesErrorMessage", "currencies", "formatElement", "element", "priceFormatter", "foundCurrencies", "formattedElement", "isSeatElement", "formattedServices", "service", "formattedService", "amount", "currency", "formatSeatMaps", "seatMaps", "seatMap", "formattedCabins", "cabin", "formattedRows", "row", "formattedSections", "section", "formattedElements", "hasHighLuminance", "accentColor", "rgb", "x", "isPayloadComplete", "payload", "offerIsExpired", "offer", "isErrorResponse", "response", "DUFFEL_API_URL", "COMPONENT_VERSION", "fetchFromDuffelAPI", "withClientKey", "path", "method", "body", "logGroup", "fullUrl", "error", "data", "COMPONENT_CDN", "importFromOfferFixtures", "offerId", "importFromSeatMapsFixtures", "isFixtureOfferId", "offerId", "retrieveOfferFromDuffelAPI", "offer_id", "client_key", "fetchFromDuffelAPI", "retrieveOffer", "offer_id", "client_key", "onError", "setIsLoading", "onOfferReady", "useFixture", "isFixtureOfferId", "importFromOfferFixtures", "offer", "data", "retrieveOfferFromDuffelAPI", "error", "message", "isErrorResponse", "captureErrorInSentry", "retrieveSeatMapsFromDuffelAPI", "offer_id", "client_key", "fetchFromDuffelAPI", "retrieveSeatMaps", "offer_id", "client_key", "onError", "setIsLoading", "onSeatMapReady", "useFixture", "isFixtureOfferId", "importFromSeatMapsFixtures", "seatMaps", "data", "retrieveSeatMapsFromDuffelAPI", "error", "message", "isErrorResponse", "captureErrorInSentry", "areDuffelAncillariesPropsValid", "props", "hasCommonRequiredProps", "isDuffelAncillariesPropsWithOfferIdForFixture", "isDuffelAncillariesPropsWithClientKeyAndOfferId", "isDuffelAncillariesPropsWithOfferAndSeatMaps", "isDuffelAncillariesPropsWithOfferAndClientKey", "React", "import_jsx_runtime", "AnimatedLoaderEllipsis", "import_jsx_runtime", "Stamp", "backgroundColor", "color", "children", "getCurrencyForServices", "offer", "serviceType", "firstService", "service", "getTotalQuantity", "fromSelectedServices", "total", "quantity", "checkFunctionsMap", "isBaggageService", "isCancelForAnyReasonService", "hasService", "offer", "type", "checkFunction", "service", "moneyStringFormatter", "currency", "locale", "options", "value", "numberFormatted", "withPlural", "totalQuantity", "singular", "plural", "import_react", "import_classnames", "React", "import_jsx_runtime", "Card", "buttonTitle", "title", "icon", "copy", "onClick", "children", "isLoading", "disabled", "isSelected", "hasChildren", "classNames", "Icon", "setBodyScrollability", "shouldScroll", "import_classnames", "React", "import_classnames", "import_jsx_runtime", "ICON_BUTTON_VARIANTS", "IconButton", "icon", "variant", "className", "nativeButtonProps", "classNames", "Icon", "import_jsx_runtime", "Modal", "children", "onClose", "isOpen", "setBodyScrollability", "classNames", "IconButton", "ModalBody", "tall", "noPadding", "getPassengerMapById", "passengers", "all", "passenger", "getSegmentList", "offer", "accumulator", "slice", "import_react", "getPassengerName", "createOrderPayloadPassenger", "offerPassenger", "fallbackIndex", "getBaggageServiceDescription", "metadata", "captureErrorInSentry", "hasAllDimensions", "dimensionsLabel", "weightLabel", "hasBaggageServiceOfSameMetadataTypeAlreadyBeenSelected", "selectedServices", "availableService", "selectedServiceMap", "service", "key", "getMetadataServiceUniquenessKey", "getMetadataServiceUniquenessKeyFromAvailableService", "availableServiceKey", "keys", "segmentId", "passengerId", "import_jsx_runtime", "Counter", "id", "min", "max", "value", "onChange", "IconButton", "import_jsx_runtime", "BaggageSelectionController", "passengerId", "availableService", "quantity", "onQuantityChanged", "selectedServices", "serviceName", "servicePrice", "moneyStringFormatter", "serviceDescription", "getBaggageServiceDescription", "shouldDisableController", "hasBaggageServiceOfSameMetadataTypeAlreadyBeenSelected", "Counter", "import_jsx_runtime", "IncludedBaggageBanner", "includedBaggage", "carryOnBagsQuantity", "checkedBagsQuantity", "sum", "type", "quantity", "baggageLabelStringArray", "withPlural", "import_jsx_runtime", "BaggageSelectionModalBodyPassenger", "segmentId", "passengerId", "passengerName", "includedBaggage", "passengerServicesForSegment", "selectedServices", "setSelectedServices", "hasIncludedBaggage", "sum", "bag", "IncludedBaggageBanner", "availableService", "BaggageSelectionController", "id", "newQuantity", "onBaggageQuantityChanged", "changedServiceIndex", "newSelectedServices", "quantity", "import_jsx_runtime", "BaggageSelectionModalBody", "offer", "segment", "passengersById", "selectedServices", "setSelectedServices", "ModalBody", "passenger_id", "baggages", "index", "BaggageSelectionModalBodyPassenger", "getPassengerName", "id", "type", "passenger_ids", "segment_ids", "import_jsx_runtime", "BaggageSelectionModalFooter", "selectedServices", "servicePrices", "currency", "isFirstSegment", "isLastSegment", "onNextSegmentButtonClicked", "onPreviousSegmentButtonClicked", "onClose", "totalQuantity", "getTotalQuantity", "totalAmount", "getTotalAmountForServicesWithPriceMap", "totalAmountLabel", "moneyStringFormatter", "isOneWay", "withPlural", "Button", "formatDateString", "dateString", "date", "captureErrorInSentry", "formatDate", "format", "import_jsx_runtime", "BaggageSelectionModalHeader", "segmentCount", "currentSegmentIndex", "currentSegment", "setCurrentSegmentIndex", "_", "index", "ActiveSegment", "InactiveSegment", "formatDateString", "onClick", "style", "import_jsx_runtime", "BaggageSelectionModal", "isOpen", "offer", "passengers", "onClose", "selectedServices", "currentSegmentIndex", "setCurrentSegmentIndex", "selectedServicesState", "setSelectedServicesState", "React", "segments", "getSegmentList", "currentSegment", "passengerMapById", "getPassengerMapById", "servicePricesMap", "getServicePriceMapById", "currencyToUse", "hasService", "getCurrencyForServices", "Modal", "BaggageSelectionModalHeader", "index", "BaggageSelectionModalBody", "BaggageSelectionModalFooter", "import_jsx_runtime", "BaggageSelectionCard", "isLoading", "offer", "passengers", "selectedServices", "setSelectedServices", "isOpen", "setIsOpen", "React", "containsBaggageService", "hasService", "totalQuantity", "getTotalQuantity", "isBaggageAdded", "totalAmount", "getTotalAmountForServices", "currencyToUse", "getCurrencyForServices", "totalAmountFormatted", "moneyStringFormatter", "copy", "withPlural", "Card", "Stamp", "AnimatedLoaderEllipsis", "BaggageSelectionModal", "newSelectedServices", "newSelectedServicesDeepCopy", "import_react", "import_jsx_runtime", "CfarSelectionModalBodyListItem", "children", "Icon", "import_jsx_runtime", "CfarSelectionModalBody", "offerCurrency", "service", "ModalBody", "CfarSelectionModalBodyListItem", "moneyStringFormatter", "Icon", "import_jsx_runtime", "CfarSelectionModalFooter", "service", "selectedServices", "onAddCfarService", "onRemoveCfarService", "onClose", "serviceIncluded", "id", "formattedPrice", "moneyStringFormatter", "Button", "ProtectedTripBanner", "Icon", "import_jsx_runtime", "CfarSelectionModalHeader", "import_jsx_runtime", "CfarSelectionModal", "isOpen", "offerCurrency", "service", "onClose", "selectedServices", "Modal", "CfarSelectionModalHeader", "CfarSelectionModalBody", "CfarSelectionModalFooter", "import_jsx_runtime", "CfarSelectionCard", "isLoading", "offer", "selectedServices", "setSelectedServices", "isOpen", "setIsOpen", "React", "containsCfarService", "hasService", "isCfarAdded", "getTotalQuantity", "currencyToUse", "getCurrencyForServices", "totalAmount", "getTotalAmountForServices", "totalAmountFormatted", "moneyStringFormatter", "cfarService", "isCancelForAnyReasonService", "copy", "Card", "Stamp", "AnimatedLoaderEllipsis", "CfarSelectionModal", "newSelectedServices", "getFirstSeatElementMatchingCriteria", "seatMaps", "matcher", "seatMap", "cabin", "row", "section", "element", "getCurrencyForSeatMaps", "seatMaps", "getFirstSeatElementMatchingCriteria", "element", "hasAvailableSeatService", "seatMaps", "seatMap", "cabin", "rows", "section", "element", "import_react", "getPassengerBySegmentList", "segments", "segment", "passenger", "passengerIndex", "import_react", "getCabinsForSegmentAndDeck", "forDeck", "seatMap", "cabin", "getSymbols", "cabins", "results", "cabin", "row", "section", "element", "hasWings", "cabin", "rowIndex", "import_classnames", "React", "import_classnames", "import_jsx_runtime", "Tabs", "value", "onChange", "options", "option", "classNames", "import_jsx_runtime", "DeckSelect", "value", "setValue", "options", "Tabs", "item", "import_jsx_runtime", "Legend", "symbols", "Icon", "symbol", "getRowNumber", "row", "seats", "section", "acc", "val", "element", "import_classnames", "React", "isAmenityElement", "element", "import_classnames", "import_jsx_runtime", "amenitiesWithoutWrapper", "Amenity", "type", "classNames", "Icon", "import_jsx_runtime", "EmptyElement", "import_classnames", "import_jsx_runtime", "ExitElement", "isRight", "classNames", "Icon", "getPassengerInitials", "passengerName", "partOfTheName", "import_classnames", "import_jsx_runtime", "SeatInfo", "seat", "service", "price", "moneyStringFormatter", "disclosure", "index", "import_jsx_runtime", "SeatUnavailable", "seat", "Icon", "import_jsx_runtime", "SeatElement", "element", "currentPassengerId", "currentSegmentId", "currentPassengerName", "onSeatToggled", "selectedServicesMap", "seatServiceFromElement", "service", "isRestrictedSeat", "SeatUnavailable", "selectedServiceFromMap", "isSeatSelected", "seatLabel", "getPassengerInitials", "isFeePayable", "isSeatSelectionAvaiable", "isActionable", "seatClassName", "classNames", "priceLabel", "moneyStringFormatter", "isSeatInfoDisplayed", "Icon", "SeatInfo", "import_jsx_runtime", "Element", "element", "elementIndex", "sectionIndex", "onSeatToggled", "selectedServicesMap", "currentPassengerId", "currentSegmentId", "currentPassengerName", "isSeatElement", "SeatElement", "EmptyElement", "ExitElement", "isAmenityElement", "Amenity", "import_jsx_runtime", "RowSection", "row", "rowNumber", "hasWings", "section", "sectionIndex", "onSeatToggled", "selectedServicesMap", "currentPassengerId", "currentPassengerName", "currentSegmentId", "rowLength", "isOneSectionRow", "classNames", "element", "elementIndex", "Element", "EmptyElement", "import_jsx_runtime", "Row", "row", "hasWings", "onSeatToggled", "selectedServicesMap", "currentPassengerId", "currentPassengerName", "currentSegmentId", "rowNumber", "getRowNumber", "section", "sectionIndex", "RowSection", "import_jsx_runtime", "SeatMapUnavailable", "NonIdealState", "import_jsx_runtime", "SeatMap", "seatMap", "onSeatToggled", "selectedServicesMap", "currentPassengerId", "currentPassengerName", "currentSegmentId", "selectedDeck", "setSelectedDeck", "SeatMapUnavailable", "cabins", "getCabinsForSegmentAndDeck", "hasMultipleDecks", "anyHasWings", "cabin", "symbols", "getSymbols", "classNames", "DeckSelect", "value", "Legend", "cabinIndex", "row", "rowIndex", "Row", "hasWings", "import_jsx_runtime", "SeatSelectionModalBody", "props", "ModalBody", "SeatMap", "import_jsx_runtime", "SeatSelectionModalFooter", "selectedServices", "servicePrices", "currency", "isFirstSegment", "isLastSegment", "onNextSegmentButtonClicked", "onPreviousSegmentButtonClicked", "onClose", "seatMaps", "totalQuantity", "getTotalQuantity", "totalAmount", "getTotalAmountForServicesWithPriceMap", "totalAmountLabel", "moneyStringFormatter", "isOneWay", "withPlural", "Button", "import_jsx_runtime", "SeatSelectionModalHeader", "segmentAndPassengerPermutationsCount", "currentSegmentAndPassengerPermutationsIndex", "currentSegment", "currentPassengerName", "setCurrentSegmentAndPassengerPermutationsIndex", "_", "index", "ActiveSegment", "InactiveSegment", "formatDateString", "onClick", "style", "import_jsx_runtime", "SeatSelectionModal", "isOpen", "offer", "passengers", "seatMaps", "selectedServices", "onClose", "currentPermutationIndex", "setCurrentPermutationIndex", "React", "selectedServicesState", "setSelectedServicesState", "selectedServicesStateMap", "all", "service", "segments", "getSegmentList", "passengerMapById", "getPassengerMapById", "servicePricesMap", "getServicePriceMapById", "segmentAndPassengerPermutations", "getPassengerBySegmentList", "currentPassengerId", "currentPassengerIndex", "currentSegmentId", "currentSegment", "id", "currentPassenger", "currentSeatMap", "seatMap", "currentPassengerName", "getPassengerName", "onSeatToggle", "seatServiceToToggle", "newSeatServices", "selectedServiceFromState", "hasClickedSeatToToggleOff", "isSelectedServiceFromStateForTheSameSegmentAndPassengerPermutation", "currencyToUse", "getCurrencyForSeatMaps", "Modal", "SeatSelectionModalHeader", "SeatSelectionModalBody", "SeatSelectionModalFooter", "import_jsx_runtime", "SeatSelectionCard", "isLoading", "offer", "seatMaps", "passengers", "selectedServices", "setSelectedServices", "isOpen", "setIsOpen", "React", "containsSeatService", "hasAvailableSeatService", "totalQuantity", "getTotalQuantity", "areSeatsAdded", "totalAmount", "getTotalAmountForServices", "currencyToUse", "getCurrencyForSeatMaps", "totalAmountFormatted", "moneyStringFormatter", "copy", "withPlural", "Card", "Stamp", "AnimatedLoaderEllipsis", "SeatSelectionModal", "services", "import_jsx_runtime", "DuffelAncillaries", "props", "initializeLogger", "logGroup", "areDuffelAncillariesPropsValid", "isPropsWithOfferIdForFixture", "isDuffelAncillariesPropsWithOfferIdForFixture", "isPropsWithClientKeyAndOfferId", "isDuffelAncillariesPropsWithClientKeyAndOfferId", "isPropsWithOfferAndSeatMaps", "isDuffelAncillariesPropsWithOfferAndSeatMaps", "isPropsWithOfferAndClientKey", "isDuffelAncillariesPropsWithOfferAndClientKey", "shouldRetrieveSeatMaps", "passengers", "setPassengers", "offer", "setOffer", "isOfferLoading", "setIsOfferLoading", "seatMaps", "setSeatMaps", "isSeatMapLoading", "setIsSeatMapLoading", "error", "setError", "baggageSelectedServices", "setBaggageSelectedServices", "seatSelectedServices", "setSeatSelectedServices", "cfarSelectedServices", "setCfarSelectedServices", "priceFormatters", "createPriceFormatters", "updateOffer", "expiryErrorMessage", "offerIsExpired", "msUntilExpiry", "milisecondsInOneDay", "offerWithFormattedServices", "formatAvailableServices", "updateSeatMaps", "formattedSeatMaps", "formatSeatMaps", "setContext", "retrieveOffer", "passenger", "index", "retrieveSeatMaps", "createOrderPayload", "compileCreateOrderPayload", "isPayloadComplete", "metadata", "nonIdealStateHeight", "duffelComponentsStyle", "hasHighLuminance", "WithComponentStyles", "ErrorBoundary", "FetchOfferErrorState", "ancillaryName", "BaggageSelectionCard", "SeatSelectionCard", "CfarSelectionCard", "import_react_stripe_js", "V3_URL", "V3_URL_REGEX", "EXISTING_SCRIPT_MESSAGE", "findScript", "scripts", "i", "script", "injectScript", "params", "queryString", "headOrBody", "registerWrapper", "stripe", "startTime", "stripePromise", "loadScript", "resolve", "reject", "error", "initStripe", "maybeStripe", "args", "stripePromise$1", "loadCalled", "err", "loadStripe", "_len", "_key", "React", "import_jsx_runtime", "STRIPE_CARD_ELEMENT", "COMPONENT_VERSION", "CARD_ELEMENT_STYLE_BASE", "CARD_ELEMENT_STYLE_INVALID", "CardPaymentComponent", "styles", "paymentIntentClientToken", "onSuccessfulPayment", "onFailedPayment", "cardElement", "setCardElement", "isComplete", "setIsComplete", "isInvalid", "setIsInvalid", "isProcessing", "setIsProcessing", "errorMessage", "setErrorMessage", "stripe", "elements", "maybeCard", "event", "error", "complete", "e", "decodedDuffelPaymentIntentClientToken", "parsedDuffelPaymentIntentClientToken", "clientSecret", "result", "Button", "DuffelPayments", "props", "setStripe", "initializeLogger", "duffelPublishableKey", "loadStripe", "duffelComponentsStyle", "hasHighLuminance", "WithComponentStyles", "ErrorBoundary", "import_classnames", "import_jsx_runtime", "HSpace", "className", "space", "alignCenter", "spaceBetween", "divProps", "classNames", "import_jsx_runtime", "Policy", "iconName", "iconColor", "label", "children", "HSpace", "Icon", "isValidDateString", "date", "getDateObject", "fromISO", "isValidDateString", "formats", "getDateString", "original", "format", "locale", "date", "getDateObject", "import_classnames", "import_jsx_runtime", "VSpace", "className", "space", "divProps", "classNames", "React", "import_classnames", "import_jsx_runtime", "TimelineItem", "label", "description", "dot", "dotColor", "lineColorLeft", "lineColorRight", "tooltip", "size", "aboveDot", "date", "ref", "VSpace", "classNames", "HSpace", "isTimezoneDate", "date", "isValidDateString", "formatDistanceLocale", "formatDistance", "token", "count", "options", "result", "tokenValue", "buildFormatLongFn", "args", "options", "width", "dateFormats", "timeFormats", "dateTimeFormats", "formatLong", "buildFormatLongFn", "formatRelativeLocale", "formatRelative", "token", "_date", "_baseDate", "_options", "buildLocalizeFn", "args", "value", "options", "context", "valuesArray", "defaultWidth", "width", "index", "eraValues", "quarterValues", "monthValues", "dayValues", "dayPeriodValues", "formattingDayPeriodValues", "ordinalNumber", "dirtyNumber", "_options", "number", "rem100", "localize", "buildLocalizeFn", "quarter", "buildMatchFn", "args", "string", "options", "width", "matchPattern", "matchResult", "matchedString", "parsePatterns", "key", "findIndex", "pattern", "findKey", "value", "rest", "object", "predicate", "array", "buildMatchPatternFn", "args", "string", "options", "matchResult", "matchedString", "parseResult", "value", "rest", "matchOrdinalNumberPattern", "parseOrdinalNumberPattern", "matchEraPatterns", "parseEraPatterns", "matchQuarterPatterns", "parseQuarterPatterns", "matchMonthPatterns", "parseMonthPatterns", "matchDayPatterns", "parseDayPatterns", "matchDayPeriodPatterns", "parseDayPeriodPatterns", "match", "buildMatchPatternFn", "value", "buildMatchFn", "index", "enUS", "formatDistance", "formatLong", "formatRelative", "localize", "match", "defaultOptions", "getDefaultOptions", "maxTime", "minTime", "millisecondsInWeek", "millisecondsInDay", "secondsInHour", "secondsInDay", "secondsInHour", "secondsInWeek", "secondsInYear", "secondsInMonth", "secondsInQuarter", "constructFromSymbol", "constructFrom", "date", "value", "constructFromSymbol", "toDate", "argument", "context", "constructFrom", "getTimezoneOffsetInMilliseconds", "date", "_date", "toDate", "utcDate", "normalizeDates", "context", "dates", "normalize", "constructFrom", "date", "startOfDay", "date", "options", "_date", "toDate", "differenceInCalendarDays", "laterDate", "earlierDate", "options", "laterDate_", "earlierDate_", "normalizeDates", "laterStartOfDay", "startOfDay", "earlierStartOfDay", "laterTimestamp", "getTimezoneOffsetInMilliseconds", "earlierTimestamp", "millisecondsInDay", "startOfYear", "date", "options", "date_", "toDate", "getDayOfYear", "date", "options", "_date", "toDate", "differenceInCalendarDays", "startOfYear", "startOfWeek", "date", "options", "defaultOptions", "getDefaultOptions", "weekStartsOn", "_date", "toDate", "day", "diff", "startOfISOWeek", "date", "options", "startOfWeek", "getISOWeekYear", "date", "options", "_date", "toDate", "year", "fourthOfJanuaryOfNextYear", "constructFrom", "startOfNextYear", "startOfISOWeek", "fourthOfJanuaryOfThisYear", "startOfThisYear", "startOfISOWeekYear", "date", "options", "year", "getISOWeekYear", "fourthOfJanuary", "constructFrom", "startOfISOWeek", "getISOWeek", "date", "options", "_date", "toDate", "diff", "startOfISOWeek", "startOfISOWeekYear", "millisecondsInWeek", "getWeekYear", "date", "options", "_date", "toDate", "year", "defaultOptions", "getDefaultOptions", "firstWeekContainsDate", "firstWeekOfNextYear", "constructFrom", "startOfNextYear", "startOfWeek", "firstWeekOfThisYear", "startOfThisYear", "startOfWeekYear", "date", "options", "defaultOptions", "getDefaultOptions", "firstWeekContainsDate", "year", "getWeekYear", "firstWeek", "constructFrom", "startOfWeek", "getWeek", "date", "options", "_date", "toDate", "diff", "startOfWeek", "startOfWeekYear", "millisecondsInWeek", "addLeadingZeros", "number", "targetLength", "sign", "output", "lightFormatters", "date", "token", "signedYear", "year", "addLeadingZeros", "month", "dayPeriodEnumValue", "numberOfDigits", "milliseconds", "fractionalSeconds", "dayPeriodEnum", "formatters", "date", "token", "localize", "era", "signedYear", "year", "lightFormatters", "options", "signedWeekYear", "getWeekYear", "weekYear", "twoDigitYear", "addLeadingZeros", "isoWeekYear", "getISOWeekYear", "quarter", "month", "week", "getWeek", "isoWeek", "getISOWeek", "dayOfYear", "getDayOfYear", "dayOfWeek", "localDayOfWeek", "isoDayOfWeek", "dayPeriodEnumValue", "hours", "_localize", "timezoneOffset", "formatTimezoneWithOptionalMinutes", "formatTimezone", "formatTimezoneShort", "timestamp", "offset", "delimiter", "sign", "absOffset", "minutes", "dateLongFormatter", "pattern", "formatLong", "timeLongFormatter", "dateTimeLongFormatter", "matchResult", "datePattern", "timePattern", "dateTimeFormat", "longFormatters", "dayOfYearTokenRE", "weekYearTokenRE", "throwTokens", "isProtectedDayOfYearToken", "token", "isProtectedWeekYearToken", "warnOrThrowProtectedError", "format", "input", "_message", "message", "subject", "isDate", "value", "isValid", "date", "isDate", "toDate", "formattingTokensRegExp", "longFormattingTokensRegExp", "escapedStringRegExp", "doubleQuoteRegExp", "unescapedLatinCharacterRegExp", "format", "date", "formatStr", "options", "defaultOptions", "getDefaultOptions", "locale", "enUS", "firstWeekContainsDate", "weekStartsOn", "originalDate", "toDate", "isValid", "parts", "longFormattingTokensRegExp", "substring", "firstCharacter", "longFormatter", "longFormatters", "formattingTokensRegExp", "cleanEscapedString", "formatters", "unescapedLatinCharacterRegExp", "formatterOptions", "part", "token", "isProtectedWeekYearToken", "isProtectedDayOfYearToken", "warnOrThrowProtectedError", "formatter", "input", "matched", "escapedStringRegExp", "doubleQuoteRegExp", "getDefaultOptions", "tzIntlTimeZoneName", "length", "date", "options", "defaultOptions", "getDefaultOptions", "dtf", "getDTF", "partsTimeZone", "hackyTimeZone", "formatted", "i", "tzNameMatch", "timeZone", "locale", "tzTokenizeDate", "date", "timeZone", "dtf", "getDateTimeFormat", "partsOffset", "hackyOffset", "typeToPos", "formatted", "filled", "i", "pos", "error", "parsed", "dtfCache", "testDateFormatted", "hourCycleSupported", "newDateUTC", "fullYear", "month", "day", "hour", "minute", "second", "millisecond", "utcDate", "MILLISECONDS_IN_HOUR", "MILLISECONDS_IN_MINUTE", "patterns", "tzParseTimezone", "timezoneString", "date", "isUtcDate", "token", "hours", "absoluteOffset", "validateTimezone", "minutes", "isValidTimezoneIANAString", "utcDate", "toUtcDate", "offset", "calcOffset", "fixOffset", "newDateUTC", "tokens", "tzTokenizeDate", "asUTC", "asTS", "over", "utcGuess", "o2", "o3", "validIANATimezoneCache", "timeZoneString", "MILLISECONDS_IN_MINUTE", "formatters", "date", "token", "options", "timezoneOffset", "getTimeZoneOffset", "formatTimezoneWithOptionalMinutes", "formatTimezone", "formatTimezoneShort", "tzIntlTimeZoneName", "timeZone", "originalDate", "timeZoneOffset", "tzParseTimezone", "addLeadingZeros", "number", "targetLength", "sign", "output", "offset", "delimiter", "absOffset", "hours", "minutes", "getTimezoneOffsetInMilliseconds", "date", "utcDate", "tzPattern", "MILLISECONDS_IN_HOUR", "MILLISECONDS_IN_MINUTE", "DEFAULT_ADDITIONAL_DIGITS", "patterns", "tzPattern", "toDate", "argument", "options", "additionalDigits", "dateStrings", "splitDateString", "year", "restDateString", "parseYear", "date", "parseDate", "timestamp", "time", "offset", "parseTime", "tzParseTimezone", "getTimezoneOffsetInMilliseconds", "dateString", "parts", "timeString", "token", "patternYYY", "patternYYYYY", "yearString", "centuryString", "month", "week", "validateDate", "dayOfYear", "validateDayOfYearDate", "day", "validateWeekDate", "dayOfISOWeekYear", "dayOfWeek", "hours", "minutes", "validateTime", "seconds", "isoWeekYear", "fourthOfJanuaryDay", "diff", "DAYS_IN_MONTH", "DAYS_IN_MONTH_LEAP_YEAR", "isLeapYearIndex", "isLeapYear", "tzFormattingTokensRegExp", "format", "date", "formatStr", "options", "matches", "d", "toDate", "result", "token", "pos", "precededByQuotedSection", "replaced", "formatters", "import_jsx_runtime", "renderTimelineDateTime", "date", "showTime", "dateTimeZone", "dateHasTimezoneDesignator", "isTimezoneDate", "getDateString", "format", "import_jsx_runtime", "FullRefundPolicy", "before", "Policy", "getDateString", "PartialRefundPolicy", "cancellationTimeline", "totalAmount", "moneyStringFormatter", "OnlyNoRefundPolicy", "NoRefundPolicy", "afterDate", "hasFreeCancellation", "StaysCancellationTimelineDeposit", "checkInDate", "checkInAfterTime", "bookingDate", "checkInDateTime", "VSpace", "timelineItem", "HSpace", "index", "currentColor", "prevColor", "timelineSize", "TimelineItem", "renderTimelineDateTime", "import_jsx_runtime", "FullRefundPolicy", "before", "Policy", "getDateString", "PartialRefundPolicy", "cancellationTimeline", "totalAmount", "moneyStringFormatter", "OnlyNoRefundPolicy", "NoRefundPolicy", "afterDate", "hasFreeCancellation", "StaysCancellationTimelineGuarantee", "checkInDate", "checkInAfterTime", "bookingDate", "checkInDateTime", "VSpace", "timelineItem", "HSpace", "index", "currentColor", "prevColor", "timelineSize", "TimelineItem", "renderTimelineDateTime", "import_jsx_runtime", "FullRefundPolicy", "before", "refundAmount", "currency", "Policy", "getDateString", "moneyStringFormatter", "PartialRefundPolicy", "cancellationTimeline", "totalAmount", "OnlyNoRefundPolicy", "NoRefundPolicy", "afterDate", "StaysCancellationTimelinePayNow", "checkInDate", "checkInAfterTime", "bookingDate", "checkInDateTime", "VSpace", "timelineItem", "HSpace", "index", "currentColor", "prevColor", "timelineSize", "TimelineItem", "renderTimelineDateTime", "import_jsx_runtime", "StaysCancellationTimeline", "paymentType", "props", "WithComponentStyles", "VSpace", "StaysCancellationTimelinePayNow", "StaysCancellationTimelineDeposit", "StaysCancellationTimelineGuarantee", "import_jsx_runtime", "StaysRating", "rating", "small", "WithComponentStyles", "HSpace", "_", "index", "Icon", "LOYALTY_PROGRAMS_NAME_MAP", "SOURCE_NAME_MAP", "getBoardTypeLabel", "boardType", "boardTypeIcon", "import_jsx_runtime", "StaysSummary", "accommodation", "checkInDate", "checkOutDate", "numRooms", "supportedLoyaltyProgramme", "loyaltyProgrammeAccountNumber", "accommodationSpecialRequests", "children", "WithComponentStyles", "VSpace", "HSpace", "Icon", "StaysRating", "boardTypeIcon", "getBoardTypeLabel", "getDateString", "LOYALTY_PROGRAMS_NAME_MAP", "import_jsx_runtime", "amenityIcon", "type", "StaysAmenities", "amenities", "hrefToComponentStyles", "amenity", "HSpace", "Icon", "import_classnames", "getRateLabel", "paymentMethod", "paymentType", "import_classnames", "import_jsx_runtime", "RadioButton", "value", "checked", "className", "inputId", "HSpace", "classNames", "Icon", "import_jsx_runtime", "StaysRoomRateCard", "numberOfNights", "searchNumberOfRooms", "rate", "selected", "onSelectRate", "hidePaymentMethod", "hideSource", "earliestCancellation", "quantityOfRoomsAvailable", "WithComponentStyles", "classNames", "VSpace", "HSpace", "StayResultRoomRateItem", "boardTypeIcon", "getBoardTypeLabel", "getDateString", "moneyStringFormatter", "paymentMethod", "getRateLabel", "LOYALTY_PROGRAMS_NAME_MAP", "SOURCE_NAME_MAP", "withPlural", "RadioButton", "icon", "label", "Icon", "import_classnames", "React", "React", "import_jsx_runtime", "hasManualOverride", "getFallbackLogoUrl", "iataCode", "getSrcForIataCode", "airlineName", "captureErrorInSentry", "AirlineLogo", "name", "size", "src", "setSrc", "import_classnames", "import_react", "import_jsx_runtime", "FilterControl", "target", "children", "disabled", "popoverWidth", "popoverMaxHeigh", "targetWidth", "isPopoverOpen", "setIsPopoverOpen", "React", "closePopover", "Icon", "FilterControlOption", "className", "isSelected", "onClick", "onKeyDown", "onDoubleClick", "classNames", "import_jsx_runtime", "isOptionSelected", "airline", "selectedAirlines", "selectedAirline", "getSelectLabel", "selected", "options", "iata_code", "removeFromSelected", "option", "addToSelected", "AirlineSelector", "onChange", "disabled", "targetLabel", "FilterControl", "onClose", "index", "isSelected", "Option", "newState", "e", "name", "onClick", "onKeyDown", "onDoubleClick", "FilterControlOption", "AirlineLogo", "import_jsx_runtime", "OPTIONS", "getLabel", "stopsOption", "StopsSelector", "selected", "onChange", "FilterControl", "onClose", "option", "index", "FilterControlOption", "e", "_typeof", "o", "toPrimitive", "t", "r", "_typeof", "e", "i", "toPropertyKey", "t", "i", "toPrimitive", "_typeof", "_defineProperty", "r", "t", "toPropertyKey", "ownKeys", "r", "t", "o", "_objectSpread2", "_defineProperty", "_arrayLikeToArray", "r", "a", "e", "_arrayWithoutHoles", "r", "_arrayLikeToArray", "_iterableToArray", "r", "_unsupportedIterableToArray", "r", "a", "_arrayLikeToArray", "t", "_nonIterableSpread", "_toConsumableArray", "r", "_arrayWithoutHoles", "_iterableToArray", "_unsupportedIterableToArray", "_nonIterableSpread", "_arrayWithHoles", "r", "_iterableToArrayLimit", "r", "l", "t", "e", "n", "i", "u", "a", "f", "o", "_nonIterableRest", "_slicedToArray", "r", "e", "_arrayWithHoles", "_iterableToArrayLimit", "_unsupportedIterableToArray", "_nonIterableRest", "import_classnames", "React", "useEvent", "callback", "fnRef", "memoFn", "_fnRef$current", "_len", "args", "_key", "React", "canUseDom", "useInternalLayoutEffect", "canUseDom", "useLayoutEffect", "callback", "deps", "firstMountRef", "useLayoutUpdateEffect", "firstMount", "React", "useSafeState", "defaultValue", "destroyRef", "_React$useState", "_React$useState2", "_slicedToArray", "value", "setValue", "safeSetState", "updater", "ignoreDestroy", "hasValue", "value", "useMergedState", "defaultStateValue", "option", "_ref", "defaultValue", "onChange", "postState", "_useState", "useSafeState", "_useState2", "_slicedToArray", "innerValue", "setInnerValue", "mergedValue", "postMergedValue", "onChangeFn", "useEvent", "_useState3", "_useState4", "prevValue", "setPrevValue", "useLayoutUpdateEffect", "prev", "triggerChange", "updater", "ignoreDestroy", "warned", "preWarningFns", "preMessage", "fn", "warning", "valid", "message", "finalMessage", "note", "resetWarned", "call", "method", "warningOnce", "noteOnce", "warning_default", "isEqual", "obj1", "obj2", "shallow", "refSet", "deepEqual", "b", "level", "circular", "warning_default", "newLevel", "i", "_typeof", "keys", "key", "isEqual_default", "React", "_extends", "n", "e", "t", "r", "_objectWithoutPropertiesLoose", "r", "e", "t", "_objectWithoutProperties", "o", "r", "i", "_objectWithoutPropertiesLoose", "n", "React", "getOffset", "value", "min", "max", "getDirectionStyle", "direction", "offset", "positionStyle", "getIndex", "index", "import_classnames", "KeyCode", "e", "keyCode", "KeyCode_default", "React", "React", "SliderContext", "context_default", "_excluded", "Handle", "props", "ref", "prefixCls", "value", "valueIndex", "onStartMove", "style", "render", "dragging", "onOffsetChange", "onChangeComplete", "onFocus", "onMouseEnter", "restProps", "_objectWithoutProperties", "_React$useContext", "context_default", "min", "max", "direction", "disabled", "keyboard", "range", "tabIndex", "ariaLabelForHandle", "ariaLabelledByForHandle", "ariaValueTextFormatterForHandle", "styles", "classNames", "handlePrefixCls", "onInternalStartMove", "e", "onInternalFocus", "onInternalMouseEnter", "onKeyDown", "offset", "KeyCode_default", "handleKeyUp", "positionStyle", "getDirectionStyle", "divProps", "_getIndex", "getIndex", "handleNode", "_extends", "cls", "_defineProperty", "_objectSpread2", "Handle_default", "_excluded", "Handles", "props", "ref", "prefixCls", "style", "onStartMove", "onOffsetChange", "values", "handleRender", "activeHandleRender", "draggingIndex", "onFocus", "restProps", "_objectWithoutProperties", "handlesRef", "index", "_handlesRef$current$i", "_React$useState", "_React$useState2", "_slicedToArray", "activeIndex", "setActiveIndex", "onHandleFocus", "e", "onHandleMouseEnter", "handleProps", "_objectSpread2", "value", "Handle_default", "_extends", "node", "getIndex", "Handles_default", "React", "import_classnames", "React", "Mark", "props", "prefixCls", "style", "children", "value", "_onClick", "_React$useContext", "context_default", "min", "max", "direction", "includedStart", "includedEnd", "included", "textCls", "positionStyle", "getDirectionStyle", "classNames", "_defineProperty", "_objectSpread2", "e", "Mark_default", "Marks", "props", "prefixCls", "marks", "onClick", "markPrefixCls", "_ref", "value", "style", "label", "Mark_default", "Marks_default", "React", "import_classnames", "React", "Dot", "props", "prefixCls", "value", "style", "activeStyle", "_React$useContext", "context_default", "min", "max", "direction", "included", "includedStart", "includedEnd", "dotClassName", "active", "mergedStyle", "_objectSpread2", "getDirectionStyle", "classNames", "_defineProperty", "Dot_default", "Steps", "props", "prefixCls", "marks", "dots", "style", "activeStyle", "_React$useContext", "context_default", "min", "max", "step", "stepDots", "dotSet", "mark", "current", "dotValue", "Dot_default", "Steps_default", "import_classnames", "React", "import_classnames", "React", "Track", "props", "prefixCls", "style", "start", "end", "index", "onStartMove", "replaceCls", "_React$useContext", "context_default", "direction", "min", "max", "disabled", "range", "classNames", "trackPrefixCls", "offsetStart", "getOffset", "offsetEnd", "onInternalStartMove", "e", "positionStyle", "className", "cls", "_defineProperty", "_objectSpread2", "Track_default", "Tracks", "props", "prefixCls", "style", "values", "startPoint", "onStartMove", "_React$useContext", "context_default", "included", "range", "min", "styles", "classNames", "trackList", "startValue", "endValue", "list", "i", "tracksNode", "Track_default", "cls", "_ref", "index", "start", "end", "_objectSpread2", "getIndex", "Tracks_default", "import_react", "import_react_is", "React", "React", "getPosition", "obj", "useDrag", "containerRef", "direction", "rawValues", "min", "max", "formatValue", "triggerChange", "finishChange", "offsetValues", "_React$useState", "_React$useState2", "_slicedToArray", "draggingValue", "setDraggingValue", "_React$useState3", "_React$useState4", "draggingIndex", "setDraggingIndex", "_React$useState5", "_React$useState6", "cacheValues", "setCacheValues", "_React$useState7", "_React$useState8", "originValues", "setOriginValues", "mouseMoveEventRef", "mouseUpEventRef", "flushValues", "nextValues", "nextValue", "val", "i", "updateCacheValue", "useEvent", "valueIndex", "offsetPercent", "startValue", "endValue", "maxStartOffset", "maxEndOffset", "offset", "formatStartValue", "cloneCacheValues", "offsetDist", "cloneValues", "_toConsumableArray", "next", "onStartMove", "e", "startValues", "initialValues", "originValue", "_getPosition", "startX", "startY", "onMouseMove", "event", "_getPosition2", "moveX", "moveY", "offsetX", "offsetY", "_containerRef$current", "width", "height", "offSetPercent", "onMouseUp", "returnValues", "sourceValues", "a", "b", "targetValues", "index", "useDrag_default", "React", "useOffset", "min", "max", "step", "markList", "allowCross", "pushable", "formatRangeValue", "val", "formatStepValue", "stepValue", "getDecimal", "num", "maxDecimal", "fixedValue", "formatValue", "formatNextValue", "alignValues", "mark", "closeValue", "closeDist", "alignValue", "dist", "offsetValue", "values", "offset", "valueIndex", "mode", "nextValue", "originValue", "targetDistValue", "potentialValues", "sign", "compareValue", "valueDist", "potentialValue", "cloneValues", "_toConsumableArray", "offsetChangedValue", "needPush", "offsetValues", "nextValues", "pushNum", "i", "changed", "_offsetChangedValue", "_i", "_changed", "_offsetChangedValue2", "_i2", "_changed2", "_offsetChangedValue3", "_i3", "_changed3", "_offsetChangedValue4", "Slider", "props", "ref", "_props$prefixCls", "prefixCls", "className", "style", "classNames", "styles", "_props$disabled", "disabled", "_props$keyboard", "keyboard", "autoFocus", "onFocus", "onBlur", "_props$min", "min", "_props$max", "max", "_props$step", "step", "value", "defaultValue", "range", "count", "onChange", "onBeforeChange", "onAfterChange", "onChangeComplete", "_props$allowCross", "allowCross", "_props$pushable", "pushable", "draggableTrack", "reverse", "vertical", "_props$included", "included", "startPoint", "trackStyle", "handleStyle", "railStyle", "dotStyle", "activeDotStyle", "marks", "dots", "handleRender", "activeHandleRender", "_props$tabIndex", "tabIndex", "ariaLabelForHandle", "ariaLabelledByForHandle", "ariaValueTextFormatterForHandle", "handlesRef", "containerRef", "direction", "mergedMin", "mergedMax", "mergedStep", "mergedPush", "markList", "key", "mark", "markObj", "_typeof", "_ref", "label", "a", "b", "_useOffset", "useOffset", "_useOffset2", "_slicedToArray", "formatValue", "offsetValues", "_useMergedState", "useMergedState", "_useMergedState2", "mergedValue", "setValue", "rawValues", "valueList", "_valueList", "_valueList$", "val0", "returnValues", "_toConsumableArray", "pointCount", "_returnValues", "val", "index", "rawValuesRef", "getTriggerValue", "triggerValues", "triggerChange", "nextValues", "cloneNextValues", "isEqual_default", "finishChange", "finishValue", "warning_default", "_useDrag", "useDrag_default", "_useDrag2", "draggingIndex", "draggingValue", "cacheValues", "onStartDrag", "changeToCloseValue", "newValue", "e", "valueIndex", "valueDist", "dist", "_document$activeEleme", "_document$activeEleme2", "onSliderMouseDown", "_containerRef$current", "width", "height", "left", "top", "bottom", "right", "clientX", "clientY", "percent", "nextValue", "_React$useState", "_React$useState2", "keyboardValue", "setKeyboardValue", "onHandleOffsetChange", "offset", "next", "mergedDraggableTrack", "onStartMove", "dragging", "sortedCacheValues", "_React$useMemo", "_React$useMemo2", "includedStart", "includedEnd", "_containerRef$current2", "_document", "activeElement", "context", "context_default", "cls", "_defineProperty", "_objectSpread2", "Tracks_default", "Steps_default", "Handles_default", "Marks_default", "Slider_default", "es_default", "Slider_default", "import_jsx_runtime", "targetLabelConectors", "getTargetLabel", "selectedRange", "departureStart", "departureEnd", "isDepartureChanged", "arrivalStart", "arrivalEnd", "isArrivalChanged", "getSliderLabel", "sliderMarks", "marks", "minutes", "transformMinutesToTimeString", "prefix", "range", "connectors", "start", "end", "hours", "mins", "hoursString", "minsString", "TimeRangeSelector", "selected", "onChange", "FilterControl", "es_default", "value", "import_jsx_runtime", "FilterControls", "selectedOwner", "airlines", "airlinesFilter", "setAirlinesFilter", "timesFilter", "setTimesFilter", "stopsFilter", "setStopsFilter", "AirlineSelector", "StopsSelector", "TimeRangeSelector", "import_jsx_runtime", "SliceCarriersTitle", "slice", "marketingCarriers", "marketing_carrier", "operatingCarriers", "operating_carrier", "firstMarketingCarrier", "marketingCarrierNamesSet", "name", "operatingCarrierNamesSet", "marketingCarriersLabel", "operatingCarriersLabel", "isPartialOperarion", "HSpace", "AirlineLogo", "segment", "getSegmentCarriersTitle", "marketingCarrier", "operatingCarrier", "isOperatedByMarketingCarrier", "import_classnames", "React", "NGS_SHELVES", "NGS_SHELF_INFO", "deduplicateMappedOffersByFareBrand", "offersMap", "sliceIndex", "sliceKey", "row", "deduplicatedRow", "NGS_SHELVES", "shelf", "groupByFareBrandName", "offers", "getCheapestOffer", "getFareBrandNameForOffer", "offer", "cabinClasses", "segment", "passenger", "c", "groupedResult", "previous", "current", "key", "getNGSSliceKey", "slice", "ownerId", "includeFareBrand", "flightNumbers", "segment", "filterOffersThatMatchCurrentSlice", "offers", "previousSliceKeys", "filteredOffers", "offer", "match", "index", "sliceKey", "groupOffersForNGSView", "sliceIndex", "offersMap", "deduplicateMappedOffersByFareBrand", "iso8601DurationRegex", "isISO8601Duration", "durationString", "convertDurationToString", "duration", "matches", "isISO8601Duration", "daysString", "hoursString", "minutesString", "getTimeString", "original", "locale", "date", "import_classnames", "import_react", "import_jsx_runtime", "SliceSummary", "slice", "firstSegment", "lastSegment", "segmentsAndStops", "segment", "index", "stops", "stop", "SliceSummaryTimeAndPlace", "getTimeString", "SliceStopsAndDurationOverview", "convertDurationToString", "Icon", "time", "place", "alignment", "classNames", "duration", "_value", "all", "React", "withPlural", "MS", "MS_PER_MINUTE", "MS_PER_HOUR", "MS_PER_DAY", "getDurationString", "start", "end", "format", "startDate", "prefix", "endDate", "temp", "diff", "days", "hours", "minutes", "daysString", "hoursString", "minutesString", "suffix", "import_classnames", "import_jsx_runtime", "OfferSlice", "slice", "firstSegment", "lastSegment", "startDate", "getDateString", "endDate", "endsOnDifferentDate", "OfferSliceRow", "segment", "index", "isLast", "getTimeString", "convertDurationToString", "getSegmentCarriersTitle", "withPlural", "stop", "getDurationString", "time", "icon", "withGreyBackground", "compact", "dottedLine", "compactCallout", "children", "classNames", "Icon", "import_jsx_runtime", "OfferSliceModal", "slice", "modalProps", "Modal", "ModalBody", "VSpace", "SliceCarriersTitle", "SliceSummary", "OfferSlice", "import_classnames", "import_jsx_runtime", "NGSShelfInfoCard", "ngs_shelf", "className", "shelfInfo", "NGS_SHELF_INFO", "classNames", "Icon", "import_classnames", "doesSliceHaveMixedCabins", "slice", "cabinMarketingNames", "segment", "doOffersHaveMixedCabin", "offer", "sliceIndex", "getBaggagesQuantity", "baggages", "type", "baggage", "quantity", "getMaxBaggagesForOfferSlice", "offerSlice", "maxBaggages", "maxBaggagesQuantity", "segment", "passenger", "import_jsx_runtime", "NGSSliceFareCard", "offer", "sliceIndex", "onSelect", "className", "slice", "shelfInfo", "NGS_SHELF_INFO", "brandName", "getFareBrandNameForOffer", "changeBeforeDepartureCondition", "refundBeforeDepartureCondition", "checkedBagItems", "getMaxBaggagesForOfferSlice", "carryOnBagItems", "classNames", "doesSliceHaveMixedCabins", "Icon", "segment", "index", "moneyStringFormatter", "Button", "getCheapestOfferAmount", "offers", "offer", "sortNGSRowsByShelfPrice", "rows", "sortShelf", "sortDirection", "a", "b", "aAmount", "bAmount", "import_jsx_runtime", "NGSTable", "offers", "sliceIndex", "onSelect", "previousSliceKeys", "sortingFunction", "selectedColumn", "setSelectedColumn", "expandedOffer", "setExpandedOffer", "isOfferSliceModalOpen", "setIsOfferSliceModalOpen", "offerSliceModalSlice", "setOfferSliceModalSlice", "rows", "groupOffersForNGSView", "sortedRows", "NonIdealState", "tripType", "NGS_SHELVES", "shelf", "classNames", "Icon", "NGS_SHELF_INFO", "NGSShelfInfoCard", "row", "index", "SliceCarriersTitle", "SliceSummary", "getFareBrandNameForOffer", "getCheapestOffer", "moneyStringFormatter", "getCheapestOfferAmount", "doOffersHaveMixedCabin", "offer", "NGSSliceFareCard", "getNGSSliceKey", "OfferSliceModal", "import_duration_fns", "sortNGSRowsByDuration", "rows", "sortDirection", "aRow", "bRow", "aParsedDuration", "bParsedDuration", "aDurationInMinutes", "bDurationInMinutes", "import_react", "filterResults", "offers", "currentSliceIndex", "filters", "offer", "currentOfferSlice", "isMatchOnAirlines", "isMatchOnStops", "isMatchOnTimes", "isTrue", "airlines", "airline", "stops", "sliceStops", "stopCount", "segment", "times", "firstSegment", "lastSegment", "sliceDepartureTime", "sliceArrivalTime", "departureRangeStart", "departureRangeEnd", "arrivalRangeStart", "arrivalRangeEnd", "sliceDepartureTimeInMinutes", "transformDateToMinutes", "sliceArrivalTimeInMinutes", "date", "getAirlines", "offerRequest", "airlines", "insertedAirlines", "offer", "owner", "a", "b", "getInitialFilterValues", "offerRequest", "getAirlines", "useFilters", "offerRequest", "selectedSliceKeys", "initialFilterValues", "getInitialFilterValues", "airlinesFilter", "setAirlinesFilter", "timesFilter", "setTimesFilter", "stopsFilter", "setStopsFilter", "clearFilters", "filteredOffers", "filterResults", "import_jsx_runtime", "OPTIONS", "OPTION_KEYS", "getLabel", "stopsOption", "SortingControl", "selected", "onChange", "FilterControl", "onClose", "option", "index", "FilterControlOption", "e", "import_duration_fns", "getAmountForRecommendedSort", "row", "getCheapestOfferAmount", "sortNGSRowsByRecommended", "rows", "aRow", "bRow", "aParsedDuration", "bParsedDuration", "aDurationInMinutes", "bDurationInMinutes", "aCheapestOfferAmount", "bCheapestOfferAmount", "aProduct", "bProduct", "import_jsx_runtime", "getSortShelfAndDirection", "sortOption", "shelf", "direction", "getDurationSortDirection", "useSort", "setSortOption", "sortingFunction", "rows", "sortNGSRowsByRecommended", "sortNGSRowsByDuration", "sortNGSRowsByShelfPrice", "DuffelNGSView", "offerRequest", "onSelect", "selectedSliceKeys", "setSelectedSliceKeys", "selectedOwner", "setSelectedOwner", "selectedColumn", "setSelectedColumn", "airlinesFilterOptions", "airlinesFilter", "timesFilter", "stopsFilter", "setAirlinesFilter", "setTimesFilter", "setStopsFilter", "clearFilters", "filteredOffers", "useFilters", "numSlices", "currentSlice", "NonIdealState", "WithComponentStyles", "slice", "index", "classNames", "newSliceKeys", "Icon", "getDateString", "FilterControls", "SortingControl", "sortingOption", "NGSTable", "offerId", "sliceKey", "offer", "React", "getIFrameEventListener", "iFrameURL", "postMessageWithStyles", "setIFrameHeight", "onValidateSuccess", "onValidateFailure", "onCreateCardForTemporaryUseSuccess", "onCreateCardForTemporaryUseFailure", "onSaveCardSuccess", "onSaveCardFailure", "onSecurityPolicyViolation", "event", "eventType", "getIFrameOriginForEnvironment", "tokenProxyEnvironment", "origin", "getPathnameForIntent", "intent", "getTokenFromClientKey", "clientKey", "payloadString", "getIframeURL", "tokenProxyEnvironment", "intent", "clientKey", "savedCardData", "iFrameOrigin", "getIFrameOriginForEnvironment", "iframeURL", "getPathnameForIntent", "getTokenFromClientKey", "postMessageToCreateCardForTemporaryUse", "iFrameReference", "baseUrl", "iFrame", "postMessageToSaveCard", "iFrameReference", "baseUrl", "iFrame", "postMessageWithStyles", "iFrameReference", "baseUrl", "styles", "iFrame", "import_jsx_runtime", "DuffelCardForm", "tokenProxyEnvironment", "clientKey", "styles", "intent", "savedCardData", "onValidateSuccess", "onValidateFailure", "onCreateCardForTemporaryUseSuccess", "onCreateCardForTemporaryUseFailure", "onSaveCardSuccess", "onSaveCardFailure", "onSecurityPolicyViolation", "ref", "postMessageToSaveCard", "iFrameReference", "iFrameURL", "postMessageToCreateCardForTemporaryUse", "intentsToUseSavedCard", "defaultIframeHeight", "iFrameHeight", "setIFrameHeight", "isLoading", "setIsLoading", "getIframeURL", "iFrameEventListener", "getIFrameEventListener", "postMessageWithStyles", "height", "import_react", "useDuffelCardFormActions", "ref", "React", "getAPIHeaders", "clientKey", "createClient", "duffelUrl", "create3DSSessionInDuffelAPI", "data", "response", "responseData", "refresh3DSSessionInDuffelAPI", "sessionID", "isFirstAttempt", "initEvervault", "sessionID", "teamID", "appID", "threeDSecure", "SCRIPT_ID", "loadEvervaultScript", "resolve", "script", "DEFAULT_ENVIRONMENT_CONFIGURATION", "TEST_ENVIRONMENT_CONFIGURATION", "GENERIC_ERROR_MESSAGE", "createThreeDSecureSession", "clientKey", "cardId", "resourceId", "services", "cardholderPresent", "exception", "environmentConfiguration", "env", "loadEvervaultScript", "resolve", "reject", "client", "createClient", "threeDSSession", "threeDSecure", "initEvervault", "error", "hasService", "offer", "seatMaps", "service", "hasAvailableSeatService"]
|
|
7
|
-
}
|